diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..b14201bf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,108 @@ +name: GE-CI + +on: + push: + branches: master + paths-ignore: + - 'tools/**' + pull_request: + branches: master + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + buildus: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Install Depedencies + run: | + sudo apt update + sudo apt install binutils-mips-linux-gnu make + + - name: Get US File + env: + FILE_US: ${{ secrets.SECRET_FILE_US }} + run: wget -O baserom.u.z64 $FILE_US + + - name: Extract US Assets + run: ./extract_baserom.u.sh + + - name: Make US + run: make -j VERSION=US + + - name: Make report + run: make -C tools/report + + - name: Stats + run: python3 tools/ge-stats.py --version us --report + #git diff HEAD^ HEAD --name-only + + # expected args + # 1481 15854 12774 232276 564 1312 652 20330 15471 269772 49 336 tools/report/index.html "src/game/bond.c" + + # Replace this with Git push to repo + # but somehow avoid loop + + #- uses: actions/download-artifact@v2 + # with: + # name: my-artifact + # path: tools/report/index.html + - name: Upload output files + + uses: dmnemec/copy_file_to_another_repo_action@v1.0.4 + + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + API_TOKEN_USER: ${{ secrets.API_TOKEN_USER }} + API_TOKEN_EMAIL: ${{ secrets.API_TOKEN_EMAIL }} + + with: + destination_repo: 'kholdfuzion/goldeneyestatus' + user_email: $API_TOKEN_EMAIL + user_name: $API_TOKEN_USER + source_file: | + tools/report/cursor.cur + tools/report/index.html + tools/report/sfx.ogg + tools/report/background.jpg + + buildjp: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Install Depedencies + run: | + sudo apt update + sudo apt install binutils-mips-linux-gnu make + + - name: Get US File + env: + FILE_US: ${{ secrets.SECRET_FILE_US }} + run: wget -O baserom.u.z64 $FILE_US + + - name: Get JP File + env: + FILE_JP: ${{ secrets.SECRET_FILE_JP }} + run: wget -O baserom.j.z64 $FILE_JP + + - name: Extract US Assets + run: ./extract_baserom.u.sh + + - name: Extract JP Assets + run: ./extract_diff.j.sh + + - name: Make JP + run: make -j VERSION=JP + + - name: Stats + run: python3 tools/ge-stats.py --version jp + +#need way of telling report that JAP passed/failed diff --git a/.gitignore b/.gitignore index 7b2aadc1..8cb5fc6d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.rz *.tmp *.z64 +*.o /.vs 021990.bin 0219D0.bin @@ -47,3 +48,6 @@ ge007.j.elf ge007.u.bin ge007.u.elf lib/libultra_rom.a +tools/aaa_rip/aaa_rip +tools/extractor/extractor +notes/ \ No newline at end of file diff --git a/Makefile b/Makefile index 6664be31..6293390c 100644 --- a/Makefile +++ b/Makefile @@ -83,8 +83,10 @@ CODEFILES := $(foreach dir,src,$(wildcard $(dir)/*.c)) CODEOBJECTS := $(foreach file,$(CODEFILES),$(BUILD_DIR)/$(file:.c=.o)) LIBULTRA := lib/libultra_rom.a -ULTRAFILES := $(foreach dir,src/libultra,$(wildcard $(dir)/*.s)) -ULTRAOBJECTS := $(foreach file,$(ULTRAFILES),$(BUILD_DIR)/$(file:.s=.o)) +ULTRAFILES_S := $(foreach dir,src/libultra,$(wildcard $(dir)/*.s)) +ULTRAFILES_C := $(foreach dir,src/libultra,$(wildcard $(dir)/*.c)) +ULTRAOBJECTS := $(foreach file,$(ULTRAFILES_S),$(BUILD_DIR)/$(file:.s=.o)) \ + $(foreach file,$(ULTRAFILES_C),$(BUILD_DIR)/$(file:.c=.o)) GAMEFILES := $(foreach dir,src/game,$(wildcard $(dir)/*.c)) GAMEOBJECTS := $(foreach file,$(GAMEFILES),$(BUILD_DIR)/$(file:.c=.o)) @@ -124,7 +126,8 @@ OBJECTS := $(RSPOBJECTS) $(CODEOBJECTS) $(GAMEOBJECTS) $(RZOBJECTS) $(OBSEGMENT) INCLUDE := -I . -I include -I include/ultra64 -I src -I src/game -I src/inflate CC := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -CFLAGS := -Wo,-loopunroll,0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm $(CFLAGWARNING) -woff 819,820,852,821,838 -signed $(INCLUDE) -mips2 $(LCDEFS) +CFLAGS := 0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm $(CFLAGWARNING) -woff 819,820,852,821,838 -signed $(INCLUDE) -mips2 $(LCDEFS) -DTARGET_N64 +CFLAGS_LIBULTRA := 0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm $(CFLAGWARNING) -woff 819,820,852,821,838 -signed $(INCLUDE) -mips2 $(LCDEFS) -DTARGET_N64 LD := $(TOOLCHAIN)ld LD_SCRIPT := ge007.$(COUNTRYCODE).ld @@ -156,6 +159,9 @@ clean: $(HEADEROBJECTS) $(BOOTOBJECTS) $(CODEOBJECTS) $(GAMEOBJECTS) $(RZOBJECTS) \ $(OBSEG_OBJECTS) $(OBSEG_RZ) $(ROMOBJECTS) $(RAMROM_OBJECTS) $(FONT_OBJECTS) $(MUSIC_OBJECTS) $(IMAGE_OBJS) $(MUSIC_RZ_FILES) $(RSPOBJECTS) +$(BUILD_DIR)/src/libultra/%.o: src/libultra/%.c + $(CC) -c $(CFLAGS_LIBULTRA) -o $@ $< + $(BUILD_DIR)/rsp/%.bin: rsp/*.s $(ARMIPS) -sym $@.sym -strequ CODE_FILE $(BUILD_DIR)/rsp/$*.bin -strequ DATA_FILE $(BUILD_DIR)/rsp/$*_data.bin $< diff --git a/assets/GlobalImageTable.c b/assets/GlobalImageTable.c index 34157965..f1b2e70b 100644 --- a/assets/GlobalImageTable.c +++ b/assets/GlobalImageTable.c @@ -1,7 +1,7 @@ #include "ultra64.h" #include "bondconstants.h" #include "bondtypes.h" -#include +#include "PR/gbi.h" struct sGlobalImageTable GlobalImageTable = { { //globalDL_0x000 diff --git a/assets/images/image_externs.h b/assets/images/image_externs.h index d2a43d33..2c935798 100644 --- a/assets/images/image_externs.h +++ b/assets/images/image_externs.h @@ -1,4 +1,5 @@ //I should be autogenerated by tools +//and have meaningful names given #ifndef _IMAGE_EXTERNS_H_ #define _IMAGE_EXTERNS_H_ #include "ultra64.h" @@ -2702,4 +2703,2706 @@ #define _image2697_size 0x201 #define _image2698_size 0x53D +typedef enum IMAGEIDS { + _image1_ID = 1, + _image2_ID, + _image3_ID, + _image4_ID, + _image5_ID, + _image6_ID, + _image7_ID, + _image8_ID, + _image9_ID, + _image10_ID, + _image11_ID, + _image12_ID, + _image13_ID, + _image14_ID, + _image15_ID, + _image16_ID, + _image17_ID, + _image18_ID, + _image19_ID, + _image20_ID, + _image21_ID, + _image22_ID, + _image23_ID, + _image24_ID, + _image25_ID, + _image26_ID, + _image27_ID, + _image28_ID, + _image29_ID, + _image30_ID, + _image31_ID, + _image32_ID, + _image33_ID, + _image34_ID, + _image35_ID, + _image36_ID, + _image37_ID, + _image38_ID, + _image39_ID, + _image40_ID, + _image41_ID, + _image42_ID, + _image43_ID, + _image44_ID, + _image45_ID, + _image46_ID, + _image47_ID, + _image48_ID, + _image49_ID, + _image50_ID, + _image51_ID, + _image52_ID, + _image53_ID, + _image54_ID, + _image55_ID, + _image56_ID, + _image57_ID, + _image58_ID, + _image59_ID, + _image60_ID, + _image61_ID, + _image62_ID, + _image63_ID, + _image64_ID, + _image65_ID, + _image66_ID, + _image67_ID, + _image68_ID, + _image69_ID, + _image70_ID, + _image71_ID, + _image72_ID, + _image73_ID, + _image74_ID, + _image75_ID, + _image76_ID, + _image77_ID, + _image78_ID, + _image79_ID, + _image80_ID, + _image81_ID, + _image82_ID, + _image83_ID, + _image84_ID, + _image85_ID, + _image86_ID, + _image87_ID, + _image88_ID, + _image89_ID, + _image90_ID, + _image91_ID, + _image92_ID, + _image93_ID, + _image94_ID, + _image95_ID, + _image96_ID, + _image97_ID, + _image98_ID, + _image99_ID, + _image100_ID, + _image101_ID, + _image102_ID, + _image103_ID, + _image104_ID, + _image105_ID, + _image106_ID, + _image107_ID, + _image108_ID, + _image109_ID, + _image110_ID, + _image111_ID, + _image112_ID, + _image113_ID, + _image114_ID, + _image115_ID, + _image116_ID, + _image117_ID, + _image118_ID, + _image119_ID, + _image120_ID, + _image121_ID, + _image122_ID, + _image123_ID, + _image124_ID, + _image125_ID, + _image126_ID, + _image127_ID, + _image128_ID, + _image129_ID, + _image130_ID, + _image131_ID, + _image132_ID, + _image133_ID, + _image134_ID, + _image135_ID, + _image136_ID, + _image137_ID, + _image138_ID, + _image139_ID, + _image140_ID, + _image141_ID, + _image142_ID, + _image143_ID, + _image144_ID, + _image145_ID, + _image146_ID, + _image147_ID, + _image148_ID, + _image149_ID, + _image150_ID, + _image151_ID, + _image152_ID, + _image153_ID, + _image154_ID, + _image155_ID, + _image156_ID, + _image157_ID, + _image158_ID, + _image159_ID, + _image160_ID, + _image161_ID, + _image162_ID, + _image163_ID, + _image164_ID, + _image165_ID, + _image166_ID, + _image167_ID, + _image168_ID, + _image169_ID, + _image170_ID, + _image171_ID, + _image172_ID, + _image173_ID, + _image174_ID, + _image175_ID, + _image176_ID, + _image177_ID, + _image178_ID, + _image179_ID, + _image180_ID, + _image181_ID, + _image182_ID, + _image183_ID, + _image184_ID, + _image185_ID, + _image186_ID, + _image187_ID, + _image188_ID, + _image189_ID, + _image190_ID, + _image191_ID, + _image192_ID, + _image193_ID, + _image194_ID, + _image195_ID, + _image196_ID, + _image197_ID, + _image198_ID, + _image199_ID, + _image200_ID, + _image201_ID_LIGHT, + _image202_ID, + _image203_ID_LIGHT, + _image204_ID, + _image205_ID_LIGHT, + _image206_ID, + _image207_ID, + _image208_ID, + _image209_ID, + _image210_ID, + _image211_ID, + _image212_ID, + _image213_ID, + _image214_ID, + _image215_ID, + _image216_ID, + _image217_ID, + _image218_ID, + _image219_ID, + _image220_ID, + _image221_ID, + _image222_ID, + _image223_ID, + _image224_ID, + _image225_ID, + _image226_ID, + _image227_ID, + _image228_ID, + _image229_ID, + _image230_ID, + _image231_ID, + _image232_ID, + _image233_ID, + _image234_ID, + _image235_ID, + _image236_ID, + _image237_ID, + _image238_ID, + _image239_ID, + _image240_ID, + _image241_ID, + _image242_ID, + _image243_ID, + _image244_ID, + _image245_ID, + _image246_ID, + _image247_ID, + _image248_ID, + _image249_ID, + _image250_ID, + _image251_ID, + _image252_ID_LIGHT, + _image253_ID, + _image254_ID_LIGHT, + _image255_ID_LIGHT, + _image256_ID_LIGHT, + _image257_ID, + _image258_ID, + _image259_ID, + _image260_ID, + _image261_ID, + _image262_ID, + _image263_ID, + _image264_ID, + _image265_ID, + _image266_ID, + _image267_ID, + _image268_ID, + _image269_ID, + _image270_ID, + _image271_ID, + _image272_ID, + _image273_ID, + _image274_ID, + _image275_ID, + _image276_ID, + _image277_ID, + _image278_ID, + _image279_ID, + _image280_ID, + _image281_ID, + _image282_ID, + _image283_ID, + _image284_ID, + _image285_ID, + _image286_ID, + _image287_ID, + _image288_ID, + _image289_ID, + _image290_ID, + _image291_ID, + _image292_ID, + _image293_ID, + _image294_ID, + _image295_ID, + _image296_ID, + _image297_ID, + _image298_ID, + _image299_ID, + _image300_ID, + _image301_ID, + _image302_ID, + _image303_ID, + _image304_ID, + _image305_ID, + _image306_ID, + _image307_ID, + _image308_ID, + _image309_ID, + _image310_ID, + _image311_ID, + _image312_ID, + _image313_ID, + _image314_ID, + _image315_ID, + _image316_ID, + _image317_ID, + _image318_ID, + _image319_ID, + _image320_ID, + _image321_ID, + _image322_ID, + _image323_ID, + _image324_ID, + _image325_ID, + _image326_ID, + _image327_ID, + _image328_ID, + _image329_ID, + _image330_ID, + _image331_ID, + _image332_ID, + _image333_ID, + _image334_ID, + _image335_ID, + _image336_ID, + _image337_ID, + _image338_ID, + _image339_ID, + _image340_ID, + _image341_ID, + _image342_ID, + _image343_ID, + _image344_ID, + _image345_ID, + _image346_ID, + _image347_ID, + _image348_ID, + _image349_ID, + _image350_ID, + _image351_ID, + _image352_ID, + _image353_ID, + _image354_ID, + _image355_ID, + _image356_ID, + _image357_ID, + _image358_ID, + _image359_ID, + _image360_ID, + _image361_ID, + _image362_ID, + _image363_ID, + _image364_ID, + _image365_ID, + _image366_ID, + _image367_ID, + _image368_ID, + _image369_ID, + _image370_ID, + _image371_ID, + _image372_ID, + _image373_ID, + _image374_ID, + _image375_ID, + _image376_ID, + _image377_ID, + _image378_ID, + _image379_ID, + _image380_ID, + _image381_ID, + _image382_ID, + _image383_ID, + _image384_ID, + _image385_ID, + _image386_ID, + _image387_ID, + _image388_ID, + _image389_ID, + _image390_ID, + _image391_ID, + _image392_ID, + _image393_ID, + _image394_ID, + _image395_ID, + _image396_ID, + _image397_ID, + _image398_ID, + _image399_ID, + _image400_ID, + _image401_ID, + _image402_ID, + _image403_ID, + _image404_ID, + _image405_ID, + _image406_ID, + _image407_ID, + _image408_ID, + _image409_ID, + _image410_ID, + _image411_ID, + _image412_ID, + _image413_ID, + _image414_ID, + _image415_ID, + _image416_ID, + _image417_ID, + _image418_ID, + _image419_ID, + _image420_ID, + _image421_ID, + _image422_ID, + _image423_ID, + _image424_ID, + _image425_ID, + _image426_ID, + _image427_ID, + _image428_ID_LIGHT, + _image429_ID, + _image430_ID, + _image431_ID, + _image432_ID, + _image433_ID, + _image434_ID, + _image435_ID, + _image436_ID, + _image437_ID, + _image438_ID, + _image439_ID, + _image440_ID, + _image441_ID, + _image442_ID, + _image443_ID, + _image444_ID, + _image445_ID, + _image446_ID, + _image447_ID, + _image448_ID, + _image449_ID, + _image450_ID, + _image451_ID, + _image452_ID, + _image453_ID, + _image454_ID, + _image455_ID, + _image456_ID, + _image457_ID, + _image458_ID, + _image459_ID, + _image460_ID, + _image461_ID, + _image462_ID, + _image463_ID, + _image464_ID, + _image465_ID, + _image466_ID, + _image467_ID, + _image468_ID, + _image469_ID, + _image470_ID, + _image471_ID, + _image472_ID, + _image473_ID, + _image474_ID, + _image475_ID, + _image476_ID, + _image477_ID, + _image478_ID, + _image479_ID, + _image480_ID, + _image481_ID, + _image482_ID, + _image483_ID, + _image484_ID, + _image485_ID, + _image486_ID, + _image487_ID, + _image488_ID, + _image489_ID, + _image490_ID, + _image491_ID, + _image492_ID, + _image493_ID, + _image494_ID, + _image495_ID, + _image496_ID, + _image497_ID, + _image498_ID, + _image499_ID, + _image500_ID, + _image501_ID, + _image502_ID, + _image503_ID, + _image504_ID, + _image505_ID, + _image506_ID, + _image507_ID, + _image508_ID, + _image509_ID, + _image510_ID, + _image511_ID, + _image512_ID, + _image513_ID, + _image514_ID, + _image515_ID, + _image516_ID, + _image517_ID, + _image518_ID, + _image519_ID, + _image520_ID, + _image521_ID, + _image522_ID, + _image523_ID, + _image524_ID, + _image525_ID, + _image526_ID, + _image527_ID, + _image528_ID, + _image529_ID, + _image530_ID, + _image531_ID, + _image532_ID, + _image533_ID, + _image534_ID, + _image535_ID, + _image536_ID, + _image537_ID, + _image538_ID, + _image539_ID, + _image540_ID, + _image541_ID, + _image542_ID, + _image543_ID, + _image544_ID, + _image545_ID, + _image546_ID, + _image547_ID, + _image548_ID, + _image549_ID, + _image550_ID, + _image551_ID, + _image552_ID, + _image553_ID, + _image554_ID, + _image555_ID, + _image556_ID, + _image557_ID, + _image558_ID, + _image559_ID, + _image560_ID, + _image561_ID, + _image562_ID, + _image563_ID, + _image564_ID, + _image565_ID, + _image566_ID, + _image567_ID, + _image568_ID, + _image569_ID, + _image570_ID, + _image571_ID, + _image572_ID, + _image573_ID, + _image574_ID, + _image575_ID, + _image576_ID, + _image577_ID, + _image578_ID, + _image579_ID, + _image580_ID, + _image581_ID, + _image582_ID, + _image583_ID, + _image584_ID, + _image585_ID, + _image586_ID, + _image587_ID, + _image588_ID, + _image589_ID, + _image590_ID, + _image591_ID, + _image592_ID, + _image593_ID, + _image594_ID, + _image595_ID, + _image596_ID, + _image597_ID, + _image598_ID, + _image599_ID, + _image600_ID, + _image601_ID, + _image602_ID, + _image603_ID, + _image604_ID, + _image605_ID, + _image606_ID, + _image607_ID, + _image608_ID, + _image609_ID, + _image610_ID, + _image611_ID, + _image612_ID, + _image613_ID, + _image614_ID, + _image615_ID, + _image616_ID, + _image617_ID, + _image618_ID, + _image619_ID, + _image620_ID, + _image621_ID, + _image622_ID, + _image623_ID, + _image624_ID, + _image625_ID, + _image626_ID, + _image627_ID, + _image628_ID, + _image629_ID, + _image630_ID, + _image631_ID, + _image632_ID, + _image633_ID, + _image634_ID, + _image635_ID, + _image636_ID, + _image637_ID, + _image638_ID, + _image639_ID, + _image640_ID, + _image641_ID, + _image642_ID, + _image643_ID, + _image644_ID, + _image645_ID, + _image646_ID, + _image647_ID, + _image648_ID, + _image649_ID, + _image650_ID, + _image651_ID, + _image652_ID, + _image653_ID, + _image654_ID, + _image655_ID, + _image656_ID, + _image657_ID, + _image658_ID, + _image659_ID, + _image660_ID, + _image661_ID, + _image662_ID, + _image663_ID, + _image664_ID, + _image665_ID, + _image666_ID, + _image667_ID, + _image668_ID, + _image669_ID, + _image670_ID, + _image671_ID, + _image672_ID, + _image673_ID, + _image674_ID, + _image675_ID, + _image676_ID, + _image677_ID, + _image678_ID, + _image679_ID, + _image680_ID, + _image681_ID, + _image682_ID, + _image683_ID, + _image684_ID, + _image685_ID, + _image686_ID, + _image687_ID, + _image688_ID, + _image689_ID, + _image690_ID, + _image691_ID, + _image692_ID, + _image693_ID, + _image694_ID, + _image695_ID, + _image696_ID, + _image697_ID, + _image698_ID, + _image699_ID, + _image700_ID, + _image701_ID, + _image702_ID, + _image703_ID, + _image704_ID, + _image705_ID, + _image706_ID, + _image707_ID, + _image708_ID, + _image709_ID, + _image710_ID, + _image711_ID, + _image712_ID, + _image713_ID, + _image714_ID, + _image715_ID, + _image716_ID, + _image717_ID, + _image718_ID, + _image719_ID, + _image720_ID, + _image721_ID, + _image722_ID, + _image723_ID, + _image724_ID, + _image725_ID, + _image726_ID, + _image727_ID, + _image728_ID, + _image729_ID, + _image730_ID, + _image731_ID, + _image732_ID, + _image733_ID, + _image734_ID, + _image735_ID, + _image736_ID, + _image737_ID, + _image738_ID, + _image739_ID, + _image740_ID, + _image741_ID, + _image742_ID, + _image743_ID, + _image744_ID, + _image745_ID, + _image746_ID, + _image747_ID, + _image748_ID, + _image749_ID, + _image750_ID, + _image751_ID, + _image752_ID, + _image753_ID, + _image754_ID, + _image755_ID, + _image756_ID, + _image757_ID, + _image758_ID, + _image759_ID, + _image760_ID, + _image761_ID, + _image762_ID, + _image763_ID, + _image764_ID, + _image765_ID, + _image766_ID, + _image767_ID, + _image768_ID, + _image769_ID, + _image770_ID, + _image771_ID, + _image772_ID, + _image773_ID, + _image774_ID, + _image775_ID, + _image776_ID, + _image777_ID, + _image778_ID, + _image779_ID, + _image780_ID, + _image781_ID, + _image782_ID, + _image783_ID, + _image784_ID, + _image785_ID, + _image786_ID, + _image787_ID, + _image788_ID, + _image789_ID, + _image790_ID, + _image791_ID, + _image792_ID, + _image793_ID, + _image794_ID, + _image795_ID, + _image796_ID, + _image797_ID, + _image798_ID, + _image799_ID, + _image800_ID, + _image801_ID, + _image802_ID, + _image803_ID, + _image804_ID, + _image805_ID, + _image806_ID, + _image807_ID, + _image808_ID, + _image809_ID, + _image810_ID, + _image811_ID, + _image812_ID, + _image813_ID, + _image814_ID, + _image815_ID, + _image816_ID, + _image817_ID, + _image818_ID, + _image819_ID, + _image820_ID, + _image821_ID, + _image822_ID, + _image823_ID, + _image824_ID, + _image825_ID, + _image826_ID, + _image827_ID, + _image828_ID, + _image829_ID, + _image830_ID, + _image831_ID, + _image832_ID, + _image833_ID, + _image834_ID, + _image835_ID, + _image836_ID, + _image837_ID, + _image838_ID, + _image839_ID, + _image840_ID, + _image841_ID, + _image842_ID, + _image843_ID, + _image844_ID, + _image845_ID, + _image846_ID, + _image847_ID, + _image848_ID, + _image849_ID, + _image850_ID, + _image851_ID, + _image852_ID, + _image853_ID, + _image854_ID, + _image855_ID, + _image856_ID, + _image857_ID, + _image858_ID, + _image859_ID, + _image860_ID, + _image861_ID, + _image862_ID, + _image863_ID, + _image864_ID, + _image865_ID, + _image866_ID, + _image867_ID, + _image868_ID, + _image869_ID, + _image870_ID, + _image871_ID, + _image872_ID, + _image873_ID, + _image874_ID, + _image875_ID, + _image876_ID, + _image877_ID, + _image878_ID, + _image879_ID, + _image880_ID, + _image881_ID, + _image882_ID, + _image883_ID, + _image884_ID, + _image885_ID, + _image886_ID, + _image887_ID, + _image888_ID, + _image889_ID, + _image890_ID, + _image891_ID, + _image892_ID, + _image893_ID, + _image894_ID, + _image895_ID, + _image896_ID, + _image897_ID, + _image898_ID, + _image899_ID, + _image900_ID, + _image901_ID, + _image902_ID, + _image903_ID, + _image904_ID, + _image905_ID, + _image906_ID, + _image907_ID, + _image908_ID, + _image909_ID, + _image910_ID, + _image911_ID, + _image912_ID, + _image913_ID, + _image914_ID, + _image915_ID, + _image916_ID, + _image917_ID, + _image918_ID, + _image919_ID, + _image920_ID, + _image921_ID, + _image922_ID, + _image923_ID, + _image924_ID, + _image925_ID, + _image926_ID, + _image927_ID, + _image928_ID, + _image929_ID, + _image930_ID, + _image931_ID, + _image932_ID, + _image933_ID, + _image934_ID, + _image935_ID, + _image936_ID, + _image937_ID, + _image938_ID, + _image939_ID, + _image940_ID, + _image941_ID, + _image942_ID, + _image943_ID, + _image944_ID, + _image945_ID, + _image946_ID, + _image947_ID, + _image948_ID, + _image949_ID, + _image950_ID, + _image951_ID, + _image952_ID, + _image953_ID, + _image954_ID, + _image955_ID, + _image956_ID, + _image957_ID, + _image958_ID, + _image959_ID, + _image960_ID, + _image961_ID, + _image962_ID, + _image963_ID, + _image964_ID, + _image965_ID, + _image966_ID, + _image967_ID, + _image968_ID, + _image969_ID, + _image970_ID, + _image971_ID, + _image972_ID, + _image973_ID, + _image974_ID, + _image975_ID, + _image976_ID, + _image977_ID, + _image978_ID, + _image979_ID, + _image980_ID, + _image981_ID, + _image982_ID_LIGHT, + _image983_ID, + _image984_ID, + _image985_ID, + _image986_ID, + _image987_ID, + _image988_ID, + _image989_ID, + _image990_ID, + _image991_ID, + _image992_ID, + _image993_ID, + _image994_ID, + _image995_ID, + _image996_ID, + _image997_ID, + _image998_ID, + _image999_ID, + _image1000_ID, + _image1001_ID, + _image1002_ID, + _image1003_ID, + _image1004_ID, + _image1005_ID, + _image1006_ID, + _image1007_ID, + _image1008_ID, + _image1009_ID, + _image1010_ID, + _image1011_ID, + _image1012_ID, + _image1013_ID, + _image1014_ID, + _image1015_ID, + _image1016_ID, + _image1017_ID, + _image1018_ID, + _image1019_ID, + _image1020_ID, + _image1021_ID, + _image1022_ID, + _image1023_ID, + _image1024_ID, + _image1025_ID, + _image1026_ID, + _image1027_ID, + _image1028_ID, + _image1029_ID, + _image1030_ID, + _image1031_ID, + _image1032_ID, + _image1033_ID, + _image1034_ID, + _image1035_ID, + _image1036_ID, + _image1037_ID, + _image1038_ID, + _image1039_ID, + _image1040_ID, + _image1041_ID, + _image1042_ID, + _image1043_ID, + _image1044_ID, + _image1045_ID, + _image1046_ID, + _image1047_ID, + _image1048_ID, + _image1049_ID, + _image1050_ID, + _image1051_ID, + _image1052_ID, + _image1053_ID, + _image1054_ID, + _image1055_ID, + _image1056_ID, + _image1057_ID, + _image1058_ID, + _image1059_ID, + _image1060_ID, + _image1061_ID, + _image1062_ID, + _image1063_ID, + _image1064_ID, + _image1065_ID, + _image1066_ID, + _image1067_ID, + _image1068_ID, + _image1069_ID, + _image1070_ID, + _image1071_ID, + _image1072_ID, + _image1073_ID, + _image1074_ID, + _image1075_ID, + _image1076_ID, + _image1077_ID, + _image1078_ID, + _image1079_ID, + _image1080_ID, + _image1081_ID, + _image1082_ID, + _image1083_ID, + _image1084_ID, + _image1085_ID, + _image1086_ID, + _image1087_ID, + _image1088_ID, + _image1089_ID, + _image1090_ID, + _image1091_ID, + _image1092_ID, + _image1093_ID, + _image1094_ID, + _image1095_ID, + _image1096_ID, + _image1097_ID, + _image1098_ID, + _image1099_ID, + _image1100_ID, + _image1101_ID, + _image1102_ID, + _image1103_ID, + _image1104_ID, + _image1105_ID, + _image1106_ID, + _image1107_ID, + _image1108_ID, + _image1109_ID, + _image1110_ID, + _image1111_ID, + _image1112_ID, + _image1113_ID, + _image1114_ID, + _image1115_ID, + _image1116_ID, + _image1117_ID, + _image1118_ID, + _image1119_ID, + _image1120_ID, + _image1121_ID, + _image1122_ID, + _image1123_ID, + _image1124_ID, + _image1125_ID, + _image1126_ID, + _image1127_ID, + _image1128_ID, + _image1129_ID, + _image1130_ID, + _image1131_ID, + _image1132_ID, + _image1133_ID, + _image1134_ID, + _image1135_ID, + _image1136_ID, + _image1137_ID, + _image1138_ID, + _image1139_ID, + _image1140_ID, + _image1141_ID, + _image1142_ID, + _image1143_ID, + _image1144_ID, + _image1145_ID, + _image1146_ID, + _image1147_ID, + _image1148_ID, + _image1149_ID, + _image1150_ID, + _image1151_ID, + _image1152_ID, + _image1153_ID, + _image1154_ID, + _image1155_ID, + _image1156_ID, + _image1157_ID, + _image1158_ID, + _image1159_ID, + _image1160_ID, + _image1161_ID, + _image1162_ID, + _image1163_ID, + _image1164_ID, + _image1165_ID, + _image1166_ID, + _image1167_ID, + _image1168_ID, + _image1169_ID, + _image1170_ID, + _image1171_ID, + _image1172_ID, + _image1173_ID, + _image1174_ID, + _image1175_ID, + _image1176_ID, + _image1177_ID, + _image1178_ID, + _image1179_ID, + _image1180_ID, + _image1181_ID, + _image1182_ID, + _image1183_ID, + _image1184_ID, + _image1185_ID, + _image1186_ID, + _image1187_ID, + _image1188_ID, + _image1189_ID, + _image1190_ID, + _image1191_ID, + _image1192_ID, + _image1193_ID, + _image1194_ID, + _image1195_ID, + _image1196_ID, + _image1197_ID, + _image1198_ID, + _image1199_ID, + _image1200_ID, + _image1201_ID, + _image1202_ID, + _image1203_ID, + _image1204_ID, + _image1205_ID, + _image1206_ID, + _image1207_ID, + _image1208_ID, + _image1209_ID, + _image1210_ID, + _image1211_ID, + _image1212_ID, + _image1213_ID, + _image1214_ID, + _image1215_ID, + _image1216_ID, + _image1217_ID, + _image1218_ID, + _image1219_ID, + _image1220_ID, + _image1221_ID, + _image1222_ID, + _image1223_ID, + _image1224_ID, + _image1225_ID, + _image1226_ID, + _image1227_ID, + _image1228_ID, + _image1229_ID, + _image1230_ID, + _image1231_ID, + _image1232_ID, + _image1233_ID, + _image1234_ID, + _image1235_ID, + _image1236_ID, + _image1237_ID, + _image1238_ID, + _image1239_ID, + _image1240_ID, + _image1241_ID, + _image1242_ID, + _image1243_ID, + _image1244_ID, + _image1245_ID, + _image1246_ID, + _image1247_ID, + _image1248_ID, + _image1249_ID, + _image1250_ID, + _image1251_ID, + _image1252_ID, + _image1253_ID, + _image1254_ID, + _image1255_ID, + _image1256_ID, + _image1257_ID, + _image1258_ID, + _image1259_ID, + _image1260_ID, + _image1261_ID, + _image1262_ID, + _image1263_ID, + _image1264_ID, + _image1265_ID, + _image1266_ID, + _image1267_ID, + _image1268_ID, + _image1269_ID, + _image1270_ID, + _image1271_ID, + _image1272_ID, + _image1273_ID, + _image1274_ID, + _image1275_ID, + _image1276_ID, + _image1277_ID, + _image1278_ID, + _image1279_ID, + _image1280_ID, + _image1281_ID, + _image1282_ID, + _image1283_ID, + _image1284_ID, + _image1285_ID, + _image1286_ID, + _image1287_ID, + _image1288_ID, + _image1289_ID, + _image1290_ID, + _image1291_ID, + _image1292_ID, + _image1293_ID, + _image1294_ID, + _image1295_ID, + _image1296_ID, + _image1297_ID, + _image1298_ID, + _image1299_ID, + _image1300_ID, + _image1301_ID, + _image1302_ID, + _image1303_ID, + _image1304_ID, + _image1305_ID, + _image1306_ID, + _image1307_ID, + _image1308_ID, + _image1309_ID, + _image1310_ID, + _image1311_ID, + _image1312_ID, + _image1313_ID, + _image1314_ID, + _image1315_ID, + _image1316_ID, + _image1317_ID, + _image1318_ID, + _image1319_ID, + _image1320_ID, + _image1321_ID, + _image1322_ID, + _image1323_ID, + _image1324_ID, + _image1325_ID, + _image1326_ID, + _image1327_ID, + _image1328_ID, + _image1329_ID, + _image1330_ID, + _image1331_ID, + _image1332_ID, + _image1333_ID, + _image1334_ID, + _image1335_ID, + _image1336_ID, + _image1337_ID, + _image1338_ID, + _image1339_ID, + _image1340_ID, + _image1341_ID, + _image1342_ID, + _image1343_ID, + _image1344_ID, + _image1345_ID, + _image1346_ID, + _image1347_ID, + _image1348_ID, + _image1349_ID, + _image1350_ID, + _image1351_ID, + _image1352_ID, + _image1353_ID, + _image1354_ID, + _image1355_ID, + _image1356_ID, + _image1357_ID, + _image1358_ID, + _image1359_ID, + _image1360_ID, + _image1361_ID, + _image1362_ID, + _image1363_ID, + _image1364_ID, + _image1365_ID, + _image1366_ID, + _image1367_ID, + _image1368_ID, + _image1369_ID, + _image1370_ID, + _image1371_ID, + _image1372_ID, + _image1373_ID, + _image1374_ID, + _image1375_ID, + _image1376_ID, + _image1377_ID, + _image1378_ID, + _image1379_ID, + _image1380_ID, + _image1381_ID, + _image1382_ID, + _image1383_ID_LIGHT, + _image1384_ID, + _image1385_ID, + _image1386_ID, + _image1387_ID, + _image1388_ID, + _image1389_ID, + _image1390_ID, + _image1391_ID, + _image1392_ID, + _image1393_ID, + _image1394_ID, + _image1395_ID, + _image1396_ID, + _image1397_ID, + _image1398_ID, + _image1399_ID, + _image1400_ID, + _image1401_ID, + _image1402_ID, + _image1403_ID, + _image1404_ID, + _image1405_ID, + _image1406_ID, + _image1407_ID, + _image1408_ID, + _image1409_ID, + _image1410_ID, + _image1411_ID, + _image1412_ID, + _image1413_ID, + _image1414_ID, + _image1415_ID, + _image1416_ID, + _image1417_ID, + _image1418_ID, + _image1419_ID, + _image1420_ID, + _image1421_ID, + _image1422_ID, + _image1423_ID, + _image1424_ID, + _image1425_ID, + _image1426_ID, + _image1427_ID, + _image1428_ID, + _image1429_ID, + _image1430_ID, + _image1431_ID, + _image1432_ID, + _image1433_ID, + _image1434_ID, + _image1435_ID, + _image1436_ID, + _image1437_ID, + _image1438_ID, + _image1439_ID, + _image1440_ID, + _image1441_ID, + _image1442_ID, + _image1443_ID, + _image1444_ID, + _image1445_ID, + _image1446_ID, + _image1447_ID, + _image1448_ID, + _image1449_ID, + _image1450_ID, + _image1451_ID, + _image1452_ID, + _image1453_ID, + _image1454_ID, + _image1455_ID, + _image1456_ID, + _image1457_ID, + _image1458_ID, + _image1459_ID, + _image1460_ID, + _image1461_ID, + _image1462_ID, + _image1463_ID, + _image1464_ID, + _image1465_ID, + _image1466_ID, + _image1467_ID, + _image1468_ID, + _image1469_ID, + _image1470_ID, + _image1471_ID, + _image1472_ID, + _image1473_ID, + _image1474_ID, + _image1475_ID, + _image1476_ID, + _image1477_ID, + _image1478_ID, + _image1479_ID, + _image1480_ID, + _image1481_ID, + _image1482_ID, + _image1483_ID, + _image1484_ID, + _image1485_ID, + _image1486_ID, + _image1487_ID, + _image1488_ID, + _image1489_ID, + _image1490_ID, + _image1491_ID, + _image1492_ID, + _image1493_ID, + _image1494_ID, + _image1495_ID, + _image1496_ID, + _image1497_ID, + _image1498_ID, + _image1499_ID, + _image1500_ID, + _image1501_ID, + _image1502_ID, + _image1503_ID, + _image1504_ID, + _image1505_ID, + _image1506_ID, + _image1507_ID, + _image1508_ID, + _image1509_ID, + _image1510_ID, + _image1511_ID, + _image1512_ID, + _image1513_ID, + _image1514_ID, + _image1515_ID, + _image1516_ID, + _image1517_ID, + _image1518_ID, + _image1519_ID, + _image1520_ID, + _image1521_ID, + _image1522_ID, + _image1523_ID, + _image1524_ID, + _image1525_ID, + _image1526_ID, + _image1527_ID, + _image1528_ID, + _image1529_ID, + _image1530_ID, + _image1531_ID, + _image1532_ID, + _image1533_ID, + _image1534_ID, + _image1535_ID, + _image1536_ID, + _image1537_ID, + _image1538_ID, + _image1539_ID, + _image1540_ID, + _image1541_ID, + _image1542_ID, + _image1543_ID, + _image1544_ID, + _image1545_ID, + _image1546_ID, + _image1547_ID, + _image1548_ID, + _image1549_ID, + _image1550_ID, + _image1551_ID, + _image1552_ID, + _image1553_ID, + _image1554_ID, + _image1555_ID, + _image1556_ID, + _image1557_ID, + _image1558_ID, + _image1559_ID, + _image1560_ID, + _image1561_ID, + _image1562_ID, + _image1563_ID, + _image1564_ID, + _image1565_ID, + _image1566_ID, + _image1567_ID, + _image1568_ID, + _image1569_ID, + _image1570_ID, + _image1571_ID, + _image1572_ID, + _image1573_ID, + _image1574_ID, + _image1575_ID, + _image1576_ID, + _image1577_ID, + _image1578_ID, + _image1579_ID, + _image1580_ID, + _image1581_ID, + _image1582_ID, + _image1583_ID, + _image1584_ID, + _image1585_ID, + _image1586_ID, + _image1587_ID, + _image1588_ID, + _image1589_ID, + _image1590_ID, + _image1591_ID, + _image1592_ID, + _image1593_ID, + _image1594_ID, + _image1595_ID, + _image1596_ID, + _image1597_ID, + _image1598_ID, + _image1599_ID, + _image1600_ID, + _image1601_ID, + _image1602_ID, + _image1603_ID, + _image1604_ID, + _image1605_ID, + _image1606_ID, + _image1607_ID, + _image1608_ID, + _image1609_ID, + _image1610_ID, + _image1611_ID, + _image1612_ID, + _image1613_ID, + _image1614_ID, + _image1615_ID, + _image1616_ID, + _image1617_ID, + _image1618_ID, + _image1619_ID, + _image1620_ID, + _image1621_ID, + _image1622_ID, + _image1623_ID, + _image1624_ID, + _image1625_ID, + _image1626_ID, + _image1627_ID, + _image1628_ID, + _image1629_ID, + _image1630_ID, + _image1631_ID, + _image1632_ID, + _image1633_ID, + _image1634_ID, + _image1635_ID, + _image1636_ID, + _image1637_ID, + _image1638_ID, + _image1639_ID, + _image1640_ID, + _image1641_ID, + _image1642_ID, + _image1643_ID, + _image1644_ID, + _image1645_ID, + _image1646_ID, + _image1647_ID, + _image1648_ID, + _image1649_ID, + _image1650_ID, + _image1651_ID, + _image1652_ID, + _image1653_ID, + _image1654_ID, + _image1655_ID, + _image1656_ID, + _image1657_ID, + _image1658_ID, + _image1659_ID, + _image1660_ID, + _image1661_ID, + _image1662_ID, + _image1663_ID, + _image1664_ID, + _image1665_ID, + _image1666_ID, + _image1667_ID, + _image1668_ID, + _image1669_ID, + _image1670_ID, + _image1671_ID, + _image1672_ID, + _image1673_ID, + _image1674_ID, + _image1675_ID, + _image1676_ID, + _image1677_ID, + _image1678_ID, + _image1679_ID, + _image1680_ID, + _image1681_ID, + _image1682_ID, + _image1683_ID, + _image1684_ID, + _image1685_ID, + _image1686_ID, + _image1687_ID, + _image1688_ID, + _image1689_ID, + _image1690_ID, + _image1691_ID, + _image1692_ID, + _image1693_ID, + _image1694_ID, + _image1695_ID, + _image1696_ID, + _image1697_ID, + _image1698_ID, + _image1699_ID, + _image1700_ID, + _image1701_ID, + _image1702_ID, + _image1703_ID, + _image1704_ID, + _image1705_ID, + _image1706_ID, + _image1707_ID, + _image1708_ID, + _image1709_ID, + _image1710_ID, + _image1711_ID, + _image1712_ID, + _image1713_ID, + _image1714_ID, + _image1715_ID, + _image1716_ID, + _image1717_ID, + _image1718_ID, + _image1719_ID, + _image1720_ID, + _image1721_ID, + _image1722_ID, + _image1723_ID, + _image1724_ID, + _image1725_ID, + _image1726_ID, + _image1727_ID, + _image1728_ID, + _image1729_ID, + _image1730_ID, + _image1731_ID, + _image1732_ID, + _image1733_ID, + _image1734_ID, + _image1735_ID, + _image1736_ID, + _image1737_ID, + _image1738_ID, + _image1739_ID, + _image1740_ID, + _image1741_ID, + _image1742_ID, + _image1743_ID, + _image1744_ID, + _image1745_ID, + _image1746_ID, + _image1747_ID, + _image1748_ID, + _image1749_ID, + _image1750_ID, + _image1751_ID, + _image1752_ID, + _image1753_ID, + _image1754_ID, + _image1755_ID, + _image1756_ID, + _image1757_ID, + _image1758_ID, + _image1759_ID, + _image1760_ID, + _image1761_ID, + _image1762_ID, + _image1763_ID, + _image1764_ID, + _image1765_ID, + _image1766_ID, + _image1767_ID, + _image1768_ID, + _image1769_ID, + _image1770_ID, + _image1771_ID, + _image1772_ID, + _image1773_ID, + _image1774_ID, + _image1775_ID, + _image1776_ID, + _image1777_ID, + _image1778_ID, + _image1779_ID, + _image1780_ID, + _image1781_ID, + _image1782_ID, + _image1783_ID, + _image1784_ID, + _image1785_ID, + _image1786_ID, + _image1787_ID, + _image1788_ID, + _image1789_ID, + _image1790_ID, + _image1791_ID, + _image1792_ID, + _image1793_ID, + _image1794_ID, + _image1795_ID, + _image1796_ID, + _image1797_ID, + _image1798_ID, + _image1799_ID, + _image1800_ID, + _image1801_ID, + _image1802_ID, + _image1803_ID, + _image1804_ID, + _image1805_ID, + _image1806_ID, + _image1807_ID, + _image1808_ID, + _image1809_ID, + _image1810_ID, + _image1811_ID, + _image1812_ID, + _image1813_ID, + _image1814_ID, + _image1815_ID, + _image1816_ID, + _image1817_ID, + _image1818_ID, + _image1819_ID, + _image1820_ID, + _image1821_ID, + _image1822_ID, + _image1823_ID, + _image1824_ID, + _image1825_ID, + _image1826_ID, + _image1827_ID, + _image1828_ID, + _image1829_ID, + _image1830_ID, + _image1831_ID, + _image1832_ID, + _image1833_ID, + _image1834_ID, + _image1835_ID, + _image1836_ID, + _image1837_ID, + _image1838_ID, + _image1839_ID, + _image1840_ID, + _image1841_ID, + _image1842_ID, + _image1843_ID, + _image1844_ID, + _image1845_ID, + _image1846_ID, + _image1847_ID, + _image1848_ID, + _image1849_ID, + _image1850_ID, + _image1851_ID, + _image1852_ID, + _image1853_ID, + _image1854_ID, + _image1855_ID, + _image1856_ID, + _image1857_ID, + _image1858_ID, + _image1859_ID, + _image1860_ID, + _image1861_ID, + _image1862_ID, + _image1863_ID, + _image1864_ID, + _image1865_ID, + _image1866_ID, + _image1867_ID, + _image1868_ID, + _image1869_ID, + _image1870_ID, + _image1871_ID, + _image1872_ID, + _image1873_ID, + _image1874_ID, + _image1875_ID, + _image1876_ID, + _image1877_ID, + _image1878_ID, + _image1879_ID, + _image1880_ID, + _image1881_ID, + _image1882_ID, + _image1883_ID, + _image1884_ID, + _image1885_ID, + _image1886_ID, + _image1887_ID, + _image1888_ID, + _image1889_ID, + _image1890_ID, + _image1891_ID, + _image1892_ID, + _image1893_ID, + _image1894_ID, + _image1895_ID, + _image1896_ID, + _image1897_ID, + _image1898_ID, + _image1899_ID, + _image1900_ID, + _image1901_ID, + _image1902_ID, + _image1903_ID, + _image1904_ID, + _image1905_ID, + _image1906_ID, + _image1907_ID, + _image1908_ID, + _image1909_ID, + _image1910_ID, + _image1911_ID, + _image1912_ID, + _image1913_ID, + _image1914_ID, + _image1915_ID, + _image1916_ID, + _image1917_ID, + _image1918_ID, + _image1919_ID, + _image1920_ID, + _image1921_ID, + _image1922_ID, + _image1923_ID, + _image1924_ID, + _image1925_ID, + _image1926_ID, + _image1927_ID, + _image1928_ID, + _image1929_ID, + _image1930_ID, + _image1931_ID, + _image1932_ID, + _image1933_ID, + _image1934_ID, + _image1935_ID, + _image1936_ID, + _image1937_ID, + _image1938_ID, + _image1939_ID, + _image1940_ID, + _image1941_ID, + _image1942_ID, + _image1943_ID, + _image1944_ID, + _image1945_ID, + _image1946_ID, + _image1947_ID, + _image1948_ID, + _image1949_ID, + _image1950_ID, + _image1951_ID, + _image1952_ID, + _image1953_ID, + _image1954_ID, + _image1955_ID, + _image1956_ID, + _image1957_ID, + _image1958_ID, + _image1959_ID, + _image1960_ID, + _image1961_ID, + _image1962_ID, + _image1963_ID, + _image1964_ID, + _image1965_ID, + _image1966_ID, + _image1967_ID, + _image1968_ID, + _image1969_ID, + _image1970_ID, + _image1971_ID, + _image1972_ID, + _image1973_ID, + _image1974_ID, + _image1975_ID, + _image1976_ID, + _image1977_ID, + _image1978_ID, + _image1979_ID, + _image1980_ID, + _image1981_ID, + _image1982_ID, + _image1983_ID, + _image1984_ID, + _image1985_ID, + _image1986_ID, + _image1987_ID, + _image1988_ID, + _image1989_ID, + _image1990_ID, + _image1991_ID, + _image1992_ID, + _image1993_ID, + _image1994_ID, + _image1995_ID, + _image1996_ID, + _image1997_ID, + _image1998_ID, + _image1999_ID, + _image2000_ID, + _image2001_ID, + _image2002_ID, + _image2003_ID, + _image2004_ID, + _image2005_ID, + _image2006_ID, + _image2007_ID, + _image2008_ID, + _image2009_ID, + _image2010_ID, + _image2011_ID, + _image2012_ID, + _image2013_ID, + _image2014_ID, + _image2015_ID, + _image2016_ID, + _image2017_ID, + _image2018_ID, + _image2019_ID, + _image2020_ID, + _image2021_ID, + _image2022_ID, + _image2023_ID, + _image2024_ID, + _image2025_ID, + _image2026_ID, + _image2027_ID, + _image2028_ID, + _image2029_ID, + _image2030_ID, + _image2031_ID, + _image2032_ID, + _image2033_ID, + _image2034_ID, + _image2035_ID, + _image2036_ID, + _image2037_ID, + _image2038_ID, + _image2039_ID, + _image2040_ID, + _image2041_ID, + _image2042_ID, + _image2043_ID, + _image2044_ID, + _image2045_ID, + _image2046_ID, + _image2047_ID, + _image2048_ID, + _image2049_ID, + _image2050_ID, + _image2051_ID, + _image2052_ID, + _image2053_ID, + _image2054_ID, + _image2055_ID, + _image2056_ID, + _image2057_ID, + _image2058_ID, + _image2059_ID, + _image2060_ID, + _image2061_ID, + _image2062_ID, + _image2063_ID, + _image2064_ID, + _image2065_ID, + _image2066_ID, + _image2067_ID, + _image2068_ID, + _image2069_ID, + _image2070_ID, + _image2071_ID, + _image2072_ID, + _image2073_ID, + _image2074_ID, + _image2075_ID, + _image2076_ID, + _image2077_ID, + _image2078_ID, + _image2079_ID, + _image2080_ID, + _image2081_ID, + _image2082_ID, + _image2083_ID, + _image2084_ID, + _image2085_ID, + _image2086_ID, + _image2087_ID, + _image2088_ID, + _image2089_ID, + _image2090_ID, + _image2091_ID, + _image2092_ID, + _image2093_ID, + _image2094_ID, + _image2095_ID, + _image2096_ID, + _image2097_ID, + _image2098_ID, + _image2099_ID, + _image2100_ID, + _image2101_ID, + _image2102_ID, + _image2103_ID, + _image2104_ID, + _image2105_ID, + _image2106_ID, + _image2107_ID, + _image2108_ID, + _image2109_ID, + _image2110_ID, + _image2111_ID, + _image2112_ID, + _image2113_ID, + _image2114_ID, + _image2115_ID, + _image2116_ID, + _image2117_ID, + _image2118_ID, + _image2119_ID, + _image2120_ID, + _image2121_ID, + _image2122_ID, + _image2123_ID, + _image2124_ID, + _image2125_ID, + _image2126_ID, + _image2127_ID, + _image2128_ID, + _image2129_ID, + _image2130_ID, + _image2131_ID, + _image2132_ID, + _image2133_ID, + _image2134_ID, + _image2135_ID, + _image2136_ID, + _image2137_ID, + _image2138_ID, + _image2139_ID, + _image2140_ID, + _image2141_ID, + _image2142_ID, + _image2143_ID, + _image2144_ID, + _image2145_ID, + _image2146_ID, + _image2147_ID, + _image2148_ID, + _image2149_ID, + _image2150_ID, + _image2151_ID, + _image2152_ID, + _image2153_ID, + _image2154_ID, + _image2155_ID, + _image2156_ID, + _image2157_ID, + _image2158_ID, + _image2159_ID, + _image2160_ID, + _image2161_ID, + _image2162_ID, + _image2163_ID, + _image2164_ID, + _image2165_ID, + _image2166_ID, + _image2167_ID, + _image2168_ID, + _image2169_ID, + _image2170_ID, + _image2171_ID, + _image2172_ID, + _image2173_ID, + _image2174_ID, + _image2175_ID, + _image2176_ID, + _image2177_ID, + _image2178_ID, + _image2179_ID, + _image2180_ID, + _image2181_ID, + _image2182_ID, + _image2183_ID, + _image2184_ID, + _image2185_ID, + _image2186_ID, + _image2187_ID, + _image2188_ID, + _image2189_ID, + _image2190_ID, + _image2191_ID, + _image2192_ID, + _image2193_ID, + _image2194_ID, + _image2195_ID, + _image2196_ID, + _image2197_ID, + _image2198_ID, + _image2199_ID, + _image2200_ID, + _image2201_ID, + _image2202_ID, + _image2203_ID, + _image2204_ID, + _image2205_ID, + _image2206_ID, + _image2207_ID, + _image2208_ID, + _image2209_ID, + _image2210_ID, + _image2211_ID, + _image2212_ID, + _image2213_ID, + _image2214_ID, + _image2215_ID, + _image2216_ID, + _image2217_ID, + _image2218_ID, + _image2219_ID, + _image2220_ID, + _image2221_ID, + _image2222_ID, + _image2223_ID, + _image2224_ID, + _image2225_ID, + _image2226_ID, + _image2227_ID, + _image2228_ID, + _image2229_ID, + _image2230_ID, + _image2231_ID, + _image2232_ID, + _image2233_ID, + _image2234_ID, + _image2235_ID, + _image2236_ID, + _image2237_ID, + _image2238_ID, + _image2239_ID, + _image2240_ID, + _image2241_ID, + _image2242_ID, + _image2243_ID, + _image2244_ID, + _image2245_ID, + _image2246_ID, + _image2247_ID, + _image2248_ID, + _image2249_ID, + _image2250_ID, + _image2251_ID, + _image2252_ID, + _image2253_ID, + _image2254_ID, + _image2255_ID, + _image2256_ID, + _image2257_ID, + _image2258_ID, + _image2259_ID, + _image2260_ID, + _image2261_ID, + _image2262_ID, + _image2263_ID, + _image2264_ID, + _image2265_ID, + _image2266_ID, + _image2267_ID, + _image2268_ID, + _image2269_ID, + _image2270_ID, + _image2271_ID, + _image2272_ID, + _image2273_ID, + _image2274_ID, + _image2275_ID, + _image2276_ID, + _image2277_ID, + _image2278_ID, + _image2279_ID, + _image2280_ID, + _image2281_ID, + _image2282_ID, + _image2283_ID, + _image2284_ID, + _image2285_ID, + _image2286_ID, + _image2287_ID, + _image2288_ID, + _image2289_ID, + _image2290_ID, + _image2291_ID, + _image2292_ID, + _image2293_ID, + _image2294_ID, + _image2295_ID, + _image2296_ID, + _image2297_ID, + _image2298_ID, + _image2299_ID, + _image2300_ID, + _image2301_ID, + _image2302_ID, + _image2303_ID, + _image2304_ID, + _image2305_ID, + _image2306_ID, + _image2307_ID, + _image2308_ID, + _image2309_ID, + _image2310_ID, + _image2311_ID, + _image2312_ID, + _image2313_ID, + _image2314_ID, + _image2315_ID, + _image2316_ID, + _image2317_ID, + _image2318_ID, + _image2319_ID, + _image2320_ID, + _image2321_ID, + _image2322_ID, + _image2323_ID, + _image2324_ID, + _image2325_ID, + _image2326_ID, + _image2327_ID, + _image2328_ID, + _image2329_ID, + _image2330_ID, + _image2331_ID, + _image2332_ID, + _image2333_ID, + _image2334_ID, + _image2335_ID, + _image2336_ID, + _image2337_ID, + _image2338_ID, + _image2339_ID, + _image2340_ID, + _image2341_ID, + _image2342_ID, + _image2343_ID, + _image2344_ID, + _image2345_ID, + _image2346_ID, + _image2347_ID, + _image2348_ID, + _image2349_ID, + _image2350_ID, + _image2351_ID, + _image2352_ID, + _image2353_ID, + _image2354_ID, + _image2355_ID, + _image2356_ID, + _image2357_ID, + _image2358_ID, + _image2359_ID, + _image2360_ID, + _image2361_ID, + _image2362_ID, + _image2363_ID, + _image2364_ID, + _image2365_ID, + _image2366_ID, + _image2367_ID, + _image2368_ID, + _image2369_ID, + _image2370_ID, + _image2371_ID, + _image2372_ID, + _image2373_ID, + _image2374_ID, + _image2375_ID, + _image2376_ID, + _image2377_ID, + _image2378_ID, + _image2379_ID, + _image2380_ID, + _image2381_ID, + _image2382_ID, + _image2383_ID, + _image2384_ID, + _image2385_ID, + _image2386_ID, + _image2387_ID, + _image2388_ID, + _image2389_ID, + _image2390_ID, + _image2391_ID, + _image2392_ID, + _image2393_ID, + _image2394_ID, + _image2395_ID, + _image2396_ID, + _image2397_ID, + _image2398_ID, + _image2399_ID, + _image2400_ID, + _image2401_ID, + _image2402_ID, + _image2403_ID, + _image2404_ID, + _image2405_ID, + _image2406_ID, + _image2407_ID, + _image2408_ID, + _image2409_ID, + _image2410_ID, + _image2411_ID, + _image2412_ID, + _image2413_ID, + _image2414_ID, + _image2415_ID, + _image2416_ID, + _image2417_ID, + _image2418_ID, + _image2419_ID, + _image2420_ID, + _image2421_ID, + _image2422_ID, + _image2423_ID, + _image2424_ID, + _image2425_ID, + _image2426_ID, + _image2427_ID, + _image2428_ID, + _image2429_ID, + _image2430_ID, + _image2431_ID, + _image2432_ID, + _image2433_ID, + _image2434_ID, + _image2435_ID, + _image2436_ID, + _image2437_ID, + _image2438_ID, + _image2439_ID, + _image2440_ID, + _image2441_ID, + _image2442_ID, + _image2443_ID, + _image2444_ID, + _image2445_ID, + _image2446_ID, + _image2447_ID, + _image2448_ID, + _image2449_ID, + _image2450_ID, + _image2451_ID, + _image2452_ID, + _image2453_ID, + _image2454_ID, + _image2455_ID, + _image2456_ID, + _image2457_ID, + _image2458_ID, + _image2459_ID, + _image2460_ID, + _image2461_ID, + _image2462_ID, + _image2463_ID, + _image2464_ID, + _image2465_ID, + _image2466_ID, + _image2467_ID, + _image2468_ID, + _image2469_ID, + _image2470_ID, + _image2471_ID, + _image2472_ID, + _image2473_ID, + _image2474_ID, + _image2475_ID, + _image2476_ID, + _image2477_ID, + _image2478_ID, + _image2479_ID, + _image2480_ID, + _image2481_ID, + _image2482_ID, + _image2483_ID, + _image2484_ID, + _image2485_ID, + _image2486_ID, + _image2487_ID, + _image2488_ID, + _image2489_ID, + _image2490_ID, + _image2491_ID, + _image2492_ID, + _image2493_ID, + _image2494_ID, + _image2495_ID, + _image2496_ID, + _image2497_ID, + _image2498_ID, + _image2499_ID, + _image2500_ID, + _image2501_ID, + _image2502_ID, + _image2503_ID, + _image2504_ID, + _image2505_ID, + _image2506_ID, + _image2507_ID, + _image2508_ID, + _image2509_ID, + _image2510_ID, + _image2511_ID, + _image2512_ID, + _image2513_ID, + _image2514_ID, + _image2515_ID, + _image2516_ID, + _image2517_ID, + _image2518_ID, + _image2519_ID, + _image2520_ID, + _image2521_ID, + _image2522_ID, + _image2523_ID, + _image2524_ID, + _image2525_ID, + _image2526_ID, + _image2527_ID, + _image2528_ID, + _image2529_ID, + _image2530_ID, + _image2531_ID, + _image2532_ID, + _image2533_ID, + _image2534_ID, + _image2535_ID, + _image2536_ID, + _image2537_ID, + _image2538_ID, + _image2539_ID, + _image2540_ID, + _image2541_ID, + _image2542_ID, + _image2543_ID, + _image2544_ID, + _image2545_ID, + _image2546_ID, + _image2547_ID, + _image2548_ID, + _image2549_ID, + _image2550_ID, + _image2551_ID, + _image2552_ID, + _image2553_ID, + _image2554_ID, + _image2555_ID, + _image2556_ID, + _image2557_ID, + _image2558_ID, + _image2559_ID, + _image2560_ID, + _image2561_ID, + _image2562_ID, + _image2563_ID, + _image2564_ID, + _image2565_ID, + _image2566_ID, + _image2567_ID, + _image2568_ID, + _image2569_ID, + _image2570_ID, + _image2571_ID, + _image2572_ID, + _image2573_ID, + _image2574_ID, + _image2575_ID, + _image2576_ID, + _image2577_ID, + _image2578_ID, + _image2579_ID, + _image2580_ID, + _image2581_ID, + _image2582_ID, + _image2583_ID, + _image2584_ID, + _image2585_ID, + _image2586_ID, + _image2587_ID, + _image2588_ID, + _image2589_ID, + _image2590_ID, + _image2591_ID, + _image2592_ID, + _image2593_ID, + _image2594_ID, + _image2595_ID, + _image2596_ID, + _image2597_ID, + _image2598_ID, + _image2599_ID, + _image2600_ID, + _image2601_ID, + _image2602_ID, + _image2603_ID, + _image2604_ID, + _image2605_ID, + _image2606_ID, + _image2607_ID, + _image2608_ID, + _image2609_ID, + _image2610_ID, + _image2611_ID, + _image2612_ID, + _image2613_ID, + _image2614_ID, + _image2615_ID, + _image2616_ID, + _image2617_ID, + _image2618_ID, + _image2619_ID, + _image2620_ID, + _image2621_ID, + _image2622_ID, + _image2623_ID, + _image2624_ID, + _image2625_ID, + _image2626_ID, + _image2627_ID, + _image2628_ID, + _image2629_ID, + _image2630_ID, + _image2631_ID, + _image2632_ID, + _image2633_ID, + _image2634_ID, + _image2635_ID, + _image2636_ID, + _image2637_ID, + _image2638_ID, + _image2639_ID, + _image2640_ID, + _image2641_ID, + _image2642_ID, + _image2643_ID, + _image2644_ID, + _image2645_ID, + _image2646_ID, + _image2647_ID, + _image2648_ID, + _image2649_ID, + _image2650_ID, + _image2651_ID, + _image2652_ID, + _image2653_ID, + _image2654_ID, + _image2655_ID, + _image2656_ID, + _image2657_ID, + _image2658_ID, + _image2659_ID, + _image2660_ID, + _image2661_ID, + _image2662_ID, + _image2663_ID, + _image2664_ID, + _image2665_ID, + _image2666_ID, + _image2667_ID, + _image2668_ID, + _image2669_ID, + _image2670_ID, + _image2671_ID, + _image2672_ID, + _image2673_ID, + _image2674_ID, + _image2675_ID, + _image2676_ID, + _image2677_ID, + _image2678_ID, + _image2679_ID, + _image2680_ID, + _image2681_ID, + _image2682_ID, + _image2683_ID, + _image2684_ID, + _image2685_ID, + _image2686_ID, + _image2687_ID, + _image2688_ID, + _image2689_ID, + _image2690_ID, + _image2691_ID, + _image2692_ID, + _image2693_ID, + _image2694_ID, + _image2695_ID, + _image2696_ID, + _image2697_ID, + _image2698_ID +} IMAGEIDS; + + #endif diff --git a/assets/obseg/bg/bg_all_p.h b/assets/obseg/bg/bg_all_p.h index f728c454..a3f51d47 100644 --- a/assets/obseg/bg/bg_all_p.h +++ b/assets/obseg/bg/bg_all_p.h @@ -31,7 +31,7 @@ struct portal_data_table_entry u16 control_bytes; }; -struct xyzpoint +struct coord { float x; float y; @@ -45,7 +45,7 @@ struct portal_3_point char padding1; char padding2; char padding3; - struct xyzpoint points[3]; + struct coord points[3]; }; struct portal_4_point @@ -54,7 +54,7 @@ struct portal_4_point char padding1; char padding2; char padding3; - struct xyzpoint points[4]; + struct coord points[4]; }; struct portal_5_point @@ -63,7 +63,7 @@ struct portal_5_point char padding1; char padding2; char padding3; - struct xyzpoint points[5]; + struct coord points[5]; }; struct portal_6_point @@ -72,7 +72,7 @@ struct portal_6_point char padding1; char padding2; char padding3; - struct xyzpoint points[6]; + struct coord points[6]; }; extern struct room_data_table_entry room_data_table[]; diff --git a/assets/obseg/brief/UbrieftraZ.c b/assets/obseg/brief/UbrieftraZ.c index 3f1b1477..c823c6d6 100644 --- a/assets/obseg/brief/UbrieftraZ.c +++ b/assets/obseg/brief/UbrieftraZ.c @@ -8,7 +8,7 @@ struct BriefStruct UbrieftraZ = { TEXT(LTRA, 3) /* Moneypenny */ }, { /* Objectives (Text and Difficult) */ - {TEXT(LTRA, 4), DIFFICULTY_AGENT}, /* Destroy break units */ + {TEXT(LTRA, 4), DIFFICULTY_AGENT}, /* Destroy brake units */ {TEXT(LTRA, 5), DIFFICULTY_AGENT}, /* Rescue Natalya */ {TEXT(LTRA, 6), DIFFICULTY_SECRET}, /* Locate Janus secret base */ {TEXT(LTRA, 7), DIFFICULTY_00}, /* Crack Boris' password */ diff --git a/clean_baserom.sh b/clean_baserom.sh index 84121a9f..5342dc89 100755 --- a/clean_baserom.sh +++ b/clean_baserom.sh @@ -19,7 +19,7 @@ if [ "$DOALL" == "1" ] || [ $1 == 'files' ]; then fi if [ "$DOALL" == "1" ] || [ $1 == 'images' ]; then - while IFS=, read -r offset size name + while IFS=, read -r offset size name compressed extract do echo "removing $name" rm -f $name diff --git a/extract_baserom.u.sh b/extract_baserom.u.sh index 6a8e79bc..a2922e56 100644 --- a/extract_baserom.u.sh +++ b/extract_baserom.u.sh @@ -1,40 +1,83 @@ #!/bin/bash -if [ -z "$1" ]; then - DOALL="1" - echo "Processing Everything" + +#set defaults +DOALL="1" +BASEROM="baserom.u.z64" + +clear + +if [ -z "$2" ]; then + if [ -z "$1" ]; then + #No Args + echo "Processing Everything" + elif [ "$1" = "files" ] || [ "$1" = "images" ]; then + #Arg1 is "files" or "images" + DOALL="0" + echo "Processing $1 Only" + else + #Arg1 is ROM + BASEROM=$1 + echo "Processing Everything using $BASEROM" + fi +else + BASEROM=$2 + if [ "$1" = "files" ] || [ "$1" != "images" ]; then + #Arg1 is "files" or "images + DOALL="0" + echo "Processing $1 Only using $BASEROM" + else + echo "Processing Everything using $BASEROM" + fi fi + true="1" -mkdir assets assets/font assets/images assets/images/split assets/music assets/ramrom assets/obseg assets/obseg/bg assets/obseg/brief assets/obseg/chr assets/obseg/gun assets/obseg/prop assets/obseg/setup assets/obseg/setup/u assets/obseg/stan assets/obseg/text assets/obseg/text/u + +DIRs='assets assets/font assets/images assets/images/split assets/music assets/ramrom assets/obseg assets/obseg/bg assets/obseg/brief assets/obseg/chr assets/obseg/gun assets/obseg/prop assets/obseg/setup assets/obseg/setup/u assets/obseg/stan assets/obseg/text assets/obseg/text/u' + +for DIR in $DIRs +do + # if dir not exist, make + if [ ! -d $DIR ]; then + mkdir $DIR + fi +done + +#build/rebuild extractor +[ ! -x tools/extractor/extractor ] && make -C tools/extractor if [ "$DOALL" == "1" ] || [ $1 == 'files' ]; then echo "Processing Files" - while IFS=, read -r offset size name compressed extract - do - if [ "$extract" == "$true" ]; then - if [ "$compressed" == "$true" ]; then - echo "Extracting compressed $name, $size bytes..." - dd bs=1 skip=$offset count=$size if=baserom.u.z64 of=$name status=none - # Add the gZip Header to a new file using the name given in command - echo -n -e \\x1F\\x8B\\x08\\x00\\x00\\x00\\x00\\x00\\x02\\x03 > $name.temp - # Add the contents of the compressed file minus the 1172 to the new file - cat $name | tail --bytes=+3 >> $name.temp - # copy the new file over the old compressed file - cat $name.temp > $name.zip - # decompress the Z file to the filename given in the command - cat $name.zip | gzip --quiet --decompress > $name.bin - # remove the compressed Z file - rm $name.temp $name.zip $name - echo "Successfully Decompressed $name" + if [ -x tools/extractor/extractor ]; then + tools/extractor/extractor "$BASEROM" filelist.u.csv + else + while IFS=, read -r offset size name compressed extract + do + if [ "$extract" == "$true" ]; then + if [ "$compressed" == "$true" ]; then + echo "Extracting compressed $name, $size bytes..." + dd bs=1 skip=$offset count=$size if="$BASEROM" of=$name status=none + # Add the gZip Header to a new file using the name given in command + echo -n -e \\x1F\\x8B\\x08\\x00\\x00\\x00\\x00\\x00\\x02\\x03 > $name.temp + # Add the contents of the compressed file minus the 1172 to the new file + cat $name | tail --bytes=+3 >> $name.temp + # copy the new file over the old compressed file + cat $name.temp > $name.zip + # decompress the Z file to the filename given in the command + cat $name.zip | gzip --quiet --decompress > $name + # remove the compressed Z file + rm $name.temp $name.zip + echo "Successfully Decompressed $name" + else + echo "Extracting uncompressed $name, $size bytes..." + dd bs=1 skip=$offset count=$size if="$BASEROM" of=$name status=none + echo "Successfully Extracted $name" + fi else - echo "Extracting uncompressed $name, $size bytes..." - dd bs=1 skip=$offset count=$size if=baserom.u.z64 of=$name status=none - echo "Successfully Extracted $name" + echo "skip $name" fi - else - echo "skip $name" - fi - done < filelist.u.csv + done < filelist.u.csv + fi #filelist.u.csv should follow pattern of: #offset,size,name,compressed,extract #formatting matters, no comments, no extra lines, unix line endings only @@ -42,15 +85,19 @@ if [ "$DOALL" == "1" ] || [ $1 == 'files' ]; then fi if [ "$DOALL" == "1" ] || [ $1 == 'images' ]; then - echo "Processing Imagess" - while IFS=, read -r offset size name - do - echo "Extracting $name, $size bytes..." - dd bs=1 skip=$offset count=$size if=baserom.u.z64 of=$name status=none - echo "Successfully Extracted $name" - done < imagelist.u.csv + echo "Processing Images" + if [ -x tools/extractor/extractor ]; then + tools/extractor/extractor "$BASEROM" imagelist.u.csv + else + while IFS=, read -r offset size name + do + echo "Extracting $name, $size bytes..." + dd bs=1 skip=$offset count=$size if="$BASEROM" of=$name status=none + echo "Successfully Extracted $name" + done < imagelist.u.csv + fi #imageslist.u.csv should follow pattern of: - #offset,size,name + #offset,size,name,compressed,extract #formatting matters, no comments, no extra lines, unix line endings only #and always end with a newline fi diff --git a/filelist.u.csv b/filelist.u.csv index c50219ef..9f31eaff 100644 --- a/filelist.u.csv +++ b/filelist.u.csv @@ -30,69 +30,69 @@ 3901424,397216,assets/music/instruments.tbl,0,1 4298640,4,assets/music/number_music_samples,0,0 4298644,504,assets/music/table_music_data.bin,0,0 -4299148,42,assets/music/Mno_music,1,1 -4299190,470,assets/music/Msolo_death_abrev,1,1 -4299660,2222,assets/music/Mintro_eye,1,1 -4301882,3050,assets/music/Mtrain,1,1 -4304932,3488,assets/music/Mdepot,1,1 -4308420,3480,assets/music/Mjungle_unused,1,1 -4311900,3520,assets/music/Mcitadel,1,1 -4315420,2766,assets/music/Mfacility,1,1 -4318186,2910,assets/music/Mcontrol,1,1 -4321096,3588,assets/music/Mdam,1,1 -4324684,3552,assets/music/Mfrigate,1,1 -4328236,2388,assets/music/Marchives,1,1 -4330624,3696,assets/music/Msilo,1,1 -4334320,3948,assets/music/Mjungle_perimeter_unused,1,1 -4338268,3330,assets/music/Mstreets,1,1 -4341598,1650,assets/music/Mbunker1,1,1 -4343248,1664,assets/music/Mbunker2,1,1 -4344912,2456,assets/music/Mstatue,1,1 -4347368,2522,assets/music/Melevator_control,1,1 -4349890,3424,assets/music/Mcradle,1,1 -4353314,42,assets/music/Mnull1,1,1 -4353356,1606,assets/music/Melevator_wc,1,1 -4354962,3482,assets/music/Megyptian,1,1 -4358444,994,assets/music/Mfolders,1,1 -4359438,498,assets/music/Mwatchmusic,1,1 -4359936,3186,assets/music/Maztec,1,1 -4363122,3628,assets/music/Mwatercaverns,1,1 -4366750,870,assets/music/Mdeathsolo,1,1 -4367620,3510,assets/music/Msurface2,1,1 -4371130,2208,assets/music/Mtrainx,1,1 -4373338,42,assets/music/Mnull2,1,1 -4373380,2392,assets/music/Mfacilityx,1,1 -4375772,1980,assets/music/Mdepotx,1,1 -4377752,1352,assets/music/Mcontrolx,1,1 -4379104,1876,assets/music/Mwatercavernsx,1,1 -4380980,1312,assets/music/Mdamx,1,1 -4382292,1474,assets/music/Mfrigatex,1,1 -4383766,1828,assets/music/Marchivesx,1,1 -4385594,2292,assets/music/Msilox,1,1 -4387886,42,assets/music/Mnull3,1,1 -4387928,1644,assets/music/Mstreetsx,1,1 -4389572,1958,assets/music/Mbunker1x,1,1 -4391530,1614,assets/music/Mbunker2x,1,1 -4393144,2070,assets/music/Mjunglex,1,1 -4395214,1074,assets/music/Mnint_rare_logo,1,1 -4396288,1720,assets/music/Mstatuex,1,1 -4398008,2262,assets/music/Maztecx,1,1 -4400270,2224,assets/music/Megyptianx,1,1 -4402494,1738,assets/music/Mcradlex,1,1 -4404232,2122,assets/music/Mcuba,1,1 -4406354,3358,assets/music/Mrunway,1,1 -4409712,730,assets/music/Mrunway_plane,1,1 -4410442,1832,assets/music/Msurface2x,1,1 -4412274,1314,assets/music/Mwindblowing,1,1 -4413588,524,assets/music/Mmultideath_alt,1,1 -4414112,1928,assets/music/Mjungle,1,1 -4416040,1570,assets/music/Mrunwayx,1,1 -4417610,3432,assets/music/Msurface1,1,1 -4421042,712,assets/music/Mmultiplayerdeath,1,1 -4421754,1832,assets/music/Msurface1x,1,1 -4423586,668,assets/music/Msurface2_ending,1,1 -4424254,358,assets/music/Mstatue_ending,1,1 -4424612,700,assets/music/Mfrigate_outro,1,1 +4299148,42,assets/music/Mno_music.bin,1,1 +4299190,470,assets/music/Msolo_death_abrev.bin,1,1 +4299660,2222,assets/music/Mintro_eye.bin,1,1 +4301882,3050,assets/music/Mtrain.bin,1,1 +4304932,3488,assets/music/Mdepot.bin,1,1 +4308420,3480,assets/music/Mjungle_unused.bin,1,1 +4311900,3520,assets/music/Mcitadel.bin,1,1 +4315420,2766,assets/music/Mfacility.bin,1,1 +4318186,2910,assets/music/Mcontrol.bin,1,1 +4321096,3588,assets/music/Mdam.bin,1,1 +4324684,3552,assets/music/Mfrigate.bin,1,1 +4328236,2388,assets/music/Marchives.bin,1,1 +4330624,3696,assets/music/Msilo.bin,1,1 +4334320,3948,assets/music/Mjungle_perimeter_unused.bin,1,1 +4338268,3330,assets/music/Mstreets.bin,1,1 +4341598,1650,assets/music/Mbunker1.bin,1,1 +4343248,1664,assets/music/Mbunker2.bin,1,1 +4344912,2456,assets/music/Mstatue.bin,1,1 +4347368,2522,assets/music/Melevator_control.bin,1,1 +4349890,3424,assets/music/Mcradle.bin,1,1 +4353314,42,assets/music/Mnull1.bin,1,1 +4353356,1606,assets/music/Melevator_wc.bin,1,1 +4354962,3482,assets/music/Megyptian.bin,1,1 +4358444,994,assets/music/Mfolders.bin,1,1 +4359438,498,assets/music/Mwatchmusic.bin,1,1 +4359936,3186,assets/music/Maztec.bin,1,1 +4363122,3628,assets/music/Mwatercaverns.bin,1,1 +4366750,870,assets/music/Mdeathsolo.bin,1,1 +4367620,3510,assets/music/Msurface2.bin,1,1 +4371130,2208,assets/music/Mtrainx.bin,1,1 +4373338,42,assets/music/Mnull2.bin,1,1 +4373380,2392,assets/music/Mfacilityx.bin,1,1 +4375772,1980,assets/music/Mdepotx.bin,1,1 +4377752,1352,assets/music/Mcontrolx.bin,1,1 +4379104,1876,assets/music/Mwatercavernsx.bin,1,1 +4380980,1312,assets/music/Mdamx.bin,1,1 +4382292,1474,assets/music/Mfrigatex.bin,1,1 +4383766,1828,assets/music/Marchivesx.bin,1,1 +4385594,2292,assets/music/Msilox.bin,1,1 +4387886,42,assets/music/Mnull3.bin,1,1 +4387928,1644,assets/music/Mstreetsx.bin,1,1 +4389572,1958,assets/music/Mbunker1x.bin,1,1 +4391530,1614,assets/music/Mbunker2x.bin,1,1 +4393144,2070,assets/music/Mjunglex.bin,1,1 +4395214,1074,assets/music/Mnint_rare_logo.bin,1,1 +4396288,1720,assets/music/Mstatuex.bin,1,1 +4398008,2262,assets/music/Maztecx.bin,1,1 +4400270,2224,assets/music/Megyptianx.bin,1,1 +4402494,1738,assets/music/Mcradlex.bin,1,1 +4404232,2122,assets/music/Mcuba.bin,1,1 +4406354,3358,assets/music/Mrunway.bin,1,1 +4409712,730,assets/music/Mrunway_plane.bin,1,1 +4410442,1832,assets/music/Msurface2x.bin,1,1 +4412274,1314,assets/music/Mwindblowing.bin,1,1 +4413588,524,assets/music/Mmultideath_alt.bin,1,1 +4414112,1928,assets/music/Mjungle.bin,1,1 +4416040,1570,assets/music/Mrunwayx.bin,1,1 +4417610,3432,assets/music/Msurface1.bin,1,1 +4421042,712,assets/music/Mmultiplayerdeath.bin,1,1 +4421754,1832,assets/music/Msurface1x.bin,1,1 +4423586,668,assets/music/Msurface2_ending.bin,1,1 +4424254,358,assets/music/Mstatue_ending.bin,1,1 +4424612,700,assets/music/Mfrigate_outro.bin,1,1 4425312,69104,assets/obseg/bg/bg_sev_all_p.bin,0,0 4494416,331584,assets/obseg/bg/bg_silo_all_p.bin,0,0 4826000,139472,assets/obseg/bg/bg_stat_all_p.bin,0,1 @@ -127,545 +127,545 @@ 7257072,4000,assets/obseg/bg/bg_lip_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,1,1 -7270416,14064,assets/obseg/chr/CbaronsamediZ,1,1 -7284480,9968,assets/obseg/chr/CbluecamguardZ,1,1 -7294448,7696,assets/obseg/chr/CbluemanZ,1,1 -7302144,7872,assets/obseg/chr/CbluewomanZ,1,1 -7310016,11280,assets/obseg/chr/CboilerbondZ,1,1 -7321296,13952,assets/obseg/chr/CboilertrevZ,1,1 -7335248,12576,assets/obseg/chr/CborisZ,1,1 -7347824,9952,assets/obseg/chr/CcamguardZ,1,1 -7357776,7680,assets/obseg/chr/CcardimanZ,1,1 -7365456,7808,assets/obseg/chr/CcheckmanZ,1,1 -7373264,9728,assets/obseg/chr/CcommguardZ,1,1 -7382992,11920,assets/obseg/chr/CdjbondZ,1,1 -7394912,7968,assets/obseg/chr/CfattechwomanZ,1,1 -7402880,10016,assets/obseg/chr/Cgreatguard2Z,1,1 -7412896,9856,assets/obseg/chr/CgreatguardZ,1,1 -7422752,9936,assets/obseg/chr/CgreyguardZ,1,1 -7432688,7616,assets/obseg/chr/CgreymanZ,1,1 -7440304,1488,assets/obseg/chr/CheadalanZ,1,1 -7441792,1392,assets/obseg/chr/CheadbZ,1,1 -7443184,976,assets/obseg/chr/CheadbalaclavaZ,1,1 -7444160,1696,assets/obseg/chr/CheadbikeZ,1,1 -7445856,3408,assets/obseg/chr/CheadbrosnanZ,1,1 -7449264,2976,assets/obseg/chr/CheadbrosnanboilerZ,1,1 -7452240,3712,assets/obseg/chr/CheadbrosnansnowZ,1,1 -7455952,3456,assets/obseg/chr/CheadbrosnansuitZ,1,1 -7459408,3008,assets/obseg/chr/CheadbrosnantimberZ,1,1 -7462416,1344,assets/obseg/chr/CheadchrisZ,1,1 -7463760,1408,assets/obseg/chr/CheaddaveZ,1,1 -7465168,1328,assets/obseg/chr/CheaddesZ,1,1 -7466496,1312,assets/obseg/chr/CheadduncanZ,1,1 -7467808,1408,assets/obseg/chr/CheaddwayneZ,1,1 -7469216,1392,assets/obseg/chr/CheadgrahamZ,1,1 -7470608,1328,assets/obseg/chr/CheadgrantZ,1,1 -7471936,1328,assets/obseg/chr/CheadjimZ,1,1 -7473264,1056,assets/obseg/chr/Cheadjoe2Z,1,1 -7474320,1392,assets/obseg/chr/CheadjoeZ,1,1 -7475712,1296,assets/obseg/chr/CheadjoelZ,1,1 -7477008,1376,assets/obseg/chr/CheadkarlZ,1,1 -7478384,1360,assets/obseg/chr/CheadkenZ,1,1 -7479744,1408,assets/obseg/chr/CheadleeZ,1,1 -7481152,1008,assets/obseg/chr/CheadmandyZ,1,1 -7482160,1040,assets/obseg/chr/CheadmarionZ,1,1 -7483200,1328,assets/obseg/chr/CheadmarkZ,1,1 -7484528,1376,assets/obseg/chr/CheadmartinZ,1,1 -7485904,1376,assets/obseg/chr/CheadmishkinZ,1,1 -7487280,1312,assets/obseg/chr/CheadneilZ,1,1 -7488592,1424,assets/obseg/chr/CheadpeteZ,1,1 -7490016,1296,assets/obseg/chr/CheadrobinZ,1,1 -7491312,1024,assets/obseg/chr/CheadsallyZ,1,1 -7492336,1408,assets/obseg/chr/CheadscottZ,1,1 -7493744,1504,assets/obseg/chr/CheadshaunZ,1,1 -7495248,1360,assets/obseg/chr/CheadsteveeZ,1,1 -7496608,1360,assets/obseg/chr/CheadstevehZ,1,1 -7497968,1168,assets/obseg/chr/CheadvivienZ,1,1 -7499136,11328,assets/obseg/chr/CjawsZ,1,1 -7510464,8208,assets/obseg/chr/CjeanwomanZ,1,1 -7518672,11168,assets/obseg/chr/CmaydayZ,1,1 -7529840,8528,assets/obseg/chr/CmoonfemaleZ,1,1 -7538368,9712,assets/obseg/chr/CmoonguardZ,1,1 -7548080,14528,assets/obseg/chr/CnatalyaZ,1,1 -7562608,9952,assets/obseg/chr/CnavyguardZ,1,1 -7572560,12592,assets/obseg/chr/CoddjobZ,1,1 -7585152,9808,assets/obseg/chr/ColiveguardZ,1,1 -7594960,13360,assets/obseg/chr/CorumovZ,1,1 -7608320,12416,assets/obseg/chr/CpilotZ,1,1 -7620736,10032,assets/obseg/chr/CredmanZ,1,1 -7630768,7216,assets/obseg/chr/CrusguardZ,1,1 -7637984,13104,assets/obseg/chr/CsnowbondZ,1,1 -7651088,11392,assets/obseg/chr/CsnowguardZ,1,1 -7662480,14624,assets/obseg/chr/CspicebondZ,1,1 -7677104,12832,assets/obseg/chr/Csuit_lf_handZ,1,1 -7689936,11664,assets/obseg/chr/CsuitbondZ,1,1 -7701600,9904,assets/obseg/chr/CtechmanZ,1,1 -7711504,8176,assets/obseg/chr/CtechwomanZ,1,1 -7719680,11568,assets/obseg/chr/CtimberbondZ,1,1 -7731248,14288,assets/obseg/chr/CtrevelyanZ,1,1 -7745536,9744,assets/obseg/chr/CtrevguardZ,1,1 -7755280,12144,assets/obseg/chr/CvalentinZ,1,1 -7767424,14832,assets/obseg/chr/CxeniaZ,1,1 -7782256,2576,assets/obseg/gun/Gak47Z,1,1 -7784832,912,assets/obseg/gun/GaudiotapeZ,1,1 -7785744,6160,assets/obseg/gun/GautoshotZ,1,1 -7791904,1536,assets/obseg/gun/GblackboxZ,1,1 -7793440,256,assets/obseg/gun/GblueprintsZ,1,1 -7793696,1936,assets/obseg/gun/GbombcaseZ,1,1 -7795632,1520,assets/obseg/gun/GbombdefuserZ,1,1 -7797152,1936,assets/obseg/gun/GbriefcaseZ,1,1 -7799088,2416,assets/obseg/gun/GbugZ,1,1 -7801504,848,assets/obseg/gun/GbugdetectorZ,1,1 -7802352,848,assets/obseg/gun/GbungeeZ,1,1 -7803200,1152,assets/obseg/gun/GcameraZ,1,1 -7804352,608,assets/obseg/gun/GcartblueZ,1,1 -7804960,304,assets/obseg/gun/GcartridgeZ,1,1 -7805264,528,assets/obseg/gun/GcartrifleZ,1,1 -7805792,512,assets/obseg/gun/GcartshellZ,1,1 -7806304,320,assets/obseg/gun/GcircuitboardZ,1,1 -7806624,496,assets/obseg/gun/GclipboardZ,1,1 -7807120,848,assets/obseg/gun/GcreditcardZ,1,1 -7807968,848,assets/obseg/gun/GdarkglassesZ,1,1 -7808816,320,assets/obseg/gun/GdatathiefZ,1,1 -7809136,368,assets/obseg/gun/GdattapeZ,1,1 -7809504,1408,assets/obseg/gun/GdoordecoderZ,1,1 -7810912,848,assets/obseg/gun/GdoorexploderZ,1,1 -7811760,864,assets/obseg/gun/GdossierredZ,1,1 -7812624,848,assets/obseg/gun/GdynamiteZ,1,1 -7813472,592,assets/obseg/gun/GexplosivefloppyZ,1,1 -7814064,848,assets/obseg/gun/GexplosivepenZ,1,1 -7814912,2032,assets/obseg/gun/GextinguisherZ,1,1 -7816944,848,assets/obseg/gun/GfingergunZ,1,1 -7817792,5888,assets/obseg/gun/GfistZ,1,1 -7823680,848,assets/obseg/gun/GflarepistolZ,1,1 -7824528,3232,assets/obseg/gun/Gfnp90Z,1,1 -7827760,2608,assets/obseg/gun/GgaskeyringZ,1,1 -7830368,848,assets/obseg/gun/GgoldbarZ,1,1 -7831216,2480,assets/obseg/gun/GgoldeneyekeyZ,1,1 -7833696,6112,assets/obseg/gun/GgoldengunZ,1,1 -7839808,6496,assets/obseg/gun/GgoldwppkZ,1,1 -7846304,2608,assets/obseg/gun/GgrenadeZ,1,1 -7848912,4224,assets/obseg/gun/GgrenadelaunchZ,1,1 -7853136,848,assets/obseg/gun/GheroinZ,1,1 -7853984,7856,assets/obseg/gun/GjoypadZ,1,1 -7861840,1936,assets/obseg/gun/GkeyanalysercaseZ,1,1 -7863776,2544,assets/obseg/gun/GkeyboltZ,1,1 -7866320,304,assets/obseg/gun/GkeycardZ,1,1 -7866624,3408,assets/obseg/gun/GkeyyaleZ,1,1 -7870032,6864,assets/obseg/gun/GknifeZ,1,1 -7876896,3568,assets/obseg/gun/GlaserZ,1,1 -7880464,848,assets/obseg/gun/GlectreZ,1,1 -7881312,848,assets/obseg/gun/GlockexploderZ,1,1 -7882160,2592,assets/obseg/gun/Gm16Z,1,1 -7884752,240,assets/obseg/gun/GmapZ,1,1 -7884992,1600,assets/obseg/gun/GmicrocameraZ,1,1 -7886592,848,assets/obseg/gun/GmicrocodeZ,1,1 -7887440,848,assets/obseg/gun/GmicrofilmZ,1,1 -7888288,848,assets/obseg/gun/GmoneyZ,1,1 -7889136,3040,assets/obseg/gun/Gmp5kZ,1,1 -7892176,3328,assets/obseg/gun/Gmp5ksilZ,1,1 -7895504,848,assets/obseg/gun/GpitongunZ,1,1 -7896352,464,assets/obseg/gun/GplansZ,1,1 -7896816,848,assets/obseg/gun/GplastiqueZ,1,1 -7897664,1376,assets/obseg/gun/GpolarizedglassesZ,1,1 -7899040,2032,assets/obseg/gun/GproximitymineZ,1,1 -7901072,2496,assets/obseg/gun/GremotemineZ,1,1 -7903568,4640,assets/obseg/gun/GrocketlaunchZ,1,1 -7908208,7568,assets/obseg/gun/GrugerZ,1,1 -7915776,1936,assets/obseg/gun/GsafecrackercaseZ,1,1 -7917712,3808,assets/obseg/gun/GshotgunZ,1,1 -7921520,6496,assets/obseg/gun/GsilverwppkZ,1,1 -7928016,4608,assets/obseg/gun/GskorpionZ,1,1 -7932624,4208,assets/obseg/gun/GsniperrifleZ,1,1 -7936832,3200,assets/obseg/gun/GspectreZ,1,1 -7940032,848,assets/obseg/gun/GspooltapeZ,1,1 -7940880,848,assets/obseg/gun/GspyfileZ,1,1 -7941728,416,assets/obseg/gun/GstafflistZ,1,1 -7942144,7776,assets/obseg/gun/GtaserZ,1,1 -7949920,6896,assets/obseg/gun/GthrowknifeZ,1,1 -7956816,2752,assets/obseg/gun/GtimedmineZ,1,1 -7959568,13312,assets/obseg/gun/GtriggerZ,1,1 -7972880,6944,assets/obseg/gun/Gtt33Z,1,1 -7979824,2320,assets/obseg/gun/GuziZ,1,1 -7982144,528,assets/obseg/gun/GvideotapeZ,1,1 -7982672,5216,assets/obseg/gun/GwatchcommunicatorZ,1,1 -7987888,5216,assets/obseg/gun/GwatchgeigercounterZ,1,1 -7993104,5216,assets/obseg/gun/GwatchidentifierZ,1,1 -7998320,13312,assets/obseg/gun/GwatchlaserZ,1,1 -8011632,5200,assets/obseg/gun/GwatchmagnetattractZ,1,1 -8016832,5216,assets/obseg/gun/GwatchmagnetrepelZ,1,1 -8022048,1936,assets/obseg/gun/GweaponcaseZ,1,1 -8023984,7312,assets/obseg/gun/GwppkZ,1,1 -8031296,7488,assets/obseg/gun/GwppksilZ,1,1 -8038784,848,assets/obseg/gun/GwristdartZ,1,1 -8039632,9600,assets/obseg/prop/PICBMZ,1,1 -8049232,1968,assets/obseg/prop/PICBM_noseZ,1,1 -8051200,480,assets/obseg/prop/Pak47magZ,1,1 -8051680,352,assets/obseg/prop/Palarm1Z,1,1 -8052032,416,assets/obseg/prop/Palarm2Z,1,1 -8052448,576,assets/obseg/prop/Pammo_crate1Z,1,1 -8053024,576,assets/obseg/prop/Pammo_crate2Z,1,1 -8053600,592,assets/obseg/prop/Pammo_crate3Z,1,1 -8054192,624,assets/obseg/prop/Pammo_crate4Z,1,1 -8054816,704,assets/obseg/prop/Pammo_crate5Z,1,1 -8055520,7264,assets/obseg/prop/PapcZ,1,1 -8062784,480,assets/obseg/prop/Parchsecdoor1Z,1,1 -8063264,464,assets/obseg/prop/Parchsecdoor2Z,1,1 -8063728,3584,assets/obseg/prop/ParticZ,1,1 -8067312,2320,assets/obseg/prop/PartictrailerZ,1,1 -8069632,576,assets/obseg/prop/PbarricadeZ,1,1 -8070208,848,assets/obseg/prop/Pbin1Z,1,1 -8071056,224,assets/obseg/prop/Pblotter1Z,1,1 -8071280,1184,assets/obseg/prop/PbodyarmourZ,1,1 -8072464,1056,assets/obseg/prop/PbodyarmourvestZ,1,1 -8073520,512,assets/obseg/prop/PbollardZ,1,1 -8074032,368,assets/obseg/prop/PbombZ,1,1 -8074400,400,assets/obseg/prop/Pbook1Z,1,1 -8074800,1776,assets/obseg/prop/Pbookshelf1Z,1,1 -8076576,368,assets/obseg/prop/Pborg_crateZ,1,1 -8076944,512,assets/obseg/prop/PboxcartridgesZ,1,1 -8077456,1072,assets/obseg/prop/Pboxes2x4Z,1,1 -8078528,1088,assets/obseg/prop/Pboxes3x4Z,1,1 -8079616,1632,assets/obseg/prop/Pboxes4x4Z,1,1 -8081248,880,assets/obseg/prop/PbrakeunitZ,1,1 -8082128,1408,assets/obseg/prop/Pbridge_console1aZ,1,1 -8083536,1376,assets/obseg/prop/Pbridge_console1bZ,1,1 -8084912,1408,assets/obseg/prop/Pbridge_console2aZ,1,1 -8086320,1264,assets/obseg/prop/Pbridge_console2bZ,1,1 -8087584,1360,assets/obseg/prop/Pbridge_console3aZ,1,1 -8088944,1424,assets/obseg/prop/Pbridge_console3bZ,1,1 -8090368,3296,assets/obseg/prop/PcarbmwZ,1,1 -8093664,512,assets/obseg/prop/Pcard_box1Z,1,1 -8094176,576,assets/obseg/prop/Pcard_box2Z,1,1 -8094752,496,assets/obseg/prop/Pcard_box3Z,1,1 -8095248,432,assets/obseg/prop/Pcard_box4Z,1,1 -8095680,512,assets/obseg/prop/Pcard_box5Z,1,1 -8096192,496,assets/obseg/prop/Pcard_box6Z,1,1 -8096688,3072,assets/obseg/prop/PcarescortZ,1,1 -8099760,3120,assets/obseg/prop/PcargolfZ,1,1 -8102880,4416,assets/obseg/prop/PcarweirdZ,1,1 -8107296,5632,assets/obseg/prop/PcarzilZ,1,1 -8112928,896,assets/obseg/prop/PcctvZ,1,1 -8113824,1376,assets/obseg/prop/PchraudiotapeZ,1,1 -8115200,864,assets/obseg/prop/PchrautoshotZ,1,1 -8116064,2176,assets/obseg/prop/PchrblackboxZ,1,1 -8118240,336,assets/obseg/prop/PchrblueprintsZ,1,1 -8118576,496,assets/obseg/prop/PchrbombcaseZ,1,1 -8119072,2272,assets/obseg/prop/PchrbombdefuserZ,1,1 -8121344,400,assets/obseg/prop/PchrbriefcaseZ,1,1 -8121744,3504,assets/obseg/prop/PchrbugZ,1,1 -8125248,368,assets/obseg/prop/PchrbugdetectorZ,1,1 -8125616,368,assets/obseg/prop/PchrbungeeZ,1,1 -8125984,1680,assets/obseg/prop/PchrcameraZ,1,1 -8127664,416,assets/obseg/prop/PchrcircuitboardZ,1,1 -8128080,640,assets/obseg/prop/PchrclipboardZ,1,1 -8128720,368,assets/obseg/prop/PchrcreditcardZ,1,1 -8129088,368,assets/obseg/prop/PchrdarkglassesZ,1,1 -8129456,416,assets/obseg/prop/PchrdatathiefZ,1,1 -8129872,496,assets/obseg/prop/PchrdattapeZ,1,1 -8130368,2144,assets/obseg/prop/PchrdoordecoderZ,1,1 -8132512,368,assets/obseg/prop/PchrdoorexploderZ,1,1 -8132880,1232,assets/obseg/prop/PchrdossierredZ,1,1 -8134112,368,assets/obseg/prop/PchrdynamiteZ,1,1 -8134480,368,assets/obseg/prop/PchrexplosivepenZ,1,1 -8134848,1280,assets/obseg/prop/PchrextinguisherZ,1,1 -8136128,368,assets/obseg/prop/PchrfingergunZ,1,1 -8136496,368,assets/obseg/prop/PchrflarepistolZ,1,1 -8136864,1120,assets/obseg/prop/Pchrfnp90Z,1,1 -8137984,3856,assets/obseg/prop/PchrgaskeyringZ,1,1 -8141840,368,assets/obseg/prop/PchrgoldbarZ,1,1 -8142208,624,assets/obseg/prop/PchrgoldenZ,1,1 -8142832,3744,assets/obseg/prop/PchrgoldeneyekeyZ,1,1 -8146576,368,assets/obseg/prop/PchrgoldwppkZ,1,1 -8146944,880,assets/obseg/prop/PchrgrenadeZ,1,1 -8147824,912,assets/obseg/prop/PchrgrenadelaunchZ,1,1 -8148736,624,assets/obseg/prop/PchrgrenaderoundZ,1,1 -8149360,368,assets/obseg/prop/PchrheroinZ,1,1 -8149728,1008,assets/obseg/prop/PchrkalashZ,1,1 -8150736,496,assets/obseg/prop/PchrkeyanalysercaseZ,1,1 -8151232,3744,assets/obseg/prop/PchrkeyboltZ,1,1 -8154976,5216,assets/obseg/prop/PchrkeyyaleZ,1,1 -8160192,512,assets/obseg/prop/PchrknifeZ,1,1 -8160704,960,assets/obseg/prop/PchrlaserZ,1,1 -8161664,368,assets/obseg/prop/PchrlectreZ,1,1 -8162032,368,assets/obseg/prop/PchrlockexploderZ,1,1 -8162400,976,assets/obseg/prop/Pchrm16Z,1,1 -8163376,336,assets/obseg/prop/PchrmapZ,1,1 -8163712,2288,assets/obseg/prop/PchrmicrocameraZ,1,1 -8166000,368,assets/obseg/prop/PchrmicrocodeZ,1,1 -8166368,368,assets/obseg/prop/PchrmicrofilmZ,1,1 -8166736,368,assets/obseg/prop/PchrmoneyZ,1,1 -8167104,896,assets/obseg/prop/Pchrmp5kZ,1,1 -8168000,1040,assets/obseg/prop/Pchrmp5ksilZ,1,1 -8169040,368,assets/obseg/prop/PchrpitongunZ,1,1 -8169408,656,assets/obseg/prop/PchrplansZ,1,1 -8170064,1120,assets/obseg/prop/PchrplastiqueZ,1,1 -8171184,2240,assets/obseg/prop/PchrpolarizedglassesZ,1,1 -8173424,1120,assets/obseg/prop/PchrproximitymineZ,1,1 -8174544,1120,assets/obseg/prop/PchrremotemineZ,1,1 -8175664,1456,assets/obseg/prop/PchrrocketZ,1,1 -8177120,992,assets/obseg/prop/PchrrocketlaunchZ,1,1 -8178112,992,assets/obseg/prop/PchrrugerZ,1,1 -8179104,496,assets/obseg/prop/PchrsafecrackercaseZ,1,1 -8179600,848,assets/obseg/prop/PchrshotgunZ,1,1 -8180448,368,assets/obseg/prop/PchrsilverwppkZ,1,1 -8180816,896,assets/obseg/prop/PchrskorpionZ,1,1 -8181712,912,assets/obseg/prop/PchrsniperrifleZ,1,1 -8182624,880,assets/obseg/prop/PchrspectreZ,1,1 -8183504,368,assets/obseg/prop/PchrspooltapeZ,1,1 -8183872,368,assets/obseg/prop/PchrspyfileZ,1,1 -8184240,544,assets/obseg/prop/PchrstafflistZ,1,1 -8184784,448,assets/obseg/prop/PchrtesttubeZ,1,1 -8185232,544,assets/obseg/prop/PchrthrowknifeZ,1,1 -8185776,1328,assets/obseg/prop/PchrtimedmineZ,1,1 -8187104,656,assets/obseg/prop/Pchrtt33Z,1,1 -8187760,720,assets/obseg/prop/PchruziZ,1,1 -8188480,720,assets/obseg/prop/PchrvideotapeZ,1,1 -8189200,512,assets/obseg/prop/PchrweaponcaseZ,1,1 -8189712,576,assets/obseg/prop/PchrwppkZ,1,1 -8190288,736,assets/obseg/prop/PchrwppksilZ,1,1 -8191024,368,assets/obseg/prop/PchrwristdartZ,1,1 -8191392,1664,assets/obseg/prop/Pconsole1Z,1,1 -8193056,1664,assets/obseg/prop/Pconsole2Z,1,1 -8194720,1680,assets/obseg/prop/Pconsole3Z,1,1 -8196400,1056,assets/obseg/prop/Pconsole_sev2aZ,1,1 -8197456,1216,assets/obseg/prop/Pconsole_sev2bZ,1,1 -8198672,1088,assets/obseg/prop/Pconsole_sev2cZ,1,1 -8199760,1072,assets/obseg/prop/Pconsole_sev2dZ,1,1 -8200832,1072,assets/obseg/prop/Pconsole_sev_GEaZ,1,1 -8201904,1072,assets/obseg/prop/Pconsole_sev_GEbZ,1,1 -8202976,1152,assets/obseg/prop/Pconsole_sevaZ,1,1 -8204128,1136,assets/obseg/prop/Pconsole_sevbZ,1,1 -8205264,1072,assets/obseg/prop/Pconsole_sevcZ,1,1 -8206336,1072,assets/obseg/prop/Pconsole_sevdZ,1,1 -8207408,400,assets/obseg/prop/Pcryptdoor1aZ,1,1 -8207808,400,assets/obseg/prop/Pcryptdoor1bZ,1,1 -8208208,400,assets/obseg/prop/Pcryptdoor2aZ,1,1 -8208608,400,assets/obseg/prop/Pcryptdoor2bZ,1,1 -8209008,624,assets/obseg/prop/Pcryptdoor3Z,1,1 -8209632,384,assets/obseg/prop/Pcryptdoor4Z,1,1 -8210016,640,assets/obseg/prop/PdamchaindoorZ,1,1 -8210656,544,assets/obseg/prop/PdamgatedoorZ,1,1 -8211200,880,assets/obseg/prop/PdamtundoorZ,1,1 -8212080,416,assets/obseg/prop/Pdepot_door_steelZ,1,1 -8212496,576,assets/obseg/prop/Pdepot_gate_entryZ,1,1 -8213072,384,assets/obseg/prop/Pdesk1Z,1,1 -8213456,384,assets/obseg/prop/Pdesk2Z,1,1 -8213840,576,assets/obseg/prop/Pdesk_arecibo1Z,1,1 -8214416,768,assets/obseg/prop/Pdesk_lamp2Z,1,1 -8215184,6384,assets/obseg/prop/Pdest_engineZ,1,1 -8221568,1632,assets/obseg/prop/Pdest_exocetZ,1,1 -8223200,1648,assets/obseg/prop/Pdest_gunZ,1,1 -8224848,2208,assets/obseg/prop/Pdest_harpoonZ,1,1 -8227056,4016,assets/obseg/prop/Pdest_seawolfZ,1,1 -8231072,448,assets/obseg/prop/Pdisc_readerZ,1,1 -8231520,400,assets/obseg/prop/Pdisk_drive1Z,1,1 -8231920,384,assets/obseg/prop/Pdoor_azt_chairZ,1,1 -8232304,1088,assets/obseg/prop/Pdoor_azt_deskZ,1,1 -8233392,912,assets/obseg/prop/Pdoor_azt_desk_topZ,1,1 -8234304,560,assets/obseg/prop/Pdoor_aztecZ,1,1 -8234864,768,assets/obseg/prop/Pdoor_dest1Z,1,1 -8235632,960,assets/obseg/prop/Pdoor_dest2Z,1,1 -8236592,1376,assets/obseg/prop/Pdoor_eyelidZ,1,1 -8237968,2640,assets/obseg/prop/Pdoor_irisZ,1,1 -8240608,752,assets/obseg/prop/Pdoor_mfZ,1,1 -8241360,880,assets/obseg/prop/Pdoor_roller1Z,1,1 -8242240,576,assets/obseg/prop/Pdoor_roller2Z,1,1 -8242816,576,assets/obseg/prop/Pdoor_roller3Z,1,1 -8243392,608,assets/obseg/prop/Pdoor_roller4Z,1,1 -8244000,304,assets/obseg/prop/Pdoor_rollertrainZ,1,1 -8244304,608,assets/obseg/prop/Pdoor_st_arec1Z,1,1 -8244912,736,assets/obseg/prop/Pdoor_st_arec2Z,1,1 -8245648,416,assets/obseg/prop/Pdoor_winZ,1,1 -8246064,1136,assets/obseg/prop/PdoorconsoleZ,1,1 -8247200,880,assets/obseg/prop/PdoorpanelZ,1,1 -8248080,336,assets/obseg/prop/Pdoorprison1Z,1,1 -8248416,512,assets/obseg/prop/PdoorstatgateZ,1,1 -8248928,288,assets/obseg/prop/PexplosionbitZ,1,1 -8249216,384,assets/obseg/prop/Pfiling_cabinet1Z,1,1 -8249600,304,assets/obseg/prop/PflagZ,1,1 -8249904,800,assets/obseg/prop/PfloppyZ,1,1 -8250704,416,assets/obseg/prop/Pfnp90magZ,1,1 -8251120,896,assets/obseg/prop/Pgas_plant_met1_do1Z,1,1 -8252016,480,assets/obseg/prop/Pgas_plant_sw2_do1Z,1,1 -8252496,512,assets/obseg/prop/Pgas_plant_sw3_do1Z,1,1 -8253008,352,assets/obseg/prop/Pgas_plant_sw4_do1Z,1,1 -8253360,656,assets/obseg/prop/Pgas_plant_sw_do1Z,1,1 -8254016,528,assets/obseg/prop/Pgas_plant_wc_cub1Z,1,1 -8254544,528,assets/obseg/prop/PgasbarrelZ,1,1 -8255072,1344,assets/obseg/prop/PgasbarrelsZ,1,1 -8256416,1376,assets/obseg/prop/Pgasplant_clear_doorZ,1,1 -8257792,1456,assets/obseg/prop/PgastankZ,1,1 -8259248,352,assets/obseg/prop/Pglassware1Z,1,1 -8259600,656,assets/obseg/prop/Pglassware2Z,1,1 -8260256,528,assets/obseg/prop/Pglassware3Z,1,1 -8260784,1408,assets/obseg/prop/Pglassware4Z,1,1 -8262192,3760,assets/obseg/prop/PgoldeneyelogoZ,1,1 -8265952,512,assets/obseg/prop/PgoldenshellsZ,1,1 -8266464,2000,assets/obseg/prop/PgroundgunZ,1,1 -8268464,1856,assets/obseg/prop/Pgun_runway1Z,1,1 -8270320,672,assets/obseg/prop/PhatberetZ,1,1 -8270992,720,assets/obseg/prop/PhatberetblueZ,1,1 -8271712,736,assets/obseg/prop/PhatberetredZ,1,1 -8272448,208,assets/obseg/prop/PhatchboltZ,1,1 -8272656,544,assets/obseg/prop/PhatchdoorZ,1,1 -8273200,368,assets/obseg/prop/PhatchsevxZ,1,1 -8273568,560,assets/obseg/prop/PhatfurryZ,1,1 -8274128,544,assets/obseg/prop/PhatfurryblackZ,1,1 -8274672,528,assets/obseg/prop/PhatfurrybrownZ,1,1 -8275200,560,assets/obseg/prop/PhathelmetZ,1,1 -8275760,560,assets/obseg/prop/PhathelmetgreyZ,1,1 -8276320,992,assets/obseg/prop/PhatmoonZ,1,1 -8277312,784,assets/obseg/prop/PhatpeakedZ,1,1 -8278096,592,assets/obseg/prop/PhattbirdZ,1,1 -8278688,624,assets/obseg/prop/PhattbirdbrownZ,1,1 -8279312,16928,assets/obseg/prop/PhelicopterZ,1,1 -8296240,6000,assets/obseg/prop/PhindZ,1,1 -8302240,4448,assets/obseg/prop/PjeepZ,1,1 -8306688,608,assets/obseg/prop/Pjerry_can1Z,1,1 -8307296,1920,assets/obseg/prop/Pjungle3_treeZ,1,1 -8309216,1328,assets/obseg/prop/Pjungle5_treeZ,1,1 -8310544,848,assets/obseg/prop/Pkey_holderZ,1,1 -8311392,368,assets/obseg/prop/Pkeyboard1Z,1,1 -8311760,672,assets/obseg/prop/Pkit_units1Z,1,1 -8312432,976,assets/obseg/prop/PlabbenchZ,1,1 -8313408,624,assets/obseg/prop/PlandmineZ,1,1 -8314032,4032,assets/obseg/prop/PlegalpageZ,1,1 -8318064,352,assets/obseg/prop/Pletter_tray1Z,1,1 -8318416,400,assets/obseg/prop/Plocker3Z,1,1 -8318816,400,assets/obseg/prop/Plocker4Z,1,1 -8319216,320,assets/obseg/prop/Pm16magZ,1,1 -8319536,512,assets/obseg/prop/PmagnumshellsZ,1,1 -8320048,768,assets/obseg/prop/Pmainframe1Z,1,1 -8320816,720,assets/obseg/prop/Pmainframe2Z,1,1 -8321536,832,assets/obseg/prop/Pmetal_chair1Z,1,1 -8322368,448,assets/obseg/prop/Pmetal_crate1Z,1,1 -8322816,448,assets/obseg/prop/Pmetal_crate2Z,1,1 -8323264,448,assets/obseg/prop/Pmetal_crate3Z,1,1 -8323712,448,assets/obseg/prop/Pmetal_crate4Z,1,1 -8324160,6368,assets/obseg/prop/PmilcopterZ,1,1 -8330528,8960,assets/obseg/prop/PmiltruckZ,1,1 -8339488,2576,assets/obseg/prop/Pmissile_rack2Z,1,1 -8342064,992,assets/obseg/prop/Pmissile_rackZ,1,1 -8343056,832,assets/obseg/prop/PmodemboxZ,1,1 -8343888,3776,assets/obseg/prop/PmotorbikeZ,1,1 -8347664,336,assets/obseg/prop/Pmp5kmagZ,1,1 -8348000,10976,assets/obseg/prop/PnintendologoZ,1,1 -8358976,624,assets/obseg/prop/Poil_drum1Z,1,1 -8359600,752,assets/obseg/prop/Poil_drum2Z,1,1 -8360352,752,assets/obseg/prop/Poil_drum3Z,1,1 -8361104,752,assets/obseg/prop/Poil_drum5Z,1,1 -8361856,784,assets/obseg/prop/Poil_drum6Z,1,1 -8362640,768,assets/obseg/prop/Poil_drum7Z,1,1 -8363408,2640,assets/obseg/prop/PpadlockZ,1,1 -8366048,1104,assets/obseg/prop/PpalmZ,1,1 -8367152,1232,assets/obseg/prop/PpalmtreeZ,1,1 -8368384,320,assets/obseg/prop/Pphone1Z,1,1 -8368704,9696,assets/obseg/prop/PplaneZ,1,1 -8378400,960,assets/obseg/prop/Pplant11Z,1,1 -8379360,912,assets/obseg/prop/Pplant1Z,1,1 -8380272,864,assets/obseg/prop/Pplant2Z,1,1 -8381136,1040,assets/obseg/prop/Pplant2bZ,1,1 -8382176,1104,assets/obseg/prop/Pplant3Z,1,1 -8383280,432,assets/obseg/prop/Pradio_unit1Z,1,1 -8383712,448,assets/obseg/prop/Pradio_unit2Z,1,1 -8384160,448,assets/obseg/prop/Pradio_unit3Z,1,1 -8384608,448,assets/obseg/prop/Pradio_unit4Z,1,1 -8385056,1632,assets/obseg/prop/ProofgunZ,1,1 -8386688,848,assets/obseg/prop/PsafeZ,1,1 -8387536,1264,assets/obseg/prop/PsafedoorZ,1,1 -8388800,5488,assets/obseg/prop/Psat1_reflectZ,1,1 -8394288,288,assets/obseg/prop/PsatboxZ,1,1 -8394576,1120,assets/obseg/prop/PsatdishZ,1,1 -8395696,416,assets/obseg/prop/Psec_panelZ,1,1 -8396112,656,assets/obseg/prop/Psev_door3Z,1,1 -8396768,912,assets/obseg/prop/Psev_door3_windZ,1,1 -8397680,992,assets/obseg/prop/Psev_door4_windZ,1,1 -8398672,848,assets/obseg/prop/Psev_doorZ,1,1 -8399520,816,assets/obseg/prop/Psev_door_v1Z,1,1 -8400336,944,assets/obseg/prop/Psev_trislideZ,1,1 -8401280,3872,assets/obseg/prop/PsevdishZ,1,1 -8405152,736,assets/obseg/prop/PsevdoormetslideZ,1,1 -8405888,368,assets/obseg/prop/PsevdoornowindZ,1,1 -8406256,1072,assets/obseg/prop/PsevdoorwindZ,1,1 -8407328,944,assets/obseg/prop/PsevdoorwoodZ,1,1 -8408272,10752,assets/obseg/prop/PshuttleZ,1,1 -8419024,3120,assets/obseg/prop/Pshuttle_door_lZ,1,1 -8422144,3328,assets/obseg/prop/Pshuttle_door_rZ,1,1 -8425472,416,assets/obseg/prop/PsilencerZ,1,1 -8425888,576,assets/obseg/prop/Psilo_lift_doorZ,1,1 -8426464,752,assets/obseg/prop/PsilotopdoorZ,1,1 -8427216,352,assets/obseg/prop/PskorpionmagZ,1,1 -8427568,368,assets/obseg/prop/PspectremagZ,1,1 -8427936,3392,assets/obseg/prop/PspeedboatZ,1,1 -8431328,12608,assets/obseg/prop/Pst_pete_room_1iZ,1,1 -8443936,12768,assets/obseg/prop/Pst_pete_room_2iZ,1,1 -8456704,12096,assets/obseg/prop/Pst_pete_room_3tZ,1,1 -8468800,13712,assets/obseg/prop/Pst_pete_room_5cZ,1,1 -8482512,13328,assets/obseg/prop/Pst_pete_room_6cZ,1,1 -8495840,624,assets/obseg/prop/Psteel_door1Z,1,1 -8496464,688,assets/obseg/prop/Psteel_door2Z,1,1 -8497152,720,assets/obseg/prop/Psteel_door2bZ,1,1 -8497872,720,assets/obseg/prop/Psteel_door3Z,1,1 -8498592,704,assets/obseg/prop/Pstool1Z,1,1 -8499296,400,assets/obseg/prop/Pswipe_card2Z,1,1 -8499696,656,assets/obseg/prop/Pswivel_chair1Z,1,1 -8500352,6816,assets/obseg/prop/PtankZ,1,1 -8507168,7824,assets/obseg/prop/PtigerZ,1,1 -8514992,2176,assets/obseg/prop/Ptorpedo_rackZ,1,1 -8517168,976,assets/obseg/prop/Ptrain_door2Z,1,1 -8518144,1056,assets/obseg/prop/Ptrain_door3Z,1,1 -8519200,624,assets/obseg/prop/Ptrain_doorZ,1,1 -8519824,832,assets/obseg/prop/PtrainextdoorZ,1,1 -8520656,320,assets/obseg/prop/Ptt33magZ,1,1 -8520976,1312,assets/obseg/prop/Ptuning_console1Z,1,1 -8522288,464,assets/obseg/prop/Ptv1Z,1,1 -8522752,416,assets/obseg/prop/Ptv4screenZ,1,1 -8523168,1744,assets/obseg/prop/Ptv_holderZ,1,1 -8524912,208,assets/obseg/prop/PtvscreenZ,1,1 -8525120,320,assets/obseg/prop/PuzimagZ,1,1 -8525440,1552,assets/obseg/prop/PvertdoorZ,1,1 -8526992,5552,assets/obseg/prop/PwalletbondZ,1,1 -8532544,240,assets/obseg/prop/PwindowZ,1,1 -8532784,224,assets/obseg/prop/Pwindow_cor11Z,1,1 -8533008,224,assets/obseg/prop/Pwindow_lib_lg1Z,1,1 -8533232,240,assets/obseg/prop/Pwindow_lib_sm1Z,1,1 -8533472,640,assets/obseg/prop/Pwood_lg_crate1Z,1,1 -8534112,544,assets/obseg/prop/Pwood_lg_crate2Z,1,1 -8534656,544,assets/obseg/prop/Pwood_md_crate3Z,1,1 -8535200,608,assets/obseg/prop/Pwood_sm_crate4Z,1,1 -8535808,608,assets/obseg/prop/Pwood_sm_crate5Z,1,1 -8536416,544,assets/obseg/prop/Pwood_sm_crate6Z,1,1 -8536960,880,assets/obseg/prop/Pwooden_table1Z,1,1 -8537840,320,assets/obseg/prop/PwppkmagZ,1,1 -8538160,6448,assets/obseg/stan/Tbg_ame_all_p_stanZ,1,1 -8544608,23792,assets/obseg/stan/Tbg_arch_all_p_stanZ,1,1 -8568400,33616,assets/obseg/stan/Tbg_arec_all_p_stanZ,1,1 -8602016,36800,assets/obseg/stan/Tbg_ark_all_p_stanZ,1,1 -8638816,6448,assets/obseg/stan/Tbg_ash_all_p_stanZ,1,1 -8645264,21888,assets/obseg/stan/Tbg_azt_all_p_stanZ,1,1 -8667152,10032,assets/obseg/stan/Tbg_cat_all_p_stanZ,1,1 -8677184,20208,assets/obseg/stan/Tbg_cave_all_p_stanZ,1,1 -8697392,10512,assets/obseg/stan/Tbg_crad_all_p_stanZ,1,1 -8707904,12400,assets/obseg/stan/Tbg_cryp_all_p_stanZ,1,1 -8720304,41952,assets/obseg/stan/Tbg_dam_all_p_stanZ,1,1 -8762256,28480,assets/obseg/stan/Tbg_depo_all_p_stanZ,1,1 -8790736,26864,assets/obseg/stan/Tbg_dest_all_p_stanZ,1,1 -8817600,2832,assets/obseg/stan/Tbg_dish_all_p_stanZ,1,1 -8820432,6448,assets/obseg/stan/Tbg_imp_all_p_stanZ,1,1 -8826880,29008,assets/obseg/stan/Tbg_jun_all_p_stanZ,1,1 -8855888,2752,assets/obseg/stan/Tbg_len_all_p_stanZ,1,1 -8858640,6400,assets/obseg/stan/Tbg_oat_all_p_stanZ,1,1 -8865040,18064,assets/obseg/stan/Tbg_pete_all_p_stanZ,1,1 -8883104,7632,assets/obseg/stan/Tbg_ref_all_p_stanZ,1,1 -8890736,6784,assets/obseg/stan/Tbg_run_all_p_stanZ,1,1 -8897520,15824,assets/obseg/stan/Tbg_sev_all_p_stanZ,1,1 -8913344,20288,assets/obseg/stan/Tbg_sevb_all_p_stanZ,1,1 -8933632,37680,assets/obseg/stan/Tbg_sevx_all_p_stanZ,1,1 -8971312,37024,assets/obseg/stan/Tbg_silo_all_p_stanZ,1,1 -9008336,20160,assets/obseg/stan/Tbg_stat_all_p_stanZ,1,1 -9028496,9168,assets/obseg/stan/Tbg_tra_all_p_stanZ,1,1 +7261072,9344,assets/obseg/chr/CarmourguardZ.bin,1,1 +7270416,14064,assets/obseg/chr/CbaronsamediZ.bin,1,1 +7284480,9968,assets/obseg/chr/CbluecamguardZ.bin,1,1 +7294448,7696,assets/obseg/chr/CbluemanZ.bin,1,1 +7302144,7872,assets/obseg/chr/CbluewomanZ.bin,1,1 +7310016,11280,assets/obseg/chr/CboilerbondZ.bin,1,1 +7321296,13952,assets/obseg/chr/CboilertrevZ.bin,1,1 +7335248,12576,assets/obseg/chr/CborisZ.bin,1,1 +7347824,9952,assets/obseg/chr/CcamguardZ.bin,1,1 +7357776,7680,assets/obseg/chr/CcardimanZ.bin,1,1 +7365456,7808,assets/obseg/chr/CcheckmanZ.bin,1,1 +7373264,9728,assets/obseg/chr/CcommguardZ.bin,1,1 +7382992,11920,assets/obseg/chr/CdjbondZ.bin,1,1 +7394912,7968,assets/obseg/chr/CfattechwomanZ.bin,1,1 +7402880,10016,assets/obseg/chr/Cgreatguard2Z.bin,1,1 +7412896,9856,assets/obseg/chr/CgreatguardZ.bin,1,1 +7422752,9936,assets/obseg/chr/CgreyguardZ.bin,1,1 +7432688,7616,assets/obseg/chr/CgreymanZ.bin,1,1 +7440304,1488,assets/obseg/chr/CheadalanZ.bin,1,1 +7441792,1392,assets/obseg/chr/CheadbZ.bin,1,1 +7443184,976,assets/obseg/chr/CheadbalaclavaZ.bin,1,1 +7444160,1696,assets/obseg/chr/CheadbikeZ.bin,1,1 +7445856,3408,assets/obseg/chr/CheadbrosnanZ.bin,1,1 +7449264,2976,assets/obseg/chr/CheadbrosnanboilerZ.bin,1,1 +7452240,3712,assets/obseg/chr/CheadbrosnansnowZ.bin,1,1 +7455952,3456,assets/obseg/chr/CheadbrosnansuitZ.bin,1,1 +7459408,3008,assets/obseg/chr/CheadbrosnantimberZ.bin,1,1 +7462416,1344,assets/obseg/chr/CheadchrisZ.bin,1,1 +7463760,1408,assets/obseg/chr/CheaddaveZ.bin,1,1 +7465168,1328,assets/obseg/chr/CheaddesZ.bin,1,1 +7466496,1312,assets/obseg/chr/CheadduncanZ.bin,1,1 +7467808,1408,assets/obseg/chr/CheaddwayneZ.bin,1,1 +7469216,1392,assets/obseg/chr/CheadgrahamZ.bin,1,1 +7470608,1328,assets/obseg/chr/CheadgrantZ.bin,1,1 +7471936,1328,assets/obseg/chr/CheadjimZ.bin,1,1 +7473264,1056,assets/obseg/chr/Cheadjoe2Z.bin,1,1 +7474320,1392,assets/obseg/chr/CheadjoeZ.bin,1,1 +7475712,1296,assets/obseg/chr/CheadjoelZ.bin,1,1 +7477008,1376,assets/obseg/chr/CheadkarlZ.bin,1,1 +7478384,1360,assets/obseg/chr/CheadkenZ.bin,1,1 +7479744,1408,assets/obseg/chr/CheadleeZ.bin,1,1 +7481152,1008,assets/obseg/chr/CheadmandyZ.bin,1,1 +7482160,1040,assets/obseg/chr/CheadmarionZ.bin,1,1 +7483200,1328,assets/obseg/chr/CheadmarkZ.bin,1,1 +7484528,1376,assets/obseg/chr/CheadmartinZ.bin,1,1 +7485904,1376,assets/obseg/chr/CheadmishkinZ.bin,1,1 +7487280,1312,assets/obseg/chr/CheadneilZ.bin,1,1 +7488592,1424,assets/obseg/chr/CheadpeteZ.bin,1,1 +7490016,1296,assets/obseg/chr/CheadrobinZ.bin,1,1 +7491312,1024,assets/obseg/chr/CheadsallyZ.bin,1,1 +7492336,1408,assets/obseg/chr/CheadscottZ.bin,1,1 +7493744,1504,assets/obseg/chr/CheadshaunZ.bin,1,1 +7495248,1360,assets/obseg/chr/CheadsteveeZ.bin,1,1 +7496608,1360,assets/obseg/chr/CheadstevehZ.bin,1,1 +7497968,1168,assets/obseg/chr/CheadvivienZ.bin,1,1 +7499136,11328,assets/obseg/chr/CjawsZ.bin,1,1 +7510464,8208,assets/obseg/chr/CjeanwomanZ.bin,1,1 +7518672,11168,assets/obseg/chr/CmaydayZ.bin,1,1 +7529840,8528,assets/obseg/chr/CmoonfemaleZ.bin,1,1 +7538368,9712,assets/obseg/chr/CmoonguardZ.bin,1,1 +7548080,14528,assets/obseg/chr/CnatalyaZ.bin,1,1 +7562608,9952,assets/obseg/chr/CnavyguardZ.bin,1,1 +7572560,12592,assets/obseg/chr/CoddjobZ.bin,1,1 +7585152,9808,assets/obseg/chr/ColiveguardZ.bin,1,1 +7594960,13360,assets/obseg/chr/CorumovZ.bin,1,1 +7608320,12416,assets/obseg/chr/CpilotZ.bin,1,1 +7620736,10032,assets/obseg/chr/CredmanZ.bin,1,1 +7630768,7216,assets/obseg/chr/CrusguardZ.bin,1,1 +7637984,13104,assets/obseg/chr/CsnowbondZ.bin,1,1 +7651088,11392,assets/obseg/chr/CsnowguardZ.bin,1,1 +7662480,14624,assets/obseg/chr/CspicebondZ.bin,1,1 +7677104,12832,assets/obseg/chr/Csuit_lf_handZ.bin,1,1 +7689936,11664,assets/obseg/chr/CsuitbondZ.bin,1,1 +7701600,9904,assets/obseg/chr/CtechmanZ.bin,1,1 +7711504,8176,assets/obseg/chr/CtechwomanZ.bin,1,1 +7719680,11568,assets/obseg/chr/CtimberbondZ.bin,1,1 +7731248,14288,assets/obseg/chr/CtrevelyanZ.bin,1,1 +7745536,9744,assets/obseg/chr/CtrevguardZ.bin,1,1 +7755280,12144,assets/obseg/chr/CvalentinZ.bin,1,1 +7767424,14832,assets/obseg/chr/CxeniaZ.bin,1,1 +7782256,2576,assets/obseg/gun/Gak47Z.bin,1,1 +7784832,912,assets/obseg/gun/GaudiotapeZ.bin,1,1 +7785744,6160,assets/obseg/gun/GautoshotZ.bin,1,1 +7791904,1536,assets/obseg/gun/GblackboxZ.bin,1,1 +7793440,256,assets/obseg/gun/GblueprintsZ.bin,1,1 +7793696,1936,assets/obseg/gun/GbombcaseZ.bin,1,1 +7795632,1520,assets/obseg/gun/GbombdefuserZ.bin,1,1 +7797152,1936,assets/obseg/gun/GbriefcaseZ.bin,1,1 +7799088,2416,assets/obseg/gun/GbugZ.bin,1,1 +7801504,848,assets/obseg/gun/GbugdetectorZ.bin,1,1 +7802352,848,assets/obseg/gun/GbungeeZ.bin,1,1 +7803200,1152,assets/obseg/gun/GcameraZ.bin,1,1 +7804352,608,assets/obseg/gun/GcartblueZ.bin,1,1 +7804960,304,assets/obseg/gun/GcartridgeZ.bin,1,1 +7805264,528,assets/obseg/gun/GcartrifleZ.bin,1,1 +7805792,512,assets/obseg/gun/GcartshellZ.bin,1,1 +7806304,320,assets/obseg/gun/GcircuitboardZ.bin,1,1 +7806624,496,assets/obseg/gun/GclipboardZ.bin,1,1 +7807120,848,assets/obseg/gun/GcreditcardZ.bin,1,1 +7807968,848,assets/obseg/gun/GdarkglassesZ.bin,1,1 +7808816,320,assets/obseg/gun/GdatathiefZ.bin,1,1 +7809136,368,assets/obseg/gun/GdattapeZ.bin,1,1 +7809504,1408,assets/obseg/gun/GdoordecoderZ.bin,1,1 +7810912,848,assets/obseg/gun/GdoorexploderZ.bin,1,1 +7811760,864,assets/obseg/gun/GdossierredZ.bin,1,1 +7812624,848,assets/obseg/gun/GdynamiteZ.bin,1,1 +7813472,592,assets/obseg/gun/GexplosivefloppyZ.bin,1,1 +7814064,848,assets/obseg/gun/GexplosivepenZ.bin,1,1 +7814912,2032,assets/obseg/gun/GextinguisherZ.bin,1,1 +7816944,848,assets/obseg/gun/GfingergunZ.bin,1,1 +7817792,5888,assets/obseg/gun/GfistZ.bin,1,1 +7823680,848,assets/obseg/gun/GflarepistolZ.bin,1,1 +7824528,3232,assets/obseg/gun/Gfnp90Z.bin,1,1 +7827760,2608,assets/obseg/gun/GgaskeyringZ.bin,1,1 +7830368,848,assets/obseg/gun/GgoldbarZ.bin,1,1 +7831216,2480,assets/obseg/gun/GgoldeneyekeyZ.bin,1,1 +7833696,6112,assets/obseg/gun/GgoldengunZ.bin,1,1 +7839808,6496,assets/obseg/gun/GgoldwppkZ.bin,1,1 +7846304,2608,assets/obseg/gun/GgrenadeZ.bin,1,1 +7848912,4224,assets/obseg/gun/GgrenadelaunchZ.bin,1,1 +7853136,848,assets/obseg/gun/GheroinZ.bin,1,1 +7853984,7856,assets/obseg/gun/GjoypadZ.bin,1,1 +7861840,1936,assets/obseg/gun/GkeyanalysercaseZ.bin,1,1 +7863776,2544,assets/obseg/gun/GkeyboltZ.bin,1,1 +7866320,304,assets/obseg/gun/GkeycardZ.bin,1,1 +7866624,3408,assets/obseg/gun/GkeyyaleZ.bin,1,1 +7870032,6864,assets/obseg/gun/GknifeZ.bin,1,1 +7876896,3568,assets/obseg/gun/GlaserZ.bin,1,1 +7880464,848,assets/obseg/gun/GlectreZ.bin,1,1 +7881312,848,assets/obseg/gun/GlockexploderZ.bin,1,1 +7882160,2592,assets/obseg/gun/Gm16Z.bin,1,1 +7884752,240,assets/obseg/gun/GmapZ.bin,1,1 +7884992,1600,assets/obseg/gun/GmicrocameraZ.bin,1,1 +7886592,848,assets/obseg/gun/GmicrocodeZ.bin,1,1 +7887440,848,assets/obseg/gun/GmicrofilmZ.bin,1,1 +7888288,848,assets/obseg/gun/GmoneyZ.bin,1,1 +7889136,3040,assets/obseg/gun/Gmp5kZ.bin,1,1 +7892176,3328,assets/obseg/gun/Gmp5ksilZ.bin,1,1 +7895504,848,assets/obseg/gun/GpitongunZ.bin,1,1 +7896352,464,assets/obseg/gun/GplansZ.bin,1,1 +7896816,848,assets/obseg/gun/GplastiqueZ.bin,1,1 +7897664,1376,assets/obseg/gun/GpolarizedglassesZ.bin,1,1 +7899040,2032,assets/obseg/gun/GproximitymineZ.bin,1,1 +7901072,2496,assets/obseg/gun/GremotemineZ.bin,1,1 +7903568,4640,assets/obseg/gun/GrocketlaunchZ.bin,1,1 +7908208,7568,assets/obseg/gun/GrugerZ.bin,1,1 +7915776,1936,assets/obseg/gun/GsafecrackercaseZ.bin,1,1 +7917712,3808,assets/obseg/gun/GshotgunZ.bin,1,1 +7921520,6496,assets/obseg/gun/GsilverwppkZ.bin,1,1 +7928016,4608,assets/obseg/gun/GskorpionZ.bin,1,1 +7932624,4208,assets/obseg/gun/GsniperrifleZ.bin,1,1 +7936832,3200,assets/obseg/gun/GspectreZ.bin,1,1 +7940032,848,assets/obseg/gun/GspooltapeZ.bin,1,1 +7940880,848,assets/obseg/gun/GspyfileZ.bin,1,1 +7941728,416,assets/obseg/gun/GstafflistZ.bin,1,1 +7942144,7776,assets/obseg/gun/GtaserZ.bin,1,1 +7949920,6896,assets/obseg/gun/GthrowknifeZ.bin,1,1 +7956816,2752,assets/obseg/gun/GtimedmineZ.bin,1,1 +7959568,13312,assets/obseg/gun/GtriggerZ.bin,1,1 +7972880,6944,assets/obseg/gun/Gtt33Z.bin,1,1 +7979824,2320,assets/obseg/gun/GuziZ.bin,1,1 +7982144,528,assets/obseg/gun/GvideotapeZ.bin,1,1 +7982672,5216,assets/obseg/gun/GwatchcommunicatorZ.bin,1,1 +7987888,5216,assets/obseg/gun/GwatchgeigercounterZ.bin,1,1 +7993104,5216,assets/obseg/gun/GwatchidentifierZ.bin,1,1 +7998320,13312,assets/obseg/gun/GwatchlaserZ.bin,1,1 +8011632,5200,assets/obseg/gun/GwatchmagnetattractZ.bin,1,1 +8016832,5216,assets/obseg/gun/GwatchmagnetrepelZ.bin,1,1 +8022048,1936,assets/obseg/gun/GweaponcaseZ.bin,1,1 +8023984,7312,assets/obseg/gun/GwppkZ.bin,1,1 +8031296,7488,assets/obseg/gun/GwppksilZ.bin,1,1 +8038784,848,assets/obseg/gun/GwristdartZ.bin,1,1 +8039632,9600,assets/obseg/prop/PICBMZ.bin,1,1 +8049232,1968,assets/obseg/prop/PICBM_noseZ.bin,1,1 +8051200,480,assets/obseg/prop/Pak47magZ.bin,1,1 +8051680,352,assets/obseg/prop/Palarm1Z.bin,1,1 +8052032,416,assets/obseg/prop/Palarm2Z.bin,1,1 +8052448,576,assets/obseg/prop/Pammo_crate1Z.bin,1,1 +8053024,576,assets/obseg/prop/Pammo_crate2Z.bin,1,1 +8053600,592,assets/obseg/prop/Pammo_crate3Z.bin,1,1 +8054192,624,assets/obseg/prop/Pammo_crate4Z.bin,1,1 +8054816,704,assets/obseg/prop/Pammo_crate5Z.bin,1,1 +8055520,7264,assets/obseg/prop/PapcZ.bin,1,1 +8062784,480,assets/obseg/prop/Parchsecdoor1Z.bin,1,1 +8063264,464,assets/obseg/prop/Parchsecdoor2Z.bin,1,1 +8063728,3584,assets/obseg/prop/ParticZ.bin,1,1 +8067312,2320,assets/obseg/prop/PartictrailerZ.bin,1,1 +8069632,576,assets/obseg/prop/PbarricadeZ.bin,1,1 +8070208,848,assets/obseg/prop/Pbin1Z.bin,1,1 +8071056,224,assets/obseg/prop/Pblotter1Z.bin,1,1 +8071280,1184,assets/obseg/prop/PbodyarmourZ.bin,1,1 +8072464,1056,assets/obseg/prop/PbodyarmourvestZ.bin,1,1 +8073520,512,assets/obseg/prop/PbollardZ.bin,1,1 +8074032,368,assets/obseg/prop/PbombZ.bin,1,1 +8074400,400,assets/obseg/prop/Pbook1Z.bin,1,1 +8074800,1776,assets/obseg/prop/Pbookshelf1Z.bin,1,1 +8076576,368,assets/obseg/prop/Pborg_crateZ.bin,1,1 +8076944,512,assets/obseg/prop/PboxcartridgesZ.bin,1,1 +8077456,1072,assets/obseg/prop/Pboxes2x4Z.bin,1,1 +8078528,1088,assets/obseg/prop/Pboxes3x4Z.bin,1,1 +8079616,1632,assets/obseg/prop/Pboxes4x4Z.bin,1,1 +8081248,880,assets/obseg/prop/PbrakeunitZ.bin,1,1 +8082128,1408,assets/obseg/prop/Pbridge_console1aZ.bin,1,1 +8083536,1376,assets/obseg/prop/Pbridge_console1bZ.bin,1,1 +8084912,1408,assets/obseg/prop/Pbridge_console2aZ.bin,1,1 +8086320,1264,assets/obseg/prop/Pbridge_console2bZ.bin,1,1 +8087584,1360,assets/obseg/prop/Pbridge_console3aZ.bin,1,1 +8088944,1424,assets/obseg/prop/Pbridge_console3bZ.bin,1,1 +8090368,3296,assets/obseg/prop/PcarbmwZ.bin,1,1 +8093664,512,assets/obseg/prop/Pcard_box1Z.bin,1,1 +8094176,576,assets/obseg/prop/Pcard_box2Z.bin,1,1 +8094752,496,assets/obseg/prop/Pcard_box3Z.bin,1,1 +8095248,432,assets/obseg/prop/Pcard_box4Z.bin,1,1 +8095680,512,assets/obseg/prop/Pcard_box5Z.bin,1,1 +8096192,496,assets/obseg/prop/Pcard_box6Z.bin,1,1 +8096688,3072,assets/obseg/prop/PcarescortZ.bin,1,1 +8099760,3120,assets/obseg/prop/PcargolfZ.bin,1,1 +8102880,4416,assets/obseg/prop/PcarweirdZ.bin,1,1 +8107296,5632,assets/obseg/prop/PcarzilZ.bin,1,1 +8112928,896,assets/obseg/prop/PcctvZ.bin,1,1 +8113824,1376,assets/obseg/prop/PchraudiotapeZ.bin,1,1 +8115200,864,assets/obseg/prop/PchrautoshotZ.bin,1,1 +8116064,2176,assets/obseg/prop/PchrblackboxZ.bin,1,1 +8118240,336,assets/obseg/prop/PchrblueprintsZ.bin,1,1 +8118576,496,assets/obseg/prop/PchrbombcaseZ.bin,1,1 +8119072,2272,assets/obseg/prop/PchrbombdefuserZ.bin,1,1 +8121344,400,assets/obseg/prop/PchrbriefcaseZ.bin,1,1 +8121744,3504,assets/obseg/prop/PchrbugZ.bin,1,1 +8125248,368,assets/obseg/prop/PchrbugdetectorZ.bin,1,1 +8125616,368,assets/obseg/prop/PchrbungeeZ.bin,1,1 +8125984,1680,assets/obseg/prop/PchrcameraZ.bin,1,1 +8127664,416,assets/obseg/prop/PchrcircuitboardZ.bin,1,1 +8128080,640,assets/obseg/prop/PchrclipboardZ.bin,1,1 +8128720,368,assets/obseg/prop/PchrcreditcardZ.bin,1,1 +8129088,368,assets/obseg/prop/PchrdarkglassesZ.bin,1,1 +8129456,416,assets/obseg/prop/PchrdatathiefZ.bin,1,1 +8129872,496,assets/obseg/prop/PchrdattapeZ.bin,1,1 +8130368,2144,assets/obseg/prop/PchrdoordecoderZ.bin,1,1 +8132512,368,assets/obseg/prop/PchrdoorexploderZ.bin,1,1 +8132880,1232,assets/obseg/prop/PchrdossierredZ.bin,1,1 +8134112,368,assets/obseg/prop/PchrdynamiteZ.bin,1,1 +8134480,368,assets/obseg/prop/PchrexplosivepenZ.bin,1,1 +8134848,1280,assets/obseg/prop/PchrextinguisherZ.bin,1,1 +8136128,368,assets/obseg/prop/PchrfingergunZ.bin,1,1 +8136496,368,assets/obseg/prop/PchrflarepistolZ.bin,1,1 +8136864,1120,assets/obseg/prop/Pchrfnp90Z.bin,1,1 +8137984,3856,assets/obseg/prop/PchrgaskeyringZ.bin,1,1 +8141840,368,assets/obseg/prop/PchrgoldbarZ.bin,1,1 +8142208,624,assets/obseg/prop/PchrgoldenZ.bin,1,1 +8142832,3744,assets/obseg/prop/PchrgoldeneyekeyZ.bin,1,1 +8146576,368,assets/obseg/prop/PchrgoldwppkZ.bin,1,1 +8146944,880,assets/obseg/prop/PchrgrenadeZ.bin,1,1 +8147824,912,assets/obseg/prop/PchrgrenadelaunchZ.bin,1,1 +8148736,624,assets/obseg/prop/PchrgrenaderoundZ.bin,1,1 +8149360,368,assets/obseg/prop/PchrheroinZ.bin,1,1 +8149728,1008,assets/obseg/prop/PchrkalashZ.bin,1,1 +8150736,496,assets/obseg/prop/PchrkeyanalysercaseZ.bin,1,1 +8151232,3744,assets/obseg/prop/PchrkeyboltZ.bin,1,1 +8154976,5216,assets/obseg/prop/PchrkeyyaleZ.bin,1,1 +8160192,512,assets/obseg/prop/PchrknifeZ.bin,1,1 +8160704,960,assets/obseg/prop/PchrlaserZ.bin,1,1 +8161664,368,assets/obseg/prop/PchrlectreZ.bin,1,1 +8162032,368,assets/obseg/prop/PchrlockexploderZ.bin,1,1 +8162400,976,assets/obseg/prop/Pchrm16Z.bin,1,1 +8163376,336,assets/obseg/prop/PchrmapZ.bin,1,1 +8163712,2288,assets/obseg/prop/PchrmicrocameraZ.bin,1,1 +8166000,368,assets/obseg/prop/PchrmicrocodeZ.bin,1,1 +8166368,368,assets/obseg/prop/PchrmicrofilmZ.bin,1,1 +8166736,368,assets/obseg/prop/PchrmoneyZ.bin,1,1 +8167104,896,assets/obseg/prop/Pchrmp5kZ.bin,1,1 +8168000,1040,assets/obseg/prop/Pchrmp5ksilZ.bin,1,1 +8169040,368,assets/obseg/prop/PchrpitongunZ.bin,1,1 +8169408,656,assets/obseg/prop/PchrplansZ.bin,1,1 +8170064,1120,assets/obseg/prop/PchrplastiqueZ.bin,1,1 +8171184,2240,assets/obseg/prop/PchrpolarizedglassesZ.bin,1,1 +8173424,1120,assets/obseg/prop/PchrproximitymineZ.bin,1,1 +8174544,1120,assets/obseg/prop/PchrremotemineZ.bin,1,1 +8175664,1456,assets/obseg/prop/PchrrocketZ.bin,1,1 +8177120,992,assets/obseg/prop/PchrrocketlaunchZ.bin,1,1 +8178112,992,assets/obseg/prop/PchrrugerZ.bin,1,1 +8179104,496,assets/obseg/prop/PchrsafecrackercaseZ.bin,1,1 +8179600,848,assets/obseg/prop/PchrshotgunZ.bin,1,1 +8180448,368,assets/obseg/prop/PchrsilverwppkZ.bin,1,1 +8180816,896,assets/obseg/prop/PchrskorpionZ.bin,1,1 +8181712,912,assets/obseg/prop/PchrsniperrifleZ.bin,1,1 +8182624,880,assets/obseg/prop/PchrspectreZ.bin,1,1 +8183504,368,assets/obseg/prop/PchrspooltapeZ.bin,1,1 +8183872,368,assets/obseg/prop/PchrspyfileZ.bin,1,1 +8184240,544,assets/obseg/prop/PchrstafflistZ.bin,1,1 +8184784,448,assets/obseg/prop/PchrtesttubeZ.bin,1,1 +8185232,544,assets/obseg/prop/PchrthrowknifeZ.bin,1,1 +8185776,1328,assets/obseg/prop/PchrtimedmineZ.bin,1,1 +8187104,656,assets/obseg/prop/Pchrtt33Z.bin,1,1 +8187760,720,assets/obseg/prop/PchruziZ.bin,1,1 +8188480,720,assets/obseg/prop/PchrvideotapeZ.bin,1,1 +8189200,512,assets/obseg/prop/PchrweaponcaseZ.bin,1,1 +8189712,576,assets/obseg/prop/PchrwppkZ.bin,1,1 +8190288,736,assets/obseg/prop/PchrwppksilZ.bin,1,1 +8191024,368,assets/obseg/prop/PchrwristdartZ.bin,1,1 +8191392,1664,assets/obseg/prop/Pconsole1Z.bin,1,1 +8193056,1664,assets/obseg/prop/Pconsole2Z.bin,1,1 +8194720,1680,assets/obseg/prop/Pconsole3Z.bin,1,1 +8196400,1056,assets/obseg/prop/Pconsole_sev2aZ.bin,1,1 +8197456,1216,assets/obseg/prop/Pconsole_sev2bZ.bin,1,1 +8198672,1088,assets/obseg/prop/Pconsole_sev2cZ.bin,1,1 +8199760,1072,assets/obseg/prop/Pconsole_sev2dZ.bin,1,1 +8200832,1072,assets/obseg/prop/Pconsole_sev_GEaZ.bin,1,1 +8201904,1072,assets/obseg/prop/Pconsole_sev_GEbZ.bin,1,1 +8202976,1152,assets/obseg/prop/Pconsole_sevaZ.bin,1,1 +8204128,1136,assets/obseg/prop/Pconsole_sevbZ.bin,1,1 +8205264,1072,assets/obseg/prop/Pconsole_sevcZ.bin,1,1 +8206336,1072,assets/obseg/prop/Pconsole_sevdZ.bin,1,1 +8207408,400,assets/obseg/prop/Pcryptdoor1aZ.bin,1,1 +8207808,400,assets/obseg/prop/Pcryptdoor1bZ.bin,1,1 +8208208,400,assets/obseg/prop/Pcryptdoor2aZ.bin,1,1 +8208608,400,assets/obseg/prop/Pcryptdoor2bZ.bin,1,1 +8209008,624,assets/obseg/prop/Pcryptdoor3Z.bin,1,1 +8209632,384,assets/obseg/prop/Pcryptdoor4Z.bin,1,1 +8210016,640,assets/obseg/prop/PdamchaindoorZ.bin,1,1 +8210656,544,assets/obseg/prop/PdamgatedoorZ.bin,1,1 +8211200,880,assets/obseg/prop/PdamtundoorZ.bin,1,1 +8212080,416,assets/obseg/prop/Pdepot_door_steelZ.bin,1,1 +8212496,576,assets/obseg/prop/Pdepot_gate_entryZ.bin,1,1 +8213072,384,assets/obseg/prop/Pdesk1Z.bin,1,1 +8213456,384,assets/obseg/prop/Pdesk2Z.bin,1,1 +8213840,576,assets/obseg/prop/Pdesk_arecibo1Z.bin,1,1 +8214416,768,assets/obseg/prop/Pdesk_lamp2Z.bin,1,1 +8215184,6384,assets/obseg/prop/Pdest_engineZ.bin,1,1 +8221568,1632,assets/obseg/prop/Pdest_exocetZ.bin,1,1 +8223200,1648,assets/obseg/prop/Pdest_gunZ.bin,1,1 +8224848,2208,assets/obseg/prop/Pdest_harpoonZ.bin,1,1 +8227056,4016,assets/obseg/prop/Pdest_seawolfZ.bin,1,1 +8231072,448,assets/obseg/prop/Pdisc_readerZ.bin,1,1 +8231520,400,assets/obseg/prop/Pdisk_drive1Z.bin,1,1 +8231920,384,assets/obseg/prop/Pdoor_azt_chairZ.bin,1,1 +8232304,1088,assets/obseg/prop/Pdoor_azt_deskZ.bin,1,1 +8233392,912,assets/obseg/prop/Pdoor_azt_desk_topZ.bin,1,1 +8234304,560,assets/obseg/prop/Pdoor_aztecZ.bin,1,1 +8234864,768,assets/obseg/prop/Pdoor_dest1Z.bin,1,1 +8235632,960,assets/obseg/prop/Pdoor_dest2Z.bin,1,1 +8236592,1376,assets/obseg/prop/Pdoor_eyelidZ.bin,1,1 +8237968,2640,assets/obseg/prop/Pdoor_irisZ.bin,1,1 +8240608,752,assets/obseg/prop/Pdoor_mfZ.bin,1,1 +8241360,880,assets/obseg/prop/Pdoor_roller1Z.bin,1,1 +8242240,576,assets/obseg/prop/Pdoor_roller2Z.bin,1,1 +8242816,576,assets/obseg/prop/Pdoor_roller3Z.bin,1,1 +8243392,608,assets/obseg/prop/Pdoor_roller4Z.bin,1,1 +8244000,304,assets/obseg/prop/Pdoor_rollertrainZ.bin,1,1 +8244304,608,assets/obseg/prop/Pdoor_st_arec1Z.bin,1,1 +8244912,736,assets/obseg/prop/Pdoor_st_arec2Z.bin,1,1 +8245648,416,assets/obseg/prop/Pdoor_winZ.bin,1,1 +8246064,1136,assets/obseg/prop/PdoorconsoleZ.bin,1,1 +8247200,880,assets/obseg/prop/PdoorpanelZ.bin,1,1 +8248080,336,assets/obseg/prop/Pdoorprison1Z.bin,1,1 +8248416,512,assets/obseg/prop/PdoorstatgateZ.bin,1,1 +8248928,288,assets/obseg/prop/PexplosionbitZ.bin,1,1 +8249216,384,assets/obseg/prop/Pfiling_cabinet1Z.bin,1,1 +8249600,304,assets/obseg/prop/PflagZ.bin,1,1 +8249904,800,assets/obseg/prop/PfloppyZ.bin,1,1 +8250704,416,assets/obseg/prop/Pfnp90magZ.bin,1,1 +8251120,896,assets/obseg/prop/Pgas_plant_met1_do1Z.bin,1,1 +8252016,480,assets/obseg/prop/Pgas_plant_sw2_do1Z.bin,1,1 +8252496,512,assets/obseg/prop/Pgas_plant_sw3_do1Z.bin,1,1 +8253008,352,assets/obseg/prop/Pgas_plant_sw4_do1Z.bin,1,1 +8253360,656,assets/obseg/prop/Pgas_plant_sw_do1Z.bin,1,1 +8254016,528,assets/obseg/prop/Pgas_plant_wc_cub1Z.bin,1,1 +8254544,528,assets/obseg/prop/PgasbarrelZ.bin,1,1 +8255072,1344,assets/obseg/prop/PgasbarrelsZ.bin,1,1 +8256416,1376,assets/obseg/prop/Pgasplant_clear_doorZ.bin,1,1 +8257792,1456,assets/obseg/prop/PgastankZ.bin,1,1 +8259248,352,assets/obseg/prop/Pglassware1Z.bin,1,1 +8259600,656,assets/obseg/prop/Pglassware2Z.bin,1,1 +8260256,528,assets/obseg/prop/Pglassware3Z.bin,1,1 +8260784,1408,assets/obseg/prop/Pglassware4Z.bin,1,1 +8262192,3760,assets/obseg/prop/PgoldeneyelogoZ.bin,1,1 +8265952,512,assets/obseg/prop/PgoldenshellsZ.bin,1,1 +8266464,2000,assets/obseg/prop/PgroundgunZ.bin,1,1 +8268464,1856,assets/obseg/prop/Pgun_runway1Z.bin,1,1 +8270320,672,assets/obseg/prop/PhatberetZ.bin,1,1 +8270992,720,assets/obseg/prop/PhatberetblueZ.bin,1,1 +8271712,736,assets/obseg/prop/PhatberetredZ.bin,1,1 +8272448,208,assets/obseg/prop/PhatchboltZ.bin,1,1 +8272656,544,assets/obseg/prop/PhatchdoorZ.bin,1,1 +8273200,368,assets/obseg/prop/PhatchsevxZ.bin,1,1 +8273568,560,assets/obseg/prop/PhatfurryZ.bin,1,1 +8274128,544,assets/obseg/prop/PhatfurryblackZ.bin,1,1 +8274672,528,assets/obseg/prop/PhatfurrybrownZ.bin,1,1 +8275200,560,assets/obseg/prop/PhathelmetZ.bin,1,1 +8275760,560,assets/obseg/prop/PhathelmetgreyZ.bin,1,1 +8276320,992,assets/obseg/prop/PhatmoonZ.bin,1,1 +8277312,784,assets/obseg/prop/PhatpeakedZ.bin,1,1 +8278096,592,assets/obseg/prop/PhattbirdZ.bin,1,1 +8278688,624,assets/obseg/prop/PhattbirdbrownZ.bin,1,1 +8279312,16928,assets/obseg/prop/PhelicopterZ.bin,1,1 +8296240,6000,assets/obseg/prop/PhindZ.bin,1,1 +8302240,4448,assets/obseg/prop/PjeepZ.bin,1,1 +8306688,608,assets/obseg/prop/Pjerry_can1Z.bin,1,1 +8307296,1920,assets/obseg/prop/Pjungle3_treeZ.bin,1,1 +8309216,1328,assets/obseg/prop/Pjungle5_treeZ.bin,1,1 +8310544,848,assets/obseg/prop/Pkey_holderZ.bin,1,1 +8311392,368,assets/obseg/prop/Pkeyboard1Z.bin,1,1 +8311760,672,assets/obseg/prop/Pkit_units1Z.bin,1,1 +8312432,976,assets/obseg/prop/PlabbenchZ.bin,1,1 +8313408,624,assets/obseg/prop/PlandmineZ.bin,1,1 +8314032,4032,assets/obseg/prop/PlegalpageZ.bin,1,1 +8318064,352,assets/obseg/prop/Pletter_tray1Z.bin,1,1 +8318416,400,assets/obseg/prop/Plocker3Z.bin,1,1 +8318816,400,assets/obseg/prop/Plocker4Z.bin,1,1 +8319216,320,assets/obseg/prop/Pm16magZ.bin,1,1 +8319536,512,assets/obseg/prop/PmagnumshellsZ.bin,1,1 +8320048,768,assets/obseg/prop/Pmainframe1Z.bin,1,1 +8320816,720,assets/obseg/prop/Pmainframe2Z.bin,1,1 +8321536,832,assets/obseg/prop/Pmetal_chair1Z.bin,1,1 +8322368,448,assets/obseg/prop/Pmetal_crate1Z.bin,1,1 +8322816,448,assets/obseg/prop/Pmetal_crate2Z.bin,1,1 +8323264,448,assets/obseg/prop/Pmetal_crate3Z.bin,1,1 +8323712,448,assets/obseg/prop/Pmetal_crate4Z.bin,1,1 +8324160,6368,assets/obseg/prop/PmilcopterZ.bin,1,1 +8330528,8960,assets/obseg/prop/PmiltruckZ.bin,1,1 +8339488,2576,assets/obseg/prop/Pmissile_rack2Z.bin,1,1 +8342064,992,assets/obseg/prop/Pmissile_rackZ.bin,1,1 +8343056,832,assets/obseg/prop/PmodemboxZ.bin,1,1 +8343888,3776,assets/obseg/prop/PmotorbikeZ.bin,1,1 +8347664,336,assets/obseg/prop/Pmp5kmagZ.bin,1,1 +8348000,10976,assets/obseg/prop/PnintendologoZ.bin,1,1 +8358976,624,assets/obseg/prop/Poil_drum1Z.bin,1,1 +8359600,752,assets/obseg/prop/Poil_drum2Z.bin,1,1 +8360352,752,assets/obseg/prop/Poil_drum3Z.bin,1,1 +8361104,752,assets/obseg/prop/Poil_drum5Z.bin,1,1 +8361856,784,assets/obseg/prop/Poil_drum6Z.bin,1,1 +8362640,768,assets/obseg/prop/Poil_drum7Z.bin,1,1 +8363408,2640,assets/obseg/prop/PpadlockZ.bin,1,1 +8366048,1104,assets/obseg/prop/PpalmZ.bin,1,1 +8367152,1232,assets/obseg/prop/PpalmtreeZ.bin,1,1 +8368384,320,assets/obseg/prop/Pphone1Z.bin,1,1 +8368704,9696,assets/obseg/prop/PplaneZ.bin,1,1 +8378400,960,assets/obseg/prop/Pplant11Z.bin,1,1 +8379360,912,assets/obseg/prop/Pplant1Z.bin,1,1 +8380272,864,assets/obseg/prop/Pplant2Z.bin,1,1 +8381136,1040,assets/obseg/prop/Pplant2bZ.bin,1,1 +8382176,1104,assets/obseg/prop/Pplant3Z.bin,1,1 +8383280,432,assets/obseg/prop/Pradio_unit1Z.bin,1,1 +8383712,448,assets/obseg/prop/Pradio_unit2Z.bin,1,1 +8384160,448,assets/obseg/prop/Pradio_unit3Z.bin,1,1 +8384608,448,assets/obseg/prop/Pradio_unit4Z.bin,1,1 +8385056,1632,assets/obseg/prop/ProofgunZ.bin,1,1 +8386688,848,assets/obseg/prop/PsafeZ.bin,1,1 +8387536,1264,assets/obseg/prop/PsafedoorZ.bin,1,1 +8388800,5488,assets/obseg/prop/Psat1_reflectZ.bin,1,1 +8394288,288,assets/obseg/prop/PsatboxZ.bin,1,1 +8394576,1120,assets/obseg/prop/PsatdishZ.bin,1,1 +8395696,416,assets/obseg/prop/Psec_panelZ.bin,1,1 +8396112,656,assets/obseg/prop/Psev_door3Z.bin,1,1 +8396768,912,assets/obseg/prop/Psev_door3_windZ.bin,1,1 +8397680,992,assets/obseg/prop/Psev_door4_windZ.bin,1,1 +8398672,848,assets/obseg/prop/Psev_doorZ.bin,1,1 +8399520,816,assets/obseg/prop/Psev_door_v1Z.bin,1,1 +8400336,944,assets/obseg/prop/Psev_trislideZ.bin,1,1 +8401280,3872,assets/obseg/prop/PsevdishZ.bin,1,1 +8405152,736,assets/obseg/prop/PsevdoormetslideZ.bin,1,1 +8405888,368,assets/obseg/prop/PsevdoornowindZ.bin,1,1 +8406256,1072,assets/obseg/prop/PsevdoorwindZ.bin,1,1 +8407328,944,assets/obseg/prop/PsevdoorwoodZ.bin,1,1 +8408272,10752,assets/obseg/prop/PshuttleZ.bin,1,1 +8419024,3120,assets/obseg/prop/Pshuttle_door_lZ.bin,1,1 +8422144,3328,assets/obseg/prop/Pshuttle_door_rZ.bin,1,1 +8425472,416,assets/obseg/prop/PsilencerZ.bin,1,1 +8425888,576,assets/obseg/prop/Psilo_lift_doorZ.bin,1,1 +8426464,752,assets/obseg/prop/PsilotopdoorZ.bin,1,1 +8427216,352,assets/obseg/prop/PskorpionmagZ.bin,1,1 +8427568,368,assets/obseg/prop/PspectremagZ.bin,1,1 +8427936,3392,assets/obseg/prop/PspeedboatZ.bin,1,1 +8431328,12608,assets/obseg/prop/Pst_pete_room_1iZ.bin,1,1 +8443936,12768,assets/obseg/prop/Pst_pete_room_2iZ.bin,1,1 +8456704,12096,assets/obseg/prop/Pst_pete_room_3tZ.bin,1,1 +8468800,13712,assets/obseg/prop/Pst_pete_room_5cZ.bin,1,1 +8482512,13328,assets/obseg/prop/Pst_pete_room_6cZ.bin,1,1 +8495840,624,assets/obseg/prop/Psteel_door1Z.bin,1,1 +8496464,688,assets/obseg/prop/Psteel_door2Z.bin,1,1 +8497152,720,assets/obseg/prop/Psteel_door2bZ.bin,1,1 +8497872,720,assets/obseg/prop/Psteel_door3Z.bin,1,1 +8498592,704,assets/obseg/prop/Pstool1Z.bin,1,1 +8499296,400,assets/obseg/prop/Pswipe_card2Z.bin,1,1 +8499696,656,assets/obseg/prop/Pswivel_chair1Z.bin,1,1 +8500352,6816,assets/obseg/prop/PtankZ.bin,1,1 +8507168,7824,assets/obseg/prop/PtigerZ.bin,1,1 +8514992,2176,assets/obseg/prop/Ptorpedo_rackZ.bin,1,1 +8517168,976,assets/obseg/prop/Ptrain_door2Z.bin,1,1 +8518144,1056,assets/obseg/prop/Ptrain_door3Z.bin,1,1 +8519200,624,assets/obseg/prop/Ptrain_doorZ.bin,1,1 +8519824,832,assets/obseg/prop/PtrainextdoorZ.bin,1,1 +8520656,320,assets/obseg/prop/Ptt33magZ.bin,1,1 +8520976,1312,assets/obseg/prop/Ptuning_console1Z.bin,1,1 +8522288,464,assets/obseg/prop/Ptv1Z.bin,1,1 +8522752,416,assets/obseg/prop/Ptv4screenZ.bin,1,1 +8523168,1744,assets/obseg/prop/Ptv_holderZ.bin,1,1 +8524912,208,assets/obseg/prop/PtvscreenZ.bin,1,1 +8525120,320,assets/obseg/prop/PuzimagZ.bin,1,1 +8525440,1552,assets/obseg/prop/PvertdoorZ.bin,1,1 +8526992,5552,assets/obseg/prop/PwalletbondZ.bin,1,1 +8532544,240,assets/obseg/prop/PwindowZ.bin,1,1 +8532784,224,assets/obseg/prop/Pwindow_cor11Z.bin,1,1 +8533008,224,assets/obseg/prop/Pwindow_lib_lg1Z.bin,1,1 +8533232,240,assets/obseg/prop/Pwindow_lib_sm1Z.bin,1,1 +8533472,640,assets/obseg/prop/Pwood_lg_crate1Z.bin,1,1 +8534112,544,assets/obseg/prop/Pwood_lg_crate2Z.bin,1,1 +8534656,544,assets/obseg/prop/Pwood_md_crate3Z.bin,1,1 +8535200,608,assets/obseg/prop/Pwood_sm_crate4Z.bin,1,1 +8535808,608,assets/obseg/prop/Pwood_sm_crate5Z.bin,1,1 +8536416,544,assets/obseg/prop/Pwood_sm_crate6Z.bin,1,1 +8536960,880,assets/obseg/prop/Pwooden_table1Z.bin,1,1 +8537840,320,assets/obseg/prop/PwppkmagZ.bin,1,1 +8538160,6448,assets/obseg/stan/Tbg_ame_all_p_stanZ.bin,1,1 +8544608,23792,assets/obseg/stan/Tbg_arch_all_p_stanZ.bin,1,1 +8568400,33616,assets/obseg/stan/Tbg_arec_all_p_stanZ.bin,1,1 +8602016,36800,assets/obseg/stan/Tbg_ark_all_p_stanZ.bin,1,1 +8638816,6448,assets/obseg/stan/Tbg_ash_all_p_stanZ.bin,1,1 +8645264,21888,assets/obseg/stan/Tbg_azt_all_p_stanZ.bin,1,1 +8667152,10032,assets/obseg/stan/Tbg_cat_all_p_stanZ.bin,1,1 +8677184,20208,assets/obseg/stan/Tbg_cave_all_p_stanZ.bin,1,1 +8697392,10512,assets/obseg/stan/Tbg_crad_all_p_stanZ.bin,1,1 +8707904,12400,assets/obseg/stan/Tbg_cryp_all_p_stanZ.bin,1,1 +8720304,41952,assets/obseg/stan/Tbg_dam_all_p_stanZ.bin,1,1 +8762256,28480,assets/obseg/stan/Tbg_depo_all_p_stanZ.bin,1,1 +8790736,26864,assets/obseg/stan/Tbg_dest_all_p_stanZ.bin,1,1 +8817600,2832,assets/obseg/stan/Tbg_dish_all_p_stanZ.bin,1,1 +8820432,6448,assets/obseg/stan/Tbg_imp_all_p_stanZ.bin,1,1 +8826880,29008,assets/obseg/stan/Tbg_jun_all_p_stanZ.bin,1,1 +8855888,2752,assets/obseg/stan/Tbg_len_all_p_stanZ.bin,1,1 +8858640,6400,assets/obseg/stan/Tbg_oat_all_p_stanZ.bin,1,1 +8865040,18064,assets/obseg/stan/Tbg_pete_all_p_stanZ.bin,1,1 +8883104,7632,assets/obseg/stan/Tbg_ref_all_p_stanZ.bin,1,1 +8890736,6784,assets/obseg/stan/Tbg_run_all_p_stanZ.bin,1,1 +8897520,15824,assets/obseg/stan/Tbg_sev_all_p_stanZ.bin,1,1 +8913344,20288,assets/obseg/stan/Tbg_sevb_all_p_stanZ.bin,1,1 +8933632,37680,assets/obseg/stan/Tbg_sevx_all_p_stanZ.bin,1,1 +8971312,37024,assets/obseg/stan/Tbg_silo_all_p_stanZ.bin,1,1 +9008336,20160,assets/obseg/stan/Tbg_stat_all_p_stanZ.bin,1,1 +9028496,9168,assets/obseg/stan/Tbg_tra_all_p_stanZ.bin,1,1 9037664,32,assets/obseg/brief/UbriefarchZ,1,0 9037696,32,assets/obseg/brief/UbriefarkZ,1,0 9037728,32,assets/obseg/brief/UbriefaztZ,1,0 @@ -686,66 +686,66 @@ 9038208,32,assets/obseg/brief/UbriefsiloZ,1,0 9038240,32,assets/obseg/brief/UbriefstatueZ,1,0 9038272,32,assets/obseg/brief/UbrieftraZ,1,0 -9038304,1824,assets/obseg/setup/Ump_setupameZ,1,1 -9040128,11680,assets/obseg/setup/u/Ump_setuparchZ,1,1 -9051808,7488,assets/obseg/setup/Ump_setuparkZ,1,1 -9059296,1776,assets/obseg/setup/Ump_setupashZ,1,1 -9061072,9568,assets/obseg/setup/Ump_setupcaveZ,1,1 -9070640,2400,assets/obseg/setup/Ump_setupcradZ,1,1 -9073040,3424,assets/obseg/setup/Ump_setupcrypZ,1,1 -9076464,1008,assets/obseg/setup/Ump_setupdishZ,1,1 -9077472,1600,assets/obseg/setup/Ump_setupimpZ,1,1 -9079072,848,assets/obseg/setup/Ump_setupoatZ,1,1 -9079920,1040,assets/obseg/setup/Ump_setuprefZ,1,1 -9080960,4880,assets/obseg/setup/Ump_setupsevbZ,1,1 -9085840,3712,assets/obseg/setup/Ump_setupstatueZ,1,1 -9089552,17936,assets/obseg/setup/UsetuparchZ,1,1 -9107488,15248,assets/obseg/setup/UsetuparkZ,1,1 -9122736,10496,assets/obseg/setup/UsetupaztZ,1,1 -9133232,15968,assets/obseg/setup/UsetupcaveZ,1,1 -9149200,15104,assets/obseg/setup/UsetupcontrolZ,1,1 -9164304,7216,assets/obseg/setup/u/UsetupcradZ,1,1 -9171520,7824,assets/obseg/setup/UsetupcrypZ,1,1 -9179344,17104,assets/obseg/setup/UsetupdamZ,1,1 -9196448,12176,assets/obseg/setup/UsetupdepoZ,1,1 -9208624,9040,assets/obseg/setup/u/UsetupdestZ,1,1 -9217664,14080,assets/obseg/setup/u/UsetupjunZ,1,1 -9231744,1488,assets/obseg/setup/u/UsetuplenZ,1,1 -9233232,12160,assets/obseg/setup/UsetuppeteZ,1,1 -9245392,6240,assets/obseg/setup/UsetuprunZ,1,1 -9251632,9824,assets/obseg/setup/UsetupsevbZ,1,1 -9261456,6704,assets/obseg/setup/UsetupsevbunkerZ,1,1 -9268160,17168,assets/obseg/setup/UsetupsevxZ,1,1 -9285328,16624,assets/obseg/setup/UsetupsevxbZ,1,1 -9301952,10832,assets/obseg/setup/u/UsetupsiloZ,1,1 -9312784,10192,assets/obseg/setup/u/UsetupstatueZ,1,1 -9322976,12848,assets/obseg/setup/u/UsetuptraZ,1,1 +9038304,1824,assets/obseg/setup/Ump_setupameZ.bin,1,1 +9040128,11680,assets/obseg/setup/u/Ump_setuparchZ.bin,1,1 +9051808,7488,assets/obseg/setup/Ump_setuparkZ.bin,1,1 +9059296,1776,assets/obseg/setup/Ump_setupashZ.bin,1,1 +9061072,9568,assets/obseg/setup/Ump_setupcaveZ.bin,1,1 +9070640,2400,assets/obseg/setup/Ump_setupcradZ.bin,1,1 +9073040,3424,assets/obseg/setup/Ump_setupcrypZ.bin,1,1 +9076464,1008,assets/obseg/setup/Ump_setupdishZ.bin,1,1 +9077472,1600,assets/obseg/setup/Ump_setupimpZ.bin,1,1 +9079072,848,assets/obseg/setup/Ump_setupoatZ.bin,1,1 +9079920,1040,assets/obseg/setup/Ump_setuprefZ.bin,1,1 +9080960,4880,assets/obseg/setup/Ump_setupsevbZ.bin,1,1 +9085840,3712,assets/obseg/setup/Ump_setupstatueZ.bin,1,1 +9089552,17936,assets/obseg/setup/UsetuparchZ.bin,1,1 +9107488,15248,assets/obseg/setup/UsetuparkZ.bin,1,1 +9122736,10496,assets/obseg/setup/UsetupaztZ.bin,1,1 +9133232,15968,assets/obseg/setup/UsetupcaveZ.bin,1,1 +9149200,15104,assets/obseg/setup/UsetupcontrolZ.bin,1,1 +9164304,7216,assets/obseg/setup/u/UsetupcradZ.bin,1,1 +9171520,7824,assets/obseg/setup/UsetupcrypZ.bin,1,1 +9179344,17104,assets/obseg/setup/UsetupdamZ.bin,1,1 +9196448,12176,assets/obseg/setup/UsetupdepoZ.bin,1,1 +9208624,9040,assets/obseg/setup/u/UsetupdestZ.bin,1,1 +9217664,14080,assets/obseg/setup/u/UsetupjunZ.bin,1,1 +9231744,1488,assets/obseg/setup/u/UsetuplenZ.bin,1,1 +9233232,12160,assets/obseg/setup/UsetuppeteZ.bin,1,1 +9245392,6240,assets/obseg/setup/UsetuprunZ.bin,1,1 +9251632,9824,assets/obseg/setup/UsetupsevbZ.bin,1,1 +9261456,6704,assets/obseg/setup/UsetupsevbunkerZ.bin,1,1 +9268160,17168,assets/obseg/setup/UsetupsevxZ.bin,1,1 +9285328,16624,assets/obseg/setup/UsetupsevxbZ.bin,1,1 +9301952,10832,assets/obseg/setup/u/UsetupsiloZ.bin,1,1 +9312784,10192,assets/obseg/setup/u/UsetupstatueZ.bin,1,1 +9322976,12848,assets/obseg/setup/u/UsetuptraZ.bin,1,1 9335824,16,assets/obseg/text/LameE,1,0 9335840,16,assets/obseg/text/LameJ,1,0 9335856,1584,assets/obseg/text/LarchE,1,0 -9337440,1632,assets/obseg/text/LarchJ,1,1 +9337440,1632,assets/obseg/text/LarchJ.bin,1,1 9339072,1488,assets/obseg/text/LarecE,1,0 -9340560,1424,assets/obseg/text/u/LarecJ,1,1 +9340560,1424,assets/obseg/text/u/LarecJ.bin,1,1 9341984,1696,assets/obseg/text/LarkE,1,0 -9343680,1712,assets/obseg/text/u/LarkJ,1,1 +9343680,1712,assets/obseg/text/u/LarkJ.bin,1,1 9345392,16,assets/obseg/text/LashE,1,0 9345408,16,assets/obseg/text/LashJ,1,0 9345424,1088,assets/obseg/text/LaztE,1,0 -9346512,1200,assets/obseg/text/u/LaztJ,1,1 +9346512,1200,assets/obseg/text/u/LaztJ.bin,1,1 9347712,16,assets/obseg/text/LcatE,1,0 9347728,16,assets/obseg/text/LcatJ,1,0 9347744,1024,assets/obseg/text/LcaveE,1,0 -9348768,1120,assets/obseg/text/LcaveJ,1,1 +9348768,1120,assets/obseg/text/LcaveJ.bin,1,1 9349888,1232,assets/obseg/text/LcradE,1,0 -9351120,1200,assets/obseg/text/u/LcradJ,1,1 +9351120,1200,assets/obseg/text/u/LcradJ.bin,1,1 9352320,592,assets/obseg/text/LcrypE,1,0 -9352912,704,assets/obseg/text/u/LcrypJ,1,1 +9352912,704,assets/obseg/text/u/LcrypJ.bin,1,1 9353616,1104,assets/obseg/text/LdamE,1,0 -9354720,1136,assets/obseg/text/u/LdamJ,1,1 +9354720,1136,assets/obseg/text/u/LdamJ.bin,1,1 9355856,880,assets/obseg/text/LdepoE,1,0 -9356736,832,assets/obseg/text/u/LdepoJ,1,1 +9356736,832,assets/obseg/text/u/LdepoJ.bin,1,1 9357568,1168,assets/obseg/text/LdestE,1,0 -9358736,1120,assets/obseg/text/LdestJ,1,1 +9358736,1120,assets/obseg/text/LdestJ.bin,1,1 9359856,16,assets/obseg/text/LdishE,1,0 9359872,16,assets/obseg/text/LdishJ,1,0 9359888,16,assets/obseg/text/LearE,1,0 @@ -753,59 +753,59 @@ 9359920,16,assets/obseg/text/LeldE,1,0 9359936,16,assets/obseg/text/LeldJ,1,0 9359952,1824,assets/obseg/text/LgunE,1,0 -9361776,1872,assets/obseg/text/u/LgunJ,1,1 +9361776,1872,assets/obseg/text/u/LgunJ.bin,1,1 9363648,16,assets/obseg/text/LimpE,1,0 9363664,16,assets/obseg/text/LimpJ,1,0 9363680,1312,assets/obseg/text/LjunE,1,0 -9364992,1344,assets/obseg/text/u/LjunJ,1,1 +9364992,1344,assets/obseg/text/u/LjunJ.bin,1,1 9366336,16,assets/obseg/text/LleeE,1,0 9366352,16,assets/obseg/text/LleeJ,1,0 9366368,1600,assets/obseg/text/LlenE,1,0 -9367968,688,assets/obseg/text/u/LlenJ,1,1 +9367968,688,assets/obseg/text/u/LlenJ.bin,1,1 9368656,16,assets/obseg/text/LlipE,1,0 9368672,16,assets/obseg/text/LlipJ,1,0 9368688,16,assets/obseg/text/LlueE,1,0 9368704,16,assets/obseg/text/LlueJ,1,0 9368720,672,assets/obseg/text/LmiscE,1,0 -9369392,736,assets/obseg/text/u/LmiscJ,1,1 +9369392,736,assets/obseg/text/u/LmiscJ.bin,1,1 9370128,416,assets/obseg/text/LmpmenuE,1,0 -9370544,400,assets/obseg/text/u/LmpmenuJ,1,1 +9370544,400,assets/obseg/text/u/LmpmenuJ.bin,1,1 9370944,192,assets/obseg/text/LmpweaponsE,1,0 -9371136,224,assets/obseg/text/u/LmpweaponsJ,1,1 +9371136,224,assets/obseg/text/u/LmpweaponsJ.bin,1,1 9371360,16,assets/obseg/text/LoatE,1,0 9371376,16,assets/obseg/text/LoatJ,1,0 9371392,560,assets/obseg/text/LoptionsE,1,0 -9371952,592,assets/obseg/text/u/LoptionsJ,1,1 +9371952,592,assets/obseg/text/u/LoptionsJ.bin,1,1 9372544,16,assets/obseg/text/LpamE,1,0 9372560,16,assets/obseg/text/LpamJ,1,0 9372576,1152,assets/obseg/text/LpeteE,1,0 -9373728,1136,assets/obseg/text/u/LpeteJ,1,1 +9373728,1136,assets/obseg/text/u/LpeteJ.bin,1,1 9374864,672,assets/obseg/text/LpropobjE,1,0 -9375536,704,assets/obseg/text/u/LpropobjJ,1,1 +9375536,704,assets/obseg/text/u/LpropobjJ.bin,1,1 9376240,16,assets/obseg/text/LrefE,1,0 9376256,16,assets/obseg/text/LrefJ,1,0 9376272,16,assets/obseg/text/LritE,1,0 9376288,16,assets/obseg/text/LritJ,1,0 9376304,624,assets/obseg/text/LrunE,1,0 -9376928,656,assets/obseg/text/LrunJ,1,1 +9376928,656,assets/obseg/text/LrunJ.bin,1,1 9377584,1376,assets/obseg/text/LsevE,1,0 -9378960,1296,assets/obseg/text/u/LsevJ,1,1 +9378960,1296,assets/obseg/text/u/LsevJ.bin,1,1 9380256,1872,assets/obseg/text/LsevbE,1,0 -9382128,2032,assets/obseg/text/u/LsevbJ,1,1 +9382128,2032,assets/obseg/text/u/LsevbJ.bin,1,1 9384160,1120,assets/obseg/text/LsevxE,1,0 -9385280,960,assets/obseg/text/u/LsevxJ,1,1 +9385280,960,assets/obseg/text/u/LsevxJ.bin,1,1 9386240,1168,assets/obseg/text/LsevxbE,1,0 -9387408,1104,assets/obseg/text/LsevxbJ,1,1 +9387408,1104,assets/obseg/text/LsevxbJ.bin,1,1 9388512,16,assets/obseg/text/LshoE,1,0 9388528,16,assets/obseg/text/LshoJ,1,0 9388544,1456,assets/obseg/text/LsiloE,1,0 -9390000,1504,assets/obseg/text/u/LsiloJ,1,1 +9390000,1504,assets/obseg/text/u/LsiloJ.bin,1,1 9391504,2336,assets/obseg/text/LstatE,1,0 -9393840,2160,assets/obseg/text/u/LstatJ,1,1 +9393840,2160,assets/obseg/text/u/LstatJ.bin,1,1 9396000,2752,assets/obseg/text/LtitleE,1,0 -9398752,2960,assets/obseg/text/u/LtitleJ,1,1 +9398752,2960,assets/obseg/text/u/LtitleJ.bin,1,1 9401712,1072,assets/obseg/text/LtraE,1,0 -9402784,1056,assets/obseg/text/u/LtraJ,1,1 +9402784,1056,assets/obseg/text/u/LtraJ.bin,1,1 9403840,16,assets/obseg/text/LwaxE,1,0 9403856,16,assets/obseg/text/LwaxJ,1,0 9403872,16,assets/obseg/ob__ob_end.seg,0,1 diff --git a/imagelist.u.csv b/imagelist.u.csv index a7129a42..74c53b53 100644 --- a/imagelist.u.csv +++ b/imagelist.u.csv @@ -1,2699 +1,2699 @@ -9403888,1876,assets/images/split/image1.bin -9405764,362,assets/images/split/image2.bin -9406126,2420,assets/images/split/image3.bin -9408546,907,assets/images/split/image4.bin -9409453,339,assets/images/split/image5.bin -9409792,606,assets/images/split/image6.bin -9410398,958,assets/images/split/image7.bin -9411356,26,assets/images/split/image8.bin -9411382,26,assets/images/split/image9.bin -9411408,895,assets/images/split/image10.bin -9412303,913,assets/images/split/image11.bin -9413216,224,assets/images/split/image12.bin -9413440,932,assets/images/split/image13.bin -9414372,1187,assets/images/split/image14.bin -9415559,1143,assets/images/split/image15.bin -9416702,1137,assets/images/split/image16.bin -9417839,1196,assets/images/split/image17.bin -9419035,986,assets/images/split/image18.bin -9420021,26,assets/images/split/image19.bin -9420047,26,assets/images/split/image20.bin -9420073,1561,assets/images/split/image21.bin -9421634,309,assets/images/split/image22.bin -9421943,1525,assets/images/split/image23.bin -9423468,863,assets/images/split/image24.bin -9424331,848,assets/images/split/image25.bin -9425179,1548,assets/images/split/image26.bin -9426727,197,assets/images/split/image27.bin -9426924,166,assets/images/split/image28.bin -9427090,181,assets/images/split/image29.bin -9427271,989,assets/images/split/image30.bin -9428260,1020,assets/images/split/image31.bin -9429280,776,assets/images/split/image32.bin -9430056,774,assets/images/split/image33.bin -9430830,1610,assets/images/split/image34.bin -9432440,1484,assets/images/split/image35.bin -9433924,1696,assets/images/split/image36.bin -9435620,1734,assets/images/split/image37.bin -9437354,1003,assets/images/split/image38.bin -9438357,275,assets/images/split/image39.bin -9438632,551,assets/images/split/image40.bin -9439183,537,assets/images/split/image41.bin -9439720,555,assets/images/split/image42.bin -9440275,546,assets/images/split/image43.bin -9440821,1341,assets/images/split/image44.bin -9442162,1372,assets/images/split/image45.bin -9443534,1007,assets/images/split/image46.bin -9444541,410,assets/images/split/image47.bin -9444951,1108,assets/images/split/image48.bin -9446059,1726,assets/images/split/image49.bin -9447785,636,assets/images/split/image50.bin -9448421,1510,assets/images/split/image51.bin -9449931,824,assets/images/split/image52.bin -9450755,1232,assets/images/split/image53.bin -9451987,1440,assets/images/split/image54.bin -9453427,1170,assets/images/split/image55.bin -9454597,792,assets/images/split/image56.bin -9455389,270,assets/images/split/image57.bin -9455659,241,assets/images/split/image58.bin -9455900,281,assets/images/split/image59.bin -9456181,678,assets/images/split/image60.bin -9456859,416,assets/images/split/image61.bin -9457275,34,assets/images/split/image62.bin -9457309,276,assets/images/split/image63.bin -9457585,156,assets/images/split/image64.bin -9457741,933,assets/images/split/image65.bin -9458674,888,assets/images/split/image66.bin -9459562,836,assets/images/split/image67.bin -9460398,247,assets/images/split/image68.bin -9460645,923,assets/images/split/image69.bin -9461568,429,assets/images/split/image70.bin -9461997,484,assets/images/split/image71.bin -9462481,725,assets/images/split/image72.bin -9463206,198,assets/images/split/image73.bin -9463404,199,assets/images/split/image74.bin -9463603,691,assets/images/split/image75.bin -9464294,418,assets/images/split/image76.bin -9464712,400,assets/images/split/image77.bin -9465112,1505,assets/images/split/image78.bin -9466617,687,assets/images/split/image79.bin -9467304,222,assets/images/split/image80.bin -9467526,500,assets/images/split/image81.bin -9468026,1508,assets/images/split/image82.bin -9469534,441,assets/images/split/image83.bin -9469975,1523,assets/images/split/image84.bin -9471498,551,assets/images/split/image85.bin -9472049,727,assets/images/split/image86.bin -9472776,942,assets/images/split/image87.bin -9473718,761,assets/images/split/image88.bin -9474479,3114,assets/images/split/image89.bin -9477593,3069,assets/images/split/image90.bin -9480662,3121,assets/images/split/image91.bin -9483783,2840,assets/images/split/image92.bin -9486623,3014,assets/images/split/image93.bin -9489637,3176,assets/images/split/image94.bin -9492813,3237,assets/images/split/image95.bin -9496050,3028,assets/images/split/image96.bin -9499078,2941,assets/images/split/image97.bin -9502019,3032,assets/images/split/image98.bin -9505051,3137,assets/images/split/image99.bin -9508188,2975,assets/images/split/image100.bin -9511163,3046,assets/images/split/image101.bin -9514209,3310,assets/images/split/image102.bin -9517519,3334,assets/images/split/image103.bin -9520853,2977,assets/images/split/image104.bin -9523830,2855,assets/images/split/image105.bin -9526685,3352,assets/images/split/image106.bin -9530037,3274,assets/images/split/image107.bin -9533311,2650,assets/images/split/image108.bin -9535961,2166,assets/images/split/image109.bin -9538127,2218,assets/images/split/image110.bin -9540345,2255,assets/images/split/image111.bin -9542600,1940,assets/images/split/image112.bin -9544540,2682,assets/images/split/image113.bin -9547222,3218,assets/images/split/image114.bin -9550440,2954,assets/images/split/image115.bin -9553394,2643,assets/images/split/image116.bin -9556037,3056,assets/images/split/image117.bin -9559093,3340,assets/images/split/image118.bin -9562433,3276,assets/images/split/image119.bin -9565709,2552,assets/images/split/image120.bin -9568261,3265,assets/images/split/image121.bin -9571526,3387,assets/images/split/image122.bin -9574913,3437,assets/images/split/image123.bin -9578350,3056,assets/images/split/image124.bin -9581406,2432,assets/images/split/image125.bin -9583838,2961,assets/images/split/image126.bin -9586799,3233,assets/images/split/image127.bin -9590032,2690,assets/images/split/image128.bin -9592722,3194,assets/images/split/image129.bin -9595916,3403,assets/images/split/image130.bin -9599319,3461,assets/images/split/image131.bin -9602780,3190,assets/images/split/image132.bin -9605970,2985,assets/images/split/image133.bin -9608955,3418,assets/images/split/image134.bin -9612373,3408,assets/images/split/image135.bin -9615781,3125,assets/images/split/image136.bin -9618906,2701,assets/images/split/image137.bin -9621607,3366,assets/images/split/image138.bin -9624973,2853,assets/images/split/image139.bin -9627826,2201,assets/images/split/image140.bin -9630027,1143,assets/images/split/image141.bin -9631170,1157,assets/images/split/image142.bin -9632327,1110,assets/images/split/image143.bin -9633437,2112,assets/images/split/image144.bin -9635549,2122,assets/images/split/image145.bin -9637671,2155,assets/images/split/image146.bin -9639826,1986,assets/images/split/image147.bin -9641812,530,assets/images/split/image148.bin -9642342,587,assets/images/split/image149.bin -9642929,329,assets/images/split/image150.bin -9643258,293,assets/images/split/image151.bin -9643551,784,assets/images/split/image152.bin -9644335,311,assets/images/split/image153.bin -9644646,295,assets/images/split/image154.bin -9644941,315,assets/images/split/image155.bin -9645256,705,assets/images/split/image156.bin -9645961,956,assets/images/split/image157.bin -9646917,1422,assets/images/split/image158.bin -9648339,326,assets/images/split/image159.bin -9648665,315,assets/images/split/image160.bin -9648980,563,assets/images/split/image161.bin -9649543,737,assets/images/split/image162.bin -9650280,796,assets/images/split/image163.bin -9651076,779,assets/images/split/image164.bin -9651855,831,assets/images/split/image165.bin -9652686,757,assets/images/split/image166.bin -9653443,830,assets/images/split/image167.bin -9654273,782,assets/images/split/image168.bin -9655055,851,assets/images/split/image169.bin -9655906,1143,assets/images/split/image170.bin -9657049,761,assets/images/split/image171.bin -9657810,603,assets/images/split/image172.bin -9658413,186,assets/images/split/image173.bin -9658599,678,assets/images/split/image174.bin -9659277,938,assets/images/split/image175.bin -9660215,572,assets/images/split/image176.bin -9660787,2014,assets/images/split/image177.bin -9662801,625,assets/images/split/image178.bin -9663426,755,assets/images/split/image179.bin -9664181,788,assets/images/split/image180.bin -9664969,296,assets/images/split/image181.bin -9665265,505,assets/images/split/image182.bin -9665770,691,assets/images/split/image183.bin -9666461,519,assets/images/split/image184.bin -9666980,603,assets/images/split/image185.bin -9667583,1353,assets/images/split/image186.bin -9668936,1099,assets/images/split/image187.bin -9670035,895,assets/images/split/image188.bin -9670930,1568,assets/images/split/image189.bin -9672498,1107,assets/images/split/image190.bin -9673605,1388,assets/images/split/image191.bin -9674993,1431,assets/images/split/image192.bin -9676424,1302,assets/images/split/image193.bin -9677726,648,assets/images/split/image194.bin -9678374,712,assets/images/split/image195.bin -9679086,1431,assets/images/split/image196.bin -9680517,1149,assets/images/split/image197.bin -9681666,671,assets/images/split/image198.bin -9682337,675,assets/images/split/image199.bin -9683012,330,assets/images/split/image200.bin -9683342,1210,assets/images/split/image201.bin -9684552,1018,assets/images/split/image202.bin -9685570,1327,assets/images/split/image203.bin -9686897,1120,assets/images/split/image204.bin -9688017,1377,assets/images/split/image205.bin -9689394,1271,assets/images/split/image206.bin -9690665,1033,assets/images/split/image207.bin -9691698,1603,assets/images/split/image208.bin -9693301,2859,assets/images/split/image209.bin -9696160,3134,assets/images/split/image210.bin -9699294,1400,assets/images/split/image211.bin -9700694,207,assets/images/split/image212.bin -9700901,656,assets/images/split/image213.bin -9701557,1238,assets/images/split/image214.bin -9702795,224,assets/images/split/image215.bin -9703019,622,assets/images/split/image216.bin -9703641,334,assets/images/split/image217.bin -9703975,480,assets/images/split/image218.bin -9704455,281,assets/images/split/image219.bin -9704736,984,assets/images/split/image220.bin -9705720,1033,assets/images/split/image221.bin -9706753,1010,assets/images/split/image222.bin -9707763,1033,assets/images/split/image223.bin -9708796,1090,assets/images/split/image224.bin -9709886,1085,assets/images/split/image225.bin -9710971,1014,assets/images/split/image226.bin -9711985,691,assets/images/split/image227.bin -9712676,895,assets/images/split/image228.bin -9713571,617,assets/images/split/image229.bin -9714188,553,assets/images/split/image230.bin -9714741,899,assets/images/split/image231.bin -9715640,1498,assets/images/split/image232.bin -9717138,833,assets/images/split/image233.bin -9717971,302,assets/images/split/image234.bin -9718273,1364,assets/images/split/image235.bin -9719637,925,assets/images/split/image236.bin -9720562,1174,assets/images/split/image237.bin -9721736,1257,assets/images/split/image238.bin -9722993,967,assets/images/split/image239.bin -9723960,991,assets/images/split/image240.bin -9724951,1024,assets/images/split/image241.bin -9725975,581,assets/images/split/image242.bin -9726556,502,assets/images/split/image243.bin -9727058,351,assets/images/split/image244.bin -9727409,1144,assets/images/split/image245.bin -9728553,525,assets/images/split/image246.bin -9729078,738,assets/images/split/image247.bin -9729816,199,assets/images/split/image248.bin -9730015,180,assets/images/split/image249.bin -9730195,152,assets/images/split/image250.bin -9730347,199,assets/images/split/image251.bin -9730546,809,assets/images/split/image252.bin -9731355,673,assets/images/split/image253.bin -9732028,717,assets/images/split/image254.bin -9732745,1032,assets/images/split/image255.bin -9733777,1003,assets/images/split/image256.bin -9734780,463,assets/images/split/image257.bin -9735243,829,assets/images/split/image258.bin -9736072,647,assets/images/split/image259.bin -9736719,806,assets/images/split/image260.bin -9737525,896,assets/images/split/image261.bin -9738421,689,assets/images/split/image262.bin -9739110,708,assets/images/split/image263.bin -9739818,558,assets/images/split/image264.bin -9740376,1412,assets/images/split/image265.bin -9741788,424,assets/images/split/image266.bin -9742212,79,assets/images/split/image267.bin -9742291,1368,assets/images/split/image268.bin -9743659,727,assets/images/split/image269.bin -9744386,1410,assets/images/split/image270.bin -9745796,694,assets/images/split/image271.bin -9746490,1302,assets/images/split/image272.bin -9747792,1248,assets/images/split/image273.bin -9749040,1945,assets/images/split/image274.bin -9750985,1920,assets/images/split/image275.bin -9752905,2060,assets/images/split/image276.bin -9754965,1959,assets/images/split/image277.bin -9756924,1924,assets/images/split/image278.bin -9758848,1715,assets/images/split/image279.bin -9760563,666,assets/images/split/image280.bin -9761229,905,assets/images/split/image281.bin -9762134,750,assets/images/split/image282.bin -9762884,799,assets/images/split/image283.bin -9763683,802,assets/images/split/image284.bin -9764485,1400,assets/images/split/image285.bin -9765885,798,assets/images/split/image286.bin -9766683,1064,assets/images/split/image287.bin -9767747,1217,assets/images/split/image288.bin -9768964,1145,assets/images/split/image289.bin -9770109,1273,assets/images/split/image290.bin -9771382,1163,assets/images/split/image291.bin -9772545,991,assets/images/split/image292.bin -9773536,1350,assets/images/split/image293.bin -9774886,1328,assets/images/split/image294.bin -9776214,1323,assets/images/split/image295.bin -9777537,1007,assets/images/split/image296.bin -9778544,1088,assets/images/split/image297.bin -9779632,930,assets/images/split/image298.bin -9780562,783,assets/images/split/image299.bin -9781345,771,assets/images/split/image300.bin -9782116,771,assets/images/split/image301.bin -9782887,884,assets/images/split/image302.bin -9783771,1333,assets/images/split/image303.bin -9785104,639,assets/images/split/image304.bin -9785743,200,assets/images/split/image305.bin -9785943,573,assets/images/split/image306.bin -9786516,687,assets/images/split/image307.bin -9787203,1376,assets/images/split/image308.bin -9788579,901,assets/images/split/image309.bin -9789480,949,assets/images/split/image310.bin -9790429,1351,assets/images/split/image311.bin -9791780,815,assets/images/split/image312.bin -9792595,904,assets/images/split/image313.bin -9793499,636,assets/images/split/image314.bin -9794135,636,assets/images/split/image315.bin -9794771,581,assets/images/split/image316.bin -9795352,581,assets/images/split/image317.bin -9795933,582,assets/images/split/image318.bin -9796515,678,assets/images/split/image319.bin -9797193,321,assets/images/split/image320.bin -9797514,536,assets/images/split/image321.bin -9798050,1115,assets/images/split/image322.bin -9799165,1515,assets/images/split/image323.bin -9800680,1563,assets/images/split/image324.bin -9802243,1581,assets/images/split/image325.bin -9803824,1567,assets/images/split/image326.bin -9805391,1601,assets/images/split/image327.bin -9806992,1619,assets/images/split/image328.bin -9808611,1525,assets/images/split/image329.bin -9810136,836,assets/images/split/image330.bin -9810972,902,assets/images/split/image331.bin -9811874,921,assets/images/split/image332.bin -9812795,864,assets/images/split/image333.bin -9813659,353,assets/images/split/image334.bin -9814012,282,assets/images/split/image335.bin -9814294,307,assets/images/split/image336.bin -9814601,298,assets/images/split/image337.bin -9814899,840,assets/images/split/image338.bin -9815739,1319,assets/images/split/image339.bin -9817058,922,assets/images/split/image340.bin -9817980,1006,assets/images/split/image341.bin -9818986,984,assets/images/split/image342.bin -9819970,1115,assets/images/split/image343.bin -9821085,232,assets/images/split/image344.bin -9821317,290,assets/images/split/image345.bin -9821607,1037,assets/images/split/image346.bin -9822644,993,assets/images/split/image347.bin -9823637,193,assets/images/split/image348.bin -9823830,271,assets/images/split/image349.bin -9824101,770,assets/images/split/image350.bin -9824871,533,assets/images/split/image351.bin -9825404,213,assets/images/split/image352.bin -9825617,818,assets/images/split/image353.bin -9826435,456,assets/images/split/image354.bin -9826891,168,assets/images/split/image355.bin -9827059,906,assets/images/split/image356.bin -9827965,704,assets/images/split/image357.bin -9828669,1098,assets/images/split/image358.bin -9829767,987,assets/images/split/image359.bin -9830754,861,assets/images/split/image360.bin -9831615,845,assets/images/split/image361.bin -9832460,1334,assets/images/split/image362.bin -9833794,960,assets/images/split/image363.bin -9834754,1224,assets/images/split/image364.bin -9835978,973,assets/images/split/image365.bin -9836951,532,assets/images/split/image366.bin -9837483,756,assets/images/split/image367.bin -9838239,950,assets/images/split/image368.bin -9839189,990,assets/images/split/image369.bin -9840179,622,assets/images/split/image370.bin -9840801,622,assets/images/split/image371.bin -9841423,1375,assets/images/split/image372.bin -9842798,1418,assets/images/split/image373.bin -9844216,823,assets/images/split/image374.bin -9845039,1023,assets/images/split/image375.bin -9846062,949,assets/images/split/image376.bin -9847011,949,assets/images/split/image377.bin -9847960,818,assets/images/split/image378.bin -9848778,1020,assets/images/split/image379.bin -9849798,964,assets/images/split/image380.bin -9850762,1094,assets/images/split/image381.bin -9851856,1018,assets/images/split/image382.bin -9852874,609,assets/images/split/image383.bin -9853483,1333,assets/images/split/image384.bin -9854816,1389,assets/images/split/image385.bin -9856205,1103,assets/images/split/image386.bin -9857308,2429,assets/images/split/image387.bin -9859737,2306,assets/images/split/image388.bin -9862043,2349,assets/images/split/image389.bin -9864392,2324,assets/images/split/image390.bin -9866716,2433,assets/images/split/image391.bin -9869149,2302,assets/images/split/image392.bin -9871451,2293,assets/images/split/image393.bin -9873744,2168,assets/images/split/image394.bin -9875912,545,assets/images/split/image395.bin -9876457,1136,assets/images/split/image396.bin -9877593,1318,assets/images/split/image397.bin -9878911,1254,assets/images/split/image398.bin -9880165,1061,assets/images/split/image399.bin -9881226,859,assets/images/split/image400.bin -9882085,1077,assets/images/split/image401.bin -9883162,1081,assets/images/split/image402.bin -9884243,828,assets/images/split/image403.bin -9885071,780,assets/images/split/image404.bin -9885851,767,assets/images/split/image405.bin -9886618,691,assets/images/split/image406.bin -9887309,1321,assets/images/split/image407.bin -9888630,845,assets/images/split/image408.bin -9889475,525,assets/images/split/image409.bin -9890000,925,assets/images/split/image410.bin -9890925,753,assets/images/split/image411.bin -9891678,435,assets/images/split/image412.bin -9892113,526,assets/images/split/image413.bin -9892639,363,assets/images/split/image414.bin -9893002,519,assets/images/split/image415.bin -9893521,399,assets/images/split/image416.bin -9893920,463,assets/images/split/image417.bin -9894383,447,assets/images/split/image418.bin -9894830,1750,assets/images/split/image419.bin -9896580,988,assets/images/split/image420.bin -9897568,1760,assets/images/split/image421.bin -9899328,547,assets/images/split/image422.bin -9899875,483,assets/images/split/image423.bin -9900358,344,assets/images/split/image424.bin -9900702,385,assets/images/split/image425.bin -9901087,1107,assets/images/split/image426.bin -9902194,1374,assets/images/split/image427.bin -9903568,1467,assets/images/split/image428.bin -9905035,1317,assets/images/split/image429.bin -9906352,1837,assets/images/split/image430.bin -9908189,1214,assets/images/split/image431.bin -9909403,755,assets/images/split/image432.bin -9910158,1084,assets/images/split/image433.bin -9911242,998,assets/images/split/image434.bin -9912240,1579,assets/images/split/image435.bin -9913819,797,assets/images/split/image436.bin -9914616,768,assets/images/split/image437.bin -9915384,1615,assets/images/split/image438.bin -9916999,1527,assets/images/split/image439.bin -9918526,1637,assets/images/split/image440.bin -9920163,968,assets/images/split/image441.bin -9921131,971,assets/images/split/image442.bin -9922102,870,assets/images/split/image443.bin -9922972,1718,assets/images/split/image444.bin -9924690,1826,assets/images/split/image445.bin -9926516,2215,assets/images/split/image446.bin -9928731,2252,assets/images/split/image447.bin -9930983,1008,assets/images/split/image448.bin -9931991,827,assets/images/split/image449.bin -9932818,580,assets/images/split/image450.bin -9933398,512,assets/images/split/image451.bin -9933910,503,assets/images/split/image452.bin -9934413,1139,assets/images/split/image453.bin -9935552,964,assets/images/split/image454.bin -9936516,987,assets/images/split/image455.bin -9937503,480,assets/images/split/image456.bin -9937983,493,assets/images/split/image457.bin -9938476,1325,assets/images/split/image458.bin -9939801,1151,assets/images/split/image459.bin -9940952,592,assets/images/split/image460.bin -9941544,646,assets/images/split/image461.bin -9942190,180,assets/images/split/image462.bin -9942370,163,assets/images/split/image463.bin -9942533,486,assets/images/split/image464.bin -9943019,430,assets/images/split/image465.bin -9943449,645,assets/images/split/image466.bin -9944094,547,assets/images/split/image467.bin -9944641,506,assets/images/split/image468.bin -9945147,1954,assets/images/split/image469.bin -9947101,1950,assets/images/split/image470.bin -9949051,320,assets/images/split/image471.bin -9949371,630,assets/images/split/image472.bin -9950001,656,assets/images/split/image473.bin -9950657,612,assets/images/split/image474.bin -9951269,1156,assets/images/split/image475.bin -9952425,966,assets/images/split/image476.bin -9953391,835,assets/images/split/image477.bin -9954226,827,assets/images/split/image478.bin -9955053,809,assets/images/split/image479.bin -9955862,973,assets/images/split/image480.bin -9956835,321,assets/images/split/image481.bin -9957156,1312,assets/images/split/image482.bin -9958468,1139,assets/images/split/image483.bin -9959607,1216,assets/images/split/image484.bin -9960823,897,assets/images/split/image485.bin -9961720,944,assets/images/split/image486.bin -9962664,1010,assets/images/split/image487.bin -9963674,1118,assets/images/split/image488.bin -9964792,1168,assets/images/split/image489.bin -9965960,937,assets/images/split/image490.bin -9966897,923,assets/images/split/image491.bin -9967820,866,assets/images/split/image492.bin -9968686,680,assets/images/split/image493.bin -9969366,1465,assets/images/split/image494.bin -9970831,187,assets/images/split/image495.bin -9971018,186,assets/images/split/image496.bin -9971204,183,assets/images/split/image497.bin -9971387,265,assets/images/split/image498.bin -9971652,225,assets/images/split/image499.bin -9971877,1182,assets/images/split/image500.bin -9973059,1139,assets/images/split/image501.bin -9974198,860,assets/images/split/image502.bin -9975058,823,assets/images/split/image503.bin -9975881,638,assets/images/split/image504.bin -9976519,584,assets/images/split/image505.bin -9977103,571,assets/images/split/image506.bin -9977674,338,assets/images/split/image507.bin -9978012,691,assets/images/split/image508.bin -9978703,392,assets/images/split/image509.bin -9979095,631,assets/images/split/image510.bin -9979726,517,assets/images/split/image511.bin -9980243,420,assets/images/split/image512.bin -9980663,158,assets/images/split/image513.bin -9980821,812,assets/images/split/image514.bin -9981633,1199,assets/images/split/image515.bin -9982832,266,assets/images/split/image516.bin -9983098,312,assets/images/split/image517.bin -9983410,319,assets/images/split/image518.bin -9983729,1236,assets/images/split/image519.bin -9984965,327,assets/images/split/image520.bin -9985292,647,assets/images/split/image521.bin -9985939,157,assets/images/split/image522.bin -9986096,749,assets/images/split/image523.bin -9986845,607,assets/images/split/image524.bin -9987452,266,assets/images/split/image525.bin -9987718,736,assets/images/split/image526.bin -9988454,883,assets/images/split/image527.bin -9989337,426,assets/images/split/image528.bin -9989763,749,assets/images/split/image529.bin -9990512,331,assets/images/split/image530.bin -9990843,1156,assets/images/split/image531.bin -9991999,746,assets/images/split/image532.bin -9992745,69,assets/images/split/image533.bin -9992814,484,assets/images/split/image534.bin -9993298,964,assets/images/split/image535.bin -9994262,1072,assets/images/split/image536.bin -9995334,805,assets/images/split/image537.bin -9996139,662,assets/images/split/image538.bin -9996801,1175,assets/images/split/image539.bin -9997976,828,assets/images/split/image540.bin -9998804,687,assets/images/split/image541.bin -9999491,249,assets/images/split/image542.bin -9999740,1046,assets/images/split/image543.bin -10000786,835,assets/images/split/image544.bin -10001621,1516,assets/images/split/image545.bin -10003137,1892,assets/images/split/image546.bin -10005029,1902,assets/images/split/image547.bin -10006931,1835,assets/images/split/image548.bin -10008766,1068,assets/images/split/image549.bin -10009834,968,assets/images/split/image550.bin -10010802,1035,assets/images/split/image551.bin -10011837,1767,assets/images/split/image552.bin -10013604,1679,assets/images/split/image553.bin -10015283,1538,assets/images/split/image554.bin -10016821,1538,assets/images/split/image555.bin -10018359,1525,assets/images/split/image556.bin -10019884,1734,assets/images/split/image557.bin -10021618,1529,assets/images/split/image558.bin -10023147,1707,assets/images/split/image559.bin -10024854,1896,assets/images/split/image560.bin -10026750,1644,assets/images/split/image561.bin -10028394,1581,assets/images/split/image562.bin -10029975,1590,assets/images/split/image563.bin -10031565,1537,assets/images/split/image564.bin -10033102,1704,assets/images/split/image565.bin -10034806,1695,assets/images/split/image566.bin -10036501,1606,assets/images/split/image567.bin -10038107,378,assets/images/split/image568.bin -10038485,2029,assets/images/split/image569.bin -10040514,1846,assets/images/split/image570.bin -10042360,1903,assets/images/split/image571.bin -10044263,2050,assets/images/split/image572.bin -10046313,2028,assets/images/split/image573.bin -10048341,1904,assets/images/split/image574.bin -10050245,1793,assets/images/split/image575.bin -10052038,2030,assets/images/split/image576.bin -10054068,867,assets/images/split/image577.bin -10054935,1214,assets/images/split/image578.bin -10056149,1169,assets/images/split/image579.bin -10057318,500,assets/images/split/image580.bin -10057818,201,assets/images/split/image581.bin -10058019,1534,assets/images/split/image582.bin -10059553,1527,assets/images/split/image583.bin -10061080,1548,assets/images/split/image584.bin -10062628,1541,assets/images/split/image585.bin -10064169,1039,assets/images/split/image586.bin -10065208,1024,assets/images/split/image587.bin -10066232,1122,assets/images/split/image588.bin -10067354,1308,assets/images/split/image589.bin -10068662,1245,assets/images/split/image590.bin -10069907,1329,assets/images/split/image591.bin -10071236,1196,assets/images/split/image592.bin -10072432,1130,assets/images/split/image593.bin -10073562,1427,assets/images/split/image594.bin -10074989,891,assets/images/split/image595.bin -10075880,1210,assets/images/split/image596.bin -10077090,1422,assets/images/split/image597.bin -10078512,433,assets/images/split/image598.bin -10078945,1377,assets/images/split/image599.bin -10080322,1619,assets/images/split/image600.bin -10081941,1920,assets/images/split/image601.bin -10083861,1617,assets/images/split/image602.bin -10085478,481,assets/images/split/image603.bin -10085959,1402,assets/images/split/image604.bin -10087361,1317,assets/images/split/image605.bin -10088678,1461,assets/images/split/image606.bin -10090139,358,assets/images/split/image607.bin -10090497,325,assets/images/split/image608.bin -10090822,1694,assets/images/split/image609.bin -10092516,2105,assets/images/split/image610.bin -10094621,1404,assets/images/split/image611.bin -10096025,2010,assets/images/split/image612.bin -10098035,702,assets/images/split/image613.bin -10098737,616,assets/images/split/image614.bin -10099353,667,assets/images/split/image615.bin -10100020,646,assets/images/split/image616.bin -10100666,622,assets/images/split/image617.bin -10101288,593,assets/images/split/image618.bin -10101881,926,assets/images/split/image619.bin -10102807,276,assets/images/split/image620.bin -10103083,611,assets/images/split/image621.bin -10103694,1432,assets/images/split/image622.bin -10105126,1128,assets/images/split/image623.bin -10106254,1146,assets/images/split/image624.bin -10107400,293,assets/images/split/image625.bin -10107693,446,assets/images/split/image626.bin -10108139,267,assets/images/split/image627.bin -10108406,328,assets/images/split/image628.bin -10108734,320,assets/images/split/image629.bin -10109054,328,assets/images/split/image630.bin -10109382,1458,assets/images/split/image631.bin -10110840,1000,assets/images/split/image632.bin -10111840,621,assets/images/split/image633.bin -10112461,961,assets/images/split/image634.bin -10113422,973,assets/images/split/image635.bin -10114395,85,assets/images/split/image636.bin -10114480,612,assets/images/split/image637.bin -10115092,870,assets/images/split/image638.bin -10115962,447,assets/images/split/image639.bin -10116409,1848,assets/images/split/image640.bin -10118257,812,assets/images/split/image641.bin -10119069,1363,assets/images/split/image642.bin -10120432,908,assets/images/split/image643.bin -10121340,301,assets/images/split/image644.bin -10121641,726,assets/images/split/image645.bin -10122367,445,assets/images/split/image646.bin -10122812,1187,assets/images/split/image647.bin -10123999,409,assets/images/split/image648.bin -10124408,701,assets/images/split/image649.bin -10125109,612,assets/images/split/image650.bin -10125721,510,assets/images/split/image651.bin -10126231,1260,assets/images/split/image652.bin -10127491,620,assets/images/split/image653.bin -10128111,587,assets/images/split/image654.bin -10128698,837,assets/images/split/image655.bin -10129535,889,assets/images/split/image656.bin -10130424,164,assets/images/split/image657.bin -10130588,171,assets/images/split/image658.bin -10130759,85,assets/images/split/image659.bin -10130844,1025,assets/images/split/image660.bin -10131869,834,assets/images/split/image661.bin -10132703,1241,assets/images/split/image662.bin -10133944,1205,assets/images/split/image663.bin -10135149,196,assets/images/split/image664.bin -10135345,226,assets/images/split/image665.bin -10135571,1511,assets/images/split/image666.bin -10137082,1014,assets/images/split/image667.bin -10138096,997,assets/images/split/image668.bin -10139093,957,assets/images/split/image669.bin -10140050,1084,assets/images/split/image670.bin -10141134,841,assets/images/split/image671.bin -10141975,1081,assets/images/split/image672.bin -10143056,889,assets/images/split/image673.bin -10143945,866,assets/images/split/image674.bin -10144811,875,assets/images/split/image675.bin -10145686,792,assets/images/split/image676.bin -10146478,675,assets/images/split/image677.bin -10147153,129,assets/images/split/image678.bin -10147282,634,assets/images/split/image679.bin -10147916,1258,assets/images/split/image680.bin -10149174,1443,assets/images/split/image681.bin -10150617,1408,assets/images/split/image682.bin -10152025,1278,assets/images/split/image683.bin -10153303,314,assets/images/split/image684.bin -10153617,478,assets/images/split/image685.bin -10154095,742,assets/images/split/image686.bin -10154837,674,assets/images/split/image687.bin -10155511,787,assets/images/split/image688.bin -10156298,831,assets/images/split/image689.bin -10157129,543,assets/images/split/image690.bin -10157672,278,assets/images/split/image691.bin -10157950,162,assets/images/split/image692.bin -10158112,333,assets/images/split/image693.bin -10158445,1101,assets/images/split/image694.bin -10159546,593,assets/images/split/image695.bin -10160139,508,assets/images/split/image696.bin -10160647,529,assets/images/split/image697.bin -10161176,452,assets/images/split/image698.bin -10161628,388,assets/images/split/image699.bin -10162016,543,assets/images/split/image700.bin -10162559,343,assets/images/split/image701.bin -10162902,828,assets/images/split/image702.bin -10163730,138,assets/images/split/image703.bin -10163868,525,assets/images/split/image704.bin -10164393,520,assets/images/split/image705.bin -10164913,884,assets/images/split/image706.bin -10165797,662,assets/images/split/image707.bin -10166459,498,assets/images/split/image708.bin -10166957,351,assets/images/split/image709.bin -10167308,1214,assets/images/split/image710.bin -10168522,789,assets/images/split/image711.bin -10169311,1242,assets/images/split/image712.bin -10170553,589,assets/images/split/image713.bin -10171142,1548,assets/images/split/image714.bin -10172690,192,assets/images/split/image715.bin -10172882,366,assets/images/split/image716.bin -10173248,850,assets/images/split/image717.bin -10174098,253,assets/images/split/image718.bin -10174351,499,assets/images/split/image719.bin -10174850,593,assets/images/split/image720.bin -10175443,539,assets/images/split/image721.bin -10175982,177,assets/images/split/image722.bin -10176159,552,assets/images/split/image723.bin -10176711,536,assets/images/split/image724.bin -10177247,851,assets/images/split/image725.bin -10178098,1062,assets/images/split/image726.bin -10179160,453,assets/images/split/image727.bin -10179613,921,assets/images/split/image728.bin -10180534,1009,assets/images/split/image729.bin -10181543,457,assets/images/split/image730.bin -10182000,408,assets/images/split/image731.bin -10182408,455,assets/images/split/image732.bin -10182863,1335,assets/images/split/image733.bin -10184198,1307,assets/images/split/image734.bin -10185505,1187,assets/images/split/image735.bin -10186692,1518,assets/images/split/image736.bin -10188210,1496,assets/images/split/image737.bin -10189706,1413,assets/images/split/image738.bin -10191119,1346,assets/images/split/image739.bin -10192465,1410,assets/images/split/image740.bin -10193875,1097,assets/images/split/image741.bin -10194972,1179,assets/images/split/image742.bin -10196151,1389,assets/images/split/image743.bin -10197540,1470,assets/images/split/image744.bin -10199010,1499,assets/images/split/image745.bin -10200509,1028,assets/images/split/image746.bin -10201537,1278,assets/images/split/image747.bin -10202815,1420,assets/images/split/image748.bin -10204235,1379,assets/images/split/image749.bin -10205614,1458,assets/images/split/image750.bin -10207072,1403,assets/images/split/image751.bin -10208475,1163,assets/images/split/image752.bin -10209638,1198,assets/images/split/image753.bin -10210836,1300,assets/images/split/image754.bin -10212136,1436,assets/images/split/image755.bin -10213572,1384,assets/images/split/image756.bin -10214956,1466,assets/images/split/image757.bin -10216422,1425,assets/images/split/image758.bin -10217847,520,assets/images/split/image759.bin -10218367,510,assets/images/split/image760.bin -10218877,1285,assets/images/split/image761.bin -10220162,927,assets/images/split/image762.bin -10221089,178,assets/images/split/image763.bin -10221267,167,assets/images/split/image764.bin -10221434,103,assets/images/split/image765.bin -10221537,1375,assets/images/split/image766.bin -10222912,510,assets/images/split/image767.bin -10223422,801,assets/images/split/image768.bin -10224223,305,assets/images/split/image769.bin -10224528,339,assets/images/split/image770.bin -10224867,1154,assets/images/split/image771.bin -10226021,1548,assets/images/split/image772.bin -10227569,601,assets/images/split/image773.bin -10228170,899,assets/images/split/image774.bin -10229069,120,assets/images/split/image775.bin -10229189,1228,assets/images/split/image776.bin -10230417,1347,assets/images/split/image777.bin -10231764,1468,assets/images/split/image778.bin -10233232,881,assets/images/split/image779.bin -10234113,1474,assets/images/split/image780.bin -10235587,1250,assets/images/split/image781.bin -10236837,1605,assets/images/split/image782.bin -10238442,1339,assets/images/split/image783.bin -10239781,1096,assets/images/split/image784.bin -10240877,504,assets/images/split/image785.bin -10241381,296,assets/images/split/image786.bin -10241677,364,assets/images/split/image787.bin -10242041,967,assets/images/split/image788.bin -10243008,573,assets/images/split/image789.bin -10243581,1580,assets/images/split/image790.bin -10245161,1538,assets/images/split/image791.bin -10246699,1503,assets/images/split/image792.bin -10248202,1640,assets/images/split/image793.bin -10249842,1656,assets/images/split/image794.bin -10251498,1517,assets/images/split/image795.bin -10253015,1600,assets/images/split/image796.bin -10254615,624,assets/images/split/image797.bin -10255239,588,assets/images/split/image798.bin -10255827,612,assets/images/split/image799.bin -10256439,225,assets/images/split/image800.bin -10256664,152,assets/images/split/image801.bin -10256816,451,assets/images/split/image802.bin -10257267,671,assets/images/split/image803.bin -10257938,415,assets/images/split/image804.bin -10258353,464,assets/images/split/image805.bin -10258817,783,assets/images/split/image806.bin -10259600,987,assets/images/split/image807.bin -10260587,325,assets/images/split/image808.bin -10260912,665,assets/images/split/image809.bin -10261577,1056,assets/images/split/image810.bin -10262633,600,assets/images/split/image811.bin -10263233,670,assets/images/split/image812.bin -10263903,821,assets/images/split/image813.bin -10264724,457,assets/images/split/image814.bin -10265181,1145,assets/images/split/image815.bin -10266326,479,assets/images/split/image816.bin -10266805,729,assets/images/split/image817.bin -10267534,1078,assets/images/split/image818.bin -10268612,611,assets/images/split/image819.bin -10269223,1539,assets/images/split/image820.bin -10270762,1391,assets/images/split/image821.bin -10272153,68,assets/images/split/image822.bin -10272221,593,assets/images/split/image823.bin -10272814,388,assets/images/split/image824.bin -10273202,683,assets/images/split/image825.bin -10273885,886,assets/images/split/image826.bin -10274771,1109,assets/images/split/image827.bin -10275880,1334,assets/images/split/image828.bin -10277214,1256,assets/images/split/image829.bin -10278470,1369,assets/images/split/image830.bin -10279839,1401,assets/images/split/image831.bin -10281240,1694,assets/images/split/image832.bin -10282934,1882,assets/images/split/image833.bin -10284816,1707,assets/images/split/image834.bin -10286523,957,assets/images/split/image835.bin -10287480,790,assets/images/split/image836.bin -10288270,1236,assets/images/split/image837.bin -10289506,590,assets/images/split/image838.bin -10290096,1909,assets/images/split/image839.bin -10292005,1962,assets/images/split/image840.bin -10293967,1675,assets/images/split/image841.bin -10295642,1677,assets/images/split/image842.bin -10297319,1402,assets/images/split/image843.bin -10298721,1393,assets/images/split/image844.bin -10300114,762,assets/images/split/image845.bin -10300876,1134,assets/images/split/image846.bin -10302010,910,assets/images/split/image847.bin -10302920,1187,assets/images/split/image848.bin -10304107,183,assets/images/split/image849.bin -10304290,1532,assets/images/split/image850.bin -10305822,783,assets/images/split/image851.bin -10306605,965,assets/images/split/image852.bin -10307570,460,assets/images/split/image853.bin -10308030,505,assets/images/split/image854.bin -10308535,389,assets/images/split/image855.bin -10308924,734,assets/images/split/image856.bin -10309658,655,assets/images/split/image857.bin -10310313,1106,assets/images/split/image858.bin -10311419,795,assets/images/split/image859.bin -10312214,1788,assets/images/split/image860.bin -10314002,1802,assets/images/split/image861.bin -10315804,529,assets/images/split/image862.bin -10316333,728,assets/images/split/image863.bin -10317061,447,assets/images/split/image864.bin -10317508,557,assets/images/split/image865.bin -10318065,403,assets/images/split/image866.bin -10318468,1256,assets/images/split/image867.bin -10319724,294,assets/images/split/image868.bin -10320018,255,assets/images/split/image869.bin -10320273,796,assets/images/split/image870.bin -10321069,379,assets/images/split/image871.bin -10321448,352,assets/images/split/image872.bin -10321800,67,assets/images/split/image873.bin -10321867,400,assets/images/split/image874.bin -10322267,47,assets/images/split/image875.bin -10322314,334,assets/images/split/image876.bin -10322648,314,assets/images/split/image877.bin -10322962,47,assets/images/split/image878.bin -10323009,57,assets/images/split/image879.bin -10323066,81,assets/images/split/image880.bin -10323147,41,assets/images/split/image881.bin -10323188,75,assets/images/split/image882.bin -10323263,43,assets/images/split/image883.bin -10323306,221,assets/images/split/image884.bin -10323527,1792,assets/images/split/image885.bin -10325319,584,assets/images/split/image886.bin -10325903,335,assets/images/split/image887.bin -10326238,364,assets/images/split/image888.bin -10326602,1016,assets/images/split/image889.bin -10327618,688,assets/images/split/image890.bin -10328306,447,assets/images/split/image891.bin -10328753,944,assets/images/split/image892.bin -10329697,1001,assets/images/split/image893.bin -10330698,976,assets/images/split/image894.bin -10331674,882,assets/images/split/image895.bin -10332556,1490,assets/images/split/image896.bin -10334046,1809,assets/images/split/image897.bin -10335855,1650,assets/images/split/image898.bin -10337505,1226,assets/images/split/image899.bin -10338731,1002,assets/images/split/image900.bin -10339733,551,assets/images/split/image901.bin -10340284,958,assets/images/split/image902.bin -10341242,852,assets/images/split/image903.bin -10342094,854,assets/images/split/image904.bin -10342948,949,assets/images/split/image905.bin -10343897,1053,assets/images/split/image906.bin -10344950,697,assets/images/split/image907.bin -10345647,429,assets/images/split/image908.bin -10346076,1299,assets/images/split/image909.bin -10347375,1220,assets/images/split/image910.bin -10348595,1135,assets/images/split/image911.bin -10349730,1245,assets/images/split/image912.bin -10350975,1627,assets/images/split/image913.bin -10352602,919,assets/images/split/image914.bin -10353521,751,assets/images/split/image915.bin -10354272,790,assets/images/split/image916.bin -10355062,790,assets/images/split/image917.bin -10355852,152,assets/images/split/image918.bin -10356004,424,assets/images/split/image919.bin -10356428,630,assets/images/split/image920.bin -10357058,1945,assets/images/split/image921.bin -10359003,668,assets/images/split/image922.bin -10359671,912,assets/images/split/image923.bin -10360583,954,assets/images/split/image924.bin -10361537,2214,assets/images/split/image925.bin -10363751,830,assets/images/split/image926.bin -10364581,1548,assets/images/split/image927.bin -10366129,1616,assets/images/split/image928.bin -10367745,567,assets/images/split/image929.bin -10368312,860,assets/images/split/image930.bin -10369172,787,assets/images/split/image931.bin -10369959,478,assets/images/split/image932.bin -10370437,445,assets/images/split/image933.bin -10370882,617,assets/images/split/image934.bin -10371499,336,assets/images/split/image935.bin -10371835,1078,assets/images/split/image936.bin -10372913,358,assets/images/split/image937.bin -10373271,397,assets/images/split/image938.bin -10373668,513,assets/images/split/image939.bin -10374181,1056,assets/images/split/image940.bin -10375237,726,assets/images/split/image941.bin -10375963,730,assets/images/split/image942.bin -10376693,815,assets/images/split/image943.bin -10377508,697,assets/images/split/image944.bin -10378205,669,assets/images/split/image945.bin -10378874,506,assets/images/split/image946.bin -10379380,639,assets/images/split/image947.bin -10380019,241,assets/images/split/image948.bin -10380260,1511,assets/images/split/image949.bin -10381771,1649,assets/images/split/image950.bin -10383420,1323,assets/images/split/image951.bin -10384743,2168,assets/images/split/image952.bin -10386911,1945,assets/images/split/image953.bin -10388856,1508,assets/images/split/image954.bin -10390364,1544,assets/images/split/image955.bin -10391908,1384,assets/images/split/image956.bin -10393292,1473,assets/images/split/image957.bin -10394765,1509,assets/images/split/image958.bin -10396274,1908,assets/images/split/image959.bin -10398182,647,assets/images/split/image960.bin -10398829,647,assets/images/split/image961.bin -10399476,1888,assets/images/split/image962.bin -10401364,2122,assets/images/split/image963.bin -10403486,2157,assets/images/split/image964.bin -10405643,2153,assets/images/split/image965.bin -10407796,2110,assets/images/split/image966.bin -10409906,2097,assets/images/split/image967.bin -10412003,2126,assets/images/split/image968.bin -10414129,2080,assets/images/split/image969.bin -10416209,645,assets/images/split/image970.bin -10416854,753,assets/images/split/image971.bin -10417607,1227,assets/images/split/image972.bin -10418834,2175,assets/images/split/image973.bin -10421009,2221,assets/images/split/image974.bin -10423230,2175,assets/images/split/image975.bin -10425405,2175,assets/images/split/image976.bin -10427580,2210,assets/images/split/image977.bin -10429790,2175,assets/images/split/image978.bin -10431965,2330,assets/images/split/image979.bin -10434295,601,assets/images/split/image980.bin -10434896,1654,assets/images/split/image981.bin -10436550,1654,assets/images/split/image982.bin -10438204,74,assets/images/split/image983.bin -10438278,880,assets/images/split/image984.bin -10439158,775,assets/images/split/image985.bin -10439933,785,assets/images/split/image986.bin -10440718,1306,assets/images/split/image987.bin -10442024,410,assets/images/split/image988.bin -10442434,17,assets/images/split/image989.bin -10442451,297,assets/images/split/image990.bin -10442748,322,assets/images/split/image991.bin -10443070,401,assets/images/split/image992.bin -10443471,384,assets/images/split/image993.bin -10443855,316,assets/images/split/image994.bin -10444171,354,assets/images/split/image995.bin -10444525,294,assets/images/split/image996.bin -10444819,373,assets/images/split/image997.bin -10445192,862,assets/images/split/image998.bin -10446054,562,assets/images/split/image999.bin -10446616,1290,assets/images/split/image1000.bin -10447906,1036,assets/images/split/image1001.bin -10448942,969,assets/images/split/image1002.bin -10449911,1232,assets/images/split/image1003.bin -10451143,1261,assets/images/split/image1004.bin -10452404,615,assets/images/split/image1005.bin -10453019,826,assets/images/split/image1006.bin -10453845,240,assets/images/split/image1007.bin -10454085,1169,assets/images/split/image1008.bin -10455254,653,assets/images/split/image1009.bin -10455907,434,assets/images/split/image1010.bin -10456341,1554,assets/images/split/image1011.bin -10457895,1822,assets/images/split/image1012.bin -10459717,409,assets/images/split/image1013.bin -10460126,1709,assets/images/split/image1014.bin -10461835,499,assets/images/split/image1015.bin -10462334,905,assets/images/split/image1016.bin -10463239,871,assets/images/split/image1017.bin -10464110,767,assets/images/split/image1018.bin -10464877,889,assets/images/split/image1019.bin -10465766,1166,assets/images/split/image1020.bin -10466932,1311,assets/images/split/image1021.bin -10468243,1349,assets/images/split/image1022.bin -10469592,778,assets/images/split/image1023.bin -10470370,947,assets/images/split/image1024.bin -10471317,1142,assets/images/split/image1025.bin -10472459,554,assets/images/split/image1026.bin -10473013,150,assets/images/split/image1027.bin -10473163,817,assets/images/split/image1028.bin -10473980,1103,assets/images/split/image1029.bin -10475083,817,assets/images/split/image1030.bin -10475900,835,assets/images/split/image1031.bin -10476735,173,assets/images/split/image1032.bin -10476908,1490,assets/images/split/image1033.bin -10478398,1160,assets/images/split/image1034.bin -10479558,1143,assets/images/split/image1035.bin -10480701,1235,assets/images/split/image1036.bin -10481936,1562,assets/images/split/image1037.bin -10483498,1167,assets/images/split/image1038.bin -10484665,1275,assets/images/split/image1039.bin -10485940,1339,assets/images/split/image1040.bin -10487279,1696,assets/images/split/image1041.bin -10488975,530,assets/images/split/image1042.bin -10489505,743,assets/images/split/image1043.bin -10490248,677,assets/images/split/image1044.bin -10490925,580,assets/images/split/image1045.bin -10491505,304,assets/images/split/image1046.bin -10491809,348,assets/images/split/image1047.bin -10492157,860,assets/images/split/image1048.bin -10493017,1654,assets/images/split/image1049.bin -10494671,717,assets/images/split/image1050.bin -10495388,1902,assets/images/split/image1051.bin -10497290,1827,assets/images/split/image1052.bin -10499117,1970,assets/images/split/image1053.bin -10501087,1555,assets/images/split/image1054.bin -10502642,552,assets/images/split/image1055.bin -10503194,1490,assets/images/split/image1056.bin -10504684,519,assets/images/split/image1057.bin -10505203,1438,assets/images/split/image1058.bin -10506641,408,assets/images/split/image1059.bin -10507049,1356,assets/images/split/image1060.bin -10508405,1294,assets/images/split/image1061.bin -10509699,483,assets/images/split/image1062.bin -10510182,1316,assets/images/split/image1063.bin -10511498,982,assets/images/split/image1064.bin -10512480,658,assets/images/split/image1065.bin -10513138,365,assets/images/split/image1066.bin -10513503,965,assets/images/split/image1067.bin -10514468,1467,assets/images/split/image1068.bin -10515935,1338,assets/images/split/image1069.bin -10517273,1443,assets/images/split/image1070.bin -10518716,1818,assets/images/split/image1071.bin -10520534,1034,assets/images/split/image1072.bin -10521568,1761,assets/images/split/image1073.bin -10523329,1827,assets/images/split/image1074.bin -10525156,1150,assets/images/split/image1075.bin -10526306,640,assets/images/split/image1076.bin -10526946,899,assets/images/split/image1077.bin -10527845,740,assets/images/split/image1078.bin -10528585,320,assets/images/split/image1079.bin -10528905,230,assets/images/split/image1080.bin -10529135,1514,assets/images/split/image1081.bin -10530649,1224,assets/images/split/image1082.bin -10531873,1295,assets/images/split/image1083.bin -10533168,228,assets/images/split/image1084.bin -10533396,72,assets/images/split/image1085.bin -10533468,1452,assets/images/split/image1086.bin -10534920,539,assets/images/split/image1087.bin -10535459,863,assets/images/split/image1088.bin -10536322,518,assets/images/split/image1089.bin -10536840,363,assets/images/split/image1090.bin -10537203,1131,assets/images/split/image1091.bin -10538334,1343,assets/images/split/image1092.bin -10539677,1002,assets/images/split/image1093.bin -10540679,1003,assets/images/split/image1094.bin -10541682,1307,assets/images/split/image1095.bin -10542989,1162,assets/images/split/image1096.bin -10544151,1224,assets/images/split/image1097.bin -10545375,1110,assets/images/split/image1098.bin -10546485,902,assets/images/split/image1099.bin -10547387,1264,assets/images/split/image1100.bin -10548651,1366,assets/images/split/image1101.bin -10550017,1331,assets/images/split/image1102.bin -10551348,1002,assets/images/split/image1103.bin -10552350,1256,assets/images/split/image1104.bin -10553606,1358,assets/images/split/image1105.bin -10554964,1304,assets/images/split/image1106.bin -10556268,1183,assets/images/split/image1107.bin -10557451,1354,assets/images/split/image1108.bin -10558805,1335,assets/images/split/image1109.bin -10560140,1333,assets/images/split/image1110.bin -10561473,998,assets/images/split/image1111.bin -10562471,1200,assets/images/split/image1112.bin -10563671,1325,assets/images/split/image1113.bin -10564996,1333,assets/images/split/image1114.bin -10566329,1132,assets/images/split/image1115.bin -10567461,1242,assets/images/split/image1116.bin -10568703,1029,assets/images/split/image1117.bin -10569732,1281,assets/images/split/image1118.bin -10571013,1413,assets/images/split/image1119.bin -10572426,698,assets/images/split/image1120.bin -10573124,672,assets/images/split/image1121.bin -10573796,796,assets/images/split/image1122.bin -10574592,412,assets/images/split/image1123.bin -10575004,216,assets/images/split/image1124.bin -10575220,1832,assets/images/split/image1125.bin -10577052,1197,assets/images/split/image1126.bin -10578249,805,assets/images/split/image1127.bin -10579054,1260,assets/images/split/image1128.bin -10580314,2049,assets/images/split/image1129.bin -10582363,2019,assets/images/split/image1130.bin -10584382,1623,assets/images/split/image1131.bin -10586005,1074,assets/images/split/image1132.bin -10587079,2474,assets/images/split/image1133.bin -10589553,895,assets/images/split/image1134.bin -10590448,1246,assets/images/split/image1135.bin -10591694,1451,assets/images/split/image1136.bin -10593145,1548,assets/images/split/image1137.bin -10594693,666,assets/images/split/image1138.bin -10595359,318,assets/images/split/image1139.bin -10595677,489,assets/images/split/image1140.bin -10596166,955,assets/images/split/image1141.bin -10597121,1086,assets/images/split/image1142.bin -10598207,1061,assets/images/split/image1143.bin -10599268,688,assets/images/split/image1144.bin -10599956,213,assets/images/split/image1145.bin -10600169,335,assets/images/split/image1146.bin -10600504,297,assets/images/split/image1147.bin -10600801,848,assets/images/split/image1148.bin -10601649,828,assets/images/split/image1149.bin -10602477,852,assets/images/split/image1150.bin -10603329,401,assets/images/split/image1151.bin -10603730,1226,assets/images/split/image1152.bin -10604956,803,assets/images/split/image1153.bin -10605759,903,assets/images/split/image1154.bin -10606662,1948,assets/images/split/image1155.bin -10608610,1798,assets/images/split/image1156.bin -10610408,720,assets/images/split/image1157.bin -10611128,762,assets/images/split/image1158.bin -10611890,1176,assets/images/split/image1159.bin -10613066,1183,assets/images/split/image1160.bin -10614249,775,assets/images/split/image1161.bin -10615024,1353,assets/images/split/image1162.bin -10616377,1253,assets/images/split/image1163.bin -10617630,1006,assets/images/split/image1164.bin -10618636,1031,assets/images/split/image1165.bin -10619667,1507,assets/images/split/image1166.bin -10621174,1345,assets/images/split/image1167.bin -10622519,1331,assets/images/split/image1168.bin -10623850,1081,assets/images/split/image1169.bin -10624931,1520,assets/images/split/image1170.bin -10626451,1457,assets/images/split/image1171.bin -10627908,884,assets/images/split/image1172.bin -10628792,37,assets/images/split/image1173.bin -10628829,676,assets/images/split/image1174.bin -10629505,576,assets/images/split/image1175.bin -10630081,527,assets/images/split/image1176.bin -10630608,873,assets/images/split/image1177.bin -10631481,551,assets/images/split/image1178.bin -10632032,289,assets/images/split/image1179.bin -10632321,617,assets/images/split/image1180.bin -10632938,473,assets/images/split/image1181.bin -10633411,586,assets/images/split/image1182.bin -10633997,539,assets/images/split/image1183.bin -10634536,1142,assets/images/split/image1184.bin -10635678,1713,assets/images/split/image1185.bin -10637391,1382,assets/images/split/image1186.bin -10638773,1448,assets/images/split/image1187.bin -10640221,1343,assets/images/split/image1188.bin -10641564,94,assets/images/split/image1189.bin -10641658,746,assets/images/split/image1190.bin -10642404,958,assets/images/split/image1191.bin -10643362,341,assets/images/split/image1192.bin -10643703,198,assets/images/split/image1193.bin -10643901,834,assets/images/split/image1194.bin -10644735,982,assets/images/split/image1195.bin -10645717,809,assets/images/split/image1196.bin -10646526,1998,assets/images/split/image1197.bin -10648524,1492,assets/images/split/image1198.bin -10650016,1569,assets/images/split/image1199.bin -10651585,2035,assets/images/split/image1200.bin -10653620,1902,assets/images/split/image1201.bin -10655522,1964,assets/images/split/image1202.bin -10657486,483,assets/images/split/image1203.bin -10657969,652,assets/images/split/image1204.bin -10658621,722,assets/images/split/image1205.bin -10659343,952,assets/images/split/image1206.bin -10660295,1348,assets/images/split/image1207.bin -10661643,1226,assets/images/split/image1208.bin -10662869,1318,assets/images/split/image1209.bin -10664187,1397,assets/images/split/image1210.bin -10665584,1211,assets/images/split/image1211.bin -10666795,1397,assets/images/split/image1212.bin -10668192,1490,assets/images/split/image1213.bin -10669682,1439,assets/images/split/image1214.bin -10671121,317,assets/images/split/image1215.bin -10671438,1764,assets/images/split/image1216.bin -10673202,1661,assets/images/split/image1217.bin -10674863,745,assets/images/split/image1218.bin -10675608,883,assets/images/split/image1219.bin -10676491,354,assets/images/split/image1220.bin -10676845,273,assets/images/split/image1221.bin -10677118,195,assets/images/split/image1222.bin -10677313,542,assets/images/split/image1223.bin -10677855,1082,assets/images/split/image1224.bin -10678937,1357,assets/images/split/image1225.bin -10680294,653,assets/images/split/image1226.bin -10680947,963,assets/images/split/image1227.bin -10681910,961,assets/images/split/image1228.bin -10682871,940,assets/images/split/image1229.bin -10683811,1438,assets/images/split/image1230.bin -10685249,841,assets/images/split/image1231.bin -10686090,984,assets/images/split/image1232.bin -10687074,1107,assets/images/split/image1233.bin -10688181,1055,assets/images/split/image1234.bin -10689236,1711,assets/images/split/image1235.bin -10690947,925,assets/images/split/image1236.bin -10691872,768,assets/images/split/image1237.bin -10692640,994,assets/images/split/image1238.bin -10693634,907,assets/images/split/image1239.bin -10694541,810,assets/images/split/image1240.bin -10695351,1038,assets/images/split/image1241.bin -10696389,819,assets/images/split/image1242.bin -10697208,709,assets/images/split/image1243.bin -10697917,613,assets/images/split/image1244.bin -10698530,876,assets/images/split/image1245.bin -10699406,1342,assets/images/split/image1246.bin -10700748,1200,assets/images/split/image1247.bin -10701948,408,assets/images/split/image1248.bin -10702356,1257,assets/images/split/image1249.bin -10703613,668,assets/images/split/image1250.bin -10704281,739,assets/images/split/image1251.bin -10705020,729,assets/images/split/image1252.bin -10705749,630,assets/images/split/image1253.bin -10706379,739,assets/images/split/image1254.bin -10707118,939,assets/images/split/image1255.bin -10708057,585,assets/images/split/image1256.bin -10708642,218,assets/images/split/image1257.bin -10708860,887,assets/images/split/image1258.bin -10709747,1351,assets/images/split/image1259.bin -10711098,999,assets/images/split/image1260.bin -10712097,771,assets/images/split/image1261.bin -10712868,498,assets/images/split/image1262.bin -10713366,296,assets/images/split/image1263.bin -10713662,434,assets/images/split/image1264.bin -10714096,260,assets/images/split/image1265.bin -10714356,1188,assets/images/split/image1266.bin -10715544,830,assets/images/split/image1267.bin -10716374,1356,assets/images/split/image1268.bin -10717730,1121,assets/images/split/image1269.bin -10718851,761,assets/images/split/image1270.bin -10719612,1357,assets/images/split/image1271.bin -10720969,481,assets/images/split/image1272.bin -10721450,551,assets/images/split/image1273.bin -10722001,501,assets/images/split/image1274.bin -10722502,830,assets/images/split/image1275.bin -10723332,726,assets/images/split/image1276.bin -10724058,417,assets/images/split/image1277.bin -10724475,203,assets/images/split/image1278.bin -10724678,1264,assets/images/split/image1279.bin -10725942,403,assets/images/split/image1280.bin -10726345,880,assets/images/split/image1281.bin -10727225,942,assets/images/split/image1282.bin -10728167,1048,assets/images/split/image1283.bin -10729215,439,assets/images/split/image1284.bin -10729654,664,assets/images/split/image1285.bin -10730318,2068,assets/images/split/image1286.bin -10732386,2058,assets/images/split/image1287.bin -10734444,2068,assets/images/split/image1288.bin -10736512,2058,assets/images/split/image1289.bin -10738570,1548,assets/images/split/image1290.bin -10740118,1085,assets/images/split/image1291.bin -10741203,1537,assets/images/split/image1292.bin -10742740,1548,assets/images/split/image1293.bin -10744288,1436,assets/images/split/image1294.bin -10745724,1519,assets/images/split/image1295.bin -10747243,1518,assets/images/split/image1296.bin -10748761,1548,assets/images/split/image1297.bin -10750309,1548,assets/images/split/image1298.bin -10751857,1185,assets/images/split/image1299.bin -10753042,1262,assets/images/split/image1300.bin -10754304,1504,assets/images/split/image1301.bin -10755808,1548,assets/images/split/image1302.bin -10757356,1548,assets/images/split/image1303.bin -10758904,1548,assets/images/split/image1304.bin -10760452,2068,assets/images/split/image1305.bin -10762520,2058,assets/images/split/image1306.bin -10764578,2058,assets/images/split/image1307.bin -10766636,2058,assets/images/split/image1308.bin -10768694,1529,assets/images/split/image1309.bin -10770223,1548,assets/images/split/image1310.bin -10771771,2022,assets/images/split/image1311.bin -10773793,2028,assets/images/split/image1312.bin -10775821,2043,assets/images/split/image1313.bin -10777864,2058,assets/images/split/image1314.bin -10779922,2060,assets/images/split/image1315.bin -10781982,2058,assets/images/split/image1316.bin -10784040,2058,assets/images/split/image1317.bin -10786098,2053,assets/images/split/image1318.bin -10788151,1513,assets/images/split/image1319.bin -10789664,1493,assets/images/split/image1320.bin -10791157,1513,assets/images/split/image1321.bin -10792670,1106,assets/images/split/image1322.bin -10793776,1548,assets/images/split/image1323.bin -10795324,1548,assets/images/split/image1324.bin -10796872,2068,assets/images/split/image1325.bin -10798940,2068,assets/images/split/image1326.bin -10801008,2058,assets/images/split/image1327.bin -10803066,2056,assets/images/split/image1328.bin -10805122,2058,assets/images/split/image1329.bin -10807180,2058,assets/images/split/image1330.bin -10809238,2058,assets/images/split/image1331.bin -10811296,2058,assets/images/split/image1332.bin -10813354,1178,assets/images/split/image1333.bin -10814532,1515,assets/images/split/image1334.bin -10816047,1335,assets/images/split/image1335.bin -10817382,1545,assets/images/split/image1336.bin -10818927,1517,assets/images/split/image1337.bin -10820444,1286,assets/images/split/image1338.bin -10821730,899,assets/images/split/image1339.bin -10822629,1269,assets/images/split/image1340.bin -10823898,2068,assets/images/split/image1341.bin -10825966,2068,assets/images/split/image1342.bin -10828034,2058,assets/images/split/image1343.bin -10830092,2058,assets/images/split/image1344.bin -10832150,2058,assets/images/split/image1345.bin -10834208,2058,assets/images/split/image1346.bin -10836266,2058,assets/images/split/image1347.bin -10838324,2058,assets/images/split/image1348.bin -10840382,2068,assets/images/split/image1349.bin -10842450,2068,assets/images/split/image1350.bin -10844518,2058,assets/images/split/image1351.bin -10846576,2058,assets/images/split/image1352.bin -10848634,2058,assets/images/split/image1353.bin -10850692,2058,assets/images/split/image1354.bin -10852750,2058,assets/images/split/image1355.bin -10854808,2058,assets/images/split/image1356.bin -10856866,789,assets/images/split/image1357.bin -10857655,643,assets/images/split/image1358.bin -10858298,646,assets/images/split/image1359.bin -10858944,1158,assets/images/split/image1360.bin -10860102,1526,assets/images/split/image1361.bin -10861628,1548,assets/images/split/image1362.bin -10863176,1545,assets/images/split/image1363.bin -10864721,1223,assets/images/split/image1364.bin -10865944,830,assets/images/split/image1365.bin -10866774,1063,assets/images/split/image1366.bin -10867837,474,assets/images/split/image1367.bin -10868311,1555,assets/images/split/image1368.bin -10869866,1218,assets/images/split/image1369.bin -10871084,1251,assets/images/split/image1370.bin -10872335,1107,assets/images/split/image1371.bin -10873442,1147,assets/images/split/image1372.bin -10874589,636,assets/images/split/image1373.bin -10875225,807,assets/images/split/image1374.bin -10876032,737,assets/images/split/image1375.bin -10876769,823,assets/images/split/image1376.bin -10877592,590,assets/images/split/image1377.bin -10878182,496,assets/images/split/image1378.bin -10878678,819,assets/images/split/image1379.bin -10879497,210,assets/images/split/image1380.bin -10879707,1211,assets/images/split/image1381.bin -10880918,40,assets/images/split/image1382.bin -10880958,38,assets/images/split/image1383.bin -10880996,826,assets/images/split/image1384.bin -10881822,633,assets/images/split/image1385.bin -10882455,1538,assets/images/split/image1386.bin -10883993,787,assets/images/split/image1387.bin -10884780,787,assets/images/split/image1388.bin -10885567,1349,assets/images/split/image1389.bin -10886916,1023,assets/images/split/image1390.bin -10887939,1122,assets/images/split/image1391.bin -10889061,1021,assets/images/split/image1392.bin -10890082,399,assets/images/split/image1393.bin -10890481,590,assets/images/split/image1394.bin -10891071,940,assets/images/split/image1395.bin -10892011,1423,assets/images/split/image1396.bin -10893434,1374,assets/images/split/image1397.bin -10894808,1047,assets/images/split/image1398.bin -10895855,1222,assets/images/split/image1399.bin -10897077,1413,assets/images/split/image1400.bin -10898490,1126,assets/images/split/image1401.bin -10899616,2383,assets/images/split/image1402.bin -10901999,2288,assets/images/split/image1403.bin -10904287,2305,assets/images/split/image1404.bin -10906592,2349,assets/images/split/image1405.bin -10908941,2368,assets/images/split/image1406.bin -10911309,2313,assets/images/split/image1407.bin -10913622,2368,assets/images/split/image1408.bin -10915990,2289,assets/images/split/image1409.bin -10918279,452,assets/images/split/image1410.bin -10918731,371,assets/images/split/image1411.bin -10919102,341,assets/images/split/image1412.bin -10919443,785,assets/images/split/image1413.bin -10920228,658,assets/images/split/image1414.bin -10920886,555,assets/images/split/image1415.bin -10921441,509,assets/images/split/image1416.bin -10921950,461,assets/images/split/image1417.bin -10922411,515,assets/images/split/image1418.bin -10922926,642,assets/images/split/image1419.bin -10923568,590,assets/images/split/image1420.bin -10924158,479,assets/images/split/image1421.bin -10924637,532,assets/images/split/image1422.bin -10925169,1047,assets/images/split/image1423.bin -10926216,500,assets/images/split/image1424.bin -10926716,1505,assets/images/split/image1425.bin -10928221,93,assets/images/split/image1426.bin -10928314,1366,assets/images/split/image1427.bin -10929680,353,assets/images/split/image1428.bin -10930033,345,assets/images/split/image1429.bin -10930378,1215,assets/images/split/image1430.bin -10931593,643,assets/images/split/image1431.bin -10932236,814,assets/images/split/image1432.bin -10933050,308,assets/images/split/image1433.bin -10933358,590,assets/images/split/image1434.bin -10933948,278,assets/images/split/image1435.bin -10934226,240,assets/images/split/image1436.bin -10934466,274,assets/images/split/image1437.bin -10934740,979,assets/images/split/image1438.bin -10935719,979,assets/images/split/image1439.bin -10936698,999,assets/images/split/image1440.bin -10937697,1098,assets/images/split/image1441.bin -10938795,283,assets/images/split/image1442.bin -10939078,300,assets/images/split/image1443.bin -10939378,373,assets/images/split/image1444.bin -10939751,638,assets/images/split/image1445.bin -10940389,456,assets/images/split/image1446.bin -10940845,737,assets/images/split/image1447.bin -10941582,511,assets/images/split/image1448.bin -10942093,760,assets/images/split/image1449.bin -10942853,667,assets/images/split/image1450.bin -10943520,632,assets/images/split/image1451.bin -10944152,671,assets/images/split/image1452.bin -10944823,593,assets/images/split/image1453.bin -10945416,654,assets/images/split/image1454.bin -10946070,622,assets/images/split/image1455.bin -10946692,722,assets/images/split/image1456.bin -10947414,913,assets/images/split/image1457.bin -10948327,1074,assets/images/split/image1458.bin -10949401,315,assets/images/split/image1459.bin -10949716,634,assets/images/split/image1460.bin -10950350,623,assets/images/split/image1461.bin -10950973,1285,assets/images/split/image1462.bin -10952258,1246,assets/images/split/image1463.bin -10953504,1202,assets/images/split/image1464.bin -10954706,827,assets/images/split/image1465.bin -10955533,727,assets/images/split/image1466.bin -10956260,438,assets/images/split/image1467.bin -10956698,498,assets/images/split/image1468.bin -10957196,1699,assets/images/split/image1469.bin -10958895,1699,assets/images/split/image1470.bin -10960594,639,assets/images/split/image1471.bin -10961233,603,assets/images/split/image1472.bin -10961836,420,assets/images/split/image1473.bin -10962256,1410,assets/images/split/image1474.bin -10963666,541,assets/images/split/image1475.bin -10964207,1309,assets/images/split/image1476.bin -10965516,1272,assets/images/split/image1477.bin -10966788,1159,assets/images/split/image1478.bin -10967947,872,assets/images/split/image1479.bin -10968819,892,assets/images/split/image1480.bin -10969711,1930,assets/images/split/image1481.bin -10971641,73,assets/images/split/image1482.bin -10971714,75,assets/images/split/image1483.bin -10971789,51,assets/images/split/image1484.bin -10971840,958,assets/images/split/image1485.bin -10972798,190,assets/images/split/image1486.bin -10972988,424,assets/images/split/image1487.bin -10973412,1742,assets/images/split/image1488.bin -10975154,1652,assets/images/split/image1489.bin -10976806,1798,assets/images/split/image1490.bin -10978604,1732,assets/images/split/image1491.bin -10980336,1758,assets/images/split/image1492.bin -10982094,1792,assets/images/split/image1493.bin -10983886,1724,assets/images/split/image1494.bin -10985610,1765,assets/images/split/image1495.bin -10987375,1643,assets/images/split/image1496.bin -10989018,1851,assets/images/split/image1497.bin -10990869,998,assets/images/split/image1498.bin -10991867,1028,assets/images/split/image1499.bin -10992895,925,assets/images/split/image1500.bin -10993820,746,assets/images/split/image1501.bin -10994566,1396,assets/images/split/image1502.bin -10995962,270,assets/images/split/image1503.bin -10996232,528,assets/images/split/image1504.bin -10996760,351,assets/images/split/image1505.bin -10997111,785,assets/images/split/image1506.bin -10997896,943,assets/images/split/image1507.bin -10998839,1271,assets/images/split/image1508.bin -11000110,650,assets/images/split/image1509.bin -11000760,564,assets/images/split/image1510.bin -11001324,658,assets/images/split/image1511.bin -11001982,645,assets/images/split/image1512.bin -11002627,1353,assets/images/split/image1513.bin -11003980,502,assets/images/split/image1514.bin -11004482,12,assets/images/split/image1515.bin -11004494,360,assets/images/split/image1516.bin -11004854,400,assets/images/split/image1517.bin -11005254,592,assets/images/split/image1518.bin -11005846,1402,assets/images/split/image1519.bin -11007248,1068,assets/images/split/image1520.bin -11008316,1279,assets/images/split/image1521.bin -11009595,803,assets/images/split/image1522.bin -11010398,479,assets/images/split/image1523.bin -11010877,1283,assets/images/split/image1524.bin -11012160,421,assets/images/split/image1525.bin -11012581,748,assets/images/split/image1526.bin -11013329,1157,assets/images/split/image1527.bin -11014486,1832,assets/images/split/image1528.bin -11016318,547,assets/images/split/image1529.bin -11016865,971,assets/images/split/image1530.bin -11017836,346,assets/images/split/image1531.bin -11018182,231,assets/images/split/image1532.bin -11018413,374,assets/images/split/image1533.bin -11018787,436,assets/images/split/image1534.bin -11019223,707,assets/images/split/image1535.bin -11019930,680,assets/images/split/image1536.bin -11020610,570,assets/images/split/image1537.bin -11021180,582,assets/images/split/image1538.bin -11021762,576,assets/images/split/image1539.bin -11022338,636,assets/images/split/image1540.bin -11022974,746,assets/images/split/image1541.bin -11023720,1201,assets/images/split/image1542.bin -11024921,1140,assets/images/split/image1543.bin -11026061,1157,assets/images/split/image1544.bin -11027218,2006,assets/images/split/image1545.bin -11029224,2177,assets/images/split/image1546.bin -11031401,1066,assets/images/split/image1547.bin -11032467,1468,assets/images/split/image1548.bin -11033935,1836,assets/images/split/image1549.bin -11035771,2193,assets/images/split/image1550.bin -11037964,1884,assets/images/split/image1551.bin -11039848,2268,assets/images/split/image1552.bin -11042116,2378,assets/images/split/image1553.bin -11044494,2340,assets/images/split/image1554.bin -11046834,2416,assets/images/split/image1555.bin -11049250,590,assets/images/split/image1556.bin -11049840,2468,assets/images/split/image1557.bin -11052308,823,assets/images/split/image1558.bin -11053131,1544,assets/images/split/image1559.bin -11054675,1548,assets/images/split/image1560.bin -11056223,2535,assets/images/split/image1561.bin -11058758,2524,assets/images/split/image1562.bin -11061282,2498,assets/images/split/image1563.bin -11063780,504,assets/images/split/image1564.bin -11064284,593,assets/images/split/image1565.bin -11064877,562,assets/images/split/image1566.bin -11065439,507,assets/images/split/image1567.bin -11065946,1472,assets/images/split/image1568.bin -11067418,1031,assets/images/split/image1569.bin -11068449,2537,assets/images/split/image1570.bin -11070986,2214,assets/images/split/image1571.bin -11073200,2408,assets/images/split/image1572.bin -11075608,1477,assets/images/split/image1573.bin -11077085,1050,assets/images/split/image1574.bin -11078135,902,assets/images/split/image1575.bin -11079037,990,assets/images/split/image1576.bin -11080027,626,assets/images/split/image1577.bin -11080653,917,assets/images/split/image1578.bin -11081570,848,assets/images/split/image1579.bin -11082418,748,assets/images/split/image1580.bin -11083166,804,assets/images/split/image1581.bin -11083970,710,assets/images/split/image1582.bin -11084680,1822,assets/images/split/image1583.bin -11086502,1807,assets/images/split/image1584.bin -11088309,857,assets/images/split/image1585.bin -11089166,969,assets/images/split/image1586.bin -11090135,928,assets/images/split/image1587.bin -11091063,875,assets/images/split/image1588.bin -11091938,183,assets/images/split/image1589.bin -11092121,1275,assets/images/split/image1590.bin -11093396,1343,assets/images/split/image1591.bin -11094739,1233,assets/images/split/image1592.bin -11095972,1805,assets/images/split/image1593.bin -11097777,732,assets/images/split/image1594.bin -11098509,934,assets/images/split/image1595.bin -11099443,411,assets/images/split/image1596.bin -11099854,972,assets/images/split/image1597.bin -11100826,40,assets/images/split/image1598.bin -11100866,53,assets/images/split/image1599.bin -11100919,567,assets/images/split/image1600.bin -11101486,933,assets/images/split/image1601.bin -11102419,910,assets/images/split/image1602.bin -11103329,677,assets/images/split/image1603.bin -11104006,655,assets/images/split/image1604.bin -11104661,12,assets/images/split/image1605.bin -11104673,475,assets/images/split/image1606.bin -11105148,1883,assets/images/split/image1607.bin -11107031,632,assets/images/split/image1608.bin -11107663,12,assets/images/split/image1609.bin -11107675,983,assets/images/split/image1610.bin -11108658,341,assets/images/split/image1611.bin -11108999,1019,assets/images/split/image1612.bin -11110018,941,assets/images/split/image1613.bin -11110959,1436,assets/images/split/image1614.bin -11112395,305,assets/images/split/image1615.bin -11112700,953,assets/images/split/image1616.bin -11113653,1268,assets/images/split/image1617.bin -11114921,335,assets/images/split/image1618.bin -11115256,949,assets/images/split/image1619.bin -11116205,1174,assets/images/split/image1620.bin -11117379,366,assets/images/split/image1621.bin -11117745,971,assets/images/split/image1622.bin -11118716,1255,assets/images/split/image1623.bin -11119971,434,assets/images/split/image1624.bin -11120405,2144,assets/images/split/image1625.bin -11122549,2170,assets/images/split/image1626.bin -11124719,1788,assets/images/split/image1627.bin -11126507,335,assets/images/split/image1628.bin -11126842,762,assets/images/split/image1629.bin -11127604,767,assets/images/split/image1630.bin -11128371,308,assets/images/split/image1631.bin -11128679,724,assets/images/split/image1632.bin -11129403,1278,assets/images/split/image1633.bin -11130681,1332,assets/images/split/image1634.bin -11132013,899,assets/images/split/image1635.bin -11132912,874,assets/images/split/image1636.bin -11133786,753,assets/images/split/image1637.bin -11134539,876,assets/images/split/image1638.bin -11135415,314,assets/images/split/image1639.bin -11135729,55,assets/images/split/image1640.bin -11135784,921,assets/images/split/image1641.bin -11136705,745,assets/images/split/image1642.bin -11137450,1055,assets/images/split/image1643.bin -11138505,812,assets/images/split/image1644.bin -11139317,1470,assets/images/split/image1645.bin -11140787,717,assets/images/split/image1646.bin -11141504,781,assets/images/split/image1647.bin -11142285,1486,assets/images/split/image1648.bin -11143771,1832,assets/images/split/image1649.bin -11145603,1148,assets/images/split/image1650.bin -11146751,1522,assets/images/split/image1651.bin -11148273,64,assets/images/split/image1652.bin -11148337,1724,assets/images/split/image1653.bin -11150061,2474,assets/images/split/image1654.bin -11152535,2042,assets/images/split/image1655.bin -11154577,1022,assets/images/split/image1656.bin -11155599,1230,assets/images/split/image1657.bin -11156829,700,assets/images/split/image1658.bin -11157529,1488,assets/images/split/image1659.bin -11159017,1389,assets/images/split/image1660.bin -11160406,1937,assets/images/split/image1661.bin -11162343,2385,assets/images/split/image1662.bin -11164728,1933,assets/images/split/image1663.bin -11166661,590,assets/images/split/image1664.bin -11167251,781,assets/images/split/image1665.bin -11168032,2358,assets/images/split/image1666.bin -11170390,1233,assets/images/split/image1667.bin -11171623,1358,assets/images/split/image1668.bin -11172981,374,assets/images/split/image1669.bin -11173355,1441,assets/images/split/image1670.bin -11174796,1414,assets/images/split/image1671.bin -11176210,12,assets/images/split/image1672.bin -11176222,1122,assets/images/split/image1673.bin -11177344,1527,assets/images/split/image1674.bin -11178871,1844,assets/images/split/image1675.bin -11180715,1850,assets/images/split/image1676.bin -11182565,1735,assets/images/split/image1677.bin -11184300,1945,assets/images/split/image1678.bin -11186245,1125,assets/images/split/image1679.bin -11187370,1630,assets/images/split/image1680.bin -11189000,1179,assets/images/split/image1681.bin -11190179,1664,assets/images/split/image1682.bin -11191843,2444,assets/images/split/image1683.bin -11194287,2336,assets/images/split/image1684.bin -11196623,2333,assets/images/split/image1685.bin -11198956,2494,assets/images/split/image1686.bin -11201450,1647,assets/images/split/image1687.bin -11203097,1553,assets/images/split/image1688.bin -11204650,1459,assets/images/split/image1689.bin -11206109,327,assets/images/split/image1690.bin -11206436,1690,assets/images/split/image1691.bin -11208126,1333,assets/images/split/image1692.bin -11209459,1034,assets/images/split/image1693.bin -11210493,796,assets/images/split/image1694.bin -11211289,720,assets/images/split/image1695.bin -11212009,703,assets/images/split/image1696.bin -11212712,2456,assets/images/split/image1697.bin -11215168,449,assets/images/split/image1698.bin -11215617,692,assets/images/split/image1699.bin -11216309,796,assets/images/split/image1700.bin -11217105,904,assets/images/split/image1701.bin -11218009,1006,assets/images/split/image1702.bin -11219015,2267,assets/images/split/image1703.bin -11221282,2137,assets/images/split/image1704.bin -11223419,874,assets/images/split/image1705.bin -11224293,2391,assets/images/split/image1706.bin -11226684,2463,assets/images/split/image1707.bin -11229147,2512,assets/images/split/image1708.bin -11231659,1686,assets/images/split/image1709.bin -11233345,446,assets/images/split/image1710.bin -11233791,673,assets/images/split/image1711.bin -11234464,1368,assets/images/split/image1712.bin -11235832,443,assets/images/split/image1713.bin -11236275,695,assets/images/split/image1714.bin -11236970,643,assets/images/split/image1715.bin -11237613,592,assets/images/split/image1716.bin -11238205,705,assets/images/split/image1717.bin -11238910,1249,assets/images/split/image1718.bin -11240159,876,assets/images/split/image1719.bin -11241035,775,assets/images/split/image1720.bin -11241810,746,assets/images/split/image1721.bin -11242556,705,assets/images/split/image1722.bin -11243261,2371,assets/images/split/image1723.bin -11245632,2243,assets/images/split/image1724.bin -11247875,2311,assets/images/split/image1725.bin -11250186,12,assets/images/split/image1726.bin -11250198,2514,assets/images/split/image1727.bin -11252712,2483,assets/images/split/image1728.bin -11255195,2448,assets/images/split/image1729.bin -11257643,1022,assets/images/split/image1730.bin -11258665,1034,assets/images/split/image1731.bin -11259699,1095,assets/images/split/image1732.bin -11260794,1048,assets/images/split/image1733.bin -11261842,2099,assets/images/split/image1734.bin -11263941,2025,assets/images/split/image1735.bin -11265966,833,assets/images/split/image1736.bin -11266799,369,assets/images/split/image1737.bin -11267168,1543,assets/images/split/image1738.bin -11268711,1421,assets/images/split/image1739.bin -11270132,951,assets/images/split/image1740.bin -11271083,1024,assets/images/split/image1741.bin -11272107,1114,assets/images/split/image1742.bin -11273221,1810,assets/images/split/image1743.bin -11275031,550,assets/images/split/image1744.bin -11275581,1045,assets/images/split/image1745.bin -11276626,1333,assets/images/split/image1746.bin -11277959,1908,assets/images/split/image1747.bin -11279867,1960,assets/images/split/image1748.bin -11281827,1901,assets/images/split/image1749.bin -11283728,636,assets/images/split/image1750.bin -11284364,681,assets/images/split/image1751.bin -11285045,267,assets/images/split/image1752.bin -11285312,834,assets/images/split/image1753.bin -11286146,485,assets/images/split/image1754.bin -11286631,507,assets/images/split/image1755.bin -11287138,1480,assets/images/split/image1756.bin -11288618,923,assets/images/split/image1757.bin -11289541,1046,assets/images/split/image1758.bin -11290587,1106,assets/images/split/image1759.bin -11291693,1064,assets/images/split/image1760.bin -11292757,667,assets/images/split/image1761.bin -11293424,466,assets/images/split/image1762.bin -11293890,1626,assets/images/split/image1763.bin -11295516,2404,assets/images/split/image1764.bin -11297920,2236,assets/images/split/image1765.bin -11300156,2280,assets/images/split/image1766.bin -11302436,2538,assets/images/split/image1767.bin -11304974,2475,assets/images/split/image1768.bin -11307449,2485,assets/images/split/image1769.bin -11309934,908,assets/images/split/image1770.bin -11310842,1369,assets/images/split/image1771.bin -11312211,1639,assets/images/split/image1772.bin -11313850,1402,assets/images/split/image1773.bin -11315252,1152,assets/images/split/image1774.bin -11316404,416,assets/images/split/image1775.bin -11316820,246,assets/images/split/image1776.bin -11317066,791,assets/images/split/image1777.bin -11317857,894,assets/images/split/image1778.bin -11318751,1562,assets/images/split/image1779.bin -11320313,1205,assets/images/split/image1780.bin -11321518,313,assets/images/split/image1781.bin -11321831,322,assets/images/split/image1782.bin -11322153,401,assets/images/split/image1783.bin -11322554,769,assets/images/split/image1784.bin -11323323,450,assets/images/split/image1785.bin -11323773,871,assets/images/split/image1786.bin -11324644,989,assets/images/split/image1787.bin -11325633,902,assets/images/split/image1788.bin -11326535,830,assets/images/split/image1789.bin -11327365,778,assets/images/split/image1790.bin -11328143,744,assets/images/split/image1791.bin -11328887,832,assets/images/split/image1792.bin -11329719,872,assets/images/split/image1793.bin -11330591,981,assets/images/split/image1794.bin -11331572,987,assets/images/split/image1795.bin -11332559,1239,assets/images/split/image1796.bin -11333798,1176,assets/images/split/image1797.bin -11334974,1181,assets/images/split/image1798.bin -11336155,746,assets/images/split/image1799.bin -11336901,884,assets/images/split/image1800.bin -11337785,1676,assets/images/split/image1801.bin -11339461,1838,assets/images/split/image1802.bin -11341299,2274,assets/images/split/image1803.bin -11343573,2080,assets/images/split/image1804.bin -11345653,2209,assets/images/split/image1805.bin -11347862,2106,assets/images/split/image1806.bin -11349968,502,assets/images/split/image1807.bin -11350470,468,assets/images/split/image1808.bin -11350938,756,assets/images/split/image1809.bin -11351694,318,assets/images/split/image1810.bin -11352012,371,assets/images/split/image1811.bin -11352383,1656,assets/images/split/image1812.bin -11354039,665,assets/images/split/image1813.bin -11354704,1443,assets/images/split/image1814.bin -11356147,2572,assets/images/split/image1815.bin -11358719,2531,assets/images/split/image1816.bin -11361250,2537,assets/images/split/image1817.bin -11363787,2368,assets/images/split/image1818.bin -11366155,2482,assets/images/split/image1819.bin -11368637,2406,assets/images/split/image1820.bin -11371043,2529,assets/images/split/image1821.bin -11373572,2345,assets/images/split/image1822.bin -11375917,2376,assets/images/split/image1823.bin -11378293,2536,assets/images/split/image1824.bin -11380829,2509,assets/images/split/image1825.bin -11383338,2468,assets/images/split/image1826.bin -11385806,2401,assets/images/split/image1827.bin -11388207,2405,assets/images/split/image1828.bin -11390612,2313,assets/images/split/image1829.bin -11392925,915,assets/images/split/image1830.bin -11393840,343,assets/images/split/image1831.bin -11394183,651,assets/images/split/image1832.bin -11394834,786,assets/images/split/image1833.bin -11395620,2521,assets/images/split/image1834.bin -11398141,2309,assets/images/split/image1835.bin -11400450,2344,assets/images/split/image1836.bin -11402794,631,assets/images/split/image1837.bin -11403425,636,assets/images/split/image1838.bin -11404061,278,assets/images/split/image1839.bin -11404339,455,assets/images/split/image1840.bin -11404794,260,assets/images/split/image1841.bin -11405054,648,assets/images/split/image1842.bin -11405702,1565,assets/images/split/image1843.bin -11407267,389,assets/images/split/image1844.bin -11407656,2137,assets/images/split/image1845.bin -11409793,2207,assets/images/split/image1846.bin -11412000,2024,assets/images/split/image1847.bin -11414024,2470,assets/images/split/image1848.bin -11416494,2221,assets/images/split/image1849.bin -11418715,2239,assets/images/split/image1850.bin -11420954,2345,assets/images/split/image1851.bin -11423299,2393,assets/images/split/image1852.bin -11425692,2363,assets/images/split/image1853.bin -11428055,2288,assets/images/split/image1854.bin -11430343,2232,assets/images/split/image1855.bin -11432575,2355,assets/images/split/image1856.bin -11434930,1243,assets/images/split/image1857.bin -11436173,2369,assets/images/split/image1858.bin -11438542,1731,assets/images/split/image1859.bin -11440273,2116,assets/images/split/image1860.bin -11442389,810,assets/images/split/image1861.bin -11443199,1546,assets/images/split/image1862.bin -11444745,934,assets/images/split/image1863.bin -11445679,272,assets/images/split/image1864.bin -11445951,694,assets/images/split/image1865.bin -11446645,1829,assets/images/split/image1866.bin -11448474,1278,assets/images/split/image1867.bin -11449752,12,assets/images/split/image1868.bin -11449764,2255,assets/images/split/image1869.bin -11452019,2378,assets/images/split/image1870.bin -11454397,2472,assets/images/split/image1871.bin -11456869,1932,assets/images/split/image1872.bin -11458801,2526,assets/images/split/image1873.bin -11461327,276,assets/images/split/image1874.bin -11461603,1407,assets/images/split/image1875.bin -11463010,450,assets/images/split/image1876.bin -11463460,2004,assets/images/split/image1877.bin -11465464,2021,assets/images/split/image1878.bin -11467485,2531,assets/images/split/image1879.bin -11470016,1981,assets/images/split/image1880.bin -11471997,1192,assets/images/split/image1881.bin -11473189,186,assets/images/split/image1882.bin -11473375,1489,assets/images/split/image1883.bin -11474864,2412,assets/images/split/image1884.bin -11477276,2170,assets/images/split/image1885.bin -11479446,2048,assets/images/split/image1886.bin -11481494,1136,assets/images/split/image1887.bin -11482630,529,assets/images/split/image1888.bin -11483159,522,assets/images/split/image1889.bin -11483681,810,assets/images/split/image1890.bin -11484491,999,assets/images/split/image1891.bin -11485490,611,assets/images/split/image1892.bin -11486101,2572,assets/images/split/image1893.bin -11488673,1548,assets/images/split/image1894.bin -11490221,1520,assets/images/split/image1895.bin -11491741,1642,assets/images/split/image1896.bin -11493383,802,assets/images/split/image1897.bin -11494185,895,assets/images/split/image1898.bin -11495080,895,assets/images/split/image1899.bin -11495975,788,assets/images/split/image1900.bin -11496763,819,assets/images/split/image1901.bin -11497582,412,assets/images/split/image1902.bin -11497994,562,assets/images/split/image1903.bin -11498556,337,assets/images/split/image1904.bin -11498893,374,assets/images/split/image1905.bin -11499267,1961,assets/images/split/image1906.bin -11501228,1946,assets/images/split/image1907.bin -11503174,2354,assets/images/split/image1908.bin -11505528,2253,assets/images/split/image1909.bin -11507781,2254,assets/images/split/image1910.bin -11510035,260,assets/images/split/image1911.bin -11510295,755,assets/images/split/image1912.bin -11511050,1460,assets/images/split/image1913.bin -11512510,830,assets/images/split/image1914.bin -11513340,1294,assets/images/split/image1915.bin -11514634,1530,assets/images/split/image1916.bin -11516164,1124,assets/images/split/image1917.bin -11517288,12,assets/images/split/image1918.bin -11517300,1399,assets/images/split/image1919.bin -11518699,1411,assets/images/split/image1920.bin -11520110,2212,assets/images/split/image1921.bin -11522322,850,assets/images/split/image1922.bin -11523172,727,assets/images/split/image1923.bin -11523899,859,assets/images/split/image1924.bin -11524758,963,assets/images/split/image1925.bin -11525721,1143,assets/images/split/image1926.bin -11526864,1151,assets/images/split/image1927.bin -11528015,657,assets/images/split/image1928.bin -11528672,2293,assets/images/split/image1929.bin -11530965,2312,assets/images/split/image1930.bin -11533277,2515,assets/images/split/image1931.bin -11535792,2249,assets/images/split/image1932.bin -11538041,672,assets/images/split/image1933.bin -11538713,2104,assets/images/split/image1934.bin -11540817,2037,assets/images/split/image1935.bin -11542854,789,assets/images/split/image1936.bin -11543643,1302,assets/images/split/image1937.bin -11544945,1131,assets/images/split/image1938.bin -11546076,773,assets/images/split/image1939.bin -11546849,1246,assets/images/split/image1940.bin -11548095,1131,assets/images/split/image1941.bin -11549226,800,assets/images/split/image1942.bin -11550026,1685,assets/images/split/image1943.bin -11551711,2414,assets/images/split/image1944.bin -11554125,2461,assets/images/split/image1945.bin -11556586,2454,assets/images/split/image1946.bin -11559040,910,assets/images/split/image1947.bin -11559950,584,assets/images/split/image1948.bin -11560534,716,assets/images/split/image1949.bin -11561250,121,assets/images/split/image1950.bin -11561371,1564,assets/images/split/image1951.bin -11562935,1166,assets/images/split/image1952.bin -11564101,1370,assets/images/split/image1953.bin -11565471,1315,assets/images/split/image1954.bin -11566786,1618,assets/images/split/image1955.bin -11568404,1347,assets/images/split/image1956.bin -11569751,1239,assets/images/split/image1957.bin -11570990,1379,assets/images/split/image1958.bin -11572369,966,assets/images/split/image1959.bin -11573335,1094,assets/images/split/image1960.bin -11574429,618,assets/images/split/image1961.bin -11575047,1377,assets/images/split/image1962.bin -11576424,601,assets/images/split/image1963.bin -11577025,1879,assets/images/split/image1964.bin -11578904,1810,assets/images/split/image1965.bin -11580714,1067,assets/images/split/image1966.bin -11581781,370,assets/images/split/image1967.bin -11582151,860,assets/images/split/image1968.bin -11583011,1017,assets/images/split/image1969.bin -11584028,1428,assets/images/split/image1970.bin -11585456,2442,assets/images/split/image1971.bin -11587898,2315,assets/images/split/image1972.bin -11590213,2501,assets/images/split/image1973.bin -11592714,2275,assets/images/split/image1974.bin -11594989,2377,assets/images/split/image1975.bin -11597366,2319,assets/images/split/image1976.bin -11599685,2572,assets/images/split/image1977.bin -11602257,2400,assets/images/split/image1978.bin -11604657,2396,assets/images/split/image1979.bin -11607053,435,assets/images/split/image1980.bin -11607488,1061,assets/images/split/image1981.bin -11608549,1900,assets/images/split/image1982.bin -11610449,1909,assets/images/split/image1983.bin -11612358,431,assets/images/split/image1984.bin -11612789,374,assets/images/split/image1985.bin -11613163,704,assets/images/split/image1986.bin -11613867,916,assets/images/split/image1987.bin -11614783,774,assets/images/split/image1988.bin -11615557,1373,assets/images/split/image1989.bin -11616930,1342,assets/images/split/image1990.bin -11618272,377,assets/images/split/image1991.bin -11618649,381,assets/images/split/image1992.bin -11619030,439,assets/images/split/image1993.bin -11619469,460,assets/images/split/image1994.bin -11619929,385,assets/images/split/image1995.bin -11620314,240,assets/images/split/image1996.bin -11620554,544,assets/images/split/image1997.bin -11621098,2456,assets/images/split/image1998.bin -11623554,2487,assets/images/split/image1999.bin -11626041,2413,assets/images/split/image2000.bin -11628454,2236,assets/images/split/image2001.bin -11630690,2234,assets/images/split/image2002.bin -11632924,2180,assets/images/split/image2003.bin -11635104,2340,assets/images/split/image2004.bin -11637444,2066,assets/images/split/image2005.bin -11639510,630,assets/images/split/image2006.bin -11640140,412,assets/images/split/image2007.bin -11640552,254,assets/images/split/image2008.bin -11640806,689,assets/images/split/image2009.bin -11641495,617,assets/images/split/image2010.bin -11642112,1896,assets/images/split/image2011.bin -11644008,185,assets/images/split/image2012.bin -11644193,228,assets/images/split/image2013.bin -11644421,321,assets/images/split/image2014.bin -11644742,783,assets/images/split/image2015.bin -11645525,320,assets/images/split/image2016.bin -11645845,920,assets/images/split/image2017.bin -11646765,387,assets/images/split/image2018.bin -11647152,303,assets/images/split/image2019.bin -11647455,344,assets/images/split/image2020.bin -11647799,430,assets/images/split/image2021.bin -11648229,469,assets/images/split/image2022.bin -11648698,196,assets/images/split/image2023.bin -11648894,920,assets/images/split/image2024.bin -11649814,703,assets/images/split/image2025.bin -11650517,1889,assets/images/split/image2026.bin -11652406,286,assets/images/split/image2027.bin -11652692,955,assets/images/split/image2028.bin -11653647,1620,assets/images/split/image2029.bin -11655267,1463,assets/images/split/image2030.bin -11656730,1647,assets/images/split/image2031.bin -11658377,1731,assets/images/split/image2032.bin -11660108,1024,assets/images/split/image2033.bin -11661132,776,assets/images/split/image2034.bin -11661908,898,assets/images/split/image2035.bin -11662806,1444,assets/images/split/image2036.bin -11664250,689,assets/images/split/image2037.bin -11664939,1089,assets/images/split/image2038.bin -11666028,500,assets/images/split/image2039.bin -11666528,423,assets/images/split/image2040.bin -11666951,2304,assets/images/split/image2041.bin -11669255,2036,assets/images/split/image2042.bin -11671291,293,assets/images/split/image2043.bin -11671584,410,assets/images/split/image2044.bin -11671994,1370,assets/images/split/image2045.bin -11673364,560,assets/images/split/image2046.bin -11673924,782,assets/images/split/image2047.bin -11674706,2372,assets/images/split/image2048.bin -11677078,641,assets/images/split/image2049.bin -11677719,597,assets/images/split/image2050.bin -11678316,1105,assets/images/split/image2051.bin -11679421,958,assets/images/split/image2052.bin -11680379,443,assets/images/split/image2053.bin -11680822,1738,assets/images/split/image2054.bin -11682560,1963,assets/images/split/image2055.bin -11684523,967,assets/images/split/image2056.bin -11685490,2418,assets/images/split/image2057.bin -11687908,12,assets/images/split/image2058.bin -11687920,406,assets/images/split/image2059.bin -11688326,635,assets/images/split/image2060.bin -11688961,426,assets/images/split/image2061.bin -11689387,2433,assets/images/split/image2062.bin -11691820,2411,assets/images/split/image2063.bin -11694231,2307,assets/images/split/image2064.bin -11696538,581,assets/images/split/image2065.bin -11697119,303,assets/images/split/image2066.bin -11697422,1163,assets/images/split/image2067.bin -11698585,762,assets/images/split/image2068.bin -11699347,1062,assets/images/split/image2069.bin -11700409,1547,assets/images/split/image2070.bin -11701956,1211,assets/images/split/image2071.bin -11703167,906,assets/images/split/image2072.bin -11704073,1119,assets/images/split/image2073.bin -11705192,1170,assets/images/split/image2074.bin -11706362,783,assets/images/split/image2075.bin -11707145,1033,assets/images/split/image2076.bin -11708178,918,assets/images/split/image2077.bin -11709096,2478,assets/images/split/image2078.bin -11711574,1960,assets/images/split/image2079.bin -11713534,2226,assets/images/split/image2080.bin -11715760,734,assets/images/split/image2081.bin -11716494,936,assets/images/split/image2082.bin -11717430,1717,assets/images/split/image2083.bin -11719147,1578,assets/images/split/image2084.bin -11720725,7,assets/images/split/image2085.bin -11720732,8,assets/images/split/image2086.bin -11720740,1245,assets/images/split/image2087.bin -11721985,291,assets/images/split/image2088.bin -11722276,943,assets/images/split/image2089.bin -11723219,209,assets/images/split/image2090.bin -11723428,1157,assets/images/split/image2091.bin -11724585,254,assets/images/split/image2092.bin -11724839,1061,assets/images/split/image2093.bin -11725900,218,assets/images/split/image2094.bin -11726118,787,assets/images/split/image2095.bin -11726905,120,assets/images/split/image2096.bin -11727025,170,assets/images/split/image2097.bin -11727195,50,assets/images/split/image2098.bin -11727245,971,assets/images/split/image2099.bin -11728216,256,assets/images/split/image2100.bin -11728472,1196,assets/images/split/image2101.bin -11729668,274,assets/images/split/image2102.bin -11729942,1365,assets/images/split/image2103.bin -11731307,288,assets/images/split/image2104.bin -11731595,1459,assets/images/split/image2105.bin -11733054,306,assets/images/split/image2106.bin -11733360,1517,assets/images/split/image2107.bin -11734877,322,assets/images/split/image2108.bin -11735199,1451,assets/images/split/image2109.bin -11736650,311,assets/images/split/image2110.bin -11736961,1408,assets/images/split/image2111.bin -11738369,309,assets/images/split/image2112.bin -11738678,1318,assets/images/split/image2113.bin -11739996,301,assets/images/split/image2114.bin -11740297,2297,assets/images/split/image2115.bin -11742594,2246,assets/images/split/image2116.bin -11744840,2094,assets/images/split/image2117.bin -11746934,2245,assets/images/split/image2118.bin -11749179,412,assets/images/split/image2119.bin -11749591,2299,assets/images/split/image2120.bin -11751890,1889,assets/images/split/image2121.bin -11753779,1739,assets/images/split/image2122.bin -11755518,1778,assets/images/split/image2123.bin -11757296,1747,assets/images/split/image2124.bin -11759043,1931,assets/images/split/image2125.bin -11760974,1852,assets/images/split/image2126.bin -11762826,1938,assets/images/split/image2127.bin -11764764,1909,assets/images/split/image2128.bin -11766673,1149,assets/images/split/image2129.bin -11767822,1572,assets/images/split/image2130.bin -11769394,1548,assets/images/split/image2131.bin -11770942,1548,assets/images/split/image2132.bin -11772490,1548,assets/images/split/image2133.bin -11774038,1546,assets/images/split/image2134.bin -11775584,3015,assets/images/split/image2135.bin -11778599,1300,assets/images/split/image2136.bin -11779899,1159,assets/images/split/image2137.bin -11781058,2557,assets/images/split/image2138.bin -11783615,2399,assets/images/split/image2139.bin -11786014,1989,assets/images/split/image2140.bin -11788003,2215,assets/images/split/image2141.bin -11790218,1881,assets/images/split/image2142.bin -11792099,1680,assets/images/split/image2143.bin -11793779,1636,assets/images/split/image2144.bin -11795415,1715,assets/images/split/image2145.bin -11797130,2062,assets/images/split/image2146.bin -11799192,1951,assets/images/split/image2147.bin -11801143,1909,assets/images/split/image2148.bin -11803052,1919,assets/images/split/image2149.bin -11804971,1721,assets/images/split/image2150.bin -11806692,1606,assets/images/split/image2151.bin -11808298,1609,assets/images/split/image2152.bin -11809907,1620,assets/images/split/image2153.bin -11811527,1408,assets/images/split/image2154.bin -11812935,1291,assets/images/split/image2155.bin -11814226,1285,assets/images/split/image2156.bin -11815511,1323,assets/images/split/image2157.bin -11816834,2098,assets/images/split/image2158.bin -11818932,2023,assets/images/split/image2159.bin -11820955,2003,assets/images/split/image2160.bin -11822958,1927,assets/images/split/image2161.bin -11824885,538,assets/images/split/image2162.bin -11825423,744,assets/images/split/image2163.bin -11826167,910,assets/images/split/image2164.bin -11827077,149,assets/images/split/image2165.bin -11827226,643,assets/images/split/image2166.bin -11827869,513,assets/images/split/image2167.bin -11828382,142,assets/images/split/image2168.bin -11828524,1017,assets/images/split/image2169.bin -11829541,847,assets/images/split/image2170.bin -11830388,1624,assets/images/split/image2171.bin -11832012,1140,assets/images/split/image2172.bin -11833152,540,assets/images/split/image2173.bin -11833692,1321,assets/images/split/image2174.bin -11835013,1104,assets/images/split/image2175.bin -11836117,1111,assets/images/split/image2176.bin -11837228,487,assets/images/split/image2177.bin -11837715,1249,assets/images/split/image2178.bin -11838964,414,assets/images/split/image2179.bin -11839378,644,assets/images/split/image2180.bin -11840022,923,assets/images/split/image2181.bin -11840945,869,assets/images/split/image2182.bin -11841814,1381,assets/images/split/image2183.bin -11843195,1537,assets/images/split/image2184.bin -11844732,1612,assets/images/split/image2185.bin -11846344,1594,assets/images/split/image2186.bin -11847938,1605,assets/images/split/image2187.bin -11849543,909,assets/images/split/image2188.bin -11850452,921,assets/images/split/image2189.bin -11851373,1116,assets/images/split/image2190.bin -11852489,846,assets/images/split/image2191.bin -11853335,1039,assets/images/split/image2192.bin -11854374,1067,assets/images/split/image2193.bin -11855441,290,assets/images/split/image2194.bin -11855731,1509,assets/images/split/image2195.bin -11857240,1491,assets/images/split/image2196.bin -11858731,1437,assets/images/split/image2197.bin -11860168,1387,assets/images/split/image2198.bin -11861555,1415,assets/images/split/image2199.bin -11862970,1418,assets/images/split/image2200.bin -11864388,378,assets/images/split/image2201.bin -11864766,1527,assets/images/split/image2202.bin -11866293,1526,assets/images/split/image2203.bin -11867819,1421,assets/images/split/image2204.bin -11869240,1494,assets/images/split/image2205.bin -11870734,1514,assets/images/split/image2206.bin -11872248,1318,assets/images/split/image2207.bin -11873566,491,assets/images/split/image2208.bin -11874057,459,assets/images/split/image2209.bin -11874516,492,assets/images/split/image2210.bin -11875008,1084,assets/images/split/image2211.bin -11876092,1090,assets/images/split/image2212.bin -11877182,1083,assets/images/split/image2213.bin -11878265,1083,assets/images/split/image2214.bin -11879348,1718,assets/images/split/image2215.bin -11881066,432,assets/images/split/image2216.bin -11881498,431,assets/images/split/image2217.bin -11881929,433,assets/images/split/image2218.bin -11882362,450,assets/images/split/image2219.bin -11882812,795,assets/images/split/image2220.bin -11883607,820,assets/images/split/image2221.bin -11884427,816,assets/images/split/image2222.bin -11885243,837,assets/images/split/image2223.bin -11886080,455,assets/images/split/image2224.bin -11886535,136,assets/images/split/image2225.bin -11886671,50,assets/images/split/image2226.bin -11886721,84,assets/images/split/image2227.bin -11886805,1609,assets/images/split/image2228.bin -11888414,1713,assets/images/split/image2229.bin -11890127,1717,assets/images/split/image2230.bin -11891844,1128,assets/images/split/image2231.bin -11892972,186,assets/images/split/image2232.bin -11893158,395,assets/images/split/image2233.bin -11893553,143,assets/images/split/image2234.bin -11893696,735,assets/images/split/image2235.bin -11894431,737,assets/images/split/image2236.bin -11895168,1027,assets/images/split/image2237.bin -11896195,430,assets/images/split/image2238.bin -11896625,736,assets/images/split/image2239.bin -11897361,2529,assets/images/split/image2240.bin -11899890,2547,assets/images/split/image2241.bin -11902437,1461,assets/images/split/image2242.bin -11903898,1220,assets/images/split/image2243.bin -11905118,1112,assets/images/split/image2244.bin -11906230,1917,assets/images/split/image2245.bin -11908147,3026,assets/images/split/image2246.bin -11911173,2511,assets/images/split/image2247.bin -11913684,1667,assets/images/split/image2248.bin -11915351,880,assets/images/split/image2249.bin -11916231,3211,assets/images/split/image2250.bin -11919442,1499,assets/images/split/image2251.bin -11920941,1508,assets/images/split/image2252.bin -11922449,1428,assets/images/split/image2253.bin -11923877,1435,assets/images/split/image2254.bin -11925312,1042,assets/images/split/image2255.bin -11926354,478,assets/images/split/image2256.bin -11926832,731,assets/images/split/image2257.bin -11927563,811,assets/images/split/image2258.bin -11928374,860,assets/images/split/image2259.bin -11929234,691,assets/images/split/image2260.bin -11929925,2106,assets/images/split/image2261.bin -11932031,1438,assets/images/split/image2262.bin -11933469,1770,assets/images/split/image2263.bin -11935239,426,assets/images/split/image2264.bin -11935665,848,assets/images/split/image2265.bin -11936513,1179,assets/images/split/image2266.bin -11937692,1792,assets/images/split/image2267.bin -11939484,1999,assets/images/split/image2268.bin -11941483,1995,assets/images/split/image2269.bin -11943478,1749,assets/images/split/image2270.bin -11945227,1268,assets/images/split/image2271.bin -11946495,1197,assets/images/split/image2272.bin -11947692,528,assets/images/split/image2273.bin -11948220,834,assets/images/split/image2274.bin -11949054,167,assets/images/split/image2275.bin -11949221,448,assets/images/split/image2276.bin -11949669,851,assets/images/split/image2277.bin -11950520,1036,assets/images/split/image2278.bin -11951556,954,assets/images/split/image2279.bin -11952510,1024,assets/images/split/image2280.bin -11953534,3646,assets/images/split/image2281.bin -11957180,1058,assets/images/split/image2282.bin -11958238,1024,assets/images/split/image2283.bin -11959262,661,assets/images/split/image2284.bin -11959923,1493,assets/images/split/image2285.bin -11961416,547,assets/images/split/image2286.bin -11961963,600,assets/images/split/image2287.bin -11962563,578,assets/images/split/image2288.bin -11963141,442,assets/images/split/image2289.bin -11963583,467,assets/images/split/image2290.bin -11964050,252,assets/images/split/image2291.bin -11964302,494,assets/images/split/image2292.bin -11964796,442,assets/images/split/image2293.bin -11965238,491,assets/images/split/image2294.bin -11965729,574,assets/images/split/image2295.bin -11966303,1379,assets/images/split/image2296.bin -11967682,443,assets/images/split/image2297.bin -11968125,397,assets/images/split/image2298.bin -11968522,640,assets/images/split/image2299.bin -11969162,157,assets/images/split/image2300.bin -11969319,788,assets/images/split/image2301.bin -11970107,967,assets/images/split/image2302.bin -11971074,1377,assets/images/split/image2303.bin -11972451,995,assets/images/split/image2304.bin -11973446,1247,assets/images/split/image2305.bin -11974693,1068,assets/images/split/image2306.bin -11975761,1540,assets/images/split/image2307.bin -11977301,241,assets/images/split/image2308.bin -11977542,823,assets/images/split/image2309.bin -11978365,1098,assets/images/split/image2310.bin -11979463,1279,assets/images/split/image2311.bin -11980742,407,assets/images/split/image2312.bin -11981149,767,assets/images/split/image2313.bin -11981916,684,assets/images/split/image2314.bin -11982600,774,assets/images/split/image2315.bin -11983374,996,assets/images/split/image2316.bin -11984370,649,assets/images/split/image2317.bin -11985019,666,assets/images/split/image2318.bin -11985685,1199,assets/images/split/image2319.bin -11986884,1087,assets/images/split/image2320.bin -11987971,1008,assets/images/split/image2321.bin -11988979,1012,assets/images/split/image2322.bin -11989991,1055,assets/images/split/image2323.bin -11991046,966,assets/images/split/image2324.bin -11992012,1053,assets/images/split/image2325.bin -11993065,720,assets/images/split/image2326.bin -11993785,659,assets/images/split/image2327.bin -11994444,998,assets/images/split/image2328.bin -11995442,526,assets/images/split/image2329.bin -11995968,887,assets/images/split/image2330.bin -11996855,923,assets/images/split/image2331.bin -11997778,1308,assets/images/split/image2332.bin -11999086,690,assets/images/split/image2333.bin -11999776,1284,assets/images/split/image2334.bin -12001060,1453,assets/images/split/image2335.bin -12002513,739,assets/images/split/image2336.bin -12003252,1023,assets/images/split/image2337.bin -12004275,423,assets/images/split/image2338.bin -12004698,706,assets/images/split/image2339.bin -12005404,237,assets/images/split/image2340.bin -12005641,722,assets/images/split/image2341.bin -12006363,1284,assets/images/split/image2342.bin -12007647,1085,assets/images/split/image2343.bin -12008732,1049,assets/images/split/image2344.bin -12009781,693,assets/images/split/image2345.bin -12010474,1548,assets/images/split/image2346.bin -12012022,669,assets/images/split/image2347.bin -12012691,1262,assets/images/split/image2348.bin -12013953,1265,assets/images/split/image2349.bin -12015218,566,assets/images/split/image2350.bin -12015784,852,assets/images/split/image2351.bin -12016636,654,assets/images/split/image2352.bin -12017290,1018,assets/images/split/image2353.bin -12018308,1234,assets/images/split/image2354.bin -12019542,1412,assets/images/split/image2355.bin -12020954,1022,assets/images/split/image2356.bin -12021976,1195,assets/images/split/image2357.bin -12023171,1140,assets/images/split/image2358.bin -12024311,1136,assets/images/split/image2359.bin -12025447,1088,assets/images/split/image2360.bin -12026535,1228,assets/images/split/image2361.bin -12027763,1231,assets/images/split/image2362.bin -12028994,1191,assets/images/split/image2363.bin -12030185,394,assets/images/split/image2364.bin -12030579,422,assets/images/split/image2365.bin -12031001,330,assets/images/split/image2366.bin -12031331,899,assets/images/split/image2367.bin -12032230,508,assets/images/split/image2368.bin -12032738,389,assets/images/split/image2369.bin -12033127,977,assets/images/split/image2370.bin -12034104,1204,assets/images/split/image2371.bin -12035308,1397,assets/images/split/image2372.bin -12036705,1037,assets/images/split/image2373.bin -12037742,2035,assets/images/split/image2374.bin -12039777,1581,assets/images/split/image2375.bin -12041358,780,assets/images/split/image2376.bin -12042138,1046,assets/images/split/image2377.bin -12043184,1092,assets/images/split/image2378.bin -12044276,426,assets/images/split/image2379.bin -12044702,545,assets/images/split/image2380.bin -12045247,1608,assets/images/split/image2381.bin -12046855,1056,assets/images/split/image2382.bin -12047911,1021,assets/images/split/image2383.bin -12048932,1027,assets/images/split/image2384.bin -12049959,1032,assets/images/split/image2385.bin -12050991,1109,assets/images/split/image2386.bin -12052100,1020,assets/images/split/image2387.bin -12053120,1032,assets/images/split/image2388.bin -12054152,787,assets/images/split/image2389.bin -12054939,813,assets/images/split/image2390.bin -12055752,635,assets/images/split/image2391.bin -12056387,693,assets/images/split/image2392.bin -12057080,1306,assets/images/split/image2393.bin -12058386,996,assets/images/split/image2394.bin -12059382,659,assets/images/split/image2395.bin -12060041,908,assets/images/split/image2396.bin -12060949,1171,assets/images/split/image2397.bin -12062120,790,assets/images/split/image2398.bin -12062910,730,assets/images/split/image2399.bin -12063640,694,assets/images/split/image2400.bin -12064334,772,assets/images/split/image2401.bin -12065106,654,assets/images/split/image2402.bin -12065760,895,assets/images/split/image2403.bin -12066655,1548,assets/images/split/image2404.bin -12068203,1548,assets/images/split/image2405.bin -12069751,958,assets/images/split/image2406.bin -12070709,1548,assets/images/split/image2407.bin -12072257,596,assets/images/split/image2408.bin -12072853,1225,assets/images/split/image2409.bin -12074078,1548,assets/images/split/image2410.bin -12075626,1599,assets/images/split/image2411.bin -12077225,1521,assets/images/split/image2412.bin -12078746,1791,assets/images/split/image2413.bin -12080537,1594,assets/images/split/image2414.bin -12082131,746,assets/images/split/image2415.bin -12082877,1055,assets/images/split/image2416.bin -12083932,829,assets/images/split/image2417.bin -12084761,933,assets/images/split/image2418.bin -12085694,814,assets/images/split/image2419.bin -12086508,1018,assets/images/split/image2420.bin -12087526,865,assets/images/split/image2421.bin -12088391,1818,assets/images/split/image2422.bin -12090209,1940,assets/images/split/image2423.bin -12092149,1698,assets/images/split/image2424.bin -12093847,545,assets/images/split/image2425.bin -12094392,1016,assets/images/split/image2426.bin -12095408,796,assets/images/split/image2427.bin -12096204,497,assets/images/split/image2428.bin -12096701,194,assets/images/split/image2429.bin -12096895,522,assets/images/split/image2430.bin -12097417,1481,assets/images/split/image2431.bin -12098898,171,assets/images/split/image2432.bin -12099069,310,assets/images/split/image2433.bin -12099379,854,assets/images/split/image2434.bin -12100233,785,assets/images/split/image2435.bin -12101018,1485,assets/images/split/image2436.bin -12102503,481,assets/images/split/image2437.bin -12102984,851,assets/images/split/image2438.bin -12103835,775,assets/images/split/image2439.bin -12104610,378,assets/images/split/image2440.bin -12104988,1465,assets/images/split/image2441.bin -12106453,828,assets/images/split/image2442.bin -12107281,884,assets/images/split/image2443.bin -12108165,1013,assets/images/split/image2444.bin -12109178,1132,assets/images/split/image2445.bin -12110310,770,assets/images/split/image2446.bin -12111080,1190,assets/images/split/image2447.bin -12112270,945,assets/images/split/image2448.bin -12113215,681,assets/images/split/image2449.bin -12113896,547,assets/images/split/image2450.bin -12114443,165,assets/images/split/image2451.bin -12114608,1170,assets/images/split/image2452.bin -12115778,196,assets/images/split/image2453.bin -12115974,444,assets/images/split/image2454.bin -12116418,1081,assets/images/split/image2455.bin -12117499,764,assets/images/split/image2456.bin -12118263,776,assets/images/split/image2457.bin -12119039,85,assets/images/split/image2458.bin -12119124,527,assets/images/split/image2459.bin -12119651,268,assets/images/split/image2460.bin -12119919,369,assets/images/split/image2461.bin -12120288,942,assets/images/split/image2462.bin -12121230,1812,assets/images/split/image2463.bin -12123042,182,assets/images/split/image2464.bin -12123224,225,assets/images/split/image2465.bin -12123449,531,assets/images/split/image2466.bin -12123980,624,assets/images/split/image2467.bin -12124604,1383,assets/images/split/image2468.bin -12125987,1267,assets/images/split/image2469.bin -12127254,346,assets/images/split/image2470.bin -12127600,418,assets/images/split/image2471.bin -12128018,594,assets/images/split/image2472.bin -12128612,648,assets/images/split/image2473.bin -12129260,859,assets/images/split/image2474.bin -12130119,1300,assets/images/split/image2475.bin -12131419,566,assets/images/split/image2476.bin -12131985,2104,assets/images/split/image2477.bin -12134089,940,assets/images/split/image2478.bin -12135029,856,assets/images/split/image2479.bin -12135885,756,assets/images/split/image2480.bin -12136641,446,assets/images/split/image2481.bin -12137087,370,assets/images/split/image2482.bin -12137457,845,assets/images/split/image2483.bin -12138302,1370,assets/images/split/image2484.bin -12139672,1427,assets/images/split/image2485.bin -12141099,738,assets/images/split/image2486.bin -12141837,591,assets/images/split/image2487.bin -12142428,731,assets/images/split/image2488.bin -12143159,1263,assets/images/split/image2489.bin -12144422,1232,assets/images/split/image2490.bin -12145654,861,assets/images/split/image2491.bin -12146515,913,assets/images/split/image2492.bin -12147428,15,assets/images/split/image2493.bin -12147443,1362,assets/images/split/image2494.bin -12148805,472,assets/images/split/image2495.bin -12149277,1293,assets/images/split/image2496.bin -12150570,1448,assets/images/split/image2497.bin -12152018,1239,assets/images/split/image2498.bin -12153257,906,assets/images/split/image2499.bin -12154163,739,assets/images/split/image2500.bin -12154902,1130,assets/images/split/image2501.bin -12156032,1071,assets/images/split/image2502.bin -12157103,913,assets/images/split/image2503.bin -12158016,2328,assets/images/split/image2504.bin -12160344,2220,assets/images/split/image2505.bin -12162564,2340,assets/images/split/image2506.bin -12164904,2443,assets/images/split/image2507.bin -12167347,2491,assets/images/split/image2508.bin -12169838,2459,assets/images/split/image2509.bin -12172297,1469,assets/images/split/image2510.bin -12173766,1030,assets/images/split/image2511.bin -12174796,1065,assets/images/split/image2512.bin -12175861,1129,assets/images/split/image2513.bin -12176990,1111,assets/images/split/image2514.bin -12178101,892,assets/images/split/image2515.bin -12178993,1333,assets/images/split/image2516.bin -12180326,1897,assets/images/split/image2517.bin -12182223,1968,assets/images/split/image2518.bin -12184191,1943,assets/images/split/image2519.bin -12186134,1780,assets/images/split/image2520.bin -12187914,1503,assets/images/split/image2521.bin -12189417,1863,assets/images/split/image2522.bin -12191280,2095,assets/images/split/image2523.bin -12193375,2442,assets/images/split/image2524.bin -12195817,2330,assets/images/split/image2525.bin -12198147,1781,assets/images/split/image2526.bin -12199928,980,assets/images/split/image2527.bin -12200908,1106,assets/images/split/image2528.bin -12202014,1255,assets/images/split/image2529.bin -12203269,2055,assets/images/split/image2530.bin -12205324,1961,assets/images/split/image2531.bin -12207285,1695,assets/images/split/image2532.bin -12208980,2253,assets/images/split/image2533.bin -12211233,1786,assets/images/split/image2534.bin -12213019,774,assets/images/split/image2535.bin -12213793,1099,assets/images/split/image2536.bin -12214892,1042,assets/images/split/image2537.bin -12215934,2027,assets/images/split/image2538.bin -12217961,2341,assets/images/split/image2539.bin -12220302,2393,assets/images/split/image2540.bin -12222695,2465,assets/images/split/image2541.bin -12225160,2384,assets/images/split/image2542.bin -12227544,1918,assets/images/split/image2543.bin -12229462,2606,assets/images/split/image2544.bin -12232068,2251,assets/images/split/image2545.bin -12234319,2334,assets/images/split/image2546.bin -12236653,2319,assets/images/split/image2547.bin -12238972,2280,assets/images/split/image2548.bin -12241252,1961,assets/images/split/image2549.bin -12243213,2528,assets/images/split/image2550.bin -12245741,2235,assets/images/split/image2551.bin -12247976,2323,assets/images/split/image2552.bin -12250299,1717,assets/images/split/image2553.bin -12252016,2109,assets/images/split/image2554.bin -12254125,2141,assets/images/split/image2555.bin -12256266,2112,assets/images/split/image2556.bin -12258378,1578,assets/images/split/image2557.bin -12259956,1655,assets/images/split/image2558.bin -12261611,1031,assets/images/split/image2559.bin -12262642,2231,assets/images/split/image2560.bin -12264873,2285,assets/images/split/image2561.bin -12267158,2356,assets/images/split/image2562.bin -12269514,1840,assets/images/split/image2563.bin -12271354,1793,assets/images/split/image2564.bin -12273147,1925,assets/images/split/image2565.bin -12275072,2146,assets/images/split/image2566.bin -12277218,1945,assets/images/split/image2567.bin -12279163,2158,assets/images/split/image2568.bin -12281321,1819,assets/images/split/image2569.bin -12283140,1523,assets/images/split/image2570.bin -12284663,1843,assets/images/split/image2571.bin -12286506,1880,assets/images/split/image2572.bin -12288386,2599,assets/images/split/image2573.bin -12290985,2724,assets/images/split/image2574.bin -12293709,1889,assets/images/split/image2575.bin -12295598,1780,assets/images/split/image2576.bin -12297378,1586,assets/images/split/image2577.bin -12298964,1675,assets/images/split/image2578.bin -12300639,2429,assets/images/split/image2579.bin -12303068,2606,assets/images/split/image2580.bin -12305674,2456,assets/images/split/image2581.bin -12308130,2478,assets/images/split/image2582.bin -12310608,2469,assets/images/split/image2583.bin -12313077,2221,assets/images/split/image2584.bin -12315298,2456,assets/images/split/image2585.bin -12317754,2076,assets/images/split/image2586.bin -12319830,2286,assets/images/split/image2587.bin -12322116,2013,assets/images/split/image2588.bin -12324129,2180,assets/images/split/image2589.bin -12326309,2425,assets/images/split/image2590.bin -12328734,2148,assets/images/split/image2591.bin -12330882,2335,assets/images/split/image2592.bin -12333217,2230,assets/images/split/image2593.bin -12335447,1880,assets/images/split/image2594.bin -12337327,2099,assets/images/split/image2595.bin -12339426,2670,assets/images/split/image2596.bin -12342096,2103,assets/images/split/image2597.bin -12344199,2278,assets/images/split/image2598.bin -12346477,1321,assets/images/split/image2599.bin -12347798,1310,assets/images/split/image2600.bin -12349108,1412,assets/images/split/image2601.bin -12350520,1446,assets/images/split/image2602.bin -12351966,1407,assets/images/split/image2603.bin -12353373,1533,assets/images/split/image2604.bin -12354906,1226,assets/images/split/image2605.bin -12356132,1547,assets/images/split/image2606.bin -12357679,1382,assets/images/split/image2607.bin -12359061,1452,assets/images/split/image2608.bin -12360513,1157,assets/images/split/image2609.bin -12361670,1764,assets/images/split/image2610.bin -12363434,1290,assets/images/split/image2611.bin -12364724,1384,assets/images/split/image2612.bin -12366108,1558,assets/images/split/image2613.bin -12367666,1439,assets/images/split/image2614.bin -12369105,1428,assets/images/split/image2615.bin -12370533,1214,assets/images/split/image2616.bin -12371747,1356,assets/images/split/image2617.bin -12373103,1299,assets/images/split/image2618.bin -12374402,1853,assets/images/split/image2619.bin -12376255,1762,assets/images/split/image2620.bin -12378017,1780,assets/images/split/image2621.bin -12379797,1758,assets/images/split/image2622.bin -12381555,1647,assets/images/split/image2623.bin -12383202,1732,assets/images/split/image2624.bin -12384934,1435,assets/images/split/image2625.bin -12386369,1882,assets/images/split/image2626.bin -12388251,931,assets/images/split/image2627.bin -12389182,1658,assets/images/split/image2628.bin -12390840,1778,assets/images/split/image2629.bin -12392618,650,assets/images/split/image2630.bin -12393268,1346,assets/images/split/image2631.bin -12394614,53,assets/images/split/image2632.bin -12394667,1208,assets/images/split/image2633.bin -12395875,1315,assets/images/split/image2634.bin -12397190,1319,assets/images/split/image2635.bin -12398509,1530,assets/images/split/image2636.bin -12400039,1556,assets/images/split/image2637.bin -12401595,1289,assets/images/split/image2638.bin -12402884,1432,assets/images/split/image2639.bin -12404316,1467,assets/images/split/image2640.bin -12405783,1255,assets/images/split/image2641.bin -12407038,1261,assets/images/split/image2642.bin -12408299,1043,assets/images/split/image2643.bin -12409342,1074,assets/images/split/image2644.bin -12410416,1242,assets/images/split/image2645.bin -12411658,1300,assets/images/split/image2646.bin -12412958,1195,assets/images/split/image2647.bin -12414153,1231,assets/images/split/image2648.bin -12415384,1362,assets/images/split/image2649.bin -12416746,1212,assets/images/split/image2650.bin -12417958,1334,assets/images/split/image2651.bin -12419292,1551,assets/images/split/image2652.bin -12420843,1347,assets/images/split/image2653.bin -12422190,1358,assets/images/split/image2654.bin -12423548,1213,assets/images/split/image2655.bin -12424761,1219,assets/images/split/image2656.bin -12425980,1235,assets/images/split/image2657.bin -12427215,1161,assets/images/split/image2658.bin -12428376,1687,assets/images/split/image2659.bin -12430063,1602,assets/images/split/image2660.bin -12431665,1383,assets/images/split/image2661.bin -12433048,1308,assets/images/split/image2662.bin -12434356,1341,assets/images/split/image2663.bin -12435697,1389,assets/images/split/image2664.bin -12437086,1374,assets/images/split/image2665.bin -12438460,1115,assets/images/split/image2666.bin -12439575,1445,assets/images/split/image2667.bin -12441020,1451,assets/images/split/image2668.bin -12442471,1364,assets/images/split/image2669.bin -12443835,1302,assets/images/split/image2670.bin -12445137,1407,assets/images/split/image2671.bin -12446544,1212,assets/images/split/image2672.bin -12447756,160,assets/images/split/image2673.bin -12447916,248,assets/images/split/image2674.bin -12448164,919,assets/images/split/image2675.bin -12449083,188,assets/images/split/image2676.bin -12449271,1077,assets/images/split/image2677.bin -12450348,2572,assets/images/split/image2678.bin -12452920,1845,assets/images/split/image2679.bin -12454765,726,assets/images/split/image2680.bin -12455491,2270,assets/images/split/image2681.bin -12457761,631,assets/images/split/image2682.bin -12458392,947,assets/images/split/image2683.bin -12459339,948,assets/images/split/image2684.bin -12460287,705,assets/images/split/image2685.bin -12460992,708,assets/images/split/image2686.bin -12461700,2422,assets/images/split/image2687.bin -12464122,2504,assets/images/split/image2688.bin -12466626,2617,assets/images/split/image2689.bin -12469243,2159,assets/images/split/image2690.bin -12471402,896,assets/images/split/image2691.bin -12472298,1348,assets/images/split/image2692.bin -12473646,1299,assets/images/split/image2693.bin -12474945,1282,assets/images/split/image2694.bin -12476227,1252,assets/images/split/image2695.bin -12477479,419,assets/images/split/image2696.bin -12477898,513,assets/images/split/image2697.bin -12478411,1341,assets/images/split/image2698.bin -12479752,8,assets/images/split/image2699.bin +9403888,1876,assets/images/split/image1.bin,0,1 +9405764,362,assets/images/split/image2.bin,0,1 +9406126,2420,assets/images/split/image3.bin,0,1 +9408546,907,assets/images/split/image4.bin,0,1 +9409453,339,assets/images/split/image5.bin,0,1 +9409792,606,assets/images/split/image6.bin,0,1 +9410398,958,assets/images/split/image7.bin,0,1 +9411356,26,assets/images/split/image8.bin,0,1 +9411382,26,assets/images/split/image9.bin,0,1 +9411408,895,assets/images/split/image10.bin,0,1 +9412303,913,assets/images/split/image11.bin,0,1 +9413216,224,assets/images/split/image12.bin,0,1 +9413440,932,assets/images/split/image13.bin,0,1 +9414372,1187,assets/images/split/image14.bin,0,1 +9415559,1143,assets/images/split/image15.bin,0,1 +9416702,1137,assets/images/split/image16.bin,0,1 +9417839,1196,assets/images/split/image17.bin,0,1 +9419035,986,assets/images/split/image18.bin,0,1 +9420021,26,assets/images/split/image19.bin,0,1 +9420047,26,assets/images/split/image20.bin,0,1 +9420073,1561,assets/images/split/image21.bin,0,1 +9421634,309,assets/images/split/image22.bin,0,1 +9421943,1525,assets/images/split/image23.bin,0,1 +9423468,863,assets/images/split/image24.bin,0,1 +9424331,848,assets/images/split/image25.bin,0,1 +9425179,1548,assets/images/split/image26.bin,0,1 +9426727,197,assets/images/split/image27.bin,0,1 +9426924,166,assets/images/split/image28.bin,0,1 +9427090,181,assets/images/split/image29.bin,0,1 +9427271,989,assets/images/split/image30.bin,0,1 +9428260,1020,assets/images/split/image31.bin,0,1 +9429280,776,assets/images/split/image32.bin,0,1 +9430056,774,assets/images/split/image33.bin,0,1 +9430830,1610,assets/images/split/image34.bin,0,1 +9432440,1484,assets/images/split/image35.bin,0,1 +9433924,1696,assets/images/split/image36.bin,0,1 +9435620,1734,assets/images/split/image37.bin,0,1 +9437354,1003,assets/images/split/image38.bin,0,1 +9438357,275,assets/images/split/image39.bin,0,1 +9438632,551,assets/images/split/image40.bin,0,1 +9439183,537,assets/images/split/image41.bin,0,1 +9439720,555,assets/images/split/image42.bin,0,1 +9440275,546,assets/images/split/image43.bin,0,1 +9440821,1341,assets/images/split/image44.bin,0,1 +9442162,1372,assets/images/split/image45.bin,0,1 +9443534,1007,assets/images/split/image46.bin,0,1 +9444541,410,assets/images/split/image47.bin,0,1 +9444951,1108,assets/images/split/image48.bin,0,1 +9446059,1726,assets/images/split/image49.bin,0,1 +9447785,636,assets/images/split/image50.bin,0,1 +9448421,1510,assets/images/split/image51.bin,0,1 +9449931,824,assets/images/split/image52.bin,0,1 +9450755,1232,assets/images/split/image53.bin,0,1 +9451987,1440,assets/images/split/image54.bin,0,1 +9453427,1170,assets/images/split/image55.bin,0,1 +9454597,792,assets/images/split/image56.bin,0,1 +9455389,270,assets/images/split/image57.bin,0,1 +9455659,241,assets/images/split/image58.bin,0,1 +9455900,281,assets/images/split/image59.bin,0,1 +9456181,678,assets/images/split/image60.bin,0,1 +9456859,416,assets/images/split/image61.bin,0,1 +9457275,34,assets/images/split/image62.bin,0,1 +9457309,276,assets/images/split/image63.bin,0,1 +9457585,156,assets/images/split/image64.bin,0,1 +9457741,933,assets/images/split/image65.bin,0,1 +9458674,888,assets/images/split/image66.bin,0,1 +9459562,836,assets/images/split/image67.bin,0,1 +9460398,247,assets/images/split/image68.bin,0,1 +9460645,923,assets/images/split/image69.bin,0,1 +9461568,429,assets/images/split/image70.bin,0,1 +9461997,484,assets/images/split/image71.bin,0,1 +9462481,725,assets/images/split/image72.bin,0,1 +9463206,198,assets/images/split/image73.bin,0,1 +9463404,199,assets/images/split/image74.bin,0,1 +9463603,691,assets/images/split/image75.bin,0,1 +9464294,418,assets/images/split/image76.bin,0,1 +9464712,400,assets/images/split/image77.bin,0,1 +9465112,1505,assets/images/split/image78.bin,0,1 +9466617,687,assets/images/split/image79.bin,0,1 +9467304,222,assets/images/split/image80.bin,0,1 +9467526,500,assets/images/split/image81.bin,0,1 +9468026,1508,assets/images/split/image82.bin,0,1 +9469534,441,assets/images/split/image83.bin,0,1 +9469975,1523,assets/images/split/image84.bin,0,1 +9471498,551,assets/images/split/image85.bin,0,1 +9472049,727,assets/images/split/image86.bin,0,1 +9472776,942,assets/images/split/image87.bin,0,1 +9473718,761,assets/images/split/image88.bin,0,1 +9474479,3114,assets/images/split/image89.bin,0,1 +9477593,3069,assets/images/split/image90.bin,0,1 +9480662,3121,assets/images/split/image91.bin,0,1 +9483783,2840,assets/images/split/image92.bin,0,1 +9486623,3014,assets/images/split/image93.bin,0,1 +9489637,3176,assets/images/split/image94.bin,0,1 +9492813,3237,assets/images/split/image95.bin,0,1 +9496050,3028,assets/images/split/image96.bin,0,1 +9499078,2941,assets/images/split/image97.bin,0,1 +9502019,3032,assets/images/split/image98.bin,0,1 +9505051,3137,assets/images/split/image99.bin,0,1 +9508188,2975,assets/images/split/image100.bin,0,1 +9511163,3046,assets/images/split/image101.bin,0,1 +9514209,3310,assets/images/split/image102.bin,0,1 +9517519,3334,assets/images/split/image103.bin,0,1 +9520853,2977,assets/images/split/image104.bin,0,1 +9523830,2855,assets/images/split/image105.bin,0,1 +9526685,3352,assets/images/split/image106.bin,0,1 +9530037,3274,assets/images/split/image107.bin,0,1 +9533311,2650,assets/images/split/image108.bin,0,1 +9535961,2166,assets/images/split/image109.bin,0,1 +9538127,2218,assets/images/split/image110.bin,0,1 +9540345,2255,assets/images/split/image111.bin,0,1 +9542600,1940,assets/images/split/image112.bin,0,1 +9544540,2682,assets/images/split/image113.bin,0,1 +9547222,3218,assets/images/split/image114.bin,0,1 +9550440,2954,assets/images/split/image115.bin,0,1 +9553394,2643,assets/images/split/image116.bin,0,1 +9556037,3056,assets/images/split/image117.bin,0,1 +9559093,3340,assets/images/split/image118.bin,0,1 +9562433,3276,assets/images/split/image119.bin,0,1 +9565709,2552,assets/images/split/image120.bin,0,1 +9568261,3265,assets/images/split/image121.bin,0,1 +9571526,3387,assets/images/split/image122.bin,0,1 +9574913,3437,assets/images/split/image123.bin,0,1 +9578350,3056,assets/images/split/image124.bin,0,1 +9581406,2432,assets/images/split/image125.bin,0,1 +9583838,2961,assets/images/split/image126.bin,0,1 +9586799,3233,assets/images/split/image127.bin,0,1 +9590032,2690,assets/images/split/image128.bin,0,1 +9592722,3194,assets/images/split/image129.bin,0,1 +9595916,3403,assets/images/split/image130.bin,0,1 +9599319,3461,assets/images/split/image131.bin,0,1 +9602780,3190,assets/images/split/image132.bin,0,1 +9605970,2985,assets/images/split/image133.bin,0,1 +9608955,3418,assets/images/split/image134.bin,0,1 +9612373,3408,assets/images/split/image135.bin,0,1 +9615781,3125,assets/images/split/image136.bin,0,1 +9618906,2701,assets/images/split/image137.bin,0,1 +9621607,3366,assets/images/split/image138.bin,0,1 +9624973,2853,assets/images/split/image139.bin,0,1 +9627826,2201,assets/images/split/image140.bin,0,1 +9630027,1143,assets/images/split/image141.bin,0,1 +9631170,1157,assets/images/split/image142.bin,0,1 +9632327,1110,assets/images/split/image143.bin,0,1 +9633437,2112,assets/images/split/image144.bin,0,1 +9635549,2122,assets/images/split/image145.bin,0,1 +9637671,2155,assets/images/split/image146.bin,0,1 +9639826,1986,assets/images/split/image147.bin,0,1 +9641812,530,assets/images/split/image148.bin,0,1 +9642342,587,assets/images/split/image149.bin,0,1 +9642929,329,assets/images/split/image150.bin,0,1 +9643258,293,assets/images/split/image151.bin,0,1 +9643551,784,assets/images/split/image152.bin,0,1 +9644335,311,assets/images/split/image153.bin,0,1 +9644646,295,assets/images/split/image154.bin,0,1 +9644941,315,assets/images/split/image155.bin,0,1 +9645256,705,assets/images/split/image156.bin,0,1 +9645961,956,assets/images/split/image157.bin,0,1 +9646917,1422,assets/images/split/image158.bin,0,1 +9648339,326,assets/images/split/image159.bin,0,1 +9648665,315,assets/images/split/image160.bin,0,1 +9648980,563,assets/images/split/image161.bin,0,1 +9649543,737,assets/images/split/image162.bin,0,1 +9650280,796,assets/images/split/image163.bin,0,1 +9651076,779,assets/images/split/image164.bin,0,1 +9651855,831,assets/images/split/image165.bin,0,1 +9652686,757,assets/images/split/image166.bin,0,1 +9653443,830,assets/images/split/image167.bin,0,1 +9654273,782,assets/images/split/image168.bin,0,1 +9655055,851,assets/images/split/image169.bin,0,1 +9655906,1143,assets/images/split/image170.bin,0,1 +9657049,761,assets/images/split/image171.bin,0,1 +9657810,603,assets/images/split/image172.bin,0,1 +9658413,186,assets/images/split/image173.bin,0,1 +9658599,678,assets/images/split/image174.bin,0,1 +9659277,938,assets/images/split/image175.bin,0,1 +9660215,572,assets/images/split/image176.bin,0,1 +9660787,2014,assets/images/split/image177.bin,0,1 +9662801,625,assets/images/split/image178.bin,0,1 +9663426,755,assets/images/split/image179.bin,0,1 +9664181,788,assets/images/split/image180.bin,0,1 +9664969,296,assets/images/split/image181.bin,0,1 +9665265,505,assets/images/split/image182.bin,0,1 +9665770,691,assets/images/split/image183.bin,0,1 +9666461,519,assets/images/split/image184.bin,0,1 +9666980,603,assets/images/split/image185.bin,0,1 +9667583,1353,assets/images/split/image186.bin,0,1 +9668936,1099,assets/images/split/image187.bin,0,1 +9670035,895,assets/images/split/image188.bin,0,1 +9670930,1568,assets/images/split/image189.bin,0,1 +9672498,1107,assets/images/split/image190.bin,0,1 +9673605,1388,assets/images/split/image191.bin,0,1 +9674993,1431,assets/images/split/image192.bin,0,1 +9676424,1302,assets/images/split/image193.bin,0,1 +9677726,648,assets/images/split/image194.bin,0,1 +9678374,712,assets/images/split/image195.bin,0,1 +9679086,1431,assets/images/split/image196.bin,0,1 +9680517,1149,assets/images/split/image197.bin,0,1 +9681666,671,assets/images/split/image198.bin,0,1 +9682337,675,assets/images/split/image199.bin,0,1 +9683012,330,assets/images/split/image200.bin,0,1 +9683342,1210,assets/images/split/image201.bin,0,1 +9684552,1018,assets/images/split/image202.bin,0,1 +9685570,1327,assets/images/split/image203.bin,0,1 +9686897,1120,assets/images/split/image204.bin,0,1 +9688017,1377,assets/images/split/image205.bin,0,1 +9689394,1271,assets/images/split/image206.bin,0,1 +9690665,1033,assets/images/split/image207.bin,0,1 +9691698,1603,assets/images/split/image208.bin,0,1 +9693301,2859,assets/images/split/image209.bin,0,1 +9696160,3134,assets/images/split/image210.bin,0,1 +9699294,1400,assets/images/split/image211.bin,0,1 +9700694,207,assets/images/split/image212.bin,0,1 +9700901,656,assets/images/split/image213.bin,0,1 +9701557,1238,assets/images/split/image214.bin,0,1 +9702795,224,assets/images/split/image215.bin,0,1 +9703019,622,assets/images/split/image216.bin,0,1 +9703641,334,assets/images/split/image217.bin,0,1 +9703975,480,assets/images/split/image218.bin,0,1 +9704455,281,assets/images/split/image219.bin,0,1 +9704736,984,assets/images/split/image220.bin,0,1 +9705720,1033,assets/images/split/image221.bin,0,1 +9706753,1010,assets/images/split/image222.bin,0,1 +9707763,1033,assets/images/split/image223.bin,0,1 +9708796,1090,assets/images/split/image224.bin,0,1 +9709886,1085,assets/images/split/image225.bin,0,1 +9710971,1014,assets/images/split/image226.bin,0,1 +9711985,691,assets/images/split/image227.bin,0,1 +9712676,895,assets/images/split/image228.bin,0,1 +9713571,617,assets/images/split/image229.bin,0,1 +9714188,553,assets/images/split/image230.bin,0,1 +9714741,899,assets/images/split/image231.bin,0,1 +9715640,1498,assets/images/split/image232.bin,0,1 +9717138,833,assets/images/split/image233.bin,0,1 +9717971,302,assets/images/split/image234.bin,0,1 +9718273,1364,assets/images/split/image235.bin,0,1 +9719637,925,assets/images/split/image236.bin,0,1 +9720562,1174,assets/images/split/image237.bin,0,1 +9721736,1257,assets/images/split/image238.bin,0,1 +9722993,967,assets/images/split/image239.bin,0,1 +9723960,991,assets/images/split/image240.bin,0,1 +9724951,1024,assets/images/split/image241.bin,0,1 +9725975,581,assets/images/split/image242.bin,0,1 +9726556,502,assets/images/split/image243.bin,0,1 +9727058,351,assets/images/split/image244.bin,0,1 +9727409,1144,assets/images/split/image245.bin,0,1 +9728553,525,assets/images/split/image246.bin,0,1 +9729078,738,assets/images/split/image247.bin,0,1 +9729816,199,assets/images/split/image248.bin,0,1 +9730015,180,assets/images/split/image249.bin,0,1 +9730195,152,assets/images/split/image250.bin,0,1 +9730347,199,assets/images/split/image251.bin,0,1 +9730546,809,assets/images/split/image252.bin,0,1 +9731355,673,assets/images/split/image253.bin,0,1 +9732028,717,assets/images/split/image254.bin,0,1 +9732745,1032,assets/images/split/image255.bin,0,1 +9733777,1003,assets/images/split/image256.bin,0,1 +9734780,463,assets/images/split/image257.bin,0,1 +9735243,829,assets/images/split/image258.bin,0,1 +9736072,647,assets/images/split/image259.bin,0,1 +9736719,806,assets/images/split/image260.bin,0,1 +9737525,896,assets/images/split/image261.bin,0,1 +9738421,689,assets/images/split/image262.bin,0,1 +9739110,708,assets/images/split/image263.bin,0,1 +9739818,558,assets/images/split/image264.bin,0,1 +9740376,1412,assets/images/split/image265.bin,0,1 +9741788,424,assets/images/split/image266.bin,0,1 +9742212,79,assets/images/split/image267.bin,0,1 +9742291,1368,assets/images/split/image268.bin,0,1 +9743659,727,assets/images/split/image269.bin,0,1 +9744386,1410,assets/images/split/image270.bin,0,1 +9745796,694,assets/images/split/image271.bin,0,1 +9746490,1302,assets/images/split/image272.bin,0,1 +9747792,1248,assets/images/split/image273.bin,0,1 +9749040,1945,assets/images/split/image274.bin,0,1 +9750985,1920,assets/images/split/image275.bin,0,1 +9752905,2060,assets/images/split/image276.bin,0,1 +9754965,1959,assets/images/split/image277.bin,0,1 +9756924,1924,assets/images/split/image278.bin,0,1 +9758848,1715,assets/images/split/image279.bin,0,1 +9760563,666,assets/images/split/image280.bin,0,1 +9761229,905,assets/images/split/image281.bin,0,1 +9762134,750,assets/images/split/image282.bin,0,1 +9762884,799,assets/images/split/image283.bin,0,1 +9763683,802,assets/images/split/image284.bin,0,1 +9764485,1400,assets/images/split/image285.bin,0,1 +9765885,798,assets/images/split/image286.bin,0,1 +9766683,1064,assets/images/split/image287.bin,0,1 +9767747,1217,assets/images/split/image288.bin,0,1 +9768964,1145,assets/images/split/image289.bin,0,1 +9770109,1273,assets/images/split/image290.bin,0,1 +9771382,1163,assets/images/split/image291.bin,0,1 +9772545,991,assets/images/split/image292.bin,0,1 +9773536,1350,assets/images/split/image293.bin,0,1 +9774886,1328,assets/images/split/image294.bin,0,1 +9776214,1323,assets/images/split/image295.bin,0,1 +9777537,1007,assets/images/split/image296.bin,0,1 +9778544,1088,assets/images/split/image297.bin,0,1 +9779632,930,assets/images/split/image298.bin,0,1 +9780562,783,assets/images/split/image299.bin,0,1 +9781345,771,assets/images/split/image300.bin,0,1 +9782116,771,assets/images/split/image301.bin,0,1 +9782887,884,assets/images/split/image302.bin,0,1 +9783771,1333,assets/images/split/image303.bin,0,1 +9785104,639,assets/images/split/image304.bin,0,1 +9785743,200,assets/images/split/image305.bin,0,1 +9785943,573,assets/images/split/image306.bin,0,1 +9786516,687,assets/images/split/image307.bin,0,1 +9787203,1376,assets/images/split/image308.bin,0,1 +9788579,901,assets/images/split/image309.bin,0,1 +9789480,949,assets/images/split/image310.bin,0,1 +9790429,1351,assets/images/split/image311.bin,0,1 +9791780,815,assets/images/split/image312.bin,0,1 +9792595,904,assets/images/split/image313.bin,0,1 +9793499,636,assets/images/split/image314.bin,0,1 +9794135,636,assets/images/split/image315.bin,0,1 +9794771,581,assets/images/split/image316.bin,0,1 +9795352,581,assets/images/split/image317.bin,0,1 +9795933,582,assets/images/split/image318.bin,0,1 +9796515,678,assets/images/split/image319.bin,0,1 +9797193,321,assets/images/split/image320.bin,0,1 +9797514,536,assets/images/split/image321.bin,0,1 +9798050,1115,assets/images/split/image322.bin,0,1 +9799165,1515,assets/images/split/image323.bin,0,1 +9800680,1563,assets/images/split/image324.bin,0,1 +9802243,1581,assets/images/split/image325.bin,0,1 +9803824,1567,assets/images/split/image326.bin,0,1 +9805391,1601,assets/images/split/image327.bin,0,1 +9806992,1619,assets/images/split/image328.bin,0,1 +9808611,1525,assets/images/split/image329.bin,0,1 +9810136,836,assets/images/split/image330.bin,0,1 +9810972,902,assets/images/split/image331.bin,0,1 +9811874,921,assets/images/split/image332.bin,0,1 +9812795,864,assets/images/split/image333.bin,0,1 +9813659,353,assets/images/split/image334.bin,0,1 +9814012,282,assets/images/split/image335.bin,0,1 +9814294,307,assets/images/split/image336.bin,0,1 +9814601,298,assets/images/split/image337.bin,0,1 +9814899,840,assets/images/split/image338.bin,0,1 +9815739,1319,assets/images/split/image339.bin,0,1 +9817058,922,assets/images/split/image340.bin,0,1 +9817980,1006,assets/images/split/image341.bin,0,1 +9818986,984,assets/images/split/image342.bin,0,1 +9819970,1115,assets/images/split/image343.bin,0,1 +9821085,232,assets/images/split/image344.bin,0,1 +9821317,290,assets/images/split/image345.bin,0,1 +9821607,1037,assets/images/split/image346.bin,0,1 +9822644,993,assets/images/split/image347.bin,0,1 +9823637,193,assets/images/split/image348.bin,0,1 +9823830,271,assets/images/split/image349.bin,0,1 +9824101,770,assets/images/split/image350.bin,0,1 +9824871,533,assets/images/split/image351.bin,0,1 +9825404,213,assets/images/split/image352.bin,0,1 +9825617,818,assets/images/split/image353.bin,0,1 +9826435,456,assets/images/split/image354.bin,0,1 +9826891,168,assets/images/split/image355.bin,0,1 +9827059,906,assets/images/split/image356.bin,0,1 +9827965,704,assets/images/split/image357.bin,0,1 +9828669,1098,assets/images/split/image358.bin,0,1 +9829767,987,assets/images/split/image359.bin,0,1 +9830754,861,assets/images/split/image360.bin,0,1 +9831615,845,assets/images/split/image361.bin,0,1 +9832460,1334,assets/images/split/image362.bin,0,1 +9833794,960,assets/images/split/image363.bin,0,1 +9834754,1224,assets/images/split/image364.bin,0,1 +9835978,973,assets/images/split/image365.bin,0,1 +9836951,532,assets/images/split/image366.bin,0,1 +9837483,756,assets/images/split/image367.bin,0,1 +9838239,950,assets/images/split/image368.bin,0,1 +9839189,990,assets/images/split/image369.bin,0,1 +9840179,622,assets/images/split/image370.bin,0,1 +9840801,622,assets/images/split/image371.bin,0,1 +9841423,1375,assets/images/split/image372.bin,0,1 +9842798,1418,assets/images/split/image373.bin,0,1 +9844216,823,assets/images/split/image374.bin,0,1 +9845039,1023,assets/images/split/image375.bin,0,1 +9846062,949,assets/images/split/image376.bin,0,1 +9847011,949,assets/images/split/image377.bin,0,1 +9847960,818,assets/images/split/image378.bin,0,1 +9848778,1020,assets/images/split/image379.bin,0,1 +9849798,964,assets/images/split/image380.bin,0,1 +9850762,1094,assets/images/split/image381.bin,0,1 +9851856,1018,assets/images/split/image382.bin,0,1 +9852874,609,assets/images/split/image383.bin,0,1 +9853483,1333,assets/images/split/image384.bin,0,1 +9854816,1389,assets/images/split/image385.bin,0,1 +9856205,1103,assets/images/split/image386.bin,0,1 +9857308,2429,assets/images/split/image387.bin,0,1 +9859737,2306,assets/images/split/image388.bin,0,1 +9862043,2349,assets/images/split/image389.bin,0,1 +9864392,2324,assets/images/split/image390.bin,0,1 +9866716,2433,assets/images/split/image391.bin,0,1 +9869149,2302,assets/images/split/image392.bin,0,1 +9871451,2293,assets/images/split/image393.bin,0,1 +9873744,2168,assets/images/split/image394.bin,0,1 +9875912,545,assets/images/split/image395.bin,0,1 +9876457,1136,assets/images/split/image396.bin,0,1 +9877593,1318,assets/images/split/image397.bin,0,1 +9878911,1254,assets/images/split/image398.bin,0,1 +9880165,1061,assets/images/split/image399.bin,0,1 +9881226,859,assets/images/split/image400.bin,0,1 +9882085,1077,assets/images/split/image401.bin,0,1 +9883162,1081,assets/images/split/image402.bin,0,1 +9884243,828,assets/images/split/image403.bin,0,1 +9885071,780,assets/images/split/image404.bin,0,1 +9885851,767,assets/images/split/image405.bin,0,1 +9886618,691,assets/images/split/image406.bin,0,1 +9887309,1321,assets/images/split/image407.bin,0,1 +9888630,845,assets/images/split/image408.bin,0,1 +9889475,525,assets/images/split/image409.bin,0,1 +9890000,925,assets/images/split/image410.bin,0,1 +9890925,753,assets/images/split/image411.bin,0,1 +9891678,435,assets/images/split/image412.bin,0,1 +9892113,526,assets/images/split/image413.bin,0,1 +9892639,363,assets/images/split/image414.bin,0,1 +9893002,519,assets/images/split/image415.bin,0,1 +9893521,399,assets/images/split/image416.bin,0,1 +9893920,463,assets/images/split/image417.bin,0,1 +9894383,447,assets/images/split/image418.bin,0,1 +9894830,1750,assets/images/split/image419.bin,0,1 +9896580,988,assets/images/split/image420.bin,0,1 +9897568,1760,assets/images/split/image421.bin,0,1 +9899328,547,assets/images/split/image422.bin,0,1 +9899875,483,assets/images/split/image423.bin,0,1 +9900358,344,assets/images/split/image424.bin,0,1 +9900702,385,assets/images/split/image425.bin,0,1 +9901087,1107,assets/images/split/image426.bin,0,1 +9902194,1374,assets/images/split/image427.bin,0,1 +9903568,1467,assets/images/split/image428.bin,0,1 +9905035,1317,assets/images/split/image429.bin,0,1 +9906352,1837,assets/images/split/image430.bin,0,1 +9908189,1214,assets/images/split/image431.bin,0,1 +9909403,755,assets/images/split/image432.bin,0,1 +9910158,1084,assets/images/split/image433.bin,0,1 +9911242,998,assets/images/split/image434.bin,0,1 +9912240,1579,assets/images/split/image435.bin,0,1 +9913819,797,assets/images/split/image436.bin,0,1 +9914616,768,assets/images/split/image437.bin,0,1 +9915384,1615,assets/images/split/image438.bin,0,1 +9916999,1527,assets/images/split/image439.bin,0,1 +9918526,1637,assets/images/split/image440.bin,0,1 +9920163,968,assets/images/split/image441.bin,0,1 +9921131,971,assets/images/split/image442.bin,0,1 +9922102,870,assets/images/split/image443.bin,0,1 +9922972,1718,assets/images/split/image444.bin,0,1 +9924690,1826,assets/images/split/image445.bin,0,1 +9926516,2215,assets/images/split/image446.bin,0,1 +9928731,2252,assets/images/split/image447.bin,0,1 +9930983,1008,assets/images/split/image448.bin,0,1 +9931991,827,assets/images/split/image449.bin,0,1 +9932818,580,assets/images/split/image450.bin,0,1 +9933398,512,assets/images/split/image451.bin,0,1 +9933910,503,assets/images/split/image452.bin,0,1 +9934413,1139,assets/images/split/image453.bin,0,1 +9935552,964,assets/images/split/image454.bin,0,1 +9936516,987,assets/images/split/image455.bin,0,1 +9937503,480,assets/images/split/image456.bin,0,1 +9937983,493,assets/images/split/image457.bin,0,1 +9938476,1325,assets/images/split/image458.bin,0,1 +9939801,1151,assets/images/split/image459.bin,0,1 +9940952,592,assets/images/split/image460.bin,0,1 +9941544,646,assets/images/split/image461.bin,0,1 +9942190,180,assets/images/split/image462.bin,0,1 +9942370,163,assets/images/split/image463.bin,0,1 +9942533,486,assets/images/split/image464.bin,0,1 +9943019,430,assets/images/split/image465.bin,0,1 +9943449,645,assets/images/split/image466.bin,0,1 +9944094,547,assets/images/split/image467.bin,0,1 +9944641,506,assets/images/split/image468.bin,0,1 +9945147,1954,assets/images/split/image469.bin,0,1 +9947101,1950,assets/images/split/image470.bin,0,1 +9949051,320,assets/images/split/image471.bin,0,1 +9949371,630,assets/images/split/image472.bin,0,1 +9950001,656,assets/images/split/image473.bin,0,1 +9950657,612,assets/images/split/image474.bin,0,1 +9951269,1156,assets/images/split/image475.bin,0,1 +9952425,966,assets/images/split/image476.bin,0,1 +9953391,835,assets/images/split/image477.bin,0,1 +9954226,827,assets/images/split/image478.bin,0,1 +9955053,809,assets/images/split/image479.bin,0,1 +9955862,973,assets/images/split/image480.bin,0,1 +9956835,321,assets/images/split/image481.bin,0,1 +9957156,1312,assets/images/split/image482.bin,0,1 +9958468,1139,assets/images/split/image483.bin,0,1 +9959607,1216,assets/images/split/image484.bin,0,1 +9960823,897,assets/images/split/image485.bin,0,1 +9961720,944,assets/images/split/image486.bin,0,1 +9962664,1010,assets/images/split/image487.bin,0,1 +9963674,1118,assets/images/split/image488.bin,0,1 +9964792,1168,assets/images/split/image489.bin,0,1 +9965960,937,assets/images/split/image490.bin,0,1 +9966897,923,assets/images/split/image491.bin,0,1 +9967820,866,assets/images/split/image492.bin,0,1 +9968686,680,assets/images/split/image493.bin,0,1 +9969366,1465,assets/images/split/image494.bin,0,1 +9970831,187,assets/images/split/image495.bin,0,1 +9971018,186,assets/images/split/image496.bin,0,1 +9971204,183,assets/images/split/image497.bin,0,1 +9971387,265,assets/images/split/image498.bin,0,1 +9971652,225,assets/images/split/image499.bin,0,1 +9971877,1182,assets/images/split/image500.bin,0,1 +9973059,1139,assets/images/split/image501.bin,0,1 +9974198,860,assets/images/split/image502.bin,0,1 +9975058,823,assets/images/split/image503.bin,0,1 +9975881,638,assets/images/split/image504.bin,0,1 +9976519,584,assets/images/split/image505.bin,0,1 +9977103,571,assets/images/split/image506.bin,0,1 +9977674,338,assets/images/split/image507.bin,0,1 +9978012,691,assets/images/split/image508.bin,0,1 +9978703,392,assets/images/split/image509.bin,0,1 +9979095,631,assets/images/split/image510.bin,0,1 +9979726,517,assets/images/split/image511.bin,0,1 +9980243,420,assets/images/split/image512.bin,0,1 +9980663,158,assets/images/split/image513.bin,0,1 +9980821,812,assets/images/split/image514.bin,0,1 +9981633,1199,assets/images/split/image515.bin,0,1 +9982832,266,assets/images/split/image516.bin,0,1 +9983098,312,assets/images/split/image517.bin,0,1 +9983410,319,assets/images/split/image518.bin,0,1 +9983729,1236,assets/images/split/image519.bin,0,1 +9984965,327,assets/images/split/image520.bin,0,1 +9985292,647,assets/images/split/image521.bin,0,1 +9985939,157,assets/images/split/image522.bin,0,1 +9986096,749,assets/images/split/image523.bin,0,1 +9986845,607,assets/images/split/image524.bin,0,1 +9987452,266,assets/images/split/image525.bin,0,1 +9987718,736,assets/images/split/image526.bin,0,1 +9988454,883,assets/images/split/image527.bin,0,1 +9989337,426,assets/images/split/image528.bin,0,1 +9989763,749,assets/images/split/image529.bin,0,1 +9990512,331,assets/images/split/image530.bin,0,1 +9990843,1156,assets/images/split/image531.bin,0,1 +9991999,746,assets/images/split/image532.bin,0,1 +9992745,69,assets/images/split/image533.bin,0,1 +9992814,484,assets/images/split/image534.bin,0,1 +9993298,964,assets/images/split/image535.bin,0,1 +9994262,1072,assets/images/split/image536.bin,0,1 +9995334,805,assets/images/split/image537.bin,0,1 +9996139,662,assets/images/split/image538.bin,0,1 +9996801,1175,assets/images/split/image539.bin,0,1 +9997976,828,assets/images/split/image540.bin,0,1 +9998804,687,assets/images/split/image541.bin,0,1 +9999491,249,assets/images/split/image542.bin,0,1 +9999740,1046,assets/images/split/image543.bin,0,1 +10000786,835,assets/images/split/image544.bin,0,1 +10001621,1516,assets/images/split/image545.bin,0,1 +10003137,1892,assets/images/split/image546.bin,0,1 +10005029,1902,assets/images/split/image547.bin,0,1 +10006931,1835,assets/images/split/image548.bin,0,1 +10008766,1068,assets/images/split/image549.bin,0,1 +10009834,968,assets/images/split/image550.bin,0,1 +10010802,1035,assets/images/split/image551.bin,0,1 +10011837,1767,assets/images/split/image552.bin,0,1 +10013604,1679,assets/images/split/image553.bin,0,1 +10015283,1538,assets/images/split/image554.bin,0,1 +10016821,1538,assets/images/split/image555.bin,0,1 +10018359,1525,assets/images/split/image556.bin,0,1 +10019884,1734,assets/images/split/image557.bin,0,1 +10021618,1529,assets/images/split/image558.bin,0,1 +10023147,1707,assets/images/split/image559.bin,0,1 +10024854,1896,assets/images/split/image560.bin,0,1 +10026750,1644,assets/images/split/image561.bin,0,1 +10028394,1581,assets/images/split/image562.bin,0,1 +10029975,1590,assets/images/split/image563.bin,0,1 +10031565,1537,assets/images/split/image564.bin,0,1 +10033102,1704,assets/images/split/image565.bin,0,1 +10034806,1695,assets/images/split/image566.bin,0,1 +10036501,1606,assets/images/split/image567.bin,0,1 +10038107,378,assets/images/split/image568.bin,0,1 +10038485,2029,assets/images/split/image569.bin,0,1 +10040514,1846,assets/images/split/image570.bin,0,1 +10042360,1903,assets/images/split/image571.bin,0,1 +10044263,2050,assets/images/split/image572.bin,0,1 +10046313,2028,assets/images/split/image573.bin,0,1 +10048341,1904,assets/images/split/image574.bin,0,1 +10050245,1793,assets/images/split/image575.bin,0,1 +10052038,2030,assets/images/split/image576.bin,0,1 +10054068,867,assets/images/split/image577.bin,0,1 +10054935,1214,assets/images/split/image578.bin,0,1 +10056149,1169,assets/images/split/image579.bin,0,1 +10057318,500,assets/images/split/image580.bin,0,1 +10057818,201,assets/images/split/image581.bin,0,1 +10058019,1534,assets/images/split/image582.bin,0,1 +10059553,1527,assets/images/split/image583.bin,0,1 +10061080,1548,assets/images/split/image584.bin,0,1 +10062628,1541,assets/images/split/image585.bin,0,1 +10064169,1039,assets/images/split/image586.bin,0,1 +10065208,1024,assets/images/split/image587.bin,0,1 +10066232,1122,assets/images/split/image588.bin,0,1 +10067354,1308,assets/images/split/image589.bin,0,1 +10068662,1245,assets/images/split/image590.bin,0,1 +10069907,1329,assets/images/split/image591.bin,0,1 +10071236,1196,assets/images/split/image592.bin,0,1 +10072432,1130,assets/images/split/image593.bin,0,1 +10073562,1427,assets/images/split/image594.bin,0,1 +10074989,891,assets/images/split/image595.bin,0,1 +10075880,1210,assets/images/split/image596.bin,0,1 +10077090,1422,assets/images/split/image597.bin,0,1 +10078512,433,assets/images/split/image598.bin,0,1 +10078945,1377,assets/images/split/image599.bin,0,1 +10080322,1619,assets/images/split/image600.bin,0,1 +10081941,1920,assets/images/split/image601.bin,0,1 +10083861,1617,assets/images/split/image602.bin,0,1 +10085478,481,assets/images/split/image603.bin,0,1 +10085959,1402,assets/images/split/image604.bin,0,1 +10087361,1317,assets/images/split/image605.bin,0,1 +10088678,1461,assets/images/split/image606.bin,0,1 +10090139,358,assets/images/split/image607.bin,0,1 +10090497,325,assets/images/split/image608.bin,0,1 +10090822,1694,assets/images/split/image609.bin,0,1 +10092516,2105,assets/images/split/image610.bin,0,1 +10094621,1404,assets/images/split/image611.bin,0,1 +10096025,2010,assets/images/split/image612.bin,0,1 +10098035,702,assets/images/split/image613.bin,0,1 +10098737,616,assets/images/split/image614.bin,0,1 +10099353,667,assets/images/split/image615.bin,0,1 +10100020,646,assets/images/split/image616.bin,0,1 +10100666,622,assets/images/split/image617.bin,0,1 +10101288,593,assets/images/split/image618.bin,0,1 +10101881,926,assets/images/split/image619.bin,0,1 +10102807,276,assets/images/split/image620.bin,0,1 +10103083,611,assets/images/split/image621.bin,0,1 +10103694,1432,assets/images/split/image622.bin,0,1 +10105126,1128,assets/images/split/image623.bin,0,1 +10106254,1146,assets/images/split/image624.bin,0,1 +10107400,293,assets/images/split/image625.bin,0,1 +10107693,446,assets/images/split/image626.bin,0,1 +10108139,267,assets/images/split/image627.bin,0,1 +10108406,328,assets/images/split/image628.bin,0,1 +10108734,320,assets/images/split/image629.bin,0,1 +10109054,328,assets/images/split/image630.bin,0,1 +10109382,1458,assets/images/split/image631.bin,0,1 +10110840,1000,assets/images/split/image632.bin,0,1 +10111840,621,assets/images/split/image633.bin,0,1 +10112461,961,assets/images/split/image634.bin,0,1 +10113422,973,assets/images/split/image635.bin,0,1 +10114395,85,assets/images/split/image636.bin,0,1 +10114480,612,assets/images/split/image637.bin,0,1 +10115092,870,assets/images/split/image638.bin,0,1 +10115962,447,assets/images/split/image639.bin,0,1 +10116409,1848,assets/images/split/image640.bin,0,1 +10118257,812,assets/images/split/image641.bin,0,1 +10119069,1363,assets/images/split/image642.bin,0,1 +10120432,908,assets/images/split/image643.bin,0,1 +10121340,301,assets/images/split/image644.bin,0,1 +10121641,726,assets/images/split/image645.bin,0,1 +10122367,445,assets/images/split/image646.bin,0,1 +10122812,1187,assets/images/split/image647.bin,0,1 +10123999,409,assets/images/split/image648.bin,0,1 +10124408,701,assets/images/split/image649.bin,0,1 +10125109,612,assets/images/split/image650.bin,0,1 +10125721,510,assets/images/split/image651.bin,0,1 +10126231,1260,assets/images/split/image652.bin,0,1 +10127491,620,assets/images/split/image653.bin,0,1 +10128111,587,assets/images/split/image654.bin,0,1 +10128698,837,assets/images/split/image655.bin,0,1 +10129535,889,assets/images/split/image656.bin,0,1 +10130424,164,assets/images/split/image657.bin,0,1 +10130588,171,assets/images/split/image658.bin,0,1 +10130759,85,assets/images/split/image659.bin,0,1 +10130844,1025,assets/images/split/image660.bin,0,1 +10131869,834,assets/images/split/image661.bin,0,1 +10132703,1241,assets/images/split/image662.bin,0,1 +10133944,1205,assets/images/split/image663.bin,0,1 +10135149,196,assets/images/split/image664.bin,0,1 +10135345,226,assets/images/split/image665.bin,0,1 +10135571,1511,assets/images/split/image666.bin,0,1 +10137082,1014,assets/images/split/image667.bin,0,1 +10138096,997,assets/images/split/image668.bin,0,1 +10139093,957,assets/images/split/image669.bin,0,1 +10140050,1084,assets/images/split/image670.bin,0,1 +10141134,841,assets/images/split/image671.bin,0,1 +10141975,1081,assets/images/split/image672.bin,0,1 +10143056,889,assets/images/split/image673.bin,0,1 +10143945,866,assets/images/split/image674.bin,0,1 +10144811,875,assets/images/split/image675.bin,0,1 +10145686,792,assets/images/split/image676.bin,0,1 +10146478,675,assets/images/split/image677.bin,0,1 +10147153,129,assets/images/split/image678.bin,0,1 +10147282,634,assets/images/split/image679.bin,0,1 +10147916,1258,assets/images/split/image680.bin,0,1 +10149174,1443,assets/images/split/image681.bin,0,1 +10150617,1408,assets/images/split/image682.bin,0,1 +10152025,1278,assets/images/split/image683.bin,0,1 +10153303,314,assets/images/split/image684.bin,0,1 +10153617,478,assets/images/split/image685.bin,0,1 +10154095,742,assets/images/split/image686.bin,0,1 +10154837,674,assets/images/split/image687.bin,0,1 +10155511,787,assets/images/split/image688.bin,0,1 +10156298,831,assets/images/split/image689.bin,0,1 +10157129,543,assets/images/split/image690.bin,0,1 +10157672,278,assets/images/split/image691.bin,0,1 +10157950,162,assets/images/split/image692.bin,0,1 +10158112,333,assets/images/split/image693.bin,0,1 +10158445,1101,assets/images/split/image694.bin,0,1 +10159546,593,assets/images/split/image695.bin,0,1 +10160139,508,assets/images/split/image696.bin,0,1 +10160647,529,assets/images/split/image697.bin,0,1 +10161176,452,assets/images/split/image698.bin,0,1 +10161628,388,assets/images/split/image699.bin,0,1 +10162016,543,assets/images/split/image700.bin,0,1 +10162559,343,assets/images/split/image701.bin,0,1 +10162902,828,assets/images/split/image702.bin,0,1 +10163730,138,assets/images/split/image703.bin,0,1 +10163868,525,assets/images/split/image704.bin,0,1 +10164393,520,assets/images/split/image705.bin,0,1 +10164913,884,assets/images/split/image706.bin,0,1 +10165797,662,assets/images/split/image707.bin,0,1 +10166459,498,assets/images/split/image708.bin,0,1 +10166957,351,assets/images/split/image709.bin,0,1 +10167308,1214,assets/images/split/image710.bin,0,1 +10168522,789,assets/images/split/image711.bin,0,1 +10169311,1242,assets/images/split/image712.bin,0,1 +10170553,589,assets/images/split/image713.bin,0,1 +10171142,1548,assets/images/split/image714.bin,0,1 +10172690,192,assets/images/split/image715.bin,0,1 +10172882,366,assets/images/split/image716.bin,0,1 +10173248,850,assets/images/split/image717.bin,0,1 +10174098,253,assets/images/split/image718.bin,0,1 +10174351,499,assets/images/split/image719.bin,0,1 +10174850,593,assets/images/split/image720.bin,0,1 +10175443,539,assets/images/split/image721.bin,0,1 +10175982,177,assets/images/split/image722.bin,0,1 +10176159,552,assets/images/split/image723.bin,0,1 +10176711,536,assets/images/split/image724.bin,0,1 +10177247,851,assets/images/split/image725.bin,0,1 +10178098,1062,assets/images/split/image726.bin,0,1 +10179160,453,assets/images/split/image727.bin,0,1 +10179613,921,assets/images/split/image728.bin,0,1 +10180534,1009,assets/images/split/image729.bin,0,1 +10181543,457,assets/images/split/image730.bin,0,1 +10182000,408,assets/images/split/image731.bin,0,1 +10182408,455,assets/images/split/image732.bin,0,1 +10182863,1335,assets/images/split/image733.bin,0,1 +10184198,1307,assets/images/split/image734.bin,0,1 +10185505,1187,assets/images/split/image735.bin,0,1 +10186692,1518,assets/images/split/image736.bin,0,1 +10188210,1496,assets/images/split/image737.bin,0,1 +10189706,1413,assets/images/split/image738.bin,0,1 +10191119,1346,assets/images/split/image739.bin,0,1 +10192465,1410,assets/images/split/image740.bin,0,1 +10193875,1097,assets/images/split/image741.bin,0,1 +10194972,1179,assets/images/split/image742.bin,0,1 +10196151,1389,assets/images/split/image743.bin,0,1 +10197540,1470,assets/images/split/image744.bin,0,1 +10199010,1499,assets/images/split/image745.bin,0,1 +10200509,1028,assets/images/split/image746.bin,0,1 +10201537,1278,assets/images/split/image747.bin,0,1 +10202815,1420,assets/images/split/image748.bin,0,1 +10204235,1379,assets/images/split/image749.bin,0,1 +10205614,1458,assets/images/split/image750.bin,0,1 +10207072,1403,assets/images/split/image751.bin,0,1 +10208475,1163,assets/images/split/image752.bin,0,1 +10209638,1198,assets/images/split/image753.bin,0,1 +10210836,1300,assets/images/split/image754.bin,0,1 +10212136,1436,assets/images/split/image755.bin,0,1 +10213572,1384,assets/images/split/image756.bin,0,1 +10214956,1466,assets/images/split/image757.bin,0,1 +10216422,1425,assets/images/split/image758.bin,0,1 +10217847,520,assets/images/split/image759.bin,0,1 +10218367,510,assets/images/split/image760.bin,0,1 +10218877,1285,assets/images/split/image761.bin,0,1 +10220162,927,assets/images/split/image762.bin,0,1 +10221089,178,assets/images/split/image763.bin,0,1 +10221267,167,assets/images/split/image764.bin,0,1 +10221434,103,assets/images/split/image765.bin,0,1 +10221537,1375,assets/images/split/image766.bin,0,1 +10222912,510,assets/images/split/image767.bin,0,1 +10223422,801,assets/images/split/image768.bin,0,1 +10224223,305,assets/images/split/image769.bin,0,1 +10224528,339,assets/images/split/image770.bin,0,1 +10224867,1154,assets/images/split/image771.bin,0,1 +10226021,1548,assets/images/split/image772.bin,0,1 +10227569,601,assets/images/split/image773.bin,0,1 +10228170,899,assets/images/split/image774.bin,0,1 +10229069,120,assets/images/split/image775.bin,0,1 +10229189,1228,assets/images/split/image776.bin,0,1 +10230417,1347,assets/images/split/image777.bin,0,1 +10231764,1468,assets/images/split/image778.bin,0,1 +10233232,881,assets/images/split/image779.bin,0,1 +10234113,1474,assets/images/split/image780.bin,0,1 +10235587,1250,assets/images/split/image781.bin,0,1 +10236837,1605,assets/images/split/image782.bin,0,1 +10238442,1339,assets/images/split/image783.bin,0,1 +10239781,1096,assets/images/split/image784.bin,0,1 +10240877,504,assets/images/split/image785.bin,0,1 +10241381,296,assets/images/split/image786.bin,0,1 +10241677,364,assets/images/split/image787.bin,0,1 +10242041,967,assets/images/split/image788.bin,0,1 +10243008,573,assets/images/split/image789.bin,0,1 +10243581,1580,assets/images/split/image790.bin,0,1 +10245161,1538,assets/images/split/image791.bin,0,1 +10246699,1503,assets/images/split/image792.bin,0,1 +10248202,1640,assets/images/split/image793.bin,0,1 +10249842,1656,assets/images/split/image794.bin,0,1 +10251498,1517,assets/images/split/image795.bin,0,1 +10253015,1600,assets/images/split/image796.bin,0,1 +10254615,624,assets/images/split/image797.bin,0,1 +10255239,588,assets/images/split/image798.bin,0,1 +10255827,612,assets/images/split/image799.bin,0,1 +10256439,225,assets/images/split/image800.bin,0,1 +10256664,152,assets/images/split/image801.bin,0,1 +10256816,451,assets/images/split/image802.bin,0,1 +10257267,671,assets/images/split/image803.bin,0,1 +10257938,415,assets/images/split/image804.bin,0,1 +10258353,464,assets/images/split/image805.bin,0,1 +10258817,783,assets/images/split/image806.bin,0,1 +10259600,987,assets/images/split/image807.bin,0,1 +10260587,325,assets/images/split/image808.bin,0,1 +10260912,665,assets/images/split/image809.bin,0,1 +10261577,1056,assets/images/split/image810.bin,0,1 +10262633,600,assets/images/split/image811.bin,0,1 +10263233,670,assets/images/split/image812.bin,0,1 +10263903,821,assets/images/split/image813.bin,0,1 +10264724,457,assets/images/split/image814.bin,0,1 +10265181,1145,assets/images/split/image815.bin,0,1 +10266326,479,assets/images/split/image816.bin,0,1 +10266805,729,assets/images/split/image817.bin,0,1 +10267534,1078,assets/images/split/image818.bin,0,1 +10268612,611,assets/images/split/image819.bin,0,1 +10269223,1539,assets/images/split/image820.bin,0,1 +10270762,1391,assets/images/split/image821.bin,0,1 +10272153,68,assets/images/split/image822.bin,0,1 +10272221,593,assets/images/split/image823.bin,0,1 +10272814,388,assets/images/split/image824.bin,0,1 +10273202,683,assets/images/split/image825.bin,0,1 +10273885,886,assets/images/split/image826.bin,0,1 +10274771,1109,assets/images/split/image827.bin,0,1 +10275880,1334,assets/images/split/image828.bin,0,1 +10277214,1256,assets/images/split/image829.bin,0,1 +10278470,1369,assets/images/split/image830.bin,0,1 +10279839,1401,assets/images/split/image831.bin,0,1 +10281240,1694,assets/images/split/image832.bin,0,1 +10282934,1882,assets/images/split/image833.bin,0,1 +10284816,1707,assets/images/split/image834.bin,0,1 +10286523,957,assets/images/split/image835.bin,0,1 +10287480,790,assets/images/split/image836.bin,0,1 +10288270,1236,assets/images/split/image837.bin,0,1 +10289506,590,assets/images/split/image838.bin,0,1 +10290096,1909,assets/images/split/image839.bin,0,1 +10292005,1962,assets/images/split/image840.bin,0,1 +10293967,1675,assets/images/split/image841.bin,0,1 +10295642,1677,assets/images/split/image842.bin,0,1 +10297319,1402,assets/images/split/image843.bin,0,1 +10298721,1393,assets/images/split/image844.bin,0,1 +10300114,762,assets/images/split/image845.bin,0,1 +10300876,1134,assets/images/split/image846.bin,0,1 +10302010,910,assets/images/split/image847.bin,0,1 +10302920,1187,assets/images/split/image848.bin,0,1 +10304107,183,assets/images/split/image849.bin,0,1 +10304290,1532,assets/images/split/image850.bin,0,1 +10305822,783,assets/images/split/image851.bin,0,1 +10306605,965,assets/images/split/image852.bin,0,1 +10307570,460,assets/images/split/image853.bin,0,1 +10308030,505,assets/images/split/image854.bin,0,1 +10308535,389,assets/images/split/image855.bin,0,1 +10308924,734,assets/images/split/image856.bin,0,1 +10309658,655,assets/images/split/image857.bin,0,1 +10310313,1106,assets/images/split/image858.bin,0,1 +10311419,795,assets/images/split/image859.bin,0,1 +10312214,1788,assets/images/split/image860.bin,0,1 +10314002,1802,assets/images/split/image861.bin,0,1 +10315804,529,assets/images/split/image862.bin,0,1 +10316333,728,assets/images/split/image863.bin,0,1 +10317061,447,assets/images/split/image864.bin,0,1 +10317508,557,assets/images/split/image865.bin,0,1 +10318065,403,assets/images/split/image866.bin,0,1 +10318468,1256,assets/images/split/image867.bin,0,1 +10319724,294,assets/images/split/image868.bin,0,1 +10320018,255,assets/images/split/image869.bin,0,1 +10320273,796,assets/images/split/image870.bin,0,1 +10321069,379,assets/images/split/image871.bin,0,1 +10321448,352,assets/images/split/image872.bin,0,1 +10321800,67,assets/images/split/image873.bin,0,1 +10321867,400,assets/images/split/image874.bin,0,1 +10322267,47,assets/images/split/image875.bin,0,1 +10322314,334,assets/images/split/image876.bin,0,1 +10322648,314,assets/images/split/image877.bin,0,1 +10322962,47,assets/images/split/image878.bin,0,1 +10323009,57,assets/images/split/image879.bin,0,1 +10323066,81,assets/images/split/image880.bin,0,1 +10323147,41,assets/images/split/image881.bin,0,1 +10323188,75,assets/images/split/image882.bin,0,1 +10323263,43,assets/images/split/image883.bin,0,1 +10323306,221,assets/images/split/image884.bin,0,1 +10323527,1792,assets/images/split/image885.bin,0,1 +10325319,584,assets/images/split/image886.bin,0,1 +10325903,335,assets/images/split/image887.bin,0,1 +10326238,364,assets/images/split/image888.bin,0,1 +10326602,1016,assets/images/split/image889.bin,0,1 +10327618,688,assets/images/split/image890.bin,0,1 +10328306,447,assets/images/split/image891.bin,0,1 +10328753,944,assets/images/split/image892.bin,0,1 +10329697,1001,assets/images/split/image893.bin,0,1 +10330698,976,assets/images/split/image894.bin,0,1 +10331674,882,assets/images/split/image895.bin,0,1 +10332556,1490,assets/images/split/image896.bin,0,1 +10334046,1809,assets/images/split/image897.bin,0,1 +10335855,1650,assets/images/split/image898.bin,0,1 +10337505,1226,assets/images/split/image899.bin,0,1 +10338731,1002,assets/images/split/image900.bin,0,1 +10339733,551,assets/images/split/image901.bin,0,1 +10340284,958,assets/images/split/image902.bin,0,1 +10341242,852,assets/images/split/image903.bin,0,1 +10342094,854,assets/images/split/image904.bin,0,1 +10342948,949,assets/images/split/image905.bin,0,1 +10343897,1053,assets/images/split/image906.bin,0,1 +10344950,697,assets/images/split/image907.bin,0,1 +10345647,429,assets/images/split/image908.bin,0,1 +10346076,1299,assets/images/split/image909.bin,0,1 +10347375,1220,assets/images/split/image910.bin,0,1 +10348595,1135,assets/images/split/image911.bin,0,1 +10349730,1245,assets/images/split/image912.bin,0,1 +10350975,1627,assets/images/split/image913.bin,0,1 +10352602,919,assets/images/split/image914.bin,0,1 +10353521,751,assets/images/split/image915.bin,0,1 +10354272,790,assets/images/split/image916.bin,0,1 +10355062,790,assets/images/split/image917.bin,0,1 +10355852,152,assets/images/split/image918.bin,0,1 +10356004,424,assets/images/split/image919.bin,0,1 +10356428,630,assets/images/split/image920.bin,0,1 +10357058,1945,assets/images/split/image921.bin,0,1 +10359003,668,assets/images/split/image922.bin,0,1 +10359671,912,assets/images/split/image923.bin,0,1 +10360583,954,assets/images/split/image924.bin,0,1 +10361537,2214,assets/images/split/image925.bin,0,1 +10363751,830,assets/images/split/image926.bin,0,1 +10364581,1548,assets/images/split/image927.bin,0,1 +10366129,1616,assets/images/split/image928.bin,0,1 +10367745,567,assets/images/split/image929.bin,0,1 +10368312,860,assets/images/split/image930.bin,0,1 +10369172,787,assets/images/split/image931.bin,0,1 +10369959,478,assets/images/split/image932.bin,0,1 +10370437,445,assets/images/split/image933.bin,0,1 +10370882,617,assets/images/split/image934.bin,0,1 +10371499,336,assets/images/split/image935.bin,0,1 +10371835,1078,assets/images/split/image936.bin,0,1 +10372913,358,assets/images/split/image937.bin,0,1 +10373271,397,assets/images/split/image938.bin,0,1 +10373668,513,assets/images/split/image939.bin,0,1 +10374181,1056,assets/images/split/image940.bin,0,1 +10375237,726,assets/images/split/image941.bin,0,1 +10375963,730,assets/images/split/image942.bin,0,1 +10376693,815,assets/images/split/image943.bin,0,1 +10377508,697,assets/images/split/image944.bin,0,1 +10378205,669,assets/images/split/image945.bin,0,1 +10378874,506,assets/images/split/image946.bin,0,1 +10379380,639,assets/images/split/image947.bin,0,1 +10380019,241,assets/images/split/image948.bin,0,1 +10380260,1511,assets/images/split/image949.bin,0,1 +10381771,1649,assets/images/split/image950.bin,0,1 +10383420,1323,assets/images/split/image951.bin,0,1 +10384743,2168,assets/images/split/image952.bin,0,1 +10386911,1945,assets/images/split/image953.bin,0,1 +10388856,1508,assets/images/split/image954.bin,0,1 +10390364,1544,assets/images/split/image955.bin,0,1 +10391908,1384,assets/images/split/image956.bin,0,1 +10393292,1473,assets/images/split/image957.bin,0,1 +10394765,1509,assets/images/split/image958.bin,0,1 +10396274,1908,assets/images/split/image959.bin,0,1 +10398182,647,assets/images/split/image960.bin,0,1 +10398829,647,assets/images/split/image961.bin,0,1 +10399476,1888,assets/images/split/image962.bin,0,1 +10401364,2122,assets/images/split/image963.bin,0,1 +10403486,2157,assets/images/split/image964.bin,0,1 +10405643,2153,assets/images/split/image965.bin,0,1 +10407796,2110,assets/images/split/image966.bin,0,1 +10409906,2097,assets/images/split/image967.bin,0,1 +10412003,2126,assets/images/split/image968.bin,0,1 +10414129,2080,assets/images/split/image969.bin,0,1 +10416209,645,assets/images/split/image970.bin,0,1 +10416854,753,assets/images/split/image971.bin,0,1 +10417607,1227,assets/images/split/image972.bin,0,1 +10418834,2175,assets/images/split/image973.bin,0,1 +10421009,2221,assets/images/split/image974.bin,0,1 +10423230,2175,assets/images/split/image975.bin,0,1 +10425405,2175,assets/images/split/image976.bin,0,1 +10427580,2210,assets/images/split/image977.bin,0,1 +10429790,2175,assets/images/split/image978.bin,0,1 +10431965,2330,assets/images/split/image979.bin,0,1 +10434295,601,assets/images/split/image980.bin,0,1 +10434896,1654,assets/images/split/image981.bin,0,1 +10436550,1654,assets/images/split/image982.bin,0,1 +10438204,74,assets/images/split/image983.bin,0,1 +10438278,880,assets/images/split/image984.bin,0,1 +10439158,775,assets/images/split/image985.bin,0,1 +10439933,785,assets/images/split/image986.bin,0,1 +10440718,1306,assets/images/split/image987.bin,0,1 +10442024,410,assets/images/split/image988.bin,0,1 +10442434,17,assets/images/split/image989.bin,0,1 +10442451,297,assets/images/split/image990.bin,0,1 +10442748,322,assets/images/split/image991.bin,0,1 +10443070,401,assets/images/split/image992.bin,0,1 +10443471,384,assets/images/split/image993.bin,0,1 +10443855,316,assets/images/split/image994.bin,0,1 +10444171,354,assets/images/split/image995.bin,0,1 +10444525,294,assets/images/split/image996.bin,0,1 +10444819,373,assets/images/split/image997.bin,0,1 +10445192,862,assets/images/split/image998.bin,0,1 +10446054,562,assets/images/split/image999.bin,0,1 +10446616,1290,assets/images/split/image1000.bin,0,1 +10447906,1036,assets/images/split/image1001.bin,0,1 +10448942,969,assets/images/split/image1002.bin,0,1 +10449911,1232,assets/images/split/image1003.bin,0,1 +10451143,1261,assets/images/split/image1004.bin,0,1 +10452404,615,assets/images/split/image1005.bin,0,1 +10453019,826,assets/images/split/image1006.bin,0,1 +10453845,240,assets/images/split/image1007.bin,0,1 +10454085,1169,assets/images/split/image1008.bin,0,1 +10455254,653,assets/images/split/image1009.bin,0,1 +10455907,434,assets/images/split/image1010.bin,0,1 +10456341,1554,assets/images/split/image1011.bin,0,1 +10457895,1822,assets/images/split/image1012.bin,0,1 +10459717,409,assets/images/split/image1013.bin,0,1 +10460126,1709,assets/images/split/image1014.bin,0,1 +10461835,499,assets/images/split/image1015.bin,0,1 +10462334,905,assets/images/split/image1016.bin,0,1 +10463239,871,assets/images/split/image1017.bin,0,1 +10464110,767,assets/images/split/image1018.bin,0,1 +10464877,889,assets/images/split/image1019.bin,0,1 +10465766,1166,assets/images/split/image1020.bin,0,1 +10466932,1311,assets/images/split/image1021.bin,0,1 +10468243,1349,assets/images/split/image1022.bin,0,1 +10469592,778,assets/images/split/image1023.bin,0,1 +10470370,947,assets/images/split/image1024.bin,0,1 +10471317,1142,assets/images/split/image1025.bin,0,1 +10472459,554,assets/images/split/image1026.bin,0,1 +10473013,150,assets/images/split/image1027.bin,0,1 +10473163,817,assets/images/split/image1028.bin,0,1 +10473980,1103,assets/images/split/image1029.bin,0,1 +10475083,817,assets/images/split/image1030.bin,0,1 +10475900,835,assets/images/split/image1031.bin,0,1 +10476735,173,assets/images/split/image1032.bin,0,1 +10476908,1490,assets/images/split/image1033.bin,0,1 +10478398,1160,assets/images/split/image1034.bin,0,1 +10479558,1143,assets/images/split/image1035.bin,0,1 +10480701,1235,assets/images/split/image1036.bin,0,1 +10481936,1562,assets/images/split/image1037.bin,0,1 +10483498,1167,assets/images/split/image1038.bin,0,1 +10484665,1275,assets/images/split/image1039.bin,0,1 +10485940,1339,assets/images/split/image1040.bin,0,1 +10487279,1696,assets/images/split/image1041.bin,0,1 +10488975,530,assets/images/split/image1042.bin,0,1 +10489505,743,assets/images/split/image1043.bin,0,1 +10490248,677,assets/images/split/image1044.bin,0,1 +10490925,580,assets/images/split/image1045.bin,0,1 +10491505,304,assets/images/split/image1046.bin,0,1 +10491809,348,assets/images/split/image1047.bin,0,1 +10492157,860,assets/images/split/image1048.bin,0,1 +10493017,1654,assets/images/split/image1049.bin,0,1 +10494671,717,assets/images/split/image1050.bin,0,1 +10495388,1902,assets/images/split/image1051.bin,0,1 +10497290,1827,assets/images/split/image1052.bin,0,1 +10499117,1970,assets/images/split/image1053.bin,0,1 +10501087,1555,assets/images/split/image1054.bin,0,1 +10502642,552,assets/images/split/image1055.bin,0,1 +10503194,1490,assets/images/split/image1056.bin,0,1 +10504684,519,assets/images/split/image1057.bin,0,1 +10505203,1438,assets/images/split/image1058.bin,0,1 +10506641,408,assets/images/split/image1059.bin,0,1 +10507049,1356,assets/images/split/image1060.bin,0,1 +10508405,1294,assets/images/split/image1061.bin,0,1 +10509699,483,assets/images/split/image1062.bin,0,1 +10510182,1316,assets/images/split/image1063.bin,0,1 +10511498,982,assets/images/split/image1064.bin,0,1 +10512480,658,assets/images/split/image1065.bin,0,1 +10513138,365,assets/images/split/image1066.bin,0,1 +10513503,965,assets/images/split/image1067.bin,0,1 +10514468,1467,assets/images/split/image1068.bin,0,1 +10515935,1338,assets/images/split/image1069.bin,0,1 +10517273,1443,assets/images/split/image1070.bin,0,1 +10518716,1818,assets/images/split/image1071.bin,0,1 +10520534,1034,assets/images/split/image1072.bin,0,1 +10521568,1761,assets/images/split/image1073.bin,0,1 +10523329,1827,assets/images/split/image1074.bin,0,1 +10525156,1150,assets/images/split/image1075.bin,0,1 +10526306,640,assets/images/split/image1076.bin,0,1 +10526946,899,assets/images/split/image1077.bin,0,1 +10527845,740,assets/images/split/image1078.bin,0,1 +10528585,320,assets/images/split/image1079.bin,0,1 +10528905,230,assets/images/split/image1080.bin,0,1 +10529135,1514,assets/images/split/image1081.bin,0,1 +10530649,1224,assets/images/split/image1082.bin,0,1 +10531873,1295,assets/images/split/image1083.bin,0,1 +10533168,228,assets/images/split/image1084.bin,0,1 +10533396,72,assets/images/split/image1085.bin,0,1 +10533468,1452,assets/images/split/image1086.bin,0,1 +10534920,539,assets/images/split/image1087.bin,0,1 +10535459,863,assets/images/split/image1088.bin,0,1 +10536322,518,assets/images/split/image1089.bin,0,1 +10536840,363,assets/images/split/image1090.bin,0,1 +10537203,1131,assets/images/split/image1091.bin,0,1 +10538334,1343,assets/images/split/image1092.bin,0,1 +10539677,1002,assets/images/split/image1093.bin,0,1 +10540679,1003,assets/images/split/image1094.bin,0,1 +10541682,1307,assets/images/split/image1095.bin,0,1 +10542989,1162,assets/images/split/image1096.bin,0,1 +10544151,1224,assets/images/split/image1097.bin,0,1 +10545375,1110,assets/images/split/image1098.bin,0,1 +10546485,902,assets/images/split/image1099.bin,0,1 +10547387,1264,assets/images/split/image1100.bin,0,1 +10548651,1366,assets/images/split/image1101.bin,0,1 +10550017,1331,assets/images/split/image1102.bin,0,1 +10551348,1002,assets/images/split/image1103.bin,0,1 +10552350,1256,assets/images/split/image1104.bin,0,1 +10553606,1358,assets/images/split/image1105.bin,0,1 +10554964,1304,assets/images/split/image1106.bin,0,1 +10556268,1183,assets/images/split/image1107.bin,0,1 +10557451,1354,assets/images/split/image1108.bin,0,1 +10558805,1335,assets/images/split/image1109.bin,0,1 +10560140,1333,assets/images/split/image1110.bin,0,1 +10561473,998,assets/images/split/image1111.bin,0,1 +10562471,1200,assets/images/split/image1112.bin,0,1 +10563671,1325,assets/images/split/image1113.bin,0,1 +10564996,1333,assets/images/split/image1114.bin,0,1 +10566329,1132,assets/images/split/image1115.bin,0,1 +10567461,1242,assets/images/split/image1116.bin,0,1 +10568703,1029,assets/images/split/image1117.bin,0,1 +10569732,1281,assets/images/split/image1118.bin,0,1 +10571013,1413,assets/images/split/image1119.bin,0,1 +10572426,698,assets/images/split/image1120.bin,0,1 +10573124,672,assets/images/split/image1121.bin,0,1 +10573796,796,assets/images/split/image1122.bin,0,1 +10574592,412,assets/images/split/image1123.bin,0,1 +10575004,216,assets/images/split/image1124.bin,0,1 +10575220,1832,assets/images/split/image1125.bin,0,1 +10577052,1197,assets/images/split/image1126.bin,0,1 +10578249,805,assets/images/split/image1127.bin,0,1 +10579054,1260,assets/images/split/image1128.bin,0,1 +10580314,2049,assets/images/split/image1129.bin,0,1 +10582363,2019,assets/images/split/image1130.bin,0,1 +10584382,1623,assets/images/split/image1131.bin,0,1 +10586005,1074,assets/images/split/image1132.bin,0,1 +10587079,2474,assets/images/split/image1133.bin,0,1 +10589553,895,assets/images/split/image1134.bin,0,1 +10590448,1246,assets/images/split/image1135.bin,0,1 +10591694,1451,assets/images/split/image1136.bin,0,1 +10593145,1548,assets/images/split/image1137.bin,0,1 +10594693,666,assets/images/split/image1138.bin,0,1 +10595359,318,assets/images/split/image1139.bin,0,1 +10595677,489,assets/images/split/image1140.bin,0,1 +10596166,955,assets/images/split/image1141.bin,0,1 +10597121,1086,assets/images/split/image1142.bin,0,1 +10598207,1061,assets/images/split/image1143.bin,0,1 +10599268,688,assets/images/split/image1144.bin,0,1 +10599956,213,assets/images/split/image1145.bin,0,1 +10600169,335,assets/images/split/image1146.bin,0,1 +10600504,297,assets/images/split/image1147.bin,0,1 +10600801,848,assets/images/split/image1148.bin,0,1 +10601649,828,assets/images/split/image1149.bin,0,1 +10602477,852,assets/images/split/image1150.bin,0,1 +10603329,401,assets/images/split/image1151.bin,0,1 +10603730,1226,assets/images/split/image1152.bin,0,1 +10604956,803,assets/images/split/image1153.bin,0,1 +10605759,903,assets/images/split/image1154.bin,0,1 +10606662,1948,assets/images/split/image1155.bin,0,1 +10608610,1798,assets/images/split/image1156.bin,0,1 +10610408,720,assets/images/split/image1157.bin,0,1 +10611128,762,assets/images/split/image1158.bin,0,1 +10611890,1176,assets/images/split/image1159.bin,0,1 +10613066,1183,assets/images/split/image1160.bin,0,1 +10614249,775,assets/images/split/image1161.bin,0,1 +10615024,1353,assets/images/split/image1162.bin,0,1 +10616377,1253,assets/images/split/image1163.bin,0,1 +10617630,1006,assets/images/split/image1164.bin,0,1 +10618636,1031,assets/images/split/image1165.bin,0,1 +10619667,1507,assets/images/split/image1166.bin,0,1 +10621174,1345,assets/images/split/image1167.bin,0,1 +10622519,1331,assets/images/split/image1168.bin,0,1 +10623850,1081,assets/images/split/image1169.bin,0,1 +10624931,1520,assets/images/split/image1170.bin,0,1 +10626451,1457,assets/images/split/image1171.bin,0,1 +10627908,884,assets/images/split/image1172.bin,0,1 +10628792,37,assets/images/split/image1173.bin,0,1 +10628829,676,assets/images/split/image1174.bin,0,1 +10629505,576,assets/images/split/image1175.bin,0,1 +10630081,527,assets/images/split/image1176.bin,0,1 +10630608,873,assets/images/split/image1177.bin,0,1 +10631481,551,assets/images/split/image1178.bin,0,1 +10632032,289,assets/images/split/image1179.bin,0,1 +10632321,617,assets/images/split/image1180.bin,0,1 +10632938,473,assets/images/split/image1181.bin,0,1 +10633411,586,assets/images/split/image1182.bin,0,1 +10633997,539,assets/images/split/image1183.bin,0,1 +10634536,1142,assets/images/split/image1184.bin,0,1 +10635678,1713,assets/images/split/image1185.bin,0,1 +10637391,1382,assets/images/split/image1186.bin,0,1 +10638773,1448,assets/images/split/image1187.bin,0,1 +10640221,1343,assets/images/split/image1188.bin,0,1 +10641564,94,assets/images/split/image1189.bin,0,1 +10641658,746,assets/images/split/image1190.bin,0,1 +10642404,958,assets/images/split/image1191.bin,0,1 +10643362,341,assets/images/split/image1192.bin,0,1 +10643703,198,assets/images/split/image1193.bin,0,1 +10643901,834,assets/images/split/image1194.bin,0,1 +10644735,982,assets/images/split/image1195.bin,0,1 +10645717,809,assets/images/split/image1196.bin,0,1 +10646526,1998,assets/images/split/image1197.bin,0,1 +10648524,1492,assets/images/split/image1198.bin,0,1 +10650016,1569,assets/images/split/image1199.bin,0,1 +10651585,2035,assets/images/split/image1200.bin,0,1 +10653620,1902,assets/images/split/image1201.bin,0,1 +10655522,1964,assets/images/split/image1202.bin,0,1 +10657486,483,assets/images/split/image1203.bin,0,1 +10657969,652,assets/images/split/image1204.bin,0,1 +10658621,722,assets/images/split/image1205.bin,0,1 +10659343,952,assets/images/split/image1206.bin,0,1 +10660295,1348,assets/images/split/image1207.bin,0,1 +10661643,1226,assets/images/split/image1208.bin,0,1 +10662869,1318,assets/images/split/image1209.bin,0,1 +10664187,1397,assets/images/split/image1210.bin,0,1 +10665584,1211,assets/images/split/image1211.bin,0,1 +10666795,1397,assets/images/split/image1212.bin,0,1 +10668192,1490,assets/images/split/image1213.bin,0,1 +10669682,1439,assets/images/split/image1214.bin,0,1 +10671121,317,assets/images/split/image1215.bin,0,1 +10671438,1764,assets/images/split/image1216.bin,0,1 +10673202,1661,assets/images/split/image1217.bin,0,1 +10674863,745,assets/images/split/image1218.bin,0,1 +10675608,883,assets/images/split/image1219.bin,0,1 +10676491,354,assets/images/split/image1220.bin,0,1 +10676845,273,assets/images/split/image1221.bin,0,1 +10677118,195,assets/images/split/image1222.bin,0,1 +10677313,542,assets/images/split/image1223.bin,0,1 +10677855,1082,assets/images/split/image1224.bin,0,1 +10678937,1357,assets/images/split/image1225.bin,0,1 +10680294,653,assets/images/split/image1226.bin,0,1 +10680947,963,assets/images/split/image1227.bin,0,1 +10681910,961,assets/images/split/image1228.bin,0,1 +10682871,940,assets/images/split/image1229.bin,0,1 +10683811,1438,assets/images/split/image1230.bin,0,1 +10685249,841,assets/images/split/image1231.bin,0,1 +10686090,984,assets/images/split/image1232.bin,0,1 +10687074,1107,assets/images/split/image1233.bin,0,1 +10688181,1055,assets/images/split/image1234.bin,0,1 +10689236,1711,assets/images/split/image1235.bin,0,1 +10690947,925,assets/images/split/image1236.bin,0,1 +10691872,768,assets/images/split/image1237.bin,0,1 +10692640,994,assets/images/split/image1238.bin,0,1 +10693634,907,assets/images/split/image1239.bin,0,1 +10694541,810,assets/images/split/image1240.bin,0,1 +10695351,1038,assets/images/split/image1241.bin,0,1 +10696389,819,assets/images/split/image1242.bin,0,1 +10697208,709,assets/images/split/image1243.bin,0,1 +10697917,613,assets/images/split/image1244.bin,0,1 +10698530,876,assets/images/split/image1245.bin,0,1 +10699406,1342,assets/images/split/image1246.bin,0,1 +10700748,1200,assets/images/split/image1247.bin,0,1 +10701948,408,assets/images/split/image1248.bin,0,1 +10702356,1257,assets/images/split/image1249.bin,0,1 +10703613,668,assets/images/split/image1250.bin,0,1 +10704281,739,assets/images/split/image1251.bin,0,1 +10705020,729,assets/images/split/image1252.bin,0,1 +10705749,630,assets/images/split/image1253.bin,0,1 +10706379,739,assets/images/split/image1254.bin,0,1 +10707118,939,assets/images/split/image1255.bin,0,1 +10708057,585,assets/images/split/image1256.bin,0,1 +10708642,218,assets/images/split/image1257.bin,0,1 +10708860,887,assets/images/split/image1258.bin,0,1 +10709747,1351,assets/images/split/image1259.bin,0,1 +10711098,999,assets/images/split/image1260.bin,0,1 +10712097,771,assets/images/split/image1261.bin,0,1 +10712868,498,assets/images/split/image1262.bin,0,1 +10713366,296,assets/images/split/image1263.bin,0,1 +10713662,434,assets/images/split/image1264.bin,0,1 +10714096,260,assets/images/split/image1265.bin,0,1 +10714356,1188,assets/images/split/image1266.bin,0,1 +10715544,830,assets/images/split/image1267.bin,0,1 +10716374,1356,assets/images/split/image1268.bin,0,1 +10717730,1121,assets/images/split/image1269.bin,0,1 +10718851,761,assets/images/split/image1270.bin,0,1 +10719612,1357,assets/images/split/image1271.bin,0,1 +10720969,481,assets/images/split/image1272.bin,0,1 +10721450,551,assets/images/split/image1273.bin,0,1 +10722001,501,assets/images/split/image1274.bin,0,1 +10722502,830,assets/images/split/image1275.bin,0,1 +10723332,726,assets/images/split/image1276.bin,0,1 +10724058,417,assets/images/split/image1277.bin,0,1 +10724475,203,assets/images/split/image1278.bin,0,1 +10724678,1264,assets/images/split/image1279.bin,0,1 +10725942,403,assets/images/split/image1280.bin,0,1 +10726345,880,assets/images/split/image1281.bin,0,1 +10727225,942,assets/images/split/image1282.bin,0,1 +10728167,1048,assets/images/split/image1283.bin,0,1 +10729215,439,assets/images/split/image1284.bin,0,1 +10729654,664,assets/images/split/image1285.bin,0,1 +10730318,2068,assets/images/split/image1286.bin,0,1 +10732386,2058,assets/images/split/image1287.bin,0,1 +10734444,2068,assets/images/split/image1288.bin,0,1 +10736512,2058,assets/images/split/image1289.bin,0,1 +10738570,1548,assets/images/split/image1290.bin,0,1 +10740118,1085,assets/images/split/image1291.bin,0,1 +10741203,1537,assets/images/split/image1292.bin,0,1 +10742740,1548,assets/images/split/image1293.bin,0,1 +10744288,1436,assets/images/split/image1294.bin,0,1 +10745724,1519,assets/images/split/image1295.bin,0,1 +10747243,1518,assets/images/split/image1296.bin,0,1 +10748761,1548,assets/images/split/image1297.bin,0,1 +10750309,1548,assets/images/split/image1298.bin,0,1 +10751857,1185,assets/images/split/image1299.bin,0,1 +10753042,1262,assets/images/split/image1300.bin,0,1 +10754304,1504,assets/images/split/image1301.bin,0,1 +10755808,1548,assets/images/split/image1302.bin,0,1 +10757356,1548,assets/images/split/image1303.bin,0,1 +10758904,1548,assets/images/split/image1304.bin,0,1 +10760452,2068,assets/images/split/image1305.bin,0,1 +10762520,2058,assets/images/split/image1306.bin,0,1 +10764578,2058,assets/images/split/image1307.bin,0,1 +10766636,2058,assets/images/split/image1308.bin,0,1 +10768694,1529,assets/images/split/image1309.bin,0,1 +10770223,1548,assets/images/split/image1310.bin,0,1 +10771771,2022,assets/images/split/image1311.bin,0,1 +10773793,2028,assets/images/split/image1312.bin,0,1 +10775821,2043,assets/images/split/image1313.bin,0,1 +10777864,2058,assets/images/split/image1314.bin,0,1 +10779922,2060,assets/images/split/image1315.bin,0,1 +10781982,2058,assets/images/split/image1316.bin,0,1 +10784040,2058,assets/images/split/image1317.bin,0,1 +10786098,2053,assets/images/split/image1318.bin,0,1 +10788151,1513,assets/images/split/image1319.bin,0,1 +10789664,1493,assets/images/split/image1320.bin,0,1 +10791157,1513,assets/images/split/image1321.bin,0,1 +10792670,1106,assets/images/split/image1322.bin,0,1 +10793776,1548,assets/images/split/image1323.bin,0,1 +10795324,1548,assets/images/split/image1324.bin,0,1 +10796872,2068,assets/images/split/image1325.bin,0,1 +10798940,2068,assets/images/split/image1326.bin,0,1 +10801008,2058,assets/images/split/image1327.bin,0,1 +10803066,2056,assets/images/split/image1328.bin,0,1 +10805122,2058,assets/images/split/image1329.bin,0,1 +10807180,2058,assets/images/split/image1330.bin,0,1 +10809238,2058,assets/images/split/image1331.bin,0,1 +10811296,2058,assets/images/split/image1332.bin,0,1 +10813354,1178,assets/images/split/image1333.bin,0,1 +10814532,1515,assets/images/split/image1334.bin,0,1 +10816047,1335,assets/images/split/image1335.bin,0,1 +10817382,1545,assets/images/split/image1336.bin,0,1 +10818927,1517,assets/images/split/image1337.bin,0,1 +10820444,1286,assets/images/split/image1338.bin,0,1 +10821730,899,assets/images/split/image1339.bin,0,1 +10822629,1269,assets/images/split/image1340.bin,0,1 +10823898,2068,assets/images/split/image1341.bin,0,1 +10825966,2068,assets/images/split/image1342.bin,0,1 +10828034,2058,assets/images/split/image1343.bin,0,1 +10830092,2058,assets/images/split/image1344.bin,0,1 +10832150,2058,assets/images/split/image1345.bin,0,1 +10834208,2058,assets/images/split/image1346.bin,0,1 +10836266,2058,assets/images/split/image1347.bin,0,1 +10838324,2058,assets/images/split/image1348.bin,0,1 +10840382,2068,assets/images/split/image1349.bin,0,1 +10842450,2068,assets/images/split/image1350.bin,0,1 +10844518,2058,assets/images/split/image1351.bin,0,1 +10846576,2058,assets/images/split/image1352.bin,0,1 +10848634,2058,assets/images/split/image1353.bin,0,1 +10850692,2058,assets/images/split/image1354.bin,0,1 +10852750,2058,assets/images/split/image1355.bin,0,1 +10854808,2058,assets/images/split/image1356.bin,0,1 +10856866,789,assets/images/split/image1357.bin,0,1 +10857655,643,assets/images/split/image1358.bin,0,1 +10858298,646,assets/images/split/image1359.bin,0,1 +10858944,1158,assets/images/split/image1360.bin,0,1 +10860102,1526,assets/images/split/image1361.bin,0,1 +10861628,1548,assets/images/split/image1362.bin,0,1 +10863176,1545,assets/images/split/image1363.bin,0,1 +10864721,1223,assets/images/split/image1364.bin,0,1 +10865944,830,assets/images/split/image1365.bin,0,1 +10866774,1063,assets/images/split/image1366.bin,0,1 +10867837,474,assets/images/split/image1367.bin,0,1 +10868311,1555,assets/images/split/image1368.bin,0,1 +10869866,1218,assets/images/split/image1369.bin,0,1 +10871084,1251,assets/images/split/image1370.bin,0,1 +10872335,1107,assets/images/split/image1371.bin,0,1 +10873442,1147,assets/images/split/image1372.bin,0,1 +10874589,636,assets/images/split/image1373.bin,0,1 +10875225,807,assets/images/split/image1374.bin,0,1 +10876032,737,assets/images/split/image1375.bin,0,1 +10876769,823,assets/images/split/image1376.bin,0,1 +10877592,590,assets/images/split/image1377.bin,0,1 +10878182,496,assets/images/split/image1378.bin,0,1 +10878678,819,assets/images/split/image1379.bin,0,1 +10879497,210,assets/images/split/image1380.bin,0,1 +10879707,1211,assets/images/split/image1381.bin,0,1 +10880918,40,assets/images/split/image1382.bin,0,1 +10880958,38,assets/images/split/image1383.bin,0,1 +10880996,826,assets/images/split/image1384.bin,0,1 +10881822,633,assets/images/split/image1385.bin,0,1 +10882455,1538,assets/images/split/image1386.bin,0,1 +10883993,787,assets/images/split/image1387.bin,0,1 +10884780,787,assets/images/split/image1388.bin,0,1 +10885567,1349,assets/images/split/image1389.bin,0,1 +10886916,1023,assets/images/split/image1390.bin,0,1 +10887939,1122,assets/images/split/image1391.bin,0,1 +10889061,1021,assets/images/split/image1392.bin,0,1 +10890082,399,assets/images/split/image1393.bin,0,1 +10890481,590,assets/images/split/image1394.bin,0,1 +10891071,940,assets/images/split/image1395.bin,0,1 +10892011,1423,assets/images/split/image1396.bin,0,1 +10893434,1374,assets/images/split/image1397.bin,0,1 +10894808,1047,assets/images/split/image1398.bin,0,1 +10895855,1222,assets/images/split/image1399.bin,0,1 +10897077,1413,assets/images/split/image1400.bin,0,1 +10898490,1126,assets/images/split/image1401.bin,0,1 +10899616,2383,assets/images/split/image1402.bin,0,1 +10901999,2288,assets/images/split/image1403.bin,0,1 +10904287,2305,assets/images/split/image1404.bin,0,1 +10906592,2349,assets/images/split/image1405.bin,0,1 +10908941,2368,assets/images/split/image1406.bin,0,1 +10911309,2313,assets/images/split/image1407.bin,0,1 +10913622,2368,assets/images/split/image1408.bin,0,1 +10915990,2289,assets/images/split/image1409.bin,0,1 +10918279,452,assets/images/split/image1410.bin,0,1 +10918731,371,assets/images/split/image1411.bin,0,1 +10919102,341,assets/images/split/image1412.bin,0,1 +10919443,785,assets/images/split/image1413.bin,0,1 +10920228,658,assets/images/split/image1414.bin,0,1 +10920886,555,assets/images/split/image1415.bin,0,1 +10921441,509,assets/images/split/image1416.bin,0,1 +10921950,461,assets/images/split/image1417.bin,0,1 +10922411,515,assets/images/split/image1418.bin,0,1 +10922926,642,assets/images/split/image1419.bin,0,1 +10923568,590,assets/images/split/image1420.bin,0,1 +10924158,479,assets/images/split/image1421.bin,0,1 +10924637,532,assets/images/split/image1422.bin,0,1 +10925169,1047,assets/images/split/image1423.bin,0,1 +10926216,500,assets/images/split/image1424.bin,0,1 +10926716,1505,assets/images/split/image1425.bin,0,1 +10928221,93,assets/images/split/image1426.bin,0,1 +10928314,1366,assets/images/split/image1427.bin,0,1 +10929680,353,assets/images/split/image1428.bin,0,1 +10930033,345,assets/images/split/image1429.bin,0,1 +10930378,1215,assets/images/split/image1430.bin,0,1 +10931593,643,assets/images/split/image1431.bin,0,1 +10932236,814,assets/images/split/image1432.bin,0,1 +10933050,308,assets/images/split/image1433.bin,0,1 +10933358,590,assets/images/split/image1434.bin,0,1 +10933948,278,assets/images/split/image1435.bin,0,1 +10934226,240,assets/images/split/image1436.bin,0,1 +10934466,274,assets/images/split/image1437.bin,0,1 +10934740,979,assets/images/split/image1438.bin,0,1 +10935719,979,assets/images/split/image1439.bin,0,1 +10936698,999,assets/images/split/image1440.bin,0,1 +10937697,1098,assets/images/split/image1441.bin,0,1 +10938795,283,assets/images/split/image1442.bin,0,1 +10939078,300,assets/images/split/image1443.bin,0,1 +10939378,373,assets/images/split/image1444.bin,0,1 +10939751,638,assets/images/split/image1445.bin,0,1 +10940389,456,assets/images/split/image1446.bin,0,1 +10940845,737,assets/images/split/image1447.bin,0,1 +10941582,511,assets/images/split/image1448.bin,0,1 +10942093,760,assets/images/split/image1449.bin,0,1 +10942853,667,assets/images/split/image1450.bin,0,1 +10943520,632,assets/images/split/image1451.bin,0,1 +10944152,671,assets/images/split/image1452.bin,0,1 +10944823,593,assets/images/split/image1453.bin,0,1 +10945416,654,assets/images/split/image1454.bin,0,1 +10946070,622,assets/images/split/image1455.bin,0,1 +10946692,722,assets/images/split/image1456.bin,0,1 +10947414,913,assets/images/split/image1457.bin,0,1 +10948327,1074,assets/images/split/image1458.bin,0,1 +10949401,315,assets/images/split/image1459.bin,0,1 +10949716,634,assets/images/split/image1460.bin,0,1 +10950350,623,assets/images/split/image1461.bin,0,1 +10950973,1285,assets/images/split/image1462.bin,0,1 +10952258,1246,assets/images/split/image1463.bin,0,1 +10953504,1202,assets/images/split/image1464.bin,0,1 +10954706,827,assets/images/split/image1465.bin,0,1 +10955533,727,assets/images/split/image1466.bin,0,1 +10956260,438,assets/images/split/image1467.bin,0,1 +10956698,498,assets/images/split/image1468.bin,0,1 +10957196,1699,assets/images/split/image1469.bin,0,1 +10958895,1699,assets/images/split/image1470.bin,0,1 +10960594,639,assets/images/split/image1471.bin,0,1 +10961233,603,assets/images/split/image1472.bin,0,1 +10961836,420,assets/images/split/image1473.bin,0,1 +10962256,1410,assets/images/split/image1474.bin,0,1 +10963666,541,assets/images/split/image1475.bin,0,1 +10964207,1309,assets/images/split/image1476.bin,0,1 +10965516,1272,assets/images/split/image1477.bin,0,1 +10966788,1159,assets/images/split/image1478.bin,0,1 +10967947,872,assets/images/split/image1479.bin,0,1 +10968819,892,assets/images/split/image1480.bin,0,1 +10969711,1930,assets/images/split/image1481.bin,0,1 +10971641,73,assets/images/split/image1482.bin,0,1 +10971714,75,assets/images/split/image1483.bin,0,1 +10971789,51,assets/images/split/image1484.bin,0,1 +10971840,958,assets/images/split/image1485.bin,0,1 +10972798,190,assets/images/split/image1486.bin,0,1 +10972988,424,assets/images/split/image1487.bin,0,1 +10973412,1742,assets/images/split/image1488.bin,0,1 +10975154,1652,assets/images/split/image1489.bin,0,1 +10976806,1798,assets/images/split/image1490.bin,0,1 +10978604,1732,assets/images/split/image1491.bin,0,1 +10980336,1758,assets/images/split/image1492.bin,0,1 +10982094,1792,assets/images/split/image1493.bin,0,1 +10983886,1724,assets/images/split/image1494.bin,0,1 +10985610,1765,assets/images/split/image1495.bin,0,1 +10987375,1643,assets/images/split/image1496.bin,0,1 +10989018,1851,assets/images/split/image1497.bin,0,1 +10990869,998,assets/images/split/image1498.bin,0,1 +10991867,1028,assets/images/split/image1499.bin,0,1 +10992895,925,assets/images/split/image1500.bin,0,1 +10993820,746,assets/images/split/image1501.bin,0,1 +10994566,1396,assets/images/split/image1502.bin,0,1 +10995962,270,assets/images/split/image1503.bin,0,1 +10996232,528,assets/images/split/image1504.bin,0,1 +10996760,351,assets/images/split/image1505.bin,0,1 +10997111,785,assets/images/split/image1506.bin,0,1 +10997896,943,assets/images/split/image1507.bin,0,1 +10998839,1271,assets/images/split/image1508.bin,0,1 +11000110,650,assets/images/split/image1509.bin,0,1 +11000760,564,assets/images/split/image1510.bin,0,1 +11001324,658,assets/images/split/image1511.bin,0,1 +11001982,645,assets/images/split/image1512.bin,0,1 +11002627,1353,assets/images/split/image1513.bin,0,1 +11003980,502,assets/images/split/image1514.bin,0,1 +11004482,12,assets/images/split/image1515.bin,0,1 +11004494,360,assets/images/split/image1516.bin,0,1 +11004854,400,assets/images/split/image1517.bin,0,1 +11005254,592,assets/images/split/image1518.bin,0,1 +11005846,1402,assets/images/split/image1519.bin,0,1 +11007248,1068,assets/images/split/image1520.bin,0,1 +11008316,1279,assets/images/split/image1521.bin,0,1 +11009595,803,assets/images/split/image1522.bin,0,1 +11010398,479,assets/images/split/image1523.bin,0,1 +11010877,1283,assets/images/split/image1524.bin,0,1 +11012160,421,assets/images/split/image1525.bin,0,1 +11012581,748,assets/images/split/image1526.bin,0,1 +11013329,1157,assets/images/split/image1527.bin,0,1 +11014486,1832,assets/images/split/image1528.bin,0,1 +11016318,547,assets/images/split/image1529.bin,0,1 +11016865,971,assets/images/split/image1530.bin,0,1 +11017836,346,assets/images/split/image1531.bin,0,1 +11018182,231,assets/images/split/image1532.bin,0,1 +11018413,374,assets/images/split/image1533.bin,0,1 +11018787,436,assets/images/split/image1534.bin,0,1 +11019223,707,assets/images/split/image1535.bin,0,1 +11019930,680,assets/images/split/image1536.bin,0,1 +11020610,570,assets/images/split/image1537.bin,0,1 +11021180,582,assets/images/split/image1538.bin,0,1 +11021762,576,assets/images/split/image1539.bin,0,1 +11022338,636,assets/images/split/image1540.bin,0,1 +11022974,746,assets/images/split/image1541.bin,0,1 +11023720,1201,assets/images/split/image1542.bin,0,1 +11024921,1140,assets/images/split/image1543.bin,0,1 +11026061,1157,assets/images/split/image1544.bin,0,1 +11027218,2006,assets/images/split/image1545.bin,0,1 +11029224,2177,assets/images/split/image1546.bin,0,1 +11031401,1066,assets/images/split/image1547.bin,0,1 +11032467,1468,assets/images/split/image1548.bin,0,1 +11033935,1836,assets/images/split/image1549.bin,0,1 +11035771,2193,assets/images/split/image1550.bin,0,1 +11037964,1884,assets/images/split/image1551.bin,0,1 +11039848,2268,assets/images/split/image1552.bin,0,1 +11042116,2378,assets/images/split/image1553.bin,0,1 +11044494,2340,assets/images/split/image1554.bin,0,1 +11046834,2416,assets/images/split/image1555.bin,0,1 +11049250,590,assets/images/split/image1556.bin,0,1 +11049840,2468,assets/images/split/image1557.bin,0,1 +11052308,823,assets/images/split/image1558.bin,0,1 +11053131,1544,assets/images/split/image1559.bin,0,1 +11054675,1548,assets/images/split/image1560.bin,0,1 +11056223,2535,assets/images/split/image1561.bin,0,1 +11058758,2524,assets/images/split/image1562.bin,0,1 +11061282,2498,assets/images/split/image1563.bin,0,1 +11063780,504,assets/images/split/image1564.bin,0,1 +11064284,593,assets/images/split/image1565.bin,0,1 +11064877,562,assets/images/split/image1566.bin,0,1 +11065439,507,assets/images/split/image1567.bin,0,1 +11065946,1472,assets/images/split/image1568.bin,0,1 +11067418,1031,assets/images/split/image1569.bin,0,1 +11068449,2537,assets/images/split/image1570.bin,0,1 +11070986,2214,assets/images/split/image1571.bin,0,1 +11073200,2408,assets/images/split/image1572.bin,0,1 +11075608,1477,assets/images/split/image1573.bin,0,1 +11077085,1050,assets/images/split/image1574.bin,0,1 +11078135,902,assets/images/split/image1575.bin,0,1 +11079037,990,assets/images/split/image1576.bin,0,1 +11080027,626,assets/images/split/image1577.bin,0,1 +11080653,917,assets/images/split/image1578.bin,0,1 +11081570,848,assets/images/split/image1579.bin,0,1 +11082418,748,assets/images/split/image1580.bin,0,1 +11083166,804,assets/images/split/image1581.bin,0,1 +11083970,710,assets/images/split/image1582.bin,0,1 +11084680,1822,assets/images/split/image1583.bin,0,1 +11086502,1807,assets/images/split/image1584.bin,0,1 +11088309,857,assets/images/split/image1585.bin,0,1 +11089166,969,assets/images/split/image1586.bin,0,1 +11090135,928,assets/images/split/image1587.bin,0,1 +11091063,875,assets/images/split/image1588.bin,0,1 +11091938,183,assets/images/split/image1589.bin,0,1 +11092121,1275,assets/images/split/image1590.bin,0,1 +11093396,1343,assets/images/split/image1591.bin,0,1 +11094739,1233,assets/images/split/image1592.bin,0,1 +11095972,1805,assets/images/split/image1593.bin,0,1 +11097777,732,assets/images/split/image1594.bin,0,1 +11098509,934,assets/images/split/image1595.bin,0,1 +11099443,411,assets/images/split/image1596.bin,0,1 +11099854,972,assets/images/split/image1597.bin,0,1 +11100826,40,assets/images/split/image1598.bin,0,1 +11100866,53,assets/images/split/image1599.bin,0,1 +11100919,567,assets/images/split/image1600.bin,0,1 +11101486,933,assets/images/split/image1601.bin,0,1 +11102419,910,assets/images/split/image1602.bin,0,1 +11103329,677,assets/images/split/image1603.bin,0,1 +11104006,655,assets/images/split/image1604.bin,0,1 +11104661,12,assets/images/split/image1605.bin,0,1 +11104673,475,assets/images/split/image1606.bin,0,1 +11105148,1883,assets/images/split/image1607.bin,0,1 +11107031,632,assets/images/split/image1608.bin,0,1 +11107663,12,assets/images/split/image1609.bin,0,1 +11107675,983,assets/images/split/image1610.bin,0,1 +11108658,341,assets/images/split/image1611.bin,0,1 +11108999,1019,assets/images/split/image1612.bin,0,1 +11110018,941,assets/images/split/image1613.bin,0,1 +11110959,1436,assets/images/split/image1614.bin,0,1 +11112395,305,assets/images/split/image1615.bin,0,1 +11112700,953,assets/images/split/image1616.bin,0,1 +11113653,1268,assets/images/split/image1617.bin,0,1 +11114921,335,assets/images/split/image1618.bin,0,1 +11115256,949,assets/images/split/image1619.bin,0,1 +11116205,1174,assets/images/split/image1620.bin,0,1 +11117379,366,assets/images/split/image1621.bin,0,1 +11117745,971,assets/images/split/image1622.bin,0,1 +11118716,1255,assets/images/split/image1623.bin,0,1 +11119971,434,assets/images/split/image1624.bin,0,1 +11120405,2144,assets/images/split/image1625.bin,0,1 +11122549,2170,assets/images/split/image1626.bin,0,1 +11124719,1788,assets/images/split/image1627.bin,0,1 +11126507,335,assets/images/split/image1628.bin,0,1 +11126842,762,assets/images/split/image1629.bin,0,1 +11127604,767,assets/images/split/image1630.bin,0,1 +11128371,308,assets/images/split/image1631.bin,0,1 +11128679,724,assets/images/split/image1632.bin,0,1 +11129403,1278,assets/images/split/image1633.bin,0,1 +11130681,1332,assets/images/split/image1634.bin,0,1 +11132013,899,assets/images/split/image1635.bin,0,1 +11132912,874,assets/images/split/image1636.bin,0,1 +11133786,753,assets/images/split/image1637.bin,0,1 +11134539,876,assets/images/split/image1638.bin,0,1 +11135415,314,assets/images/split/image1639.bin,0,1 +11135729,55,assets/images/split/image1640.bin,0,1 +11135784,921,assets/images/split/image1641.bin,0,1 +11136705,745,assets/images/split/image1642.bin,0,1 +11137450,1055,assets/images/split/image1643.bin,0,1 +11138505,812,assets/images/split/image1644.bin,0,1 +11139317,1470,assets/images/split/image1645.bin,0,1 +11140787,717,assets/images/split/image1646.bin,0,1 +11141504,781,assets/images/split/image1647.bin,0,1 +11142285,1486,assets/images/split/image1648.bin,0,1 +11143771,1832,assets/images/split/image1649.bin,0,1 +11145603,1148,assets/images/split/image1650.bin,0,1 +11146751,1522,assets/images/split/image1651.bin,0,1 +11148273,64,assets/images/split/image1652.bin,0,1 +11148337,1724,assets/images/split/image1653.bin,0,1 +11150061,2474,assets/images/split/image1654.bin,0,1 +11152535,2042,assets/images/split/image1655.bin,0,1 +11154577,1022,assets/images/split/image1656.bin,0,1 +11155599,1230,assets/images/split/image1657.bin,0,1 +11156829,700,assets/images/split/image1658.bin,0,1 +11157529,1488,assets/images/split/image1659.bin,0,1 +11159017,1389,assets/images/split/image1660.bin,0,1 +11160406,1937,assets/images/split/image1661.bin,0,1 +11162343,2385,assets/images/split/image1662.bin,0,1 +11164728,1933,assets/images/split/image1663.bin,0,1 +11166661,590,assets/images/split/image1664.bin,0,1 +11167251,781,assets/images/split/image1665.bin,0,1 +11168032,2358,assets/images/split/image1666.bin,0,1 +11170390,1233,assets/images/split/image1667.bin,0,1 +11171623,1358,assets/images/split/image1668.bin,0,1 +11172981,374,assets/images/split/image1669.bin,0,1 +11173355,1441,assets/images/split/image1670.bin,0,1 +11174796,1414,assets/images/split/image1671.bin,0,1 +11176210,12,assets/images/split/image1672.bin,0,1 +11176222,1122,assets/images/split/image1673.bin,0,1 +11177344,1527,assets/images/split/image1674.bin,0,1 +11178871,1844,assets/images/split/image1675.bin,0,1 +11180715,1850,assets/images/split/image1676.bin,0,1 +11182565,1735,assets/images/split/image1677.bin,0,1 +11184300,1945,assets/images/split/image1678.bin,0,1 +11186245,1125,assets/images/split/image1679.bin,0,1 +11187370,1630,assets/images/split/image1680.bin,0,1 +11189000,1179,assets/images/split/image1681.bin,0,1 +11190179,1664,assets/images/split/image1682.bin,0,1 +11191843,2444,assets/images/split/image1683.bin,0,1 +11194287,2336,assets/images/split/image1684.bin,0,1 +11196623,2333,assets/images/split/image1685.bin,0,1 +11198956,2494,assets/images/split/image1686.bin,0,1 +11201450,1647,assets/images/split/image1687.bin,0,1 +11203097,1553,assets/images/split/image1688.bin,0,1 +11204650,1459,assets/images/split/image1689.bin,0,1 +11206109,327,assets/images/split/image1690.bin,0,1 +11206436,1690,assets/images/split/image1691.bin,0,1 +11208126,1333,assets/images/split/image1692.bin,0,1 +11209459,1034,assets/images/split/image1693.bin,0,1 +11210493,796,assets/images/split/image1694.bin,0,1 +11211289,720,assets/images/split/image1695.bin,0,1 +11212009,703,assets/images/split/image1696.bin,0,1 +11212712,2456,assets/images/split/image1697.bin,0,1 +11215168,449,assets/images/split/image1698.bin,0,1 +11215617,692,assets/images/split/image1699.bin,0,1 +11216309,796,assets/images/split/image1700.bin,0,1 +11217105,904,assets/images/split/image1701.bin,0,1 +11218009,1006,assets/images/split/image1702.bin,0,1 +11219015,2267,assets/images/split/image1703.bin,0,1 +11221282,2137,assets/images/split/image1704.bin,0,1 +11223419,874,assets/images/split/image1705.bin,0,1 +11224293,2391,assets/images/split/image1706.bin,0,1 +11226684,2463,assets/images/split/image1707.bin,0,1 +11229147,2512,assets/images/split/image1708.bin,0,1 +11231659,1686,assets/images/split/image1709.bin,0,1 +11233345,446,assets/images/split/image1710.bin,0,1 +11233791,673,assets/images/split/image1711.bin,0,1 +11234464,1368,assets/images/split/image1712.bin,0,1 +11235832,443,assets/images/split/image1713.bin,0,1 +11236275,695,assets/images/split/image1714.bin,0,1 +11236970,643,assets/images/split/image1715.bin,0,1 +11237613,592,assets/images/split/image1716.bin,0,1 +11238205,705,assets/images/split/image1717.bin,0,1 +11238910,1249,assets/images/split/image1718.bin,0,1 +11240159,876,assets/images/split/image1719.bin,0,1 +11241035,775,assets/images/split/image1720.bin,0,1 +11241810,746,assets/images/split/image1721.bin,0,1 +11242556,705,assets/images/split/image1722.bin,0,1 +11243261,2371,assets/images/split/image1723.bin,0,1 +11245632,2243,assets/images/split/image1724.bin,0,1 +11247875,2311,assets/images/split/image1725.bin,0,1 +11250186,12,assets/images/split/image1726.bin,0,1 +11250198,2514,assets/images/split/image1727.bin,0,1 +11252712,2483,assets/images/split/image1728.bin,0,1 +11255195,2448,assets/images/split/image1729.bin,0,1 +11257643,1022,assets/images/split/image1730.bin,0,1 +11258665,1034,assets/images/split/image1731.bin,0,1 +11259699,1095,assets/images/split/image1732.bin,0,1 +11260794,1048,assets/images/split/image1733.bin,0,1 +11261842,2099,assets/images/split/image1734.bin,0,1 +11263941,2025,assets/images/split/image1735.bin,0,1 +11265966,833,assets/images/split/image1736.bin,0,1 +11266799,369,assets/images/split/image1737.bin,0,1 +11267168,1543,assets/images/split/image1738.bin,0,1 +11268711,1421,assets/images/split/image1739.bin,0,1 +11270132,951,assets/images/split/image1740.bin,0,1 +11271083,1024,assets/images/split/image1741.bin,0,1 +11272107,1114,assets/images/split/image1742.bin,0,1 +11273221,1810,assets/images/split/image1743.bin,0,1 +11275031,550,assets/images/split/image1744.bin,0,1 +11275581,1045,assets/images/split/image1745.bin,0,1 +11276626,1333,assets/images/split/image1746.bin,0,1 +11277959,1908,assets/images/split/image1747.bin,0,1 +11279867,1960,assets/images/split/image1748.bin,0,1 +11281827,1901,assets/images/split/image1749.bin,0,1 +11283728,636,assets/images/split/image1750.bin,0,1 +11284364,681,assets/images/split/image1751.bin,0,1 +11285045,267,assets/images/split/image1752.bin,0,1 +11285312,834,assets/images/split/image1753.bin,0,1 +11286146,485,assets/images/split/image1754.bin,0,1 +11286631,507,assets/images/split/image1755.bin,0,1 +11287138,1480,assets/images/split/image1756.bin,0,1 +11288618,923,assets/images/split/image1757.bin,0,1 +11289541,1046,assets/images/split/image1758.bin,0,1 +11290587,1106,assets/images/split/image1759.bin,0,1 +11291693,1064,assets/images/split/image1760.bin,0,1 +11292757,667,assets/images/split/image1761.bin,0,1 +11293424,466,assets/images/split/image1762.bin,0,1 +11293890,1626,assets/images/split/image1763.bin,0,1 +11295516,2404,assets/images/split/image1764.bin,0,1 +11297920,2236,assets/images/split/image1765.bin,0,1 +11300156,2280,assets/images/split/image1766.bin,0,1 +11302436,2538,assets/images/split/image1767.bin,0,1 +11304974,2475,assets/images/split/image1768.bin,0,1 +11307449,2485,assets/images/split/image1769.bin,0,1 +11309934,908,assets/images/split/image1770.bin,0,1 +11310842,1369,assets/images/split/image1771.bin,0,1 +11312211,1639,assets/images/split/image1772.bin,0,1 +11313850,1402,assets/images/split/image1773.bin,0,1 +11315252,1152,assets/images/split/image1774.bin,0,1 +11316404,416,assets/images/split/image1775.bin,0,1 +11316820,246,assets/images/split/image1776.bin,0,1 +11317066,791,assets/images/split/image1777.bin,0,1 +11317857,894,assets/images/split/image1778.bin,0,1 +11318751,1562,assets/images/split/image1779.bin,0,1 +11320313,1205,assets/images/split/image1780.bin,0,1 +11321518,313,assets/images/split/image1781.bin,0,1 +11321831,322,assets/images/split/image1782.bin,0,1 +11322153,401,assets/images/split/image1783.bin,0,1 +11322554,769,assets/images/split/image1784.bin,0,1 +11323323,450,assets/images/split/image1785.bin,0,1 +11323773,871,assets/images/split/image1786.bin,0,1 +11324644,989,assets/images/split/image1787.bin,0,1 +11325633,902,assets/images/split/image1788.bin,0,1 +11326535,830,assets/images/split/image1789.bin,0,1 +11327365,778,assets/images/split/image1790.bin,0,1 +11328143,744,assets/images/split/image1791.bin,0,1 +11328887,832,assets/images/split/image1792.bin,0,1 +11329719,872,assets/images/split/image1793.bin,0,1 +11330591,981,assets/images/split/image1794.bin,0,1 +11331572,987,assets/images/split/image1795.bin,0,1 +11332559,1239,assets/images/split/image1796.bin,0,1 +11333798,1176,assets/images/split/image1797.bin,0,1 +11334974,1181,assets/images/split/image1798.bin,0,1 +11336155,746,assets/images/split/image1799.bin,0,1 +11336901,884,assets/images/split/image1800.bin,0,1 +11337785,1676,assets/images/split/image1801.bin,0,1 +11339461,1838,assets/images/split/image1802.bin,0,1 +11341299,2274,assets/images/split/image1803.bin,0,1 +11343573,2080,assets/images/split/image1804.bin,0,1 +11345653,2209,assets/images/split/image1805.bin,0,1 +11347862,2106,assets/images/split/image1806.bin,0,1 +11349968,502,assets/images/split/image1807.bin,0,1 +11350470,468,assets/images/split/image1808.bin,0,1 +11350938,756,assets/images/split/image1809.bin,0,1 +11351694,318,assets/images/split/image1810.bin,0,1 +11352012,371,assets/images/split/image1811.bin,0,1 +11352383,1656,assets/images/split/image1812.bin,0,1 +11354039,665,assets/images/split/image1813.bin,0,1 +11354704,1443,assets/images/split/image1814.bin,0,1 +11356147,2572,assets/images/split/image1815.bin,0,1 +11358719,2531,assets/images/split/image1816.bin,0,1 +11361250,2537,assets/images/split/image1817.bin,0,1 +11363787,2368,assets/images/split/image1818.bin,0,1 +11366155,2482,assets/images/split/image1819.bin,0,1 +11368637,2406,assets/images/split/image1820.bin,0,1 +11371043,2529,assets/images/split/image1821.bin,0,1 +11373572,2345,assets/images/split/image1822.bin,0,1 +11375917,2376,assets/images/split/image1823.bin,0,1 +11378293,2536,assets/images/split/image1824.bin,0,1 +11380829,2509,assets/images/split/image1825.bin,0,1 +11383338,2468,assets/images/split/image1826.bin,0,1 +11385806,2401,assets/images/split/image1827.bin,0,1 +11388207,2405,assets/images/split/image1828.bin,0,1 +11390612,2313,assets/images/split/image1829.bin,0,1 +11392925,915,assets/images/split/image1830.bin,0,1 +11393840,343,assets/images/split/image1831.bin,0,1 +11394183,651,assets/images/split/image1832.bin,0,1 +11394834,786,assets/images/split/image1833.bin,0,1 +11395620,2521,assets/images/split/image1834.bin,0,1 +11398141,2309,assets/images/split/image1835.bin,0,1 +11400450,2344,assets/images/split/image1836.bin,0,1 +11402794,631,assets/images/split/image1837.bin,0,1 +11403425,636,assets/images/split/image1838.bin,0,1 +11404061,278,assets/images/split/image1839.bin,0,1 +11404339,455,assets/images/split/image1840.bin,0,1 +11404794,260,assets/images/split/image1841.bin,0,1 +11405054,648,assets/images/split/image1842.bin,0,1 +11405702,1565,assets/images/split/image1843.bin,0,1 +11407267,389,assets/images/split/image1844.bin,0,1 +11407656,2137,assets/images/split/image1845.bin,0,1 +11409793,2207,assets/images/split/image1846.bin,0,1 +11412000,2024,assets/images/split/image1847.bin,0,1 +11414024,2470,assets/images/split/image1848.bin,0,1 +11416494,2221,assets/images/split/image1849.bin,0,1 +11418715,2239,assets/images/split/image1850.bin,0,1 +11420954,2345,assets/images/split/image1851.bin,0,1 +11423299,2393,assets/images/split/image1852.bin,0,1 +11425692,2363,assets/images/split/image1853.bin,0,1 +11428055,2288,assets/images/split/image1854.bin,0,1 +11430343,2232,assets/images/split/image1855.bin,0,1 +11432575,2355,assets/images/split/image1856.bin,0,1 +11434930,1243,assets/images/split/image1857.bin,0,1 +11436173,2369,assets/images/split/image1858.bin,0,1 +11438542,1731,assets/images/split/image1859.bin,0,1 +11440273,2116,assets/images/split/image1860.bin,0,1 +11442389,810,assets/images/split/image1861.bin,0,1 +11443199,1546,assets/images/split/image1862.bin,0,1 +11444745,934,assets/images/split/image1863.bin,0,1 +11445679,272,assets/images/split/image1864.bin,0,1 +11445951,694,assets/images/split/image1865.bin,0,1 +11446645,1829,assets/images/split/image1866.bin,0,1 +11448474,1278,assets/images/split/image1867.bin,0,1 +11449752,12,assets/images/split/image1868.bin,0,1 +11449764,2255,assets/images/split/image1869.bin,0,1 +11452019,2378,assets/images/split/image1870.bin,0,1 +11454397,2472,assets/images/split/image1871.bin,0,1 +11456869,1932,assets/images/split/image1872.bin,0,1 +11458801,2526,assets/images/split/image1873.bin,0,1 +11461327,276,assets/images/split/image1874.bin,0,1 +11461603,1407,assets/images/split/image1875.bin,0,1 +11463010,450,assets/images/split/image1876.bin,0,1 +11463460,2004,assets/images/split/image1877.bin,0,1 +11465464,2021,assets/images/split/image1878.bin,0,1 +11467485,2531,assets/images/split/image1879.bin,0,1 +11470016,1981,assets/images/split/image1880.bin,0,1 +11471997,1192,assets/images/split/image1881.bin,0,1 +11473189,186,assets/images/split/image1882.bin,0,1 +11473375,1489,assets/images/split/image1883.bin,0,1 +11474864,2412,assets/images/split/image1884.bin,0,1 +11477276,2170,assets/images/split/image1885.bin,0,1 +11479446,2048,assets/images/split/image1886.bin,0,1 +11481494,1136,assets/images/split/image1887.bin,0,1 +11482630,529,assets/images/split/image1888.bin,0,1 +11483159,522,assets/images/split/image1889.bin,0,1 +11483681,810,assets/images/split/image1890.bin,0,1 +11484491,999,assets/images/split/image1891.bin,0,1 +11485490,611,assets/images/split/image1892.bin,0,1 +11486101,2572,assets/images/split/image1893.bin,0,1 +11488673,1548,assets/images/split/image1894.bin,0,1 +11490221,1520,assets/images/split/image1895.bin,0,1 +11491741,1642,assets/images/split/image1896.bin,0,1 +11493383,802,assets/images/split/image1897.bin,0,1 +11494185,895,assets/images/split/image1898.bin,0,1 +11495080,895,assets/images/split/image1899.bin,0,1 +11495975,788,assets/images/split/image1900.bin,0,1 +11496763,819,assets/images/split/image1901.bin,0,1 +11497582,412,assets/images/split/image1902.bin,0,1 +11497994,562,assets/images/split/image1903.bin,0,1 +11498556,337,assets/images/split/image1904.bin,0,1 +11498893,374,assets/images/split/image1905.bin,0,1 +11499267,1961,assets/images/split/image1906.bin,0,1 +11501228,1946,assets/images/split/image1907.bin,0,1 +11503174,2354,assets/images/split/image1908.bin,0,1 +11505528,2253,assets/images/split/image1909.bin,0,1 +11507781,2254,assets/images/split/image1910.bin,0,1 +11510035,260,assets/images/split/image1911.bin,0,1 +11510295,755,assets/images/split/image1912.bin,0,1 +11511050,1460,assets/images/split/image1913.bin,0,1 +11512510,830,assets/images/split/image1914.bin,0,1 +11513340,1294,assets/images/split/image1915.bin,0,1 +11514634,1530,assets/images/split/image1916.bin,0,1 +11516164,1124,assets/images/split/image1917.bin,0,1 +11517288,12,assets/images/split/image1918.bin,0,1 +11517300,1399,assets/images/split/image1919.bin,0,1 +11518699,1411,assets/images/split/image1920.bin,0,1 +11520110,2212,assets/images/split/image1921.bin,0,1 +11522322,850,assets/images/split/image1922.bin,0,1 +11523172,727,assets/images/split/image1923.bin,0,1 +11523899,859,assets/images/split/image1924.bin,0,1 +11524758,963,assets/images/split/image1925.bin,0,1 +11525721,1143,assets/images/split/image1926.bin,0,1 +11526864,1151,assets/images/split/image1927.bin,0,1 +11528015,657,assets/images/split/image1928.bin,0,1 +11528672,2293,assets/images/split/image1929.bin,0,1 +11530965,2312,assets/images/split/image1930.bin,0,1 +11533277,2515,assets/images/split/image1931.bin,0,1 +11535792,2249,assets/images/split/image1932.bin,0,1 +11538041,672,assets/images/split/image1933.bin,0,1 +11538713,2104,assets/images/split/image1934.bin,0,1 +11540817,2037,assets/images/split/image1935.bin,0,1 +11542854,789,assets/images/split/image1936.bin,0,1 +11543643,1302,assets/images/split/image1937.bin,0,1 +11544945,1131,assets/images/split/image1938.bin,0,1 +11546076,773,assets/images/split/image1939.bin,0,1 +11546849,1246,assets/images/split/image1940.bin,0,1 +11548095,1131,assets/images/split/image1941.bin,0,1 +11549226,800,assets/images/split/image1942.bin,0,1 +11550026,1685,assets/images/split/image1943.bin,0,1 +11551711,2414,assets/images/split/image1944.bin,0,1 +11554125,2461,assets/images/split/image1945.bin,0,1 +11556586,2454,assets/images/split/image1946.bin,0,1 +11559040,910,assets/images/split/image1947.bin,0,1 +11559950,584,assets/images/split/image1948.bin,0,1 +11560534,716,assets/images/split/image1949.bin,0,1 +11561250,121,assets/images/split/image1950.bin,0,1 +11561371,1564,assets/images/split/image1951.bin,0,1 +11562935,1166,assets/images/split/image1952.bin,0,1 +11564101,1370,assets/images/split/image1953.bin,0,1 +11565471,1315,assets/images/split/image1954.bin,0,1 +11566786,1618,assets/images/split/image1955.bin,0,1 +11568404,1347,assets/images/split/image1956.bin,0,1 +11569751,1239,assets/images/split/image1957.bin,0,1 +11570990,1379,assets/images/split/image1958.bin,0,1 +11572369,966,assets/images/split/image1959.bin,0,1 +11573335,1094,assets/images/split/image1960.bin,0,1 +11574429,618,assets/images/split/image1961.bin,0,1 +11575047,1377,assets/images/split/image1962.bin,0,1 +11576424,601,assets/images/split/image1963.bin,0,1 +11577025,1879,assets/images/split/image1964.bin,0,1 +11578904,1810,assets/images/split/image1965.bin,0,1 +11580714,1067,assets/images/split/image1966.bin,0,1 +11581781,370,assets/images/split/image1967.bin,0,1 +11582151,860,assets/images/split/image1968.bin,0,1 +11583011,1017,assets/images/split/image1969.bin,0,1 +11584028,1428,assets/images/split/image1970.bin,0,1 +11585456,2442,assets/images/split/image1971.bin,0,1 +11587898,2315,assets/images/split/image1972.bin,0,1 +11590213,2501,assets/images/split/image1973.bin,0,1 +11592714,2275,assets/images/split/image1974.bin,0,1 +11594989,2377,assets/images/split/image1975.bin,0,1 +11597366,2319,assets/images/split/image1976.bin,0,1 +11599685,2572,assets/images/split/image1977.bin,0,1 +11602257,2400,assets/images/split/image1978.bin,0,1 +11604657,2396,assets/images/split/image1979.bin,0,1 +11607053,435,assets/images/split/image1980.bin,0,1 +11607488,1061,assets/images/split/image1981.bin,0,1 +11608549,1900,assets/images/split/image1982.bin,0,1 +11610449,1909,assets/images/split/image1983.bin,0,1 +11612358,431,assets/images/split/image1984.bin,0,1 +11612789,374,assets/images/split/image1985.bin,0,1 +11613163,704,assets/images/split/image1986.bin,0,1 +11613867,916,assets/images/split/image1987.bin,0,1 +11614783,774,assets/images/split/image1988.bin,0,1 +11615557,1373,assets/images/split/image1989.bin,0,1 +11616930,1342,assets/images/split/image1990.bin,0,1 +11618272,377,assets/images/split/image1991.bin,0,1 +11618649,381,assets/images/split/image1992.bin,0,1 +11619030,439,assets/images/split/image1993.bin,0,1 +11619469,460,assets/images/split/image1994.bin,0,1 +11619929,385,assets/images/split/image1995.bin,0,1 +11620314,240,assets/images/split/image1996.bin,0,1 +11620554,544,assets/images/split/image1997.bin,0,1 +11621098,2456,assets/images/split/image1998.bin,0,1 +11623554,2487,assets/images/split/image1999.bin,0,1 +11626041,2413,assets/images/split/image2000.bin,0,1 +11628454,2236,assets/images/split/image2001.bin,0,1 +11630690,2234,assets/images/split/image2002.bin,0,1 +11632924,2180,assets/images/split/image2003.bin,0,1 +11635104,2340,assets/images/split/image2004.bin,0,1 +11637444,2066,assets/images/split/image2005.bin,0,1 +11639510,630,assets/images/split/image2006.bin,0,1 +11640140,412,assets/images/split/image2007.bin,0,1 +11640552,254,assets/images/split/image2008.bin,0,1 +11640806,689,assets/images/split/image2009.bin,0,1 +11641495,617,assets/images/split/image2010.bin,0,1 +11642112,1896,assets/images/split/image2011.bin,0,1 +11644008,185,assets/images/split/image2012.bin,0,1 +11644193,228,assets/images/split/image2013.bin,0,1 +11644421,321,assets/images/split/image2014.bin,0,1 +11644742,783,assets/images/split/image2015.bin,0,1 +11645525,320,assets/images/split/image2016.bin,0,1 +11645845,920,assets/images/split/image2017.bin,0,1 +11646765,387,assets/images/split/image2018.bin,0,1 +11647152,303,assets/images/split/image2019.bin,0,1 +11647455,344,assets/images/split/image2020.bin,0,1 +11647799,430,assets/images/split/image2021.bin,0,1 +11648229,469,assets/images/split/image2022.bin,0,1 +11648698,196,assets/images/split/image2023.bin,0,1 +11648894,920,assets/images/split/image2024.bin,0,1 +11649814,703,assets/images/split/image2025.bin,0,1 +11650517,1889,assets/images/split/image2026.bin,0,1 +11652406,286,assets/images/split/image2027.bin,0,1 +11652692,955,assets/images/split/image2028.bin,0,1 +11653647,1620,assets/images/split/image2029.bin,0,1 +11655267,1463,assets/images/split/image2030.bin,0,1 +11656730,1647,assets/images/split/image2031.bin,0,1 +11658377,1731,assets/images/split/image2032.bin,0,1 +11660108,1024,assets/images/split/image2033.bin,0,1 +11661132,776,assets/images/split/image2034.bin,0,1 +11661908,898,assets/images/split/image2035.bin,0,1 +11662806,1444,assets/images/split/image2036.bin,0,1 +11664250,689,assets/images/split/image2037.bin,0,1 +11664939,1089,assets/images/split/image2038.bin,0,1 +11666028,500,assets/images/split/image2039.bin,0,1 +11666528,423,assets/images/split/image2040.bin,0,1 +11666951,2304,assets/images/split/image2041.bin,0,1 +11669255,2036,assets/images/split/image2042.bin,0,1 +11671291,293,assets/images/split/image2043.bin,0,1 +11671584,410,assets/images/split/image2044.bin,0,1 +11671994,1370,assets/images/split/image2045.bin,0,1 +11673364,560,assets/images/split/image2046.bin,0,1 +11673924,782,assets/images/split/image2047.bin,0,1 +11674706,2372,assets/images/split/image2048.bin,0,1 +11677078,641,assets/images/split/image2049.bin,0,1 +11677719,597,assets/images/split/image2050.bin,0,1 +11678316,1105,assets/images/split/image2051.bin,0,1 +11679421,958,assets/images/split/image2052.bin,0,1 +11680379,443,assets/images/split/image2053.bin,0,1 +11680822,1738,assets/images/split/image2054.bin,0,1 +11682560,1963,assets/images/split/image2055.bin,0,1 +11684523,967,assets/images/split/image2056.bin,0,1 +11685490,2418,assets/images/split/image2057.bin,0,1 +11687908,12,assets/images/split/image2058.bin,0,1 +11687920,406,assets/images/split/image2059.bin,0,1 +11688326,635,assets/images/split/image2060.bin,0,1 +11688961,426,assets/images/split/image2061.bin,0,1 +11689387,2433,assets/images/split/image2062.bin,0,1 +11691820,2411,assets/images/split/image2063.bin,0,1 +11694231,2307,assets/images/split/image2064.bin,0,1 +11696538,581,assets/images/split/image2065.bin,0,1 +11697119,303,assets/images/split/image2066.bin,0,1 +11697422,1163,assets/images/split/image2067.bin,0,1 +11698585,762,assets/images/split/image2068.bin,0,1 +11699347,1062,assets/images/split/image2069.bin,0,1 +11700409,1547,assets/images/split/image2070.bin,0,1 +11701956,1211,assets/images/split/image2071.bin,0,1 +11703167,906,assets/images/split/image2072.bin,0,1 +11704073,1119,assets/images/split/image2073.bin,0,1 +11705192,1170,assets/images/split/image2074.bin,0,1 +11706362,783,assets/images/split/image2075.bin,0,1 +11707145,1033,assets/images/split/image2076.bin,0,1 +11708178,918,assets/images/split/image2077.bin,0,1 +11709096,2478,assets/images/split/image2078.bin,0,1 +11711574,1960,assets/images/split/image2079.bin,0,1 +11713534,2226,assets/images/split/image2080.bin,0,1 +11715760,734,assets/images/split/image2081.bin,0,1 +11716494,936,assets/images/split/image2082.bin,0,1 +11717430,1717,assets/images/split/image2083.bin,0,1 +11719147,1578,assets/images/split/image2084.bin,0,1 +11720725,7,assets/images/split/image2085.bin,0,1 +11720732,8,assets/images/split/image2086.bin,0,1 +11720740,1245,assets/images/split/image2087.bin,0,1 +11721985,291,assets/images/split/image2088.bin,0,1 +11722276,943,assets/images/split/image2089.bin,0,1 +11723219,209,assets/images/split/image2090.bin,0,1 +11723428,1157,assets/images/split/image2091.bin,0,1 +11724585,254,assets/images/split/image2092.bin,0,1 +11724839,1061,assets/images/split/image2093.bin,0,1 +11725900,218,assets/images/split/image2094.bin,0,1 +11726118,787,assets/images/split/image2095.bin,0,1 +11726905,120,assets/images/split/image2096.bin,0,1 +11727025,170,assets/images/split/image2097.bin,0,1 +11727195,50,assets/images/split/image2098.bin,0,1 +11727245,971,assets/images/split/image2099.bin,0,1 +11728216,256,assets/images/split/image2100.bin,0,1 +11728472,1196,assets/images/split/image2101.bin,0,1 +11729668,274,assets/images/split/image2102.bin,0,1 +11729942,1365,assets/images/split/image2103.bin,0,1 +11731307,288,assets/images/split/image2104.bin,0,1 +11731595,1459,assets/images/split/image2105.bin,0,1 +11733054,306,assets/images/split/image2106.bin,0,1 +11733360,1517,assets/images/split/image2107.bin,0,1 +11734877,322,assets/images/split/image2108.bin,0,1 +11735199,1451,assets/images/split/image2109.bin,0,1 +11736650,311,assets/images/split/image2110.bin,0,1 +11736961,1408,assets/images/split/image2111.bin,0,1 +11738369,309,assets/images/split/image2112.bin,0,1 +11738678,1318,assets/images/split/image2113.bin,0,1 +11739996,301,assets/images/split/image2114.bin,0,1 +11740297,2297,assets/images/split/image2115.bin,0,1 +11742594,2246,assets/images/split/image2116.bin,0,1 +11744840,2094,assets/images/split/image2117.bin,0,1 +11746934,2245,assets/images/split/image2118.bin,0,1 +11749179,412,assets/images/split/image2119.bin,0,1 +11749591,2299,assets/images/split/image2120.bin,0,1 +11751890,1889,assets/images/split/image2121.bin,0,1 +11753779,1739,assets/images/split/image2122.bin,0,1 +11755518,1778,assets/images/split/image2123.bin,0,1 +11757296,1747,assets/images/split/image2124.bin,0,1 +11759043,1931,assets/images/split/image2125.bin,0,1 +11760974,1852,assets/images/split/image2126.bin,0,1 +11762826,1938,assets/images/split/image2127.bin,0,1 +11764764,1909,assets/images/split/image2128.bin,0,1 +11766673,1149,assets/images/split/image2129.bin,0,1 +11767822,1572,assets/images/split/image2130.bin,0,1 +11769394,1548,assets/images/split/image2131.bin,0,1 +11770942,1548,assets/images/split/image2132.bin,0,1 +11772490,1548,assets/images/split/image2133.bin,0,1 +11774038,1546,assets/images/split/image2134.bin,0,1 +11775584,3015,assets/images/split/image2135.bin,0,1 +11778599,1300,assets/images/split/image2136.bin,0,1 +11779899,1159,assets/images/split/image2137.bin,0,1 +11781058,2557,assets/images/split/image2138.bin,0,1 +11783615,2399,assets/images/split/image2139.bin,0,1 +11786014,1989,assets/images/split/image2140.bin,0,1 +11788003,2215,assets/images/split/image2141.bin,0,1 +11790218,1881,assets/images/split/image2142.bin,0,1 +11792099,1680,assets/images/split/image2143.bin,0,1 +11793779,1636,assets/images/split/image2144.bin,0,1 +11795415,1715,assets/images/split/image2145.bin,0,1 +11797130,2062,assets/images/split/image2146.bin,0,1 +11799192,1951,assets/images/split/image2147.bin,0,1 +11801143,1909,assets/images/split/image2148.bin,0,1 +11803052,1919,assets/images/split/image2149.bin,0,1 +11804971,1721,assets/images/split/image2150.bin,0,1 +11806692,1606,assets/images/split/image2151.bin,0,1 +11808298,1609,assets/images/split/image2152.bin,0,1 +11809907,1620,assets/images/split/image2153.bin,0,1 +11811527,1408,assets/images/split/image2154.bin,0,1 +11812935,1291,assets/images/split/image2155.bin,0,1 +11814226,1285,assets/images/split/image2156.bin,0,1 +11815511,1323,assets/images/split/image2157.bin,0,1 +11816834,2098,assets/images/split/image2158.bin,0,1 +11818932,2023,assets/images/split/image2159.bin,0,1 +11820955,2003,assets/images/split/image2160.bin,0,1 +11822958,1927,assets/images/split/image2161.bin,0,1 +11824885,538,assets/images/split/image2162.bin,0,1 +11825423,744,assets/images/split/image2163.bin,0,1 +11826167,910,assets/images/split/image2164.bin,0,1 +11827077,149,assets/images/split/image2165.bin,0,1 +11827226,643,assets/images/split/image2166.bin,0,1 +11827869,513,assets/images/split/image2167.bin,0,1 +11828382,142,assets/images/split/image2168.bin,0,1 +11828524,1017,assets/images/split/image2169.bin,0,1 +11829541,847,assets/images/split/image2170.bin,0,1 +11830388,1624,assets/images/split/image2171.bin,0,1 +11832012,1140,assets/images/split/image2172.bin,0,1 +11833152,540,assets/images/split/image2173.bin,0,1 +11833692,1321,assets/images/split/image2174.bin,0,1 +11835013,1104,assets/images/split/image2175.bin,0,1 +11836117,1111,assets/images/split/image2176.bin,0,1 +11837228,487,assets/images/split/image2177.bin,0,1 +11837715,1249,assets/images/split/image2178.bin,0,1 +11838964,414,assets/images/split/image2179.bin,0,1 +11839378,644,assets/images/split/image2180.bin,0,1 +11840022,923,assets/images/split/image2181.bin,0,1 +11840945,869,assets/images/split/image2182.bin,0,1 +11841814,1381,assets/images/split/image2183.bin,0,1 +11843195,1537,assets/images/split/image2184.bin,0,1 +11844732,1612,assets/images/split/image2185.bin,0,1 +11846344,1594,assets/images/split/image2186.bin,0,1 +11847938,1605,assets/images/split/image2187.bin,0,1 +11849543,909,assets/images/split/image2188.bin,0,1 +11850452,921,assets/images/split/image2189.bin,0,1 +11851373,1116,assets/images/split/image2190.bin,0,1 +11852489,846,assets/images/split/image2191.bin,0,1 +11853335,1039,assets/images/split/image2192.bin,0,1 +11854374,1067,assets/images/split/image2193.bin,0,1 +11855441,290,assets/images/split/image2194.bin,0,1 +11855731,1509,assets/images/split/image2195.bin,0,1 +11857240,1491,assets/images/split/image2196.bin,0,1 +11858731,1437,assets/images/split/image2197.bin,0,1 +11860168,1387,assets/images/split/image2198.bin,0,1 +11861555,1415,assets/images/split/image2199.bin,0,1 +11862970,1418,assets/images/split/image2200.bin,0,1 +11864388,378,assets/images/split/image2201.bin,0,1 +11864766,1527,assets/images/split/image2202.bin,0,1 +11866293,1526,assets/images/split/image2203.bin,0,1 +11867819,1421,assets/images/split/image2204.bin,0,1 +11869240,1494,assets/images/split/image2205.bin,0,1 +11870734,1514,assets/images/split/image2206.bin,0,1 +11872248,1318,assets/images/split/image2207.bin,0,1 +11873566,491,assets/images/split/image2208.bin,0,1 +11874057,459,assets/images/split/image2209.bin,0,1 +11874516,492,assets/images/split/image2210.bin,0,1 +11875008,1084,assets/images/split/image2211.bin,0,1 +11876092,1090,assets/images/split/image2212.bin,0,1 +11877182,1083,assets/images/split/image2213.bin,0,1 +11878265,1083,assets/images/split/image2214.bin,0,1 +11879348,1718,assets/images/split/image2215.bin,0,1 +11881066,432,assets/images/split/image2216.bin,0,1 +11881498,431,assets/images/split/image2217.bin,0,1 +11881929,433,assets/images/split/image2218.bin,0,1 +11882362,450,assets/images/split/image2219.bin,0,1 +11882812,795,assets/images/split/image2220.bin,0,1 +11883607,820,assets/images/split/image2221.bin,0,1 +11884427,816,assets/images/split/image2222.bin,0,1 +11885243,837,assets/images/split/image2223.bin,0,1 +11886080,455,assets/images/split/image2224.bin,0,1 +11886535,136,assets/images/split/image2225.bin,0,1 +11886671,50,assets/images/split/image2226.bin,0,1 +11886721,84,assets/images/split/image2227.bin,0,1 +11886805,1609,assets/images/split/image2228.bin,0,1 +11888414,1713,assets/images/split/image2229.bin,0,1 +11890127,1717,assets/images/split/image2230.bin,0,1 +11891844,1128,assets/images/split/image2231.bin,0,1 +11892972,186,assets/images/split/image2232.bin,0,1 +11893158,395,assets/images/split/image2233.bin,0,1 +11893553,143,assets/images/split/image2234.bin,0,1 +11893696,735,assets/images/split/image2235.bin,0,1 +11894431,737,assets/images/split/image2236.bin,0,1 +11895168,1027,assets/images/split/image2237.bin,0,1 +11896195,430,assets/images/split/image2238.bin,0,1 +11896625,736,assets/images/split/image2239.bin,0,1 +11897361,2529,assets/images/split/image2240.bin,0,1 +11899890,2547,assets/images/split/image2241.bin,0,1 +11902437,1461,assets/images/split/image2242.bin,0,1 +11903898,1220,assets/images/split/image2243.bin,0,1 +11905118,1112,assets/images/split/image2244.bin,0,1 +11906230,1917,assets/images/split/image2245.bin,0,1 +11908147,3026,assets/images/split/image2246.bin,0,1 +11911173,2511,assets/images/split/image2247.bin,0,1 +11913684,1667,assets/images/split/image2248.bin,0,1 +11915351,880,assets/images/split/image2249.bin,0,1 +11916231,3211,assets/images/split/image2250.bin,0,1 +11919442,1499,assets/images/split/image2251.bin,0,1 +11920941,1508,assets/images/split/image2252.bin,0,1 +11922449,1428,assets/images/split/image2253.bin,0,1 +11923877,1435,assets/images/split/image2254.bin,0,1 +11925312,1042,assets/images/split/image2255.bin,0,1 +11926354,478,assets/images/split/image2256.bin,0,1 +11926832,731,assets/images/split/image2257.bin,0,1 +11927563,811,assets/images/split/image2258.bin,0,1 +11928374,860,assets/images/split/image2259.bin,0,1 +11929234,691,assets/images/split/image2260.bin,0,1 +11929925,2106,assets/images/split/image2261.bin,0,1 +11932031,1438,assets/images/split/image2262.bin,0,1 +11933469,1770,assets/images/split/image2263.bin,0,1 +11935239,426,assets/images/split/image2264.bin,0,1 +11935665,848,assets/images/split/image2265.bin,0,1 +11936513,1179,assets/images/split/image2266.bin,0,1 +11937692,1792,assets/images/split/image2267.bin,0,1 +11939484,1999,assets/images/split/image2268.bin,0,1 +11941483,1995,assets/images/split/image2269.bin,0,1 +11943478,1749,assets/images/split/image2270.bin,0,1 +11945227,1268,assets/images/split/image2271.bin,0,1 +11946495,1197,assets/images/split/image2272.bin,0,1 +11947692,528,assets/images/split/image2273.bin,0,1 +11948220,834,assets/images/split/image2274.bin,0,1 +11949054,167,assets/images/split/image2275.bin,0,1 +11949221,448,assets/images/split/image2276.bin,0,1 +11949669,851,assets/images/split/image2277.bin,0,1 +11950520,1036,assets/images/split/image2278.bin,0,1 +11951556,954,assets/images/split/image2279.bin,0,1 +11952510,1024,assets/images/split/image2280.bin,0,1 +11953534,3646,assets/images/split/image2281.bin,0,1 +11957180,1058,assets/images/split/image2282.bin,0,1 +11958238,1024,assets/images/split/image2283.bin,0,1 +11959262,661,assets/images/split/image2284.bin,0,1 +11959923,1493,assets/images/split/image2285.bin,0,1 +11961416,547,assets/images/split/image2286.bin,0,1 +11961963,600,assets/images/split/image2287.bin,0,1 +11962563,578,assets/images/split/image2288.bin,0,1 +11963141,442,assets/images/split/image2289.bin,0,1 +11963583,467,assets/images/split/image2290.bin,0,1 +11964050,252,assets/images/split/image2291.bin,0,1 +11964302,494,assets/images/split/image2292.bin,0,1 +11964796,442,assets/images/split/image2293.bin,0,1 +11965238,491,assets/images/split/image2294.bin,0,1 +11965729,574,assets/images/split/image2295.bin,0,1 +11966303,1379,assets/images/split/image2296.bin,0,1 +11967682,443,assets/images/split/image2297.bin,0,1 +11968125,397,assets/images/split/image2298.bin,0,1 +11968522,640,assets/images/split/image2299.bin,0,1 +11969162,157,assets/images/split/image2300.bin,0,1 +11969319,788,assets/images/split/image2301.bin,0,1 +11970107,967,assets/images/split/image2302.bin,0,1 +11971074,1377,assets/images/split/image2303.bin,0,1 +11972451,995,assets/images/split/image2304.bin,0,1 +11973446,1247,assets/images/split/image2305.bin,0,1 +11974693,1068,assets/images/split/image2306.bin,0,1 +11975761,1540,assets/images/split/image2307.bin,0,1 +11977301,241,assets/images/split/image2308.bin,0,1 +11977542,823,assets/images/split/image2309.bin,0,1 +11978365,1098,assets/images/split/image2310.bin,0,1 +11979463,1279,assets/images/split/image2311.bin,0,1 +11980742,407,assets/images/split/image2312.bin,0,1 +11981149,767,assets/images/split/image2313.bin,0,1 +11981916,684,assets/images/split/image2314.bin,0,1 +11982600,774,assets/images/split/image2315.bin,0,1 +11983374,996,assets/images/split/image2316.bin,0,1 +11984370,649,assets/images/split/image2317.bin,0,1 +11985019,666,assets/images/split/image2318.bin,0,1 +11985685,1199,assets/images/split/image2319.bin,0,1 +11986884,1087,assets/images/split/image2320.bin,0,1 +11987971,1008,assets/images/split/image2321.bin,0,1 +11988979,1012,assets/images/split/image2322.bin,0,1 +11989991,1055,assets/images/split/image2323.bin,0,1 +11991046,966,assets/images/split/image2324.bin,0,1 +11992012,1053,assets/images/split/image2325.bin,0,1 +11993065,720,assets/images/split/image2326.bin,0,1 +11993785,659,assets/images/split/image2327.bin,0,1 +11994444,998,assets/images/split/image2328.bin,0,1 +11995442,526,assets/images/split/image2329.bin,0,1 +11995968,887,assets/images/split/image2330.bin,0,1 +11996855,923,assets/images/split/image2331.bin,0,1 +11997778,1308,assets/images/split/image2332.bin,0,1 +11999086,690,assets/images/split/image2333.bin,0,1 +11999776,1284,assets/images/split/image2334.bin,0,1 +12001060,1453,assets/images/split/image2335.bin,0,1 +12002513,739,assets/images/split/image2336.bin,0,1 +12003252,1023,assets/images/split/image2337.bin,0,1 +12004275,423,assets/images/split/image2338.bin,0,1 +12004698,706,assets/images/split/image2339.bin,0,1 +12005404,237,assets/images/split/image2340.bin,0,1 +12005641,722,assets/images/split/image2341.bin,0,1 +12006363,1284,assets/images/split/image2342.bin,0,1 +12007647,1085,assets/images/split/image2343.bin,0,1 +12008732,1049,assets/images/split/image2344.bin,0,1 +12009781,693,assets/images/split/image2345.bin,0,1 +12010474,1548,assets/images/split/image2346.bin,0,1 +12012022,669,assets/images/split/image2347.bin,0,1 +12012691,1262,assets/images/split/image2348.bin,0,1 +12013953,1265,assets/images/split/image2349.bin,0,1 +12015218,566,assets/images/split/image2350.bin,0,1 +12015784,852,assets/images/split/image2351.bin,0,1 +12016636,654,assets/images/split/image2352.bin,0,1 +12017290,1018,assets/images/split/image2353.bin,0,1 +12018308,1234,assets/images/split/image2354.bin,0,1 +12019542,1412,assets/images/split/image2355.bin,0,1 +12020954,1022,assets/images/split/image2356.bin,0,1 +12021976,1195,assets/images/split/image2357.bin,0,1 +12023171,1140,assets/images/split/image2358.bin,0,1 +12024311,1136,assets/images/split/image2359.bin,0,1 +12025447,1088,assets/images/split/image2360.bin,0,1 +12026535,1228,assets/images/split/image2361.bin,0,1 +12027763,1231,assets/images/split/image2362.bin,0,1 +12028994,1191,assets/images/split/image2363.bin,0,1 +12030185,394,assets/images/split/image2364.bin,0,1 +12030579,422,assets/images/split/image2365.bin,0,1 +12031001,330,assets/images/split/image2366.bin,0,1 +12031331,899,assets/images/split/image2367.bin,0,1 +12032230,508,assets/images/split/image2368.bin,0,1 +12032738,389,assets/images/split/image2369.bin,0,1 +12033127,977,assets/images/split/image2370.bin,0,1 +12034104,1204,assets/images/split/image2371.bin,0,1 +12035308,1397,assets/images/split/image2372.bin,0,1 +12036705,1037,assets/images/split/image2373.bin,0,1 +12037742,2035,assets/images/split/image2374.bin,0,1 +12039777,1581,assets/images/split/image2375.bin,0,1 +12041358,780,assets/images/split/image2376.bin,0,1 +12042138,1046,assets/images/split/image2377.bin,0,1 +12043184,1092,assets/images/split/image2378.bin,0,1 +12044276,426,assets/images/split/image2379.bin,0,1 +12044702,545,assets/images/split/image2380.bin,0,1 +12045247,1608,assets/images/split/image2381.bin,0,1 +12046855,1056,assets/images/split/image2382.bin,0,1 +12047911,1021,assets/images/split/image2383.bin,0,1 +12048932,1027,assets/images/split/image2384.bin,0,1 +12049959,1032,assets/images/split/image2385.bin,0,1 +12050991,1109,assets/images/split/image2386.bin,0,1 +12052100,1020,assets/images/split/image2387.bin,0,1 +12053120,1032,assets/images/split/image2388.bin,0,1 +12054152,787,assets/images/split/image2389.bin,0,1 +12054939,813,assets/images/split/image2390.bin,0,1 +12055752,635,assets/images/split/image2391.bin,0,1 +12056387,693,assets/images/split/image2392.bin,0,1 +12057080,1306,assets/images/split/image2393.bin,0,1 +12058386,996,assets/images/split/image2394.bin,0,1 +12059382,659,assets/images/split/image2395.bin,0,1 +12060041,908,assets/images/split/image2396.bin,0,1 +12060949,1171,assets/images/split/image2397.bin,0,1 +12062120,790,assets/images/split/image2398.bin,0,1 +12062910,730,assets/images/split/image2399.bin,0,1 +12063640,694,assets/images/split/image2400.bin,0,1 +12064334,772,assets/images/split/image2401.bin,0,1 +12065106,654,assets/images/split/image2402.bin,0,1 +12065760,895,assets/images/split/image2403.bin,0,1 +12066655,1548,assets/images/split/image2404.bin,0,1 +12068203,1548,assets/images/split/image2405.bin,0,1 +12069751,958,assets/images/split/image2406.bin,0,1 +12070709,1548,assets/images/split/image2407.bin,0,1 +12072257,596,assets/images/split/image2408.bin,0,1 +12072853,1225,assets/images/split/image2409.bin,0,1 +12074078,1548,assets/images/split/image2410.bin,0,1 +12075626,1599,assets/images/split/image2411.bin,0,1 +12077225,1521,assets/images/split/image2412.bin,0,1 +12078746,1791,assets/images/split/image2413.bin,0,1 +12080537,1594,assets/images/split/image2414.bin,0,1 +12082131,746,assets/images/split/image2415.bin,0,1 +12082877,1055,assets/images/split/image2416.bin,0,1 +12083932,829,assets/images/split/image2417.bin,0,1 +12084761,933,assets/images/split/image2418.bin,0,1 +12085694,814,assets/images/split/image2419.bin,0,1 +12086508,1018,assets/images/split/image2420.bin,0,1 +12087526,865,assets/images/split/image2421.bin,0,1 +12088391,1818,assets/images/split/image2422.bin,0,1 +12090209,1940,assets/images/split/image2423.bin,0,1 +12092149,1698,assets/images/split/image2424.bin,0,1 +12093847,545,assets/images/split/image2425.bin,0,1 +12094392,1016,assets/images/split/image2426.bin,0,1 +12095408,796,assets/images/split/image2427.bin,0,1 +12096204,497,assets/images/split/image2428.bin,0,1 +12096701,194,assets/images/split/image2429.bin,0,1 +12096895,522,assets/images/split/image2430.bin,0,1 +12097417,1481,assets/images/split/image2431.bin,0,1 +12098898,171,assets/images/split/image2432.bin,0,1 +12099069,310,assets/images/split/image2433.bin,0,1 +12099379,854,assets/images/split/image2434.bin,0,1 +12100233,785,assets/images/split/image2435.bin,0,1 +12101018,1485,assets/images/split/image2436.bin,0,1 +12102503,481,assets/images/split/image2437.bin,0,1 +12102984,851,assets/images/split/image2438.bin,0,1 +12103835,775,assets/images/split/image2439.bin,0,1 +12104610,378,assets/images/split/image2440.bin,0,1 +12104988,1465,assets/images/split/image2441.bin,0,1 +12106453,828,assets/images/split/image2442.bin,0,1 +12107281,884,assets/images/split/image2443.bin,0,1 +12108165,1013,assets/images/split/image2444.bin,0,1 +12109178,1132,assets/images/split/image2445.bin,0,1 +12110310,770,assets/images/split/image2446.bin,0,1 +12111080,1190,assets/images/split/image2447.bin,0,1 +12112270,945,assets/images/split/image2448.bin,0,1 +12113215,681,assets/images/split/image2449.bin,0,1 +12113896,547,assets/images/split/image2450.bin,0,1 +12114443,165,assets/images/split/image2451.bin,0,1 +12114608,1170,assets/images/split/image2452.bin,0,1 +12115778,196,assets/images/split/image2453.bin,0,1 +12115974,444,assets/images/split/image2454.bin,0,1 +12116418,1081,assets/images/split/image2455.bin,0,1 +12117499,764,assets/images/split/image2456.bin,0,1 +12118263,776,assets/images/split/image2457.bin,0,1 +12119039,85,assets/images/split/image2458.bin,0,1 +12119124,527,assets/images/split/image2459.bin,0,1 +12119651,268,assets/images/split/image2460.bin,0,1 +12119919,369,assets/images/split/image2461.bin,0,1 +12120288,942,assets/images/split/image2462.bin,0,1 +12121230,1812,assets/images/split/image2463.bin,0,1 +12123042,182,assets/images/split/image2464.bin,0,1 +12123224,225,assets/images/split/image2465.bin,0,1 +12123449,531,assets/images/split/image2466.bin,0,1 +12123980,624,assets/images/split/image2467.bin,0,1 +12124604,1383,assets/images/split/image2468.bin,0,1 +12125987,1267,assets/images/split/image2469.bin,0,1 +12127254,346,assets/images/split/image2470.bin,0,1 +12127600,418,assets/images/split/image2471.bin,0,1 +12128018,594,assets/images/split/image2472.bin,0,1 +12128612,648,assets/images/split/image2473.bin,0,1 +12129260,859,assets/images/split/image2474.bin,0,1 +12130119,1300,assets/images/split/image2475.bin,0,1 +12131419,566,assets/images/split/image2476.bin,0,1 +12131985,2104,assets/images/split/image2477.bin,0,1 +12134089,940,assets/images/split/image2478.bin,0,1 +12135029,856,assets/images/split/image2479.bin,0,1 +12135885,756,assets/images/split/image2480.bin,0,1 +12136641,446,assets/images/split/image2481.bin,0,1 +12137087,370,assets/images/split/image2482.bin,0,1 +12137457,845,assets/images/split/image2483.bin,0,1 +12138302,1370,assets/images/split/image2484.bin,0,1 +12139672,1427,assets/images/split/image2485.bin,0,1 +12141099,738,assets/images/split/image2486.bin,0,1 +12141837,591,assets/images/split/image2487.bin,0,1 +12142428,731,assets/images/split/image2488.bin,0,1 +12143159,1263,assets/images/split/image2489.bin,0,1 +12144422,1232,assets/images/split/image2490.bin,0,1 +12145654,861,assets/images/split/image2491.bin,0,1 +12146515,913,assets/images/split/image2492.bin,0,1 +12147428,15,assets/images/split/image2493.bin,0,1 +12147443,1362,assets/images/split/image2494.bin,0,1 +12148805,472,assets/images/split/image2495.bin,0,1 +12149277,1293,assets/images/split/image2496.bin,0,1 +12150570,1448,assets/images/split/image2497.bin,0,1 +12152018,1239,assets/images/split/image2498.bin,0,1 +12153257,906,assets/images/split/image2499.bin,0,1 +12154163,739,assets/images/split/image2500.bin,0,1 +12154902,1130,assets/images/split/image2501.bin,0,1 +12156032,1071,assets/images/split/image2502.bin,0,1 +12157103,913,assets/images/split/image2503.bin,0,1 +12158016,2328,assets/images/split/image2504.bin,0,1 +12160344,2220,assets/images/split/image2505.bin,0,1 +12162564,2340,assets/images/split/image2506.bin,0,1 +12164904,2443,assets/images/split/image2507.bin,0,1 +12167347,2491,assets/images/split/image2508.bin,0,1 +12169838,2459,assets/images/split/image2509.bin,0,1 +12172297,1469,assets/images/split/image2510.bin,0,1 +12173766,1030,assets/images/split/image2511.bin,0,1 +12174796,1065,assets/images/split/image2512.bin,0,1 +12175861,1129,assets/images/split/image2513.bin,0,1 +12176990,1111,assets/images/split/image2514.bin,0,1 +12178101,892,assets/images/split/image2515.bin,0,1 +12178993,1333,assets/images/split/image2516.bin,0,1 +12180326,1897,assets/images/split/image2517.bin,0,1 +12182223,1968,assets/images/split/image2518.bin,0,1 +12184191,1943,assets/images/split/image2519.bin,0,1 +12186134,1780,assets/images/split/image2520.bin,0,1 +12187914,1503,assets/images/split/image2521.bin,0,1 +12189417,1863,assets/images/split/image2522.bin,0,1 +12191280,2095,assets/images/split/image2523.bin,0,1 +12193375,2442,assets/images/split/image2524.bin,0,1 +12195817,2330,assets/images/split/image2525.bin,0,1 +12198147,1781,assets/images/split/image2526.bin,0,1 +12199928,980,assets/images/split/image2527.bin,0,1 +12200908,1106,assets/images/split/image2528.bin,0,1 +12202014,1255,assets/images/split/image2529.bin,0,1 +12203269,2055,assets/images/split/image2530.bin,0,1 +12205324,1961,assets/images/split/image2531.bin,0,1 +12207285,1695,assets/images/split/image2532.bin,0,1 +12208980,2253,assets/images/split/image2533.bin,0,1 +12211233,1786,assets/images/split/image2534.bin,0,1 +12213019,774,assets/images/split/image2535.bin,0,1 +12213793,1099,assets/images/split/image2536.bin,0,1 +12214892,1042,assets/images/split/image2537.bin,0,1 +12215934,2027,assets/images/split/image2538.bin,0,1 +12217961,2341,assets/images/split/image2539.bin,0,1 +12220302,2393,assets/images/split/image2540.bin,0,1 +12222695,2465,assets/images/split/image2541.bin,0,1 +12225160,2384,assets/images/split/image2542.bin,0,1 +12227544,1918,assets/images/split/image2543.bin,0,1 +12229462,2606,assets/images/split/image2544.bin,0,1 +12232068,2251,assets/images/split/image2545.bin,0,1 +12234319,2334,assets/images/split/image2546.bin,0,1 +12236653,2319,assets/images/split/image2547.bin,0,1 +12238972,2280,assets/images/split/image2548.bin,0,1 +12241252,1961,assets/images/split/image2549.bin,0,1 +12243213,2528,assets/images/split/image2550.bin,0,1 +12245741,2235,assets/images/split/image2551.bin,0,1 +12247976,2323,assets/images/split/image2552.bin,0,1 +12250299,1717,assets/images/split/image2553.bin,0,1 +12252016,2109,assets/images/split/image2554.bin,0,1 +12254125,2141,assets/images/split/image2555.bin,0,1 +12256266,2112,assets/images/split/image2556.bin,0,1 +12258378,1578,assets/images/split/image2557.bin,0,1 +12259956,1655,assets/images/split/image2558.bin,0,1 +12261611,1031,assets/images/split/image2559.bin,0,1 +12262642,2231,assets/images/split/image2560.bin,0,1 +12264873,2285,assets/images/split/image2561.bin,0,1 +12267158,2356,assets/images/split/image2562.bin,0,1 +12269514,1840,assets/images/split/image2563.bin,0,1 +12271354,1793,assets/images/split/image2564.bin,0,1 +12273147,1925,assets/images/split/image2565.bin,0,1 +12275072,2146,assets/images/split/image2566.bin,0,1 +12277218,1945,assets/images/split/image2567.bin,0,1 +12279163,2158,assets/images/split/image2568.bin,0,1 +12281321,1819,assets/images/split/image2569.bin,0,1 +12283140,1523,assets/images/split/image2570.bin,0,1 +12284663,1843,assets/images/split/image2571.bin,0,1 +12286506,1880,assets/images/split/image2572.bin,0,1 +12288386,2599,assets/images/split/image2573.bin,0,1 +12290985,2724,assets/images/split/image2574.bin,0,1 +12293709,1889,assets/images/split/image2575.bin,0,1 +12295598,1780,assets/images/split/image2576.bin,0,1 +12297378,1586,assets/images/split/image2577.bin,0,1 +12298964,1675,assets/images/split/image2578.bin,0,1 +12300639,2429,assets/images/split/image2579.bin,0,1 +12303068,2606,assets/images/split/image2580.bin,0,1 +12305674,2456,assets/images/split/image2581.bin,0,1 +12308130,2478,assets/images/split/image2582.bin,0,1 +12310608,2469,assets/images/split/image2583.bin,0,1 +12313077,2221,assets/images/split/image2584.bin,0,1 +12315298,2456,assets/images/split/image2585.bin,0,1 +12317754,2076,assets/images/split/image2586.bin,0,1 +12319830,2286,assets/images/split/image2587.bin,0,1 +12322116,2013,assets/images/split/image2588.bin,0,1 +12324129,2180,assets/images/split/image2589.bin,0,1 +12326309,2425,assets/images/split/image2590.bin,0,1 +12328734,2148,assets/images/split/image2591.bin,0,1 +12330882,2335,assets/images/split/image2592.bin,0,1 +12333217,2230,assets/images/split/image2593.bin,0,1 +12335447,1880,assets/images/split/image2594.bin,0,1 +12337327,2099,assets/images/split/image2595.bin,0,1 +12339426,2670,assets/images/split/image2596.bin,0,1 +12342096,2103,assets/images/split/image2597.bin,0,1 +12344199,2278,assets/images/split/image2598.bin,0,1 +12346477,1321,assets/images/split/image2599.bin,0,1 +12347798,1310,assets/images/split/image2600.bin,0,1 +12349108,1412,assets/images/split/image2601.bin,0,1 +12350520,1446,assets/images/split/image2602.bin,0,1 +12351966,1407,assets/images/split/image2603.bin,0,1 +12353373,1533,assets/images/split/image2604.bin,0,1 +12354906,1226,assets/images/split/image2605.bin,0,1 +12356132,1547,assets/images/split/image2606.bin,0,1 +12357679,1382,assets/images/split/image2607.bin,0,1 +12359061,1452,assets/images/split/image2608.bin,0,1 +12360513,1157,assets/images/split/image2609.bin,0,1 +12361670,1764,assets/images/split/image2610.bin,0,1 +12363434,1290,assets/images/split/image2611.bin,0,1 +12364724,1384,assets/images/split/image2612.bin,0,1 +12366108,1558,assets/images/split/image2613.bin,0,1 +12367666,1439,assets/images/split/image2614.bin,0,1 +12369105,1428,assets/images/split/image2615.bin,0,1 +12370533,1214,assets/images/split/image2616.bin,0,1 +12371747,1356,assets/images/split/image2617.bin,0,1 +12373103,1299,assets/images/split/image2618.bin,0,1 +12374402,1853,assets/images/split/image2619.bin,0,1 +12376255,1762,assets/images/split/image2620.bin,0,1 +12378017,1780,assets/images/split/image2621.bin,0,1 +12379797,1758,assets/images/split/image2622.bin,0,1 +12381555,1647,assets/images/split/image2623.bin,0,1 +12383202,1732,assets/images/split/image2624.bin,0,1 +12384934,1435,assets/images/split/image2625.bin,0,1 +12386369,1882,assets/images/split/image2626.bin,0,1 +12388251,931,assets/images/split/image2627.bin,0,1 +12389182,1658,assets/images/split/image2628.bin,0,1 +12390840,1778,assets/images/split/image2629.bin,0,1 +12392618,650,assets/images/split/image2630.bin,0,1 +12393268,1346,assets/images/split/image2631.bin,0,1 +12394614,53,assets/images/split/image2632.bin,0,1 +12394667,1208,assets/images/split/image2633.bin,0,1 +12395875,1315,assets/images/split/image2634.bin,0,1 +12397190,1319,assets/images/split/image2635.bin,0,1 +12398509,1530,assets/images/split/image2636.bin,0,1 +12400039,1556,assets/images/split/image2637.bin,0,1 +12401595,1289,assets/images/split/image2638.bin,0,1 +12402884,1432,assets/images/split/image2639.bin,0,1 +12404316,1467,assets/images/split/image2640.bin,0,1 +12405783,1255,assets/images/split/image2641.bin,0,1 +12407038,1261,assets/images/split/image2642.bin,0,1 +12408299,1043,assets/images/split/image2643.bin,0,1 +12409342,1074,assets/images/split/image2644.bin,0,1 +12410416,1242,assets/images/split/image2645.bin,0,1 +12411658,1300,assets/images/split/image2646.bin,0,1 +12412958,1195,assets/images/split/image2647.bin,0,1 +12414153,1231,assets/images/split/image2648.bin,0,1 +12415384,1362,assets/images/split/image2649.bin,0,1 +12416746,1212,assets/images/split/image2650.bin,0,1 +12417958,1334,assets/images/split/image2651.bin,0,1 +12419292,1551,assets/images/split/image2652.bin,0,1 +12420843,1347,assets/images/split/image2653.bin,0,1 +12422190,1358,assets/images/split/image2654.bin,0,1 +12423548,1213,assets/images/split/image2655.bin,0,1 +12424761,1219,assets/images/split/image2656.bin,0,1 +12425980,1235,assets/images/split/image2657.bin,0,1 +12427215,1161,assets/images/split/image2658.bin,0,1 +12428376,1687,assets/images/split/image2659.bin,0,1 +12430063,1602,assets/images/split/image2660.bin,0,1 +12431665,1383,assets/images/split/image2661.bin,0,1 +12433048,1308,assets/images/split/image2662.bin,0,1 +12434356,1341,assets/images/split/image2663.bin,0,1 +12435697,1389,assets/images/split/image2664.bin,0,1 +12437086,1374,assets/images/split/image2665.bin,0,1 +12438460,1115,assets/images/split/image2666.bin,0,1 +12439575,1445,assets/images/split/image2667.bin,0,1 +12441020,1451,assets/images/split/image2668.bin,0,1 +12442471,1364,assets/images/split/image2669.bin,0,1 +12443835,1302,assets/images/split/image2670.bin,0,1 +12445137,1407,assets/images/split/image2671.bin,0,1 +12446544,1212,assets/images/split/image2672.bin,0,1 +12447756,160,assets/images/split/image2673.bin,0,1 +12447916,248,assets/images/split/image2674.bin,0,1 +12448164,919,assets/images/split/image2675.bin,0,1 +12449083,188,assets/images/split/image2676.bin,0,1 +12449271,1077,assets/images/split/image2677.bin,0,1 +12450348,2572,assets/images/split/image2678.bin,0,1 +12452920,1845,assets/images/split/image2679.bin,0,1 +12454765,726,assets/images/split/image2680.bin,0,1 +12455491,2270,assets/images/split/image2681.bin,0,1 +12457761,631,assets/images/split/image2682.bin,0,1 +12458392,947,assets/images/split/image2683.bin,0,1 +12459339,948,assets/images/split/image2684.bin,0,1 +12460287,705,assets/images/split/image2685.bin,0,1 +12460992,708,assets/images/split/image2686.bin,0,1 +12461700,2422,assets/images/split/image2687.bin,0,1 +12464122,2504,assets/images/split/image2688.bin,0,1 +12466626,2617,assets/images/split/image2689.bin,0,1 +12469243,2159,assets/images/split/image2690.bin,0,1 +12471402,896,assets/images/split/image2691.bin,0,1 +12472298,1348,assets/images/split/image2692.bin,0,1 +12473646,1299,assets/images/split/image2693.bin,0,1 +12474945,1282,assets/images/split/image2694.bin,0,1 +12476227,1252,assets/images/split/image2695.bin,0,1 +12477479,419,assets/images/split/image2696.bin,0,1 +12477898,513,assets/images/split/image2697.bin,0,1 +12478411,1341,assets/images/split/image2698.bin,0,1 +12479752,8,assets/images/split/image2699.bin,0,1 diff --git a/include/PR/R4300.h b/include/PR/R4300.h new file mode 100644 index 00000000..932694d3 --- /dev/null +++ b/include/PR/R4300.h @@ -0,0 +1,453 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.13 $ + * $Date: 1997/02/11 08:15:34 $ + * $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $ + * + **************************************************************************/ + +#ifndef __R4300_H__ +#define __R4300_H__ + +#include + +/* + * Segment base addresses and sizes + */ +#define KUBASE 0 +#define KUSIZE 0x80000000 +#define K0BASE 0x80000000 +#define K0SIZE 0x20000000 +#define K1BASE 0xA0000000 +#define K1SIZE 0x20000000 +#define K2BASE 0xC0000000 +#define K2SIZE 0x20000000 + +/* + * Exception vectors + */ +#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */ +#define UT_VEC K0BASE /* utlbmiss vector */ +#define R_VEC (K1BASE+0x1fc00000) /* reset vector */ +#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */ +#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */ +#define E_VEC (K0BASE+0x180) /* Gen. exception vector */ + +/* + * Address conversion macros + */ +#ifdef _LANGUAGE_ASSEMBLY + +#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */ +#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */ +#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */ +#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */ +#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */ +#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */ +#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */ + +#else /* _LANGUAGE_C */ + +#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */ +#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */ +#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */ +#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */ +#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */ +#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */ +#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */ + +#endif /* _LANGUAGE_ASSEMBLY */ + +/* + * Address predicates + */ +#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE) +#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE) +#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE) +#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE) +#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE) +#define IS_KUSEG(x) ((u32)(x) < K0BASE) + +/* + * TLB size constants + */ + +#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */ + +#define TLBHI_VPN2MASK 0xffffe000 +#define TLBHI_VPN2SHIFT 13 +#define TLBHI_PIDMASK 0xff +#define TLBHI_PIDSHIFT 0 +#define TLBHI_NPID 255 /* 255 to fit in 8 bits */ + +#define TLBLO_PFNMASK 0x3fffffc0 +#define TLBLO_PFNSHIFT 6 +#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */ +#define TLBLO_CACHSHIFT 3 +#define TLBLO_UNCACHED 0x10 /* not cached */ +#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */ +#define TLBLO_EXLWR 0x28 /* Exclusive write */ +#define TLBLO_D 0x4 /* writeable */ +#define TLBLO_V 0x2 /* valid bit */ +#define TLBLO_G 0x1 /* global access bit */ + +#define TLBINX_PROBE 0x80000000 +#define TLBINX_INXMASK 0x3f +#define TLBINX_INXSHIFT 0 + +#define TLBRAND_RANDMASK 0x3f +#define TLBRAND_RANDSHIFT 0 + +#define TLBWIRED_WIREDMASK 0x3f + +#define TLBCTXT_BASEMASK 0xff800000 +#define TLBCTXT_BASESHIFT 23 +#define TLBCTXT_BASEBITS 9 + +#define TLBCTXT_VPNMASK 0x7ffff0 +#define TLBCTXT_VPNSHIFT 4 + +#define TLBPGMASK_4K 0x0 +#define TLBPGMASK_16K 0x6000 +#define TLBPGMASK_64K 0x1e000 + +/* + * Status register + */ +#define SR_CUMASK 0xf0000000 /* coproc usable bits */ + +#define SR_CU3 0x80000000 /* Coprocessor 3 usable */ +#define SR_CU2 0x40000000 /* Coprocessor 2 usable */ +#define SR_CU1 0x20000000 /* Coprocessor 1 usable */ +#define SR_CU0 0x10000000 /* Coprocessor 0 usable */ +#define SR_RP 0x08000000 /* Reduced power (quarter speed) */ +#define SR_FR 0x04000000 /* MIPS III FP register mode */ +#define SR_RE 0x02000000 /* Reverse endian */ +#define SR_ITS 0x01000000 /* Instruction trace support */ +#define SR_BEV 0x00400000 /* Use boot exception vectors */ +#define SR_TS 0x00200000 /* TLB shutdown */ +#define SR_SR 0x00100000 /* Soft reset occured */ +#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */ +#define SR_CE 0x00020000 /* Create ECC */ +#define SR_DE 0x00010000 /* ECC of parity does not cause error */ + +/* + * Interrupt enable bits + * (NOTE: bits set to 1 enable the corresponding level interrupt) + */ +#define SR_IMASK 0x0000ff00 /* Interrupt mask */ +#define SR_IMASK8 0x00000000 /* mask level 8 */ +#define SR_IMASK7 0x00008000 /* mask level 7 */ +#define SR_IMASK6 0x0000c000 /* mask level 6 */ +#define SR_IMASK5 0x0000e000 /* mask level 5 */ +#define SR_IMASK4 0x0000f000 /* mask level 4 */ +#define SR_IMASK3 0x0000f800 /* mask level 3 */ +#define SR_IMASK2 0x0000fc00 /* mask level 2 */ +#define SR_IMASK1 0x0000fe00 /* mask level 1 */ +#define SR_IMASK0 0x0000ff00 /* mask level 0 */ + +#define SR_IBIT8 0x00008000 /* bit level 8 */ +#define SR_IBIT7 0x00004000 /* bit level 7 */ +#define SR_IBIT6 0x00002000 /* bit level 6 */ +#define SR_IBIT5 0x00001000 /* bit level 5 */ +#define SR_IBIT4 0x00000800 /* bit level 4 */ +#define SR_IBIT3 0x00000400 /* bit level 3 */ +#define SR_IBIT2 0x00000200 /* bit level 2 */ +#define SR_IBIT1 0x00000100 /* bit level 1 */ + +#define SR_IMASKSHIFT 8 + +#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */ +#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */ +#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */ +#define SR_KSU_MASK 0x00000018 /* mode mask */ +#define SR_KSU_USR 0x00000010 /* user mode */ +#define SR_KSU_SUP 0x00000008 /* supervisor mode */ +#define SR_KSU_KER 0x00000000 /* kernel mode */ +#define SR_ERL 0x00000004 /* Error level, 1=>cache error */ +#define SR_EXL 0x00000002 /* Exception level, 1=>exception */ +#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */ + +/* + * Cause Register + */ +#define CAUSE_BD 0x80000000 /* Branch delay slot */ +#define CAUSE_CEMASK 0x30000000 /* coprocessor error */ +#define CAUSE_CESHIFT 28 + +/* Interrupt pending bits */ +#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */ +#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */ +#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */ +#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */ +#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */ +#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */ +#define CAUSE_SW2 0x00000200 /* Software level 2 pending */ +#define CAUSE_SW1 0x00000100 /* Software level 1 pending */ + +#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */ +#define CAUSE_IPSHIFT 8 + +#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */ + +#define CAUSE_EXCSHIFT 2 + +/* Cause register exception codes */ + +#define EXC_CODE(x) ((x)<<2) + +/* Hardware exception codes */ +#define EXC_INT EXC_CODE(0) /* interrupt */ +#define EXC_MOD EXC_CODE(1) /* TLB mod */ +#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */ +#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */ +#define EXC_RADE EXC_CODE(4) /* Read Address Error */ +#define EXC_WADE EXC_CODE(5) /* Write Address Error */ +#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */ +#define EXC_DBE EXC_CODE(7) /* Data Bus Error */ +#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */ +#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */ +#define EXC_II EXC_CODE(10) /* Illegal Instruction */ +#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */ +#define EXC_OV EXC_CODE(12) /* OVerflow */ +#define EXC_TRAP EXC_CODE(13) /* Trap exception */ +#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */ +#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */ +#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */ +#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */ + +/* C0_PRID Defines */ +#define C0_IMPMASK 0xff00 +#define C0_IMPSHIFT 8 +#define C0_REVMASK 0xff +#define C0_MAJREVMASK 0xf0 +#define C0_MAJREVSHIFT 4 +#define C0_MINREVMASK 0xf + +/* + * Coprocessor 0 operations + */ +#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */ +#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */ +#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */ +#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */ +#define C0_RFE 0x10 /* restore for exception */ + +/* + * 'cache' instruction definitions + */ + +/* Target cache */ +#define CACH_PI 0x0 /* specifies primary inst. cache */ +#define CACH_PD 0x1 /* primary data cache */ +#define CACH_SI 0x2 /* secondary instruction cache */ +#define CACH_SD 0x3 /* secondary data cache */ + +/* Cache operations */ +#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */ +#define C_IWBINV 0x0 /* index writeback inval (d, sd) */ +#define C_ILT 0x4 /* index load tag (all) */ +#define C_IST 0x8 /* index store tag (all) */ +#define C_CDX 0xc /* create dirty exclusive (d, sd) */ +#define C_HINV 0x10 /* hit invalidate (all) */ +#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */ +#define C_FILL 0x14 /* fill (i) */ +#define C_HWB 0x18 /* hit writeback (i, d, sd) */ +#define C_HSV 0x1c /* hit set virt. (si, sd) */ + +/* + * Cache size definitions + */ +#define ICACHE_SIZE 0x4000 /* 16K */ +#define ICACHE_LINESIZE 32 /* 8 words */ +#define ICACHE_LINEMASK (ICACHE_LINESIZE-1) + +#define DCACHE_SIZE 0x2000 /* 8K */ +#define DCACHE_LINESIZE 16 /* 4 words */ +#define DCACHE_LINEMASK (DCACHE_LINESIZE-1) + +/* + * C0_CONFIG register definitions + */ +#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */ +#define CONFIG_EC 0x70000000 /* System Clock ratio */ +#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */ +#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */ +#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */ +#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */ +#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */ +#define CONFIG_SB 0x00c00000 /* Secondary cache block size */ + +#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */ +#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */ +#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */ +#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */ +#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/ +#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */ +#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */ +#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */ + +#define CONFIG_IC 0x00000e00 /* Primary Icache size */ +#define CONFIG_DC 0x000001c0 /* Primary Dcache size */ +#define CONFIG_IB 0x00000020 /* Icache block size */ +#define CONFIG_DB 0x00000010 /* Dcache block size */ +#define CONFIG_CU 0x00000008 /* Update on Store-conditional */ +#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */ + +#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */ +#define CONFIG_NONCOHRNT 0x00000003 +#define CONFIG_COHRNT_EXLWR 0x00000005 +#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */ +#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */ +#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */ +#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */ + +/* + * C0_TAGLO definitions for setting/getting cache states and physaddr bits + */ +#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */ +#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */ +#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */ +#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */ +#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */ +#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */ +#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */ +#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */ + +#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */ +#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */ +#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */ +#define PINVALID 0x0000 /* invalid --> 000 == state 0 */ +#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */ +#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */ +#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */ + +/* + * C0_CACHE_ERR definitions. + */ +#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */ +#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */ +#define CACHERR_ED 0x20000000 /* 1: data error */ +#define CACHERR_ET 0x10000000 /* 1: tag error */ +#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/ +#define CACHERR_EE 0x04000000 /* error on SysAD bus */ +#define CACHERR_EB 0x02000000 /* complicated, see spec. */ +#define CACHERR_EI 0x01000000 /* complicated, see spec. */ +#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */ +#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */ +#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */ + +/* R4000 family supports hardware watchpoints: + * C0_WATCHLO: + * bits 31..3 are bits 31..3 of physaddr to watch + * bit 2: reserved; must be written as 0. + * bit 1: when set causes a watchpoint trap on load accesses to paddr. + * bit 0: when set traps on stores to paddr; + * C0_WATCHHI + * bits 31..4 are reserved and must be written as zeros. + * bits 3..0 are bits 35..32 of the physaddr to watch + */ +#define WATCHLO_WTRAP 0x00000001 +#define WATCHLO_RTRAP 0x00000002 +#define WATCHLO_ADDRMASK 0xfffffff8 +#define WATCHLO_VALIDMASK 0xfffffffb +#define WATCHHI_VALIDMASK 0x0000000f + +/* + * Coprocessor 0 registers + */ +#ifdef _LANGUAGE_ASSEMBLY +#define C0_INX $0 +#define C0_RAND $1 +#define C0_ENTRYLO0 $2 +#define C0_ENTRYLO1 $3 +#define C0_CONTEXT $4 +#define C0_PAGEMASK $5 /* page mask */ +#define C0_WIRED $6 /* # wired entries in tlb */ +#define C0_BADVADDR $8 +#define C0_COUNT $9 /* free-running counter */ +#define C0_ENTRYHI $10 +#define C0_SR $12 +#define C0_CAUSE $13 +#define C0_EPC $14 +#define C0_PRID $15 /* revision identifier */ +#define C0_COMPARE $11 /* counter comparison reg. */ +#define C0_CONFIG $16 /* hardware configuration */ +#define C0_LLADDR $17 /* load linked address */ +#define C0_WATCHLO $18 /* watchpoint */ +#define C0_WATCHHI $19 /* watchpoint */ +#define C0_ECC $26 /* S-cache ECC and primary parity */ +#define C0_CACHE_ERR $27 /* cache error status */ +#define C0_TAGLO $28 /* cache operations */ +#define C0_TAGHI $29 /* cache operations */ +#define C0_ERROR_EPC $30 /* ECC error prg. counter */ + +# else /* ! _LANGUAGE_ASSEMBLY */ + +#define C0_INX 0 +#define C0_RAND 1 +#define C0_ENTRYLO0 2 +#define C0_ENTRYLO1 3 +#define C0_CONTEXT 4 +#define C0_PAGEMASK 5 /* page mask */ +#define C0_WIRED 6 /* # wired entries in tlb */ +#define C0_BADVADDR 8 +#define C0_COUNT 9 /* free-running counter */ +#define C0_ENTRYHI 10 +#define C0_SR 12 +#define C0_CAUSE 13 +#define C0_EPC 14 +#define C0_PRID 15 /* revision identifier */ +#define C0_COMPARE 11 /* counter comparison reg. */ +#define C0_CONFIG 16 /* hardware configuration */ +#define C0_LLADDR 17 /* load linked address */ +#define C0_WATCHLO 18 /* watchpoint */ +#define C0_WATCHHI 19 /* watchpoint */ +#define C0_ECC 26 /* S-cache ECC and primary parity */ +#define C0_CACHE_ERR 27 /* cache error status */ +#define C0_TAGLO 28 /* cache operations */ +#define C0_TAGHI 29 /* cache operations */ +#define C0_ERROR_EPC 30 /* ECC error prg. counter */ + +#endif /* _LANGUAGE_ASSEMBLY */ + +/* + * floating-point status register + */ +#define FPCSR_FS 0x01000000 /* flush denorm to zero */ +#define FPCSR_C 0x00800000 /* condition bit */ +#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */ +#define FPCSR_CV 0x00010000 /* cause: invalid operation */ +#define FPCSR_CZ 0x00008000 /* cause: division by zero */ +#define FPCSR_CO 0x00004000 /* cause: overflow */ +#define FPCSR_CU 0x00002000 /* cause: underflow */ +#define FPCSR_CI 0x00001000 /* cause: inexact operation */ +#define FPCSR_EV 0x00000800 /* enable: invalid operation */ +#define FPCSR_EZ 0x00000400 /* enable: division by zero */ +#define FPCSR_EO 0x00000200 /* enable: overflow */ +#define FPCSR_EU 0x00000100 /* enable: underflow */ +#define FPCSR_EI 0x00000080 /* enable: inexact operation */ +#define FPCSR_FV 0x00000040 /* flag: invalid operation */ +#define FPCSR_FZ 0x00000020 /* flag: division by zero */ +#define FPCSR_FO 0x00000010 /* flag: overflow */ +#define FPCSR_FU 0x00000008 /* flag: underflow */ +#define FPCSR_FI 0x00000004 /* flag: inexact operation */ +#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */ +#define FPCSR_RM_RN 0x00000000 /* round to nearest */ +#define FPCSR_RM_RZ 0x00000001 /* round to zero */ +#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */ +#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */ + +#endif /* __R4300_H */ diff --git a/include/PR/abi.h b/include/PR/abi.h new file mode 100644 index 00000000..2631214f --- /dev/null +++ b/include/PR/abi.h @@ -0,0 +1,841 @@ +#ifndef _ABI_H_ +#define _ABI_H_ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.32 $ + * $Date: 1997/02/11 08:16:37 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/abi.h,v $ + * + **************************************************************************/ + +/* + * Header file for the Audio Binary Interface. + * This is included in the Media Binary Interface file + * mbi.h. + * + * This file follows the framework used for graphics. + * + */ + +/* Audio commands: */ +#define A_SPNOOP 0 +#define A_ADPCM 1 +#define A_CLEARBUFF 2 +#define A_RESAMPLE 5 +#define A_SETBUFF 8 +#define A_DMEMMOVE 10 +#define A_LOADADPCM 11 +#define A_MIXER 12 +#define A_INTERLEAVE 13 +#define A_SETLOOP 15 + +#ifndef VERSION_SH + +#define A_ENVMIXER 3 +#define A_LOADBUFF 4 +#define A_RESAMPLE 5 +#define A_SAVEBUFF 6 +#define A_SEGMENT 7 +#define A_SETVOL 9 +#define A_POLEF 14 + +#else + +#define A_ADDMIXER 4 +#define A_RESAMPLE_ZOH 6 +#define A_INTERL 17 +#define A_ENVSETUP1 18 +#define A_ENVMIXER 19 +#define A_LOADBUFF 20 +#define A_SAVEBUFF 21 +#define A_ENVSETUP2 22 +#define A_UNK_23 23 +#define A_HILOGAIN 24 +#define A_UNK_25 25 +#define A_DUPLICATE 26 +#define A_FILTER 27 + +#endif + +#define ACMD_SIZE 32 +/* + * Audio flags + */ + +#define A_INIT 0x01 +#define A_CONTINUE 0x00 +#define A_LOOP 0x02 +#define A_OUT 0x02 +#define A_LEFT 0x02 +#define A_RIGHT 0x00 +#define A_VOL 0x04 +#define A_RATE 0x00 +#define A_AUX 0x08 +#define A_NOAUX 0x00 +#define A_MAIN 0x00 +#define A_MIX 0x10 + +/* + * BEGIN C-specific section: (typedef's) + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* + * Data Structures. + */ + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int addr; +} Aadpcm; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int addr; +} Apolef; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Aenvelope; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int dmem:16; + unsigned int pad2:16; + unsigned int count:16; +} Aclearbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int pad2:16; + unsigned int inL:16; + unsigned int inR:16; +} Ainterleave; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int addr; +} Aloadbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Aenvmixer; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int dmemi:16; + unsigned int dmemo:16; +} Amixer; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int dmem2:16; + unsigned int addr; +} Apan; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pitch:16; + unsigned int addr; +} Aresample; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Areverb; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int addr; +} Asavebuff; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int pad2:2; + unsigned int number:4; + unsigned int base:24; +} Asegment; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int dmemin:16; + unsigned int dmemout:16; + unsigned int count:16; +} Asetbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int vol:16; + unsigned int voltgt:16; + unsigned int volrate:16; +} Asetvol; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int dmemin:16; + unsigned int dmemout:16; + unsigned int count:16; +} Admemmove; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int count:16; + unsigned int addr; +} Aloadadpcm; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int pad2:16; + unsigned int addr; +} Asetloop; + +/* + * Generic Acmd Packet + */ + +typedef struct { + uintptr_t w0; + uintptr_t w1; +} Awords; + +typedef union { + Awords words; +#if IS_BIG_ENDIAN && !IS_64_BIT + Aadpcm adpcm; + Apolef polef; + Aclearbuff clearbuff; + Aenvelope envelope; + Ainterleave interleave; + Aloadbuff loadbuff; + Aenvmixer envmixer; + Aresample resample; + Areverb reverb; + Asavebuff savebuff; + Asegment segment; + Asetbuff setbuff; + Asetvol setvol; + Admemmove dmemmove; + Aloadadpcm loadadpcm; + Amixer mixer; + Asetloop setloop; +#endif + long long int force_union_align; /* dummy, force alignment */ +} Acmd; + +/* + * ADPCM State + */ +typedef short ADPCM_STATE[16]; + +/* + * Pole filter state + */ +typedef short POLEF_STATE[4]; + +/* + * Resampler state + */ +typedef short RESAMPLE_STATE[16]; + +/* + * Resampler constants + */ +#define UNITY_PITCH 0x8000 +#define MAX_RATIO 1.99996 /* within .03 cents of +1 octave */ + +/* + * Enveloper/Mixer state + */ +typedef short ENVMIX_STATE[40]; + +/* + * Macros to assemble the audio command list + */ + +/* + * Info about parameters: + * + * A "count" in the following macros is always measured in bytes. + * + * All volumes/gains are in Q1.15 signed fixed point numbers: + * 0x8000 is the minimum volume (-100%), negating the audio curve. + * 0x0000 is silent. + * 0x7fff is maximum volume (99.997%). + * + * All DRAM addresses refer to segmented addresses. A segment table shall + * first be set up by calling aSegment for each segment. When a DRAM + * address is later used as parameter, the 8 high bits will be an index + * to the segment table and the lower 24 bits are added to the base address + * stored in the segment table for this entry. The result is the physical address. + * + * Transfers to/from DRAM are executed using DMA and hence follow these restrictions: + * All DRAM addresses should be aligned by 8 bytes, or they will be + * rounded down to the nearest multiple of 8 bytes. + * All DRAM lengths should be aligned by 8 bytes, or they will be + * rounded up to the nearest multiple of 8 bytes. + */ + +/* + * Decompresses ADPCM data. + * Possible flags: A_INIT and A_LOOP. + * + * First set up internal data in DMEM: + * aLoadADPCM(cmd++, nEntries * 16, physicalAddressOfBook) + * aSetLoop(cmd++, physicalAddressOfLoopState) (if A_LOOP is set) + * + * Then before this command, call: + * aSetBuffer(cmd++, 0, in, out, count) + * + * Note: count will be rounded up to the nearest multiple of 32 bytes. + * + * ADPCM decompression works on a block of 16 (uncompressed) samples. + * The previous 2 samples and 9 bytes of input are decompressed to + * 16 new samples using the code book previously loaded. + * + * Before the algorithm starts, the previous 16 samples are loaded according to flag: + * A_INIT: all zeros + * A_LOOP: the address set by aSetLoop + * no flags: the DRAM address in the s parameter + * These 16 samples are immediately copied to the destination address. + * + * The result of "count" bytes will be written after these 16 initial samples. + * The last 16 samples written to the destination will also be written to + * the state address in DRAM. + */ +#define aADPCMdec(pkt, f, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +#define aADPCM_23(pkt, f, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_UNK_23, 24, 8) | _SHIFTL(f, 16, 8); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Not used in SM64. + */ +#define aPoleFilter(pkt, f, g, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Clears DMEM data, where d is address and c is count, by writing zeros. + * + * Note: c is rounded up to the nearest multiple of 16 bytes. + */ +#define aClearBuffer(pkt, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \ + _a->words.w1 = (uintptr_t)(c); \ +} + +/* + * Mixes an envelope with mono sound into 2 or 4 channels. + * Possible flags: A_INIT, A_AUX (indicates that 4 channels should be used). + * + * Before this command, call: + * aSetBuffer(cmd++, 0, inBuf, dryLeft, count) + * aSetBuffer(cmd++, A_AUX, dryRight, wetLeft, wetRight) + * + * The first time (A_INIT is set), volume also needs to be set: + * aSetVolume(cmd++, A_VOL | A_LEFT, initialVolumeLeft, 0, 0) + * aSetVolume(cmd++, A_VOL | A_RIGHT, initialVolumeRight, 0, 0) + * aSetVolume32(cmd++, A_RATE | A_LEFT, targetVolumeLeft, rampLeft) + * aSetVolume32(cmd++, A_RATE | A_RIGHT, targetVolumeRight, rampRight) + * aSetVolume(cmd++, A_AUX, dryVolume, 0, wetVolume) + * + * This command will now mix samples in inBuf into the destination buffers (dry and wet), + * but with the volume increased (or decreased) from initial volumes to target volumes, + * with the specified ramp rate. Once the target volume is reached, the volume stays + * at that level. Before the samples are finally mixed (added) into the destination + * buffers (dry and wet), the volume is changed according to dryVolume and wetVolume. + * + * Note: count will be rounded up to the nearest multiple of 16 bytes. + * Note: the wet channels are used for reverb. + * + */ +#define aEnvMixer(pkt, f, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Interleaves two mono channels into stereo. + * + * First call: + * aSetBuffer(cmd++, 0, 0, output, count) + * + * The count refers to the size of each input. Hence 2 * count bytes will be written out. + * A left sample will be placed before the right sample. + * + * Note: count will be rounded up to the nearest multiple of 16 bytes. + */ +#define aInterleave(pkt, l, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \ + _a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +/* + * Loads a buffer from DRAM to DMEM. + * + * First call: + * aSetBuffer(cmd++, 0, in, 0, count) + * + * The in parameter to aSetBuffer is the destination in DMEM and the + * s parameter to this command is the source in DRAM. + */ +#define aLoadBuffer(pkt, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Mixes audio. + * Possible flags: no flags used, although parameter present. + * + * First call: + * aSetBuffer(cmd++, 0, 0, 0, count) + * + * Input and output addresses are taken from the i and o parameters. + * The volume with which the input is changed is taken from the g parameter. + * After the volume of the input samples have been changed, the result + * is added to the output. + * + * Note: count will be rounded up to the nearest multiple of 32 bytes. + */ +#define aMix(pkt, f, g, i, o) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = _SHIFTL(i,16, 16) | _SHIFTL(o, 0, 16); \ +} + +// Not present in the audio microcode. +#define aPan(pkt, f, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(d, 0, 16)); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Resamples audio. + * Possible flags: A_INIT, A_OUT? (not used in SM64). + * + * First call: + * aSetBuffer(cmd++, 0, in, out, count) + * + * This command resamples the audio using the given frequency ratio (pitch) + * using a filter that uses a window of 4 source samples. This can be used + * either for just resampling audio to be able to be played back at a different + * sample rate, or to change the pitch if the result is played back at + * the same sample rate as the input. + * + * The frequency ratio is given in UQ1.15 fixed point format. + * For no change in frequency, use pitch 0x8000. + * For 1 octave up or downsampling to (roughly) half number of samples, use pitch 0xffff. + * For 1 octave down or upsampling to double as many samples, use pitch 0x4000. + * + * Note: count represents the number of output sample bytes and is rounded up to + * the nearest multiple of 16 bytes. + * + * The state consists of the four following source samples when the algorithm stopped as + * well as a fractional position, and is initialized to all zeros if A_INIT is given. + * Otherwise it is loaded from DRAM at address s. + * + * The algorithm starts by writing the four source samples from the state (or zero) + * to just before the input address given. It then creates one output sample by examining + * the four next source samples and then moving the source position zero or more + * samples forward. The first output sample (when A_INIT is given) is always 0. + * + * When "count" bytes have been written, the following four source samples + * are written to the state in DRAM as well as a fractional position. + */ +#define aResample(pkt, f, p, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\ + _SHIFTL(p, 0, 16)); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Stores a buffer in DMEM to DRAM. + * + * First call: + * aSetBuffer(cmd++, 0, 0, out, count) + * + * The out parameter to aSetBuffer is the source in DMEM and the + * s parameter to this command is the destination in DRAM. + */ +#define aSaveBuffer(pkt, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Sets up an entry in the segment table. + * + * The s parameter is a segment index, 0 to 15. + * The b parameter is the base offset. + */ +#define aSegment(pkt, s, b) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_SEGMENT, 24, 8); \ + _a->words.w1 = _SHIFTL(s, 24, 8) | _SHIFTL(b, 0, 24); \ +} + +/* + * Sets internal DMEM buffer addresses used for later commands. + * See each command for how to use aSetBuffer. + */ +#define aSetBuffer(pkt, f, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(i, 0, 16)); \ + _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ +} + +#define aInterl(pkt, f, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_INTERL, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(i, 0, 16)); \ + _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ +} + +/* + * Sets internal volume parameters. + * See aEnvMixer for more info. + */ +#define aSetVolume(pkt, f, v, t, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ + _SHIFTL(v, 0, 16)); \ + _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +/* + * Sets the address to ADPCM loop state. + * + * The a parameter is a DRAM address. + * See aADPCMdec for more info. + */ +#define aSetLoop(pkt, a) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + _a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \ + _a->words.w1 = (uintptr_t)(a); \ +} + +/* + * Copies memory in DMEM. + * + * Copies c bytes from address i to address o. + * + * Note: count is rounded up to the nearest multiple of 16 bytes. + * + * Note: This acts as memcpy where 16 bytes are moved at a time, therefore + * if input and output overlap, output address should be less than input address. + */ +#define aDMEMMove(pkt, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_DMEMMOVE, 24, 8) | _SHIFTL(i, 0, 24); \ + _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ +} + +/* + * Loads ADPCM book from DRAM into DMEM. + * + * This command loads ADPCM table entries from DRAM to DMEM. + * + * The count parameter c should be a multiple of 16 bytes. + * The d parameter is a DRAM address. + */ +#define aLoadADPCM(pkt, c, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ + _a->words.w1 = (uintptr_t) (d); \ +} + +// This is a version of aSetVolume which takes a single 32-bit parameter +// instead of two 16-bit ones. According to AziAudio, it is used to set +// ramping values when neither bit 4 nor bit 8 is set in the flags parameter. +// It does not appear in the official abi.h header. +/* + * Sets internal volume parameters. + * See aEnvMixer for more info. + */ +#define aSetVolume32(pkt, f, v, tr) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ + _SHIFTL(v, 0, 16)); \ + _a->words.w1 = (uintptr_t)(tr); \ +} + +#ifdef VERSION_SH +#undef aLoadBuffer +#undef aSaveBuffer +#undef aMix +#undef aEnvMixer +#undef aInterleave + +/* + * Mix two tracks by simple clamped addition. + * + * s: DMEM source track 1 + * d: DMEM source track 2 and destination + * c: number of bytes to write (rounded down to 16 byte alignment) + */ +#define aAddMixer(pkt, s, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ADDMIXER, 24, 8) | \ + _SHIFTL((c) >> 4, 16, 8) | _SHIFTL(0x7fff, 0, 16)); \ + _a->words.w1 = (_SHIFTL(s, 16, 16) | _SHIFTL(d, 0, 16)); \ +} + +/* + * Loads a buffer from DRAM to DMEM. + * + * s: DRAM source + * d: DMEM destination + * c: number of bytes to copy (rounded down to 16 byte alignment) + */ +#define aLoadBuffer(pkt, s, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8) | \ + _SHIFTL((c) >> 4, 16, 8) | _SHIFTL(d, 0, 16); \ + _a->words.w1 = (uintptr_t)(s); \ +} + +/* + * Stores a buffer from DMEM to DRAM. + * + * s: DMEM source + * d: DRAM destination + * c: number of bytes to copy (rounded down to 16 byte alignment) + */ +#define aSaveBuffer(pkt, s, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8) | \ + _SHIFTL((c) >> 4, 16, 8) | _SHIFTL(s, 0, 16); \ + _a->words.w1 = (uintptr_t)(d); \ +} + +/* + * Duplicates 128 bytes of data a number of times. + * + * 128 bytes are read from source DMEM address s. + * Then c identical copies of these bytes are written to DMEM address d. + */ +#define aDuplicate(pkt, s, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_DUPLICATE, 24, 8) | \ + _SHIFTL(c, 16, 8) | _SHIFTL(s, 0, 16)); \ + _a->words.w1 = (_SHIFTL(d, 16, 16) | _SHIFTL(0x80, 0, 16)); \ +} + +/* + * Fast resample. + * + * Before this command, call: + * aSetBuffer(cmd++, 0, in, out, count) + * + * This works like the other resample command but just takes the "nearest" sample, + * instead of a function of the four nearest samples. + */ +#define aResampleZoh(pkt, pitch, start_fract) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_RESAMPLE_ZOH, 24, 8) | \ + _SHIFTL(pitch, 0, 16)); \ + _a->words.w1 = _SHIFTL(start_fract, 0, 16); \ +} + +/* + * Mixes audio. + * + * Input and output addresses are taken from the i and o parameters. + * The volume with which the input is changed is taken from the g parameter. + * After the volume of the input samples have been changed, the result + * is added to the output. + * + * Note: count is first rounded down to the nearest multiple of 16 bytes + * and then rounded up to the nearest multiple of 32 bytes. + */ +#define aMix(pkt, g, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | \ + _SHIFTL((c) >> 4, 16, 8) | _SHIFTL(g, 0, 16)); \ + _a->words.w1 = _SHIFTL(i, 16, 16) | _SHIFTL(o, 0, 16); \ +} + +#define aEnvSetup1(pkt, a, b, c, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | \ + _SHIFTL(a, 16, 8) | _SHIFTL(b, 0, 16)); \ + _a->words.w1 = _SHIFTL(c, 16, 16) | _SHIFTL(d, 0, 16); \ +} + +#define aEnvSetup2(pkt, volLeft, volRight) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_ENVSETUP2, 24, 8); \ + _a->words.w1 = _SHIFTL(volLeft, 16, 16) | \ + _SHIFTL(volRight, 0, 16); \ +} + +#define aEnvMixer(pkt, inBuf, nSamples, bit1, bit2, bit3, dryLeft, dryRight, wetLeft, wetRight) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ENVMIXER, 24, 8) | \ + _SHIFTL((inBuf) >> 4, 16, 8) | \ + _SHIFTL(nSamples, 8, 8)) | \ + _SHIFTL(bit1, 2, 1) | _SHIFTL(bit2, 1, 1) | \ + _SHIFTL(bit3, 0, 1); \ + _a->words.w1 = _SHIFTL((dryLeft) >> 4, 24, 8) | \ + _SHIFTL((dryRight) >> 4, 16, 8) | \ + _SHIFTL((wetLeft) >> 4, 8, 8) | \ + _SHIFTL((wetRight) >> 4, 0, 8); \ +} + +#define aInterleave(pkt, o, l, r, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8) | \ + _SHIFTL((c) >> 4, 16, 8) | _SHIFTL(o, 0, 16); \ + _a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +// countOrBuf meaning depends on flag +#define aFilter(pkt, f, countOrBuf, addr) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_FILTER, 24, 8) | _SHIFTL((f), 16, 8) | \ + _SHIFTL((countOrBuf), 0, 16); \ + _a->words.w1 = (uintptr_t)(addr); \ +} + +#define aHilogain(pkt, id, buflen, i) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_HILOGAIN, 24, 8) | \ + _SHIFTL((id), 16, 8) | _SHIFTL((buflen), 0, 16); \ + _a->words.w1 = _SHIFTL((i), 16, 16); \ +} + +#define aUnknown25(pkt, f, g, i, o) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_UNK_25, 24, 8) | \ + _SHIFTL((f), 16, 8) | _SHIFTL((g), 0, 16)); \ + _a->words.w1 = _SHIFTL((i), 16, 16) | _SHIFTL((o), 0, 16); \ +} + +#endif + +#endif /* _LANGUAGE_C */ + +#endif /* !_ABI_H_ */ diff --git a/include/PR/gbi.h b/include/PR/gbi.h new file mode 100644 index 00000000..ebfab07e --- /dev/null +++ b/include/PR/gbi.h @@ -0,0 +1,4801 @@ +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ +/************************************************************************** + * + * $Revision: 1.141 $ + * $Date: 1999/09/03 03:43:08 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gbi.h,v $ + * + **************************************************************************/ + +#ifndef _GBI_H_ +#define _GBI_H_ + +#include + +/* + * To use the F3DEX ucodes, define F3DEX_GBI before include this file. + * + * #define F3DEX_GBI + * #include + * + * or + * + * cc -c -DF3DEX_GBI -I.... foo.c + * + */ + +/************************************************************************** + * + * Graphics Binary Interface + * + **************************************************************************/ + +/* + * Graphics Commands, 'xxx' parts may be generated from ucode + * + * The command format is + * + * |00xxxxxx| = DMA 0,..,127 + * |10xxxxxx| = Immediate Mode -65,..,-128 + * |11xxxxxx| = RDP cmds -1,..,-64 + * + * Note: in order for the RSP microcode to process RDP commands opaquely, + * we need to further identify those RDP commands that need DRAM address + * "fixup". To do this, we have the dummy command G_RDP_ADDR_FIXUP, and + * all |RDP commands| less than this are commands with embedded DRAM + * addresses. Further, the format of these commands should be similar so + * only one fixup routine is needed. + * + * Further explanation: + * The names of the commands are somewhat misleading. Here is clarification: + * + * - a 'DMA' type command has a pointer to additional data and + * causes a DMA transfer to bring that into DMEM. + * + * - an 'Immediate' type command isn't really 'immediate', in the + * traditional sense. This just means that the entire command fits + * in the 64-bit word, and the ucode can execute it 'immediately' + * without additional memory transfers. + * + * - an 'RDP' command is identified as such because the RDP + * commands can be passed-thru the RSP and sent to the RDP + * directly. One further confusing thing, is that some 'DP' + * macros below actually generate immediate commands, not + * not direct DP commands. + * + * IMPLEMENTATION NOTE: + * There is another group of RDP commands that includes the triangle commands + * generated by the RSP code. These are the raw commands the rasterizer + * hardware chews on, with slope info, etc. They will follow the RDP + * ordering... + * + * IMPLEMENTATION NOTE: + * The RDP hardware has some of these bit patterns wired up. If the hardware + * changes, we must adjust this table, likewise we can't change/add things + * once the hardware is frozen. (actually, the RDP hardware only looks at + * the lower 6 bits of the command byte) + * + */ + +#ifdef F3DEX_GBI_2E +# ifndef F3DEX_GBI_2 +# define F3DEX_GBI_2 +# endif +# define GBI_FLOATS +#endif + +#ifdef F3DEX_GBI_2 +# ifndef F3DEX_GBI +# define F3DEX_GBI +# endif +#define G_NOOP 0x00 +#define G_RDPHALF_2 0xf1 +#define G_SETOTHERMODE_H 0xe3 +#define G_SETOTHERMODE_L 0xe2 +#define G_RDPHALF_1 0xe1 +#define G_SPNOOP 0xe0 +#define G_ENDDL 0xdf +#define G_DL 0xde +#define G_LOAD_UCODE 0xdd +#define G_MOVEMEM 0xdc +#define G_MOVEWORD 0xdb +#define G_MTX 0xda +#define G_GEOMETRYMODE 0xd9 +#define G_POPMTX 0xd8 +#define G_TEXTURE 0xd7 +#define G_DMA_IO 0xd6 +#define G_SPECIAL_1 0xd5 +#define G_SPECIAL_2 0xd4 +#define G_SPECIAL_3 0xd3 + +#define G_VTX 0x01 +#define G_MODIFYVTX 0x02 +#define G_CULLDL 0x03 +#define G_BRANCH_Z 0x04 +#define G_TRI1 0x05 +#define G_TRI2 0x06 +#define G_QUAD 0x07 +#define G_LINE3D 0x08 +#else /* F3DEX_GBI_2 */ + +/* DMA commands: */ +#define G_SPNOOP 0 /* handle 0 gracefully */ +#define G_MTX 1 +#define G_RESERVED0 2 /* not implemeted */ +#define G_MOVEMEM 3 /* move a block of memory (up to 4 words) to dmem */ +#define G_VTX 4 +#define G_RESERVED1 5 /* not implemeted */ +#define G_DL 6 +#define G_RESERVED2 7 /* not implemeted */ +#define G_RESERVED3 8 /* not implemeted */ +#define G_SPRITE2D_BASE 9 /* sprite command */ + +/* IMMEDIATE commands: */ +#define G_IMMFIRST -65 +#define G_TRI1 (G_IMMFIRST-0) +#define G_CULLDL (G_IMMFIRST-1) +#define G_POPMTX (G_IMMFIRST-2) +#define G_MOVEWORD (G_IMMFIRST-3) +#define G_TEXTURE (G_IMMFIRST-4) +#define G_SETOTHERMODE_H (G_IMMFIRST-5) +#define G_SETOTHERMODE_L (G_IMMFIRST-6) +#define G_ENDDL (G_IMMFIRST-7) +#define G_SETGEOMETRYMODE (G_IMMFIRST-8) +#define G_CLEARGEOMETRYMODE (G_IMMFIRST-9) +#define G_LINE3D (G_IMMFIRST-10) +#define G_RDPHALF_1 (G_IMMFIRST-11) +#define G_RDPHALF_2 (G_IMMFIRST-12) +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_MODIFYVTX (G_IMMFIRST-13) +# define G_TRI2 (G_IMMFIRST-14) +# define G_BRANCH_Z (G_IMMFIRST-15) +# define G_LOAD_UCODE (G_IMMFIRST-16) +#else +# define G_RDPHALF_CONT (G_IMMFIRST-13) +#endif + +/* We are overloading 2 of the immediate commands + to keep the byte alignment of dmem the same */ + +#define G_SPRITE2D_SCALEFLIP (G_IMMFIRST-1) +#define G_SPRITE2D_DRAW (G_IMMFIRST-2) + +/* RDP commands: */ +#define G_NOOP 0xc0 /* 0 */ + +#endif /* F3DEX_GBI_2 */ + +/* RDP commands: */ +#define G_SETCIMG 0xff /* -1 */ +#define G_SETZIMG 0xfe /* -2 */ +#define G_SETTIMG 0xfd /* -3 */ +#define G_SETCOMBINE 0xfc /* -4 */ +#define G_SETENVCOLOR 0xfb /* -5 */ +#define G_SETPRIMCOLOR 0xfa /* -6 */ +#define G_SETBLENDCOLOR 0xf9 /* -7 */ +#define G_SETFOGCOLOR 0xf8 /* -8 */ +#define G_SETFILLCOLOR 0xf7 /* -9 */ +#define G_FILLRECT 0xf6 /* -10 */ +#define G_SETTILE 0xf5 /* -11 */ +#define G_LOADTILE 0xf4 /* -12 */ +#define G_LOADBLOCK 0xf3 /* -13 */ +#define G_SETTILESIZE 0xf2 /* -14 */ +#define G_LOADTLUT 0xf0 /* -16 */ +#define G_RDPSETOTHERMODE 0xef /* -17 */ +#define G_SETPRIMDEPTH 0xee /* -18 */ +#define G_SETSCISSOR 0xed /* -19 */ +#define G_SETCONVERT 0xec /* -20 */ +#define G_SETKEYR 0xeb /* -21 */ +#define G_SETKEYGB 0xea /* -22 */ +#define G_RDPFULLSYNC 0xe9 /* -23 */ +#define G_RDPTILESYNC 0xe8 /* -24 */ +#define G_RDPPIPESYNC 0xe7 /* -25 */ +#define G_RDPLOADSYNC 0xe6 /* -26 */ +#define G_TEXRECTFLIP 0xe5 /* -27 */ +#define G_TEXRECT 0xe4 /* -28 */ + + +/* + * The following commands are the "generated" RDP commands; the user + * never sees them, the RSP microcode generates them. + * + * The layout of the bits is magical, to save work in the ucode. + * These id's are -56, -52, -54, -50, -55, -51, -53, -49, ... + * edge, shade, texture, zbuff bits: estz + */ +#define G_TRI_FILL 0xc8 /* fill triangle: 11001000 */ +#define G_TRI_SHADE 0xcc /* shade triangle: 11001100 */ +#define G_TRI_TXTR 0xca /* texture triangle: 11001010 */ +#define G_TRI_SHADE_TXTR 0xce /* shade, texture triangle: 11001110 */ +#define G_TRI_FILL_ZBUFF 0xc9 /* fill, zbuff triangle: 11001001 */ +#define G_TRI_SHADE_ZBUFF 0xcd /* shade, zbuff triangle: 11001101 */ +#define G_TRI_TXTR_ZBUFF 0xcb /* texture, zbuff triangle: 11001011 */ +#define G_TRI_SHADE_TXTR_ZBUFF 0xcf /* shade, txtr, zbuff trngl: 11001111 */ + +/* + * A TRI_FILL triangle is just the edges. You need to set the DP + * to use primcolor, in order to see anything. (it is NOT a triangle + * that gets rendered in 'fill mode'. Triangles can't be rendered + * in 'fill mode') + * + * A TRI_SHADE is a gouraud triangle that has colors interpolated. + * Flat-shaded triangles (from the software) are still gouraud shaded, + * it's just the colors are all the same and the deltas are 0. + * + * Other triangle types, and combinations are more obvious. + */ + +/* masks to build RDP triangle commands: */ +#define G_RDP_TRI_FILL_MASK 0x08 +#define G_RDP_TRI_SHADE_MASK 0x04 +#define G_RDP_TRI_TXTR_MASK 0x02 +#define G_RDP_TRI_ZBUFF_MASK 0x01 + +/* + * HACK: + * This is a dreadful hack. For version 1.0 hardware, there are still + * some 'bowtie' hangs. This parameter can be increased to avoid + * the hangs. Every increase of 4 chops one scanline off of every + * triangle. Values of 4,8,12 should be sufficient to avoid any + * bowtie hang. + * + * Change this value, then recompile ALL of your program (including static + * display lists!) + * + * THIS WILL BE REMOVED FOR HARDWARE VERSION 2.0! + */ +#define BOWTIE_VAL 0 + + +/* gets added to RDP command, in order to test for addres fixup: */ +#define G_RDP_ADDR_FIXUP 3 /* |RDP cmds| <= this, do addr fixup */ +#ifdef _LANGUAGE_ASSEMBLY +#define G_RDP_TEXRECT_CHECK ((-1*G_TEXRECTFLIP)& 0xff) +#endif + +/* macros for command parsing: */ +#define GDMACMD(x) (x) +#define GIMMCMD(x) (G_IMMFIRST-(x)) +#define GRDPCMD(x) (0xff-(x)) + +#define G_DMACMDSIZ 128 +#define G_IMMCMDSIZ 64 +#define G_RDPCMDSIZ 64 + +/* + * Coordinate shift values, number of bits of fraction + */ +#define G_TEXTURE_IMAGE_FRAC 2 +#define G_TEXTURE_SCALE_FRAC 16 +#define G_SCALE_FRAC 8 +#define G_ROTATE_FRAC 16 + +/* + * Parameters to graphics commands + */ + +/* + * Data packing macros + */ + +/* + * Maximum z-buffer value, used to initialize the z-buffer. + * Note : this number is NOT the viewport z-scale constant. + * See the comment next to G_MAXZ for more info. + */ +#define G_MAXFBZ 0x3fff /* 3b exp, 11b mantissa */ + +#define GPACK_RGBA5551(r, g, b, a) ((((r)<<8) & 0xf800) | \ + (((g)<<3) & 0x7c0) | \ + (((b)>>2) & 0x3e) | ((a) & 0x1)) +#define GPACK_ZDZ(z, dz) ((z) << 2 | (dz)) + +/* + * G_MTX: parameter flags + */ +#ifdef F3DEX_GBI_2 +# define G_MTX_MODELVIEW 0x00 /* matrix types */ +# define G_MTX_PROJECTION 0x04 +# define G_MTX_MUL 0x00 /* concat or load */ +# define G_MTX_LOAD 0x02 +# define G_MTX_NOPUSH 0x00 /* push or not */ +# define G_MTX_PUSH 0x01 +#else /* F3DEX_GBI_2 */ +# define G_MTX_MODELVIEW 0x00 /* matrix types */ +# define G_MTX_PROJECTION 0x01 +# define G_MTX_MUL 0x00 /* concat or load */ +# define G_MTX_LOAD 0x02 +# define G_MTX_NOPUSH 0x00 /* push or not */ +# define G_MTX_PUSH 0x04 +#endif /* F3DEX_GBI_2 */ + +/* + * flags for G_SETGEOMETRYMODE + * (this rendering state is maintained in RSP) + * + * DO NOT USE THE LOW 8 BITS OF GEOMETRYMODE: + * The weird bit-ordering is for the micro-code: the lower byte + * can be OR'd in with G_TRI_SHADE (11001100) to construct + * the triangle command directly. Don't break it... + * + * DO NOT USE THE HIGH 8 BITS OF GEOMETRYMODE: + * The high byte is OR'd with 0x703 to form the clip code mask. + * If it is set to 0x04, this will cause near clipping to occur. + * If it is zero, near clipping will not occur. + * + * Further explanation: + * G_SHADE is necessary in order to see the color that you passed + * down with the vertex. If G_SHADE isn't set, you need to set the DP + * appropriately and use primcolor to see anything. + * + * G_SHADING_SMOOTH enabled means use all 3 colors of the triangle. + * If it is not set, then do 'flat shading', where only one vertex color + * is used (and all 3 vertices are set to that same color by the ucode) + * See the man page for gSP1Triangle(). + * + */ +#define G_ZBUFFER 0x00000001 +#define G_SHADE 0x00000004 /* enable Gouraud interp */ +/* rest of low byte reserved for setup ucode */ +#ifdef F3DEX_GBI_2 +# define G_TEXTURE_ENABLE 0x00000000 /* Ignored */ +# define G_SHADING_SMOOTH 0x00200000 /* flat or smooth shaded */ +# define G_CULL_FRONT 0x00000200 +# define G_CULL_BACK 0x00000400 +# define G_CULL_BOTH 0x00000600 /* To make code cleaner */ +#else +# define G_TEXTURE_ENABLE 0x00000002 /* Microcode use only */ +# define G_SHADING_SMOOTH 0x00000200 /* flat or smooth shaded */ +# define G_CULL_FRONT 0x00001000 +# define G_CULL_BACK 0x00002000 +# define G_CULL_BOTH 0x00003000 /* To make code cleaner */ +#endif +#define G_FOG 0x00010000 +#define G_LIGHTING 0x00020000 +#define G_TEXTURE_GEN 0x00040000 +#define G_TEXTURE_GEN_LINEAR 0x00080000 +#define G_LOD 0x00100000 /* NOT IMPLEMENTED */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_CLIPPING 0x00800000 +#else +# define G_CLIPPING 0x00000000 +#endif + +#ifdef _LANGUAGE_ASSEMBLY +#define G_FOG_H (G_FOG/0x10000) +#define G_LIGHTING_H (G_LIGHTING/0x10000) +#define G_TEXTURE_GEN_H (G_TEXTURE_GEN/0x10000) +#define G_TEXTURE_GEN_LINEAR_H (G_TEXTURE_GEN_LINEAR/0x10000) +#define G_LOD_H (G_LOD/0x10000) /* NOT IMPLEMENTED */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_CLIPPING_H (G_CLIPPING/0x10000) +#endif +#endif + +/* Need these defined for Sprite Microcode */ +#ifdef _LANGUAGE_ASSEMBLY +#define G_TX_LOADTILE 7 +#define G_TX_RENDERTILE 0 + +#define G_TX_NOMIRROR 0 +#define G_TX_WRAP 0 +#define G_TX_MIRROR 0x1 +#define G_TX_CLAMP 0x2 +#define G_TX_NOMASK 0 +#define G_TX_NOLOD 0 +#endif + +/* + * G_SETIMG fmt: set image formats + */ +#define G_IM_FMT_RGBA 0 +#define G_IM_FMT_YUV 1 +#define G_IM_FMT_CI 2 +#define G_IM_FMT_IA 3 +#define G_IM_FMT_I 4 + +/* + * G_SETIMG siz: set image pixel size + */ +#define G_IM_SIZ_4b 0 +#define G_IM_SIZ_8b 1 +#define G_IM_SIZ_16b 2 +#define G_IM_SIZ_32b 3 +#define G_IM_SIZ_DD 5 + +#define G_IM_SIZ_4b_BYTES 0 +#define G_IM_SIZ_4b_TILE_BYTES G_IM_SIZ_4b_BYTES +#define G_IM_SIZ_4b_LINE_BYTES G_IM_SIZ_4b_BYTES + +#define G_IM_SIZ_8b_BYTES 1 +#define G_IM_SIZ_8b_TILE_BYTES G_IM_SIZ_8b_BYTES +#define G_IM_SIZ_8b_LINE_BYTES G_IM_SIZ_8b_BYTES + +#define G_IM_SIZ_16b_BYTES 2 +#define G_IM_SIZ_16b_TILE_BYTES G_IM_SIZ_16b_BYTES +#define G_IM_SIZ_16b_LINE_BYTES G_IM_SIZ_16b_BYTES + +#define G_IM_SIZ_32b_BYTES 4 +#define G_IM_SIZ_32b_TILE_BYTES 2 +#define G_IM_SIZ_32b_LINE_BYTES 2 + +#define G_IM_SIZ_4b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_8b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_16b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_32b_LOAD_BLOCK G_IM_SIZ_32b + +#define G_IM_SIZ_4b_SHIFT 2 +#define G_IM_SIZ_8b_SHIFT 1 +#define G_IM_SIZ_16b_SHIFT 0 +#define G_IM_SIZ_32b_SHIFT 0 + +#define G_IM_SIZ_4b_INCR 3 +#define G_IM_SIZ_8b_INCR 1 +#define G_IM_SIZ_16b_INCR 0 +#define G_IM_SIZ_32b_INCR 0 + +/* + * G_SETCOMBINE: color combine modes + */ +/* Color combiner constants: */ +#define G_CCMUX_COMBINED 0 +#define G_CCMUX_TEXEL0 1 +#define G_CCMUX_TEXEL1 2 +#define G_CCMUX_PRIMITIVE 3 +#define G_CCMUX_SHADE 4 +#define G_CCMUX_ENVIRONMENT 5 +#define G_CCMUX_CENTER 6 +#define G_CCMUX_SCALE 6 +#define G_CCMUX_COMBINED_ALPHA 7 +#define G_CCMUX_TEXEL0_ALPHA 8 +#define G_CCMUX_TEXEL1_ALPHA 9 +#define G_CCMUX_PRIMITIVE_ALPHA 10 +#define G_CCMUX_SHADE_ALPHA 11 +#define G_CCMUX_ENV_ALPHA 12 +#define G_CCMUX_LOD_FRACTION 13 +#define G_CCMUX_PRIM_LOD_FRAC 14 +#define G_CCMUX_NOISE 7 +#define G_CCMUX_K4 7 +#define G_CCMUX_K5 15 +#define G_CCMUX_1 6 +#define G_CCMUX_0 31 + +/* Alpha combiner constants: */ +#define G_ACMUX_COMBINED 0 +#define G_ACMUX_TEXEL0 1 +#define G_ACMUX_TEXEL1 2 +#define G_ACMUX_PRIMITIVE 3 +#define G_ACMUX_SHADE 4 +#define G_ACMUX_ENVIRONMENT 5 +#define G_ACMUX_LOD_FRACTION 0 +#define G_ACMUX_PRIM_LOD_FRAC 6 +#define G_ACMUX_1 6 +#define G_ACMUX_0 7 + +/* typical CC cycle 1 modes */ +#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE +#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE + +#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE +#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0 +#define G_CC_MODULATEIFADE TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT + +#define G_CC_MODULATERGB G_CC_MODULATEI +#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA +#define G_CC_MODULATERGBFADE G_CC_MODULATEIFADE + +#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0 +#define G_CC_MODULATEIFADEA TEXEL0, 0, SHADE, 0, TEXEL0, 0, ENVIRONMENT, 0 + +#define G_CC_MODULATEFADE TEXEL0, 0, SHADE, 0, ENVIRONMENT, 0, TEXEL0, 0 + +#define G_CC_MODULATERGBA G_CC_MODULATEIA +#define G_CC_MODULATERGBFADEA G_CC_MODULATEIFADEA + +#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE +#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0 +#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0 + +#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM +#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM +#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM + +#define G_CC_FADE SHADE, 0, ENVIRONMENT, 0, SHADE, 0, ENVIRONMENT, 0 +#define G_CC_FADEA TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0 + +#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE +#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0 +#define G_CC_DECALFADE 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT + +#define G_CC_DECALFADEA 0, 0, 0, TEXEL0, TEXEL0, 0, ENVIRONMENT, 0 + +#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0 +#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0 + +#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_BLENDRGBFADEA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, ENVIRONMENT + +#define G_CC_ADDRGB TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_ADDRGBDECALA TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_ADDRGBFADE TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, ENVIRONMENT + +#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0 + +#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE +#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0 + +#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_SHADEFADEA 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT + +#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0 +#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0 + +/* oddball modes */ +#define _G_CC_BLENDPE ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, SHADE, 0 +#define _G_CC_BLENDPEDECALA ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0 +#define _G_CC_TWOCOLORTEX PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +/* used for 1-cycle sparse mip-maps, primitive color has color of lowest LOD */ +#define _G_CC_SPARSEST PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0 +#define G_CC_TEMPLERP TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0 + +/* typical CC cycle 1 modes, usually followed by other cycle 2 modes */ +#define G_CC_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0 +#define G_CC_INTERFERENCE TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0 + +/* + * One-cycle color convert operation + */ +#define G_CC_1CYUV2RGB TEXEL0, K4, K5, TEXEL0, 0, 0, 0, SHADE + +/* + * NOTE: YUV2RGB expects TF step1 color conversion to occur in 2nd clock. + * Therefore, CC looks for step1 results in TEXEL1 + */ +#define G_CC_YUV2RGB TEXEL1, K4, K5, TEXEL1, 0, 0, 0, 0 + +/* typical CC cycle 2 modes */ +#define G_CC_PASS2 0, 0, 0, COMBINED, 0, 0, 0, COMBINED +#define G_CC_MODULATEI2 COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE +#define G_CC_MODULATEIA2 COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0 +#define G_CC_MODULATERGB2 G_CC_MODULATEI2 +#define G_CC_MODULATERGBA2 G_CC_MODULATEIA2 +#define G_CC_MODULATEI_PRIM2 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE +#define G_CC_MODULATEIA_PRIM2 COMBINED, 0, PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0 +#define G_CC_MODULATERGB_PRIM2 G_CC_MODULATEI_PRIM2 +#define G_CC_MODULATERGBA_PRIM2 G_CC_MODULATEIA_PRIM2 +#define G_CC_DECALRGB2 0, 0, 0, COMBINED, 0, 0, 0, SHADE +/* + * ? +#define G_CC_DECALRGBA2 COMBINED, SHADE, COMBINED_ALPHA, SHADE, 0, 0, 0, SHADE +*/ +#define G_CC_BLENDI2 ENVIRONMENT, SHADE, COMBINED, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDIA2 ENVIRONMENT, SHADE, COMBINED, SHADE, COMBINED, 0, SHADE, 0 +#define G_CC_CHROMA_KEY2 TEXEL0, CENTER, SCALE, 0, 0, 0, 0, 0 +#define G_CC_HILITERGB2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, SHADE +#define G_CC_HILITERGBA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, ENVIRONMENT, COMBINED, TEXEL0, COMBINED +#define G_CC_HILITERGBDECALA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, TEXEL0 +#define G_CC_HILITERGBPASSA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, COMBINED + +/* + * G_SETOTHERMODE_L sft: shift count + */ +#define G_MDSFT_ALPHACOMPARE 0 +#define G_MDSFT_ZSRCSEL 2 +#define G_MDSFT_RENDERMODE 3 +#define G_MDSFT_BLENDER 16 + +/* + * G_SETOTHERMODE_H sft: shift count + */ +#define G_MDSFT_BLENDMASK 0 /* unsupported */ +#define G_MDSFT_ALPHADITHER 4 +#define G_MDSFT_RGBDITHER 6 + +#define G_MDSFT_COMBKEY 8 +#define G_MDSFT_TEXTCONV 9 +#define G_MDSFT_TEXTFILT 12 +#define G_MDSFT_TEXTLUT 14 +#define G_MDSFT_TEXTLOD 16 +#define G_MDSFT_TEXTDETAIL 17 +#define G_MDSFT_TEXTPERSP 19 +#define G_MDSFT_CYCLETYPE 20 +#define G_MDSFT_COLORDITHER 22 /* unsupported in HW 2.0 */ +#define G_MDSFT_PIPELINE 23 + +/* G_SETOTHERMODE_H gPipelineMode */ +#define G_PM_1PRIMITIVE (1 << G_MDSFT_PIPELINE) +#define G_PM_NPRIMITIVE (0 << G_MDSFT_PIPELINE) + +/* G_SETOTHERMODE_H gSetCycleType */ +#define G_CYC_1CYCLE (0 << G_MDSFT_CYCLETYPE) +#define G_CYC_2CYCLE (1 << G_MDSFT_CYCLETYPE) +#define G_CYC_COPY (2 << G_MDSFT_CYCLETYPE) +#define G_CYC_FILL (3 << G_MDSFT_CYCLETYPE) + +/* G_SETOTHERMODE_H gSetTexturePersp */ +#define G_TP_NONE (0 << G_MDSFT_TEXTPERSP) +#define G_TP_PERSP (1 << G_MDSFT_TEXTPERSP) + +/* G_SETOTHERMODE_H gSetTextureDetail */ +#define G_TD_CLAMP (0 << G_MDSFT_TEXTDETAIL) +#define G_TD_SHARPEN (1 << G_MDSFT_TEXTDETAIL) +#define G_TD_DETAIL (2 << G_MDSFT_TEXTDETAIL) + +/* G_SETOTHERMODE_H gSetTextureLOD */ +#define G_TL_TILE (0 << G_MDSFT_TEXTLOD) +#define G_TL_LOD (1 << G_MDSFT_TEXTLOD) + +/* G_SETOTHERMODE_H gSetTextureLUT */ +#define G_TT_NONE (0 << G_MDSFT_TEXTLUT) +#define G_TT_RGBA16 (2 << G_MDSFT_TEXTLUT) +#define G_TT_IA16 (3 << G_MDSFT_TEXTLUT) + +/* G_SETOTHERMODE_H gSetTextureFilter */ +#define G_TF_POINT (0 << G_MDSFT_TEXTFILT) +#define G_TF_AVERAGE (3 << G_MDSFT_TEXTFILT) +#define G_TF_BILERP (2 << G_MDSFT_TEXTFILT) + +/* G_SETOTHERMODE_H gSetTextureConvert */ +#define G_TC_CONV (0 << G_MDSFT_TEXTCONV) +#define G_TC_FILTCONV (5 << G_MDSFT_TEXTCONV) +#define G_TC_FILT (6 << G_MDSFT_TEXTCONV) + +/* G_SETOTHERMODE_H gSetCombineKey */ +#define G_CK_NONE (0 << G_MDSFT_COMBKEY) +#define G_CK_KEY (1 << G_MDSFT_COMBKEY) + +/* G_SETOTHERMODE_H gSetColorDither */ +#define G_CD_MAGICSQ (0 << G_MDSFT_RGBDITHER) +#define G_CD_BAYER (1 << G_MDSFT_RGBDITHER) +#define G_CD_NOISE (2 << G_MDSFT_RGBDITHER) + +#ifndef _HW_VERSION_1 +#define G_CD_DISABLE (3 << G_MDSFT_RGBDITHER) +#define G_CD_ENABLE G_CD_NOISE /* HW 1.0 compatibility mode */ +#else +#define G_CD_ENABLE (1 << G_MDSFT_COLORDITHER) +#define G_CD_DISABLE (0 << G_MDSFT_COLORDITHER) +#endif + +/* G_SETOTHERMODE_H gSetAlphaDither */ +#define G_AD_PATTERN (0 << G_MDSFT_ALPHADITHER) +#define G_AD_NOTPATTERN (1 << G_MDSFT_ALPHADITHER) +#define G_AD_NOISE (2 << G_MDSFT_ALPHADITHER) +#define G_AD_DISABLE (3 << G_MDSFT_ALPHADITHER) + +/* G_SETOTHERMODE_L gSetAlphaCompare */ +#define G_AC_NONE (0 << G_MDSFT_ALPHACOMPARE) +#define G_AC_THRESHOLD (1 << G_MDSFT_ALPHACOMPARE) +#define G_AC_DITHER (3 << G_MDSFT_ALPHACOMPARE) + +/* G_SETOTHERMODE_L gSetDepthSource */ +#define G_ZS_PIXEL (0 << G_MDSFT_ZSRCSEL) +#define G_ZS_PRIM (1 << G_MDSFT_ZSRCSEL) + +/* G_SETOTHERMODE_L gSetRenderMode */ +#define AA_EN 0x8 +#define Z_CMP 0x10 +#define Z_UPD 0x20 +#define IM_RD 0x40 +#define CLR_ON_CVG 0x80 +#define CVG_DST_CLAMP 0 +#define CVG_DST_WRAP 0x100 +#define CVG_DST_FULL 0x200 +#define CVG_DST_SAVE 0x300 +#define ZMODE_OPA 0 +#define ZMODE_INTER 0x400 +#define ZMODE_XLU 0x800 +#define ZMODE_DEC 0xc00 +#define CVG_X_ALPHA 0x1000 +#define ALPHA_CVG_SEL 0x2000 +#define FORCE_BL 0x4000 +#define TEX_EDGE 0x0000 /* used to be 0x8000 */ + +#define G_BL_CLR_IN 0 +#define G_BL_CLR_MEM 1 +#define G_BL_CLR_BL 2 +#define G_BL_CLR_FOG 3 +#define G_BL_1MA 0 +#define G_BL_A_MEM 1 +#define G_BL_A_IN 0 +#define G_BL_A_FOG 1 +#define G_BL_A_SHADE 2 +#define G_BL_1 2 +#define G_BL_0 3 + +#define GBL_c1(m1a, m1b, m2a, m2b) \ + (m1a) << 30 | (m1b) << 26 | (m2a) << 22 | (m2b) << 18 +#define GBL_c2(m1a, m1b, m2a, m2b) \ + (m1a) << 28 | (m1b) << 24 | (m2a) << 20 | (m2b) << 16 + +#define RM_AA_ZB_OPA_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_SURF(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_DECAL(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ALPHA_CVG_SEL | \ + ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_DECAL(clk) \ + AA_EN | Z_CMP | CVG_DST_WRAP | ALPHA_CVG_SEL | \ + ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_DECAL(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ALPHA_CVG_SEL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \ + ALPHA_CVG_SEL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_INTER(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_XLU_LINE(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_DEC_LINE(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_TEX_EDGE(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_TEX_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_INTER | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_SUB_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_PCL_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_TEX_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_SUB_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + + +#define RM_AA_OPA_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_OPA_SURF(clk) \ + AA_EN | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_XLU_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | \ + ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_XLU_LINE(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_DEC_LINE(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_TEX_EDGE(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_SUB_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_PCL_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_OPA_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_TEX_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_SUB_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + + +#define RM_ZB_OPA_SURF(clk) \ + Z_CMP | Z_UPD | CVG_DST_FULL | ALPHA_CVG_SEL | \ + ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_ZB_XLU_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_OPA_DECAL(clk) \ + Z_CMP | CVG_DST_FULL | ALPHA_CVG_SEL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_ZB_XLU_DECAL(clk) \ + Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_CLD_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_OVL_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_PCL_SURF(clk) \ + Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | \ + G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + + +#define RM_OPA_SURF(clk) \ + CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_XLU_SURF(clk) \ + IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_TEX_EDGE(clk) \ + CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL |\ + ZMODE_OPA | TEX_EDGE | AA_EN | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_CLD_SURF(clk) \ + IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_PCL_SURF(clk) \ + CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \ + G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_ADD(clk) \ + IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1) + +#define RM_NOOP(clk) \ + GBL_c##clk(0, 0, 0, 0) + +#define RM_VISCVG(clk) \ + IM_RD | FORCE_BL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM) + +/* for rendering to an 8-bit framebuffer */ +#define RM_OPA_CI(clk) \ + CVG_DST_CLAMP | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +/* Custom version of RM_AA_ZB_XLU_SURF with Z_UPD */ +#define RM_CUSTOM_AA_ZB_XLU_SURF(clk) \ + RM_AA_ZB_XLU_SURF(clk) | Z_UPD + + +#define G_RM_AA_ZB_OPA_SURF RM_AA_ZB_OPA_SURF(1) +#define G_RM_AA_ZB_OPA_SURF2 RM_AA_ZB_OPA_SURF(2) +#define G_RM_AA_ZB_XLU_SURF RM_AA_ZB_XLU_SURF(1) +#define G_RM_AA_ZB_XLU_SURF2 RM_AA_ZB_XLU_SURF(2) +#define G_RM_AA_ZB_OPA_DECAL RM_AA_ZB_OPA_DECAL(1) +#define G_RM_AA_ZB_OPA_DECAL2 RM_AA_ZB_OPA_DECAL(2) +#define G_RM_AA_ZB_XLU_DECAL RM_AA_ZB_XLU_DECAL(1) +#define G_RM_AA_ZB_XLU_DECAL2 RM_AA_ZB_XLU_DECAL(2) +#define G_RM_AA_ZB_OPA_INTER RM_AA_ZB_OPA_INTER(1) +#define G_RM_AA_ZB_OPA_INTER2 RM_AA_ZB_OPA_INTER(2) +#define G_RM_AA_ZB_XLU_INTER RM_AA_ZB_XLU_INTER(1) +#define G_RM_AA_ZB_XLU_INTER2 RM_AA_ZB_XLU_INTER(2) +#define G_RM_AA_ZB_XLU_LINE RM_AA_ZB_XLU_LINE(1) +#define G_RM_AA_ZB_XLU_LINE2 RM_AA_ZB_XLU_LINE(2) +#define G_RM_AA_ZB_DEC_LINE RM_AA_ZB_DEC_LINE(1) +#define G_RM_AA_ZB_DEC_LINE2 RM_AA_ZB_DEC_LINE(2) +#define G_RM_AA_ZB_TEX_EDGE RM_AA_ZB_TEX_EDGE(1) +#define G_RM_AA_ZB_TEX_EDGE2 RM_AA_ZB_TEX_EDGE(2) +#define G_RM_AA_ZB_TEX_INTER RM_AA_ZB_TEX_INTER(1) +#define G_RM_AA_ZB_TEX_INTER2 RM_AA_ZB_TEX_INTER(2) +#define G_RM_AA_ZB_SUB_SURF RM_AA_ZB_SUB_SURF(1) +#define G_RM_AA_ZB_SUB_SURF2 RM_AA_ZB_SUB_SURF(2) +#define G_RM_AA_ZB_PCL_SURF RM_AA_ZB_PCL_SURF(1) +#define G_RM_AA_ZB_PCL_SURF2 RM_AA_ZB_PCL_SURF(2) +#define G_RM_AA_ZB_OPA_TERR RM_AA_ZB_OPA_TERR(1) +#define G_RM_AA_ZB_OPA_TERR2 RM_AA_ZB_OPA_TERR(2) +#define G_RM_AA_ZB_TEX_TERR RM_AA_ZB_TEX_TERR(1) +#define G_RM_AA_ZB_TEX_TERR2 RM_AA_ZB_TEX_TERR(2) +#define G_RM_AA_ZB_SUB_TERR RM_AA_ZB_SUB_TERR(1) +#define G_RM_AA_ZB_SUB_TERR2 RM_AA_ZB_SUB_TERR(2) + +#define G_RM_RA_ZB_OPA_SURF RM_RA_ZB_OPA_SURF(1) +#define G_RM_RA_ZB_OPA_SURF2 RM_RA_ZB_OPA_SURF(2) +#define G_RM_RA_ZB_OPA_DECAL RM_RA_ZB_OPA_DECAL(1) +#define G_RM_RA_ZB_OPA_DECAL2 RM_RA_ZB_OPA_DECAL(2) +#define G_RM_RA_ZB_OPA_INTER RM_RA_ZB_OPA_INTER(1) +#define G_RM_RA_ZB_OPA_INTER2 RM_RA_ZB_OPA_INTER(2) + +#define G_RM_AA_OPA_SURF RM_AA_OPA_SURF(1) +#define G_RM_AA_OPA_SURF2 RM_AA_OPA_SURF(2) +#define G_RM_AA_XLU_SURF RM_AA_XLU_SURF(1) +#define G_RM_AA_XLU_SURF2 RM_AA_XLU_SURF(2) +#define G_RM_AA_XLU_LINE RM_AA_XLU_LINE(1) +#define G_RM_AA_XLU_LINE2 RM_AA_XLU_LINE(2) +#define G_RM_AA_DEC_LINE RM_AA_DEC_LINE(1) +#define G_RM_AA_DEC_LINE2 RM_AA_DEC_LINE(2) +#define G_RM_AA_TEX_EDGE RM_AA_TEX_EDGE(1) +#define G_RM_AA_TEX_EDGE2 RM_AA_TEX_EDGE(2) +#define G_RM_AA_SUB_SURF RM_AA_SUB_SURF(1) +#define G_RM_AA_SUB_SURF2 RM_AA_SUB_SURF(2) +#define G_RM_AA_PCL_SURF RM_AA_PCL_SURF(1) +#define G_RM_AA_PCL_SURF2 RM_AA_PCL_SURF(2) +#define G_RM_AA_OPA_TERR RM_AA_OPA_TERR(1) +#define G_RM_AA_OPA_TERR2 RM_AA_OPA_TERR(2) +#define G_RM_AA_TEX_TERR RM_AA_TEX_TERR(1) +#define G_RM_AA_TEX_TERR2 RM_AA_TEX_TERR(2) +#define G_RM_AA_SUB_TERR RM_AA_SUB_TERR(1) +#define G_RM_AA_SUB_TERR2 RM_AA_SUB_TERR(2) + +#define G_RM_RA_OPA_SURF RM_RA_OPA_SURF(1) +#define G_RM_RA_OPA_SURF2 RM_RA_OPA_SURF(2) + +#define G_RM_ZB_OPA_SURF RM_ZB_OPA_SURF(1) +#define G_RM_ZB_OPA_SURF2 RM_ZB_OPA_SURF(2) +#define G_RM_ZB_XLU_SURF RM_ZB_XLU_SURF(1) +#define G_RM_ZB_XLU_SURF2 RM_ZB_XLU_SURF(2) +#define G_RM_ZB_OPA_DECAL RM_ZB_OPA_DECAL(1) +#define G_RM_ZB_OPA_DECAL2 RM_ZB_OPA_DECAL(2) +#define G_RM_ZB_XLU_DECAL RM_ZB_XLU_DECAL(1) +#define G_RM_ZB_XLU_DECAL2 RM_ZB_XLU_DECAL(2) +#define G_RM_ZB_CLD_SURF RM_ZB_CLD_SURF(1) +#define G_RM_ZB_CLD_SURF2 RM_ZB_CLD_SURF(2) +#define G_RM_ZB_OVL_SURF RM_ZB_OVL_SURF(1) +#define G_RM_ZB_OVL_SURF2 RM_ZB_OVL_SURF(2) +#define G_RM_ZB_PCL_SURF RM_ZB_PCL_SURF(1) +#define G_RM_ZB_PCL_SURF2 RM_ZB_PCL_SURF(2) + +#define G_RM_OPA_SURF RM_OPA_SURF(1) +#define G_RM_OPA_SURF2 RM_OPA_SURF(2) +#define G_RM_XLU_SURF RM_XLU_SURF(1) +#define G_RM_XLU_SURF2 RM_XLU_SURF(2) +#define G_RM_CLD_SURF RM_CLD_SURF(1) +#define G_RM_CLD_SURF2 RM_CLD_SURF(2) +#define G_RM_TEX_EDGE RM_TEX_EDGE(1) +#define G_RM_TEX_EDGE2 RM_TEX_EDGE(2) +#define G_RM_PCL_SURF RM_PCL_SURF(1) +#define G_RM_PCL_SURF2 RM_PCL_SURF(2) +#define G_RM_ADD RM_ADD(1) +#define G_RM_ADD2 RM_ADD(2) +#define G_RM_NOOP RM_NOOP(1) +#define G_RM_NOOP2 RM_NOOP(2) +#define G_RM_VISCVG RM_VISCVG(1) +#define G_RM_VISCVG2 RM_VISCVG(2) +#define G_RM_OPA_CI RM_OPA_CI(1) +#define G_RM_OPA_CI2 RM_OPA_CI(2) + +#define G_RM_CUSTOM_AA_ZB_XLU_SURF RM_CUSTOM_AA_ZB_XLU_SURF(1) +#define G_RM_CUSTOM_AA_ZB_XLU_SURF2 RM_CUSTOM_AA_ZB_XLU_SURF(2) + + +#define G_RM_FOG_SHADE_A GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA) +#define G_RM_FOG_PRIM_A GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA) +#define G_RM_PASS GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +/* + * G_SETCONVERT: K0-5 + */ +#define G_CV_K0 175 +#define G_CV_K1 -43 +#define G_CV_K2 -89 +#define G_CV_K3 222 +#define G_CV_K4 114 +#define G_CV_K5 42 + +/* + * G_SETSCISSOR: interlace mode + */ +#define G_SC_NON_INTERLACE 0 +#define G_SC_ODD_INTERLACE 3 +#define G_SC_EVEN_INTERLACE 2 + +/* flags to inhibit pushing of the display list (on branch) */ +#define G_DL_PUSH 0x00 +#define G_DL_NOPUSH 0x01 + +/* + * BEGIN C-specific section: (typedef's) + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* + * Data Structures + * + * NOTE: + * The DMA transfer hardware requires 64-bit aligned, 64-bit multiple- + * sized transfers. This important hardware optimization is unfortunately + * reflected in the programming interface, with some structures + * padded and alignment enforced. + * + * Since structures are aligned to the boundary of the "worst-case" + * element, we can't depend on the C compiler to align things + * properly. + * + * 64-bit structure alignment is enforced by wrapping structures with + * unions that contain a dummy "long long int". Why this works is + * explained in the ANSI C Spec, or on page 186 of the second edition + * of K&R, "The C Programming Language". + * + * The price we pay for this is a little awkwardness referencing the + * structures through the union. There is no memory penalty, since + * all the structures are at least 64-bits the dummy alignment field + * does not increase the size of the union. + * + * Static initialization of these union structures works because + * the ANSI C spec states that static initialization for unions + * works by using the first union element. We put the dummy alignment + * field last for this reason. + * + * (it's possible a newer 64-bit compiler from MIPS might make this + * easier with a flag, but we can't wait for it...) + * + */ + +/* + * Vertex (set up for use with colors) + */ +typedef struct { +#ifndef GBI_FLOATS + short ob[3]; /* x, y, z */ +#else + float ob[3]; /* x, y, z */ +#endif + unsigned short flag; + short tc[2]; /* texture coord */ + unsigned char cn[4]; /* color & alpha */ +} Vtx_t; + +/* + * Vertex (set up for use with normals) + */ +typedef struct { +#ifndef GBI_FLOATS + short ob[3]; /* x, y, z */ +#else + float ob[3]; /* x, y, z */ +#endif + unsigned short flag; + short tc[2]; /* texture coord */ + signed char n[3]; /* normal */ + unsigned char a; /* alpha */ +} Vtx_tn; + +typedef union { + Vtx_t v; /* Use this one for colors */ + Vtx_tn n; /* Use this one for normals */ + long long int force_structure_alignment; +} Vtx; + +/* + * Sprite structure + */ + +typedef struct { + void *SourceImagePointer; + void *TlutPointer; + short Stride; + short SubImageWidth; + short SubImageHeight; + char SourceImageType; + char SourceImageBitSize; + short SourceImageOffsetS; + short SourceImageOffsetT; + /* 20 bytes for above */ + + /* padding to bring structure size to 64 bit allignment */ + char dummy[4]; + +} uSprite_t; + +typedef union { + uSprite_t s; + + /* Need to make sure this is 64 bit aligned */ + long long int force_structure_allignment[3]; +} uSprite; + +/* + * Triangle face + */ +typedef struct { + unsigned char flag; + unsigned char v[3]; +} Tri; + +#ifndef GBI_FLOATS +/* + * 4x4 matrix, fixed point s15.16 format. + * First 8 words are integer portion of the 4x4 matrix + * Last 8 words are the fraction portion of the 4x4 matrix + */ +typedef s32 Mtx_t[4][4]; + +typedef union { + Mtx_t m; + long long int force_structure_alignment; +} Mtx; +#else +typedef struct { + float m[4][4]; +} Mtx; +#endif + +/* + * Viewport + */ + +/* + * + * This magic value is the maximum INTEGER z-range of the hardware + * (there are also 16-bits of fraction, which are introduced during + * any transformations). This is not just a good idea, it's the law. + * Feeding the hardware eventual z-coordinates (after any transforms + * or scaling) bigger than this, will not work. + * + * This number is DIFFERENT than G_MAXFBZ, which is the maximum value + * you want to use to initialize the z-buffer. + * + * The reason these are different is mildly interesting, but too long + * to explain here. It is basically the result of optimizations in the + * hardware. A more generic API might hide this detail from the users, + * but we don't have the ucode to do that... + * + */ +#define G_MAXZ 0x03ff /* 10 bits of integer screen-Z precision */ + +/* + * The viewport structure elements have 2 bits of fraction, necessary + * to accomodate the sub-pixel positioning scaling for the hardware. + * This can also be exploited to handle odd-sized viewports. + * + * Accounting for these fractional bits, using the default projection + * and viewing matrices, the viewport structure is initialized thusly: + * + * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0, + * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0, + */ +typedef struct { + short vscale[4]; /* scale, 2 bits fraction */ + short vtrans[4]; /* translate, 2 bits fraction */ + /* both the above arrays are padded to 64-bit boundary */ +} Vp_t; + +typedef union { + Vp_t vp; + long long int force_structure_alignment; +} Vp; + +/* + * MOVEMEM indices + * + * Each of these indexes an entry in a dmem table + * which points to a 1-4 word block of dmem in + * which to store a 1-4 word DMA. + * + */ +#ifdef F3DEX_GBI_2 +/* 0,4 are reserved by G_MTX */ +# define G_MV_MMTX 2 +# define G_MV_PMTX 6 +# define G_MV_VIEWPORT 8 +# define G_MV_LIGHT 10 +# define G_MV_POINT 12 +# define G_MV_MATRIX 14 /* NOTE: this is in moveword table */ +# define G_MVO_LOOKATX (0*24) +# define G_MVO_LOOKATY (1*24) +# define G_MVO_L0 (2*24) +# define G_MVO_L1 (3*24) +# define G_MVO_L2 (4*24) +# define G_MVO_L3 (5*24) +# define G_MVO_L4 (6*24) +# define G_MVO_L5 (7*24) +# define G_MVO_L6 (8*24) +# define G_MVO_L7 (9*24) +#else /* F3DEX_GBI_2 */ +# define G_MV_VIEWPORT 0x80 +# define G_MV_LOOKATY 0x82 +# define G_MV_LOOKATX 0x84 +# define G_MV_L0 0x86 +# define G_MV_L1 0x88 +# define G_MV_L2 0x8a +# define G_MV_L3 0x8c +# define G_MV_L4 0x8e +# define G_MV_L5 0x90 +# define G_MV_L6 0x92 +# define G_MV_L7 0x94 +# define G_MV_TXTATT 0x96 +# define G_MV_MATRIX_1 0x9e /* NOTE: this is in moveword table */ +# define G_MV_MATRIX_2 0x98 +# define G_MV_MATRIX_3 0x9a +# define G_MV_MATRIX_4 0x9c +#endif /* F3DEX_GBI_2 */ + +/* + * MOVEWORD indices + * + * Each of these indexes an entry in a dmem table + * which points to a word in dmem in dmem where + * an immediate word will be stored. + * + */ +#define G_MW_MATRIX 0x00 /* NOTE: also used by movemem */ +#define G_MW_NUMLIGHT 0x02 +#define G_MW_CLIP 0x04 +#define G_MW_SEGMENT 0x06 +#define G_MW_FOG 0x08 +#define G_MW_LIGHTCOL 0x0a +#ifdef F3DEX_GBI_2 +# define G_MW_FORCEMTX 0x0c +#else /* F3DEX_GBI_2 */ +# define G_MW_POINTS 0x0c +#endif /* F3DEX_GBI_2 */ +#define G_MW_PERSPNORM 0x0e + +/* + * These are offsets from the address in the dmem table + */ +#define G_MWO_NUMLIGHT 0x00 +#define G_MWO_CLIP_RNX 0x04 +#define G_MWO_CLIP_RNY 0x0c +#define G_MWO_CLIP_RPX 0x14 +#define G_MWO_CLIP_RPY 0x1c +#define G_MWO_SEGMENT_0 0x00 +#define G_MWO_SEGMENT_1 0x01 +#define G_MWO_SEGMENT_2 0x02 +#define G_MWO_SEGMENT_3 0x03 +#define G_MWO_SEGMENT_4 0x04 +#define G_MWO_SEGMENT_5 0x05 +#define G_MWO_SEGMENT_6 0x06 +#define G_MWO_SEGMENT_7 0x07 +#define G_MWO_SEGMENT_8 0x08 +#define G_MWO_SEGMENT_9 0x09 +#define G_MWO_SEGMENT_A 0x0a +#define G_MWO_SEGMENT_B 0x0b +#define G_MWO_SEGMENT_C 0x0c +#define G_MWO_SEGMENT_D 0x0d +#define G_MWO_SEGMENT_E 0x0e +#define G_MWO_SEGMENT_F 0x0f +#define G_MWO_FOG 0x00 +#define G_MWO_aLIGHT_1 0x00 +#define G_MWO_bLIGHT_1 0x04 +#ifdef F3DEX_GBI_2 +#define G_MWO_aLIGHT_2 0x18 +#define G_MWO_bLIGHT_2 0x1c +#define G_MWO_aLIGHT_3 0x30 +#define G_MWO_bLIGHT_3 0x34 +#define G_MWO_aLIGHT_4 0x48 +#define G_MWO_bLIGHT_4 0x4c +#define G_MWO_aLIGHT_5 0x60 +#define G_MWO_bLIGHT_5 0x64 +#define G_MWO_aLIGHT_6 0x78 +#define G_MWO_bLIGHT_6 0x7c +#define G_MWO_aLIGHT_7 0x90 +#define G_MWO_bLIGHT_7 0x94 +#define G_MWO_aLIGHT_8 0xa8 +#define G_MWO_bLIGHT_8 0xac +#else +#define G_MWO_aLIGHT_2 0x20 +#define G_MWO_bLIGHT_2 0x24 +#define G_MWO_aLIGHT_3 0x40 +#define G_MWO_bLIGHT_3 0x44 +#define G_MWO_aLIGHT_4 0x60 +#define G_MWO_bLIGHT_4 0x64 +#define G_MWO_aLIGHT_5 0x80 +#define G_MWO_bLIGHT_5 0x84 +#define G_MWO_aLIGHT_6 0xa0 +#define G_MWO_bLIGHT_6 0xa4 +#define G_MWO_aLIGHT_7 0xc0 +#define G_MWO_bLIGHT_7 0xc4 +#define G_MWO_aLIGHT_8 0xe0 +#define G_MWO_bLIGHT_8 0xe4 +#endif +#define G_MWO_MATRIX_XX_XY_I 0x00 +#define G_MWO_MATRIX_XZ_XW_I 0x04 +#define G_MWO_MATRIX_YX_YY_I 0x08 +#define G_MWO_MATRIX_YZ_YW_I 0x0c +#define G_MWO_MATRIX_ZX_ZY_I 0x10 +#define G_MWO_MATRIX_ZZ_ZW_I 0x14 +#define G_MWO_MATRIX_WX_WY_I 0x18 +#define G_MWO_MATRIX_WZ_WW_I 0x1c +#define G_MWO_MATRIX_XX_XY_F 0x20 +#define G_MWO_MATRIX_XZ_XW_F 0x24 +#define G_MWO_MATRIX_YX_YY_F 0x28 +#define G_MWO_MATRIX_YZ_YW_F 0x2c +#define G_MWO_MATRIX_ZX_ZY_F 0x30 +#define G_MWO_MATRIX_ZZ_ZW_F 0x34 +#define G_MWO_MATRIX_WX_WY_F 0x38 +#define G_MWO_MATRIX_WZ_WW_F 0x3c +#define G_MWO_POINT_RGBA 0x10 +#define G_MWO_POINT_ST 0x14 +#define G_MWO_POINT_XYSCREEN 0x18 +#define G_MWO_POINT_ZSCREEN 0x1c + +/* + * Light structure. + * + * Note: only directional (infinite) lights are currently supported. + * + * Note: the weird order is for the DMEM alignment benefit of + * the microcode. + * + */ + +typedef struct { + unsigned char col[3]; /* diffuse light value (rgba) */ + char pad1; + unsigned char colc[3]; /* copy of diffuse light value (rgba) */ + char pad2; + signed char dir[3]; /* direction of light (normalized) */ + char pad3; +} Light_t; + +typedef struct { + unsigned char col[3]; /* ambient light value (rgba) */ + char pad1; + unsigned char colc[3]; /* copy of ambient light value (rgba) */ + char pad2; +} Ambient_t; + +typedef struct { + int x1,y1,x2,y2; /* texture offsets for highlight 1/2 */ +} Hilite_t; + +typedef union { + Light_t l; + long long int force_structure_alignment[2]; +} Light; + +typedef union { + Ambient_t l; + long long int force_structure_alignment[1]; +} Ambient; + +typedef struct { + Ambient a; + Light l[7]; +} Lightsn; + +typedef struct { + Ambient a; + Light l[1]; +} Lights0; + +typedef struct { + Ambient a; + Light l[1]; +} Lights1; + +typedef struct { + Ambient a; + Light l[2]; +} Lights2; + +typedef struct { + Ambient a; + Light l[3]; +} Lights3; + +typedef struct { + Ambient a; + Light l[4]; +} Lights4; + +typedef struct { + Ambient a; + Light l[5]; +} Lights5; + +typedef struct { + Ambient a; + Light l[6]; +} Lights6; + +typedef struct { + Ambient a; + Light l[7]; +} Lights7; + +typedef struct { + Light l[2]; +} LookAt; + +typedef union { + Hilite_t h; + long int force_structure_alignment[4]; +} Hilite; + +#define gdSPDefLights0(ar,ag,ab) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ { 0, 0, 0},0,{ 0, 0, 0},0,{ 0, 0, 0},0}}} } +#define gdSPDefLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}} } +#define gdSPDefLights2(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}} } +#define gdSPDefLights3(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}} } +#define gdSPDefLights4(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}} } +#define gdSPDefLights5(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}} } + + +#define gdSPDefLights6(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \ + {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}} } + + +#define gdSPDefLights7(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6,r7,g7,b7,x7,y7,z7) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \ + {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}, \ + {{ {r7,g7,b7},0,{r7,g7,b7},0,{x7,y7,z7},0}}} } + + +#define gdSPDefLookAt(rightx,righty,rightz,upx,upy,upz) \ + { {{ {{0,0,0},0,{0,0,0},0,{rightx,righty,rightz},0}}, \ + { {{0,0x80,0},0,{0,0x80,0},0,{upx,upy,upz},0}}} } + +/* Don't declare these for F3D_OLD to avoid bss reordering */ +#ifndef F3D_OLD +/* + * Graphics DMA Packet + */ +typedef struct { + int cmd:8; + unsigned int par:8; + unsigned int len:16; + uintptr_t addr; +} Gdma; + +/* + * Graphics Immediate Mode Packet types + */ +typedef struct { + int cmd:8; + int pad:24; + Tri tri; +} Gtri; + +typedef struct { + int cmd:8; + int pad1:24; + int pad2:24; + unsigned char param:8; +} Gpopmtx; + +/* + * typedef struct { + * int cmd:8; + * int pad0:24; + * int pad1:4; + * int number:4; + * int base:24; + * } Gsegment; + */ +typedef struct { + int cmd:8; + int pad0:8; + int mw_index:8; + int number:8; + int pad1:8; + int base:24; +} Gsegment; + +typedef struct { + int cmd:8; + int pad0:8; + int sft:8; + int len:8; + unsigned int data:32; +} GsetothermodeL; + +typedef struct { + int cmd:8; + int pad0:8; + int sft:8; + int len:8; + unsigned int data:32; +} GsetothermodeH; + +typedef struct { + unsigned char cmd; + unsigned char lodscale; + unsigned char tile; + unsigned char on; + unsigned short s; + unsigned short t; +} Gtexture; + +typedef struct { + int cmd:8; + int pad:24; + Tri line; +} Gline3D; + +typedef struct { + int cmd:8; + int pad1:24; + short int pad2; + short int scale; +} Gperspnorm; + + +/* + * RDP Packet types + */ +typedef struct { + int cmd:8; + unsigned int fmt:3; + unsigned int siz:2; + unsigned int pad:7; + unsigned int wd:12; /* really only 10 bits, extra */ + uintptr_t dram; /* to account for 1024 */ +} Gsetimg; + +typedef struct { + int cmd:8; + unsigned int muxs0:24; + unsigned int muxs1:32; +} Gsetcombine; + +typedef struct { + int cmd:8; + unsigned char pad; + unsigned char prim_min_level; + unsigned char prim_level; + unsigned long color; +} Gsetcolor; + +typedef struct { + int cmd:8; + int x0:10; + int x0frac:2; + int y0:10; + int y0frac:2; + unsigned int pad:8; + int x1:10; + int x1frac:2; + int y1:10; + int y1frac:2; +} Gfillrect; + +typedef struct { + int cmd:8; + unsigned int fmt:3; + unsigned int siz:2; + unsigned int pad0:1; + unsigned int line:9; + unsigned int tmem:9; + unsigned int pad1:5; + unsigned int tile:3; + unsigned int palette:4; + unsigned int ct:1; + unsigned int mt:1; + unsigned int maskt:4; + unsigned int shiftt:4; + unsigned int cs:1; + unsigned int ms:1; + unsigned int masks:4; + unsigned int shifts:4; +} Gsettile; + +typedef struct { + int cmd:8; + unsigned int sl:12; + unsigned int tl:12; + int pad:5; + unsigned int tile:3; + unsigned int sh:12; + unsigned int th:12; +} Gloadtile; + +typedef Gloadtile Gloadblock; + +typedef Gloadtile Gsettilesize; + +typedef Gloadtile Gloadtlut; + +typedef struct { + unsigned int cmd:8; /* command */ + unsigned int xl:12; /* X coordinate of upper left */ + unsigned int yl:12; /* Y coordinate of upper left */ + unsigned int pad1:5; /* Padding */ + unsigned int tile:3; /* Tile descriptor index */ + unsigned int xh:12; /* X coordinate of lower right */ + unsigned int yh:12; /* Y coordinate of lower right */ + unsigned int s:16; /* S texture coord at top left */ + unsigned int t:16; /* T texture coord at top left */ + unsigned int dsdx:16;/* Change in S per change in X */ + unsigned int dtdy:16;/* Change in T per change in Y */ +} Gtexrect; + +/* + * Textured rectangles are 128 bits not 64 bits + */ +typedef struct { + unsigned long w0; + unsigned long w1; + unsigned long w2; + unsigned long w3; +} TexRect; +#endif + +#define MakeTexRect(xh,yh,flip,tile,xl,yl,s,t,dsdx,dtdy) \ + G_TEXRECT, xh, yh, 0, flip, 0, tile, xl, yl, s, t, dsdx, dtdy + +/* + * Generic Gfx Packet + */ +typedef struct { + uintptr_t w0; + uintptr_t w1; +} Gwords; + +/* + * This union is the fundamental type of the display list. + * It is, by law, exactly 64 bits in size. + * + * (Edit: except on 64-bit, where it is exactly 128 bit. On little-endian or + * 64-bit systems, only the 'words' member may be accessed; the rest of the + * structs don't have matching layouts for now.) + */ +typedef union { + Gwords words; +#if !defined(F3D_OLD) && IS_BIG_ENDIAN && !IS_64_BIT + Gdma dma; + Gtri tri; + Gline3D line; + Gpopmtx popmtx; + Gsegment segment; + GsetothermodeH setothermodeH; + GsetothermodeL setothermodeL; + Gtexture texture; + Gperspnorm perspnorm; + Gsetimg setimg; + Gsetcombine setcombine; + Gsetcolor setcolor; + Gfillrect fillrect; /* use for setscissor also */ + Gsettile settile; + Gloadtile loadtile; /* use for loadblock also, th is dxt */ + Gsettilesize settilesize; + Gloadtlut loadtlut; +#endif + long long int force_structure_alignment; +} Gfx; + +/* + * Macros to assemble the graphics display list + */ + +/* + * DMA macros + */ +#define gDma0p(pkt, c, s, l) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \ + _g->words.w1 = (uintptr_t)(s); \ +} + +#define gsDma0p(c, s, l) \ +{{ \ + _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (uintptr_t)(s) \ +}} + +#define gDma1p(pkt, c, s, l, p) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ + _SHIFTL((l), 0, 16)); \ + _g->words.w1 = (uintptr_t)(s); \ +} + +#define gsDma1p(c, s, l, p) \ +{{ \ + (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ + _SHIFTL((l), 0, 16)), \ + (uintptr_t)(s) \ +}} + +#define gDma2p(pkt, c, adrs, len, idx, ofs) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ + _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \ + _g->words.w1 = (uintptr_t)(adrs); \ +} +#define gsDma2p(c, adrs, len, idx, ofs) \ +{{ \ + (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ + _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \ + (uintptr_t)(adrs) \ +}} + +#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0) +#define gsSPNoOp() gsDma0p(G_SPNOOP, 0, 0) + +#ifdef F3DEX_GBI_2 +# define gSPMatrix(pkt, m, p) \ + gDma2p((pkt),G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0) +# define gsSPMatrix(m, p) \ + gsDma2p( G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0) +#else /* F3DEX_GBI_2 */ +# define gSPMatrix(pkt, m, p) gDma1p(pkt, G_MTX, m, sizeof(Mtx), p) +# define gsSPMatrix(m, p) gsDma1p(G_MTX, m, sizeof(Mtx), p) +#endif /* F3DEX_GBI_2 */ + +#if defined(F3DEX_GBI_2) +/* + * F3DEX_GBI_2: G_VTX GBI format was changed. + * + * +--------+----+---+---+----+------+-+ + * G_VTX | cmd:8 |0000| n:8 |0000|v0+n:7|0| + * +-+---+--+----+---+---+----+------+-+ + * | |seg| address | + * +-+---+-----------------------------+ + */ +# define gSPVertex(pkt, v, n, v0) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = \ + _SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7); \ + _g->words.w1 = (uintptr_t)(v); \ +} +# define gsSPVertex(v, n, v0) \ +{{ \ + (_SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7)), \ + (uintptr_t)(v) \ +}} +#elif (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +/* + * F3DEX_GBI: G_VTX GBI format was changed to support 64 vertice. + * + * +--------+--------+------+----------+ + * G_VTX | cmd:8 | v0:8 | n:6 |length:10 | + * +-+---+--+--------+------+----------+ + * | |seg| address | + * +-+---+-----------------------------+ + */ +# define gSPVertex(pkt, v, n, v0) \ + gDma1p((pkt),G_VTX,(v),((n)<<10)|(sizeof(Vtx)*(n)-1),(v0)*2) +# define gsSPVertex(v, n, v0) \ + gsDma1p(G_VTX,(v),((n)<<10)|(sizeof(Vtx)*(n)-1),(v0)*2) +#else +# define gSPVertex(pkt, v, n, v0) \ + gDma1p(pkt, G_VTX, v, sizeof(Vtx)*(n),((n)-1)<<4|(v0)) +# define gsSPVertex(v, n, v0) \ + gsDma1p(G_VTX, v, sizeof(Vtx)*(n), ((n)-1)<<4|(v0)) +#endif + + +#ifdef F3DEX_GBI_2 +# define gSPViewport(pkt, v) \ + gDma2p((pkt), G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT, 0) +# define gsSPViewport(v) \ + gsDma2p( G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT, 0) +#else /* F3DEX_GBI_2 */ +# define gSPViewport(pkt,v) \ + gDma1p((pkt), G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT) +# define gsSPViewport(v) \ + gsDma1p( G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT) +#endif /* F3DEX_GBI_2 */ + +#define gSPDisplayList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_PUSH) +#define gsSPDisplayList( dl) gsDma1p( G_DL,dl,0,G_DL_PUSH) + +#define gSPBranchList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_NOPUSH) +#define gsSPBranchList( dl) gsDma1p( G_DL,dl,0,G_DL_NOPUSH) + +#define gSPSprite2DBase(pkt, s) gDma1p(pkt, G_SPRITE2D_BASE, s, sizeof(uSprite), 0) +#define gsSPSprite2DBase(s) gsDma1p(G_SPRITE2D_BASE, s, sizeof(uSprite), 0) + +/* + * RSP short command (no DMA required) macros + */ +#define gImmp0(pkt, c) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ +} + +#define gsImmp0(c) \ +{{ \ + _SHIFTL((c), 24, 8) \ +}} + +#define gImmp1(pkt, c, p0) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = (uintptr_t)(p0); \ +} + +#define gsImmp1(c, p0) \ +{{ \ + _SHIFTL((c), 24, 8), (uintptr_t)(p0) \ +}} + +#define gImmp2(pkt, c, p0, p1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8); \ +} + +#define gsImmp2(c, p0, p1) \ +{{ \ + _SHIFTL((c), 24, 8), _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8)\ +}} + +#define gImmp3(pkt, c, p0, p1, p2) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = (_SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8) | \ + _SHIFTL((p2), 0, 8)); \ +} + +#define gsImmp3(c, p0, p1, p2) \ +{{ \ + _SHIFTL((c), 24, 8), (_SHIFTL((p0), 16, 16) | \ + _SHIFTL((p1), 8, 8) | _SHIFTL((p2), 0, 8))\ +}} + +#define gImmp21(pkt, c, p0, p1, dat) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \ + _SHIFTL((p1), 0, 8)); \ + _g->words.w1 = (uintptr_t) (dat); \ +} + +#define gsImmp21(c, p0, p1, dat) \ +{{ \ + _SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8),\ + (uintptr_t) (dat) \ +}} + +#ifdef F3DEX_GBI_2 +#define gMoveWd(pkt, index, offset, data) \ + gDma1p((pkt), G_MOVEWORD, data, offset, index) +#define gsMoveWd( index, offset, data) \ + gsDma1p( G_MOVEWORD, data, offset, index) +#else /* F3DEX_GBI_2 */ +#define gMoveWd(pkt, index, offset, data) \ + gImmp21((pkt), G_MOVEWORD, offset, index, data) +#define gsMoveWd( index, offset, data) \ + gsImmp21( G_MOVEWORD, offset, index, data) +#endif /* F3DEX_GBI_2 */ + +/* Sprite immediate macros, there is also a sprite dma macro above */ + +#define gSPSprite2DScaleFlip(pkt, sx, sy, fx, fy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \ + _SHIFTL((fx), 8, 8) | \ + _SHIFTL((fy), 0, 8)); \ + _g->words.w1 = (_SHIFTL((sx), 16, 16) | \ + _SHIFTL((sy), 0, 16)); \ +} + +#define gsSPSprite2DScaleFlip(sx, sy, fx, fy) \ +{{ \ + (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \ + _SHIFTL((fx), 8, 8) | \ + _SHIFTL((fy), 0, 8)), \ + (_SHIFTL((sx), 16, 16) | \ + _SHIFTL((sy), 0, 16)) \ +}} + +#define gSPSprite2DDraw(pkt, px, py) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)); \ + _g->words.w1 = (_SHIFTL((px), 16, 16) | \ + _SHIFTL((py), 0, 16)); \ +} + +#define gsSPSprite2DDraw(px, py) \ +{{ \ + (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)), \ + (_SHIFTL((px), 16, 16) | \ + _SHIFTL((py), 0, 16)) \ +}} + + +/* + * Note: the SP1Triangle() and line macros multiply the vertex indices + * by 10, this is an optimization for the microcode. + */ +#if (defined(F3DLP_GBI)||defined(F3DEX_GBI)) +# define __gsSP1Triangle_w1(v0, v1, v2) \ + (_SHIFTL((v0)*2,16,8)|_SHIFTL((v1)*2,8,8)|_SHIFTL((v2)*2,0,8)) +# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v0): \ + __gsSP1Triangle_w1(v2, v0, v1)) +# define __gsSPLine3D_w1(v0, v1, wd) \ + (_SHIFTL((v0)*2,16,8)|_SHIFT((v1)*2,8,8)|_SHIFT((wd),0,8)) +# define __gsSPLine3D_w1f(v0, v1, wd, flag) \ + (((flag) == 0) ? __gsSPLine3D_w1(v0, v1, wd): \ + __gsSPLine3D_w1(v1, v0, wd)) +# define __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v3): \ + ((flag) == 2) ? __gsSP1Triangle_w1(v2, v3, v0): \ + __gsSP1Triangle_w1(v3, v0, v1)) +# define __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v2, v3): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v3, v0): \ + ((flag) == 2) ? __gsSP1Triangle_w1(v2, v0, v1): \ + __gsSP1Triangle_w1(v3, v1, v2)) +#else +# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \ + (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \ + _SHIFTL((v1)*10, 8,8)|_SHIFTL((v2)*10, 0,8)) +# define __gsSPLine3D_w1f(v0, v1, wd, flag) \ + (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \ + _SHIFTL((v1)*10, 8,8)|_SHIFTL((wd), 0,8)) +#endif + +#ifdef F3DEX_GBI_2 +/*** + *** 1 Triangle + ***/ +#define gSP1Triangle(pkt, v0, v1, v2, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_TRI1, 24, 8)| \ + __gsSP1Triangle_w1f(v0, v1, v2, flag); \ + _g->words.w1 = 0; \ +} +#define gsSP1Triangle(v0, v1, v2, flag) \ +{{ \ + _SHIFTL(G_TRI1, 24, 8)|__gsSP1Triangle_w1f(v0, v1, v2, flag), \ + 0 \ +}} + +/*** + *** Line + ***/ +#define gSPLine3D(pkt, v0, v1, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8)| \ + __gsSPLine3D_w1f(v0, v1, 0, flag); \ + _g->words.w1 = 0; \ +} +#define gsSPLine3D(v0, v1, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8)|__gsSPLine3D_w1f(v0, v1, 0, flag), \ + 0 \ +}} + +/*** + *** LineW + ***/ +/* these macros are the same as SPLine3D, except they have an + * additional parameter for width. The width is added to the "minimum" + * thickness, which is 1.5 pixels. The units for width are in + * half-pixel units, so a width of 1 translates to (.5 + 1.5) or + * a 2.0 pixels wide line. + */ +#define gSPLineW3D(pkt, v0, v1, wd, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8)| \ + __gsSPLine3D_w1f(v0, v1, wd, flag); \ + _g->words.w1 = 0; \ +} +#define gsSPLineW3D(v0, v1, wd, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8)|__gsSPLine3D_w1f(v0, v1, wd, flag), \ + 0 \ +}} + +/*** + *** 1 Quadrangle + ***/ +#define gSP1Quadrangle(pkt, v0, v1, v2, v3, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_QUAD, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)); \ + _g->words.w1 = __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag); \ +} + +#define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ +{{ \ + (_SHIFTL(G_QUAD, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)), \ + __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ +}} +#else /* F3DEX_GBI_2 */ + +/*** + *** 1 Triangle + ***/ +#define gSP1Triangle(pkt, v0, v1, v2, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_TRI1, 24, 8); \ + _g->words.w1 = __gsSP1Triangle_w1f(v0, v1, v2, flag); \ +} +#define gsSP1Triangle(v0, v1, v2, flag) \ +{{ \ + _SHIFTL(G_TRI1, 24, 8), \ + __gsSP1Triangle_w1f(v0, v1, v2, flag) \ +}} + +/*** + *** Line + ***/ +#define gSPLine3D(pkt, v0, v1, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \ + _g->words.w1 = __gsSPLine3D_w1f(v0, v1, 0, flag); \ +} +#define gsSPLine3D(v0, v1, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8), \ + __gsSPLine3D_w1f(v0, v1, 0, flag) \ +}} + +/*** + *** LineW + ***/ +/* these macros are the same as SPLine3D, except they have an + * additional parameter for width. The width is added to the "minimum" + * thickness, which is 1.5 pixels. The units for width are in + * half-pixel units, so a width of 1 translates to (.5 + 1.5) or + * a 2.0 pixels wide line. + */ +#define gSPLineW3D(pkt, v0, v1, wd, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \ + _g->words.w1 = __gsSPLine3D_w1f(v0, v1, wd, flag); \ +} +#define gsSPLineW3D(v0, v1, wd, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8), \ + __gsSPLine3D_w1f(v0, v1, wd, flag) \ +}} + +/*** + *** 1 Quadrangle + ***/ +#define gSP1Quadrangle(pkt, v0, v1, v2, v3, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)); \ + _g->words.w1 = __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag); \ +} + +#define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ +{{ \ + (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)), \ + __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ +}} +#endif /* F3DEX_GBI_2 */ + +#if (defined(F3DLP_GBI)||defined(F3DEX_GBI)) +/*** + *** 2 Triangles + ***/ +#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Triangle_w1f(v00, v01, v02, flag0)); \ + _g->words.w1 = __gsSP1Triangle_w1f(v10, v11, v12, flag1); \ +} + +#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ +{{ \ + (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Triangle_w1f(v00, v01, v02, flag0)), \ + __gsSP1Triangle_w1f(v10, v11, v12, flag1) \ +}} +#else +#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \ +{ \ + gSP1Triangle(pkt, v00, v01, v02, flag0); \ + gSP1Triangle(pkt, v10, v11, v12, flag1); \ +} +#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ + gsSP1Triangle(v00, v01, v02, flag0), \ + gsSP1Triangle(v10, v11, v12, flag1) +#endif /* F3DEX_GBI/F3DLP_GBI */ + +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +#define gSPCullDisplayList(pkt,vstart,vend) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \ + _SHIFTL((vstart)*2, 0, 16); \ + _g->words.w1 = _SHIFTL((vend)*2, 0, 16); \ +} + +#define gsSPCullDisplayList(vstart,vend) \ +{{ \ + _SHIFTL(G_CULLDL, 24, 8) | _SHIFTL((vstart)*2, 0, 16), \ + _SHIFTL((vend)*2, 0, 16) \ +}} + +#else +#define gSPCullDisplayList(pkt,vstart,vend) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \ + ((0x0f & (vstart))*40); \ + _g->words.w1 = (unsigned int)((0x0f & ((vend)+1))*40); \ +} + +#define gsSPCullDisplayList(vstart,vend) \ +{{ \ + _SHIFTL(G_CULLDL, 24, 8) | ((0x0f & (vstart))*40), \ + ((0x0f & ((vend)+1))*40) \ +}} +#endif + +#define gSPSegment(pkt, segment, base) \ + gMoveWd(pkt, G_MW_SEGMENT, (segment)*4, base) +#define gsSPSegment(segment, base) \ + gsMoveWd( G_MW_SEGMENT, (segment)*4, base) + +/* + * Clipping Macros + */ +#define FR_NEG_FRUSTRATIO_1 0x00000001 +#define FR_POS_FRUSTRATIO_1 0x0000ffff +#define FR_NEG_FRUSTRATIO_2 0x00000002 +#define FR_POS_FRUSTRATIO_2 0x0000fffe +#define FR_NEG_FRUSTRATIO_3 0x00000003 +#define FR_POS_FRUSTRATIO_3 0x0000fffd +#define FR_NEG_FRUSTRATIO_4 0x00000004 +#define FR_POS_FRUSTRATIO_4 0x0000fffc +#define FR_NEG_FRUSTRATIO_5 0x00000005 +#define FR_POS_FRUSTRATIO_5 0x0000fffb +#define FR_NEG_FRUSTRATIO_6 0x00000006 +#define FR_POS_FRUSTRATIO_6 0x0000fffa +/* + * r should be one of: FRUSTRATIO_1, FRUSTRATIO_2, FRUSTRATIO_3, ... FRUSTRATIO_6 + */ +#define gSPClipRatio(pkt, r) \ +{ \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r); \ +} + +#define gsSPClipRatio(r) \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r) + +/* + * Insert values into Matrix + * + * where = element of matrix (byte offset) + * num = new element (32 bit value replacing 2 int or 2 frac matrix + * componants + */ +#ifdef F3DEX_GBI_2 +#define gSPInsertMatrix(pkt, where, num) \ + ERROR!! gSPInsertMatrix is no longer supported. +#define gsSPInsertMatrix(where, num) \ + ERROR!! gsSPInsertMatrix is no longer supported. +#else +#define gSPInsertMatrix(pkt, where, num) \ + gMoveWd(pkt, G_MW_MATRIX, where, num) +#define gsSPInsertMatrix(where, num) \ + gsMoveWd(G_MW_MATRIX, where, num) +#endif + +/* + * Load new matrix directly + * + * mptr = pointer to matrix + */ +#ifdef F3DEX_GBI_2 +#define gSPForceMatrix(pkt, mptr) \ +{ gDma2p((pkt),G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0); \ + gMoveWd((pkt), G_MW_FORCEMTX,0,0x00010000); \ +} +#define gsSPForceMatrix(mptr) \ + gsDma2p(G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0), \ + gsMoveWd(G_MW_FORCEMTX,0,0x00010000) + +#else /* F3DEX_GBI_2 */ +#define gSPForceMatrix(pkt, mptr) \ +{ \ + gDma1p(pkt, G_MOVEMEM, mptr, 16, G_MV_MATRIX_1); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4); \ +} +#define gsSPForceMatrix(mptr) \ + gsDma1p( G_MOVEMEM, mptr, 16, G_MV_MATRIX_1), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4) +#endif /* F3DEX_GBI_2 */ + +/* + * Insert values into Points + * + * point = point number 0-15 + * where = which element of point to modify (byte offset into point) + * num = new value (32 bit) + */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define gSPModifyVertex(pkt, vtx, where, val) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_MODIFYVTX,24,8)| \ + _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16)); \ + _g->words.w1 = (unsigned int)(val); \ +} +# define gsSPModifyVertex(vtx, where, val) \ +{{ \ + _SHIFTL(G_MODIFYVTX,24,8)| \ + _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16), \ + (unsigned int)(val) \ +}} +#else +# define gSPModifyVertex(pkt, vtx, where, val) \ + gMoveWd(pkt, G_MW_POINTS, (vtx)*40+(where), val) +# define gsSPModifyVertex(vtx, where, val) \ + gsMoveWd(G_MW_POINTS, (vtx)*40+(where), val) +#endif + +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +/* + * gSPBranchLessZ Branch DL if (vtx.z) less than or equal (zval). + * + * dl = DL branch to + * vtx = Vertex + * zval = Screen depth + * near = Near plane + * far = Far plane + * flag = G_BZ_PERSP or G_BZ_ORTHO + */ + +#define G_BZ_PERSP 0 +#define G_BZ_ORTHO 1 + +#define G_DEPTOZSrg(zval, near, far, flag, zmin, zmax) \ +(((unsigned int)FTOFIX32(((flag) == G_BZ_PERSP ? \ + (1.0f-(float)(near)/(float)(zval)) / \ + (1.0f-(float)(near)/(float)(far )) : \ + ((float)(zval) - (float)(near)) / \ + ((float)(far ) - (float)(near))))) * \ + (((int)((zmax) - (zmin)))&~1) + (int)FTOFIX32(zmin)) + +#define G_DEPTOZS(zval, near, far, flag) \ + G_DEPTOZSrg(zval, near, far, flag, 0, G_MAXZ) + +#define gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, zmin, zmax) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (uintptr_t)(dl); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ + _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ + _g->words.w1 = G_DEPTOZSrg(zval, near, far, flag, zmin, zmax); \ +} + +#define gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, zmin, zmax) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (uintptr_t)(dl), }}, \ +{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ + G_DEPTOZSrg(zval, near, far, flag, zmin, zmax), }} + +#define gSPBranchLessZ(pkt, dl, vtx, zval, near, far, flag) \ + gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, 0, G_MAXZ) +#define gsSPBranchLessZ(dl, vtx, zval, near, far, flag) \ + gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, 0, G_MAXZ) + +/* + * gSPBranchLessZraw Branch DL if (vtx.z) less than or equal (raw zval). + * + * dl = DL branch to + * vtx = Vertex + * zval = Raw value of screen depth + */ +#define gSPBranchLessZraw(pkt, dl, vtx, zval) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (uintptr_t)(dl); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ + _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ + _g->words.w1 = (unsigned int)(zval); \ +} + +#define gsSPBranchLessZraw(dl, vtx, zval) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (uintptr_t)(dl), }}, \ +{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ + (unsigned int)(zval), }} + +/* + * gSPLoadUcode RSP loads specified ucode. + * + * uc_start = ucode text section start + * uc_dstart = ucode data section start + */ +#define gSPLoadUcodeEx(pkt, uc_start, uc_dstart, uc_dsize) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (uintptr_t)(uc_dstart); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_LOAD_UCODE,24,8)| \ + _SHIFTL((int)(uc_dsize)-1,0,16)); \ + _g->words.w1 = (uintptr_t)(uc_start); \ +} + +#define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (uintptr_t)(uc_dstart), }}, \ +{{ _SHIFTL(G_LOAD_UCODE,24,8)| \ + _SHIFTL((int)(uc_dsize)-1,0,16), \ + (uintptr_t)(uc_start), }} + +#define gSPLoadUcode(pkt, uc_start, uc_dstart) \ + gSPLoadUcodeEx((pkt), (uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) +#define gsSPLoadUcode(uc_start, uc_dstart) \ + gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) + +#define gSPLoadUcodeL(pkt, ucode) \ + gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&##ucode##DataStart)) +#define gsSPLoadUcodeL(ucode) \ + gsSPLoadUcode(OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&##ucode##DataStart)) +#endif + +#ifdef F3DEX_GBI_2 +/* + * gSPDma_io DMA to/from DMEM/IMEM for DEBUG. + */ +#define gSPDma_io(pkt, flag, dmem, dram, size) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ + _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12); \ + _g->words.w1 = (uintptr_t)(dram); \ +} + +#define gsSPDma_io(flag, dmem, dram, size) \ +{{ \ + _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ + _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12), \ + (uintptr_t)(dram) \ +}} + +#define gSPDmaRead(pkt,dmem,dram,size) gSPDma_io((pkt),0,(dmem),(dram),(size)) +#define gsSPDmaRead(dmem,dram,size) gsSPDma_io(0,(dmem),(dram),(size)) +#define gSPDmaWrite(pkt,dmem,dram,size) gSPDma_io((pkt),1,(dmem),(dram),(size)) +#define gsSPDmaWrite(dmem,dram,size) gsSPDma_io(1,(dmem),(dram),(size)) +#endif + +/* + * Lighting Macros + */ +#ifdef F3DEX_GBI_2 +# define NUML(n) ((n)*24) +#else +# define NUML(n) (((n)+1)*32 + 0x80000000) +#endif +#define NUMLIGHTS_0 1 +#define NUMLIGHTS_1 1 +#define NUMLIGHTS_2 2 +#define NUMLIGHTS_3 3 +#define NUMLIGHTS_4 4 +#define NUMLIGHTS_5 5 +#define NUMLIGHTS_6 6 +#define NUMLIGHTS_7 7 +/* + * n should be one of: NUMLIGHTS_0, NUMLIGHTS_1, ..., NUMLIGHTS_7 + * NOTE: in addition to the number of directional lights specified, + * there is always 1 ambient light + */ +#define gSPNumLights(pkt, n) \ + gMoveWd(pkt, G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n)) +#define gsSPNumLights(n) \ + gsMoveWd( G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n)) + +#define LIGHT_1 1 +#define LIGHT_2 2 +#define LIGHT_3 3 +#define LIGHT_4 4 +#define LIGHT_5 5 +#define LIGHT_6 6 +#define LIGHT_7 7 +#define LIGHT_8 8 +/* + * l should point to a Light struct + * n should be one of: LIGHT_1, LIGHT_2, ..., LIGHT_8 + * NOTE: the highest numbered light is always the ambient light (eg if there are + * 3 directional lights defined: gsSPNumLights(NUMLIGHTS_3), then lights + * LIGHT_1 through LIGHT_3 will be the directional lights and light + * LIGHT_4 will be the ambient light. + */ +#ifdef F3DEX_GBI_2 +# define gSPLight(pkt, l, n) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*24+24) +# define gsSPLight(l, n) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*24+24) +#else /* F3DEX_GBI_2 */ +# define gSPLight(pkt, l, n) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0) +# define gsSPLight(l, n) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0) +#endif /* F3DEX_GBI_2 */ + +/* + * gSPLightColor changes color of light without recalculating light direction + * col is a 32 bit word with r,g,b,a (alpha is ignored) + * n should be one of LIGHT_1, LIGHT_2, ..., LIGHT_8 + */ +#define gSPLightColor(pkt, n, col) \ +{ \ + gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_a##n, col); \ + gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_b##n, col); \ +} +#define gsSPLightColor(n, col) \ + gsMoveWd(G_MW_LIGHTCOL, G_MWO_a##n, col), \ + gsMoveWd(G_MW_LIGHTCOL, G_MWO_b##n, col) + +/* These macros use a structure "name" which is init'd with the gdSPDefLights macros*/ + +#define gSPSetLights0(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_0); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.a,2); \ +} +#define gsSPSetLights0(name) \ + gsSPNumLights(NUMLIGHTS_0), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.a,2) + +#define gSPSetLights1(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_1); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.a,2); \ +} +#define gsSPSetLights1(name) \ + gsSPNumLights(NUMLIGHTS_1), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.a,2) + +#define gSPSetLights2(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_2); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.a,3); \ +} +#define gsSPSetLights2(name) \ + gsSPNumLights(NUMLIGHTS_2), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.a,3) + +#define gSPSetLights3(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_3); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.a,4); \ +} +#define gsSPSetLights3(name) \ + gsSPNumLights(NUMLIGHTS_3), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.a,4) + +#define gSPSetLights4(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_4); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.a,5); \ +} +#define gsSPSetLights4(name) \ + gsSPNumLights(NUMLIGHTS_4), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.a,5) + +#define gSPSetLights5(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_5); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.a,6); \ +} + +#define gsSPSetLights5(name) \ + gsSPNumLights(NUMLIGHTS_5), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.a,6) + +#define gSPSetLights6(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_6); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.l[5],6); \ + gSPLight(pkt,&name.a,7); \ +} + +#define gsSPSetLights6(name) \ + gsSPNumLights(NUMLIGHTS_6), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.l[5],6), \ + gsSPLight(&name.a,7) + +#define gSPSetLights7(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_7); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.l[5],6); \ + gSPLight(pkt,&name.l[6],7); \ + gSPLight(pkt,&name.a,8); \ +} + +#define gsSPSetLights7(name) \ + gsSPNumLights(NUMLIGHTS_7), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.l[5],6), \ + gsSPLight(&name.l[6],7), \ + gsSPLight(&name.a,8) + +/* + * Reflection/Hiliting Macros + */ +#ifdef F3DEX_GBI_2 +# define gSPLookAtX(pkt, l) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATX) +# define gsSPLookAtX(l) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATX) +# define gSPLookAtY(pkt, l) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATY) +# define gsSPLookAtY(l) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATY) +#else /* F3DEX_GBI_2 */ +# define gSPLookAtX(pkt, l) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX) +# define gsSPLookAtX(l) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX) +# define gSPLookAtY(pkt, l) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY) +# define gsSPLookAtY(l) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY) +#endif /* F3DEX_GBI_2 */ + +#define gSPLookAt(pkt, la) \ +{ \ + gSPLookAtX(pkt,la) \ + gSPLookAtY(pkt,(char *)(la)+16) \ +} +#define gsSPLookAt(la) \ + gsSPLookAtX(la), \ + gsSPLookAtY((char *)(la)+16) + +#define gDPSetHilite1Tile(pkt, tile, hilite, width, height) \ + gDPSetTileSize(pkt, tile, (hilite)->h.x1 & 0xfff, (hilite)->h.y1 & 0xfff, \ + ((((width)-1)*4)+(hilite)->h.x1) & 0xfff, ((((height)-1)*4)+(hilite)->h.y1) & 0xfff) + +#define gDPSetHilite2Tile(pkt, tile, hilite, width, height) \ + gDPSetTileSize(pkt, tile, (hilite)->h.x2 & 0xfff, (hilite)->h.y2 & 0xfff, \ + ((((width)-1)*4)+(hilite)->h.x2) & 0xfff, ((((height)-1)*4)+(hilite)->h.y2) & 0xfff) + + +/* + * FOG macros + * fm = z multiplier + * fo = z offset + * FOG FORMULA: alpha(fog) = (eyespace z) * fm + fo CLAMPED 0 to 255 + * note: (eyespace z) ranges -1 to 1 + * + * Alternate method of setting fog: + * min, max: range 0 to 1000: 0=nearplane, 1000=farplane + * min is where fog begins (usually less than max and often 0) + * max is where fog is thickest (usually 1000) + * + */ +#define gSPFogFactor(pkt, fm, fo) \ + gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16))) + +#define gsSPFogFactor(fm, fo) \ + gsMoveWd(G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16))) + +#define gSPFogPosition(pkt, min, max) \ + gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL((128000/((max)-(min))),16,16) | \ + _SHIFTL(((500-(min))*256/((max)-(min))),0,16))) + +#define gsSPFogPosition(min, max) \ + gsMoveWd(G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL((128000/((max)-(min))),16,16) | \ + _SHIFTL(((500-(min))*256/((max)-(min))),0,16))) + +#ifdef F3DEX_GBI_2 +/* + * Macros to turn texture on/off + */ +# define gSPTexture(pkt, s, t, level, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8) | \ + _SHIFTL(BOWTIE_VAL,16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | \ + _SHIFTL((on),1,7)); \ + _g->words.w1 = (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)); \ +} +# define gsSPTexture(s, t, level, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8) | _SHIFTL(BOWTIE_VAL,16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | _SHIFTL((on),1,7)),\ + (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)) \ +}} +/* + * Different version of SPTexture macro, has an additional parameter + * which is currently reserved in the microcode. + */ +# define gSPTextureL(pkt, s, t, level, xparam, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8) | \ + _SHIFTL((xparam),16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | \ + _SHIFTL((on),1,7)); \ + _g->words.w1 = (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)); \ +} +# define gsSPTextureL(s, t, level, xparam, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8) | _SHIFTL((xparam),16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | _SHIFTL((on),1,7)),\ + (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)) \ +}} +#else +/* + * Macros to turn texture on/off + */ +# define gSPTexture(pkt, s, t, level, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL(BOWTIE_VAL,16,8)|\ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)| \ + _SHIFTL((on),0,8)); \ + _g->words.w1 = (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)); \ +} +# define gsSPTexture(s, t, level, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL(BOWTIE_VAL,16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)|_SHIFTL((on),0,8)), \ + (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)) \ +}} +/* + * Different version of SPTexture macro, has an additional parameter + * which is currently reserved in the microcode. + */ +# define gSPTextureL(pkt, s, t, level, xparam, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL((xparam),16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)| \ + _SHIFTL((on),0,8)); \ + _g->words.w1 = (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)); \ +} +# define gsSPTextureL(s, t, level, xparam, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL((xparam),16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)|_SHIFTL((on),0,8)), \ + (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)) \ +}} +#endif + +#ifndef F3D_OLD +# define gSPPerspNormalize(pkt, s) gMoveWd(pkt, G_MW_PERSPNORM, 0, (s)) +# define gsSPPerspNormalize(s) gsMoveWd( G_MW_PERSPNORM, 0, (s)) +#else +# define gSPPerspNormalize(pkt, s) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1, 24, 8); \ + _g->words.w1 = (s); \ +} +# define gsSPPerspNormalize(s) \ +{{ \ + _SHIFTL(G_RDPHALF_1, 24, 8), \ + (s) \ +}} +#endif + +#ifdef F3DEX_GBI_2 +# define gSPPopMatrixN(pkt, n, num) gDma2p((pkt),G_POPMTX,(num)*64,64,2,0) +# define gsSPPopMatrixN(n, num) gsDma2p( G_POPMTX,(num)*64,64,2,0) +# define gSPPopMatrix(pkt, n) gSPPopMatrixN((pkt), (n), 1) +# define gsSPPopMatrix(n) gsSPPopMatrixN( (n), 1) +#else /* F3DEX_GBI_2 */ +# define gSPPopMatrix(pkt, n) gImmp1(pkt, G_POPMTX, n) +# define gsSPPopMatrix(n) gsImmp1( G_POPMTX, n) +#endif /* F3DEX_GBI_2 */ + +#define gSPEndDisplayList(pkt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_ENDDL, 24, 8); \ + _g->words.w1 = 0; \ +} + +#define gsSPEndDisplayList() \ +{{ \ + _SHIFTL(G_ENDDL, 24, 8), 0 \ +}} + +#ifdef F3DEX_GBI_2 +/* + * One gSPGeometryMode(pkt,c,s) GBI is equal to these two GBIs. + * + * gSPClearGeometryMode(pkt,c) + * gSPSetGeometryMode(pkt,s) + * + * gSPLoadGeometryMode(pkt, word) sets GeometryMode directly. + */ +#define gSPGeometryMode(pkt, c, s) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24);\ + _g->words.w1 = (u32)(s); \ +} + +#define gsSPGeometryMode(c, s) \ +{{ \ + (_SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24)),(u32)(s) \ +}} +#define gSPSetGeometryMode(pkt, word) gSPGeometryMode((pkt),0,(word)) +#define gsSPSetGeometryMode(word) gsSPGeometryMode(0,(word)) +#define gSPClearGeometryMode(pkt, word) gSPGeometryMode((pkt),(word),0) +#define gsSPClearGeometryMode(word) gsSPGeometryMode((word),0) +#define gSPLoadGeometryMode(pkt, word) gSPGeometryMode((pkt),-1,(word)) +#define gsSPLoadGeometryMode(word) gsSPGeometryMode(-1,(word)) +#define gsSPGeometryModeSetFirst(c, s) gsSPGeometryMode(c, s) +#else /* F3DEX_GBI_2 */ +#define gSPSetGeometryMode(pkt, word) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETGEOMETRYMODE, 24, 8); \ + _g->words.w1 = (unsigned int)(word); \ +} + +#define gsSPSetGeometryMode(word) \ +{{ \ + _SHIFTL(G_SETGEOMETRYMODE, 24, 8), (unsigned int)(word) \ +}} + +#define gSPClearGeometryMode(pkt, word) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8); \ + _g->words.w1 = (unsigned int)(word); \ +} + +#define gsSPClearGeometryMode(word) \ +{{ \ + _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (unsigned int)(word) \ +}} + +/* + * gsSPGeometryMode + * In Fast3DEX2 it is better to use this, as the RSP geometry mode + * is able to be set and cleared in a single command. + */ +#define gsSPGeometryMode(c, s) \ + gsSPClearGeometryMode(c), \ + gsSPSetGeometryMode(s) +#define gsSPGeometryModeSetFirst(c, s) \ + gsSPSetGeometryMode(s), \ + gsSPClearGeometryMode(c) +#endif /* F3DEX_GBI_2 */ + +#ifdef F3DEX_GBI_2 +#define gSPSetOtherMode(pkt, cmd, sft, len, data) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)| \ + _SHIFTL((len)-1,0,8)); \ + _g->words.w1 = (unsigned int)(data); \ +} + +#define gsSPSetOtherMode(cmd, sft, len, data) \ +{{ \ + _SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)|_SHIFTL((len)-1,0,8), \ + (unsigned int)(data) \ +}} +#else +#define gSPSetOtherMode(pkt, cmd, sft, len, data) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | \ + _SHIFTL(len, 0, 8)); \ + _g->words.w1 = (unsigned int)(data); \ +} + +#define gsSPSetOtherMode(cmd, sft, len, data) \ +{{ \ + _SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), \ + (unsigned int)(data) \ +}} +#endif + +/* + * RDP setothermode register commands - register shadowed in RSP + */ +#define gDPPipelineMode(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode) +#define gsDPPipelineMode(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode) + +#define gDPSetCycleType(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type) +#define gsDPSetCycleType(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type) + +#define gDPSetTexturePersp(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type) +#define gsDPSetTexturePersp(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type) + +#define gDPSetTextureDetail(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type) +#define gsDPSetTextureDetail(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type) + +#define gDPSetTextureLOD(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type) +#define gsDPSetTextureLOD(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type) + +#define gDPSetTextureLUT(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type) +#define gsDPSetTextureLUT(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type) + +#define gDPSetTextureFilter(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type) +#define gsDPSetTextureFilter(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type) + +#define gDPSetTextureConvert(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type) +#define gsDPSetTextureConvert(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type) + +#define gDPSetCombineKey(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type) +#define gsDPSetCombineKey(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type) + +#ifndef _HW_VERSION_1 +#define gDPSetColorDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode) +#define gsDPSetColorDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode) +#else +#define gDPSetColorDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode) +#define gsDPSetColorDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode) +#endif + +#ifndef _HW_VERSION_1 +#define gDPSetAlphaDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode) +#define gsDPSetAlphaDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode) +#endif + +/* 'blendmask' is not supported anymore. + * The bits are reserved for future use. + * Fri May 26 13:45:55 PDT 1995 + */ +#define gDPSetBlendMask(pkt, mask) gDPNoOp(pkt) +#define gsDPSetBlendMask(mask) gsDPNoOp() + +#define gDPSetAlphaCompare(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type) +#define gsDPSetAlphaCompare(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type) + +#define gDPSetDepthSource(pkt, src) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src) +#define gsDPSetDepthSource(src) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src) + +#define gDPSetRenderMode(pkt, c0, c1) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \ + (c0) | (c1)) +#define gsDPSetRenderMode(c0, c1) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \ + (c0) | (c1)) + +#define gSetImage(pkt, cmd, fmt, siz, width, i) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \ + _g->words.w1 = (uintptr_t)(i); \ +} + +#define gsSetImage(cmd, fmt, siz, width, i) \ +{{ \ + _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \ + (uintptr_t)(i) \ +}} + +#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i) +#define gsDPSetColorImage(f, s, w, i) gsSetImage(G_SETCIMG, f, s, w, i) + + +/* use these for new code */ +#define gDPSetDepthImage(pkt, i) gSetImage(pkt, G_SETZIMG, 0, 0, 1, i) +#define gsDPSetDepthImage(i) gsSetImage(G_SETZIMG, 0, 0, 1, i) +/* kept for compatibility */ +#define gDPSetMaskImage(pkt, i) gDPSetDepthImage(pkt, i) +#define gsDPSetMaskImage(i) gsDPSetDepthImage(i) + +#define gDPSetTextureImage(pkt, f, s, w, i) gSetImage(pkt, G_SETTIMG, f, s, w, i) +#define gsDPSetTextureImage(f, s, w, i) gsSetImage(G_SETTIMG, f, s, w, i) + +/* + * RDP macros + */ + +#define gDPSetCombine(pkt, muxs0, muxs1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24);\ + _g->words.w1 = (unsigned int)(muxs1); \ +} + +#define gsDPSetCombine(muxs0, muxs1) \ +{{ \ + _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \ + (unsigned int)(muxs1) \ +}} + +#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \ + (_SHIFTL((saRGB0), 20, 4) | _SHIFTL((mRGB0), 15, 5) | \ + _SHIFTL((saA0), 12, 3) | _SHIFTL((mA0), 9, 3)) + +#define GCCc1w0(saRGB1, mRGB1) \ + (_SHIFTL((saRGB1), 5, 4) | _SHIFTL((mRGB1), 0, 5)) + +#define GCCc0w1(sbRGB0, aRGB0, sbA0, aA0) \ + (_SHIFTL((sbRGB0), 28, 4) | _SHIFTL((aRGB0), 15, 3) | \ + _SHIFTL((sbA0), 12, 3) | _SHIFTL((aA0), 9, 3)) + +#define GCCc1w1(sbRGB1, saA1, mA1, aRGB1, sbA1, aA1) \ + (_SHIFTL((sbRGB1), 24, 4) | _SHIFTL((saA1), 21, 3) | \ + _SHIFTL((mA1), 18, 3) | _SHIFTL((aRGB1), 6, 3) | \ + _SHIFTL((sbA1), 3, 3) | _SHIFTL((aA1), 0, 3)) + +#define gDPSetCombineLERP(pkt, a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ + a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | \ + _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \ + G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \ + GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), \ + 0, 24); \ + _g->words.w1 = (unsigned int)(GCCc0w1(G_CCMUX_##b0, \ + G_CCMUX_##d0, \ + G_ACMUX_##Ab0, \ + G_ACMUX_##Ad0) | \ + GCCc1w1(G_CCMUX_##b1, \ + G_ACMUX_##Aa1, \ + G_ACMUX_##Ac1, \ + G_CCMUX_##d1, \ + G_ACMUX_##Ab1, \ + G_ACMUX_##Ad1)); \ +} + +#define gsDPSetCombineLERP(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ + a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ +{{ \ + _SHIFTL(G_SETCOMBINE, 24, 8) | \ + _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \ + G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \ + GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), 0, 24), \ + (unsigned int)(GCCc0w1(G_CCMUX_##b0, G_CCMUX_##d0, \ + G_ACMUX_##Ab0, G_ACMUX_##Ad0) | \ + GCCc1w1(G_CCMUX_##b1, G_ACMUX_##Aa1, \ + G_ACMUX_##Ac1, G_CCMUX_##d1, \ + G_ACMUX_##Ab1, G_ACMUX_##Ad1)) \ +}} + +/* + * SetCombineMode macros are NOT redunant. It allow the C preprocessor + * to substitute single parameter which includes commas in the token and + * rescan for higher parameter count macro substitution. + * + * eg. gsDPSetCombineMode(G_CC_MODULATE, G_CC_MODULATE) turns into + * gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, + * TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0) + */ + +#define gDPSetCombineMode(pkt, a, b) gDPSetCombineLERP(pkt, a, b) +#define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b) + +#define gDPSetColor(pkt, c, d) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(c, 24, 8); \ + _g->words.w1 = (unsigned int)(d); \ +} + +#define gsDPSetColor(c, d) \ +{{ \ + _SHIFTL(c, 24, 8), (unsigned int)(d) \ +}} + +#define DPRGBColor(pkt, cmd, r, g, b, a) \ + gDPSetColor(pkt, cmd, \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))) +#define sDPRGBColor(cmd, r, g, b, a) \ + gsDPSetColor(cmd, \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))) + +#define gDPSetEnvColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETENVCOLOR, r,g,b,a) +#define gsDPSetEnvColor(r, g, b, a) \ + sDPRGBColor(G_SETENVCOLOR, r,g,b,a) +#define gDPSetBlendColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETBLENDCOLOR, r,g,b,a) +#define gsDPSetBlendColor(r, g, b, a) \ + sDPRGBColor(G_SETBLENDCOLOR, r,g,b,a) +#define gDPSetFogColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETFOGCOLOR, r,g,b,a) +#define gsDPSetFogColor(r, g, b, a) \ + sDPRGBColor(G_SETFOGCOLOR, r,g,b,a) +#define gDPSetFillColor(pkt, d) \ + gDPSetColor(pkt, G_SETFILLCOLOR, (d)) +#define gsDPSetFillColor(d) \ + gsDPSetColor(G_SETFILLCOLOR, (d)) + +#define gDPSetPrimDepth(pkt, z, dz) \ + gDPSetColor(pkt, G_SETPRIMDEPTH, \ + _SHIFTL(z, 16, 16) | _SHIFTL(dz, 0, 16)) +#define gsDPSetPrimDepth(z, dz) \ + gsDPSetColor(G_SETPRIMDEPTH, _SHIFTL(z, 16, 16) | \ + _SHIFTL(dz, 0, 16)) + +#define gDPSetPrimColor(pkt, m, l, r, g, b, a) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \ + _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \ + _g->words.w1 = (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)); \ +} + +#define gsDPSetPrimColor(m, l, r, g, b, a) \ +{{ \ + (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | \ + _SHIFTL(l, 0, 8)), \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | \ + _SHIFTL(a, 0, 8)) \ +}} + +/* + * gDPSetOtherMode (This is for expert user.) + * + * This command makes all othermode parameters set. + * Do not use this command in the same DL with another g*SPSetOtherMode DLs. + * + * [Usage] + * gDPSetOtherMode(pkt, modeA, modeB) + * + * 'modeA' is described all parameters of GroupA GBI command. + * 'modeB' is also described all parameters of GroupB GBI command. + * + * GroupA: + * gDPPipelineMode, gDPSetCycleType, gSPSetTexturePersp, + * gDPSetTextureDetail, gDPSetTextureLOD, gDPSetTextureLUT, + * gDPSetTextureFilter, gDPSetTextureConvert, gDPSetCombineKey, + * gDPSetColorDither, gDPSetAlphaDither + * + * GroupB: + * gDPSetAlphaCompare, gDPSetDepthSource, gDPSetRenderMode + * + * Use 'OR' operation to get modeA and modeB. + * + * modeA = G_PM_* | G_CYC_* | G_TP_* | G_TD_* | G_TL_* | G_TT_* | G_TF_* + * G_TC_* | G_CK_* | G_CD_* | G_AD_*; + * + * modeB = G_AC_* | G_ZS_* | G_RM_* | G_RM_*2; + */ +#define gDPSetOtherMode(pkt, mode0, mode1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24);\ + _g->words.w1 = (unsigned int)(mode1); \ +} + +#define gsDPSetOtherMode(mode0, mode1) \ +{{ \ + _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24), \ + (unsigned int)(mode1) \ +}} + +/* + * Texturing macros + */ + +/* These are also defined defined above for Sprite Microcode */ + +#define G_TX_LOADTILE 7 +#define G_TX_RENDERTILE 0 + +#define G_TX_NOMIRROR 0 +#define G_TX_WRAP 0 +#define G_TX_MIRROR 0x1 +#define G_TX_CLAMP 0x2 +#define G_TX_NOMASK 0 +#define G_TX_NOLOD 0 + + +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +/* + * Dxt is the inverse of the number of 64-bit words in a line of + * the texture being loaded using the load_block command. If + * there are any 1's to the right of the 11th fractional bit, + * dxt should be rounded up. The following macros accomplish + * this. The 4b macros are a special case since 4-bit textures + * are loaded as 8-bit textures. Dxt is fixed point 1.11. RJM + */ +#define G_TX_DXT_FRAC 11 + +/* + * For RCP 2.0, the maximum number of texels that can be loaded + * using a load_block command is 2048. In order to load the total + * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b, + * then change the tile to the proper texel size after the load. + * The g*DPLoadTextureBlock macros already do this, so this change + * will be transparent if you use these macros. If you use + * the g*DPLoadBlock macros directly, you will need to handle this + * tile manipulation yourself. RJM. + */ +#ifdef _HW_VERSION_1 +#define G_TX_LDBLK_MAX_TXL 4095 +#else +#define G_TX_LDBLK_MAX_TXL 2047 +#endif /* _HW_VERSION_1 */ + +#define TXL2WORDS(txls, b_txl) MAX(1, ((txls)*(b_txl)/8)) +#define CALC_DXT(width, b_txl) \ + (((1 << G_TX_DXT_FRAC) + TXL2WORDS(width, b_txl) - 1) / \ + TXL2WORDS(width, b_txl)) + +#define TXL2WORDS_4b(txls) MAX(1, ((txls)/16)) +#define CALC_DXT_4b(width) \ + (((1 << G_TX_DXT_FRAC) + TXL2WORDS_4b(width) - 1) / \ + TXL2WORDS_4b(width)) + +#define gDPLoadTileGeneric(pkt, c, tile, uls, ult, lrs, lrt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | \ + _SHIFTL(ult, 0, 12); \ + _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | \ + _SHIFTL(lrt, 0, 12); \ +} + +#define gsDPLoadTileGeneric(c, tile, uls, ult, lrs, lrt) \ +{{ \ + _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \ + _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12)\ +}} + +#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt) \ + gDPLoadTileGeneric(pkt, G_SETTILESIZE, t, uls, ult, lrs, lrt) +#define gsDPSetTileSize(t, uls, ult, lrs, lrt) \ + gsDPLoadTileGeneric(G_SETTILESIZE, t, uls, ult, lrs, lrt) +#define gDPLoadTile(pkt, t, uls, ult, lrs, lrt) \ + gDPLoadTileGeneric(pkt, G_LOADTILE, t, uls, ult, lrs, lrt) +#define gsDPLoadTile(t, uls, ult, lrs, lrt) \ + gsDPLoadTileGeneric(G_LOADTILE, t, uls, ult, lrs, lrt) + +#define gDPSetTile(pkt, fmt, siz, line, tmem, tile, palette, cmt, \ + maskt, shiftt, cms, masks, shifts) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) |\ + _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | \ + _SHIFTL(tmem, 0, 9); \ + _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \ + _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \ + _SHIFTL(shiftt, 10, 4) |_SHIFTL(cms, 8, 2) | \ + _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4); \ +} + +#define gsDPSetTile(fmt, siz, line, tmem, tile, palette, cmt, \ + maskt, shiftt, cms, masks, shifts) \ +{{ \ + (_SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | _SHIFTL(tmem, 0, 9)),\ + (_SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \ + _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \ + _SHIFTL(shiftt, 10, 4) | _SHIFTL(cms, 8, 2) | \ + _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4)) \ +}} + +/* + * For RCP 2.0, the maximum number of texels that can be loaded + * using a load_block command is 2048. In order to load the total + * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b, + * then change the tile to the proper texel size after the load. + * The g*DPLoadTextureBlock macros already do this, so this change + * will be transparent if you use these macros. If you use + * the g*DPLoadBlock macros directly, you will need to handle this + * tile manipulation yourself. RJM. + */ +#define gDPLoadBlock(pkt, tile, uls, ult, lrs, dxt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_LOADBLOCK, 24, 8) | \ + _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | \ + _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) |\ + _SHIFTL(dxt, 0, 12)); \ +} + +#define gsDPLoadBlock(tile, uls, ult, lrs, dxt) \ +{{ \ + (_SHIFTL(G_LOADBLOCK, 24, 8) | _SHIFTL(uls, 12, 12) | \ + _SHIFTL(ult, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | \ + _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) | \ + _SHIFTL(dxt, 0, 12)) \ +}} + +#define gDPLoadTLUTCmd(pkt, tile, count) \ +{ \ + Gfx *_g = (Gfx *)pkt; \ + \ + _g->words.w0 = _SHIFTL(G_LOADTLUT, 24, 8); \ + _g->words.w1 = _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10);\ +} + +#define gsDPLoadTLUTCmd(tile, count) \ +{{ \ + _SHIFTL(G_LOADTLUT, 24, 8), \ + _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10) \ +}} + +#define gDPLoadTextureBlock(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gDPLoadTextureBlockYuv(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * 1)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* Load fix rww 27jun95 */ +/* The S at the end means odd lines are already word Swapped */ + +#define gDPLoadTextureBlockS(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * Allow tmem address and render tile to be specified. + * The S at the end means odd lines are already word Swapped + */ +#define gDPLoadMultiBlockS(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + + +#define gDPLoadTextureBlockYuvS(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * 1)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address to be specified + */ +#define _gDPLoadTextureBlock(pkt, timg, tmem, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0, cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, G_TX_RENDERTILE, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address and render tile to be specified + */ +#define _gDPLoadTextureBlockTile(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, rtile, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address and render tile to be specified + */ +#define gDPLoadMultiBlock(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, rtile, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gsDPLoadTextureBlock(timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* Here is the static form of the pre-swapped texture block loading */ +/* See gDPLoadTextureBlockS() for reference. Basically, just don't + calculate DxT, use 0 */ + +#define gsDPLoadTextureBlockS(timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0 , \ + cmt, maskt,shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * Allow tmem address to be specified + */ +#define _gsDPLoadTextureBlock(timg, tmem, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allow tmem address and render_tile to be specified + */ +#define _gsDPLoadTextureBlockTile(timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allow tmem address and render_tile to be specified, useful when loading + * mutilple tiles at a time. + */ +#define gsDPLoadMultiBlock(timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * Allows tmem and render tile to be specified. Useful when loading + * several tiles at a time. + * + * Here is the static form of the pre-swapped texture block loading + * See gDPLoadTextureBlockS() for reference. Basically, just don't + * calculate DxT, use 0 + */ + +#define gsDPLoadMultiBlockS(timg, tmem, rtile, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0 , \ + cmt, maskt,shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), tmem,\ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +#define gDPLoadTextureBlock_4b(pkt, timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* Load fix rww 27jun95 */ +/* The S at the end means odd lines are already word Swapped */ + +#define gDPLoadTextureBlock_4bS(pkt, timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, 0 ); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * 4-bit load block. Useful when loading multiple tiles + */ +#define gDPLoadMultiBlock_4b(pkt, timg, tmem, rtile, fmt, width, height,\ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * 4-bit load block. Allows tmem and render tile to be specified. Useful when + * loading multiple tiles. The S means odd lines are already word swapped. + */ +#define gDPLoadMultiBlock_4bS(pkt, timg, tmem, rtile, fmt, width, height,\ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, 0 ); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + + +#define _gDPLoadTextureBlock_4b(pkt, timg, tmem, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gsDPLoadTextureBlock_4b(timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +#define gsDPLoadTextureBlock_4bS(timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * 4-bit load block. Allows tmem address and render tile to be specified. + * Useful when loading multiple tiles. + */ +#define gsDPLoadMultiBlock_4b(timg, tmem, rtile, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * 4-bit load block. Allows tmem address and render tile to be specified. + * Useful when loading multiple tiles. S means odd lines are already swapped. + */ +#define gsDPLoadMultiBlock_4bS(timg, tmem, rtile, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allows tmem address to be specified + */ +#define _gsDPLoadTextureBlock_4b(timg, tmem, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +#ifndef _HW_VERSION_1 + +#define gDPLoadTextureTile(pkt, timg, fmt, siz, width, height, \ + uls, ult, lrs, lrt, pal, \ + cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz, width, timg); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs)-(uls)+1) * siz##_TILE_BYTES)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls)<>3), tmem, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks,\ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, \ + (uls)<>3), \ + tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<>3), \ + tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, \ + (uls)<>1), timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, \ + masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls)<>1), timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<>1), timg), \ + gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, \ + (uls)<>1), timg), \ + gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), \ + tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), \ + tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, \ + (uls)<words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(uly)*4.0F), 0, 12); \ + _g->words.w1 = _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(lry)*4.0F), 0, 12); \ +} + + +#define gDPSetScissorFrac(pkt, mode, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)pkt; \ + \ + _g->words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((ulx)), 12, 12) | \ + _SHIFTL((int)((uly)), 0, 12); \ + _g->words.w1 = _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((lrx)), 12, 12) | \ + _SHIFTL((int)((lry)), 0, 12); \ +} + +#define gsDPSetScissor(mode, ulx, uly, lrx, lry) \ +{{ \ + _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(uly)*4.0F), 0, 12), \ + _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(lry)*4.0F), 0, 12) \ +}} + +#define gsDPSetScissorFrac(mode, ulx, uly, lrx, lry) \ +{{ \ + _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((ulx)), 12, 12) | \ + _SHIFTL((int)((uly)), 0, 12), \ + _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)(lrx), 12, 12) | \ + _SHIFTL((int)(lry), 0, 12) \ +}} + +/* Fraction never used in fill */ +#ifdef F3DEX_GBI_2E +#define gDPFillRectangle(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g0 = (Gfx *)(pkt), *_g1 = (Gfx *)(pkt); \ + _g0->words.w0 = _SHIFTL(G_FILLRECT, 24, 8) | \ + _SHIFTL((lrx), 2, 22); \ + _g0->words.w1 = _SHIFTL((lry), 2, 22); \ + _g1->words.w0 = _SHIFTL((ulx), 2, 22); \ + _g1->words.w1 = _SHIFTL((uly), 2, 22); \ +} +#define gsDPFillRectangle(ulx, uly, lrx, lry) \ +{{ \ + (_SHIFTL(G_FILLRECT, 24, 8) | _SHIFTL((lrx), 2, 22)), \ + _SHIFTL((lry), 2, 22), \ +}}, \ +{{ \ + _SHIFTL((ulx), 2, 22), \ + _SHIFTL((uly), 2, 22), \ +}} +#else +#define gDPFillRectangle(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \ + _SHIFTL((lrx), 14, 10) | _SHIFTL((lry), 2, 10));\ + _g->words.w1 = (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10));\ +} +#define gsDPFillRectangle(ulx, uly, lrx, lry) \ +{{ \ + (_SHIFTL(G_FILLRECT, 24, 8) | _SHIFTL((lrx), 14, 10) | \ + _SHIFTL((lry), 2, 10)), \ + (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10)) \ +}} +#endif + +/* like gDPFillRectangle but accepts negative arguments */ +#ifndef F3DEX_GBI_2E +#define gDPScisFillRectangle(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \ + _SHIFTL(MAX((lrx),0), 14, 10) | \ + _SHIFTL(MAX((lry),0), 2, 10)); \ + _g->words.w1 = (_SHIFTL(MAX((ulx),0), 14, 10) | \ + _SHIFTL(MAX((uly),0), 2, 10)); \ +} +#endif + +#define gDPSetConvert(pkt, k0, k1, k2, k3, k4, k5) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETCONVERT, 24, 8) | \ + _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | \ + _SHIFTR(k2, 5, 4)); \ + _g->words.w1 = (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | \ + _SHIFTL(k4, 9, 9) | _SHIFTL(k5, 0, 9)); \ +} + +#define gsDPSetConvert(k0, k1, k2, k3, k4, k5) \ +{{ \ + (_SHIFTL(G_SETCONVERT, 24, 8) | \ + _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | _SHIFTR(k2, 5, 4)), \ + (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | _SHIFTL(k4, 9, 9) | \ + _SHIFTL(k5, 0, 9)) \ +}} + +#define gDPSetKeyR(pkt, cR, sR, wR) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETKEYR, 24, 8); \ + _g->words.w1 = (_SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | \ + _SHIFTL(sR, 0, 8)); \ +} + +#define gsDPSetKeyR(cR, sR, wR) \ +{{ \ + _SHIFTL(G_SETKEYR, 24, 8), \ + _SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | _SHIFTL(sR, 0, 8) \ +}} + +#define gDPSetKeyGB(pkt, cG, sG, wG, cB, sB, wB) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETKEYGB, 24, 8) | \ + _SHIFTL(wG, 12, 12) | _SHIFTL(wB, 0, 12)); \ + _g->words.w1 = (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | \ + _SHIFTL(cB, 8, 8) | _SHIFTL(sB, 0, 8)); \ +} + +#define gsDPSetKeyGB(cG, sG, wG, cB, sB, wB) \ +{{ \ + (_SHIFTL(G_SETKEYGB, 24, 8) | _SHIFTL(wG, 12, 12) | \ + _SHIFTL(wB, 0, 12)), \ + (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | _SHIFTL(cB, 8, 8) | \ + _SHIFTL(sB, 0, 8)) \ +}} + +#define gDPNoParam(pkt, cmd) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8); \ + _g->words.w1 = 0; \ +} + +#define gsDPNoParam(cmd) \ +{{ \ + _SHIFTL(cmd, 24, 8), 0 \ +}} + +#define gDPParam(pkt, cmd, param) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8); \ + _g->words.w1 = (param); \ +} + +#define gsDPParam(cmd, param) \ +{{ \ + _SHIFTL(cmd, 24, 8), (param) \ +}} + +/* Notice that textured rectangles are 128-bit commands, therefore + * gsDPTextureRectangle() should not be used in display lists + * under normal circumstances (use gsSPTextureRectangle()). + * That is also why there is no gDPTextureRectangle() macros. + */ +#define gsDPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + +#define gDPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + if (pkt); \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + _g ++; \ + _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} + +#define gsDPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + +#define gDPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + if (pkt); \ + _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + _g ++; \ + _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} + +#ifdef F3D_OLD +# define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\ +} + +#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +/* like gSPTextureRectangle but accepts negative position arguments */ +# define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \ + _SHIFTL(MAX((s16)(xh),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yh),0), 0, 12)); \ + _g->words.w1 = (_SHIFTL((tile), 24, 3) | \ + _SHIFTL(MAX((s16)(xl),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yl),0), 0, 12)); \ + gImmp1(pkt, G_RDPHALF_2, \ + (_SHIFTL(((s) - \ + (((s16)(xl) < 0) ? \ + (((s16)(dsdx) < 0) ? \ + (MAX((((s16)(xl)*(s16)(dsdx))>>7),0)) : \ + (MIN((((s16)(xl)*(s16)(dsdx))>>7),0))) : 0)), \ + 16, 16) | \ + _SHIFTL(((t) - \ + (((yl) < 0) ? \ + (((s16)(dtdy) < 0) ? \ + (MAX((((s16)(yl)*(s16)(dtdy))>>7),0)) : \ + (MIN((((s16)(yl)*(s16)(dtdy))>>7),0))) : 0)), \ + 0, 16))); \ + gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL((dsdx), 16, 16) | \ + _SHIFTL((dtdy), 0, 16))); \ +} + +# define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +# define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) |\ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \ +} +#elif defined(F3DEX_GBI_2E) +# define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g0 = (Gfx *)(pkt), *_g1 = (Gfx *)(pkt), *_g2 = (Gfx *)(pkt); \ + \ + _g0->words.w0 = _SHIFTL(G_TEXRECT, 24, 8) | \ + _SHIFTL((xh), 0, 24); \ + _g0->words.w1 = _SHIFTL((yh), 0, 24); \ + _g1->words.w0 = (_SHIFTL(tile, 24, 3) | _SHIFTL((xl), 0, 24)); \ + _g1->words.w1 = _SHIFTL((yl), 0, 24); \ + _g2->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g2->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} + +# define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL((xh), 0, 24)), \ + _SHIFTL((yh), 0, 24), \ +}}, \ +{{ \ + (_SHIFTL((tile), 24, 3) | _SHIFTL((xl), 0, 24)), \ + _SHIFTL((yl), 0, 24), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + +# define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g0 = (Gfx *)(pkt), *_g1 = (Gfx *)(pkt), *_g2 = (Gfx *)(pkt); \ + \ + _g0->words.w0 = _SHIFTL(G_TEXRECTFLIP, 24, 8) | \ + _SHIFTL((xh), 0, 24); \ + _g0->words.w1 = _SHIFTL((yh), 0, 24); \ + _g1->words.w0 = (_SHIFTL(tile, 24, 3) | _SHIFTL((xl), 0, 24)); \ + _g1->words.w1 = _SHIFTL((yl), 0, 24); \ + _g2->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g2->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} +#else +# define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\ +} + +#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +/* like gSPTextureRectangle but accepts negative position arguments */ +# define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \ + _SHIFTL(MAX((s16)(xh),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yh),0), 0, 12)); \ + _g->words.w1 = (_SHIFTL((tile), 24, 3) | \ + _SHIFTL(MAX((s16)(xl),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yl),0), 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, \ + (_SHIFTL(((s) - \ + (((s16)(xl) < 0) ? \ + (((s16)(dsdx) < 0) ? \ + (MAX((((s16)(xl)*(s16)(dsdx))>>7),0)) : \ + (MIN((((s16)(xl)*(s16)(dsdx))>>7),0))) : 0)), \ + 16, 16) | \ + _SHIFTL(((t) - \ + (((yl) < 0) ? \ + (((s16)(dtdy) < 0) ? \ + (MAX((((s16)(yl)*(s16)(dtdy))>>7),0)) : \ + (MIN((((s16)(yl)*(s16)(dtdy))>>7),0))) : 0)), \ + 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL((dsdx), 16, 16) | \ + _SHIFTL((dtdy), 0, 16))); \ +} + +# define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +# define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) |\ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \ +} +#endif + +#define gsDPWord(wordhi, wordlo) \ + gsImmp1(G_RDPHALF_1, (uintptr_t)(wordhi)), \ + gsImmp1(G_RDPHALF_2, (uintptr_t)(wordlo)) + +#define gDPWord(pkt, wordhi, wordlo) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + gImmp1(pkt, G_RDPHALF_1, (uintptr_t)(wordhi)); \ + gImmp1(pkt, G_RDPHALF_2, (uintptr_t)(wordlo)); \ +} + +#define gDPFullSync(pkt) gDPNoParam(pkt, G_RDPFULLSYNC) +#define gsDPFullSync() gsDPNoParam(G_RDPFULLSYNC) +#define gDPTileSync(pkt) gDPNoParam(pkt, G_RDPTILESYNC) +#define gsDPTileSync() gsDPNoParam(G_RDPTILESYNC) +#define gDPPipeSync(pkt) gDPNoParam(pkt, G_RDPPIPESYNC) +#define gsDPPipeSync() gsDPNoParam(G_RDPPIPESYNC) +#define gDPLoadSync(pkt) gDPNoParam(pkt, G_RDPLOADSYNC) +#define gsDPLoadSync() gsDPNoParam(G_RDPLOADSYNC) +#define gDPNoOp(pkt) gDPNoParam(pkt, G_NOOP) +#define gsDPNoOp() gsDPNoParam(G_NOOP) +#define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag) +#define gsDPNoOpTag(tag) gsDPParam(G_NOOP, tag) + +#endif /* _LANGUAGE_C */ + + +#endif /* _GBI_H_ */ diff --git a/include/PR/gs2dex.h b/include/PR/gs2dex.h new file mode 100644 index 00000000..ced46855 --- /dev/null +++ b/include/PR/gs2dex.h @@ -0,0 +1,392 @@ +/*--------------------------------------------------------------------- + Copyright (C) 1997, Nintendo. + + File gs2dex.h + Coded by Yoshitaka Yasumoto. Jul 31, 1997. + Modified by + Comments Header file for S2DEX ucode. + + $Id: gs2dex.h,v 1.21 1998/05/28 00:14:49 has Exp $ + ---------------------------------------------------------------------*/ + +#ifndef _GS2DEX_H_ +#define _GS2DEX_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +/*===========================================================================* + * Macro + *===========================================================================*/ +#define GS_CALC_DXT(line) (((1<< G_TX_DXT_FRAC)-1)/(line)+1) +#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz))) +#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))) + +/*===========================================================================* + * Data structures for S2DEX microcode + *===========================================================================*/ + +/*---------------------------------------------------------------------------* + * Background + *---------------------------------------------------------------------------*/ +#define G_BGLT_LOADBLOCK 0x0033 +#define G_BGLT_LOADTILE 0xfff4 + +#define G_BG_FLAG_FLIPS 0x01 +#define G_BG_FLAG_FLIPT 0x10 + +/* Non scalable background plane */ +typedef struct { + u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ + u16 imageW; /* width of the texture (u10.2) */ + s16 frameX; /* upper-left position of transferred frame (s10.2) */ + u16 frameW; /* width of transferred frame (u10.2) */ + + u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ + u16 imageH; /* height of the texture (u10.2) */ + s16 frameY; /* upper-left position of transferred frame (s10.2) */ + u16 frameH; /* height of transferred frame (u10.2) */ + + u64 *imagePtr; /* texture source address on DRAM */ + u16 imageLoad; /* which to use, LoadBlock or LoadTile */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u16 imagePal; /* pallet number */ + u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ + + /* The following is set in the initialization routine guS2DInitBg(). There is no need for the user to set it. */ + u16 tmemW; /* TMEM width and Word size of frame 1 line. + At LoadBlock, GS_PIX2TMEM(imageW/4,imageSiz) + At LoadTile GS_PIX2TMEM(frameW/4,imageSiz)+1 */ + u16 tmemH; /* height of TMEM loadable at a time (s13.2) 4 times value + When the normal texture, 512/tmemW*4 + When the CI texture, 256/tmemW*4 */ + u16 tmemLoadSH; /* SH value + At LoadBlock, tmemSize/2-1 + At LoadTile, tmemW*16-1 */ + u16 tmemLoadTH; /* TH value or Stride value + At LoadBlock, GS_CALC_DXT(tmemW) + At LoadTile, tmemH-1 */ + u16 tmemSizeW; /* skip value of imagePtr for image 1-line + At LoadBlock, tmemW*2 + At LoadTile, GS_PIX2TMEM(imageW/4,imageSiz)*2 */ + u16 tmemSize; /* skip value of imagePtr for 1-loading + = tmemSizeW*tmemH */ +} uObjBg_t; /* 40 bytes */ + +/* Scalable background plane */ +typedef struct { + u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ + u16 imageW; /* width of texture (u10.2) */ + s16 frameX; /* upper-left position of transferred frame (s10.2) */ + u16 frameW; /* width of transferred frame (u10.2) */ + + u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ + u16 imageH; /* height of texture (u10.2) */ + s16 frameY; /* upper-left position of transferred frame (s10.2) */ + u16 frameH; /* height of transferred frame (u10.2) */ + + u64 *imagePtr; /* texture source address on DRAM */ + u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u16 imagePal; /* pallet number */ + u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ + + u16 scaleW; /* scale value of X-direction (u5.10) */ + u16 scaleH; /* scale value of Y-direction (u5.10) */ + s32 imageYorig; /* start point of drawing on image (s20.5) */ + + u8 padding[4]; + +} uObjScaleBg_t; /* 40 bytes */ + +typedef union { + uObjBg_t b; + uObjScaleBg_t s; + long long int force_structure_alignment; +} uObjBg; + +/*---------------------------------------------------------------------------* + * 2D Objects + *---------------------------------------------------------------------------*/ +#define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */ +#define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */ + +typedef struct { + s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */ + u16 scaleW; /* u5.10 Scaling of u5.10 width direction */ + u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */ + u16 paddingX; /* Unused - Always 0 */ + s16 objY; /* s10.2 OBJ y-coordinate of s10.2 OBJ upper-left end */ + u16 scaleH; /* u5.10 Scaling of u5.10 height direction */ + u16 imageH; /* u10.5 height of u10.5 texture (length of T-direction) */ + u16 paddingY; /* Unused - Always 0 */ + u16 imageStride; /* folding width of texel (In units of 64bit word) */ + u16 imageAdrs; /* texture header position in TMEM (In units of 64bit word) */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u8 imagePal; /* pallet number (0-7) */ + u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */ +} uObjSprite_t; /* 24 bytes */ + +typedef union { + uObjSprite_t s; + long long int force_structure_alignment; +} uObjSprite; + +/*---------------------------------------------------------------------------* + * 2D Matrix + *---------------------------------------------------------------------------*/ +typedef struct { + s32 A, B, C, D; /* s15.16 */ + s16 X, Y; /* s10.2 */ + u16 BaseScaleX; /* u5.10 */ + u16 BaseScaleY; /* u5.10 */ +} uObjMtx_t; /* 24 bytes */ + +typedef union { + uObjMtx_t m; + long long int force_structure_alignment; +} uObjMtx; + +typedef struct { + s16 X, Y; /* s10.2 */ + u16 BaseScaleX; /* u5.10 */ + u16 BaseScaleY; /* u5.10 */ +} uObjSubMtx_t; /* 8 bytes */ + +typedef union { + uObjSubMtx_t m; + long long int force_structure_alignment; +} uObjSubMtx; + +/*---------------------------------------------------------------------------* + * Loading into TMEM + *---------------------------------------------------------------------------*/ +#define G_OBJLT_TXTRBLOCK 0x00001033 +#define G_OBJLT_TXTRTILE 0x00fc1034 +#define G_OBJLT_TLUT 0x00000030 + +#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1) +#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz)))) + +typedef struct { + u32 type; /* G_OBJLT_TXTRBLOCK divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 tmem; /* loaded TMEM word address (8byteWORD) */ + u16 tsize; /* Texture size, Specified by macro GS_TB_TSIZE() */ + u16 tline; /* width of Texture 1-line, Specified by macro GS_TB_TLINE() */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrBlock_t; /* 24 bytes */ + +#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1) +#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1) + +typedef struct { + u32 type; /* G_OBJLT_TXTRTILE divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 tmem; /* loaded TMEM word address (8byteWORD)*/ + u16 twidth; /* width of Texture (Specified by macro GS_TT_TWIDTH()) */ + u16 theight; /* height of Texture (Specified by macro GS_TT_THEIGHT()) */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrTile_t; /* 24 bytes */ + +#define GS_PAL_HEAD(head) ((head)+256) +#define GS_PAL_NUM(num) ((num)-1) + +typedef struct { + u32 type; /* G_OBJLT_TLUT divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 phead; /* pallet number of load header (Between 256 and 511) */ + u16 pnum; /* loading pallet number -1 */ + u16 zero; /* Assign 0 all the time */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12)*/ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrTLUT_t; /* 24 bytes */ + +typedef union { + uObjTxtrBlock_t block; + uObjTxtrTile_t tile; + uObjTxtrTLUT_t tlut; + long long int force_structure_alignment; +} uObjTxtr; + +/*---------------------------------------------------------------------------* + * Loading into TMEM & 2D Objects + *---------------------------------------------------------------------------*/ +typedef struct { + uObjTxtr txtr; + uObjSprite sprite; +} uObjTxSprite; /* 48 bytes */ + +/*===========================================================================* + * GBI Commands for S2DEX microcode + *===========================================================================*/ +/* GBI Header */ +#ifdef F3DEX_GBI_2 +#define G_OBJ_RECTANGLE_R 0xda +#define G_OBJ_MOVEMEM 0xdc +#define G_RDPHALF_0 0xe4 +#define G_OBJ_RECTANGLE 0x01 +#define G_OBJ_SPRITE 0x02 +#define G_SELECT_DL 0x04 +#define G_OBJ_LOADTXTR 0x05 +#define G_OBJ_LDTX_SPRITE 0x06 +#define G_OBJ_LDTX_RECT 0x07 +#define G_OBJ_LDTX_RECT_R 0x08 +#define G_BG_1CYC 0x09 +#define G_BG_COPY 0x0a +#define G_OBJ_RENDERMODE 0x0b +#else +#define G_BG_1CYC 0x01 +#define G_BG_COPY 0x02 +#define G_OBJ_RECTANGLE 0x03 +#define G_OBJ_SPRITE 0x04 +#define G_OBJ_MOVEMEM 0x05 +#define G_SELECT_DL 0xb0 +#define G_OBJ_RENDERMODE 0xb1 +#define G_OBJ_RECTANGLE_R 0xb2 +#define G_OBJ_LOADTXTR 0xc1 +#define G_OBJ_LDTX_SPRITE 0xc2 +#define G_OBJ_LDTX_RECT 0xc3 +#define G_OBJ_LDTX_RECT_R 0xc4 +#define G_RDPHALF_0 0xe4 +#endif + +/*---------------------------------------------------------------------------* + * Background wrapped screen + *---------------------------------------------------------------------------*/ +#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt),(m),(mptr),0) +#define gsSPBgRectangle(m, mptr) gsDma0p( (m),(mptr),0) +#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr)) +#define gsSPBgRectCopy(mptr) gsSPBgRectangle( G_BG_COPY, (mptr)) +#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr)) +#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle( G_BG_1CYC, (mptr)) + +/*---------------------------------------------------------------------------* + * 2D Objects + *---------------------------------------------------------------------------*/ +#define gSPObjSprite(pkt, mptr) gDma0p((pkt),G_OBJ_SPRITE, (mptr),0) +#define gsSPObjSprite(mptr) gsDma0p( G_OBJ_SPRITE, (mptr),0) +#define gSPObjRectangle(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE, (mptr),0) +#define gsSPObjRectangle(mptr) gsDma0p( G_OBJ_RECTANGLE, (mptr),0) +#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE_R,(mptr),0) +#define gsSPObjRectangleR(mptr) gsDma0p( G_OBJ_RECTANGLE_R,(mptr),0) + +/*---------------------------------------------------------------------------* + * 2D Matrix + *---------------------------------------------------------------------------*/ +#define gSPObjMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),0,23) +#define gsSPObjMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),0,23) +#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),2, 7) +#define gsSPObjSubMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),2, 7) + +/*---------------------------------------------------------------------------* + * Loading into TMEM + *---------------------------------------------------------------------------*/ +#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt),G_OBJ_LOADTXTR, (tptr),23) +#define gsSPObjLoadTxtr(tptr) gsDma0p( G_OBJ_LOADTXTR, (tptr),23) +#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_SPRITE,(tptr),47) +#define gsSPObjLoadTxSprite(tptr) gsDma0p( G_OBJ_LDTX_SPRITE,(tptr),47) +#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT, (tptr),47) +#define gsSPObjLoadTxRect(tptr) gsDma0p( G_OBJ_LDTX_RECT, (tptr),47) +#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT_R,(tptr),47) +#define gsSPObjLoadTxRectR(tptr) gsDma0p( G_OBJ_LDTX_RECT_R,(tptr),47) + +/*---------------------------------------------------------------------------* + * Select Display List + *---------------------------------------------------------------------------*/ +#define gSPSelectDL(pkt, mptr, sid, flag, mask) \ +{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } +#define gsSPSelectDL(mptr, sid, flag, mask) \ +{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } +#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \ +{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } +#define gsSPSelectBranchDL(mptr, sid, flag, mask) \ +{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } + +/*---------------------------------------------------------------------------* + * Set general status + *---------------------------------------------------------------------------*/ +#define G_MW_GENSTAT 0x08 /* Note that it is the same value of G_MW_FOG */ + +#define gSPSetStatus(pkt, sid, val) \ + gMoveWd((pkt), G_MW_GENSTAT, (sid), (val)) +#define gsSPSetStatus(sid, val) \ + gsMoveWd( G_MW_GENSTAT, (sid), (val)) + +/*---------------------------------------------------------------------------* + * Set Object Render Mode + *---------------------------------------------------------------------------*/ +#define G_OBJRM_NOTXCLAMP 0x01 +#define G_OBJRM_XLU 0x02 /* Ignored */ +#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */ +#define G_OBJRM_BILERP 0x08 +#define G_OBJRM_SHRINKSIZE_1 0x10 +#define G_OBJRM_SHRINKSIZE_2 0x20 +#define G_OBJRM_WIDEN 0x40 + +#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode)) +#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode)) + +/*===========================================================================* + * Render Mode Macro + *===========================================================================*/ +#define RM_RA_SPRITE(clk) \ + AA_EN | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define G_RM_SPRITE G_RM_OPA_SURF +#define G_RM_SPRITE2 G_RM_OPA_SURF2 +#define G_RM_RA_SPRITE RM_RA_SPRITE(1) +#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2) +#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR +#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2 +#define G_RM_XLU_SPRITE G_RM_XLU_SURF +#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2 +#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF +#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2 + +/*===========================================================================* + * External functions + *===========================================================================*/ +extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[]; +extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[]; +extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[]; +extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[]; +extern u64 gspS2DEX2_fifoTextStart[], gspS2DEX2_fifoTextEnd[]; +extern u64 gspS2DEX2_fifoDataStart[], gspS2DEX2_fifoDataEnd[]; +extern u64 gspS2DEX2_xbusTextStart[], gspS2DEX2_xbusTextEnd[]; +extern u64 gspS2DEX2_xbusDataStart[], gspS2DEX2_xbusDataEnd[]; +extern void guS2DInitBg(uObjBg *); + +#ifdef F3DEX_GBI_2 +# define guS2DEmuBgRect1Cyc guS2D2EmuBgRect1Cyc /*Wrapper*/ +# define guS2DEmuSetScissor guS2D2EmuSetScissor /*Wrapper*/ + extern void guS2D2EmuSetScissor(u32, u32, u32, u32, u8); + extern void guS2D2EmuBgRect1Cyc(Gfx **, uObjBg *); +#else + extern void guS2DEmuSetScissor(u32, u32, u32, u32, u8); + extern void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *); +#endif + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif +#endif /* _GS2DEX_H_ */ + +/*======== End of gs2dex.h ========*/ diff --git a/include/ultra64/gu.h b/include/PR/gu.h similarity index 75% rename from include/ultra64/gu.h rename to include/PR/gu.h index d2ff3a8e..6527777d 100644 --- a/include/ultra64/gu.h +++ b/include/PR/gu.h @@ -1,6 +1,9 @@ #ifndef _ULTRA64_GU_H_ #define _ULTRA64_GU_H_ +#include +#include + #define GU_PI 3.1415926 /* Functions */ @@ -18,4 +21,9 @@ void guMtxIdent(Mtx *m); void guMtxIdentF(float mf[4][4]); void guMtxL2F(float mf[4][4], Mtx *m); void guNormalize(float *, float *, float *); + +/* Used only in Fast3DEX2 */ +void guLookAtReflect (Mtx *m, LookAt *l, float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); #endif diff --git a/include/PR/libaudio.h b/include/PR/libaudio.h new file mode 100644 index 00000000..3fffe9c0 --- /dev/null +++ b/include/PR/libaudio.h @@ -0,0 +1,48 @@ +#ifndef _ULTRA64_LIBAUDIO_H_ +#define _ULTRA64_LIBAUDIO_H_ + +#include "abi.h" + +typedef struct +{ + u8 *offset; + s32 len; +#ifdef VERSION_SH + s8 magic[2]; // tbl: 0x0204, otherwise: 0x0203 + + // for ctl (else zeros): + union { + // unused, just for clarification (big endian) + struct { + u8 bank; + u8 ff; + u8 numInstruments; + u8 numDrums; + } as_u8; + + // used + struct { + s16 bankAndFf; + s16 numInstrumentsAndDrums; + } as_s16; + } ctl; +#endif +} ALSeqData; + +typedef struct +{ +#ifndef VERSION_SH + s16 revision; +#endif + s16 seqCount; +#ifdef VERSION_SH + s16 unk2; + u8 *data; + s32 pad[2]; +#endif + ALSeqData seqArray[1]; +} ALSeqFile; + +void alSeqFileNew(ALSeqFile *f, u8 *base); + +#endif diff --git a/include/ultra64/libultra.h b/include/PR/libultra.h similarity index 93% rename from include/ultra64/libultra.h rename to include/PR/libultra.h index 033a8d8e..f0dab415 100644 --- a/include/ultra64/libultra.h +++ b/include/PR/libultra.h @@ -12,6 +12,7 @@ extern u32 osTvType; extern u32 osRomBase; extern u32 osResetType; +extern u32 osMemSize; extern u8 osAppNmiBuffer[64]; -extern u64 osClockRate; + #endif /* _LIBULTRA_H */ diff --git a/include/PR/mbi.h b/include/PR/mbi.h new file mode 100644 index 00000000..6b3cebfe --- /dev/null +++ b/include/PR/mbi.h @@ -0,0 +1,102 @@ +#ifndef _MBI_H_ +#define _MBI_H_ + +#include "platform_info.h" + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.136 $ + * $Date: 1999/01/05 13:04:00 $ + * $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $ + * + **************************************************************************/ + +/* + * Header file for the Media Binary Interface + * + * NOTE: This file is included by the RSP microcode, so any C-specific + * constructs must be bracketed by #ifdef _LANGUAGE_C + * + */ + + +/* + * the SHIFT macros are used to build display list commands, inserting + * bit-fields into a 32-bit word. They take a value, a shift amount, + * and a width. + * + * For the left shift, the lower bits of the value are masked, + * then shifted left. + * + * For the right shift, the value is shifted right, then the lower bits + * are masked. + * + * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment) + * + */ +#define _SHIFTL(v, s, w) \ + ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s))) +#define _SHIFTR(v, s, w) \ + ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1))) + +#define _SHIFT _SHIFTL /* old, for compatibility only */ + +#define G_ON (1) +#define G_OFF (0) + +/************************************************************************** + * + * Graphics Binary Interface + * + **************************************************************************/ + +#include + +/************************************************************************** + * + * Audio Binary Interface + * + **************************************************************************/ + +#include + +/************************************************************************** + * + * Task list + * + **************************************************************************/ + +#define M_GFXTASK 1 +#define M_AUDTASK 2 +#define M_VIDTASK 3 +#define M_HVQTASK 6 +#define M_HVQMTASK 7 + +/************************************************************************** + * + * Segment macros and definitions + * + **************************************************************************/ + +#define NUM_SEGMENTS (16) +#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff) +#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28) +#define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* !_MBI_H_ */ diff --git a/include/PR/os_ai.h b/include/PR/os_ai.h new file mode 100644 index 00000000..f89d87cf --- /dev/null +++ b/include/PR/os_ai.h @@ -0,0 +1,92 @@ + +/*==================================================================== + * os_ai.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_ai.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:04 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_AI_H_ +#define _OS_AI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Audio interface (Ai) */ +extern u32 osAiGetStatus(void); +extern u32 osAiGetLength(void); +extern s32 osAiSetFrequency(u32); +extern s32 osAiSetNextBuffer(void *, u32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_AI_H_ */ diff --git a/include/PR/os_cache.h b/include/PR/os_cache.h new file mode 100644 index 00000000..93d53c5f --- /dev/null +++ b/include/PR/os_cache.h @@ -0,0 +1,96 @@ + +/*==================================================================== + * os_cache.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_cache.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:04 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_CACHE_H_ +#define _OS_CACHE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10)) +#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10)) + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Cache operations and macros */ + +extern void osInvalDCache(void *, size_t); +extern void osInvalICache(void *, size_t); +extern void osWritebackDCache(void *, size_t); +extern void osWritebackDCacheAll(void); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_CACHE_H_ */ diff --git a/include/PR/os_cont.h b/include/PR/os_cont.h new file mode 100644 index 00000000..15ee60f3 --- /dev/null +++ b/include/PR/os_cont.h @@ -0,0 +1,207 @@ + +/*==================================================================== + * os_cont.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_cont.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:05 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_CONT_H_ +#define _OS_CONT_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for controllers + */ + +typedef struct { + u16 type; /* Controller Type */ + u8 status; /* Controller status */ + u8 errnum; +}OSContStatus; + +typedef struct { + u16 button; + s8 stick_x; /* -80 <= stick_x <= 80 */ + s8 stick_y; /* -80 <= stick_y <= 80 */ + u8 errnum; +} OSContPad; + +typedef struct { + void *address; /* Ram pad Address: 11 bits */ + u8 databuffer[32]; /* address of the data buffer */ + u8 addressCrc; /* CRC code for address */ + u8 dataCrc; /* CRC code for data */ + u8 errnum; +} OSContRamIo; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Controllers number + */ + +#ifndef _HW_VERSION_1 +#define MAXCONTROLLERS 4 +#else +#define MAXCONTROLLERS 6 +#endif + +/* controller errors */ +#define CONT_NO_RESPONSE_ERROR 0x8 +#define CONT_OVERRUN_ERROR 0x4 +#ifdef _HW_VERSION_1 +#define CONT_FRAME_ERROR 0x2 +#define CONT_COLLISION_ERROR 0x1 +#endif + +/* Controller type */ + +#define CONT_ABSOLUTE 0x0001 +#define CONT_RELATIVE 0x0002 +#define CONT_JOYPORT 0x0004 +#define CONT_EEPROM 0x8000 +#define CONT_EEP16K 0x4000 +#define CONT_TYPE_MASK 0x1f07 +#define CONT_TYPE_NORMAL 0x0005 +#define CONT_TYPE_MOUSE 0x0002 +#define CONT_TYPE_VOICE 0x0100 + +/* Controller status */ + +#define CONT_CARD_ON 0x01 +#define CONT_CARD_PULL 0x02 +#define CONT_ADDR_CRC_ER 0x04 +#define CONT_EEPROM_BUSY 0x80 + +/* Buttons */ + +#define CONT_A 0x8000 +#define CONT_B 0x4000 +#define CONT_G 0x2000 +#define CONT_START 0x1000 +#define CONT_UP 0x0800 +#define CONT_DOWN 0x0400 +#define CONT_LEFT 0x0200 +#define CONT_RIGHT 0x0100 +#define CONT_L 0x0020 +#define CONT_R 0x0010 +#define CONT_E 0x0008 +#define CONT_D 0x0004 +#define CONT_C 0x0002 +#define CONT_F 0x0001 + +/* Nintendo's official button names */ + +#define A_BUTTON CONT_A +#define B_BUTTON CONT_B +#define L_TRIG CONT_L +#define R_TRIG CONT_R +#define Z_TRIG CONT_G +#define START_BUTTON CONT_START +#define U_JPAD CONT_UP +#define L_JPAD CONT_LEFT +#define R_JPAD CONT_RIGHT +#define D_JPAD CONT_DOWN +#define U_CBUTTONS CONT_E +#define L_CBUTTONS CONT_C +#define R_CBUTTONS CONT_F +#define D_CBUTTONS CONT_D + +/* Controller error number */ + +#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */ +#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */ +#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */ +#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */ +#define CONT_ERR_NOT_READY 12 +#define CONT_ERR_VOICE_MEMORY 13 +#define CONT_ERR_VOICE_WORD 14 +#define CONT_ERR_VOICE_NO_RESPONSE 15 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Controller interface */ + +extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *); +extern s32 osContReset(OSMesgQueue *, OSContStatus *); +extern s32 osContStartQuery(OSMesgQueue *); +extern s32 osContStartReadData(OSMesgQueue *); +#ifndef _HW_VERSION_1 +extern s32 osContSetCh(u8); +#endif +extern void osContGetQuery(OSContStatus *); +extern void osContGetReadData(OSContPad *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_CONT_H_ */ diff --git a/include/PR/os_eeprom.h b/include/PR/os_eeprom.h new file mode 100644 index 00000000..b3bca814 --- /dev/null +++ b/include/PR/os_eeprom.h @@ -0,0 +1,107 @@ + +/*==================================================================== + * os_eeprom.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_eeprom.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:06 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_EEPROM_H_ +#define _OS_EEPROM_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* EEPROM TYPE */ + +#define EEPROM_TYPE_4K 0x01 +#define EEPROM_TYPE_16K 0x02 + +/* definition for EEPROM */ + +#define EEPROM_MAXBLOCKS 64 +#define EEP16K_MAXBLOCKS 256 +#define EEPROM_BLOCK_SIZE 8 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* EEPROM interface */ + +extern s32 osEepromProbe(OSMesgQueue *); +extern s32 osEepromRead(OSMesgQueue *, u8, u8 *); +extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *); +extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int); +extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_EEPROM_H_ */ diff --git a/include/PR/os_exception.h b/include/PR/os_exception.h new file mode 100644 index 00000000..245e5e69 --- /dev/null +++ b/include/PR/os_exception.h @@ -0,0 +1,119 @@ + +/*==================================================================== + * os_exception.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_exception.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:07 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_EXCEPTION_H_ +#define _OS_EXCEPTION_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSIntMask; +typedef u32 OSHWIntr; + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Flags for debugging purpose */ + +#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */ +#define OS_FLAG_FAULT 2 /* CPU fault has occurred */ + +/* Interrupt masks */ + +#define OS_IM_NONE 0x00000001 +#define OS_IM_SW1 0x00000501 +#define OS_IM_SW2 0x00000601 +#define OS_IM_CART 0x00000c01 +#define OS_IM_PRENMI 0x00001401 +#define OS_IM_RDBWRITE 0x00002401 +#define OS_IM_RDBREAD 0x00004401 +#define OS_IM_COUNTER 0x00008401 +#define OS_IM_CPU 0x0000ff01 +#define OS_IM_SP 0x00010401 +#define OS_IM_SI 0x00020401 +#define OS_IM_AI 0x00040401 +#define OS_IM_VI 0x00080401 +#define OS_IM_PI 0x00100401 +#define OS_IM_DP 0x00200401 +#define OS_IM_ALL 0x003fff01 +#define RCP_IMASK 0x003f0000 +#define RCP_IMASKSHIFT 16 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Interrupt operations */ + +extern OSIntMask osGetIntMask(void); +extern OSIntMask osSetIntMask(OSIntMask); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_EXCEPTION_H_ */ diff --git a/include/ultra64/os_internal.h b/include/PR/os_internal.h similarity index 75% rename from include/ultra64/os_internal.h rename to include/PR/os_internal.h index 067ebaaa..e38f1105 100644 --- a/include/ultra64/os_internal.h +++ b/include/PR/os_internal.h @@ -1,16 +1,19 @@ #ifndef _ULTRA64_OS_INTERNAL_H_ #define _ULTRA64_OS_INTERNAL_H_ +#include "PR/os_message.h" /* Internal functions used by the operating system */ /* Do not include this header in application code */ /* Variables */ -//extern u64 osClockRate; +extern u64 osClockRate; /* Functions */ /*u32 __osProbeTLB(void *); u32 __osDisableInt(void); void __osRestoreInt(u32);*/ +OSThread *__osGetCurrFaultedThread(void); + #endif diff --git a/include/PR/os_libc.h b/include/PR/os_libc.h new file mode 100644 index 00000000..94111c0b --- /dev/null +++ b/include/PR/os_libc.h @@ -0,0 +1,10 @@ +#ifndef _OS_LIBC_H_ +#define _OS_LIBC_H_ + +#include "ultratypes.h" + +// Old deprecated functions from strings.h, replaced by memcpy/memset. +extern void bcopy(const void *, void *, size_t); +extern void bzero(void *, size_t); + +#endif /* !_OS_LIBC_H_ */ diff --git a/include/PR/os_message.h b/include/PR/os_message.h new file mode 100644 index 00000000..71e76986 --- /dev/null +++ b/include/PR/os_message.h @@ -0,0 +1,164 @@ + +/*==================================================================== + * os_message.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_message.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:15 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_MESSAGE_H_ +#define _OS_MESSAGE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSEvent; + +/* + * Structure for message + */ +typedef void * OSMesg; + +/* + * Structure for message queue + */ +typedef struct OSMesgQueue_s { + OSThread *mtqueue; /* Queue to store threads blocked + on empty mailboxes (receive) */ + OSThread *fullqueue; /* Queue to store threads blocked + on full mailboxes (send) */ + s32 validCount; /* Contains number of valid message */ + s32 first; /* Points to first valid message */ + s32 msgCount; /* Contains total # of messages */ + OSMesg *msg; /* Points to message buffer array */ +} OSMesgQueue; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Events */ +#ifdef _FINALROM +#define OS_NUM_EVENTS 15 +#else +#define OS_NUM_EVENTS 23 +#endif + +#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ +#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ +#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ +#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ +#define OS_EVENT_SP 4 /* SP task done interrupt */ +#define OS_EVENT_SI 5 /* SI (controller) interrupt */ +#define OS_EVENT_AI 6 /* AI interrupt */ +#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ +#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ +#define OS_EVENT_DP 9 /* DP full sync interrupt */ +#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ +#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ +#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ +#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ +#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ +#ifndef _FINALROM +#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */ +#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */ +#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */ +#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */ +#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */ +#define OS_EVENT_RDB_DBG_DONE 20 +#define OS_EVENT_RDB_FLUSH_PROF 21 +#define OS_EVENT_RDB_ACK_PROF 22 +#endif + +/* Flags to turn blocking on/off when sending/receiving message */ + +#define OS_MESG_NOBLOCK 0 +#define OS_MESG_BLOCK 1 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +/* Get count of valid messages in queue */ +#define MQ_GET_COUNT(mq) ((mq)->validCount) + +/* Figure out if message queue is empty or full */ +#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0) +#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount) + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Message operations */ + +extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); +extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); + +/* Event operations */ + +extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_MESSAGE_H_ */ diff --git a/include/ultra64/os_misc.h b/include/PR/os_misc.h similarity index 68% rename from include/ultra64/os_misc.h rename to include/PR/os_misc.h index fecc4e74..71e111f1 100644 --- a/include/ultra64/os_misc.h +++ b/include/PR/os_misc.h @@ -1,11 +1,11 @@ #ifndef _ULTRA64_OS_MISC_H_ #define _ULTRA64_OS_MISC_H_ - +#include /* Miscellaneous OS functions */ void osInitialize(void); u32 osGetCount(void); -u32 osVirtualToPhysical(void *); +uintptr_t osVirtualToPhysical(void *); #endif diff --git a/include/PR/os_pi.h b/include/PR/os_pi.h new file mode 100644 index 00000000..e1a136f7 --- /dev/null +++ b/include/PR/os_pi.h @@ -0,0 +1,86 @@ +#ifndef _ULTRA64_PI_H_ +#define _ULTRA64_PI_H_ +#include + +/* Ultra64 Parallel Interface */ + +/* Types */ + +typedef struct { +#if !defined(VERSION_EU) + u32 errStatus; +#endif + void *dramAddr; + void *C2Addr; + u32 sectorSize; + u32 C1ErrNum; + u32 C1ErrSector[4]; +} __OSBlockInfo; + +typedef struct { + u32 cmdType; // 0 + u16 transferMode; // 4 + u16 blockNum; // 6 + s32 sectorNum; // 8 + uintptr_t devAddr; // c +#if defined(VERSION_EU) + u32 errStatus; //error status added moved to blockinfo +#endif + u32 bmCtlShadow; // 10 + u32 seqCtlShadow; // 14 + __OSBlockInfo block[2]; // 18 +} __OSTranxInfo; + +typedef struct OSPiHandle_s { + struct OSPiHandle_s *next; + u8 type; + u8 latency; + u8 pageSize; + u8 relDuration; + u8 pulse; + u8 domain; + u32 baseAddress; + u32 speed; + __OSTranxInfo transferInfo; +} OSPiHandle; + +typedef struct { + u8 type; + uintptr_t address; +} OSPiInfo; + +typedef struct { + u16 type; + u8 pri; + u8 status; + OSMesgQueue *retQueue; +} OSIoMesgHdr; + +typedef struct { + /*0x00*/ OSIoMesgHdr hdr; + /*0x08*/ void *dramAddr; + /*0x0C*/ uintptr_t devAddr; + /*0x10*/ size_t size; + OSPiHandle *piHandle; // from the official definition +} OSIoMesg; + +/* Definitions */ + +#define OS_READ 0 // device -> RDRAM +#define OS_WRITE 1 // device <- RDRAM + +#define OS_MESG_PRI_NORMAL 0 +#define OS_MESG_PRI_HIGH 1 + +/* Functions */ + +s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, + size_t nbytes, OSMesgQueue *mq); +void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt); +OSMesgQueue *osPiGetCmdQueue(void); +s32 osPiWriteIo(uintptr_t devAddr, u32 data); +s32 osPiReadIo(uintptr_t devAddr, u32 *data); + +s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size); +s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size); +#endif diff --git a/include/PR/os_rdp.h b/include/PR/os_rdp.h new file mode 100644 index 00000000..6b3d288c --- /dev/null +++ b/include/PR/os_rdp.h @@ -0,0 +1,92 @@ + +/*==================================================================== + * os_rdp.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_rdp.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:16 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_RDP_H_ +#define _OS_RDP_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Display processor interface (Dp) */ +extern u32 osDpGetStatus(void); +extern void osDpSetStatus(u32); +extern void osDpGetCounters(u32 *); +extern s32 osDpSetNextBuffer(void *, u64); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_RDP_H_ */ diff --git a/include/ultra64/thread.h b/include/PR/os_thread.h similarity index 98% rename from include/ultra64/thread.h rename to include/PR/os_thread.h index 791701c2..76e528b5 100644 --- a/include/ultra64/thread.h +++ b/include/PR/os_thread.h @@ -1,6 +1,6 @@ #ifndef _ULTRA64_THREAD_H_ #define _ULTRA64_THREAD_H_ - +#include "ultratypes.h" /* Recommended priorities for system threads */ #define OS_PRIORITY_MAX 255 #define OS_PRIORITY_VIMGR 254 diff --git a/include/ultra64/time.h b/include/PR/os_time.h similarity index 73% rename from include/ultra64/time.h rename to include/PR/os_time.h index 1507ed36..ecb05d62 100644 --- a/include/ultra64/time.h +++ b/include/PR/os_time.h @@ -1,6 +1,8 @@ #ifndef _ULTRA64_TIME_H_ #define _ULTRA64_TIME_H_ -#include "message.h" + +#include +#include /* Types */ @@ -20,6 +22,6 @@ typedef u64 OSTime; OSTime osGetTime(void); void osSetTime(OSTime time); -u32 osSetTimer(OSTimer *, OSTime, u64, OSMesgQueue *, OSMesg); +u32 osSetTimer(OSTimer *, OSTime, OSTime, OSMesgQueue *, OSMesg); #endif diff --git a/include/PR/os_tlb.h b/include/PR/os_tlb.h new file mode 100644 index 00000000..2cdd5c9c --- /dev/null +++ b/include/PR/os_tlb.h @@ -0,0 +1,107 @@ + +/*==================================================================== + * os_tlb.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_tlb.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:20 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_TLB_H_ +#define _OS_TLB_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSPageMask; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Page size argument for TLB routines + */ +#define OS_PM_4K 0x0000000 +#define OS_PM_16K 0x0006000 +#define OS_PM_64K 0x001e000 +#define OS_PM_256K 0x007e000 +#define OS_PM_1M 0x01fe000 +#define OS_PM_4M 0x07fe000 +#define OS_PM_16M 0x1ffe000 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* TLB management routines */ + +extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32); +extern void osMapTLBRdb(void); +extern void osUnmapTLB(s32); +extern void osUnmapTLBAll(void); +extern void osSetTLBASID(s32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_TLB_H_ */ diff --git a/include/ultra64/vi.h b/include/PR/os_vi.h similarity index 71% rename from include/ultra64/vi.h rename to include/PR/os_vi.h index 6433a1d4..9ef80546 100644 --- a/include/ultra64/vi.h +++ b/include/PR/os_vi.h @@ -1,6 +1,9 @@ #ifndef _ULTRA64_VI_H_ #define _ULTRA64_VI_H_ +#include +#include + /* Ultra64 Video Interface */ @@ -58,7 +61,7 @@ typedef struct /* 0x00 */ u16 unk00; //some kind of flags. swap buffer sets to 0x10 /* 0x02 */ u16 retraceCount; /* 0x04 */ void* buffer; - /* 0x08 */ OSViMode *unk08; + /* 0x08 */ OSViMode *modep; /* 0x0c */ u32 features; /* 0x10 */ OSMesgQueue *mq; /* 0x14 */ OSMesg *msg; @@ -72,6 +75,7 @@ typedef struct void osCreateViManager(OSPri pri); void osViSetMode(OSViMode *mode); +void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount); void osViBlack(u8 active); void osViSetSpecialFeatures(u32 func); void osViSwapBuffer(void *vaddr); @@ -107,36 +111,7 @@ void osViSwapBuffer(void *vaddr); #define OS_VI_PAL_HPN2 26 #define OS_VI_PAL_HPF2 27 -#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */ -#define OS_VI_MPAL_LPF1 29 -#define OS_VI_MPAL_LAN1 30 -#define OS_VI_MPAL_LAF1 31 -#define OS_VI_MPAL_LPN2 32 -#define OS_VI_MPAL_LPF2 33 -#define OS_VI_MPAL_LAN2 34 -#define OS_VI_MPAL_LAF2 35 -#define OS_VI_MPAL_HPN1 36 -#define OS_VI_MPAL_HPF1 37 -#define OS_VI_MPAL_HAN1 38 -#define OS_VI_MPAL_HAF1 39 -#define OS_VI_MPAL_HPN2 40 -#define OS_VI_MPAL_HPF2 41 - -#define OS_VI_FPAL_LPN1 42 /* FPAL - Full screen PAL */ -#define OS_VI_FPAL_LPF1 43 -#define OS_VI_FPAL_LAN1 44 -#define OS_VI_FPAL_LAF1 45 -#define OS_VI_FPAL_LPN2 46 -#define OS_VI_FPAL_LPF2 47 -#define OS_VI_FPAL_LAN2 48 -#define OS_VI_FPAL_LAF2 49 -#define OS_VI_FPAL_HPN1 50 -#define OS_VI_FPAL_HPF1 51 -#define OS_VI_FPAL_HAN1 52 -#define OS_VI_FPAL_HAF1 53 -#define OS_VI_FPAL_HPN2 54 -#define OS_VI_FPAL_HPF2 55 - +#define OS_VI_MPAL_LAN1 30 extern OSViMode osViModeTable[]; /* Global VI mode table */ diff --git a/include/PR/rcp.h b/include/PR/rcp.h new file mode 100644 index 00000000..68ce9682 --- /dev/null +++ b/include/PR/rcp.h @@ -0,0 +1,881 @@ +#ifndef _RCP_H_ +#define _RCP_H_ + +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * File: rcp.h + * + * This file contains register and bit definitions for RCP memory map. + * $Revision: 1.20 $ + * $Date: 1997/07/23 08:35:21 $ + * $Source: /disk6/Master/cvsmdev2/PR/include/rcp.h,v $ + * + **************************************************************************/ + +#include +#include + +/********************************************************************** + * + * Here is a quick overview of the RCP memory map: + * + +0x0000_0000 .. 0x03ef_ffff RDRAM memory +0x03f0_0000 .. 0x03ff_ffff RDRAM registers + + RCP registers (see below) +0x0400_0000 .. 0x040f_ffff SP registers +0x0410_0000 .. 0x041f_ffff DP command registers +0x0420_0000 .. 0x042f_ffff DP span registers +0x0430_0000 .. 0x043f_ffff MI registers +0x0440_0000 .. 0x044f_ffff VI registers +0x0450_0000 .. 0x045f_ffff AI registers +0x0460_0000 .. 0x046f_ffff PI registers +0x0470_0000 .. 0x047f_ffff RI registers +0x0480_0000 .. 0x048f_ffff SI registers +0x0490_0000 .. 0x04ff_ffff unused + +0x0500_0000 .. 0x05ff_ffff cartridge domain 2 +0x0600_0000 .. 0x07ff_ffff cartridge domain 1 +0x0800_0000 .. 0x0fff_ffff cartridge domain 2 +0x1000_0000 .. 0x1fbf_ffff cartridge domain 1 + +0x1fc0_0000 .. 0x1fc0_07bf PIF Boot Rom (1984 bytes) +0x1fc0_07c0 .. 0x1fc0_07ff PIF (JoyChannel) RAM (64 bytes) +0x1fc0_0800 .. 0x1fcf_ffff Reserved +0x1fd0_0000 .. 0x7fff_ffff cartridge domain 1 +0x8000_0000 .. 0xffff_ffff external SysAD device + +The Indy development board use cartridge domain 1: +0x1000_0000 .. 0x10ff_ffff RAMROM +0x1800_0000 .. 0x1800_0003 GIO interrupt (6 bits valid in 4 bytes) +0x1800_0400 .. 0x1800_0403 GIO sync (6 bits valid in 4 bytes) +0x1800_0800 .. 0x1800_0803 CART interrupt (6 bits valid in 4 bytes) + + + +**************************************************************************/ + + +/************************************************************************* + * RDRAM Memory (Assumes that maximum size is 4 MB) + */ +#define RDRAM_0_START 0x00000000 +#define RDRAM_0_END 0x001FFFFF +#define RDRAM_1_START 0x00200000 +#define RDRAM_1_END 0x003FFFFF + +#define RDRAM_START RDRAM_0_START +#define RDRAM_END RDRAM_1_END + + +/************************************************************************* + * Address predicates + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#define IS_RDRAM(x) ((unsigned)(x) >= RDRAM_START && \ + (unsigned)(x) < RDRAM_END) +#endif + + +/************************************************************************* + * RDRAM Registers (0x03f0_0000 .. 0x03ff_ffff) + */ +#define RDRAM_BASE_REG 0x03F00000 + +#define RDRAM_CONFIG_REG (RDRAM_BASE_REG+0x00) +#define RDRAM_DEVICE_TYPE_REG (RDRAM_BASE_REG+0x00) +#define RDRAM_DEVICE_ID_REG (RDRAM_BASE_REG+0x04) +#define RDRAM_DELAY_REG (RDRAM_BASE_REG+0x08) +#define RDRAM_MODE_REG (RDRAM_BASE_REG+0x0c) +#define RDRAM_REF_INTERVAL_REG (RDRAM_BASE_REG+0x10) +#define RDRAM_REF_ROW_REG (RDRAM_BASE_REG+0x14) +#define RDRAM_RAS_INTERVAL_REG (RDRAM_BASE_REG+0x18) +#define RDRAM_MIN_INTERVAL_REG (RDRAM_BASE_REG+0x1c) +#define RDRAM_ADDR_SELECT_REG (RDRAM_BASE_REG+0x20) +#define RDRAM_DEVICE_MANUF_REG (RDRAM_BASE_REG+0x24) + +#define RDRAM_0_DEVICE_ID 0 +#define RDRAM_1_DEVICE_ID 1 + +#define RDRAM_RESET_MODE 0 +#define RDRAM_ACTIVE_MODE 1 +#define RDRAM_STANDBY_MODE 2 + +#define RDRAM_LENGTH (2*512*2048) +#define RDRAM_0_BASE_ADDRESS (RDRAM_0_DEVICE_ID*RDRAM_LENGTH) +#define RDRAM_1_BASE_ADDRESS (RDRAM_1_DEVICE_ID*RDRAM_LENGTH) + +#define RDRAM_0_CONFIG 0x00000 +#define RDRAM_1_CONFIG 0x00400 +#define RDRAM_GLOBAL_CONFIG 0x80000 + + +/************************************************************************* + * PIF Physical memory map (total size = 2 KB) + * + * Size Description Mode + * 1FC007FF +-------+-----------------+-----+ + * | 64 B | JoyChannel RAM | R/W | + * 1FC007C0 +-------+-----------------+-----+ + * |1984 B | Boot ROM | * | * = Reserved + * 1FC00000 +-------+-----------------+-----+ + * + */ +#define PIF_ROM_START 0x1FC00000 +#define PIF_ROM_END 0x1FC007BF +#define PIF_RAM_START 0x1FC007C0 +#define PIF_RAM_END 0x1FC007FF + + +/************************************************************************* + * Controller channel + * Each game controller channel has 4 error bits that are defined in bit 6-7 of + * the Rx and Tx data size area bytes. Programmers need to clear these bits + * when setting the Tx/Rx size area values for a channel + */ +#define CHNL_ERR_NORESP 0x80 /* Bit 7 (Rx): No response error */ +#define CHNL_ERR_OVERRUN 0x40 /* Bit 6 (Rx): Overrun error */ +#define CHNL_ERR_FRAME 0x80 /* Bit 7 (Tx): Frame error */ +#define CHNL_ERR_COLLISION 0x40 /* Bit 6 (Tx): Collision error */ + +#define CHNL_ERR_MASK 0xC0 /* Bit 6-7: channel errors */ + + +/************************************************************************* + * External device info + */ +#define DEVICE_TYPE_CART 0 /* ROM cartridge */ +#define DEVICE_TYPE_BULK 1 /* ROM bulk */ +#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */ +#define DEVICE_TYPE_SRAM 3 /* SRAM */ + +/************************************************************************* + * SP Memory + */ +#define SP_DMEM_START 0x04000000 /* read/write */ +#define SP_DMEM_END 0x04000FFF +#define SP_IMEM_START 0x04001000 /* read/write */ +#define SP_IMEM_END 0x04001FFF + +/************************************************************************* + * SP CP0 Registers + */ + +#define SP_BASE_REG 0x04040000 + +/* SP memory address (R/W): [11:0] DMEM/IMEM address; [12] 0=DMEM,1=IMEM */ +#define SP_MEM_ADDR_REG (SP_BASE_REG+0x00) /* Master */ + +/* SP DRAM DMA address (R/W): [23:0] RDRAM address */ +#define SP_DRAM_ADDR_REG (SP_BASE_REG+0x04) /* Slave */ + +/* SP read DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */ +/* direction: I/DMEM <- RDRAM */ +#define SP_RD_LEN_REG (SP_BASE_REG+0x08) /* R/W: read len */ + +/* SP write DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */ +/* direction: I/DMEM -> RDRAM */ +#define SP_WR_LEN_REG (SP_BASE_REG+0x0C) /* R/W: write len */ + +/* SP status (R/W): [14:0] valid bits; see below for write/read mode */ +#define SP_STATUS_REG (SP_BASE_REG+0x10) + +/* SP DMA full (R): [0] valid bit; dma full */ +#define SP_DMA_FULL_REG (SP_BASE_REG+0x14) + +/* SP DMA busy (R): [0] valid bit; dma busy */ +#define SP_DMA_BUSY_REG (SP_BASE_REG+0x18) + +/* SP semaphore (R/W): Read: [0] semaphore flag (set on read) */ +/* Write: [] clear semaphore flag */ +#define SP_SEMAPHORE_REG (SP_BASE_REG+0x1C) + +/* SP PC (R/W): [11:0] program counter */ +#define SP_PC_REG 0x04080000 + +/* SP MEM address: bit 12 specifies if address is IMEM or DMEM */ +#define SP_DMA_DMEM 0x0000 /* Bit 12: 0=DMEM, 1=IMEM */ +#define SP_DMA_IMEM 0x1000 /* Bit 12: 0=DMEM, 1=IMEM */ + +/* + * Values to clear/set bit in status reg (SP_STATUS_REG - write) + */ +#define SP_CLR_HALT 0x00001 /* Bit 0: clear halt */ +#define SP_SET_HALT 0x00002 /* Bit 1: set halt */ +#define SP_CLR_BROKE 0x00004 /* Bit 2: clear broke */ +#define SP_CLR_INTR 0x00008 /* Bit 3: clear intr */ +#define SP_SET_INTR 0x00010 /* Bit 4: set intr */ +#define SP_CLR_SSTEP 0x00020 /* Bit 5: clear sstep */ +#define SP_SET_SSTEP 0x00040 /* Bit 6: set sstep */ +#define SP_CLR_INTR_BREAK 0x00080 /* Bit 7: clear intr on break */ +#define SP_SET_INTR_BREAK 0x00100 /* Bit 8: set intr on break */ +#define SP_CLR_SIG0 0x00200 /* Bit 9: clear signal 0 */ +#define SP_SET_SIG0 0x00400 /* Bit 10: set signal 0 */ +#define SP_CLR_SIG1 0x00800 /* Bit 11: clear signal 1 */ +#define SP_SET_SIG1 0x01000 /* Bit 12: set signal 1 */ +#define SP_CLR_SIG2 0x02000 /* Bit 13: clear signal 2 */ +#define SP_SET_SIG2 0x04000 /* Bit 14: set signal 2 */ +#define SP_CLR_SIG3 0x08000 /* Bit 15: clear signal 3 */ +#define SP_SET_SIG3 0x10000 /* Bit 16: set signal 3 */ +#define SP_CLR_SIG4 0x20000 /* Bit 17: clear signal 4 */ +#define SP_SET_SIG4 0x40000 /* Bit 18: set signal 4 */ +#define SP_CLR_SIG5 0x80000 /* Bit 19: clear signal 5 */ +#define SP_SET_SIG5 0x100000 /* Bit 20: set signal 5 */ +#define SP_CLR_SIG6 0x200000 /* Bit 21: clear signal 6 */ +#define SP_SET_SIG6 0x400000 /* Bit 22: set signal 6 */ +#define SP_CLR_SIG7 0x800000 /* Bit 23: clear signal 7 */ +#define SP_SET_SIG7 0x1000000 /* Bit 24: set signal 7 */ + +/* + * Patterns to interpret status reg (SP_STATUS_REG - read) + */ +#define SP_STATUS_HALT 0x001 /* Bit 0: halt */ +#define SP_STATUS_BROKE 0x002 /* Bit 1: broke */ +#define SP_STATUS_DMA_BUSY 0x004 /* Bit 2: dma busy */ +#define SP_STATUS_DMA_FULL 0x008 /* Bit 3: dma full */ +#define SP_STATUS_IO_FULL 0x010 /* Bit 4: io full */ +#define SP_STATUS_SSTEP 0x020 /* Bit 5: single step */ +#define SP_STATUS_INTR_BREAK 0x040 /* Bit 6: interrupt on break */ +#define SP_STATUS_SIG0 0x080 /* Bit 7: signal 0 set */ +#define SP_STATUS_SIG1 0x100 /* Bit 8: signal 1 set */ +#define SP_STATUS_SIG2 0x200 /* Bit 9: signal 2 set */ +#define SP_STATUS_SIG3 0x400 /* Bit 10: signal 3 set */ +#define SP_STATUS_SIG4 0x800 /* Bit 11: signal 4 set */ +#define SP_STATUS_SIG5 0x1000 /* Bit 12: signal 5 set */ +#define SP_STATUS_SIG6 0x2000 /* Bit 13: signal 6 set */ +#define SP_STATUS_SIG7 0x4000 /* Bit 14: signal 7 set */ + +/* + * Use of SIG bits + */ +#define SP_CLR_YIELD SP_CLR_SIG0 +#define SP_SET_YIELD SP_SET_SIG0 +#define SP_STATUS_YIELD SP_STATUS_SIG0 +#define SP_CLR_YIELDED SP_CLR_SIG1 +#define SP_SET_YIELDED SP_SET_SIG1 +#define SP_STATUS_YIELDED SP_STATUS_SIG1 +#define SP_CLR_TASKDONE SP_CLR_SIG2 +#define SP_SET_TASKDONE SP_SET_SIG2 +#define SP_STATUS_TASKDONE SP_STATUS_SIG2 +#define SP_CLR_RSPSIGNAL SP_CLR_SIG3 +#define SP_SET_RSPSIGNAL SP_SET_SIG3 +#define SP_STATUS_RSPSIGNAL SP_STATUS_SIG3 +#define SP_CLR_CPUSIGNAL SP_CLR_SIG4 +#define SP_SET_CPUSIGNAL SP_SET_SIG4 +#define SP_STATUS_CPUSIGNAL SP_STATUS_SIG4 + +/* SP IMEM BIST REG (R/W): [6:0] BIST status bits; see below for detail */ +#define SP_IBIST_REG 0x04080004 + +/* + * Patterns to interpret status reg (SP_BIST_REG - write) + */ +#define SP_IBIST_CHECK 0x01 /* Bit 0: BIST check */ +#define SP_IBIST_GO 0x02 /* Bit 1: BIST go */ +#define SP_IBIST_CLEAR 0x04 /* Bit 2: BIST clear */ + +/* + * Patterns to interpret status reg (SP_BIST_REG - read) + */ +/* First 2 bits are same as in write mode: + * Bit 0: BIST check; Bit 1: BIST go + */ +#define SP_IBIST_DONE 0x04 /* Bit 2: BIST done */ +#define SP_IBIST_FAILED 0x78 /* Bit [6:3]: BIST fail */ + + +/************************************************************************* + * DP Command Registers + */ +#define DPC_BASE_REG 0x04100000 + +/* DP CMD DMA start (R/W): [23:0] DMEM/RDRAM start address */ +#define DPC_START_REG (DPC_BASE_REG+0x00) + +/* DP CMD DMA end (R/W): [23:0] DMEM/RDRAM end address */ +#define DPC_END_REG (DPC_BASE_REG+0x04) + +/* DP CMD DMA end (R): [23:0] DMEM/RDRAM current address */ +#define DPC_CURRENT_REG (DPC_BASE_REG+0x08) + +/* DP CMD status (R/W): [9:0] valid bits - see below for definitions */ +#define DPC_STATUS_REG (DPC_BASE_REG+0x0C) + +/* DP clock counter (R): [23:0] clock counter */ +#define DPC_CLOCK_REG (DPC_BASE_REG+0x10) + +/* DP buffer busy counter (R): [23:0] clock counter */ +#define DPC_BUFBUSY_REG (DPC_BASE_REG+0x14) + +/* DP pipe busy counter (R): [23:0] clock counter */ +#define DPC_PIPEBUSY_REG (DPC_BASE_REG+0x18) + +/* DP TMEM load counter (R): [23:0] clock counter */ +#define DPC_TMEM_REG (DPC_BASE_REG+0x1C) + +/* + * Values to clear/set bit in status reg (DPC_STATUS_REG - write) + */ +#define DPC_CLR_XBUS_DMEM_DMA 0x0001 /* Bit 0: clear xbus_dmem_dma */ +#define DPC_SET_XBUS_DMEM_DMA 0x0002 /* Bit 1: set xbus_dmem_dma */ +#define DPC_CLR_FREEZE 0x0004 /* Bit 2: clear freeze */ +#define DPC_SET_FREEZE 0x0008 /* Bit 3: set freeze */ +#define DPC_CLR_FLUSH 0x0010 /* Bit 4: clear flush */ +#define DPC_SET_FLUSH 0x0020 /* Bit 5: set flush */ +#define DPC_CLR_TMEM_CTR 0x0040 /* Bit 6: clear tmem ctr */ +#define DPC_CLR_PIPE_CTR 0x0080 /* Bit 7: clear pipe ctr */ +#define DPC_CLR_CMD_CTR 0x0100 /* Bit 8: clear cmd ctr */ +#define DPC_CLR_CLOCK_CTR 0x0200 /* Bit 9: clear clock ctr */ + +/* + * Patterns to interpret status reg (DPC_STATUS_REG - read) + */ +#define DPC_STATUS_XBUS_DMEM_DMA 0x001 /* Bit 0: xbus_dmem_dma */ +#define DPC_STATUS_FREEZE 0x002 /* Bit 1: freeze */ +#define DPC_STATUS_FLUSH 0x004 /* Bit 2: flush */ +/*#define DPC_STATUS_FROZEN 0x008*/ /* Bit 3: frozen */ +#define DPC_STATUS_START_GCLK 0x008 /* Bit 3: start gclk */ +#define DPC_STATUS_TMEM_BUSY 0x010 /* Bit 4: tmem busy */ +#define DPC_STATUS_PIPE_BUSY 0x020 /* Bit 5: pipe busy */ +#define DPC_STATUS_CMD_BUSY 0x040 /* Bit 6: cmd busy */ +#define DPC_STATUS_CBUF_READY 0x080 /* Bit 7: cbuf ready */ +#define DPC_STATUS_DMA_BUSY 0x100 /* Bit 8: dma busy */ +#define DPC_STATUS_END_VALID 0x200 /* Bit 9: end valid */ +#define DPC_STATUS_START_VALID 0x400 /* Bit 10: start valid */ + + +/************************************************************************* + * DP Span Registers + */ +#define DPS_BASE_REG 0x04200000 + +/* DP tmem bist (R/W): [10:0] BIST status bits; see below for detail */ +#define DPS_TBIST_REG (DPS_BASE_REG+0x00) + +/* DP span test mode (R/W): [0] Span buffer test access enable */ +#define DPS_TEST_MODE_REG (DPS_BASE_REG+0x04) + +/* DP span buffer test address (R/W): [6:0] bits; see below for detail */ +#define DPS_BUFTEST_ADDR_REG (DPS_BASE_REG+0x08) + +/* DP span buffer test data (R/W): [31:0] span buffer data */ +#define DPS_BUFTEST_DATA_REG (DPS_BASE_REG+0x0C) + +/* + * Patterns to interpret status reg (DPS_TMEM_BIST_REG - write) + */ +#define DPS_TBIST_CHECK 0x01 /* Bit 0: BIST check */ +#define DPS_TBIST_GO 0x02 /* Bit 1: BIST go */ +#define DPS_TBIST_CLEAR 0x04 /* Bit 2: BIST clear */ + +/* + * Patterns to interpret status reg (DPS_TMEM_BIST_REG - read) + */ +/* First 2 bits are same as in write mode: + * Bit 0: BIST check; Bit 1: BIST go + */ +#define DPS_TBIST_DONE 0x004 /* Bit 2: BIST done */ +#define DPS_TBIST_FAILED 0x7F8 /* Bit [10:3]: BIST fail */ + + +/************************************************************************* + * MIPS Interface (MI) Registers + */ +#define MI_BASE_REG 0x04300000 + +/* + * MI init mode (W): [6:0] init length, [7] clear init mode, [8] set init mode + * [9/10] clear/set ebus test mode, [11] clear DP interrupt + * (R): [6:0] init length, [7] init mode, [8] ebus test mode + */ +#define MI_INIT_MODE_REG (MI_BASE_REG+0x00) +#define MI_MODE_REG MI_INIT_MODE_REG + +/* + * Values to clear/set bit in mode reg (MI_MODE_REG - write) + */ +#define MI_CLR_INIT 0x0080 /* Bit 7: clear init mode */ +#define MI_SET_INIT 0x0100 /* Bit 8: set init mode */ +#define MI_CLR_EBUS 0x0200 /* Bit 9: clear ebus test */ +#define MI_SET_EBUS 0x0400 /* Bit 10: set ebus test mode */ +#define MI_CLR_DP_INTR 0x0800 /* Bit 11: clear dp interrupt */ +#define MI_CLR_RDRAM 0x1000 /* Bit 12: clear RDRAM reg */ +#define MI_SET_RDRAM 0x2000 /* Bit 13: set RDRAM reg mode */ + +/* + * Patterns to interpret mode reg (MI_MODE_REG - read) + */ +#define MI_MODE_INIT 0x0080 /* Bit 7: init mode */ +#define MI_MODE_EBUS 0x0100 /* Bit 8: ebus test mode */ +#define MI_MODE_RDRAM 0x0200 /* Bit 9: RDRAM reg mode */ + +/* MI version (R): [7:0] io, [15:8] rac, [23:16] rdp, [31:24] rsp */ +#define MI_VERSION_REG (MI_BASE_REG+0x04) +#define MI_NOOP_REG MI_VERSION_REG + +/* MI interrupt (R): [5:0] valid bits - see below for bit patterns */ +#define MI_INTR_REG (MI_BASE_REG+0x08) + +/* + * MI interrupt mask (W): [11:0] valid bits - see below for bit patterns + * (R): [5:0] valid bits - see below for bit patterns + */ +#define MI_INTR_MASK_REG (MI_BASE_REG+0x0C) + +/* + * The following are values to check for interrupt setting (MI_INTR_REG) + */ +#define MI_INTR_SP 0x01 /* Bit 0: SP intr */ +#define MI_INTR_SI 0x02 /* Bit 1: SI intr */ +#define MI_INTR_AI 0x04 /* Bit 2: AI intr */ +#define MI_INTR_VI 0x08 /* Bit 3: VI intr */ +#define MI_INTR_PI 0x10 /* Bit 4: PI intr */ +#define MI_INTR_DP 0x20 /* Bit 5: DP intr */ + +/* + * The following are values to clear/set various interrupt bit mask + * They can be ORed together to manipulate multiple bits + * (MI_INTR_MASK_REG - write) + */ +#define MI_INTR_MASK_CLR_SP 0x0001 /* Bit 0: clear SP mask */ +#define MI_INTR_MASK_SET_SP 0x0002 /* Bit 1: set SP mask */ +#define MI_INTR_MASK_CLR_SI 0x0004 /* Bit 2: clear SI mask */ +#define MI_INTR_MASK_SET_SI 0x0008 /* Bit 3: set SI mask */ +#define MI_INTR_MASK_CLR_AI 0x0010 /* Bit 4: clear AI mask */ +#define MI_INTR_MASK_SET_AI 0x0020 /* Bit 5: set AI mask */ +#define MI_INTR_MASK_CLR_VI 0x0040 /* Bit 6: clear VI mask */ +#define MI_INTR_MASK_SET_VI 0x0080 /* Bit 7: set VI mask */ +#define MI_INTR_MASK_CLR_PI 0x0100 /* Bit 8: clear PI mask */ +#define MI_INTR_MASK_SET_PI 0x0200 /* Bit 9: set PI mask */ +#define MI_INTR_MASK_CLR_DP 0x0400 /* Bit 10: clear DP mask */ +#define MI_INTR_MASK_SET_DP 0x0800 /* Bit 11: set DP mask */ + +/* + * The following are values to check for interrupt mask setting + * (MI_INTR_MASK_REG - read) + */ +#define MI_INTR_MASK_SP 0x01 /* Bit 0: SP intr mask */ +#define MI_INTR_MASK_SI 0x02 /* Bit 1: SI intr mask */ +#define MI_INTR_MASK_AI 0x04 /* Bit 2: AI intr mask */ +#define MI_INTR_MASK_VI 0x08 /* Bit 3: VI intr mask */ +#define MI_INTR_MASK_PI 0x10 /* Bit 4: PI intr mask */ +#define MI_INTR_MASK_DP 0x20 /* Bit 5: DP intr mask */ + + +/************************************************************************* + * Video Interface (VI) Registers + */ +#define VI_BASE_REG 0x04400000 + +/* VI status/control (R/W): [15-0] valid bits: + * [1:0] = type[1:0] (pixel size) + * 0: blank (no data, no sync) + * 1: reserved + * 2: 5/5/5/3 ("16" bit) + * 3: 8/8/8/8 (32 bit) + * [2] = gamma_dither_enable (normally on, unless "special effect") + * [3] = gamma_enable (normally on, unless MPEG/JPEG) + * [4] = divot_enable (normally on if antialiased, unless decal lines) + * [5] = reserved - always off + * [6] = serrate (always on if interlaced, off if not) + * [7] = reserved - diagnostics only + * [9:8] = anti-alias (aa) mode[1:0] + * 0: aa & resamp (always fetch extra lines) + * 1: aa & resamp (fetch extra lines if needed) + * 2: resamp only (treat as all fully covered) + * 3: neither (replicate pixels, no interpolate) + * [11] = reserved - diagnostics only + * [15:12] = reserved + * + */ +#define VI_STATUS_REG (VI_BASE_REG+0x00) +#define VI_CONTROL_REG VI_STATUS_REG + +/* VI origin (R/W): [23:0] frame buffer origin in bytes */ +#define VI_ORIGIN_REG (VI_BASE_REG+0x04) +#define VI_DRAM_ADDR_REG VI_ORIGIN_REG + +/* VI width (R/W): [11:0] frame buffer line width in pixels */ +#define VI_WIDTH_REG (VI_BASE_REG+0x08) +#define VI_H_WIDTH_REG VI_WIDTH_REG + +/* VI vertical intr (R/W): [9:0] interrupt when current half-line = V_INTR */ +#define VI_INTR_REG (VI_BASE_REG+0x0C) +#define VI_V_INTR_REG VI_INTR_REG + +/* + * VI current vertical line (R/W): [9:0] current half line, sampled once per + * line (the lsb of V_CURRENT is constant within a field, and in + * interlaced modes gives the field number - which is constant for non- + * interlaced modes) + * - Any write to this register will clear interrupt line + */ +#define VI_CURRENT_REG (VI_BASE_REG+0x10) +#define VI_V_CURRENT_LINE_REG VI_CURRENT_REG + +/* + * VI video timing (R/W): [ 7: 0] horizontal sync width in pixels, + * [15: 8] color burst width in pixels, + * [19:16] vertical sync width in half lines, + * [29:20] start of color burst in pixels from h-sync + */ +#define VI_BURST_REG (VI_BASE_REG+0x14) +#define VI_TIMING_REG VI_BURST_REG + +/* VI vertical sync (R/W): [9:0] number of half-lines per field */ +#define VI_V_SYNC_REG (VI_BASE_REG+0x18) + +/* VI horizontal sync (R/W): [11: 0] total duration of a line in 1/4 pixel + * [20:16] a 5-bit leap pattern used for PAL only + * (h_sync_period) + */ +#define VI_H_SYNC_REG (VI_BASE_REG+0x1C) + +/* + * VI horizontal sync leap (R/W): [11: 0] identical to h_sync_period + * [27:16] identical to h_sync_period + */ +#define VI_LEAP_REG (VI_BASE_REG+0x20) +#define VI_H_SYNC_LEAP_REG VI_LEAP_REG + +/* + * VI horizontal video (R/W): [ 9: 0] end of active video in screen pixels + * : [25:16] start of active video in screen pixels + */ +#define VI_H_START_REG (VI_BASE_REG+0x24) +#define VI_H_VIDEO_REG VI_H_START_REG + +/* + * VI vertical video (R/W): [ 9: 0] end of active video in screen half-lines + * : [25:16] start of active video in screen half-lines + */ +#define VI_V_START_REG (VI_BASE_REG+0x28) +#define VI_V_VIDEO_REG VI_V_START_REG + +/* + * VI vertical burst (R/W): [ 9: 0] end of color burst enable in half-lines + * : [25:16] start of color burst enable in half-lines + */ +#define VI_V_BURST_REG (VI_BASE_REG+0x2C) + +/* VI x-scale (R/W): [11: 0] 1/horizontal scale up factor (2.10 format) + * [27:16] horizontal subpixel offset (2.10 format) + */ +#define VI_X_SCALE_REG (VI_BASE_REG+0x30) + +/* VI y-scale (R/W): [11: 0] 1/vertical scale up factor (2.10 format) + * [27:16] vertical subpixel offset (2.10 format) + */ +#define VI_Y_SCALE_REG (VI_BASE_REG+0x34) + +/* + * Patterns to interpret VI_CONTROL_REG + */ +#define VI_CTRL_TYPE_16 0x00002 /* Bit [1:0] pixel size: 16 bit */ +#define VI_CTRL_TYPE_32 0x00003 /* Bit [1:0] pixel size: 32 bit */ +#define VI_CTRL_GAMMA_DITHER_ON 0x00004 /* Bit 2: default = on */ +#define VI_CTRL_GAMMA_ON 0x00008 /* Bit 3: default = on */ +#define VI_CTRL_DIVOT_ON 0x00010 /* Bit 4: default = on */ +#define VI_CTRL_SERRATE_ON 0x00040 /* Bit 6: on if interlaced */ +#define VI_CTRL_ANTIALIAS_MASK 0x00300 /* Bit [9:8] anti-alias mode */ +#define VI_CTRL_DITHER_FILTER_ON 0x10000 /* Bit 16: dither-filter mode */ + +/* + * Possible video clocks (NTSC or PAL) + */ +#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */ +#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */ +#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */ + + +/************************************************************************* + * Audio Interface (AI) Registers + * + * The address and length registers are double buffered; that is, they + * can be written twice before becoming full. + * The address must be written before the length. + */ +#define AI_BASE_REG 0x04500000 + +/* AI DRAM address (W): [23:0] starting RDRAM address (8B-aligned) */ +#define AI_DRAM_ADDR_REG (AI_BASE_REG+0x00) /* R0: DRAM address */ + +/* AI length (R/W): [14:0] transfer length (v1.0) - Bottom 3 bits are ignored */ +/* [17:0] transfer length (v2.0) - Bottom 3 bits are ignored */ +#define AI_LEN_REG (AI_BASE_REG+0x04) /* R1: Length */ + +/* AI control (W): [0] DMA enable - if LSB == 1, DMA is enabled */ +#define AI_CONTROL_REG (AI_BASE_REG+0x08) /* R2: DMA Control */ + +/* + * AI status (R): [31]/[0] ai_full (addr & len buffer full), [30] ai_busy + * Note that a 1->0 transition in ai_full will set interrupt + * (W): clear audio interrupt + */ +#define AI_STATUS_REG (AI_BASE_REG+0x0C) /* R3: Status */ + +/* + * AI DAC sample period register (W): [13:0] dac rate + * - vid_clock/(dperiod + 1) is the DAC sample rate + * - (dperiod + 1) >= 66 * (aclockhp + 1) must be true + */ +#define AI_DACRATE_REG (AI_BASE_REG+0x10) /* R4: DAC rate 14-lsb*/ + +/* + * AI bit rate (W): [3:0] bit rate (abus clock half period register - aclockhp) + * - vid_clock/(2 * (aclockhp + 1)) is the DAC clock rate + * - The abus clock stops if aclockhp is zero + */ +#define AI_BITRATE_REG (AI_BASE_REG+0x14) /* R5: Bit rate 4-lsb */ + +/* Value for control register */ +#define AI_CONTROL_DMA_ON 0x01 /* LSB = 1: DMA enable*/ +#define AI_CONTROL_DMA_OFF 0x00 /* LSB = 1: DMA enable*/ + +/* Value for status register */ +#define AI_STATUS_FIFO_FULL 0x80000000 /* Bit 31: full */ +#define AI_STATUS_DMA_BUSY 0x40000000 /* Bit 30: busy */ + +/* DAC rate = video clock / audio frequency + * - DAC rate >= (66 * Bit rate) must be true + */ +#define AI_MAX_DAC_RATE 16384 /* 14-bit+1 */ +#define AI_MIN_DAC_RATE 132 + +/* Bit rate <= (DAC rate / 66) */ +#define AI_MAX_BIT_RATE 16 /* 4-bit+1 */ +#define AI_MIN_BIT_RATE 2 + +/* + * Maximum and minimum values for audio frequency based on video clocks + * max frequency = (video clock / min dac rate) + * min frequency = (video clock / max dac rate) + */ +#define AI_NTSC_MAX_FREQ 368000 /* 368 KHz */ +#define AI_NTSC_MIN_FREQ 3000 /* 3 KHz ~ 2971 Hz */ + +#define AI_PAL_MAX_FREQ 376000 /* 376 KHz */ +#define AI_PAL_MIN_FREQ 3050 /* 3 KHz ~ 3031 Hz */ + +#define AI_MPAL_MAX_FREQ 368000 /* 368 KHz */ +#define AI_MPAL_MIN_FREQ 3000 /* 3 KHz ~ 2968 Hz */ + + +/************************************************************************* + * Peripheral Interface (PI) Registers + */ +#define PI_BASE_REG 0x04600000 + +/* PI DRAM address (R/W): [23:0] starting RDRAM address */ +#define PI_DRAM_ADDR_REG (PI_BASE_REG+0x00) /* DRAM address */ + +/* PI pbus (cartridge) address (R/W): [31:0] starting AD16 address */ +#define PI_CART_ADDR_REG (PI_BASE_REG+0x04) + +/* PI read length (R/W): [23:0] read data length */ +#define PI_RD_LEN_REG (PI_BASE_REG+0x08) + +/* PI write length (R/W): [23:0] write data length */ +#define PI_WR_LEN_REG (PI_BASE_REG+0x0C) + +/* + * PI status (R): [0] DMA busy, [1] IO busy, [2], error + * (W): [0] reset controller (and abort current op), [1] clear intr + */ +#define PI_STATUS_REG (PI_BASE_REG+0x10) + +/* PI dom1 latency (R/W): [7:0] domain 1 device latency */ +#define PI_BSD_DOM1_LAT_REG (PI_BASE_REG+0x14) + +/* PI dom1 pulse width (R/W): [7:0] domain 1 device R/W strobe pulse width */ +#define PI_BSD_DOM1_PWD_REG (PI_BASE_REG+0x18) + +/* PI dom1 page size (R/W): [3:0] domain 1 device page size */ +#define PI_BSD_DOM1_PGS_REG (PI_BASE_REG+0x1C) /* page size */ + +/* PI dom1 release (R/W): [1:0] domain 1 device R/W release duration */ +#define PI_BSD_DOM1_RLS_REG (PI_BASE_REG+0x20) + +/* PI dom2 latency (R/W): [7:0] domain 2 device latency */ +#define PI_BSD_DOM2_LAT_REG (PI_BASE_REG+0x24) /* Domain 2 latency */ + +/* PI dom2 pulse width (R/W): [7:0] domain 2 device R/W strobe pulse width */ +#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28) /* pulse width */ + +/* PI dom2 page size (R/W): [3:0] domain 2 device page size */ +#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C) /* page size */ + +/* PI dom2 release (R/W): [1:0] domain 2 device R/W release duration */ +#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30) /* release duration */ + +#define PI_DOMAIN1_REG PI_BSD_DOM1_LAT_REG +#define PI_DOMAIN2_REG PI_BSD_DOM2_LAT_REG + +#define PI_DOM_LAT_OFS 0x00 +#define PI_DOM_PWD_OFS 0x04 +#define PI_DOM_PGS_OFS 0x08 +#define PI_DOM_RLS_OFS 0x0C + +/* + * PI status register has 3 bits active when read from (PI_STATUS_REG - read) + * Bit 0: DMA busy - set when DMA is in progress + * Bit 1: IO busy - set when IO is in progress + * Bit 2: Error - set when CPU issues IO request while DMA is busy + */ +#define PI_STATUS_ERROR 0x04 +#define PI_STATUS_IO_BUSY 0x02 +#define PI_STATUS_DMA_BUSY 0x01 + +/* PI status register has 2 bits active when written to: + * Bit 0: When set, reset PIC + * Bit 1: When set, clear interrupt flag + * The values of the two bits can be ORed together to both reset PIC and + * clear interrupt at the same time. + * + * Note: + * - The PIC does generate an interrupt at the end of each DMA. CPU + * needs to clear the interrupt flag explicitly (from an interrupt + * handler) by writing into the STATUS register with bit 1 set. + * + * - When a DMA completes, the interrupt flag is set. CPU can issue + * another request even while the interrupt flag is set (as long as + * PIC is idle). However, it is the CPU's responsibility for + * maintaining accurate correspondence between DMA completions and + * interrupts. + * + * - When PIC is reset, if PIC happens to be busy, an interrupt will + * be generated as PIC returns to idle. Otherwise, no interrupt will + * be generated and PIC remains idle. + */ +/* + * Values to clear interrupt/reset PIC (PI_STATUS_REG - write) + */ +#define PI_STATUS_RESET 0x01 +#define PI_SET_RESET PI_STATUS_RESET + +#define PI_STATUS_CLR_INTR 0x02 +#define PI_CLR_INTR PI_STATUS_CLR_INTR + +#define PI_DMA_BUFFER_SIZE 128 + +#define PI_DOM1_ADDR1 0x06000000 /* to 0x07FFFFFF */ +#define PI_DOM1_ADDR2 0x10000000 /* to 0x1FBFFFFF */ +#define PI_DOM1_ADDR3 0x1FD00000 /* to 0x7FFFFFFF */ +#define PI_DOM2_ADDR1 0x05000000 /* to 0x05FFFFFF */ +#define PI_DOM2_ADDR2 0x08000000 /* to 0x0FFFFFFF */ + + +/************************************************************************* + * RDRAM Interface (RI) Registers + */ +#define RI_BASE_REG 0x04700000 + +/* RI mode (R/W): [1:0] operating mode, [2] stop T active, [3] stop R active */ +#define RI_MODE_REG (RI_BASE_REG+0x00) + +/* RI config (R/W): [5:0] current control input, [6] current control enable */ +#define RI_CONFIG_REG (RI_BASE_REG+0x04) + +/* RI current load (W): [] any write updates current control register */ +#define RI_CURRENT_LOAD_REG (RI_BASE_REG+0x08) + +/* RI select (R/W): [2:0] receive select, [2:0] transmit select */ +#define RI_SELECT_REG (RI_BASE_REG+0x0C) + +/* RI refresh (R/W): [7:0] clean refresh delay, [15:8] dirty refresh delay, + * [16] refresh bank, [17] refresh enable + * [18] refresh optimize + */ +#define RI_REFRESH_REG (RI_BASE_REG+0x10) +#define RI_COUNT_REG RI_REFRESH_REG + +/* RI latency (R/W): [3:0] DMA latency/overlap */ +#define RI_LATENCY_REG (RI_BASE_REG+0x14) + +/* RI error (R): [0] nack error, [1] ack error */ +#define RI_RERROR_REG (RI_BASE_REG+0x18) + +/* RI error (W): [] any write clears all error bits */ +#define RI_WERROR_REG (RI_BASE_REG+0x1C) + + +/************************************************************************* + * Serial Interface (SI) Registers + */ +#define SI_BASE_REG 0x04800000 + +/* SI DRAM address (R/W): [23:0] starting RDRAM address */ +#define SI_DRAM_ADDR_REG (SI_BASE_REG+0x00) /* R0: DRAM address */ + +/* SI address read 64B (W): [] any write causes a 64B DMA write */ +#define SI_PIF_ADDR_RD64B_REG (SI_BASE_REG+0x04) /* R1: 64B PIF->DRAM */ + +/* Address SI_BASE_REG + (0x08, 0x0c, 0x14) are reserved */ + +/* SI address write 64B (W): [] any write causes a 64B DMA read */ +#define SI_PIF_ADDR_WR64B_REG (SI_BASE_REG+0x10) /* R4: 64B DRAM->PIF */ + +/* + * SI status (W): [] any write clears interrupt + * (R): [0] DMA busy, [1] IO read busy, [2] reserved + * [3] DMA error, [12] interrupt + */ +#define SI_STATUS_REG (SI_BASE_REG+0x18) /* R6: Status */ + +/* SI status register has the following bits active: + * 0: DMA busy - set when DMA is in progress + * 1: IO busy - set when IO access is in progress + * 3: DMA error - set when there are overlapping DMA requests + * 12: Interrupt - Interrupt set + */ +#define SI_STATUS_DMA_BUSY 0x0001 +#define SI_STATUS_RD_BUSY 0x0002 +#define SI_STATUS_DMA_ERROR 0x0008 +#define SI_STATUS_INTERRUPT 0x1000 + +/************************************************************************* + * Development Board GIO Control Registers + */ + +#define GIO_BASE_REG 0x18000000 + +/* Game to Host Interrupt */ +#define GIO_GIO_INTR_REG (GIO_BASE_REG+0x000) + +/* Game to Host SYNC */ +#define GIO_GIO_SYNC_REG (GIO_BASE_REG+0x400) + +/* Host to Game Interrupt */ +#define GIO_CART_INTR_REG (GIO_BASE_REG+0x800) + + +/************************************************************************* + * Common macros + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr)) +#define IO_WRITE(addr,data) (*(vu32 *)PHYS_TO_K1(addr)=(u32)(data)) +#define RCP_STAT_PRINT \ + rmonPrintf("current=%x start=%x end=%x dpstat=%x spstat=%x\n", \ + IO_READ(DPC_CURRENT_REG), \ + IO_READ(DPC_START_REG), \ + IO_READ(DPC_END_REG), \ + IO_READ(DPC_STATUS_REG), \ + IO_READ(SP_STATUS_REG)) + +#endif + +#endif /* _RCP_H_ */ diff --git a/include/ultra64/sptask.h b/include/PR/sptask.h similarity index 98% rename from include/ultra64/sptask.h rename to include/PR/sptask.h index 75d5752a..ec443ef4 100644 --- a/include/ultra64/sptask.h +++ b/include/PR/sptask.h @@ -8,7 +8,6 @@ #define M_HVQTASK 6 #define M_HVQMTASK 7 -//gGfxSPTaskYieldBuffer has to be changed for this too #if (defined(F3DEX_GBI) || defined(F3DLP_GBI) || defined(F3DEX_GBI_2)) #define OS_YIELD_DATA_SIZE 0xc00 #else @@ -19,6 +18,9 @@ /* Flags */ #define M_TASK_FLAG0 1 #define M_TASK_FLAG1 2 +#ifdef VERSION_SH +#define M_TASK_FLAG2 4 +#endif /* SpStatus */ #define SPSTATUS_CLEAR_HALT 0x00000001 diff --git a/include/ultra64/ucode.h b/include/PR/ucode.h similarity index 66% rename from include/ultra64/ucode.h rename to include/PR/ucode.h index 407f7f6b..37fd1977 100644 --- a/include/ultra64/ucode.h +++ b/include/PR/ucode.h @@ -11,13 +11,13 @@ extern u64 rspF3DBootStart[], rspF3DBootEnd[]; // F3D ucode extern u64 rspF3DStart[], rspF3DEnd[]; -// F3D data ucode +// F3D ucode data extern u64 rspF3DDataStart[], rspF3DDataEnd[]; -// F3D audio ucode -extern u64 rspF3DAudioStart[], rspF3DAudioEnd[]; +// aspMain (audio) ucode +extern u64 rspAspMainStart[], rspAspMainEnd[]; -// F3D audio data ucode -extern u64 rspF3DAudioDataStart[], rspF3DAudioDataEnd[]; +// aspMain ucode data +extern u64 rspAspMainDataStart[], rspAspMainDataEnd[]; #endif diff --git a/include/ultra64/types.h b/include/PR/ultratypes.h similarity index 76% rename from include/ultra64/types.h rename to include/PR/ultratypes.h index ddad7d15..8a00490a 100644 --- a/include/ultra64/types.h +++ b/include/PR/ultratypes.h @@ -29,13 +29,16 @@ typedef volatile s64 vs64; typedef float f32; typedef double f64; -typedef long int Mtx_t[4][4]; -typedef union -{ - Mtx_t m; - long long int forc_structure_alignment; -} Mtx; - -typedef unsigned long size_t; +#ifdef TARGET_N64 +typedef u32 size_t; +typedef s32 ssize_t; +typedef u32 uintptr_t; +typedef s32 intptr_t; +typedef s32 ptrdiff_t; +#else +#include +#include +typedef ptrdiff_t ssize_t; +#endif #endif diff --git a/include/platform_info.h b/include/platform_info.h new file mode 100644 index 00000000..310aa4d1 --- /dev/null +++ b/include/platform_info.h @@ -0,0 +1,15 @@ +#ifndef PLATFORM_INFO_H +#define PLATFORM_INFO_H + +#ifdef TARGET_N64 +#define IS_64_BIT 0 +#define IS_BIG_ENDIAN 1 +#else +#include +#define IS_64_BIT (UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFU) +#define IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#endif + +#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void *) / 4)) + +#endif // PLATFORM_INFO_H diff --git a/include/ultra64.h b/include/ultra64.h index 6a96dc80..409a3cf7 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -3,27 +3,31 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef _LANGUAGE_C +#define _LANGUAGE_C +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/include/ultra64/cache.h b/include/ultra64/cache.h deleted file mode 100644 index 1373a9a9..00000000 --- a/include/ultra64/cache.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ULTRA64_CACHE_H_ -#define _ULTRA64_CACHE_H_ - -/* Functions */ - -void osInvalICache(void *vaddr, s32 nbytes); -void osInvalDCache(void *vaddr, s32 nbytes); -void osWritebackDCache(void *vaddr, s32 nbytes); -void osWritebackDCacheAll(void); - -#endif diff --git a/include/ultra64/eeprom.h b/include/ultra64/eeprom.h deleted file mode 100644 index 1724a6d4..00000000 --- a/include/ultra64/eeprom.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ULTRA64_EEPROM_H_ -#define _ULTRA64_EEPROM_H_ - -typedef struct -{ - u16 unk00; - u16 unk01; -} OSEepromUnknownStruct0; - -/* Functions */ - -s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes); -s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes); -s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer); -s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer); -s32 osEepromProbe(OSMesgQueue *mq); - -#endif diff --git a/include/ultra64/gbi.h b/include/ultra64/gbi.h deleted file mode 100644 index 2d6fd626..00000000 --- a/include/ultra64/gbi.h +++ /dev/null @@ -1,736 +0,0 @@ -#ifndef _ULTRA64_GBI_H_ -#define _ULTRA64_GBI_H_ - -/* Types */ - -/* Vertex (set up for use with colors) */ -typedef struct -{ - short ob[3]; /* x, y, z */ - unsigned short flag; - short tc[2]; /* texture coord */ - unsigned char cn[4]; /* color & alpha */ -} Vtx_t; - -/* Vertex (set up for use with normals) */ -typedef struct -{ - short ob[3]; /* x, y, z */ - unsigned short flag; - short tc[2]; /* texture coord */ - signed char n[3]; /* normal */ - unsigned char a; /* alpha */ -} Vtx_tn; - -typedef union -{ - Vtx_t v; /* Use this one for colors */ - Vtx_tn n; /* Use this one for normals */ - long long int force_structure_alignment; -} Vtx; - - -typedef struct -{ - short vscale[4]; /* scale, 2 bits fraction */ - short vtrans[4]; /* translate, 2 bits fraction */ -} Vp_t; - -typedef union -{ - Vp_t vp; - long long int force_structure_alignment; -} Vp; - - -typedef struct -{ - unsigned int w0; - unsigned int w1; -} Gwords; - -/* TODO: fill in the rest of the members */ -typedef union -{ - Gwords words; - long long int force_structure_alignment; -} Gfx; - - -#define _SHIFTL(value, shift, size) \ - ((unsigned int) (((unsigned int) (value) & ((1 << size) - 1)) << shift)) - -#define G_ON 1 -#define G_OFF 0 - -#define GPACK_RGBA5551(r, g, b, a) \ - ((((r) << 8) & 0xF800) | \ - (((g) << 3) & 0x07C0) | \ - (((b) >> 2) & 0x003E) | \ - ((a) & 0x0001)) -#define GPACK_ZDZ(z, dz) ((z) << 2 | (dz)) - - -#define G_ZBUFFER 0x00000001 -#define G_TEXTURE_ENABLE 0x00000002 -#define G_SHADE 0x00000004 -#define G_SHADING_SMOOTH 0x00000200 -#define G_CULL_FRONT 0x00001000 -#define G_CULL_BACK 0x00002000 -#define G_CULL_BOTH 0x00003000 -#define G_FOG 0x00010000 -#define G_LIGHTING 0x00020000 -#define G_TEXTURE_GEN 0x00040000 -#define G_TEXTURE_GEN_LINEAR 0x00080000 -#define G_LOD 0x00100000 -#define G_CLIPPING 0x00800000 - -#define G_IM_FMT_RGBA 0 -#define G_IM_FMT_YUV 1 -#define G_IM_FMT_CI 2 -#define G_IM_FMT_IA 3 -#define G_IM_FMT_I 4 - -#define G_IM_SIZ_4b 0 -#define G_IM_SIZ_8b 1 -#define G_IM_SIZ_16b 2 -#define G_IM_SIZ_32b 3 -#define G_IM_SIZ_DD 5 - -#define G_AC_NONE (0 << 0) -#define G_AC_THRESHOLD (1 << 0) -#define G_AC_DITHER (3 << 0) - -#define G_ZS_PIXEL (0 << 2) -#define G_ZS_PRIM (1 << 2) - -#define G_CD_MAGICSQ (0 << 6) -#define G_CD_BAYER (1 << 6) -#define G_CD_NOISE (2 << 6) - -#define G_CK_NONE (0 << 8) -#define G_CK_KEY (1 << 8) - -#define G_TC_CONV (0 << 9) -#define G_TC_FILTCONV (5 << 9) -#define G_TC_FILT (6 << 9) - -#define G_TF_POINT (0 << 12) -#define G_TF_BILERP (2 << 12) -#define G_TF_AVERAGE (3 << 12) - -#define G_TT_NONE (0 << 14) -#define G_TT_RGBA16 (2 << 14) -#define G_TT_IA16 (3 << 14) - -#define G_TL_TILE (0 << 16) -#define G_TL_LOD (1 << 16) - -#define G_TD_CLAMP (0 << 17) -#define G_TD_SHARPEN (1 << 17) -#define G_TD_DETAIL (2 << 17) - -#define G_TP_NONE (0 << 19) -#define G_TP_PERSP (1 << 19) - -#define G_CYC_1CYCLE (0 << 20) -#define G_CYC_2CYCLE (1 << 20) -#define G_CYC_COPY (2 << 20) -#define G_CYC_FILL (3 << 20) - -#define G_PM_NPRIMITIVE (0 << 23) -#define G_PM_1PRIMITIVE (1 << 23) - -#define G_SC_NON_INTERLACE 0 -#define G_SC_ODD_INTERLACE 3 -#define G_SC_EVEN_INTERLACE 2 - -#define G_TX_LOADTILE 7 -#define G_TX_RENDERTILE 0 - -#define G_TX_NOMIRROR 0 -#define G_TX_WRAP 0 -#define G_TX_MIRROR 1 -#define G_TX_CLAMP 2 -#define G_TX_NOMASK 0 -#define G_TX_NOLOD 0 - -#define G_TX_LDBLK_MAX_TXL 2047 - -#define G_MV_VIEWPORT 0x80 -#define G_MV_LOOKATY 0x82 -#define G_MV_LOOKATX 0x84 -#define G_MV_L0 0x86 -#define G_MV_L1 0x88 -#define G_MV_L2 0x8A -#define G_MV_L3 0x8C -#define G_MV_L4 0x8E -#define G_MV_L5 0x90 -#define G_MV_L6 0x92 -#define G_MV_L7 0x94 -#define G_MV_TXTATT 0x96 -#define G_MV_MATRIX_1 0x9E -#define G_MV_MATRIX_2 0x98 -#define G_MV_MATRIX_3 0x9A -#define G_MV_MATRIX_4 0x9C - -#define G_SETOTHERMODE_L 0xB9 -#define G_SETOTHERMODE_H 0xBA - -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#define gSPMatrix(pkt, m, p) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0x01, 24, 8) \ - | _SHIFTL((p), 16, 8) \ - | _SHIFTL(sizeof(Mtx), 0, 16); \ - _g->words.w1 = (u32)(m); \ -} - -#define gSPVertex(pkt, v, n, v0) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0x04, 24, 8) \ - | _SHIFTL(((n)-1) << 4 | (v0), 16, 8) \ - | _SHIFTL(sizeof(Vtx)*(n), 0, 16); \ - _g->words.w1 = (u32)(v); \ -} - -#define gDPLoadSync(pkt) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xE6000000; \ - _g->words.w1 = 0x00000000; \ -} - -#define gDPPipeSync(pkt) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xE7000000; \ - _g->words.w1 = 0x00000000; \ -} - -#define gDPTileSync(pkt) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xE8000000; \ - _g->words.w1 = 0x00000000; \ -} - -#define gDPFullSync(pkt) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xE9000000; \ - _g->words.w1 = 0x00000000; \ -} - -#define gSPDisplayList(pkt, dl) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0x06000000; \ - _g->words.w1 = (u32)(dl); \ -} - -#define gSPBranchList(pkt, dl) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = 0x06010000; \ - _g->words.w1 = (u32)(dl); \ -} - -#define gSPEndDisplayList(pkt) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB8000000; \ - _g->words.w1 = 0x00000000; \ -} - -#define gDPSetCycleType(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA001402; \ - _g->words.w1 = type; \ -} - -#define gDPPipelineMode(pkt, mode) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA001701; \ - _g->words.w1 = mode; \ -} - -#define gDPSetScissor(pkt, mode, ulx, uly, lrx, lry) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xED, 24, 8) \ - | _SHIFTL((int)((float)(ulx)*4.0f), 12, 12) \ - | _SHIFTL((int)((float)(uly)*4.0f), 0, 12); \ - _g->words.w1 = _SHIFTL((mode), 24, 8) \ - | _SHIFTL((int)((float)(lrx)*4.0f), 12, 12) \ - | _SHIFTL((int)((float)(lry)*4.0f), 0, 12); \ -} - -#define gDPSetCombine(pkt, muxs0, muxs1) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xFC, 24, 8) \ - | _SHIFTL((muxs0), 0, 24); \ - _g->words.w1 = (muxs1); \ -} - -#define gDPSetTextureLOD(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA001001; \ - _g->words.w1 = type; \ -} - -#define gDPSetTextureLUT(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA000E02; \ - _g->words.w1 = type; \ -} - -#define gDPSetTextureDetail(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA001102; \ - _g->words.w1 = type; \ -} - -#define gDPSetTexturePersp(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA001301; \ - _g->words.w1 = type; \ -} - -#define gDPSetTextureFilter(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA000C02; \ - _g->words.w1 = type; \ -} - -#define gDPSetTextureConvert(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA000903; \ - _g->words.w1 = type; \ -} - -#define gDPSetCombineKey(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA000801; \ - _g->words.w1 = type; \ -} - -#define gDPSetColorDither(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBA000602; \ - _g->words.w1 = type; \ -} - -#define gDPSetFillColor(pkt, color) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xF7000000; \ - _g->words.w1 = color; \ -} - -#define gDPFillRectangle(pkt, ulx, uly, lrx, lry) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xF6, 24, 8) \ - | _SHIFTL((lrx), 14, 10) \ - | _SHIFTL((lry), 2, 10); \ - _g->words.w1 = _SHIFTL(0, 24, 8) \ - | _SHIFTL((ulx), 14, 10) \ - | _SHIFTL((uly), 2, 10); \ -} - -#define gDPSetAlphaCompare(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB9000002; \ - _g->words.w1 = type; \ -} - -#define gDPSetDepthSource(pkt, type) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB9000201; \ - _g->words.w1 = type; \ -} - -#define gSPSetOtherMode(pkt, cmd, shift, length, data) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = _SHIFTL((cmd), 24, 8) \ - | _SHIFTL((shift), 8, 8) \ - | _SHIFTL(((length)-1), 0, 8); \ - _g->words.w1 = (data); \ -} - -#define gDPSetRenderMode(pkt, mode1, mode2) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB900031D; \ - _g->words.w1 = (mode1) | (mode2); \ -} - -#define gSPClearGeometryMode(pkt, mode) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB6000000; \ - _g->words.w1 = mode; \ -} - -#define gSPSetGeometryMode(pkt, word) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xB7000000; \ - _g->words.w1 = word; \ -} - -#define gSPNumLights(pkt, n) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBC000002; \ - _g->words.w1 = (0x80000000 + ((n) + 1) * 0x20); \ -} - -#define gSPTexture(pkt, sc, tc, level, tile, on) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xBB, 24, 8) \ - | _SHIFTL(0, 16, 8) \ - | _SHIFTL((level), 11, 3) \ - | _SHIFTL((tile), 8, 3) \ - | _SHIFTL((on), 0, 8); \ - _g->words.w1 = _SHIFTL((sc), 16, 16) \ - | _SHIFTL((tc), 0, 16); \ -} - -#define gDPSetColorImage(pkt, fmt, size, width, image) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xFF, 24, 8) \ - | _SHIFTL((fmt), 21, 3) \ - | _SHIFTL((size), 19, 2) \ - | _SHIFTL((width)-1, 0, 12); \ - _g->words.w1 = (image); \ -} - -#define gDPSetTileSize(pkt, tile, uls, ult, lrs, lrt) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xF2, 24, 8) \ - | _SHIFTL(uls, 12, 12) \ - | _SHIFTL(ult, 0, 12); \ - _g->words.w1 = _SHIFTL(tile, 24, 3) \ - | _SHIFTL(lrs, 12, 12) \ - | _SHIFTL(lrt, 0, 12); \ -} - -#define gDPLoadBlock(pkt, tile, uls, ult, lrs, dxt) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xF3, 24, 8) \ - | _SHIFTL((uls), 12, 12) \ - | _SHIFTL((ult), 0, 12); \ - _g->words.w1 = _SHIFTL((tile), 24, 3) \ - | _SHIFTL((MIN((lrs),G_TX_LDBLK_MAX_TXL)), 12, 12) \ - | _SHIFTL((dxt), 0, 12); \ -} - -#define gDPSetTile(pkt, fmt, siz, line, tmem, tile, \ - palette, cmt, maskt, shiftt, cms, masks, shifts) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xF5, 24, 8) \ - | _SHIFTL((fmt), 21, 3) \ - | _SHIFTL((siz), 19, 2) \ - | _SHIFTL((line), 9, 9) \ - | _SHIFTL((tmem), 0, 9); \ - _g->words.w1 = _SHIFTL((tile), 24, 3) \ - | _SHIFTL((palette), 20, 4) \ - | _SHIFTL((cmt), 18, 2) \ - | _SHIFTL((maskt), 14, 4) \ - | _SHIFTL((shiftt), 10, 4) \ - | _SHIFTL((cms), 8, 2) \ - | _SHIFTL((masks), 4, 4) \ - | _SHIFTL((shifts), 0, 4); \ -} - -#define gDPSetDepthImage(pkt, image) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xFE, 24, 8); \ - _g->words.w1 = (image); \ -} - -#define G_SETPRIMCOLOR 0xFA - -#define gDPSetPrimColor(pkt, m, l, r, g, b, a) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(G_SETPRIMCOLOR, 24, 8) \ - | _SHIFTL(m, 8, 8) \ - | _SHIFTL(l, 0, 8); \ - _g->words.w1 = _SHIFTL(r, 24, 8) \ - | _SHIFTL(g, 16, 8) \ - | _SHIFTL(b, 8, 8) \ - | _SHIFTL(a, 0, 8); \ -} - -#define gDPSetEnvColor(pkt, r, g, b, a) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xFB, 24, 8); \ - _g->words.w1 = _SHIFTL((r), 24, 8) \ - | _SHIFTL((g), 16, 8) \ - | _SHIFTL((b), 8, 8) \ - | _SHIFTL((a), 0, 8); \ -} - -#define gDPSetTextureImage(pkt, fmt, size, width, img) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xFD, 24, 8) \ - | _SHIFTL((fmt), 21, 3) \ - | _SHIFTL((size), 19, 2) \ - | _SHIFTL((width)-1, 0, 12); \ - _g->words.w1 = (u32)(img); \ -} - -#define gMoveWd(pkt, index, offset, data) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xBC, 24, 8) \ - | _SHIFTL((offset), 8, 16) \ - | _SHIFTL((index), 0, 8); \ - _g->words.w1 = (u32)(data); \ -} - -/* Matrix Operations */ - -#define G_MTX_MODELVIEW 0x00 -#define G_MTX_PROJECTION 0x01 -#define G_MTX_MUL 0x00 -#define G_MTX_LOAD 0x02 -#define G_MTX_NOPUSH 0x00 -#define G_MTX_PUSH 0x04 - -#define gSPPopMatrix(pkt, n) \ -{ \ - Gfx *_g = (Gfx *) (pkt); \ - _g->words.w0 = 0xBD000000; \ - _g->words.w1 = (n); \ -} - -#define gSPViewport(pkt, v) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0x03, 24, 8) \ - | _SHIFTL(G_MV_VIEWPORT, 16, 8) \ - | _SHIFTL(sizeof(Vp), 0, 16); \ - _g->words.w1 = (u32)(v); \ -} - -#define gSP1Triangle(pkt, v0, v1, v2, flag) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xBF, 24, 8); \ - _g->words.w1 = _SHIFTL((flag), 24, 8) \ - | _SHIFTL((v0)*10, 16, 8) \ - | _SHIFTL((v1)*10, 8, 8) \ - | _SHIFTL((v2)*10, 0, 8); \ -} - -#if (defined(F3DLP_GBI)||defined(F3DEX_GBI)) -/*** - *** 2 Triangles - ***/ -#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ - __gsSP1Triangle_w1f(v00, v01, v02, flag0)); \ - _g->words.w1 = __gsSP1Triangle_w1f(v10, v11, v12, flag1); \ -} - -#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ -{ \ - (_SHIFTL(G_TRI2, 24, 8)| \ - __gsSP1Triangle_w1f(v00, v01, v02, flag0)), \ - __gsSP1Triangle_w1f(v10, v11, v12, flag1) \ -} - -#endif /* F3DEX_GBI/F3DLP_GBI */ - -#if (defined(TRI4_Ext)) - /*** - *** 4 Triangles - 2Tri Extension - *** Draws up to four triangles at a time. - *** Expects values from 0-F, corresponding with # points declared by vertex command. - *** Triangles with all points set to 0 are not drawn. - *** Vertex Buffer reduced to 16 due to only being able to address 0-F - ***/ -#define gSP4Triangles(pkt, v00, v01, v02, v10, v11, v12, \ - v20, v21, v22, v30, v31, v32 ) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ - _SHIFTL((v32),12,4)|_SHIFTL((v22),8,4)|_SHIFTL((v12),4,4)|_SHIFTL((v02),0,4); \ - _g->words.w1 = _SHIFTL((v31),28,4)|_SHIFTL((v30),24,4)|_SHIFTL((v21),20,4)|_SHIFTL((v20),16,4) \ - _SHIFTL((v11),12,4)|_SHIFTL((v10),8,4)|_SHIFTL((v02),4,4)|_SHIFTL((v00),0,4); \ -} - -#define gsSP4Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ -{ \ - (_SHIFTL(G_TRI2, 24, 8)| \ - _SHIFTL((v32),12,4)|_SHIFTL((v22),8,4)|_SHIFTL((v12),4,4)|_SHIFTL((v02),0,4)), \ - (_SHIFTL((v31),28,4)|_SHIFTL((v30),24,4)|_SHIFTL((v21),20,4)|_SHIFTL((v20),16,4) \ - _SHIFTL((v11),12,4)|_SHIFTL((v10),8,4)|_SHIFTL((v02),4,4)|_SHIFTL((v00),0,4)); \ -} - -#endif /* TRI4_Ext*/ - -#define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xE4, 24, 8) \ - | _SHIFTL((xh), 12, 12) \ - | _SHIFTL((yh), 0, 12); \ - _g->words.w1 = _SHIFTL((tile), 24, 3) \ - | _SHIFTL((xl), 12, 12) \ - | _SHIFTL((yl), 0, 12); \ -} \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xB3, 24, 8); \ - _g->words.w1 = _SHIFTL((s), 16, 16) \ - | _SHIFTL((t), 0, 16); \ -} \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(0xB2, 24, 8); \ - _g->words.w1 = _SHIFTL((dsdx), 16, 16) \ - | _SHIFTL((dtdy), 0, 16); \ -} - -/* Lights and Light Operations */ - -typedef struct { - unsigned char col[3]; - char pad1; - unsigned char colc[3]; - char pad2; - signed char dir[3]; - char pad3; -} Light_t; - -typedef struct { - unsigned char col[3]; - char pad1; - unsigned char colc[3]; - char pad2; -} Ambient_t; - -typedef union { - Ambient_t l; - long long int force_structure_alignment[1]; -} Ambient; - -typedef union { - Light_t l; - long long int force_structure_alignment[2]; -} Light; - -typedef struct { - Ambient a; - Light l[4]; -} Lights4; - -typedef struct { - Light l[2]; -} LookAt; - -typedef struct { - int x1, y1, x2, y2; -} Hilite_t; - -typedef union { - Hilite_t h; - long int force_alignmnet[4]; -} Hilite; - -#define G_MOVEMEM 0x03 -/* for gSPNumLights */ -// is NUMLIGHTS_0 accurate? -#define NUMLIGHTS_0 1 -#define NUMLIGHTS_1 1 -#define NUMLIGHTS_2 2 -#define NUMLIGHTS_3 3 -#define NUMLIGHTS_4 4 -#define NUMLIGHTS_5 5 -#define NUMLIGHTS_6 6 -#define NUMLIGHTS_7 7 - -/* for gSPLight */ -#define LIGHT_1 1 -#define LIGHT_2 2 -#define LIGHT_3 3 -#define LIGHT_4 4 -#define LIGHT_5 5 -#define LIGHT_6 6 -#define LIGHT_7 7 -#define LIGHT_8 8 - -#define gSPLight(pkt, l, n) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ - | _SHIFTL(((n)-1)*2+G_MV_L0, 16, 8) \ - | _SHIFTL(sizeof(Light), 0, 16); \ - _g->words.w1 = (u32)(l); \ -} - -#define gSPLookAtX(pkt, la) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ - | _SHIFTL(G_MV_LOOKATX, 16, 8) \ - | _SHIFTL(sizeof(Light), 0, 16); \ - _g->words.w1 = (u32)(la); \ -} - -#define gSPLookAtY(pkt, la) \ -{ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ - | _SHIFTL(G_MV_LOOKATY, 16, 8) \ - | _SHIFTL(sizeof(Light), 0, 16); \ - _g->words.w1 = (u32)(la); \ -} - -#define gSPLookAt(pkt, la) \ -{ \ - gSPLookAtX((pkt), (la)) \ - gSPLookAtY((pkt), (char *)(la)+16) \ -} - -#endif diff --git a/include/ultra64/gbi.inc b/include/ultra64/gbi.inc deleted file mode 100644 index cb05cf41..00000000 --- a/include/ultra64/gbi.inc +++ /dev/null @@ -1,332 +0,0 @@ -/* GNU as assembler macros for F3D GBI */ - -/* commands with no parameters */ -.macro f3d_noparam cmd - .word (\cmd << 24), 0x00000000 -.endm - -.macro gsImmp1 cmd, param - .word (\cmd << 24), \param -.endm - -/* DMA helper */ -.macro gsDma1p cmd, segAddr, length, params - .byte \cmd, \params - .hword \length - .word \segAddr -.endm - -/* 01: G_MTX */ -/* params */ -.set G_MTX_MODELVIEW, 0x00 -.set G_MTX_PROJECTION, 0x01 -.set G_MTX_MUL, 0x00 -.set G_MTX_LOAD, 0x02 -.set G_MTX_NOPUSH, 0x00 -.set G_MTX_PUSH, 0x04 - -.set G_MTX, 0x01 -.macro gsSPMatrix matrix, params - gsDma1p G_MTX, \matrix, 64, \params -.endm - -/* 02: reserved */ - -/* 03: G_MOVEMEM */ -.set G_MOVEMEM, 0x03 -.set G_MV_L0, 0x86 -.macro gsSPLight light, num - gsDma1p G_MOVEMEM, \light, 16, ((\num)-1)*2+G_MV_L0 -.endm - -/* 04: G_VTX */ -.set G_VTX, 0x04 -.macro gsSPVertex verts, num, index - gsDma1p G_VTX, \verts, 16*\num, ((\num)-1)<<4|(\index) -.endm - -/* 05: reserved */ - -/* 06: G_DL */ -.set G_DL, 0x06 -.set G_DL_PUSH, 0x00 -.set G_DL_NOPUSH, 0x01 -.macro gsSPDisplayList dl - gsDma1p G_DL, \dl, 0, G_DL_PUSH -.endm -.macro gsSPBranchList dl - gsDma1p G_DL, \dl, 0, G_DL_NOPUSH -.endm - -/* geometry mode flags */ -.set G_ZBUFFER, 0x00000001 -.set G_SHADE, 0x00000004 -.set G_SHADING_SMOOTH, 0x00000200 -.set G_CULL_FRONT, 0x00001000 -.set G_CULL_BACK, 0x00002000 -.set G_FOG, 0x00010000 -.set G_LIGHTING, 0x00020000 -.set G_TEXTURE_GEN, 0x00040000 -.set G_TEXTURE_GEN_LINEAR, 0x00080000 - -/* B3: G_RDPHALF_2 */ -.set G_RDPHALF_2, 0xB3 - -/* B4: G_RDPHALF_1 */ -.set G_RDPHALF_1, 0xB4 - -/* B6: G_CLEARGEOMETRYMODE */ -.set G_CLEARGEOMETRYMODE, 0xB6 -.macro gsSPClearGeometryMode flags - .word G_CLEARGEOMETRYMODE << 24 - .word \flags -.endm - -/* B7: G_SETGEOMETRYMODE */ -.set G_SETGEOMETRYMODE, 0xB7 -.macro gsSPSetGeometryMode flags - .word G_SETGEOMETRYMODE << 24 - .word \flags -.endm - -/* B8: G_ENDDL */ -.set G_ENDDL, 0xB8 -.macro gsSPEndDisplayList - f3d_noparam G_ENDDL -.endm - -/* B9: G_SETOTHERMODE_L */ -.set G_SETOTHERMODE_L, 0xB9 -/* G_SETOTHERMODE_L sft: shift count */ -.set G_MDSFT_ALPHACOMPARE, 0 -.set G_MDSFT_ZSRCSEL, 2 -.set G_MDSFT_RENDERMODE, 3 -.set G_MDSFT_BLENDER, 16 - -/* BA: G_SETOTHERMODE_H */ -.set G_SETOTHERMODE_H, 0xBA -/* G_SETOTHERMODE_H sft: shift count */ -.set G_MDSFT_ALPHADITHER, 4 -.set G_MDSFT_RGBDITHER, 6 -.set G_MDSFT_COMBKEY, 8 -.set G_MDSFT_TEXTCONV, 9 -.set G_MDSFT_TEXTFILT, 12 -.set G_MDSFT_TEXTLUT, 14 -.set G_MDSFT_TEXTLOD, 16 -.set G_MDSFT_TEXTDETAIL, 17 -.set G_MDSFT_TEXTPERSP, 19 -.set G_MDSFT_CYCLETYPE, 20 -.set G_MDSFT_PIPELINE, 23 - -.macro gsSPSetOtherMode cmd, sft, len, data - .word ((\cmd & 0xFF) << 24) | ((\sft & 0xFF) << 8) | (\len & 0xFF) - .word \data -.endm - -/* BB: G_TEXTURE */ -.set G_TEXTURE, 0xBB -.macro gsSPTexture scaleS, scaleT, level, tile, enable - .word (G_TEXTURE << 24) | ((\level & 0x7) << 11) | ((\tile & 0x7) << 8) | \enable - .word ((\scaleS & 0xFFFF) << 16) | (\scaleT & 0xFFFF) -.endm - -/* BC: G_MOVEWORD */ -.set G_MOVEWORD, 0xBC -.macro gsMoveWd index, offset, data - .word G_MOVEWORD << 24 | ((\index & 0xFFFF) << 8) | (\offset & 0xFF) - .word \data -.endm - -/* BF: G_TRI1 */ -.set G_TRI1, 0xBF -.macro gsSP1Triangle v0, v1, v2, flag - .word G_TRI1 << 24 - .byte \flag, \v0*10, \v1*10, \v2*10 -.endm - -/* C0: G_NOOP */ -.set G_NOOP, 0xC0 -.macro gsDPNoOp - f3d_noparam G_NOOP -.endm - -/* E6: G_RDPLOADSYNC */ -.set G_RDPLOADSYNC, 0xE6 -.macro gsDPLoadSync - f3d_noparam G_RDPLOADSYNC -.endm - -/* E7: G_RDPPIPESYNC */ -.set G_RDPPIPESYNC, 0xE7 -.macro gsDPPipeSync - f3d_noparam G_RDPPIPESYNC -.endm - -/* E8: G_RDPTILESYNC */ -.set G_RDPTILESYNC, 0xE8 -.macro gsDPTileSync - f3d_noparam G_RDPTILESYNC -.endm - -/* E9: G_RDPFULLSYNC */ -.set G_RDPFULLSYNC, 0xE9 -.macro gsDPFullSync - f3d_noparam G_RDPFULLSYNC -.endm - -/* F0: G_LOADTLUT */ -.set G_LOADTLUT, 0xF0 -.macro gsDPLoadTLUTCmd tile, count - .word G_LOADTLUT << 24 - .word ((\tile & 0x7) << 24) | (\count & 0x3FFF) << 10 -.endm - -/* F1: unused */ - -/* F2: G_SETTILESIZE */ -.set G_SETTILESIZE, 0xF2 -.macro gsDPSetTileSize tile, uls, ult, lrs, lrt - .word (G_SETTILESIZE << 24) | ((\uls & 0x0FFF) << 12) | (\ult & 0x0FFF) - .word ((\tile & 0x7) << 24) | ((\lrs & 0x0FFF) << 12) | (\lrt & 0x0FFF) -.endm - -/* F3: G_LOADBLOCK */ -.set G_LOADBLOCK, 0xF3 -.macro gsDPLoadBlock tile, uls, ult, lrs, dxt - .word (G_LOADBLOCK << 24) | ((\uls & 0x0FFF) << 12) | (\ult & 0x0FFF) - .word ((\tile & 0x7) << 24) | ((\lrs & 0x0FFF) << 12) | (\dxt & 0x0FFF) -.endm - -/* F5: G_SETTILE */ -.set G_TX_LOADTILE, 0x7 -.set G_TX_RENDERTILE, 0x0 - -/* axis clamp and mirror flags */ -.set G_TX_NOMIRROR, 0x0 -.set G_TX_WRAP, 0x0 -.set G_TX_MIRROR, 0x1 -.set G_TX_CLAMP, 0x2 - -/* mask flags */ -.set G_TX_NOMASK, 0x0 - -/* shift flags */ -.set G_TX_NOLOD, 0x0 - -.set G_SETTILE, 0xF5 -.macro gsDPSetTile fmt, siz, line, tmem, tile, palette, cmt, maskt, shiftt, cms, masks, shifts - .word (G_SETTILE << 24) | ((\fmt & 0x7) << 21) | ((\siz & 0x3) << 19) | ((\line & 0x1FF) << 9) | (\tmem & 0x1FF) - .word ((\tile & 0x7) << 24) | ((\palette & 0xF) << 20) | ((\cmt & 0x3) << 18) | ((\maskt & 0xF) << 14) | ((\shiftt & 0xF) << 10) | ((\cms & 0x3) << 8) | ((\masks & 0xF) << 4) | (\shifts & 0xF) -.endm - -/* F6: G_FILLRECT */ -.set G_FILLRECT, 0xF6 -.macro gsDPFillRectangle ulx, uly, lrx, lry - .word (G_FILLRECT << 24) | ((\lrx & 0x3FF) << 14) | ((\lry & 0x3FF) << 2) - .word ((\ulx & 0x3FF) << 14) | ((\uly & 0x3FF) << 2) -.endm - -/* F7: G_SETFILLCOLOR */ -.set G_SETFILLCOLOR, 0xF7 -.macro gsDPSetFillColor fillValue - .word G_SETFILLCOLOR << 24 - .word \fillValue -.endm - -/* helper for RGBA colors */ -.macro sDPRGBColor cmd r, g, b, a - .word \cmd << 24 - .byte \r, \g, \b, \a -.endm - -/* F8: G_SETFOGCOLOR */ -.set G_SETFOGCOLOR, 0xF8 -.macro gsDPSetFogColor r, g, b, a - sDPRGBColor G_SETFOGCOLOR, \r, \g, \b, \a -.endm - -/* F9: G_SETBLENDCOLOR */ -.set G_SETBLENDCOLOR, 0xF9 -.macro gsDPSetBlendColor r, g, b, a - sDPRGBColor G_SETBLENDCOLOR, \r, \g, \b, \a -.endm - -/* FA: G_SETPRIMCOLOR */ -.set G_SETPRIMCOLOR, 0xFA -.macro gsDPSetPrimColor m, l, r, g, b, a - .word (G_SETPRIMCOLOR << 24) | ((\m & 0xFF) << 8) | (\l & 0xFF) - .byte \r, \g, \b, \a -.endm - -/* FB: G_SETENVCOLOR */ -.set G_SETENVCOLOR, 0xFB -.macro gsDPSetEnvColor r, g, b, a - sDPRGBColor G_SETENVCOLOR, \r, \g, \b, \a -.endm - -/* FC: G_SETCOMBINE */ -/* color combiner */ -.set G_CCMUX_COMBINED, 0 -.set G_CCMUX_TEXEL0, 1 -.set G_CCMUX_TEXEL1, 2 -.set G_CCMUX_PRIMITIVE, 3 -.set G_CCMUX_SHADE, 4 -.set G_CCMUX_ENVIRONMENT, 5 -.set G_CCMUX_CENTER, 6 -.set G_CCMUX_SCALE, 6 -.set G_CCMUX_COMBINED_ALPHA, 7 -.set G_CCMUX_TEXEL0_ALPHA, 8 -.set G_CCMUX_TEXEL1_ALPHA, 9 -.set G_CCMUX_PRIMITIVE_ALPHA, 10 -.set G_CCMUX_SHADE_ALPHA, 11 -.set G_CCMUX_ENV_ALPHA, 12 -.set G_CCMUX_LOD_FRACTION, 13 -.set G_CCMUX_PRIM_LOD_FRAC, 14 -.set G_CCMUX_NOISE, 7 -.set G_CCMUX_K4, 7 -.set G_CCMUX_K5, 15 -.set G_CCMUX_1, 6 -.set G_CCMUX_0, 31 - -/* alpha combiner */ -.set G_ACMUX_COMBINED, 0 -.set G_ACMUX_TEXEL0, 1 -.set G_ACMUX_TEXEL1, 2 -.set G_ACMUX_PRIMITIVE, 3 -.set G_ACMUX_SHADE, 4 -.set G_ACMUX_ENVIRONMENT, 5 -.set G_ACMUX_LOD_FRACTION, 0 -.set G_ACMUX_PRIM_LOD_FRAC, 6 -.set G_ACMUX_1, 6 -.set G_ACMUX_0, 7 - -.set G_SETCOMBINE, 0xFC -.macro gsDPSetCombine muxs0, muxs1 - .word (G_SETCOMBINE << 24) | (\muxs0 & 0x00FFFFFF) - .word \muxs1 -.endm -.macro gsDPSetCombineMode a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1 - .word (G_SETCOMBINE << 24) | ((\a0 & 0xF) << 20) | ((\c0 & 0x1F) << 15) | ((\Aa0 & 0x7) << 12) | ((\Ac0 & 0x7) << 9) | ((\a1 & 0xF) << 5) | (\c1 & 0x1F) - .word ((\b0 & 0xF) << 28) | ((\b1 & 0xF) << 24) | ((\Aa1 & 0x7) << 21) | ((\Ac1 & 0x7) << 18) | ((\d0 & 0x7) << 15) | ((\Ab0 & 0x7) << 12) | ((\Ad0 & 0x7) << 9) | ((\d1 & 0x7) << 6) | ((\Ab1 & 0x7) << 3) | (\Ad1 & 0x7) -.endm - -/* FD: G_SETTIMG */ -/* fmt */ -.set G_IM_FMT_RGBA, 0x00 -.set G_IM_FMT_YUV, 0x01 -.set G_IM_FMT_CI, 0x02 -.set G_IM_FMT_IA, 0x03 -.set G_IM_FMT_I, 0x04 - -/* size */ -.set G_IM_SIZ_4b, 0x00 -.set G_IM_SIZ_8b, 0x01 -.set G_IM_SIZ_16b, 0x02 -.set G_IM_SIZ_32b, 0x03 - -.set G_SETTIMG, 0xFD -.macro gsDPSetTextureImage fmt, size, width, segAddr - .word (G_SETTIMG << 24) | ((\fmt & 0x7) << 21) | ((\size & 0x3) << 19) | ((\width-1) & 0x0FFF) - .word \segAddr -.endm - diff --git a/include/ultra64/interrupt.h b/include/ultra64/interrupt.h deleted file mode 100644 index 7eb8a4d7..00000000 --- a/include/ultra64/interrupt.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _ULTRA64_INTERRUPT_H_ -#define _ULTRA64_INTERRUPT_H_ - -/* Types */ - -typedef u32 OSIntMask; - - -/* Functions */ - -OSIntMask osGetIntMask(void); -OSIntMask osSetIntMask(OSIntMask); - -#endif diff --git a/include/ultra64/libaudio.h b/include/ultra64/libaudio.h deleted file mode 100644 index 474061b1..00000000 --- a/include/ultra64/libaudio.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _ULTRA64_LIBAUDIO_H_ -#define _ULTRA64_LIBAUDIO_H_ - - -typedef struct -{ - u8 *offset; - s32 len; -} ALSeqData; - -typedef struct -{ - s16 revision; - s16 seqCount; - ALSeqData seqArray[1]; -} ALSeqFile; - -void alSeqFileNew(ALSeqFile *f, u8 *base); - -#endif diff --git a/include/ultra64/libc.h b/include/ultra64/libc.h deleted file mode 100644 index 3b402d40..00000000 --- a/include/ultra64/libc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _ULTRA64_LIBC_H_ -#define _ULTRA64_LIBC_H_ - -int sprintf(char *, const char *, ... ); -void bcopy(const void *src, void *dest, size_t size); -void bzero(void *s, size_t size); - -#endif diff --git a/include/ultra64/message.h b/include/ultra64/message.h deleted file mode 100644 index 19531493..00000000 --- a/include/ultra64/message.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _ULTRA64_MESSAGE_H_ -#define _ULTRA64_MESSAGE_H_ - -/* Events */ -#define OS_EVENT_SW1 0 -#define OS_EVENT_SW2 1 -#define OS_EVENT_CART 2 -#define OS_EVENT_COUNTER 3 -#define OS_EVENT_SP 4 -#define OS_EVENT_SI 5 -#define OS_EVENT_AI 6 -#define OS_EVENT_VI 7 -#define OS_EVENT_PI 8 -#define OS_EVENT_DP 9 -#define OS_EVENT_CPU_BREAK 10 -#define OS_EVENT_SP_BREAK 11 -#define OS_EVENT_FAULT 12 -#define OS_EVENT_THREADSTATUS 13 -#define OS_EVENT_PRENMI 14 - -#define OS_MESG_NOBLOCK 0 -#define OS_MESG_BLOCK 1 - -/* Types */ - -typedef u32 OSEvent; - -typedef void *OSMesg; - -typedef struct OSMesgQueue_s -{ - OSThread *mtqueue; - OSThread *fullqueue; - s32 validCount; - s32 first; - s32 msgCount; - OSMesg *msg; -} OSMesgQueue; - -/* Functions */ - -void osCreateMesgQueue(OSMesgQueue *mq, OSMesg *msgBuf, s32 count); -s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flag); -s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag); -s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flag); -void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg); -void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount); -s32 osContStartReadData(OSMesgQueue *mq); - -#endif diff --git a/include/ultra64/os_cont.h b/include/ultra64/os_cont.h deleted file mode 100644 index 7393f39f..00000000 --- a/include/ultra64/os_cont.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _ULTRA64_CONTROLLER_H_ -#define _ULTRA64_CONTROLLER_H_ - -typedef struct -{ - /*0x00*/ u16 type; /* Controller Type */ - /*0x02*/ u8 status; /* Controller status */ - /*0x03*/ u8 errno; -} OSContStatus; - -typedef struct { - /*0x00*/ u16 button; - /*0x02*/ s8 stick_x; /* -80 <= stick_x <= 80 */ - /*0x03*/ s8 stick_y; /* -80 <= stick_y <= 80 */ - /*0x04*/ u8 errno; -} OSContPad; - -#define A_BUTTON (1 << 15) // 0x8000 -#define B_BUTTON (1 << 14) // 0x4000 -#define Z_TRIG (1 << 13) // 0x2000 -#define START_BUTTON (1 << 12) // 0x1000 -#define U_JPAD (1 << 11) // 0x0800 -#define D_JPAD (1 << 10) // 0x0400 -#define L_JPAD (1 << 9) // 0x0200 -#define R_JPAD (1 << 8) // 0x0100 -#define DUMMY_1 (1 << 7) // 0x0080 (unused) -#define DUMMY_2 (1 << 6) // 0x0040 (unused) -#define L_TRIG (1 << 5) // 0x0020 -#define R_TRIG (1 << 4) // 0x0010 -#define U_CBUTTONS (1 << 3) // 0x0008 -#define D_CBUTTONS (1 << 2) // 0x0004 -#define L_CBUTTONS (1 << 1) // 0x0002 -#define R_CBUTTONS (1 << 0) // 0x0001 - - -s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *); -void osContGetReadData(OSContPad *); - -#endif diff --git a/include/ultra64/pi.h b/include/ultra64/pi.h deleted file mode 100644 index 4844f81f..00000000 --- a/include/ultra64/pi.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef _ULTRA64_PI_H_ -#define _ULTRA64_PI_H_ - -/* Ultra64 Parallel Interface */ - -/* Types */ - -typedef struct -{ - u32 errStatus; - void *dramAddr; - void *C2Addr; - u32 sectorSize; - u32 C1ErrNum; - u32 C1ErrSector[4]; -} __OSBlockInfo; - -typedef struct -{ - u32 cmdType; - u16 transferMode; - u16 blockNum; - s32 sectorNum; - u32 devAddr; - u32 bmCtlShadow; - u32 seqCtlShadow; - __OSBlockInfo block[2]; -} __OSTranxInfo; - -typedef struct OSPiHandle_s -{ - struct OSPiHandle_s *next; - u8 type; - u8 latency; - u8 pageSize; - u8 relDuration; - u8 pulse; - u8 domain; - u32 baseAddress; - u32 speed; - __OSTranxInfo transferInfo; -} OSPiHandle; - -typedef struct -{ - u8 type; - u32 address; -} OSPiInfo; - -typedef struct -{ - u16 type; - u8 pri; - u8 status; - OSMesgQueue *retQueue; -} OSIoMesgHdr; - -typedef struct -{ - /*0x00*/ OSIoMesgHdr hdr; - /*0x08*/ void *dramAddr; - /*0x0C*/ u32 devAddr; - /*0x10*/ u32 size; - OSPiHandle *piHandle; //from the official definition -} OSIoMesg; - -/* Definitions */ - -#define OS_READ 0 // device -> RDRAM -#define OS_WRITE 1 // device <- RDRAM - -#define OS_MESG_PRI_NORMAL 0 -#define OS_MESG_PRI_HIGH 1 - -/* Functions */ - -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, - u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *mq); -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, - s32 cmdMsgCnt); -OSMesgQueue *osPiGetCmdQueue(void); -s32 osPiWriteIo(u32 devAddr, u32 data); -s32 osPiReadIo(u32 devAddr, u32 *data); - -#endif diff --git a/include/ultra64/rdp.h b/include/ultra64/rdp.h deleted file mode 100644 index 718d223b..00000000 --- a/include/ultra64/rdp.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _ULTRA64_RDP_H_ -#define _ULTRA64_RDP_H_ - -/* DP Command Registers */ - -#define DPC_REG_BASE 0xA4100000 - -#define DPC_START_REG (*(vu32 *)(DPC_REG_BASE + 0x00)) -#define DPC_END_REG (*(vu32 *)(DPC_REG_BASE + 0x04)) -#define DPC_CURRENT_REG (*(vu32 *)(DPC_REG_BASE + 0x08)) -#define DPC_STATUS_REG (*(vu32 *)(DPC_REG_BASE + 0x0C)) -#define DPC_CLOCK_REG (*(vu32 *)(DPC_REG_BASE + 0x10)) -#define DPC_BUFBUSY_REG (*(vu32 *)(DPC_REG_BASE + 0x14)) -#define DPC_PIPEBUSY_REG (*(vu32 *)(DPC_REG_BASE + 0x18)) -#define DPC_TMEM_REG (*(vu32 *)(DPC_REG_BASE + 0x1C)) - - -/* DP Span Registers */ - -#define DPS_REG_BASE 0xA4200000 - -#define DPS_TBIST_REG (*(vu32 *)(DPS_REG_BASE + 0x00)) -#define DPS_TEST_MODE_REG (*(vu32 *)(DPS_REG_BASE + 0x04)) -#define DPS_BUFTEST_ADDR_REG (*(vu32 *)(DPS_REG_BASE + 0x08)) -#define DPS_BUFTEST_DATA_REG (*(vu32 *)(DPS_REG_BASE + 0x0C)) - - -/* Functions */ - -u32 osDpGetStatus(void); -void osDpSetStatus(u32 status); - -#endif diff --git a/include/ultra64/tlb.h b/include/ultra64/tlb.h deleted file mode 100644 index 1a0f4694..00000000 --- a/include/ultra64/tlb.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _ULTRA64_TLB_H_ -#define _ULTRA64_TLB_H_ - -/* Types */ - -typedef u32 OSPageMask; -/* OSPageMask Valid Values */ -#define OS_PM_4K 0x0000000 -#define OS_PM_16K 0x0006000 -#define OS_PM_64K 0x001e000 -#define OS_PM_256K 0x007e000 -#define OS_PM_1M 0x01fe000 -#define OS_PM_4M 0x07fe000 -#define OS_PM_16M 0x1ffe000 - -/* Functions */ - -void osMapTLB(s32 index, OSPageMask pm, void *vaddr, u32 evenpaddr, - u32 oddpaddr, s32 asid); -void osMapTLBRdb(void); -void osUnmapTLB(s32 index); -void osUnmapTLBAll(void); -void osSetTLBASID(s32 asid); - -#endif diff --git a/readme.md b/readme.md index 8f8c5133..6bd8b994 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,8 @@ This is a working Goldeneye 007 decompilation! +[![GE-CI](https://github.com/kholdfuzion/goldeneye_src/workflows/GE-CI/badge.svg)](https://kholdfuzion.github.io/goldeneyestatus/) + + ## Setup The only requirements for Ubuntu 16.04 and 18.04 should be ``` diff --git a/src/bondaicommands.h b/src/bondaicommands.h index d23287dd..85c98a75 100644 --- a/src/bondaicommands.h +++ b/src/bondaicommands.h @@ -952,8 +952,10 @@ //============================================================================= // note: uses chr->visionrange while checking for bond. once bond has been spotted, // check if bond and guard are within line of sight (ignores facing direction). +// injured guards will also set spotted Bond state (won't work with invincible/armored guards). // if bond breaks line of sight, do not goto label. if bond has broken line of -// sight for more than 10 seconds, reset spotted bond state +// sight for more than 10 seconds, reset spotted bond state. when using with +// command 3E, make sure 32 takes priority over command 3E //===========================================================================*/ #define if_guard_sees_bond_ID 0x32 #define if_guard_sees_bond_LENGTH 0x02 @@ -1112,16 +1114,22 @@ label, /*============================================================================= -// name: if_guard_was_shot_within_last_10_secs +// name: if_guard_was_shot_or_seen_bond_within_last_10_secs // command id: 3E -// info: if guard was shot (from anyone) within the last 10 seconds, goto label +// info: if guard was shot (from anyone) or saw Bond within the last 10 seconds, goto label //============================================================================= -// note: command will not count guard as shot if they are invincible/have armour +// note: command will not count guard as shot if they are invincible/have armour. +// if guard saw Bond (using command 32) in the last 10 seconds, goto label. when +// using with command 32, make sure 32 takes priority over command 3E. if guard +// was injured within the last 10 seconds, goto label when finished injury reaction +// animation (will not work with invincible/armored guards). +// to check if guard was hit/damaged use commands 7E/F8 instead, or check if +// guard flags CHRFLAG_WAS_DAMAGED/CHRFLAG_WAS_HIT are set using command 9F/A2 //===========================================================================*/ -#define if_guard_was_shot_within_last_10_secs_ID 0x3E -#define if_guard_was_shot_within_last_10_secs_LENGTH 0x02 -#define if_guard_was_shot_within_last_10_secs(label) \ - if_guard_was_shot_within_last_10_secs_ID, \ +#define if_guard_was_shot_or_seen_bond_within_last_10_secs_ID 0x3E +#define if_guard_was_shot_or_seen_bond_within_last_10_secs_LENGTH 0x02 +#define if_guard_was_shot_or_seen_bond_within_last_10_secs(label) \ + if_guard_was_shot_or_seen_bond_within_last_10_secs_ID, \ label, /*============================================================================= @@ -2436,7 +2444,7 @@ /*============================================================================= // name: if_guard_bitfield_is_set_on // command id: 96 -// info: if bits is set on in chr->BITFIELD, goto label +// info: if any bits in argument are set on in chr->BITFIELD, goto label //============================================================================= // note: can be used by obj ai lists, obj lists are free to utilize the entire // spectrum of flags @@ -2483,7 +2491,7 @@ /*============================================================================= // name: if_chr_bitfield_is_set_on // command id: 99 -// info: if bits is set on in chr->BITFIELD, goto label +// info: if any bits in argument are set on in chr->BITFIELD, goto label //===========================================================================*/ #define if_chr_bitfield_is_set_on_ID 0x99 #define if_chr_bitfield_is_set_on_LENGTH 0x04 diff --git a/src/bondconstants.h b/src/bondconstants.h index 0adab7ab..98aa5665 100644 --- a/src/bondconstants.h +++ b/src/bondconstants.h @@ -44,6 +44,17 @@ typedef enum MISSION_BRIEFING { BRIEF_MONEYPENNY } MISSION_BRIEFING; +typedef enum OPTIONS { + PLAYER_OPTION_LOOK = 0, + PLAYER_OPTION_AUTOAIM, + PLAYER_OPTION_AIM, + PLAYER_OPTION_SIGHT, + PLAYER_OPTION_LOOKAHEAD, + PLAYER_OPTION_AMMODISPLAY, + PLAYER_OPTION_SCREEN, + PLAYER_OPTION_RATIO +} OPTIONS; + typedef enum DIFFICULTY { DIFFICULTY_AGENT = 0, DIFFICULTY_SECRET, @@ -1282,7 +1293,7 @@ typedef enum ACT_TYPE { #define CHRFLAG_INIT 0x00000001 // initialize chr #define CHRFLAG_CLONE 0x00000002 // clone on heard gunfire (used by GLIST_DETECT_BOND_SPAWN_CLONE_ON_HEARD_GUNFIRE) -#define CHRFLAG_NEAR_MISS 0x00000004 // chr was just nearly shot (sometimes set on direct hit) +#define CHRFLAG_NEAR_MISS 0x00000004 // chr was just nearly shot (sometimes set on direct hit) - resets every tick #define CHRFLAG_HAS_BEEN_ON_SCREEN 0x00000008 // chr has been on screen before #define CHRFLAG_INVINCIBLE 0x00000010 // invincible #define CHRFLAG_00000020 0x00000020 // unknown @@ -1428,7 +1439,9 @@ typedef enum ACT_TYPE { #define OBJECTTYPE_35 0x35 #define OBJECTTYPE_36 0x36 - +#define CROUCH_SQUAT 0 +#define CROUCH_HALF 1 +#define CROUCH_STAND 2 #endif diff --git a/src/bondgame.h b/src/bondgame.h index f08c3c7f..012368b2 100644 --- a/src/bondgame.h +++ b/src/bondgame.h @@ -1,9 +1,8 @@ -#ifndef _BOND_H_ -#define _BOND_H_ +#ifndef _BONDGAME_H_ +#define _BONDGAME_H_ #include "ultra64.h" -extern u8 cfb_16_a[]; -extern u8 cfb_16_b[]; +extern u8 cfb_16[2][320*240*2]; extern u32 *_codeSegmentStart; extern u32 *_codeSegmentEnd; diff --git a/src/bondtypes.h b/src/bondtypes.h index bd42b0a1..c436fda4 100644 --- a/src/bondtypes.h +++ b/src/bondtypes.h @@ -2,6 +2,8 @@ #define _BONDTYPES_H_ #include "ultra64.h" #include "bondconstants.h" +#include "structs.h" + struct rgba_val{ u8 r; u8 g; @@ -46,10 +48,8 @@ typedef struct PropRecord } Entityp; } PropRecord; -typedef struct CHRdata CHRdata, *PCHRdata; - /* unfinished struct, WIP */ -struct CHRdata { +struct chrdata { u16 chrnum; s8 accuracyrating; s8 speedrating; @@ -70,7 +70,7 @@ struct CHRdata { s8 flinchcnt; s16 hidden; s32 chrflags; - void * pad; + struct prop* posdata; void * model; /* 0x0020 */ void * field_20; @@ -154,7 +154,7 @@ struct CHRdata { u8 random; /* 0x0110 */ s32 timer60; - u16 padpreset1; /* ID PAD_PRESET */ + s16 padpreset1; /* ID PAD_PRESET */ u16 chrpreset1; /* ID CHR_PRESET */ u16 chrseeshot; /* ID CHR_SEE_SHOT - ignores invincible/armoured guards */ u16 chrseedie; /* ID CHR_SEE_DIE */ diff --git a/src/boss.c b/src/boss.c index d0f2de9e..4c74ddd3 100644 --- a/src/boss.c +++ b/src/boss.c @@ -484,7 +484,7 @@ loop_29: if (current_stage_num != 0x5a) { phi_s1_2 = 0; - if (get_num_players() > 0) + if (getPlayerCount() > 0) { loop_44: set_cur_player(sub_GAME_7F09B528(phi_s1_2)); @@ -493,7 +493,7 @@ loop_44: sub_GAME_7F0BF800(); temp_s1 = phi_s1_2 + 1; phi_s1_2 = temp_s1; - if (temp_s1 < get_num_players()) + if (temp_s1 < getPlayerCount()) { goto loop_44; } @@ -1013,7 +1013,7 @@ glabel mainloop /* 0071A8 700065A8 2401005A */ li $at, 90 /* 0071AC 700065AC 13210018 */ beq $t9, $at, .L70006610 /* 0071B0 700065B0 00000000 */ nop -/* 0071B4 700065B4 0FC26919 */ jal get_num_players +/* 0071B4 700065B4 0FC26919 */ jal getPlayerCount /* 0071B8 700065B8 00008825 */ move $s1, $zero /* 0071BC 700065BC 18400014 */ blez $v0, .L70006610 /* 0071C0 700065C0 00000000 */ nop @@ -1032,7 +1032,7 @@ glabel mainloop /* 0071F0 700065F0 860507F6 */ lh $a1, 0x7f6($s0) /* 0071F4 700065F4 0FC2FE00 */ jal sub_GAME_7F0BF800 /* 0071F8 700065F8 00000000 */ nop -/* 0071FC 700065FC 0FC26919 */ jal get_num_players +/* 0071FC 700065FC 0FC26919 */ jal getPlayerCount /* 007200 70006600 26310001 */ addiu $s1, $s1, 1 /* 007204 70006604 0222082A */ slt $at, $s1, $v0 /* 007208 70006608 1420FFEE */ bnez $at, .L700065C4 diff --git a/src/cfb.c b/src/cfb.c index af2fd9e6..357d456f 100644 --- a/src/cfb.c +++ b/src/cfb.c @@ -1,5 +1,4 @@ #include "ultra64.h" #include "bondgame.h" -u8 cfb_16_a[320*240*2]; -u8 cfb_16_b[320*240*2]; \ No newline at end of file +u8 cfb_16[2][320*240*2]; \ No newline at end of file diff --git a/src/deb_print.c b/src/deb_print.c index a56e5869..4a9b4933 100644 --- a/src/deb_print.c +++ b/src/deb_print.c @@ -590,7 +590,7 @@ void set_ptr_video_buffers(s32 arg0, s32 arg1) { * calls 70005984: A0=803B5000, A1=803DA800 */ void set_video_buffer_pointers(void) { - set_ptr_video_buffers(&cfb_16_a, &cfb_16_b); + set_ptr_video_buffers(&cfb_16[0], &cfb_16[1]); } diff --git a/src/game/bg.c b/src/game/bg.c index 01f93c40..d089e601 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -1028,7 +1028,7 @@ glabel sub_GAME_7F0B3C8C /* 0E8880 7F0B3D50 56B90049 */ bnel $s5, $t9, .L7F0B3E78 /* 0E8884 7F0B3D54 26730001 */ addiu $s3, $s3, 1 /* 0E8888 7F0B3D58 26100008 */ addiu $s0, $s0, 8 -/* 0E888C 7F0B3D5C 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0E888C 7F0B3D5C 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0E8890 7F0B3D60 AE340000 */ sw $s4, ($s1) /* 0E8894 7F0B3D64 0C003A2C */ jal osVirtualToPhysical /* 0E8898 7F0B3D68 00402025 */ move $a0, $v0 @@ -1081,7 +1081,7 @@ glabel sub_GAME_7F0B3C8C /* 0E8948 7F0B3E18 02008825 */ move $s1, $s0 .L7F0B3E1C: /* 0E894C 7F0B3E1C AE340000 */ sw $s4, ($s1) -/* 0E8950 7F0B3E20 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0E8950 7F0B3E20 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0E8954 7F0B3E24 26100008 */ addiu $s0, $s0, 8 /* 0E8958 7F0B3E28 0C003A2C */ jal osVirtualToPhysical /* 0E895C 7F0B3E2C 00402025 */ move $a0, $v0 @@ -1183,7 +1183,7 @@ glabel sub_GAME_7F0B3C8C /* 0E8ABC 7F0B3F8C 02008825 */ move $s1, $s0 .L7F0B3F90: /* 0E8AC0 7F0B3F90 AE340000 */ sw $s4, ($s1) -/* 0E8AC4 7F0B3F94 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0E8AC4 7F0B3F94 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0E8AC8 7F0B3F98 26100008 */ addiu $s0, $s0, 8 /* 0E8ACC 7F0B3F9C 0C003A2C */ jal osVirtualToPhysical /* 0E8AD0 7F0B3FA0 00402025 */ move $a0, $v0 @@ -1235,32 +1235,25 @@ glabel sub_GAME_7F0B3C8C #ifdef NONMATCHING -s32 sub_GAME_7F0B4034(s32 arg0) { - s32 temp_v1; - void *phi_a0; - s32 phi_v1; - s32 phi_v1_2; +int sub_GAME_7F0B4034(int room) - // Node 0 - phi_v1 = arg0; - if ((ptr_bgdata_room_fileposition_list + (arg0 * 0x18))->unk4 == 0) +{ + bg_room_data *pbVar1; + f32 fVar2; + + if (ptr_bgdata_room_fileposition_list[room].ypos == 0.00000000) + { + fVar2 = (ptr_bgdata_room_fileposition_list[room+1].ypos; + pbVar1 = ptr_bgdata_room_fileposition_list + room; + while( true ) { - // Node 1 - phi_a0 = (ptr_bgdata_room_fileposition_list + (arg0 * 0x18)); - phi_v1_2 = arg0; -loop_2: - // Node 2 - temp_v1 = (phi_v1_2 + 1); - phi_a0 = (phi_a0 + 0x18); - phi_v1 = temp_v1; - phi_v1_2 = temp_v1; - if (phi_a0->unk1C == 0) - { - goto loop_2; - } + room = room + 1; + if (fVar2 != 0.00000000) break; + fVar2 = pbVar1[2].ypos; + pbVar1 = pbVar1 + 1; } - // Node 3 - return phi_v1; + } + return room; } #else GLOBAL_ASM( @@ -1538,7 +1531,7 @@ glabel load_bg_file /* 0E8DFC 7F0B42CC 01F40019 */ multu $t7, $s4 /* 0E8E00 7F0B42D0 0000C012 */ mflo $t8 /* 0E8E04 7F0B42D4 0238C821 */ addu $t9, $s1, $t8 -/* 0E8E08 7F0B42D8 0FC2CA54 */ jal sub_GAME_7F0B2950 +/* 0E8E08 7F0B42D8 0FC2CA54 */ jal setLevelScale /* 0E8E0C 7F0B42DC C72C000C */ lwc1 $f12, 0xc($t9) /* 0E8E10 7F0B42E0 8E480000 */ lw $t0, ($s2) /* 0E8E14 7F0B42E4 01140019 */ multu $t0, $s4 @@ -1562,7 +1555,7 @@ glabel load_bg_file /* 0E8E5C 7F0B432C E6040000 */ swc1 $f4, ($s0) /* 0E8E60 7F0B4330 0FC225DB */ jal sub_GAME_7F08976C /* 0E8E64 7F0B4334 C60C0000 */ lwc1 $f12, ($s0) -/* 0E8E68 7F0B4338 0FC16313 */ jal sub_GAME_7F058C4C +/* 0E8E68 7F0B4338 0FC16313 */ jal matrix_4x4_7F058C4C /* 0E8E6C 7F0B433C C60C0000 */ lwc1 $f12, ($s0) /* 0E8E70 7F0B4340 8EE20000 */ lw $v0, ($s7) /* 0E8E74 7F0B4344 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007BF98) @@ -1900,7 +1893,7 @@ glabel load_bg_file #ifdef NONMATCHING void sub_GAME_7F0B47E0(void) { sub_GAME_7F0B667C(); - sub_GAME_7F058C4C(1.0); + matrix_4x4_7F058C4C(1.0); } #else GLOBAL_ASM( @@ -1912,7 +1905,7 @@ glabel sub_GAME_7F0B47E0 /* 0E931C 7F0B47EC 00000000 */ nop /* 0E9320 7F0B47F0 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0E9324 7F0B47F4 44816000 */ mtc1 $at, $f12 -/* 0E9328 7F0B47F8 0FC16313 */ jal sub_GAME_7F058C4C +/* 0E9328 7F0B47F8 0FC16313 */ jal matrix_4x4_7F058C4C /* 0E932C 7F0B47FC 00000000 */ nop /* 0E9330 7F0B4800 8FBF0014 */ lw $ra, 0x14($sp) /* 0E9334 7F0B4804 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2137,47 +2130,22 @@ def_7F0B490C: +void addToByteSetMaxSize15(u8* set, u8 newElement) { + s32 i = 0; + while (i < 0x10 && set[i] != 0xFF) { + if (newElement == set[i]) { + return; + } + i++; + } -#ifdef NONMATCHING -void sub_GAME_7F0B4A50(void) { - + if (i < 0xF) { + set[i] = newElement; + set[i+1] = -1; + } + return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B4A50 -/* 0E9580 7F0B4A50 AFA50004 */ sw $a1, 4($sp) -/* 0E9584 7F0B4A54 908E0000 */ lbu $t6, ($a0) -/* 0E9588 7F0B4A58 240800FF */ li $t0, 255 -/* 0E958C 7F0B4A5C 30A600FF */ andi $a2, $a1, 0xff -/* 0E9590 7F0B4A60 110E000C */ beq $t0, $t6, .L7F0B4A94 -/* 0E9594 7F0B4A64 00001025 */ move $v0, $zero -/* 0E9598 7F0B4A68 00801821 */ addu $v1, $a0, $zero -/* 0E959C 7F0B4A6C 90850000 */ lbu $a1, ($a0) -/* 0E95A0 7F0B4A70 00C03825 */ move $a3, $a2 -.L7F0B4A74: -/* 0E95A4 7F0B4A74 10E5000D */ beq $a3, $a1, .L7F0B4AAC -/* 0E95A8 7F0B4A78 24420001 */ addiu $v0, $v0, 1 -/* 0E95AC 7F0B4A7C 28410010 */ slti $at, $v0, 0x10 -/* 0E95B0 7F0B4A80 10200004 */ beqz $at, .L7F0B4A94 -/* 0E95B4 7F0B4A84 24630001 */ addiu $v1, $v1, 1 -/* 0E95B8 7F0B4A88 90650000 */ lbu $a1, ($v1) -/* 0E95BC 7F0B4A8C 1505FFF9 */ bne $t0, $a1, .L7F0B4A74 -/* 0E95C0 7F0B4A90 00000000 */ nop -.L7F0B4A94: -/* 0E95C4 7F0B4A94 2841000F */ slti $at, $v0, 0xf -/* 0E95C8 7F0B4A98 10200004 */ beqz $at, .L7F0B4AAC -/* 0E95CC 7F0B4A9C 00821821 */ addu $v1, $a0, $v0 -/* 0E95D0 7F0B4AA0 240F00FF */ li $t7, 255 -/* 0E95D4 7F0B4AA4 A0660000 */ sb $a2, ($v1) -/* 0E95D8 7F0B4AA8 A06F0001 */ sb $t7, 1($v1) -.L7F0B4AAC: -/* 0E95DC 7F0B4AAC 03E00008 */ jr $ra -/* 0E95E0 7F0B4AB0 00000000 */ nop -) -#endif - @@ -2297,12 +2265,12 @@ glabel sub_GAME_7F0B4AB4 /* 0E975C 7F0B4C2C 02602025 */ move $a0, $s3 /* 0E9760 7F0B4C30 156C000C */ bne $t3, $t4, .L7F0B4C64 /* 0E9764 7F0B4C34 00000000 */ nop -/* 0E9768 7F0B4C38 0FC2D294 */ jal sub_GAME_7F0B4A50 +/* 0E9768 7F0B4C38 0FC2D294 */ jal addToByteSetMaxSize15 /* 0E976C 7F0B4C3C 90650005 */ lbu $a1, 5($v1) /* 0E9770 7F0B4C40 8EAD0000 */ lw $t5, ($s5) /* 0E9774 7F0B4C44 02802025 */ move $a0, $s4 /* 0E9778 7F0B4C48 01B27021 */ addu $t6, $t5, $s2 -/* 0E977C 7F0B4C4C 0FC2D294 */ jal sub_GAME_7F0B4A50 +/* 0E977C 7F0B4C4C 0FC2D294 */ jal addToByteSetMaxSize15 /* 0E9780 7F0B4C50 91C50005 */ lbu $a1, 5($t6) /* 0E9784 7F0B4C54 8EA80000 */ lw $t0, ($s5) /* 0E9788 7F0B4C58 A2200000 */ sb $zero, ($s1) @@ -2316,12 +2284,12 @@ glabel sub_GAME_7F0B4AB4 /* 0E97A4 7F0B4C74 02602025 */ move $a0, $s3 /* 0E97A8 7F0B4C78 55F8000C */ bnel $t7, $t8, .L7F0B4CAC /* 0E97AC 7F0B4C7C 920A0001 */ lbu $t2, 1($s0) -/* 0E97B0 7F0B4C80 0FC2D294 */ jal sub_GAME_7F0B4A50 +/* 0E97B0 7F0B4C80 0FC2D294 */ jal addToByteSetMaxSize15 /* 0E97B4 7F0B4C84 90650004 */ lbu $a1, 4($v1) /* 0E97B8 7F0B4C88 8EB90000 */ lw $t9, ($s5) /* 0E97BC 7F0B4C8C 02802025 */ move $a0, $s4 /* 0E97C0 7F0B4C90 03324821 */ addu $t1, $t9, $s2 -/* 0E97C4 7F0B4C94 0FC2D294 */ jal sub_GAME_7F0B4A50 +/* 0E97C4 7F0B4C94 0FC2D294 */ jal addToByteSetMaxSize15 /* 0E97C8 7F0B4C98 91250004 */ lbu $a1, 4($t1) /* 0E97CC 7F0B4C9C 8EA80000 */ lw $t0, ($s5) /* 0E97D0 7F0B4CA0 A2200000 */ sb $zero, ($s1) @@ -2576,8 +2544,8 @@ glabel sub_GAME_7F0B4E40 /* 0E9A9C 7F0B4F6C 35080040 */ ori $t0, (0x01030040 & 0xFFFF) # ori $t0, $t0, 0x40 /* 0E9AA0 7F0B4F70 00801025 */ move $v0, $a0 /* 0E9AA4 7F0B4F74 AC480000 */ sw $t0, ($v0) -/* 0E9AA8 7F0B4F78 3C098006 */ lui $t1, %hi(m) -/* 0E9AAC 7F0B4F7C 8D290820 */ lw $t1, %lo(m)($t1) +/* 0E9AA8 7F0B4F78 3C098006 */ lui $t1, %hi(projectionMatrix) +/* 0E9AAC 7F0B4F7C 8D290820 */ lw $t1, %lo(projectionMatrix)($t1) /* 0E9AB0 7F0B4F80 24840008 */ addiu $a0, $a0, 8 /* 0E9AB4 7F0B4F84 0FC22F3D */ jal sub_GAME_7F08BCF4 /* 0E9AB8 7F0B4F88 AC490004 */ sw $t1, 4($v0) @@ -2593,7 +2561,7 @@ glabel sub_GAME_7F0B4E40 #ifdef NONMATCHING -void sub_GAME_7F0B4F9C(s32 arg0) { +s32 sub_GAME_7F0B4F9C(u8 arg0) { return (dword_CODE_bss_8007FF94 + (arg0 * 4))->unk4; } #else @@ -3287,7 +3255,7 @@ void sub_GAME_7F0B5488(void *arg0, void *arg1) { *arg1 = (f32) (*arg0 * room_data_float2); arg1->unk4 = (f32) (arg0->unk4 * room_data_float2); arg1->unk8 = (f32) (arg0->unk8 * room_data_float2); - matrix_4x4_transform_vector_in_place(get_BONDdata_field_10CC(), arg1, arg0); + matrix_4x4_transform_vector_in_place(currentPlayerGetMatrix10CC(), arg1, arg0); sub_GAME_7F078060(arg1, arg1); if (0.0f < arg1->unk8) { @@ -3304,7 +3272,7 @@ glabel sub_GAME_7F0B5488 /* 0E9FBC 7F0B548C AFBF001C */ sw $ra, 0x1c($sp) /* 0E9FC0 7F0B5490 AFB00018 */ sw $s0, 0x18($sp) /* 0E9FC4 7F0B5494 00A08025 */ move $s0, $a1 -/* 0E9FC8 7F0B5498 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0E9FC8 7F0B5498 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0E9FCC 7F0B549C AFA40020 */ sw $a0, 0x20($sp) /* 0E9FD0 7F0B54A0 8FA60020 */ lw $a2, 0x20($sp) /* 0E9FD4 7F0B54A4 3C038004 */ lui $v1, %hi(room_data_float2) @@ -3375,7 +3343,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 get_BONDdata_field_10CC +/* 0EA098 7F0B5568 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0EA09C 7F0B556C AFA400B0 */ sw $a0, 0xb0($sp) /* 0EA0A0 7F0B5570 AFA200AC */ sw $v0, 0xac($sp) /* 0EA0A4 7F0B5574 241E0001 */ li $fp, 1 @@ -9794,7 +9762,7 @@ f32 sub_GAME_7F0B908C(void) { sp24 = (f32) D_80041404.unk4; sp28 = (f32) ((f32) D_8004140C + (f32) get_video2_settings_txtClipW()); sp20 = (f32) ((f32) D_80041410 + (f32) get_video2_settings_txtClipH()); - pPlayer->unk1118 = (f32) get_video2_settings_ulx(); + pPlayer->unk1118 = (f32) viGetViewLeft(); if (pPlayer->unk1118 < sp2C) { // Node 1 @@ -9807,7 +9775,7 @@ f32 sub_GAME_7F0B908C(void) { pPlayer->unk1118 = sp28; } // Node 4 - pPlayer->unk111C = (f32) get_video2_settings_uly(sp28, &pPlayer); + pPlayer->unk111C = (f32) viGetViewTop(sp28, &pPlayer); if (pPlayer->unk111C < sp24) { // Node 5 @@ -9820,8 +9788,8 @@ f32 sub_GAME_7F0B908C(void) { pPlayer->unk111C = sp20; } // Node 8 - sp1E = get_video2_settings_ulx(sp20, &pPlayer); - pPlayer->unk1120 = (f32) (get_video2_settings_width() + sp1E); + sp1E = viGetViewLeft(sp20, &pPlayer); + pPlayer->unk1120 = (f32) (viGetViewWidth() + sp1E); if (pPlayer->unk1120 < sp2C) { // Node 9 @@ -9834,8 +9802,8 @@ f32 sub_GAME_7F0B908C(void) { pPlayer->unk1120 = sp28; } // Node 12 - sp1E = get_video2_settings_uly(&pPlayer); - pPlayer->unk1124 = (f32) (get_video2_settings_height() + sp1E); + sp1E = viGetViewTop(&pPlayer); + pPlayer->unk1124 = (f32) (viGetViewHeight() + sp1E); if (pPlayer->unk1124 < sp24) { // Node 13 @@ -9883,7 +9851,7 @@ glabel sub_GAME_7F0B908C /* 0EDC24 7F0B90F4 468024A0 */ cvt.s.w $f18, $f4 /* 0EDC28 7F0B90F8 46805420 */ cvt.s.w $f16, $f10 /* 0EDC2C 7F0B90FC 46128180 */ add.s $f6, $f16, $f18 -/* 0EDC30 7F0B9100 0C001145 */ jal get_video2_settings_ulx +/* 0EDC30 7F0B9100 0C001145 */ jal viGetViewLeft /* 0EDC34 7F0B9104 E7A60020 */ swc1 $f6, 0x20($sp) /* 0EDC38 7F0B9108 44824000 */ mtc1 $v0, $f8 /* 0EDC3C 7F0B910C 3C048008 */ lui $a0, %hi(pPlayer) @@ -9909,7 +9877,7 @@ glabel sub_GAME_7F0B908C /* 0EDC88 7F0B9158 00000000 */ nop /* 0EDC8C 7F0B915C E46C1118 */ swc1 $f12, 0x1118($v1) .L7F0B9160: -/* 0EDC90 7F0B9160 0C001149 */ jal get_video2_settings_uly +/* 0EDC90 7F0B9160 0C001149 */ jal viGetViewTop /* 0EDC94 7F0B9164 00000000 */ nop /* 0EDC98 7F0B9168 44822000 */ mtc1 $v0, $f4 /* 0EDC9C 7F0B916C 3C048008 */ lui $a0, %hi(pPlayer) @@ -9935,9 +9903,9 @@ glabel sub_GAME_7F0B908C /* 0EDCE8 7F0B91B8 00000000 */ nop /* 0EDCEC 7F0B91BC E46C111C */ swc1 $f12, 0x111c($v1) .L7F0B91C0: -/* 0EDCF0 7F0B91C0 0C001145 */ jal get_video2_settings_ulx +/* 0EDCF0 7F0B91C0 0C001145 */ jal viGetViewLeft /* 0EDCF4 7F0B91C4 00000000 */ nop -/* 0EDCF8 7F0B91C8 0C001127 */ jal get_video2_settings_width +/* 0EDCF8 7F0B91C8 0C001127 */ jal viGetViewWidth /* 0EDCFC 7F0B91CC A7A2001E */ sh $v0, 0x1e($sp) /* 0EDD00 7F0B91D0 87AA001E */ lh $t2, 0x1e($sp) /* 0EDD04 7F0B91D4 3C048008 */ lui $a0, %hi(pPlayer) @@ -9965,9 +9933,9 @@ glabel sub_GAME_7F0B908C /* 0EDD58 7F0B9228 00000000 */ nop /* 0EDD5C 7F0B922C E46A1120 */ swc1 $f10, 0x1120($v1) .L7F0B9230: -/* 0EDD60 7F0B9230 0C001149 */ jal get_video2_settings_uly +/* 0EDD60 7F0B9230 0C001149 */ jal viGetViewTop /* 0EDD64 7F0B9234 00000000 */ nop -/* 0EDD68 7F0B9238 0C00112B */ jal get_video2_settings_height +/* 0EDD68 7F0B9238 0C00112B */ jal viGetViewHeight /* 0EDD6C 7F0B923C A7A2001E */ sh $v0, 0x1e($sp) /* 0EDD70 7F0B9240 87AD001E */ lh $t5, 0x1e($sp) /* 0EDD74 7F0B9244 3C048008 */ lui $a0, %hi(pPlayer) diff --git a/src/game/bg.h b/src/game/bg.h index d2d2bdeb..9f8f2192 100644 --- a/src/game/bg.h +++ b/src/game/bg.h @@ -42,4 +42,7 @@ typedef struct s_room_info { void bgInitDebugNoticeList(void); +s32 sub_GAME_7F0B8FD0(u8 roomA, u8 roomB); +s32 sub_GAME_7F0B4F9C(u8 room); // u8 not s32 for sub_GAME_7F0B2FE0 + #endif diff --git a/src/game/blood_animation.c b/src/game/blood_animation.c index fa85bfa5..946d7d6b 100644 --- a/src/game/blood_animation.c +++ b/src/game/blood_animation.c @@ -737,15 +737,15 @@ glabel sub_GAME_7F01C670 /* 051384 7F01C854 AC6F0004 */ sw $t7, 4($v1) /* 051388 7F01C858 26100008 */ addiu $s0, $s0, 8 /* 05138C 7F01C85C AFB00040 */ sw $s0, 0x40($sp) -/* 051390 7F01C860 0C001127 */ jal get_video2_settings_width +/* 051390 7F01C860 0C001127 */ jal viGetViewWidth /* 051394 7F01C864 26100008 */ addiu $s0, $s0, 8 -/* 051398 7F01C868 0C001145 */ jal get_video2_settings_ulx +/* 051398 7F01C868 0C001145 */ jal viGetViewLeft /* 05139C 7F01C86C A7A20026 */ sh $v0, 0x26($sp) -/* 0513A0 7F01C870 0C001149 */ jal get_video2_settings_uly +/* 0513A0 7F01C870 0C001149 */ jal viGetViewTop /* 0513A4 7F01C874 A7A20028 */ sh $v0, 0x28($sp) /* 0513A8 7F01C878 00028C00 */ sll $s1, $v0, 0x10 /* 0513AC 7F01C87C 0011C403 */ sra $t8, $s1, 0x10 -/* 0513B0 7F01C880 0C00112B */ jal get_video2_settings_height +/* 0513B0 7F01C880 0C00112B */ jal viGetViewHeight /* 0513B4 7F01C884 03008825 */ move $s1, $t8 /* 0513B8 7F01C888 87B90028 */ lh $t9, 0x28($sp) /* 0513BC 7F01C88C 87A80026 */ lh $t0, 0x26($sp) @@ -762,11 +762,11 @@ glabel sub_GAME_7F01C670 /* 0513E8 7F01C8B8 03214025 */ or $t0, $t9, $at /* 0513EC 7F01C8BC 000C6B00 */ sll $t5, $t4, 0xc /* 0513F0 7F01C8C0 010D4825 */ or $t1, $t0, $t5 -/* 0513F4 7F01C8C4 0C001145 */ jal get_video2_settings_ulx +/* 0513F4 7F01C8C4 0C001145 */ jal viGetViewLeft /* 0513F8 7F01C8C8 AD490000 */ sw $t1, ($t2) /* 0513FC 7F01C8CC 00028C00 */ sll $s1, $v0, 0x10 /* 051400 7F01C8D0 00115C03 */ sra $t3, $s1, 0x10 -/* 051404 7F01C8D4 0C001149 */ jal get_video2_settings_uly +/* 051404 7F01C8D4 0C001149 */ jal viGetViewTop /* 051408 7F01C8D8 01608825 */ move $s1, $t3 /* 05140C 7F01C8DC 00117880 */ sll $t7, $s1, 2 /* 051410 7F01C8E0 8FAD0040 */ lw $t5, 0x40($sp) @@ -785,11 +785,11 @@ glabel sub_GAME_7F01C670 /* 051444 7F01C914 3C0AB300 */ lui $t2, 0xb300 /* 051448 7F01C918 AC8A0000 */ sw $t2, ($a0) /* 05144C 7F01C91C AFA40038 */ sw $a0, 0x38($sp) -/* 051450 7F01C920 0C001127 */ jal get_video2_settings_width +/* 051450 7F01C920 0C001127 */ jal viGetViewWidth /* 051454 7F01C924 26100008 */ addiu $s0, $s0, 8 /* 051458 7F01C928 00028C00 */ sll $s1, $v0, 0x10 /* 05145C 7F01C92C 00115C03 */ sra $t3, $s1, 0x10 -/* 051460 7F01C930 0C00112B */ jal get_video2_settings_height +/* 051460 7F01C930 0C00112B */ jal viGetViewHeight /* 051464 7F01C934 01608825 */ move $s1, $t3 /* 051468 7F01C938 3C0C0001 */ lui $t4, (0x00014000 >> 16) # lui $t4, 1 /* 05146C 7F01C93C 358C4000 */ ori $t4, (0x00014000 & 0xFFFF) # ori $t4, $t4, 0x4000 diff --git a/src/game/bond.c b/src/game/bond.c index f96494ff..4f47b044 100644 --- a/src/game/bond.c +++ b/src/game/bond.c @@ -8,37 +8,13 @@ #include "game/bondwalk.h" // bss -//CODE.bss:80079940 -f32 flt_CODE_bss_80079940; -//CODE.bss:80079944 -f32 flt_CODE_bss_80079944; -//CODE.bss:80079948 -f32 flt_CODE_bss_80079948; -//CODE.bss:8007994C +struct coord flt_CODE_bss_80079940; f32 flt_CODE_bss_8007994C; -//CODE.bss:80079950 -f32 flt_CODE_bss_80079950; -//CODE.bss:80079954 -f32 flt_CODE_bss_80079954; -//CODE.bss:80079958 -f32 flt_CODE_bss_80079958; -//CODE.bss:8007995C +struct coord flt_CODE_bss_80079950; f32 flt_CODE_bss_8007995C; -//CODE.bss:80079960 -f32 flt_CODE_bss_80079960; -//CODE.bss:80079964 -f32 flt_CODE_bss_80079964; -//CODE.bss:80079968 -f32 flt_CODE_bss_80079968; -//CODE.bss:8007996C +struct coord flt_CODE_bss_80079960; f32 flt_CODE_bss_8007996C; -//CODE.bss:80079970 -f32 flt_CODE_bss_80079970; -//CODE.bss:80079974 -f32 flt_CODE_bss_80079974; -//CODE.bss:80079978 -f32 flt_CODE_bss_80079978; -//CODE.bss:8007997C +struct coord flt_CODE_bss_80079970; f32 flt_CODE_bss_8007997C; //CODE.bss:80079980 f32 flt_CODE_bss_80079980; @@ -481,693 +457,142 @@ void nullsub_75(void) return; } -void set_BONDdata_screensize(f32 width, f32 height) +void currentPlayerSetScreenSize(f32 width, f32 height) { pPlayer->c_screenwidth = width; pPlayer->c_screenheight = height; - pPlayer->c_halfwidth = (f32) (width * 0.5f); - pPlayer->c_halfheight = (f32) (height * 0.5f); + pPlayer->c_halfwidth = width * 0.5f; + pPlayer->c_halfheight = height * 0.5f; } -void *set_ulx_uly(f32 ulx, f32 uly) +void currentPlayerSetScreenPosition(f32 left, f32 top) { - pPlayer->c_screenleft = ulx; - pPlayer->c_screentop = uly; + pPlayer->c_screenleft = left; + pPlayer->c_screentop = top; } -void sub_GAME_7F077C30(f32 arg0, f32 arg1, f32 arg2) +void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect) { - pPlayer->c_perspnear = arg0; - pPlayer->c_perspfovy = arg1; - pPlayer->c_perspaspect = arg2; + pPlayer->c_perspnear = near; + pPlayer->c_perspfovy = fovy; + pPlayer->c_perspaspect = aspect; } - - - - - -#ifdef NONMATCHING -void sub_GAME_7F077C5C(void) +#define DEG2RAD(x) ((x * 3.1415927f) / 360.0f) +float sinf(float); +float cosf(float); +void currentPlayerSetCameraScale(void) { - f32 sp34; - f32 sp30; - f32 sp2C; - f32 temp_f14; - f32 temp_f16; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; + f32 fVar4; + f32 tmp; + f32 fVar5; + f32 fVar2; - sp2C = sinf((pPlayer->c_perspfovy * D_80054FA0) / 360.0f); - pPlayer->c_scaley = (f32) (sp2C / (cosf((pPlayer->c_perspfovy * D_80054FA0) / 360.0f) * pPlayer->c_halfheight)); - pPlayer->c_scalex = (f32) (((pPlayer->c_scaley * pPlayer->c_perspaspect) * pPlayer->c_halfheight) / pPlayer->c_halfwidth); - pPlayer->c_recipscalex = (f32) (1.0f / pPlayer->c_scalex); - pPlayer->c_recipscaley = (f32) (1.0f / pPlayer->c_scaley); - pPlayer->c_scalelod = (f32) pPlayer->c_scaley; - sp2C = sinf(D_80054FA4); - pPlayer->c_scalelod60 = (f32) (sp2C / (cosf(D_80054FA8) * 120.0f)); - pPlayer->c_lodscalez = (f32) (pPlayer->c_scalelod / pPlayer->c_scalelod60); - temp_f2 = pPlayer->c_lodscalez * 65536.0f; - if (4294967296.0f < temp_f2) - { - pPlayer->c_lodscalezu32 = -1U; - } - else - { - pPlayer->c_lodscalezu32 = (u32) temp_f2; - } - temp_f14 = pPlayer->c_halfheight * pPlayer->c_scaley; - sp30 = temp_f14; - temp_f2_2 = 1.0f / sqrtf((temp_f14 * temp_f14) + 1.0f, temp_f14); - (pPlayer->c_cameratopnorm).x = 0.0f; - (pPlayer->c_cameratopnorm).y = temp_f2_2; - (pPlayer->c_cameratopnorm).z = (f32) (temp_f14 * temp_f2_2); - temp_f16 = -pPlayer->c_halfwidth * pPlayer->c_scalex; - sp34 = temp_f16; - temp_f2_3 = 1.0f / sqrtf((temp_f16 * temp_f16) + 1.0f, temp_f14); - (pPlayer->c_cameraleftnorm).x = (f32) -temp_f2_3; - (pPlayer->c_cameraleftnorm).y = 0.0f; - (pPlayer->c_cameraleftnorm).z = (f32) (-temp_f16 * temp_f2_3); + pPlayer->c_scaley = sinf(DEG2RAD(pPlayer->c_perspfovy)) / (cosf(DEG2RAD(pPlayer->c_perspfovy)) * pPlayer->c_halfheight); + pPlayer->c_scalex = (pPlayer->c_scaley * pPlayer->c_perspaspect * pPlayer->c_halfheight) / pPlayer->c_halfwidth; + + pPlayer->c_recipscalex = 1.0f / pPlayer->c_scalex; + pPlayer->c_recipscaley = 1.0f / pPlayer->c_scaley; + + pPlayer->c_scalelod = pPlayer->c_scaley; + pPlayer->c_scalelod60 = sinf(0.52359879f/*DEG2RAD(30)*/) / (cosf(0.52359879f/*DEG2RAD(30)*/) * 120.0f); + pPlayer->c_lodscalez = pPlayer->c_scalelod / pPlayer->c_scalelod60; + tmp = (pPlayer->c_lodscalez * 65536.0f); + + if (tmp > 4294967296.0f) { + pPlayer->c_lodscalezu32 = -1; + } else { + pPlayer->c_lodscalezu32 = tmp; + } + + fVar2 = pPlayer->c_halfheight * pPlayer->c_scaley; + fVar4 = 1.0f / sqrtf(fVar2 * fVar2 + 1.0f); + pPlayer->c_cameratopnorm.x = 0; + pPlayer->c_cameratopnorm.y = fVar4; + pPlayer->c_cameratopnorm.z = fVar2 * fVar4; + + fVar5 = -pPlayer->c_halfwidth * pPlayer->c_scalex; + fVar4 = 1.0f / sqrtf(fVar5 * fVar5 + 1.0f); + pPlayer->c_cameraleftnorm.x = -fVar4; + pPlayer->c_cameraleftnorm.y = 0; + pPlayer->c_cameraleftnorm.z = -fVar5 * fVar4; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80054FA0 -.word 0x40490fdb /*3.1415927*/ -glabel D_80054FA4 -.word 0x3f060a92 /*0.52359879*/ -glabel D_80054FA8 -.word 0x3f060a92 /*0.52359879*/ -.text -glabel sub_GAME_7F077C5C -/* 0AC78C 7F077C5C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0AC790 7F077C60 AFB00020 */ sw $s0, 0x20($sp) -/* 0AC794 7F077C64 3C108008 */ lui $s0, %hi(pPlayer) -/* 0AC798 7F077C68 2610A0B0 */ addiu $s0, %lo(pPlayer) # addiu $s0, $s0, -0x5f50 -/* 0AC79C 7F077C6C 8E0E0000 */ lw $t6, ($s0) -/* 0AC7A0 7F077C70 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0AC7A4 7F077C74 AFBF0024 */ sw $ra, 0x24($sp) -/* 0AC7A8 7F077C78 3C018005 */ lui $at, %hi(D_80054FA0) -/* 0AC7AC 7F077C7C C4344FA0 */ lwc1 $f20, %lo(D_80054FA0)($at) -/* 0AC7B0 7F077C80 C5C410A4 */ lwc1 $f4, 0x10a4($t6) -/* 0AC7B4 7F077C84 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0AC7B8 7F077C88 44814000 */ mtc1 $at, $f8 -/* 0AC7BC 7F077C8C 46142182 */ mul.s $f6, $f4, $f20 -/* 0AC7C0 7F077C90 0FC15FAB */ jal sinf -/* 0AC7C4 7F077C94 46083303 */ div.s $f12, $f6, $f8 -/* 0AC7C8 7F077C98 8E0F0000 */ lw $t7, ($s0) -/* 0AC7CC 7F077C9C E7A0002C */ swc1 $f0, 0x2c($sp) -/* 0AC7D0 7F077CA0 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0AC7D4 7F077CA4 C5EA10A4 */ lwc1 $f10, 0x10a4($t7) -/* 0AC7D8 7F077CA8 44812000 */ mtc1 $at, $f4 -/* 0AC7DC 7F077CAC 46145482 */ mul.s $f18, $f10, $f20 -/* 0AC7E0 7F077CB0 0FC15FA8 */ jal cosf -/* 0AC7E4 7F077CB4 46049303 */ div.s $f12, $f18, $f4 -/* 0AC7E8 7F077CB8 8E020000 */ lw $v0, ($s0) -/* 0AC7EC 7F077CBC C7A6002C */ lwc1 $f6, 0x2c($sp) -/* 0AC7F0 7F077CC0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AC7F4 7F077CC4 C44810B0 */ lwc1 $f8, 0x10b0($v0) -/* 0AC7F8 7F077CC8 4481A000 */ mtc1 $at, $f20 -/* 0AC7FC 7F077CCC 3C018005 */ lui $at, %hi(D_80054FA4) -/* 0AC800 7F077CD0 46080282 */ mul.s $f10, $f0, $f8 -/* 0AC804 7F077CD4 460A3483 */ div.s $f18, $f6, $f10 -/* 0AC808 7F077CD8 E45210B8 */ swc1 $f18, 0x10b8($v0) -/* 0AC80C 7F077CDC 8E020000 */ lw $v0, ($s0) -/* 0AC810 7F077CE0 C44410B8 */ lwc1 $f4, 0x10b8($v0) -/* 0AC814 7F077CE4 C44810A8 */ lwc1 $f8, 0x10a8($v0) -/* 0AC818 7F077CE8 C44A10B0 */ lwc1 $f10, 0x10b0($v0) -/* 0AC81C 7F077CEC 46082182 */ mul.s $f6, $f4, $f8 -/* 0AC820 7F077CF0 C44410AC */ lwc1 $f4, 0x10ac($v0) -/* 0AC824 7F077CF4 460A3482 */ mul.s $f18, $f6, $f10 -/* 0AC828 7F077CF8 46049203 */ div.s $f8, $f18, $f4 -/* 0AC82C 7F077CFC E44810B4 */ swc1 $f8, 0x10b4($v0) -/* 0AC830 7F077D00 8E020000 */ lw $v0, ($s0) -/* 0AC834 7F077D04 C44610B4 */ lwc1 $f6, 0x10b4($v0) -/* 0AC838 7F077D08 4606A283 */ div.s $f10, $f20, $f6 -/* 0AC83C 7F077D0C E44A10BC */ swc1 $f10, 0x10bc($v0) -/* 0AC840 7F077D10 8E020000 */ lw $v0, ($s0) -/* 0AC844 7F077D14 C45210B8 */ lwc1 $f18, 0x10b8($v0) -/* 0AC848 7F077D18 4612A103 */ div.s $f4, $f20, $f18 -/* 0AC84C 7F077D1C E44410C0 */ swc1 $f4, 0x10c0($v0) -/* 0AC850 7F077D20 8E020000 */ lw $v0, ($s0) -/* 0AC854 7F077D24 C44810B8 */ lwc1 $f8, 0x10b8($v0) -/* 0AC858 7F077D28 E44810F4 */ swc1 $f8, 0x10f4($v0) -/* 0AC85C 7F077D2C 0FC15FAB */ jal sinf -/* 0AC860 7F077D30 C42C4FA4 */ lwc1 $f12, %lo(D_80054FA4)($at) -/* 0AC864 7F077D34 3C018005 */ lui $at, %hi(D_80054FA8) -/* 0AC868 7F077D38 C42C4FA8 */ lwc1 $f12, %lo(D_80054FA8)($at) -/* 0AC86C 7F077D3C 0FC15FA8 */ jal cosf -/* 0AC870 7F077D40 E7A0002C */ swc1 $f0, 0x2c($sp) -/* 0AC874 7F077D44 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 0AC878 7F077D48 44815000 */ mtc1 $at, $f10 -/* 0AC87C 7F077D4C C7A6002C */ lwc1 $f6, 0x2c($sp) -/* 0AC880 7F077D50 8E180000 */ lw $t8, ($s0) -/* 0AC884 7F077D54 460A0482 */ mul.s $f18, $f0, $f10 -/* 0AC888 7F077D58 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 0AC88C 7F077D5C 2419FFFF */ li $t9, -1 -/* 0AC890 7F077D60 24090001 */ li $t1, 1 -/* 0AC894 7F077D64 46123103 */ div.s $f4, $f6, $f18 -/* 0AC898 7F077D68 E70410F0 */ swc1 $f4, 0x10f0($t8) -/* 0AC89C 7F077D6C 8E020000 */ lw $v0, ($s0) -/* 0AC8A0 7F077D70 44812000 */ mtc1 $at, $f4 -/* 0AC8A4 7F077D74 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0AC8A8 7F077D78 C44810F4 */ lwc1 $f8, 0x10f4($v0) -/* 0AC8AC 7F077D7C C44A10F0 */ lwc1 $f10, 0x10f0($v0) -/* 0AC8B0 7F077D80 460A4183 */ div.s $f6, $f8, $f10 -/* 0AC8B4 7F077D84 44814000 */ mtc1 $at, $f8 -/* 0AC8B8 7F077D88 E44610F8 */ swc1 $f6, 0x10f8($v0) -/* 0AC8BC 7F077D8C 8E020000 */ lw $v0, ($s0) -/* 0AC8C0 7F077D90 C45210F8 */ lwc1 $f18, 0x10f8($v0) -/* 0AC8C4 7F077D94 46049082 */ mul.s $f2, $f18, $f4 -/* 0AC8C8 7F077D98 4602403C */ c.lt.s $f8, $f2 -/* 0AC8CC 7F077D9C 00000000 */ nop -/* 0AC8D0 7F077DA0 45020004 */ bc1fl .L7F077DB4 -/* 0AC8D4 7F077DA4 4448F800 */ cfc1 $t0, $31 -/* 0AC8D8 7F077DA8 10000022 */ b .L7F077E34 -/* 0AC8DC 7F077DAC AC5910FC */ sw $t9, 0x10fc($v0) -/* 0AC8E0 7F077DB0 4448F800 */ cfc1 $t0, $31 -.L7F077DB4: -/* 0AC8E4 7F077DB4 44C9F800 */ ctc1 $t1, $31 -/* 0AC8E8 7F077DB8 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 0AC8EC 7F077DBC 460012A4 */ cvt.w.s $f10, $f2 -/* 0AC8F0 7F077DC0 4449F800 */ cfc1 $t1, $31 -/* 0AC8F4 7F077DC4 00000000 */ nop -/* 0AC8F8 7F077DC8 31290078 */ andi $t1, $t1, 0x78 -/* 0AC8FC 7F077DCC 51200013 */ beql $t1, $zero, .L7F077E1C -/* 0AC900 7F077DD0 44095000 */ mfc1 $t1, $f10 -/* 0AC904 7F077DD4 44815000 */ mtc1 $at, $f10 -/* 0AC908 7F077DD8 24090001 */ li $t1, 1 -/* 0AC90C 7F077DDC 460A1281 */ sub.s $f10, $f2, $f10 -/* 0AC910 7F077DE0 44C9F800 */ ctc1 $t1, $31 -/* 0AC914 7F077DE4 00000000 */ nop -/* 0AC918 7F077DE8 460052A4 */ cvt.w.s $f10, $f10 -/* 0AC91C 7F077DEC 4449F800 */ cfc1 $t1, $31 -/* 0AC920 7F077DF0 00000000 */ nop -/* 0AC924 7F077DF4 31290078 */ andi $t1, $t1, 0x78 -/* 0AC928 7F077DF8 15200005 */ bnez $t1, .L7F077E10 -/* 0AC92C 7F077DFC 00000000 */ nop -/* 0AC930 7F077E00 44095000 */ mfc1 $t1, $f10 -/* 0AC934 7F077E04 3C018000 */ lui $at, 0x8000 -/* 0AC938 7F077E08 10000007 */ b .L7F077E28 -/* 0AC93C 7F077E0C 01214825 */ or $t1, $t1, $at -.L7F077E10: -/* 0AC940 7F077E10 10000005 */ b .L7F077E28 -/* 0AC944 7F077E14 2409FFFF */ li $t1, -1 -/* 0AC948 7F077E18 44095000 */ mfc1 $t1, $f10 -.L7F077E1C: -/* 0AC94C 7F077E1C 00000000 */ nop -/* 0AC950 7F077E20 0520FFFB */ bltz $t1, .L7F077E10 -/* 0AC954 7F077E24 00000000 */ nop -.L7F077E28: -/* 0AC958 7F077E28 44C8F800 */ ctc1 $t0, $31 -/* 0AC95C 7F077E2C AC4910FC */ sw $t1, 0x10fc($v0) -/* 0AC960 7F077E30 00000000 */ nop -.L7F077E34: -/* 0AC964 7F077E34 8E020000 */ lw $v0, ($s0) -/* 0AC968 7F077E38 C44610B0 */ lwc1 $f6, 0x10b0($v0) -/* 0AC96C 7F077E3C C45210B8 */ lwc1 $f18, 0x10b8($v0) -/* 0AC970 7F077E40 46123382 */ mul.s $f14, $f6, $f18 -/* 0AC974 7F077E44 00000000 */ nop -/* 0AC978 7F077E48 460E7102 */ mul.s $f4, $f14, $f14 -/* 0AC97C 7F077E4C E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0AC980 7F077E50 0C007DF8 */ jal sqrtf -/* 0AC984 7F077E54 46142300 */ add.s $f12, $f4, $f20 -/* 0AC988 7F077E58 4600A083 */ div.s $f2, $f20, $f0 -/* 0AC98C 7F077E5C 44804000 */ mtc1 $zero, $f8 -/* 0AC990 7F077E60 8E0A0000 */ lw $t2, ($s0) -/* 0AC994 7F077E64 C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0AC998 7F077E68 E5481100 */ swc1 $f8, 0x1100($t2) -/* 0AC99C 7F077E6C 8E0B0000 */ lw $t3, ($s0) -/* 0AC9A0 7F077E70 46027282 */ mul.s $f10, $f14, $f2 -/* 0AC9A4 7F077E74 E5621104 */ swc1 $f2, 0x1104($t3) -/* 0AC9A8 7F077E78 8E0C0000 */ lw $t4, ($s0) -/* 0AC9AC 7F077E7C E58A1108 */ swc1 $f10, 0x1108($t4) -/* 0AC9B0 7F077E80 8E020000 */ lw $v0, ($s0) -/* 0AC9B4 7F077E84 C44610AC */ lwc1 $f6, 0x10ac($v0) -/* 0AC9B8 7F077E88 C44410B4 */ lwc1 $f4, 0x10b4($v0) -/* 0AC9BC 7F077E8C 46003487 */ neg.s $f18, $f6 -/* 0AC9C0 7F077E90 46049402 */ mul.s $f16, $f18, $f4 -/* 0AC9C4 7F077E94 00000000 */ nop -/* 0AC9C8 7F077E98 46108202 */ mul.s $f8, $f16, $f16 -/* 0AC9CC 7F077E9C E7B00034 */ swc1 $f16, 0x34($sp) -/* 0AC9D0 7F077EA0 0C007DF8 */ jal sqrtf -/* 0AC9D4 7F077EA4 46144300 */ add.s $f12, $f8, $f20 -/* 0AC9D8 7F077EA8 4600A083 */ div.s $f2, $f20, $f0 -/* 0AC9DC 7F077EAC C7B00034 */ lwc1 $f16, 0x34($sp) -/* 0AC9E0 7F077EB0 8E0D0000 */ lw $t5, ($s0) -/* 0AC9E4 7F077EB4 44803000 */ mtc1 $zero, $f6 -/* 0AC9E8 7F077EB8 46008487 */ neg.s $f18, $f16 -/* 0AC9EC 7F077EBC 46001287 */ neg.s $f10, $f2 -/* 0AC9F0 7F077EC0 46029102 */ mul.s $f4, $f18, $f2 -/* 0AC9F4 7F077EC4 E5AA110C */ swc1 $f10, 0x110c($t5) -/* 0AC9F8 7F077EC8 8E0E0000 */ lw $t6, ($s0) -/* 0AC9FC 7F077ECC E5C61110 */ swc1 $f6, 0x1110($t6) -/* 0ACA00 7F077ED0 8E0F0000 */ lw $t7, ($s0) -/* 0ACA04 7F077ED4 E5E41114 */ swc1 $f4, 0x1114($t7) -/* 0ACA08 7F077ED8 8FBF0024 */ lw $ra, 0x24($sp) -/* 0ACA0C 7F077EDC 8FB00020 */ lw $s0, 0x20($sp) -/* 0ACA10 7F077EE0 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0ACA14 7F077EE4 03E00008 */ jr $ra -/* 0ACA18 7F077EE8 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F077EEC(void *arg0, void *arg1, f32 arg2) { - f32 sp20; - f32 temp_f14; - f32 temp_f16; - ? temp_ret; - f32 temp_f2; - - // Node 0 - temp_f14 = ((pPlayer->c_halfheight - (arg0->unk4 - pPlayer->c_screentop)) * pPlayer->c_scaley); - temp_f16 = (((*arg0 - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex); - sp20 = temp_f16; - temp_ret = sqrtf((((temp_f16 * temp_f16) + (temp_f14 * temp_f14)) + (-1.0f * -1.0f)), temp_f14); - temp_f2 = (arg2 / temp_ret); - *arg1 = (f32) (temp_f16 * temp_f2); - arg1->unk4 = (f32) (sp1C * temp_f2); - arg1->unk8 = (f32) (-1.0f * temp_f2); - return temp_ret; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F077EEC -/* 0ACA1C 7F077EEC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0ACA20 7F077EF0 3C028008 */ lui $v0, %hi(pPlayer) -/* 0ACA24 7F077EF4 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0ACA28 7F077EF8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0ACA2C 7F077EFC AFA60030 */ sw $a2, 0x30($sp) -/* 0ACA30 7F077F00 C4840004 */ lwc1 $f4, 4($a0) -/* 0ACA34 7F077F04 C446109C */ lwc1 $f6, 0x109c($v0) -/* 0ACA38 7F077F08 C44A10B0 */ lwc1 $f10, 0x10b0($v0) -/* 0ACA3C 7F077F0C 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0ACA40 7F077F10 46062201 */ sub.s $f8, $f4, $f6 -/* 0ACA44 7F077F14 C4860000 */ lwc1 $f6, ($a0) -/* 0ACA48 7F077F18 C44410B8 */ lwc1 $f4, 0x10b8($v0) -/* 0ACA4C 7F077F1C 44810000 */ mtc1 $at, $f0 -/* 0ACA50 7F077F20 46085481 */ sub.s $f18, $f10, $f8 -/* 0ACA54 7F077F24 C44A1098 */ lwc1 $f10, 0x1098($v0) -/* 0ACA58 7F077F28 46049382 */ mul.s $f14, $f18, $f4 -/* 0ACA5C 7F077F2C 460A3201 */ sub.s $f8, $f6, $f10 -/* 0ACA60 7F077F30 C45210AC */ lwc1 $f18, 0x10ac($v0) -/* 0ACA64 7F077F34 C44610B4 */ lwc1 $f6, 0x10b4($v0) -/* 0ACA68 7F077F38 AFA5002C */ sw $a1, 0x2c($sp) -/* 0ACA6C 7F077F3C 46124101 */ sub.s $f4, $f8, $f18 -/* 0ACA70 7F077F40 E7AE001C */ swc1 $f14, 0x1c($sp) -/* 0ACA74 7F077F44 46062402 */ mul.s $f16, $f4, $f6 -/* 0ACA78 7F077F48 00000000 */ nop -/* 0ACA7C 7F077F4C 46108282 */ mul.s $f10, $f16, $f16 -/* 0ACA80 7F077F50 E7B00020 */ swc1 $f16, 0x20($sp) -/* 0ACA84 7F077F54 460E7202 */ mul.s $f8, $f14, $f14 -/* 0ACA88 7F077F58 46085480 */ add.s $f18, $f10, $f8 -/* 0ACA8C 7F077F5C 46000102 */ mul.s $f4, $f0, $f0 -/* 0ACA90 7F077F60 0C007DF8 */ jal sqrtf -/* 0ACA94 7F077F64 46049300 */ add.s $f12, $f18, $f4 -/* 0ACA98 7F077F68 C7A60030 */ lwc1 $f6, 0x30($sp) -/* 0ACA9C 7F077F6C C7B00020 */ lwc1 $f16, 0x20($sp) -/* 0ACAA0 7F077F70 C7AE001C */ lwc1 $f14, 0x1c($sp) -/* 0ACAA4 7F077F74 46003083 */ div.s $f2, $f6, $f0 -/* 0ACAA8 7F077F78 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0ACAAC 7F077F7C 44819000 */ mtc1 $at, $f18 -/* 0ACAB0 7F077F80 8FA5002C */ lw $a1, 0x2c($sp) -/* 0ACAB4 7F077F84 46028282 */ mul.s $f10, $f16, $f2 -/* 0ACAB8 7F077F88 00000000 */ nop -/* 0ACABC 7F077F8C 46027202 */ mul.s $f8, $f14, $f2 -/* 0ACAC0 7F077F90 00000000 */ nop -/* 0ACAC4 7F077F94 46029102 */ mul.s $f4, $f18, $f2 -/* 0ACAC8 7F077F98 E4AA0000 */ swc1 $f10, ($a1) -/* 0ACACC 7F077F9C E4A80004 */ swc1 $f8, 4($a1) -/* 0ACAD0 7F077FA0 E4A40008 */ swc1 $f4, 8($a1) -/* 0ACAD4 7F077FA4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0ACAD8 7F077FA8 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0ACADC 7F077FAC 03E00008 */ jr $ra -/* 0ACAE0 7F077FB0 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F077FB4(void *arg0, s32 arg1, void *arg2) { - // Node 0 - arg2->unk4 = (f32) ((arg0->unk4 * arg1) * pPlayer->c_scaley); - *arg2 = (f32) ((*arg0 * arg1) * pPlayer->c_scalex); - return &pPlayer; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F077FB4 -/* 0ACAE4 7F077FB4 44856000 */ mtc1 $a1, $f12 -/* 0ACAE8 7F077FB8 C4840004 */ lwc1 $f4, 4($a0) -/* 0ACAEC 7F077FBC 3C028008 */ lui $v0, %hi(pPlayer) -/* 0ACAF0 7F077FC0 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0ACAF4 7F077FC4 460C2182 */ mul.s $f6, $f4, $f12 -/* 0ACAF8 7F077FC8 8C4E0000 */ lw $t6, ($v0) -/* 0ACAFC 7F077FCC C5C810B8 */ lwc1 $f8, 0x10b8($t6) -/* 0ACB00 7F077FD0 46083282 */ mul.s $f10, $f6, $f8 -/* 0ACB04 7F077FD4 E4CA0004 */ swc1 $f10, 4($a2) -/* 0ACB08 7F077FD8 C4900000 */ lwc1 $f16, ($a0) -/* 0ACB0C 7F077FDC 8C4F0000 */ lw $t7, ($v0) -/* 0ACB10 7F077FE0 460C8482 */ mul.s $f18, $f16, $f12 -/* 0ACB14 7F077FE4 C5E410B4 */ lwc1 $f4, 0x10b4($t7) -/* 0ACB18 7F077FE8 46049182 */ mul.s $f6, $f18, $f4 -/* 0ACB1C 7F077FEC 03E00008 */ jr $ra -/* 0ACB20 7F077FF0 E4C60000 */ swc1 $f6, ($a2) -) -#endif - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F077FF4(void *arg0, void *arg1) { - f32 temp_f0; - - // Node 0 - temp_f0 = (1.0f / arg0->unk8); - arg1->unk4 = (f32) (((arg0->unk4 * temp_f0) * pPlayer->c_recipscaley) + (pPlayer->c_screentop + pPlayer->c_halfheight)); - *arg1 = (f32) ((pPlayer->c_screenleft + pPlayer->c_halfwidth) - ((*arg0 * temp_f0) * pPlayer->c_recipscalex)); - return pPlayer; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F077FF4 -/* 0ACB24 7F077FF4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0ACB28 7F077FF8 44812000 */ mtc1 $at, $f4 -/* 0ACB2C 7F077FFC C4860008 */ lwc1 $f6, 8($a0) -/* 0ACB30 7F078000 C4880004 */ lwc1 $f8, 4($a0) -/* 0ACB34 7F078004 3C038008 */ lui $v1, %hi(pPlayer) -/* 0ACB38 7F078008 46062003 */ div.s $f0, $f4, $f6 -/* 0ACB3C 7F07800C 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0ACB40 7F078010 8C620000 */ lw $v0, ($v1) -/* 0ACB44 7F078014 C45010C0 */ lwc1 $f16, 0x10c0($v0) -/* 0ACB48 7F078018 C444109C */ lwc1 $f4, 0x109c($v0) -/* 0ACB4C 7F07801C C44610B0 */ lwc1 $f6, 0x10b0($v0) -/* 0ACB50 7F078020 46004282 */ mul.s $f10, $f8, $f0 -/* 0ACB54 7F078024 46062200 */ add.s $f8, $f4, $f6 -/* 0ACB58 7F078028 46105482 */ mul.s $f18, $f10, $f16 -/* 0ACB5C 7F07802C 46089280 */ add.s $f10, $f18, $f8 -/* 0ACB60 7F078030 E4AA0004 */ swc1 $f10, 4($a1) -/* 0ACB64 7F078034 C4920000 */ lwc1 $f18, ($a0) -/* 0ACB68 7F078038 8C620000 */ lw $v0, ($v1) -/* 0ACB6C 7F07803C 46009202 */ mul.s $f8, $f18, $f0 -/* 0ACB70 7F078040 C4501098 */ lwc1 $f16, 0x1098($v0) -/* 0ACB74 7F078044 C44410AC */ lwc1 $f4, 0x10ac($v0) -/* 0ACB78 7F078048 C44A10BC */ lwc1 $f10, 0x10bc($v0) -/* 0ACB7C 7F07804C 46048180 */ add.s $f6, $f16, $f4 -/* 0ACB80 7F078050 460A4402 */ mul.s $f16, $f8, $f10 -/* 0ACB84 7F078054 46103101 */ sub.s $f4, $f6, $f16 -/* 0ACB88 7F078058 03E00008 */ jr $ra -/* 0ACB8C 7F07805C E4A40000 */ swc1 $f4, ($a1) -) -#endif - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F078060(void *arg0, void *arg1) { - f32 phi_f2; - - // Node 0 - if (0.0f == arg0->unk8) - { - // Node 1 - phi_f2 = *(void *)0x80050000; - } - else - { - // Node 2 - phi_f2 = (1.0f / arg0->unk8); - } - // Node 3 - arg1->unk4 = (f32) (((arg0->unk4 * phi_f2) * pPlayer->c_recipscaley) + (pPlayer->c_screentop + pPlayer->c_halfheight)); - *arg1 = (f32) ((pPlayer->c_screenleft + pPlayer->c_halfwidth) - ((*arg0 * phi_f2) * pPlayer->c_recipscalex)); - return pPlayer; +void sub_GAME_7F077EEC(struct coord *in, struct coord *out, f32 value) { + f32 norm; + f32 x; + f32 y; + f32 z; + y = (pPlayer->c_halfheight - (in->y - pPlayer->c_screentop)) * pPlayer->c_scaley; + x = ((in->x - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex; + z = -1.0f; + norm = value / sqrtf((x * x) + (y * y) + (z * z)); + out->x = (x * norm); + out->y = (y * norm); + out->z = (-1.0f * norm); } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80054FAC -.word 0xe0ad78ec /*-1.0e20*/ -.text -glabel sub_GAME_7F078060 -/* 0ACB90 7F078060 C4800008 */ lwc1 $f0, 8($a0) -/* 0ACB94 7F078064 44802000 */ mtc1 $zero, $f4 -/* 0ACB98 7F078068 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0ACB9C 7F07806C 46002032 */ c.eq.s $f4, $f0 -/* 0ACBA0 7F078070 00000000 */ nop -/* 0ACBA4 7F078074 45020005 */ bc1fl .L7F07808C -/* 0ACBA8 7F078078 44813000 */ mtc1 $at, $f6 -/* 0ACBAC 7F07807C 3C018005 */ lui $at, %hi(D_80054FAC) -/* 0ACBB0 7F078080 10000004 */ b .L7F078094 -/* 0ACBB4 7F078084 C4224FAC */ lwc1 $f2, %lo(D_80054FAC)($at) -/* 0ACBB8 7F078088 44813000 */ mtc1 $at, $f6 -.L7F07808C: -/* 0ACBBC 7F07808C 00000000 */ nop -/* 0ACBC0 7F078090 46003083 */ div.s $f2, $f6, $f0 -.L7F078094: -/* 0ACBC4 7F078094 C4880004 */ lwc1 $f8, 4($a0) -/* 0ACBC8 7F078098 3C038008 */ lui $v1, %hi(pPlayer) -/* 0ACBCC 7F07809C 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0ACBD0 7F0780A0 46024282 */ mul.s $f10, $f8, $f2 -/* 0ACBD4 7F0780A4 8C620000 */ lw $v0, ($v1) -/* 0ACBD8 7F0780A8 C45010C0 */ lwc1 $f16, 0x10c0($v0) -/* 0ACBDC 7F0780AC C444109C */ lwc1 $f4, 0x109c($v0) -/* 0ACBE0 7F0780B0 C44610B0 */ lwc1 $f6, 0x10b0($v0) -/* 0ACBE4 7F0780B4 46105482 */ mul.s $f18, $f10, $f16 -/* 0ACBE8 7F0780B8 46062200 */ add.s $f8, $f4, $f6 -/* 0ACBEC 7F0780BC 46089280 */ add.s $f10, $f18, $f8 -/* 0ACBF0 7F0780C0 E4AA0004 */ swc1 $f10, 4($a1) -/* 0ACBF4 7F0780C4 C4920000 */ lwc1 $f18, ($a0) -/* 0ACBF8 7F0780C8 8C620000 */ lw $v0, ($v1) -/* 0ACBFC 7F0780CC 46029202 */ mul.s $f8, $f18, $f2 -/* 0ACC00 7F0780D0 C4501098 */ lwc1 $f16, 0x1098($v0) -/* 0ACC04 7F0780D4 C44410AC */ lwc1 $f4, 0x10ac($v0) -/* 0ACC08 7F0780D8 C44A10BC */ lwc1 $f10, 0x10bc($v0) -/* 0ACC0C 7F0780DC 46048180 */ add.s $f6, $f16, $f4 -/* 0ACC10 7F0780E0 460A4402 */ mul.s $f16, $f8, $f10 -/* 0ACC14 7F0780E4 46103101 */ sub.s $f4, $f6, $f16 -/* 0ACC18 7F0780E8 03E00008 */ jr $ra -/* 0ACC1C 7F0780EC E4A40000 */ swc1 $f4, ($a1) -) -#endif - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F0780F0(void *arg0, s32 arg1, void *arg2) { - f32 temp_f0; - - // Node 0 - temp_f0 = (1.0f / arg1); - arg2->unk4 = (f32) ((arg0->unk4 * temp_f0) * pPlayer->c_recipscaley); - *arg2 = (f32) ((*arg0 * temp_f0) * pPlayer->c_recipscalex); - return &pPlayer; +void sub_GAME_7F077FB4(struct coord *in, f32 value, struct coord *out) { + out->y = ((in->y * value) * pPlayer->c_scaley); + out->x = ((in->x * value) * pPlayer->c_scalex); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0780F0 -/* 0ACC20 7F0780F0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0ACC24 7F0780F4 44856000 */ mtc1 $a1, $f12 -/* 0ACC28 7F0780F8 44812000 */ mtc1 $at, $f4 -/* 0ACC2C 7F0780FC C4860004 */ lwc1 $f6, 4($a0) -/* 0ACC30 7F078100 3C028008 */ lui $v0, %hi(pPlayer) -/* 0ACC34 7F078104 460C2003 */ div.s $f0, $f4, $f12 -/* 0ACC38 7F078108 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0ACC3C 7F07810C 8C4E0000 */ lw $t6, ($v0) -/* 0ACC40 7F078110 C5CA10C0 */ lwc1 $f10, 0x10c0($t6) -/* 0ACC44 7F078114 46003202 */ mul.s $f8, $f6, $f0 -/* 0ACC48 7F078118 00000000 */ nop -/* 0ACC4C 7F07811C 460A4402 */ mul.s $f16, $f8, $f10 -/* 0ACC50 7F078120 E4D00004 */ swc1 $f16, 4($a2) -/* 0ACC54 7F078124 C4920000 */ lwc1 $f18, ($a0) -/* 0ACC58 7F078128 8C4F0000 */ lw $t7, ($v0) -/* 0ACC5C 7F07812C 46009102 */ mul.s $f4, $f18, $f0 -/* 0ACC60 7F078130 C5E610BC */ lwc1 $f6, 0x10bc($t7) -/* 0ACC64 7F078134 46062202 */ mul.s $f8, $f4, $f6 -/* 0ACC68 7F078138 03E00008 */ jr $ra -/* 0ACC6C 7F07813C E4C80000 */ swc1 $f8, ($a2) -) -#endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F078140(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4) { - f32 sp1C; - f32 sp2C; - f32 sp30; - f32 temp_f14; - f32 temp_f4; - f32 temp_f8; - f32 temp_f2; - - // Node 0 - sp1C = sinf(((arg3 * *(void *)0x80050000) / 360.0f), arg3); - temp_f14 = (sp1C / (cosf(sp18) * pPlayer->c_halfheight)); - temp_f4 = ((pPlayer->c_halfheight - (arg0->unk4 - pPlayer->c_screentop)) * temp_f14); - sp2C = temp_f4; - temp_f8 = (((*arg0 - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * (((temp_f14 * arg4) * pPlayer->c_halfheight) / pPlayer->c_halfwidth)); - sp30 = temp_f8; - temp_f2 = (arg2 / sqrtf((((temp_f8 * temp_f8) + (temp_f4 * temp_f4)) + (-1.0f * -1.0f)), temp_f14)); - *arg1 = (f32) (sp30 * temp_f2); - arg1->unk4 = (f32) (sp2C * temp_f2); - arg1->unk8 = (f32) (-1.0f * temp_f2); - return arg1; +void sub_GAME_7F077FF4(struct coord *in, struct coord *out) { + f32 inv_z = (1.0f / in->z); + out->y = (in->y * inv_z * pPlayer->c_recipscaley) + (pPlayer->c_screentop + pPlayer->c_halfheight); + out->x = (pPlayer->c_screenleft + pPlayer->c_halfwidth) - (in->x * inv_z * pPlayer->c_recipscalex); } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80054FB0 -.word 0x40490fdb /*3.1415927*/ -.text -glabel sub_GAME_7F078140 -/* 0ACC70 7F078140 3C018005 */ lui $at, %hi(D_80054FB0) -/* 0ACC74 7F078144 44877000 */ mtc1 $a3, $f14 -/* 0ACC78 7F078148 C4244FB0 */ lwc1 $f4, %lo(D_80054FB0)($at) -/* 0ACC7C 7F07814C 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0ACC80 7F078150 44814000 */ mtc1 $at, $f8 -/* 0ACC84 7F078154 46047182 */ mul.s $f6, $f14, $f4 -/* 0ACC88 7F078158 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0ACC8C 7F07815C AFBF0014 */ sw $ra, 0x14($sp) -/* 0ACC90 7F078160 AFA40038 */ sw $a0, 0x38($sp) -/* 0ACC94 7F078164 AFA5003C */ sw $a1, 0x3c($sp) -/* 0ACC98 7F078168 AFA60040 */ sw $a2, 0x40($sp) -/* 0ACC9C 7F07816C 46083303 */ div.s $f12, $f6, $f8 -/* 0ACCA0 7F078170 0FC15FAB */ jal sinf -/* 0ACCA4 7F078174 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0ACCA8 7F078178 C7AC0018 */ lwc1 $f12, 0x18($sp) -/* 0ACCAC 7F07817C 0FC15FA8 */ jal cosf -/* 0ACCB0 7F078180 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0ACCB4 7F078184 3C028008 */ lui $v0, %hi(pPlayer) -/* 0ACCB8 7F078188 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0ACCBC 7F07818C C7AA001C */ lwc1 $f10, 0x1c($sp) -/* 0ACCC0 7F078190 C7A60048 */ lwc1 $f6, 0x48($sp) -/* 0ACCC4 7F078194 C44210B0 */ lwc1 $f2, 0x10b0($v0) -/* 0ACCC8 7F078198 8FA30038 */ lw $v1, 0x38($sp) -/* 0ACCCC 7F07819C C45010AC */ lwc1 $f16, 0x10ac($v0) -/* 0ACCD0 7F0781A0 46020102 */ mul.s $f4, $f0, $f2 -/* 0ACCD4 7F0781A4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0ACCD8 7F0781A8 46045383 */ div.s $f14, $f10, $f4 -/* 0ACCDC 7F0781AC C4640004 */ lwc1 $f4, 4($v1) -/* 0ACCE0 7F0781B0 46067202 */ mul.s $f8, $f14, $f6 -/* 0ACCE4 7F0781B4 C446109C */ lwc1 $f6, 0x109c($v0) -/* 0ACCE8 7F0781B8 46024282 */ mul.s $f10, $f8, $f2 -/* 0ACCEC 7F0781BC 46062201 */ sub.s $f8, $f4, $f6 -/* 0ACCF0 7F0781C0 46105483 */ div.s $f18, $f10, $f16 -/* 0ACCF4 7F0781C4 46081281 */ sub.s $f10, $f2, $f8 -/* 0ACCF8 7F0781C8 460E5102 */ mul.s $f4, $f10, $f14 -/* 0ACCFC 7F0781CC E7A4002C */ swc1 $f4, 0x2c($sp) -/* 0ACD00 7F0781D0 C4481098 */ lwc1 $f8, 0x1098($v0) -/* 0ACD04 7F0781D4 C4660000 */ lwc1 $f6, ($v1) -/* 0ACD08 7F0781D8 46083281 */ sub.s $f10, $f6, $f8 -/* 0ACD0C 7F0781DC 46105181 */ sub.s $f6, $f10, $f16 -/* 0ACD10 7F0781E0 46123202 */ mul.s $f8, $f6, $f18 -/* 0ACD14 7F0781E4 00000000 */ nop -/* 0ACD18 7F0781E8 46084282 */ mul.s $f10, $f8, $f8 -/* 0ACD1C 7F0781EC E7A80030 */ swc1 $f8, 0x30($sp) -/* 0ACD20 7F0781F0 46042182 */ mul.s $f6, $f4, $f4 -/* 0ACD24 7F0781F4 44812000 */ mtc1 $at, $f4 -/* 0ACD28 7F0781F8 46065200 */ add.s $f8, $f10, $f6 -/* 0ACD2C 7F0781FC 44815000 */ mtc1 $at, $f10 -/* 0ACD30 7F078200 00000000 */ nop -/* 0ACD34 7F078204 460A2182 */ mul.s $f6, $f4, $f10 -/* 0ACD38 7F078208 0C007DF8 */ jal sqrtf -/* 0ACD3C 7F07820C 46064300 */ add.s $f12, $f8, $f6 -/* 0ACD40 7F078210 C7A40040 */ lwc1 $f4, 0x40($sp) -/* 0ACD44 7F078214 C7AA0030 */ lwc1 $f10, 0x30($sp) -/* 0ACD48 7F078218 8FA2003C */ lw $v0, 0x3c($sp) -/* 0ACD4C 7F07821C 46002083 */ div.s $f2, $f4, $f0 -/* 0ACD50 7F078220 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0ACD54 7F078224 46025202 */ mul.s $f8, $f10, $f2 -/* 0ACD58 7F078228 44815000 */ mtc1 $at, $f10 -/* 0ACD5C 7F07822C E4480000 */ swc1 $f8, ($v0) -/* 0ACD60 7F078230 C7A6002C */ lwc1 $f6, 0x2c($sp) -/* 0ACD64 7F078234 46023102 */ mul.s $f4, $f6, $f2 -/* 0ACD68 7F078238 00000000 */ nop -/* 0ACD6C 7F07823C 46025202 */ mul.s $f8, $f10, $f2 -/* 0ACD70 7F078240 E4440004 */ swc1 $f4, 4($v0) -/* 0ACD74 7F078244 E4480008 */ swc1 $f8, 8($v0) -/* 0ACD78 7F078248 8FBF0014 */ lw $ra, 0x14($sp) -/* 0ACD7C 7F07824C 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0ACD80 7F078250 03E00008 */ jr $ra -/* 0ACD84 7F078254 00000000 */ nop -) -#endif +void sub_GAME_7F078060(struct coord *in, struct coord *out) +{ + f32 inv_z; + if (in->z == 0.0f) { + inv_z = -100000000000000000000.0f; + } else { + inv_z = 1.0f / in->z; + } + out->y = in->y * inv_z * pPlayer->c_recipscaley + (pPlayer->c_screentop + pPlayer->c_halfheight); + out->x = (pPlayer->c_screenleft + pPlayer->c_halfwidth) - in->x * inv_z * pPlayer->c_recipscalex; +} +void sub_GAME_7F0780F0(struct coord *in, f32 divisor, struct coord *out) +{ + out->y = in->y * (1.0f / divisor) * pPlayer->c_recipscaley; + out->x = in->x * (1.0f / divisor) * pPlayer->c_recipscalex; +} + +void sub_GAME_7F078140(struct coord *in, struct coord *out, f32 value1, f32 angle, f32 value2) { + f32 var1; + f32 x; + f32 y; + f32 z; + f32 var2 = sinf(DEG2RAD(angle)) / (cosf(DEG2RAD(angle)) * pPlayer->c_halfheight); + f32 var3 = (var2 * value2 * pPlayer->c_halfheight) / pPlayer->c_halfwidth; + y = (pPlayer->c_halfheight - (in->y - pPlayer->c_screentop)) * var2; + x = ((in->x - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * var3; + z = -1.0f; + var1 = value1 / sqrtf((x * x) + (y * y) + (z * z)); + out->x = (x * var1); + out->y = (y * var1); + out->z = (-1.0f * var1); +} #ifdef NONMATCHING -void *sub_GAME_7F078258(void *arg0, void *arg1, f32 arg2, f32 arg3) { - f32 sp20; - f32 temp_f12; - - // Node 0 - sp20 = cosf(((arg2 * D_80054FB4) / 360.0f), arg2); - temp_f12 = ((sp20 * pPlayer->c_halfheight) / (arg0->unk8 * sinf(sp1C))); - arg1->unk4 = (f32) ((arg0->unk4 * temp_f12) + (pPlayer->c_screentop + pPlayer->c_halfheight)); - *arg1 = (f32) ((pPlayer->c_screenleft + pPlayer->c_halfwidth) - (*arg0 * ((pPlayer->c_halfwidth * temp_f12) / (arg3 * pPlayer->c_halfheight)))); - return pPlayer; +// acdf8: mul.s $f4,$f18,$f0 r acdf8: mul.s $f4,$f0,$f18 +void sub_GAME_7F078258(struct coord *in, struct coord *out, f32 angle, f32 value) { + f32 var0 = DEG2RAD(angle); + f32 var1 = (cosf(var0) * pPlayer->c_halfheight) / (sinf(var0) * in->z); + f32 var2 = (var1 * pPlayer->c_halfwidth) / (value * pPlayer->c_halfheight); + out->y = ((in->y * var1) + (pPlayer->c_screentop + pPlayer->c_halfheight)); + out->x = ((pPlayer->c_screenleft + pPlayer->c_halfwidth) - (in->x * var2)); } #else GLOBAL_ASM( .late_rodata glabel D_80054FB4 .word 0x40490fdb /*3.1415927*/ -glabel D_80054FB8 -.word 0 -glabel D_80054FBC -.word 0 - -/*D:80054FC0*/ -glabel a8s -/*"%8s"*/ -.word 0x25387300 - -glabel aX4_0f -/*"x %4.0f"*/ -.word 0x78202534 -.word 0x2E306600 - -glabel aY4_0f -/*"y %4.0f"*/ -.word 0x79202534 -.word 0x2E306600 - -glabel aZ4_0f -/*"z %4.0f"*/ -.word 0x7A202534 -.word 0x2E306600 - -glabel aS3d -/*"%s %3d"*/ -.word 0x25732025 -.word 0x33640000 - .text glabel sub_GAME_7F078258 /* 0ACD88 7F078258 3C018005 */ lui $at, %hi(D_80054FB4) @@ -1224,32 +649,28 @@ glabel sub_GAME_7F078258 ) #endif - - - - -void set_BONDdata_field_10C4(s32 arg0) { - pPlayer->field_10C4 = arg0; +void currentPlayerSetMatrix10C4(Mtx *matrix) { + pPlayer->field_10C4 = matrix; } -s32 get_BONDdata_field_10C4(void) { +Mtx *currentPlayerGetMatrix10C4(void) { return pPlayer->field_10C4; } -void set_BONDdata_field_10C8(s32 arg0) { - pPlayer->field_10C8 = arg0; +void currentPlayerSetMatrix10C8(Mtx *matrix) { + pPlayer->field_10C8 = matrix; } -s32 get_BONDdata_field_10C8(void) { +Mtx *currentPlayerGetMatrix10C8(void) { return pPlayer->field_10C8; } -void set_BONDdata_field_10D8(s32 arg0) { - pPlayer->field_10D8 = arg0; +void currentPlayerSetProjectionMatrix(Mtx *matrix) { + pPlayer->projmatrix = matrix; } -s32 get_BONDdata_field_10D8(void) { - return pPlayer->field_10D8; +Mtx *currentPlayerGetProjectionMatrix(void) { + return pPlayer->projmatrix; } void set_BONDdata_field_10E0(s32 arg0) { @@ -1257,28 +678,27 @@ void set_BONDdata_field_10E0(s32 arg0) { } s32 get_BONDdata_field_10E0(void) { - // Node 0 return pPlayer->field_10E0; } -void *copy_BONDdata_field_10CC_to_10E8_set_10CC(s32 arg0) { - pPlayer->field_10E8 = (s32) pPlayer->field_10CC; - pPlayer->field_10CC = arg0; +void *currentPlayerSetMatrix10CC(Mtxf *matrix) { + pPlayer->field_10E8 = pPlayer->field_10CC; + pPlayer->field_10CC = matrix; } -s32 get_BONDdata_field_10CC(void) { +Mtxf *currentPlayerGetMatrix10CC(void) { return pPlayer->field_10CC; } -void set_BONDdata_field_10DC(s32 arg0) { - pPlayer->field_10DC = arg0; +void currentPlayerSetProjectionMatrixF(Mtxf *matrix) { + pPlayer->projmatrixf = matrix; } -s32 get_BONDdata_field_10DC(void) { - return pPlayer->field_10DC; +Mtxf *currentPlayerGetProjectionMatrixF(void) { + return pPlayer->projmatrixf; } -s32 sub_GAME_7F0783F4(void) { +Mtxf *currentPlayerGetMatrix10E8(void) { return pPlayer->field_10E8; } @@ -1290,16 +710,16 @@ s32 sub_GAME_7F078414(void) { return pPlayer->field_10D0; } -void sub_GAME_7F078424(s32 arg0) { +void currentPlayerSetMatrix10D4(Mtxf *matrix) { pPlayer->field_10EC = pPlayer->field_10D4; - pPlayer->field_10D4 = arg0; + pPlayer->field_10D4 = matrix; } -s32 sub_GAME_7F078444(void) { +Mtxf *currentPlayerGetMatrix10D4(void) { return pPlayer->field_10D4; } -s32 sub_GAME_7F078454(void) { +Mtxf *currentPlayerGetMatrix10EC(void) { return pPlayer->field_10EC; } @@ -1351,187 +771,73 @@ f32 getPlayer_c_perspaspect(void) return pPlayer->c_perspaspect; } - -#ifdef NONMATCHING -void proc_7F078504(xyzpoint *param_1) +void getPlayer_c_cameratopnorm(struct coord *out) { - param_1->x = (pPlayer->c_cameratopnorm).x; - param_1->y = (pPlayer->c_cameratopnorm).y; - param_1->z = (pPlayer->c_cameratopnorm).z; + out->x = (pPlayer->c_cameratopnorm).x; + out->y = (pPlayer->c_cameratopnorm).y; + out->z = (pPlayer->c_cameratopnorm).z; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078504 -/* 0AD034 7F078504 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AD038 7F078508 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0AD03C 7F07850C 8C4E0000 */ lw $t6, ($v0) -/* 0AD040 7F078510 C5C41100 */ lwc1 $f4, 0x1100($t6) -/* 0AD044 7F078514 E4840000 */ swc1 $f4, ($a0) -/* 0AD048 7F078518 8C4F0000 */ lw $t7, ($v0) -/* 0AD04C 7F07851C C5E61104 */ lwc1 $f6, 0x1104($t7) -/* 0AD050 7F078520 E4860004 */ swc1 $f6, 4($a0) -/* 0AD054 7F078524 8C580000 */ lw $t8, ($v0) -/* 0AD058 7F078528 C7081108 */ lwc1 $f8, 0x1108($t8) -/* 0AD05C 7F07852C 03E00008 */ jr $ra -/* 0AD060 7F078530 E4880008 */ swc1 $f8, 8($a0) -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F078534(xyzpoint *param_1) +void getPlayer_c_cameratopnorm_inverted_y(struct coord *out) { - param_1->x = (pPlayer->c_cameratopnorm).x; - param_1->y = -(pPlayer->c_cameratopnorm).y; - param_1->z = (pPlayer->c_cameratopnorm).z; + out->x = (pPlayer->c_cameratopnorm).x; + out->y = -(pPlayer->c_cameratopnorm).y; + out->z = (pPlayer->c_cameratopnorm).z; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078534 -/* 0AD064 7F078534 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AD068 7F078538 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0AD06C 7F07853C 8C4E0000 */ lw $t6, ($v0) -/* 0AD070 7F078540 C5C41100 */ lwc1 $f4, 0x1100($t6) -/* 0AD074 7F078544 E4840000 */ swc1 $f4, ($a0) -/* 0AD078 7F078548 8C4F0000 */ lw $t7, ($v0) -/* 0AD07C 7F07854C C5E61104 */ lwc1 $f6, 0x1104($t7) -/* 0AD080 7F078550 46003207 */ neg.s $f8, $f6 -/* 0AD084 7F078554 E4880004 */ swc1 $f8, 4($a0) -/* 0AD088 7F078558 8C580000 */ lw $t8, ($v0) -/* 0AD08C 7F07855C C70A1108 */ lwc1 $f10, 0x1108($t8) -/* 0AD090 7F078560 03E00008 */ jr $ra -/* 0AD094 7F078564 E48A0008 */ swc1 $f10, 8($a0) -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F078568(xyzpoint *param_1) +void getPlayer_c_cameraleftnorm(struct coord *out) { - param_1->x = (pPlayer->c_cameraleftnorm).x; - param_1->y = (pPlayer->c_cameraleftnorm).y; - param_1->z = (pPlayer->c_cameraleftnorm).z; + out->x = (pPlayer->c_cameraleftnorm).x; + out->y = (pPlayer->c_cameraleftnorm).y; + out->z = (pPlayer->c_cameraleftnorm).z; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078568 -/* 0AD098 7F078568 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AD09C 7F07856C 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0AD0A0 7F078570 8C4E0000 */ lw $t6, ($v0) -/* 0AD0A4 7F078574 C5C4110C */ lwc1 $f4, 0x110c($t6) -/* 0AD0A8 7F078578 E4840000 */ swc1 $f4, ($a0) -/* 0AD0AC 7F07857C 8C4F0000 */ lw $t7, ($v0) -/* 0AD0B0 7F078580 C5E61110 */ lwc1 $f6, 0x1110($t7) -/* 0AD0B4 7F078584 E4860004 */ swc1 $f6, 4($a0) -/* 0AD0B8 7F078588 8C580000 */ lw $t8, ($v0) -/* 0AD0BC 7F07858C C7081114 */ lwc1 $f8, 0x1114($t8) -/* 0AD0C0 7F078590 03E00008 */ jr $ra -/* 0AD0C4 7F078594 E4880008 */ swc1 $f8, 8($a0) -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F078598(xyzpoint *param_1) +void getPlayer_c_cameraleftnorm_inverted_x(struct coord *out) { - param_1->x = -(pPlayer->c_cameraleftnorm).x; - param_1->y = (pPlayer->c_cameraleftnorm).y; - param_1->z = (pPlayer->c_cameraleftnorm).z; + out->x = -(pPlayer->c_cameraleftnorm).x; + out->y = (pPlayer->c_cameraleftnorm).y; + out->z = (pPlayer->c_cameraleftnorm).z; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078598 -/* 0AD0C8 7F078598 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AD0CC 7F07859C 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0AD0D0 7F0785A0 8C4E0000 */ lw $t6, ($v0) -/* 0AD0D4 7F0785A4 C5C4110C */ lwc1 $f4, 0x110c($t6) -/* 0AD0D8 7F0785A8 46002187 */ neg.s $f6, $f4 -/* 0AD0DC 7F0785AC E4860000 */ swc1 $f6, ($a0) -/* 0AD0E0 7F0785B0 8C4F0000 */ lw $t7, ($v0) -/* 0AD0E4 7F0785B4 C5E81110 */ lwc1 $f8, 0x1110($t7) -/* 0AD0E8 7F0785B8 E4880004 */ swc1 $f8, 4($a0) -/* 0AD0EC 7F0785BC 8C580000 */ lw $t8, ($v0) -/* 0AD0F0 7F0785C0 C70A1114 */ lwc1 $f10, 0x1114($t8) -/* 0AD0F4 7F0785C4 03E00008 */ jr $ra -/* 0AD0F8 7F0785C8 E48A0008 */ swc1 $f10, 8($a0) -) -#endif - - - - - f32 getPlayer_c_perspnear(void) { return pPlayer->c_perspnear; } - - - - - #ifdef NONMATCHING -void sub_GAME_7F0785DC(void) +// Regalloc mostly +void sub_GAME_7F0785DC() { - f32 sp28; - f32 sp24; f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16; - f32 temp_f16_2; - f32 temp_f18; - f32 temp_f18_2; - f32 temp_f20; f32 temp_f20_2; - f32 temp_f2; - f32 temp_f2_2; - - temp_f2 = pPlayer->c_halfheight * pPlayer->c_scaley; - sp24 = temp_f2; - temp_f20 = 1.0f / sqrtf((temp_f2 * temp_f2) + 1.0f); - temp_f2_2 = temp_f2 * temp_f20; - temp_f16 = -temp_f20; - temp_f18 = -temp_f16; - flt_CODE_bss_80079940.unk0 = (f32) ((pPlayer->unk10D4->unk20 * temp_f2_2) + (temp_f18 * pPlayer->unk10D4->unk10)); - flt_CODE_bss_80079940.unk4 = (f32) ((pPlayer->unk10D4->unk24 * temp_f2_2) + (temp_f18 * pPlayer->unk10D4->unk14)); - flt_CODE_bss_80079940.unk8 = (f32) ((pPlayer->unk10D4->unk28 * temp_f2_2) + (temp_f18 * pPlayer->unk10D4->unk18)); - flt_CODE_bss_8007994C = (f32) ((pPlayer->unk10D4->unk38 * flt_CODE_bss_80079940.unk8) + ((flt_CODE_bss_80079940.unk0 * pPlayer->unk10D4->unk30) + (flt_CODE_bss_80079940.unk4 * pPlayer->unk10D4->unk34))); - flt_CODE_bss_80079950.unk0 = (f32) ((pPlayer->unk10D4->unk20 * temp_f2_2) + (temp_f16 * pPlayer->unk10D4->unk10)); - flt_CODE_bss_80079950.unk4 = (f32) ((pPlayer->unk10D4->unk24 * temp_f2_2) + (temp_f16 * pPlayer->unk10D4->unk14)); - flt_CODE_bss_80079950.unk8 = (f32) ((pPlayer->unk10D4->unk28 * temp_f2_2) + (temp_f16 * pPlayer->unk10D4->unk18)); - flt_CODE_bss_8007995C = (f32) ((pPlayer->unk10D4->unk38 * flt_CODE_bss_80079950.unk8) + ((flt_CODE_bss_80079950.unk0 * pPlayer->unk10D4->unk30) + (flt_CODE_bss_80079950.unk4 * pPlayer->unk10D4->unk34))); - temp_f14 = -pPlayer->unk10AC * pPlayer->unk10B4; - sp28 = temp_f14; - temp_f20_2 = 1.0f / sqrtf((temp_f14 * temp_f14) + 1.0f, temp_f14, &flt_CODE_bss_80079940, &flt_CODE_bss_80079950); + f32 temp_f14_2; + f32 test2; + f32 temp_f2 = pPlayer->c_halfheight * pPlayer->c_scaley; + f32 temp_f20 = 1.0f / sqrtf((temp_f2 * temp_f2) + 1.0f); + f32 temp_f2_2 = temp_f2 * temp_f20; + f32 test = -temp_f20; + flt_CODE_bss_80079940.x = (-test * pPlayer->field_10D4->m[1][0]) + (temp_f2_2 * pPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079940.y = (-test * pPlayer->field_10D4->m[1][1]) + (temp_f2_2 * pPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079940.z = (-test * pPlayer->field_10D4->m[1][2]) + (temp_f2_2 * pPlayer->field_10D4->m[2][2]); + flt_CODE_bss_8007994C = (flt_CODE_bss_80079940.x * pPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079940.y * pPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079940.z * pPlayer->field_10D4->m[3][2]); + flt_CODE_bss_80079950.x = (test * pPlayer->field_10D4->m[1][0]) + (temp_f2_2 * pPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079950.y = (test * pPlayer->field_10D4->m[1][1]) + (temp_f2_2 * pPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079950.z = (test * pPlayer->field_10D4->m[1][2]) + (temp_f2_2 * pPlayer->field_10D4->m[2][2]); + flt_CODE_bss_8007995C = (flt_CODE_bss_80079950.x * pPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079950.y * pPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079950.z * pPlayer->field_10D4->m[3][2]); + temp_f14 = -pPlayer->c_halfwidth * pPlayer->c_scalex; + temp_f20_2 = 1.0f / sqrtf((temp_f14 * temp_f14) + 1.0f); temp_f14_2 = temp_f14 * temp_f20_2; - temp_f16_2 = -temp_f20_2; - temp_f18_2 = -temp_f16_2; - flt_CODE_bss_80079960.unk0 = (f32) ((temp_f16_2 * pPlayer->unk10D4->unk0) - (pPlayer->unk10D4->unk20 * temp_f14_2)); - flt_CODE_bss_80079960.unk4 = (f32) ((temp_f16_2 * pPlayer->unk10D4->unk4) - (pPlayer->unk10D4->unk24 * temp_f14_2)); - flt_CODE_bss_80079960.unk8 = (f32) ((temp_f16_2 * pPlayer->unk10D4->unk8) - (pPlayer->unk10D4->unk28 * temp_f14_2)); - flt_CODE_bss_8007996C = (f32) ((pPlayer->unk10D4->unk38 * flt_CODE_bss_80079960.unk8) + ((flt_CODE_bss_80079960.unk0 * pPlayer->unk10D4->unk30) + (flt_CODE_bss_80079960.unk4 * pPlayer->unk10D4->unk34))); - flt_CODE_bss_80079970.unk0 = (f32) ((temp_f18_2 * pPlayer->unk10D4->unk0) - (pPlayer->unk10D4->unk20 * temp_f14_2)); - flt_CODE_bss_80079970.unk4 = (f32) ((temp_f18_2 * pPlayer->unk10D4->unk4) - (pPlayer->unk10D4->unk24 * temp_f14_2)); - flt_CODE_bss_80079970.unk8 = (f32) ((temp_f18_2 * pPlayer->unk10D4->unk8) - (pPlayer->unk10D4->unk28 * temp_f14_2)); - flt_CODE_bss_8007997C = (f32) ((pPlayer->unk10D4->unk38 * flt_CODE_bss_80079970.unk8) + ((flt_CODE_bss_80079970.unk0 * pPlayer->unk10D4->unk30) + (flt_CODE_bss_80079970.unk4 * pPlayer->unk10D4->unk34))); - flt_CODE_bss_80079980 = (f32) ((pPlayer->unk10D4->unk38 * pPlayer->unk10D4->unk28) + ((pPlayer->unk10D4->unk20 * pPlayer->unk10D4->unk30) + (pPlayer->unk10D4->unk24 * pPlayer->unk10D4->unk34))); + test2 = -temp_f20_2; + flt_CODE_bss_80079960.x = (test2 * pPlayer->field_10D4->m[0][0]) - (temp_f14_2 * pPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079960.y = (test2 * pPlayer->field_10D4->m[0][1]) - (temp_f14_2 * pPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079960.z = (test2 * pPlayer->field_10D4->m[0][2]) - (temp_f14_2 * pPlayer->field_10D4->m[2][2]); + flt_CODE_bss_8007996C = (flt_CODE_bss_80079960.x * pPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079960.y * pPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079960.z * pPlayer->field_10D4->m[3][2]); + flt_CODE_bss_80079970.x = (-test2 * pPlayer->field_10D4->m[0][0]) - (temp_f14_2 * pPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079970.y = (-test2 * pPlayer->field_10D4->m[0][1]) - (temp_f14_2 * pPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079970.z = (-test2 * pPlayer->field_10D4->m[0][2]) - (temp_f14_2 * pPlayer->field_10D4->m[2][2]); + flt_CODE_bss_8007997C = (flt_CODE_bss_80079970.x * pPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079970.y * pPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079970.z * pPlayer->field_10D4->m[3][2]); + flt_CODE_bss_80079980 = (pPlayer->field_10D4->m[2][0] * pPlayer->field_10D4->m[3][0]) + (pPlayer->field_10D4->m[2][1] * pPlayer->field_10D4->m[3][1]) + (pPlayer->field_10D4->m[2][2] * pPlayer->field_10D4->m[3][2]); } - #else GLOBAL_ASM( .text @@ -1760,209 +1066,64 @@ glabel sub_GAME_7F0785DC ) #endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F078950(void *arg0, void *arg1) { - // Node 0 - *arg0 = (f32) flt_CODE_bss_80079940; - arg0->unk4 = (f32) flt_CODE_bss_80079940.unk4; - arg0->unk8 = (f32) flt_CODE_bss_80079940.unk8; - *arg1 = (f32) flt_CODE_bss_8007994C; - return &flt_CODE_bss_80079940; +void sub_GAME_7F078950(struct coord *arg0, f32 *arg1) { + arg0->x = flt_CODE_bss_80079940.x; + arg0->y = flt_CODE_bss_80079940.y; + arg0->z = flt_CODE_bss_80079940.z; + *arg1 = flt_CODE_bss_8007994C; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078950 -/* 0AD480 7F078950 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079940) -/* 0AD484 7F078954 24429940 */ addiu $v0, %lo(flt_CODE_bss_80079940) # addiu $v0, $v0, -0x66c0 -/* 0AD488 7F078958 C4440000 */ lwc1 $f4, ($v0) -/* 0AD48C 7F07895C 3C018008 */ lui $at, %hi(flt_CODE_bss_8007994C) -/* 0AD490 7F078960 E4840000 */ swc1 $f4, ($a0) -/* 0AD494 7F078964 C4460004 */ lwc1 $f6, 4($v0) -/* 0AD498 7F078968 E4860004 */ swc1 $f6, 4($a0) -/* 0AD49C 7F07896C C4480008 */ lwc1 $f8, 8($v0) -/* 0AD4A0 7F078970 E4880008 */ swc1 $f8, 8($a0) -/* 0AD4A4 7F078974 C42A994C */ lwc1 $f10, %lo(flt_CODE_bss_8007994C)($at) -/* 0AD4A8 7F078978 03E00008 */ jr $ra -/* 0AD4AC 7F07897C E4AA0000 */ swc1 $f10, ($a1) -) -#endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F078980(void *arg0, void *arg1) { - // Node 0 - *arg0 = (f32) flt_CODE_bss_80079950; - arg0->unk4 = (f32) flt_CODE_bss_80079950.unk4; - arg0->unk8 = (f32) flt_CODE_bss_80079950.unk8; - *arg1 = (f32) flt_CODE_bss_8007995C; - return &flt_CODE_bss_80079950; +void sub_GAME_7F078980(struct coord *arg0, f32 *arg1) { + arg0->x = flt_CODE_bss_80079950.x; + arg0->y = flt_CODE_bss_80079950.y; + arg0->z = flt_CODE_bss_80079950.z; + *arg1 = flt_CODE_bss_8007995C; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078980 -/* 0AD4B0 7F078980 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079950) -/* 0AD4B4 7F078984 24429950 */ addiu $v0, %lo(flt_CODE_bss_80079950) # addiu $v0, $v0, -0x66b0 -/* 0AD4B8 7F078988 C4440000 */ lwc1 $f4, ($v0) -/* 0AD4BC 7F07898C 3C018008 */ lui $at, %hi(flt_CODE_bss_8007995C) -/* 0AD4C0 7F078990 E4840000 */ swc1 $f4, ($a0) -/* 0AD4C4 7F078994 C4460004 */ lwc1 $f6, 4($v0) -/* 0AD4C8 7F078998 E4860004 */ swc1 $f6, 4($a0) -/* 0AD4CC 7F07899C C4480008 */ lwc1 $f8, 8($v0) -/* 0AD4D0 7F0789A0 E4880008 */ swc1 $f8, 8($a0) -/* 0AD4D4 7F0789A4 C42A995C */ lwc1 $f10, %lo(flt_CODE_bss_8007995C)($at) -/* 0AD4D8 7F0789A8 03E00008 */ jr $ra -/* 0AD4DC 7F0789AC E4AA0000 */ swc1 $f10, ($a1) -) -#endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F0789B0(void *arg0, void *arg1) { - // Node 0 - *arg0 = (f32) flt_CODE_bss_80079960; - arg0->unk4 = (f32) flt_CODE_bss_80079960.unk4; - arg0->unk8 = (f32) flt_CODE_bss_80079960.unk8; - *arg1 = (f32) flt_CODE_bss_8007996C; - return &flt_CODE_bss_80079960; +void sub_GAME_7F0789B0(struct coord *arg0, f32 *arg1) { + arg0->x = flt_CODE_bss_80079960.x; + arg0->y = flt_CODE_bss_80079960.y; + arg0->z = flt_CODE_bss_80079960.z; + *arg1 = flt_CODE_bss_8007996C; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0789B0 -/* 0AD4E0 7F0789B0 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079960) -/* 0AD4E4 7F0789B4 24429960 */ addiu $v0, %lo(flt_CODE_bss_80079960) # addiu $v0, $v0, -0x66a0 -/* 0AD4E8 7F0789B8 C4440000 */ lwc1 $f4, ($v0) -/* 0AD4EC 7F0789BC 3C018008 */ lui $at, %hi(flt_CODE_bss_8007996C) -/* 0AD4F0 7F0789C0 E4840000 */ swc1 $f4, ($a0) -/* 0AD4F4 7F0789C4 C4460004 */ lwc1 $f6, 4($v0) -/* 0AD4F8 7F0789C8 E4860004 */ swc1 $f6, 4($a0) -/* 0AD4FC 7F0789CC C4480008 */ lwc1 $f8, 8($v0) -/* 0AD500 7F0789D0 E4880008 */ swc1 $f8, 8($a0) -/* 0AD504 7F0789D4 C42A996C */ lwc1 $f10, %lo(flt_CODE_bss_8007996C)($at) -/* 0AD508 7F0789D8 03E00008 */ jr $ra -/* 0AD50C 7F0789DC E4AA0000 */ swc1 $f10, ($a1) -) -#endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F0789E0(void *arg0, void *arg1) { - // Node 0 - *arg0 = (f32) flt_CODE_bss_80079970; - arg0->unk4 = (f32) flt_CODE_bss_80079970.unk4; - arg0->unk8 = (f32) flt_CODE_bss_80079970.unk8; - *arg1 = (f32) flt_CODE_bss_8007997C; - return &flt_CODE_bss_80079970; +void sub_GAME_7F0789E0(struct coord *arg0, f32 *arg1) { + arg0->x = flt_CODE_bss_80079970.x; + arg0->y = flt_CODE_bss_80079970.y; + arg0->z = flt_CODE_bss_80079970.z; + *arg1 = flt_CODE_bss_8007997C; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0789E0 -/* 0AD510 7F0789E0 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079970) -/* 0AD514 7F0789E4 24429970 */ addiu $v0, %lo(flt_CODE_bss_80079970) # addiu $v0, $v0, -0x6690 -/* 0AD518 7F0789E8 C4440000 */ lwc1 $f4, ($v0) -/* 0AD51C 7F0789EC 3C018008 */ lui $at, %hi(flt_CODE_bss_8007997C) -/* 0AD520 7F0789F0 E4840000 */ swc1 $f4, ($a0) -/* 0AD524 7F0789F4 C4460004 */ lwc1 $f6, 4($v0) -/* 0AD528 7F0789F8 E4860004 */ swc1 $f6, 4($a0) -/* 0AD52C 7F0789FC C4480008 */ lwc1 $f8, 8($v0) -/* 0AD530 7F078A00 E4880008 */ swc1 $f8, 8($a0) -/* 0AD534 7F078A04 C42A997C */ lwc1 $f10, %lo(flt_CODE_bss_8007997C)($at) -/* 0AD538 7F078A08 03E00008 */ jr $ra -/* 0AD53C 7F078A0C E4AA0000 */ swc1 $f10, ($a1) -) -#endif - - - - -#ifdef NONMATCHING -void *sub_GAME_7F078A10(void *arg0, void *arg1) { - // Node 0 - *arg0 = (f32) pPlayer->field_10D4->unk20; - arg0->unk4 = (f32) pPlayer->field_10D4->unk24; - arg0->unk8 = (f32) pPlayer->field_10D4->unk28; - *arg1 = (f32) flt_CODE_bss_80079980; - return &pPlayer; +void sub_GAME_7F078A10(struct coord *arg0, f32 *arg1) { + arg0->x = pPlayer->field_10D4->m[2][0]; + arg0->y = pPlayer->field_10D4->m[2][1]; + arg0->z = pPlayer->field_10D4->m[2][2]; + *arg1 = flt_CODE_bss_80079980; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F078A10 -/* 0AD540 7F078A10 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AD544 7F078A14 2442A0B0 */ addiu $v0, %lo(pPlayer) # addiu $v0, $v0, -0x5f50 -/* 0AD548 7F078A18 8C4E0000 */ lw $t6, ($v0) -/* 0AD54C 7F078A1C 3C018008 */ lui $at, %hi(flt_CODE_bss_80079980) -/* 0AD550 7F078A20 8DCF10D4 */ lw $t7, 0x10d4($t6) -/* 0AD554 7F078A24 C5E40020 */ lwc1 $f4, 0x20($t7) -/* 0AD558 7F078A28 E4840000 */ swc1 $f4, ($a0) -/* 0AD55C 7F078A2C 8C580000 */ lw $t8, ($v0) -/* 0AD560 7F078A30 8F1910D4 */ lw $t9, 0x10d4($t8) -/* 0AD564 7F078A34 C7260024 */ lwc1 $f6, 0x24($t9) -/* 0AD568 7F078A38 E4860004 */ swc1 $f6, 4($a0) -/* 0AD56C 7F078A3C 8C480000 */ lw $t0, ($v0) -/* 0AD570 7F078A40 8D0910D4 */ lw $t1, 0x10d4($t0) -/* 0AD574 7F078A44 C5280028 */ lwc1 $f8, 0x28($t1) -/* 0AD578 7F078A48 E4880008 */ swc1 $f8, 8($a0) -/* 0AD57C 7F078A4C C42A9980 */ lwc1 $f10, %lo(flt_CODE_bss_80079980)($at) -/* 0AD580 7F078A50 03E00008 */ jr $ra -/* 0AD584 7F078A54 E4AA0000 */ swc1 $f10, ($a1) -) -#endif - - - - #ifdef NONMATCHING -void sub_GAME_7F078A58(void *arg0, s32 arg1) { - // Node 0 - if ((flt_CODE_bss_80079980 + arg1) < ((arg0->unk8 * pPlayer->field_10D4->unk28) + ((pPlayer->field_10D4->unk20 * *arg0) + (pPlayer->field_10D4->unk24 * arg0->unk4)))) +// Regalloc +s32 sub_GAME_7F078A58(struct coord *arg0, f32 arg1) { + if ((flt_CODE_bss_80079980 + arg1) < ((pPlayer->field_10D4->m[2][0] * arg0->x) + (pPlayer->field_10D4->m[2][1] * arg0->y) + (pPlayer->field_10D4->m[2][2] * arg0->z))) { - // Node 1 return 0; } - // Node 2 - if ((flt_CODE_bss_8007996C + arg1) < ((arg0->unk8 * flt_CODE_bss_80079960.unk8) + ((flt_CODE_bss_80079960 * *arg0) + (flt_CODE_bss_80079960.unk4 * arg0->unk4)))) + if ((flt_CODE_bss_8007996C + arg1) < ((flt_CODE_bss_80079960.x * arg0->x) + (flt_CODE_bss_80079960.y * arg0->y) + (flt_CODE_bss_80079960.z * arg0->z))) { - // Node 3 return 0; } - // Node 4 - if ((flt_CODE_bss_8007997C + arg1) < ((arg0->unk8 * flt_CODE_bss_80079970.unk8) + ((flt_CODE_bss_80079970 * *arg0) + (flt_CODE_bss_80079970.unk4 * arg0->unk4)))) + if ((flt_CODE_bss_8007997C + arg1) < ((flt_CODE_bss_80079970.x * arg0->x) + (flt_CODE_bss_80079970.y * arg0->y) + (flt_CODE_bss_80079970.z * arg0->z))) { - // Node 5 return 0; } - // Node 6 - if ((flt_CODE_bss_8007994C + arg1) < ((arg0->unk8 * flt_CODE_bss_80079940.unk8) + ((flt_CODE_bss_80079940 * *arg0) + (flt_CODE_bss_80079940.unk4 * arg0->unk4)))) + if ((flt_CODE_bss_8007994C + arg1) < ((flt_CODE_bss_80079940.x * arg0->x) + (flt_CODE_bss_80079940.y * arg0->y) + (flt_CODE_bss_80079940.z * arg0->z))) { - // Node 7 return 0; } - // Node 8 - if ((flt_CODE_bss_8007995C + arg1) < ((arg0->unk8 * flt_CODE_bss_80079950.unk8) + ((flt_CODE_bss_80079950 * *arg0) + (flt_CODE_bss_80079950.unk4 * arg0->unk4)))) + if ((flt_CODE_bss_8007995C + arg1) < ((flt_CODE_bss_80079950.x * arg0->x) + (flt_CODE_bss_80079950.y * arg0->y) + (flt_CODE_bss_80079950.z * arg0->z))) { - // Node 9 return 0; } - // Node 10 return 1; } #else @@ -2085,27 +1246,9 @@ glabel sub_GAME_7F078A58 ) #endif - - - - #ifdef NONMATCHING -void sub_GAME_7F078BF4(void *arg0, s32 arg1, void *arg2) +s32 sub_GAME_7F078BF4(struct coord *arg0, f32 arg1, f32 *arg2) { - f32 sp7C; - f32 sp78; - f32 sp74; - f32 sp6C; - f32 sp68; - f32 sp64; - f32 sp5C; - f32 sp58; - f32 sp54; - f32 sp4C; - f32 sp48; - f32 sp44; - f32 sp38; - f32 sp34; f32 temp_f2; f32 temp_f12; f32 temp_f2_2; @@ -2116,14 +1259,12 @@ void sub_GAME_7F078BF4(void *arg0, s32 arg1, void *arg2) f32 temp_f2_3; f32 temp_f12_2; f32 temp_f2_4; - f32 temp_f14_2; f32 temp_f6; f32 temp_f8; f32 temp_f4_2; f32 temp_f2_5; f32 temp_f12_3; f32 temp_f2_6; - f32 temp_f14_3; f32 temp_f8_2; f32 temp_f18_2; f32 temp_f4_3; @@ -2134,70 +1275,51 @@ void sub_GAME_7F078BF4(void *arg0, s32 arg1, void *arg2) f32 temp_f6_2; f32 temp_f10_2; f32 temp_f18_3; - - if ((flt_CODE_bss_80079980 + arg1) < ((arg0->unk8 * pPlayer->field_10D4->unk28) + ((pPlayer->field_10D4->unk20 * *arg0) + (pPlayer->field_10D4->unk24 * arg0->unk4)))) + if ((flt_CODE_bss_80079980 + arg1) < ((pPlayer->field_10D4->m[2][0] * arg0->x) + (pPlayer->field_10D4->m[2][1] * arg0->y) + (pPlayer->field_10D4->m[2][2] * arg0->z))) { return 0; } - temp_f2 = (((*arg2 - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex); - sp38 = temp_f2; + temp_f2 = (((arg2[0] - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex); temp_f12 = (1.0f / sqrtf(((temp_f2 * temp_f2) + 1.0f))); temp_f2_2 = (temp_f2 * temp_f12); temp_f14 = -temp_f12; - temp_f10 = ((temp_f14 * *pPlayer->field_10D4) - (pPlayer->field_10D4->unk20 * temp_f2_2)); - sp54 = temp_f10; - temp_f4 = ((temp_f14 * pPlayer->field_10D4->unk4) - (pPlayer->field_10D4->unk24 * temp_f2_2)); - sp58 = temp_f4; - temp_f18 = ((temp_f14 * pPlayer->field_10D4->unk8) - (pPlayer->field_10D4->unk28 * temp_f2_2)); - sp5C = temp_f18; - if ((((pPlayer->field_10D4->unk38 * temp_f18) + ((temp_f10 * pPlayer->field_10D4->unk30) + (temp_f4 * pPlayer->field_10D4->unk34))) + arg1) < ((arg0->unk8 * temp_f18) + ((temp_f10 * *arg0) + (temp_f4 * arg0->unk4)))) + temp_f10 = ((temp_f14 * pPlayer->field_10D4->m[0][0]) - (pPlayer->field_10D4->m[2][0] * temp_f2_2)); + temp_f4 = ((temp_f14 * pPlayer->field_10D4->m[0][1]) - (pPlayer->field_10D4->m[2][1] * temp_f2_2)); + temp_f18 = ((temp_f14 * pPlayer->field_10D4->m[0][2]) - (pPlayer->field_10D4->m[2][2] * temp_f2_2)); + if ((((temp_f10 * pPlayer->field_10D4->m[3][0]) + (temp_f4 * pPlayer->field_10D4->m[3][1]) + (temp_f18 * pPlayer->field_10D4->m[3][2])) + arg1) < ((temp_f10 * arg0->x) + (temp_f4 * arg0->y) + (temp_f18 * arg0->z))) { return 0; } - temp_f2_3 = (-((arg2->unk8 - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex); - sp38 = temp_f2_3; - temp_f12_2 = (1.0f / sqrtf(((temp_f2_3 * temp_f2_3) + 1.0f), temp_f14, arg0)); + temp_f2_3 = (-((arg2[2] - pPlayer->c_screenleft) - pPlayer->c_halfwidth) * pPlayer->c_scalex); + temp_f12_2 = (1.0f / sqrtf(((temp_f2_3 * temp_f2_3) + 1.0f))); temp_f2_4 = (temp_f2_3 * temp_f12_2); - temp_f14_2 = --temp_f12_2; - temp_f6 = ((temp_f14_2 * *pPlayer->field_10D4) - (pPlayer->field_10D4->unk20 * temp_f2_4)); - sp44 = temp_f6; - temp_f8 = ((temp_f14_2 * pPlayer->field_10D4->unk4) - (pPlayer->field_10D4->unk24 * temp_f2_4)); - sp48 = temp_f8; - temp_f4_2 = ((temp_f14_2 * pPlayer->field_10D4->unk8) - (pPlayer->field_10D4->unk28 * temp_f2_4)); - sp4C = temp_f4_2; - if ((((pPlayer->field_10D4->unk38 * temp_f4_2) + ((temp_f6 * pPlayer->field_10D4->unk30) + (temp_f8 * pPlayer->field_10D4->unk34))) + arg1) < ((arg0->unk8 * temp_f4_2) + ((temp_f6 * *arg0) + (temp_f8 * arg0->unk4)))) + temp_f6 = ((temp_f12_2 * pPlayer->field_10D4->m[0][0]) - (pPlayer->field_10D4->m[2][0] * temp_f2_4)); + temp_f8 = ((temp_f12_2 * pPlayer->field_10D4->m[0][1]) - (pPlayer->field_10D4->m[2][1] * temp_f2_4)); + temp_f4_2 = ((temp_f12_2 * pPlayer->field_10D4->m[0][2]) - (pPlayer->field_10D4->m[2][2] * temp_f2_4)); + if ((((temp_f6 * pPlayer->field_10D4->m[3][0]) + (temp_f8 * pPlayer->field_10D4->m[3][1]) + (temp_f4_2 * pPlayer->field_10D4->m[3][2])) + arg1) < ((temp_f6 * arg0->x) + (temp_f8 * arg0->y) + (temp_f4_2 * arg0->z))) { return 0; } - temp_f2_5 = ((pPlayer->c_halfheight - (arg2->unk4 - pPlayer->c_screentop)) * pPlayer->c_scaley); - sp34 = temp_f2_5; - temp_f12_3 = (1.0f / sqrtf(((temp_f2_5 * temp_f2_5) + 1.0f), temp_f14_2, arg0)); + temp_f2_5 = ((pPlayer->c_halfheight - (arg2[1] - pPlayer->c_screentop)) * pPlayer->c_scaley); + temp_f12_3 = (1.0f / sqrtf(((temp_f2_5 * temp_f2_5) + 1.0f))); temp_f2_6 = (temp_f2_5 * temp_f12_3); - temp_f14_3 = --temp_f12_3; - temp_f8_2 = ((pPlayer->field_10D4->unk20 * temp_f2_6) + (temp_f14_3 * pPlayer->field_10D4->unk10)); - sp74 = temp_f8_2; - temp_f18_2 = ((pPlayer->field_10D4->unk24 * temp_f2_6) + (temp_f14_3 * pPlayer->field_10D4->unk14)); - sp78 = temp_f18_2; - temp_f4_3 = ((pPlayer->field_10D4->unk28 * temp_f2_6) + (temp_f14_3 * pPlayer->field_10D4->unk18)); - sp7C = temp_f4_3; - if ((((pPlayer->field_10D4->unk38 * temp_f4_3) + ((temp_f8_2 * pPlayer->field_10D4->unk30) + (temp_f18_2 * pPlayer->field_10D4->unk34))) + arg1) < ((arg0->unk8 * temp_f4_3) + ((temp_f8_2 * *arg0) + (temp_f18_2 * arg0->unk4)))) + temp_f8_2 = ((pPlayer->field_10D4->m[2][0] * temp_f2_6) + (temp_f12_3 * pPlayer->field_10D4->m[1][0])); + temp_f18_2 = ((pPlayer->field_10D4->m[2][1] * temp_f2_6) + (temp_f12_3 * pPlayer->field_10D4->m[1][1])); + temp_f4_3 = ((pPlayer->field_10D4->m[2][2] * temp_f2_6) + (temp_f12_3 * pPlayer->field_10D4->m[1][2])); + if ((((temp_f8_2 * pPlayer->field_10D4->m[3][0]) + (temp_f18_2 * pPlayer->field_10D4->m[3][1]) + (temp_f4_3 * pPlayer->field_10D4->m[3][2])) + arg1) < ((temp_f8_2 * arg0->x) + (temp_f18_2 * arg0->y) + (temp_f4_3 * arg0->z))) { return 0; } - temp_f2_7 = (-(pPlayer->c_halfheight - (arg2->unkC - pPlayer->c_screentop)) * pPlayer->c_scaley); - sp34 = temp_f2_7; - temp_f12_4 = (1.0f / sqrtf(((temp_f2_7 * temp_f2_7) + 1.0f), temp_f14_3, arg0)); + temp_f2_7 = (-(pPlayer->c_halfheight - (arg2[3] - pPlayer->c_screentop)) * pPlayer->c_scaley); + temp_f12_4 = (1.0f / sqrtf(((temp_f2_7 * temp_f2_7) + 1.0f))); temp_f2_8 = (temp_f2_7 * temp_f12_4); temp_f14_4 = -temp_f12_4; - temp_f6_2 = ((pPlayer->field_10D4->unk20 * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->unk10)); - sp64 = temp_f6_2; - temp_f10_2 = ((pPlayer->field_10D4->unk24 * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->unk14)); - sp68 = temp_f10_2; - temp_f18_3 = ((pPlayer->field_10D4->unk28 * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->unk18)); - sp6C = temp_f18_3; - if ((((pPlayer->field_10D4->unk38 * temp_f18_3) + ((temp_f6_2 * pPlayer->field_10D4->unk30) + (temp_f10_2 * pPlayer->field_10D4->unk34))) + arg1) < ((arg0->unk8 * temp_f18_3) + ((temp_f6_2 * *arg0) + (temp_f10_2 * arg0->unk4)))) + temp_f6_2 = ((pPlayer->field_10D4->m[2][0] * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->m[1][0])); + temp_f10_2 = ((pPlayer->field_10D4->m[2][1] * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->m[1][1])); + temp_f18_3 = ((pPlayer->field_10D4->m[2][2] * temp_f2_8) + (temp_f14_4 * pPlayer->field_10D4->m[1][2])); + if ((((temp_f6_2 * pPlayer->field_10D4->m[3][0]) + (temp_f10_2 * pPlayer->field_10D4->m[3][1]) + (temp_f18_3 * pPlayer->field_10D4->m[3][2])) + arg1) < ((temp_f6_2 * arg0->x) + (temp_f10_2 * arg0->y) + (temp_f18_3 * arg0->z))) { - + return 0; } return 1; } @@ -2570,7 +1692,7 @@ u32 sub_GAME_7F0790F0(void) s32 phi_s1_8; temp_s6 = get_cur_playernum(); - temp_s2 = get_num_players(); + temp_s2 = getPlayerCount(); phi_s1_2 = 1; phi_s7_2 = 0; if (dword_CODE_bss_80079C68 > 0) @@ -2588,7 +1710,7 @@ block_3: phi_s1_5 = phi_s1_7; if (phi_s0 != temp_s6) { - temp_t3 = (&ptr_BONDdata_p1 + (phi_s0 * 4)); + temp_t3 = (&players + (phi_s0 * 4)); phi_s1_5 = phi_s1_7; if ((*temp_t3)->unkA8 != 0) { @@ -2646,7 +1768,7 @@ block_15: phi_s1_6 = phi_s1_8; if (phi_s0_2 != temp_s6) { - temp_t5 = (&ptr_BONDdata_p1 + (phi_s0_2 * 4)); + temp_t5 = (&players + (phi_s0_2 * 4)); phi_s1_6 = phi_s1_8; if ((*temp_t5)->unkA8 != 0) { @@ -2706,7 +1828,7 @@ glabel sub_GAME_7F0790F0 /* 0ADC48 7F079118 AFB00020 */ sw $s0, 0x20($sp) /* 0ADC4C 7F07911C 0FC26C54 */ jal get_cur_playernum /* 0ADC50 7F079120 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0ADC54 7F079124 0FC26919 */ jal get_num_players +/* 0ADC54 7F079124 0FC26919 */ jal getPlayerCount /* 0ADC58 7F079128 0040B025 */ move $s6, $v0 /* 0ADC5C 7F07912C 3C0E8008 */ lui $t6, %hi(dword_CODE_bss_80079C68) /* 0ADC60 7F079130 8DCE9C68 */ lw $t6, %lo(dword_CODE_bss_80079C68)($t6) @@ -2717,9 +1839,9 @@ glabel sub_GAME_7F0790F0 /* 0ADC74 7F079144 3C01447A */ li $at, 0x447A0000 # 1000.000000 /* 0ADC78 7F079148 3C1E8008 */ lui $fp, %hi(pPlayer) /* 0ADC7C 7F07914C 3C158008 */ lui $s5, %hi(dword_CODE_bss_80079C28) -/* 0ADC80 7F079150 3C148008 */ lui $s4, %hi(ptr_BONDdata_p1) +/* 0ADC80 7F079150 3C148008 */ lui $s4, %hi(players) /* 0ADC84 7F079154 4481A000 */ mtc1 $at, $f20 -/* 0ADC88 7F079158 26949EE0 */ addiu $s4, %lo(ptr_BONDdata_p1) # addiu $s4, $s4, -0x6120 +/* 0ADC88 7F079158 26949EE0 */ addiu $s4, %lo(players) # addiu $s4, $s4, -0x6120 /* 0ADC8C 7F07915C 26B59C28 */ addiu $s5, %lo(dword_CODE_bss_80079C28) # addiu $s5, $s5, -0x63d8 /* 0ADC90 7F079160 27DEA0B0 */ addiu $fp, %lo(pPlayer) # addiu $fp, $fp, -0x5f50 /* 0ADC94 7F079164 8FC20000 */ lw $v0, ($fp) @@ -2791,12 +1913,12 @@ glabel sub_GAME_7F0790F0 /* 0ADD84 7F079254 8FC20000 */ lw $v0, ($fp) /* 0ADD88 7F079258 AFB3004C */ sw $s3, 0x4c($sp) .L7F07925C: -/* 0ADD8C 7F07925C 3C148008 */ lui $s4, %hi(ptr_BONDdata_p1) +/* 0ADD8C 7F07925C 3C148008 */ lui $s4, %hi(players) /* 0ADD90 7F079260 3C158008 */ lui $s5, %hi(dword_CODE_bss_80079C28) /* 0ADD94 7F079264 3C1E8008 */ lui $fp, %hi(pPlayer) /* 0ADD98 7F079268 27DEA0B0 */ addiu $fp, %lo(pPlayer) # addiu $fp, $fp, -0x5f50 /* 0ADD9C 7F07926C 26B59C28 */ addiu $s5, %lo(dword_CODE_bss_80079C28) # addiu $s5, $s5, -0x63d8 -/* 0ADDA0 7F079270 26949EE0 */ addiu $s4, %lo(ptr_BONDdata_p1) # addiu $s4, $s4, -0x6120 +/* 0ADDA0 7F079270 26949EE0 */ addiu $s4, %lo(players) # addiu $s4, $s4, -0x6120 /* 0ADDA4 7F079274 12200044 */ beqz $s1, .L7F079388 /* 0ADDA8 7F079278 8FB3004C */ lw $s3, 0x4c($sp) /* 0ADDAC 7F07927C 3C188008 */ lui $t8, %hi(dword_CODE_bss_80079C68) @@ -2903,24 +2025,20 @@ glabel sub_GAME_7F0790F0 ) #endif - - - - -#ifdef NONMATCHING +#ifdef VERSION_US void init_player_BONDdata(void) { - if (get_num_players() >= 2) + if (getPlayerCount() >= 2) { - pPlayer->controlstyle = get_player_control_style(get_cur_playernum()); + pPlayer->field_430 = get_player_control_style(get_cur_playernum()); cur_player_set_control_type(get_player_control_style(get_cur_playernum())); } - pPlayer->current_model_xpos = 0.0f; - pPlayer->current_model_ypos = 0.0f; - pPlayer->current_model_zpos = 0.0f; - pPlayer->previous_model_xpos = 0.0f; - pPlayer->previous_model_ypos = 0.0f; - pPlayer->previous_model_zpos = 0.0f; + pPlayer->current_model_pos[0] = 0.0f; + pPlayer->current_model_pos[1] = 0.0f; + pPlayer->current_model_pos[2] = 0.0f; + pPlayer->previous_model_pos[0] = 0.0f; + pPlayer->previous_model_pos[1] = 0.0f; + pPlayer->previous_model_pos[2] = 0.0f; pPlayer->current_room_xpos = 0.0f; pPlayer->current_room_ypos = 0.0f; pPlayer->current_room_zpos = 0.0f; @@ -2947,11 +2065,11 @@ void init_player_BONDdata(void) pPlayer->field_90 = 0.0f; pPlayer->field_94 = 0; pPlayer->field_98 = 0.0f; - pPlayer->field_1274 = 0.0f; + pPlayer->swaytarget = 0.0f; pPlayer->field_1278 = 0.0f; pPlayer->field_127C = 0.0f; - pPlayer->crouchposition = 2; - pPlayer->field_29FC = 2; + pPlayer->crouchpos = CROUCH_STAND; + pPlayer->autocrouchpos = CROUCH_STAND; pPlayer->ducking_height_offset = 0.0f; pPlayer->field_A4 = 0.0f; pPlayer->field_AC = 1; @@ -2967,11 +2085,11 @@ void init_player_BONDdata(void) pPlayer->healthshowtime = -1; pPlayer->field_1C0 = 0; pPlayer->field_1C4 = 0; - pPlayer->pause_animation_state = 0; + pPlayer->watch_animation_state = 0; pPlayer->paused_flag = 1; pPlayer->open_close_solo_watch_menu = 0; pPlayer->field_1A0 = 0; - pPlayer->bondfadefracnew = 0.0f; + pPlayer->field_19C = 0.0f; pPlayer->speedtheta = 0.0f; pPlayer->vv_costheta = 1.0f; pPlayer->vv_sintheta = 0.0f; @@ -3010,26 +2128,26 @@ void init_player_BONDdata(void) pPlayer->autoaimx = 0.0f; pPlayer->autoxaimtime = 0; pPlayer->autoxaimtime60 = -1; - pPlayer->tint_red = 0xff; - pPlayer->tint_green = 0xff; - pPlayer->tint_blue = 0xff; - pPlayer->tint_alpha = 0.0f; - pPlayer->field_3E0 = -1.0f; - pPlayer->time_for_fade = -1.0f; - pPlayer->field_3E8 = 0xff; - pPlayer->field_3EC = 0xff; - pPlayer->field_3F0 = 0xff; - pPlayer->field_3F4 = 0xff; - pPlayer->field_3F8 = 0xff; - pPlayer->field_3FC = 0xff; - pPlayer->field_400 = 0.0f; - pPlayer->field_404 = 0.0f; - pPlayer->viewport_alpha = -1.0f; + pPlayer->colourscreenred = 0xff; + pPlayer->colourscreengreen = 0xff; + pPlayer->colourscreenblue = 0xff; + pPlayer->colourscreenfrac = 0.0f; + pPlayer->colourfadetime60 = -1.0f; + pPlayer->colourfadetimemax60 = -1.0f; + pPlayer->colourfaderedold = 0xff; + pPlayer->colourfaderednew = 0xff; + pPlayer->colourfadegreenold = 0xff; + pPlayer->colourfadegreennew = 0xff; + pPlayer->colourfadeblueold = 0xff; + pPlayer->colourfadebluenew = 0xff; + pPlayer->colourfadefracold = 0.0f; + pPlayer->colourfadefracnew = 0.0f; pPlayer->bondfadetime60 = -1.0f; - pPlayer->bondfadetimemax = 0.0f; + pPlayer->bondfadetimemax60 = -1.0f; pPlayer->bondfadefracold = 0.0f; + pPlayer->bondfadefracnew = 0.0f; pPlayer->field_42C = 2; - pPlayer->controlstyle = 0; + pPlayer->field_430 = 0; pPlayer->pause_starting_angle = 0.0f; pPlayer->field_208 = 0.0f; pPlayer->pause_target_angle = 0.0f; @@ -3048,322 +2166,6 @@ void init_player_BONDdata(void) pPlayer->field_2A6C = 0; pPlayer->field_2A70 = 0; } -#else - -#ifdef VERSION_US -GLOBAL_ASM( -.text -glabel init_player_BONDdata -/* 0ADF1C 7F0793EC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0ADF20 7F0793F0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0ADF24 7F0793F4 0FC26919 */ jal get_num_players -/* 0ADF28 7F0793F8 00000000 */ nop -/* 0ADF2C 7F0793FC 28410002 */ slti $at, $v0, 2 -/* 0ADF30 7F079400 1420000E */ bnez $at, .L7F07943C -/* 0ADF34 7F079404 00000000 */ nop -/* 0ADF38 7F079408 0FC26C54 */ jal get_cur_playernum -/* 0ADF3C 7F07940C 00000000 */ nop -/* 0ADF40 7F079410 0FC0402F */ jal get_player_control_style -/* 0ADF44 7F079414 00402025 */ move $a0, $v0 -/* 0ADF48 7F079418 3C038008 */ lui $v1, %hi(pPlayer) -/* 0ADF4C 7F07941C 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0ADF50 7F079420 8C6E0000 */ lw $t6, ($v1) -/* 0ADF54 7F079424 0FC26C54 */ jal get_cur_playernum -/* 0ADF58 7F079428 ADC20430 */ sw $v0, 0x430($t6) -/* 0ADF5C 7F07942C 0FC0402F */ jal get_player_control_style -/* 0ADF60 7F079430 00402025 */ move $a0, $v0 -/* 0ADF64 7F079434 0FC29374 */ jal cur_player_set_control_type -/* 0ADF68 7F079438 00402025 */ move $a0, $v0 -.L7F07943C: -/* 0ADF6C 7F07943C 3C038008 */ lui $v1, %hi(pPlayer) -/* 0ADF70 7F079440 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0ADF74 7F079444 44800000 */ mtc1 $zero, $f0 -/* 0ADF78 7F079448 8C6F0000 */ lw $t7, ($v1) -/* 0ADF7C 7F07944C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0ADF80 7F079450 44811000 */ mtc1 $at, $f2 -/* 0ADF84 7F079454 E5E00038 */ swc1 $f0, 0x38($t7) -/* 0ADF88 7F079458 8C780000 */ lw $t8, ($v1) -/* 0ADF8C 7F07945C 24070002 */ li $a3, 2 -/* 0ADF90 7F079460 24050001 */ li $a1, 1 -/* 0ADF94 7F079464 E700003C */ swc1 $f0, 0x3c($t8) -/* 0ADF98 7F079468 8C790000 */ lw $t9, ($v1) -/* 0ADF9C 7F07946C 2406FFFF */ li $a2, -1 -/* 0ADFA0 7F079470 3C01C080 */ li $at, 0xC0800000 # -4.000000 -/* 0ADFA4 7F079474 E7200040 */ swc1 $f0, 0x40($t9) -/* 0ADFA8 7F079478 8C680000 */ lw $t0, ($v1) -/* 0ADFAC 7F07947C 44812000 */ mtc1 $at, $f4 -/* 0ADFB0 7F079480 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0ADFB4 7F079484 E5000044 */ swc1 $f0, 0x44($t0) -/* 0ADFB8 7F079488 8C690000 */ lw $t1, ($v1) -/* 0ADFBC 7F07948C E5200048 */ swc1 $f0, 0x48($t1) -/* 0ADFC0 7F079490 8C6A0000 */ lw $t2, ($v1) -/* 0ADFC4 7F079494 E540004C */ swc1 $f0, 0x4c($t2) -/* 0ADFC8 7F079498 8C6B0000 */ lw $t3, ($v1) -/* 0ADFCC 7F07949C E5600050 */ swc1 $f0, 0x50($t3) -/* 0ADFD0 7F0794A0 8C6C0000 */ lw $t4, ($v1) -/* 0ADFD4 7F0794A4 E5800054 */ swc1 $f0, 0x54($t4) -/* 0ADFD8 7F0794A8 8C6D0000 */ lw $t5, ($v1) -/* 0ADFDC 7F0794AC E5A00058 */ swc1 $f0, 0x58($t5) -/* 0ADFE0 7F0794B0 8C6E0000 */ lw $t6, ($v1) -/* 0ADFE4 7F0794B4 ADC00000 */ sw $zero, ($t6) -/* 0ADFE8 7F0794B8 8C6F0000 */ lw $t7, ($v1) -/* 0ADFEC 7F0794BC E5E00004 */ swc1 $f0, 4($t7) -/* 0ADFF0 7F0794C0 8C780000 */ lw $t8, ($v1) -/* 0ADFF4 7F0794C4 E7000008 */ swc1 $f0, 8($t8) -/* 0ADFF8 7F0794C8 8C790000 */ lw $t9, ($v1) -/* 0ADFFC 7F0794CC E720000C */ swc1 $f0, 0xc($t9) -/* 0AE000 7F0794D0 8C680000 */ lw $t0, ($v1) -/* 0AE004 7F0794D4 E5000010 */ swc1 $f0, 0x10($t0) -/* 0AE008 7F0794D8 8C690000 */ lw $t1, ($v1) -/* 0AE00C 7F0794DC E5200014 */ swc1 $f0, 0x14($t1) -/* 0AE010 7F0794E0 8C6A0000 */ lw $t2, ($v1) -/* 0AE014 7F0794E4 E5420018 */ swc1 $f2, 0x18($t2) -/* 0AE018 7F0794E8 8C6B0000 */ lw $t3, ($v1) -/* 0AE01C 7F0794EC E560001C */ swc1 $f0, 0x1c($t3) -/* 0AE020 7F0794F0 8C6C0000 */ lw $t4, ($v1) -/* 0AE024 7F0794F4 E5820020 */ swc1 $f2, 0x20($t4) -/* 0AE028 7F0794F8 8C6D0000 */ lw $t5, ($v1) -/* 0AE02C 7F0794FC E5A00024 */ swc1 $f0, 0x24($t5) -/* 0AE030 7F079500 8C6E0000 */ lw $t6, ($v1) -/* 0AE034 7F079504 E5C00028 */ swc1 $f0, 0x28($t6) -/* 0AE038 7F079508 8C6F0000 */ lw $t7, ($v1) -/* 0AE03C 7F07950C E5E0002C */ swc1 $f0, 0x2c($t7) -/* 0AE040 7F079510 8C780000 */ lw $t8, ($v1) -/* 0AE044 7F079514 E7000030 */ swc1 $f0, 0x30($t8) -/* 0AE048 7F079518 8C790000 */ lw $t9, ($v1) -/* 0AE04C 7F07951C AF200034 */ sw $zero, 0x34($t9) -/* 0AE050 7F079520 8C680000 */ lw $t0, ($v1) -/* 0AE054 7F079524 E50003C4 */ swc1 $f0, 0x3c4($t0) -/* 0AE058 7F079528 8C690000 */ lw $t1, ($v1) -/* 0AE05C 7F07952C E52003C8 */ swc1 $f0, 0x3c8($t1) -/* 0AE060 7F079530 8C6A0000 */ lw $t2, ($v1) -/* 0AE064 7F079534 E54203CC */ swc1 $f2, 0x3cc($t2) -/* 0AE068 7F079538 8C6B0000 */ lw $t3, ($v1) -/* 0AE06C 7F07953C E5600084 */ swc1 $f0, 0x84($t3) -/* 0AE070 7F079540 8C6C0000 */ lw $t4, ($v1) -/* 0AE074 7F079544 E5800088 */ swc1 $f0, 0x88($t4) -/* 0AE078 7F079548 8C6D0000 */ lw $t5, ($v1) -/* 0AE07C 7F07954C ADA0008C */ sw $zero, 0x8c($t5) -/* 0AE080 7F079550 8C6E0000 */ lw $t6, ($v1) -/* 0AE084 7F079554 E5C00090 */ swc1 $f0, 0x90($t6) -/* 0AE088 7F079558 8C6F0000 */ lw $t7, ($v1) -/* 0AE08C 7F07955C ADE00094 */ sw $zero, 0x94($t7) -/* 0AE090 7F079560 8C780000 */ lw $t8, ($v1) -/* 0AE094 7F079564 E7000098 */ swc1 $f0, 0x98($t8) -/* 0AE098 7F079568 8C790000 */ lw $t9, ($v1) -/* 0AE09C 7F07956C E7201274 */ swc1 $f0, 0x1274($t9) -/* 0AE0A0 7F079570 8C680000 */ lw $t0, ($v1) -/* 0AE0A4 7F079574 E5001278 */ swc1 $f0, 0x1278($t0) -/* 0AE0A8 7F079578 8C690000 */ lw $t1, ($v1) -/* 0AE0AC 7F07957C E520127C */ swc1 $f0, 0x127c($t1) -/* 0AE0B0 7F079580 8C6A0000 */ lw $t2, ($v1) -/* 0AE0B4 7F079584 AD47009C */ sw $a3, 0x9c($t2) -/* 0AE0B8 7F079588 8C6B0000 */ lw $t3, ($v1) -/* 0AE0BC 7F07958C AD6729FC */ sw $a3, 0x29fc($t3) -/* 0AE0C0 7F079590 8C6C0000 */ lw $t4, ($v1) -/* 0AE0C4 7F079594 E58000A0 */ swc1 $f0, 0xa0($t4) -/* 0AE0C8 7F079598 8C6D0000 */ lw $t5, ($v1) -/* 0AE0CC 7F07959C E5A000A4 */ swc1 $f0, 0xa4($t5) -/* 0AE0D0 7F0795A0 8C6E0000 */ lw $t6, ($v1) -/* 0AE0D4 7F0795A4 ADC500AC */ sw $a1, 0xac($t6) -/* 0AE0D8 7F0795A8 8C6F0000 */ lw $t7, ($v1) -/* 0AE0DC 7F0795AC ADE000D0 */ sw $zero, 0xd0($t7) -/* 0AE0E0 7F0795B0 8C780000 */ lw $t8, ($v1) -/* 0AE0E4 7F0795B4 AF0000D8 */ sw $zero, 0xd8($t8) -/* 0AE0E8 7F0795B8 8C790000 */ lw $t9, ($v1) -/* 0AE0EC 7F0795BC E72200DC */ swc1 $f2, 0xdc($t9) -/* 0AE0F0 7F0795C0 8C680000 */ lw $t0, ($v1) -/* 0AE0F4 7F0795C4 E50000E0 */ swc1 $f0, 0xe0($t0) -/* 0AE0F8 7F0795C8 8C690000 */ lw $t1, ($v1) -/* 0AE0FC 7F0795CC E52200E4 */ swc1 $f2, 0xe4($t1) -/* 0AE100 7F0795D0 8C6A0000 */ lw $t2, ($v1) -/* 0AE104 7F0795D4 E54000E8 */ swc1 $f0, 0xe8($t2) -/* 0AE108 7F0795D8 8C6B0000 */ lw $t3, ($v1) -/* 0AE10C 7F0795DC E56200EC */ swc1 $f2, 0xec($t3) -/* 0AE110 7F0795E0 8C6C0000 */ lw $t4, ($v1) -/* 0AE114 7F0795E4 E58000F0 */ swc1 $f0, 0xf0($t4) -/* 0AE118 7F0795E8 8C6D0000 */ lw $t5, ($v1) -/* 0AE11C 7F0795EC ADA600F4 */ sw $a2, 0xf4($t5) -/* 0AE120 7F0795F0 8C6E0000 */ lw $t6, ($v1) -/* 0AE124 7F0795F4 ADC600F8 */ sw $a2, 0xf8($t6) -/* 0AE128 7F0795F8 8C6F0000 */ lw $t7, ($v1) -/* 0AE12C 7F0795FC ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0AE130 7F079600 8C780000 */ lw $t8, ($v1) -/* 0AE134 7F079604 AF0001C4 */ sw $zero, 0x1c4($t8) -/* 0AE138 7F079608 8C790000 */ lw $t9, ($v1) -/* 0AE13C 7F07960C AF2001C8 */ sw $zero, 0x1c8($t9) -/* 0AE140 7F079610 8C680000 */ lw $t0, ($v1) -/* 0AE144 7F079614 AD0501CC */ sw $a1, 0x1cc($t0) -/* 0AE148 7F079618 8C690000 */ lw $t1, ($v1) -/* 0AE14C 7F07961C AD2001D0 */ sw $zero, 0x1d0($t1) -/* 0AE150 7F079620 8C6A0000 */ lw $t2, ($v1) -/* 0AE154 7F079624 AD4001A0 */ sw $zero, 0x1a0($t2) -/* 0AE158 7F079628 8C6B0000 */ lw $t3, ($v1) -/* 0AE15C 7F07962C E560019C */ swc1 $f0, 0x19c($t3) -/* 0AE160 7F079630 8C6C0000 */ lw $t4, ($v1) -/* 0AE164 7F079634 E580014C */ swc1 $f0, 0x14c($t4) -/* 0AE168 7F079638 8C6D0000 */ lw $t5, ($v1) -/* 0AE16C 7F07963C E5A20150 */ swc1 $f2, 0x150($t5) -/* 0AE170 7F079640 8C6E0000 */ lw $t6, ($v1) -/* 0AE174 7F079644 E5C00154 */ swc1 $f0, 0x154($t6) -/* 0AE178 7F079648 8C6F0000 */ lw $t7, ($v1) -/* 0AE17C 7F07964C E5E40158 */ swc1 $f4, 0x158($t7) -/* 0AE180 7F079650 8C640000 */ lw $a0, ($v1) -/* 0AE184 7F079654 C4860158 */ lwc1 $f6, 0x158($a0) -/* 0AE188 7F079658 E486015C */ swc1 $f6, 0x15c($a0) -/* 0AE18C 7F07965C 8C640000 */ lw $a0, ($v1) -/* 0AE190 7F079660 C48C015C */ lwc1 $f12, 0x15c($a0) -/* 0AE194 7F079664 4600603C */ c.lt.s $f12, $f0 -/* 0AE198 7F079668 00000000 */ nop -/* 0AE19C 7F07966C 45020007 */ bc1fl .L7F07968C -/* 0AE1A0 7F079670 E4800160 */ swc1 $f0, 0x160($a0) -/* 0AE1A4 7F079674 44814000 */ mtc1 $at, $f8 -/* 0AE1A8 7F079678 00000000 */ nop -/* 0AE1AC 7F07967C 46086280 */ add.s $f10, $f12, $f8 -/* 0AE1B0 7F079680 E48A015C */ swc1 $f10, 0x15c($a0) -/* 0AE1B4 7F079684 8C640000 */ lw $a0, ($v1) -/* 0AE1B8 7F079688 E4800160 */ swc1 $f0, 0x160($a0) -.L7F07968C: -/* 0AE1BC 7F07968C 8C780000 */ lw $t8, ($v1) -/* 0AE1C0 7F079690 240200FF */ li $v0, 255 -/* 0AE1C4 7F079694 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0AE1C8 7F079698 E7020164 */ swc1 $f2, 0x164($t8) -/* 0AE1CC 7F07969C 8C790000 */ lw $t9, ($v1) -/* 0AE1D0 7F0796A0 44816000 */ mtc1 $at, $f12 -/* 0AE1D4 7F0796A4 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0AE1D8 7F0796A8 E7200168 */ swc1 $f0, 0x168($t9) -/* 0AE1DC 7F0796AC 8C680000 */ lw $t0, ($v1) -/* 0AE1E0 7F0796B0 44818000 */ mtc1 $at, $f16 -/* 0AE1E4 7F0796B4 E500016C */ swc1 $f0, 0x16c($t0) -/* 0AE1E8 7F0796B8 8C690000 */ lw $t1, ($v1) -/* 0AE1EC 7F0796BC E5200170 */ swc1 $f0, 0x170($t1) -/* 0AE1F0 7F0796C0 8C6A0000 */ lw $t2, ($v1) -/* 0AE1F4 7F0796C4 E5400174 */ swc1 $f0, 0x174($t2) -/* 0AE1F8 7F0796C8 8C6B0000 */ lw $t3, ($v1) -/* 0AE1FC 7F0796CC E5602A4C */ swc1 $f0, 0x2a4c($t3) -/* 0AE200 7F0796D0 8C6C0000 */ lw $t4, ($v1) -/* 0AE204 7F0796D4 E5820178 */ swc1 $f2, 0x178($t4) -/* 0AE208 7F0796D8 8C6D0000 */ lw $t5, ($v1) -/* 0AE20C 7F0796DC ADA0017C */ sw $zero, 0x17c($t5) -/* 0AE210 7F0796E0 8C6E0000 */ lw $t6, ($v1) -/* 0AE214 7F0796E4 E5C00180 */ swc1 $f0, 0x180($t6) -/* 0AE218 7F0796E8 8C6F0000 */ lw $t7, ($v1) -/* 0AE21C 7F0796EC E5E00184 */ swc1 $f0, 0x184($t7) -/* 0AE220 7F0796F0 8C780000 */ lw $t8, ($v1) -/* 0AE224 7F0796F4 E7000188 */ swc1 $f0, 0x188($t8) -/* 0AE228 7F0796F8 8C790000 */ lw $t9, ($v1) -/* 0AE22C 7F0796FC AF200104 */ sw $zero, 0x104($t9) -/* 0AE230 7F079700 8C680000 */ lw $t0, ($v1) -/* 0AE234 7F079704 AD000108 */ sw $zero, 0x108($t0) -/* 0AE238 7F079708 8C690000 */ lw $t1, ($v1) -/* 0AE23C 7F07970C AD20010C */ sw $zero, 0x10c($t1) -/* 0AE240 7F079710 8C6A0000 */ lw $t2, ($v1) -/* 0AE244 7F079714 AD400110 */ sw $zero, 0x110($t2) -/* 0AE248 7F079718 8C6B0000 */ lw $t3, ($v1) -/* 0AE24C 7F07971C AD650114 */ sw $a1, 0x114($t3) -/* 0AE250 7F079720 8C6C0000 */ lw $t4, ($v1) -/* 0AE254 7F079724 AD850118 */ sw $a1, 0x118($t4) -/* 0AE258 7F079728 8C6D0000 */ lw $t5, ($v1) -/* 0AE25C 7F07972C ADA0011C */ sw $zero, 0x11c($t5) -/* 0AE260 7F079730 8C6E0000 */ lw $t6, ($v1) -/* 0AE264 7F079734 ADC50120 */ sw $a1, 0x120($t6) -/* 0AE268 7F079738 8C6F0000 */ lw $t7, ($v1) -/* 0AE26C 7F07973C ADE00124 */ sw $zero, 0x124($t7) -/* 0AE270 7F079740 8C780000 */ lw $t8, ($v1) -/* 0AE274 7F079744 AF050128 */ sw $a1, 0x128($t8) -/* 0AE278 7F079748 8C790000 */ lw $t9, ($v1) -/* 0AE27C 7F07974C E720012C */ swc1 $f0, 0x12c($t9) -/* 0AE280 7F079750 8C680000 */ lw $t0, ($v1) -/* 0AE284 7F079754 AD000130 */ sw $zero, 0x130($t0) -/* 0AE288 7F079758 8C690000 */ lw $t1, ($v1) -/* 0AE28C 7F07975C AD260134 */ sw $a2, 0x134($t1) -/* 0AE290 7F079760 8C6A0000 */ lw $t2, ($v1) -/* 0AE294 7F079764 AD450138 */ sw $a1, 0x138($t2) -/* 0AE298 7F079768 8C6B0000 */ lw $t3, ($v1) -/* 0AE29C 7F07976C E560013C */ swc1 $f0, 0x13c($t3) -/* 0AE2A0 7F079770 8C6C0000 */ lw $t4, ($v1) -/* 0AE2A4 7F079774 AD800140 */ sw $zero, 0x140($t4) -/* 0AE2A8 7F079778 8C6D0000 */ lw $t5, ($v1) -/* 0AE2AC 7F07977C ADA60144 */ sw $a2, 0x144($t5) -/* 0AE2B0 7F079780 8C6E0000 */ lw $t6, ($v1) -/* 0AE2B4 7F079784 ADC203D0 */ sw $v0, 0x3d0($t6) -/* 0AE2B8 7F079788 8C6F0000 */ lw $t7, ($v1) -/* 0AE2BC 7F07978C ADE203D4 */ sw $v0, 0x3d4($t7) -/* 0AE2C0 7F079790 8C780000 */ lw $t8, ($v1) -/* 0AE2C4 7F079794 AF0203D8 */ sw $v0, 0x3d8($t8) -/* 0AE2C8 7F079798 8C790000 */ lw $t9, ($v1) -/* 0AE2CC 7F07979C E72003DC */ swc1 $f0, 0x3dc($t9) -/* 0AE2D0 7F0797A0 8C680000 */ lw $t0, ($v1) -/* 0AE2D4 7F0797A4 E50C03E0 */ swc1 $f12, 0x3e0($t0) -/* 0AE2D8 7F0797A8 8C690000 */ lw $t1, ($v1) -/* 0AE2DC 7F0797AC E52C03E4 */ swc1 $f12, 0x3e4($t1) -/* 0AE2E0 7F0797B0 8C6A0000 */ lw $t2, ($v1) -/* 0AE2E4 7F0797B4 AD4203E8 */ sw $v0, 0x3e8($t2) -/* 0AE2E8 7F0797B8 8C6B0000 */ lw $t3, ($v1) -/* 0AE2EC 7F0797BC AD6203EC */ sw $v0, 0x3ec($t3) -/* 0AE2F0 7F0797C0 8C6C0000 */ lw $t4, ($v1) -/* 0AE2F4 7F0797C4 AD8203F0 */ sw $v0, 0x3f0($t4) -/* 0AE2F8 7F0797C8 8C6D0000 */ lw $t5, ($v1) -/* 0AE2FC 7F0797CC ADA203F4 */ sw $v0, 0x3f4($t5) -/* 0AE300 7F0797D0 8C6E0000 */ lw $t6, ($v1) -/* 0AE304 7F0797D4 ADC203F8 */ sw $v0, 0x3f8($t6) -/* 0AE308 7F0797D8 8C6F0000 */ lw $t7, ($v1) -/* 0AE30C 7F0797DC ADE203FC */ sw $v0, 0x3fc($t7) -/* 0AE310 7F0797E0 8C780000 */ lw $t8, ($v1) -/* 0AE314 7F0797E4 E7000400 */ swc1 $f0, 0x400($t8) -/* 0AE318 7F0797E8 8C790000 */ lw $t9, ($v1) -/* 0AE31C 7F0797EC E7200404 */ swc1 $f0, 0x404($t9) -/* 0AE320 7F0797F0 8C680000 */ lw $t0, ($v1) -/* 0AE324 7F0797F4 E50C018C */ swc1 $f12, 0x18c($t0) -/* 0AE328 7F0797F8 8C690000 */ lw $t1, ($v1) -/* 0AE32C 7F0797FC E52C0190 */ swc1 $f12, 0x190($t1) -/* 0AE330 7F079800 8C6A0000 */ lw $t2, ($v1) -/* 0AE334 7F079804 E5400194 */ swc1 $f0, 0x194($t2) -/* 0AE338 7F079808 8C6B0000 */ lw $t3, ($v1) -/* 0AE33C 7F07980C E5600198 */ swc1 $f0, 0x198($t3) -/* 0AE340 7F079810 8C6C0000 */ lw $t4, ($v1) -/* 0AE344 7F079814 AD87042C */ sw $a3, 0x42c($t4) -/* 0AE348 7F079818 8C6D0000 */ lw $t5, ($v1) -/* 0AE34C 7F07981C ADA00430 */ sw $zero, 0x430($t5) -/* 0AE350 7F079820 8C6E0000 */ lw $t6, ($v1) -/* 0AE354 7F079824 E5C00204 */ swc1 $f0, 0x204($t6) -/* 0AE358 7F079828 8C6F0000 */ lw $t7, ($v1) -/* 0AE35C 7F07982C E5E00208 */ swc1 $f0, 0x208($t7) -/* 0AE360 7F079830 8C780000 */ lw $t8, ($v1) -/* 0AE364 7F079834 E700020C */ swc1 $f0, 0x20c($t8) -/* 0AE368 7F079838 8C790000 */ lw $t9, ($v1) -/* 0AE36C 7F07983C E7200210 */ swc1 $f0, 0x210($t9) -/* 0AE370 7F079840 8C680000 */ lw $t0, ($v1) -/* 0AE374 7F079844 E5000214 */ swc1 $f0, 0x214($t0) -/* 0AE378 7F079848 8C690000 */ lw $t1, ($v1) -/* 0AE37C 7F07984C AD200218 */ sw $zero, 0x218($t1) -/* 0AE380 7F079850 8C6A0000 */ lw $t2, ($v1) -/* 0AE384 7F079854 AD400220 */ sw $zero, 0x220($t2) -/* 0AE388 7F079858 8C6B0000 */ lw $t3, ($v1) -/* 0AE38C 7F07985C E5600224 */ swc1 $f0, 0x224($t3) -/* 0AE390 7F079860 8C6C0000 */ lw $t4, ($v1) -/* 0AE394 7F079864 AD800200 */ sw $zero, 0x200($t4) -/* 0AE398 7F079868 8C6D0000 */ lw $t5, ($v1) -/* 0AE39C 7F07986C A5A003B4 */ sh $zero, 0x3b4($t5) -/* 0AE3A0 7F079870 8C6E0000 */ lw $t6, ($v1) -/* 0AE3A4 7F079874 A5C003B6 */ sh $zero, 0x3b6($t6) -/* 0AE3A8 7F079878 8C6F0000 */ lw $t7, ($v1) -/* 0AE3AC 7F07987C E5F029C0 */ swc1 $f16, 0x29c0($t7) -/* 0AE3B0 7F079880 8C780000 */ lw $t8, ($v1) -/* 0AE3B4 7F079884 A7062A04 */ sh $a2, 0x2a04($t8) -/* 0AE3B8 7F079888 8C790000 */ lw $t9, ($v1) -/* 0AE3BC 7F07988C E7202A08 */ swc1 $f0, 0x2a08($t9) -/* 0AE3C0 7F079890 8C680000 */ lw $t0, ($v1) -/* 0AE3C4 7F079894 E5002A0C */ swc1 $f0, 0x2a0c($t0) -/* 0AE3C8 7F079898 8C690000 */ lw $t1, ($v1) -/* 0AE3CC 7F07989C AD202A6C */ sw $zero, 0x2a6c($t1) -/* 0AE3D0 7F0798A0 8C6A0000 */ lw $t2, ($v1) -/* 0AE3D4 7F0798A4 AD402A70 */ sw $zero, 0x2a70($t2) -/* 0AE3D8 7F0798A8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AE3DC 7F0798AC 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0AE3E0 7F0798B0 03E00008 */ jr $ra -/* 0AE3E4 7F0798B4 00000000 */ nop -) #endif #ifdef VERSION_JP @@ -3372,7 +2174,7 @@ GLOBAL_ASM( glabel init_player_BONDdata /* 0AE54C 7F0799DC 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0AE550 7F0799E0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0AE554 7F0799E4 0FC26C01 */ jal get_num_players +/* 0AE554 7F0799E4 0FC26C01 */ jal getPlayerCount /* 0AE558 7F0799E8 00000000 */ nop /* 0AE55C 7F0799EC 28410002 */ slti $at, $v0, 2 /* 0AE560 7F0799F0 1420000E */ bnez $at, .L7F079A2C @@ -3682,9 +2484,6 @@ glabel init_player_BONDdata ) #endif -#endif - - #ifdef NONMATCHING void sub_GAME_7F0798B8(void) { ? temp_ret; @@ -3696,7 +2495,7 @@ void sub_GAME_7F0798B8(void) { pPlayer->field_29F4 = get_mission_timer(); pPlayer->field_2A00 = 0; add_item_to_inventory(1); - temp_ret = get_num_players(); + temp_ret = getPlayerCount(); phi_return = temp_ret; if (temp_ret >= 2) { @@ -3714,6 +2513,36 @@ void sub_GAME_7F0798B8(void) { } #else GLOBAL_ASM( +.late_rodata +glabel D_80054FB8 +.word 0 +glabel D_80054FBC +.word 0 + +/*D:80054FC0*/ +glabel a8s +/*"%8s"*/ +.word 0x25387300 + +glabel aX4_0f +/*"x %4.0f"*/ +.word 0x78202534 +.word 0x2E306600 + +glabel aY4_0f +/*"y %4.0f"*/ +.word 0x79202534 +.word 0x2E306600 + +glabel aZ4_0f +/*"z %4.0f"*/ +.word 0x7A202534 +.word 0x2E306600 + +glabel aS3d +/*"%s %3d"*/ +.word 0x25732025 +.word 0x33640000 .text glabel sub_GAME_7F0798B8 /* 0AE3E8 7F0798B8 3C0E8008 */ lui $t6, %hi(pPlayersPerm) @@ -3745,7 +2574,7 @@ glabel sub_GAME_7F0798B8 /* 0AE450 7F079920 8C680000 */ lw $t0, ($v1) /* 0AE454 7F079924 0FC23122 */ jal add_item_to_inventory /* 0AE458 7F079928 AD002A00 */ sw $zero, 0x2a00($t0) -/* 0AE45C 7F07992C 0FC26919 */ jal get_num_players +/* 0AE45C 7F07992C 0FC26919 */ jal getPlayerCount /* 0AE460 7F079930 00000000 */ nop /* 0AE464 7F079934 28410002 */ slti $at, $v0, 2 /* 0AE468 7F079938 1420000F */ bnez $at, .L7F079978 @@ -3773,149 +2602,33 @@ glabel sub_GAME_7F0798B8 ) #endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F079988(s32 arg0) { - // Node 0 - pPlayer->field_1274 = (f32) ((f32) arg0 * 75.0f); - return; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F079988 -/* 0AE4B8 7F079988 44842000 */ mtc1 $a0, $f4 -/* 0AE4BC 7F07998C 3C014296 */ li $at, 0x42960000 # 75.000000 -/* 0AE4C0 7F079990 44814000 */ mtc1 $at, $f8 -/* 0AE4C4 7F079994 468021A0 */ cvt.s.w $f6, $f4 -/* 0AE4C8 7F079998 3C0E8008 */ lui $t6, %hi(pPlayer) -/* 0AE4CC 7F07999C 8DCEA0B0 */ lw $t6, %lo(pPlayer)($t6) -/* 0AE4D0 7F0799A0 46083282 */ mul.s $f10, $f6, $f8 -/* 0AE4D4 7F0799A4 03E00008 */ jr $ra -/* 0AE4D8 7F0799A8 E5CA1274 */ swc1 $f10, 0x1274($t6) -) -#endif - - - - - - -void change_crouch_position(int position) -{ - pPlayer->crouchposition = pPlayer->crouchposition + position; - if (pPlayer->crouchposition < 0) { - pPlayer->crouchposition = 0; - return; - } - if (2 < pPlayer->crouchposition) { - pPlayer->crouchposition = 2; - } - return; +void currentPlayerSetSwayTarget(s32 value) { + pPlayer->swaytarget = (value * 75.0f); } +void currentPlayerAdjustCrouchPos(s32 value) { + pPlayer->crouchpos = pPlayer->crouchpos + value; - - - -#ifdef NONMATCHING -s32 sub_GAME_7F0799F0(void) { - // Node 0 - if (pPlayer->crouchposition < pPlayer->field_29FC) - { - // Node 1 - return pPlayer->crouchposition; + if (pPlayer->crouchpos < CROUCH_SQUAT) { + pPlayer->crouchpos = CROUCH_SQUAT; + } else if (pPlayer->crouchpos > CROUCH_STAND) { + pPlayer->crouchpos = CROUCH_STAND; } - // Node 2 - return pPlayer->field_29FC; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0799F0 -/* 0AE520 7F0799F0 3C028008 */ lui $v0, %hi(pPlayer) -/* 0AE524 7F0799F4 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0AE528 7F0799F8 8C43009C */ lw $v1, 0x9c($v0) -/* 0AE52C 7F0799FC 8C4429FC */ lw $a0, 0x29fc($v0) -/* 0AE530 7F079A00 0064082A */ slt $at, $v1, $a0 -/* 0AE534 7F079A04 10200003 */ beqz $at, .L7F079A14 -/* 0AE538 7F079A08 00802825 */ move $a1, $a0 -/* 0AE53C 7F079A0C 03E00008 */ jr $ra -/* 0AE540 7F079A10 00601025 */ move $v0, $v1 -.L7F079A14: -/* 0AE544 7F079A14 03E00008 */ jr $ra -/* 0AE548 7F079A18 00A01025 */ move $v0, $a1 -) -#endif - - - - - -#ifdef NONMATCHING -s32 sub_GAME_7F079A1C(s32 arg0) { - void *temp_v0; - - // Node 0 - temp_v0 = (&ptr_BONDdata_p1 + (arg0 * 4)); - if (*temp_v0->unk9C < *temp_v0->unk29FC) - { - // Node 1 - return *temp_v0->unk9C; - } - // Node 2 - return *temp_v0->unk29FC; +s32 currentPlayerGetCrouchPos(void) { + return ((pPlayer->crouchpos < pPlayer->autocrouchpos) ? pPlayer->crouchpos : pPlayer->autocrouchpos); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F079A1C -/* 0AE54C 7F079A1C 00047080 */ sll $t6, $a0, 2 -/* 0AE550 7F079A20 3C028008 */ lui $v0, %hi(ptr_BONDdata_p1) -/* 0AE554 7F079A24 004E1021 */ addu $v0, $v0, $t6 -/* 0AE558 7F079A28 8C429EE0 */ lw $v0, %lo(ptr_BONDdata_p1)($v0) -/* 0AE55C 7F079A2C 8C43009C */ lw $v1, 0x9c($v0) -/* 0AE560 7F079A30 8C4529FC */ lw $a1, 0x29fc($v0) -/* 0AE564 7F079A34 0065082A */ slt $at, $v1, $a1 -/* 0AE568 7F079A38 10200003 */ beqz $at, .L7F079A48 -/* 0AE56C 7F079A3C 00A02025 */ move $a0, $a1 -/* 0AE570 7F079A40 03E00008 */ jr $ra -/* 0AE574 7F079A44 00601025 */ move $v0, $v1 -.L7F079A48: -/* 0AE578 7F079A48 03E00008 */ jr $ra -/* 0AE57C 7F079A4C 00801025 */ move $v0, $a0 -) -#endif - - - - - -#ifdef NONMATCHING -void setptrBONDdata(s32 arg0) { - // Node 0 - *pPlayer = arg0; - return; +s32 playerGetCrouchPos(s32 playernum) { + return (players[playernum]->crouchpos < players[playernum]->autocrouchpos) + ? players[playernum]->crouchpos + : players[playernum]->autocrouchpos; } -#else -GLOBAL_ASM( -.text -glabel setptrBONDdata -/* 0AE580 7F079A50 3C0E8008 */ lui $t6, %hi(pPlayer) -/* 0AE584 7F079A54 8DCEA0B0 */ lw $t6, %lo(pPlayer)($t6) -/* 0AE588 7F079A58 03E00008 */ jr $ra -/* 0AE58C 7F079A5C ADC40000 */ sw $a0, ($t6) -) -#endif - - - +void currentPlayerSetField00(s32 value) { + pPlayer->unknown = value; +} #ifdef NONMATCHING void *sub_GAME_7F079A60(void *arg0, void *arg1, void *arg2, s32 arg3, void *arg4) { @@ -4256,7 +2969,7 @@ glabel solo_char_load /* 0AE8DC 7F079DAC AFA00038 */ sw $zero, 0x38($sp) /* 0AE8E0 7F079DB0 0FC1F799 */ jal sub_GAME_7F07DE64 /* 0AE8E4 7F079DB4 8C84A0B0 */ lw $a0, %lo(pPlayer)($a0) -/* 0AE8E8 7F079DB8 0FC26919 */ jal get_num_players +/* 0AE8E8 7F079DB8 0FC26919 */ jal getPlayerCount /* 0AE8EC 7F079DBC 00000000 */ nop /* 0AE8F0 7F079DC0 24010001 */ li $at, 1 /* 0AE8F4 7F079DC4 14410066 */ bne $v0, $at, .L7F079F60 @@ -4405,7 +3118,7 @@ variable_body_head: /* 0AEAC8 7F079F98 8D6B99E0 */ lw $t3, %lo(starting_right_weapon)($t3) /* 0AEACC 7F079F9C AFAB0048 */ sw $t3, 0x48($sp) .L7F079FA0: -/* 0AEAD0 7F079FA0 0FC26919 */ jal get_num_players +/* 0AEAD0 7F079FA0 0FC26919 */ jal getPlayerCount /* 0AEAD4 7F079FA4 00000000 */ nop /* 0AEAD8 7F079FA8 24010001 */ li $at, 1 /* 0AEADC 7F079FAC 14410083 */ bne $v0, $at, .L7F07A1BC @@ -4631,7 +3344,7 @@ variable_body_head: /* 0AEE3C 7F07A30C 8FA40048 */ lw $a0, 0x48($sp) /* 0AEE40 7F07A310 04400045 */ bltz $v0, .L7F07A428 /* 0AEE44 7F07A314 AFA2004C */ sw $v0, 0x4c($sp) -/* 0AEE48 7F07A318 0FC26919 */ jal get_num_players +/* 0AEE48 7F07A318 0FC26919 */ jal getPlayerCount /* 0AEE4C 7F07A31C 00000000 */ nop /* 0AEE50 7F07A320 24010001 */ li $at, 1 /* 0AEE54 7F07A324 14410035 */ bne $v0, $at, .L7F07A3FC @@ -4819,7 +3532,7 @@ glabel solo_char_load /* 0AEF0C 7F07A39C AFA00038 */ sw $zero, 0x38($sp) /* 0AEF10 7F07A3A0 0FC1F922 */ jal sub_GAME_7F07DE64 /* 0AEF14 7F07A3A4 8C84A120 */ lw $a0, %lo(pPlayer)($a0) -/* 0AEF18 7F07A3A8 0FC26C01 */ jal get_num_players +/* 0AEF18 7F07A3A8 0FC26C01 */ jal getPlayerCount /* 0AEF1C 7F07A3AC 00000000 */ nop /* 0AEF20 7F07A3B0 24010001 */ li $at, 1 /* 0AEF24 7F07A3B4 14410066 */ bne $v0, $at, .Ljp7F07A550 @@ -4968,7 +3681,7 @@ variable_body_head: /* 0AF0F8 7F07A588 8D6B9A20 */ lw $t3, %lo(starting_right_weapon)($t3) /* 0AF0FC 7F07A58C AFAB0048 */ sw $t3, 0x48($sp) .Ljp7F07A590: -/* 0AF100 7F07A590 0FC26C01 */ jal get_num_players +/* 0AF100 7F07A590 0FC26C01 */ jal getPlayerCount /* 0AF104 7F07A594 00000000 */ nop /* 0AF108 7F07A598 24010001 */ li $at, 1 /* 0AF10C 7F07A59C 14410082 */ bne $v0, $at, .Ljp7F07A7A8 @@ -5207,7 +3920,7 @@ variable_body_head: /* 0AF49C 7F07A92C 8FA40048 */ lw $a0, 0x48($sp) /* 0AF4A0 7F07A930 04400045 */ bltz $v0, .Ljp7F07AA48 /* 0AF4A4 7F07A934 AFA2004C */ sw $v0, 0x4c($sp) -/* 0AF4A8 7F07A938 0FC26C01 */ jal get_num_players +/* 0AF4A8 7F07A938 0FC26C01 */ jal getPlayerCount /* 0AF4AC 7F07A93C 00000000 */ nop /* 0AF4B0 7F07A940 24010001 */ li $at, 1 /* 0AF4B4 7F07A944 14410035 */ bne $v0, $at, .Ljp7F07AA1C @@ -5322,7 +4035,7 @@ void maybe_solo_intro_camera_handler(void) { if (pPlayer->field_A8->unk4 != 0) { // Node 1 - if (get_num_players() == 1) + if (getPlayerCount() == 1) { // Node 2 disable_sounds_attached_to_player_then_something(pPlayer->field_A8); @@ -5348,7 +4061,7 @@ glabel maybe_solo_intro_camera_handler /* 0AEFE8 7F07A4B8 8DF80004 */ lw $t8, 4($t7) /* 0AEFEC 7F07A4BC 53000017 */ beql $t8, $zero, .L7F07A51C /* 0AEFF0 7F07A4C0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AEFF4 7F07A4C4 0FC26919 */ jal get_num_players +/* 0AEFF4 7F07A4C4 0FC26919 */ jal getPlayerCount /* 0AEFF8 7F07A4C8 00000000 */ nop /* 0AEFFC 7F07A4CC 3C038008 */ lui $v1, %hi(pPlayer) /* 0AF000 7F07A4D0 24010001 */ li $at, 1 @@ -5758,12 +4471,12 @@ glabel set_camera_mode /* 0AF550 7F07AA20 00002825 */ move $a1, $zero /* 0AF554 7F07AA24 00003025 */ move $a2, $zero /* 0AF558 7F07AA28 3C073F80 */ lui $a3, 0x3f80 -/* 0AF55C 7F07AA2C 0FC201EC */ jal set_rgba_tint +/* 0AF55C 7F07AA2C 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF560 7F07AA30 E42464A4 */ swc1 $f4, %lo(D_800364A4)($at) /* 0AF564 7F07AA34 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AF568 7F07AA38 44816000 */ mtc1 $at, $f12 /* 0AF56C 7F07AA3C 44807000 */ mtc1 $zero, $f14 -/* 0AF570 7F07AA40 0FC20216 */ jal fade_to_over_seconds +/* 0AF570 7F07AA40 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF574 7F07AA44 00000000 */ nop /* 0AF578 7F07AA48 0C001A57 */ jal get_stage_num /* 0AF57C 7F07AA4C 00000000 */ nop @@ -5785,13 +4498,13 @@ glabel set_camera_mode /* 0AF5B4 7F07AA84 00002025 */ move $a0, $zero /* 0AF5B8 7F07AA88 00002825 */ move $a1, $zero /* 0AF5BC 7F07AA8C 00003025 */ move $a2, $zero -/* 0AF5C0 7F07AA90 0FC201EC */ jal set_rgba_tint +/* 0AF5C0 7F07AA90 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF5C4 7F07AA94 24070000 */ li $a3, 0 /* 0AF5C8 7F07AA98 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AF5CC 7F07AA9C 44816000 */ mtc1 $at, $f12 /* 0AF5D0 7F07AAA0 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AF5D4 7F07AAA4 44817000 */ mtc1 $at, $f14 -/* 0AF5D8 7F07AAA8 0FC20216 */ jal fade_to_over_seconds +/* 0AF5D8 7F07AAA8 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF5DC 7F07AAAC 00000000 */ nop /* 0AF5E0 7F07AAB0 100001B8 */ b .L7F07B194 /* 0AF5E4 7F07AAB4 8FBF002C */ lw $ra, 0x2c($sp) @@ -5826,12 +4539,12 @@ glabel set_camera_mode /* 0AF650 7F07AB20 AC20649C */ sw $zero, %lo(D_8003649C)($at) /* 0AF654 7F07AB24 00002825 */ move $a1, $zero /* 0AF658 7F07AB28 00003025 */ move $a2, $zero -/* 0AF65C 7F07AB2C 0FC201EC */ jal set_rgba_tint +/* 0AF65C 7F07AB2C 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF660 7F07AB30 3C073F80 */ lui $a3, 0x3f80 /* 0AF664 7F07AB34 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AF668 7F07AB38 44816000 */ mtc1 $at, $f12 /* 0AF66C 7F07AB3C 44807000 */ mtc1 $zero, $f14 -/* 0AF670 7F07AB40 0FC20216 */ jal fade_to_over_seconds +/* 0AF670 7F07AB40 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF674 7F07AB44 00000000 */ nop /* 0AF678 7F07AB48 0C001A57 */ jal get_stage_num /* 0AF67C 7F07AB4C 00000000 */ nop @@ -5858,7 +4571,7 @@ glabel set_camera_mode /* 0AF6D0 7F07ABA0 AC3964A8 */ sw $t9, %lo(D_800364A8)($at) /* 0AF6D4 7F07ABA4 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AF6D8 7F07ABA8 44817000 */ mtc1 $at, $f14 -/* 0AF6DC 7F07ABAC 0FC20284 */ jal set_curplayer_fade +/* 0AF6DC 7F07ABAC 0FC20284 */ jal currentPlayerStartChrFade /* 0AF6E0 7F07ABB0 00000000 */ nop /* 0AF6E4 7F07ABB4 0FC1E73C */ jal solo_char_load /* 0AF6E8 7F07ABB8 00000000 */ nop @@ -5924,12 +4637,12 @@ glabel set_camera_mode /* 0AF7CC 7F07AC9C 00002025 */ move $a0, $zero /* 0AF7D0 7F07ACA0 00002825 */ move $a1, $zero /* 0AF7D4 7F07ACA4 00003025 */ move $a2, $zero -/* 0AF7D8 7F07ACA8 0FC201EC */ jal set_rgba_tint +/* 0AF7D8 7F07ACA8 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF7DC 7F07ACAC 3C073F80 */ lui $a3, 0x3f80 /* 0AF7E0 7F07ACB0 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AF7E4 7F07ACB4 44817000 */ mtc1 $at, $f14 /* 0AF7E8 7F07ACB8 44806000 */ mtc1 $zero, $f12 -/* 0AF7EC 7F07ACBC 0FC20216 */ jal fade_to_over_seconds +/* 0AF7EC 7F07ACBC 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF7F0 7F07ACC0 00000000 */ nop /* 0AF7F4 7F07ACC4 1000000D */ b .L7F07ACFC /* 0AF7F8 7F07ACC8 00000000 */ nop @@ -5939,15 +4652,15 @@ glabel set_camera_mode /* 0AF804 7F07ACD4 00002825 */ move $a1, $zero /* 0AF808 7F07ACD8 11200008 */ beqz $t1, .L7F07ACFC /* 0AF80C 7F07ACDC 00003025 */ move $a2, $zero -/* 0AF810 7F07ACE0 0FC201EC */ jal set_rgba_tint +/* 0AF810 7F07ACE0 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF814 7F07ACE4 3C073F80 */ lui $a3, 0x3f80 /* 0AF818 7F07ACE8 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AF81C 7F07ACEC 44816000 */ mtc1 $at, $f12 /* 0AF820 7F07ACF0 44807000 */ mtc1 $zero, $f14 -/* 0AF824 7F07ACF4 0FC20216 */ jal fade_to_over_seconds +/* 0AF824 7F07ACF4 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF828 7F07ACF8 00000000 */ nop .L7F07ACFC: -/* 0AF82C 7F07ACFC 0FC26919 */ jal get_num_players +/* 0AF82C 7F07ACFC 0FC26919 */ jal getPlayerCount /* 0AF830 7F07AD00 00000000 */ nop /* 0AF834 7F07AD04 28410002 */ slti $at, $v0, 2 /* 0AF838 7F07AD08 14200006 */ bnez $at, .L7F07AD24 @@ -5987,12 +4700,12 @@ glabel set_camera_mode /* 0AF8B4 7F07AD84 3C018003 */ lui $at, %hi(D_800364A8) /* 0AF8B8 7F07AD88 AC2364A8 */ sw $v1, %lo(D_800364A8)($at) /* 0AF8BC 7F07AD8C 00003025 */ move $a2, $zero -/* 0AF8C0 7F07AD90 0FC201EC */ jal set_rgba_tint +/* 0AF8C0 7F07AD90 0FC201EC */ jal currentPlayerSetFadeColour /* 0AF8C4 7F07AD94 3C073F80 */ lui $a3, 0x3f80 /* 0AF8C8 7F07AD98 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AF8CC 7F07AD9C 44816000 */ mtc1 $at, $f12 /* 0AF8D0 7F07ADA0 44807000 */ mtc1 $zero, $f14 -/* 0AF8D4 7F07ADA4 0FC20216 */ jal fade_to_over_seconds +/* 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) @@ -6055,7 +4768,7 @@ glabel set_camera_mode /* 0AF9BC 7F07AE8C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AF9C0 7F07AE90 44817000 */ mtc1 $at, $f14 /* 0AF9C4 7F07AE94 44806000 */ mtc1 $zero, $f12 -/* 0AF9C8 7F07AE98 0FC20284 */ jal set_curplayer_fade +/* 0AF9C8 7F07AE98 0FC20284 */ jal currentPlayerStartChrFade /* 0AF9CC 7F07AE9C 00000000 */ nop /* 0AF9D0 7F07AEA0 0FC1E73C */ jal solo_char_load /* 0AF9D4 7F07AEA4 00000000 */ nop @@ -6197,13 +4910,13 @@ glabel set_camera_mode /* 0AFBD8 7F07B0A8 00002025 */ move $a0, $zero /* 0AFBDC 7F07B0AC 00002825 */ move $a1, $zero /* 0AFBE0 7F07B0B0 00003025 */ move $a2, $zero -/* 0AFBE4 7F07B0B4 0FC201EC */ jal set_rgba_tint +/* 0AFBE4 7F07B0B4 0FC201EC */ jal currentPlayerSetFadeColour /* 0AFBE8 7F07B0B8 24070000 */ li $a3, 0 /* 0AFBEC 7F07B0BC 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AFBF0 7F07B0C0 44816000 */ mtc1 $at, $f12 /* 0AFBF4 7F07B0C4 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AFBF8 7F07B0C8 44817000 */ mtc1 $at, $f14 -/* 0AFBFC 7F07B0CC 0FC20216 */ jal fade_to_over_seconds +/* 0AFBFC 7F07B0CC 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AFC00 7F07B0D0 00000000 */ nop /* 0AFC04 7F07B0D4 1000002F */ b .L7F07B194 /* 0AFC08 7F07B0D8 8FBF002C */ lw $ra, 0x2c($sp) @@ -6231,7 +4944,7 @@ glabel set_camera_mode .L7F07B128: /* 0AFC58 7F07B128 5441001A */ bnel $v0, $at, .L7F07B194 /* 0AFC5C 7F07B12C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0AFC60 7F07B130 0FC26919 */ jal get_num_players +/* 0AFC60 7F07B130 0FC26919 */ jal getPlayerCount /* 0AFC64 7F07B134 00008025 */ move $s0, $zero /* 0AFC68 7F07B138 18400013 */ blez $v0, .L7F07B188 /* 0AFC6C 7F07B13C 00000000 */ nop @@ -6241,15 +4954,15 @@ glabel set_camera_mode /* 0AFC78 7F07B148 00002025 */ move $a0, $zero /* 0AFC7C 7F07B14C 00002825 */ move $a1, $zero /* 0AFC80 7F07B150 00003025 */ move $a2, $zero -/* 0AFC84 7F07B154 0FC201EC */ jal set_rgba_tint +/* 0AFC84 7F07B154 0FC201EC */ jal currentPlayerSetFadeColour /* 0AFC88 7F07B158 24070000 */ li $a3, 0 /* 0AFC8C 7F07B15C 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0AFC90 7F07B160 44816000 */ mtc1 $at, $f12 /* 0AFC94 7F07B164 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AFC98 7F07B168 44817000 */ mtc1 $at, $f14 -/* 0AFC9C 7F07B16C 0FC20216 */ jal fade_to_over_seconds +/* 0AFC9C 7F07B16C 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AFCA0 7F07B170 00000000 */ nop -/* 0AFCA4 7F07B174 0FC26919 */ jal get_num_players +/* 0AFCA4 7F07B174 0FC26919 */ jal getPlayerCount /* 0AFCA8 7F07B178 26100001 */ addiu $s0, $s0, 1 /* 0AFCAC 7F07B17C 0202082A */ slt $at, $s0, $v0 /* 0AFCB0 7F07B180 1420FFEF */ bnez $at, .L7F07B140 @@ -6314,7 +5027,7 @@ glabel sub_GAME_7F07B1A4 /* 0AFD4C 7F07B21C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0AFD50 7F07B220 44817000 */ mtc1 $at, $f14 /* 0AFD54 7F07B224 44806000 */ mtc1 $zero, $f12 -/* 0AFD58 7F07B228 0FC20284 */ jal set_curplayer_fade +/* 0AFD58 7F07B228 0FC20284 */ jal currentPlayerStartChrFade /* 0AFD5C 7F07B22C 00000000 */ nop /* 0AFD60 7F07B230 0FC1EA6E */ jal set_camera_mode /* 0AFD64 7F07B234 24040004 */ li $a0, 4 @@ -6622,7 +5335,7 @@ glabel sub_GAME_7F07B56C /* 0B0118 7F07B5E8 4500000C */ bc1f .L7F07B61C /* 0B011C 7F07B5EC 00000000 */ nop /* 0B0120 7F07B5F0 8C840EB8 */ lw $a0, %lo(ptrSecondFontTableLarge)($a0) -/* 0B0124 7F07B5F4 0FC228ED */ jal sub_GAME_7F08A3B4 +/* 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) @@ -7052,7 +5765,7 @@ glabel sub_GAME_7F07B56C /* 0B0770 7F07BC40 00000000 */ nop /* 0B0774 7F07BC44 45000008 */ bc1f .L7F07BC68 /* 0B0778 7F07BC48 00000000 */ nop -/* 0B077C 7F07BC4C 0FC20284 */ jal set_curplayer_fade +/* 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) @@ -7064,7 +5777,7 @@ glabel sub_GAME_7F07B56C /* 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 check_if_fade_to_black_complete +/* 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) @@ -7109,9 +5822,9 @@ glabel sub_GAME_7F07B56C /* 0B0848 7F07BD18 00002025 */ move $a0, $zero /* 0B084C 7F07BD1C 00002825 */ move $a1, $zero /* 0B0850 7F07BD20 00003025 */ move $a2, $zero -/* 0B0854 7F07BD24 0FC201EC */ jal set_rgba_tint +/* 0B0854 7F07BD24 0FC201EC */ jal currentPlayerSetFadeColour /* 0B0858 7F07BD28 8DE703DC */ lw $a3, 0x3dc($t7) -/* 0B085C 7F07BD2C 0FC20223 */ jal check_if_fade_to_black_complete +/* 0B085C 7F07BD2C 0FC20223 */ jal currentPlayerIsFadeComplete /* 0B0860 7F07BD30 00000000 */ nop /* 0B0864 7F07BD34 3C098008 */ lui $t1, %hi(pPlayer) /* 0B0868 7F07BD38 1040000C */ beqz $v0, .L7F07BD6C @@ -7120,7 +5833,7 @@ glabel sub_GAME_7F07B56C /* 0B0874 7F07BD44 44816000 */ mtc1 $at, $f12 /* 0B0878 7F07BD48 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0B087C 7F07BD4C 44817000 */ mtc1 $at, $f14 -/* 0B0880 7F07BD50 0FC20216 */ jal fade_to_over_seconds +/* 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) @@ -7131,7 +5844,7 @@ glabel sub_GAME_7F07B56C /* 0B089C 7F07BD6C 8D2C0000 */ lw $t4, ($t1) /* 0B08A0 7F07BD70 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0B08A4 7F07BD74 44817000 */ mtc1 $at, $f14 -/* 0B08A8 7F07BD78 0FC20216 */ jal fade_to_over_seconds +/* 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) @@ -8144,7 +6857,7 @@ glabel sub_GAME_7F07B56C /* 0B0DD4 7F07C264 00000000 */ nop /* 0B0DD8 7F07C268 45000008 */ bc1f .Ljp7F07C28C /* 0B0DDC 7F07C26C 00000000 */ nop -/* 0B0DE0 7F07C270 0FC20408 */ jal set_curplayer_fade +/* 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 @@ -8156,7 +6869,7 @@ glabel sub_GAME_7F07B56C /* 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 check_if_fade_to_black_complete +/* 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 @@ -8201,9 +6914,9 @@ glabel sub_GAME_7F07B56C /* 0B0EAC 7F07C33C 00002025 */ move $a0, $zero /* 0B0EB0 7F07C340 00002825 */ move $a1, $zero /* 0B0EB4 7F07C344 00003025 */ move $a2, $zero -/* 0B0EB8 7F07C348 0FC20370 */ jal set_rgba_tint +/* 0B0EB8 7F07C348 0FC20370 */ jal currentPlayerSetFadeColour /* 0B0EBC 7F07C34C 8DE703DC */ lw $a3, 0x3dc($t7) -/* 0B0EC0 7F07C350 0FC203A7 */ jal check_if_fade_to_black_complete +/* 0B0EC0 7F07C350 0FC203A7 */ jal currentPlayerIsFadeComplete /* 0B0EC4 7F07C354 00000000 */ nop /* 0B0EC8 7F07C358 3C098008 */ lui $t1, %hi(pPlayer) # $t1, 0x8008 /* 0B0ECC 7F07C35C 1040000C */ beqz $v0, .Ljp7F07C390 @@ -8212,7 +6925,7 @@ glabel sub_GAME_7F07B56C /* 0B0ED8 7F07C368 44816000 */ mtc1 $at, $f12 /* 0B0EDC 7F07C36C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0B0EE0 7F07C370 44817000 */ mtc1 $at, $f14 -/* 0B0EE4 7F07C374 0FC2039A */ jal fade_to_over_seconds +/* 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 @@ -8223,7 +6936,7 @@ glabel sub_GAME_7F07B56C /* 0B0F00 7F07C390 8D2C0000 */ lw $t4, ($t1) /* 0B0F04 7F07C394 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0B0F08 7F07C398 44817000 */ mtc1 $at, $f14 -/* 0B0F0C 7F07C39C 0FC2039A */ jal fade_to_over_seconds +/* 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 @@ -8782,7 +7495,7 @@ void set_BONDdata_autoaim_y(s32 param_1) #ifdef NONMATCHING s32 get_BONDdata_autoaim_y(void) { - if (get_num_players() == 1) { + if (getPlayerCount() == 1) { return pPlayer->autoyaimenabled; } else { @@ -8795,7 +7508,7 @@ GLOBAL_ASM( glabel get_BONDdata_autoaim_y /* 0B10B0 7F07C580 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0B10B4 7F07C584 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B10B8 7F07C588 0FC26919 */ jal get_num_players +/* 0B10B8 7F07C588 0FC26919 */ jal getPlayerCount /* 0B10BC 7F07C58C 00000000 */ nop /* 0B10C0 7F07C590 24010001 */ li $at, 1 /* 0B10C4 7F07C594 14410005 */ bne $v0, $at, .L7F07C5AC @@ -8888,7 +7601,7 @@ void set_BONDdata_autoaim_x(s32 param_1) { #ifdef NONMATCHING void get_BONDdata_autoaim_x(void) { // Node 0 - if (get_num_players() != 1) + if (getPlayerCount() != 1) { // Node 2 // Node 3 @@ -8903,7 +7616,7 @@ GLOBAL_ASM( glabel get_BONDdata_autoaim_x /* 0B1198 7F07C668 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0B119C 7F07C66C AFBF0014 */ sw $ra, 0x14($sp) -/* 0B11A0 7F07C670 0FC26919 */ jal get_num_players +/* 0B11A0 7F07C670 0FC26919 */ jal getPlayerCount /* 0B11A4 7F07C674 00000000 */ nop /* 0B11A8 7F07C678 24010001 */ li $at, 1 /* 0B11AC 7F07C67C 14410005 */ bne $v0, $at, .L7F07C694 @@ -9788,36 +8501,14 @@ s32 get_intank_flag(void) { -#ifdef NONMATCHING -void get_ptr_for_players_tank(void) { - // Node 0 +s32 get_ptr_for_players_tank(void) +{ if (in_tank_flag == 1) { - // Node 1 return ptr_playerstank; } - // Node 2 return 0; } -#else -GLOBAL_ASM( -.text -glabel get_ptr_for_players_tank -/* 0B19B4 7F07CE84 3C0E8003 */ lui $t6, %hi(in_tank_flag) -/* 0B19B8 7F07CE88 8DCE6448 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B19BC 7F07CE8C 24010001 */ li $at, 1 -/* 0B19C0 7F07CE90 00001025 */ move $v0, $zero -/* 0B19C4 7F07CE94 15C10004 */ bne $t6, $at, .L7F07CEA8 -/* 0B19C8 7F07CE98 00000000 */ nop -/* 0B19CC 7F07CE9C 3C028003 */ lui $v0, %hi(ptr_playerstank) -/* 0B19D0 7F07CEA0 03E00008 */ jr $ra -/* 0B19D4 7F07CEA4 8C426450 */ lw $v0, %lo(ptr_playerstank)($v0) - -.L7F07CEA8: -/* 0B19D8 7F07CEA8 03E00008 */ jr $ra -/* 0B19DC 7F07CEAC 00000000 */ nop -) -#endif @@ -9988,7 +8679,7 @@ s32 cal_player_collision(void *arg0, void *arg1) { if (sub_GAME_7F0B239C(&sp3C) != 0) { // Node 9 - pPlayer->field_29FC = 0; + pPlayer->autocrouchpos = 0; } // Node 10 if ((sub_GAME_7F0B0E24(&sp90, pPlayer->field_48C, pPlayer->field_494, *arg0, (f32) arg0->unk8, sp8C, sp88, sp84, 0.0f, 1.0f) != 0) && (sub_GAME_7F0B18B8(&sp90, *arg0, arg0->unk8, sp80, sp8C, sp88, sp84) < 0)) @@ -10006,18 +8697,18 @@ s32 cal_player_collision(void *arg0, void *arg1) { { // Node 20 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04 != 0) + if (stanSavedColl_posData != 0) { // Node 21 phi_v1 = pPlayer; - if (*dword_CODE_bss_8007BA04 == 1) + if (*stanSavedColl_posData == 1) { // Node 22 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04->unk4->unk3 == &D_8003644C) + if (stanSavedColl_posData->unk4->unk3 == &D_8003644C) { // Node 23 - D_8003644C = (void *) dword_CODE_bss_8007BA04; + D_8003644C = (void *) stanSavedColl_posData; phi_v1 = pPlayer; } } @@ -10040,18 +8731,18 @@ s32 cal_player_collision(void *arg0, void *arg1) { { // Node 20 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04 != 0) + if (stanSavedColl_posData != 0) { // Node 21 phi_v1 = pPlayer; - if (*dword_CODE_bss_8007BA04 == 1) + if (*stanSavedColl_posData == 1) { // Node 22 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04->unk4->unk3 == &D_8003644C) + if (stanSavedColl_posData->unk4->unk3 == &D_8003644C) { // Node 23 - D_8003644C = (void *) dword_CODE_bss_8007BA04; + D_8003644C = (void *) stanSavedColl_posData; phi_v1 = pPlayer; } } @@ -10068,18 +8759,18 @@ s32 cal_player_collision(void *arg0, void *arg1) { { // Node 20 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04 != 0) + if (stanSavedColl_posData != 0) { // Node 21 phi_v1 = pPlayer; - if (*dword_CODE_bss_8007BA04 == 1) + if (*stanSavedColl_posData == 1) { // Node 22 phi_v1 = pPlayer; - if (dword_CODE_bss_8007BA04->unk4->unk3 == &D_8003644C) + if (stanSavedColl_posData->unk4->unk3 == &D_8003644C) { // Node 23 - D_8003644C = (void *) dword_CODE_bss_8007BA04; + D_8003644C = (void *) stanSavedColl_posData; phi_v1 = pPlayer; } } @@ -10250,10 +8941,10 @@ glabel cal_player_collision .L7F07D1B4: /* 0B1CE4 7F07D1B4 3C0A8003 */ lui $t2, %hi(ptr_playerstank) /* 0B1CE8 7F07D1B8 8D4A6450 */ lw $t2, %lo(ptr_playerstank)($t2) -/* 0B1CEC 7F07D1BC 3C028008 */ lui $v0, %hi(dword_CODE_bss_8007BA04) +/* 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(dword_CODE_bss_8007BA04)($v0) +/* 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) @@ -10300,7 +8991,7 @@ void sub_GAME_7F07D234(void *arg0, s32 arg1, ? arg2) { if (cal_player_collision(arg0, &sp1C) == 0) { // Node 2 - sub_GAME_7F0B28B0(arg1, arg2); + getCollisionEdge_maybe(arg1, arg2); // Node 3 return 0; } @@ -10340,7 +9031,7 @@ glabel sub_GAME_7F07D234 /* 0B1DC0 7F07D290 E7260494 */ swc1 $f6, 0x494($t9) .L7F07D294: /* 0B1DC4 7F07D294 8FA40024 */ lw $a0, 0x24($sp) -/* 0B1DC8 7F07D298 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 0B1DC8 7F07D298 0FC2CA2C */ jal getCollisionEdge_maybe /* 0B1DCC 7F07D29C 8FA50028 */ lw $a1, 0x28($sp) /* 0B1DD0 7F07D2A0 00001025 */ move $v0, $zero .L7F07D2A4: @@ -10447,7 +9138,7 @@ glabel sub_GAME_7F07D2B4 .L7F07D3F8: /* 0B1F28 7F07D3F8 8FB00090 */ lw $s0, 0x90($sp) /* 0B1F2C 7F07D3FC 8FA4008C */ lw $a0, 0x8c($sp) -/* 0B1F30 7F07D400 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 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) @@ -11211,8 +9902,8 @@ glabel sub_GAME_7F07D960 /* 0B28E8 7F07DDB8 11A00008 */ beqz $t5, .L7F07DDDC /* 0B28EC 7F07DDBC 00000000 */ nop /* 0B28F0 7F07DDC0 14870005 */ bne $a0, $a3, .L7F07DDD8 -/* 0B28F4 7F07DDC4 3C0F8004 */ lui $t7, %hi(base_ptr_connection_vals) -/* 0B28F8 7F07DDC8 8DEF0F58 */ lw $t7, %lo(base_ptr_connection_vals)($t7) +/* 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 @@ -11261,8 +9952,8 @@ glabel sub_GAME_7F07D960 #endif -void sub_GAME_7F07DE64(struct Player *player) { - sub_GAME_7F03DE94(player->position_data_pointer, player->field_2A04, player); +void sub_GAME_7F07DE64(struct player *player) { + sub_GAME_7F03DE94(player->prop, player->field_2A04, player); player->field_2A04 = -1; } @@ -12490,8 +11181,16 @@ glabel sub_GAME_7F07E964 #ifdef NONMATCHING -void sub_GAME_7F07EA78(void) { - +// Regalloc, v1 and v0 switched +f32 sub_GAME_7F07EA78() { + s32 temp_v1 = pPlayer->step_in_view_watch_animation; + if (temp_v1 == 1 || temp_v1 == 2) { + return pPlayer->pause_animation_counter / 20.0f; + } + else if (temp_v1 == 3) { + return 1.0f; + } + return 0.0f; } #else GLOBAL_ASM( @@ -14657,400 +13356,119 @@ glabel trigger_solo_watch_menu ) #endif - - - - -#ifdef NONMATCHING void sub_GAME_7F07FCC4(s32 arg0) { - // Node 0 - if (arg0 == -1) - { - // Node 1 - pPlayer->speedstrafe = (f32) (pPlayer->speedstrafe - global_timer_delta); - if (pPlayer->speedstrafe < -1.0f) - { - // Node 2 + if (arg0 == -1) { + pPlayer->speedstrafe = (pPlayer->speedstrafe - global_timer_delta); + if (pPlayer->speedstrafe < -1.0f) { pPlayer->speedstrafe = -1.0f; } } - else - { - // Node 3 - if (arg0 == 1) - { - // Node 4 - pPlayer->speedstrafe = (f32) (pPlayer->speedstrafe + global_timer_delta); - if (1.0f < pPlayer->speedstrafe) - { - // Node 5 + else { + if (arg0 == 1) { + pPlayer->speedstrafe = (pPlayer->speedstrafe + global_timer_delta); + if (1.0f < pPlayer->speedstrafe) { pPlayer->speedstrafe = 1.0f; } - } - else - { - // Node 6 - if (0.0f < pPlayer->speedstrafe) - { - // Node 7 - pPlayer->speedstrafe = (f32) (pPlayer->speedstrafe - global_timer_delta); - if (pPlayer->speedstrafe < 0.0f) - { - // Node 8 + } else { + if (0.0f < pPlayer->speedstrafe) { + pPlayer->speedstrafe = (pPlayer->speedstrafe - global_timer_delta); + if (pPlayer->speedstrafe < 0.0f) { pPlayer->speedstrafe = 0.0f; } - } - else - { - // Node 9 - pPlayer->speedstrafe = (f32) (pPlayer->speedstrafe + global_timer_delta); - if (0.0f < pPlayer->speedstrafe) - { - // Node 10 + } else { + pPlayer->speedstrafe = (pPlayer->speedstrafe + global_timer_delta); + if (0.0f < pPlayer->speedstrafe) { pPlayer->speedstrafe = 0.0f; } } } } - // Node 11 - pPlayer->speedsideways = (f32) pPlayer->speedstrafe; - return; + pPlayer->speedsideways = pPlayer->speedstrafe; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F07FCC4 -/* 0B47F4 7F07FCC4 2401FFFF */ li $at, -1 -/* 0B47F8 7F07FCC8 14810015 */ bne $a0, $at, .L7F07FD20 -/* 0B47FC 7F07FCCC 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B4800 7F07FCD0 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B4804 7F07FCD4 8C620000 */ lw $v0, ($v1) -/* 0B4808 7F07FCD8 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B480C 7F07FCDC 44811000 */ mtc1 $at, $f2 -/* 0B4810 7F07FCE0 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B4814 7F07FCE4 C4268378 */ lwc1 $f6, %lo(global_timer_delta)($at) -/* 0B4818 7F07FCE8 C4440170 */ lwc1 $f4, 0x170($v0) -/* 0B481C 7F07FCEC 46062201 */ sub.s $f8, $f4, $f6 -/* 0B4820 7F07FCF0 E4480170 */ swc1 $f8, 0x170($v0) -/* 0B4824 7F07FCF4 8C620000 */ lw $v0, ($v1) -/* 0B4828 7F07FCF8 C4400170 */ lwc1 $f0, 0x170($v0) -/* 0B482C 7F07FCFC 4602003C */ c.lt.s $f0, $f2 -/* 0B4830 7F07FD00 00000000 */ nop -/* 0B4834 7F07FD04 45000043 */ bc1f .L7F07FE14 -/* 0B4838 7F07FD08 00000000 */ nop -/* 0B483C 7F07FD0C E4420170 */ swc1 $f2, 0x170($v0) -/* 0B4840 7F07FD10 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B4844 7F07FD14 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4848 7F07FD18 1000003E */ b .L7F07FE14 -/* 0B484C 7F07FD1C C4400170 */ lwc1 $f0, 0x170($v0) -.L7F07FD20: -/* 0B4850 7F07FD20 24010001 */ li $at, 1 -/* 0B4854 7F07FD24 14810016 */ bne $a0, $at, .L7F07FD80 -/* 0B4858 7F07FD28 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B485C 7F07FD2C 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B4860 7F07FD30 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B4864 7F07FD34 8C620000 */ lw $v0, ($v1) -/* 0B4868 7F07FD38 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B486C 7F07FD3C 44811000 */ mtc1 $at, $f2 -/* 0B4870 7F07FD40 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B4874 7F07FD44 C4308378 */ lwc1 $f16, %lo(global_timer_delta)($at) -/* 0B4878 7F07FD48 C44A0170 */ lwc1 $f10, 0x170($v0) -/* 0B487C 7F07FD4C 46105480 */ add.s $f18, $f10, $f16 -/* 0B4880 7F07FD50 E4520170 */ swc1 $f18, 0x170($v0) -/* 0B4884 7F07FD54 8C620000 */ lw $v0, ($v1) -/* 0B4888 7F07FD58 C4400170 */ lwc1 $f0, 0x170($v0) -/* 0B488C 7F07FD5C 4600103C */ c.lt.s $f2, $f0 -/* 0B4890 7F07FD60 00000000 */ nop -/* 0B4894 7F07FD64 4500002B */ bc1f .L7F07FE14 -/* 0B4898 7F07FD68 00000000 */ nop -/* 0B489C 7F07FD6C E4420170 */ swc1 $f2, 0x170($v0) -/* 0B48A0 7F07FD70 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B48A4 7F07FD74 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B48A8 7F07FD78 10000026 */ b .L7F07FE14 -/* 0B48AC 7F07FD7C C4400170 */ lwc1 $f0, 0x170($v0) -.L7F07FD80: -/* 0B48B0 7F07FD80 2463A0B0 */ addiu $v1, $v1, %lo(pPlayer) -/* 0B48B4 7F07FD84 8C620000 */ lw $v0, ($v1) -/* 0B48B8 7F07FD88 44801000 */ mtc1 $zero, $f2 -/* 0B48BC 7F07FD8C 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B48C0 7F07FD90 C4400170 */ lwc1 $f0, 0x170($v0) -/* 0B48C4 7F07FD94 4600103C */ c.lt.s $f2, $f0 -/* 0B48C8 7F07FD98 00000000 */ nop -/* 0B48CC 7F07FD9C 45000010 */ bc1f .L7F07FDE0 -/* 0B48D0 7F07FDA0 00000000 */ nop -/* 0B48D4 7F07FDA4 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B48D8 7F07FDA8 C4248378 */ lwc1 $f4, %lo(global_timer_delta)($at) -/* 0B48DC 7F07FDAC 46040181 */ sub.s $f6, $f0, $f4 -/* 0B48E0 7F07FDB0 E4460170 */ swc1 $f6, 0x170($v0) -/* 0B48E4 7F07FDB4 8C620000 */ lw $v0, ($v1) -/* 0B48E8 7F07FDB8 C4400170 */ lwc1 $f0, 0x170($v0) -/* 0B48EC 7F07FDBC 4602003C */ c.lt.s $f0, $f2 -/* 0B48F0 7F07FDC0 00000000 */ nop -/* 0B48F4 7F07FDC4 45000013 */ bc1f .L7F07FE14 -/* 0B48F8 7F07FDC8 00000000 */ nop -/* 0B48FC 7F07FDCC E4420170 */ swc1 $f2, 0x170($v0) -/* 0B4900 7F07FDD0 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B4904 7F07FDD4 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4908 7F07FDD8 1000000E */ b .L7F07FE14 -/* 0B490C 7F07FDDC C4400170 */ lwc1 $f0, 0x170($v0) -.L7F07FDE0: -/* 0B4910 7F07FDE0 C4288378 */ lwc1 $f8, %lo(global_timer_delta)($at) -/* 0B4914 7F07FDE4 46080280 */ add.s $f10, $f0, $f8 -/* 0B4918 7F07FDE8 E44A0170 */ swc1 $f10, 0x170($v0) -/* 0B491C 7F07FDEC 8C620000 */ lw $v0, ($v1) -/* 0B4920 7F07FDF0 C4400170 */ lwc1 $f0, 0x170($v0) -/* 0B4924 7F07FDF4 4600103C */ c.lt.s $f2, $f0 -/* 0B4928 7F07FDF8 00000000 */ nop -/* 0B492C 7F07FDFC 45000005 */ bc1f .L7F07FE14 -/* 0B4930 7F07FE00 00000000 */ nop -/* 0B4934 7F07FE04 E4420170 */ swc1 $f2, 0x170($v0) -/* 0B4938 7F07FE08 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B493C 7F07FE0C 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4940 7F07FE10 C4400170 */ lwc1 $f0, 0x170($v0) -.L7F07FE14: -/* 0B4944 7F07FE14 03E00008 */ jr $ra -/* 0B4948 7F07FE18 E440016C */ swc1 $f0, 0x16c($v0) -) -#endif - - - - -#ifdef NONMATCHING void sub_GAME_7F07FE1C(s32 arg0) { - // Node 0 - if (arg0 == 1) - { - // Node 1 - pPlayer->field_2A4C = (f32) (pPlayer->field_2A4C + global_timer_delta); - if (1.0f < pPlayer->field_2A4C) - { - // Node 2 + if (arg0 == 1) { + pPlayer->field_2A4C = (pPlayer->field_2A4C + global_timer_delta); + if (1.0f < pPlayer->field_2A4C) { pPlayer->field_2A4C = 1.0f; } - } - else - { - // Node 3 - if (arg0 == -1) - { - // Node 4 - pPlayer->field_2A4C = (f32) (pPlayer->field_2A4C - global_timer_delta); - if (pPlayer->field_2A4C < -1.0f) - { - // Node 5 + } else { + if (arg0 == -1) { + pPlayer->field_2A4C = (pPlayer->field_2A4C - global_timer_delta); + if (pPlayer->field_2A4C < -1.0f) { pPlayer->field_2A4C = -1.0f; } - } - else - { - // Node 6 - if (0.0f < pPlayer->field_2A4C) - { - // Node 7 - pPlayer->field_2A4C = (f32) (pPlayer->field_2A4C - global_timer_delta); - if (pPlayer->field_2A4C < 0.0f) - { - // Node 8 + } else { + if (0.0f < pPlayer->field_2A4C) { + pPlayer->field_2A4C = (pPlayer->field_2A4C - global_timer_delta); + if (pPlayer->field_2A4C < 0.0f) { pPlayer->field_2A4C = 0.0f; } - } - else - { - // Node 9 - pPlayer->field_2A4C = (f32) (pPlayer->field_2A4C + global_timer_delta); - if (0.0f < pPlayer->field_2A4C) - { - // Node 10 + } else { + pPlayer->field_2A4C = (pPlayer->field_2A4C + global_timer_delta); + if (0.0f < pPlayer->field_2A4C) { pPlayer->field_2A4C = 0.0f; } } } } - // Node 11 - pPlayer->speedforwards = (f32) pPlayer->field_2A4C; - return; + pPlayer->speedforwards = pPlayer->field_2A4C; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F07FE1C -/* 0B494C 7F07FE1C 24010001 */ li $at, 1 -/* 0B4950 7F07FE20 14810015 */ bne $a0, $at, .L7F07FE78 -/* 0B4954 7F07FE24 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B4958 7F07FE28 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B495C 7F07FE2C 8C620000 */ lw $v0, ($v1) -/* 0B4960 7F07FE30 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4964 7F07FE34 44811000 */ mtc1 $at, $f2 -/* 0B4968 7F07FE38 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B496C 7F07FE3C C4268378 */ lwc1 $f6, %lo(global_timer_delta)($at) -/* 0B4970 7F07FE40 C4442A4C */ lwc1 $f4, 0x2a4c($v0) -/* 0B4974 7F07FE44 46062200 */ add.s $f8, $f4, $f6 -/* 0B4978 7F07FE48 E4482A4C */ swc1 $f8, 0x2a4c($v0) -/* 0B497C 7F07FE4C 8C620000 */ lw $v0, ($v1) -/* 0B4980 7F07FE50 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -/* 0B4984 7F07FE54 4600103C */ c.lt.s $f2, $f0 -/* 0B4988 7F07FE58 00000000 */ nop -/* 0B498C 7F07FE5C 45000043 */ bc1f .L7F07FF6C -/* 0B4990 7F07FE60 00000000 */ nop -/* 0B4994 7F07FE64 E4422A4C */ swc1 $f2, 0x2a4c($v0) -/* 0B4998 7F07FE68 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B499C 7F07FE6C 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B49A0 7F07FE70 1000003E */ b .L7F07FF6C -/* 0B49A4 7F07FE74 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -.L7F07FE78: -/* 0B49A8 7F07FE78 2401FFFF */ li $at, -1 -/* 0B49AC 7F07FE7C 14810016 */ bne $a0, $at, .L7F07FED8 -/* 0B49B0 7F07FE80 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B49B4 7F07FE84 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B49B8 7F07FE88 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B49BC 7F07FE8C 8C620000 */ lw $v0, ($v1) -/* 0B49C0 7F07FE90 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B49C4 7F07FE94 44811000 */ mtc1 $at, $f2 -/* 0B49C8 7F07FE98 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B49CC 7F07FE9C C4308378 */ lwc1 $f16, %lo(global_timer_delta)($at) -/* 0B49D0 7F07FEA0 C44A2A4C */ lwc1 $f10, 0x2a4c($v0) -/* 0B49D4 7F07FEA4 46105481 */ sub.s $f18, $f10, $f16 -/* 0B49D8 7F07FEA8 E4522A4C */ swc1 $f18, 0x2a4c($v0) -/* 0B49DC 7F07FEAC 8C620000 */ lw $v0, ($v1) -/* 0B49E0 7F07FEB0 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -/* 0B49E4 7F07FEB4 4602003C */ c.lt.s $f0, $f2 -/* 0B49E8 7F07FEB8 00000000 */ nop -/* 0B49EC 7F07FEBC 4500002B */ bc1f .L7F07FF6C -/* 0B49F0 7F07FEC0 00000000 */ nop -/* 0B49F4 7F07FEC4 E4422A4C */ swc1 $f2, 0x2a4c($v0) -/* 0B49F8 7F07FEC8 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B49FC 7F07FECC 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4A00 7F07FED0 10000026 */ b .L7F07FF6C -/* 0B4A04 7F07FED4 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -.L7F07FED8: -/* 0B4A08 7F07FED8 2463A0B0 */ addiu $v1, $v1, %lo(pPlayer) -/* 0B4A0C 7F07FEDC 8C620000 */ lw $v0, ($v1) -/* 0B4A10 7F07FEE0 44801000 */ mtc1 $zero, $f2 -/* 0B4A14 7F07FEE4 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B4A18 7F07FEE8 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -/* 0B4A1C 7F07FEEC 4600103C */ c.lt.s $f2, $f0 -/* 0B4A20 7F07FEF0 00000000 */ nop -/* 0B4A24 7F07FEF4 45000010 */ bc1f .L7F07FF38 -/* 0B4A28 7F07FEF8 00000000 */ nop -/* 0B4A2C 7F07FEFC 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B4A30 7F07FF00 C4248378 */ lwc1 $f4, %lo(global_timer_delta)($at) -/* 0B4A34 7F07FF04 46040181 */ sub.s $f6, $f0, $f4 -/* 0B4A38 7F07FF08 E4462A4C */ swc1 $f6, 0x2a4c($v0) -/* 0B4A3C 7F07FF0C 8C620000 */ lw $v0, ($v1) -/* 0B4A40 7F07FF10 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -/* 0B4A44 7F07FF14 4602003C */ c.lt.s $f0, $f2 -/* 0B4A48 7F07FF18 00000000 */ nop -/* 0B4A4C 7F07FF1C 45000013 */ bc1f .L7F07FF6C -/* 0B4A50 7F07FF20 00000000 */ nop -/* 0B4A54 7F07FF24 E4422A4C */ swc1 $f2, 0x2a4c($v0) -/* 0B4A58 7F07FF28 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B4A5C 7F07FF2C 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4A60 7F07FF30 1000000E */ b .L7F07FF6C -/* 0B4A64 7F07FF34 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -.L7F07FF38: -/* 0B4A68 7F07FF38 C4288378 */ lwc1 $f8, %lo(global_timer_delta)($at) -/* 0B4A6C 7F07FF3C 46080280 */ add.s $f10, $f0, $f8 -/* 0B4A70 7F07FF40 E44A2A4C */ swc1 $f10, 0x2a4c($v0) -/* 0B4A74 7F07FF44 8C620000 */ lw $v0, ($v1) -/* 0B4A78 7F07FF48 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -/* 0B4A7C 7F07FF4C 4600103C */ c.lt.s $f2, $f0 -/* 0B4A80 7F07FF50 00000000 */ nop -/* 0B4A84 7F07FF54 45000005 */ bc1f .L7F07FF6C -/* 0B4A88 7F07FF58 00000000 */ nop -/* 0B4A8C 7F07FF5C E4422A4C */ swc1 $f2, 0x2a4c($v0) -/* 0B4A90 7F07FF60 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B4A94 7F07FF64 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B4A98 7F07FF68 C4402A4C */ lwc1 $f0, 0x2a4c($v0) -.L7F07FF6C: -/* 0B4A9C 7F07FF6C 03E00008 */ jr $ra -/* 0B4AA0 7F07FF70 E4400174 */ swc1 $f0, 0x174($v0) -) -#endif - - +f32 viGetFovY(void); +f32 sub_GAME_7F07FF74(f32 value) { + if (value > 0) { + return (viGetFovY() * value * -0.7f) / 60.0f; + } + + if (value < 0) { + return (viGetFovY() * -value * 0.7f) / 60.0f; + } + + return 0; +} #ifdef NONMATCHING -f32 sub_GAME_7F07FF74(f32 arg0) { - // Node 0 - if (0.0f < arg0) - { - // Node 1 - return 0.0f; +// global_timer_delta should be loaded and multiplied two more times +void currentPlayerUpdateSpeedVerta(f32 value) { + f32 mult = viGetFovY() / 60.0f; + f32 limit = sub_GAME_7F07FF74(value); + if (value > 0) { + if (pPlayer->speedverta > 0) { + pPlayer->speedverta -= (0.05f * global_timer_delta * mult); + } else { + pPlayer->speedverta -= (0.0125f * global_timer_delta * mult); + } + + if (pPlayer->speedverta < limit) { + pPlayer->speedverta = limit; + } + } else if (value < 0) { + if (pPlayer->speedverta < 0) { + pPlayer->speedverta += (0.05f * 0.0125f * mult); + } else { + pPlayer->speedverta += (0.0125f * global_timer_delta * mult); + } + + if (pPlayer->speedverta > limit) { + pPlayer->speedverta = limit; + } + } else { + if (pPlayer->speedverta > limit) { + pPlayer->speedverta -= (0.05f * 0.05f * mult); + + if (pPlayer->speedverta < limit) { + pPlayer->speedverta = limit; + } + } else { + pPlayer->speedverta += (0.05f * global_timer_delta * mult); + + if (pPlayer->speedverta > limit) { + pPlayer->speedverta = limit; + } + } } - // Node 2 - if (arg0 >= 0.0f) - { - // Node 4 - // Node 5 - return 0.0f; - } - // Node 3 - return 0.0f; -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80055094 -.word 0xbf333333 /*-0.69999999*/ -glabel D_80055098 -.word 0x3f333333 /*0.69999999*/ -.text -glabel sub_GAME_7F07FF74 -/* 0B4AA4 7F07FF74 44801000 */ mtc1 $zero, $f2 -/* 0B4AA8 7F07FF78 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0B4AAC 7F07FF7C AFBF0014 */ sw $ra, 0x14($sp) -/* 0B4AB0 7F07FF80 460C103C */ c.lt.s $f2, $f12 -/* 0B4AB4 7F07FF84 00000000 */ nop -/* 0B4AB8 7F07FF88 4502000D */ bc1fl .L7F07FFC0 -/* 0B4ABC 7F07FF8C 4602603C */ c.lt.s $f12, $f2 -/* 0B4AC0 7F07FF90 0C001177 */ jal video_related_23 -/* 0B4AC4 7F07FF94 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0B4AC8 7F07FF98 C7AC0018 */ lwc1 $f12, 0x18($sp) -/* 0B4ACC 7F07FF9C 3C018005 */ lui $at, %hi(D_80055094) -/* 0B4AD0 7F07FFA0 C4265094 */ lwc1 $f6, %lo(D_80055094)($at) -/* 0B4AD4 7F07FFA4 460C0102 */ mul.s $f4, $f0, $f12 -/* 0B4AD8 7F07FFA8 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B4ADC 7F07FFAC 44815000 */ mtc1 $at, $f10 -/* 0B4AE0 7F07FFB0 46062202 */ mul.s $f8, $f4, $f6 -/* 0B4AE4 7F07FFB4 10000012 */ b .L7F080000 -/* 0B4AE8 7F07FFB8 460A4003 */ div.s $f0, $f8, $f10 -/* 0B4AEC 7F07FFBC 4602603C */ c.lt.s $f12, $f2 -.L7F07FFC0: -/* 0B4AF0 7F07FFC0 00000000 */ nop -/* 0B4AF4 7F07FFC4 4502000E */ bc1fl .L7F080000 -/* 0B4AF8 7F07FFC8 46001006 */ mov.s $f0, $f2 -/* 0B4AFC 7F07FFCC 0C001177 */ jal video_related_23 -/* 0B4B00 7F07FFD0 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0B4B04 7F07FFD4 C7AC0018 */ lwc1 $f12, 0x18($sp) -/* 0B4B08 7F07FFD8 3C018005 */ lui $at, %hi(D_80055098) -/* 0B4B0C 7F07FFDC C4245098 */ lwc1 $f4, %lo(D_80055098)($at) -/* 0B4B10 7F07FFE0 46006407 */ neg.s $f16, $f12 -/* 0B4B14 7F07FFE4 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B4B18 7F07FFE8 46100482 */ mul.s $f18, $f0, $f16 -/* 0B4B1C 7F07FFEC 44814000 */ mtc1 $at, $f8 -/* 0B4B20 7F07FFF0 46049182 */ mul.s $f6, $f18, $f4 -/* 0B4B24 7F07FFF4 10000002 */ b .L7F080000 -/* 0B4B28 7F07FFF8 46083003 */ div.s $f0, $f6, $f8 -/* 0B4B2C 7F07FFFC 46001006 */ mov.s $f0, $f2 -.L7F080000: -/* 0B4B30 7F080000 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B4B34 7F080004 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0B4B38 7F080008 03E00008 */ jr $ra -/* 0B4B3C 7F08000C 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F080010(void) { - } #else GLOBAL_ASM( @@ -15068,10 +13486,10 @@ glabel D_800550AC glabel D_800550B0 .word 0x3d4ccccd /*0.050000001*/ .text -glabel sub_GAME_7F080010 +glabel currentPlayerUpdateSpeedVerta /* 0B4B40 7F080010 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0B4B44 7F080014 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B4B48 7F080018 0C001177 */ jal video_related_23 +/* 0B4B48 7F080018 0C001177 */ jal viGetFovY /* 0B4B4C 7F08001C E7AC0020 */ swc1 $f12, 0x20($sp) /* 0B4B50 7F080020 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0B4B54 7F080024 44812000 */ mtc1 $at, $f4 @@ -15218,82 +13636,15 @@ glabel sub_GAME_7F080010 - -#ifdef NONMATCHING - f32 sub_GAME_7F080228(f32 arg0) { - // Node 0 - if (0.0f < arg0) - { - // Node 1 + if (0.0f < arg0) { + return (viGetFovY() * arg0 * -0.7f) / 60.0f; + } else if (arg0 < 0.0f) { + return (viGetFovY() * -arg0 * 0.7f) / 60.0f; + } else { return 0.0f; } - // Node 2 - if (arg0 >= 0.0f) - { - // Node 4 - // Node 5 - return 0.0f; - } - // Node 3 - return 0.0f; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800550B4 -.word 0xbf333333 /*-0.69999999*/ -glabel D_800550B8 -.word 0x3f333333 /*0.69999999*/ -.text -glabel sub_GAME_7F080228 -/* 0B4D58 7F080228 44801000 */ mtc1 $zero, $f2 -/* 0B4D5C 7F08022C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0B4D60 7F080230 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B4D64 7F080234 460C103C */ c.lt.s $f2, $f12 -/* 0B4D68 7F080238 00000000 */ nop -/* 0B4D6C 7F08023C 4502000D */ bc1fl .L7F080274 -/* 0B4D70 7F080240 4602603C */ c.lt.s $f12, $f2 -/* 0B4D74 7F080244 0C001177 */ jal video_related_23 -/* 0B4D78 7F080248 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0B4D7C 7F08024C C7AC0018 */ lwc1 $f12, 0x18($sp) -/* 0B4D80 7F080250 3C018005 */ lui $at, %hi(D_800550B4) -/* 0B4D84 7F080254 C42650B4 */ lwc1 $f6, %lo(D_800550B4)($at) -/* 0B4D88 7F080258 460C0102 */ mul.s $f4, $f0, $f12 -/* 0B4D8C 7F08025C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B4D90 7F080260 44815000 */ mtc1 $at, $f10 -/* 0B4D94 7F080264 46062202 */ mul.s $f8, $f4, $f6 -/* 0B4D98 7F080268 10000012 */ b .L7F0802B4 -/* 0B4D9C 7F08026C 460A4003 */ div.s $f0, $f8, $f10 -/* 0B4DA0 7F080270 4602603C */ c.lt.s $f12, $f2 -.L7F080274: -/* 0B4DA4 7F080274 00000000 */ nop -/* 0B4DA8 7F080278 4502000E */ bc1fl .L7F0802B4 -/* 0B4DAC 7F08027C 46001006 */ mov.s $f0, $f2 -/* 0B4DB0 7F080280 0C001177 */ jal video_related_23 -/* 0B4DB4 7F080284 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0B4DB8 7F080288 C7AC0018 */ lwc1 $f12, 0x18($sp) -/* 0B4DBC 7F08028C 3C018005 */ lui $at, %hi(D_800550B8) -/* 0B4DC0 7F080290 C42450B8 */ lwc1 $f4, %lo(D_800550B8)($at) -/* 0B4DC4 7F080294 46006407 */ neg.s $f16, $f12 -/* 0B4DC8 7F080298 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B4DCC 7F08029C 46100482 */ mul.s $f18, $f0, $f16 -/* 0B4DD0 7F0802A0 44814000 */ mtc1 $at, $f8 -/* 0B4DD4 7F0802A4 46049182 */ mul.s $f6, $f18, $f4 -/* 0B4DD8 7F0802A8 10000002 */ b .L7F0802B4 -/* 0B4DDC 7F0802AC 46083003 */ div.s $f0, $f6, $f8 -/* 0B4DE0 7F0802B0 46001006 */ mov.s $f0, $f2 -.L7F0802B4: -/* 0B4DE4 7F0802B4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B4DE8 7F0802B8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0B4DEC 7F0802BC 03E00008 */ jr $ra -/* 0B4DF0 7F0802C0 00000000 */ nop -) -#endif - - - - #ifdef NONMATCHING void sub_GAME_7F0802C4(void) { @@ -15318,7 +13669,7 @@ glabel D_800550D0 glabel sub_GAME_7F0802C4 /* 0B4DF4 7F0802C4 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0B4DF8 7F0802C8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B4DFC 7F0802CC 0C001177 */ jal video_related_23 +/* 0B4DFC 7F0802CC 0C001177 */ jal viGetFovY /* 0B4E00 7F0802D0 E7AC0020 */ swc1 $f12, 0x20($sp) /* 0B4E04 7F0802D4 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0B4E08 7F0802D8 44812000 */ mtc1 $at, $f4 @@ -15463,623 +13814,130 @@ glabel sub_GAME_7F0802C4 ) #endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F0804E0(void) { - -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0804E0 -/* 0B5010 7F0804E0 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B5014 7F0804E4 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B5018 7F0804E8 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 0B501C 7F0804EC AFB00018 */ sw $s0, 0x18($sp) -/* 0B5020 7F0804F0 3C0E8003 */ lui $t6, %hi(camera_80036430) -/* 0B5024 7F0804F4 8DCE6430 */ lw $t6, %lo(camera_80036430)($t6) -/* 0B5028 7F0804F8 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B502C 7F0804FC 00808025 */ move $s0, $a0 -/* 0B5030 7F080500 C44003DC */ lwc1 $f0, 0x3dc($v0) -/* 0B5034 7F080504 8C4703D0 */ lw $a3, 0x3d0($v0) -/* 0B5038 7F080508 8C4803D4 */ lw $t0, 0x3d4($v0) -/* 0B503C 7F08050C 15C00004 */ bnez $t6, .L7F080520 -/* 0B5040 7F080510 8C4903D8 */ lw $t1, 0x3d8($v0) -/* 0B5044 7F080514 3C0F8003 */ lui $t7, %hi(camera_80036434) -/* 0B5048 7F080518 8DEF6434 */ lw $t7, %lo(camera_80036434)($t7) -/* 0B504C 7F08051C 11E00005 */ beqz $t7, .L7F080534 -.L7F080520: -/* 0B5050 7F080520 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5054 7F080524 44810000 */ mtc1 $at, $f0 -/* 0B5058 7F080528 00004825 */ move $t1, $zero -/* 0B505C 7F08052C 00004025 */ move $t0, $zero -/* 0B5060 7F080530 00003825 */ move $a3, $zero -.L7F080534: -/* 0B5064 7F080534 44802000 */ mtc1 $zero, $f4 -/* 0B5068 7F080538 3C19BA00 */ lui $t9, (0xBA001402 >> 16) # lui $t9, 0xba00 -/* 0B506C 7F08053C 3C0ABA00 */ lui $t2, (0xBA000602 >> 16) # lui $t2, 0xba00 -/* 0B5070 7F080540 4600203C */ c.lt.s $f4, $f0 -/* 0B5074 7F080544 02001025 */ move $v0, $s0 -/* 0B5078 7F080548 3C18E700 */ lui $t8, 0xe700 -/* 0B507C 7F08054C 37391402 */ ori $t9, (0xBA001402 & 0xFFFF) # ori $t9, $t9, 0x1402 -/* 0B5080 7F080550 45000092 */ bc1f .L7F08079C -/* 0B5084 7F080554 354A0602 */ ori $t2, (0xBA000602 & 0xFFFF) # ori $t2, $t2, 0x602 -/* 0B5088 7F080558 26100008 */ addiu $s0, $s0, 8 -/* 0B508C 7F08055C 02001825 */ move $v1, $s0 -/* 0B5090 7F080560 AC580000 */ sw $t8, ($v0) -/* 0B5094 7F080564 AC400004 */ sw $zero, 4($v0) -/* 0B5098 7F080568 26100008 */ addiu $s0, $s0, 8 -/* 0B509C 7F08056C 02002025 */ move $a0, $s0 -/* 0B50A0 7F080570 AC600004 */ sw $zero, 4($v1) -/* 0B50A4 7F080574 AC790000 */ sw $t9, ($v1) -/* 0B50A8 7F080578 26100008 */ addiu $s0, $s0, 8 -/* 0B50AC 7F08057C 240B00C0 */ li $t3, 192 -/* 0B50B0 7F080580 AC8B0004 */ sw $t3, 4($a0) -/* 0B50B4 7F080584 AC8A0000 */ sw $t2, ($a0) -/* 0B50B8 7F080588 02002825 */ move $a1, $s0 -/* 0B50BC 7F08058C 3C0CBA00 */ lui $t4, (0xBA001301 >> 16) # lui $t4, 0xba00 -/* 0B50C0 7F080590 358C1301 */ ori $t4, (0xBA001301 & 0xFFFF) # ori $t4, $t4, 0x1301 -/* 0B50C4 7F080594 26100008 */ addiu $s0, $s0, 8 -/* 0B50C8 7F080598 ACAC0000 */ sw $t4, ($a1) -/* 0B50CC 7F08059C 02003025 */ move $a2, $s0 -/* 0B50D0 7F0805A0 3C0DB900 */ lui $t5, (0xB9000002 >> 16) # lui $t5, 0xb900 -/* 0B50D4 7F0805A4 ACA00004 */ sw $zero, 4($a1) -/* 0B50D8 7F0805A8 35AD0002 */ ori $t5, (0xB9000002 & 0xFFFF) # ori $t5, $t5, 2 -/* 0B50DC 7F0805AC 26100008 */ addiu $s0, $s0, 8 -/* 0B50E0 7F0805B0 3C01437F */ li $at, 0x437F0000 # 255.000000 -/* 0B50E4 7F0805B4 44813000 */ mtc1 $at, $f6 -/* 0B50E8 7F0805B8 ACCD0000 */ sw $t5, ($a2) -/* 0B50EC 7F0805BC 02001025 */ move $v0, $s0 -/* 0B50F0 7F0805C0 3C0EBA00 */ lui $t6, (0xBA001001 >> 16) # lui $t6, 0xba00 -/* 0B50F4 7F0805C4 ACC00004 */ sw $zero, 4($a2) -/* 0B50F8 7F0805C8 35CE1001 */ ori $t6, (0xBA001001 & 0xFFFF) # ori $t6, $t6, 0x1001 -/* 0B50FC 7F0805CC 26100008 */ addiu $s0, $s0, 8 -/* 0B5100 7F0805D0 AC4E0000 */ sw $t6, ($v0) -/* 0B5104 7F0805D4 02001825 */ move $v1, $s0 -/* 0B5108 7F0805D8 46060202 */ mul.s $f8, $f0, $f6 -/* 0B510C 7F0805DC AC400004 */ sw $zero, 4($v0) -/* 0B5110 7F0805E0 3C0FBA00 */ lui $t7, (0xBA000C02 >> 16) # lui $t7, 0xba00 -/* 0B5114 7F0805E4 35EF0C02 */ ori $t7, (0xBA000C02 & 0xFFFF) # ori $t7, $t7, 0xc02 -/* 0B5118 7F0805E8 26100008 */ addiu $s0, $s0, 8 -/* 0B511C 7F0805EC 24182000 */ li $t8, 8192 -/* 0B5120 7F0805F0 AC780004 */ sw $t8, 4($v1) -/* 0B5124 7F0805F4 AC6F0000 */ sw $t7, ($v1) -/* 0B5128 7F0805F8 02002025 */ move $a0, $s0 -/* 0B512C 7F0805FC 26100008 */ addiu $s0, $s0, 8 -/* 0B5130 7F080600 240A0C00 */ li $t2, 3072 -/* 0B5134 7F080604 3C19BA00 */ lui $t9, (0xBA000903 >> 16) # lui $t9, 0xba00 -/* 0B5138 7F080608 37390903 */ ori $t9, (0xBA000903 & 0xFFFF) # ori $t9, $t9, 0x903 -/* 0B513C 7F08060C AC8A0004 */ sw $t2, 4($a0) -/* 0B5140 7F080610 02002825 */ move $a1, $s0 -/* 0B5144 7F080614 3C0BBA00 */ lui $t3, (0xBA000E02 >> 16) # lui $t3, 0xba00 -/* 0B5148 7F080618 AC990000 */ sw $t9, ($a0) -/* 0B514C 7F08061C 356B0E02 */ ori $t3, (0xBA000E02 & 0xFFFF) # ori $t3, $t3, 0xe02 -/* 0B5150 7F080620 26100008 */ addiu $s0, $s0, 8 -/* 0B5154 7F080624 ACAB0000 */ sw $t3, ($a1) -/* 0B5158 7F080628 02003025 */ move $a2, $s0 -/* 0B515C 7F08062C 3C0CB900 */ lui $t4, (0xB900031D >> 16) # lui $t4, 0xb900 -/* 0B5160 7F080630 4600428D */ trunc.w.s $f10, $f8 -/* 0B5164 7F080634 ACA00004 */ sw $zero, 4($a1) -/* 0B5168 7F080638 358C031D */ ori $t4, (0xB900031D & 0xFFFF) # ori $t4, $t4, 0x31d -/* 0B516C 7F08063C 26100008 */ addiu $s0, $s0, 8 -/* 0B5170 7F080640 3C0D0050 */ lui $t5, (0x00504340 >> 16) # lui $t5, 0x50 -/* 0B5174 7F080644 35AD4340 */ ori $t5, (0x00504340 & 0xFFFF) # ori $t5, $t5, 0x4340 -/* 0B5178 7F080648 ACCC0000 */ sw $t4, ($a2) -/* 0B517C 7F08064C 02001025 */ move $v0, $s0 -/* 0B5180 7F080650 ACCD0004 */ sw $t5, 4($a2) -/* 0B5184 7F080654 3C0FFFFD */ lui $t7, (0xFFFDF6FB >> 16) # lui $t7, 0xfffd -/* 0B5188 7F080658 3C0EFCFF */ lui $t6, (0xFCFFFFFF >> 16) # lui $t6, 0xfcff -/* 0B518C 7F08065C 310B00FF */ andi $t3, $t0, 0xff -/* 0B5190 7F080660 35CEFFFF */ ori $t6, (0xFCFFFFFF & 0xFFFF) # ori $t6, $t6, 0xffff -/* 0B5194 7F080664 35EFF6FB */ ori $t7, (0xFFFDF6FB & 0xFFFF) # ori $t7, $t7, 0xf6fb -/* 0B5198 7F080668 000B6400 */ sll $t4, $t3, 0x10 -/* 0B519C 7F08066C 440B5000 */ mfc1 $t3, $f10 -/* 0B51A0 7F080670 AC4F0004 */ sw $t7, 4($v0) -/* 0B51A4 7F080674 AC4E0000 */ sw $t6, ($v0) -/* 0B51A8 7F080678 26100008 */ addiu $s0, $s0, 8 -/* 0B51AC 7F08067C 00075600 */ sll $t2, $a3, 0x18 -/* 0B51B0 7F080680 014C6825 */ or $t5, $t2, $t4 -/* 0B51B4 7F080684 02001825 */ move $v1, $s0 -/* 0B51B8 7F080688 312E00FF */ andi $t6, $t1, 0xff -/* 0B51BC 7F08068C 3C18FA00 */ lui $t8, 0xfa00 -/* 0B51C0 7F080690 AC780000 */ sw $t8, ($v1) -/* 0B51C4 7F080694 000E7A00 */ sll $t7, $t6, 8 -/* 0B51C8 7F080698 01AFC025 */ or $t8, $t5, $t7 -/* 0B51CC 7F08069C 316A00FF */ andi $t2, $t3, 0xff -/* 0B51D0 7F0806A0 030A6025 */ or $t4, $t8, $t2 -/* 0B51D4 7F0806A4 AC6C0004 */ sw $t4, 4($v1) -/* 0B51D8 7F0806A8 26100008 */ addiu $s0, $s0, 8 -/* 0B51DC 7F0806AC AFB0003C */ sw $s0, 0x3c($sp) -/* 0B51E0 7F0806B0 0C001127 */ jal get_video2_settings_width -/* 0B51E4 7F0806B4 26100008 */ addiu $s0, $s0, 8 -/* 0B51E8 7F0806B8 0C001145 */ jal get_video2_settings_ulx -/* 0B51EC 7F0806BC A7A20026 */ sh $v0, 0x26($sp) -/* 0B51F0 7F0806C0 0C001149 */ jal get_video2_settings_uly -/* 0B51F4 7F0806C4 A7A20028 */ sh $v0, 0x28($sp) -/* 0B51F8 7F0806C8 0C00112B */ jal get_video2_settings_height -/* 0B51FC 7F0806CC A7A2002A */ sh $v0, 0x2a($sp) -/* 0B5200 7F0806D0 87AE0028 */ lh $t6, 0x28($sp) -/* 0B5204 7F0806D4 87AD0026 */ lh $t5, 0x26($sp) -/* 0B5208 7F0806D8 87B8002A */ lh $t8, 0x2a($sp) -/* 0B520C 7F0806DC 3C01F600 */ lui $at, 0xf600 -/* 0B5210 7F0806E0 01CD7821 */ addu $t7, $t6, $t5 -/* 0B5214 7F0806E4 00585021 */ addu $t2, $v0, $t8 -/* 0B5218 7F0806E8 314C03FF */ andi $t4, $t2, 0x3ff -/* 0B521C 7F0806EC 31F903FF */ andi $t9, $t7, 0x3ff -/* 0B5220 7F0806F0 00195B80 */ sll $t3, $t9, 0xe -/* 0B5224 7F0806F4 000C7080 */ sll $t6, $t4, 2 -/* 0B5228 7F0806F8 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B522C 7F0806FC 01C16825 */ or $t5, $t6, $at -/* 0B5230 7F080700 01AB7825 */ or $t7, $t5, $t3 -/* 0B5234 7F080704 0C001145 */ jal get_video2_settings_ulx -/* 0B5238 7F080708 AF2F0000 */ sw $t7, ($t9) -/* 0B523C 7F08070C 0C001149 */ jal get_video2_settings_uly -/* 0B5240 7F080710 A7A2002A */ sh $v0, 0x2a($sp) -/* 0B5244 7F080714 87AC002A */ lh $t4, 0x2a($sp) -/* 0B5248 7F080718 8FAF003C */ lw $t7, 0x3c($sp) -/* 0B524C 7F08071C 305803FF */ andi $t8, $v0, 0x3ff -/* 0B5250 7F080720 318E03FF */ andi $t6, $t4, 0x3ff -/* 0B5254 7F080724 000E6B80 */ sll $t5, $t6, 0xe -/* 0B5258 7F080728 00185080 */ sll $t2, $t8, 2 -/* 0B525C 7F08072C 014D5825 */ or $t3, $t2, $t5 -/* 0B5260 7F080730 02001825 */ move $v1, $s0 -/* 0B5264 7F080734 ADEB0004 */ sw $t3, 4($t7) -/* 0B5268 7F080738 26100008 */ addiu $s0, $s0, 8 -/* 0B526C 7F08073C 3C19E700 */ lui $t9, 0xe700 -/* 0B5270 7F080740 02002025 */ move $a0, $s0 -/* 0B5274 7F080744 AC790000 */ sw $t9, ($v1) -/* 0B5278 7F080748 AC600004 */ sw $zero, 4($v1) -/* 0B527C 7F08074C 26100008 */ addiu $s0, $s0, 8 -/* 0B5280 7F080750 3C18BA00 */ lui $t8, (0xBA000602 >> 16) # lui $t8, 0xba00 -/* 0B5284 7F080754 37180602 */ ori $t8, (0xBA000602 & 0xFFFF) # ori $t8, $t8, 0x602 -/* 0B5288 7F080758 240C0040 */ li $t4, 64 -/* 0B528C 7F08075C 02002825 */ move $a1, $s0 -/* 0B5290 7F080760 AC8C0004 */ sw $t4, 4($a0) -/* 0B5294 7F080764 AC980000 */ sw $t8, ($a0) -/* 0B5298 7F080768 26100008 */ addiu $s0, $s0, 8 -/* 0B529C 7F08076C 3C0EBA00 */ lui $t6, (0xBA001301 >> 16) # lui $t6, 0xba00 -/* 0B52A0 7F080770 35CE1301 */ ori $t6, (0xBA001301 & 0xFFFF) # ori $t6, $t6, 0x1301 -/* 0B52A4 7F080774 3C0A0008 */ lui $t2, 8 -/* 0B52A8 7F080778 02003025 */ move $a2, $s0 -/* 0B52AC 7F08077C ACAA0004 */ sw $t2, 4($a1) -/* 0B52B0 7F080780 ACAE0000 */ sw $t6, ($a1) -/* 0B52B4 7F080784 3C0DBA00 */ lui $t5, (0xBA001001 >> 16) # lui $t5, 0xba00 -/* 0B52B8 7F080788 35AD1001 */ ori $t5, (0xBA001001 & 0xFFFF) # ori $t5, $t5, 0x1001 -/* 0B52BC 7F08078C 3C0B0001 */ lui $t3, 1 -/* 0B52C0 7F080790 ACCB0004 */ sw $t3, 4($a2) -/* 0B52C4 7F080794 ACCD0000 */ sw $t5, ($a2) -/* 0B52C8 7F080798 26100008 */ addiu $s0, $s0, 8 -.L7F08079C: -/* 0B52CC 7F08079C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B52D0 7F0807A0 02001025 */ move $v0, $s0 -/* 0B52D4 7F0807A4 8FB00018 */ lw $s0, 0x18($sp) -/* 0B52D8 7F0807A8 03E00008 */ jr $ra -/* 0B52DC 7F0807AC 27BD0080 */ addiu $sp, $sp, 0x80 -) -#endif - - - - - -void set_rgba_tint(s32 arg0, s32 arg1, s32 arg2, f32 arg3) { - pPlayer->tint_red = arg0; - pPlayer->tint_green = arg1; - pPlayer->tint_blue = arg2; - pPlayer->tint_alpha = arg3; -} - - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F0807E0(f32 arg0, s32 arg1, ?32 arg2, ?32 arg3, f32 arg4) { - // Node 0 - pPlayer->field_3E0 = 0.0f; - pPlayer->time_for_fade = arg0; - pPlayer->field_3E8 = (?32) pPlayer->tint_red; - pPlayer->field_3EC = arg1; - pPlayer->field_3F0 = (?32) pPlayer->tint_green; - pPlayer->field_3F4 = arg2; - pPlayer->field_3F8 = (?32) pPlayer->tint_blue; - pPlayer->field_3FC = arg3; - pPlayer->field_400 = (f32) pPlayer->tint_alpha; - pPlayer->field_404 = arg4; - return pPlayer; -} - -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0807E0 -/* 0B5310 7F0807E0 3C038008 */ lui $v1, %hi(pPlayer) -/* 0B5314 7F0807E4 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B5318 7F0807E8 8C6E0000 */ lw $t6, ($v1) -/* 0B531C 7F0807EC 44802000 */ mtc1 $zero, $f4 -/* 0B5320 7F0807F0 00000000 */ nop -/* 0B5324 7F0807F4 E5C403E0 */ swc1 $f4, 0x3e0($t6) -/* 0B5328 7F0807F8 8C6F0000 */ lw $t7, ($v1) -/* 0B532C 7F0807FC E5EC03E4 */ swc1 $f12, 0x3e4($t7) -/* 0B5330 7F080800 8C620000 */ lw $v0, ($v1) -/* 0B5334 7F080804 8C5803D0 */ lw $t8, 0x3d0($v0) -/* 0B5338 7F080808 AC5803E8 */ sw $t8, 0x3e8($v0) -/* 0B533C 7F08080C 8C790000 */ lw $t9, ($v1) -/* 0B5340 7F080810 AF2503EC */ sw $a1, 0x3ec($t9) -/* 0B5344 7F080814 8C620000 */ lw $v0, ($v1) -/* 0B5348 7F080818 8C4803D4 */ lw $t0, 0x3d4($v0) -/* 0B534C 7F08081C AC4803F0 */ sw $t0, 0x3f0($v0) -/* 0B5350 7F080820 8C690000 */ lw $t1, ($v1) -/* 0B5354 7F080824 AD2603F4 */ sw $a2, 0x3f4($t1) -/* 0B5358 7F080828 8C620000 */ lw $v0, ($v1) -/* 0B535C 7F08082C 8C4A03D8 */ lw $t2, 0x3d8($v0) -/* 0B5360 7F080830 AC4A03F8 */ sw $t2, 0x3f8($v0) -/* 0B5364 7F080834 8C6B0000 */ lw $t3, ($v1) -/* 0B5368 7F080838 AD6703FC */ sw $a3, 0x3fc($t3) -/* 0B536C 7F08083C 8C620000 */ lw $v0, ($v1) -/* 0B5370 7F080840 C44603DC */ lwc1 $f6, 0x3dc($v0) -/* 0B5374 7F080844 E4460400 */ swc1 $f6, 0x400($v0) -/* 0B5378 7F080848 8C6C0000 */ lw $t4, ($v1) -/* 0B537C 7F08084C C7A80010 */ lwc1 $f8, 0x10($sp) -/* 0B5380 7F080850 03E00008 */ jr $ra -/* 0B5384 7F080854 E5880404 */ swc1 $f8, 0x404($t4) -) -#endif - - - - - -#ifdef NONMATCHING -void fade_to_over_seconds(f32 arg1) { - // Node 0 - return sub_GAME_7F0807E0(pPlayer->tint_red, pPlayer->tint_green, pPlayer->tint_blue); -} - -#else -GLOBAL_ASM( -.text -glabel fade_to_over_seconds -/* 0B5388 7F080858 3C028008 */ lui $v0, %hi(pPlayer) -/* 0B538C 7F08085C 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) -/* 0B5390 7F080860 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0B5394 7F080864 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B5398 7F080868 8C4703D8 */ lw $a3, 0x3d8($v0) -/* 0B539C 7F08086C 8C4603D4 */ lw $a2, 0x3d4($v0) -/* 0B53A0 7F080870 8C4503D0 */ lw $a1, 0x3d0($v0) -/* 0B53A4 7F080874 0FC201F8 */ jal sub_GAME_7F0807E0 -/* 0B53A8 7F080878 E7AE0010 */ swc1 $f14, 0x10($sp) -/* 0B53AC 7F08087C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B53B0 7F080880 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0B53B4 7F080884 03E00008 */ jr $ra -/* 0B53B8 7F080888 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void check_if_fade_to_black_complete(void) { - // Node 0 - if (pPlayer->time_for_fade < 0.0f) - { - // Node 1 +s16 viGetViewLeft(void); +s16 viGetViewTop(void); +s16 viGetViewWidth(void); +s16 viGetViewHeight(void); +Gfx *currentPlayerDrawFade(Gfx *gdl) { + f32 frac = pPlayer->colourscreenfrac; + s32 r = pPlayer->colourscreenred; + s32 g = pPlayer->colourscreengreen; + s32 b = pPlayer->colourscreenblue; + if ((camera_80036430 != 0) || (camera_80036434 != 0)) { + frac = 1.0f; + b = 0; + g = 0; + r = 0; } - // Node 2 - return 0; -} -#else -GLOBAL_ASM( -.text -glabel check_if_fade_to_black_complete -/* 0B53BC 7F08088C 3C0E8008 */ lui $t6, %hi(pPlayer) -/* 0B53C0 7F080890 8DCEA0B0 */ lw $t6, %lo(pPlayer)($t6) -/* 0B53C4 7F080894 44803000 */ mtc1 $zero, $f6 -/* 0B53C8 7F080898 00001025 */ move $v0, $zero -/* 0B53CC 7F08089C C5C403E4 */ lwc1 $f4, 0x3e4($t6) -/* 0B53D0 7F0808A0 4606203C */ c.lt.s $f4, $f6 -/* 0B53D4 7F0808A4 00000000 */ nop -/* 0B53D8 7F0808A8 45000002 */ bc1f .L7F0808B4 -/* 0B53DC 7F0808AC 00000000 */ nop -/* 0B53E0 7F0808B0 24020001 */ li $v0, 1 -.L7F0808B4: -/* 0B53E4 7F0808B4 03E00008 */ jr $ra -/* 0B53E8 7F0808B8 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void *sub_GAME_7F0808BC(void) { - f32 temp_f12; - - // Node 0 - if (0.0f <= pPlayer->time_for_fade) - { - // Node 1 - pPlayer->field_3E0 = (f32) (pPlayer->field_3E0 + global_timer_delta); - if (pPlayer->field_3E0 < pPlayer->time_for_fade) - { - // Node 2 - temp_f12 = (pPlayer->field_3E0 / pPlayer->time_for_fade); - pPlayer->tint_alpha = (f32) (pPlayer->field_400 + ((pPlayer->field_404 - pPlayer->field_400) * temp_f12)); - pPlayer->tint_red = (s32) (pPlayer->field_3E8 + (s32) ((f32) (pPlayer->field_3EC - pPlayer->field_3E8) * temp_f12)); - pPlayer->tint_green = (s32) (pPlayer->field_3F0 + (s32) ((f32) (pPlayer->field_3F4 - pPlayer->field_3F0) * temp_f12)); - pPlayer->tint_blue = (s32) (pPlayer->field_3F8 + (s32) ((f32) (pPlayer->field_3FC - pPlayer->field_3F8) * temp_f12)); - return pPlayer; - } - // Node 3 - pPlayer->tint_alpha = (f32) pPlayer->field_404; - pPlayer->tint_red = (s32) pPlayer->field_3EC; - pPlayer->tint_green = (s32) pPlayer->field_3F4; - pPlayer->tint_blue = (s32) pPlayer->field_3FC; - pPlayer->time_for_fade = -1.0f; + if (frac > 0) { + gDPPipeSync(gdl++); + gDPSetCycleType(gdl++, G_CYC_1CYCLE); + gDPSetColorDither(gdl++, G_CD_DISABLE); + gDPSetTexturePersp(gdl++, G_TP_NONE); + gDPSetAlphaCompare(gdl++, G_AC_NONE); + gDPSetTextureLOD(gdl++, G_TL_TILE); + gDPSetTextureFilter(gdl++, G_TF_BILERP); + gDPSetTextureConvert(gdl++, G_TC_FILT); + gDPSetTextureLUT(gdl++, G_TT_NONE); + gDPSetRenderMode(gdl++, G_RM_CLD_SURF, G_RM_CLD_SURF2); + gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPSetPrimColor(gdl++, 0, 0, r, g, b, (s32)(frac * 255.0f)); + gDPFillRectangle(gdl++, viGetViewLeft(), viGetViewTop(), (viGetViewLeft() + viGetViewWidth()), (viGetViewTop() + viGetViewHeight())); + gDPPipeSync(gdl++); + gDPSetColorDither(gdl++, G_CD_BAYER); + gDPSetTexturePersp(gdl++, G_TP_PERSP); + gDPSetTextureLOD(gdl++, G_TL_LOD); } - // Node 4 - return pPlayer; + + return gdl; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0808BC -/* 0B53EC 7F0808BC 3C068008 */ lui $a2, %hi(pPlayer) -/* 0B53F0 7F0808C0 24C6A0B0 */ addiu $a2, %lo(pPlayer) # addiu $a2, $a2, -0x5f50 -/* 0B53F4 7F0808C4 8CC20000 */ lw $v0, ($a2) -/* 0B53F8 7F0808C8 44803000 */ mtc1 $zero, $f6 -/* 0B53FC 7F0808CC 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B5400 7F0808D0 C44403E4 */ lwc1 $f4, 0x3e4($v0) -/* 0B5404 7F0808D4 4604303E */ c.le.s $f6, $f4 -/* 0B5408 7F0808D8 00000000 */ nop -/* 0B540C 7F0808DC 4500004A */ bc1f .L7F080A08 -/* 0B5410 7F0808E0 00000000 */ nop -/* 0B5414 7F0808E4 C44803E0 */ lwc1 $f8, 0x3e0($v0) -/* 0B5418 7F0808E8 C42A8378 */ lwc1 $f10, %lo(global_timer_delta)($at) -/* 0B541C 7F0808EC 460A4400 */ add.s $f16, $f8, $f10 -/* 0B5420 7F0808F0 E45003E0 */ swc1 $f16, 0x3e0($v0) -/* 0B5424 7F0808F4 8CC20000 */ lw $v0, ($a2) -/* 0B5428 7F0808F8 C44203E0 */ lwc1 $f2, 0x3e0($v0) -/* 0B542C 7F0808FC C44003E4 */ lwc1 $f0, 0x3e4($v0) -/* 0B5430 7F080900 4600103C */ c.lt.s $f2, $f0 -/* 0B5434 7F080904 00000000 */ nop -/* 0B5438 7F080908 45020031 */ bc1fl .L7F0809D0 -/* 0B543C 7F08090C C44A0404 */ lwc1 $f10, 0x404($v0) -/* 0B5440 7F080910 46001303 */ div.s $f12, $f2, $f0 -/* 0B5444 7F080914 C44E0400 */ lwc1 $f14, 0x400($v0) -/* 0B5448 7F080918 C4520404 */ lwc1 $f18, 0x404($v0) -/* 0B544C 7F08091C 460E9101 */ sub.s $f4, $f18, $f14 -/* 0B5450 7F080920 460C2182 */ mul.s $f6, $f4, $f12 -/* 0B5454 7F080924 46067200 */ add.s $f8, $f14, $f6 -/* 0B5458 7F080928 E44803DC */ swc1 $f8, 0x3dc($v0) -/* 0B545C 7F08092C 8CC20000 */ lw $v0, ($a2) -/* 0B5460 7F080930 8C4303E8 */ lw $v1, 0x3e8($v0) -/* 0B5464 7F080934 8C4E03EC */ lw $t6, 0x3ec($v0) -/* 0B5468 7F080938 01C37823 */ subu $t7, $t6, $v1 -/* 0B546C 7F08093C 448F5000 */ mtc1 $t7, $f10 -/* 0B5470 7F080940 00000000 */ nop -/* 0B5474 7F080944 46805420 */ cvt.s.w $f16, $f10 -/* 0B5478 7F080948 460C8482 */ mul.s $f18, $f16, $f12 -/* 0B547C 7F08094C 4600910D */ trunc.w.s $f4, $f18 -/* 0B5480 7F080950 44192000 */ mfc1 $t9, $f4 -/* 0B5484 7F080954 00000000 */ nop -/* 0B5488 7F080958 00794021 */ addu $t0, $v1, $t9 -/* 0B548C 7F08095C AC4803D0 */ sw $t0, 0x3d0($v0) -/* 0B5490 7F080960 8CC20000 */ lw $v0, ($a2) -/* 0B5494 7F080964 8C4403F0 */ lw $a0, 0x3f0($v0) -/* 0B5498 7F080968 8C4903F4 */ lw $t1, 0x3f4($v0) -/* 0B549C 7F08096C 01245023 */ subu $t2, $t1, $a0 -/* 0B54A0 7F080970 448A3000 */ mtc1 $t2, $f6 -/* 0B54A4 7F080974 00000000 */ nop -/* 0B54A8 7F080978 46803220 */ cvt.s.w $f8, $f6 -/* 0B54AC 7F08097C 460C4282 */ mul.s $f10, $f8, $f12 -/* 0B54B0 7F080980 4600540D */ trunc.w.s $f16, $f10 -/* 0B54B4 7F080984 440C8000 */ mfc1 $t4, $f16 -/* 0B54B8 7F080988 00000000 */ nop -/* 0B54BC 7F08098C 008C6821 */ addu $t5, $a0, $t4 -/* 0B54C0 7F080990 AC4D03D4 */ sw $t5, 0x3d4($v0) -/* 0B54C4 7F080994 8CC20000 */ lw $v0, ($a2) -/* 0B54C8 7F080998 8C4503F8 */ lw $a1, 0x3f8($v0) -/* 0B54CC 7F08099C 8C4E03FC */ lw $t6, 0x3fc($v0) -/* 0B54D0 7F0809A0 01C57823 */ subu $t7, $t6, $a1 -/* 0B54D4 7F0809A4 448F9000 */ mtc1 $t7, $f18 -/* 0B54D8 7F0809A8 00000000 */ nop -/* 0B54DC 7F0809AC 46809120 */ cvt.s.w $f4, $f18 -/* 0B54E0 7F0809B0 460C2182 */ mul.s $f6, $f4, $f12 -/* 0B54E4 7F0809B4 4600320D */ trunc.w.s $f8, $f6 -/* 0B54E8 7F0809B8 44194000 */ mfc1 $t9, $f8 -/* 0B54EC 7F0809BC 00000000 */ nop -/* 0B54F0 7F0809C0 00B94021 */ addu $t0, $a1, $t9 -/* 0B54F4 7F0809C4 03E00008 */ jr $ra -/* 0B54F8 7F0809C8 AC4803D8 */ sw $t0, 0x3d8($v0) -/* 0B54FC 7F0809CC C44A0404 */ lwc1 $f10, 0x404($v0) -.L7F0809D0: -/* 0B5500 7F0809D0 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5504 7F0809D4 44818000 */ mtc1 $at, $f16 -/* 0B5508 7F0809D8 E44A03DC */ swc1 $f10, 0x3dc($v0) -/* 0B550C 7F0809DC 8CC20000 */ lw $v0, ($a2) -/* 0B5510 7F0809E0 8C4903EC */ lw $t1, 0x3ec($v0) -/* 0B5514 7F0809E4 AC4903D0 */ sw $t1, 0x3d0($v0) -/* 0B5518 7F0809E8 8CC20000 */ lw $v0, ($a2) -/* 0B551C 7F0809EC 8C4A03F4 */ lw $t2, 0x3f4($v0) -/* 0B5520 7F0809F0 AC4A03D4 */ sw $t2, 0x3d4($v0) -/* 0B5524 7F0809F4 8CC20000 */ lw $v0, ($a2) -/* 0B5528 7F0809F8 8C4B03FC */ lw $t3, 0x3fc($v0) -/* 0B552C 7F0809FC AC4B03D8 */ sw $t3, 0x3d8($v0) -/* 0B5530 7F080A00 8CCC0000 */ lw $t4, ($a2) -/* 0B5534 7F080A04 E59003E4 */ swc1 $f16, 0x3e4($t4) -.L7F080A08: -/* 0B5538 7F080A08 03E00008 */ jr $ra -/* 0B553C 7F080A0C 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void *set_curplayer_fade(f32 arg0, f32 arg1) { - f32 temp_f8; - f32 phi_f8; - - // Node 0 - if (pPlayer->field_A8->unk4 != 0) - { - // Node 1 - pPlayer->viewport_alpha = 0.0f; - pPlayer->bondfadetime60 = arg0; - temp_f8 = (f32) pPlayer->field_A8->unk4->unkC; - phi_f8 = temp_f8; - if (pPlayer->field_A8->unk4->unkC < 0) - { - // Node 2 - phi_f8 = (temp_f8 + 4294967296.0f); - } - // Node 3 - pPlayer->bondfadetimemax = (f32) (phi_f8 / 255.0f); - pPlayer->bondfadefracold = arg1; - } - // Node 4 - return pPlayer->field_A8->unk4; +void currentPlayerSetFadeColour(s32 r, s32 g, s32 b, f32 frac) { + pPlayer->colourscreenred = r; + pPlayer->colourscreengreen = g; + pPlayer->colourscreenblue = b; + pPlayer->colourscreenfrac = frac; } -#else -GLOBAL_ASM( -.text -glabel set_curplayer_fade -/* 0B5540 7F080A10 3C048008 */ lui $a0, %hi(pPlayer) -/* 0B5544 7F080A14 2484A0B0 */ addiu $a0, %lo(pPlayer) # addiu $a0, $a0, -0x5f50 -/* 0B5548 7F080A18 8C830000 */ lw $v1, ($a0) -/* 0B554C 7F080A1C 8C6E00A8 */ lw $t6, 0xa8($v1) -/* 0B5550 7F080A20 8DC20004 */ lw $v0, 4($t6) -/* 0B5554 7F080A24 10400014 */ beqz $v0, .L7F080A78 -/* 0B5558 7F080A28 00000000 */ nop -/* 0B555C 7F080A2C 44802000 */ mtc1 $zero, $f4 -/* 0B5560 7F080A30 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B5564 7F080A34 E464018C */ swc1 $f4, 0x18c($v1) -/* 0B5568 7F080A38 8C8F0000 */ lw $t7, ($a0) -/* 0B556C 7F080A3C E5EC0190 */ swc1 $f12, 0x190($t7) -/* 0B5570 7F080A40 9058000C */ lbu $t8, 0xc($v0) -/* 0B5574 7F080A44 44983000 */ mtc1 $t8, $f6 -/* 0B5578 7F080A48 07010004 */ bgez $t8, .L7F080A5C -/* 0B557C 7F080A4C 46803220 */ cvt.s.w $f8, $f6 -/* 0B5580 7F080A50 44815000 */ mtc1 $at, $f10 -/* 0B5584 7F080A54 00000000 */ nop -/* 0B5588 7F080A58 460A4200 */ add.s $f8, $f8, $f10 -.L7F080A5C: -/* 0B558C 7F080A5C 3C01437F */ li $at, 0x437F0000 # 255.000000 -/* 0B5590 7F080A60 44818000 */ mtc1 $at, $f16 -/* 0B5594 7F080A64 8C990000 */ lw $t9, ($a0) -/* 0B5598 7F080A68 46104483 */ div.s $f18, $f8, $f16 -/* 0B559C 7F080A6C E7320194 */ swc1 $f18, 0x194($t9) -/* 0B55A0 7F080A70 8C880000 */ lw $t0, ($a0) -/* 0B55A4 7F080A74 E50E0198 */ swc1 $f14, 0x198($t0) -.L7F080A78: -/* 0B55A8 7F080A78 03E00008 */ jr $ra -/* 0B55AC 7F080A7C 00000000 */ nop -) -#endif - - - - -#ifdef NONMATCHING -void *update_curplayer_fade(void) { - f32 phi_f12; - - // Node 0 - if (0.0f <= pPlayer->bondfadetime60) - { - // Node 1 - pPlayer->viewport_alpha = (f32) (pPlayer->viewport_alpha + *(void *)0x80050000); - if (pPlayer->viewport_alpha < pPlayer->bondfadetime60) - { - // Node 2 - phi_f12 = (pPlayer->bondfadetimemax + (((pPlayer->bondfadefracold - pPlayer->bondfadetimemax) * pPlayer->viewport_alpha) / pPlayer->bondfadetime60)); - } - else - { - // Node 3 - pPlayer->bondfadetime60 = -1.0f; - phi_f12 = pPlayer->bondfadefracold; - } - // Node 4 - if (pPlayer->field_A8->unk4 != 0) - { - // Node 5 - pPlayer->field_A8->unk4->unkC = (s32) (phi_f12 * 255.0f); - } - } - // Node 6 - return pPlayer; +void currentPlayerAdjustFade(f32 maxfadetime, s32 r, s32 g, s32 b, f32 frac) { + pPlayer->colourfadetime60 = 0; + pPlayer->colourfadetimemax60 = maxfadetime; + pPlayer->colourfaderedold = pPlayer->colourscreenred; + pPlayer->colourfaderednew = r; + pPlayer->colourfadegreenold = pPlayer->colourscreengreen; + pPlayer->colourfadegreennew = g; + pPlayer->colourfadeblueold = pPlayer->colourscreenblue; + pPlayer->colourfadebluenew = b; + pPlayer->colourfadefracold = pPlayer->colourscreenfrac; + pPlayer->colourfadefracnew = frac; } -#else -GLOBAL_ASM( -.text -glabel update_curplayer_fade -/* 0B55B0 7F080A80 3C048008 */ lui $a0, %hi(pPlayer) -/* 0B55B4 7F080A84 2484A0B0 */ addiu $a0, %lo(pPlayer) # addiu $a0, $a0, -0x5f50 -/* 0B55B8 7F080A88 8C820000 */ lw $v0, ($a0) -/* 0B55BC 7F080A8C 44803000 */ mtc1 $zero, $f6 -/* 0B55C0 7F080A90 3C018005 */ lui $at, %hi(global_timer_delta) -/* 0B55C4 7F080A94 C4440190 */ lwc1 $f4, 0x190($v0) -/* 0B55C8 7F080A98 4604303E */ c.le.s $f6, $f4 -/* 0B55CC 7F080A9C 00000000 */ nop -/* 0B55D0 7F080AA0 45000022 */ bc1f .L7F080B2C -/* 0B55D4 7F080AA4 00000000 */ nop -/* 0B55D8 7F080AA8 C448018C */ lwc1 $f8, 0x18c($v0) -/* 0B55DC 7F080AAC C42A8378 */ lwc1 $f10, %lo(global_timer_delta)($at) -/* 0B55E0 7F080AB0 8C4E00A8 */ lw $t6, 0xa8($v0) -/* 0B55E4 7F080AB4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B55E8 7F080AB8 460A4400 */ add.s $f16, $f8, $f10 -/* 0B55EC 7F080ABC 8DC30004 */ lw $v1, 4($t6) -/* 0B55F0 7F080AC0 E450018C */ swc1 $f16, 0x18c($v0) -/* 0B55F4 7F080AC4 8C820000 */ lw $v0, ($a0) -/* 0B55F8 7F080AC8 C442018C */ lwc1 $f2, 0x18c($v0) -/* 0B55FC 7F080ACC C4400190 */ lwc1 $f0, 0x190($v0) -/* 0B5600 7F080AD0 4600103C */ c.lt.s $f2, $f0 -/* 0B5604 7F080AD4 00000000 */ nop -/* 0B5608 7F080AD8 45020009 */ bc1fl .L7F080B00 -/* 0B560C 7F080ADC 44815000 */ mtc1 $at, $f10 -/* 0B5610 7F080AE0 C44E0194 */ lwc1 $f14, 0x194($v0) -/* 0B5614 7F080AE4 C4520198 */ lwc1 $f18, 0x198($v0) -/* 0B5618 7F080AE8 460E9101 */ sub.s $f4, $f18, $f14 -/* 0B561C 7F080AEC 46022182 */ mul.s $f6, $f4, $f2 -/* 0B5620 7F080AF0 46003203 */ div.s $f8, $f6, $f0 -/* 0B5624 7F080AF4 10000004 */ b .L7F080B08 -/* 0B5628 7F080AF8 46087300 */ add.s $f12, $f14, $f8 -/* 0B562C 7F080AFC 44815000 */ mtc1 $at, $f10 -.L7F080B00: -/* 0B5630 7F080B00 C44C0198 */ lwc1 $f12, 0x198($v0) -/* 0B5634 7F080B04 E44A0190 */ swc1 $f10, 0x190($v0) -.L7F080B08: -/* 0B5638 7F080B08 10600008 */ beqz $v1, .L7F080B2C -/* 0B563C 7F080B0C 3C01437F */ li $at, 0x437F0000 # 255.000000 -/* 0B5640 7F080B10 44818000 */ mtc1 $at, $f16 -/* 0B5644 7F080B14 00000000 */ nop -/* 0B5648 7F080B18 46106482 */ mul.s $f18, $f12, $f16 -/* 0B564C 7F080B1C 4600910D */ trunc.w.s $f4, $f18 -/* 0B5650 7F080B20 44182000 */ mfc1 $t8, $f4 -/* 0B5654 7F080B24 00000000 */ nop -/* 0B5658 7F080B28 A078000C */ sb $t8, 0xc($v1) -.L7F080B2C: -/* 0B565C 7F080B2C 03E00008 */ jr $ra -/* 0B5660 7F080B30 00000000 */ nop -) -#endif +void currentPlayerSetFadeFrac(f32 maxfadetime, f32 frac) { + currentPlayerAdjustFade(maxfadetime, pPlayer->colourscreenred, pPlayer->colourscreengreen, pPlayer->colourscreenblue, frac); +} +s32 /*bool*/ currentPlayerIsFadeComplete(void) +{ + return pPlayer->colourfadetimemax60 < 0; +} +void currentPlayerUpdateColourScreenProperties(void) +{ + if (pPlayer->colourfadetimemax60 >= 0) { + pPlayer->colourfadetime60 += global_timer_delta; + if (pPlayer->colourfadetime60 < pPlayer->colourfadetimemax60) { + f32 mult = pPlayer->colourfadetime60 / pPlayer->colourfadetimemax60; + pPlayer->colourscreenfrac = pPlayer->colourfadefracold + (pPlayer->colourfadefracnew - pPlayer->colourfadefracold) * mult; + pPlayer->colourscreenred = pPlayer->colourfaderedold + (s32)((pPlayer->colourfaderednew - pPlayer->colourfaderedold) * mult); + pPlayer->colourscreengreen = pPlayer->colourfadegreenold + (s32)((pPlayer->colourfadegreennew - pPlayer->colourfadegreenold) * mult); + pPlayer->colourscreenblue = pPlayer->colourfadeblueold + (s32)((pPlayer->colourfadebluenew - pPlayer->colourfadeblueold) * mult); + return; + } + + pPlayer->colourscreenfrac = pPlayer->colourfadefracnew; + pPlayer->colourscreenred = pPlayer->colourfaderednew; + pPlayer->colourscreengreen = pPlayer->colourfadegreennew; + pPlayer->colourscreenblue = pPlayer->colourfadebluenew; + pPlayer->colourfadetimemax60 = -1; + } +} + +void currentPlayerStartChrFade(f32 duration60, f32 targetfrac) +{ + struct chrdata* chr = pPlayer->prop->chr; + + if (chr) { + pPlayer->bondfadetime60 = 0; + pPlayer->bondfadetimemax60 = duration60; + pPlayer->bondfadefracold = chr->fadealpha / 255.0f; + pPlayer->bondfadefracnew = targetfrac; + } +} + +void currentPlayerTickChrFade(void) +{ + if (pPlayer->bondfadetimemax60 >= 0) { + struct chrdata *chr = pPlayer->prop->chr; + f32 frac; + + pPlayer->bondfadetime60 += global_timer_delta; + + if (pPlayer->bondfadetime60 < pPlayer->bondfadetimemax60) { + frac = pPlayer->bondfadefracold + + (pPlayer->bondfadefracnew - pPlayer->bondfadefracold) + * pPlayer->bondfadetime60 + / pPlayer->bondfadetimemax60; + } else { + frac = pPlayer->bondfadefracnew; + pPlayer->bondfadetimemax60 = -1; + } + + if (chr) { + chr->fadealpha = (s8)(frac * 255); + } + } +} #ifdef NONMATCHING void sub_GAME_7F080B34(void) { @@ -16197,7 +14055,7 @@ glabel sub_GAME_7F080B34 /* 0B57DC 7F080CAC C4440518 */ lwc1 $f4, 0x518($v0) /* 0B57E0 7F080CB0 E7A40020 */ swc1 $f4, 0x20($sp) /* 0B57E4 7F080CB4 C446051C */ lwc1 $f6, 0x51c($v0) -/* 0B57E8 7F080CB8 0FC16642 */ jal sub_GAME_7F059908 +/* 0B57E8 7F080CB8 0FC16642 */ jal matrix_4x4_7F059908 /* 0B57EC 7F080CBC E7A60024 */ swc1 $f6, 0x24($sp) /* 0B57F0 7F080CC0 27A4004C */ addiu $a0, $sp, 0x4c /* 0B57F4 7F080CC4 0FC1601A */ jal matrix_4x4_multiply_in_place @@ -17506,7 +15364,7 @@ glabel controller_gameplay_interaction /* 0B661C 7F081AEC 53000009 */ beql $t8, $zero, .L7F081B14 /* 0B6620 7F081AF0 8E080000 */ lw $t0, ($s0) .L7F081AF4: -/* 0B6624 7F081AF4 0FC26919 */ jal get_num_players +/* 0B6624 7F081AF4 0FC26919 */ jal getPlayerCount /* 0B6628 7F081AF8 00000000 */ nop /* 0B662C 7F081AFC 24010001 */ li $at, 1 /* 0B6630 7F081B00 54410004 */ bnel $v0, $at, .L7F081B14 @@ -17522,7 +15380,7 @@ glabel controller_gameplay_interaction /* 0B6650 7F081B20 8D0A00D8 */ lw $t2, 0xd8($t0) /* 0B6654 7F081B24 554003A9 */ bnezl $t2, .L7F0829CC /* 0B6658 7F081B28 8E0A0000 */ lw $t2, ($s0) -/* 0B665C 7F081B2C 0FC26919 */ jal get_num_players +/* 0B665C 7F081B2C 0FC26919 */ jal getPlayerCount /* 0B6660 7F081B30 00000000 */ nop /* 0B6664 7F081B34 24010001 */ li $at, 1 /* 0B6668 7F081B38 10410008 */ beq $v0, $at, .L7F081B5C @@ -17563,7 +15421,7 @@ glabel controller_gameplay_interaction /* 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 get_num_players +/* 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 @@ -17572,7 +15430,7 @@ glabel controller_gameplay_interaction /* 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 get_num_players +/* 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 @@ -17581,7 +15439,7 @@ glabel controller_gameplay_interaction /* 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 get_num_players +/* 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 @@ -18734,7 +16592,7 @@ glabel controller_gameplay_interaction /* 0B7794 7F082C64 00000000 */ nop /* 0B7798 7F082C68 10400007 */ beqz $v0, .L7F082C88 /* 0B779C 7F082C6C 00000000 */ nop -/* 0B77A0 7F082C70 0FC26919 */ jal get_num_players +/* 0B77A0 7F082C70 0FC26919 */ jal getPlayerCount /* 0B77A4 7F082C74 00000000 */ nop /* 0B77A8 7F082C78 24010001 */ li $at, 1 /* 0B77AC 7F082C7C 14410002 */ bne $v0, $at, .L7F082C88 @@ -19206,33 +17064,33 @@ glabel controller_gameplay_interaction /* 0B7E54 7F083324 8FAC0150 */ lw $t4, 0x150($sp) /* 0B7E58 7F083328 11A00005 */ beqz $t5, .L7F083340 /* 0B7E5C 7F08332C 00000000 */ nop -/* 0B7E60 7F083330 0FC1E662 */ jal sub_GAME_7F079988 +/* 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 sub_GAME_7F079988 +/* 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 sub_GAME_7F079988 +/* 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 change_crouch_position +/* 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 change_crouch_position +/* 0B7EB8 7F083388 0FC1E66B */ jal currentPlayerAdjustCrouchPos /* 0B7EBC 7F08338C 24040002 */ li $a0, 2 /* 0B7EC0 7F083390 8E080000 */ lw $t0, ($s0) .L7F083394: @@ -19582,7 +17440,7 @@ glabel controller_gameplay_interaction /* 0B83BC 7F08388C 45020007 */ bc1fl .L7F0838AC /* 0B83C0 7F083890 460C7281 */ sub.s $f10, $f14, $f12 /* 0B83C4 7F083894 44816000 */ mtc1 $at, $f12 -/* 0B83C8 7F083898 0FC20004 */ jal sub_GAME_7F080010 +/* 0B83C8 7F083898 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 0B83CC 7F08389C E7AE00C4 */ swc1 $f14, 0xc4($sp) /* 0B83D0 7F0838A0 10000010 */ b .L7F0838E4 /* 0B83D4 7F0838A4 C7AE00C4 */ lwc1 $f14, 0xc4($sp) @@ -19594,13 +17452,13 @@ glabel controller_gameplay_interaction /* 0B83E8 7F0838B8 45020007 */ bc1fl .L7F0838D8 /* 0B83EC 7F0838BC 4600A306 */ mov.s $f12, $f20 /* 0B83F0 7F0838C0 44816000 */ mtc1 $at, $f12 -/* 0B83F4 7F0838C4 0FC20004 */ jal sub_GAME_7F080010 +/* 0B83F4 7F0838C4 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 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 sub_GAME_7F080010 +/* 0B8408 7F0838D8 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 0B840C 7F0838DC E7AE00C4 */ swc1 $f14, 0xc4($sp) /* 0B8410 7F0838E0 C7AE00C4 */ lwc1 $f14, 0xc4($sp) .L7F0838E4: @@ -19645,7 +17503,7 @@ glabel controller_gameplay_interaction .L7F083970: /* 0B84A0 7F083970 1140002E */ beqz $t2, .L7F083A2C /* 0B84A4 7F083974 C7B20184 */ lwc1 $f18, 0x184($sp) -/* 0B84A8 7F083978 0C001177 */ jal video_related_23 +/* 0B84A8 7F083978 0C001177 */ jal viGetFovY /* 0B84AC 7F08397C 00000000 */ nop /* 0B84B0 7F083980 8FAB0128 */ lw $t3, 0x128($sp) /* 0B84B4 7F083984 3C014270 */ li $at, 0x42700000 # 60.000000 @@ -19699,7 +17557,7 @@ glabel controller_gameplay_interaction /* 0B8560 7F083A30 C7A40180 */ lwc1 $f4, 0x180($sp) /* 0B8564 7F083A34 45020010 */ bc1fl .L7F083A78 /* 0B8568 7F083A38 4604A03C */ c.lt.s $f20, $f4 -/* 0B856C 7F083A3C 0FC20004 */ jal sub_GAME_7F080010 +/* 0B856C 7F083A3C 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 0B8570 7F083A40 46009306 */ mov.s $f12, $f18 /* 0B8574 7F083A44 8FAC01AC */ lw $t4, 0x1ac($sp) /* 0B8578 7F083A48 8FB80120 */ lw $t8, 0x120($sp) @@ -19719,7 +17577,7 @@ glabel controller_gameplay_interaction /* 0B85A8 7F083A78 00000000 */ nop /* 0B85AC 7F083A7C 4500000F */ bc1f .L7F083ABC /* 0B85B0 7F083A80 00000000 */ nop -/* 0B85B4 7F083A84 0FC20004 */ jal sub_GAME_7F080010 +/* 0B85B4 7F083A84 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 0B85B8 7F083A88 46002307 */ neg.s $f12, $f4 /* 0B85BC 7F083A8C 8FB901AC */ lw $t9, 0x1ac($sp) /* 0B85C0 7F083A90 8FAA0120 */ lw $t2, 0x120($sp) @@ -19735,7 +17593,7 @@ glabel controller_gameplay_interaction /* 0B85E4 7F083AB4 10000003 */ b .L7F083AC4 /* 0B85E8 7F083AB8 ADAB0110 */ sw $t3, 0x110($t5) .L7F083ABC: -/* 0B85EC 7F083ABC 0FC20004 */ jal sub_GAME_7F080010 +/* 0B85EC 7F083ABC 0FC20004 */ jal currentPlayerUpdateSpeedVerta /* 0B85F0 7F083AC0 4600A306 */ mov.s $f12, $f20 .L7F083AC4: /* 0B85F4 7F083AC4 8E080000 */ lw $t0, ($s0) @@ -19775,7 +17633,7 @@ glabel controller_gameplay_interaction /* 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 video_related_23 +/* 0B867C 7F083B4C 0C001177 */ jal viGetFovY /* 0B8680 7F083B50 00000000 */ nop /* 0B8684 7F083B54 8FAF012C */ lw $t7, 0x12c($sp) /* 0B8688 7F083B58 3C013F80 */ li $at, 0x3F800000 # 1.000000 @@ -19947,7 +17805,7 @@ glabel controller_gameplay_interaction /* 0B88D8 7F083DA8 AF200898 */ sw $zero, 0x898($t9) /* 0B88DC 7F083DAC 240A0001 */ li $t2, 1 .L7F083DB0: -/* 0B88E0 7F083DB0 0FC26919 */ jal get_num_players +/* 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 @@ -20213,7 +18071,7 @@ glabel sub_GAME_7F083FC8 /* 0B8C74 7F084144 44070000 */ mfc1 $a3, $f0 /* 0B8C78 7F084148 8D040020 */ lw $a0, 0x20($t0) /* 0B8C7C 7F08414C 8D050024 */ lw $a1, 0x24($t0) -/* 0B8C80 7F084150 0FC201EC */ jal set_rgba_tint +/* 0B8C80 7F084150 0FC201EC */ jal currentPlayerSetFadeColour /* 0B8C84 7F084154 8D060028 */ lw $a2, 0x28($t0) /* 0B8C88 7F084158 3C028008 */ lui $v0, %hi(pPlayer) /* 0B8C8C 7F08415C 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) @@ -20239,7 +18097,7 @@ glabel sub_GAME_7F083FC8 .L7F0841A0: /* 0B8CD0 7F0841A0 AC4E00F4 */ sw $t6, 0xf4($v0) /* 0B8CD4 7F0841A4 240600FF */ li $a2, 255 -/* 0B8CD8 7F0841A8 0FC201EC */ jal set_rgba_tint +/* 0B8CD8 7F0841A8 0FC201EC */ jal currentPlayerSetFadeColour /* 0B8CDC 7F0841AC 24070000 */ li $a3, 0 /* 0B8CE0 7F0841B0 3C028008 */ lui $v0, %hi(pPlayer) /* 0B8CE4 7F0841B4 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) @@ -20474,7 +18332,7 @@ glabel sub_GAME_7F083FC8 /* 0B92E4 7F084774 44070000 */ mfc1 $a3, $f0 /* 0B92E8 7F084778 8C640020 */ lw $a0, 0x20($v1) /* 0B92EC 7F08477C 8C650024 */ lw $a1, 0x24($v1) -/* 0B92F0 7F084780 0FC20370 */ jal set_rgba_tint +/* 0B92F0 7F084780 0FC20370 */ jal currentPlayerSetFadeColour /* 0B92F4 7F084784 8C660028 */ lw $a2, 0x28($v1) /* 0B92F8 7F084788 3C028008 */ lui $v0, %hi(pPlayer) # $v0, 0x8008 /* 0B92FC 7F08478C 8C42A120 */ lw $v0, %lo(pPlayer)($v0) @@ -20503,7 +18361,7 @@ glabel sub_GAME_7F083FC8 /* 0B9344 7F0847D4 240500FF */ li $a1, 255 /* 0B9348 7F0847D8 240600FF */ li $a2, 255 /* 0B934C 7F0847DC 24070000 */ li $a3, 0 -/* 0B9350 7F0847E0 0FC20370 */ jal set_rgba_tint +/* 0B9350 7F0847E0 0FC20370 */ jal currentPlayerSetFadeColour /* 0B9354 7F0847E4 E44600F4 */ swc1 $f6, 0xf4($v0) /* 0B9358 7F0847E8 3C028008 */ lui $v0, %hi(pPlayer) # $v0, 0x8008 /* 0B935C 7F0847EC 8C42A120 */ lw $v0, %lo(pPlayer)($v0) @@ -21078,7 +18936,7 @@ glabel MoveBond .L7F08474C: /* 0B927C 7F08474C 3C118008 */ lui $s1, %hi(pPlayer) /* 0B9280 7F084750 2631A0B0 */ addiu $s1, %lo(pPlayer) # addiu $s1, $s1, -0x5f50 -/* 0B9284 7F084754 0FC1E694 */ jal setptrBONDdata +/* 0B9284 7F084754 0FC1E694 */ jal currentPlayerSetField00 /* 0B9288 7F084758 00002025 */ move $a0, $zero /* 0B928C 7F08475C 0FC20FF2 */ jal sub_GAME_7F083FC8 /* 0B9290 7F084760 00000000 */ nop @@ -21109,7 +18967,7 @@ glabel MoveBond /* 0B92EC 7F0847BC 8D6B6448 */ lw $t3, %lo(in_tank_flag)($t3) /* 0B92F0 7F0847C0 1560006E */ bnez $t3, .L7F08497C /* 0B92F4 7F0847C4 00000000 */ nop -/* 0B92F8 7F0847C8 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 0B92F8 7F0847C8 0FC1E67C */ jal currentPlayerGetCrouchPos /* 0B92FC 7F0847CC 00000000 */ nop /* 0B9300 7F0847D0 5440000D */ bnezl $v0, .L7F084808 /* 0B9304 7F0847D4 8E280000 */ lw $t0, ($s1) @@ -21282,7 +19140,7 @@ glabel MoveBond /* 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 sub_GAME_7F0B28B0 +/* 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) @@ -21834,7 +19692,7 @@ glabel MoveBond .L7F08525C: /* 0B9D8C 7F08525C 0FC205E4 */ jal sub_GAME_7F081790 /* 0B9D90 7F085260 00000000 */ nop -/* 0B9D94 7F085264 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 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 @@ -21842,7 +19700,7 @@ glabel MoveBond /* 0B9DA8 7F085278 1000000B */ b .L7F0852A8 /* 0B9DAC 7F08527C E7A602AC */ swc1 $f6, 0x2ac($sp) .L7F085280: -/* 0B9DB0 7F085280 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 0B9DB0 7F085280 0FC1E67C */ jal currentPlayerGetCrouchPos /* 0B9DB4 7F085284 00000000 */ nop /* 0B9DB8 7F085288 24010001 */ li $at, 1 /* 0B9DBC 7F08528C 14410004 */ bne $v0, $at, .L7F0852A0 @@ -21851,7 +19709,7 @@ glabel MoveBond /* 0B9DC8 7F085298 10000003 */ b .L7F0852A8 /* 0B9DCC 7F08529C E7A402AC */ swc1 $f4, 0x2ac($sp) .L7F0852A0: -/* 0B9DD0 7F0852A0 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 0B9DD0 7F0852A0 0FC1E67C */ jal currentPlayerGetCrouchPos /* 0B9DD4 7F0852A4 00000000 */ nop .L7F0852A8: /* 0B9DD8 7F0852A8 8E280000 */ lw $t0, ($s1) @@ -23618,7 +21476,7 @@ glabel MoveBond .Ljp7F084DFC: /* 0B996C 7F084DFC 3C118008 */ lui $s1, %hi(pPlayer) # $s1, 0x8008 /* 0B9970 7F084E00 2631A120 */ addiu $s1, %lo(pPlayer) # addiu $s1, $s1, -0x5ee0 -/* 0B9974 7F084E04 0FC1E810 */ jal setptrBONDdata +/* 0B9974 7F084E04 0FC1E810 */ jal currentPlayerSetField00 /* 0B9978 7F084E08 00002025 */ move $a0, $zero /* 0B997C 7F084E0C 0FC21176 */ jal sub_GAME_7F083FC8 /* 0B9980 7F084E10 00000000 */ nop @@ -23649,7 +21507,7 @@ glabel MoveBond /* 0B99DC 7F084E6C 8D6B6488 */ lw $t3, %lo(in_tank_flag)($t3) /* 0B99E0 7F084E70 1560006E */ bnez $t3, .Ljp7F08502C /* 0B99E4 7F084E74 00000000 */ nop -/* 0B99E8 7F084E78 0FC1E7F8 */ jal sub_GAME_7F0799F0 +/* 0B99E8 7F084E78 0FC1E7F8 */ jal currentPlayerGetCrouchPos /* 0B99EC 7F084E7C 00000000 */ nop /* 0B99F0 7F084E80 5440000D */ bnezl $v0, .Ljp7F084EB8 /* 0B99F4 7F084E84 8E280000 */ lw $t0, ($s1) @@ -23822,7 +21680,7 @@ glabel MoveBond /* 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 sub_GAME_7F0B28B0 +/* 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) @@ -24374,7 +22232,7 @@ glabel MoveBond .Ljp7F08590C: /* 0BA47C 7F08590C 0FC20768 */ jal sub_GAME_7F081790 /* 0BA480 7F085910 00000000 */ nop -/* 0BA484 7F085914 0FC1E7F8 */ jal sub_GAME_7F0799F0 +/* 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 @@ -24382,7 +22240,7 @@ glabel MoveBond /* 0BA498 7F085928 1000000B */ b .Ljp7F085958 /* 0BA49C 7F08592C E7A602AC */ swc1 $f6, 0x2ac($sp) .Ljp7F085930: -/* 0BA4A0 7F085930 0FC1E7F8 */ jal sub_GAME_7F0799F0 +/* 0BA4A0 7F085930 0FC1E7F8 */ jal currentPlayerGetCrouchPos /* 0BA4A4 7F085934 00000000 */ nop /* 0BA4A8 7F085938 24010001 */ li $at, 1 /* 0BA4AC 7F08593C 14410004 */ bne $v0, $at, .Ljp7F085950 @@ -24391,7 +22249,7 @@ glabel MoveBond /* 0BA4B8 7F085948 10000003 */ b .Ljp7F085958 /* 0BA4BC 7F08594C E7A402AC */ swc1 $f4, 0x2ac($sp) .Ljp7F085950: -/* 0BA4C0 7F085950 0FC1E7F8 */ jal sub_GAME_7F0799F0 +/* 0BA4C0 7F085950 0FC1E7F8 */ jal currentPlayerGetCrouchPos /* 0BA4C4 7F085954 00000000 */ nop .Ljp7F085958: /* 0BA4C8 7F085958 8E280000 */ lw $t0, ($s1) @@ -26022,14 +23880,14 @@ void sub_GAME_7F086990(s32 arg0, s32 arg1, ? arg2, ? arg_unalignedA, ? arg3, ? a { // Node 7 sub_GAME_7F07B56C(arg_unalignedA, arg_unalignedE, &sp64, &sp58, &sp4C, &sp3C, &sp30); - setptrBONDdata(1); + currentPlayerSetField00(1); // Node 8 - return setptrBONDdata(0); + return currentPlayerSetField00(0); } } } // Node 6 - return setptrBONDdata(0); + return currentPlayerSetField00(0); } #else GLOBAL_ASM( @@ -26165,7 +24023,7 @@ glabel sub_GAME_7F086990 /* 0BB6B4 7F086B84 14410005 */ bne $v0, $at, .L7F086B9C /* 0BB6B8 7F086B88 97A4007A */ lhu $a0, 0x7a($sp) .L7F086B8C: -/* 0BB6BC 7F086B8C 0FC1E694 */ jal setptrBONDdata +/* 0BB6BC 7F086B8C 0FC1E694 */ jal currentPlayerSetField00 /* 0BB6C0 7F086B90 00002025 */ move $a0, $zero /* 0BB6C4 7F086B94 10000015 */ b .L7F086BEC /* 0BB6C8 7F086B98 8FBF0024 */ lw $ra, 0x24($sp) @@ -26180,7 +24038,7 @@ glabel sub_GAME_7F086990 /* 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 setptrBONDdata +/* 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) @@ -26219,7 +24077,7 @@ int getHeight330or240(void) { s32 get_curplayer_viewport_width(void) { - if (get_num_players() >= 3) + if (getPlayerCount() >= 3) { return 159; } @@ -26241,7 +24099,7 @@ s32 get_curplayer_viewport_width(void) s32 get_curplayer_viewport_ulx(void) { - if (2 < get_num_players()) { + if (2 < getPlayerCount()) { if ((get_cur_playernum() == 1) || (get_cur_playernum() == 3)) { return 0xa1; } @@ -26255,7 +24113,7 @@ s32 get_curplayer_viewport_ulx(void) #ifdef NONMATCHING s32 get_curplayer_viewport_height(void) { - if (get_num_players() >= 2) + if (getPlayerCount() >= 2) { return 0x6d; } @@ -26287,7 +24145,7 @@ GLOBAL_ASM( glabel get_curplayer_viewport_height /* 0BB854 7F086D24 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0BB858 7F086D28 AFBF0014 */ sw $ra, 0x14($sp) -/* 0BB85C 7F086D2C 0FC26919 */ jal get_num_players +/* 0BB85C 7F086D2C 0FC26919 */ jal getPlayerCount /* 0BB860 7F086D30 00000000 */ nop /* 0BB864 7F086D34 28410002 */ slti $at, $v0, 2 /* 0BB868 7F086D38 14200003 */ bnez $at, .L7F086D48 @@ -26377,7 +24235,7 @@ GLOBAL_ASM( glabel get_curplayer_viewport_uly /* 0BB968 7F086E38 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0BB96C 7F086E3C AFBF0014 */ sw $ra, 0x14($sp) -/* 0BB970 7F086E40 0FC26919 */ jal get_num_players +/* 0BB970 7F086E40 0FC26919 */ jal getPlayerCount /* 0BB974 7F086E44 00000000 */ nop /* 0BB978 7F086E48 24010002 */ li $at, 2 /* 0BB97C 7F086E4C 14410009 */ bne $v0, $at, .L7F086E74 @@ -26392,7 +24250,7 @@ glabel get_curplayer_viewport_uly /* 0BB99C 7F086E6C 10000047 */ b .L7F086F8C /* 0BB9A0 7F086E70 24020079 */ li $v0, 121 .L7F086E74: -/* 0BB9A4 7F086E74 0FC26919 */ jal get_num_players +/* 0BB9A4 7F086E74 0FC26919 */ jal getPlayerCount /* 0BB9A8 7F086E78 00000000 */ nop /* 0BB9AC 7F086E7C 28410003 */ slti $at, $v0, 3 /* 0BB9B0 7F086E80 1420000A */ bnez $at, .L7F086EAC @@ -26518,8 +24376,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BBB20 7F086FF0 8C790000 */ lw $t9, ($v1) /* 0BBB24 7F086FF4 0C000F07 */ jal get_video_settings2_frameb /* 0BBB28 7F086FF8 00000000 */ nop -/* 0BBB2C 7F086FFC 3C0F803E */ lui $t7, %hi(cfb_16_b) # $t7, 0x803e -/* 0BBB30 7F087000 25EFA800 */ addiu $t7, %lo(cfb_16_b) # addiu $t7, $t7, -0x5800 +/* 0BBB2C 7F086FFC 3C0F803E */ lui $t7, %hi(cfb_16+0x25800) # $t7, 0x803e +/* 0BBB30 7F087000 25EFA800 */ addiu $t7, %lo(cfb_16+0x25800) # addiu $t7, $t7, -0x5800 /* 0BBB34 7F087004 3C038003 */ lui $v1, %hi(camera_80036430) /* 0BBB38 7F087008 144F0006 */ bne $v0, $t7, .L7F087024 /* 0BBB3C 7F08700C 24636430 */ addiu $v1, %lo(camera_80036430) # addiu $v1, $v1, 0x6430 @@ -26544,8 +24402,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BBB7C 7F08704C 8C6A0000 */ lw $t2, ($v1) /* 0BBB80 7F087050 0C000F07 */ jal get_video_settings2_frameb /* 0BBB84 7F087054 00000000 */ nop -/* 0BBB88 7F087058 3C09803B */ lui $t1, %hi(cfb_16_a) # $t1, 0x803b -/* 0BBB8C 7F08705C 25295000 */ addiu $t1, %lo(cfb_16_a) # addiu $t1, $t1, 0x5000 +/* 0BBB88 7F087058 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b +/* 0BBB8C 7F08705C 25295000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, 0x5000 /* 0BBB90 7F087060 3C038003 */ lui $v1, %hi(camera_80036434) /* 0BBB94 7F087064 14490005 */ bne $v0, $t1, .L7F08707C /* 0BBB98 7F087068 24636434 */ addiu $v1, %lo(camera_80036434) # addiu $v1, $v1, 0x6434 @@ -26565,8 +24423,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BBBC4 7F087094 00000000 */ nop /* 0BBBC8 7F087098 0C000F07 */ jal get_video_settings2_frameb /* 0BBBCC 7F08709C 00000000 */ nop -/* 0BBBD0 7F0870A0 3C0D803E */ lui $t5, %hi(cfb_16_b) # $t5, 0x803e -/* 0BBBD4 7F0870A4 25ADA800 */ addiu $t5, %lo(cfb_16_b) # addiu $t5, $t5, -0x5800 +/* 0BBBD0 7F0870A0 3C0D803E */ lui $t5, %hi(cfb_16+0x25800) # $t5, 0x803e +/* 0BBBD4 7F0870A4 25ADA800 */ addiu $t5, %lo(cfb_16+0x25800) # addiu $t5, $t5, -0x5800 /* 0BBBD8 7F0870A8 144D0003 */ bne $v0, $t5, .L7F0870B8 /* 0BBBDC 7F0870AC 3C048003 */ lui $a0, %hi(resolution) /* 0BBBE0 7F0870B0 0C000F0F */ jal set_video2buf_frameb @@ -26613,7 +24471,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBC80 7F087150 46082182 */ mul.s $f6, $f4, $f8 /* 0BBC84 7F087154 00000000 */ nop /* 0BBC88 7F087158 46103302 */ mul.s $f12, $f6, $f16 -/* 0BBC8C 7F08715C 0C001164 */ jal video_related_21 +/* 0BBC8C 7F08715C 0C001164 */ jal set_page_aspect /* 0BBC90 7F087160 00000000 */ nop /* 0BBC94 7F087164 10000017 */ b .L7F0871C4 /* 0BBC98 7F087168 00000000 */ nop @@ -26638,7 +24496,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBCE0 7F0871B0 44993000 */ mtc1 $t9, $f6 /* 0BBCE4 7F0871B4 46805120 */ cvt.s.w $f4, $f10 /* 0BBCE8 7F0871B8 46803420 */ cvt.s.w $f16, $f6 -/* 0BBCEC 7F0871BC 0C001164 */ jal video_related_21 +/* 0BBCEC 7F0871BC 0C001164 */ jal set_page_aspect /* 0BBCF0 7F0871C0 46048303 */ div.s $f12, $f16, $f4 .L7F0871C4: /* 0BBCF4 7F0871C4 0FC21B10 */ jal get_curplayer_viewport_width @@ -26691,9 +24549,9 @@ glabel possibly_reset_viewport_options_for_player /* 0BBDB0 7F087280 01602825 */ move $a1, $t3 /* 0BBDB4 7F087284 0C00112F */ jal set_video2_ulx_uly /* 0BBDB8 7F087288 87A4001C */ lh $a0, 0x1c($sp) -/* 0BBDBC 7F08728C 0FC2022F */ jal sub_GAME_7F0808BC +/* 0BBDBC 7F08728C 0FC2022F */ jal currentPlayerUpdateColourScreenProperties /* 0BBDC0 7F087290 00000000 */ nop -/* 0BBDC4 7F087294 0FC202A0 */ jal update_curplayer_fade +/* 0BBDC4 7F087294 0FC202A0 */ jal currentPlayerTickChrFade /* 0BBDC8 7F087298 00000000 */ nop /* 0BBDCC 7F08729C 0FC29394 */ jal cur_player_get_autoaim /* 0BBDD0 7F0872A0 00000000 */ nop @@ -26712,7 +24570,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBE04 7F0872D4 24040001 */ li $a0, 1 /* 0BBE08 7F0872D8 0FC1A43D */ jal set_unset_ammo_on_screen_setting /* 0BBE0C 7F0872DC 00402825 */ move $a1, $v0 -/* 0BBE10 7F0872E0 0FC26919 */ jal get_num_players +/* 0BBE10 7F0872E0 0FC26919 */ jal getPlayerCount /* 0BBE14 7F0872E4 00000000 */ nop /* 0BBE18 7F0872E8 24010001 */ li $at, 1 /* 0BBE1C 7F0872EC 14410006 */ bne $v0, $at, .L7F087308 @@ -26723,7 +24581,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBE30 7F087300 14A0000B */ bnez $a1, .L7F087330 /* 0BBE34 7F087304 00000000 */ nop .L7F087308: -/* 0BBE38 7F087308 0FC26919 */ jal get_num_players +/* 0BBE38 7F087308 0FC26919 */ jal getPlayerCount /* 0BBE3C 7F08730C 00000000 */ nop /* 0BBE40 7F087310 28430002 */ slti $v1, $v0, 2 /* 0BBE44 7F087314 38650001 */ xori $a1, $v1, 1 @@ -26803,7 +24661,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBF54 7F087424 3109F030 */ andi $t1, $t0, 0xf030 /* 0BBF58 7F087428 11200025 */ beqz $t1, .L7F0874C0 /* 0BBF5C 7F08742C 00000000 */ nop -/* 0BBF60 7F087430 0FC20223 */ jal check_if_fade_to_black_complete +/* 0BBF60 7F087430 0FC20223 */ jal currentPlayerIsFadeComplete /* 0BBF64 7F087434 AC2A64A0 */ sw $t2, %lo(stop_time_flag)($at) /* 0BBF68 7F087438 10400015 */ beqz $v0, .L7F087490 /* 0BBF6C 7F08743C 3C0B8008 */ lui $t3, %hi(pPlayer) @@ -26817,13 +24675,13 @@ glabel possibly_reset_viewport_options_for_player /* 0BBF8C 7F08745C 45000018 */ bc1f .L7F0874C0 /* 0BBF90 7F087460 00000000 */ nop /* 0BBF94 7F087464 44070000 */ mfc1 $a3, $f0 -/* 0BBF98 7F087468 0FC201EC */ jal set_rgba_tint +/* 0BBF98 7F087468 0FC201EC */ jal currentPlayerSetFadeColour /* 0BBF9C 7F08746C 00003025 */ move $a2, $zero /* 0BBFA0 7F087470 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0BBFA4 7F087474 44816000 */ mtc1 $at, $f12 /* 0BBFA8 7F087478 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0BBFAC 7F08747C 44817000 */ mtc1 $at, $f14 -/* 0BBFB0 7F087480 0FC20216 */ jal fade_to_over_seconds +/* 0BBFB0 7F087480 0FC20216 */ jal currentPlayerSetFadeFrac /* 0BBFB4 7F087484 00000000 */ nop /* 0BBFB8 7F087488 1000000D */ b .L7F0874C0 /* 0BBFBC 7F08748C 00000000 */ nop @@ -26838,7 +24696,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBFDC 7F0874AC 45000004 */ bc1f .L7F0874C0 /* 0BBFE0 7F0874B0 00000000 */ nop /* 0BBFE4 7F0874B4 44817000 */ mtc1 $at, $f14 -/* 0BBFE8 7F0874B8 0FC20216 */ jal fade_to_over_seconds +/* 0BBFE8 7F0874B8 0FC20216 */ jal currentPlayerSetFadeFrac /* 0BBFEC 7F0874BC C44C03E0 */ lwc1 $f12, 0x3e0($v0) .L7F0874C0: /* 0BBFF0 7F0874C0 3C0C8003 */ lui $t4, %hi(stop_time_flag) @@ -26846,7 +24704,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BBFF8 7F0874C8 24010002 */ li $at, 2 /* 0BBFFC 7F0874CC 1581000F */ bne $t4, $at, .L7F08750C /* 0BC000 7F0874D0 00000000 */ nop -/* 0BC004 7F0874D4 0FC20223 */ jal check_if_fade_to_black_complete +/* 0BC004 7F0874D4 0FC20223 */ jal currentPlayerIsFadeComplete /* 0BC008 7F0874D8 00000000 */ nop /* 0BC00C 7F0874DC 1040000B */ beqz $v0, .L7F08750C /* 0BC010 7F0874E0 3C0D8008 */ lui $t5, %hi(pPlayer) @@ -26904,7 +24762,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC0D0 7F0875A0 2401000A */ li $at, 10 /* 0BC0D4 7F0875A4 15010007 */ bne $t0, $at, .L7F0875C4 /* 0BC0D8 7F0875A8 00000000 */ nop -/* 0BC0DC 7F0875AC 0FC20223 */ jal check_if_fade_to_black_complete +/* 0BC0DC 7F0875AC 0FC20223 */ jal currentPlayerIsFadeComplete /* 0BC0E0 7F0875B0 00000000 */ nop /* 0BC0E4 7F0875B4 10400003 */ beqz $v0, .L7F0875C4 /* 0BC0E8 7F0875B8 00000000 */ nop @@ -26955,8 +24813,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BC22C 7F0876BC 8C790000 */ lw $t9, ($v1) /* 0BC230 7F0876C0 0C000F07 */ jal get_video_settings2_frameb /* 0BC234 7F0876C4 00000000 */ nop -/* 0BC238 7F0876C8 3C0F803E */ lui $t7, %hi(cfb_16_b) # $t7, 0x803e -/* 0BC23C 7F0876CC 25EFA800 */ addiu $t7, %lo(cfb_16_b) # addiu $t7, $t7, -0x5800 +/* 0BC238 7F0876C8 3C0F803E */ lui $t7, %hi(cfb_16+0x25800) # $t7, 0x803e +/* 0BC23C 7F0876CC 25EFA800 */ addiu $t7, %lo(cfb_16+0x25800) # addiu $t7, $t7, -0x5800 /* 0BC240 7F0876D0 3C038003 */ lui $v1, %hi(camera_80036430) # $v1, 0x8003 /* 0BC244 7F0876D4 144F0006 */ bne $v0, $t7, .Ljp7F0876F0 /* 0BC248 7F0876D8 24636470 */ addiu $v1, %lo(camera_80036430) # addiu $v1, $v1, 0x6470 @@ -26981,8 +24839,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BC288 7F087718 8C6A0000 */ lw $t2, ($v1) /* 0BC28C 7F08771C 0C000F07 */ jal get_video_settings2_frameb /* 0BC290 7F087720 00000000 */ nop -/* 0BC294 7F087724 3C09803B */ lui $t1, %hi(cfb_16_a) # $t1, 0x803b -/* 0BC298 7F087728 25295000 */ addiu $t1, %lo(cfb_16_a) # addiu $t1, $t1, 0x5000 +/* 0BC294 7F087724 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b +/* 0BC298 7F087728 25295000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, 0x5000 /* 0BC29C 7F08772C 3C038003 */ lui $v1, %hi(camera_80036434) # $v1, 0x8003 /* 0BC2A0 7F087730 14490005 */ bne $v0, $t1, .Ljp7F087748 /* 0BC2A4 7F087734 24636474 */ addiu $v1, %lo(camera_80036434) # addiu $v1, $v1, 0x6474 @@ -27002,8 +24860,8 @@ glabel possibly_reset_viewport_options_for_player /* 0BC2D0 7F087760 00000000 */ nop /* 0BC2D4 7F087764 0C000F07 */ jal get_video_settings2_frameb /* 0BC2D8 7F087768 00000000 */ nop -/* 0BC2DC 7F08776C 3C0D803E */ lui $t5, %hi(cfb_16_b) # $t5, 0x803e -/* 0BC2E0 7F087770 25ADA800 */ addiu $t5, %lo(cfb_16_b) # addiu $t5, $t5, -0x5800 +/* 0BC2DC 7F08776C 3C0D803E */ lui $t5, %hi(cfb_16+0x25800) # $t5, 0x803e +/* 0BC2E0 7F087770 25ADA800 */ addiu $t5, %lo(cfb_16+0x25800) # addiu $t5, $t5, -0x5800 /* 0BC2E4 7F087774 144D0003 */ bne $v0, $t5, .Ljp7F087784 /* 0BC2E8 7F087778 3C048003 */ lui $a0, %hi(resolution) # $a0, 0x8003 /* 0BC2EC 7F08777C 0C000F0F */ jal set_video2buf_frameb @@ -27050,7 +24908,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC38C 7F08781C 46082182 */ mul.s $f6, $f4, $f8 /* 0BC390 7F087820 00000000 */ nop /* 0BC394 7F087824 46103302 */ mul.s $f12, $f6, $f16 -/* 0BC398 7F087828 0C001164 */ jal video_related_21 +/* 0BC398 7F087828 0C001164 */ jal set_page_aspect /* 0BC39C 7F08782C 00000000 */ nop /* 0BC3A0 7F087830 10000017 */ b .Ljp7F087890 /* 0BC3A4 7F087834 00000000 */ nop @@ -27075,7 +24933,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC3EC 7F08787C 44993000 */ mtc1 $t9, $f6 /* 0BC3F0 7F087880 46805120 */ cvt.s.w $f4, $f10 /* 0BC3F4 7F087884 46803420 */ cvt.s.w $f16, $f6 -/* 0BC3F8 7F087888 0C001164 */ jal video_related_21 +/* 0BC3F8 7F087888 0C001164 */ jal set_page_aspect /* 0BC3FC 7F08788C 46048303 */ div.s $f12, $f16, $f4 .Ljp7F087890: /* 0BC400 7F087890 0FC21CC3 */ jal get_curplayer_viewport_width @@ -27128,9 +24986,9 @@ glabel possibly_reset_viewport_options_for_player /* 0BC4BC 7F08794C 01602825 */ move $a1, $t3 /* 0BC4C0 7F087950 0C00112F */ jal set_video2_ulx_uly /* 0BC4C4 7F087954 87A4001C */ lh $a0, 0x1c($sp) -/* 0BC4C8 7F087958 0FC203B3 */ jal sub_GAME_7F0808BC +/* 0BC4C8 7F087958 0FC203B3 */ jal currentPlayerUpdateColourScreenProperties /* 0BC4CC 7F08795C 00000000 */ nop -/* 0BC4D0 7F087960 0FC20424 */ jal update_curplayer_fade +/* 0BC4D0 7F087960 0FC20424 */ jal currentPlayerTickChrFade /* 0BC4D4 7F087964 00000000 */ nop /* 0BC4D8 7F087968 0FC2967C */ jal cur_player_get_autoaim /* 0BC4DC 7F08796C 00000000 */ nop @@ -27149,7 +25007,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC510 7F0879A0 24040001 */ li $a0, 1 /* 0BC514 7F0879A4 0FC1A5B8 */ jal set_unset_ammo_on_screen_setting /* 0BC518 7F0879A8 00402825 */ move $a1, $v0 -/* 0BC51C 7F0879AC 0FC26C01 */ jal get_num_players +/* 0BC51C 7F0879AC 0FC26C01 */ jal getPlayerCount /* 0BC520 7F0879B0 00000000 */ nop /* 0BC524 7F0879B4 24010001 */ li $at, 1 /* 0BC528 7F0879B8 14410006 */ bne $v0, $at, .Ljp7F0879D4 @@ -27160,7 +25018,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC53C 7F0879CC 14A0000B */ bnez $a1, .Ljp7F0879FC /* 0BC540 7F0879D0 00000000 */ nop .Ljp7F0879D4: -/* 0BC544 7F0879D4 0FC26C01 */ jal get_num_players +/* 0BC544 7F0879D4 0FC26C01 */ jal getPlayerCount /* 0BC548 7F0879D8 00000000 */ nop /* 0BC54C 7F0879DC 28430002 */ slti $v1, $v0, 2 /* 0BC550 7F0879E0 38650001 */ xori $a1, $v1, 1 @@ -27240,7 +25098,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC660 7F087AF0 31F8F030 */ andi $t8, $t7, 0xf030 /* 0BC664 7F087AF4 13000025 */ beqz $t8, .Ljp7F087B8C /* 0BC668 7F087AF8 00000000 */ nop -/* 0BC66C 7F087AFC 0FC203A7 */ jal check_if_fade_to_black_complete +/* 0BC66C 7F087AFC 0FC203A7 */ jal currentPlayerIsFadeComplete /* 0BC670 7F087B00 AC3964E0 */ sw $t9, %lo(stop_time_flag)($at) /* 0BC674 7F087B04 10400015 */ beqz $v0, .Ljp7F087B5C /* 0BC678 7F087B08 3C088008 */ lui $t0, %hi(pPlayer) # $t0, 0x8008 @@ -27254,13 +25112,13 @@ glabel possibly_reset_viewport_options_for_player /* 0BC698 7F087B28 45000018 */ bc1f .Ljp7F087B8C /* 0BC69C 7F087B2C 00000000 */ nop /* 0BC6A0 7F087B30 44070000 */ mfc1 $a3, $f0 -/* 0BC6A4 7F087B34 0FC20370 */ jal set_rgba_tint +/* 0BC6A4 7F087B34 0FC20370 */ jal currentPlayerSetFadeColour /* 0BC6A8 7F087B38 00003025 */ move $a2, $zero /* 0BC6AC 7F087B3C 3C014270 */ li $at, 0x42700000 # 60.000000 /* 0BC6B0 7F087B40 44816000 */ mtc1 $at, $f12 /* 0BC6B4 7F087B44 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0BC6B8 7F087B48 44817000 */ mtc1 $at, $f14 -/* 0BC6BC 7F087B4C 0FC2039A */ jal fade_to_over_seconds +/* 0BC6BC 7F087B4C 0FC2039A */ jal currentPlayerSetFadeFrac /* 0BC6C0 7F087B50 00000000 */ nop /* 0BC6C4 7F087B54 1000000D */ b .Ljp7F087B8C /* 0BC6C8 7F087B58 00000000 */ nop @@ -27275,7 +25133,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC6E8 7F087B78 45000004 */ bc1f .Ljp7F087B8C /* 0BC6EC 7F087B7C 00000000 */ nop /* 0BC6F0 7F087B80 44817000 */ mtc1 $at, $f14 -/* 0BC6F4 7F087B84 0FC2039A */ jal fade_to_over_seconds +/* 0BC6F4 7F087B84 0FC2039A */ jal currentPlayerSetFadeFrac /* 0BC6F8 7F087B88 C44C03E0 */ lwc1 $f12, 0x3e0($v0) .Ljp7F087B8C: /* 0BC6FC 7F087B8C 3C098003 */ lui $t1, %hi(stop_time_flag) # $t1, 0x8003 @@ -27283,7 +25141,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC704 7F087B94 24010002 */ li $at, 2 /* 0BC708 7F087B98 1521000F */ bne $t1, $at, .Ljp7F087BD8 /* 0BC70C 7F087B9C 00000000 */ nop -/* 0BC710 7F087BA0 0FC203A7 */ jal check_if_fade_to_black_complete +/* 0BC710 7F087BA0 0FC203A7 */ jal currentPlayerIsFadeComplete /* 0BC714 7F087BA4 00000000 */ nop /* 0BC718 7F087BA8 1040000B */ beqz $v0, .Ljp7F087BD8 /* 0BC71C 7F087BAC 3C0A8008 */ lui $t2, %hi(pPlayer) # $t2, 0x8008 @@ -27341,7 +25199,7 @@ glabel possibly_reset_viewport_options_for_player /* 0BC7DC 7F087C6C 2401000A */ li $at, 10 /* 0BC7E0 7F087C70 15E10007 */ bne $t7, $at, .Ljp7F087C90 /* 0BC7E4 7F087C74 00000000 */ nop -/* 0BC7E8 7F087C78 0FC203A7 */ jal check_if_fade_to_black_complete +/* 0BC7E8 7F087C78 0FC203A7 */ jal currentPlayerIsFadeComplete /* 0BC7EC 7F087C7C 00000000 */ nop /* 0BC7F0 7F087C80 10400003 */ beqz $v0, .Ljp7F087C90 /* 0BC7F4 7F087C84 00000000 */ nop @@ -27411,52 +25269,12 @@ glabel sub_GAME_7F0875E4 ) #endif - - - - -#ifdef NONMATCHING void store_BONDdata_curpos_to_previous(void) { - // Node 0 - pPlayer->previous_model_xpos = (f32) pPlayer->current_model_xpos; - pPlayer->previous_model_ypos = (f32) pPlayer->current_model_ypos; - pPlayer->previous_model_zpos = (f32) pPlayer->current_model_zpos; - return matrix_4x4_rotate_vector_in_place(get_BONDdata_field_10CC(), (pPlayer + 0x44)); + pPlayer->previous_model_pos[0] = pPlayer->current_model_pos[0]; + pPlayer->previous_model_pos[1] = pPlayer->current_model_pos[1]; + pPlayer->previous_model_pos[2] = pPlayer->current_model_pos[2]; + matrix_4x4_rotate_vector_in_place(currentPlayerGetMatrix10CC(), pPlayer->previous_model_pos); } -#else -GLOBAL_ASM( -.text -glabel store_BONDdata_curpos_to_previous -/* 0BC194 7F087664 3C038008 */ lui $v1, %hi(pPlayer) -/* 0BC198 7F087668 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0BC19C 7F08766C 8C620000 */ lw $v0, ($v1) -/* 0BC1A0 7F087670 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0BC1A4 7F087674 AFBF0014 */ sw $ra, 0x14($sp) -/* 0BC1A8 7F087678 C4440038 */ lwc1 $f4, 0x38($v0) -/* 0BC1AC 7F08767C E4440044 */ swc1 $f4, 0x44($v0) -/* 0BC1B0 7F087680 8C620000 */ lw $v0, ($v1) -/* 0BC1B4 7F087684 C446003C */ lwc1 $f6, 0x3c($v0) -/* 0BC1B8 7F087688 E4460048 */ swc1 $f6, 0x48($v0) -/* 0BC1BC 7F08768C 8C620000 */ lw $v0, ($v1) -/* 0BC1C0 7F087690 C4480040 */ lwc1 $f8, 0x40($v0) -/* 0BC1C4 7F087694 0FC1E0F1 */ jal get_BONDdata_field_10CC -/* 0BC1C8 7F087698 E448004C */ swc1 $f8, 0x4c($v0) -/* 0BC1CC 7F08769C 3C038008 */ lui $v1, %hi(pPlayer) -/* 0BC1D0 7F0876A0 2463A0B0 */ addiu $v1, %lo(pPlayer) # addiu $v1, $v1, -0x5f50 -/* 0BC1D4 7F0876A4 8C650000 */ lw $a1, ($v1) -/* 0BC1D8 7F0876A8 00402025 */ move $a0, $v0 -/* 0BC1DC 7F0876AC 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0BC1E0 7F0876B0 24A50044 */ addiu $a1, $a1, 0x44 -/* 0BC1E4 7F0876B4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0BC1E8 7F0876B8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0BC1EC 7F0876BC 03E00008 */ jr $ra -/* 0BC1F0 7F0876C0 00000000 */ nop -) -#endif - - - - #ifdef NONMATCHING void sub_GAME_7F0876C4(void *arg0, void *arg1, void *arg2) { @@ -27500,12 +25318,12 @@ void sub_GAME_7F0876C4(void *arg0, void *arg1, void *arg2) { spB8 = temp_f16; spBC = (f32) (arg1->unk4 + temp_f6); spC0 = (f32) (arg1->unk8 + temp_f4); - sub_GAME_7F059424(&spC4, temp_f10, temp_f6, temp_f4, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); + 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); - sub_GAME_7F059424(pPlayer->field_64, *arg0, arg0->unk4, arg0->unk8, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); - sub_GAME_7F059708(pPlayer->field_68, *arg0, arg0->unk4, arg0->unk8, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); + matrix_4x4_7F059424(pPlayer->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(pPlayer->field_68, *arg0, arg0->unk4, arg0->unk8, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); temp_s0 = sub_GAME_7F0BD6E0(); - matrix_4x4_multiply(get_BONDdata_field_10DC(), &spC4, &sp60); + matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), &spC4, &sp60); phi_a1 = &sp60; loop_1: // Node 1 @@ -27549,10 +25367,10 @@ loop_2: matrix_scalar_multiply(sub_GAME_7F0B4878(), &spC4); guMtxF2L(&spC4, pPlayer->field_5C); sub_GAME_7F059334(pPlayer->field_5C, pPlayer->field_60); - set_BONDdata_field_10C8(pPlayer->field_5C); - set_BONDdata_field_10C4(pPlayer->field_60); - copy_BONDdata_field_10CC_to_10E8_set_10CC(pPlayer->field_64); - sub_GAME_7F078424(pPlayer->field_68); + currentPlayerSetMatrix10C8(pPlayer->field_5C); + currentPlayerSetMatrix10C4(pPlayer->field_60); + currentPlayerSetMatrix10CC(pPlayer->field_64); + currentPlayerSetMatrix10D4(pPlayer->field_68); sub_GAME_7F078464(sp104); sub_GAME_7F0785DC(); return store_BONDdata_curpos_to_previous(); @@ -27633,7 +25451,7 @@ glabel sub_GAME_7F0876C4 /* 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 sub_GAME_7F059424 +/* 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) @@ -27671,7 +25489,7 @@ glabel sub_GAME_7F0876C4 /* 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 sub_GAME_7F059424 +/* 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) @@ -27690,11 +25508,11 @@ glabel sub_GAME_7F0876C4 /* 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 sub_GAME_7F059708 +/* 0BC3F8 7F0878C8 0FC165C2 */ jal matrix_4x4_7F059708 /* 0BC3FC 7F0878CC E7A80024 */ swc1 $f8, 0x24($sp) /* 0BC400 7F0878D0 0FC2F5B8 */ jal sub_GAME_7F0BD6E0 /* 0BC404 7F0878D4 00000000 */ nop -/* 0BC408 7F0878D8 0FC1E0F9 */ jal get_BONDdata_field_10DC +/* 0BC408 7F0878D8 0FC1E0F9 */ jal currentPlayerGetProjectionMatrixF /* 0BC40C 7F0878DC 00408025 */ move $s0, $v0 /* 0BC410 7F0878E0 27B10060 */ addiu $s1, $sp, 0x60 /* 0BC414 7F0878E4 02203025 */ move $a2, $s1 @@ -27751,16 +25569,16 @@ glabel sub_GAME_7F0876C4 /* 0BC4D0 7F0879A0 0FC164CD */ jal sub_GAME_7F059334 /* 0BC4D4 7F0879A4 8C650060 */ lw $a1, 0x60($v1) /* 0BC4D8 7F0879A8 8E4D0000 */ lw $t5, ($s2) -/* 0BC4DC 7F0879AC 0FC1E0D1 */ jal set_BONDdata_field_10C8 +/* 0BC4DC 7F0879AC 0FC1E0D1 */ jal currentPlayerSetMatrix10C8 /* 0BC4E0 7F0879B0 8DA4005C */ lw $a0, 0x5c($t5) /* 0BC4E4 7F0879B4 8E4E0000 */ lw $t6, ($s2) -/* 0BC4E8 7F0879B8 0FC1E0C9 */ jal set_BONDdata_field_10C4 +/* 0BC4E8 7F0879B8 0FC1E0C9 */ jal currentPlayerSetMatrix10C4 /* 0BC4EC 7F0879BC 8DC40060 */ lw $a0, 0x60($t6) /* 0BC4F0 7F0879C0 8E4F0000 */ lw $t7, ($s2) -/* 0BC4F4 7F0879C4 0FC1E0E9 */ jal copy_BONDdata_field_10CC_to_10E8_set_10CC +/* 0BC4F4 7F0879C4 0FC1E0E9 */ jal currentPlayerSetMatrix10CC /* 0BC4F8 7F0879C8 8DE40064 */ lw $a0, 0x64($t7) /* 0BC4FC 7F0879CC 8E580000 */ lw $t8, ($s2) -/* 0BC500 7F0879D0 0FC1E109 */ jal sub_GAME_7F078424 +/* 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) @@ -28506,7 +26324,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 get_BONDdata_field_10CC +/* 0BCBA0 7F088070 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0BCBA4 7F088074 00000000 */ nop /* 0BCBA8 7F088078 00402025 */ move $a0, $v0 /* 0BCBAC 7F08807C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -28601,7 +26419,7 @@ glabel sub_GAME_7F087E74 /* 0BCD0C 7F0881DC E7AA0020 */ swc1 $f10, 0x20($sp) /* 0BCD10 7F0881E0 C44801F4 */ lwc1 $f8, 0x1f4($v0) /* 0BCD14 7F0881E4 E7AE0168 */ swc1 $f14, 0x168($sp) -/* 0BCD18 7F0881E8 0FC16642 */ jal sub_GAME_7F059908 +/* 0BCD18 7F0881E8 0FC16642 */ jal matrix_4x4_7F059908 /* 0BCD1C 7F0881EC E7A80024 */ swc1 $f8, 0x24($sp) /* 0BCD20 7F0881F0 8FA40164 */ lw $a0, 0x164($sp) /* 0BCD24 7F0881F4 0FC16218 */ jal matrix_4x4_get_rotation_around_xyz @@ -28850,12 +26668,12 @@ glabel sub_GAME_7F087E74 /* 0BD0B4 7F088584 8FA40164 */ lw $a0, 0x164($sp) /* 0BD0B8 7F088588 0FC1601A */ jal matrix_4x4_multiply_in_place /* 0BD0BC 7F08858C 27A5004C */ addiu $a1, $sp, 0x4c -/* 0BD0C0 7F088590 0FC16319 */ jal sub_GAME_7F058C64 +/* 0BD0C0 7F088590 0FC16319 */ jal matrix_4x4_7F058C64 /* 0BD0C4 7F088594 00000000 */ nop /* 0BD0C8 7F088598 27A4004C */ addiu $a0, $sp, 0x4c /* 0BD0CC 7F08859C 0FC16327 */ jal sub_GAME_7F058C9C /* 0BD0D0 7F0885A0 8FA50048 */ lw $a1, 0x48($sp) -/* 0BD0D4 7F0885A4 0FC16322 */ jal sub_GAME_7F058C88 +/* 0BD0D4 7F0885A4 0FC16322 */ jal matrix_4x4_7F058C88 /* 0BD0D8 7F0885A8 00000000 */ nop /* 0BD0DC 7F0885AC 3C0E8008 */ lui $t6, %hi(pPlayer) /* 0BD0E0 7F0885B0 8DCEA0B0 */ lw $t6, %lo(pPlayer)($t6) @@ -28870,7 +26688,7 @@ glabel sub_GAME_7F087E74 .L7F0885D4: /* 0BD104 7F0885D4 0FC2B28A */ jal sub_GAME_7F0ACA28 /* 0BD108 7F0885D8 8FA50048 */ lw $a1, 0x48($sp) -/* 0BD10C 7F0885DC 0FC16319 */ jal sub_GAME_7F058C64 +/* 0BD10C 7F0885DC 0FC16319 */ jal matrix_4x4_7F058C64 /* 0BD110 7F0885E0 AFA201F8 */ sw $v0, 0x1f8($sp) /* 0BD114 7F0885E4 3C0F8008 */ lui $t7, %hi(pPlayer) /* 0BD118 7F0885E8 8DEFA0B0 */ lw $t7, %lo(pPlayer)($t7) @@ -28878,7 +26696,7 @@ glabel sub_GAME_7F087E74 /* 0BD120 7F0885F0 8DE4023C */ lw $a0, 0x23c($t7) /* 0BD124 7F0885F4 0FC22F52 */ jal sub_GAME_7F08BD48 /* 0BD128 7F0885F8 85A5000E */ lh $a1, 0xe($t5) -/* 0BD12C 7F0885FC 0FC16322 */ jal sub_GAME_7F058C88 +/* 0BD12C 7F0885FC 0FC16322 */ jal matrix_4x4_7F058C88 /* 0BD130 7F088600 00000000 */ nop .L7F088604: /* 0BD134 7F088604 8FBF002C */ lw $ra, 0x2c($sp) @@ -29027,7 +26845,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 get_BONDdata_field_10CC +/* 0BD2AC 7F08873C 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 0BD2B0 7F088740 00000000 */ nop /* 0BD2B4 7F088744 00402025 */ move $a0, $v0 /* 0BD2B8 7F088748 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -29124,7 +26942,7 @@ glabel sub_GAME_7F087E74 /* 0BD420 7F0888B0 E7A60020 */ swc1 $f6, 0x20($sp) /* 0BD424 7F0888B4 C44401F4 */ lwc1 $f4, 0x1f4($v0) /* 0BD428 7F0888B8 E7AE0168 */ swc1 $f14, 0x168($sp) -/* 0BD42C 7F0888BC 0FC1678A */ jal sub_GAME_7F059908 +/* 0BD42C 7F0888BC 0FC1678A */ jal matrix_4x4_7F059908 /* 0BD430 7F0888C0 E7A40024 */ swc1 $f4, 0x24($sp) /* 0BD434 7F0888C4 8FA40164 */ lw $a0, 0x164($sp) /* 0BD438 7F0888C8 0FC16360 */ jal matrix_4x4_get_rotation_around_xyz @@ -29373,12 +27191,12 @@ glabel sub_GAME_7F087E74 /* 0BD7C8 7F088C58 8FA40164 */ lw $a0, 0x164($sp) /* 0BD7CC 7F088C5C 0FC16162 */ jal matrix_4x4_multiply_in_place /* 0BD7D0 7F088C60 27A5004C */ addiu $a1, $sp, 0x4c -/* 0BD7D4 7F088C64 0FC16461 */ jal sub_GAME_7F058C64 +/* 0BD7D4 7F088C64 0FC16461 */ jal matrix_4x4_7F058C64 /* 0BD7D8 7F088C68 00000000 */ nop /* 0BD7DC 7F088C6C 27A4004C */ addiu $a0, $sp, 0x4c /* 0BD7E0 7F088C70 0FC1646F */ jal sub_GAME_7F058C9C /* 0BD7E4 7F088C74 8FA50048 */ lw $a1, 0x48($sp) -/* 0BD7E8 7F088C78 0FC1646A */ jal sub_GAME_7F058C88 +/* 0BD7E8 7F088C78 0FC1646A */ jal matrix_4x4_7F058C88 /* 0BD7EC 7F088C7C 00000000 */ nop /* 0BD7F0 7F088C80 3C0C8008 */ lui $t4, %hi(pPlayer) # $t4, 0x8008 /* 0BD7F4 7F088C84 8D8CA120 */ lw $t4, %lo(pPlayer)($t4) @@ -29393,7 +27211,7 @@ glabel sub_GAME_7F087E74 .Ljp7F088CA8: /* 0BD818 7F088CA8 0FC2B574 */ jal sub_GAME_7F0ACA28 /* 0BD81C 7F088CAC 8FA50048 */ lw $a1, 0x48($sp) -/* 0BD820 7F088CB0 0FC16461 */ jal sub_GAME_7F058C64 +/* 0BD820 7F088CB0 0FC16461 */ jal matrix_4x4_7F058C64 /* 0BD824 7F088CB4 AFA201F8 */ sw $v0, 0x1f8($sp) /* 0BD828 7F088CB8 3C0A8008 */ lui $t2, %hi(pPlayer) # $t2, 0x8008 /* 0BD82C 7F088CBC 8D4AA120 */ lw $t2, %lo(pPlayer)($t2) @@ -29401,7 +27219,7 @@ glabel sub_GAME_7F087E74 /* 0BD834 7F088CC4 8D44023C */ lw $a0, 0x23c($t2) /* 0BD838 7F088CC8 0FC23174 */ jal sub_GAME_7F08BD48 /* 0BD83C 7F088CCC 85E5000E */ lh $a1, 0xe($t7) -/* 0BD840 7F088CD0 0FC1646A */ jal sub_GAME_7F058C88 +/* 0BD840 7F088CD0 0FC1646A */ jal matrix_4x4_7F058C88 /* 0BD844 7F088CD4 00000000 */ nop .Ljp7F088CD8: /* 0BD848 7F088CD8 8FBF002C */ lw $ra, 0x2c($sp) @@ -29446,7 +27264,7 @@ s32 sub_GAME_7F088618(void *arg0) { *arg0 = 0x1030040; temp_s0 = (arg0 + 8); arg0->unk4 = osVirtualToPhysical(spB8); - sub_GAME_7F059694(&sp78, 0.0f, &0x43FA0004, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f); + matrix_4x4_7F059694(&sp78, 0.0f, &0x43FA0004, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f); sub_GAME_7F058C9C(&sp78, spBC); *temp_s0 = 0x1020040; temp_s0_2 = (temp_s0 + 8); @@ -29479,7 +27297,7 @@ s32 sub_GAME_7F088618(void *arg0) { temp_s0_11 = (temp_s0_10 + 8); temp_s0_10->unk4 = (s32) (pPlayer + 0x80002128); *temp_s0_11 = 0x1030040; - temp_s0_11->unk4 = osVirtualToPhysical(get_BONDdata_field_10D8(temp_s0_9, temp_s0_10, 0x6000000, temp_s0_6)); + temp_s0_11->unk4 = osVirtualToPhysical(currentPlayerGetProjectionMatrix(temp_s0_9, temp_s0_10, 0x6000000, temp_s0_6)); return (temp_s0_11 + 8); } #else @@ -29574,7 +27392,7 @@ glabel sub_GAME_7F088618 /* 0BD29C 7F08876C E7A00018 */ swc1 $f0, 0x18($sp) /* 0BD2A0 7F088770 E7A00014 */ swc1 $f0, 0x14($sp) /* 0BD2A4 7F088774 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0BD2A8 7F088778 0FC165A5 */ jal sub_GAME_7F059694 +/* 0BD2A8 7F088778 0FC165A5 */ jal matrix_4x4_7F059694 /* 0BD2AC 7F08877C E7B20024 */ swc1 $f18, 0x24($sp) /* 0BD2B0 7F088780 27A40078 */ addiu $a0, $sp, 0x78 /* 0BD2B4 7F088784 0FC16327 */ jal sub_GAME_7F058C9C @@ -29654,7 +27472,7 @@ glabel sub_GAME_7F088618 /* 0BD3DC 7F0888AC 356B0040 */ ori $t3, (0x01030040 & 0xFFFF) # ori $t3, $t3, 0x40 /* 0BD3E0 7F0888B0 02008825 */ move $s1, $s0 /* 0BD3E4 7F0888B4 AE2B0000 */ sw $t3, ($s1) -/* 0BD3E8 7F0888B8 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0BD3E8 7F0888B8 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0BD3EC 7F0888BC 26100008 */ addiu $s0, $s0, 8 /* 0BD3F0 7F0888C0 0C003A2C */ jal osVirtualToPhysical /* 0BD3F4 7F0888C4 00402025 */ move $a0, $v0 @@ -29744,7 +27562,7 @@ glabel mp_respawn_handler /* 0BD4B8 7F088988 AD0F1128 */ sw $t7, 0x1128($t0) /* 0BD4BC 7F08898C 0FC22A4A */ jal sub_GAME_7F08A928 /* 0BD4C0 7F088990 2404FFFF */ li $a0, -1 -/* 0BD4C4 7F088994 0FC26919 */ jal get_num_players +/* 0BD4C4 7F088994 0FC26919 */ jal getPlayerCount /* 0BD4C8 7F088998 00000000 */ nop /* 0BD4CC 7F08899C 28410002 */ slti $at, $v0, 2 /* 0BD4D0 7F0889A0 14200008 */ bnez $at, .L7F0889C4 @@ -29966,7 +27784,7 @@ mp_spawntype_default: /* 0BD7E0 7F088CB0 8E390000 */ lw $t9, ($s1) /* 0BD7E4 7F088CB4 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0BD7E8 7F088CB8 44817000 */ mtc1 $at, $f14 -/* 0BD7EC 7F088CBC 0FC20284 */ jal set_curplayer_fade +/* 0BD7EC 7F088CBC 0FC20284 */ jal currentPlayerStartChrFade /* 0BD7F0 7F088CC0 E7200080 */ swc1 $f0, 0x80($t9) /* 0BD7F4 7F088CC4 8FBF001C */ lw $ra, 0x1c($sp) /* 0BD7F8 7F088CC8 8FB00014 */ lw $s0, 0x14($sp) @@ -30024,7 +27842,7 @@ glabel sub_GAME_7F088CD8 /* 0BD88C 7F088D5C AFB900B4 */ sw $t9, 0xb4($sp) /* 0BD890 7F088D60 0FC2B366 */ jal microcode_constructor /* 0BD894 7F088D64 02A02025 */ move $a0, $s5 -/* 0BD898 7F088D68 0C00112B */ jal get_video2_settings_height +/* 0BD898 7F088D68 0C00112B */ jal viGetViewHeight /* 0BD89C 7F088D6C 0040A825 */ move $s5, $v0 /* 0BD8A0 7F088D70 8FAA00B4 */ lw $t2, 0xb4($sp) /* 0BD8A4 7F088D74 3C048003 */ lui $a0, %hi(D_80036440) @@ -30133,11 +27951,11 @@ glabel sub_GAME_7F088CD8 /* 0BDA0C 7F088EDC 00000000 */ nop /* 0BDA10 7F088EE0 AFA20084 */ sw $v0, 0x84($sp) .L7F088EE4: -/* 0BDA14 7F088EE4 0C00112B */ jal get_video2_settings_height +/* 0BDA14 7F088EE4 0C00112B */ jal viGetViewHeight /* 0BDA18 7F088EE8 00000000 */ nop /* 0BDA1C 7F088EEC 00028400 */ sll $s0, $v0, 0x10 /* 0BDA20 7F088EF0 00106403 */ sra $t4, $s0, 0x10 -/* 0BDA24 7F088EF4 0C001149 */ jal get_video2_settings_uly +/* 0BDA24 7F088EF4 0C001149 */ jal viGetViewTop /* 0BDA28 7F088EF8 01808025 */ move $s0, $t4 /* 0BDA2C 7F088EFC 8FAE00B4 */ lw $t6, 0xb4($sp) /* 0BDA30 7F088F00 00516821 */ addu $t5, $v0, $s1 @@ -30235,11 +28053,11 @@ glabel sub_GAME_7F088CD8 /* 0BDB8C 7F08905C 00000000 */ nop /* 0BDB90 7F089060 AFA20080 */ sw $v0, 0x80($sp) .L7F089064: -/* 0BDB94 7F089064 0C00112B */ jal get_video2_settings_height +/* 0BDB94 7F089064 0C00112B */ jal viGetViewHeight /* 0BDB98 7F089068 00000000 */ nop /* 0BDB9C 7F08906C 00028400 */ sll $s0, $v0, 0x10 /* 0BDBA0 7F089070 00106403 */ sra $t4, $s0, 0x10 -/* 0BDBA4 7F089074 0C001149 */ jal get_video2_settings_uly +/* 0BDBA4 7F089074 0C001149 */ jal viGetViewTop /* 0BDBA8 7F089078 01808025 */ move $s0, $t4 /* 0BDBAC 7F08907C 8FAE00B4 */ lw $t6, 0xb4($sp) /* 0BDBB0 7F089080 00516821 */ addu $t5, $v0, $s1 @@ -30383,7 +28201,7 @@ glabel maybe_mp_interface /* 0BDD80 7F089250 0FC15884 */ jal sub_GAME_7F056210 /* 0BDD84 7F089254 00402025 */ move $a0, $v0 /* 0BDD88 7F089258 AFA20058 */ sw $v0, 0x58($sp) -/* 0BDD8C 7F08925C 0FC20138 */ jal sub_GAME_7F0804E0 +/* 0BDD8C 7F08925C 0FC20138 */ jal currentPlayerDrawFade /* 0BDD90 7F089260 00402025 */ move $a0, $v0 /* 0BDD94 7F089264 AFA20058 */ sw $v0, 0x58($sp) /* 0BDD98 7F089268 0FC22336 */ jal sub_GAME_7F088CD8 @@ -30405,19 +28223,19 @@ glabel maybe_mp_interface /* 0BDDD4 7F0892A4 8F1929C4 */ lw $t9, 0x29c4($t8) /* 0BDDD8 7F0892A8 1320001F */ beqz $t9, .L7F089328 /* 0BDDDC 7F0892AC 00000000 */ nop -/* 0BDDE0 7F0892B0 0C001145 */ jal get_video2_settings_ulx +/* 0BDDE0 7F0892B0 0C001145 */ jal viGetViewLeft /* 0BDDE4 7F0892B4 00000000 */ nop -/* 0BDDE8 7F0892B8 0C001149 */ jal get_video2_settings_uly +/* 0BDDE8 7F0892B8 0C001149 */ jal viGetViewTop /* 0BDDEC 7F0892BC AFA20054 */ sw $v0, 0x54($sp) -/* 0BDDF0 7F0892C0 0C001145 */ jal get_video2_settings_ulx +/* 0BDDF0 7F0892C0 0C001145 */ jal viGetViewLeft /* 0BDDF4 7F0892C4 AFA20050 */ sw $v0, 0x50($sp) -/* 0BDDF8 7F0892C8 0C001127 */ jal get_video2_settings_width +/* 0BDDF8 7F0892C8 0C001127 */ jal viGetViewWidth /* 0BDDFC 7F0892CC A7A2002E */ sh $v0, 0x2e($sp) /* 0BDE00 7F0892D0 87A8002E */ lh $t0, 0x2e($sp) /* 0BDE04 7F0892D4 00484821 */ addu $t1, $v0, $t0 -/* 0BDE08 7F0892D8 0C001149 */ jal get_video2_settings_uly +/* 0BDE08 7F0892D8 0C001149 */ jal viGetViewTop /* 0BDE0C 7F0892DC AFA9004C */ sw $t1, 0x4c($sp) -/* 0BDE10 7F0892E0 0C00112B */ jal get_video2_settings_height +/* 0BDE10 7F0892E0 0C00112B */ jal viGetViewHeight /* 0BDE14 7F0892E4 A7A2002E */ sh $v0, 0x2e($sp) /* 0BDE18 7F0892E8 87AA002E */ lh $t2, 0x2e($sp) /* 0BDE1C 7F0892EC 8FA40058 */ lw $a0, 0x58($sp) @@ -30473,7 +28291,7 @@ glabel maybe_mp_interface /* 0BDED8 7F0893A8 00000000 */ nop /* 0BDEDC 7F0893AC AC602A00 */ sw $zero, 0x2a00($v1) .L7F0893B0: -/* 0BDEE0 7F0893B0 0FC26919 */ jal get_num_players +/* 0BDEE0 7F0893B0 0FC26919 */ jal getPlayerCount /* 0BDEE4 7F0893B4 00000000 */ nop /* 0BDEE8 7F0893B8 24010001 */ li $at, 1 /* 0BDEEC 7F0893BC 14410003 */ bne $v0, $at, .L7F0893CC @@ -30500,7 +28318,7 @@ glabel maybe_mp_interface /* 0BDF38 7F089408 3C0A8008 */ lui $t2, %hi(pPlayer) /* 0BDF3C 7F08940C 0FC070A1 */ jal die_blood_image_routine /* 0BDF40 7F089410 00002025 */ move $a0, $zero -/* 0BDF44 7F089414 0FC26919 */ jal get_num_players +/* 0BDF44 7F089414 0FC26919 */ jal getPlayerCount /* 0BDF48 7F089418 00000000 */ nop /* 0BDF4C 7F08941C 24010001 */ li $at, 1 /* 0BDF50 7F089420 14410013 */ bne $v0, $at, .L7F089470 @@ -30539,7 +28357,7 @@ glabel maybe_mp_interface /* 0BDFC8 7F089498 3C073F34 */ lui $a3, (0x3F34B4B5 >> 16) # lui $a3, 0x3f34 /* 0BDFCC 7F08949C 11600006 */ beqz $t3, .L7F0894B8 /* 0BDFD0 7F0894A0 3C0C8005 */ lui $t4, %hi(clock_timer) -/* 0BDFD4 7F0894A4 0FC201EC */ jal set_rgba_tint +/* 0BDFD4 7F0894A4 0FC201EC */ jal currentPlayerSetFadeColour /* 0BDFD8 7F0894A8 34E7B4B5 */ ori $a3, (0x3F34B4B5 & 0xFFFF) # ori $a3, $a3, 0xb4b5 /* 0BDFDC 7F0894AC 3C038008 */ lui $v1, %hi(pPlayer) /* 0BDFE0 7F0894B0 10000013 */ b .L7F089500 @@ -30594,19 +28412,19 @@ glabel maybe_mp_interface /* 0BE094 7F089564 AC790428 */ sw $t9, 0x428($v1) /* 0BE098 7F089568 00003025 */ move $a2, $zero /* 0BE09C 7F08956C 00003825 */ move $a3, $zero -/* 0BE0A0 7F089570 0FC201F8 */ jal sub_GAME_7F0807E0 +/* 0BE0A0 7F089570 0FC201F8 */ jal currentPlayerAdjustFade /* 0BE0A4 7F089574 E7A60010 */ swc1 $f6, 0x10($sp) /* 0BE0A8 7F089578 3C0142F0 */ li $at, 0x42F00000 # 120.000000 /* 0BE0AC 7F08957C 44816000 */ mtc1 $at, $f12 /* 0BE0B0 7F089580 44807000 */ mtc1 $zero, $f14 -/* 0BE0B4 7F089584 0FC20284 */ jal set_curplayer_fade +/* 0BE0B4 7F089584 0FC20284 */ jal currentPlayerStartChrFade /* 0BE0B8 7F089588 00000000 */ nop .L7F08958C: -/* 0BE0BC 7F08958C 0FC20223 */ jal check_if_fade_to_black_complete +/* 0BE0BC 7F08958C 0FC20223 */ jal currentPlayerIsFadeComplete /* 0BE0C0 7F089590 00000000 */ nop /* 0BE0C4 7F089594 10400030 */ beqz $v0, .L7F089658 /* 0BE0C8 7F089598 00000000 */ nop -/* 0BE0CC 7F08959C 0FC26919 */ jal get_num_players +/* 0BE0CC 7F08959C 0FC26919 */ jal getPlayerCount /* 0BE0D0 7F0895A0 00000000 */ nop /* 0BE0D4 7F0895A4 24010001 */ li $at, 1 /* 0BE0D8 7F0895A8 14410005 */ bne $v0, $at, .L7F0895C0 @@ -30620,7 +28438,7 @@ glabel maybe_mp_interface /* 0BE0F4 7F0895C4 00000000 */ nop /* 0BE0F8 7F0895C8 0FC26C54 */ jal get_cur_playernum /* 0BE0FC 7F0895CC AFA20040 */ sw $v0, 0x40($sp) -/* 0BE100 7F0895D0 0FC26919 */ jal get_num_players +/* 0BE100 7F0895D0 0FC26919 */ jal getPlayerCount /* 0BE104 7F0895D4 AFA2003C */ sw $v0, 0x3c($sp) /* 0BE108 7F0895D8 00402825 */ move $a1, $v0 /* 0BE10C 7F0895DC 00002025 */ move $a0, $zero @@ -30678,7 +28496,7 @@ glabel maybe_mp_interface /* 0BE1CC 7F08969C 0FC31824 */ jal display_red_blue_on_radar /* 0BE1D0 7F0896A0 00402025 */ move $a0, $v0 /* 0BE1D4 7F0896A4 AFA20058 */ sw $v0, 0x58($sp) -/* 0BE1D8 7F0896A8 0FC20138 */ jal sub_GAME_7F0804E0 +/* 0BE1D8 7F0896A8 0FC20138 */ jal currentPlayerDrawFade /* 0BE1DC 7F0896AC 00402025 */ move $a0, $v0 /* 0BE1E0 7F0896B0 8FBF001C */ lw $ra, 0x1c($sp) .L7F0896B4: @@ -30840,20 +28658,9 @@ glabel sub_GAME_7F089780 -#ifdef NONMATCHING -void get_curplayer_positiondata(void) { - +struct prop* get_curplayer_positiondata(void) { + return pPlayer->prop; } -#else -GLOBAL_ASM( -.text -glabel get_curplayer_positiondata -/* 0BE2C8 7F089798 3C0E8008 */ lui $t6, %hi(pPlayer) -/* 0BE2CC 7F08979C 8DCEA0B0 */ lw $t6, %lo(pPlayer)($t6) -/* 0BE2D0 7F0897A0 03E00008 */ jr $ra -/* 0BE2D4 7F0897A4 8DC200A8 */ lw $v0, 0xa8($t6) -) -#endif @@ -31033,7 +28840,7 @@ glabel record_damage_kills /* 0BE4C8 7F089998 0FC28BCC */ jal sub_GAME_7F0A2F30 /* 0BE4CC 7F08999C 24841598 */ addiu $a0, $a0, 0x1598 .L7F0899A0: -/* 0BE4D0 7F0899A0 0FC26919 */ jal get_num_players +/* 0BE4D0 7F0899A0 0FC26919 */ jal getPlayerCount /* 0BE4D4 7F0899A4 00000000 */ nop /* 0BE4D8 7F0899A8 28410002 */ slti $at, $v0, 2 /* 0BE4DC 7F0899AC 14200007 */ bnez $at, .L7F0899CC @@ -31076,14 +28883,14 @@ glabel record_damage_kills /* 0BE568 7F089A38 00000000 */ nop /* 0BE56C 7F089A3C 0FC26C54 */ jal get_cur_playernum /* 0BE570 7F089A40 00000000 */ nop -/* 0BE574 7F089A44 0FC26919 */ jal get_num_players +/* 0BE574 7F089A44 0FC26919 */ jal getPlayerCount /* 0BE578 7F089A48 AFA2001C */ sw $v0, 0x1c($sp) /* 0BE57C 7F089A4C 8FAC001C */ lw $t4, 0x1c($sp) /* 0BE580 7F089A50 3C053E80 */ lui $a1, 0x3e80 /* 0BE584 7F089A54 0C003215 */ jal controller_7000C854 /* 0BE588 7F089A58 004C2021 */ addu $a0, $v0, $t4 .L7F089A5C: -/* 0BE58C 7F089A5C 0FC26919 */ jal get_num_players +/* 0BE58C 7F089A5C 0FC26919 */ jal getPlayerCount /* 0BE590 7F089A60 00000000 */ nop /* 0BE594 7F089A64 28410002 */ slti $at, $v0, 2 /* 0BE598 7F089A68 14200010 */ bnez $at, .L7F089AAC @@ -31119,7 +28926,7 @@ glabel record_damage_kills /* 0BE60C 7F089ADC 8C5800F4 */ lw $t8, 0xf4($v0) /* 0BE610 7F089AE0 0702000B */ bltzl $t8, .L7F089B10 /* 0BE614 7F089AE4 8C4301C8 */ lw $v1, 0x1c8($v0) -/* 0BE618 7F089AE8 0FC26919 */ jal get_num_players +/* 0BE618 7F089AE8 0FC26919 */ jal getPlayerCount /* 0BE61C 7F089AEC 00000000 */ nop /* 0BE620 7F089AF0 28410002 */ slti $at, $v0, 2 /* 0BE624 7F089AF4 142000D1 */ bnez $at, .L7F089E3C @@ -31140,7 +28947,7 @@ glabel record_damage_kills /* 0BE65C 7F089B2C 3C028008 */ lui $v0, %hi(pPlayer) /* 0BE660 7F089B30 8C42A0B0 */ lw $v0, %lo(pPlayer)($v0) /* 0BE664 7F089B34 C44800E0 */ lwc1 $f8, 0xe0($v0) -/* 0BE668 7F089B38 0FC26919 */ jal get_num_players +/* 0BE668 7F089B38 0FC26919 */ jal getPlayerCount /* 0BE66C 7F089B3C E44800E8 */ swc1 $f8, 0xe8($v0) /* 0BE670 7F089B40 28410002 */ slti $at, $v0, 2 /* 0BE674 7F089B44 54200035 */ bnezl $at, .L7F089C1C @@ -31158,12 +28965,12 @@ glabel record_damage_kills /* 0BE6A4 7F089B74 460A0182 */ mul.s $f6, $f0, $f10 /* 0BE6A8 7F089B78 8FA80038 */ lw $t0, 0x38($sp) /* 0BE6AC 7F089B7C 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0BE6B0 7F089B80 3C0A8008 */ lui $t2, %hi(ptr_BONDdata_p1) +/* 0BE6B0 7F089B80 3C0A8008 */ lui $t2, %hi(players) /* 0BE6B4 7F089B84 00084880 */ sll $t1, $t0, 2 /* 0BE6B8 7F089B88 44812000 */ mtc1 $at, $f4 /* 0BE6BC 7F089B8C 01495021 */ addu $t2, $t2, $t1 /* 0BE6C0 7F089B90 46103483 */ div.s $f18, $f6, $f16 -/* 0BE6C4 7F089B94 8D4A9EE0 */ lw $t2, %lo(ptr_BONDdata_p1)($t2) +/* 0BE6C4 7F089B94 8D4A9EE0 */ lw $t2, %lo(players)($t2) /* 0BE6C8 7F089B98 44806000 */ mtc1 $zero, $f12 /* 0BE6CC 7F089B9C 8FAB004C */ lw $t3, 0x4c($sp) /* 0BE6D0 7F089BA0 C54A0148 */ lwc1 $f10, 0x148($t2) @@ -31251,7 +29058,7 @@ glabel record_damage_kills /* 0BE804 7F089CD4 00000000 */ nop /* 0BE808 7F089CD8 45020040 */ bc1fl .L7F089DDC /* 0BE80C 7F089CDC 8C4B00F4 */ lw $t3, 0xf4($v0) -/* 0BE810 7F089CE0 0FC26919 */ jal get_num_players +/* 0BE810 7F089CE0 0FC26919 */ jal getPlayerCount /* 0BE814 7F089CE4 00000000 */ nop /* 0BE818 7F089CE8 28410002 */ slti $at, $v0, 2 /* 0BE81C 7F089CEC 14200036 */ bnez $at, .L7F089DC8 @@ -31397,7 +29204,7 @@ glabel record_damage_kills /* 0BEBDC 7F08A06C 0FC28EB4 */ jal sub_GAME_7F0A2F30 /* 0BEBE0 7F08A070 24841598 */ addiu $a0, $a0, 0x1598 .Ljp7F08A074: -/* 0BEBE4 7F08A074 0FC26C01 */ jal get_num_players +/* 0BEBE4 7F08A074 0FC26C01 */ jal getPlayerCount /* 0BEBE8 7F08A078 00000000 */ nop /* 0BEBEC 7F08A07C 28410002 */ slti $at, $v0, 2 /* 0BEBF0 7F08A080 14200007 */ bnez $at, .Ljp7F08A0A0 @@ -31440,14 +29247,14 @@ glabel record_damage_kills /* 0BEC7C 7F08A10C 00000000 */ nop /* 0BEC80 7F08A110 0FC26F3C */ jal get_cur_playernum /* 0BEC84 7F08A114 00000000 */ nop -/* 0BEC88 7F08A118 0FC26C01 */ jal get_num_players +/* 0BEC88 7F08A118 0FC26C01 */ jal getPlayerCount /* 0BEC8C 7F08A11C AFA2001C */ sw $v0, 0x1c($sp) /* 0BEC90 7F08A120 8FAC001C */ lw $t4, 0x1c($sp) /* 0BEC94 7F08A124 3C053E80 */ lui $a1, 0x3e80 /* 0BEC98 7F08A128 0C00322E */ jal controller_7000C854 /* 0BEC9C 7F08A12C 004C2021 */ addu $a0, $v0, $t4 .Ljp7F08A130: -/* 0BECA0 7F08A130 0FC26C01 */ jal get_num_players +/* 0BECA0 7F08A130 0FC26C01 */ jal getPlayerCount /* 0BECA4 7F08A134 00000000 */ nop /* 0BECA8 7F08A138 28410002 */ slti $at, $v0, 2 /* 0BECAC 7F08A13C 14200010 */ bnez $at, .Ljp7F08A180 @@ -31487,7 +29294,7 @@ glabel record_damage_kills /* 0BED30 7F08A1C0 00000000 */ nop /* 0BED34 7F08A1C4 4503000E */ bc1tl .Ljp7F08A200 /* 0BED38 7F08A1C8 8C4301C8 */ lw $v1, 0x1c8($v0) -/* 0BED3C 7F08A1CC 0FC26C01 */ jal get_num_players +/* 0BED3C 7F08A1CC 0FC26C01 */ jal getPlayerCount /* 0BED40 7F08A1D0 00000000 */ nop /* 0BED44 7F08A1D4 28410002 */ slti $at, $v0, 2 /* 0BED48 7F08A1D8 142000DA */ bnez $at, .Ljp7F08A544 @@ -31511,7 +29318,7 @@ glabel record_damage_kills /* 0BED8C 7F08A21C 3C028008 */ lui $v0, %hi(pPlayer) # $v0, 0x8008 /* 0BED90 7F08A220 8C42A120 */ lw $v0, %lo(pPlayer)($v0) /* 0BED94 7F08A224 C45200E0 */ lwc1 $f18, 0xe0($v0) -/* 0BED98 7F08A228 0FC26C01 */ jal get_num_players +/* 0BED98 7F08A228 0FC26C01 */ jal getPlayerCount /* 0BED9C 7F08A22C E45200E8 */ swc1 $f18, 0xe8($v0) /* 0BEDA0 7F08A230 28410002 */ slti $at, $v0, 2 /* 0BEDA4 7F08A234 54200035 */ bnezl $at, .Ljp7F08A30C @@ -31529,12 +29336,12 @@ glabel record_damage_kills /* 0BEDD4 7F08A264 46040202 */ mul.s $f8, $f0, $f4 /* 0BEDD8 7F08A268 8FB80038 */ lw $t8, 0x38($sp) /* 0BEDDC 7F08A26C 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0BEDE0 7F08A270 3C088008 */ lui $t0, %hi(ptr_BONDdata_p1) +/* 0BEDE0 7F08A270 3C088008 */ lui $t0, %hi(players) /* 0BEDE4 7F08A274 0018C880 */ sll $t9, $t8, 2 /* 0BEDE8 7F08A278 44818000 */ mtc1 $at, $f16 /* 0BEDEC 7F08A27C 01194021 */ addu $t0, $t0, $t9 /* 0BEDF0 7F08A280 460A4183 */ div.s $f6, $f8, $f10 -/* 0BEDF4 7F08A284 8D089F50 */ lw $t0, %lo(ptr_BONDdata_p1)($t0) +/* 0BEDF4 7F08A284 8D089F50 */ lw $t0, %lo(players)($t0) /* 0BEDF8 7F08A288 44806000 */ mtc1 $zero, $f12 /* 0BEDFC 7F08A28C 8FA9004C */ lw $t1, 0x4c($sp) /* 0BEE00 7F08A290 C5040148 */ lwc1 $f4, 0x148($t0) @@ -31622,7 +29429,7 @@ glabel record_damage_kills /* 0BEF34 7F08A3C4 00000000 */ nop /* 0BEF38 7F08A3C8 45020041 */ bc1fl .Ljp7F08A4D0 /* 0BEF3C 7F08A3CC C44800F4 */ lwc1 $f8, 0xf4($v0) -/* 0BEF40 7F08A3D0 0FC26C01 */ jal get_num_players +/* 0BEF40 7F08A3D0 0FC26C01 */ jal getPlayerCount /* 0BEF44 7F08A3D4 00000000 */ nop /* 0BEF48 7F08A3D8 28410002 */ slti $at, $v0, 2 /* 0BEF4C 7F08A3DC 14200036 */ bnez $at, .Ljp7F08A4B8 @@ -31828,7 +29635,7 @@ glabel check_if_healthbar_timer_greater_than_0 f32 get_BONDdata_bondfadefracnew(void) { - return pPlayer->bondfadefracnew; + return pPlayer->field_19C; } @@ -31993,11 +29800,11 @@ glabel sub_GAME_7F08A03C /* 0BEBB0 7F08A080 8FA50024 */ lw $a1, 0x24($sp) /* 0BEBB4 7F08A084 8FB8001C */ lw $t8, 0x1c($sp) .L7F08A088: -/* 0BEBB8 7F08A088 3C088008 */ lui $t0, %hi(ptr_BONDdata_p1) +/* 0BEBB8 7F08A088 3C088008 */ lui $t0, %hi(players) /* 0BEBBC 7F08A08C 8FAF0024 */ lw $t7, 0x24($sp) /* 0BEBC0 7F08A090 0018C880 */ sll $t9, $t8, 2 /* 0BEBC4 7F08A094 01194021 */ addu $t0, $t0, $t9 -/* 0BEBC8 7F08A098 8D089EE0 */ lw $t0, %lo(ptr_BONDdata_p1)($t0) +/* 0BEBC8 7F08A098 8D089EE0 */ lw $t0, %lo(players)($t0) /* 0BEBCC 7F08A09C AD0F00AC */ sw $t7, 0xac($t0) /* 0BEBD0 7F08A0A0 8FBF0014 */ lw $ra, 0x14($sp) /* 0BEBD4 7F08A0A4 27BD0020 */ addiu $sp, $sp, 0x20 @@ -32024,19 +29831,19 @@ glabel sub_GAME_7F08A0B0 /* 0BEBEC 7F08A0BC AFA60028 */ sw $a2, 0x28($sp) /* 0BEBF0 7F08A0C0 0FC26C57 */ jal sub_GAME_7F09B15C /* 0BEBF4 7F08A0C4 AFA7002C */ sw $a3, 0x2c($sp) -/* 0BEBF8 7F08A0C8 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) -/* 0BEBFC 7F08A0CC 24849EE0 */ addiu $a0, %lo(ptr_BONDdata_p1) # addiu $a0, $a0, -0x6120 +/* 0BEBF8 7F08A0C8 3C048008 */ lui $a0, %hi(players) +/* 0BEBFC 7F08A0CC 24849EE0 */ addiu $a0, %lo(players) # addiu $a0, $a0, -0x6120 /* 0BEC00 7F08A0D0 00027080 */ sll $t6, $v0, 2 /* 0BEC04 7F08A0D4 008E7821 */ addu $t7, $a0, $t6 /* 0BEC08 7F08A0D8 8DF80000 */ lw $t8, ($t7) /* 0BEC0C 7F08A0DC 8F1900AC */ lw $t9, 0xac($t8) /* 0BEC10 7F08A0E0 53200029 */ beql $t9, $zero, .L7F08A188 /* 0BEC14 7F08A0E4 8FAE0028 */ lw $t6, 0x28($sp) -/* 0BEC18 7F08A0E8 0FC26919 */ jal get_num_players +/* 0BEC18 7F08A0E8 0FC26919 */ jal getPlayerCount /* 0BEC1C 7F08A0EC AFA2001C */ sw $v0, 0x1c($sp) -/* 0BEC20 7F08A0F0 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) +/* 0BEC20 7F08A0F0 3C048008 */ lui $a0, %hi(players) /* 0BEC24 7F08A0F4 24050001 */ li $a1, 1 -/* 0BEC28 7F08A0F8 24849EE0 */ addiu $a0, %lo(ptr_BONDdata_p1) # addiu $a0, $a0, -0x6120 +/* 0BEC28 7F08A0F8 24849EE0 */ addiu $a0, %lo(players) # addiu $a0, $a0, -0x6120 /* 0BEC2C 7F08A0FC 10450006 */ beq $v0, $a1, .L7F08A118 /* 0BEC30 7F08A100 8FA3001C */ lw $v1, 0x1c($sp) /* 0BEC34 7F08A104 00034080 */ sll $t0, $v1, 2 @@ -32173,8 +29980,8 @@ glabel sub_GAME_7F08A274 /* 0BEDB0 7F08A280 AFA60020 */ sw $a2, 0x20($sp) /* 0BEDB4 7F08A284 0FC26C57 */ jal sub_GAME_7F09B15C /* 0BEDB8 7F08A288 AFA70024 */ sw $a3, 0x24($sp) -/* 0BEDBC 7F08A28C 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p1) -/* 0BEDC0 7F08A290 25EF9EE0 */ addiu $t7, %lo(ptr_BONDdata_p1) # addiu $t7, $t7, -0x6120 +/* 0BEDBC 7F08A28C 3C0F8008 */ lui $t7, %hi(players) +/* 0BEDC0 7F08A290 25EF9EE0 */ addiu $t7, %lo(players) # addiu $t7, $t7, -0x6120 /* 0BEDC4 7F08A294 00027080 */ sll $t6, $v0, 2 /* 0BEDC8 7F08A298 01CF1821 */ addu $v1, $t6, $t7 /* 0BEDCC 7F08A29C 8C780000 */ lw $t8, ($v1) @@ -32351,21 +30158,11 @@ glabel set_flags_in_BONDdata_stationary_intro_cam #ifdef VERSION_US -#ifdef NONMATCHING -void sub_GAME_7F08A3B4(void) { - +void setFontTables(s32 arg0, s32 arg1) +{ + copy_2ndfonttable = arg0; + copy_1stfonttable = arg1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08A3B4 -/* 0BEEE4 7F08A3B4 3C018003 */ lui $at, %hi(copy_2ndfonttable) -/* 0BEEE8 7F08A3B8 AC2468A4 */ sw $a0, %lo(copy_2ndfonttable)($at) -/* 0BEEEC 7F08A3BC 3C018003 */ lui $at, %hi(copy_1stfonttable) -/* 0BEEF0 7F08A3C0 03E00008 */ jr $ra -/* 0BEEF4 7F08A3C4 AC2568A0 */ sw $a1, %lo(copy_1stfonttable)($at) -) -#endif #endif @@ -32382,7 +30179,7 @@ GLOBAL_ASM( glabel display_string_in_lower_left_corner /* 0BEEF8 7F08A3C8 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 0BEEFC 7F08A3CC AFBF0014 */ sw $ra, 0x14($sp) -/* 0BEF00 7F08A3D0 0FC26919 */ jal get_num_players +/* 0BEF00 7F08A3D0 0FC26919 */ jal getPlayerCount /* 0BEF04 7F08A3D4 AFA40028 */ sw $a0, 0x28($sp) /* 0BEF08 7F08A3D8 24010001 */ li $at, 1 /* 0BEF0C 7F08A3DC 14410020 */ bne $v0, $at, .L7F08A460 @@ -32468,7 +30265,7 @@ glabel display_string_in_lower_left_corner /* 0BF640 7F08AAD0 AFBF0014 */ sw $ra, 0x14($sp) /* 0BF644 7F08AAD4 AFA40028 */ sw $a0, 0x28($sp) /* 0BF648 7F08AAD8 AFA5002C */ sw $a1, 0x2c($sp) -/* 0BF64C 7F08AADC 0FC26C01 */ jal get_num_players +/* 0BF64C 7F08AADC 0FC26C01 */ jal getPlayerCount /* 0BF650 7F08AAE0 AFA60030 */ sw $a2, 0x30($sp) /* 0BF654 7F08AAE4 24010001 */ li $at, 1 /* 0BF658 7F08AAE8 1441002B */ bne $v0, $at, .L7F08AB98 @@ -32596,7 +30393,7 @@ glabel sub_GAME_7F08A4E4 /* 0BF048 7F08A518 00000000 */ nop /* 0BF04C 7F08A51C 8F188374 */ lw $t8, %lo(clock_timer)($t8) /* 0BF050 7F08A520 0078C823 */ subu $t9, $v1, $t8 -/* 0BF054 7F08A524 0FC26919 */ jal get_num_players +/* 0BF054 7F08A524 0FC26919 */ jal getPlayerCount /* 0BF058 7F08A528 AC5911DC */ sw $t9, 0x11dc($v0) /* 0BF05C 7F08A52C 24010001 */ li $at, 1 /* 0BF060 7F08A530 1441001B */ bne $v0, $at, .L7F08A5A0 @@ -32629,7 +30426,7 @@ glabel sub_GAME_7F08A4E4 /* 0BF0C8 7F08A598 240E001E */ li $t6, 30 /* 0BF0CC 7F08A59C AC4E11DC */ sw $t6, 0x11dc($v0) .L7F08A5A0: -/* 0BF0D0 7F08A5A0 0FC26919 */ jal get_num_players +/* 0BF0D0 7F08A5A0 0FC26919 */ jal getPlayerCount /* 0BF0D4 7F08A5A4 00000000 */ nop /* 0BF0D8 7F08A5A8 24010001 */ li $at, 1 /* 0BF0DC 7F08A5AC 1441000F */ bne $v0, $at, .L7F08A5EC @@ -32685,7 +30482,7 @@ glabel sub_GAME_7F08A5FC /* 0BF158 7F08A628 8C5829C4 */ lw $t8, 0x29c4($v0) /* 0BF15C 7F08A62C 570000B0 */ bnezl $t8, .L7F08A8F0 /* 0BF160 7F08A630 8FBF0034 */ lw $ra, 0x34($sp) -/* 0BF164 7F08A634 0FC26919 */ jal get_num_players +/* 0BF164 7F08A634 0FC26919 */ jal getPlayerCount /* 0BF168 7F08A638 AFA0005C */ sw $zero, 0x5c($sp) /* 0BF16C 7F08A63C 24010001 */ li $at, 1 /* 0BF170 7F08A640 14410010 */ bne $v0, $at, .L7F08A684 @@ -32744,12 +30541,12 @@ glabel sub_GAME_7F08A5FC /* 0BF23C 7F08A70C AFA00014 */ sw $zero, 0x14($sp) /* 0BF240 7F08A710 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0BF244 7F08A714 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BF248 7F08A718 0FC26919 */ jal get_num_players +/* 0BF248 7F08A718 0FC26919 */ jal getPlayerCount /* 0BF24C 7F08A71C 00000000 */ nop /* 0BF250 7F08A720 28410003 */ slti $at, $v0, 3 /* 0BF254 7F08A724 10200005 */ beqz $at, .L7F08A73C /* 0BF258 7F08A728 00000000 */ nop -/* 0BF25C 7F08A72C 0C001145 */ jal get_video2_settings_ulx +/* 0BF25C 7F08A72C 0C001145 */ jal viGetViewLeft /* 0BF260 7F08A730 00000000 */ nop /* 0BF264 7F08A734 1000000D */ b .L7F08A76C /* 0BF268 7F08A738 2443001E */ addiu $v1, $v0, 0x1e @@ -32759,19 +30556,19 @@ glabel sub_GAME_7F08A5FC /* 0BF274 7F08A744 30580001 */ andi $t8, $v0, 1 /* 0BF278 7F08A748 13000005 */ beqz $t8, .L7F08A760 /* 0BF27C 7F08A74C 00000000 */ nop -/* 0BF280 7F08A750 0C001145 */ jal get_video2_settings_ulx +/* 0BF280 7F08A750 0C001145 */ jal viGetViewLeft /* 0BF284 7F08A754 00000000 */ nop /* 0BF288 7F08A758 10000004 */ b .L7F08A76C /* 0BF28C 7F08A75C 2443000A */ addiu $v1, $v0, 0xa .L7F08A760: -/* 0BF290 7F08A760 0C001145 */ jal get_video2_settings_ulx +/* 0BF290 7F08A760 0C001145 */ jal viGetViewLeft /* 0BF294 7F08A764 00000000 */ nop /* 0BF298 7F08A768 2443001E */ addiu $v1, $v0, 0x1e .L7F08A76C: /* 0BF29C 7F08A76C 8FB90044 */ lw $t9, 0x44($sp) /* 0BF2A0 7F08A770 AFA30058 */ sw $v1, 0x58($sp) /* 0BF2A4 7F08A774 00794021 */ addu $t0, $v1, $t9 -/* 0BF2A8 7F08A778 0FC26919 */ jal get_num_players +/* 0BF2A8 7F08A778 0FC26919 */ jal getPlayerCount /* 0BF2AC 7F08A77C AFA80050 */ sw $t0, 0x50($sp) /* 0BF2B0 7F08A780 28410003 */ slti $at, $v0, 3 /* 0BF2B4 7F08A784 10200024 */ beqz $at, .L7F08A818 @@ -32786,9 +30583,9 @@ glabel sub_GAME_7F08A5FC /* 0BF2D8 7F08A7A8 00000000 */ nop /* 0BF2DC 7F08A7AC 1440000A */ bnez $v0, .L7F08A7D8 /* 0BF2E0 7F08A7B0 00000000 */ nop -/* 0BF2E4 7F08A7B4 0C001149 */ jal get_video2_settings_uly +/* 0BF2E4 7F08A7B4 0C001149 */ jal viGetViewTop /* 0BF2E8 7F08A7B8 00000000 */ nop -/* 0BF2EC 7F08A7BC 0C00112B */ jal get_video2_settings_height +/* 0BF2EC 7F08A7BC 0C00112B */ jal viGetViewHeight /* 0BF2F0 7F08A7C0 A7A2003E */ sh $v0, 0x3e($sp) /* 0BF2F4 7F08A7C4 87A9003E */ lh $t1, 0x3e($sp) /* 0BF2F8 7F08A7C8 00495021 */ addu $t2, $v0, $t1 @@ -32796,9 +30593,9 @@ glabel sub_GAME_7F08A5FC /* 0BF300 7F08A7D0 10000009 */ b .L7F08A7F8 /* 0BF304 7F08A7D4 AFAB004C */ sw $t3, 0x4c($sp) .L7F08A7D8: -/* 0BF308 7F08A7D8 0C001149 */ jal get_video2_settings_uly +/* 0BF308 7F08A7D8 0C001149 */ jal viGetViewTop /* 0BF30C 7F08A7DC 00000000 */ nop -/* 0BF310 7F08A7E0 0C00112B */ jal get_video2_settings_height +/* 0BF310 7F08A7E0 0C00112B */ jal viGetViewHeight /* 0BF314 7F08A7E4 A7A2003E */ sh $v0, 0x3e($sp) /* 0BF318 7F08A7E8 87AC003E */ lh $t4, 0x3e($sp) /* 0BF31C 7F08A7EC 004C6821 */ addu $t5, $v0, $t4 @@ -32814,7 +30611,7 @@ glabel sub_GAME_7F08A5FC /* 0BF340 7F08A810 10000005 */ b .L7F08A828 /* 0BF344 7F08A814 AFB8004C */ sw $t8, 0x4c($sp) .L7F08A818: -/* 0BF348 7F08A818 0C001149 */ jal get_video2_settings_uly +/* 0BF348 7F08A818 0C001149 */ jal viGetViewTop /* 0BF34C 7F08A81C 00000000 */ nop /* 0BF350 7F08A820 24590010 */ addiu $t9, $v0, 0x10 /* 0BF354 7F08A824 AFB9004C */ sw $t9, 0x4c($sp) @@ -32895,7 +30692,7 @@ glabel sub_GAME_7F08A5FC /* 0BF920 7F08ADB0 8C5829C4 */ lw $t8, 0x29c4($v0) /* 0BF924 7F08ADB4 570000C5 */ bnezl $t8, .Ljp7F08B0CC /* 0BF928 7F08ADB8 8FBF0034 */ lw $ra, 0x34($sp) -/* 0BF92C 7F08ADBC 0FC26C01 */ jal get_num_players +/* 0BF92C 7F08ADBC 0FC26C01 */ jal getPlayerCount /* 0BF930 7F08ADC0 AFA0005C */ sw $zero, 0x5c($sp) /* 0BF934 7F08ADC4 24010001 */ li $at, 1 /* 0BF938 7F08ADC8 14410010 */ bne $v0, $at, .Ljp7F08AE0C @@ -32957,12 +30754,12 @@ glabel sub_GAME_7F08A5FC /* 0BFA10 7F08AEA0 AFA00014 */ sw $zero, 0x14($sp) /* 0BFA14 7F08AEA4 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0BFA18 7F08AEA8 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BFA1C 7F08AEAC 0FC26C01 */ jal get_num_players +/* 0BFA1C 7F08AEAC 0FC26C01 */ jal getPlayerCount /* 0BFA20 7F08AEB0 00000000 */ nop /* 0BFA24 7F08AEB4 28410003 */ slti $at, $v0, 3 /* 0BFA28 7F08AEB8 10200005 */ beqz $at, .Ljp7F08AED0 /* 0BFA2C 7F08AEBC 00000000 */ nop -/* 0BFA30 7F08AEC0 0C001145 */ jal get_video2_settings_ulx +/* 0BFA30 7F08AEC0 0C001145 */ jal viGetViewLeft /* 0BFA34 7F08AEC4 00000000 */ nop /* 0BFA38 7F08AEC8 1000000D */ b .Ljp7F08AF00 /* 0BFA3C 7F08AECC 2443001E */ addiu $v1, $v0, 0x1e @@ -32972,19 +30769,19 @@ glabel sub_GAME_7F08A5FC /* 0BFA48 7F08AED8 30580001 */ andi $t8, $v0, 1 /* 0BFA4C 7F08AEDC 13000005 */ beqz $t8, .Ljp7F08AEF4 /* 0BFA50 7F08AEE0 00000000 */ nop -/* 0BFA54 7F08AEE4 0C001145 */ jal get_video2_settings_ulx +/* 0BFA54 7F08AEE4 0C001145 */ jal viGetViewLeft /* 0BFA58 7F08AEE8 00000000 */ nop /* 0BFA5C 7F08AEEC 10000004 */ b .Ljp7F08AF00 /* 0BFA60 7F08AEF0 2443000A */ addiu $v1, $v0, 0xa .Ljp7F08AEF4: -/* 0BFA64 7F08AEF4 0C001145 */ jal get_video2_settings_ulx +/* 0BFA64 7F08AEF4 0C001145 */ jal viGetViewLeft /* 0BFA68 7F08AEF8 00000000 */ nop /* 0BFA6C 7F08AEFC 2443001E */ addiu $v1, $v0, 0x1e .Ljp7F08AF00: /* 0BFA70 7F08AF00 8FB90044 */ lw $t9, 0x44($sp) /* 0BFA74 7F08AF04 AFA30058 */ sw $v1, 0x58($sp) /* 0BFA78 7F08AF08 00794821 */ addu $t1, $v1, $t9 -/* 0BFA7C 7F08AF0C 0FC26C01 */ jal get_num_players +/* 0BFA7C 7F08AF0C 0FC26C01 */ jal getPlayerCount /* 0BFA80 7F08AF10 AFA90050 */ sw $t1, 0x50($sp) /* 0BFA84 7F08AF14 28410003 */ slti $at, $v0, 3 /* 0BFA88 7F08AF18 10200024 */ beqz $at, .Ljp7F08AFAC @@ -32999,9 +30796,9 @@ glabel sub_GAME_7F08A5FC /* 0BFAAC 7F08AF3C 00000000 */ nop /* 0BFAB0 7F08AF40 1440000A */ bnez $v0, .Ljp7F08AF6C /* 0BFAB4 7F08AF44 00000000 */ nop -/* 0BFAB8 7F08AF48 0C001149 */ jal get_video2_settings_uly +/* 0BFAB8 7F08AF48 0C001149 */ jal viGetViewTop /* 0BFABC 7F08AF4C 00000000 */ nop -/* 0BFAC0 7F08AF50 0C00112B */ jal get_video2_settings_height +/* 0BFAC0 7F08AF50 0C00112B */ jal viGetViewHeight /* 0BFAC4 7F08AF54 A7A2003E */ sh $v0, 0x3e($sp) /* 0BFAC8 7F08AF58 87A3003E */ lh $v1, 0x3e($sp) /* 0BFACC 7F08AF5C 00435821 */ addu $t3, $v0, $v1 @@ -33009,9 +30806,9 @@ glabel sub_GAME_7F08A5FC /* 0BFAD4 7F08AF64 10000009 */ b .Ljp7F08AF8C /* 0BFAD8 7F08AF68 AFAC004C */ sw $t4, 0x4c($sp) .Ljp7F08AF6C: -/* 0BFADC 7F08AF6C 0C001149 */ jal get_video2_settings_uly +/* 0BFADC 7F08AF6C 0C001149 */ jal viGetViewTop /* 0BFAE0 7F08AF70 00000000 */ nop -/* 0BFAE4 7F08AF74 0C00112B */ jal get_video2_settings_height +/* 0BFAE4 7F08AF74 0C00112B */ jal viGetViewHeight /* 0BFAE8 7F08AF78 A7A2003E */ sh $v0, 0x3e($sp) /* 0BFAEC 7F08AF7C 87A3003E */ lh $v1, 0x3e($sp) /* 0BFAF0 7F08AF80 00437021 */ addu $t6, $v0, $v1 @@ -33027,7 +30824,7 @@ glabel sub_GAME_7F08A5FC /* 0BFB14 7F08AFA4 10000014 */ b .Ljp7F08AFF8 /* 0BFB18 7F08AFA8 AFB9004C */ sw $t9, 0x4c($sp) .Ljp7F08AFAC: -/* 0BFB1C 7F08AFAC 0C001149 */ jal get_video2_settings_uly +/* 0BFB1C 7F08AFAC 0C001149 */ jal viGetViewTop /* 0BFB20 7F08AFB0 00000000 */ nop /* 0BFB24 7F08AFB4 3C0A8005 */ lui $t2, %hi(j_text_trigger) # $t2, 0x8005 /* 0BFB28 7F08AFB8 8D4A8500 */ lw $t2, %lo(j_text_trigger)($t2) @@ -33381,10 +31178,10 @@ glabel sub_GAME_7F08AAE8 /* 0BF6F4 7F08ABC4 8DEF642C */ lw $t7, %lo(camera_8003642C)($t7) /* 0BF6F8 7F08ABC8 11E0001B */ beqz $t7, .L7F08AC38 /* 0BF6FC 7F08ABCC 00000000 */ nop -/* 0BF700 7F08ABD0 0C001145 */ jal get_video2_settings_ulx +/* 0BF700 7F08ABD0 0C001145 */ jal viGetViewLeft /* 0BF704 7F08ABD4 00000000 */ nop /* 0BF708 7F08ABD8 24580046 */ addiu $t8, $v0, 0x46 -/* 0BF70C 7F08ABDC 0C001149 */ jal get_video2_settings_uly +/* 0BF70C 7F08ABDC 0C001149 */ jal viGetViewTop /* 0BF710 7F08ABE0 AFB800E4 */ sw $t8, 0xe4($sp) /* 0BF714 7F08ABE4 00401825 */ move $v1, $v0 /* 0BF718 7F08ABE8 24630020 */ addiu $v1, $v1, 0x20 @@ -33410,10 +31207,10 @@ glabel sub_GAME_7F08AAE8 /* 0BF760 7F08AC30 10000008 */ b .L7F08AC54 /* 0BF764 7F08AC34 8FA800D8 */ lw $t0, 0xd8($sp) .L7F08AC38: -/* 0BF768 7F08AC38 0C001145 */ jal get_video2_settings_ulx +/* 0BF768 7F08AC38 0C001145 */ jal viGetViewLeft /* 0BF76C 7F08AC3C 00000000 */ nop /* 0BF770 7F08AC40 2459001E */ addiu $t9, $v0, 0x1e -/* 0BF774 7F08AC44 0C001149 */ jal get_video2_settings_uly +/* 0BF774 7F08AC44 0C001149 */ jal viGetViewTop /* 0BF778 7F08AC48 AFB900E4 */ sw $t9, 0xe4($sp) /* 0BF77C 7F08AC4C 2443000D */ addiu $v1, $v0, 0xd /* 0BF780 7F08AC50 8FA800D8 */ lw $t0, 0xd8($sp) @@ -33561,10 +31358,10 @@ glabel sub_GAME_7F08AAE8 /* 0BF9B0 7F08AE80 24A54FDC */ addiu $a1, %lo(aS3d) # addiu $a1, $a1, 0x4fdc /* 0BF9B4 7F08AE84 0C002B25 */ jal sprintf /* 0BF9B8 7F08AE88 27A40084 */ addiu $a0, $sp, 0x84 -/* 0BF9BC 7F08AE8C 0C001145 */ jal get_video2_settings_ulx +/* 0BF9BC 7F08AE8C 0C001145 */ jal viGetViewLeft /* 0BF9C0 7F08AE90 00000000 */ nop /* 0BF9C4 7F08AE94 244F0011 */ addiu $t7, $v0, 0x11 -/* 0BF9C8 7F08AE98 0C001149 */ jal get_video2_settings_uly +/* 0BF9C8 7F08AE98 0C001149 */ jal viGetViewTop /* 0BF9CC 7F08AE9C AFAF0080 */ sw $t7, 0x80($sp) /* 0BF9D0 7F08AEA0 24460011 */ addiu $a2, $v0, 0x11 /* 0BF9D4 7F08AEA4 24D8000A */ addiu $t8, $a2, 0xa @@ -33606,7 +31403,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFA64 7F08AF34 AFAA0010 */ sw $t2, 0x10($sp) /* 0BFA68 7F08AF38 0FC2B6AF */ jal en_text_write_stuff /* 0BFA6C 7F08AF3C AFAB001C */ sw $t3, 0x1c($sp) -/* 0BFA70 7F08AF40 0C001145 */ jal get_video2_settings_ulx +/* 0BFA70 7F08AF40 0C001145 */ jal viGetViewLeft /* 0BFA74 7F08AF44 00408025 */ move $s0, $v0 /* 0BFA78 7F08AF48 244C0057 */ addiu $t4, $v0, 0x57 /* 0BFA7C 7F08AF4C 0C001107 */ jal get_video2_settings_txtClipW @@ -33631,7 +31428,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFAC8 7F08AF98 AFAF0010 */ sw $t7, 0x10($sp) /* 0BFACC 7F08AF9C 0FC2B6AF */ jal en_text_write_stuff /* 0BFAD0 7F08AFA0 AFA8001C */ sw $t0, 0x1c($sp) -/* 0BFAD4 7F08AFA4 0C001145 */ jal get_video2_settings_ulx +/* 0BFAD4 7F08AFA4 0C001145 */ jal viGetViewLeft /* 0BFAD8 7F08AFA8 00408025 */ move $s0, $v0 /* 0BFADC 7F08AFAC 2449008D */ addiu $t1, $v0, 0x8d /* 0BFAE0 7F08AFB0 0C001107 */ jal get_video2_settings_txtClipW @@ -33656,7 +31453,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFB2C 7F08AFFC AFAA0010 */ sw $t2, 0x10($sp) /* 0BFB30 7F08B000 0FC2B6AF */ jal en_text_write_stuff /* 0BFB34 7F08B004 AFAB001C */ sw $t3, 0x1c($sp) -/* 0BFB38 7F08B008 0C001145 */ jal get_video2_settings_ulx +/* 0BFB38 7F08B008 0C001145 */ jal viGetViewLeft /* 0BFB3C 7F08B00C 00408025 */ move $s0, $v0 /* 0BFB40 7F08B010 244C00C3 */ addiu $t4, $v0, 0xc3 /* 0BFB44 7F08B014 0C001107 */ jal get_video2_settings_txtClipW @@ -33681,7 +31478,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFB90 7F08B060 AFAF0010 */ sw $t7, 0x10($sp) /* 0BFB94 7F08B064 0FC2B6AF */ jal en_text_write_stuff /* 0BFB98 7F08B068 AFA8001C */ sw $t0, 0x1c($sp) -/* 0BFB9C 7F08B06C 0C001145 */ jal get_video2_settings_ulx +/* 0BFB9C 7F08B06C 0C001145 */ jal viGetViewLeft /* 0BFBA0 7F08B070 00408025 */ move $s0, $v0 /* 0BFBA4 7F08B074 244900F9 */ addiu $t1, $v0, 0xf9 /* 0BFBA8 7F08B078 0C001107 */ jal get_video2_settings_txtClipW @@ -33783,10 +31580,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFF10 7F08B3A0 8DEF646C */ lw $t7, %lo(camera_8003642C)($t7) /* 0BFF14 7F08B3A4 11E0001B */ beqz $t7, .Ljp7F08B414 /* 0BFF18 7F08B3A8 00000000 */ nop -/* 0BFF1C 7F08B3AC 0C001145 */ jal get_video2_settings_ulx +/* 0BFF1C 7F08B3AC 0C001145 */ jal viGetViewLeft /* 0BFF20 7F08B3B0 00000000 */ nop /* 0BFF24 7F08B3B4 24580046 */ addiu $t8, $v0, 0x46 -/* 0BFF28 7F08B3B8 0C001149 */ jal get_video2_settings_uly +/* 0BFF28 7F08B3B8 0C001149 */ jal viGetViewTop /* 0BFF2C 7F08B3BC AFB800E4 */ sw $t8, 0xe4($sp) /* 0BFF30 7F08B3C0 00401825 */ move $v1, $v0 /* 0BFF34 7F08B3C4 24630020 */ addiu $v1, $v1, 0x20 @@ -33812,10 +31609,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFF7C 7F08B40C 10000008 */ b .Ljp7F08B430 /* 0BFF80 7F08B410 8FA800D8 */ lw $t0, 0xd8($sp) .Ljp7F08B414: -/* 0BFF84 7F08B414 0C001145 */ jal get_video2_settings_ulx +/* 0BFF84 7F08B414 0C001145 */ jal viGetViewLeft /* 0BFF88 7F08B418 00000000 */ nop /* 0BFF8C 7F08B41C 2459001E */ addiu $t9, $v0, 0x1e -/* 0BFF90 7F08B420 0C001149 */ jal get_video2_settings_uly +/* 0BFF90 7F08B420 0C001149 */ jal viGetViewTop /* 0BFF94 7F08B424 AFB900E4 */ sw $t9, 0xe4($sp) /* 0BFF98 7F08B428 2443000D */ addiu $v1, $v0, 0xd /* 0BFF9C 7F08B42C 8FA800D8 */ lw $t0, 0xd8($sp) @@ -34008,10 +31805,10 @@ glabel sub_GAME_7F08AAE8 /* 0C0278 7F08B708 24A5500C */ addiu $a1, %lo(aS3d) # addiu $a1, $a1, 0x500c /* 0C027C 7F08B70C 0C002B29 */ jal sprintf /* 0C0280 7F08B710 27A40084 */ addiu $a0, $sp, 0x84 -/* 0C0284 7F08B714 0C001145 */ jal get_video2_settings_ulx +/* 0C0284 7F08B714 0C001145 */ jal viGetViewLeft /* 0C0288 7F08B718 00000000 */ nop /* 0C028C 7F08B71C 244E0011 */ addiu $t6, $v0, 0x11 -/* 0C0290 7F08B720 0C001149 */ jal get_video2_settings_uly +/* 0C0290 7F08B720 0C001149 */ jal viGetViewTop /* 0C0294 7F08B724 AFAE0080 */ sw $t6, 0x80($sp) /* 0C0298 7F08B728 24460011 */ addiu $a2, $v0, 0x11 /* 0C029C 7F08B72C 24CF000A */ addiu $t7, $a2, 0xa @@ -34053,7 +31850,7 @@ glabel sub_GAME_7F08AAE8 /* 0C032C 7F08B7BC AFA90010 */ sw $t1, 0x10($sp) /* 0C0330 7F08B7C0 0FC2B99B */ jal en_text_write_stuff /* 0C0334 7F08B7C4 AFAA001C */ sw $t2, 0x1c($sp) -/* 0C0338 7F08B7C8 0C001145 */ jal get_video2_settings_ulx +/* 0C0338 7F08B7C8 0C001145 */ jal viGetViewLeft /* 0C033C 7F08B7CC 00408025 */ move $s0, $v0 /* 0C0340 7F08B7D0 244B0057 */ addiu $t3, $v0, 0x57 /* 0C0344 7F08B7D4 0C001107 */ jal get_video2_settings_txtClipW @@ -34078,7 +31875,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0390 7F08B820 AFAE0010 */ sw $t6, 0x10($sp) /* 0C0394 7F08B824 0FC2B99B */ jal en_text_write_stuff /* 0C0398 7F08B828 AFB9001C */ sw $t9, 0x1c($sp) -/* 0C039C 7F08B82C 0C001145 */ jal get_video2_settings_ulx +/* 0C039C 7F08B82C 0C001145 */ jal viGetViewLeft /* 0C03A0 7F08B830 00408025 */ move $s0, $v0 /* 0C03A4 7F08B834 2448008D */ addiu $t0, $v0, 0x8d /* 0C03A8 7F08B838 0C001107 */ jal get_video2_settings_txtClipW @@ -34103,7 +31900,7 @@ glabel sub_GAME_7F08AAE8 /* 0C03F4 7F08B884 AFA90010 */ sw $t1, 0x10($sp) /* 0C03F8 7F08B888 0FC2B99B */ jal en_text_write_stuff /* 0C03FC 7F08B88C AFAA001C */ sw $t2, 0x1c($sp) -/* 0C0400 7F08B890 0C001145 */ jal get_video2_settings_ulx +/* 0C0400 7F08B890 0C001145 */ jal viGetViewLeft /* 0C0404 7F08B894 00408025 */ move $s0, $v0 /* 0C0408 7F08B898 244B00C3 */ addiu $t3, $v0, 0xc3 /* 0C040C 7F08B89C 0C001107 */ jal get_video2_settings_txtClipW @@ -34128,7 +31925,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0458 7F08B8E8 AFAE0010 */ sw $t6, 0x10($sp) /* 0C045C 7F08B8EC 0FC2B99B */ jal en_text_write_stuff /* 0C0460 7F08B8F0 AFB9001C */ sw $t9, 0x1c($sp) -/* 0C0464 7F08B8F4 0C001145 */ jal get_video2_settings_ulx +/* 0C0464 7F08B8F4 0C001145 */ jal viGetViewLeft /* 0C0468 7F08B8F8 00408025 */ move $s0, $v0 /* 0C046C 7F08B8FC 244800F9 */ addiu $t0, $v0, 0xf9 /* 0C0470 7F08B900 0C001107 */ jal get_video2_settings_txtClipW @@ -34214,10 +32011,10 @@ glabel sub_GAME_7F08B0F0 /* 0BFC74 7F08B144 8FA900F0 */ lw $t1, 0xf0($sp) .L7F08B148: /* 0BFC78 7F08B148 8FAA00F4 */ lw $t2, 0xf4($sp) -/* 0BFC7C 7F08B14C 3C0C8008 */ lui $t4, %hi(ptr_BONDdata_p1) +/* 0BFC7C 7F08B14C 3C0C8008 */ lui $t4, %hi(players) /* 0BFC80 7F08B150 1120004D */ beqz $t1, .L7F08B288 /* 0BFC84 7F08B154 000A5880 */ sll $t3, $t2, 2 -/* 0BFC88 7F08B158 258C9EE0 */ addiu $t4, %lo(ptr_BONDdata_p1) # addiu $t4, $t4, -0x6120 +/* 0BFC88 7F08B158 258C9EE0 */ addiu $t4, %lo(players) # addiu $t4, $t4, -0x6120 /* 0BFC8C 7F08B15C 016C8821 */ addu $s1, $t3, $t4 /* 0BFC90 7F08B160 8E2D0000 */ lw $t5, ($s1) /* 0BFC94 7F08B164 8DAE00D4 */ lw $t6, 0xd4($t5) @@ -34266,7 +32063,7 @@ glabel sub_GAME_7F08B0F0 /* 0BFD3C 7F08B20C 00000000 */ nop /* 0BFD40 7F08B210 8E2A0000 */ lw $t2, ($s1) /* 0BFD44 7F08B214 8D4B00D4 */ lw $t3, 0xd4($t2) -/* 0BFD48 7F08B218 0FC1E111 */ jal sub_GAME_7F078444 +/* 0BFD48 7F08B218 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0BFD4C 7F08B21C 8D70000C */ lw $s0, 0xc($t3) /* 0BFD50 7F08B220 00402025 */ move $a0, $v0 /* 0BFD54 7F08B224 02002825 */ move $a1, $s0 @@ -34299,16 +32096,16 @@ glabel sub_GAME_7F08B0F0 /* 0BFDB8 7F08B288 8FAF00F0 */ lw $t7, 0xf0($sp) .L7F08B28C: /* 0BFDBC 7F08B28C 8FB800F4 */ lw $t8, 0xf4($sp) -/* 0BFDC0 7F08B290 3C098008 */ lui $t1, %hi(ptr_BONDdata_p1) +/* 0BFDC0 7F08B290 3C098008 */ lui $t1, %hi(players) /* 0BFDC4 7F08B294 11E0027E */ beqz $t7, .L7F08BC90 /* 0BFDC8 7F08B298 0018C880 */ sll $t9, $t8, 2 -/* 0BFDCC 7F08B29C 25299EE0 */ addiu $t1, %lo(ptr_BONDdata_p1) # addiu $t1, $t1, -0x6120 +/* 0BFDCC 7F08B29C 25299EE0 */ addiu $t1, %lo(players) # addiu $t1, $t1, -0x6120 /* 0BFDD0 7F08B2A0 03298821 */ addu $s1, $t9, $t1 /* 0BFDD4 7F08B2A4 8E2A0000 */ lw $t2, ($s1) /* 0BFDD8 7F08B2A8 8D4B00D4 */ lw $t3, 0xd4($t2) /* 0BFDDC 7F08B2AC 51600279 */ beql $t3, $zero, .L7F08BC94 /* 0BFDE0 7F08B2B0 8FAA00F8 */ lw $t2, 0xf8($sp) -/* 0BFDE4 7F08B2B4 0FC26919 */ jal get_num_players +/* 0BFDE4 7F08B2B4 0FC26919 */ jal getPlayerCount /* 0BFDE8 7F08B2B8 00000000 */ nop /* 0BFDEC 7F08B2BC 28410002 */ slti $at, $v0, 2 /* 0BFDF0 7F08B2C0 54200274 */ bnezl $at, .L7F08BC94 @@ -34492,12 +32289,12 @@ glabel sub_GAME_7F08B0F0 /* 0C0078 7F08B548 00008025 */ move $s0, $zero /* 0C007C 7F08B54C 24100001 */ li $s0, 1 .L7F08B550: -/* 0C0080 7F08B550 0FC1E687 */ jal sub_GAME_7F079A1C +/* 0C0080 7F08B550 0FC1E687 */ jal playerGetCrouchPos /* 0C0084 7F08B554 8FA400F4 */ lw $a0, 0xf4($sp) /* 0C0088 7F08B558 24010001 */ li $at, 1 /* 0C008C 7F08B55C 50410005 */ beql $v0, $at, .L7F08B574 /* 0C0090 7F08B560 3C013F80 */ lui $at, 0x3f80 -/* 0C0094 7F08B564 0FC1E687 */ jal sub_GAME_7F079A1C +/* 0C0094 7F08B564 0FC1E687 */ jal playerGetCrouchPos /* 0C0098 7F08B568 8FA400F4 */ lw $a0, 0xf4($sp) /* 0C009C 7F08B56C 14400006 */ bnez $v0, .L7F08B588 /* 0C00A0 7F08B570 3C013F80 */ li $at, 0x3F800000 # 1.000000 @@ -35291,7 +33088,7 @@ glabel sub_GAME_7F08BEEC /* 0C0A54 7F08BF24 00808025 */ move $s0, $a0 /* 0C0A58 7F08BF28 27B20040 */ addiu $s2, $sp, 0x40 .L7F08BF2C: -/* 0C0A5C 7F08BF2C 0FC1E111 */ jal sub_GAME_7F078444 +/* 0C0A5C 7F08BF2C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0C0A60 7F08BF30 00000000 */ nop /* 0C0A64 7F08BF34 00402025 */ move $a0, $v0 /* 0C0A68 7F08BF38 02002825 */ move $a1, $s0 diff --git a/src/game/bond.h b/src/game/bond.h index bf064378..e4ffb082 100644 --- a/src/game/bond.h +++ b/src/game/bond.h @@ -3,8 +3,10 @@ #include "ultra64.h" #include "game/chr.h" +#include "game/matrixmath.h" +#include "structs.h" -struct xyzpoint +struct coord { f32 x; f32 y; @@ -299,31 +301,27 @@ typedef struct textoverride { } textoverride; -struct Player +struct player { s32 unknown; - s32 xpos; - s32 ypos; - s32 zpos; - s32 xpos2; - s32 ypos2; - s32 zpos2; - s32 xoffset; - s32 yoffset; - s32 zoffset; - s32 xpos3; - s32 ypos3; - s32 zpos3; + f32 xpos; + f32 ypos; + f32 zpos; + f32 xpos2; + f32 ypos2; + f32 zpos2; + f32 xoffset; + f32 yoffset; + f32 zoffset; + f32 xpos3; + f32 ypos3; + f32 zpos3; s32 room_pointer; - s32 current_model_xpos; - s32 current_model_ypos; - s32 current_model_zpos; - s32 previous_model_xpos; - s32 previous_model_ypos; - s32 previous_model_zpos; - s32 current_room_xpos; - s32 current_room_ypos; - s32 current_room_zpos; + vec3 current_model_pos; + vec3 previous_model_pos; + f32 current_room_xpos; + f32 current_room_ypos; + f32 current_room_zpos; s32 field_5C; s32 field_60; s32 field_64; @@ -334,16 +332,16 @@ struct Player s32 field_78; s32 field_7C; s32 field_80; - s32 field_84; - s32 field_88; + f32 field_84; + f32 field_88; s32 field_8C; - s32 field_90; + f32 field_90; s32 field_94; - s32 field_98; - s32 crouchposition; - s32 ducking_height_offset; - s32 field_A4; - s32 position_data_pointer; + f32 field_98; + s32 crouchpos; + f32 ducking_height_offset; + f32 field_A4; + struct prop* prop; s32 field_AC; s32 field_B0; s32 zpos_0; @@ -356,12 +354,12 @@ struct Player s32 field_D0; s32 ptr_char_objectinstance; s32 bonddead; - s32 bondhealth; + f32 bondhealth; f32 bondarmour; - s32 oldhealth; - s32 oldarmour; - s32 apparenthealth; - s32 apparentarmour; + f32 oldhealth; + f32 oldarmour; + f32 apparenthealth; + f32 apparentarmour; s32 damageshowtime; s32 healthshowtime; s32 healthshowmode; @@ -385,26 +383,26 @@ struct Player s32 autoxaimtime60; f32 vv_theta; f32 speedtheta; - s32 vv_costheta; - s32 vv_sintheta; + f32 vv_costheta; + f32 vv_sintheta; f32 vv_verta; - s32 vv_verta360; + f32 vv_verta360; f32 speedverta; - s32 vv_cosverta; - s32 vv_sinverta; + f32 vv_cosverta; + f32 vv_sinverta; f32 speedsideways; f32 speedstrafe; f32 speedforwards; - s32 speedboost; + f32 speedboost; s32 speedmaxtime60; - s32 boost_factor_x; - s32 boost_factor_y; - s32 boost_factor_z; - s32 viewport_alpha; - s32 bondfadetime60; - s32 bondfadetimemax; - s32 bondfadefracold; + f32 boost_factor_x; + f32 boost_factor_y; + f32 boost_factor_z; + f32 bondfadetime60; + f32 bondfadetimemax60; + f32 bondfadefracold; f32 bondfadefracnew; + f32 field_19C; s32 field_1A0; s32 field_1A4; s32 field_1A8; @@ -431,14 +429,14 @@ struct Player s32 field_1FC; s32 pausing_flag; f32 pause_starting_angle; - s32 field_208; - s32 pause_target_angle; + f32 field_208; + f32 pause_target_angle; f32 field_210; f32 field_214; s32 field_218; s32 field_21C; s32 step_in_view_watch_animation; - s32 pause_animation_counter; + f32 pause_animation_counter; s32 field_228; s32 field_22C; s32 something_with_watch_object_instance; @@ -543,23 +541,23 @@ struct Player s32 field_3B8; s32 field_3BC; s32 field_3C0; - s32 field_3C4; - s32 field_3C8; - s32 field_3CC; - s32 tint_red; - s32 tint_green; - s32 tint_blue; - f32 tint_alpha; - s32 screen_fade_timer; - f32 screen_fade_max_time; - s32 field_3E8; - s32 field_3EC; - s32 field_3F0; - s32 field_3F4; - s32 field_3F8; - s32 field_3FC; - s32 field_400; - s32 field_404; + f32 field_3C4; + f32 field_3C8; + f32 field_3CC; + s32 colourscreenred; + s32 colourscreengreen; + s32 colourscreenblue; + f32 colourscreenfrac; + f32 colourfadetime60; + f32 colourfadetimemax60; + s32 colourfaderedold; + s32 colourfaderednew; + s32 colourfadegreenold; + s32 colourfadegreennew; + s32 colourfadeblueold; + s32 colourfadebluenew; + f32 colourfadefracold; + f32 colourfadefracnew; s32 field_408; s32 field_40C; s32 field_410; @@ -613,32 +611,20 @@ struct Player s32 field_4D0; s32 field_4D4; s32 current_tile_ptr_for_portals; - s32 field_4DC; - s32 field_4E0; + u32 resetheadpos; // bool + u32 resetheadrot; // bool s32 field_4E4; s32 field_4E8; - f32 field_4EC; + f32 headdamp; s32 field_4F0; s32 field_4F4; s32 field_4F8; - struct xyzpoint scaled_velocity; - //f32 field_500; - //f32 field_504; - struct xyzpoint field_508; - //s32 field_50C; - //s32 field_510; - struct xyzpoint field_514; - //s32 field_518; - //s32 field_51C; - struct xyzpoint velocity; - //f32 field_524; - //f32 field_528; - struct xyzpoint field_52C; - //s32 field_530; - //s32 field_534; - struct xyzpoint field_538; - //s32 field_53C; - //s32 field_540; + vec3 headpos; + vec3 headlook; + vec3 headup; + vec3 headpossum; + vec3 headlooksum; + vec3 headupsum; s32 field_544; s32 field_548; s32 field_54C; @@ -647,19 +633,9 @@ struct Player s32 field_558; s32 field_55C; s32 field_560; - s32 field_564; - s32 field_568; - s32 field_56C; - s32 field_570; - s32 field_574; - s32 field_578; - s32 field_57C; - s32 field_580; - s32 field_584; - s32 field_588; - s32 field_58C; - s32 field_590; - s32 field_594; + vec3 standlook[2]; + vec3 standup[2]; + s32 standcnt; s32 field_598; s32 field_59C; s32 field_5A0; @@ -805,14 +781,7 @@ struct Player s32 field_7C4; s32 field_7C8; s32 field_7CC; - s32 field_7D0; - s32 field_7D4; - s32 field_7D8; - s32 field_7DC; - s32 field_7E0; - s32 field_7E4; - s32 field_7E8; - s32 field_7EC; + Vp viewports[2]; s16 viewx; s16 viewy; s16 viewleft; @@ -899,24 +868,23 @@ struct Player f32 c_scaley; f32 c_recipscalex; f32 c_recipscaley; - s32 field_10C4; - s32 field_10C8; - s32 field_10CC; - s32 field_10D0; - s32 field_10D4; - s32 field_10D8; - s32 field_10DC; - s32 field_10E0; - s32 field_10E4; - s32 field_10E8; - s32 field_10EC; + Mtx* field_10C4; + Mtx* field_10C8; + Mtxf* field_10CC; + s32 field_10D0; // ptr + Mtxf* field_10D4; + Mtx* projmatrix; + Mtxf* projmatrixf; + s32 field_10E0; // ptr + s32 field_10E4; // ptr + Mtxf* field_10E8; + Mtxf* field_10EC; f32 c_scalelod60; f32 c_scalelod; f32 c_lodscalez; u32 c_lodscalezu32; - struct xyzpoint c_cameratopnorm; - struct xyzpoint c_cameraleftnorm; - + struct coord c_cameratopnorm; + struct coord c_cameraleftnorm; f32 screenxminf; f32 screenyminf; f32 screenxmaxf; @@ -1004,9 +972,9 @@ struct Player s32 field_1268; s32 field_126C; s32 field_1270; - s32 field_1274; - s32 field_1278; - s32 field_127C; + f32 swaytarget; + f32 field_1278; + f32 field_127C; s32 field_1280; s32 players_cur_animation; s32 field_1288; @@ -2498,7 +2466,7 @@ struct Player s32 field_29B4; s32 field_29B8; s32 field_29BC; - s32 field_29C0; + f32 field_29C0; s32 mpmenuon; s32 mpmenumode; s32 mpquitconfirm; @@ -2513,11 +2481,11 @@ struct Player s32 field_29F0; s32 field_29F4; s32 field_29F8; - s32 field_29FC; + s32 autocrouchpos; s32 healthdisplaytime; s16 field_2A04; - s32 field_2A08; - s32 field_2A0C; + f32 field_2A08; + f32 field_2A0C; s32 ptr_text_first_mp_award; s32 ptr_text_second_mp_award; s32 field_2A18; @@ -2873,4 +2841,6 @@ void sub_GAME_7F07E46C(f32 param); void trigger_watch_zoom(f32 final, f32 time); +struct prop* get_curplayer_positiondata(void); + #endif diff --git a/src/game/bondinv.c b/src/game/bondinv.c index 989c0451..c9a9cfdc 100644 --- a/src/game/bondinv.c +++ b/src/game/bondinv.c @@ -288,7 +288,7 @@ s32 check_if_item_for_hand_available(ITEM_IDS item,int hand) { #ifdef VERSION_US if (((pPlayer->equipallguns && (item < ITEM_BOMBCASE)) && - (item == hand)) && ((get_num_players() == 1 && + (item == hand)) && ((getPlayerCount() == 1 && (bondwalkItemCheckBitflags(item,0x100000) != 0)))) { return 1; @@ -303,7 +303,7 @@ s32 check_if_item_for_hand_available(ITEM_IDS item,int hand) else { if ((((pPlayer->equipallguns != 0) && (item < ITEM_BOMBCASE)) && - (item == hand)) && (((get_num_players() == 1 && + (item == hand)) && (((getPlayerCount() == 1 && (bondwalkItemCheckBitflags(item,0x100000) != 0)) && ((j_text_trigger == 0 || (item != ITEM_KNIFE)))))) { @@ -716,7 +716,7 @@ glabel sub_GAME_7F08C86C /* 0C14CC 7F08C99C 8FA90028 */ lw $t1, 0x28($sp) /* 0C14D0 7F08C9A0 51000051 */ beql $t0, $zero, .L7F08CAE8 /* 0C14D4 7F08C9A4 8FAB0028 */ lw $t3, 0x28($sp) -/* 0C14D8 7F08C9A8 0FC26919 */ jal get_num_players +/* 0C14D8 7F08C9A8 0FC26919 */ jal getPlayerCount /* 0C14DC 7F08C9AC 8D300000 */ lw $s0, ($t1) /* 0C14E0 7F08C9B0 24010001 */ li $at, 1 /* 0C14E4 7F08C9B4 5441001E */ bnel $v0, $at, .L7F08CA30 @@ -914,7 +914,7 @@ glabel sub_GAME_7F08C86C /* 0C1E04 7F08D294 8FA90028 */ lw $t1, 0x28($sp) /* 0C1E08 7F08D298 5100005E */ beql $t0, $zero, .Ljp7F08D414 /* 0C1E0C 7F08D29C 8FAD0028 */ lw $t5, 0x28($sp) -/* 0C1E10 7F08D2A0 0FC26C01 */ jal get_num_players +/* 0C1E10 7F08D2A0 0FC26C01 */ jal getPlayerCount /* 0C1E14 7F08D2A4 8D300000 */ lw $s0, ($t1) /* 0C1E18 7F08D2A8 24010001 */ li $at, 1 /* 0C1E1C 7F08D2AC 14410023 */ bne $v0, $at, .Ljp7F08D33C @@ -1183,7 +1183,7 @@ glabel sub_GAME_7F08CB10 .L7F08CCE4: /* 0C1814 7F08CCE4 1611001E */ bne $s0, $s1, .L7F08CD60 /* 0C1818 7F08CCE8 00000000 */ nop -/* 0C181C 7F08CCEC 0FC26919 */ jal get_num_players +/* 0C181C 7F08CCEC 0FC26919 */ jal getPlayerCount /* 0C1820 7F08CCF0 00000000 */ nop /* 0C1824 7F08CCF4 24010001 */ li $at, 1 /* 0C1828 7F08CCF8 14410052 */ bne $v0, $at, .L7F08CE44 @@ -1222,7 +1222,7 @@ glabel sub_GAME_7F08CB10 /* 0C18A0 7F08CD70 10400018 */ beqz $v0, .L7F08CDD4 /* 0C18A4 7F08CD74 24030021 */ li $v1, 33 .L7F08CD78: -/* 0C18A8 7F08CD78 0FC26919 */ jal get_num_players +/* 0C18A8 7F08CD78 0FC26919 */ jal getPlayerCount /* 0C18AC 7F08CD7C 00000000 */ nop /* 0C18B0 7F08CD80 24010001 */ li $at, 1 /* 0C18B4 7F08CD84 14410010 */ bne $v0, $at, .L7F08CDC8 @@ -1436,7 +1436,7 @@ glabel sub_GAME_7F08CB10 .Ljp7F08D614: /* 0C2184 7F08D614 16110024 */ bne $s0, $s1, .Ljp7F08D6A8 /* 0C2188 7F08D618 00000000 */ nop -/* 0C218C 7F08D61C 0FC26C01 */ jal get_num_players +/* 0C218C 7F08D61C 0FC26C01 */ jal getPlayerCount /* 0C2190 7F08D620 00000000 */ nop /* 0C2194 7F08D624 24010001 */ li $at, 1 /* 0C2198 7F08D628 1441005F */ bne $v0, $at, .Ljp7F08D7A8 @@ -1490,7 +1490,7 @@ glabel sub_GAME_7F08CB10 /* 0C2244 7F08D6D4 52010019 */ beql $s0, $at, .Ljp7F08D73C /* 0C2248 7F08D6D8 260E0020 */ addiu $t6, $s0, 0x20 .Ljp7F08D6DC: -/* 0C224C 7F08D6DC 0FC26C01 */ jal get_num_players +/* 0C224C 7F08D6DC 0FC26C01 */ jal getPlayerCount /* 0C2250 7F08D6E0 00000000 */ nop /* 0C2254 7F08D6E4 24010001 */ li $at, 1 /* 0C2258 7F08D6E8 14410010 */ bne $v0, $at, .Ljp7F08D72C diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 4f6ff45a..dce201b3 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -2201,7 +2201,7 @@ glabel likely_change_weapon_in_hand /* 092064 7F05D534 8C4F0890 */ lw $t7, 0x890($v0) /* 092068 7F05D538 AC4F08B0 */ sw $t7, 0x8b0($v0) /* 09206C 7F05D53C AFA7001C */ sw $a3, 0x1c($sp) -/* 092070 7F05D540 0FC26919 */ jal get_num_players +/* 092070 7F05D540 0FC26919 */ jal getPlayerCount /* 092074 7F05D544 AFA40020 */ sw $a0, 0x20($sp) /* 092078 7F05D548 3C088008 */ lui $t0, %hi(pPlayer) /* 09207C 7F05D54C 24010001 */ li $at, 1 @@ -2650,7 +2650,7 @@ glabel remove_hands_item /* 092740 7F05DC10 01706021 */ addu $t4, $t3, $s0 /* 092744 7F05DC14 AD860878 */ sw $a2, 0x878($t4) .L7F05DC18: -/* 092748 7F05DC18 0FC26919 */ jal get_num_players +/* 092748 7F05DC18 0FC26919 */ jal getPlayerCount /* 09274C 7F05DC1C 00000000 */ nop /* 092750 7F05DC20 28410002 */ slti $at, $v0, 2 /* 092754 7F05DC24 14200003 */ bnez $at, .L7F05DC34 @@ -3846,7 +3846,7 @@ glabel sub_GAME_7F05EE24 /* 093990 7F05EE60 27A50088 */ addiu $a1, $sp, 0x88 /* 093994 7F05EE64 0FC1A073 */ jal sub_GAME_7F0681CC /* 093998 7F05EE68 8FA60140 */ lw $a2, 0x140($sp) -/* 09399C 7F05EE6C 0FC1E111 */ jal sub_GAME_7F078444 +/* 09399C 7F05EE6C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0939A0 7F05EE70 00000000 */ nop /* 0939A4 7F05EE74 00402025 */ move $a0, $v0 /* 0939A8 7F05EE78 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place @@ -4028,7 +4028,7 @@ glabel sub_GAME_7F05F09C /* 093BF8 7F05F0C8 27A50078 */ addiu $a1, $sp, 0x78 /* 093BFC 7F05F0CC 0FC1A073 */ jal sub_GAME_7F0681CC /* 093C00 7F05F0D0 8FA60130 */ lw $a2, 0x130($sp) -/* 093C04 7F05F0D4 0FC1E111 */ jal sub_GAME_7F078444 +/* 093C04 7F05F0D4 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 093C08 7F05F0D8 00000000 */ nop /* 093C0C 7F05F0DC 00402025 */ move $a0, $v0 /* 093C10 7F05F0E0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place @@ -4319,7 +4319,7 @@ glabel generate_player_thrown_object /* 093EE8 7F05F3B8 27A50088 */ addiu $a1, $sp, 0x88 /* 093EEC 7F05F3BC 0FC1A073 */ jal sub_GAME_7F0681CC /* 093EF0 7F05F3C0 8FA60140 */ lw $a2, 0x140($sp) -/* 093EF4 7F05F3C4 0FC1E111 */ jal sub_GAME_7F078444 +/* 093EF4 7F05F3C4 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 093EF8 7F05F3C8 00000000 */ nop /* 093EFC 7F05F3CC 00402025 */ move $a0, $v0 /* 093F00 7F05F3D0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place @@ -4464,7 +4464,7 @@ create_instance: /* 0940F8 7F05F5C8 01200008 */ jr $t1 /* 0940FC 7F05F5CC 00000000 */ nop generate_temp_remote_mine: -/* 094100 7F05F5D0 0FC26919 */ jal get_num_players +/* 094100 7F05F5D0 0FC26919 */ jal getPlayerCount /* 094104 7F05F5D4 00000000 */ nop /* 094108 7F05F5D8 24010001 */ li $at, 1 /* 09410C 7F05F5DC 14410004 */ bne $v0, $at, .L7F05F5F0 @@ -4476,7 +4476,7 @@ generate_temp_remote_mine: /* 094120 7F05F5F0 10000024 */ b .L7F05F684 /* 094124 7F05F5F4 A60B0082 */ sh $t3, 0x82($s0) generate_temp_proximity_mine: -/* 094128 7F05F5F8 0FC26919 */ jal get_num_players +/* 094128 7F05F5F8 0FC26919 */ jal getPlayerCount /* 09412C 7F05F5FC 00000000 */ nop /* 094130 7F05F600 24010001 */ li $at, 1 /* 094134 7F05F604 14410004 */ bne $v0, $at, .L7F05F618 @@ -4488,7 +4488,7 @@ generate_temp_proximity_mine: /* 094148 7F05F618 1000001A */ b .L7F05F684 /* 09414C 7F05F61C A60D0082 */ sh $t5, 0x82($s0) generate_temp_timed_mine: -/* 094150 7F05F620 0FC26919 */ jal get_num_players +/* 094150 7F05F620 0FC26919 */ jal getPlayerCount /* 094154 7F05F624 00000000 */ nop /* 094158 7F05F628 24010001 */ li $at, 1 /* 09415C 7F05F62C 14410004 */ bne $v0, $at, .L7F05F640 @@ -4500,7 +4500,7 @@ generate_temp_timed_mine: /* 094170 7F05F640 10000010 */ b .L7F05F684 /* 094174 7F05F644 A60F0082 */ sh $t7, 0x82($s0) generate_temp_bombcase: -/* 094178 7F05F648 0FC26919 */ jal get_num_players +/* 094178 7F05F648 0FC26919 */ jal getPlayerCount /* 09417C 7F05F64C 00000000 */ nop /* 094180 7F05F650 24010001 */ li $at, 1 /* 094184 7F05F654 14410004 */ bne $v0, $at, .L7F05F668 @@ -4616,7 +4616,7 @@ glabel sub_GAME_7F05F73C /* 0942C8 7F05F798 27A50038 */ addiu $a1, $sp, 0x38 /* 0942CC 7F05F79C 0FC1A073 */ jal sub_GAME_7F0681CC /* 0942D0 7F05F7A0 8FA600E8 */ lw $a2, 0xe8($sp) -/* 0942D4 7F05F7A4 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -4792,7 +4792,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 get_BONDdata_field_10CC +/* 09454C 7F05FA1C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 094550 7F05FA20 00000000 */ nop /* 094554 7F05FA24 00402025 */ move $a0, $v0 /* 094558 7F05FA28 02402825 */ move $a1, $s2 @@ -4975,7 +4975,7 @@ glabel sub_GAME_7F05FB64 .L7F05FC10: /* 094740 7F05FC10 0FC1A064 */ jal sub_GAME_7F068190 /* 094744 7F05FC14 27A5004C */ addiu $a1, $sp, 0x4c -/* 094748 7F05FC18 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -5038,7 +5038,7 @@ glabel sub_GAME_7F05FB64 /* 094830 7F05FD00 8C480014 */ lw $t0, 0x14($v0) /* 094834 7F05FD04 8D09000C */ lw $t1, 0xc($t0) /* 094838 7F05FD08 C52A0138 */ lwc1 $f10, 0x138($t1) -/* 09483C 7F05FD0C 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -5060,7 +5060,7 @@ glabel sub_GAME_7F05FB64 .L7F05FD50: /* 094880 7F05FD50 0FC1A073 */ jal sub_GAME_7F0681CC /* 094884 7F05FD54 8FA60108 */ lw $a2, 0x108($sp) -/* 094888 7F05FD58 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -6077,7 +6077,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095674 7F060B44 C60600DC */ lwc1 $f6, 0xdc($s0) /* 095678 7F060B48 E7A60020 */ swc1 $f6, 0x20($sp) /* 09567C 7F060B4C C60A00E0 */ lwc1 $f10, 0xe0($s0) -/* 095680 7F060B50 0FC16642 */ jal sub_GAME_7F059908 +/* 095680 7F060B50 0FC16642 */ jal matrix_4x4_7F059908 /* 095684 7F060B54 E7AA0024 */ swc1 $f10, 0x24($sp) /* 095688 7F060B58 27A401A4 */ addiu $a0, $sp, 0x1a4 /* 09568C 7F060B5C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -6114,7 +6114,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095708 7F060BD8 AFA40040 */ sw $a0, 0x40($sp) /* 09570C 7F060BDC 0FC16008 */ jal matrix_4x4_copy /* 095710 7F060BE0 260502A8 */ addiu $a1, $s0, 0x2a8 -/* 095714 7F060BE4 0FC1E111 */ jal sub_GAME_7F078444 +/* 095714 7F060BE4 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 095718 7F060BE8 00000000 */ nop /* 09571C 7F060BEC 00402025 */ move $a0, $v0 /* 095720 7F060BF0 8FA50044 */ lw $a1, 0x44($sp) @@ -6466,7 +6466,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095C2C 7F0610FC C7B20258 */ lwc1 $f18, 0x258($sp) /* 095C30 7F061100 E61202EC */ swc1 $f18, 0x2ec($s0) /* 095C34 7F061104 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 095C38 7F061108 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -6577,7 +6577,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095DE0 7F0612B0 46128281 */ sub.s $f10, $f16, $f18 /* 095DE4 7F0612B4 44074000 */ mfc1 $a3, $f8 /* 095DE8 7F0612B8 24050000 */ li $a1, 0 -/* 095DEC 7F0612BC 0FC166D6 */ jal sub_GAME_7F059B58 +/* 095DEC 7F0612BC 0FC166D6 */ jal matrix_4x4_7F059B58 /* 095DF0 7F0612C0 E7AA0010 */ swc1 $f10, 0x10($sp) /* 095DF4 7F0612C4 27A40114 */ addiu $a0, $sp, 0x114 /* 095DF8 7F0612C8 0FC1601A */ jal matrix_4x4_multiply_in_place @@ -6700,7 +6700,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095FC4 7F061494 46088101 */ sub.s $f4, $f16, $f8 /* 095FC8 7F061498 44073000 */ mfc1 $a3, $f6 /* 095FCC 7F06149C 24050000 */ li $a1, 0 -/* 095FD0 7F0614A0 0FC166D6 */ jal sub_GAME_7F059B58 +/* 095FD0 7F0614A0 0FC166D6 */ jal matrix_4x4_7F059B58 /* 095FD4 7F0614A4 E7A40010 */ swc1 $f4, 0x10($sp) /* 095FD8 7F0614A8 27A40114 */ addiu $a0, $sp, 0x114 /* 095FDC 7F0614AC 0FC1601A */ jal matrix_4x4_multiply_in_place @@ -7861,7 +7861,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095BD4 7F061064 C60600DC */ lwc1 $f6, 0xdc($s0) /* 095BD8 7F061068 E7A60020 */ swc1 $f6, 0x20($sp) /* 095BDC 7F06106C C60A00E0 */ lwc1 $f10, 0xe0($s0) -/* 095BE0 7F061070 0FC1678A */ jal sub_GAME_7F059908 +/* 095BE0 7F061070 0FC1678A */ jal matrix_4x4_7F059908 /* 095BE4 7F061074 E7AA0024 */ swc1 $f10, 0x24($sp) /* 095BE8 7F061078 27A401A4 */ addiu $a0, $sp, 0x1a4 /* 095BEC 7F06107C 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -7898,7 +7898,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095C68 7F0610F8 AFA40040 */ sw $a0, 0x40($sp) /* 095C6C 7F0610FC 0FC16150 */ jal matrix_4x4_copy /* 095C70 7F061100 260502A8 */ addiu $a1, $s0, 0x2a8 -/* 095C74 7F061104 0FC1E28D */ jal sub_GAME_7F078444 +/* 095C74 7F061104 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 095C78 7F061108 00000000 */ nop /* 095C7C 7F06110C 00402025 */ move $a0, $v0 /* 095C80 7F061110 8FA50044 */ lw $a1, 0x44($sp) @@ -8250,7 +8250,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 09618C 7F06161C C7B20258 */ lwc1 $f18, 0x258($sp) /* 096190 7F061620 E61202EC */ swc1 $f18, 0x2ec($s0) /* 096194 7F061624 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 096198 7F061628 0FC1E28D */ jal sub_GAME_7F078444 +/* 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 @@ -8361,7 +8361,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 096340 7F0617D0 46128281 */ sub.s $f10, $f16, $f18 /* 096344 7F0617D4 44074000 */ mfc1 $a3, $f8 /* 096348 7F0617D8 24050000 */ li $a1, 0 -/* 09634C 7F0617DC 0FC1681E */ jal sub_GAME_7F059B58 +/* 09634C 7F0617DC 0FC1681E */ jal matrix_4x4_7F059B58 /* 096350 7F0617E0 E7AA0010 */ swc1 $f10, 0x10($sp) /* 096354 7F0617E4 27A40114 */ addiu $a0, $sp, 0x114 /* 096358 7F0617E8 0FC16162 */ jal matrix_4x4_multiply_in_place @@ -8484,7 +8484,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 096524 7F0619B4 46088101 */ sub.s $f4, $f16, $f8 /* 096528 7F0619B8 44073000 */ mfc1 $a3, $f6 /* 09652C 7F0619BC 24050000 */ li $a1, 0 -/* 096530 7F0619C0 0FC1681E */ jal sub_GAME_7F059B58 +/* 096530 7F0619C0 0FC1681E */ jal matrix_4x4_7F059B58 /* 096534 7F0619C4 E7A40010 */ swc1 $f4, 0x10($sp) /* 096538 7F0619C8 27A40114 */ addiu $a0, $sp, 0x114 /* 09653C 7F0619CC 0FC16162 */ jal matrix_4x4_multiply_in_place @@ -9063,7 +9063,7 @@ glabel sub_GAME_7F061BF4 /* 096754 7F061C24 AFB10018 */ sw $s1, 0x18($sp) /* 096758 7F061C28 01CF8021 */ addu $s0, $t6, $t7 /* 09675C 7F061C2C 00808825 */ move $s1, $a0 -/* 096760 7F061C30 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 096760 7F061C30 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 096764 7F061C34 26100870 */ addiu $s0, $s0, 0x870 /* 096768 7F061C38 C604039C */ lwc1 $f4, 0x39c($s0) /* 09676C 7F061C3C C4460008 */ lwc1 $f6, 8($v0) @@ -9098,7 +9098,7 @@ glabel sub_GAME_7F061BF4 /* 0967E0 7F061CB0 8F280004 */ lw $t0, 4($t9) /* 0967E4 7F061CB4 51000054 */ beql $t0, $zero, .L7F061E08 /* 0967E8 7F061CB8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0967EC 7F061CBC 0FC26919 */ jal get_num_players +/* 0967EC 7F061CBC 0FC26919 */ jal getPlayerCount /* 0967F0 7F061CC0 00000000 */ nop /* 0967F4 7F061CC4 28410002 */ slti $at, $v0, 2 /* 0967F8 7F061CC8 1420004E */ bnez $at, .L7F061E04 @@ -9272,7 +9272,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 get_BONDdata_field_10CC +/* 096A0C 7F061EDC 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 096A10 7F061EE0 AFAC00B0 */ sw $t4, 0xb0($sp) /* 096A14 7F061EE4 AFA200A8 */ sw $v0, 0xa8($sp) /* 096A18 7F061EE8 82230001 */ lb $v1, 1($s1) @@ -9644,7 +9644,7 @@ glabel sub_GAME_7F061E18 /* 096F98 7F062468 E7AC00A0 */ swc1 $f12, 0xa0($sp) /* 096F9C 7F06246C E7AE00A4 */ swc1 $f14, 0xa4($sp) .L7F062470: -/* 096FA0 7F062470 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -10417,7 +10417,7 @@ glabel sub_GAME_7F062BE4 /* 0979C4 7F062E94 01EA5825 */ or $t3, $t7, $t2 /* 0979C8 7F062E98 AFAB00C0 */ sw $t3, 0xc0($sp) /* 0979CC 7F062E9C AFA00090 */ sw $zero, 0x90($sp) -/* 0979D0 7F062EA0 0FC16319 */ jal sub_GAME_7F058C64 +/* 0979D0 7F062EA0 0FC16319 */ jal matrix_4x4_7F058C64 /* 0979D4 7F062EA4 267102F8 */ addiu $s1, $s3, 0x2f8 /* 0979D8 7F062EA8 24010019 */ li $at, 25 /* 0979DC 7F062EAC 56810011 */ bnel $s4, $at, .L7F062EF4 @@ -10476,7 +10476,7 @@ glabel sub_GAME_7F062BE4 /* 097AA0 7F062F70 8E640304 */ lw $a0, 0x304($s3) /* 097AA4 7F062F74 0FC22F52 */ jal sub_GAME_7F08BD48 /* 097AA8 7F062F78 85A5000E */ lh $a1, 0xe($t5) -/* 097AAC 7F062F7C 0FC16322 */ jal sub_GAME_7F058C88 +/* 097AAC 7F062F7C 0FC16322 */ jal matrix_4x4_7F058C88 /* 097AB0 7F062F80 00000000 */ nop /* 097AB4 7F062F84 3C0CBC00 */ lui $t4, (0xBC00000E >> 16) # lui $t4, 0xbc00 /* 097AB8 7F062F88 358C000E */ ori $t4, (0xBC00000E & 0xFFFF) # ori $t4, $t4, 0xe @@ -10828,7 +10828,7 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097F80 7F063450 0FC1D1A1 */ jal subdraw /* 097F84 7F063454 02602825 */ move $a1, $s3 /* 097F88 7F063458 8FAF0164 */ lw $t7, 0x164($sp) -/* 097F8C 7F06345C 0FC16319 */ jal sub_GAME_7F058C64 +/* 097F8C 7F06345C 0FC16319 */ jal matrix_4x4_7F058C64 /* 097F90 7F063460 AFAF0198 */ sw $t7, 0x198($sp) /* 097F94 7F063464 864E000E */ lh $t6, 0xe($s2) /* 097F98 7F063468 00008025 */ move $s0, $zero @@ -10851,7 +10851,7 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097FD8 7F0634A8 5420FFF3 */ bnezl $at, .L7F063478 /* 097FDC 7F0634AC 8FA90144 */ lw $t1, 0x144($sp) .L7F0634B0: -/* 097FE0 7F0634B0 0FC16322 */ jal sub_GAME_7F058C88 +/* 097FE0 7F0634B0 0FC16322 */ jal matrix_4x4_7F058C88 /* 097FE4 7F0634B4 00000000 */ nop .L7F0634B8: /* 097FE8 7F0634B8 8FA20198 */ lw $v0, 0x198($sp) @@ -11174,7 +11174,7 @@ glabel sub_GAME_7F06359C /* 098324 7F0637F4 0FC1D1A1 */ jal subdraw /* 098328 7F0637F8 27A504D8 */ addiu $a1, $sp, 0x4d8 /* 09832C 7F0637FC 8FB90504 */ lw $t9, 0x504($sp) -/* 098330 7F063800 0FC16319 */ jal sub_GAME_7F058C64 +/* 098330 7F063800 0FC16319 */ jal matrix_4x4_7F058C64 /* 098334 7F063804 AFB90538 */ sw $t9, 0x538($sp) /* 098338 7F063808 8FB803D8 */ lw $t8, 0x3d8($sp) /* 09833C 7F06380C 00008825 */ move $s1, $zero @@ -11200,7 +11200,7 @@ glabel sub_GAME_7F06359C /* 098388 7F063858 5420FFF2 */ bnezl $at, .L7F063824 /* 09838C 7F06385C 8FAF04E4 */ lw $t7, 0x4e4($sp) .L7F063860: -/* 098390 7F063860 0FC16322 */ jal sub_GAME_7F058C88 +/* 098390 7F063860 0FC16322 */ jal matrix_4x4_7F058C88 /* 098394 7F063864 00000000 */ nop /* 098398 7F063868 126002AE */ beqz $s3, .L7F064324 /* 09839C 7F06386C 8FAC03D8 */ lw $t4, 0x3d8($sp) @@ -11247,7 +11247,7 @@ glabel sub_GAME_7F06359C /* 098438 7F063908 E7B80020 */ swc1 $f24, 0x20($sp) /* 09843C 7F06390C E7A00010 */ swc1 $f0, 0x10($sp) /* 098440 7F063910 E7A20018 */ swc1 $f2, 0x18($sp) -/* 098444 7F063914 0FC165A5 */ jal sub_GAME_7F059694 +/* 098444 7F063914 0FC165A5 */ jal matrix_4x4_7F059694 /* 098448 7F063918 E7B00024 */ swc1 $f16, 0x24($sp) /* 09844C 7F06391C 3C01C0A0 */ li $at, 0xC0A00000 # -5.000000 /* 098450 7F063920 44810000 */ mtc1 $at, $f0 @@ -11264,7 +11264,7 @@ glabel sub_GAME_7F06359C /* 09847C 7F06394C E7B80020 */ swc1 $f24, 0x20($sp) /* 098480 7F063950 E7A00010 */ swc1 $f0, 0x10($sp) /* 098484 7F063954 E7A20018 */ swc1 $f2, 0x18($sp) -/* 098488 7F063958 0FC165A5 */ jal sub_GAME_7F059694 +/* 098488 7F063958 0FC165A5 */ jal matrix_4x4_7F059694 /* 09848C 7F06395C E7B20024 */ swc1 $f18, 0x24($sp) /* 098490 7F063960 0FC15FF4 */ jal matrix_4x4_set_identity /* 098494 7F063964 02602025 */ move $a0, $s3 @@ -11894,7 +11894,7 @@ glabel sub_GAME_7F06359C /* 098DE0 7F0642B0 0FC1D1A1 */ jal subdraw /* 098DE4 7F0642B4 AFA90504 */ sw $t1, 0x504($sp) /* 098DE8 7F0642B8 8FAE0504 */ lw $t6, 0x504($sp) -/* 098DEC 7F0642BC 0FC16319 */ jal sub_GAME_7F058C64 +/* 098DEC 7F0642BC 0FC16319 */ jal matrix_4x4_7F058C64 /* 098DF0 7F0642C0 AFAE0538 */ sw $t6, 0x538($sp) /* 098DF4 7F0642C4 8FAB03D8 */ lw $t3, 0x3d8($sp) /* 098DF8 7F0642C8 00008825 */ move $s1, $zero @@ -11920,7 +11920,7 @@ glabel sub_GAME_7F06359C /* 098E44 7F064314 5420FFF2 */ bnezl $at, .L7F0642E0 /* 098E48 7F064318 8FB904E4 */ lw $t9, 0x4e4($sp) .L7F06431C: -/* 098E4C 7F06431C 0FC16322 */ jal sub_GAME_7F058C88 +/* 098E4C 7F06431C 0FC16322 */ jal matrix_4x4_7F058C88 /* 098E50 7F064320 00000000 */ nop .L7F064324: /* 098E54 7F064324 8FA20538 */ lw $v0, 0x538($sp) @@ -13571,7 +13571,7 @@ Weapon_function_camera: /* 09992C 7F064DFC 00002825 */ move $a1, $zero /* 099930 7F064E00 15800005 */ bnez $t4, .L7F064E18 /* 099934 7F064E04 00003025 */ move $a2, $zero -/* 099938 7F064E08 0FC201EC */ jal set_rgba_tint +/* 099938 7F064E08 0FC201EC */ jal currentPlayerSetFadeColour /* 09993C 7F064E0C 3C073F80 */ lui $a3, 0x3f80 /* 099940 7F064E10 10000063 */ b .L7F064FA0 /* 099944 7F064E14 AE000398 */ sw $zero, 0x398($s0) @@ -13584,7 +13584,7 @@ Weapon_function_camera: /* 09995C 7F064E2C 44802000 */ mtc1 $zero, $f4 /* 099960 7F064E30 44816000 */ mtc1 $at, $f12 /* 099964 7F064E34 00003825 */ move $a3, $zero -/* 099968 7F064E38 0FC201F8 */ jal sub_GAME_7F0807E0 +/* 099968 7F064E38 0FC201F8 */ jal currentPlayerAdjustFade /* 09996C 7F064E3C E7A40010 */ swc1 $f4, 0x10($sp) /* 099970 7F064E40 240F0002 */ li $t7, 2 /* 099974 7F064E44 AE0F0024 */ sw $t7, 0x24($s0) @@ -13739,7 +13739,7 @@ Weapon_shooting_pistol: /* 099B68 7F065038 24190003 */ li $t9, 3 /* 099B6C 7F06503C 5560001E */ bnezl $t3, .L7F0650B8 /* 099B70 7F065040 AE190024 */ sw $t9, 0x24($s0) -/* 099B74 7F065044 0FC26919 */ jal get_num_players +/* 099B74 7F065044 0FC26919 */ jal getPlayerCount /* 099B78 7F065048 00000000 */ nop /* 099B7C 7F06504C 24010001 */ li $at, 1 /* 099B80 7F065050 50410009 */ beql $v0, $at, .L7F065078 @@ -13816,7 +13816,7 @@ Weapon_shooting_machinegun: .L7F065150: /* 099C80 7F065150 5700004F */ bnezl $t8, .L7F065290 /* 099C84 7F065154 820F000C */ lb $t7, 0xc($s0) -/* 099C88 7F065158 0FC26919 */ jal get_num_players +/* 099C88 7F065158 0FC26919 */ jal getPlayerCount /* 099C8C 7F06515C 00000000 */ nop /* 099C90 7F065160 24010001 */ li $at, 1 /* 099C94 7F065164 50410009 */ beql $v0, $at, .L7F06518C @@ -13926,7 +13926,7 @@ Weapon_shooting_throwable: /* 099DFC 7F0652CC 8E18002C */ lw $t8, 0x2c($s0) /* 099E00 7F0652D0 0FC26C54 */ jal get_cur_playernum /* 099E04 7F0652D4 00000000 */ nop -/* 099E08 7F0652D8 0FC26919 */ jal get_num_players +/* 099E08 7F0652D8 0FC26919 */ jal getPlayerCount /* 099E0C 7F0652DC AFA20048 */ sw $v0, 0x48($sp) /* 099E10 7F0652E0 8FAE0048 */ lw $t6, 0x48($sp) /* 099E14 7F0652E4 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc @@ -13979,7 +13979,7 @@ Weapon_shooting_throwable: /* 099EC4 7F065394 00000000 */ nop /* 099EC8 7F065398 AFB901B4 */ sw $t9, 0x1b4($sp) .L7F06539C: -/* 099ECC 7F06539C 0FC26919 */ jal get_num_players +/* 099ECC 7F06539C 0FC26919 */ jal getPlayerCount /* 099ED0 7F0653A0 00000000 */ nop /* 099ED4 7F0653A4 24010001 */ li $at, 1 /* 099ED8 7F0653A8 5041000A */ beql $v0, $at, .L7F0653D4 @@ -14081,7 +14081,7 @@ Weapon_shooting_throwable: /* 09A03C 7F06550C AE190024 */ sw $t9, 0x24($s0) .L7F065510: /* 09A040 7F065510 AE000020 */ sw $zero, 0x20($s0) -/* 09A044 7F065514 0FC26919 */ jal get_num_players +/* 09A044 7F065514 0FC26919 */ jal getPlayerCount /* 09A048 7F065518 AE00001C */ sw $zero, 0x1c($s0) /* 09A04C 7F06551C 24010001 */ li $at, 1 /* 09A050 7F065520 10410004 */ beq $v0, $at, .L7F065534 @@ -14441,7 +14441,7 @@ Weapon_shooting_throwable: /* 09A584 7F065A54 24040010 */ li $a0, 16 /* 09A588 7F065A58 54A2005E */ bnel $a1, $v0, .L7F065BD4 /* 09A58C 7F065A5C 24060006 */ li $a2, 6 -/* 09A590 7F065A60 0FC26919 */ jal get_num_players +/* 09A590 7F065A60 0FC26919 */ jal getPlayerCount /* 09A594 7F065A64 AFA40188 */ sw $a0, 0x188($sp) /* 09A598 7F065A68 28410002 */ slti $at, $v0, 2 /* 09A59C 7F065A6C 14200002 */ bnez $at, .L7F065A78 @@ -14451,7 +14451,7 @@ Weapon_shooting_throwable: /* 09A5A8 7F065A78 8E19001C */ lw $t9, 0x1c($s0) /* 09A5AC 7F065A7C 5720000C */ bnezl $t9, .L7F065AB0 /* 09A5B0 7F065A80 8E030020 */ lw $v1, 0x20($s0) -/* 09A5B4 7F065A84 0FC26919 */ jal get_num_players +/* 09A5B4 7F065A84 0FC26919 */ jal getPlayerCount /* 09A5B8 7F065A88 AFA40188 */ sw $a0, 0x188($sp) /* 09A5BC 7F065A8C 24010001 */ li $at, 1 /* 09A5C0 7F065A90 14410004 */ bne $v0, $at, .L7F065AA4 @@ -14478,7 +14478,7 @@ Weapon_shooting_throwable: /* 09A608 7F065AD8 8C6F1130 */ lw $t7, 0x1130($v1) /* 09A60C 7F065ADC 01F8C821 */ addu $t9, $t7, $t8 /* 09A610 7F065AE0 AC791130 */ sw $t9, 0x1130($v1) -/* 09A614 7F065AE4 0FC26919 */ jal get_num_players +/* 09A614 7F065AE4 0FC26919 */ jal getPlayerCount /* 09A618 7F065AE8 AE00002C */ sw $zero, 0x2c($s0) /* 09A61C 7F065AEC 28410002 */ slti $at, $v0, 2 /* 09A620 7F065AF0 14200003 */ bnez $at, .L7F065B00 @@ -14661,7 +14661,7 @@ Weapon_shooting_throwable: .L7F065D78: /* 09A8A8 7F065D78 14410088 */ bne $v0, $at, .L7F065F9C /* 09A8AC 7F065D7C 240C0017 */ li $t4, 23 -/* 09A8B0 7F065D80 0FC26919 */ jal get_num_players +/* 09A8B0 7F065D80 0FC26919 */ jal getPlayerCount /* 09A8B4 7F065D84 AFAC0178 */ sw $t4, 0x178($sp) /* 09A8B8 7F065D88 28410002 */ slti $at, $v0, 2 /* 09A8BC 7F065D8C 14200002 */ bnez $at, .L7F065D98 @@ -14671,7 +14671,7 @@ Weapon_shooting_throwable: /* 09A8C8 7F065D98 8E0E001C */ lw $t6, 0x1c($s0) /* 09A8CC 7F065D9C 55C00048 */ bnezl $t6, .L7F065EC0 /* 09A8D0 7F065DA0 8E0E0020 */ lw $t6, 0x20($s0) -/* 09A8D4 7F065DA4 0FC26919 */ jal get_num_players +/* 09A8D4 7F065DA4 0FC26919 */ jal getPlayerCount /* 09A8D8 7F065DA8 00000000 */ nop /* 09A8DC 7F065DAC 28410002 */ slti $at, $v0, 2 /* 09A8E0 7F065DB0 14200003 */ bnez $at, .L7F065DC0 @@ -15245,7 +15245,7 @@ weapon_reload_none_sfx: /* 09B0EC 7F0665BC 8E0D0020 */ lw $t5, 0x20($s0) /* 09B0F0 7F0665C0 5020000E */ beql $at, $zero, .L7F0665FC /* 09B0F4 7F0665C4 8E0D0020 */ lw $t5, 0x20($s0) -/* 09B0F8 7F0665C8 0FC26919 */ jal get_num_players +/* 09B0F8 7F0665C8 0FC26919 */ jal getPlayerCount /* 09B0FC 7F0665CC 00000000 */ nop /* 09B100 7F0665D0 28410002 */ slti $at, $v0, 2 /* 09B104 7F0665D4 14200003 */ bnez $at, .L7F0665E4 @@ -16417,7 +16417,7 @@ Weapon_function_camera: /* 099F00 7F065390 00002825 */ move $a1, $zero /* 099F04 7F065394 15C00005 */ bnez $t6, .Ljp7F0653AC /* 099F08 7F065398 00003025 */ move $a2, $zero -/* 099F0C 7F06539C 0FC20370 */ jal set_rgba_tint +/* 099F0C 7F06539C 0FC20370 */ jal currentPlayerSetFadeColour /* 099F10 7F0653A0 3C073F80 */ lui $a3, 0x3f80 /* 099F14 7F0653A4 10000063 */ b .Ljp7F065534 /* 099F18 7F0653A8 AE000398 */ sw $zero, 0x398($s0) @@ -16430,7 +16430,7 @@ Weapon_function_camera: /* 099F30 7F0653C0 44802000 */ mtc1 $zero, $f4 /* 099F34 7F0653C4 44816000 */ mtc1 $at, $f12 /* 099F38 7F0653C8 00003825 */ move $a3, $zero -/* 099F3C 7F0653CC 0FC2037C */ jal sub_GAME_7F0807E0 +/* 099F3C 7F0653CC 0FC2037C */ jal currentPlayerAdjustFade /* 099F40 7F0653D0 E7A40010 */ swc1 $f4, 0x10($sp) /* 099F44 7F0653D4 240F0002 */ li $t7, 2 /* 099F48 7F0653D8 AE0F0024 */ sw $t7, 0x24($s0) @@ -16584,7 +16584,7 @@ Weapon_shooting_pistol: /* 09A13C 7F0655CC 24190003 */ li $t9, 3 /* 09A140 7F0655D0 5700001E */ bnezl $t8, .Ljp7F06564C /* 09A144 7F0655D4 AE190024 */ sw $t9, 0x24($s0) -/* 09A148 7F0655D8 0FC26C01 */ jal get_num_players +/* 09A148 7F0655D8 0FC26C01 */ jal getPlayerCount /* 09A14C 7F0655DC 00000000 */ nop /* 09A150 7F0655E0 24010001 */ li $at, 1 /* 09A154 7F0655E4 50410009 */ beql $v0, $at, .Ljp7F06560C @@ -16661,7 +16661,7 @@ Weapon_shooting_machinegun: .Ljp7F0656E4: /* 09A254 7F0656E4 5700004F */ bnezl $t8, .Ljp7F065824 /* 09A258 7F0656E8 820F000C */ lb $t7, 0xc($s0) -/* 09A25C 7F0656EC 0FC26C01 */ jal get_num_players +/* 09A25C 7F0656EC 0FC26C01 */ jal getPlayerCount /* 09A260 7F0656F0 00000000 */ nop /* 09A264 7F0656F4 24010001 */ li $at, 1 /* 09A268 7F0656F8 50410009 */ beql $v0, $at, .Ljp7F065720 @@ -16770,7 +16770,7 @@ Weapon_shooting_throwable: /* 09A3D0 7F065860 8E0E002C */ lw $t6, 0x2c($s0) /* 09A3D4 7F065864 0FC26F3C */ jal get_cur_playernum /* 09A3D8 7F065868 00000000 */ nop -/* 09A3DC 7F06586C 0FC26C01 */ jal get_num_players +/* 09A3DC 7F06586C 0FC26C01 */ jal getPlayerCount /* 09A3E0 7F065870 AFA2004C */ sw $v0, 0x4c($sp) /* 09A3E4 7F065874 8FB8004C */ lw $t8, 0x4c($sp) /* 09A3E8 7F065878 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc @@ -16823,7 +16823,7 @@ Weapon_shooting_throwable: /* 09A498 7F065928 00000000 */ nop /* 09A49C 7F06592C AFB801C4 */ sw $t8, 0x1c4($sp) .Ljp7F065930: -/* 09A4A0 7F065930 0FC26C01 */ jal get_num_players +/* 09A4A0 7F065930 0FC26C01 */ jal getPlayerCount /* 09A4A4 7F065934 00000000 */ nop /* 09A4A8 7F065938 24010001 */ li $at, 1 /* 09A4AC 7F06593C 5041000A */ beql $v0, $at, .Ljp7F065968 @@ -16925,7 +16925,7 @@ Weapon_shooting_throwable: /* 09A610 7F065AA0 AE0F0024 */ sw $t7, 0x24($s0) .Ljp7F065AA4: /* 09A614 7F065AA4 AE000020 */ sw $zero, 0x20($s0) -/* 09A618 7F065AA8 0FC26C01 */ jal get_num_players +/* 09A618 7F065AA8 0FC26C01 */ jal getPlayerCount /* 09A61C 7F065AAC AE00001C */ sw $zero, 0x1c($s0) /* 09A620 7F065AB0 24010001 */ li $at, 1 /* 09A624 7F065AB4 10410008 */ beq $v0, $at, .Ljp7F065AD8 @@ -17289,7 +17289,7 @@ Weapon_shooting_throwable: /* 09AB68 7F065FF8 24040010 */ li $a0, 16 /* 09AB6C 7F065FFC 54A2005E */ bnel $a1, $v0, .Ljp7F066178 /* 09AB70 7F066000 24060006 */ li $a2, 6 -/* 09AB74 7F066004 0FC26C01 */ jal get_num_players +/* 09AB74 7F066004 0FC26C01 */ jal getPlayerCount /* 09AB78 7F066008 AFA4018C */ sw $a0, 0x18c($sp) /* 09AB7C 7F06600C 28410002 */ slti $at, $v0, 2 /* 09AB80 7F066010 14200002 */ bnez $at, .Ljp7F06601C @@ -17299,7 +17299,7 @@ Weapon_shooting_throwable: /* 09AB8C 7F06601C 8E18001C */ lw $t8, 0x1c($s0) /* 09AB90 7F066020 5700000C */ bnezl $t8, .Ljp7F066054 /* 09AB94 7F066024 8E030020 */ lw $v1, 0x20($s0) -/* 09AB98 7F066028 0FC26C01 */ jal get_num_players +/* 09AB98 7F066028 0FC26C01 */ jal getPlayerCount /* 09AB9C 7F06602C AFA4018C */ sw $a0, 0x18c($sp) /* 09ABA0 7F066030 24010001 */ li $at, 1 /* 09ABA4 7F066034 14410004 */ bne $v0, $at, .Ljp7F066048 @@ -17326,7 +17326,7 @@ Weapon_shooting_throwable: /* 09ABEC 7F06607C 8C6E1130 */ lw $t6, 0x1130($v1) /* 09ABF0 7F066080 01CFC821 */ addu $t9, $t6, $t7 /* 09ABF4 7F066084 AC791130 */ sw $t9, 0x1130($v1) -/* 09ABF8 7F066088 0FC26C01 */ jal get_num_players +/* 09ABF8 7F066088 0FC26C01 */ jal getPlayerCount /* 09ABFC 7F06608C AE00002C */ sw $zero, 0x2c($s0) /* 09AC00 7F066090 28410002 */ slti $at, $v0, 2 /* 09AC04 7F066094 14200003 */ bnez $at, .Ljp7F0660A4 @@ -17509,7 +17509,7 @@ Weapon_shooting_throwable: .Ljp7F06631C: /* 09AE8C 7F06631C 1441008D */ bne $v0, $at, .Ljp7F066554 /* 09AE90 7F066320 24190017 */ li $t9, 23 -/* 09AE94 7F066324 0FC26C01 */ jal get_num_players +/* 09AE94 7F066324 0FC26C01 */ jal getPlayerCount /* 09AE98 7F066328 AFB9017C */ sw $t9, 0x17c($sp) /* 09AE9C 7F06632C 28410002 */ slti $at, $v0, 2 /* 09AEA0 7F066330 14200002 */ bnez $at, .Ljp7F06633C @@ -17519,7 +17519,7 @@ Weapon_shooting_throwable: /* 09AEAC 7F06633C 8E0E001C */ lw $t6, 0x1c($s0) /* 09AEB0 7F066340 55C0004D */ bnezl $t6, .Ljp7F066478 /* 09AEB4 7F066344 8E0F0020 */ lw $t7, 0x20($s0) -/* 09AEB8 7F066348 0FC26C01 */ jal get_num_players +/* 09AEB8 7F066348 0FC26C01 */ jal getPlayerCount /* 09AEBC 7F06634C 00000000 */ nop /* 09AEC0 7F066350 28410002 */ slti $at, $v0, 2 /* 09AEC4 7F066354 14200003 */ bnez $at, .Ljp7F066364 @@ -18103,7 +18103,7 @@ weapon_reload_none_sfx: /* 09B704 7F066B94 8E0F0020 */ lw $t7, 0x20($s0) /* 09B708 7F066B98 5020000E */ beql $at, $zero, .Ljp7F066BD4 /* 09B70C 7F066B9C 8E0F0020 */ lw $t7, 0x20($s0) -/* 09B710 7F066BA0 0FC26C01 */ jal get_num_players +/* 09B710 7F066BA0 0FC26C01 */ jal getPlayerCount /* 09B714 7F066BA4 00000000 */ nop /* 09B718 7F066BA8 28410002 */ slti $at, $v0, 2 /* 09B71C 7F066BAC 14200003 */ bnez $at, .Ljp7F066BBC @@ -19612,7 +19612,7 @@ void sub_GAME_7F067AA4(s32 param_1) } -void sub_GAME_7F067AB4(struct xyzpoint *param_1) +void sub_GAME_7F067AB4(struct coord *param_1) { pPlayer->hands[RIGHT_HAND].field_A38 = sub_GAME_7F05DCB8(RIGHT_HAND) + param_1->x; pPlayer->hands[RIGHT_HAND].field_A3C = param_1->y; @@ -20219,7 +20219,7 @@ void sub_GAME_7F0681CC(void *arg0, s32 arg1, s32 arg2) { } } // Node 3 - sp24 = (f32) ((120.0f * sp28) / video_related_23()); + sp24 = (f32) ((120.0f * sp28) / viGetFovY()); sp1C = get_random_value(); temp_ret = get_random_value(); temp_f10 = (f32) sp1C; @@ -20312,7 +20312,7 @@ glabel sub_GAME_7F0681CC /* 09CD8C 7F06825C 46083282 */ mul.s $f10, $f6, $f8 /* 09CD90 7F068260 E7AA0028 */ swc1 $f10, 0x28($sp) .L7F068264: -/* 09CD94 7F068264 0C001177 */ jal video_related_23 +/* 09CD94 7F068264 0C001177 */ jal viGetFovY /* 09CD98 7F068268 00000000 */ nop /* 09CD9C 7F06826C 3C0142F0 */ li $at, 0x42F00000 # 120.000000 /* 09CDA0 7F068270 44818000 */ mtc1 $at, $f16 @@ -20624,7 +20624,7 @@ glabel sub_GAME_7F068508 /* 09D060 7F068530 8C430028 */ lw $v1, 0x28($v0) /* 09D064 7F068534 506001F6 */ beql $v1, $zero, .L7F068D10 /* 09D068 7F068538 8FBF001C */ lw $ra, 0x1c($sp) -/* 09D06C 7F06853C 0FC26919 */ jal get_num_players +/* 09D06C 7F06853C 0FC26919 */ jal getPlayerCount /* 09D070 7F068540 AFA30070 */ sw $v1, 0x70($sp) /* 09D074 7F068544 28410002 */ slti $at, $v0, 2 /* 09D078 7F068548 102001F0 */ beqz $at, .L7F068D0C @@ -21469,7 +21469,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 get_BONDdata_field_10CC +/* 09DABC 7F068F8C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 09DAC0 7F068F90 00000000 */ nop /* 09DAC4 7F068F94 00402025 */ move $a0, $v0 /* 09DAC8 7F068F98 27A5003C */ addiu $a1, $sp, 0x3c @@ -22949,7 +22949,7 @@ s32 generate_ammo_total_microcode(s32 arg0) { // Node 2 sp64 = get_item_in_hand(1); sp60 = get_item_in_hand(0); - if (get_num_players() < 3) + if (getPlayerCount() < 3) { // Node 3 sp58 = 0x3b; @@ -22998,8 +22998,8 @@ s32 generate_ammo_total_microcode(s32 arg0) { sp48 = (void *) (temp_v1->unk4 + globalbank_rdram_offset); sp30 = getPlayer_c_screenleft(); sp34 = getPlayer_c_screenwidth(); - sp38 = get_video2_settings_uly(); - arg0 = set_rgba_redirect_generate_microcode(arg0, sp48, ((sp34 + sp30) - (f32) sp54), 0xbf800000, (f32) ((get_video2_settings_height() + sp38) + -0x14), 0, (f32) sp28->unk8, 1); + sp38 = viGetViewTop(); + arg0 = set_rgba_redirect_generate_microcode(arg0, sp48, ((sp34 + sp30) - (f32) sp54), 0xbf800000, (f32) ((viGetViewHeight() + sp38) + -0x14), 0, (f32) sp28->unk8, 1); sp44 = (s32) sp48->unk4; } // Node 14 @@ -23028,10 +23028,10 @@ s32 generate_ammo_total_microcode(s32 arg0) { if (bondwalkItemCheckBitflags(sp60, 0x400000) == 0) { // Node 20 - sp2C = get_video2_settings_ulx(); - sp2E = get_video2_settings_width(); - sp38 = get_video2_settings_uly(); - get_video2_settings_height(); + sp2C = viGetViewLeft(); + sp2E = viGetViewWidth(); + sp38 = viGetViewTop(); + viGetViewHeight(); phi_t9 = (sp44 >> 1); if (sp44 < 0) { @@ -23045,10 +23045,10 @@ s32 generate_ammo_total_microcode(s32 arg0) { if ((sp50 > 0) || (bondwalkItemCheckBitflags(sp60, 0x400000) != 0)) { // Node 25 - sp2C = get_video2_settings_ulx(); - sp2E = get_video2_settings_width(); - sp38 = get_video2_settings_uly(); - get_video2_settings_height(); + sp2C = viGetViewLeft(); + sp2E = viGetViewWidth(); + sp38 = viGetViewTop(); + viGetViewHeight(); temp_t3 = (sp44 + 1); phi_t0 = (temp_t3 >> 1); if (temp_t3 < 0) @@ -23096,8 +23096,8 @@ s32 generate_ammo_total_microcode(s32 arg0) { sp28 = temp_v1_2; sp40 = (void *) (temp_v1_2->unk4 + globalbank_rdram_offset); sp34 = getPlayer_c_screenleft(); - sp38 = get_video2_settings_uly(); - get_video2_settings_height(); + sp38 = viGetViewTop(); + viGetViewHeight(); arg0 = set_rgba_redirect_generate_microcode(sp28->unk8, arg0, sp40, (sp34 + (f32) sp58), 0xbf800000, 1, 1); sp3C = (s32) sp40->unk4; } @@ -23127,9 +23127,9 @@ s32 generate_ammo_total_microcode(s32 arg0) { if (bondwalkItemCheckBitflags(sp64, 0x400000) == 0) { // Node 42 - sp2E = get_video2_settings_ulx(); - sp38 = get_video2_settings_uly(); - get_video2_settings_height(); + sp2E = viGetViewLeft(); + sp38 = viGetViewTop(); + viGetViewHeight(); phi_t3 = (sp3C >> 1); if (sp3C < 0) { @@ -23143,9 +23143,9 @@ s32 generate_ammo_total_microcode(s32 arg0) { if ((sp50 > 0) || (bondwalkItemCheckBitflags(sp64, 0x400000) != 0)) { // Node 47 - sp2E = get_video2_settings_ulx(); - sp38 = get_video2_settings_uly(); - get_video2_settings_height(); + sp2E = viGetViewLeft(); + sp38 = viGetViewTop(); + viGetViewHeight(); temp_t1 = (sp3C + 1); phi_t0_2 = (temp_t1 >> 1); if (temp_t1 < 0) @@ -23192,7 +23192,7 @@ glabel generate_ammo_total_microcode /* 09E858 7F069D28 AFA20064 */ sw $v0, 0x64($sp) /* 09E85C 7F069D2C 0FC17674 */ jal get_item_in_hand /* 09E860 7F069D30 00002025 */ move $a0, $zero -/* 09E864 7F069D34 0FC26919 */ jal get_num_players +/* 09E864 7F069D34 0FC26919 */ jal getPlayerCount /* 09E868 7F069D38 AFA20060 */ sw $v0, 0x60($sp) /* 09E86C 7F069D3C 28410003 */ slti $at, $v0, 3 /* 09E870 7F069D40 10200005 */ beqz $at, .L7F069D58 @@ -23254,9 +23254,9 @@ glabel generate_ammo_total_microcode /* 09E944 7F069E14 AFA20048 */ sw $v0, 0x48($sp) /* 09E948 7F069E18 0FC1E129 */ jal getPlayer_c_screenwidth /* 09E94C 7F069E1C E7A00030 */ swc1 $f0, 0x30($sp) -/* 09E950 7F069E20 0C001149 */ jal get_video2_settings_uly +/* 09E950 7F069E20 0C001149 */ jal viGetViewTop /* 09E954 7F069E24 E7A00034 */ swc1 $f0, 0x34($sp) -/* 09E958 7F069E28 0C00112B */ jal get_video2_settings_height +/* 09E958 7F069E28 0C00112B */ jal viGetViewHeight /* 09E95C 7F069E2C A7A20038 */ sh $v0, 0x38($sp) /* 09E960 7F069E30 8FAA0054 */ lw $t2, 0x54($sp) /* 09E964 7F069E34 87AB0038 */ lh $t3, 0x38($sp) @@ -23327,13 +23327,13 @@ glabel generate_ammo_total_microcode /* 09EA58 7F069F28 8FA40060 */ lw $a0, 0x60($sp) /* 09EA5C 7F069F2C 54400023 */ bnezl $v0, .L7F069FBC /* 09EA60 7F069F30 8FAD0050 */ lw $t5, 0x50($sp) -/* 09EA64 7F069F34 0C001145 */ jal get_video2_settings_ulx +/* 09EA64 7F069F34 0C001145 */ jal viGetViewLeft /* 09EA68 7F069F38 00000000 */ nop -/* 09EA6C 7F069F3C 0C001127 */ jal get_video2_settings_width +/* 09EA6C 7F069F3C 0C001127 */ jal viGetViewWidth /* 09EA70 7F069F40 A7A2002C */ sh $v0, 0x2c($sp) -/* 09EA74 7F069F44 0C001149 */ jal get_video2_settings_uly +/* 09EA74 7F069F44 0C001149 */ jal viGetViewTop /* 09EA78 7F069F48 A7A2002E */ sh $v0, 0x2e($sp) -/* 09EA7C 7F069F4C 0C00112B */ jal get_video2_settings_height +/* 09EA7C 7F069F4C 0C00112B */ jal viGetViewHeight /* 09EA80 7F069F50 A7A20038 */ sh $v0, 0x38($sp) /* 09EA84 7F069F54 87A8002E */ lh $t0, 0x2e($sp) /* 09EA88 7F069F58 87AC002C */ lh $t4, 0x2c($sp) @@ -23371,13 +23371,13 @@ glabel generate_ammo_total_microcode /* 09EB00 7F069FD0 10400023 */ beqz $v0, .L7F06A060 /* 09EB04 7F069FD4 00000000 */ nop .L7F069FD8: -/* 09EB08 7F069FD8 0C001145 */ jal get_video2_settings_ulx +/* 09EB08 7F069FD8 0C001145 */ jal viGetViewLeft /* 09EB0C 7F069FDC 00000000 */ nop -/* 09EB10 7F069FE0 0C001127 */ jal get_video2_settings_width +/* 09EB10 7F069FE0 0C001127 */ jal viGetViewWidth /* 09EB14 7F069FE4 A7A2002C */ sh $v0, 0x2c($sp) -/* 09EB18 7F069FE8 0C001149 */ jal get_video2_settings_uly +/* 09EB18 7F069FE8 0C001149 */ jal viGetViewTop /* 09EB1C 7F069FEC A7A2002E */ sh $v0, 0x2e($sp) -/* 09EB20 7F069FF0 0C00112B */ jal get_video2_settings_height +/* 09EB20 7F069FF0 0C00112B */ jal viGetViewHeight /* 09EB24 7F069FF4 A7A20038 */ sh $v0, 0x38($sp) /* 09EB28 7F069FF8 87AE002E */ lh $t6, 0x2e($sp) /* 09EB2C 7F069FFC 87B8002C */ lh $t8, 0x2c($sp) @@ -23447,9 +23447,9 @@ glabel generate_ammo_total_microcode /* 09EC1C 7F06A0EC 004C1021 */ addu $v0, $v0, $t4 /* 09EC20 7F06A0F0 0FC1E131 */ jal getPlayer_c_screenleft /* 09EC24 7F06A0F4 AFA20040 */ sw $v0, 0x40($sp) -/* 09EC28 7F06A0F8 0C001149 */ jal get_video2_settings_uly +/* 09EC28 7F06A0F8 0C001149 */ jal viGetViewTop /* 09EC2C 7F06A0FC E7A00034 */ swc1 $f0, 0x34($sp) -/* 09EC30 7F06A100 0C00112B */ jal get_video2_settings_height +/* 09EC30 7F06A100 0C00112B */ jal viGetViewHeight /* 09EC34 7F06A104 A7A20038 */ sh $v0, 0x38($sp) /* 09EC38 7F06A108 8FAD0058 */ lw $t5, 0x58($sp) /* 09EC3C 7F06A10C 87AE0038 */ lh $t6, 0x38($sp) @@ -23519,11 +23519,11 @@ glabel generate_ammo_total_microcode /* 09ED2C 7F06A1FC 8FA40064 */ lw $a0, 0x64($sp) /* 09ED30 7F06A200 5440001F */ bnezl $v0, .L7F06A280 /* 09ED34 7F06A204 8FAC0050 */ lw $t4, 0x50($sp) -/* 09ED38 7F06A208 0C001145 */ jal get_video2_settings_ulx +/* 09ED38 7F06A208 0C001145 */ jal viGetViewLeft /* 09ED3C 7F06A20C 00000000 */ nop -/* 09ED40 7F06A210 0C001149 */ jal get_video2_settings_uly +/* 09ED40 7F06A210 0C001149 */ jal viGetViewTop /* 09ED44 7F06A214 A7A2002E */ sh $v0, 0x2e($sp) -/* 09ED48 7F06A218 0C00112B */ jal get_video2_settings_height +/* 09ED48 7F06A218 0C00112B */ jal viGetViewHeight /* 09ED4C 7F06A21C A7A20038 */ sh $v0, 0x38($sp) /* 09ED50 7F06A220 87AC002E */ lh $t4, 0x2e($sp) /* 09ED54 7F06A224 8FAF0058 */ lw $t7, 0x58($sp) @@ -23559,11 +23559,11 @@ glabel generate_ammo_total_microcode /* 09EDC4 7F06A294 1040001F */ beqz $v0, .L7F06A314 /* 09EDC8 7F06A298 00000000 */ nop .L7F06A29C: -/* 09EDCC 7F06A29C 0C001145 */ jal get_video2_settings_ulx +/* 09EDCC 7F06A29C 0C001145 */ jal viGetViewLeft /* 09EDD0 7F06A2A0 00000000 */ nop -/* 09EDD4 7F06A2A4 0C001149 */ jal get_video2_settings_uly +/* 09EDD4 7F06A2A4 0C001149 */ jal viGetViewTop /* 09EDD8 7F06A2A8 A7A2002E */ sh $v0, 0x2e($sp) -/* 09EDDC 7F06A2AC 0C00112B */ jal get_video2_settings_height +/* 09EDDC 7F06A2AC 0C00112B */ jal viGetViewHeight /* 09EDE0 7F06A2B0 A7A20038 */ sh $v0, 0x38($sp) /* 09EDE4 7F06A2B4 87AF002E */ lh $t7, 0x2e($sp) /* 09EDE8 7F06A2B8 8FAA0058 */ lw $t2, 0x58($sp) @@ -23669,9 +23669,9 @@ s32 sub_GAME_7F06A334(s32 arg0) { { // Node 6 sp40 = (void *) (sp40 + globalbank_rdram_offset); - sp34 = get_video2_settings_uly(); + sp34 = viGetViewTop(); sp3C = (s32) sp40->unk4; - phi_s0 = set_rgba_redirect_generate_microcode(arg0, sp40, 0x43480000, 0x43340000, (f32) ((get_video2_settings_height() + sp34) + -0x14), 0, (f32) sp30->unk8, 1); + phi_s0 = set_rgba_redirect_generate_microcode(arg0, sp40, 0x43480000, 0x43340000, (f32) ((viGetViewHeight() + sp34) + -0x14), 0, (f32) sp30->unk8, 1); } // Node 7 temp_s0 = microcode_constructor(phi_s0); @@ -23787,9 +23787,9 @@ glabel sub_GAME_7F06A334 /* 09EF10 7F06A3E0 00000000 */ nop /* 09EF14 7F06A3E4 8D4AD0B0 */ lw $t2, %lo(globalbank_rdram_offset)($t2) /* 09EF18 7F06A3E8 006A1821 */ addu $v1, $v1, $t2 -/* 09EF1C 7F06A3EC 0C001149 */ jal get_video2_settings_uly +/* 09EF1C 7F06A3EC 0C001149 */ jal viGetViewTop /* 09EF20 7F06A3F0 AFA30040 */ sw $v1, 0x40($sp) -/* 09EF24 7F06A3F4 0C00112B */ jal get_video2_settings_height +/* 09EF24 7F06A3F4 0C00112B */ jal viGetViewHeight /* 09EF28 7F06A3F8 A7A20034 */ sh $v0, 0x34($sp) /* 09EF2C 7F06A3FC 87AB0034 */ lh $t3, 0x34($sp) /* 09EF30 7F06A400 8FAE0030 */ lw $t6, 0x30($sp) @@ -24201,7 +24201,7 @@ void *increment_num_kills_display_text_in_MP(void) { // Node 0 pPlayersPerm->killcount = (s32) (pPlayersPerm->killcount + 1); pPlayer->field_29F8 = (s32) (pPlayer->field_29F8 + 1); - temp_ret = get_num_players(); + temp_ret = getPlayerCount(); phi_return_reg = temp_ret; if (temp_ret >= 2) { @@ -24292,7 +24292,7 @@ glabel increment_num_kills_display_text_in_MP /* 09F2D8 7F06A7A8 8E020000 */ lw $v0, ($s0) /* 09F2DC 7F06A7AC 8C5829F8 */ lw $t8, 0x29f8($v0) /* 09F2E0 7F06A7B0 27190001 */ addiu $t9, $t8, 1 -/* 09F2E4 7F06A7B4 0FC26919 */ jal get_num_players +/* 09F2E4 7F06A7B4 0FC26919 */ jal getPlayerCount /* 09F2E8 7F06A7B8 AC5929F8 */ sw $t9, 0x29f8($v0) /* 09F2EC 7F06A7BC 28410002 */ slti $at, $v0, 2 /* 09F2F0 7F06A7C0 54200054 */ bnezl $at, .L7F06A914 @@ -24407,7 +24407,7 @@ glabel increment_num_kills_display_text_in_MP /* 09F2D8 7F06A7A8 8E020000 */ lw $v0, ($s0) /* 09F2DC 7F06A7AC 8C5829F8 */ lw $t8, 0x29f8($v0) /* 09F2E0 7F06A7B0 27190001 */ addiu $t9, $t8, 1 -/* 09F2E4 7F06A7B4 0FC26919 */ jal get_num_players +/* 09F2E4 7F06A7B4 0FC26919 */ jal getPlayerCount /* 09F2E8 7F06A7B8 AC5929F8 */ sw $t9, 0x29f8($v0) /* 09F2EC 7F06A7BC 28410002 */ slti $at, $v0, 2 /* 09F2F0 7F06A7C0 54200054 */ bnezl $at, .L7F06A914 @@ -24524,7 +24524,7 @@ void increment_num_deaths(void) { char acStack256 [256] pPlayer->deathcount = (s32) (pPlayer->deathcount + 1); - if (get_num_players() >= 2) + if (getPlayerCount() >= 2) { if (pPlayer->deathcount == 1) { @@ -24548,7 +24548,7 @@ glabel increment_num_deaths /* 09F498 7F06A968 AFBF001C */ sw $ra, 0x1c($sp) /* 09F49C 7F06A96C 8C4E29D8 */ lw $t6, 0x29d8($v0) /* 09F4A0 7F06A970 25CF0001 */ addiu $t7, $t6, 1 -/* 09F4A4 7F06A974 0FC26919 */ jal get_num_players +/* 09F4A4 7F06A974 0FC26919 */ jal getPlayerCount /* 09F4A8 7F06A978 AC4F29D8 */ sw $t7, 0x29d8($v0) /* 09F4AC 7F06A97C 28410002 */ slti $at, $v0, 2 /* 09F4B0 7F06A980 1420001D */ bnez $at, .L7F06A9F8 @@ -24600,7 +24600,7 @@ glabel increment_num_deaths /* 09F498 7F06A968 AFBF001C */ sw $ra, 0x1c($sp) /* 09F49C 7F06A96C 8C4E29D8 */ lw $t6, 0x29d8($v0) /* 09F4A0 7F06A970 25CF0001 */ addiu $t7, $t6, 1 -/* 09F4A4 7F06A974 0FC26919 */ jal get_num_players +/* 09F4A4 7F06A974 0FC26919 */ jal getPlayerCount /* 09F4A8 7F06A978 AC4F29D8 */ sw $t7, 0x29d8($v0) /* 09F4AC 7F06A97C 28410002 */ slti $at, $v0, 2 /* 09F4B0 7F06A980 1420001D */ bnez $at, .L7F06A9F8 @@ -24660,7 +24660,7 @@ void *increment_num_suicides_display_MP(void) { // Node 0 pPlayer->num_suicides = (s32) (pPlayer->num_suicides + 1); - temp_ret = get_num_players(); + temp_ret = getPlayerCount(); phi_return_reg = temp_ret; if (temp_ret >= 2) { @@ -24747,7 +24747,7 @@ glabel increment_num_suicides_display_MP /* 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 get_num_players +/* 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 @@ -24856,7 +24856,7 @@ glabel increment_num_suicides_display_MP /* 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 get_num_players +/* 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 diff --git a/src/game/cheat_buttons.c b/src/game/cheat_buttons.c index a85ff995..86566c6e 100644 --- a/src/game/cheat_buttons.c +++ b/src/game/cheat_buttons.c @@ -262,7 +262,7 @@ glabel cheatButton_7F09177C /* 0C62E4 7F0917B4 10000008 */ b .L7F0917D8 /* 0C62E8 7F0917B8 24130001 */ li $s3, 1 .L7F0917BC: -/* 0C62EC 7F0917BC 0FC26919 */ jal get_num_players +/* 0C62EC 7F0917BC 0FC26919 */ jal getPlayerCount /* 0C62F0 7F0917C0 00000000 */ nop /* 0C62F4 7F0917C4 24010001 */ li $at, 1 /* 0C62F8 7F0917C8 14410003 */ bne $v0, $at, .L7F0917D8 @@ -521,7 +521,7 @@ void turn_on_cheat_for_players(u32 cheatindex) uVar1 = D_8003F80C[cheatindex]; playernum = get_cur_playernum(); - numplayers = get_num_players(); + numplayers = getPlayerCount(); if (numplayers == 1) { handle_cheats_turned_on(cheatindex); } @@ -565,7 +565,7 @@ glabel turn_on_cheat_for_players /* 0C65FC 7F091ACC AFB1001C */ sw $s1, 0x1c($sp) /* 0C6600 7F091AD0 0FC26C54 */ jal get_cur_playernum /* 0C6604 7F091AD4 8E10F808 */ lw $s0, %lo(D_8003F808)($s0) -/* 0C6608 7F091AD8 0FC26919 */ jal get_num_players +/* 0C6608 7F091AD8 0FC26919 */ jal getPlayerCount /* 0C660C 7F091ADC AFA20028 */ sw $v0, 0x28($sp) /* 0C6610 7F091AE0 24010001 */ li $at, 1 /* 0C6614 7F091AE4 14410005 */ bne $v0, $at, .L7F091AFC @@ -638,7 +638,7 @@ void handle_cheats_turned_on(CHEAT_IDS cheat) uVar1 = (&D_8003F808)[cheat * 4]; playernum = get_cur_playernum(); - numplayers = get_num_players(); + numplayers = getPlayerCount(); if ((uVar1 & 0x10) == 0) { if ((uVar1 & 0x20) == 0) { cheatl_ARRAY_80079e30[cheat] = cheatl_ARRAY_80079e30[cheat] | (byte)(1 << (playernum & 0x1f)); @@ -792,7 +792,7 @@ void handle_cheats_turned_on(CHEAT_IDS cheat) } break; case cheats_cheat_invisibility_mp: - set_curplayer_fade(300.00000000, 0.5f); + currentPlayerStartChrFade(300.00000000, 0.5f); break; case cheats_cheat_fast: if (get_debug_fast_bond_flag() == FALSE) @@ -1022,7 +1022,7 @@ glabel handle_cheats_turned_on /* 0C66AC 7F091B7C AFA40040 */ sw $a0, 0x40($sp) /* 0C66B0 7F091B80 0FC26C54 */ jal get_cur_playernum /* 0C66B4 7F091B84 AFAF003C */ sw $t7, 0x3c($sp) -/* 0C66B8 7F091B88 0FC26919 */ jal get_num_players +/* 0C66B8 7F091B88 0FC26919 */ jal getPlayerCount /* 0C66BC 7F091B8C AFA20038 */ sw $v0, 0x38($sp) /* 0C66C0 7F091B90 8FA3003C */ lw $v1, 0x3c($sp) /* 0C66C4 7F091B94 8FA60040 */ lw $a2, 0x40($sp) @@ -1421,7 +1421,7 @@ cheats_cheat_invisibility_mp: /* 0C6C74 7F092144 3C014396 */ li $at, 0x43960000 # 300.000000 /* 0C6C78 7F092148 44816000 */ mtc1 $at, $f12 /* 0C6C7C 7F09214C 3C018005 */ lui $at, %hi(finalamount) -/* 0C6C80 7F092150 0FC20284 */ jal set_curplayer_fade +/* 0C6C80 7F092150 0FC20284 */ jal currentPlayerStartChrFade /* 0C6C84 7F092154 C42E73D8 */ lwc1 $f14, %lo(finalamount)($at) /* 0C6C88 7F092158 100000B4 */ b .L7F09242C /* 0C6C8C 7F09215C 8FBF0014 */ lw $ra, 0x14($sp) @@ -1723,7 +1723,7 @@ glabel handle_cheats_turned_on /* 0C71CC 7F09265C AFA40040 */ sw $a0, 0x40($sp) /* 0C71D0 7F092660 0FC26F3C */ jal get_cur_playernum /* 0C71D4 7F092664 AFAF003C */ sw $t7, 0x3c($sp) -/* 0C71D8 7F092668 0FC26C01 */ jal get_num_players +/* 0C71D8 7F092668 0FC26C01 */ jal getPlayerCount /* 0C71DC 7F09266C AFA20038 */ sw $v0, 0x38($sp) /* 0C71E0 7F092670 8FA3003C */ lw $v1, 0x3c($sp) /* 0C71E4 7F092674 8FA60040 */ lw $a2, 0x40($sp) @@ -2122,7 +2122,7 @@ cheats_cheat_invisibility_mp: /* 0C7794 7F092C24 3C014396 */ li $at, 0x43960000 # 300.000000 /* 0C7798 7F092C28 44816000 */ mtc1 $at, $f12 /* 0C779C 7F092C2C 3C018005 */ lui $at, %hi(finalamount) # $at, 0x8005 -/* 0C77A0 7F092C30 0FC20408 */ jal set_curplayer_fade +/* 0C77A0 7F092C30 0FC20408 */ jal currentPlayerStartChrFade /* 0C77A4 7F092C34 C42E7408 */ lwc1 $f14, %lo(finalamount)($at) /* 0C77A8 7F092C38 100000DC */ b .Ljp7F092FAC /* 0C77AC 7F092C3C 8FBF0014 */ lw $ra, 0x14($sp) @@ -2470,7 +2470,7 @@ glabel cheatDisplayMessageActivateCheat /* 0C6F80 7F092450 AFA40020 */ sw $a0, 0x20($sp) /* 0C6F84 7F092454 0FC26C54 */ jal get_cur_playernum /* 0C6F88 7F092458 AFAF001C */ sw $t7, 0x1c($sp) -/* 0C6F8C 7F09245C 0FC26919 */ jal get_num_players +/* 0C6F8C 7F09245C 0FC26919 */ jal getPlayerCount /* 0C6F90 7F092460 AFA20018 */ sw $v0, 0x18($sp) /* 0C6F94 7F092464 8FA3001C */ lw $v1, 0x1c($sp) /* 0C6F98 7F092468 8FA40020 */ lw $a0, 0x20($sp) @@ -2608,7 +2608,7 @@ cheat_button_mp_invis: /* 0C717C 7F09264C 44816000 */ mtc1 $at, $f12 /* 0C7180 7F092650 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0C7184 7F092654 44817000 */ mtc1 $at, $f14 -/* 0C7188 7F092658 0FC20284 */ jal set_curplayer_fade +/* 0C7188 7F092658 0FC20284 */ jal currentPlayerStartChrFade /* 0C718C 7F09265C 00000000 */ nop /* 0C7190 7F092660 10000014 */ b .L7F0926B4 /* 0C7194 7F092664 8FBF0014 */ lw $ra, 0x14($sp) @@ -2732,7 +2732,7 @@ glabel cheatDisplayMessageActivateCheat /* 0C6F80 7F092450 AFA40020 */ sw $a0, 0x20($sp) /* 0C6F84 7F092454 0FC26C54 */ jal get_cur_playernum /* 0C6F88 7F092458 AFAF001C */ sw $t7, 0x1c($sp) -/* 0C6F8C 7F09245C 0FC26919 */ jal get_num_players +/* 0C6F8C 7F09245C 0FC26919 */ jal getPlayerCount /* 0C6F90 7F092460 AFA20018 */ sw $v0, 0x18($sp) /* 0C6F94 7F092464 8FA3001C */ lw $v1, 0x1c($sp) /* 0C6F98 7F092468 8FA40020 */ lw $a0, 0x20($sp) @@ -2870,7 +2870,7 @@ cheat_button_mp_invis: /* 0C717C 7F09264C 44816000 */ mtc1 $at, $f12 /* 0C7180 7F092650 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0C7184 7F092654 44817000 */ mtc1 $at, $f14 -/* 0C7188 7F092658 0FC20284 */ jal set_curplayer_fade +/* 0C7188 7F092658 0FC20284 */ jal currentPlayerStartChrFade /* 0C718C 7F09265C 00000000 */ nop /* 0C7190 7F092660 10000014 */ b .L7F0926B4 /* 0C7194 7F092664 8FBF0014 */ lw $ra, 0x14($sp) @@ -2920,7 +2920,7 @@ void cheatDisableAllCheats(void) { s32 phi_s0; // Node 0 - temp_s4 = get_num_players(); + temp_s4 = getPlayerCount(); sp30 = get_cur_playernum(); if (temp_s4 > 0) { @@ -2994,7 +2994,7 @@ glabel cheatDisableAllCheats /* 0C71FC 7F0926CC AFB30024 */ sw $s3, 0x24($sp) /* 0C7200 7F0926D0 AFB20020 */ sw $s2, 0x20($sp) /* 0C7204 7F0926D4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0C7208 7F0926D8 0FC26919 */ jal get_num_players +/* 0C7208 7F0926D8 0FC26919 */ jal getPlayerCount /* 0C720C 7F0926DC AFB00018 */ sw $s0, 0x18($sp) /* 0C7210 7F0926E0 0FC26C54 */ jal get_cur_playernum /* 0C7214 7F0926E4 0040A025 */ move $s4, $v0 diff --git a/src/game/chr.c b/src/game/chr.c index 2fcf4f04..c619e9b9 100644 --- a/src/game/chr.c +++ b/src/game/chr.c @@ -36,8 +36,8 @@ struct animation_something D_8002CC2C = {0xFFFFFFFF, 0, 0, 0.0, 0, 0, 0.0, NULL, s32 D_8002CC58 = 0; s32 show_patrols_flag = FALSE; -s32 player1_guardID = 0x1388; -s32 ptr_guard_data = 0; +s32 player1_guardID = 5000; +struct chrdata *ptr_guard_data = 0; s32 num_guards = 0; s32 D_8002CC6C[] = {0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; s32 D_8002CCA8 = 0; @@ -1219,7 +1219,7 @@ glabel sub_GAME_7F01F614 .L7F01F708: /* 054238 7F01F708 AFA0004C */ sw $zero, 0x4c($sp) /* 05423C 7F01F70C 27A40078 */ addiu $a0, $sp, 0x78 -/* 054240 7F01F710 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 054240 7F01F710 0FC2CA2C */ jal getCollisionEdge_maybe /* 054244 7F01F714 27A5006C */ addiu $a1, $sp, 0x6c /* 054248 7F01F718 50400130 */ beql $v0, $zero, .L7F01FBDC /* 05424C 7F01F71C 8FA40098 */ lw $a0, 0x98($sp) @@ -2201,139 +2201,45 @@ glabel sub_GAME_7F01FC10 #endif #endif +s32 chrGetNumFree(void) +{ + s32 count = 0; + s32 i; -#ifdef NONMATCHING -void get_next_available_guardID(void) { + for (i = 0; i < num_guards; i++) { + if (ptr_guard_data[i].model == 0) { + count++; + } + } + return count; } -#else -GLOBAL_ASM( -.text -glabel get_next_available_guardID -/* 054AF0 7F01FFC0 3C048003 */ lui $a0, %hi(num_guards) -/* 054AF4 7F01FFC4 8C84CC68 */ lw $a0, %lo(num_guards)($a0) -/* 054AF8 7F01FFC8 00001825 */ move $v1, $zero -/* 054AFC 7F01FFCC 00001025 */ move $v0, $zero -/* 054B00 7F01FFD0 1880000F */ blez $a0, .L7F020010 -/* 054B04 7F01FFD4 3C058003 */ lui $a1, %hi(ptr_guard_data) -/* 054B08 7F01FFD8 00043100 */ sll $a2, $a0, 4 -/* 054B0C 7F01FFDC 00C43023 */ subu $a2, $a2, $a0 -/* 054B10 7F01FFE0 000630C0 */ sll $a2, $a2, 3 -/* 054B14 7F01FFE4 00C43023 */ subu $a2, $a2, $a0 -/* 054B18 7F01FFE8 00063080 */ sll $a2, $a2, 2 -/* 054B1C 7F01FFEC 8CA5CC64 */ lw $a1, %lo(ptr_guard_data)($a1) -.L7F01FFF0: -/* 054B20 7F01FFF0 8CAE001C */ lw $t6, 0x1c($a1) -/* 054B24 7F01FFF4 244201DC */ addiu $v0, $v0, 0x1dc -/* 054B28 7F01FFF8 0046082A */ slt $at, $v0, $a2 -/* 054B2C 7F01FFFC 15C00002 */ bnez $t6, .L7F020008 -/* 054B30 7F020000 00000000 */ nop -/* 054B34 7F020004 24630001 */ addiu $v1, $v1, 1 -.L7F020008: -/* 054B38 7F020008 1420FFF9 */ bnez $at, .L7F01FFF0 -/* 054B3C 7F02000C 24A501DC */ addiu $a1, $a1, 0x1dc -.L7F020010: -/* 054B40 7F020010 03E00008 */ jr $ra -/* 054B44 7F020014 00601025 */ move $v0, $v1 -) -#endif +f32 get_007_health_mod(void); - -#ifdef NONMATCHING -void sub_GAME_7F020018(void) { - +void chrSetMaxDamage(struct chrdata *chr, f32 maxdamage) +{ + chr->maxdamage = (get_007_health_mod() * maxdamage); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F020018 -/* 054B48 7F020018 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 054B4C 7F02001C AFBF0014 */ sw $ra, 0x14($sp) -/* 054B50 7F020020 AFA40018 */ sw $a0, 0x18($sp) -/* 054B54 7F020024 0FC074BA */ jal get_007_health_mod -/* 054B58 7F020028 AFA5001C */ sw $a1, 0x1c($sp) -/* 054B5C 7F02002C C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 054B60 7F020030 8FAE0018 */ lw $t6, 0x18($sp) -/* 054B64 7F020034 46040182 */ mul.s $f6, $f0, $f4 -/* 054B68 7F020038 E5C60100 */ swc1 $f6, 0x100($t6) -/* 054B6C 7F02003C 8FBF0014 */ lw $ra, 0x14($sp) -/* 054B70 7F020040 27BD0018 */ addiu $sp, $sp, 0x18 -/* 054B74 7F020044 03E00008 */ jr $ra -/* 054B78 7F020048 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F02004C(void) { +f32 chrGetMaxDamage(struct chrdata *chr) +{ + return chr->maxdamage; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F02004C -/* 054B7C 7F02004C 03E00008 */ jr $ra -/* 054B80 7F020050 C4800100 */ lwc1 $f0, 0x100($a0) -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F020054(void) { +void chrAddHealth(struct chrdata *chr, f32 health) +{ + chr->damage -= (health * get_007_health_mod()); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F020054 -/* 054B84 7F020054 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 054B88 7F020058 AFBF0014 */ sw $ra, 0x14($sp) -/* 054B8C 7F02005C AFA40018 */ sw $a0, 0x18($sp) -/* 054B90 7F020060 0FC074BA */ jal get_007_health_mod -/* 054B94 7F020064 AFA5001C */ sw $a1, 0x1c($sp) -/* 054B98 7F020068 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 054B9C 7F02006C 8FA20018 */ lw $v0, 0x18($sp) -/* 054BA0 7F020070 46003202 */ mul.s $f8, $f6, $f0 -/* 054BA4 7F020074 C44400FC */ lwc1 $f4, 0xfc($v0) -/* 054BA8 7F020078 46082281 */ sub.s $f10, $f4, $f8 -/* 054BAC 7F02007C E44A00FC */ swc1 $f10, 0xfc($v0) -/* 054BB0 7F020080 8FBF0014 */ lw $ra, 0x14($sp) -/* 054BB4 7F020084 27BD0018 */ addiu $sp, $sp, 0x18 -/* 054BB8 7F020088 03E00008 */ jr $ra -/* 054BBC 7F02008C 00000000 */ nop -) -#endif +f32 chrGetArmor(struct chrdata *chr) +{ + if (chr->damage < 0) { + return -chr->damage; + } - -#ifdef NONMATCHING -void sub_GAME_7F020090(void) { - + return 0; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F020090 -/* 054BC0 7F020090 44806000 */ mtc1 $zero, $f12 -/* 054BC4 7F020094 C48200FC */ lwc1 $f2, 0xfc($a0) -/* 054BC8 7F020098 460C103C */ c.lt.s $f2, $f12 -/* 054BCC 7F02009C 00000000 */ nop -/* 054BD0 7F0200A0 45020004 */ bc1fl .L7F0200B4 -/* 054BD4 7F0200A4 46006006 */ mov.s $f0, $f12 -/* 054BD8 7F0200A8 03E00008 */ jr $ra -/* 054BDC 7F0200AC 46001007 */ neg.s $f0, $f2 - -/* 054BE0 7F0200B0 46006006 */ mov.s $f0, $f12 -.L7F0200B4: -/* 054BE4 7F0200B4 03E00008 */ jr $ra -/* 054BE8 7F0200B8 00000000 */ nop -) -#endif - - #ifdef NONMATCHING void init_GUARDdata_with_set_values(void) { @@ -3338,7 +3244,7 @@ glabel sub_GAME_7F02083C /* 055720 7F020BF0 460A6300 */ add.s $f12, $f12, $f10 /* 055724 7F020BF4 E7AC008C */ swc1 $f12, 0x8c($sp) .L7F020BF8: -/* 055728 7F020BF8 0FC1E111 */ jal sub_GAME_7F078444 +/* 055728 7F020BF8 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 05572C 7F020BFC E7AE0090 */ swc1 $f14, 0x90($sp) /* 055730 7F020C00 00402025 */ move $a0, $v0 /* 055734 7F020C04 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -3439,7 +3345,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 get_BONDdata_field_10CC +/* 0558A0 7F020D70 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0558A4 7F020D74 E5040038 */ swc1 $f4, 0x38($t0) /* 0558A8 7F020D78 00402025 */ move $a0, $v0 /* 0558AC 7F020D7C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -3732,7 +3638,7 @@ glabel sub_GAME_7F02083C /* 0559F8 7F020E88 460A6300 */ add.s $f12, $f12, $f10 /* 0559FC 7F020E8C E7AC008C */ swc1 $f12, 0x8c($sp) .L7F020E90: -/* 055A00 7F020E90 0FC1E28D */ jal sub_GAME_7F078444 +/* 055A00 7F020E90 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 055A04 7F020E94 E7AE0090 */ swc1 $f14, 0x90($sp) /* 055A08 7F020E98 00402025 */ move $a0, $v0 /* 055A0C 7F020E9C 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -3833,7 +3739,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 get_BONDdata_field_10CC +/* 055B78 7F021008 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 055B7C 7F02100C E5240038 */ swc1 $f4, 0x38($t1) /* 055B80 7F021010 00402025 */ move $a0, $v0 /* 055B84 7F021014 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -4113,9 +4019,9 @@ glabel sub_GAME_7F020EF0 /* 055C18 7F0210E8 0FC26C57 */ jal sub_GAME_7F09B15C /* 055C1C 7F0210EC 01802025 */ move $a0, $t4 /* 055C20 7F0210F0 0002C880 */ sll $t9, $v0, 2 -/* 055C24 7F0210F4 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) +/* 055C24 7F0210F4 3C188008 */ lui $t8, %hi(players) /* 055C28 7F0210F8 0319C021 */ addu $t8, $t8, $t9 -/* 055C2C 7F0210FC 8F189EE0 */ lw $t8, %lo(ptr_BONDdata_p1)($t8) +/* 055C2C 7F0210FC 8F189EE0 */ lw $t8, %lo(players)($t8) /* 055C30 7F021100 24010001 */ li $at, 1 /* 055C34 7F021104 8F080000 */ lw $t0, ($t8) /* 055C38 7F021108 51010005 */ beql $t0, $at, .L7F021120 @@ -4369,7 +4275,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 get_BONDdata_field_10CC +/* 055FB4 7F021484 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 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) @@ -4965,9 +4871,9 @@ glabel sub_GAME_7F020EF0 /* 055EF0 7F021380 0FC26F3F */ jal sub_GAME_7F09B15C /* 055EF4 7F021384 01802025 */ move $a0, $t4 /* 055EF8 7F021388 0002C880 */ sll $t9, $v0, 2 -/* 055EFC 7F02138C 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) +/* 055EFC 7F02138C 3C188008 */ lui $t8, %hi(players) /* 055F00 7F021390 0319C021 */ addu $t8, $t8, $t9 -/* 055F04 7F021394 8F189F50 */ lw $t8, %lo(ptr_BONDdata_p1)($t8) +/* 055F04 7F021394 8F189F50 */ lw $t8, %lo(players)($t8) /* 055F08 7F021398 24010001 */ li $at, 1 /* 055F0C 7F02139C 8F080000 */ lw $t0, ($t8) /* 055F10 7F0213A0 51010005 */ beql $t0, $at, .Ljp7F0213B8 @@ -5241,7 +5147,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 get_BONDdata_field_10CC +/* 0562DC 7F02176C 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 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) @@ -6195,7 +6101,7 @@ glabel sub_GAME_7F022078 /* 056C98 7F022168 E7B00040 */ swc1 $f16, 0x40($sp) /* 056C9C 7F02216C C4D20008 */ lwc1 $f18, 8($a2) /* 056CA0 7F022170 46029102 */ mul.s $f4, $f18, $f2 -/* 056CA4 7F022174 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -6691,7 +6597,7 @@ glabel sub_GAME_7F022648 /* 057360 7F022830 C6520010 */ lwc1 $f18, 0x10($s2) /* 057364 7F022834 E7B20078 */ swc1 $f18, 0x78($sp) /* 057368 7F022838 C6440014 */ lwc1 $f4, 0x14($s2) -/* 05736C 7F02283C 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -6846,7 +6752,7 @@ glabel sub_GAME_7F022980 /* 057590 7F022A60 46023202 */ mul.s $f8, $f6, $f2 /* 057594 7F022A64 E7A400A8 */ swc1 $f4, 0xa8($sp) /* 057598 7F022A68 E7B000AC */ swc1 $f16, 0xac($sp) -/* 05759C 7F022A6C 0FC1E111 */ jal sub_GAME_7F078444 +/* 05759C 7F022A6C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0575A0 7F022A70 E7A800B0 */ swc1 $f8, 0xb0($sp) /* 0575A4 7F022A74 27B000A8 */ addiu $s0, $sp, 0xa8 /* 0575A8 7F022A78 02002825 */ move $a1, $s0 @@ -7072,7 +6978,7 @@ glabel sub_GAME_7F022980 /* 0578E8 7F022DB8 02002025 */ move $a0, $s0 /* 0578EC 7F022DBC 46082402 */ mul.s $f16, $f4, $f8 /* 0578F0 7F022DC0 46105181 */ sub.s $f6, $f10, $f16 -/* 0578F4 7F022DC4 0FC16799 */ jal sub_GAME_7F059E64 +/* 0578F4 7F022DC4 0FC16799 */ jal matrix_4x4_7F059E64 /* 0578F8 7F022DC8 E7A60078 */ swc1 $f6, 0x78($sp) /* 0578FC 7F022DCC 27B00070 */ addiu $s0, $sp, 0x70 /* 057900 7F022DD0 02002825 */ move $a1, $s0 @@ -7252,7 +7158,7 @@ glabel sub_GAME_7F022EEC /* 057A7C 7F022F4C 44812000 */ mtc1 $at, $f4 /* 057A80 7F022F50 02302021 */ addu $a0, $s1, $s0 /* 057A84 7F022F54 4604B502 */ mul.s $f20, $f22, $f4 -/* 057A88 7F022F58 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 057A88 7F022F58 0FC0CB79 */ jal distToBond3D /* 057A8C 7F022F5C 00000000 */ nop /* 057A90 7F022F60 8E700000 */ lw $s0, ($s3) /* 057A94 7F022F64 0211C821 */ addu $t9, $s0, $s1 diff --git a/src/game/chr.h b/src/game/chr.h index e82007a3..0f39f387 100644 --- a/src/game/chr.h +++ b/src/game/chr.h @@ -2,10 +2,12 @@ #define _CHR_H_ #include "ultra64.h" #include "bondgame.h" +#include "chrai.h" +#include "bondtypes.h" // chrdata -struct animation_something -{ - s32 anonymous_0; + struct animation_something + { + s32 anonymous_0; s32 field_4; s32 field_8; f32 field_C; @@ -16,7 +18,7 @@ struct animation_something s32 field_20; struct struck_animation_table *field_24; s32 field_28; -}; + }; struct struck_animation_table { @@ -173,7 +175,7 @@ extern s32 D_8002C910; extern s32 D_8002CC58; extern s32 show_patrols_flag; extern s32 player1_guardID; -extern s32 ptr_guard_data; +extern struct chrdata *ptr_guard_data; extern s32 num_guards; extern s32 D_8002CC6C[]; extern s32 D_8002CCA8; diff --git a/src/game/chr2.c b/src/game/chr2.c index 40a8f7ed..870d0d00 100644 --- a/src/game/chr2.c +++ b/src/game/chr2.c @@ -2,6 +2,8 @@ #include "bondgame.h" #include "game/chr.h" #include "game/bondwalk.h" +#include "game/lvl.h" +#include "bondconstants.h" #ifdef NONMATCHING void load_body_head_if_not_loaded(void) { @@ -4032,7 +4034,7 @@ glabel sub_GAME_7F02624C /* 05AD88 7F026258 AFA5003C */ sw $a1, 0x3c($sp) /* 05AD8C 7F02625C AFA60040 */ sw $a2, 0x40($sp) /* 05AD90 7F026260 27A50020 */ addiu $a1, $sp, 0x20 -/* 05AD94 7F026264 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 05AD94 7F026264 0FC2CA2C */ jal getCollisionEdge_maybe /* 05AD98 7F026268 27A4002C */ addiu $a0, $sp, 0x2c /* 05AD9C 7F02626C 8FAE0040 */ lw $t6, 0x40($sp) /* 05ADA0 7F026270 27A4002C */ addiu $a0, $sp, 0x2c @@ -4064,7 +4066,7 @@ glabel sub_GAME_7F026298 /* 05ADD4 7F0262A4 AFA5003C */ sw $a1, 0x3c($sp) /* 05ADD8 7F0262A8 27A50020 */ addiu $a1, $sp, 0x20 /* 05ADDC 7F0262AC 27A4002C */ addiu $a0, $sp, 0x2c -/* 05ADE0 7F0262B0 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 05ADE0 7F0262B0 0FC2CA2C */ jal getCollisionEdge_maybe /* 05ADE4 7F0262B4 AFA60040 */ sw $a2, 0x40($sp) /* 05ADE8 7F0262B8 8FA30038 */ lw $v1, 0x38($sp) /* 05ADEC 7F0262BC C7A40020 */ lwc1 $f4, 0x20($sp) @@ -4291,7 +4293,7 @@ glabel triggered_on_shot_hit /* 05B078 7F026548 57010009 */ bnel $t8, $at, .L7F026570 /* 05B07C 7F02654C 82020007 */ lb $v0, 7($s0) /* 05B080 7F026550 AFA700AC */ sw $a3, 0xac($sp) -/* 05B084 7F026554 0FC26919 */ jal get_num_players +/* 05B084 7F026554 0FC26919 */ jal getPlayerCount /* 05B088 7F026558 E7AC00A8 */ swc1 $f12, 0xa8($sp) /* 05B08C 7F02655C 28410002 */ slti $at, $v0, 2 /* 05B090 7F026560 8FA700AC */ lw $a3, 0xac($sp) @@ -5079,9 +5081,9 @@ glabel play_sound_for_shot_actor /* 05BBB8 7F027088 0FC26C57 */ jal sub_GAME_7F09B15C /* 05BBBC 7F02708C AFA00060 */ sw $zero, 0x60($sp) /* 05BBC0 7F027090 0002C080 */ sll $t8, $v0, 2 -/* 05BBC4 7F027094 3C198008 */ lui $t9, %hi(ptr_BONDdata_p1) +/* 05BBC4 7F027094 3C198008 */ lui $t9, %hi(players) /* 05BBC8 7F027098 0338C821 */ addu $t9, $t9, $t8 -/* 05BBCC 7F02709C 8F399EE0 */ lw $t9, %lo(ptr_BONDdata_p1)($t9) +/* 05BBCC 7F02709C 8F399EE0 */ lw $t9, %lo(players)($t9) /* 05BBD0 7F0270A0 8FA30060 */ lw $v1, 0x60($sp) /* 05BBD4 7F0270A4 8F2800D8 */ lw $t0, 0xd8($t9) /* 05BBD8 7F0270A8 55000071 */ bnezl $t0, .L7F027270 @@ -5094,7 +5096,7 @@ glabel play_sound_for_shot_actor /* 05BBF0 7F0270C0 914B0000 */ lbu $t3, ($t2) /* 05BBF4 7F0270C4 5561001D */ bnel $t3, $at, .L7F02713C /* 05BBF8 7F0270C8 8328000F */ lb $t0, 0xf($t9) -/* 05BBFC 7F0270CC 0FC26919 */ jal get_num_players +/* 05BBFC 7F0270CC 0FC26919 */ jal getPlayerCount /* 05BC00 7F0270D0 AFA30060 */ sw $v1, 0x60($sp) /* 05BC04 7F0270D4 24010001 */ li $at, 1 /* 05BC08 7F0270D8 1441000D */ bne $v0, $at, .L7F027110 @@ -5359,7 +5361,7 @@ glabel handles_shot_actors /* 05BF70 7F027440 46000086 */ mov.s $f2, $f0 /* 05BF74 7F027444 51A0000B */ beql $t5, $zero, .L7F027474 /* 05BF78 7F027448 8FA20070 */ lw $v0, 0x70($sp) -/* 05BF7C 7F02744C 0FC26919 */ jal get_num_players +/* 05BF7C 7F02744C 0FC26919 */ jal getPlayerCount /* 05BF80 7F027450 E7A2003C */ swc1 $f2, 0x3c($sp) /* 05BF84 7F027454 24010001 */ li $at, 1 /* 05BF88 7F027458 14410005 */ bne $v0, $at, .L7F027470 @@ -7808,20 +7810,11 @@ glabel set_actor_on_path -#ifdef NONMATCHING -void update_GUARDdata_timer_to_current(void) { - +void setSeenBondTimeToNow(struct chrdata *guardData) +{ + guardData->timeshooter = global_timer; + return; } -#else -GLOBAL_ASM( -.text -glabel update_GUARDdata_timer_to_current -/* 05DDC8 7F029298 3C0E8005 */ lui $t6, %hi(global_timer) -/* 05DDCC 7F02929C 8DCE837C */ lw $t6, %lo(global_timer)($t6) -/* 05DDD0 7F0292A0 03E00008 */ jr $ra -/* 05DDD4 7F0292A4 AC8E00E8 */ sw $t6, 0xe8($a0) -) -#endif @@ -7901,7 +7894,7 @@ glabel sub_GAME_7F0292A8 /* 05DED4 7F0293A4 8FAF0040 */ lw $t7, 0x40($sp) /* 05DED8 7F0293A8 15CF0005 */ bne $t6, $t7, .L7F0293C0 /* 05DEDC 7F0293AC 00000000 */ nop -/* 05DEE0 7F0293B0 0FC0A4A6 */ jal update_GUARDdata_timer_to_current +/* 05DEE0 7F0293B0 0FC0A4A6 */ jal setSeenBondTimeToNow /* 05DEE4 7F0293B4 8FA40050 */ lw $a0, 0x50($sp) /* 05DEE8 7F0293B8 24180001 */ li $t8, 1 /* 05DEEC 7F0293BC AFB8004C */ sw $t8, 0x4c($sp) @@ -8039,7 +8032,7 @@ glabel sub_GAME_7F0294BC /* 05E0B0 7F029580 8D2A0014 */ lw $t2, 0x14($t1) /* 05E0B4 7F029584 550A0006 */ bnel $t0, $t2, .L7F0295A0 /* 05E0B8 7F029588 02002025 */ move $a0, $s0 -/* 05E0BC 7F02958C 0FC0A4A6 */ jal update_GUARDdata_timer_to_current +/* 05E0BC 7F02958C 0FC0A4A6 */ jal setSeenBondTimeToNow /* 05E0C0 7F029590 02002025 */ move $a0, $s0 /* 05E0C4 7F029594 240B0001 */ li $t3, 1 /* 05E0C8 7F029598 AFAB004C */ sw $t3, 0x4c($sp) @@ -9110,7 +9103,7 @@ glabel sub_GAME_7F02A1E8 -s32 true_if_actor_dying_fading_limping_shot(PCHRdata chr) { +s32 true_if_actor_dying_fading_limping_shot(struct chrdata *chr) { s8 currentaction = chr->actiontype; if ((currentaction == ACT_DIE) || (currentaction == ACT_DEAD) || (currentaction == ACT_PREARGH) || (currentaction == ACT_ARGH) && !(chr->chrflags & CHRFLAG_00000200)) @@ -9120,7 +9113,7 @@ s32 true_if_actor_dying_fading_limping_shot(PCHRdata chr) { -s32 true_if_actor_dying_fading(PCHRdata chr) { +s32 true_if_actor_dying_fading(struct chrdata *chr) { s8 currentaction = chr->actiontype; return ((currentaction == ACT_DIE) || (currentaction == ACT_DEAD)); @@ -9922,7 +9915,7 @@ glabel actor_moves_to_preset_at_speed /* 05F71C 7F02ABEC 29C1000A */ slti $at, $t6, 0xa /* 05F720 7F02ABF0 50200053 */ beql $at, $zero, .L7F02AD40 /* 05F724 7F02ABF4 00001025 */ move $v0, $zero -/* 05F728 7F02ABF8 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 05F728 7F02ABF8 0FC0CBE5 */ jal convertPadIf9000 /* 05F72C 7F02ABFC 02002825 */ move $a1, $s0 /* 05F730 7F02AC00 28412710 */ slti $at, $v0, 0x2710 /* 05F734 7F02AC04 1020000A */ beqz $at, .L7F02AC30 @@ -10584,7 +10577,7 @@ glabel sub_GAME_7F02AD98 -void actor_reset_sleep(PCHRdata actor) { +void actor_reset_sleep(struct chrdata *actor) { actor->sleep = 0; } @@ -10645,7 +10638,7 @@ glabel sub_GAME_7F02B4E8 /* 0600C4 7F02B594 314B0001 */ andi $t3, $t2, 1 /* 0600C8 7F02B598 55600012 */ bnezl $t3, .L7F02B5E4 /* 0600CC 7F02B59C 8E0C0014 */ lw $t4, 0x14($s0) -/* 0600D0 7F02B5A0 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 0600D0 7F02B5A0 0FC0CB79 */ jal distToBond3D /* 0600D4 7F02B5A4 02002025 */ move $a0, $s0 /* 0600D8 7F02B5A8 3C014448 */ li $at, 0x44480000 # 800.000000 /* 0600DC 7F02B5AC 44814000 */ mtc1 $at, $f8 @@ -12658,7 +12651,7 @@ glabel sub_GAME_7F02C4C0 /* 061788 7F02CC58 8F290004 */ lw $t1, 4($t9) /* 06178C 7F02CC5C 0FC1639E */ jal sub_GAME_7F058E78 /* 061790 7F02CC60 AFA900B8 */ sw $t1, 0xb8($sp) -/* 061794 7F02CC64 0FC1E115 */ jal sub_GAME_7F078454 +/* 061794 7F02CC64 0FC1E115 */ jal currentPlayerGetMatrix10EC /* 061798 7F02CC68 00000000 */ nop /* 06179C 7F02CC6C 00402025 */ move $a0, $v0 /* 0617A0 7F02CC70 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -12692,7 +12685,7 @@ glabel sub_GAME_7F02C4C0 /* 06180C 7F02CCDC 00402025 */ move $a0, $v0 /* 061810 7F02CCE0 0FC1639E */ jal sub_GAME_7F058E78 /* 061814 7F02CCE4 27A50068 */ addiu $a1, $sp, 0x68 -/* 061818 7F02CCE8 0FC1E115 */ jal sub_GAME_7F078454 +/* 061818 7F02CCE8 0FC1E115 */ jal currentPlayerGetMatrix10EC /* 06181C 7F02CCEC 00000000 */ nop /* 061820 7F02CCF0 00402025 */ move $a0, $v0 /* 061824 7F02CCF4 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -13760,7 +13753,7 @@ glabel sub_GAME_7F02D630 /* 0621D0 7F02D6A0 C4660004 */ lwc1 $f6, 4($v1) /* 0621D4 7F02D6A4 E6060004 */ swc1 $f6, 4($s0) /* 0621D8 7F02D6A8 C4680008 */ lwc1 $f8, 8($v1) -/* 0621DC 7F02D6AC 0FC1E111 */ jal sub_GAME_7F078444 +/* 0621DC 7F02D6AC 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0621E0 7F02D6B0 E6080008 */ swc1 $f8, 8($s0) /* 0621E4 7F02D6B4 00402025 */ move $a0, $v0 /* 0621E8 7F02D6B8 8FA500B4 */ lw $a1, 0xb4($sp) @@ -13777,7 +13770,7 @@ glabel sub_GAME_7F02D630 /* 062210 7F02D6E0 8FBF001C */ lw $ra, 0x1c($sp) /* 062214 7F02D6E4 0FC1B198 */ jal sub_GAME_7F06C660 /* 062218 7F02D6E8 00003025 */ move $a2, $zero -/* 06221C 7F02D6EC 0FC1E111 */ jal sub_GAME_7F078444 +/* 06221C 7F02D6EC 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 062220 7F02D6F0 AFA2006C */ sw $v0, 0x6c($sp) /* 062224 7F02D6F4 00402025 */ move $a0, $v0 /* 062228 7F02D6F8 8FA5006C */ lw $a1, 0x6c($sp) @@ -14443,7 +14436,7 @@ glabel sub_GAME_7F02D734 /* 062B44 7F02E014 8FA80230 */ lw $t0, 0x230($sp) .L7F02E018: /* 062B48 7F02E018 8FA50270 */ lw $a1, 0x270($sp) -/* 062B4C 7F02E01C 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007BA04) +/* 062B4C 7F02E01C 3C038008 */ lui $v1, %hi(stanSavedColl_posData) /* 062B50 7F02E020 1100000F */ beqz $t0, .L7F02E060 /* 062B54 7F02E024 00000000 */ nop /* 062B58 7F02E028 C4A60008 */ lwc1 $f6, 8($a1) @@ -14461,7 +14454,7 @@ glabel sub_GAME_7F02D734 /* 062B88 7F02E058 10000012 */ b .L7F02E0A4 /* 062B8C 7F02E05C 8FAC022C */ lw $t4, 0x22c($sp) .L7F02E060: -/* 062B90 7F02E060 8C63BA04 */ lw $v1, %lo(dword_CODE_bss_8007BA04)($v1) +/* 062B90 7F02E060 8C63BA04 */ lw $v1, %lo(stanSavedColl_posData)($v1) /* 062B94 7F02E064 C7A8020C */ lwc1 $f8, 0x20c($sp) /* 062B98 7F02E068 10600006 */ beqz $v1, .L7F02E084 /* 062B9C 7F02E06C 00000000 */ nop @@ -14491,8 +14484,8 @@ glabel sub_GAME_7F02D734 /* 062BF0 7F02E0C0 0FC28F87 */ jal sub_GAME_7F0A3E1C /* 062BF4 7F02E0C4 91A70003 */ lbu $a3, 3($t5) .L7F02E0C8: -/* 062BF8 7F02E0C8 3C058008 */ lui $a1, %hi(dword_CODE_bss_8007BA04) -/* 062BFC 7F02E0CC 8CA5BA04 */ lw $a1, %lo(dword_CODE_bss_8007BA04)($a1) +/* 062BF8 7F02E0C8 3C058008 */ lui $a1, %hi(stanSavedColl_posData) +/* 062BFC 7F02E0CC 8CA5BA04 */ lw $a1, %lo(stanSavedColl_posData)($a1) /* 062C00 7F02E0D0 8FAE0274 */ lw $t6, 0x274($sp) /* 062C04 7F02E0D4 2406FFFF */ li $a2, -1 /* 062C08 7F02E0D8 10A0002D */ beqz $a1, .L7F02E190 @@ -14500,8 +14493,8 @@ glabel sub_GAME_7F02D734 /* 062C10 7F02E0E0 00E02025 */ move $a0, $a3 /* 062C14 7F02E0E4 0FC19107 */ jal recall_joy2_hits_edit_detail_edit_flag /* 062C18 7F02E0E8 2406FFFF */ li $a2, -1 -/* 062C1C 7F02E0EC 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007BA04) -/* 062C20 7F02E0F0 8C63BA04 */ lw $v1, %lo(dword_CODE_bss_8007BA04)($v1) +/* 062C1C 7F02E0EC 3C038008 */ lui $v1, %hi(stanSavedColl_posData) +/* 062C20 7F02E0F0 8C63BA04 */ lw $v1, %lo(stanSavedColl_posData)($v1) /* 062C24 7F02E0F4 24010003 */ li $at, 3 /* 062C28 7F02E0F8 8FAF0288 */ lw $t7, 0x288($sp) /* 062C2C 7F02E0FC 90620000 */ lbu $v0, ($v1) @@ -14532,8 +14525,8 @@ glabel sub_GAME_7F02D734 /* 062C88 7F02E158 81240080 */ lb $a0, 0x80($t1) /* 062C8C 7F02E15C 0FC26C54 */ jal get_cur_playernum /* 062C90 7F02E160 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 062C94 7F02E164 3C0B8008 */ lui $t3, %hi(dword_CODE_bss_8007BA04) -/* 062C98 7F02E168 8D6BBA04 */ lw $t3, %lo(dword_CODE_bss_8007BA04)($t3) +/* 062C94 7F02E164 3C0B8008 */ lui $t3, %hi(stanSavedColl_posData) +/* 062C98 7F02E168 8D6BBA04 */ lw $t3, %lo(stanSavedColl_posData)($t3) /* 062C9C 7F02E16C 8FAA0274 */ lw $t2, 0x274($sp) /* 062CA0 7F02E170 8FA5004C */ lw $a1, 0x4c($sp) /* 062CA4 7F02E174 8D640004 */ lw $a0, 4($t3) @@ -17853,7 +17846,7 @@ glabel sub_GAME_7F03081C /* 065588 7F030A58 24080001 */ li $t0, 1 /* 06558C 7F030A5C AFA80088 */ sw $t0, 0x88($sp) /* 065590 7F030A60 27A40078 */ addiu $a0, $sp, 0x78 -/* 065594 7F030A64 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 065594 7F030A64 0FC2CA2C */ jal getCollisionEdge_maybe /* 065598 7F030A68 27A5006C */ addiu $a1, $sp, 0x6c /* 06559C 7F030A6C 27A40078 */ addiu $a0, $sp, 0x78 /* 0655A0 7F030A70 27A5006C */ addiu $a1, $sp, 0x6c @@ -17928,7 +17921,7 @@ glabel sub_GAME_7F03081C /* 0656AC 7F030B7C 240C0001 */ li $t4, 1 /* 0656B0 7F030B80 AFAC0084 */ sw $t4, 0x84($sp) /* 0656B4 7F030B84 27A40060 */ addiu $a0, $sp, 0x60 -/* 0656B8 7F030B88 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 0656B8 7F030B88 0FC2CA2C */ jal getCollisionEdge_maybe /* 0656BC 7F030B8C 27A50054 */ addiu $a1, $sp, 0x54 /* 0656C0 7F030B90 27A40060 */ addiu $a0, $sp, 0x60 /* 0656C4 7F030B94 27A50054 */ addiu $a1, $sp, 0x54 @@ -18040,7 +18033,7 @@ glabel sub_GAME_7F03081C /* 06585C 7F030D2C AFAB0050 */ sw $t3, 0x50($sp) .L7F030D30: /* 065860 7F030D30 8FA400C0 */ lw $a0, 0xc0($sp) -/* 065864 7F030D34 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 065864 7F030D34 0FC2CA2C */ jal getCollisionEdge_maybe /* 065868 7F030D38 8FA500C4 */ lw $a1, 0xc4($sp) /* 06586C 7F030D3C 8FA400C0 */ lw $a0, 0xc0($sp) /* 065870 7F030D40 8FA500C4 */ lw $a1, 0xc4($sp) @@ -18228,14 +18221,14 @@ glabel sub_GAME_7F030D70 /* 065ADC 7F030FAC 24080001 */ li $t0, 1 /* 065AE0 7F030FB0 AFA80090 */ sw $t0, 0x90($sp) /* 065AE4 7F030FB4 27A40080 */ addiu $a0, $sp, 0x80 -/* 065AE8 7F030FB8 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 065AE8 7F030FB8 0FC2CA2C */ jal getCollisionEdge_maybe /* 065AEC 7F030FBC 27A50074 */ addiu $a1, $sp, 0x74 /* 065AF0 7F030FC0 27A40080 */ addiu $a0, $sp, 0x80 /* 065AF4 7F030FC4 27A50074 */ addiu $a1, $sp, 0x74 /* 065AF8 7F030FC8 0FC0C1D3 */ jal sub_GAME_7F03074C /* 065AFC 7F030FCC 27A600A8 */ addiu $a2, $sp, 0xa8 -/* 065B00 7F030FD0 3C018008 */ lui $at, %hi(flt_CODE_bss_8007BA00) -/* 065B04 7F030FD4 C42ABA00 */ lwc1 $f10, %lo(flt_CODE_bss_8007BA00)($at) +/* 065B00 7F030FD0 3C018008 */ lui $at, %hi(stanSavedColl_someMin) +/* 065B04 7F030FD4 C42ABA00 */ lwc1 $f10, %lo(stanSavedColl_someMin)($at) /* 065B08 7F030FD8 E7AA0054 */ swc1 $f10, 0x54($sp) .L7F030FDC: /* 065B0C 7F030FDC 8FA900C0 */ lw $t1, 0xc0($sp) @@ -18306,14 +18299,14 @@ glabel sub_GAME_7F030D70 /* 065C0C 7F0310DC 240C0001 */ li $t4, 1 /* 065C10 7F0310E0 AFAC008C */ sw $t4, 0x8c($sp) /* 065C14 7F0310E4 27A40068 */ addiu $a0, $sp, 0x68 -/* 065C18 7F0310E8 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 065C18 7F0310E8 0FC2CA2C */ jal getCollisionEdge_maybe /* 065C1C 7F0310EC 27A5005C */ addiu $a1, $sp, 0x5c /* 065C20 7F0310F0 27A40068 */ addiu $a0, $sp, 0x68 /* 065C24 7F0310F4 27A5005C */ addiu $a1, $sp, 0x5c /* 065C28 7F0310F8 0FC0C1D3 */ jal sub_GAME_7F03074C /* 065C2C 7F0310FC 27A600A8 */ addiu $a2, $sp, 0xa8 -/* 065C30 7F031100 3C018008 */ lui $at, %hi(flt_CODE_bss_8007BA00) -/* 065C34 7F031104 C428BA00 */ lwc1 $f8, %lo(flt_CODE_bss_8007BA00)($at) +/* 065C30 7F031100 3C018008 */ lui $at, %hi(stanSavedColl_someMin) +/* 065C34 7F031104 C428BA00 */ lwc1 $f8, %lo(stanSavedColl_someMin)($at) /* 065C38 7F031108 E7A80050 */ swc1 $f8, 0x50($sp) .L7F03110C: /* 065C3C 7F03110C 8FAD0090 */ lw $t5, 0x90($sp) @@ -18434,7 +18427,7 @@ glabel sub_GAME_7F030D70 /* 065DF8 7F0312C8 AFAB0058 */ sw $t3, 0x58($sp) .L7F0312CC: /* 065DFC 7F0312CC 8FA400C8 */ lw $a0, 0xc8($sp) -/* 065E00 7F0312D0 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 065E00 7F0312D0 0FC2CA2C */ jal getCollisionEdge_maybe /* 065E04 7F0312D4 8FA500CC */ lw $a1, 0xcc($sp) /* 065E08 7F0312D8 8FA400C8 */ lw $a0, 0xc8($sp) /* 065E0C 7F0312DC 8FA500CC */ lw $a1, 0xcc($sp) @@ -20449,7 +20442,7 @@ glabel sub_GAME_7F032C78 /* 067800 7F032CD0 30A90008 */ andi $t1, $a1, 8 /* 067804 7F032CD4 1120001C */ beqz $t1, .L7F032D48 /* 067808 7F032CD8 00000000 */ nop -/* 06780C 7F032CDC 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 06780C 7F032CDC 0FC0CBE5 */ jal convertPadIf9000 /* 067810 7F032CE0 00C02825 */ move $a1, $a2 /* 067814 7F032CE4 28412710 */ slti $at, $v0, 0x2710 /* 067818 7F032CE8 1020000A */ beqz $at, .L7F032D14 @@ -20540,43 +20533,21 @@ glabel get_angle_between_actor_cur_player #endif - -#ifdef NONMATCHING -void sub_GAME_7F032DE4(void) { - +float distToBond3D(struct chrdata *guardData) +{ + struct prop *guardPosData; + struct prop *playerPosData; + float xDiff; + float yDiff; + float zDiff; + + guardPosData = guardData->posdata; + playerPosData = get_curplayer_positiondata(); + xDiff = (playerPosData->position).x - (guardPosData->position).x; + yDiff = (playerPosData->position).y - (guardPosData->position).y; + zDiff = (playerPosData->position).z - (guardPosData->position).z; + return sqrtf(xDiff * xDiff + yDiff * yDiff + zDiff * zDiff); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F032DE4 -/* 067914 7F032DE4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 067918 7F032DE8 AFBF0014 */ sw $ra, 0x14($sp) -/* 06791C 7F032DEC 8C830018 */ lw $v1, 0x18($a0) -/* 067920 7F032DF0 0FC225E6 */ jal get_curplayer_positiondata -/* 067924 7F032DF4 AFA3001C */ sw $v1, 0x1c($sp) -/* 067928 7F032DF8 8FA3001C */ lw $v1, 0x1c($sp) -/* 06792C 7F032DFC C4440008 */ lwc1 $f4, 8($v0) -/* 067930 7F032E00 C448000C */ lwc1 $f8, 0xc($v0) -/* 067934 7F032E04 C4660008 */ lwc1 $f6, 8($v1) -/* 067938 7F032E08 C46A000C */ lwc1 $f10, 0xc($v1) -/* 06793C 7F032E0C C4500010 */ lwc1 $f16, 0x10($v0) -/* 067940 7F032E10 46062001 */ sub.s $f0, $f4, $f6 -/* 067944 7F032E14 C4720010 */ lwc1 $f18, 0x10($v1) -/* 067948 7F032E18 460A4081 */ sub.s $f2, $f8, $f10 -/* 06794C 7F032E1C 46000102 */ mul.s $f4, $f0, $f0 -/* 067950 7F032E20 46128381 */ sub.s $f14, $f16, $f18 -/* 067954 7F032E24 46021182 */ mul.s $f6, $f2, $f2 -/* 067958 7F032E28 46062200 */ add.s $f8, $f4, $f6 -/* 06795C 7F032E2C 460E7282 */ mul.s $f10, $f14, $f14 -/* 067960 7F032E30 0C007DF8 */ jal sqrtf -/* 067964 7F032E34 460A4300 */ add.s $f12, $f8, $f10 -/* 067968 7F032E38 8FBF0014 */ lw $ra, 0x14($sp) -/* 06796C 7F032E3C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 067970 7F032E40 03E00008 */ jr $ra -/* 067974 7F032E44 00000000 */ nop -) -#endif - #ifdef NONMATCHING @@ -20590,7 +20561,7 @@ glabel sub_GAME_7F032E48 /* 067978 7F032E48 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 06797C 7F032E4C AFBF0014 */ sw $ra, 0x14($sp) /* 067980 7F032E50 8C860018 */ lw $a2, 0x18($a0) -/* 067984 7F032E54 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 067984 7F032E54 0FC0CBE5 */ jal convertPadIf9000 /* 067988 7F032E58 AFA6001C */ sw $a2, 0x1c($sp) /* 06798C 7F032E5C 28412710 */ slti $at, $v0, 0x2710 /* 067990 7F032E60 1020000A */ beqz $at, .L7F032E8C @@ -20649,7 +20620,7 @@ GLOBAL_ASM( glabel check_if_room_for_preset_loaded /* 067A2C 7F032EFC 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 067A30 7F032F00 AFBF0014 */ sw $ra, 0x14($sp) -/* 067A34 7F032F04 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 067A34 7F032F04 0FC0CBE5 */ jal convertPadIf9000 /* 067A38 7F032F08 00000000 */ nop /* 067A3C 7F032F0C 28412710 */ slti $at, $v0, 0x2710 /* 067A40 7F032F10 1020000A */ beqz $at, .L7F032F3C @@ -20677,7 +20648,7 @@ glabel check_if_room_for_preset_loaded /* 067A90 7F032F60 00001025 */ move $v0, $zero /* 067A94 7F032F64 10800007 */ beqz $a0, .L7F032F84 /* 067A98 7F032F68 00000000 */ nop -/* 067A9C 7F032F6C 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 067A9C 7F032F6C 0FC2CBF6 */ jal getTileRoom /* 067AA0 7F032F70 00000000 */ nop /* 067AA4 7F032F74 0FC2D794 */ jal sub_GAME_7F0B5E50 /* 067AA8 7F032F78 00402025 */ move $a0, $v0 @@ -20693,25 +20664,14 @@ glabel check_if_room_for_preset_loaded #endif - -#ifdef NONMATCHING -void sub_GAME_7F032F94(void) { - +s32 convertPadIf9000(struct chrdata *guardData,s32 padNo) +{ + // Guard's target pad. + if (padNo == PAD_PRESET) { + padNo = (s32)guardData->padpreset1; + } + return padNo; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F032F94 -/* 067AC4 7F032F94 24012328 */ li $at, 9000 -/* 067AC8 7F032F98 14A10002 */ bne $a1, $at, .L7F032FA4 -/* 067ACC 7F032F9C 00000000 */ nop -/* 067AD0 7F032FA0 84850114 */ lh $a1, 0x114($a0) -.L7F032FA4: -/* 067AD4 7F032FA4 03E00008 */ jr $ra -/* 067AD8 7F032FA8 00A01025 */ move $v0, $a1 -) -#endif - #ifdef NONMATCHING @@ -20891,7 +20851,7 @@ glabel get_distance_between_actor_and_preset /* 067C94 7F033164 AFA50024 */ sw $a1, 0x24($sp) /* 067C98 7F033168 8FA40020 */ lw $a0, 0x20($sp) /* 067C9C 7F03316C 8FA50024 */ lw $a1, 0x24($sp) -/* 067CA0 7F033170 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 067CA0 7F033170 0FC0CBE5 */ jal convertPadIf9000 /* 067CA4 7F033174 AFA2001C */ sw $v0, 0x1c($sp) /* 067CA8 7F033178 28412710 */ slti $at, $v0, 0x2710 /* 067CAC 7F03317C 1020000A */ beqz $at, .L7F0331A8 @@ -21277,7 +21237,7 @@ glabel sub_GAME_7F0333F8 /* 067F68 7F033438 8FA40044 */ lw $a0, 0x44($sp) /* 067F6C 7F03343C 0FC1B2E6 */ jal getsuboffset /* 067F70 7F033440 27A50020 */ addiu $a1, $sp, 0x20 -/* 067F74 7F033444 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 067F74 7F033444 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 067F78 7F033448 00000000 */ nop /* 067F7C 7F03344C 00402025 */ move $a0, $v0 /* 067F80 7F033450 0FC1611D */ jal matrix_4x4_transform_vector_in_place @@ -22205,7 +22165,7 @@ GLOBAL_ASM( glabel sub_GAME_7F033D5C /* 06888C 7F033D5C 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 068890 7F033D60 AFBF0014 */ sw $ra, 0x14($sp) -/* 068894 7F033D64 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 068894 7F033D64 0FC0CBE5 */ jal convertPadIf9000 /* 068898 7F033D68 AFA40018 */ sw $a0, 0x18($sp) /* 06889C 7F033D6C 8FAE0018 */ lw $t6, 0x18($sp) /* 0688A0 7F033D70 A5C20114 */ sh $v0, 0x114($t6) @@ -22234,7 +22194,7 @@ glabel sub_GAME_7F033D84 /* 0688C8 7F033D98 10400006 */ beqz $v0, .L7F033DB4 /* 0688CC 7F033D9C 8FA40020 */ lw $a0, 0x20($sp) /* 0688D0 7F033DA0 8FA50028 */ lw $a1, 0x28($sp) -/* 0688D4 7F033DA4 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 0688D4 7F033DA4 0FC0CBE5 */ jal convertPadIf9000 /* 0688D8 7F033DA8 AFA2001C */ sw $v0, 0x1c($sp) /* 0688DC 7F033DAC 8FA3001C */ lw $v1, 0x1c($sp) /* 0688E0 7F033DB0 A4620114 */ sh $v0, 0x114($v1) @@ -22280,7 +22240,7 @@ glabel sub_GAME_7F033DC4 /* 068948 7F033E18 1000001F */ b .L7F033E98 /* 06894C 7F033E1C 00001025 */ move $v0, $zero .L7F033E20: -/* 068950 7F033E20 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 068950 7F033E20 0FC2CA2C */ jal getCollisionEdge_maybe /* 068954 7F033E24 27A5003C */ addiu $a1, $sp, 0x3c /* 068958 7F033E28 8E060014 */ lw $a2, 0x14($s0) /* 06895C 7F033E2C 26230008 */ addiu $v1, $s1, 8 @@ -22336,7 +22296,7 @@ glabel sub_GAME_7F033EAC /* 0689E8 7F033EB8 240E0001 */ li $t6, 1 /* 0689EC 7F033EBC AFA50034 */ sw $a1, 0x34($sp) /* 0689F0 7F033EC0 AFAE002C */ sw $t6, 0x2c($sp) -/* 0689F4 7F033EC4 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 0689F4 7F033EC4 0FC2CBF6 */ jal getTileRoom /* 0689F8 7F033EC8 00A02025 */ move $a0, $a1 /* 0689FC 7F033ECC 0FC2D794 */ jal sub_GAME_7F0B5E50 /* 068A00 7F033ED0 00402025 */ move $a0, $v0 @@ -22346,7 +22306,7 @@ glabel sub_GAME_7F033EAC /* 068A10 7F033EE0 24050000 */ li $a1, 0 /* 068A14 7F033EE4 50400014 */ beql $v0, $zero, .L7F033F38 /* 068A18 7F033EE8 8FBF0014 */ lw $ra, 0x14($sp) -/* 068A1C 7F033EEC 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 068A1C 7F033EEC 0FC2CBF6 */ jal getTileRoom /* 068A20 7F033EF0 8FA40034 */ lw $a0, 0x34($sp) /* 068A24 7F033EF4 00402025 */ move $a0, $v0 /* 068A28 7F033EF8 0FC2CF03 */ jal sub_GAME_7F0B3C0C @@ -22549,7 +22509,7 @@ glabel actionblock_guard_constructor_BDBE /* 068C94 7F034164 AFA40040 */ sw $a0, 0x40($sp) /* 068C98 7F034168 AFA50044 */ sw $a1, 0x44($sp) /* 068C9C 7F03416C AFA60048 */ sw $a2, 0x48($sp) -/* 068CA0 7F034170 0FC07FF0 */ jal get_next_available_guardID +/* 068CA0 7F034170 0FC07FF0 */ jal chrGetNumFree /* 068CA4 7F034174 AFA7004C */ sw $a3, 0x4c($sp) /* 068CA8 7F034178 28410003 */ slti $at, $v0, 3 /* 068CAC 7F03417C 14200031 */ bnez $at, .L7F034244 @@ -22627,7 +22587,7 @@ glabel guard_constructor_BD /* 068D8C 7F03425C AFBF0024 */ sw $ra, 0x24($sp) /* 068D90 7F034260 AFA50034 */ sw $a1, 0x34($sp) /* 068D94 7F034264 AFA60038 */ sw $a2, 0x38($sp) -/* 068D98 7F034268 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 068D98 7F034268 0FC0CBE5 */ jal convertPadIf9000 /* 068D9C 7F03426C 00E02825 */ move $a1, $a3 /* 068DA0 7F034270 28412710 */ slti $at, $v0, 0x2710 /* 068DA4 7F034274 1020000A */ beqz $at, .L7F0342A0 @@ -22736,7 +22696,7 @@ glabel check_if_actorID_is_at_preset /* 068EC8 7F034398 AFA60028 */ sw $a2, 0x28($sp) /* 068ECC 7F03439C 8FA40020 */ lw $a0, 0x20($sp) /* 068ED0 7F0343A0 8FA50028 */ lw $a1, 0x28($sp) -/* 068ED4 7F0343A4 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 068ED4 7F0343A4 0FC0CBE5 */ jal convertPadIf9000 /* 068ED8 7F0343A8 AFA20018 */ sw $v0, 0x18($sp) /* 068EDC 7F0343AC 28412710 */ slti $at, $v0, 0x2710 /* 068EE0 7F0343B0 1020000A */ beqz $at, .L7F0343DC @@ -22801,7 +22761,7 @@ glabel check_if_actor_is_at_preset /* 068F8C 7F03445C AFA50024 */ sw $a1, 0x24($sp) /* 068F90 7F034460 AFA2001C */ sw $v0, 0x1c($sp) /* 068F94 7F034464 8FA40020 */ lw $a0, 0x20($sp) -/* 068F98 7F034468 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 068F98 7F034468 0FC0CBE5 */ jal convertPadIf9000 /* 068F9C 7F03446C 8FA50024 */ lw $a1, 0x24($sp) /* 068FA0 7F034470 28412710 */ slti $at, $v0, 0x2710 /* 068FA4 7F034474 1020000A */ beqz $at, .L7F0344A0 @@ -22883,7 +22843,7 @@ glabel removed_animation_routine_2B { s32 temp_ret; - arg1 = sub_GAME_7F032F94(); + arg1 = convertPadIf9000(); if (true_if_actor_dying_fading_limping_shot(arg0) != 0) { temp_ret = scan_position_data_table_for_normal_object_at_preset(arg1); @@ -22904,7 +22864,7 @@ GLOBAL_ASM( glabel sub_GAME_7F034514 /* 069044 7F034514 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 069048 7F034518 AFBF0014 */ sw $ra, 0x14($sp) -/* 06904C 7F03451C 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 06904C 7F03451C 0FC0CBE5 */ jal convertPadIf9000 /* 069050 7F034520 AFA40018 */ sw $a0, 0x18($sp) /* 069054 7F034524 AFA2001C */ sw $v0, 0x1c($sp) /* 069058 7F034528 0FC0A896 */ jal true_if_actor_dying_fading_limping_shot @@ -22950,7 +22910,7 @@ glabel sub_GAME_7F034514 { return 0; } - if (sub_GAME_7F032DE4(arg0) < 10.0f) + if (distToBond3D(arg0) < 10.0f) { return 0; } @@ -23022,7 +22982,7 @@ glabel actor_draws_throws_grenade_at_player_if_possible /* 0690DC 7F0345AC 1000004E */ b .L7F0346E8 /* 0690E0 7F0345B0 00001025 */ move $v0, $zero .L7F0345B4: -/* 0690E4 7F0345B4 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 0690E4 7F0345B4 0FC0CB79 */ jal distToBond3D /* 0690E8 7F0345B8 02002025 */ move $a0, $s0 /* 0690EC 7F0345BC 3C014120 */ li $at, 0x41200000 # 10.000000 /* 0690F0 7F0345C0 44812000 */ mtc1 $at, $f4 @@ -23132,7 +23092,7 @@ glabel actor_draws_throws_grenade_at_player_if_possible temp_a0 = temp_ret->unk14; sp1C = temp_ret; set_obj_instance_controller_scale(temp_a0, temp_a0->unk14); - sub_GAME_7F03A5A4(sp1C->unk10, arg0->unk18); + attachNewChild(sp1C->unk10, arg0->unk18); sp1C->unk82 = (u16)0xb4; sub_GAME_7F04BFD0(sp1C->unk10, 1); arg0->unk12 = (s16) (arg0->unk12 | 1); @@ -23165,7 +23125,7 @@ glabel actor_drops_itemtype_setting_timer /* 069270 7F034740 8FA3001C */ lw $v1, 0x1c($sp) /* 069274 7F034744 8FB80020 */ lw $t8, 0x20($sp) /* 069278 7F034748 8C640010 */ lw $a0, 0x10($v1) -/* 06927C 7F03474C 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 06927C 7F03474C 0FC0E969 */ jal attachNewChild /* 069280 7F034750 8F050018 */ lw $a1, 0x18($t8) /* 069284 7F034754 8FA3001C */ lw $v1, 0x1c($sp) /* 069288 7F034758 241900B4 */ li $t9, 180 diff --git a/src/game/chrai.c b/src/game/chrai.c index 7f4662a1..7bc93f4a 100644 --- a/src/game/chrai.c +++ b/src/game/chrai.c @@ -140,7 +140,7 @@ char dword_CODE_bss_80075C10[0x78]; char dword_CODE_bss_80075C88[0x78]; //CODE.bss:80075D00 -void * ptr_setup_path_tbl; +struct Pad * ptr_setup_path_tbl; //CODE.bss:80075D04 void * ptr_setup_path_link; //CODE.bss:80075D08 @@ -4023,7 +4023,7 @@ action42_If_Current_Guard_On_Screen_In_Loaded_Room_RVL_2: /* 06B0E0 7F0365B0 26310002 */ addiu $s1, $s1, 2 action43_If_Guard_In_A_Room_Currently_Loaded_RVL_2: /* 06B0E4 7F0365B4 8EEC0018 */ lw $t4, 0x18($s7) -/* 06B0E8 7F0365B8 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 06B0E8 7F0365B8 0FC2CBF6 */ jal getTileRoom /* 06B0EC 7F0365BC 8D840014 */ lw $a0, 0x14($t4) /* 06B0F0 7F0365C0 0FC2D794 */ jal sub_GAME_7F0B5E50 /* 06B0F4 7F0365C4 00402025 */ move $a0, $v0 @@ -4227,7 +4227,7 @@ action4B_RVL_If_In_Proximity_Of_Bond_4: /* 06B3BC 7F03688C 00000000 */ nop /* 06B3C0 7F036890 468042A0 */ cvt.s.w $f10, $f8 /* 06B3C4 7F036894 46185402 */ mul.s $f16, $f10, $f24 -/* 06B3C8 7F036898 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 06B3C8 7F036898 0FC0CB79 */ jal distToBond3D /* 06B3CC 7F03689C E7B005FC */ swc1 $f16, 0x5fc($sp) /* 06B3D0 7F0368A0 C7B205FC */ lwc1 $f18, 0x5fc($sp) /* 06B3D4 7F0368A4 02C02025 */ move $a0, $s6 @@ -4255,7 +4255,7 @@ action4C_RVL_If_Not_In_Proximity_Of_Bond_4: /* 06B424 7F0368F4 00000000 */ nop /* 06B428 7F0368F8 468021A0 */ cvt.s.w $f6, $f4 /* 06B42C 7F0368FC 46183202 */ mul.s $f8, $f6, $f24 -/* 06B430 7F036900 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 06B430 7F036900 0FC0CB79 */ jal distToBond3D /* 06B434 7F036904 E7A805F4 */ swc1 $f8, 0x5f4($sp) /* 06B438 7F036908 C7AA05F4 */ lwc1 $f10, 0x5f4($sp) /* 06B43C 7F03690C 02C02025 */ move $a0, $s6 @@ -4932,7 +4932,7 @@ action64_Type_16_Object_Equipped_On_Guard_3: /* 06BDB4 7F037284 26520003 */ addiu $s2, $s2, 3 /* 06BDB8 7F037288 8E040010 */ lw $a0, 0x10($s0) .L7F03728C: -/* 06BDBC 7F03728C 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 06BDBC 7F03728C 0FC0E969 */ jal attachNewChild /* 06BDC0 7F037290 8E650018 */ lw $a1, 0x18($s3) .L7F037294: /* 06BDC4 7F037294 26520003 */ addiu $s2, $s2, 3 @@ -4994,7 +4994,7 @@ action65_Object_Moved_To_Preset_4: /* 06BE94 7F037364 C60A0010 */ lwc1 $f10, 0x10($s0) /* 06BE98 7F037368 E7AA0020 */ swc1 $f10, 0x20($sp) /* 06BE9C 7F03736C C6100014 */ lwc1 $f16, 0x14($s0) -/* 06BEA0 7F037370 0FC16642 */ jal sub_GAME_7F059908 +/* 06BEA0 7F037370 0FC16642 */ jal matrix_4x4_7F059908 /* 06BEA4 7F037374 E7B00024 */ swc1 $f16, 0x24($sp) /* 06BEA8 7F037378 8E620014 */ lw $v0, 0x14($s3) /* 06BEAC 7F03737C 27A504B8 */ addiu $a1, $sp, 0x4b8 @@ -5881,7 +5881,7 @@ action8F_Set_Guard_Health_3: /* 06CAF8 7F037FC8 468054A0 */ cvt.s.w $f18, $f10 /* 06CAFC 7F037FCC 46069002 */ mul.s $f0, $f18, $f6 /* 06CB00 7F037FD0 44050000 */ mfc1 $a1, $f0 -/* 06CB04 7F037FD4 0FC08006 */ jal sub_GAME_7F020018 +/* 06CB04 7F037FD4 0FC08006 */ jal chrSetMaxDamage /* 06CB08 7F037FD8 00000000 */ nop /* 06CB0C 7F037FDC 26520003 */ addiu $s2, $s2, 3 /* 06CB10 7F037FE0 1000F56A */ b GetByteS1_ParseCommandByte_SwitchCase @@ -5898,7 +5898,7 @@ action90_Set_Guard_Armor_Amount_3: /* 06CB38 7F038008 46808220 */ cvt.s.w $f8, $f16 /* 06CB3C 7F03800C 46044002 */ mul.s $f0, $f8, $f4 /* 06CB40 7F038010 44050000 */ mfc1 $a1, $f0 -/* 06CB44 7F038014 0FC08015 */ jal sub_GAME_7F020054 +/* 06CB44 7F038014 0FC08015 */ jal chrAddHealth /* 06CB48 7F038018 00000000 */ nop /* 06CB4C 7F03801C 26520003 */ addiu $s2, $s2, 3 /* 06CB50 7F038020 1000F55A */ b GetByteS1_ParseCommandByte_SwitchCase @@ -7560,7 +7560,7 @@ actionD9_GuardIDMovedToPresetReturnLoopIfSuccessful_5: /* 06E2EC 7F0397BC 1040005E */ beqz $v0, .L7F039938 /* 06E2F0 7F0397C0 00408025 */ move $s0, $v0 /* 06E2F4 7F0397C4 02E02025 */ move $a0, $s7 -/* 06E2F8 7F0397C8 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 06E2F8 7F0397C8 0FC0CBE5 */ jal convertPadIf9000 /* 06E2FC 7F0397CC 02602825 */ move $a1, $s3 /* 06E300 7F0397D0 28412710 */ slti $at, $v0, 0x2710 /* 06E304 7F0397D4 1020000A */ beqz $at, .L7F039800 @@ -7676,11 +7676,11 @@ actionDA_Fade_Out_From_Cut_Scene_1: /* 06E4A4 7F039974 11A10008 */ beq $t5, $at, .L7F039998 /* 06E4A8 7F039978 00002825 */ move $a1, $zero /* 06E4AC 7F03997C 4407A000 */ mfc1 $a3, $f20 -/* 06E4B0 7F039980 0FC201EC */ jal set_rgba_tint +/* 06E4B0 7F039980 0FC201EC */ jal currentPlayerSetFadeColour /* 06E4B4 7F039984 00003025 */ move $a2, $zero /* 06E4B8 7F039988 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 06E4BC 7F03998C 44817000 */ mtc1 $at, $f14 -/* 06E4C0 7F039990 0FC20216 */ jal fade_to_over_seconds +/* 06E4C0 7F039990 0FC20216 */ jal currentPlayerSetFadeFrac /* 06E4C4 7F039994 4600B306 */ mov.s $f12, $f22 .L7F039998: /* 06E4C8 7F039998 26520001 */ addiu $s2, $s2, 1 @@ -7694,10 +7694,10 @@ actionDB_Fade_In_From_Black_Reset_DA_1: /* 06E4E4 7F0399B4 11C10007 */ beq $t6, $at, .L7F0399D4 /* 06E4E8 7F0399B8 00002825 */ move $a1, $zero /* 06E4EC 7F0399BC 00003025 */ move $a2, $zero -/* 06E4F0 7F0399C0 0FC201EC */ jal set_rgba_tint +/* 06E4F0 7F0399C0 0FC201EC */ jal currentPlayerSetFadeColour /* 06E4F4 7F0399C4 3C073F80 */ li $a3, 0x3F800000 # 1.000000 /* 06E4F8 7F0399C8 4600B306 */ mov.s $f12, $f22 -/* 06E4FC 7F0399CC 0FC20216 */ jal fade_to_over_seconds +/* 06E4FC 7F0399CC 0FC20216 */ jal currentPlayerSetFadeFrac /* 06E500 7F0399D0 4600A386 */ mov.s $f14, $f20 .L7F0399D4: /* 06E504 7F0399D4 26520001 */ addiu $s2, $s2, 1 @@ -7812,7 +7812,7 @@ actionE0_Guard_ID_Draws_Weapon_num_3: /* 06E680 7F039B50 1000EE8E */ b GetByteS1_ParseCommandByte_SwitchCase /* 06E684 7F039B54 26310003 */ addiu $s1, $s1, 3 actionE1_If_Fewer_than_This_Many_Players_Playing_RVL_3: -/* 06E688 7F039B58 0FC26919 */ jal get_num_players +/* 06E688 7F039B58 0FC26919 */ jal getPlayerCount /* 06E68C 7F039B5C 00000000 */ nop /* 06E690 7F039B60 822A0001 */ lb $t2, 1($s1) /* 06E694 7F039B64 02C02025 */ move $a0, $s6 @@ -9890,7 +9890,7 @@ action42_If_Current_Guard_On_Screen_In_Loaded_Room_RVL_2: /* 06B0E0 7F0365B0 26310002 */ addiu $s1, $s1, 2 action43_If_Guard_In_A_Room_Currently_Loaded_RVL_2: /* 06B0E4 7F0365B4 8EEC0018 */ lw $t4, 0x18($s7) -/* 06B0E8 7F0365B8 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 06B0E8 7F0365B8 0FC2CBF6 */ jal getTileRoom /* 06B0EC 7F0365BC 8D840014 */ lw $a0, 0x14($t4) /* 06B0F0 7F0365C0 0FC2D794 */ jal sub_GAME_7F0B5E50 /* 06B0F4 7F0365C4 00402025 */ move $a0, $v0 @@ -10094,7 +10094,7 @@ action4B_RVL_If_In_Proximity_Of_Bond_4: /* 06B3BC 7F03688C 00000000 */ nop /* 06B3C0 7F036890 468042A0 */ cvt.s.w $f10, $f8 /* 06B3C4 7F036894 46185402 */ mul.s $f16, $f10, $f24 -/* 06B3C8 7F036898 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 06B3C8 7F036898 0FC0CB79 */ jal distToBond3D /* 06B3CC 7F03689C E7B005FC */ swc1 $f16, 0x5fc($sp) /* 06B3D0 7F0368A0 C7B205FC */ lwc1 $f18, 0x5fc($sp) /* 06B3D4 7F0368A4 02C02025 */ move $a0, $s6 @@ -10122,7 +10122,7 @@ action4C_RVL_If_Not_In_Proximity_Of_Bond_4: /* 06B424 7F0368F4 00000000 */ nop /* 06B428 7F0368F8 468021A0 */ cvt.s.w $f6, $f4 /* 06B42C 7F0368FC 46183202 */ mul.s $f8, $f6, $f24 -/* 06B430 7F036900 0FC0CB79 */ jal sub_GAME_7F032DE4 +/* 06B430 7F036900 0FC0CB79 */ jal distToBond3D /* 06B434 7F036904 E7A805F4 */ swc1 $f8, 0x5f4($sp) /* 06B438 7F036908 C7AA05F4 */ lwc1 $f10, 0x5f4($sp) /* 06B43C 7F03690C 02C02025 */ move $a0, $s6 @@ -10799,7 +10799,7 @@ action64_Type_16_Object_Equipped_On_Guard_3: /* 06BDB4 7F037284 26520003 */ addiu $s2, $s2, 3 /* 06BDB8 7F037288 8E040010 */ lw $a0, 0x10($s0) .L7F03728C: -/* 06BDBC 7F03728C 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 06BDBC 7F03728C 0FC0E969 */ jal attachNewChild /* 06BDC0 7F037290 8E650018 */ lw $a1, 0x18($s3) .L7F037294: /* 06BDC4 7F037294 26520003 */ addiu $s2, $s2, 3 @@ -10861,7 +10861,7 @@ action65_Object_Moved_To_Preset_4: /* 06BE94 7F037364 C60A0010 */ lwc1 $f10, 0x10($s0) /* 06BE98 7F037368 E7AA0020 */ swc1 $f10, 0x20($sp) /* 06BE9C 7F03736C C6100014 */ lwc1 $f16, 0x14($s0) -/* 06BEA0 7F037370 0FC16642 */ jal sub_GAME_7F059908 +/* 06BEA0 7F037370 0FC16642 */ jal matrix_4x4_7F059908 /* 06BEA4 7F037374 E7B00024 */ swc1 $f16, 0x24($sp) /* 06BEA8 7F037378 8E620014 */ lw $v0, 0x14($s3) /* 06BEAC 7F03737C 27A504B8 */ addiu $a1, $sp, 0x4b8 @@ -11748,7 +11748,7 @@ action8F_Set_Guard_Health_3: /* 06CAF8 7F037FC8 468054A0 */ cvt.s.w $f18, $f10 /* 06CAFC 7F037FCC 46069002 */ mul.s $f0, $f18, $f6 /* 06CB00 7F037FD0 44050000 */ mfc1 $a1, $f0 -/* 06CB04 7F037FD4 0FC08006 */ jal sub_GAME_7F020018 +/* 06CB04 7F037FD4 0FC08006 */ jal chrSetMaxDamage /* 06CB08 7F037FD8 00000000 */ nop /* 06CB0C 7F037FDC 26520003 */ addiu $s2, $s2, 3 /* 06CB10 7F037FE0 1000F56A */ b GetByteS1_ParseCommandByte_SwitchCase @@ -11765,7 +11765,7 @@ action90_Set_Guard_Armor_Amount_3: /* 06CB38 7F038008 46808220 */ cvt.s.w $f8, $f16 /* 06CB3C 7F03800C 46044002 */ mul.s $f0, $f8, $f4 /* 06CB40 7F038010 44050000 */ mfc1 $a1, $f0 -/* 06CB44 7F038014 0FC08015 */ jal sub_GAME_7F020054 +/* 06CB44 7F038014 0FC08015 */ jal chrAddHealth /* 06CB48 7F038018 00000000 */ nop /* 06CB4C 7F03801C 26520003 */ addiu $s2, $s2, 3 /* 06CB50 7F038020 1000F55A */ b GetByteS1_ParseCommandByte_SwitchCase @@ -13427,7 +13427,7 @@ actionD9_GuardIDMovedToPresetReturnLoopIfSuccessful_5: /* 06E2EC 7F0397BC 1040005E */ beqz $v0, .L7F039938 /* 06E2F0 7F0397C0 00408025 */ move $s0, $v0 /* 06E2F4 7F0397C4 02E02025 */ move $a0, $s7 -/* 06E2F8 7F0397C8 0FC0CBE5 */ jal sub_GAME_7F032F94 +/* 06E2F8 7F0397C8 0FC0CBE5 */ jal convertPadIf9000 /* 06E2FC 7F0397CC 02602825 */ move $a1, $s3 /* 06E300 7F0397D0 28412710 */ slti $at, $v0, 0x2710 /* 06E304 7F0397D4 1020000A */ beqz $at, .L7F039800 @@ -13543,11 +13543,11 @@ actionDA_Fade_Out_From_Cut_Scene_1: /* 06E4A4 7F039974 11A10008 */ beq $t5, $at, .L7F039998 /* 06E4A8 7F039978 00002825 */ move $a1, $zero /* 06E4AC 7F03997C 4407A000 */ mfc1 $a3, $f20 -/* 06E4B0 7F039980 0FC201EC */ jal set_rgba_tint +/* 06E4B0 7F039980 0FC201EC */ jal currentPlayerSetFadeColour /* 06E4B4 7F039984 00003025 */ move $a2, $zero /* 06E4B8 7F039988 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 06E4BC 7F03998C 44817000 */ mtc1 $at, $f14 -/* 06E4C0 7F039990 0FC20216 */ jal fade_to_over_seconds +/* 06E4C0 7F039990 0FC20216 */ jal currentPlayerSetFadeFrac /* 06E4C4 7F039994 4600B306 */ mov.s $f12, $f22 .L7F039998: /* 06E4C8 7F039998 26520001 */ addiu $s2, $s2, 1 @@ -13561,10 +13561,10 @@ actionDB_Fade_In_From_Black_Reset_DA_1: /* 06E4E4 7F0399B4 11C10007 */ beq $t6, $at, .L7F0399D4 /* 06E4E8 7F0399B8 00002825 */ move $a1, $zero /* 06E4EC 7F0399BC 00003025 */ move $a2, $zero -/* 06E4F0 7F0399C0 0FC201EC */ jal set_rgba_tint +/* 06E4F0 7F0399C0 0FC201EC */ jal currentPlayerSetFadeColour /* 06E4F4 7F0399C4 3C073F80 */ li $a3, 0x3F800000 # 1.000000 /* 06E4F8 7F0399C8 4600B306 */ mov.s $f12, $f22 -/* 06E4FC 7F0399CC 0FC20216 */ jal fade_to_over_seconds +/* 06E4FC 7F0399CC 0FC20216 */ jal currentPlayerSetFadeFrac /* 06E500 7F0399D0 4600A386 */ mov.s $f14, $f20 .L7F0399D4: /* 06E504 7F0399D4 26520001 */ addiu $s2, $s2, 1 @@ -13679,7 +13679,7 @@ actionE0_Guard_ID_Draws_Weapon_num_3: /* 06E680 7F039B50 1000EE8E */ b GetByteS1_ParseCommandByte_SwitchCase /* 06E684 7F039B54 26310003 */ addiu $s1, $s1, 3 actionE1_If_Fewer_than_This_Many_Players_Playing_RVL_3: -/* 06E688 7F039B58 0FC26919 */ jal get_num_players +/* 06E688 7F039B58 0FC26919 */ jal getPlayerCount /* 06E68C 7F039B5C 00000000 */ nop /* 06E690 7F039B60 822A0001 */ lb $t2, 1($s1) /* 06E694 7F039B64 02C02025 */ move $a0, $s6 @@ -14540,28 +14540,22 @@ glabel sub_GAME_7F03A538 -#ifdef NONMATCHING -void sub_GAME_7F03A5A4(void) { +void attachNewChild(struct prop *newChild,struct prop *host) +{ + newChild->host = host; + // Link the newChild into its siblings + if (host->child) { + host->child->prevSibling = newChild; + } + newChild->nextSibling = host->child; + newChild->prevSibling = 0x0; + + newChild->standTile = 0x0; + host->child = newChild; + + return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03A5A4 -/* 06F0D4 7F03A5A4 AC85001C */ sw $a1, 0x1c($a0) -/* 06F0D8 7F03A5A8 8CA20020 */ lw $v0, 0x20($a1) -/* 06F0DC 7F03A5AC 50400004 */ beql $v0, $zero, .L7F03A5C0 -/* 06F0E0 7F03A5B0 AC820024 */ sw $v0, 0x24($a0) -/* 06F0E4 7F03A5B4 AC440028 */ sw $a0, 0x28($v0) -/* 06F0E8 7F03A5B8 8CA20020 */ lw $v0, 0x20($a1) -/* 06F0EC 7F03A5BC AC820024 */ sw $v0, 0x24($a0) -.L7F03A5C0: -/* 06F0F0 7F03A5C0 AC800028 */ sw $zero, 0x28($a0) -/* 06F0F4 7F03A5C4 AC800014 */ sw $zero, 0x14($a0) -/* 06F0F8 7F03A5C8 03E00008 */ jr $ra -/* 06F0FC 7F03A5CC ACA40020 */ sw $a0, 0x20($a1) -) -#endif @@ -15549,7 +15543,7 @@ glabel sub_GAME_7F03B15C /* 06FD54 7F03B224 C7AA019C */ lwc1 $f10, 0x19c($sp) /* 06FD58 7F03B228 E7A601B0 */ swc1 $f6, 0x1b0($sp) /* 06FD5C 7F03B22C E7A801B4 */ swc1 $f8, 0x1b4($sp) -/* 06FD60 7F03B230 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -15559,7 +15553,7 @@ glabel sub_GAME_7F03B15C /* 06FD7C 7F03B24C C7A401A8 */ lwc1 $f4, 0x1a8($sp) /* 06FD80 7F03B250 E7B001BC */ swc1 $f16, 0x1bc($sp) /* 06FD84 7F03B254 E7B201C0 */ swc1 $f18, 0x1c0($sp) -/* 06FD88 7F03B258 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -15645,7 +15639,7 @@ glabel sub_GAME_7F03B15C /* 06FECC 7F03B39C C6080008 */ lwc1 $f8, 8($s0) /* 06FED0 7F03B3A0 AFA4055C */ sw $a0, 0x55c($sp) /* 06FED4 7F03B3A4 46004402 */ mul.s $f16, $f8, $f0 -/* 06FED8 7F03B3A8 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 06FED8 7F03B3A8 0FC2CBF6 */ jal getTileRoom /* 06FEDC 7F03B3AC E7B00084 */ swc1 $f16, 0x84($sp) /* 06FEE0 7F03B3B0 00408825 */ move $s1, $v0 /* 06FEE4 7F03B3B4 27A2018C */ addiu $v0, $sp, 0x18c @@ -15678,7 +15672,7 @@ glabel sub_GAME_7F03B15C /* 06FF48 7F03B418 00000000 */ nop /* 06FF4C 7F03B41C 0FC225E6 */ jal get_curplayer_positiondata /* 06FF50 7F03B420 00000000 */ nop -/* 06FF54 7F03B424 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 06FF54 7F03B424 0FC2CBF6 */ jal getTileRoom /* 06FF58 7F03B428 8C440014 */ lw $a0, 0x14($v0) /* 06FF5C 7F03B42C 27AC007C */ addiu $t4, $sp, 0x7c /* 06FF60 7F03B430 27AD008C */ addiu $t5, $sp, 0x8c @@ -15696,7 +15690,7 @@ glabel sub_GAME_7F03B15C .L7F03B460: /* 06FF90 7F03B460 0FC225E6 */ jal get_curplayer_positiondata /* 06FF94 7F03B464 00000000 */ nop -/* 06FF98 7F03B468 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 06FF98 7F03B468 0FC2CBF6 */ jal getTileRoom /* 06FF9C 7F03B46C 8C440014 */ lw $a0, 0x14($v0) /* 06FFA0 7F03B470 27AF007C */ addiu $t7, $sp, 0x7c /* 06FFA4 7F03B474 27B8008C */ addiu $t8, $sp, 0x8c @@ -15774,7 +15768,7 @@ glabel sub_GAME_7F03B15C /* 0700B0 7F03B580 5300000B */ beql $t8, $zero, .L7F03B5B0 /* 0700B4 7F03B584 8FB901AC */ lw $t9, 0x1ac($sp) .L7F03B588: -/* 0700B8 7F03B588 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0700B8 7F03B588 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0700BC 7F03B58C 00000000 */ nop /* 0700C0 7F03B590 00402025 */ move $a0, $v0 /* 0700C4 7F03B594 0FC1611D */ jal matrix_4x4_transform_vector_in_place @@ -16528,7 +16522,7 @@ glabel sub_GAME_7F03BDEC /* 070B14 7F03BFE4 8E090014 */ lw $t1, 0x14($s0) /* 070B18 7F03BFE8 15090024 */ bne $t0, $t1, .L7F03C07C /* 070B1C 7F03BFEC 00000000 */ nop -/* 070B20 7F03BFF0 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 070B20 7F03BFF0 0FC1E67C */ jal currentPlayerGetCrouchPos /* 070B24 7F03BFF4 2411000F */ li $s1, 15 /* 070B28 7F03BFF8 24010001 */ li $at, 1 /* 070B2C 7F03BFFC 14410003 */ bne $v0, $at, .L7F03C00C @@ -16536,7 +16530,7 @@ glabel sub_GAME_7F03BDEC /* 070B34 7F03C004 10000006 */ b .L7F03C020 /* 070B38 7F03C008 241100C8 */ li $s1, 200 .L7F03C00C: -/* 070B3C 7F03C00C 0FC1E67C */ jal sub_GAME_7F0799F0 +/* 070B3C 7F03C00C 0FC1E67C */ jal currentPlayerGetCrouchPos /* 070B40 7F03C010 00000000 */ nop /* 070B44 7F03C014 54400003 */ bnezl $v0, .L7F03C024 /* 070B48 7F03C018 27A40084 */ addiu $a0, $sp, 0x84 @@ -16547,7 +16541,7 @@ glabel sub_GAME_7F03BDEC /* 070B54 7F03C024 02A02825 */ move $a1, $s5 /* 070B58 7F03C028 0FC1A073 */ jal sub_GAME_7F0681CC /* 070B5C 7F03C02C 8FA600C8 */ lw $a2, 0xc8($sp) -/* 070B60 7F03C030 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -16847,7 +16841,7 @@ glabel sub_GAME_7F03C2BC /* 070F04 7F03C3D4 0FC225E6 */ jal get_curplayer_positiondata /* 070F08 7F03C3D8 00000000 */ nop /* 070F0C 7F03C3DC 02002025 */ move $a0, $s0 -/* 070F10 7F03C3E0 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 070F10 7F03C3E0 0FC0E969 */ jal attachNewChild /* 070F14 7F03C3E4 00402825 */ move $a1, $v0 /* 070F18 7F03C3E8 8FBF001C */ lw $ra, 0x1c($sp) .L7F03C3EC: @@ -17025,7 +17019,7 @@ glabel sub_GAME_7F03C574 /* 0710B4 7F03C584 AFB30028 */ sw $s3, 0x28($sp) /* 0710B8 7F03C588 AFB10020 */ sw $s1, 0x20($sp) /* 0710BC 7F03C58C AFB0001C */ sw $s0, 0x1c($sp) -/* 0710C0 7F03C590 0FC26919 */ jal get_num_players +/* 0710C0 7F03C590 0FC26919 */ jal getPlayerCount /* 0710C4 7F03C594 F7B40010 */ sdc1 $f20, 0x10($sp) /* 0710C8 7F03C598 240E0001 */ li $t6, 1 /* 0710CC 7F03C59C 00409825 */ move $s3, $v0 @@ -17033,9 +17027,9 @@ glabel sub_GAME_7F03C574 /* 0710D4 7F03C5A4 1840001F */ blez $v0, .L7F03C624 /* 0710D8 7F03C5A8 00008025 */ move $s0, $zero /* 0710DC 7F03C5AC 3C0143C8 */ li $at, 0x43C80000 # 400.000000 -/* 0710E0 7F03C5B0 3C118008 */ lui $s1, %hi(ptr_BONDdata_p1) +/* 0710E0 7F03C5B0 3C118008 */ lui $s1, %hi(players) /* 0710E4 7F03C5B4 4481A000 */ mtc1 $at, $f20 -/* 0710E8 7F03C5B8 26319EE0 */ addiu $s1, %lo(ptr_BONDdata_p1) # addiu $s1, $s1, -0x6120 +/* 0710E8 7F03C5B8 26319EE0 */ addiu $s1, %lo(players) # addiu $s1, $s1, -0x6120 .L7F03C5BC: /* 0710EC 7F03C5BC 8E2F0000 */ lw $t7, ($s1) /* 0710F0 7F03C5C0 C6460008 */ lwc1 $f6, 8($s2) @@ -17219,7 +17213,7 @@ glabel handle_mp_respawn_and_some_things /* 071354 7F03C824 AFA20028 */ sw $v0, 0x28($sp) /* 071358 7F03C828 8FA30028 */ lw $v1, 0x28($sp) /* 07135C 7F03C82C 8E040010 */ lw $a0, 0x10($s0) -/* 071360 7F03C830 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 071360 7F03C830 0FC0E969 */ jal attachNewChild /* 071364 7F03C834 8C650010 */ lw $a1, 0x10($v1) /* 071368 7F03C838 1000001C */ b .L7F03C8AC /* 07136C 7F03C83C 24130001 */ li $s3, 1 @@ -17305,23 +17299,23 @@ glabel handle_mp_respawn_and_some_things /* 07147C 7F03C94C 0FC26C57 */ jal sub_GAME_7F09B15C /* 071480 7F03C950 02202025 */ move $a0, $s1 /* 071484 7F03C954 00024080 */ sll $t0, $v0, 2 -/* 071488 7F03C958 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) +/* 071488 7F03C958 3C048008 */ lui $a0, %hi(players) /* 07148C 7F03C95C 00882021 */ addu $a0, $a0, $t0 -/* 071490 7F03C960 8C849EE0 */ lw $a0, %lo(ptr_BONDdata_p1)($a0) +/* 071490 7F03C960 8C849EE0 */ lw $a0, %lo(players)($a0) /* 071494 7F03C964 0FC18AC0 */ jal sub_GAME_7F062B00 /* 071498 7F03C968 24840A54 */ addiu $a0, $a0, 0xa54 /* 07149C 7F03C96C 0FC26C57 */ jal sub_GAME_7F09B15C /* 0714A0 7F03C970 02202025 */ move $a0, $s1 /* 0714A4 7F03C974 00024880 */ sll $t1, $v0, 2 -/* 0714A8 7F03C978 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) +/* 0714A8 7F03C978 3C048008 */ lui $a0, %hi(players) /* 0714AC 7F03C97C 00892021 */ addu $a0, $a0, $t1 -/* 0714B0 7F03C980 8C849EE0 */ lw $a0, %lo(ptr_BONDdata_p1)($a0) +/* 0714B0 7F03C980 8C849EE0 */ lw $a0, %lo(players)($a0) /* 0714B4 7F03C984 0FC18AC0 */ jal sub_GAME_7F062B00 /* 0714B8 7F03C988 24840DFC */ addiu $a0, $a0, 0xdfc /* 0714BC 7F03C98C 8E2A0004 */ lw $t2, 4($s1) /* 0714C0 7F03C990 5140000C */ beql $t2, $zero, .L7F03C9C4 /* 0714C4 7F03C994 24010005 */ li $at, 5 -/* 0714C8 7F03C998 0FC26919 */ jal get_num_players +/* 0714C8 7F03C998 0FC26919 */ jal getPlayerCount /* 0714CC 7F03C99C 00000000 */ nop /* 0714D0 7F03C9A0 28410002 */ slti $at, $v0, 2 /* 0714D4 7F03C9A4 54200007 */ bnezl $at, .L7F03C9C4 @@ -17904,10 +17898,10 @@ glabel sub_GAME_7F03CFE8 /* 071B4C 7F03D01C 0FC26C57 */ jal sub_GAME_7F09B15C /* 071B50 7F03D020 00000000 */ nop /* 071B54 7F03D024 00027080 */ sll $t6, $v0, 2 -/* 071B58 7F03D028 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) +/* 071B58 7F03D028 3C048008 */ lui $a0, %hi(players) /* 071B5C 7F03D02C 008E2021 */ addu $a0, $a0, $t6 /* 071B60 7F03D030 0FC225DE */ jal sub_GAME_7F089778 -/* 071B64 7F03D034 8C849EE0 */ lw $a0, %lo(ptr_BONDdata_p1)($a0) +/* 071B64 7F03D034 8C849EE0 */ lw $a0, %lo(players)($a0) /* 071B68 7F03D038 10000004 */ b .L7F03D04C /* 071B6C 7F03D03C 8FBF0014 */ lw $ra, 0x14($sp) /* 071B70 7F03D040 44800000 */ mtc1 $zero, $f0 @@ -18199,7 +18193,7 @@ glabel sub_GAME_7F03D188 /* 071EBC 7F03D38C 44814000 */ mtc1 $at, $f8 /* 071EC0 7F03D390 00000000 */ nop /* 071EC4 7F03D394 46083282 */ mul.s $f10, $f6, $f8 -/* 071EC8 7F03D398 0FC26919 */ jal get_num_players +/* 071EC8 7F03D398 0FC26919 */ jal getPlayerCount /* 071ECC 7F03D39C E7AA0058 */ swc1 $f10, 0x58($sp) /* 071ED0 7F03D3A0 24010001 */ li $at, 1 /* 071ED4 7F03D3A4 14410005 */ bne $v0, $at, .L7F03D3BC @@ -19334,7 +19328,7 @@ glabel sub_GAME_7F03E134 #ifdef NONMATCHING void sub_GAME_7F03E18C(void) { - + // Duplicate of the below function with a small extension. } #else GLOBAL_ASM( @@ -19384,8 +19378,31 @@ glabel sub_GAME_7F03E18C #ifdef NONMATCHING -void sub_GAME_7F03E210(void) { +/* +Main missing these kinds of instructions: +- sll $a1, $s0, 0x10 +- sra $t6, $a1, 0x10 +.. +- sll $a1, $s0, 0x10 + +So it looks like a conversion from u32 to u16, but we're reading a u8? +I tried u32 room but no joy. +*/ +void sub_GAME_7F03E210(struct prop *posData) +{ + u8 room; + u8 *roomIter; + + roomIter = posData->rooms; + room = roomIter[0]; + + while (room != 0xff) { + FUN_7f03dd9c(posData,(u16)room); + roomIter += 1; + room = *roomIter; + } + return; } #else GLOBAL_ASM( diff --git a/src/game/chrai.h b/src/game/chrai.h index 7d273dd0..3872508e 100644 --- a/src/game/chrai.h +++ b/src/game/chrai.h @@ -71,6 +71,14 @@ struct struct_20 { void * anonymous_19; }; +struct Pad { + u32 padNumber; + s32* neighbours; + u32 pathSetIndex; + s32 dist_tmp; +}; + +extern struct Pad * ptr_setup_path_tbl; extern u32 D_800312A0[]; extern u32 D_800312B4[]; extern u32 D_800312C8[]; diff --git a/src/game/chrobjdata.c b/src/game/chrobjdata.c index b60d2349..35edbc47 100644 --- a/src/game/chrobjdata.c +++ b/src/game/chrobjdata.c @@ -27,7 +27,7 @@ u8 dword_D_80037084[] = { // GLIST_DETECT_BOND_SPAWN_CLONE_ON_HEARD_GUNFIRE: wai goto_loop_repeat(0x01) label(0x06) if_guard_sees_bond(0x07) - if_guard_was_shot_within_last_10_secs(0x0D) + if_guard_was_shot_or_seen_bond_within_last_10_secs(0x0D) if_guard_heard_bond_within_last_10_secs(0x0E) if_guard_shot_from_bond_missed(0x10) if_guard_see_another_guard_shot(0x0D) @@ -113,7 +113,7 @@ u8 dword_D_8003717C[] = { // GLIST_DETECT_BOND_DEAF_NO_CLONE_NO_IDLE_ANIM: wait goto_loop_repeat(0x01) label(0x06) if_guard_sees_bond(0x07) - if_guard_was_shot_within_last_10_secs(0x0D) + if_guard_was_shot_or_seen_bond_within_last_10_secs(0x0D) if_guard_shot_from_bond_missed(0x10) if_guard_see_another_guard_shot(0x0D) if_guard_see_another_guard_die(0x0D) @@ -212,7 +212,7 @@ u8 dword_D_80037248[] = { // GLIST_RUN_TO_BOND_AND_FIRE: run to bond and fire u8 dword_D_80037250[] = { // GLIST_DETECT_BOND_NO_CLONE_NO_IDLE_ANIM: wait for bond detection (no clones/no idling) goto_loop_start(0x01) // wait for guard to stop moving before branching to next logic if_guard_sees_bond(0x07) - if_guard_was_shot_within_last_10_secs(0x0D) + if_guard_was_shot_or_seen_bond_within_last_10_secs(0x0D) if_guard_heard_bond_within_last_10_secs(0x0D) if_guard_shot_from_bond_missed(0x0D) if_guard_see_another_guard_shot(0x0D) diff --git a/src/game/chrobjhandler.c b/src/game/chrobjhandler.c index 0d67acdc..761e0095 100644 --- a/src/game/chrobjhandler.c +++ b/src/game/chrobjhandler.c @@ -2493,7 +2493,7 @@ glabel sub_GAME_7F041160 /* 075DCC 7F04129C 02202025 */ move $a0, $s1 /* 075DD0 7F0412A0 0FC1611D */ jal matrix_4x4_transform_vector_in_place /* 075DD4 7F0412A4 E4A80008 */ swc1 $f8, 8($a1) -/* 075DD8 7F0412A8 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -2531,7 +2531,7 @@ glabel sub_GAME_7F041160 /* 075E64 7F041334 E60A0004 */ swc1 $f10, 4($s0) /* 075E68 7F041338 E6120008 */ swc1 $f18, 8($s0) .L7F04133C: -/* 075E6C 7F04133C 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -3401,7 +3401,7 @@ glabel sub_GAME_7F041E0C /* 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 get_BONDdata_field_10CC +/* 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 @@ -3411,7 +3411,7 @@ glabel sub_GAME_7F041E0C /* 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 get_BONDdata_field_10CC +/* 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 @@ -3513,9 +3513,9 @@ glabel sub_GAME_7F041E0C /* 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(ptr_BONDdata_p1) +/* 076BF4 7F0420C4 3C0C8008 */ lui $t4, %hi(players) /* 076BF8 7F0420C8 018B6021 */ addu $t4, $t4, $t3 -/* 076BFC 7F0420CC 8D8C9EE0 */ lw $t4, %lo(ptr_BONDdata_p1)($t4) +/* 076BFC 7F0420CC 8D8C9EE0 */ lw $t4, %lo(players)($t4) /* 076C00 7F0420D0 324E0004 */ andi $t6, $s2, 4 /* 076C04 7F0420D4 8D8D00AC */ lw $t5, 0xac($t4) /* 076C08 7F0420D8 51A00037 */ beql $t5, $zero, .L7F0421B8 @@ -3560,9 +3560,9 @@ glabel sub_GAME_7F041E0C /* 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(ptr_BONDdata_p1) +/* 076CA0 7F042170 3C0C8008 */ lui $t4, %hi(players) /* 076CA4 7F042174 018B6021 */ addu $t4, $t4, $t3 -/* 076CA8 7F042178 8D8C9EE0 */ lw $t4, %lo(ptr_BONDdata_p1)($t4) +/* 076CA8 7F042178 8D8C9EE0 */ lw $t4, %lo(players)($t4) /* 076CAC 7F04217C 02002025 */ move $a0, $s0 /* 076CB0 7F042180 02802825 */ move $a1, $s4 /* 076CB4 7F042184 8D8D00AC */ lw $t5, 0xac($t4) @@ -4319,7 +4319,7 @@ glabel sub_GAME_7F042A0C /* 077734 7F042C04 E440005C */ swc1 $f0, 0x5c($v0) .L7F042C08: /* 077738 7F042C08 27A40080 */ addiu $a0, $sp, 0x80 -/* 07773C 7F042C0C 0FC2CA2C */ jal sub_GAME_7F0B28B0 +/* 07773C 7F042C0C 0FC2CA2C */ jal getCollisionEdge_maybe /* 077740 7F042C10 27A50074 */ addiu $a1, $sp, 0x74 /* 077744 7F042C14 C7A8007C */ lwc1 $f8, 0x7c($sp) /* 077748 7F042C18 C7B00088 */ lwc1 $f16, 0x88($sp) @@ -5479,7 +5479,7 @@ glabel sub_GAME_7F043A6C /* 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 sub_GAME_7F03A5A4 +/* 078630 7F043B00 0FC0E969 */ jal attachNewChild /* 078634 7F043B04 8FA500F4 */ lw $a1, 0xf4($sp) /* 078638 7F043B08 27B100AC */ addiu $s1, $sp, 0xac /* 07863C 7F043B0C 02202825 */ move $a1, $s1 @@ -5488,7 +5488,7 @@ glabel sub_GAME_7F043A6C /* 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 sub_GAME_7F078444 +/* 078654 7F043B24 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 078658 7F043B28 00000000 */ nop /* 07865C 7F043B2C 00402025 */ move $a0, $v0 /* 078660 7F043B30 8FA50028 */ lw $a1, 0x28($sp) @@ -5570,7 +5570,7 @@ glabel generate_explosion_at_position /* 07873C 7F043C0C C4460034 */ lwc1 $f6, 0x34($v0) /* 078740 7F043C10 E7A60048 */ swc1 $f6, 0x48($sp) /* 078744 7F043C14 C4480038 */ lwc1 $f8, 0x38($v0) -/* 078748 7F043C18 0FC1E111 */ jal sub_GAME_7F078444 +/* 078748 7F043C18 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 07874C 7F043C1C E7A8004C */ swc1 $f8, 0x4c($sp) /* 078750 7F043C20 27B00044 */ addiu $s0, $sp, 0x44 /* 078754 7F043C24 02002825 */ move $a1, $s0 @@ -5710,7 +5710,7 @@ glabel generate_explosion_at_position /* 078A7C 7F043F0C C4460034 */ lwc1 $f6, 0x34($v0) /* 078A80 7F043F10 E7A60044 */ swc1 $f6, 0x44($sp) /* 078A84 7F043F14 C4480038 */ lwc1 $f8, 0x38($v0) -/* 078A88 7F043F18 0FC1E28D */ jal sub_GAME_7F078444 +/* 078A88 7F043F18 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 078A8C 7F043F1C E7A80048 */ swc1 $f8, 0x48($sp) /* 078A90 7F043F20 27B00040 */ addiu $s0, $sp, 0x40 /* 078A94 7F043F24 02002825 */ move $a1, $s0 @@ -7055,13 +7055,13 @@ glabel sub_GAME_7F044718 /* 07930C 7F0447DC 46000507 */ neg.s $f20, $f0 /* 079310 7F0447E0 C62C0000 */ lwc1 $f12, ($s1) .L7F0447E4: -/* 079314 7F0447E4 0FC2C5E5 */ jal sub_GAME_7F0B1794 +/* 079314 7F0447E4 0FC2C5E5 */ jal distBetweenPoints2d /* 079318 7F0447E8 C62E0004 */ lwc1 $f14, 4($s1) /* 07931C 7F0447EC 4406B000 */ mfc1 $a2, $f22 /* 079320 7F0447F0 4407C000 */ mfc1 $a3, $f24 /* 079324 7F0447F4 46000686 */ mov.s $f26, $f0 /* 079328 7F0447F8 C60C0000 */ lwc1 $f12, ($s0) -/* 07932C 7F0447FC 0FC2C5E5 */ jal sub_GAME_7F0B1794 +/* 07932C 7F0447FC 0FC2C5E5 */ jal distBetweenPoints2d /* 079330 7F044800 C60E0004 */ lwc1 $f14, 4($s0) /* 079334 7F044804 461CA03C */ c.lt.s $f20, $f28 /* 079338 7F044808 00000000 */ nop @@ -7999,7 +7999,7 @@ glabel object_interaction /* 079E34 7F045304 8E340014 */ lw $s4, 0x14($s1) /* 079E38 7F045308 AFA00690 */ sw $zero, 0x690($sp) /* 079E3C 7F04530C AFA00680 */ sw $zero, 0x680($sp) -/* 079E40 7F045310 0FC26919 */ jal get_num_players +/* 079E40 7F045310 0FC26919 */ jal getPlayerCount /* 079E44 7F045314 E7B6067C */ swc1 $f22, 0x67c($sp) /* 079E48 7F045318 240C0001 */ li $t4, 1 /* 079E4C 7F04531C AFA20674 */ sw $v0, 0x674($sp) @@ -8578,7 +8578,7 @@ 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 get_BONDdata_field_10CC +/* 07A6CC 7F045B9C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07A6D0 7F045BA0 E7A405D4 */ swc1 $f4, 0x5d4($sp) /* 07A6D4 7F045BA4 00402025 */ move $a0, $v0 /* 07A6D8 7F045BA8 0FC1611D */ jal matrix_4x4_transform_vector_in_place @@ -8646,7 +8646,7 @@ glabel object_interaction /* 07A7D0 7F045CA0 27A5058C */ addiu $a1, $sp, 0x58c /* 07A7D4 7F045CA4 46045182 */ mul.s $f6, $f10, $f4 /* 07A7D8 7F045CA8 46064281 */ sub.s $f10, $f8, $f6 -/* 07A7DC 7F045CAC 0FC16799 */ jal sub_GAME_7F059E64 +/* 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 @@ -11399,7 +11399,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 get_BONDdata_field_10CC +/* 07CFBC 7F04848C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07CFC0 7F048490 00000000 */ nop /* 07CFC4 7F048494 00402025 */ move $a0, $v0 /* 07CFC8 7F048498 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -11579,7 +11579,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 get_BONDdata_field_10CC +/* 07D278 7F048748 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07D27C 7F04874C 00000000 */ nop /* 07D280 7F048750 00402025 */ move $a0, $v0 /* 07D284 7F048754 27A503A4 */ addiu $a1, $sp, 0x3a4 @@ -11628,7 +11628,7 @@ glabel object_interaction /* 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 get_BONDdata_field_10CC +/* 07D334 7F048804 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07D338 7F048808 00000000 */ nop /* 07D33C 7F04880C 00402025 */ move $a0, $v0 /* 07D340 7F048810 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -11679,7 +11679,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 get_BONDdata_field_10CC +/* 07D3F8 7F0488C8 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07D3FC 7F0488CC 00000000 */ nop /* 07D400 7F0488D0 00402025 */ move $a0, $v0 /* 07D404 7F0488D4 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -12107,7 +12107,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 get_BONDdata_field_10CC +/* 07DA44 7F048F14 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 07DA48 7F048F18 AD210000 */ sw $at, ($t1) /* 07DA4C 7F048F1C AFA201B0 */ sw $v0, 0x1b0($sp) /* 07DA50 7F048F20 AFB201C0 */ sw $s2, 0x1c0($sp) @@ -12258,7 +12258,7 @@ glabel object_interaction /* 07DC74 7F049144 8FA4006C */ lw $a0, 0x6c($sp) /* 07DC78 7F049148 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place /* 07DC7C 7F04914C 8FA50068 */ lw $a1, 0x68($sp) -/* 07DC80 7F049150 0FC1E111 */ jal sub_GAME_7F078444 +/* 07DC80 7F049150 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 07DC84 7F049154 00000000 */ nop /* 07DC88 7F049158 27B0016C */ addiu $s0, $sp, 0x16c /* 07DC8C 7F04915C 02003025 */ move $a2, $s0 @@ -12522,7 +12522,7 @@ glabel object_interaction /* 07E04C 7F04951C C4660004 */ lwc1 $f6, 4($v1) /* 07E050 7F049520 E7A60130 */ swc1 $f6, 0x130($sp) /* 07E054 7F049524 C4680008 */ lwc1 $f8, 8($v1) -/* 07E058 7F049528 0FC1E111 */ jal sub_GAME_7F078444 +/* 07E058 7F049528 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 07E05C 7F04952C E7A80134 */ swc1 $f8, 0x134($sp) /* 07E060 7F049530 27B100B8 */ addiu $s1, $sp, 0xb8 /* 07E064 7F049534 02203025 */ move $a2, $s1 @@ -13092,7 +13092,7 @@ glabel object_interaction /* 07A248 7F0456D8 8E340014 */ lw $s4, 0x14($s1) /* 07A24C 7F0456DC AFA00698 */ sw $zero, 0x698($sp) /* 07A250 7F0456E0 AFA00688 */ sw $zero, 0x688($sp) -/* 07A254 7F0456E4 0FC26C01 */ jal get_num_players +/* 07A254 7F0456E4 0FC26C01 */ jal getPlayerCount /* 07A258 7F0456E8 E7B60684 */ swc1 $f22, 0x684($sp) /* 07A25C 7F0456EC 240F0001 */ li $t7, 1 /* 07A260 7F0456F0 AFA2067C */ sw $v0, 0x67c($sp) @@ -13675,7 +13675,7 @@ 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 get_BONDdata_field_10CC +/* 07AAF0 7F045F80 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07AAF4 7F045F84 E7A405DC */ swc1 $f4, 0x5dc($sp) /* 07AAF8 7F045F88 00402025 */ move $a0, $v0 /* 07AAFC 7F045F8C 0FC16265 */ jal matrix_4x4_transform_vector_in_place @@ -13743,7 +13743,7 @@ glabel object_interaction /* 07ABF4 7F046084 27A50594 */ addiu $a1, $sp, 0x594 /* 07ABF8 7F046088 46045182 */ mul.s $f6, $f10, $f4 /* 07ABFC 7F04608C 46064281 */ sub.s $f10, $f8, $f6 -/* 07AC00 7F046090 0FC168E1 */ jal sub_GAME_7F059E64 +/* 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 @@ -16505,7 +16505,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 get_BONDdata_field_10CC +/* 07D400 7F048890 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07D404 7F048894 00000000 */ nop /* 07D408 7F048898 00402025 */ move $a0, $v0 /* 07D40C 7F04889C 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -16685,7 +16685,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 get_BONDdata_field_10CC +/* 07D6BC 7F048B4C 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07D6C0 7F048B50 00000000 */ nop /* 07D6C4 7F048B54 00402025 */ move $a0, $v0 /* 07D6C8 7F048B58 27A503A8 */ addiu $a1, $sp, 0x3a8 @@ -16734,7 +16734,7 @@ glabel object_interaction /* 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 get_BONDdata_field_10CC +/* 07D778 7F048C08 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07D77C 7F048C0C 00000000 */ nop /* 07D780 7F048C10 00402025 */ move $a0, $v0 /* 07D784 7F048C14 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -16785,7 +16785,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 get_BONDdata_field_10CC +/* 07D83C 7F048CCC 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07D840 7F048CD0 00000000 */ nop /* 07D844 7F048CD4 00402025 */ move $a0, $v0 /* 07D848 7F048CD8 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -17213,7 +17213,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 get_BONDdata_field_10CC +/* 07DE88 7F049318 0FC1E26D */ jal currentPlayerGetMatrix10CC /* 07DE8C 7F04931C ADA10000 */ sw $at, ($t5) /* 07DE90 7F049320 AFA201B4 */ sw $v0, 0x1b4($sp) /* 07DE94 7F049324 AFB201C4 */ sw $s2, 0x1c4($sp) @@ -17364,7 +17364,7 @@ glabel object_interaction /* 07E0B8 7F049548 8FA40070 */ lw $a0, 0x70($sp) /* 07E0BC 7F04954C 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place /* 07E0C0 7F049550 8FA5006C */ lw $a1, 0x6c($sp) -/* 07E0C4 7F049554 0FC1E28D */ jal sub_GAME_7F078444 +/* 07E0C4 7F049554 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 07E0C8 7F049558 00000000 */ nop /* 07E0CC 7F04955C 27B00170 */ addiu $s0, $sp, 0x170 /* 07E0D0 7F049560 02003025 */ move $a2, $s0 @@ -17628,7 +17628,7 @@ glabel object_interaction /* 07E490 7F049920 C4660004 */ lwc1 $f6, 4($v1) /* 07E494 7F049924 E7A60134 */ swc1 $f6, 0x134($sp) /* 07E498 7F049928 C4680008 */ lwc1 $f8, 8($v1) -/* 07E49C 7F04992C 0FC1E28D */ jal sub_GAME_7F078444 +/* 07E49C 7F04992C 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 07E4A0 7F049930 E7A80138 */ swc1 $f8, 0x138($sp) /* 07E4A4 7F049934 27B100BC */ addiu $s1, $sp, 0xbc /* 07E4A8 7F049938 02203025 */ move $a2, $s1 @@ -20656,7 +20656,7 @@ glabel sub_GAME_7F04AC20 /* 07FBD4 7F04B0A4 24E70008 */ addiu $a3, $a3, 8 /* 07FBD8 7F04B0A8 AC790000 */ sw $t9, ($v1) /* 07FBDC 7F04B0AC AFA70064 */ sw $a3, 0x64($sp) -/* 07FBE0 7F04B0B0 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 07FBE0 7F04B0B0 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 07FBE4 7F04B0B4 AFA3002C */ sw $v1, 0x2c($sp) /* 07FBE8 7F04B0B8 8FA3002C */ lw $v1, 0x2c($sp) /* 07FBEC 7F04B0BC 8FA70064 */ lw $a3, 0x64($sp) @@ -21791,7 +21791,7 @@ glabel sub_GAME_7F04BCDC /* 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 sub_GAME_7F078444 +/* 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 @@ -22496,7 +22496,7 @@ glabel sub_GAME_7F04C130 /* 081374 7F04C844 8FA400F8 */ lw $a0, 0xf8($sp) /* 081378 7F04C848 240E001F */ li $t6, 31 /* 08137C 7F04C84C AFA20058 */ sw $v0, 0x58($sp) -/* 081380 7F04C850 0FC1E111 */ jal sub_GAME_7F078444 +/* 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) @@ -24256,7 +24256,7 @@ glabel sub_GAME_7F04DE18 /* 082988 7F04DE58 8D230004 */ lw $v1, 4($t1) /* 08298C 7F04DE5C 0FC1B198 */ jal sub_GAME_7F06C660 /* 082990 7F04DE60 AFA30088 */ sw $v1, 0x88($sp) -/* 082994 7F04DE64 0FC1E111 */ jal sub_GAME_7F078444 +/* 082994 7F04DE64 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 082998 7F04DE68 AFA20084 */ sw $v0, 0x84($sp) /* 08299C 7F04DE6C 00402025 */ move $a0, $v0 /* 0829A0 7F04DE70 8FA50084 */ lw $a1, 0x84($sp) @@ -24818,7 +24818,7 @@ glabel maybe_detonate_object /* 08303C 7F04E50C AFA600C0 */ sw $a2, 0xc0($sp) /* 083040 7F04E510 8FA600C0 */ lw $a2, 0xc0($sp) /* 083044 7F04E514 8E050010 */ lw $a1, 0x10($s0) -/* 083048 7F04E518 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 083048 7F04E518 0FC0E969 */ jal attachNewChild /* 08304C 7F04E51C 8CC40010 */ lw $a0, 0x10($a2) /* 083050 7F04E520 10000008 */ b .L7F04E544 /* 083054 7F04E524 92020003 */ lbu $v0, 3($s0) @@ -25288,7 +25288,7 @@ glabel sub_GAME_7F04EA68 /* 083660 7F04EB30 AFA3005C */ sw $v1, 0x5c($sp) /* 083664 7F04EB34 46080482 */ mul.s $f18, $f0, $f8 /* 083668 7F04EB38 46123281 */ sub.s $f10, $f6, $f18 -/* 08366C 7F04EB3C 0FC1E111 */ jal sub_GAME_7F078444 +/* 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 @@ -26492,14 +26492,14 @@ void prepare_ammo_type_collection_text(u8 *finaltext, AMMOTYPES ammotype, u32 qu if (j_text_trigger != 0) { apped_text_ammotype(finaltext,ammotype,quantity); - if (get_num_players() < 3) + if (getPlayerCount() < 3) { append_text_picked_up(finaltext, ammotype, quantity); } string_append_from_obseg_textbank(finaltext, (char *)D_800529D0); return; } - if (get_num_players() < 3) + if (getPlayerCount() < 3) { append_text_picked_up(finaltext, ammotype, quantity); append_text_ammo_amount_word(finaltext, ammotype, quantity); @@ -26527,7 +26527,7 @@ glabel prepare_ammo_type_collection_text /* 08447C 7F04F94C 00C09025 */ move $s2, $a2 /* 084480 7F04F950 0FC13D03 */ jal apped_text_ammotype /* 084484 7F04F954 00000000 */ nop -/* 084488 7F04F958 0FC26919 */ jal get_num_players +/* 084488 7F04F958 0FC26919 */ jal getPlayerCount /* 08448C 7F04F95C 00000000 */ nop /* 084490 7F04F960 28410003 */ slti $at, $v0, 3 /* 084494 7F04F964 10200004 */ beqz $at, .L7F04F978 @@ -26543,7 +26543,7 @@ glabel prepare_ammo_type_collection_text /* 0844B8 7F04F988 10000016 */ b .L7F04F9E4 /* 0844BC 7F04F98C 8FBF0024 */ lw $ra, 0x24($sp) .L7F04F990: -/* 0844C0 7F04F990 0FC26919 */ jal get_num_players +/* 0844C0 7F04F990 0FC26919 */ jal getPlayerCount /* 0844C4 7F04F994 00000000 */ nop /* 0844C8 7F04F998 28410003 */ slti $at, $v0, 3 /* 0844CC 7F04F99C 10200008 */ beqz $at, .L7F04F9C0 @@ -26791,7 +26791,7 @@ magazine_has_default_ammo_rounds: /* 0847D4 7F04FCA4 28610002 */ slti $at, $v1, 2 /* 0847D8 7F04FCA8 5420000F */ bnezl $at, .L7F04FCE8 /* 0847DC 7F04FCAC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0847E0 7F04FCB0 0FC26919 */ jal get_num_players +/* 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 @@ -26895,7 +26895,7 @@ weapon_has_default_ammo: /* 0848BC 7F04FD8C 28610002 */ slti $at, $v1, 2 /* 0848C0 7F04FD90 5420000F */ bnezl $at, .L7F04FDD0 /* 0848C4 7F04FD94 00601025 */ move $v0, $v1 -/* 0848C8 7F04FD98 0FC26919 */ jal get_num_players +/* 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 @@ -26933,7 +26933,7 @@ void generate_language_specific_text_for_weapon(char *finalstring,ITEM_IDS itemt morethan2players = false; if (j_text_trigger == 0) { - numplayers = get_num_players(); + numplayers = getPlayerCount(); if ((int)numplayers < 3) { textfiletext = get_textptr_for_textID(0xa400); textpointer_load_parse_something(finalstring,textfiletext); @@ -26941,7 +26941,7 @@ void generate_language_specific_text_for_weapon(char *finalstring,ITEM_IDS itemt } else { textpointer_load_parse_something(finalstring,""); - numplayers = get_num_players(); + numplayers = getPlayerCount(); if (2 < (int)numplayers) { morethan2players = true; } @@ -27194,7 +27194,7 @@ glabel generate_language_specific_text_for_weapon /* 084934 7F04FE04 3C058005 */ lui $a1, %hi(D_80052A3C) /* 084938 7F04FE08 0C0029DC */ jal textpointer_load_parse_something /* 08493C 7F04FE0C 24A52A3C */ addiu $a1, %lo(D_80052A3C) # addiu $a1, $a1, 0x2a3c -/* 084940 7F04FE10 0FC26919 */ jal get_num_players +/* 084940 7F04FE10 0FC26919 */ jal getPlayerCount /* 084944 7F04FE14 00000000 */ nop /* 084948 7F04FE18 28410003 */ slti $at, $v0, 3 /* 08494C 7F04FE1C 1420000D */ bnez $at, .L7F04FE54 @@ -27202,7 +27202,7 @@ glabel generate_language_specific_text_for_weapon /* 084954 7F04FE24 1000000B */ b .L7F04FE54 /* 084958 7F04FE28 AFAF0024 */ sw $t7, 0x24($sp) .L7F04FE2C: -/* 08495C 7F04FE2C 0FC26919 */ jal get_num_players +/* 08495C 7F04FE2C 0FC26919 */ jal getPlayerCount /* 084960 7F04FE30 00000000 */ nop /* 084964 7F04FE34 28410003 */ slti $at, $v0, 3 /* 084968 7F04FE38 50200007 */ beql $at, $zero, .L7F04FE58 @@ -27652,7 +27652,7 @@ interact_ammobox_object: /* 084E84 7F050354 96050082 */ lhu $a1, 0x82($s0) /* 084E88 7F050358 AFA4004C */ sw $a0, 0x4c($sp) /* 084E8C 7F05035C AFA30020 */ sw $v1, 0x20($sp) -/* 084E90 7F050360 0FC26919 */ jal get_num_players +/* 084E90 7F050360 0FC26919 */ jal getPlayerCount /* 084E94 7F050364 AFA50050 */ sw $a1, 0x50($sp) /* 084E98 7F050368 24010001 */ li $at, 1 /* 084E9C 7F05036C 8FA30020 */ lw $v1, 0x20($sp) @@ -27830,7 +27830,7 @@ interact_bodyarmor_object: /* 085110 7F0505E0 8FA4006C */ lw $a0, 0x6c($sp) /* 085114 7F0505E4 1440000D */ bnez $v0, .L7F05061C /* 085118 7F0505E8 00402025 */ move $a0, $v0 -/* 08511C 7F0505EC 0FC26919 */ jal get_num_players +/* 08511C 7F0505EC 0FC26919 */ jal getPlayerCount /* 085120 7F0505F0 00000000 */ nop /* 085124 7F0505F4 28410003 */ slti $at, $v0, 3 /* 085128 7F0505F8 10200005 */ beqz $at, .L7F050610 @@ -28032,7 +28032,7 @@ interact_ammobox_object: /* 084E84 7F050354 96050082 */ lhu $a1, 0x82($s0) /* 084E88 7F050358 AFA4004C */ sw $a0, 0x4c($sp) /* 084E8C 7F05035C AFA30020 */ sw $v1, 0x20($sp) -/* 084E90 7F050360 0FC26919 */ jal get_num_players +/* 084E90 7F050360 0FC26919 */ jal getPlayerCount /* 084E94 7F050364 AFA50050 */ sw $a1, 0x50($sp) /* 084E98 7F050368 24010001 */ li $at, 1 /* 084E9C 7F05036C 8FA30020 */ lw $v1, 0x20($sp) @@ -28210,7 +28210,7 @@ interact_bodyarmor_object: /* 085110 7F0505E0 8FA4006C */ lw $a0, 0x6c($sp) /* 085114 7F0505E4 1440000D */ bnez $v0, .L7F05061C /* 085118 7F0505E8 00402025 */ move $a0, $v0 -/* 08511C 7F0505EC 0FC26919 */ jal get_num_players +/* 08511C 7F0505EC 0FC26919 */ jal getPlayerCount /* 085120 7F0505F0 00000000 */ nop /* 085124 7F0505F4 28410003 */ slti $at, $v0, 3 /* 085128 7F0505F8 10200005 */ beqz $at, .L7F050610 @@ -28566,7 +28566,7 @@ glabel object_collectability_routines /* 0855A0 7F050A70 1000001A */ b .L7F050ADC /* 0855A4 7F050A74 AFB9005C */ sw $t9, 0x5c($sp) .L7F050A78: -/* 0855A8 7F050A78 0FC26919 */ jal get_num_players +/* 0855A8 7F050A78 0FC26919 */ jal getPlayerCount /* 0855AC 7F050A7C 00000000 */ nop /* 0855B0 7F050A80 28410002 */ slti $at, $v0, 2 /* 0855B4 7F050A84 54200016 */ bnezl $at, .L7F050AE0 @@ -29108,7 +29108,7 @@ glabel object_collectability_routines /* 085AE4 7F050F74 10000019 */ b .Ljp7F050FDC /* 085AE8 7F050F78 AFAF0064 */ sw $t7, 0x64($sp) .Ljp7F050F7C: -/* 085AEC 7F050F7C 0FC26C01 */ jal get_num_players +/* 085AEC 7F050F7C 0FC26C01 */ jal getPlayerCount /* 085AF0 7F050F80 00000000 */ nop /* 085AF4 7F050F84 28410002 */ slti $at, $v0, 2 /* 085AF8 7F050F88 54200015 */ bnezl $at, .Ljp7F050FE0 @@ -29534,7 +29534,7 @@ glabel sub_GAME_7F050F50 /* 085B24 7F050FF4 8D090008 */ lw $t1, 8($t0) /* 085B28 7F050FF8 8D2A0018 */ lw $t2, 0x18($t1) /* 085B2C 7F050FFC AD6A001C */ sw $t2, 0x1c($t3) -/* 085B30 7F051000 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 085B30 7F051000 0FC0E969 */ jal attachNewChild /* 085B34 7F051004 8C450018 */ lw $a1, 0x18($v0) /* 085B38 7F051008 8FAC0024 */ lw $t4, 0x24($sp) /* 085B3C 7F05100C AD9101D8 */ sw $s1, 0x1d8($t4) @@ -30883,7 +30883,7 @@ glabel sub_GAME_7F051E1C /* 086A3C 7F051F0C 10000004 */ b .L7F051F20 /* 086A40 7F051F10 00001025 */ move $v0, $zero .L7F051F14: -/* 086A44 7F051F14 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 086A44 7F051F14 0FC0E969 */ jal attachNewChild /* 086A48 7F051F18 8CE50018 */ lw $a1, 0x18($a3) /* 086A4C 7F051F1C 24020001 */ li $v0, 1 .L7F051F20: @@ -33004,11 +33004,11 @@ glabel sub_GAME_7F053894 /* 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 get_num_players +/* 0883EC 7F0538BC 0FC26919 */ jal getPlayerCount /* 0883F0 7F0538C0 C7B40038 */ lwc1 $f20, 0x38($sp) /* 0883F4 7F0538C4 1840001D */ blez $v0, .L7F05393C -/* 0883F8 7F0538C8 3C0E8008 */ lui $t6, %hi(ptr_BONDdata_p1) -/* 0883FC 7F0538CC 25D09EE0 */ addiu $s0, $t6, %lo(ptr_BONDdata_p1) +/* 0883F8 7F0538C8 3C0E8008 */ lui $t6, %hi(players) +/* 0883FC 7F0538CC 25D09EE0 */ addiu $s0, $t6, %lo(players) /* 088400 7F0538D0 00027880 */ sll $t7, $v0, 2 /* 088404 7F0538D4 01F09021 */ addu $s2, $t7, $s0 /* 088408 7F0538D8 8E180000 */ lw $t8, ($s0) @@ -34777,7 +34777,7 @@ glabel sub_GAME_7F054C58 /* 0897A8 7F054C78 8FBF0014 */ lw $ra, 0x14($sp) /* 0897AC 7F054C7C 0FC227F5 */ jal get_BONDdata_position /* 0897B0 7F054C80 AFA20030 */ sw $v0, 0x30($sp) -/* 0897B4 7F054C84 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 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) @@ -36718,11 +36718,11 @@ glabel sub_GAME_7F056210 /* 08AE3C 7F05630C AFA8003C */ sw $t0, 0x3c($sp) /* 08AE40 7F056310 0FC2B366 */ jal microcode_constructor /* 08AE44 7F056314 02202025 */ move $a0, $s1 -/* 08AE48 7F056318 0C001149 */ jal get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08AE58 7F056328 0C00112B */ jal viGetViewHeight /* 08AE5C 7F05632C 01408025 */ move $s0, $t2 /* 08AE60 7F056330 8FA50044 */ lw $a1, 0x44($sp) /* 08AE64 7F056334 24010064 */ li $at, 100 @@ -36742,11 +36742,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08AEB8 7F056388 0C00112B */ jal viGetViewHeight /* 08AEBC 7F05638C 03008025 */ move $s0, $t8 /* 08AEC0 7F056390 8FA50044 */ lw $a1, 0x44($sp) /* 08AEC4 7F056394 2401000A */ li $at, 10 @@ -36763,11 +36763,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 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 @@ -36782,11 +36782,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08AF58 7F056428 0C00112B */ jal viGetViewHeight /* 08AF5C 7F05642C 01208025 */ move $s0, $t1 /* 08AF60 7F056430 8FA50040 */ lw $a1, 0x40($sp) /* 08AF64 7F056434 2401003C */ li $at, 60 @@ -36806,11 +36806,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08AFB8 7F056488 0C00112B */ jal viGetViewHeight /* 08AFBC 7F05648C 01E08025 */ move $s0, $t7 /* 08AFC0 7F056490 8FA50040 */ lw $a1, 0x40($sp) /* 08AFC4 7F056494 2401000A */ li $at, 10 @@ -36827,11 +36827,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 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 @@ -36846,11 +36846,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08B058 7F056528 0C00112B */ jal viGetViewHeight /* 08B05C 7F05652C 03208025 */ move $s0, $t9 /* 08B060 7F056530 8FA5003C */ lw $a1, 0x3c($sp) /* 08B064 7F056534 24010064 */ li $at, 100 @@ -36870,11 +36870,11 @@ glabel sub_GAME_7F056210 /* 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 get_video2_settings_uly +/* 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 get_video2_settings_height +/* 08B0B8 7F056588 0C00112B */ jal viGetViewHeight /* 08B0BC 7F05658C 01C08025 */ move $s0, $t6 /* 08B0C0 7F056590 8FA5003C */ lw $a1, 0x3c($sp) /* 08B0C4 7F056594 2401000A */ li $at, 10 diff --git a/src/game/debugmenu_090490.c b/src/game/debugmenu_090490.c index ff6d4d70..0fad92af 100644 --- a/src/game/debugmenu_090490.c +++ b/src/game/debugmenu_090490.c @@ -760,7 +760,7 @@ debug_collisions: /* 0C540C 7F0908DC 10000166 */ b .L7F090E78 /* 0C5410 7F0908E0 8FB80018 */ lw $t8, 0x18($sp) debug_allguns: -/* 0C5414 7F0908E4 0FC26919 */ jal get_num_players +/* 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) @@ -773,7 +773,7 @@ debug_allguns: /* 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 get_num_players +/* 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 @@ -785,7 +785,7 @@ debug_maxammo: /* 0C5464 7F090934 0FC26C54 */ jal get_cur_playernum /* 0C5468 7F090938 00000000 */ nop /* 0C546C 7F09093C AFA20054 */ sw $v0, 0x54($sp) -/* 0C5470 7F090940 0FC26919 */ jal get_num_players +/* 0C5470 7F090940 0FC26919 */ jal getPlayerCount /* 0C5474 7F090944 AFA00058 */ sw $zero, 0x58($sp) /* 0C5478 7F090948 1840000D */ blez $v0, .L7F090980 /* 0C547C 7F09094C 00000000 */ nop @@ -796,7 +796,7 @@ debug_maxammo: /* 0C548C 7F09095C 00000000 */ nop /* 0C5490 7F090960 8FAD0058 */ lw $t5, 0x58($sp) /* 0C5494 7F090964 25AE0001 */ addiu $t6, $t5, 1 -/* 0C5498 7F090968 0FC26919 */ jal get_num_players +/* 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 diff --git a/src/game/dyn.c b/src/game/dyn.c index cea3a03e..9d0a7c41 100644 --- a/src/game/dyn.c +++ b/src/game/dyn.c @@ -52,20 +52,20 @@ void set_vtx_gfx_mem_alloc(void) { if (check_token(1, "-mgfx") != 0) { - dyn_c_debug_notice_list_entry[get_num_players()] = strtol(check_token(1, "-mgfx"), 0, 0) << 0xa; + dyn_c_debug_notice_list_entry[getPlayerCount()] = strtol(check_token(1, "-mgfx"), 0, 0) << 0xa; } if (check_token(1, "-mvtx") != 0) { - D_800482F0[get_num_players()] = strtol(check_token(1, "-mvtx"), 0, 0) << 0xa; + D_800482F0[getPlayerCount()] = strtol(check_token(1, "-mvtx"), 0, 0) << 0xa; } mempAllocBytesInBank(dyn_c_debug_notice_list_entry[sVar1] << 1, 4); - ptr_mgfx0_alloc_start.unk4 = (s32) ((0x80050000 + (get_num_players() * 4))->unk-7D20 + ptr_mgfx0_alloc_start); - ptr_mgfx0_alloc_start.unk8 = (s32) ((0x80050000 + (get_num_players() * 4))->unk-7D20 + ptr_mgfx0_alloc_start.unk4); - ptr_mvtx0_alloc_start = mempAllocBytesInBank(((0x80050000 + (get_num_players() * 4))->unk-7D10 * 2), 4); - ptr_mvtx0_alloc_start.unk4 = (s32) ((0x80050000 + (get_num_players() * 4))->unk-7D10 + ptr_mvtx0_alloc_start); - temp_ret = get_num_players(); + ptr_mgfx0_alloc_start.unk4 = (s32) ((0x80050000 + (getPlayerCount() * 4))->unk-7D20 + ptr_mgfx0_alloc_start); + ptr_mgfx0_alloc_start.unk8 = (s32) ((0x80050000 + (getPlayerCount() * 4))->unk-7D20 + ptr_mgfx0_alloc_start.unk4); + ptr_mvtx0_alloc_start = mempAllocBytesInBank(((0x80050000 + (getPlayerCount() * 4))->unk-7D10 * 2), 4); + ptr_mvtx0_alloc_start.unk4 = (s32) ((0x80050000 + (getPlayerCount() * 4))->unk-7D10 + ptr_mvtx0_alloc_start); + temp_ret = getPlayerCount(); ptr_mvtx0_alloc_start.unk8 = (s32) ((0x80050000 + (temp_ret * 4))->unk-7D10 + ptr_mvtx0_alloc_start.unk4); bank_in_mgfx_alloc_table = (u8)0; dword_CODE_bss_8008C254 = 0; @@ -105,7 +105,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F1FD0 7F0BD4A0 24040001 */ li $a0, 1 /* 0F1FD4 7F0BD4A4 10400012 */ beqz $v0, .L7F0BD4F0 /* 0F1FD8 7F0BD4A8 00000000 */ nop -/* 0F1FDC 7F0BD4AC 0FC26919 */ jal get_num_players +/* 0F1FDC 7F0BD4AC 0FC26919 */ jal getPlayerCount /* 0F1FE0 7F0BD4B0 00000000 */ nop /* 0F1FE4 7F0BD4B4 3C058006 */ lui $a1, %hi(aMgfx_1) /* 0F1FE8 7F0BD4B8 24A5B694 */ addiu $a1, %lo(aMgfx_1) # addiu $a1, $a1, -0x496c @@ -129,7 +129,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F202C 7F0BD4FC 24040001 */ li $a0, 1 /* 0F2030 7F0BD500 10400012 */ beqz $v0, .L7F0BD54C /* 0F2034 7F0BD504 00000000 */ nop -/* 0F2038 7F0BD508 0FC26919 */ jal get_num_players +/* 0F2038 7F0BD508 0FC26919 */ jal getPlayerCount /* 0F203C 7F0BD50C 00000000 */ nop /* 0F2040 7F0BD510 3C058006 */ lui $a1, %hi(aMvtx_0) /* 0F2044 7F0BD514 24A5B6A4 */ addiu $a1, %lo(aMvtx_0) # addiu $a1, $a1, -0x495c @@ -147,7 +147,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F2074 7F0BD544 00290821 */ addu $at, $at, $t1 /* 0F2078 7F0BD548 AC3982F0 */ sw $t9, %lo(D_800482F0)($at) .L7F0BD54C: -/* 0F207C 7F0BD54C 0FC26919 */ jal get_num_players +/* 0F207C 7F0BD54C 0FC26919 */ jal getPlayerCount /* 0F2080 7F0BD550 00000000 */ nop /* 0F2084 7F0BD554 00025080 */ sll $t2, $v0, 2 /* 0F2088 7F0BD558 3C048005 */ lui $a0, %hi(D_800482E0) @@ -158,7 +158,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F209C 7F0BD56C 0C0025C8 */ jal mempAllocBytesInBank /* 0F20A0 7F0BD570 01602025 */ move $a0, $t3 /* 0F20A4 7F0BD574 3C018009 */ lui $at, %hi(ptr_mgfx0_alloc_start) -/* 0F20A8 7F0BD578 0FC26919 */ jal get_num_players +/* 0F20A8 7F0BD578 0FC26919 */ jal getPlayerCount /* 0F20AC 7F0BD57C AC22C230 */ sw $v0, %lo(ptr_mgfx0_alloc_start)($at) /* 0F20B0 7F0BD580 3C038009 */ lui $v1, %hi(ptr_mgfx0_alloc_start) /* 0F20B4 7F0BD584 00026080 */ sll $t4, $v0, 2 @@ -168,7 +168,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F20C4 7F0BD594 8C6F0000 */ lw $t7, ($v1) /* 0F20C8 7F0BD598 8DAD82E0 */ lw $t5, %lo(D_800482E0)($t5) /* 0F20CC 7F0BD59C 01AF7021 */ addu $t6, $t5, $t7 -/* 0F20D0 7F0BD5A0 0FC26919 */ jal get_num_players +/* 0F20D0 7F0BD5A0 0FC26919 */ jal getPlayerCount /* 0F20D4 7F0BD5A4 AC6E0004 */ sw $t6, 4($v1) /* 0F20D8 7F0BD5A8 3C038009 */ lui $v1, %hi(ptr_mgfx0_alloc_start) /* 0F20DC 7F0BD5AC 0002C080 */ sll $t8, $v0, 2 @@ -178,7 +178,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F20EC 7F0BD5BC 8C790004 */ lw $t9, 4($v1) /* 0F20F0 7F0BD5C0 8D0882E0 */ lw $t0, %lo(D_800482E0)($t0) /* 0F20F4 7F0BD5C4 01194821 */ addu $t1, $t0, $t9 -/* 0F20F8 7F0BD5C8 0FC26919 */ jal get_num_players +/* 0F20F8 7F0BD5C8 0FC26919 */ jal getPlayerCount /* 0F20FC 7F0BD5CC AC690008 */ sw $t1, 8($v1) /* 0F2100 7F0BD5D0 00025080 */ sll $t2, $v0, 2 /* 0F2104 7F0BD5D4 3C048005 */ lui $a0, %hi(D_800482F0) @@ -190,7 +190,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F211C 7F0BD5EC 01602025 */ move $a0, $t3 /* 0F2120 7F0BD5F0 3C038009 */ lui $v1, %hi(ptr_mvtx0_alloc_start) /* 0F2124 7F0BD5F4 2463C240 */ addiu $v1, %lo(ptr_mvtx0_alloc_start) # addiu $v1, $v1, -0x3dc0 -/* 0F2128 7F0BD5F8 0FC26919 */ jal get_num_players +/* 0F2128 7F0BD5F8 0FC26919 */ jal getPlayerCount /* 0F212C 7F0BD5FC AC620000 */ sw $v0, ($v1) /* 0F2130 7F0BD600 3C038009 */ lui $v1, %hi(ptr_mvtx0_alloc_start) /* 0F2134 7F0BD604 00026080 */ sll $t4, $v0, 2 @@ -200,7 +200,7 @@ glabel set_vtx_gfx_mem_alloc /* 0F2144 7F0BD614 8C6F0000 */ lw $t7, ($v1) /* 0F2148 7F0BD618 8DAD82F0 */ lw $t5, %lo(D_800482F0)($t5) /* 0F214C 7F0BD61C 01AF7021 */ addu $t6, $t5, $t7 -/* 0F2150 7F0BD620 0FC26919 */ jal get_num_players +/* 0F2150 7F0BD620 0FC26919 */ jal getPlayerCount /* 0F2154 7F0BD624 AC6E0004 */ sw $t6, 4($v1) /* 0F2158 7F0BD628 3C038009 */ lui $v1, %hi(ptr_mvtx0_alloc_start) /* 0F215C 7F0BD62C 0002C080 */ sll $t8, $v0, 2 diff --git a/src/game/fog.c b/src/game/fog.c index e9c3c1c8..0b74e2b0 100644 --- a/src/game/fog.c +++ b/src/game/fog.c @@ -476,7 +476,7 @@ glabel load_enviroment /* 0EF598 7F0BAA68 AFBF0014 */ sw $ra, 0x14($sp) /* 0EF59C 7F0BAA6C AFA5002C */ sw $a1, 0x2c($sp) /* 0EF5A0 7F0BAA70 AFA0001C */ sw $zero, 0x1c($sp) -/* 0EF5A4 7F0BAA74 0FC26919 */ jal get_num_players +/* 0EF5A4 7F0BAA74 0FC26919 */ jal getPlayerCount /* 0EF5A8 7F0BAA78 AFA40028 */ sw $a0, 0x28($sp) /* 0EF5AC 7F0BAA7C 24010001 */ li $at, 1 /* 0EF5B0 7F0BAA80 8FA6001C */ lw $a2, 0x1c($sp) @@ -1126,7 +1126,7 @@ glabel sub_GAME_7F0BB2C8 .L7F0BB2E8: /* 0EFE18 7F0BB2E8 0FC227F5 */ jal get_BONDdata_position /* 0EFE1C 7F0BB2EC AFA40030 */ sw $a0, 0x30($sp) -/* 0EFE20 7F0BB2F0 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0EFE20 7F0BB2F0 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0EFE24 7F0BB2F4 AFA2001C */ sw $v0, 0x1c($sp) /* 0EFE28 7F0BB2F8 8FA3001C */ lw $v1, 0x1c($sp) /* 0EFE2C 7F0BB2FC 8FA40030 */ lw $a0, 0x30($sp) diff --git a/src/game/gamefile.c b/src/game/gamefile.c index 0ac8cba3..0c9b46e1 100644 --- a/src/game/gamefile.c +++ b/src/game/gamefile.c @@ -111,34 +111,23 @@ f32 get_007_accuracy_mod(void) #ifdef NONMATCHING void end_of_mission_briefing(void) - { - short sVar1; - int iVar3; - save_file *folder; - ulonglong uVar2; - - if (((-1 < briefingpage) && (selected_difficulty != DIFFICULTY_007)) && (append_cheat_sp == FALSE) - ) { - sVar1 = (&solo_target_times_ARRAY_8002b564 - [mission_folder_setup_entries[briefingpage].mission_num].agent_time) - [selected_difficulty]; + if (((-1 < briefingpage) && (selected_difficulty != DIFFICULTY_007)) && (append_cheat_sp == FALSE)) + { + unlock_stage_in_folder_on_difficulty(selected_folder_num, mission_folder_setup_entries[briefingpage].mission_num, selected_difficulty, get_mission_timer() / 0x3c); - unlock_stage_in_folder_on_difficulty - (selected_folder_num,(longlong)mission_folder_setup_entries[briefingpage].mission_num, - (longlong)selected_difficulty,getMissiontime() / 0x3c); - - if ((longlong)(getMissiontime() / 0x3c) <= (longlong)sVar1) { - folder = getEEPROMforFoldernum(selected_folder_num); - if (check_if_cheat_unlocked(folder,(longlong)mission_folder_setup_entries[briefingpage].mission_num) == 0) { - proc_7F01E760(selected_folder_num,(longlong)mission_folder_setup_entries[briefingpage].mission_num); - newcheatunlocked = 1; - return; - } + if ((get_mission_timer() / 0x3c) <= (&solo_target_time_array[mission_folder_setup_entries[briefingpage].mission_num].agent_time)[selected_difficulty]) + { + if (check_if_cheat_unlocked(get_save_folder_ptr(selected_folder_num), mission_folder_setup_entries[briefingpage].mission_num) == 0) + { + sub_GAME_7F01E760(selected_folder_num, mission_folder_setup_entries[briefingpage].mission_num); + newcheatunlocked = 1; + return; + } + } + newcheatunlocked = 0; } - newcheatunlocked = 0; - } - return; + return; } #else @@ -363,115 +352,51 @@ void set_selected_folder_num(u32 foldernum) selected_folder_num = foldernum; } - - - -#ifdef NONMATCHING void set_selected_difficulty(DIFFICULTY difficulty) { - if (difficulty != DIFFICULTY_AGENT) - { - if (difficulty == DIFFICULTY_SECRET) + switch(difficulty) { - selected_difficulty = DIFFICULTY_SECRET; - return; + case DIFFICULTY_AGENT: + default: + selected_difficulty = DIFFICULTY_AGENT; + return; + case DIFFICULTY_SECRET: + selected_difficulty = DIFFICULTY_SECRET; + return; + case DIFFICULTY_00: + selected_difficulty = DIFFICULTY_00; + return; + case DIFFICULTY_007: + selected_difficulty = DIFFICULTY_007; + return; } - if (difficulty == DIFFICULTY_00) - { - selected_difficulty = DIFFICULTY_00; - return; - } - if (difficulty == DIFFICULTY_007) - { - selected_difficulty = DIFFICULTY_007; - return; - } - } - else - { - selected_difficulty = DIFFICULTY_AGENT; - } } -#else -GLOBAL_ASM( -.text -glabel set_selected_difficulty -/* 0520CC 7F01D59C 10800009 */ beqz $a0, .L7F01D5C4 -/* 0520D0 7F01D5A0 24020001 */ li $v0, 1 -/* 0520D4 7F01D5A4 1082000A */ beq $a0, $v0, .L7F01D5D0 -/* 0520D8 7F01D5A8 3C018003 */ lui $at, %hi(selected_difficulty) -/* 0520DC 7F01D5AC 24020002 */ li $v0, 2 -/* 0520E0 7F01D5B0 10820009 */ beq $a0, $v0, .L7F01D5D8 -/* 0520E4 7F01D5B4 3C018003 */ lui $at, %hi(selected_difficulty) -/* 0520E8 7F01D5B8 24020003 */ li $v0, 3 -/* 0520EC 7F01D5BC 10820008 */ beq $a0, $v0, .L7F01D5E0 -/* 0520F0 7F01D5C0 3C018003 */ lui $at, %hi(selected_difficulty) -.L7F01D5C4: -/* 0520F4 7F01D5C4 3C018003 */ lui $at, %hi(selected_difficulty) -/* 0520F8 7F01D5C8 03E00008 */ jr $ra -/* 0520FC 7F01D5CC AC20A8FC */ sw $zero, %lo(selected_difficulty)($at) - -.L7F01D5D0: -/* 052100 7F01D5D0 03E00008 */ jr $ra -/* 052104 7F01D5D4 AC22A8FC */ sw $v0, %lo(selected_difficulty)($at) - -.L7F01D5D8: -/* 052108 7F01D5D8 03E00008 */ jr $ra -/* 05210C 7F01D5DC AC22A8FC */ sw $v0, %lo(selected_difficulty)($at) - -.L7F01D5E0: -/* 052110 7F01D5E0 AC22A8FC */ sw $v0, %lo(selected_difficulty)($at) -/* 052114 7F01D5E4 03E00008 */ jr $ra -/* 052118 7F01D5E8 00000000 */ nop -) -#endif - - - void set_solo_and_ptr_briefing(LEVELID stage) { - gamemode = GAMEMODE_SOLO; - selected_stage = stage; - briefingpage = pull_and_display_text_for_folder_a0(stage); + gamemode = GAMEMODE_SOLO; + selected_stage = stage; + briefingpage = pull_and_display_text_for_folder_a0(stage); } void sub_GAME_7F01D61C(struct save_file *savefile) { - copy_eeprom_from_to(selected_folder_num,savefile); + copy_eeprom_from_to(selected_folder_num,savefile); } -#ifdef NONMATCHING +//this feels fake, generated with a permuter session i forgot was running void sub_GAME_7F01D644(struct save_file *eeprom) { - selected_folder_num_copy = selected_folder_num; - selected_folder_num = 100; - copy_eepromfile_a0_from_a1_to_buffer(100,eeprom); - return; + int new_var; + long long new_var2; + new_var2 = (long long) 0x64; + new_var = new_var2; + selected_folder_num_copy = (s32) selected_folder_num; + selected_folder_num = new_var; + copy_eepromfile_a0_from_a1_to_buffer(new_var, eeprom); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01D644 -/* 052174 7F01D644 3C028003 */ lui $v0, %hi(selected_folder_num) -/* 052178 7F01D648 2442A8E8 */ addiu $v0, %lo(selected_folder_num) # addiu $v0, $v0, -0x5718 -/* 05217C 7F01D64C 8C4E0000 */ lw $t6, ($v0) -/* 052180 7F01D650 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 052184 7F01D654 00802825 */ move $a1, $a0 -/* 052188 7F01D658 3C018003 */ lui $at, %hi(selected_folder_num_copy) -/* 05218C 7F01D65C AFBF0014 */ sw $ra, 0x14($sp) -/* 052190 7F01D660 24040064 */ li $a0, 100 -/* 052194 7F01D664 AC2EA8EC */ sw $t6, %lo(selected_folder_num_copy)($at) -/* 052198 7F01D668 0FC07D17 */ jal copy_eepromfile_a0_from_a1_to_buffer -/* 05219C 7F01D66C AC440000 */ sw $a0, ($v0) -/* 0521A0 7F01D670 8FBF0014 */ lw $ra, 0x14($sp) -/* 0521A4 7F01D674 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0521A8 7F01D678 03E00008 */ jr $ra -/* 0521AC 7F01D67C 00000000 */ nop -) -#endif void store_favorite_weapon_current_player(u32 right,u32 left) @@ -479,6 +404,6 @@ void store_favorite_weapon_current_player(u32 right,u32 left) u32 playerNum; playerNum = get_cur_playernum(); - array_favweapon[playerNum][0] = right; - array_favweapon[playerNum][1] = left; + array_favweapon[playerNum][RIGHT_HAND] = right; + array_favweapon[playerNum][LEFT_HAND] = left; } \ No newline at end of file diff --git a/src/game/gamefile.h b/src/game/gamefile.h index cb880803..436d0c53 100644 --- a/src/game/gamefile.h +++ b/src/game/gamefile.h @@ -6,7 +6,7 @@ struct save_data { int chksum1; int chksum2; - char completion_bitflags; + u8 completion_bitflags; char flag_007; char music_vol; char sfx_vol; diff --git a/src/game/gamefile2.c b/src/game/gamefile2.c index 4538745a..143e4f1b 100644 --- a/src/game/gamefile2.c +++ b/src/game/gamefile2.c @@ -188,21 +188,11 @@ glabel sub_GAME_7F01D840 #endif - -#ifdef NONMATCHING -void get_foldernum_of_eeprom(void) { - +u32 get_foldernum_of_eeprom(struct save_data *eeprom) +{ + return eeprom->completion_bitflags & 7; } -#else -GLOBAL_ASM( -.text -glabel get_foldernum_of_eeprom -/* 0523F8 7F01D8C8 90820008 */ lbu $v0, 8($a0) -/* 0523FC 7F01D8CC 304E0007 */ andi $t6, $v0, 7 -/* 052400 7F01D8D0 03E00008 */ jr $ra -/* 052404 7F01D8D4 01C01025 */ move $v0, $t6 -) -#endif + @@ -225,21 +215,11 @@ glabel set_eeprom_to_folder_num #endif - -#ifdef NONMATCHING -void set_eeprom_flag_0x18(void) { - +u32 set_eeprom_flag_0x18(struct save_data *folder) +{ + return (folder->completion_bitflags & 0x18) >> 3; } -#else -GLOBAL_ASM( -.text -glabel set_eeprom_flag_0x18 -/* 052424 7F01D8F4 90820008 */ lbu $v0, 8($a0) -/* 052428 7F01D8F8 304E0018 */ andi $t6, $v0, 0x18 -/* 05242C 7F01D8FC 03E00008 */ jr $ra -/* 052430 7F01D900 000E10C3 */ sra $v0, $t6, 3 -) -#endif + @@ -264,20 +244,12 @@ glabel reset_eeprom_flag_0x18 -#ifdef NONMATCHING -void get_selected_bond(void) { +u32 get_selected_bond(struct save_data *folder) +{ + return (folder->completion_bitflags & 0x60) >> 5; } -#else -GLOBAL_ASM( -.text -glabel get_selected_bond -/* 052454 7F01D924 90820008 */ lbu $v0, 8($a0) -/* 052458 7F01D928 304E0060 */ andi $t6, $v0, 0x60 -/* 05245C 7F01D92C 03E00008 */ jr $ra -/* 052460 7F01D930 000E1143 */ sra $v0, $t6, 5 -) -#endif + @@ -302,46 +274,23 @@ glabel set_selected_bond -#ifdef NONMATCHING -void check_if_eeprom_flag_set_0x80(void) { +u32 check_if_eeprom_flag_set_0x80(struct save_data *folder) +{ + return ((folder->completion_bitflags & 0x80) != 0); } -#else -GLOBAL_ASM( -.text -glabel check_if_eeprom_flag_set_0x80 -/* 052484 7F01D954 90820008 */ lbu $v0, 8($a0) -/* 052488 7F01D958 304E0080 */ andi $t6, $v0, 0x80 -/* 05248C 7F01D95C 03E00008 */ jr $ra -/* 052490 7F01D960 000E102B */ sltu $v0, $zero, $t6 -) -#endif - -#ifdef NONMATCHING -void toggle_eeprom_flag_set_0x80(void) { - +void toggle_eeprom_flag_set_0x80(struct save_data *folder,u32 mode) +{ + if (mode != 0) { + folder->completion_bitflags = folder->completion_bitflags | 0x80; + return; + } + folder->completion_bitflags = folder->completion_bitflags & 0xff7f; + return; } -#else -GLOBAL_ASM( -.text -glabel toggle_eeprom_flag_set_0x80 -/* 052494 7F01D964 50A00006 */ beql $a1, $zero, .L7F01D980 -/* 052498 7F01D968 90980008 */ lbu $t8, 8($a0) -/* 05249C 7F01D96C 908E0008 */ lbu $t6, 8($a0) -/* 0524A0 7F01D970 35CF0080 */ ori $t7, $t6, 0x80 -/* 0524A4 7F01D974 03E00008 */ jr $ra -/* 0524A8 7F01D978 A08F0008 */ sb $t7, 8($a0) -/* 0524AC 7F01D97C 90980008 */ lbu $t8, 8($a0) -.L7F01D980: -/* 0524B0 7F01D980 3319FF7F */ andi $t9, $t8, 0xff7f -/* 0524B4 7F01D984 A0990008 */ sb $t9, 8($a0) -/* 0524B8 7F01D988 03E00008 */ jr $ra -/* 0524BC 7F01D98C 00000000 */ nop -) -#endif @@ -649,7 +598,7 @@ glabel sub_GAME_7F01DCB0 #ifdef NONMATCHING -void check_if_cheat_unlocked(void) { +u32 check_if_cheat_unlocked(save_file *folder,s32 cheat) { } #else @@ -1105,34 +1054,18 @@ glabel sub_GAME_7F01DF90 -#ifdef NONMATCHING -void check_if_valid_folder_num(void) { - +s32 check_if_valid_folder_num(s32 folder) +{ + if ((folder >= 0) && (folder < 4)) + { + return 1; + } + if (folder == 100) + { + return 1; + } + return 0; } -#else -GLOBAL_ASM( -.text -glabel check_if_valid_folder_num -/* 052DBC 7F01E28C 04800005 */ bltz $a0, .L7F01E2A4 -/* 052DC0 7F01E290 28810004 */ slti $at, $a0, 4 -/* 052DC4 7F01E294 50200004 */ beql $at, $zero, .L7F01E2A8 -/* 052DC8 7F01E298 24010064 */ li $at, 100 -/* 052DCC 7F01E29C 03E00008 */ jr $ra -/* 052DD0 7F01E2A0 24020001 */ li $v0, 1 - -.L7F01E2A4: -/* 052DD4 7F01E2A4 24010064 */ li $at, 100 -.L7F01E2A8: -/* 052DD8 7F01E2A8 14810003 */ bne $a0, $at, .L7F01E2B8 -/* 052DDC 7F01E2AC 00001025 */ move $v0, $zero -/* 052DE0 7F01E2B0 03E00008 */ jr $ra -/* 052DE4 7F01E2B4 24020001 */ li $v0, 1 - -.L7F01E2B8: -/* 052DE8 7F01E2B8 03E00008 */ jr $ra -/* 052DEC 7F01E2BC 00000000 */ nop -) -#endif @@ -2187,7 +2120,7 @@ glabel update_eeprom_to_current_solo_watch_settings /* 053A44 7F01EF14 AFBF001C */ sw $ra, 0x1c($sp) /* 053A48 7F01EF18 AFB00018 */ sw $s0, 0x18($sp) /* 053A4C 7F01EF1C AFA40020 */ sw $a0, 0x20($sp) -/* 053A50 7F01EF20 0FC2A4D6 */ jal sub_GAME_7F0A9358 +/* 053A50 7F01EF20 0FC2A4D6 */ jal get_mTrack2Vol /* 053A54 7F01EF24 00008025 */ move $s0, $zero /* 053A58 7F01EF28 8FAF0020 */ lw $t7, 0x20($sp) /* 053A5C 7F01EF2C 000271C3 */ sra $t6, $v0, 7 @@ -2289,7 +2222,7 @@ glabel get_screen_ratio_settings_for_mpgame_from_folder /* 053B84 7F01F054 00027843 */ sra $t7, $v0, 1 /* 053B88 7F01F058 01CF2025 */ or $a0, $t6, $t7 /* 053B8C 7F01F05C 3098FFFF */ andi $t8, $a0, 0xffff -/* 053B90 7F01F060 0FC2A4D9 */ jal sub_GAME_7F0A9364 +/* 053B90 7F01F060 0FC2A4D9 */ jal set_mTrack2Vol /* 053B94 7F01F064 03002025 */ move $a0, $t8 /* 053B98 7F01F068 8FB00024 */ lw $s0, 0x24($sp) /* 053B9C 7F01F06C 9202000B */ lbu $v0, 0xb($s0) @@ -2300,7 +2233,7 @@ glabel get_screen_ratio_settings_for_mpgame_from_folder /* 053BB0 7F01F080 0FC2A468 */ jal sub_GAME_7F0A91A0 /* 053BB4 7F01F084 01202025 */ move $a0, $t1 /* 053BB8 7F01F088 960A000C */ lhu $t2, 0xc($s0) -/* 053BBC 7F01F08C 0FC26919 */ jal get_num_players +/* 053BBC 7F01F08C 0FC26919 */ jal getPlayerCount /* 053BC0 7F01F090 A7AA0020 */ sh $t2, 0x20($sp) /* 053BC4 7F01F094 24010001 */ li $at, 1 /* 053BC8 7F01F098 14410007 */ bne $v0, $at, .L7F01F0B8 diff --git a/src/game/initBondDATA.c b/src/game/initBondDATA.c index 5ea39df0..f0112109 100644 --- a/src/game/initBondDATA.c +++ b/src/game/initBondDATA.c @@ -58,7 +58,7 @@ glabel init_player_BONDdata_stats /* 039C50 7F005120 3C108008 */ lui $s0, %hi(pPlayer) /* 039C54 7F005124 2610A0B0 */ addiu $s0, %lo(pPlayer) # addiu $s0, $s0, -0x5f50 /* 039C58 7F005128 8E090000 */ lw $t1, ($s0) -/* 039C5C 7F00512C 0FC26919 */ jal get_num_players +/* 039C5C 7F00512C 0FC26919 */ jal getPlayerCount /* 039C60 7F005130 AD220808 */ sw $v0, 0x808($t1) /* 039C64 7F005134 24010001 */ li $at, 1 /* 039C68 7F005138 14410006 */ bne $v0, $at, .L7F005154 diff --git a/src/game/initBondDATAdefaults.c b/src/game/initBondDATAdefaults.c index 4b9b20e1..f865378f 100644 --- a/src/game/initBondDATAdefaults.c +++ b/src/game/initBondDATAdefaults.c @@ -347,11 +347,11 @@ glabel sets_a_bunch_of_BONDdata_values_to_default /* 03B2A4 7F006774 0FC1BF7A */ jal sub_GAME_7F06FDE8 /* 03B2A8 7F006778 8DC50008 */ lw $a1, 8($t6) /* 03B2AC 7F00677C 8E240000 */ lw $a0, ($s1) -/* 03B2B0 7F006780 3C057F09 */ lui $a1, %hi(sub_GAME_7F08DBB0) # $a1, 0x7f09 -/* 03B2B4 7F006784 24A5DBB0 */ addiu $a1, %lo(sub_GAME_7F08DBB0) # addiu $a1, $a1, -0x2450 +/* 03B2B0 7F006780 3C057F09 */ lui $a1, %hi(currentPlayerToggle5BC) # $a1, 0x7f09 +/* 03B2B4 7F006784 24A5DBB0 */ addiu $a1, %lo(currentPlayerToggle5BC) # addiu $a1, $a1, -0x2450 /* 03B2B8 7F006788 0FC1BF8F */ jal sub_GAME_7F06FE3C /* 03B2BC 7F00678C 24840598 */ addiu $a0, $a0, 0x598 -/* 03B2C0 7F006790 0FC236F2 */ jal sub_GAME_7F08DBC8 +/* 03B2C0 7F006790 0FC236F2 */ jal currentPlayerUpdateIdleHeadRoll /* 03B2C4 7F006794 00000000 */ nop /* 03B2C8 7F006798 8FBF0044 */ lw $ra, 0x44($sp) /* 03B2CC 7F00679C D7B40020 */ ldc1 $f20, 0x20($sp) @@ -640,11 +640,11 @@ glabel sets_a_bunch_of_BONDdata_values_to_default /* 03B300 7F006790 0FC1C0F6 */ jal sub_GAME_7F06FDE8 /* 03B304 7F006794 8DC50008 */ lw $a1, 8($t6) /* 03B308 7F006798 8E240000 */ lw $a0, ($s1) -/* 03B30C 7F00679C 3C057F09 */ lui $a1, %hi(sub_GAME_7F08DBB0) # $a1, 0x7f09 -/* 03B310 7F0067A0 24A5E690 */ addiu $a1, %lo(sub_GAME_7F08DBB0) # addiu $a1, $a1, -0x1970 +/* 03B30C 7F00679C 3C057F09 */ lui $a1, %hi(currentPlayerToggle5BC) # $a1, 0x7f09 +/* 03B310 7F0067A0 24A5E690 */ addiu $a1, %lo(currentPlayerToggle5BC) # addiu $a1, $a1, -0x1970 /* 03B314 7F0067A4 0FC1C10B */ jal sub_GAME_7F06FE3C /* 03B318 7F0067A8 24840598 */ addiu $a0, $a0, 0x598 -/* 03B31C 7F0067AC 0FC239AA */ jal sub_GAME_7F08DBC8 +/* 03B31C 7F0067AC 0FC239AA */ jal currentPlayerUpdateIdleHeadRoll /* 03B320 7F0067B0 00000000 */ nop /* 03B324 7F0067B4 8FBF0044 */ lw $ra, 0x44($sp) /* 03B328 7F0067B8 D7B40020 */ ldc1 $f20, 0x20($sp) diff --git a/src/game/initcameraandthrown.c b/src/game/initcameraandthrown.c index 02591533..4af34110 100644 --- a/src/game/initcameraandthrown.c +++ b/src/game/initcameraandthrown.c @@ -644,7 +644,7 @@ def_7F005A74: /* 03A9C8 7F005E98 8D089C68 */ lw $t0, %lo(dword_CODE_bss_80079C68)($t0) /* 03A9CC 7F005E9C 5900002C */ blezl $t0, .L7F005F50 /* 03A9D0 7F005EA0 27A4008C */ addiu $a0, $sp, 0x8c -/* 03A9D4 7F005EA4 0FC26919 */ jal get_num_players +/* 03A9D4 7F005EA4 0FC26919 */ jal getPlayerCount /* 03A9D8 7F005EA8 00000000 */ nop /* 03A9DC 7F005EAC 28410002 */ slti $at, $v0, 2 /* 03A9E0 7F005EB0 14200008 */ bnez $at, .L7F005ED4 @@ -813,7 +813,7 @@ def_7F005A74: /* 03AC58 7F006128 8E420000 */ lw $v0, ($s2) /* 03AC5C 7F00612C C45204BC */ lwc1 $f18, 0x4bc($v0) /* 03AC60 7F006130 46009103 */ div.s $f4, $f18, $f0 -/* 03AC64 7F006134 0FC26919 */ jal get_num_players +/* 03AC64 7F006134 0FC26919 */ jal getPlayerCount /* 03AC68 7F006138 E44403C0 */ swc1 $f4, 0x3c0($v0) /* 03AC6C 7F00613C 24010001 */ li $at, 1 /* 03AC70 7F006140 14410005 */ bne $v0, $at, .L7F006158 @@ -1406,7 +1406,7 @@ def_7F005A74: /* 03AA04 7F005E94 8F399CD8 */ lw $t9, %lo(dword_CODE_bss_80079C68)($t9) /* 03AA08 7F005E98 5B20002C */ blezl $t9, .L7F005F4C /* 03AA0C 7F005E9C 27A40094 */ addiu $a0, $sp, 0x94 -/* 03AA10 7F005EA0 0FC26C01 */ jal get_num_players +/* 03AA10 7F005EA0 0FC26C01 */ jal getPlayerCount /* 03AA14 7F005EA4 00000000 */ nop /* 03AA18 7F005EA8 28410002 */ slti $at, $v0, 2 /* 03AA1C 7F005EAC 14200008 */ bnez $at, .L7F005ED0 @@ -1574,7 +1574,7 @@ def_7F005A74: /* 03AC90 7F006120 8E420000 */ lw $v0, ($s2) /* 03AC94 7F006124 C45204BC */ lwc1 $f18, 0x4bc($v0) /* 03AC98 7F006128 46009203 */ div.s $f8, $f18, $f0 -/* 03AC9C 7F00612C 0FC26C01 */ jal get_num_players +/* 03AC9C 7F00612C 0FC26C01 */ jal getPlayerCount /* 03ACA0 7F006130 E44803C0 */ swc1 $f8, 0x3c0($v0) /* 03ACA4 7F006134 24010001 */ li $at, 1 /* 03ACA8 7F006138 14410005 */ bne $v0, $at, .L7F006150 diff --git a/src/game/initexplosioncasing.c b/src/game/initexplosioncasing.c index e1d43561..953baafd 100644 --- a/src/game/initexplosioncasing.c +++ b/src/game/initexplosioncasing.c @@ -161,7 +161,7 @@ glabel alloc_explosion_smoke_casing_scorch_impact_buffers /* 03BB00 7F006FD0 28810014 */ slti $at, $a0, 0x14 /* 03BB04 7F006FD4 1420FFB7 */ bnez $at, .L7F006EB4 /* 03BB08 7F006FD8 24C60198 */ addiu $a2, $a2, 0x198 -/* 03BB0C 7F006FDC 0FC26919 */ jal get_num_players +/* 03BB0C 7F006FDC 0FC26919 */ jal getPlayerCount /* 03BB10 7F006FE0 00000000 */ nop /* 03BB14 7F006FE4 24010001 */ li $at, 1 /* 03BB18 7F006FE8 14410017 */ bne $v0, $at, .L7F007048 @@ -205,7 +205,7 @@ glabel alloc_explosion_smoke_casing_scorch_impact_buffers /* 03BBA4 7F007074 28611F40 */ slti $at, $v1, 0x1f40 /* 03BBA8 7F007078 1420FFFB */ bnez $at, .L7F007068 /* 03BBAC 7F00707C A5E60000 */ sh $a2, ($t7) -/* 03BBB0 7F007080 0FC26919 */ jal get_num_players +/* 03BBB0 7F007080 0FC26919 */ jal getPlayerCount /* 03BBB4 7F007084 00000000 */ nop /* 03BBB8 7F007088 241800C8 */ li $t8, 200 /* 03BBBC 7F00708C 0302001A */ div $zero, $t8, $v0 diff --git a/src/game/initpathtablesomething.c b/src/game/initpathtablesomething.c index 9933b412..74afe876 100644 --- a/src/game/initpathtablesomething.c +++ b/src/game/initpathtablesomething.c @@ -24,7 +24,7 @@ glabel init_pathtable_something /* 03B314 7F0067E4 AE220000 */ sw $v0, ($s1) /* 03B318 7F0067E8 00402025 */ move $a0, $v0 /* 03B31C 7F0067EC 8E050000 */ lw $a1, ($s0) -/* 03B320 7F0067F0 0FC2C0DB */ jal sub_GAME_7F0B036C +/* 03B320 7F0067F0 0FC2C0DB */ jal isPointInsideTriStandTileUnscaled_Maybe /* 03B324 7F0067F4 8E060008 */ lw $a2, 8($s0) /* 03B328 7F0067F8 5440001D */ bnezl $v0, .L7F006870 /* 03B32C 7F0067FC 24020001 */ li $v0, 1 diff --git a/src/game/initunk_007180.c b/src/game/initunk_007180.c index a4a59924..d35de066 100644 --- a/src/game/initunk_007180.c +++ b/src/game/initunk_007180.c @@ -14,7 +14,7 @@ glabel sub_GAME_7F007180 /* 03BCB4 7F007184 AFBF0014 */ sw $ra, 0x14($sp) /* 03BCB8 7F007188 0FC2F7C1 */ jal sub_GAME_7F0BDF04 /* 03BCBC 7F00718C 00000000 */ nop -/* 03BCC0 7F007190 0FC26919 */ jal get_num_players +/* 03BCC0 7F007190 0FC26919 */ jal getPlayerCount /* 03BCC4 7F007194 AFA20018 */ sw $v0, 0x18($sp) /* 03BCC8 7F007198 240E00C8 */ li $t6, 200 /* 03BCCC 7F00719C 01C2001A */ div $zero, $t6, $v0 diff --git a/src/game/intro_logos.c b/src/game/intro_logos.c index 46edb8ce..43397db4 100644 --- a/src/game/intro_logos.c +++ b/src/game/intro_logos.c @@ -880,7 +880,7 @@ glabel insert_bond_eye_intro /* 03CFB8 7F008488 27A40060 */ addiu $a0, $sp, 0x60 /* 03CFBC 7F00848C E7B00020 */ swc1 $f16, 0x20($sp) /* 03CFC0 7F008490 E7B20024 */ swc1 $f18, 0x24($sp) -/* 03CFC4 7F008494 0FC165A5 */ jal sub_GAME_7F059694 +/* 03CFC4 7F008494 0FC165A5 */ jal matrix_4x4_7F059694 /* 03CFC8 7F008498 E7AA001C */ swc1 $f10, 0x1c($sp) /* 03CFCC 7F00849C 02002025 */ move $a0, $s0 /* 03CFD0 7F0084A0 24050002 */ li $a1, 2 diff --git a/src/game/lightfixture.c b/src/game/lightfixture.c index d00098ba..ceb2459e 100644 --- a/src/game/lightfixture.c +++ b/src/game/lightfixture.c @@ -1,5 +1,6 @@ #include "ultra64.h" #include "game/lightfixture.h" +#include "assets/images/image_externs.h" // bss //CODE.bss:80082660 @@ -19,50 +20,57 @@ s32 dword_CODE_bss_80083318; //D:80046030 s32 D_80046030[] = {0, 0, 0, 0, 0, 0, 0, 0}; - +//this mostly matches 4 bytes different +#ifdef NONMATCHING void init_lightfixture_tables(void) { s32 i; - - for (i=0;i<0x64;i++) - { - light_fixture_table[i].index = 0; - } - - for (i=0;i<0x400;i=i+8) - { - word_CODE_bss_80082B18[i+2] = 0; - word_CODE_bss_80082B18[i+4] = 0; - word_CODE_bss_80082B18[i+6] = 0; - word_CODE_bss_80082B18[i+0] = 0; - } - + for (i=0;i<0x64;i++) {light_fixture_table[i].index = 0;} + for (i=0;i<0x400;i++) {word_CODE_bss_80082B18[i] = 0;} D_80046030[0] = 0; } +#else +GLOBAL_ASM( +.text +glabel init_lightfixture_tables +/* 0F0000 7F0BB4D0 3C038008 */ lui $v1, %hi(light_fixture_table) +/* 0F0004 7F0BB4D4 3C028008 */ lui $v0, %hi(cur_entry_lightfixture_table) +/* 0F0008 7F0BB4D8 24422B10 */ addiu $v0, %lo(cur_entry_lightfixture_table) # addiu $v0, $v0, 0x2b10 +/* 0F000C 7F0BB4DC 24632660 */ addiu $v1, %lo(light_fixture_table) # addiu $v1, $v1, 0x2660 +.L7F0BB4E0: +/* 0F0010 7F0BB4E0 2463000C */ addiu $v1, $v1, 0xc +/* 0F0014 7F0BB4E4 0062082B */ sltu $at, $v1, $v0 +/* 0F0018 7F0BB4E8 1420FFFD */ bnez $at, .L7F0BB4E0 +/* 0F001C 7F0BB4EC A460FFF4 */ sh $zero, -0xc($v1) +/* 0F0020 7F0BB4F0 3C038008 */ lui $v1, %hi(word_CODE_bss_80082B18) +/* 0F0024 7F0BB4F4 3C028008 */ lui $v0, %hi(dword_CODE_bss_80083318) +/* 0F0028 7F0BB4F8 24423318 */ addiu $v0, %lo(dword_CODE_bss_80083318) # addiu $v0, $v0, 0x3318 +/* 0F002C 7F0BB4FC 24632B18 */ addiu $v1, %lo(word_CODE_bss_80082B18) # addiu $v1, $v1, 0x2b18 +.L7F0BB500: + /*v1 offsets don't match*/ +/* 0F0030 7F0BB500 24630010 */ addiu $v1, $v1, 0x10 +/* 0F0034 7F0BB504 A460FFF4 */ sh $zero, -0xc($v1) +/* 0F0038 7F0BB508 A460FFF8 */ sh $zero, -8($v1) +/* 0F003C 7F0BB50C A460FFFC */ sh $zero, -4($v1) +/* 0F0040 7F0BB510 1462FFFB */ bne $v1, $v0, .L7F0BB500 +/* 0F0044 7F0BB514 A460FFF0 */ sh $zero, -0x10($v1) +/* 0F0048 7F0BB518 3C018004 */ lui $at, %hi(D_80046030) +/* 0F004C 7F0BB51C 03E00008 */ jr $ra +/* 0F0050 7F0BB520 AC206030 */ sw $zero, %lo(D_80046030)($at) +) +#endif s32 get_index_of_current_entry_in_init_lightfixture_table(void) { s32 i; - for (i = 0; i != 0x64; i+=4) + for (i = 0; i != 0x64; i++) { if (light_fixture_table[i].index == 0) { return i; } - if (light_fixture_table[i+1].index == 0) - { - return i + 1; - } - if (light_fixture_table[i+2].index == 0) - { - return i + 2; - } - if (light_fixture_table[i+3].index == 0) - { - return i + 3; - } } return 0x64; } @@ -86,87 +94,27 @@ void save_ptrDL_enpoint_to_current_init_lightfixture_table(Gfx *param_1) } - -#ifdef NONMATCHING s32 check_if_imageID_is_light(s32 imageID) { - if (imageID == 0xC9) + if ((imageID == _image201_ID_LIGHT) || + (imageID == _image203_ID_LIGHT) || + (imageID == _image205_ID_LIGHT) || + (imageID == _image252_ID_LIGHT) || + (imageID == _image254_ID_LIGHT) || + (imageID == _image255_ID_LIGHT) || + (imageID == _image256_ID_LIGHT) || + (imageID == _image428_ID_LIGHT) || + (imageID == _image982_ID_LIGHT) || + (imageID == _image1383_ID_LIGHT)) { return 1; - } - if (imageID == 0xCB) + } + else { - return 1; + return 0; } - if (imageID == 0xCD) - { - return 1; - } - if (imageID == 0xFC) - { - return 1; - } - if (imageID == 0xFE) - { - return 1; - } - if (imageID == 0xFF) - { - return 1; - } - if (imageID == 0x100) - { - return 1; - } - if (imageID == 0x1AC) - { - return 1; - } - if (imageID == 0x3D6) - { - return 1; - } - if (imageID == 0x567) - { - return 1; - } - return 0; } -#else -GLOBAL_ASM( -.text -glabel check_if_imageID_is_light -/* 0F0160 7F0BB630 240100C9 */ li $at, 201 -/* 0F0164 7F0BB634 10810013 */ beq $a0, $at, .L7F0BB684 -/* 0F0168 7F0BB638 240100CB */ li $at, 203 -/* 0F016C 7F0BB63C 10810011 */ beq $a0, $at, .L7F0BB684 -/* 0F0170 7F0BB640 240100CD */ li $at, 205 -/* 0F0174 7F0BB644 1081000F */ beq $a0, $at, .L7F0BB684 -/* 0F0178 7F0BB648 240100FC */ li $at, 252 -/* 0F017C 7F0BB64C 1081000D */ beq $a0, $at, .L7F0BB684 -/* 0F0180 7F0BB650 240100FE */ li $at, 254 -/* 0F0184 7F0BB654 1081000B */ beq $a0, $at, .L7F0BB684 -/* 0F0188 7F0BB658 240100FF */ li $at, 255 -/* 0F018C 7F0BB65C 10810009 */ beq $a0, $at, .L7F0BB684 -/* 0F0190 7F0BB660 24010100 */ li $at, 256 -/* 0F0194 7F0BB664 10810007 */ beq $a0, $at, .L7F0BB684 -/* 0F0198 7F0BB668 240101AC */ li $at, 428 -/* 0F019C 7F0BB66C 10810005 */ beq $a0, $at, .L7F0BB684 -/* 0F01A0 7F0BB670 240103D6 */ li $at, 982 -/* 0F01A4 7F0BB674 10810003 */ beq $a0, $at, .L7F0BB684 -/* 0F01A8 7F0BB678 24010567 */ li $at, 1383 -/* 0F01AC 7F0BB67C 14810003 */ bne $a0, $at, .L7F0BB68C -/* 0F01B0 7F0BB680 00001025 */ move $v0, $zero -.L7F0BB684: -/* 0F01B4 7F0BB684 03E00008 */ jr $ra -/* 0F01B8 7F0BB688 24020001 */ li $v0, 1 - -.L7F0BB68C: -/* 0F01BC 7F0BB68C 03E00008 */ jr $ra -/* 0F01C0 7F0BB690 00000000 */ nop -) -#endif diff --git a/src/game/lvl.c b/src/game/lvl.c index 7a1a5098..4551e9ee 100644 --- a/src/game/lvl.c +++ b/src/game/lvl.c @@ -490,7 +490,7 @@ glabel stage_load /* 0F27BC 7F0BDC8C 0240A025 */ move $s4, $s2 /* 0F27C0 7F0BDC90 24130004 */ li $s3, 4 .L7F0BDC94: -/* 0F27C4 7F0BDC94 0FC26919 */ jal get_num_players +/* 0F27C4 7F0BDC94 0FC26919 */ jal getPlayerCount /* 0F27C8 7F0BDC98 00000000 */ nop /* 0F27CC 7F0BDC9C 24010001 */ li $at, 1 /* 0F27D0 7F0BDCA0 14410009 */ bne $v0, $at, .L7F0BDCC8 @@ -605,7 +605,7 @@ glabel stage_load /* 0F2968 7F0BDE38 00000000 */ nop /* 0F296C 7F0BDE3C 0FC01410 */ jal something_with_ejected_cartridges /* 0F2970 7F0BDE40 00000000 */ nop -/* 0F2974 7F0BDE44 0FC26919 */ jal get_num_players +/* 0F2974 7F0BDE44 0FC26919 */ jal getPlayerCount /* 0F2978 7F0BDE48 00008025 */ move $s0, $zero /* 0F297C 7F0BDE4C 18400016 */ blez $v0, .L7F0BDEA8 /* 0F2980 7F0BDE50 00000000 */ nop @@ -626,7 +626,7 @@ glabel stage_load /* 0F29B8 7F0BDE88 00000000 */ nop /* 0F29BC 7F0BDE8C 0FC01CBE */ jal disable_onscreen_cheat_text /* 0F29C0 7F0BDE90 00000000 */ nop -/* 0F29C4 7F0BDE94 0FC26919 */ jal get_num_players +/* 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 @@ -637,7 +637,7 @@ glabel stage_load .L7F0BDEB0: /* 0F29E0 7F0BDEB0 0FC0154D */ jal set_contents_of_80036078 /* 0F29E4 7F0BDEB4 00002025 */ move $a0, $zero -/* 0F29E8 7F0BDEB8 0FC348E0 */ jal remove_viewport_buffer +/* 0F29E8 7F0BDEB8 0FC348E0 */ jal zbufDeallocate /* 0F29EC 7F0BDEBC 00000000 */ nop /* 0F29F0 7F0BDEC0 0C000EEC */ jal setVideoWidthHeightToMode /* 0F29F4 7F0BDEC4 24040001 */ li $a0, 1 @@ -795,7 +795,7 @@ glabel stage_load /* 0F33BC 7F0BE84C 0240A025 */ move $s4, $s2 /* 0F33C0 7F0BE850 24130004 */ li $s3, 4 .Ljp7F0BE854: -/* 0F33C4 7F0BE854 0FC26C01 */ jal get_num_players +/* 0F33C4 7F0BE854 0FC26C01 */ jal getPlayerCount /* 0F33C8 7F0BE858 00000000 */ nop /* 0F33CC 7F0BE85C 24010001 */ li $at, 1 /* 0F33D0 7F0BE860 14410009 */ bne $v0, $at, .Ljp7F0BE888 @@ -910,7 +910,7 @@ glabel stage_load /* 0F3568 7F0BE9F8 00000000 */ nop /* 0F356C 7F0BE9FC 0FC01418 */ jal something_with_ejected_cartridges /* 0F3570 7F0BEA00 00000000 */ nop -/* 0F3574 7F0BEA04 0FC26C01 */ jal get_num_players +/* 0F3574 7F0BEA04 0FC26C01 */ jal getPlayerCount /* 0F3578 7F0BEA08 00008025 */ move $s0, $zero /* 0F357C 7F0BEA0C 18400016 */ blez $v0, .Ljp7F0BEA68 /* 0F3580 7F0BEA10 00000000 */ nop @@ -931,7 +931,7 @@ glabel stage_load /* 0F35B8 7F0BEA48 00000000 */ nop /* 0F35BC 7F0BEA4C 0FC01CC6 */ jal disable_onscreen_cheat_text /* 0F35C0 7F0BEA50 00000000 */ nop -/* 0F35C4 7F0BEA54 0FC26C01 */ jal get_num_players +/* 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 @@ -942,7 +942,7 @@ glabel stage_load .Ljp7F0BEA70: /* 0F35E0 7F0BEA70 0FC01555 */ jal set_contents_of_80036078 /* 0F35E4 7F0BEA74 00002025 */ move $a0, $zero -/* 0F35E8 7F0BEA78 0FC34C18 */ jal remove_viewport_buffer +/* 0F35E8 7F0BEA78 0FC34C18 */ jal zbufDeallocate /* 0F35EC 7F0BEA7C 00000000 */ nop /* 0F35F0 7F0BEA80 0C000EEC */ jal setVideoWidthHeightToMode /* 0F35F4 7F0BEA84 24040001 */ li $a0, 1 @@ -1348,7 +1348,7 @@ glabel sub_GAME_7F0BE30C /* 0F2F68 7F0BE438 10000102 */ b .L7F0BE844 /* 0F2F6C 7F0BE43C AFA20060 */ sw $v0, 0x60($sp) .L7F0BE440: -/* 0F2F70 7F0BE440 0FC26919 */ jal get_num_players +/* 0F2F70 7F0BE440 0FC26919 */ jal getPlayerCount /* 0F2F74 7F0BE444 00000000 */ nop /* 0F2F78 7F0BE448 8FAA0060 */ lw $t2, 0x60($sp) /* 0F2F7C 7F0BE44C AFA20044 */ sw $v0, 0x44($sp) @@ -1402,7 +1402,7 @@ glabel sub_GAME_7F0BE30C /* 0F3038 7F0BE508 0C001151 */ jal setvideo_far /* 0F303C 7F0BE50C C5CC11D0 */ lwc1 $f12, 0x11d0($t6) /* 0F3040 7F0BE510 8E0F0000 */ lw $t7, ($s0) -/* 0F3044 7F0BE514 0C001164 */ jal video_related_21 +/* 0F3044 7F0BE514 0C001164 */ jal set_page_aspect /* 0F3048 7F0BE518 C5EC11D4 */ lwc1 $f12, 0x11d4($t7) /* 0F304C 7F0BE51C 0C000FAD */ jal video_related_10 /* 0F3050 7F0BE520 8FA40060 */ lw $a0, 0x60($sp) @@ -1741,7 +1741,7 @@ glabel sub_GAME_7F0BE30C /* 0F3B68 7F0BEFF8 1000010B */ b .Ljp7F0BF428 /* 0F3B6C 7F0BEFFC AFA20060 */ sw $v0, 0x60($sp) .Ljp7F0BF000: -/* 0F3B70 7F0BF000 0FC26C01 */ jal get_num_players +/* 0F3B70 7F0BF000 0FC26C01 */ jal getPlayerCount /* 0F3B74 7F0BF004 00000000 */ nop /* 0F3B78 7F0BF008 8FAA0060 */ lw $t2, 0x60($sp) /* 0F3B7C 7F0BF00C AFA20044 */ sw $v0, 0x44($sp) @@ -1795,7 +1795,7 @@ glabel sub_GAME_7F0BE30C /* 0F3C38 7F0BF0C8 0C001151 */ jal setvideo_far /* 0F3C3C 7F0BF0CC C5CC11D0 */ lwc1 $f12, 0x11d0($t6) /* 0F3C40 7F0BF0D0 8E0F0000 */ lw $t7, ($s0) -/* 0F3C44 7F0BF0D4 0C001164 */ jal video_related_21 +/* 0F3C44 7F0BF0D4 0C001164 */ jal set_page_aspect /* 0F3C48 7F0BF0D8 C5EC11D4 */ lwc1 $f12, 0x11d4($t7) /* 0F3C4C 7F0BF0DC 0C000FAD */ jal video_related_10 /* 0F3C50 7F0BF0E0 8FA40060 */ lw $a0, 0x60($sp) @@ -2581,7 +2581,7 @@ glabel manage_mp_game /* 0F37CC 7F0BEC9C 1481FFEF */ bne $a0, $at, .L7F0BEC5C /* 0F37D0 7F0BECA0 24630001 */ addiu $v1, $v1, 1 .L7F0BECA4: -/* 0F37D4 7F0BECA4 0FC26919 */ jal get_num_players +/* 0F37D4 7F0BECA4 0FC26919 */ jal getPlayerCount /* 0F37D8 7F0BECA8 00000000 */ nop /* 0F37DC 7F0BECAC 28410002 */ slti $at, $v0, 2 /* 0F37E0 7F0BECB0 1420014B */ bnez $at, .L7F0BF1E0 @@ -2597,14 +2597,14 @@ glabel manage_mp_game /* 0F3808 7F0BECD8 00000000 */ nop /* 0F380C 7F0BECDC AFA00190 */ sw $zero, 0x190($sp) /* 0F3810 7F0BECE0 AFA0018C */ sw $zero, 0x18c($sp) -/* 0F3814 7F0BECE4 0FC26919 */ jal get_num_players +/* 0F3814 7F0BECE4 0FC26919 */ jal getPlayerCount /* 0F3818 7F0BECE8 AFA00188 */ sw $zero, 0x188($sp) /* 0F381C 7F0BECEC 8FA30190 */ lw $v1, 0x190($sp) /* 0F3820 7F0BECF0 8FA5018C */ lw $a1, 0x18c($sp) /* 0F3824 7F0BECF4 1840001B */ blez $v0, .L7F0BED64 /* 0F3828 7F0BECF8 8FA60188 */ lw $a2, 0x188($sp) -/* 0F382C 7F0BECFC 3C0E8008 */ lui $t6, %hi(ptr_BONDdata_p1) -/* 0F3830 7F0BED00 25CE9EE0 */ addiu $t6, %lo(ptr_BONDdata_p1) # addiu $t6, $t6, -0x6120 +/* 0F382C 7F0BECFC 3C0E8008 */ lui $t6, %hi(players) +/* 0F3830 7F0BED00 25CE9EE0 */ addiu $t6, %lo(players) # addiu $t6, $t6, -0x6120 /* 0F3834 7F0BED04 0003C880 */ sll $t9, $v1, 2 /* 0F3838 7F0BED08 032E2021 */ addu $a0, $t9, $t6 .L7F0BED0C: @@ -2623,7 +2623,7 @@ glabel manage_mp_game .L7F0BED3C: /* 0F386C 7F0BED3C AFA4001C */ sw $a0, 0x1c($sp) /* 0F3870 7F0BED40 AFA5018C */ sw $a1, 0x18c($sp) -/* 0F3874 7F0BED44 0FC26919 */ jal get_num_players +/* 0F3874 7F0BED44 0FC26919 */ jal getPlayerCount /* 0F3878 7F0BED48 AFA60188 */ sw $a2, 0x188($sp) /* 0F387C 7F0BED4C 8FA30190 */ lw $v1, 0x190($sp) /* 0F3880 7F0BED50 8FA4001C */ lw $a0, 0x1c($sp) @@ -2656,7 +2656,7 @@ glabel manage_mp_game /* 0F38E4 7F0BEDB4 01C4082A */ slt $at, $t6, $a0 /* 0F38E8 7F0BEDB8 14200012 */ bnez $at, .L7F0BEE04 /* 0F38EC 7F0BEDBC 00000000 */ nop -/* 0F38F0 7F0BEDC0 0FC26919 */ jal get_num_players +/* 0F38F0 7F0BEDC0 0FC26919 */ jal getPlayerCount /* 0F38F4 7F0BEDC4 AFA0017C */ sw $zero, 0x17c($sp) /* 0F38F8 7F0BEDC8 1840000E */ blez $v0, .L7F0BEE04 /* 0F38FC 7F0BEDCC 00000000 */ nop @@ -2668,7 +2668,7 @@ glabel manage_mp_game /* 0F3910 7F0BEDE0 2484B704 */ addiu $a0, %lo(aOneMinuteLeft) # addiu $a0, $a0, -0x48fc /* 0F3914 7F0BEDE4 8FAF017C */ lw $t7, 0x17c($sp) /* 0F3918 7F0BEDE8 25F80001 */ addiu $t8, $t7, 1 -/* 0F391C 7F0BEDEC 0FC26919 */ jal get_num_players +/* 0F391C 7F0BEDEC 0FC26919 */ jal getPlayerCount /* 0F3920 7F0BEDF0 AFB8017C */ sw $t8, 0x17c($sp) /* 0F3924 7F0BEDF4 8FB9017C */ lw $t9, 0x17c($sp) /* 0F3928 7F0BEDF8 0322082A */ slt $at, $t9, $v0 @@ -2730,16 +2730,16 @@ glabel manage_mp_game /* 0F39F8 7F0BEEC8 8F398374 */ lw $t9, %lo(clock_timer)($t9) /* 0F39FC 7F0BEECC 1320003A */ beqz $t9, .L7F0BEFB8 /* 0F3A00 7F0BEED0 00000000 */ nop -/* 0F3A04 7F0BEED4 0FC26919 */ jal get_num_players +/* 0F3A04 7F0BEED4 0FC26919 */ jal getPlayerCount /* 0F3A08 7F0BEED8 00000000 */ nop /* 0F3A0C 7F0BEEDC 00403825 */ move $a3, $v0 /* 0F3A10 7F0BEEE0 00002825 */ move $a1, $zero /* 0F3A14 7F0BEEE4 00003025 */ move $a2, $zero /* 0F3A18 7F0BEEE8 18400029 */ blez $v0, .L7F0BEF90 /* 0F3A1C 7F0BEEEC 00002025 */ move $a0, $zero -/* 0F3A20 7F0BEEF0 3C038008 */ lui $v1, %hi(ptr_BONDdata_p1) +/* 0F3A20 7F0BEEF0 3C038008 */ lui $v1, %hi(players) /* 0F3A24 7F0BEEF4 44800000 */ mtc1 $zero, $f0 -/* 0F3A28 7F0BEEF8 24639EE0 */ addiu $v1, %lo(ptr_BONDdata_p1) # addiu $v1, $v1, -0x6120 +/* 0F3A28 7F0BEEF8 24639EE0 */ addiu $v1, %lo(players) # addiu $v1, $v1, -0x6120 .L7F0BEEFC: /* 0F3A2C 7F0BEEFC 8C620000 */ lw $v0, ($v1) /* 0F3A30 7F0BEF00 8C4F00D8 */ lw $t7, 0xd8($v0) @@ -2802,7 +2802,7 @@ glabel manage_mp_game /* 0F3AFC 7F0BEFCC 8DEF8374 */ lw $t7, %lo(clock_timer)($t7) /* 0F3B00 7F0BEFD0 11E00083 */ beqz $t7, .L7F0BF1E0 /* 0F3B04 7F0BEFD4 00000000 */ nop -/* 0F3B08 7F0BEFD8 0FC26919 */ jal get_num_players +/* 0F3B08 7F0BEFD8 0FC26919 */ jal getPlayerCount /* 0F3B0C 7F0BEFDC 00000000 */ nop /* 0F3B10 7F0BEFE0 44800000 */ mtc1 $zero, $f0 /* 0F3B14 7F0BEFE4 00405025 */ move $t2, $v0 @@ -2818,8 +2818,8 @@ glabel manage_mp_game /* 0F3B38 7F0BF008 30490003 */ andi $t1, $v0, 3 /* 0F3B3C 7F0BF00C 11200019 */ beqz $t1, .L7F0BF074 /* 0F3B40 7F0BF010 000C5880 */ sll $t3, $t4, 2 -/* 0F3B44 7F0BF014 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) -/* 0F3B48 7F0BF018 27189EE0 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x6120 +/* 0F3B44 7F0BF014 3C188008 */ lui $t8, %hi(players) +/* 0F3B48 7F0BF018 27189EE0 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x6120 /* 0F3B4C 7F0BF01C 00007080 */ sll $t6, $zero, 2 /* 0F3B50 7F0BF020 0000C8C0 */ sll $t9, $zero, 3 /* 0F3B54 7F0BF024 0320C823 */ subu $t9, $t9, $zero @@ -2845,10 +2845,10 @@ glabel manage_mp_game /* 0F3B9C 7F0BF06C 00AF2821 */ addu $a1, $a1, $t7 /* 0F3BA0 7F0BF070 10E2002C */ beq $a3, $v0, .L7F0BF124 .L7F0BF074: -/* 0F3BA4 7F0BF074 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) +/* 0F3BA4 7F0BF074 3C188008 */ lui $t8, %hi(players) /* 0F3BA8 7F0BF078 0007C8C0 */ sll $t9, $a3, 3 /* 0F3BAC 7F0BF07C 0327C823 */ subu $t9, $t9, $a3 -/* 0F3BB0 7F0BF080 27189EE0 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x6120 +/* 0F3BB0 7F0BF080 27189EE0 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x6120 /* 0F3BB4 7F0BF084 00077080 */ sll $t6, $a3, 2 /* 0F3BB8 7F0BF088 01D81821 */ addu $v1, $t6, $t8 /* 0F3BBC 7F0BF08C 0019C900 */ sll $t9, $t9, 4 @@ -2904,8 +2904,8 @@ glabel manage_mp_game /* 0F3C6C 7F0BF13C 000F7900 */ sll $t7, $t7, 4 /* 0F3C70 7F0BF140 01EE1821 */ addu $v1, $t7, $t6 /* 0F3C74 7F0BF144 906F0068 */ lbu $t7, 0x68($v1) -/* 0F3C78 7F0BF148 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) -/* 0F3C7C 7F0BF14C 27189EE0 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x6120 +/* 0F3C78 7F0BF148 3C188008 */ lui $t8, %hi(players) +/* 0F3C7C 7F0BF14C 27189EE0 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x6120 /* 0F3C80 7F0BF150 000CC880 */ sll $t9, $t4, 2 /* 0F3C84 7F0BF154 15E00003 */ bnez $t7, .L7F0BF164 /* 0F3C88 7F0BF158 03382021 */ addu $a0, $t9, $t8 @@ -3458,7 +3458,7 @@ glabel manage_mp_game /* 0F4440 7F0BF8D0 1481FFEF */ bne $a0, $at, .Ljp7F0BF890 /* 0F4444 7F0BF8D4 24630001 */ addiu $v1, $v1, 1 .Ljp7F0BF8D8: -/* 0F4448 7F0BF8D8 0FC26C01 */ jal get_num_players +/* 0F4448 7F0BF8D8 0FC26C01 */ jal getPlayerCount /* 0F444C 7F0BF8DC 00000000 */ nop /* 0F4450 7F0BF8E0 28410002 */ slti $at, $v0, 2 /* 0F4454 7F0BF8E4 1420014C */ bnez $at, .Ljp7F0BFE18 @@ -3474,14 +3474,14 @@ glabel manage_mp_game /* 0F447C 7F0BF90C 00000000 */ nop /* 0F4480 7F0BF910 AFA00190 */ sw $zero, 0x190($sp) /* 0F4484 7F0BF914 AFA0018C */ sw $zero, 0x18c($sp) -/* 0F4488 7F0BF918 0FC26C01 */ jal get_num_players +/* 0F4488 7F0BF918 0FC26C01 */ jal getPlayerCount /* 0F448C 7F0BF91C AFA00188 */ sw $zero, 0x188($sp) /* 0F4490 7F0BF920 8FA30190 */ lw $v1, 0x190($sp) /* 0F4494 7F0BF924 8FA5018C */ lw $a1, 0x18c($sp) /* 0F4498 7F0BF928 1840001B */ blez $v0, .Ljp7F0BF998 /* 0F449C 7F0BF92C 8FA60188 */ lw $a2, 0x188($sp) -/* 0F44A0 7F0BF930 3C0E8008 */ lui $t6, %hi(ptr_BONDdata_p1) # $t6, 0x8008 -/* 0F44A4 7F0BF934 25CE9F50 */ addiu $t6, %lo(ptr_BONDdata_p1) # addiu $t6, $t6, -0x60b0 +/* 0F44A0 7F0BF930 3C0E8008 */ lui $t6, %hi(players) # $t6, 0x8008 +/* 0F44A4 7F0BF934 25CE9F50 */ addiu $t6, %lo(players) # addiu $t6, $t6, -0x60b0 /* 0F44A8 7F0BF938 0003C880 */ sll $t9, $v1, 2 /* 0F44AC 7F0BF93C 032E2021 */ addu $a0, $t9, $t6 .Ljp7F0BF940: @@ -3500,7 +3500,7 @@ glabel manage_mp_game .Ljp7F0BF970: /* 0F44E0 7F0BF970 AFA4001C */ sw $a0, 0x1c($sp) /* 0F44E4 7F0BF974 AFA5018C */ sw $a1, 0x18c($sp) -/* 0F44E8 7F0BF978 0FC26C01 */ jal get_num_players +/* 0F44E8 7F0BF978 0FC26C01 */ jal getPlayerCount /* 0F44EC 7F0BF97C AFA60188 */ sw $a2, 0x188($sp) /* 0F44F0 7F0BF980 8FA30190 */ lw $v1, 0x190($sp) /* 0F44F4 7F0BF984 8FA4001C */ lw $a0, 0x1c($sp) @@ -3533,7 +3533,7 @@ glabel manage_mp_game /* 0F4558 7F0BF9E8 01C4082A */ slt $at, $t6, $a0 /* 0F455C 7F0BF9EC 14200013 */ bnez $at, .Ljp7F0BFA3C /* 0F4560 7F0BF9F0 00000000 */ nop -/* 0F4564 7F0BF9F4 0FC26C01 */ jal get_num_players +/* 0F4564 7F0BF9F4 0FC26C01 */ jal getPlayerCount /* 0F4568 7F0BF9F8 AFA0017C */ sw $zero, 0x17c($sp) /* 0F456C 7F0BF9FC 1840000F */ blez $v0, .Ljp7F0BFA3C /* 0F4570 7F0BFA00 00000000 */ nop @@ -3546,7 +3546,7 @@ glabel manage_mp_game /* 0F4588 7F0BFA18 00402025 */ move $a0, $v0 /* 0F458C 7F0BFA1C 8FAF017C */ lw $t7, 0x17c($sp) /* 0F4590 7F0BFA20 25F80001 */ addiu $t8, $t7, 1 -/* 0F4594 7F0BFA24 0FC26C01 */ jal get_num_players +/* 0F4594 7F0BFA24 0FC26C01 */ jal getPlayerCount /* 0F4598 7F0BFA28 AFB8017C */ sw $t8, 0x17c($sp) /* 0F459C 7F0BFA2C 8FB9017C */ lw $t9, 0x17c($sp) /* 0F45A0 7F0BFA30 0322082A */ slt $at, $t9, $v0 @@ -3608,16 +3608,16 @@ glabel manage_mp_game /* 0F4670 7F0BFB00 8F3983A4 */ lw $t9, %lo(clock_timer)($t9) /* 0F4674 7F0BFB04 1320003A */ beqz $t9, .Ljp7F0BFBF0 /* 0F4678 7F0BFB08 00000000 */ nop -/* 0F467C 7F0BFB0C 0FC26C01 */ jal get_num_players +/* 0F467C 7F0BFB0C 0FC26C01 */ jal getPlayerCount /* 0F4680 7F0BFB10 00000000 */ nop /* 0F4684 7F0BFB14 00403825 */ move $a3, $v0 /* 0F4688 7F0BFB18 00002825 */ move $a1, $zero /* 0F468C 7F0BFB1C 00003025 */ move $a2, $zero /* 0F4690 7F0BFB20 18400029 */ blez $v0, .Ljp7F0BFBC8 /* 0F4694 7F0BFB24 00002025 */ move $a0, $zero -/* 0F4698 7F0BFB28 3C038008 */ lui $v1, %hi(ptr_BONDdata_p1) # $v1, 0x8008 +/* 0F4698 7F0BFB28 3C038008 */ lui $v1, %hi(players) # $v1, 0x8008 /* 0F469C 7F0BFB2C 44800000 */ mtc1 $zero, $f0 -/* 0F46A0 7F0BFB30 24639F50 */ addiu $v1, %lo(ptr_BONDdata_p1) # addiu $v1, $v1, -0x60b0 +/* 0F46A0 7F0BFB30 24639F50 */ addiu $v1, %lo(players) # addiu $v1, $v1, -0x60b0 .Ljp7F0BFB34: /* 0F46A4 7F0BFB34 8C620000 */ lw $v0, ($v1) /* 0F46A8 7F0BFB38 8C4F00D8 */ lw $t7, 0xd8($v0) @@ -3680,7 +3680,7 @@ glabel manage_mp_game /* 0F4774 7F0BFC04 8DEF83A4 */ lw $t7, %lo(clock_timer)($t7) /* 0F4778 7F0BFC08 11E00083 */ beqz $t7, .Ljp7F0BFE18 /* 0F477C 7F0BFC0C 00000000 */ nop -/* 0F4780 7F0BFC10 0FC26C01 */ jal get_num_players +/* 0F4780 7F0BFC10 0FC26C01 */ jal getPlayerCount /* 0F4784 7F0BFC14 00000000 */ nop /* 0F4788 7F0BFC18 44800000 */ mtc1 $zero, $f0 /* 0F478C 7F0BFC1C 00405025 */ move $t2, $v0 @@ -3696,8 +3696,8 @@ glabel manage_mp_game /* 0F47B0 7F0BFC40 30490003 */ andi $t1, $v0, 3 /* 0F47B4 7F0BFC44 11200019 */ beqz $t1, .Ljp7F0BFCAC /* 0F47B8 7F0BFC48 000C5880 */ sll $t3, $t4, 2 -/* 0F47BC 7F0BFC4C 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) # $t8, 0x8008 -/* 0F47C0 7F0BFC50 27189F50 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x60b0 +/* 0F47BC 7F0BFC4C 3C188008 */ lui $t8, %hi(players) # $t8, 0x8008 +/* 0F47C0 7F0BFC50 27189F50 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x60b0 /* 0F47C4 7F0BFC54 00007080 */ sll $t6, $zero, 2 /* 0F47C8 7F0BFC58 0000C8C0 */ sll $t9, $zero, 3 /* 0F47CC 7F0BFC5C 0320C823 */ subu $t9, $t9, $zero @@ -3723,10 +3723,10 @@ glabel manage_mp_game /* 0F4814 7F0BFCA4 00AF2821 */ addu $a1, $a1, $t7 /* 0F4818 7F0BFCA8 10E2002C */ beq $a3, $v0, .Ljp7F0BFD5C .Ljp7F0BFCAC: -/* 0F481C 7F0BFCAC 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) # $t8, 0x8008 +/* 0F481C 7F0BFCAC 3C188008 */ lui $t8, %hi(players) # $t8, 0x8008 /* 0F4820 7F0BFCB0 0007C8C0 */ sll $t9, $a3, 3 /* 0F4824 7F0BFCB4 0327C823 */ subu $t9, $t9, $a3 -/* 0F4828 7F0BFCB8 27189F50 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x60b0 +/* 0F4828 7F0BFCB8 27189F50 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x60b0 /* 0F482C 7F0BFCBC 00077080 */ sll $t6, $a3, 2 /* 0F4830 7F0BFCC0 01D81821 */ addu $v1, $t6, $t8 /* 0F4834 7F0BFCC4 0019C900 */ sll $t9, $t9, 4 @@ -3782,8 +3782,8 @@ glabel manage_mp_game /* 0F48E4 7F0BFD74 000F7900 */ sll $t7, $t7, 4 /* 0F48E8 7F0BFD78 01EE1821 */ addu $v1, $t7, $t6 /* 0F48EC 7F0BFD7C 906F0068 */ lbu $t7, 0x68($v1) -/* 0F48F0 7F0BFD80 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) # $t8, 0x8008 -/* 0F48F4 7F0BFD84 27189F50 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x60b0 +/* 0F48F0 7F0BFD80 3C188008 */ lui $t8, %hi(players) # $t8, 0x8008 +/* 0F48F4 7F0BFD84 27189F50 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x60b0 /* 0F48F8 7F0BFD88 000CC880 */ sll $t9, $t4, 2 /* 0F48FC 7F0BFD8C 15E00003 */ bnez $t7, .Ljp7F0BFD9C /* 0F4900 7F0BFD90 03382021 */ addu $a0, $t9, $t8 diff --git a/src/game/mainmenu.c b/src/game/mainmenu.c index 354f79b1..90346e8a 100644 --- a/src/game/mainmenu.c +++ b/src/game/mainmenu.c @@ -9,6 +9,7 @@ #include "game/bond.h" #include "game/chrobjdata.h" #include "joy.h" +#include "video.h" struct point { f32 x; f32 y; @@ -327,29 +328,14 @@ u8 cheat_activated_78; s32 array_favweapon[4][2]; //CODE.bss:80069710 -s32 mp_char_cur_select_player1; -//CODE.bss:80069714 -s32 mp_char_cur_select_player2; -//CODE.bss:80069718 -s32 mp_char_cur_select_player3; -//CODE.bss:8006971C -s32 mp_char_cur_select_player4; +s32 mp_char_cur_select_player[4]; + //CODE.bss:80069720 -s32 mp_char_prev_select_player1; -//CODE.bss:80069724 -s32 mp_char_prev_select_player2; -//CODE.bss:80069728 -s32 mp_char_prev_select_player3; -//CODE.bss:8006972C -s32 mp_char_prev_select_player4; +s32 mp_char_prev_select_player[4]; + //CODE.bss:80069730 -s32 dword_CODE_bss_80069730; -//CODE.bss:80069734 -s32 dword_CODE_bss_80069734; -//CODE.bss:80069738 -s32 dword_CODE_bss_80069738; -//CODE.bss:8006973C -s32 dword_CODE_bss_8006973C; +s32 dword_CODE_bss_80069730[4]; + //CODE.bss:80069740 s32 has_selected_char_player1; //CODE.bss:80069744 @@ -439,9 +425,9 @@ s32 highlight_aimadjustment; char dword_CODE_bss_800697F0[0x130]; -s32 current_menu = -1; -s32 menu_update = -1; -s32 maybe_prev_menu = -1; +MENU current_menu = MENU_INVALID; +MENU menu_update = MENU_INVALID; +MENU maybe_prev_menu = MENU_INVALID; s32 menu_timer = 0; s32 tab_1_selected = FALSE; @@ -454,7 +440,7 @@ s32 tab_3_highlight = FALSE; s32 selected_folder_num = 0; s32 selected_folder_num_copy = 0; -s32 gamemode = GAMEMODE_INTRO; +GAMEMODE gamemode = GAMEMODE_INTRO; s32 selected_stage = -1; s32 briefingpage = -1; DIFFICULTY selected_difficulty = DIFFICULTY_MULTI; @@ -3022,31 +3008,35 @@ void update_menu00_legalscreen(void) #ifdef NONMATCHING -void interface_menu00_legalscreen(void) { - s32 temp; - setvideo_far(60.0f); - video_related_21(1.3333334f); - set_page_height(100.0f, 10000.0f); - set_video2_settings_offset_24(0); - temp = menu_timer + clock_timer; - menu_timer = temp; - if (temp >= 0xF1) { - if (get_attached_controller_count() > 0) { - while (is_first_time_on_legal_screen == 0) { - set_menu_to_mode(MENU_NINTENDO_LOGO,1); - return; - } - set_menu_to_mode(MENU_NO_CONTROLLERS,1); - return; - } - if (get_controller_buttons_pressed(0, 0xFFFF)) { - if ((is_first_time_on_legal_screen == 0) && (is_first_time_on_main_menu == 0)) { - set_menu_to_mode(MENU_FILE_SELECT,1); - return; - } - set_menu_to_mode(MENU_NINTENDO_LOGO,1); - } - } +void interface_menu00_legalscreen(void) +{ + setvideo_far(60.0f); + set_page_aspect(1.333333f); + set_page_height(100.0f, 10000.0f); + set_video2_settings_offset_24(0); + + menu_timer += clock_timer; + if (menu_timer >= 0xF1) + { + if ((get_attached_controller_count() > 0) && (is_first_time_on_legal_screen == 0)) + { + set_menu_to_mode(MENU_NINTENDO_LOGO,1); + return; + } else + { + set_menu_to_mode(MENU_NO_CONTROLLERS,1); + return; + } + } + if (get_controller_buttons_pressed(0, 0xFFFF)) + { + if ((is_first_time_on_legal_screen == 0) && (is_first_time_on_main_menu == 0)) + { + set_menu_to_mode(MENU_FILE_SELECT,1); + return; + } + set_menu_to_mode(MENU_NINTENDO_LOGO,1); + } } #else GLOBAL_ASM( @@ -3064,7 +3054,7 @@ glabel interface_menu00_legalscreen /* 03F21C 7F00A6EC 0C001151 */ jal setvideo_far /* 03F220 7F00A6F0 00000000 */ nop /* 03F224 7F00A6F4 3C018005 */ lui $at, %hi(D_800519E4) -/* 03F228 7F00A6F8 0C001164 */ jal video_related_21 +/* 03F228 7F00A6F8 0C001164 */ jal set_page_aspect /* 03F22C 7F00A6FC C42C19E4 */ lwc1 $f12, %lo(D_800519E4)($at) /* 03F230 7F00A700 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 03F234 7F00A704 44816000 */ mtc1 $at, $f12 @@ -3280,7 +3270,7 @@ loop_1: } temp_t0->unk0 = (s32) temp_t6->unk0; insert_imageDL(arg0); - sub_GAME_7F059694(&spA0, 0.0f, 0.0f, 0x457a0000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + matrix_4x4_7F059694(&spA0, 0.0f, 0.0f, 0x457a0000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); temp_ret = sub_GAME_7F0BD714(something_legalscreen_constructor->unk8->unkE << 6); spF4 = temp_ret; matrix_4x4_copy(&spA0, temp_ret); @@ -3360,7 +3350,7 @@ glabel constructor_menu00_legalscreen /* 03F4A4 7F00A974 E7A00018 */ swc1 $f0, 0x18($sp) /* 03F4A8 7F00A978 E7A0001C */ swc1 $f0, 0x1c($sp) /* 03F4AC 7F00A97C E7A00024 */ swc1 $f0, 0x24($sp) -/* 03F4B0 7F00A980 0FC165A5 */ jal sub_GAME_7F059694 +/* 03F4B0 7F00A980 0FC165A5 */ jal matrix_4x4_7F059694 /* 03F4B4 7F00A984 E7A40020 */ swc1 $f4, 0x20($sp) /* 03F4B8 7F00A988 3C138003 */ lui $s3, %hi(something_legalscreen_constructor) /* 03F4BC 7F00A98C 2673A958 */ addiu $s3, %lo(something_legalscreen_constructor) # addiu $s3, $s3, -0x56a8 @@ -3471,87 +3461,20 @@ void dummy7F00AAF8(void) { -#ifdef NONMATCHING -void *interface_menu17_switchscreens(void) +void interface_menu17_switchscreens(void) { - s32 temp_t7; - - setvideo_far(0x42700000); - video_related_21(D_800519EC); - set_page_height(0x42c80000, D_800519F0); + setvideo_far(60.0f); + set_page_aspect(1.3333334f); + set_page_height(100.0f, 10000.0f); set_video2_settings_offset_24(0); - temp_t7 = menu_timer + 1; - menu_timer = temp_t7; - if (temp_t7 >= 4) + + menu_timer++; + if ((menu_timer >= 4) && (spectrum_related_flag == 0) && (is_emulating_spectrum == 0)) { - if (spectrum_related_flag == 0) - { - if (is_emulating_spectrum == 0) - { - maybe_prev_menu = (s32) menu_update; - menu_update = -1; - } - } + maybe_prev_menu = menu_update; + menu_update = -1; } - return &menu_timer; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800519EC -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_800519F0 -.word 0x461C4000 /* 10000.0;*/ -.text -glabel interface_menu17_switchscreens -/* 03F630 7F00AB00 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 03F634 7F00AB04 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 03F638 7F00AB08 AFBF0014 */ sw $ra, 0x14($sp) -/* 03F63C 7F00AB0C 44816000 */ mtc1 $at, $f12 -/* 03F640 7F00AB10 0C001151 */ jal setvideo_far -/* 03F644 7F00AB14 00000000 */ nop -/* 03F648 7F00AB18 3C018005 */ lui $at, %hi(D_800519EC) -/* 03F64C 7F00AB1C 0C001164 */ jal video_related_21 -/* 03F650 7F00AB20 C42C19EC */ lwc1 $f12, %lo(D_800519EC)($at) -/* 03F654 7F00AB24 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 03F658 7F00AB28 44816000 */ mtc1 $at, $f12 -/* 03F65C 7F00AB2C 3C018005 */ lui $at, %hi(D_800519F0) -/* 03F660 7F00AB30 0C001194 */ jal set_page_height -/* 03F664 7F00AB34 C42E19F0 */ lwc1 $f14, %lo(D_800519F0)($at) -/* 03F668 7F00AB38 0C00114D */ jal set_video2_settings_offset_24 -/* 03F66C 7F00AB3C 00002025 */ move $a0, $zero -/* 03F670 7F00AB40 3C028003 */ lui $v0, %hi(menu_timer) -/* 03F674 7F00AB44 2442A8CC */ addiu $v0, %lo(menu_timer) # addiu $v0, $v0, -0x5734 -/* 03F678 7F00AB48 8C4E0000 */ lw $t6, ($v0) -/* 03F67C 7F00AB4C 3C198003 */ lui $t9, %hi(spectrum_related_flag) -/* 03F680 7F00AB50 25CF0001 */ addiu $t7, $t6, 1 -/* 03F684 7F00AB54 29E10004 */ slti $at, $t7, 4 -/* 03F688 7F00AB58 1420000F */ bnez $at, .L7F00AB98 -/* 03F68C 7F00AB5C AC4F0000 */ sw $t7, ($v0) -/* 03F690 7F00AB60 8F39A944 */ lw $t9, %lo(spectrum_related_flag)($t9) -/* 03F694 7F00AB64 3C088003 */ lui $t0, %hi(is_emulating_spectrum) -/* 03F698 7F00AB68 5720000C */ bnezl $t9, .L7F00AB9C -/* 03F69C 7F00AB6C 8FBF0014 */ lw $ra, 0x14($sp) -/* 03F6A0 7F00AB70 8D08A948 */ lw $t0, %lo(is_emulating_spectrum)($t0) -/* 03F6A4 7F00AB74 3C028003 */ lui $v0, %hi(menu_update) -/* 03F6A8 7F00AB78 2442A8C4 */ addiu $v0, %lo(menu_update) # addiu $v0, $v0, -0x573c -/* 03F6AC 7F00AB7C 55000007 */ bnezl $t0, .L7F00AB9C -/* 03F6B0 7F00AB80 8FBF0014 */ lw $ra, 0x14($sp) -/* 03F6B4 7F00AB84 8C490000 */ lw $t1, ($v0) -/* 03F6B8 7F00AB88 3C018003 */ lui $at, %hi(maybe_prev_menu) -/* 03F6BC 7F00AB8C 240AFFFF */ li $t2, -1 -/* 03F6C0 7F00AB90 AC29A8C8 */ sw $t1, %lo(maybe_prev_menu)($at) -/* 03F6C4 7F00AB94 AC4A0000 */ sw $t2, ($v0) -.L7F00AB98: -/* 03F6C8 7F00AB98 8FBF0014 */ lw $ra, 0x14($sp) -.L7F00AB9C: -/* 03F6CC 7F00AB9C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 03F6D0 7F00ABA0 03E00008 */ jr $ra -/* 03F6D4 7F00ABA4 00000000 */ nop -) -#endif - - void constructor_menu17_switchscreens(Gfx * DL) @@ -3568,7 +3491,7 @@ void constructor_menu17_switchscreens(Gfx * DL) #ifdef NONMATCHING void init_menu01_nintendo(void) { - struct xyzpoint local_c; + struct coord local_c; menu_timer = 0; local_c.x = xyzpoint_8002aafc.x; @@ -3663,107 +3586,30 @@ void update_menu01_nintendo(void) -#ifdef NONMATCHING -extern f32 menu01_aspect; -extern f32 menu01_pageheight; - void interface_menu01_nintendo(void) { setvideo_far(60.0f); - video_related_21(menu01_aspect); - set_page_height(100.0f, menu01_pageheight); - set_video2_settings_offset_24(0.0f); + set_page_aspect(1.3333334f); + set_page_height(100.0f, 10000.0f); + set_video2_settings_offset_24(0); menu_timer = menu_timer + clock_timer; - if (menu_timer < 501) - { - if (get_controller_buttons_pressed(0, 0xffff) != 0) - { - if (is_first_time_on_main_menu == 0) - { - set_menu_to_mode(MENU_FILE_SELECT, 1); - } - else - { - prev_keypresses = 1; - set_menu_to_mode(MENU_RAREWARE_LOGO, 1); - } - } - } - else + if (menu_timer >= 0x1F5) { set_menu_to_mode(MENU_RAREWARE_LOGO, 1); return; } + if (get_controller_buttons_pressed(0, 0xFFFF)) + { + if (is_first_time_on_main_menu == 0) + { + set_menu_to_mode(MENU_FILE_SELECT, 1); + return; + } + prev_keypresses = 1; + set_menu_to_mode(MENU_RAREWARE_LOGO, 1); + } } -#else -GLOBAL_ASM( -.late_rodata -glabel menu01_aspect -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel menu01_pageheight -.word 0x461C4000 /* 10000.0;*/ -.text -glabel interface_menu01_nintendo -/* 03F7F8 7F00ACC8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 03F7FC 7F00ACCC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 03F800 7F00ACD0 AFBF0014 */ sw $ra, 0x14($sp) -/* 03F804 7F00ACD4 44816000 */ mtc1 $at, $f12 -/* 03F808 7F00ACD8 0C001151 */ jal setvideo_far -/* 03F80C 7F00ACDC 00000000 */ nop -/* 03F810 7F00ACE0 3C018005 */ lui $at, %hi(menu01_aspect) -/* 03F814 7F00ACE4 0C001164 */ jal video_related_21 -/* 03F818 7F00ACE8 C42C19FC */ lwc1 $f12, %lo(menu01_aspect)($at) -/* 03F81C 7F00ACEC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 03F820 7F00ACF0 44816000 */ mtc1 $at, $f12 -/* 03F824 7F00ACF4 3C018005 */ lui $at, %hi(menu01_pageheight) -/* 03F828 7F00ACF8 0C001194 */ jal set_page_height -/* 03F82C 7F00ACFC C42E1A00 */ lwc1 $f14, %lo(menu01_pageheight)($at) -/* 03F830 7F00AD00 0C00114D */ jal set_video2_settings_offset_24 -/* 03F834 7F00AD04 00002025 */ move $a0, $zero -/* 03F838 7F00AD08 3C028003 */ lui $v0, %hi(menu_timer) -/* 03F83C 7F00AD0C 2442A8CC */ addiu $v0, %lo(menu_timer) # addiu $v0, $v0, -0x5734 -/* 03F840 7F00AD10 3C0F8005 */ lui $t7, %hi(clock_timer) -/* 03F844 7F00AD14 8DEF8374 */ lw $t7, %lo(clock_timer)($t7) -/* 03F848 7F00AD18 8C4E0000 */ lw $t6, ($v0) -/* 03F84C 7F00AD1C 24050001 */ li $a1, 1 -/* 03F850 7F00AD20 00002025 */ move $a0, $zero -/* 03F854 7F00AD24 01CFC021 */ addu $t8, $t6, $t7 -/* 03F858 7F00AD28 2B0101F5 */ slti $at, $t8, 0x1f5 -/* 03F85C 7F00AD2C 14200005 */ bnez $at, .L7F00AD44 -/* 03F860 7F00AD30 AC580000 */ sw $t8, ($v0) -/* 03F864 7F00AD34 0FC06975 */ jal set_menu_to_mode -/* 03F868 7F00AD38 24040002 */ li $a0, 2 -/* 03F86C 7F00AD3C 10000013 */ b .L7F00AD8C -/* 03F870 7F00AD40 8FBF0014 */ lw $ra, 0x14($sp) -.L7F00AD44: -/* 03F874 7F00AD44 0C0030EB */ jal get_controller_buttons_pressed -/* 03F878 7F00AD48 3405FFFF */ li $a1, 65535 -/* 03F87C 7F00AD4C 1040000E */ beqz $v0, .L7F00AD88 -/* 03F880 7F00AD50 3C088003 */ lui $t0, %hi(is_first_time_on_main_menu) -/* 03F884 7F00AD54 8D08A930 */ lw $t0, %lo(is_first_time_on_main_menu)($t0) -/* 03F888 7F00AD58 24090001 */ li $t1, 1 -/* 03F88C 7F00AD5C 3C018003 */ lui $at, %hi(prev_keypresses) -/* 03F890 7F00AD60 15000006 */ bnez $t0, .L7F00AD7C -/* 03F894 7F00AD64 24040002 */ li $a0, 2 -/* 03F898 7F00AD68 24040005 */ li $a0, 5 -/* 03F89C 7F00AD6C 0FC06975 */ jal set_menu_to_mode -/* 03F8A0 7F00AD70 24050001 */ li $a1, 1 -/* 03F8A4 7F00AD74 10000005 */ b .L7F00AD8C -/* 03F8A8 7F00AD78 8FBF0014 */ lw $ra, 0x14($sp) -.L7F00AD7C: -/* 03F8AC 7F00AD7C AC29A934 */ sw $t1, %lo(prev_keypresses)($at) -/* 03F8B0 7F00AD80 0FC06975 */ jal set_menu_to_mode -/* 03F8B4 7F00AD84 24050001 */ li $a1, 1 -.L7F00AD88: -/* 03F8B8 7F00AD88 8FBF0014 */ lw $ra, 0x14($sp) -.L7F00AD8C: -/* 03F8BC 7F00AD8C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 03F8C0 7F00AD90 03E00008 */ jr $ra -/* 03F8C4 7F00AD94 00000000 */ nop -) -#endif - @@ -3840,7 +3686,7 @@ loop_1: { flt_CODE_bss_80069618 = (f32) D_80051A08; } - sub_GAME_7F059694(&spE0, 0.0f, 0.0f, 0x457a0000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + 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 = sub_GAME_7F0BD714(something_legalscreen_constructor->unk8->unkE << 6); @@ -3994,7 +3840,7 @@ glabel constructor_menu01_nintendo /* 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 sub_GAME_7F059694 +/* 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 @@ -4227,7 +4073,7 @@ void interface_menu04_goldeneyelogo(void) u32 uVar1; setvideo_far(60.00000000); - video_related_21(menu04_aspect); + set_page_aspect(menu04_aspect); set_page_height(100.00000000,(f32)menu04_pageheight); set_video2_settings_offset_24(0); menu_timer += clock_timer; @@ -4281,7 +4127,7 @@ glabel interface_menu04_goldeneyelogo /* 03FE70 7F00B340 0C001151 */ jal setvideo_far /* 03FE74 7F00B344 00000000 */ nop /* 03FE78 7F00B348 3C018005 */ lui $at, %hi(D_80051A10) -/* 03FE7C 7F00B34C 0C001164 */ jal video_related_21 +/* 03FE7C 7F00B34C 0C001164 */ jal set_page_aspect /* 03FE80 7F00B350 C42C1A10 */ lwc1 $f12, %lo(D_80051A10)($at) /* 03FE84 7F00B354 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 03FE88 7F00B358 44816000 */ mtc1 $at, $f12 @@ -4430,7 +4276,7 @@ loop_1: temp_s4 = temp_s4 + 8; temp_s4->unk4 = (s32) (temp_s0 + 0x10); temp_s4->unk0 = 0x3820010; - sub_GAME_7F059694(&spF8, 0.0f, 0.0f, 0x453b8000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + matrix_4x4_7F059694(&spF8, 0.0f, 0.0f, 0x453b8000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); sp150 = sub_GAME_7F0BD714(something_legalscreen_constructor->unk8->unkE << 6); matrix_scalar_multiply(D_80051A18, &spF8); matrix_4x4_copy(&spF8, sp150); @@ -4567,7 +4413,7 @@ glabel constructor_menu04_goldeneyelogo /* 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 sub_GAME_7F059694 +/* 040148 7F00B618 0FC165A5 */ jal matrix_4x4_7F059694 /* 04014C 7F00B61C E7A80020 */ swc1 $f8, 0x20($sp) /* 040150 7F00B620 3C138003 */ lui $s3, %hi(something_legalscreen_constructor) /* 040154 7F00B624 2673A958 */ addiu $s3, %lo(something_legalscreen_constructor) # addiu $s3, $s3, -0x56a8 @@ -5213,7 +5059,7 @@ s32 interface_menu05_fileselect(void) menu_timer = (s32) (menu_timer + clock_timer); } setvideo_far(0x42700000); - video_related_21(D_80051A1C); + set_page_aspect(D_80051A1C); set_page_height(0x42c80000, D_80051A20); set_video2_settings_offset_24(0); sp54 = &D_8002AB94; @@ -5221,7 +5067,7 @@ s32 interface_menu05_fileselect(void) phi_s1 = &dword_CODE_bss_80069620; phi_s2 = 0; loop_8: - sub_GAME_7F059694(&spC8, 0, 0, 0x457a0000, 1.0f); + 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); @@ -5416,7 +5262,7 @@ loop_38: if (selected_folder_num >= 0) { set_menu_to_mode(MENU_MODE_SELECT, 0); - return set_menu_cursor_pos_to_setting(0); + return setCursorPOSforMode(0); } if (menu_timer >= 0x709) { @@ -5484,7 +5330,7 @@ glabel interface_menu05_fileselect /* 0407A8 7F00BC78 0C001151 */ jal setvideo_far /* 0407AC 7F00BC7C 00000000 */ nop /* 0407B0 7F00BC80 3C018005 */ lui $at, %hi(D_80051A1C) -/* 0407B4 7F00BC84 0C001164 */ jal video_related_21 +/* 0407B4 7F00BC84 0C001164 */ jal set_page_aspect /* 0407B8 7F00BC88 C42C1A1C */ lwc1 $f12, %lo(D_80051A1C)($at) /* 0407BC 7F00BC8C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 0407C0 7F00BC90 44816000 */ mtc1 $at, $f12 @@ -5515,7 +5361,7 @@ glabel interface_menu05_fileselect /* 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 sub_GAME_7F059694 +/* 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 @@ -5937,7 +5783,7 @@ glabel interface_menu05_fileselect /* 040E58 7F00C328 24040006 */ li $a0, 6 /* 040E5C 7F00C32C 0FC06975 */ jal set_menu_to_mode /* 040E60 7F00C330 00002825 */ move $a1, $zero -/* 040E64 7F00C334 0FC035FF */ jal set_menu_cursor_pos_to_setting +/* 040E64 7F00C334 0FC035FF */ jal setCursorPOSforMode /* 040E68 7F00C338 00002025 */ move $a0, $zero /* 040E6C 7F00C33C 1000000A */ b .L7F00C368 /* 040E70 7F00C340 8FBF0044 */ lw $ra, 0x44($sp) @@ -7401,79 +7247,83 @@ void interface_menu06_modesel(void) is_cheat_menu_available = TRUE; } } - - setvideo_far(60.0f); - video_related_21((1.33333337f); + setvideo_far(60.f); + set_page_aspect(1.333333f); set_page_height(100.0f, 10000.0f); set_video2_settings_offset_24(0); + disable_all_switches(ptr_folder_object_instance); - select_load_bond_picture(ptr_folder_object_instance, removed_would_have_returned_bond_for_folder_num(selected_folder_num)); set_item_visibility_in_objinstance(ptr_folder_object_instance, 0, 1); set_item_visibility_in_objinstance(ptr_folder_object_instance, 1, 1); set_item_visibility_in_objinstance(ptr_folder_object_instance, 3, 1); set_item_visibility_in_objinstance(ptr_folder_object_instance, 7, 1); set_item_visibility_in_objinstance(ptr_folder_object_instance, 2, 1); - tab_3_highlight = FALSE; - mission_difficulty_highlighted = DIFFICULTY_MULTI; - if (isontab3() == 0) { - if ((is_cheat_menu_available == FALSE) || (cursor_v_pos < 275.0f)) { - if ((cursor_v_pos < 243.0f) || - (get_attached_controller_count() < 2)) { - mission_difficulty_highlighted = DIFFICULTY_AGENT; - if (get_controller_buttons_pressed('\0', START_BUTTON|Z_TRIG|A_BUTTON)) { - gamemode = GAMEMODE_SOLO; - play_sfx_a1(ptr_sfx_buf, 0xc5, NULL); - } - } - else { - mission_difficulty_highlighted = DIFFICULTY_SECRET; - if (get_controller_buttons_pressed('\0', START_BUTTON|Z_TRIG|A_BUTTON)) { - gamemode = GAMEMODE_MULTI; - play_sfx_a1(ptr_sfx_buf, 0xc5, NULL); - } - } - } - else { - mission_difficulty_highlighted = DIFFICULTY_00; - if (get_controller_buttons_pressed('\0', START_BUTTON|Z_TRIG|A_BUTTON)) { - gamemode = GAMEMODE_CHEATS; - play_sfx_a1(ptr_sfx_buf, 0xc5, NULL); - } + tab_3_highlight = 0; + mission_difficulty_highlighted = -1; + if (isontab3() != 0) + { + tab_3_highlight = 1; + if (get_controller_buttons_pressed(0, START_BUTTON|Z_TRIG|A_BUTTON) != 0) + { + tab_3_selected = 1; + play_sfx_a1(ptr_sfx_buf, 0xC7, 0); } } - else { - tab_3_highlight = TRUE; - if (get_controller_buttons_pressed('\0', START_BUTTON|Z_TRIG|A_BUTTON)) { - tab_3_selected = TRUE; - play_sfx_a1(ptr_sfx_buf, 199, NULL); + else if ((is_cheat_menu_available != 0) && (275.0f <= cursor_v_pos)) + { + mission_difficulty_highlighted = 2; + if (get_controller_buttons_pressed(0, START_BUTTON|Z_TRIG|A_BUTTON) != 0) + { + gamemode = 2; + play_sfx_a1(ptr_sfx_buf, 0xC5, 0); } } - if (get_controller_buttons_pressed('\0',B_BUTTON)) { - tab_3_selected = TRUE; - play_sfx_a1(ptr_sfx_buf, 199, NULL); + else if ((243.0f <= cursor_v_pos) && (get_attached_controller_count() >= 2)) + { + mission_difficulty_highlighted = 1; + if (get_controller_buttons_pressed(0, START_BUTTON|Z_TRIG|A_BUTTON) != 0) + { + gamemode = 1; + play_sfx_a1(ptr_sfx_buf, 0xC5, 0); + } + } + else + { + mission_difficulty_highlighted = 0; + if (get_controller_buttons_pressed(0, START_BUTTON|Z_TRIG|A_BUTTON) != 0) + { + gamemode = 0; + play_sfx_a1(ptr_sfx_buf, 0xC5, 0); + } + } + + if (get_controller_buttons_pressed(0, B_BUTTON) != 0) + { + tab_3_selected = 1; + play_sfx_a1(ptr_sfx_buf, 0xC7, 0); } menu_control_stick_tracking(); - if (gamemode == GAMEMODE_SOLO) { + if (gamemode == GAMEMODE_SOLO) + { set_menu_to_mode(MENU_MISSION_SELECT, 0); set_cursor_to_stage_solo(0); + return; } - else { - if (gamemode == GAMEMODE_MULTI) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); - } - else { - if (gamemode == GAMEMODE_CHEATS) { - set_menu_to_mode(MENU_CHEAT, 0); - } - else { - if (tab_3_selected != FALSE) { - set_menu_to_mode(MENU_FILE_SELECT, 0); - } - } - } + if (gamemode == GAMEMODE_MULTI) + { + set_menu_to_mode(MENU_MP_OPTIONS, 0); + return; + } + if (gamemode == GAMEMODE_CHEATS) + { + set_menu_to_mode(MENU_CHEAT, 0); + return; + } + if (tab_3_selected != 0) + { + set_menu_to_mode(MENU_FILE_SELECT, 0); } - return; } #else GLOBAL_ASM( @@ -7518,7 +7368,7 @@ glabel interface_menu06_modesel /* 041E30 7F00D300 0C001151 */ jal setvideo_far /* 041E34 7F00D304 00000000 */ nop /* 041E38 7F00D308 3C018005 */ lui $at, %hi(D_80051A38) -/* 041E3C 7F00D30C 0C001164 */ jal video_related_21 +/* 041E3C 7F00D30C 0C001164 */ jal set_page_aspect /* 041E40 7F00D310 C42C1A38 */ lwc1 $f12, %lo(D_80051A38)($at) /* 041E44 7F00D314 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 041E48 7F00D318 44816000 */ mtc1 $at, $f12 @@ -7758,7 +7608,7 @@ loop_1: temp_t8->unk0 = (s32) temp_t9->unk0; temp_f0 = temp_v0->unk0 + D_8002AFC4; temp_f2 = temp_v0->unk4 + D_8002AFC8; - sub_GAME_7F059694(0, &spC8, temp_f0, temp_f2, 4000.0f + D_8002AFCC, temp_f0, temp_f2, 1.0f); + 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); matrix_4x4_multiply_in_place(&spC8, &sp88); @@ -7849,7 +7699,7 @@ glabel sub_GAME_7F00D5E8 /* 0421EC 7F00D6BC 44078000 */ mfc1 $a3, $f16 /* 0421F0 7F00D6C0 E7AC001C */ swc1 $f12, 0x1c($sp) /* 0421F4 7F00D6C4 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0421F8 7F00D6C8 0FC165A5 */ jal sub_GAME_7F059694 +/* 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 @@ -7933,32 +7783,11 @@ glabel sub_GAME_7F00D5E8 -#ifdef NONMATCHING -void set_menu_cursor_pos_to_setting(s32 arg0) { - // Node 0 +void setCursorPOSforMode(int mode) +{ cursor_h_pos = 126.0f; - cursor_v_pos = (f32) ((arg0 << 5) + 0xe2); - return; - // (function likely void) + cursor_v_pos = mode * 0x20 + 0xe2; } -#else -GLOBAL_ASM( -.text -glabel set_menu_cursor_pos_to_setting -/* 04232C 7F00D7FC 00047140 */ sll $t6, $a0, 5 -/* 042330 7F00D800 25CF00E2 */ addiu $t7, $t6, 0xe2 -/* 042334 7F00D804 448F3000 */ mtc1 $t7, $f6 -/* 042338 7F00D808 3C0142FC */ li $at, 0x42FC0000 # 126.000000 -/* 04233C 7F00D80C 44812000 */ mtc1 $at, $f4 -/* 042340 7F00D810 46803220 */ cvt.s.w $f8, $f6 -/* 042344 7F00D814 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 042348 7F00D818 E424A908 */ swc1 $f4, %lo(cursor_h_pos)($at) -/* 04234C 7F00D81C 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 042350 7F00D820 03E00008 */ jr $ra -/* 042354 7F00D824 E428A90C */ swc1 $f8, %lo(cursor_v_pos)($at) -) -#endif - @@ -8664,7 +8493,7 @@ void interface_menu07_missionsel(void) s32 phi_s5; setvideo_far(0x42700000); - video_related_21(D_80051A44); + set_page_aspect(D_80051A44); set_page_height(0x42c80000, D_80051A48); set_video2_settings_offset_24(0); disable_all_switches(ptr_folder_object_instance); @@ -8879,7 +8708,7 @@ loop_29: if (tab_3_selected != 0) { set_menu_to_mode(MENU_MODE_SELECT, 0); - set_menu_cursor_pos_to_setting(0); + setCursorPOSforMode(0); } } #else @@ -8905,7 +8734,7 @@ glabel interface_menu07_missionsel /* 042A0C 7F00DEDC 0C001151 */ jal setvideo_far /* 042A10 7F00DEE0 AFB00014 */ sw $s0, 0x14($sp) /* 042A14 7F00DEE4 3C018005 */ lui $at, %hi(D_80051A44) -/* 042A18 7F00DEE8 0C001164 */ jal video_related_21 +/* 042A18 7F00DEE8 0C001164 */ jal set_page_aspect /* 042A1C 7F00DEEC C42C1A44 */ lwc1 $f12, %lo(D_80051A44)($at) /* 042A20 7F00DEF0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 042A24 7F00DEF4 44816000 */ mtc1 $at, $f12 @@ -9239,7 +9068,7 @@ glabel interface_menu07_missionsel /* 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 set_menu_cursor_pos_to_setting +/* 042EE4 7F00E3B4 0FC035FF */ jal setCursorPOSforMode /* 042EE8 7F00E3B8 00002025 */ move $a0, $zero /* 042EEC 7F00E3BC 8FBF002C */ lw $ra, 0x2c($sp) .L7F00E3C0: @@ -9275,7 +9104,7 @@ glabel interface_menu07_missionsel /* 042A6C 7F00DEFC 0C001151 */ jal setvideo_far /* 042A70 7F00DF00 AFB00014 */ sw $s0, 0x14($sp) /* 042A74 7F00DF04 3C018005 */ lui $at, %hi(D_80051A44) # $at, 0x8005 -/* 042A78 7F00DF08 0C001164 */ jal video_related_21 +/* 042A78 7F00DF08 0C001164 */ jal set_page_aspect /* 042A7C 7F00DF0C C42C1A74 */ lwc1 $f12, %lo(D_80051A44)($at) /* 042A80 7F00DF10 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 042A84 7F00DF14 44816000 */ mtc1 $at, $f12 @@ -9618,7 +9447,7 @@ glabel interface_menu07_missionsel /* 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 set_menu_cursor_pos_to_setting +/* 042F64 7F00E3F4 0FC03607 */ jal setCursorPOSforMode /* 042F68 7F00E3F8 00002025 */ move $a0, $zero /* 042F6C 7F00E3FC 8FBF002C */ lw $ra, 0x2c($sp) .L7F00E400: @@ -10033,7 +9862,7 @@ void interface_menu08_difficulty(void) sp1C = get_highest_unlocked_difficulty_for_level((0x80030000 + (briefingpage * 0x1c))->unk-5408); setvideo_far(0x42700000); - video_related_21(D_80051A4C); + set_page_aspect(D_80051A4C); set_page_height(0x42c80000, D_80051A50); set_video2_settings_offset_24(0); disable_all_switches(ptr_folder_object_instance); @@ -10143,7 +9972,7 @@ glabel interface_menu08_difficulty /* 043324 7F00E7F4 0C001151 */ jal setvideo_far /* 043328 7F00E7F8 AFA2001C */ sw $v0, 0x1c($sp) /* 04332C 7F00E7FC 3C018005 */ lui $at, %hi(D_80051A4C) -/* 043330 7F00E800 0C001164 */ jal video_related_21 +/* 043330 7F00E800 0C001164 */ jal set_page_aspect /* 043334 7F00E804 C42C1A4C */ lwc1 $f12, %lo(D_80051A4C)($at) /* 043338 7F00E808 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04333C 7F00E80C 44816000 */ mtc1 $at, $f12 @@ -11244,7 +11073,7 @@ void interface_menu09_007options(void) f32 phi_f0_2; setvideo_far(0x42700000); - video_related_21(D_80051A58); + set_page_aspect(D_80051A58); set_page_height(0x42c80000, D_80051A5C); set_video2_settings_offset_24(0); if (get_controller_buttons_held(0, 0xa000) == 0) @@ -11423,7 +11252,7 @@ glabel interface_menu09_007options /* 043EB4 7F00F384 0C001151 */ jal setvideo_far /* 043EB8 7F00F388 00000000 */ nop /* 043EBC 7F00F38C 3C018005 */ lui $at, %hi(D_80051A58) -/* 043EC0 7F00F390 0C001164 */ jal video_related_21 +/* 043EC0 7F00F390 0C001164 */ jal set_page_aspect /* 043EC4 7F00F394 C42C1A58 */ lwc1 $f12, %lo(D_80051A58)($at) /* 043EC8 7F00F398 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 043ECC 7F00F39C 44816000 */ mtc1 $at, $f12 @@ -13004,13 +12833,13 @@ void interface_menu0E_mpoptions(void) controlstyle_selected = 0; aimadjustment_selected = 0; setvideo_far(60.0f); - video_related_21(menu0E_aspect); + set_page_aspect(menu0E_aspect); set_page_height(100.0f, menu0E_pageheight); set_video2_settings_offset_24(0); if (get_attached_controller_count() < 2) { set_menu_to_mode(MENU_MODE_SELECT, 0); - set_menu_cursor_pos_to_setting(gamemode); + setCursorPOSforMode(gamemode); } if (get_attached_controller_count() < selected_num_players) { @@ -13159,7 +12988,7 @@ void interface_menu0E_mpoptions(void) if (tab_3_selected != 0) { set_menu_to_mode(MENU_MODE_SELECT, 0); - set_menu_cursor_pos_to_setting(gamemode); + setCursorPOSforMode(gamemode); return; } if (tab_1_selected != 0) @@ -13252,7 +13081,7 @@ glabel interface_menu0E_mpoptions /* 0453A8 7F010878 0C001151 */ jal setvideo_far /* 0453AC 7F01087C AFA0001C */ sw $zero, 0x1c($sp) /* 0453B0 7F010880 3C018005 */ lui $at, %hi(menu0E_aspect) -/* 0453B4 7F010884 0C001164 */ jal video_related_21 +/* 0453B4 7F010884 0C001164 */ jal set_page_aspect /* 0453B8 7F010888 C42C1A80 */ lwc1 $f12, %lo(menu0E_aspect)($at) /* 0453BC 7F01088C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 0453C0 7F010890 44816000 */ mtc1 $at, $f12 @@ -13269,7 +13098,7 @@ glabel interface_menu0E_mpoptions /* 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 set_menu_cursor_pos_to_setting +/* 0453F8 7F0108C8 0FC035FF */ jal setCursorPOSforMode /* 0453FC 7F0108CC 8C84A8F0 */ lw $a0, %lo(gamemode)($a0) .L7F0108D0: /* 045400 7F0108D0 0C002E7E */ jal get_attached_controller_count @@ -13586,7 +13415,7 @@ glabel interface_menu0E_mpoptions /* 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 set_menu_cursor_pos_to_setting +/* 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) @@ -15052,24 +14881,24 @@ loop_16: } } } - mp_char_cur_select_player1 = (s32) player_1_char; - mp_char_prev_select_player1 = (s32) player_1_char; + 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_player2 = (s32) player_2_char; - mp_char_prev_select_player2 = (s32) player_2_char; - dword_CODE_bss_80069734 = 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_player3 = (s32) player_3_char; - mp_char_prev_select_player3 = (s32) player_3_char; - dword_CODE_bss_80069738 = 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_player4 = (s32) player_4_char; - mp_char_prev_select_player4 = (s32) player_4_char; - dword_CODE_bss_8006973C = 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); @@ -15199,11 +15028,11 @@ glabel init_menu0f_mpcharsel .L7F011DE8: /* 046918 7F011DE8 3C028003 */ lui $v0, %hi(player_1_char) /* 04691C 7F011DEC 8C42B524 */ lw $v0, %lo(player_1_char)($v0) -/* 046920 7F011DF0 3C018007 */ lui $at, %hi(mp_char_cur_select_player1) +/* 046920 7F011DF0 3C018007 */ lui $at, %hi(mp_char_cur_select_player) /* 046924 7F011DF4 3C038003 */ lui $v1, %hi(player_2_char) -/* 046928 7F011DF8 AC229710 */ sw $v0, %lo(mp_char_cur_select_player1)($at) -/* 04692C 7F011DFC 3C018007 */ lui $at, %hi(mp_char_prev_select_player1) -/* 046930 7F011E00 AC229720 */ sw $v0, %lo(mp_char_prev_select_player1)($at) +/* 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(has_selected_char_player1) @@ -15211,36 +15040,36 @@ glabel init_menu0f_mpcharsel /* 046944 7F011E14 8C63B528 */ lw $v1, %lo(player_2_char)($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_player2) -/* 046954 7F011E24 AC239714 */ sw $v1, %lo(mp_char_cur_select_player2)($at) -/* 046958 7F011E28 3C018007 */ lui $at, %hi(mp_char_prev_select_player2) -/* 04695C 7F011E2C AC239724 */ sw $v1, %lo(mp_char_prev_select_player2)($at) -/* 046960 7F011E30 3C018007 */ lui $at, %hi(dword_CODE_bss_80069734) -/* 046964 7F011E34 AC209734 */ sw $zero, %lo(dword_CODE_bss_80069734)($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(has_selected_char_player2) /* 04696C 7F011E3C AC209744 */ sw $zero, %lo(has_selected_char_player2)($at) /* 046970 7F011E40 3C048003 */ lui $a0, %hi(player_3_char) /* 046974 7F011E44 8C84B52C */ lw $a0, %lo(player_3_char)($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_player3) -/* 046984 7F011E54 AC249718 */ sw $a0, %lo(mp_char_cur_select_player3)($at) -/* 046988 7F011E58 3C018007 */ lui $at, %hi(mp_char_prev_select_player3) -/* 04698C 7F011E5C AC249728 */ sw $a0, %lo(mp_char_prev_select_player3)($at) -/* 046990 7F011E60 3C018007 */ lui $at, %hi(dword_CODE_bss_80069738) -/* 046994 7F011E64 AC209738 */ sw $zero, %lo(dword_CODE_bss_80069738)($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(has_selected_char_player3) /* 04699C 7F011E6C AC209748 */ sw $zero, %lo(has_selected_char_player3)($at) /* 0469A0 7F011E70 3C058003 */ lui $a1, %hi(player_4_char) /* 0469A4 7F011E74 8CA5B530 */ lw $a1, %lo(player_4_char)($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_player4) -/* 0469B4 7F011E84 AC25971C */ sw $a1, %lo(mp_char_cur_select_player4)($at) -/* 0469B8 7F011E88 3C018007 */ lui $at, %hi(mp_char_prev_select_player4) -/* 0469BC 7F011E8C AC25972C */ sw $a1, %lo(mp_char_prev_select_player4)($at) -/* 0469C0 7F011E90 3C018007 */ lui $at, %hi(dword_CODE_bss_8006973C) -/* 0469C4 7F011E94 AC20973C */ sw $zero, %lo(dword_CODE_bss_8006973C)($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(has_selected_char_player4) /* 0469CC 7F011E9C AC20974C */ sw $zero, %lo(has_selected_char_player4)($at) /* 0469D0 7F011EA0 3C018007 */ lui $at, %hi(size_mp_select_image_player4) @@ -15289,15 +15118,15 @@ void interface_menu0F_mpcharsel(void) iVar4 = get_selected_num_players(); iStack12 = 0; setvideo_far(60.00000000); - video_related_21((f32)flt_80051A88); + set_page_aspect((f32)flt_80051A88); set_page_height(100.00000000,(f32)flt_80051A8C); set_video2_settings_offset_24(0); iVar13 = 0; iVar10 = 0; if (0 < iVar4) { piVar9 = &mp_unknown1_player1; - piVar8 = &mp_char_cur_select_player1; - piVar12 = &mp_char_prev_select_player1; + piVar8 = &mp_char_cur_select_player; + piVar12 = &mp_char_prev_select_player; pBVar11 = &has_selected_char_player1; do { controller = (char)iVar13; @@ -15437,7 +15266,7 @@ glabel interface_menu0F_mpcharsel /* 046A40 7F011F10 0C001151 */ jal setvideo_far /* 046A44 7F011F14 AFA00044 */ sw $zero, 0x44($sp) /* 046A48 7F011F18 3C018005 */ lui $at, %hi(D_80051A88) -/* 046A4C 7F011F1C 0C001164 */ jal video_related_21 +/* 046A4C 7F011F1C 0C001164 */ jal set_page_aspect /* 046A50 7F011F20 C42C1A88 */ lwc1 $f12, %lo(D_80051A88)($at) /* 046A54 7F011F24 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 046A58 7F011F28 44816000 */ mtc1 $at, $f12 @@ -15451,16 +15280,16 @@ glabel interface_menu0F_mpcharsel /* 046A78 7F011F48 00009825 */ move $s3, $zero /* 046A7C 7F011F4C 19C000B6 */ blez $t6, .L7F012228 /* 046A80 7F011F50 3C148007 */ lui $s4, %hi(has_selected_char_player1) -/* 046A84 7F011F54 3C158007 */ lui $s5, %hi(mp_char_prev_select_player1) -/* 046A88 7F011F58 3C118007 */ lui $s1, %hi(mp_char_cur_select_player1) +/* 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(ptr_sfx_buf) /* 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(ptr_sfx_buf) # 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_player1) # addiu $s1, $s1, -0x68f0 -/* 046AA8 7F011F78 26B59720 */ addiu $s5, %lo(mp_char_prev_select_player1) # addiu $s5, $s5, -0x68e0 +/* 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(has_selected_char_player1) # addiu $s4, $s4, -0x68c0 .L7F011F80: /* 046AB0 7F011F80 8E8F0000 */ lw $t7, ($s4) @@ -16288,9 +16117,9 @@ void constructor_menu0F_mpcharsel(s32 arg0) if (spE4 > 0) { sp88 = &has_selected_char_player1; - sp80 = &mp_char_cur_select_player1; + sp80 = &mp_char_cur_select_player; sp74 = &dword_CODE_bss_80069730; - sp70 = &mp_char_prev_select_player1; + sp70 = &mp_char_prev_select_player; spE0 = 0; loop_4: if (spE4 == 2) @@ -16498,13 +16327,13 @@ glabel constructor_menu0F_mpcharsel .L7F01285C: /* 04738C 7F01285C 19000165 */ blez $t0, .L7F012DF4 /* 047390 7F012860 3C098007 */ lui $t1, %hi(has_selected_char_player1) -/* 047394 7F012864 3C0A8007 */ lui $t2, %hi(mp_char_cur_select_player1) +/* 047394 7F012864 3C0A8007 */ lui $t2, %hi(mp_char_cur_select_player) /* 047398 7F012868 3C0B8007 */ lui $t3, %hi(dword_CODE_bss_80069730) -/* 04739C 7F01286C 3C0C8007 */ lui $t4, %hi(mp_char_prev_select_player1) +/* 04739C 7F01286C 3C0C8007 */ lui $t4, %hi(mp_char_prev_select_player) /* 0473A0 7F012870 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0473A4 7F012874 258C9720 */ addiu $t4, %lo(mp_char_prev_select_player1) # addiu $t4, $t4, -0x68e0 +/* 0473A4 7F012874 258C9720 */ addiu $t4, %lo(mp_char_prev_select_player) # addiu $t4, $t4, -0x68e0 /* 0473A8 7F012878 256B9730 */ addiu $t3, %lo(dword_CODE_bss_80069730) # addiu $t3, $t3, -0x68d0 -/* 0473AC 7F01287C 254A9710 */ addiu $t2, %lo(mp_char_cur_select_player1) # addiu $t2, $t2, -0x68f0 +/* 0473AC 7F01287C 254A9710 */ addiu $t2, %lo(mp_char_cur_select_player) # addiu $t2, $t2, -0x68f0 /* 0473B0 7F012880 25299740 */ addiu $t1, %lo(has_selected_char_player1) # addiu $t1, $t1, -0x68c0 /* 0473B4 7F012884 3C1E8007 */ lui $fp, %hi(size_mp_select_image_player1) /* 0473B8 7F012888 4481A000 */ mtc1 $at, $f20 @@ -16939,7 +16768,7 @@ void interface_menu10_mphandicap(void) sp44 = get_selected_num_players(); setvideo_far(0x42700000); - video_related_21(D_80051A90); + set_page_aspect(D_80051A90); set_page_height(0x42c80000, D_80051A94); set_video2_settings_offset_24(0); phi_fp = 0; @@ -17066,7 +16895,7 @@ glabel interface_menu10_mphandicap /* 047A30 7F012F00 0C001151 */ jal setvideo_far /* 047A34 7F012F04 0000F025 */ move $fp, $zero /* 047A38 7F012F08 3C018005 */ lui $at, %hi(D_80051A90) -/* 047A3C 7F012F0C 0C001164 */ jal video_related_21 +/* 047A3C 7F012F0C 0C001164 */ jal set_page_aspect /* 047A40 7F012F10 C42C1A90 */ lwc1 $f12, %lo(D_80051A90)($at) /* 047A44 7F012F14 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 047A48 7F012F18 44816000 */ mtc1 $at, $f12 @@ -17678,7 +17507,7 @@ void interface_menu11_mpcontrols(void) temp_s6 = get_selected_num_players(); sp44 = 0; setvideo_far(0x42700000); - video_related_21(D_80051A98); + set_page_aspect(D_80051A98); set_page_height(0x42c80000, D_80051A9C); set_video2_settings_offset_24(0); if (temp_s6 > 0) @@ -17858,7 +17687,7 @@ glabel interface_menu11_mpcontrols /* 048174 7F013644 0C001151 */ jal setvideo_far /* 048178 7F013648 AFA00044 */ sw $zero, 0x44($sp) /* 04817C 7F01364C 3C018005 */ lui $at, %hi(D_80051A98) -/* 048180 7F013650 0C001164 */ jal video_related_21 +/* 048180 7F013650 0C001164 */ jal set_page_aspect /* 048184 7F013654 C42C1A98 */ lwc1 $f12, %lo(D_80051A98)($at) /* 048188 7F013658 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04818C 7F01365C 44816000 */ mtc1 $at, $f12 @@ -18112,7 +17941,7 @@ glabel interface_menu11_mpcontrols /* 0481F4 7F013684 0C001151 */ jal setvideo_far /* 0481F8 7F013688 AFA00054 */ sw $zero, 0x54($sp) /* 0481FC 7F01368C 3C018005 */ lui $at, %hi(D_80051A98) # $at, 0x8005 -/* 048200 7F013690 0C001164 */ jal video_related_21 +/* 048200 7F013690 0C001164 */ jal set_page_aspect /* 048204 7F013694 C42C1AC8 */ lwc1 $f12, %lo(D_80051A98)($at) /* 048208 7F013698 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04820C 7F01369C 44816000 */ mtc1 $at, $f12 @@ -18800,7 +18629,7 @@ void interface_menu12_mpstage(void) s32 phi_v0; setvideo_far(0x42700000); - video_related_21(D_80051AA0); + set_page_aspect(D_80051AA0); set_page_height(0x42c80000, D_80051AA4); set_video2_settings_offset_24(0); if (get_controller_buttons_held(0, 0xb000) == 0) @@ -18917,7 +18746,7 @@ glabel interface_menu12_mpstage /* 048914 7F013DE4 0C001151 */ jal setvideo_far /* 048918 7F013DE8 AFB00018 */ sw $s0, 0x18($sp) /* 04891C 7F013DEC 3C018005 */ lui $at, %hi(D_80051AA0) -/* 048920 7F013DF0 0C001164 */ jal video_related_21 +/* 048920 7F013DF0 0C001164 */ jal set_page_aspect /* 048924 7F013DF4 C42C1AA0 */ lwc1 $f12, %lo(D_80051AA0)($at) /* 048928 7F013DF8 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04892C 7F013DFC 44816000 */ mtc1 $at, $f12 @@ -19817,7 +19646,7 @@ void interface_menu13_mpscenario(void) sp2C = 0; setvideo_far(0x42700000); - video_related_21(D_80051AA8); + set_page_aspect(D_80051AA8); set_page_height(0x42c80000, D_80051AAC); set_video2_settings_offset_24(0); if (get_controller_buttons_held(0, 0xa000) == 0) @@ -19918,7 +19747,7 @@ glabel interface_menu13_mpscenario /* 049304 7F0147D4 0C001151 */ jal setvideo_far /* 049308 7F0147D8 AFA0002C */ sw $zero, 0x2c($sp) /* 04930C 7F0147DC 3C018005 */ lui $at, %hi(D_80051AA8) -/* 049310 7F0147E0 0C001164 */ jal video_related_21 +/* 049310 7F0147E0 0C001164 */ jal set_page_aspect /* 049314 7F0147E4 C42C1AA8 */ lwc1 $f12, %lo(D_80051AA8)($at) /* 049318 7F0147E8 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04931C 7F0147EC 44816000 */ mtc1 $at, $f12 @@ -20396,7 +20225,7 @@ void interface_menu14_mpteams(void) s32 phi_s0_2; setvideo_far(0x42700000); - video_related_21(D_80051AB0); + set_page_aspect(D_80051AB0); set_page_height(0x42c80000, D_80051AB4); set_video2_settings_offset_24(0); D_8002B560 = (s32) ((s32) (D_8002B560 + 1) % 0x14); @@ -20547,7 +20376,7 @@ glabel interface_menu14_mpteams /* 04988C 7F014D5C 0C001151 */ jal setvideo_far /* 049890 7F014D60 AFB00014 */ sw $s0, 0x14($sp) /* 049894 7F014D64 3C018005 */ lui $at, %hi(D_80051AB0) -/* 049898 7F014D68 0C001164 */ jal video_related_21 +/* 049898 7F014D68 0C001164 */ jal set_page_aspect /* 04989C 7F014D6C C42C1AB0 */ lwc1 $f12, %lo(D_80051AB0)($at) /* 0498A0 7F014D70 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 0498A4 7F014D74 44816000 */ mtc1 $at, $f12 @@ -21361,7 +21190,7 @@ void update_menu0A_briefing(void) void interface_menu0A_briefing(void) { setvideo_far(0x42700000); - video_related_21(D_80051AB8); + set_page_aspect(D_80051AB8); set_page_height(0x42c80000, D_80051ABC); set_video2_settings_offset_24(0); tab_3_highlight = 0; @@ -21483,7 +21312,7 @@ glabel interface_menu0A_briefing /* 04A1DC 7F0156AC 0C001151 */ jal setvideo_far /* 04A1E0 7F0156B0 00000000 */ nop /* 04A1E4 7F0156B4 3C018005 */ lui $at, %hi(D_80051AB8) -/* 04A1E8 7F0156B8 0C001164 */ jal video_related_21 +/* 04A1E8 7F0156B8 0C001164 */ jal set_page_aspect /* 04A1EC 7F0156BC C42C1AB8 */ lwc1 $f12, %lo(D_80051AB8)($at) /* 04A1F0 7F0156C0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04A1F4 7F0156C4 44816000 */ mtc1 $at, $f12 @@ -22405,7 +22234,7 @@ void interface_menu0C_missionfailed(void) const f32 menu0C_pageheight = 10000.0; setvideo_far(60.00000000); - video_related_21(menu0C_aspect); + set_page_aspect(menu0C_aspect); set_page_height(100.00000000, menu0C_pageheight); set_video2_settings_offset_24(0); tab_2_highlight = 0; @@ -22482,7 +22311,7 @@ glabel interface_menu0C_missionfailed /* 04AC50 7F016120 0C001151 */ jal setvideo_far /* 04AC54 7F016124 00000000 */ nop /* 04AC58 7F016128 3C018005 */ lui $at, %hi(menu0C_aspect) -/* 04AC5C 7F01612C 0C001164 */ jal video_related_21 +/* 04AC5C 7F01612C 0C001164 */ jal set_page_aspect /* 04AC60 7F016130 C42C1AD4 */ lwc1 $f12, %lo(menu0C_aspect)($at) /* 04AC64 7F016134 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04AC68 7F016138 44816000 */ mtc1 $at, $f12 @@ -23000,7 +22829,7 @@ void interface_menu0D_missioncomplete(u32 param_1,u32 param_2) int iVar7; setvideo_far(60.00000000); - video_related_21((f32)menu0D_aspect); + set_page_aspect((f32)menu0D_aspect); set_page_height(100.00000000,(f32)menu0D_pageheight); set_video2_settings_offset_24(0); tab_3_highlight = FALSE; @@ -23106,7 +22935,7 @@ glabel interface_menu0D_missioncomplete /* 04B218 7F0166E8 0C001151 */ jal setvideo_far /* 04B21C 7F0166EC 00000000 */ nop /* 04B220 7F0166F0 3C018005 */ lui $at, %hi(menu0D_aspect) -/* 04B224 7F0166F4 0C001164 */ jal video_related_21 +/* 04B224 7F0166F4 0C001164 */ jal set_page_aspect /* 04B228 7F0166F8 C42C1ADC */ lwc1 $f12, %lo(menu0D_aspect)($at) /* 04B22C 7F0166FC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04B230 7F016700 44816000 */ mtc1 $at, $f12 @@ -24642,7 +24471,7 @@ void interface_menu15_cheat(u32 param_1,u32 param_2) int iVar5; setvideo_far(60.00000000); - video_related_21(menu15_aspect); + set_page_aspect(menu15_aspect); set_page_height(100.00000000, menu15_pageheight); set_video2_settings_offset_24(0); MP_menu_selected_option = 0; @@ -24723,7 +24552,7 @@ void interface_menu15_cheat(u32 param_1,u32 param_2) } else { set_menu_to_mode(MENU_MODE_SELECT,0); - set_menu_cursor_pos_to_setting(gamemode); + setCursorPOSforMode(gamemode); } } #else @@ -24742,7 +24571,7 @@ glabel interface_menu15_cheat /* 04C7C8 7F017C98 0C001151 */ jal setvideo_far /* 04C7CC 7F017C9C 00000000 */ nop /* 04C7D0 7F017CA0 3C018005 */ lui $at, %hi(menu15_aspect) -/* 04C7D4 7F017CA4 0C001164 */ jal video_related_21 +/* 04C7D4 7F017CA4 0C001164 */ jal set_page_aspect /* 04C7D8 7F017CA8 C42C1AE4 */ lwc1 $f12, %lo(menu15_aspect)($at) /* 04C7DC 7F017CAC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04C7E0 7F017CB0 44816000 */ mtc1 $at, $f12 @@ -24905,7 +24734,7 @@ glabel interface_menu15_cheat /* 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 set_menu_cursor_pos_to_setting +/* 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) @@ -26159,7 +25988,7 @@ set_body_mp_choice_maybe: /* 04D424 7F0188F4 3B04003F */ xori $a0, $t8, 0x3f /* 04D428 7F0188F8 AFA200B0 */ sw $v0, 0xb0($sp) /* 04D42C 7F0188FC 240501B8 */ li $a1, 440 -/* 04D430 7F018900 0FC34912 */ jal sub_GAME_7F0D2448 +/* 04D430 7F018900 0FC34912 */ jal zbufSetBuffer /* 04D434 7F018904 2406014A */ li $a2, 330 /* 04D438 7F018908 3C060001 */ lui $a2, (0x00019000 >> 16) # lui $a2, 1 /* 04D43C 7F01890C 34C69000 */ ori $a2, (0x00019000 & 0xFFFF) # ori $a2, $a2, 0x9000 @@ -26599,7 +26428,7 @@ void interface_menu18_displaycast(u32 param_1,u32 param_2) setvideo_far(46.00000000); set_page_height(10.00000000,2000.00000000); set_video2_settings_offset_24(1); - video_related_21((f32)flt_80051B08); + set_page_aspect((f32)flt_80051B08); set_cur_player_screen_size(0x1b8,0x14a); set_video2_width_height(0x1b8,0x14a); set_cur_player_viewport_size(0,0); @@ -26717,7 +26546,7 @@ glabel interface_menu18_displaycast /* 04DACC 7F018F9C 0C00114D */ jal set_video2_settings_offset_24 /* 04DAD0 7F018FA0 24040001 */ li $a0, 1 /* 04DAD4 7F018FA4 3C018005 */ lui $at, %hi(D_80051B08) -/* 04DAD8 7F018FA8 0C001164 */ jal video_related_21 +/* 04DAD8 7F018FA8 0C001164 */ jal set_page_aspect /* 04DADC 7F018FAC C42C1B08 */ lwc1 $f12, %lo(D_80051B08)($at) /* 04DAE0 7F018FB0 240401B8 */ li $a0, 440 /* 04DAE4 7F018FB4 0FC26C77 */ jal set_cur_player_screen_size @@ -27551,7 +27380,7 @@ glabel constructor_menu18_displaycast /* 04E710 7F019BE0 E7A8001C */ swc1 $f8, 0x1c($sp) /* 04E714 7F019BE4 E7A60018 */ swc1 $f6, 0x18($sp) /* 04E718 7F019BE8 E7A40024 */ swc1 $f4, 0x24($sp) -/* 04E71C 7F019BEC 0FC165A5 */ jal sub_GAME_7F059694 +/* 04E71C 7F019BEC 0FC165A5 */ jal matrix_4x4_7F059694 /* 04E720 7F019BF0 E7AA0020 */ swc1 $f10, 0x20($sp) /* 04E724 7F019BF4 8E8E0000 */ lw $t6, ($s4) /* 04E728 7F019BF8 AFB201A8 */ sw $s2, 0x1a8($sp) @@ -28223,7 +28052,7 @@ void update_menu19_spectrum(void) { #ifdef NONMATCHING void interface_menu19_spectrum(void) { setvideo_far(60.0f); - video_related_21(D_80051B3C); + set_page_aspect(D_80051B3C); set_page_height(100.0f, D_80051B40); set_video2_settings_offset_24(0); run_spectrum_game(); @@ -28239,7 +28068,7 @@ glabel interface_menu19_spectrum /* 04EFC8 7F01A498 0C001151 */ jal setvideo_far /* 04EFCC 7F01A49C 00000000 */ nop /* 04EFD0 7F01A4A0 3C018005 */ lui $at, %hi(D_80051B3C) -/* 04EFD4 7F01A4A4 0C001164 */ jal video_related_21 +/* 04EFD4 7F01A4A4 0C001164 */ jal set_page_aspect /* 04EFD8 7F01A4A8 C42C1B3C */ lwc1 $f12, %lo(D_80051B3C)($at) /* 04EFDC 7F01A4AC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 /* 04EFE0 7F01A4B0 44816000 */ mtc1 $at, $f12 @@ -28368,7 +28197,7 @@ glabel constructor_menu19_spectrum #ifdef NONMATCHING -void set_menu_to_mode(MENU menu, u32 mode) +void set_menu_to_mode(MENU menu, s32 mode) { if ((menu == MENU_RUN_STAGE) || (menu == MENU_SPECTRUM_EMU)) { is_emulating_spectrum = TRUE; @@ -28424,13 +28253,13 @@ void menu_init(u32 param_1,u32 param_2) if (current_menu == MENU_SWITCH_SCREENS) { if (spectrum_related_flag == FALSE) { if ((is_emulating_spectrum != FALSE) && - (get_video_settings2_frameb() == cfb_16_a)) { + (get_video_settings2_frameb() == cfb_16)) { screen_size = SCREEN_SIZE_320x240; is_emulating_spectrum = FALSE; } } else { - if (get_video_settings2_frameb() == cfb_16_b) { + if (get_video_settings2_frameb() == cfb_16[1]) { screen_size = SCREEN_SIZE_440x330; spectrum_related_flag = FALSE; } @@ -28438,7 +28267,7 @@ void menu_init(u32 param_1,u32 param_2) } if (screen_size == SCREEN_SIZE_320x240) { - video_related_21((f32)flt_80051B48); + set_page_aspect((f32)flt_80051B48); set_video2_text_clip_size(320,240); set_video2_settings_offset_18_1A(320,240); set_cur_player_screen_size(320,240); @@ -28447,10 +28276,10 @@ void menu_init(u32 param_1,u32 param_2) set_video2_ulx_uly(0,0); } else { - if (get_video_settings2_frameb() == cfb_16_b) { + if (get_video_settings2_frameb() == cfb_16[1]) { set_video_settings2_frameb(ptr_menu_videobuffer); } - video_related_21((f32)flt_80051B44); + set_page_aspect((f32)flt_80051B44); set_video2_text_clip_size(440,330); set_video2_settings_offset_18_1A(440,330); set_cur_player_screen_size(440,330); @@ -28821,8 +28650,8 @@ glabel menu_init /* 04F174 7F01A644 00000000 */ nop /* 04F178 7F01A648 0C000F07 */ jal get_video_settings2_frameb /* 04F17C 7F01A64C 00000000 */ nop -/* 04F180 7F01A650 3C18803E */ lui $t8, %hi(cfb_16_b) # $t8, 0x803e -/* 04F184 7F01A654 2718A800 */ addiu $t8, %lo(cfb_16_b) # addiu $t8, $t8, -0x5800 +/* 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) @@ -28836,8 +28665,8 @@ glabel menu_init /* 04F1AC 7F01A67C 00000000 */ nop /* 04F1B0 7F01A680 0C000F07 */ jal get_video_settings2_frameb /* 04F1B4 7F01A684 00000000 */ nop -/* 04F1B8 7F01A688 3C09803B */ lui $t1, %hi(cfb_16_a) # $t1, 0x803b -/* 04F1BC 7F01A68C 25295000 */ addiu $t1, %lo(cfb_16_a) # addiu $t1, $t1, 0x5000 +/* 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) @@ -28851,15 +28680,15 @@ glabel menu_init /* 04F1E4 7F01A6B4 00000000 */ nop /* 04F1E8 7F01A6B8 0C000F07 */ jal get_video_settings2_frameb /* 04F1EC 7F01A6BC 00000000 */ nop -/* 04F1F0 7F01A6C0 3C0B803E */ lui $t3, %hi(cfb_16_b) # $t3, 0x803e -/* 04F1F4 7F01A6C4 256BA800 */ addiu $t3, %lo(cfb_16_b) # addiu $t3, $t3, -0x5800 +/* 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 set_video2buf_frameb /* 04F204 7F01A6D4 8C84A954 */ lw $a0, %lo(ptr_menu_videobuffer)($a0) .L7F01A6D8: /* 04F208 7F01A6D8 3C018005 */ lui $at, %hi(D_80051B48) -/* 04F20C 7F01A6DC 0C001164 */ jal video_related_21 +/* 04F20C 7F01A6DC 0C001164 */ jal set_page_aspect /* 04F210 7F01A6E0 C42C1B44 */ lwc1 $f12, %lo(D_80051B44)($at) /* 04F214 7F01A6E4 240401B8 */ li $a0, 440 /* 04F218 7F01A6E8 0C0010FE */ jal set_video2_text_clip_size @@ -28882,7 +28711,7 @@ glabel menu_init /* 04F25C 7F01A72C 10000015 */ b .L7F01A784 /* 04F260 7F01A730 00000000 */ nop .L7F01A734: -/* 04F264 7F01A734 0C001164 */ jal video_related_21 +/* 04F264 7F01A734 0C001164 */ jal set_page_aspect /* 04F268 7F01A738 C42C1B48 */ lwc1 $f12, %lo(D_80051B48)($at) /* 04F26C 7F01A73C 24040140 */ li $a0, 320 /* 04F270 7F01A740 0C0010FE */ jal set_video2_text_clip_size diff --git a/src/game/mainmenu.h b/src/game/mainmenu.h index 6ca60c50..26d03e10 100644 --- a/src/game/mainmenu.h +++ b/src/game/mainmenu.h @@ -361,29 +361,14 @@ extern u8 cheat_activated_78; //CODE.bss:800696F0 extern s32 array_favweapon[4][2]; //CODE.bss:80069710 -extern s32 mp_char_cur_select_player1; -//CODE.bss:80069714 -extern s32 mp_char_cur_select_player2; -//CODE.bss:80069718 -extern s32 mp_char_cur_select_player3; -//CODE.bss:8006971C -extern s32 mp_char_cur_select_player4; +extern s32 mp_char_cur_select_player[4]; + //CODE.bss:80069720 -extern s32 mp_char_prev_select_player1; -//CODE.bss:80069724 -extern s32 mp_char_prev_select_player2; -//CODE.bss:80069728 -extern s32 mp_char_prev_select_player3; -//CODE.bss:8006972C -extern s32 mp_char_prev_select_player4; +extern s32 mp_char_prev_select_player[4]; + //CODE.bss:80069730 -extern s32 dword_CODE_bss_80069730; -//CODE.bss:80069734 -extern s32 dword_CODE_bss_80069734; -//CODE.bss:80069738 -extern s32 dword_CODE_bss_80069738; -//CODE.bss:8006973C -extern s32 dword_CODE_bss_8006973C; +extern s32 dword_CODE_bss_80069730[4]; + //CODE.bss:80069740 extern s32 has_selected_char_player1; //CODE.bss:80069744 @@ -472,9 +457,9 @@ extern s32 highlight_aimadjustment; CODE.bss:800697F0 dword_CODE_bss_800697F0:.space 0x130 */ -extern s32 current_menu; -extern s32 menu_update; -extern s32 maybe_prev_menu; +extern MENU current_menu; +extern MENU menu_update; +extern MENU maybe_prev_menu; extern s32 menu_timer; extern s32 tab_1_selected; extern s32 tab_2_selected; @@ -489,7 +474,7 @@ extern f32 tab2_bottom_y_coord; extern s32 selected_folder_num; extern s32 selected_folder_num_copy; -extern s32 gamemode; +extern GAMEMODE gamemode; extern s32 selected_stage; extern s32 briefingpage; extern DIFFICULTY selected_difficulty; @@ -538,6 +523,8 @@ extern f32 slider_007_mode_health; extern f32 slider_007_mode_damage; extern f32 slider_007_mode_accuracy; + +extern struct mission_folder_setup mission_folder_setup_entries[]; /* dword_D_8002A9B0:.word 0xA0000000 dword_D_8002A9B4:.word 0x96000000 @@ -760,6 +747,7 @@ extern s32 unlock_weapon_select; extern s32 unlock_handicap; extern s32 unlock_control_style; extern s32 unlock_aim_sight; +extern struct solo_target_times solo_target_time_array[]; /* dword_D_8002B560:.word 0 solo_target_times <0, 160, 0> @@ -792,6 +780,6 @@ extern u32 intro_animation_count; extern u32 objinstance; extern u32 ptrobjinstance; extern u32 full_actor_intro; -void set_menu_to_mode(MENU menu, u32 mode); +void set_menu_to_mode(MENU menu, s32 mode); #endif diff --git a/src/game/matrixmath.c b/src/game/matrixmath.c index 7e1612cf..70f9a0a9 100644 --- a/src/game/matrixmath.c +++ b/src/game/matrixmath.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include "matrixmath.h" // bss //CODE.bss:80075DA0 @@ -17,216 +17,101 @@ f32 D_80032310[2] = {65536.0f, 65536.0f}; // rodata //D:800536F0 -typedef f32 vec3[3]; -typedef f32 mat44[4][4]; - -void matrix_4x4_set_identity(mat44 matrix) { - matrix[0][0] = 1.0f; - matrix[0][1] = 0.0f; - matrix[0][2] = 0.0f; - matrix[0][3] = 0.0f; - matrix[1][0] = 0.0f; - matrix[1][1] = 1.0f; - matrix[1][2] = 0.0f; - matrix[1][3] = 0.0f; - matrix[2][0] = 0.0f; - matrix[2][1] = 0.0f; - matrix[2][2] = 1.0f; - matrix[2][3] = 0.0f; - matrix[3][0] = 0.0f; - matrix[3][1] = 0.0f; - matrix[3][2] = 0.0f; - matrix[3][3] = 1.0f; +void matrix_4x4_set_identity(Mtxf *matrix) { + matrix->m[0][0] = 1.0f; + matrix->m[0][1] = 0.0f; + matrix->m[0][2] = 0.0f; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = 0.0f; + matrix->m[1][1] = 1.0f; + matrix->m[1][2] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = 0.0f; + matrix->m[2][1] = 0.0f; + matrix->m[2][2] = 1.0f; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[3][2] = 0.0f; + matrix->m[3][3] = 1.0f; } -void matrix_4x4_copy(mat44 src, mat44 dst) { - s32 i; - for (i = 0; i < 4; i++) { - dst[i][0] = src[i][0]; - dst[i][1] = src[i][1]; - dst[i][2] = src[i][2]; - dst[i][3] = src[i][3]; - } -} - -void matrix_4x4_multiply(mat44 lhs, mat44 rhs, mat44 result); - -void matrix_4x4_multiply_in_place(mat44 lhs, mat44 rhs) { - mat44 result; - matrix_4x4_multiply(lhs, rhs, result); - matrix_4x4_copy(result, rhs); -} - -void matrix_4x4_multiply_homogeneous_in_place(mat44 lhs, mat44 rhs) { - mat44 result; - matrix_4x4_multiply_homogeneous(lhs, rhs, result); - matrix_4x4_copy(result, rhs); -} - -#ifdef NONMATCHING -// 8cbf8: move v1,zero 8cbf8: move v1,zero -// 8cbfc: move t0,a0 r 8cbfc: move t1,a0 -// 8cc00: li t2,0x10 r 8cc00: li t3,0x10 -// 8cc04: li t1,4 r 8cc04: li t2,0x40 -// 8cc08: move v0,zero | 8cc08: addu a0,a2,v1 -// 8cc0c: addu a0,a2,v1 | 8cc0c: move a3,zero -// 8cc10: move a3,a1 r 8cc10: move t0,a1 -// 8cc14: lwc1 $f18,0(t0) r 8cc14: lwc1 $f18,0(t1) -// 8cc18: lwc1 $f16,0(a3) r 8cc18: lwc1 $f16,0(t0) -// 8cc1c: lwc1 $f14,0x10(t0) r 8cc1c: lwc1 $f14,0x10(t1) -// 8cc20: lwc1 $f12,4(a3) r 8cc20: lwc1 $f12,4(t0) -// 8cc24: mul.s $f16,$f18,$f16 8cc24: mul.s $f16,$f18,$f16 -// 8cc28: lwc1 $f18,0x20(t0) r 8cc28: lwc1 $f18,0x20(t1) -// 8cc2c: lwc1 $f10,8(a3) r 8cc2c: lwc1 $f10,8(t0) -// 8cc30: mul.s $f12,$f14,$f12 8cc30: mul.s $f12,$f14,$f12 -// 8cc34: lwc1 $f14,0xc(a3) r 8cc34: lwc1 $f14,0xc(t0) -// 8cc38: lwc1 $f8,0x30(t0) r 8cc38: lwc1 $f8,0x30(t1) -// 8cc3c: mul.s $f10,$f18,$f10 8cc3c: mul.s $f10,$f18,$f10 -// 8cc40: addiu v0,v0,2 r 8cc40: addiu a3,a3,0x20 -// 8cc44: addiu a0,a0,0x20 8cc44: addiu a0,a0,0x20 -// 8cc48: mul.s $f8,$f14,$f8 8cc48: mul.s $f8,$f14,$f8 -// 8cc4c: addiu a3,a3,0x20 r 8cc4c: addiu t0,t0,0x20 -// 8cc50: add.s $f12,$f16,$f12 8cc50: add.s $f12,$f16,$f12 -// 8cc54: add.s $f10,$f12,$f10 8cc54: add.s $f10,$f12,$f10 -// 8cc58: add.s $f10,$f8,$f10 8cc58: add.s $f10,$f8,$f10 -// 8cc5c: swc1 $f10,-0x20(a0) 8cc5c: swc1 $f10,-0x20(a0) -// 8cc60: lwc1 $f10,0(t0) r 8cc60: lwc1 $f10,0(t1) -// 8cc64: lwc1 $f8,-0x10(a3) r 8cc64: lwc1 $f8,-0x10(t0) -// 8cc68: lwc1 $f12,0x10(t0) r 8cc68: lwc1 $f12,0x10(t1) -// 8cc6c: lwc1 $f16,-0xc(a3) r 8cc6c: lwc1 $f16,-0xc(t0) -// 8cc70: mul.s $f8,$f10,$f8 8cc70: mul.s $f8,$f10,$f8 -// 8cc74: lwc1 $f10,0x20(t0) r 8cc74: lwc1 $f10,0x20(t1) -// 8cc78: lwc1 $f14,-8(a3) r 8cc78: lwc1 $f14,-8(t0) -// 8cc7c: mul.s $f16,$f12,$f16 8cc7c: mul.s $f16,$f12,$f16 -// 8cc80: lwc1 $f12,-4(a3) r 8cc80: lwc1 $f12,-4(t0) -// 8cc84: lwc1 $f18,0x30(t0) r 8cc84: lwc1 $f18,0x30(t1) -// 8cc88: mul.s $f14,$f10,$f14 8cc88: mul.s $f14,$f10,$f14 -// 8cc8c: nop 8cc8c: nop -// 8cc90: mul.s $f18,$f12,$f18 8cc90: mul.s $f18,$f12,$f18 -// 8cc94: add.s $f16,$f8,$f16 8cc94: add.s $f16,$f8,$f16 -// 8cc98: add.s $f14,$f16,$f14 8cc98: add.s $f14,$f16,$f14 -// 8cc9c: add.s $f14,$f18,$f14 8cc9c: add.s $f14,$f18,$f14 -// 8cca0: bne v0,t1,0x8cc14 ~> r 8cca0: bne a3,t2,0x8cc14 ~> -// 8cca4: swc1 $f14,-0x10(a0) 8cca4: swc1 $f14,-0x10(a0) -// 8cca8: addiu v1,v1,4 8cca8: addiu v1,v1,4 -// 8ccac: bne v1,t2,0x8cc08 ~> r 8ccac: bne v1,t3,0x8cc08 ~> -// 8ccb0: addiu t0,t0,4 r 8ccb0: addiu t1,t1,4 -// 8ccb4: jr ra 8ccb4: jr ra -void matrix_4x4_multiply(mat44 lhs, mat44 rhs, mat44 result) { +void matrix_4x4_copy(Mtxf *src, Mtxf *dst) { s32 i, j; for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j += 2) { - result[j + 0][i] = lhs[0][i] * rhs[j + 0][0] + lhs[1][i] * rhs[j + 0][1] + lhs[2][i] * rhs[j + 0][2] + lhs[3][i] * rhs[j + 0][3]; - result[j + 1][i] = lhs[0][i] * rhs[j + 1][0] + lhs[1][i] * rhs[j + 1][1] + lhs[2][i] * rhs[j + 1][2] + lhs[3][i] * rhs[j + 1][3]; + for (j = 0; j < 4; j++) { + dst->m[i][j] = src->m[i][j]; } } } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_multiply -/* 08CBF8 7F0580C8 00001825 */ move $v1, $zero -/* 08CBFC 7F0580CC 00804025 */ move $t0, $a0 -/* 08CC00 7F0580D0 240A0010 */ li $t2, 16 -/* 08CC04 7F0580D4 24090004 */ li $t1, 4 -.L7F0580D8: -/* 08CC08 7F0580D8 00001025 */ move $v0, $zero -/* 08CC0C 7F0580DC 00C32021 */ addu $a0, $a2, $v1 -/* 08CC10 7F0580E0 00A03825 */ move $a3, $a1 -.L7F0580E4: -/* 08CC14 7F0580E4 C5120000 */ lwc1 $f18, ($t0) -/* 08CC18 7F0580E8 C4F00000 */ lwc1 $f16, ($a3) -/* 08CC1C 7F0580EC C50E0010 */ lwc1 $f14, 0x10($t0) -/* 08CC20 7F0580F0 C4EC0004 */ lwc1 $f12, 4($a3) -/* 08CC24 7F0580F4 46109402 */ mul.s $f16, $f18, $f16 -/* 08CC28 7F0580F8 C5120020 */ lwc1 $f18, 0x20($t0) -/* 08CC2C 7F0580FC C4EA0008 */ lwc1 $f10, 8($a3) -/* 08CC30 7F058100 460C7302 */ mul.s $f12, $f14, $f12 -/* 08CC34 7F058104 C4EE000C */ lwc1 $f14, 0xc($a3) -/* 08CC38 7F058108 C5080030 */ lwc1 $f8, 0x30($t0) -/* 08CC3C 7F05810C 460A9282 */ mul.s $f10, $f18, $f10 -/* 08CC40 7F058110 24420002 */ addiu $v0, $v0, 2 -/* 08CC44 7F058114 24840020 */ addiu $a0, $a0, 0x20 -/* 08CC48 7F058118 46087202 */ mul.s $f8, $f14, $f8 -/* 08CC4C 7F05811C 24E70020 */ addiu $a3, $a3, 0x20 -/* 08CC50 7F058120 460C8300 */ add.s $f12, $f16, $f12 -/* 08CC54 7F058124 460A6280 */ add.s $f10, $f12, $f10 -/* 08CC58 7F058128 460A4280 */ add.s $f10, $f8, $f10 -/* 08CC5C 7F05812C E48AFFE0 */ swc1 $f10, -0x20($a0) -/* 08CC60 7F058130 C50A0000 */ lwc1 $f10, ($t0) -/* 08CC64 7F058134 C4E8FFF0 */ lwc1 $f8, -0x10($a3) -/* 08CC68 7F058138 C50C0010 */ lwc1 $f12, 0x10($t0) -/* 08CC6C 7F05813C C4F0FFF4 */ lwc1 $f16, -0xc($a3) -/* 08CC70 7F058140 46085202 */ mul.s $f8, $f10, $f8 -/* 08CC74 7F058144 C50A0020 */ lwc1 $f10, 0x20($t0) -/* 08CC78 7F058148 C4EEFFF8 */ lwc1 $f14, -8($a3) -/* 08CC7C 7F05814C 46106402 */ mul.s $f16, $f12, $f16 -/* 08CC80 7F058150 C4ECFFFC */ lwc1 $f12, -4($a3) -/* 08CC84 7F058154 C5120030 */ lwc1 $f18, 0x30($t0) -/* 08CC88 7F058158 460E5382 */ mul.s $f14, $f10, $f14 -/* 08CC8C 7F05815C 00000000 */ nop -/* 08CC90 7F058160 46126482 */ mul.s $f18, $f12, $f18 -/* 08CC94 7F058164 46104400 */ add.s $f16, $f8, $f16 -/* 08CC98 7F058168 460E8380 */ add.s $f14, $f16, $f14 -/* 08CC9C 7F05816C 460E9380 */ add.s $f14, $f18, $f14 -/* 08CCA0 7F058170 1449FFDC */ bne $v0, $t1, .L7F0580E4 -/* 08CCA4 7F058174 E48EFFF0 */ swc1 $f14, -0x10($a0) -/* 08CCA8 7F058178 24630004 */ addiu $v1, $v1, 4 -/* 08CCAC 7F05817C 146AFFD6 */ bne $v1, $t2, .L7F0580D8 -/* 08CCB0 7F058180 25080004 */ addiu $t0, $t0, 4 -/* 08CCB4 7F058184 03E00008 */ jr $ra -/* 08CCB8 7F058188 00000000 */ nop -) -#endif -s32 matrix_4x4_multiply_homogeneous(mat44 lhs, mat44 rhs, mat44 result) { +void matrix_4x4_multiply(Mtxf *lhs, Mtxf *rhs, Mtxf *result); + +void matrix_4x4_multiply_in_place(Mtxf *lhs, Mtxf *rhs) { + Mtxf result; + matrix_4x4_multiply(lhs, rhs, &result); + matrix_4x4_copy(&result, rhs); +} + +void matrix_4x4_multiply_homogeneous_in_place(Mtxf *lhs, Mtxf *rhs) { + Mtxf result; + matrix_4x4_multiply_homogeneous(lhs, rhs, &result); + matrix_4x4_copy(&result, rhs); +} + +void matrix_4x4_multiply(Mtxf *lhs, Mtxf *rhs, Mtxf *result) { + s32 i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + result->m[j][i] = lhs->m[0][i] * rhs->m[j][0] + lhs->m[1][i] * rhs->m[j][1] + lhs->m[2][i] * rhs->m[j][2] + lhs->m[3][i] * rhs->m[j][3]; + } + } +} + +s32 matrix_4x4_multiply_homogeneous(Mtxf *lhs, Mtxf *rhs, Mtxf *result) { s32 i, j; for (i = 0; i < 3; i++) { - for (j = 0; j < 4; j += 2) { - result[j + 0][i] = (lhs[0][i] * rhs[j + 0][0]) + (lhs[1][i] * rhs[j + 0][1]) + (lhs[2][i] * rhs[j + 0][2]); + for (j = 0; j < 4; j++) { + result->m[j][i] = (lhs->m[0][i] * rhs->m[j][0]) + (lhs->m[1][i] * rhs->m[j][1]) + (lhs->m[2][i] * rhs->m[j][2]); if (j == 3) { - result[j + 0][i] += lhs[3][i]; - } - result[j + 1][i] = (lhs[0][i] * rhs[j + 1][0]) + (lhs[1][i] * rhs[j + 1][1]) + (lhs[2][i] * rhs[j + 1][2]); - if (j == 2) { - result[j + 1][i] += lhs[3][i]; + result->m[j][i] += lhs->m[3][i]; } } } - result[0][3] = 0.0f; - result[1][3] = 0.0f; - result[2][3] = 0.0f; - result[3][3] = 1.0f; + result->m[0][3] = 0.0f; + result->m[1][3] = 0.0f; + result->m[2][3] = 0.0f; + result->m[3][3] = 1.0f; } -void sub_GAME_7F058274(mat44 arg0, mat44 arg1, mat44 arg2) { - arg2[0][0] = (arg0[0][0] * arg1[0][0]); - arg2[1][0] = (arg0[0][0] * arg1[1][0]); - arg2[2][0] = (arg0[0][0] * arg1[2][0]); - arg2[3][0] = (arg0[0][0] * arg1[3][0]); - arg2[0][1] = (arg0[1][1] * arg1[0][1]); - arg2[1][1] = (arg0[1][1] * arg1[1][1]); - arg2[2][1] = (arg0[1][1] * arg1[2][1]); - arg2[3][1] = (arg0[1][1] * arg1[3][1]); - arg2[0][2] = (arg0[2][2] * arg1[0][2]); - arg2[1][2] = (arg0[2][2] * arg1[1][2]); - arg2[2][2] = (arg0[2][2] * arg1[2][2]); - arg2[3][2] = (arg0[2][2] * arg1[3][2]) + arg0[3][2]; - arg2[0][3] = (arg0[2][3] * arg1[0][2]); - arg2[1][3] = (arg0[2][3] * arg1[1][2]); - arg2[2][3] = (arg0[2][3] * arg1[2][2]); - arg2[3][3] = (arg0[2][3] * arg1[3][2]); +void matrix_4x4_7F058274(Mtxf *arg0, Mtxf *arg1, Mtxf *arg2) { + arg2->m[0][0] = (arg0->m[0][0] * arg1->m[0][0]); + arg2->m[1][0] = (arg0->m[0][0] * arg1->m[1][0]); + arg2->m[2][0] = (arg0->m[0][0] * arg1->m[2][0]); + arg2->m[3][0] = (arg0->m[0][0] * arg1->m[3][0]); + arg2->m[0][1] = (arg0->m[1][1] * arg1->m[0][1]); + arg2->m[1][1] = (arg0->m[1][1] * arg1->m[1][1]); + arg2->m[2][1] = (arg0->m[1][1] * arg1->m[2][1]); + arg2->m[3][1] = (arg0->m[1][1] * arg1->m[3][1]); + arg2->m[0][2] = (arg0->m[2][2] * arg1->m[0][2]); + arg2->m[1][2] = (arg0->m[2][2] * arg1->m[1][2]); + arg2->m[2][2] = (arg0->m[2][2] * arg1->m[2][2]); + arg2->m[3][2] = (arg0->m[2][2] * arg1->m[3][2]) + arg0->m[3][2]; + arg2->m[0][3] = (arg0->m[2][3] * arg1->m[0][2]); + arg2->m[1][3] = (arg0->m[2][3] * arg1->m[1][2]); + arg2->m[2][3] = (arg0->m[2][3] * arg1->m[2][2]); + arg2->m[3][3] = (arg0->m[2][3] * arg1->m[3][2]); } -void matrix_4x4_rotate_vector(mat44 matrix, vec3 vector, vec3 result) { +void matrix_4x4_rotate_vector(Mtxf *matrix, vec3 vector, vec3 result) { s32 i; for (i = 0; i < 3; i++) { - result[i] = matrix[0][i] * vector[0] + matrix[1][i] * vector[1] + matrix[2][i] * vector[2]; + result[i] = matrix->m[0][i] * vector[0] + matrix->m[1][i] * vector[1] + matrix->m[2][i] * vector[2]; } } -void matrix_4x4_rotate_vector_in_place(mat44 matrix, vec3 vector) { +void matrix_4x4_rotate_vector_in_place(Mtxf *matrix, vec3 vector) { vec3 result; matrix_4x4_rotate_vector(matrix, vector, result); vector[0] = result[0]; @@ -234,291 +119,170 @@ void matrix_4x4_rotate_vector_in_place(mat44 matrix, vec3 vector) { vector[2] = result[2]; } -void matrix_4x4_transform_vector(mat44 matrix, vec3 vector, vec3 result) { +void matrix_4x4_transform_vector(Mtxf *matrix, vec3 vector, vec3 result) { matrix_4x4_rotate_vector(matrix, vector, result); - result[0] += matrix[3][0]; - result[1] += matrix[3][1]; - result[2] += matrix[3][2]; + result[0] += matrix->m[3][0]; + result[1] += matrix->m[3][1]; + result[2] += matrix->m[3][2]; } -void matrix_4x4_transform_vector_in_place(mat44 matrix, vec3 vector) { +void matrix_4x4_transform_vector_in_place(Mtxf *matrix, vec3 vector) { matrix_4x4_rotate_vector_in_place(matrix, vector); - vector[0] += matrix[3][0]; - vector[1] += matrix[3][1]; - vector[2] += matrix[3][2]; + vector[0] += matrix->m[3][0]; + vector[1] += matrix->m[3][1]; + vector[2] += matrix->m[3][2]; } -void matrix_4x4_set_position_and_rotation_around_y(f32* position, f32 angle, mat44 matrix) { +void matrix_4x4_set_position_and_rotation_around_y(f32* position, f32 angle, Mtxf *matrix) { f32 cosine = cosf(angle); f32 sine = sinf(angle); - matrix[0][0] = cosine; - matrix[0][1] = 0.0f; - matrix[0][2] = -sine; - matrix[0][3] = 0.0f; - matrix[1][0] = 0.0f; - matrix[1][1] = 1.0f; - matrix[1][2] = 0.0f; - matrix[1][3] = 0.0f; - matrix[2][0] = sine; - matrix[2][1] = 0.0f; - matrix[2][2] = cosine; - matrix[2][3] = 0.0f; - matrix[3][0] = position[0]; - matrix[3][1] = position[1]; - matrix[3][2] = position[2]; - matrix[3][3] = 1.0f; + matrix->m[0][0] = cosine; + matrix->m[0][1] = 0.0f; + matrix->m[0][2] = -sine; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = 0.0f; + matrix->m[1][1] = 1.0f; + matrix->m[1][2] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = sine; + matrix->m[2][1] = 0.0f; + matrix->m[2][2] = cosine; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = position[0]; + matrix->m[3][1] = position[1]; + matrix->m[3][2] = position[2]; + matrix->m[3][3] = 1.0f; } -void matrix_4x4_set_rotation_around_x(f32 angle, mat44 matrix) { +void matrix_4x4_set_rotation_around_x(f32 angle, Mtxf *matrix) { f32 cosine = cosf(angle); f32 sine = sinf(angle); - matrix[0][0] = 1.0f; - matrix[0][1] = 0.0f; - matrix[0][2] = 0.0f; - matrix[0][3] = 0.0f; - matrix[1][0] = 0.0f; - matrix[1][1] = cosine; - matrix[1][2] = sine; - matrix[1][3] = 0.0f; - matrix[2][0] = 0.0f; - matrix[2][1] = -sine; - matrix[2][2] = cosine; - matrix[2][3] = 0.0f; - matrix[3][0] = 0.0f; - matrix[3][1] = 0.0f; - matrix[3][2] = 0.0f; - matrix[3][3] = 1.0f; + matrix->m[0][0] = 1.0f; + matrix->m[0][1] = 0.0f; + matrix->m[0][2] = 0.0f; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = 0.0f; + matrix->m[1][1] = cosine; + matrix->m[1][2] = sine; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = 0.0f; + matrix->m[2][1] = -sine; + matrix->m[2][2] = cosine; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[3][2] = 0.0f; + matrix->m[3][3] = 1.0f; } -void matrix_4x4_set_rotation_around_y(f32 angle, mat44 matrix) { +void matrix_4x4_set_rotation_around_y(f32 angle, Mtxf *matrix) { f32 cosine = cosf(angle); f32 sine = sinf(angle); - matrix[0][0] = cosine; - matrix[0][1] = 0.0f; - matrix[0][2] = -sine; - matrix[0][3] = 0.0f; - matrix[1][0] = 0.0f; - matrix[1][1] = 1.0f; - matrix[1][2] = 0.0f; - matrix[1][3] = 0.0f; - matrix[2][0] = sine; - matrix[2][1] = 0.0f; - matrix[2][2] = cosine; - matrix[2][3] = 0.0f; - matrix[3][0] = 0.0f; - matrix[3][1] = 0.0f; - matrix[3][2] = 0.0f; - matrix[3][3] = 1.0f; + matrix->m[0][0] = cosine; + matrix->m[0][1] = 0.0f; + matrix->m[0][2] = -sine; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = 0.0f; + matrix->m[1][1] = 1.0f; + matrix->m[1][2] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = sine; + matrix->m[2][1] = 0.0f; + matrix->m[2][2] = cosine; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[3][2] = 0.0f; + matrix->m[3][3] = 1.0f; } -void matrix_4x4_set_rotation_around_z(f32 angle, mat44 matrix) { +void matrix_4x4_set_rotation_around_z(f32 angle, Mtxf *matrix) { f32 cosine = cosf(angle); f32 sine = sinf(angle); - matrix[0][0] = cosine; - matrix[0][1] = sine; - matrix[0][2] = 0.0f; - matrix[0][3] = 0.0f; - matrix[1][0] = -sine; - matrix[1][1] = cosine; - matrix[1][2] = 0.0f; - matrix[1][3] = 0.0f; - matrix[2][0] = 0.0f; - matrix[2][1] = 0.0f; - matrix[2][2] = 1.0f; - matrix[2][3] = 0.0f; - matrix[3][0] = 0.0f; - matrix[3][1] = 0.0f; - matrix[3][2] = 0.0f; - matrix[3][3] = 1.0f; + matrix->m[0][0] = cosine; + matrix->m[0][1] = sine; + matrix->m[0][2] = 0.0f; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = -sine; + matrix->m[1][1] = cosine; + matrix->m[1][2] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = 0.0f; + matrix->m[2][1] = 0.0f; + matrix->m[2][2] = 1.0f; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[3][2] = 0.0f; + matrix->m[3][3] = 1.0f; } -#ifdef NONMATCHING -// 8d300: lwc1 $f10,0x54(sp) r 8d300: lwc1 $f8,0x54(sp) -// 8d304: mul.s $f18,$f4,$f0 r 8d304: mul.s $f10,$f4,$f0 -// 8d308: nop 8d308: nop -// 8d30c: mul.s $f8,$f10,$f16 r 8d30c: mul.s $f18,$f8,$f16 -// 8d310: nop 8d310: nop -// 8d314: mul.s $f6,$f18,$f2 r 8d314: mul.s $f6,$f10,$f2 -// 8d318: swc1 $f8,0x20(sp) r 8d318: swc1 $f10,0x20(sp) -// 8d31c: add.s $f4,$f6,$f8 r 8d31c: add.s $f4,$f6,$f18 -// 8d320: swc1 $f4,0x14(s0) 8d320: swc1 $f4,0x14(s0) -// 8d324: lwc1 $f10,0x50(sp) r 8d324: lwc1 $f8,0x50(sp) -// 8d328: swc1 $f12,0x1c(s0) 8d328: swc1 $f12,0x1c(s0) -// 8d32c: mul.s $f6,$f10,$f14 r 8d32c: mul.s $f10,$f8,$f14 -// 8d330: swc1 $f6,0x18(s0) r 8d330: swc1 $f10,0x18(s0) -// 8d334: lwc1 $f8,0x20(sp) | 8d334: mul.s $f6,$f18,$f2 -// 8d338: mul.s $f4,$f8,$f2 | 8d338: lwc1 $f4,0x20(sp) -// 8d33c: add.s $f10,$f4,$f18 r 8d33c: add.s $f8,$f6,$f4 -// 8d340: swc1 $f10,0x20(s0) r 8d340: swc1 $f8,0x20(s0) -// 8d344: lwc1 $f6,0x28(sp) r 8d344: lwc1 $f10,0x28(sp) -// 8d348: lwc1 $f4,0x24(sp) 8d348: lwc1 $f4,0x24(sp) -// 8d34c: mul.s $f8,$f6,$f2 r 8d34c: mul.s $f6,$f10,$f2 -// 8d350: sub.s $f10,$f8,$f4 r 8d350: sub.s $f8,$f6,$f4 -// 8d354: mtc1 at,$f4 8d354: mtc1 at,$f4 -// 8d358: swc1 $f10,0x24(s0) r 8d358: swc1 $f8,0x24(s0) -// 8d35c: lwc1 $f6,0x54(sp) r 8d35c: lwc1 $f10,0x54(sp) -// 8d360: swc1 $f12,0x2c(s0) 8d360: swc1 $f12,0x2c(s0) -// 8d364: swc1 $f12,0x30(s0) 8d364: swc1 $f12,0x30(s0) -// 8d368: mul.s $f8,$f6,$f14 r 8d368: mul.s $f6,$f10,$f14 -// 8d36c: swc1 $f12,0x34(s0) 8d36c: swc1 $f12,0x34(s0) -// 8d370: swc1 $f12,0x38(s0) 8d370: swc1 $f12,0x38(s0) -// 8d374: swc1 $f4,0x3c(s0) 8d374: swc1 $f4,0x3c(s0) -// 8d378: swc1 $f8,0x28(s0) r 8d378: swc1 $f6,0x28(s0) -// void matrix_4x4_set_rotation_around_xyz(vec3 angles, mat44 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_cos_z = cos_x * cos_z; -// f32 cos_x_sin_z = cos_x * sin_z; -// f32 sin_x_cos_z = sin_x * cos_z; -// f32 sin_x_sin_z = sin_x * sin_z; -// matrix[0][0] = (cos_y * cos_z); -// matrix[0][1] = (cos_y * sin_z); -// matrix[0][2] = -sin_y; -// matrix[0][3] = 0.0f; -// matrix[1][0] = ((sin_x_cos_z * sin_y) - cos_x_sin_z); -// matrix[1][1] = ((sin_x_sin_z * sin_y) + cos_x_cos_z); -// matrix[1][2] = sin_x * cos_y; -// matrix[1][3] = 0.0f; -// matrix[2][0] = ((cos_x_cos_z * sin_y) + sin_x_sin_z); -// matrix[2][1] = ((cos_x_sin_z * sin_y) - sin_x_cos_z); -// matrix[2][2] = cos_x * cos_y; -// matrix[2][3] = 0.0f; -// matrix[3][0] = 0.0f; -// matrix[3][1] = 0.0f; -// matrix[3][2] = 0.0f; -// matrix[3][3] = 1.0f; -// } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_set_rotation_around_xyz -/* 08D244 7F058714 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 08D248 7F058718 AFBF001C */ sw $ra, 0x1c($sp) -/* 08D24C 7F05871C AFB10018 */ sw $s1, 0x18($sp) -/* 08D250 7F058720 AFB00014 */ sw $s0, 0x14($sp) -/* 08D254 7F058724 00A08025 */ move $s0, $a1 -/* 08D258 7F058728 00808825 */ move $s1, $a0 -/* 08D25C 7F05872C 0FC15FA8 */ jal cosf -/* 08D260 7F058730 C48C0000 */ lwc1 $f12, ($a0) -/* 08D264 7F058734 E7A00054 */ swc1 $f0, 0x54($sp) -/* 08D268 7F058738 0FC15FAB */ jal sinf -/* 08D26C 7F05873C C62C0000 */ lwc1 $f12, ($s1) -/* 08D270 7F058740 E7A00050 */ swc1 $f0, 0x50($sp) -/* 08D274 7F058744 0FC15FA8 */ jal cosf -/* 08D278 7F058748 C62C0004 */ lwc1 $f12, 4($s1) -/* 08D27C 7F05874C C62C0004 */ lwc1 $f12, 4($s1) -/* 08D280 7F058750 0FC15FAB */ jal sinf -/* 08D284 7F058754 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 08D288 7F058758 C62C0008 */ lwc1 $f12, 8($s1) -/* 08D28C 7F05875C 0FC15FA8 */ jal cosf -/* 08D290 7F058760 E7A00048 */ swc1 $f0, 0x48($sp) -/* 08D294 7F058764 C62C0008 */ lwc1 $f12, 8($s1) -/* 08D298 7F058768 0FC15FAB */ jal sinf -/* 08D29C 7F05876C E7A00044 */ swc1 $f0, 0x44($sp) -/* 08D2A0 7F058770 C7AE004C */ lwc1 $f14, 0x4c($sp) -/* 08D2A4 7F058774 C7B00044 */ lwc1 $f16, 0x44($sp) -/* 08D2A8 7F058778 C7A20048 */ lwc1 $f2, 0x48($sp) -/* 08D2AC 7F05877C 44806000 */ mtc1 $zero, $f12 -/* 08D2B0 7F058780 46107102 */ mul.s $f4, $f14, $f16 -/* 08D2B4 7F058784 46001207 */ neg.s $f8, $f2 -/* 08D2B8 7F058788 E60C000C */ swc1 $f12, 0xc($s0) -/* 08D2BC 7F05878C 46007182 */ mul.s $f6, $f14, $f0 -/* 08D2C0 7F058790 E6080008 */ swc1 $f8, 8($s0) -/* 08D2C4 7F058794 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08D2C8 7F058798 E6040000 */ swc1 $f4, ($s0) -/* 08D2CC 7F05879C E6060004 */ swc1 $f6, 4($s0) -/* 08D2D0 7F0587A0 C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 08D2D4 7F0587A4 C7A60054 */ lwc1 $f6, 0x54($sp) -/* 08D2D8 7F0587A8 46105102 */ mul.s $f4, $f10, $f16 -/* 08D2DC 7F0587AC 00000000 */ nop -/* 08D2E0 7F0587B0 46003202 */ mul.s $f8, $f6, $f0 -/* 08D2E4 7F0587B4 00000000 */ nop -/* 08D2E8 7F0587B8 46022282 */ mul.s $f10, $f4, $f2 -/* 08D2EC 7F0587BC E7A40024 */ swc1 $f4, 0x24($sp) -/* 08D2F0 7F0587C0 E7A80028 */ swc1 $f8, 0x28($sp) -/* 08D2F4 7F0587C4 46085181 */ sub.s $f6, $f10, $f8 -/* 08D2F8 7F0587C8 E6060010 */ swc1 $f6, 0x10($s0) -/* 08D2FC 7F0587CC C7A40050 */ lwc1 $f4, 0x50($sp) -/* 08D300 7F0587D0 C7AA0054 */ lwc1 $f10, 0x54($sp) -/* 08D304 7F0587D4 46002482 */ mul.s $f18, $f4, $f0 -/* 08D308 7F0587D8 00000000 */ nop -/* 08D30C 7F0587DC 46105202 */ mul.s $f8, $f10, $f16 -/* 08D310 7F0587E0 00000000 */ nop -/* 08D314 7F0587E4 46029182 */ mul.s $f6, $f18, $f2 -/* 08D318 7F0587E8 E7A80020 */ swc1 $f8, 0x20($sp) -/* 08D31C 7F0587EC 46083100 */ add.s $f4, $f6, $f8 -/* 08D320 7F0587F0 E6040014 */ swc1 $f4, 0x14($s0) -/* 08D324 7F0587F4 C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 08D328 7F0587F8 E60C001C */ swc1 $f12, 0x1c($s0) -/* 08D32C 7F0587FC 460E5182 */ mul.s $f6, $f10, $f14 -/* 08D330 7F058800 E6060018 */ swc1 $f6, 0x18($s0) -/* 08D334 7F058804 C7A80020 */ lwc1 $f8, 0x20($sp) -/* 08D338 7F058808 46024102 */ mul.s $f4, $f8, $f2 -/* 08D33C 7F05880C 46122280 */ add.s $f10, $f4, $f18 -/* 08D340 7F058810 E60A0020 */ swc1 $f10, 0x20($s0) -/* 08D344 7F058814 C7A60028 */ lwc1 $f6, 0x28($sp) -/* 08D348 7F058818 C7A40024 */ lwc1 $f4, 0x24($sp) -/* 08D34C 7F05881C 46023202 */ mul.s $f8, $f6, $f2 -/* 08D350 7F058820 46044281 */ sub.s $f10, $f8, $f4 -/* 08D354 7F058824 44812000 */ mtc1 $at, $f4 -/* 08D358 7F058828 E60A0024 */ swc1 $f10, 0x24($s0) -/* 08D35C 7F05882C C7A60054 */ lwc1 $f6, 0x54($sp) -/* 08D360 7F058830 E60C002C */ swc1 $f12, 0x2c($s0) -/* 08D364 7F058834 E60C0030 */ swc1 $f12, 0x30($s0) -/* 08D368 7F058838 460E3202 */ mul.s $f8, $f6, $f14 -/* 08D36C 7F05883C E60C0034 */ swc1 $f12, 0x34($s0) -/* 08D370 7F058840 E60C0038 */ swc1 $f12, 0x38($s0) -/* 08D374 7F058844 E604003C */ swc1 $f4, 0x3c($s0) -/* 08D378 7F058848 E6080028 */ swc1 $f8, 0x28($s0) -/* 08D37C 7F05884C 8FBF001C */ lw $ra, 0x1c($sp) -/* 08D380 7F058850 8FB10018 */ lw $s1, 0x18($sp) -/* 08D384 7F058854 8FB00014 */ lw $s0, 0x14($sp) -/* 08D388 7F058858 03E00008 */ jr $ra -/* 08D38C 7F05885C 27BD0058 */ addiu $sp, $sp, 0x58 -) -#endif +void matrix_4x4_set_rotation_around_xyz(vec3 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 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; + f32 cos_x_cos_z = cos_x * cos_z; + matrix->m[0][0] = (cos_y * cos_z); + matrix->m[0][1] = (cos_y * sin_z); + matrix->m[0][2] = -sin_y; + matrix->m[0][3] = 0.0f; + matrix->m[1][0] = ((sin_x_cos_z * sin_y) - cos_x_sin_z); + matrix->m[1][1] = ((sin_x_sin_z * sin_y) + cos_x_cos_z); + matrix->m[1][2] = sin_x * cos_y; + matrix->m[1][3] = 0.0f; + matrix->m[2][0] = ((cos_x_cos_z * sin_y) + sin_x_sin_z); + matrix->m[2][1] = ((cos_x_sin_z * sin_y) - sin_x_cos_z); + matrix->m[2][2] = cos_x * cos_y; + matrix->m[2][3] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[3][2] = 0.0f; + matrix->m[3][3] = 1.0f; +} f32 atan2f(f32, f32); #define EPSILON 0.0000019073486f // https://stackoverflow.com/a/15029416 -void matrix_4x4_get_rotation_around_xyz(mat44 matrix, vec3 angles) { +void matrix_4x4_get_rotation_around_xyz(Mtxf *matrix, vec3 angles) { f32 norm; - f32 sin_x_cos_y = matrix[1][2]; - f32 cos_x_cos_y = matrix[2][2]; + f32 sin_x_cos_y = matrix->m[1][2]; + f32 cos_x_cos_y = matrix->m[2][2]; norm = sqrtf((sin_x_cos_y * sin_x_cos_y) + (cos_x_cos_y * cos_x_cos_y)); if (EPSILON < norm) { - angles[0] = atan2f(matrix[1][2], matrix[2][2]); - angles[1] = atan2f(-matrix[0][2], norm); - angles[2] = atan2f(matrix[0][1], matrix[0][0]); + 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]); } else { angles[0] = 0.0f; - angles[1] = atan2f(-matrix[0][2], norm); - angles[2] = atan2f(-matrix[1][0], matrix[1][1]); + angles[1] = atan2f(-matrix->m[0][2], norm); + angles[2] = atan2f(-matrix->m[1][0], matrix->m[1][1]); } } -void matrix_4x4_set_position(vec3 position, mat44 matrix); +void matrix_4x4_set_position(vec3 position, Mtxf *matrix); -void matrix_4x4_set_position_and_rotation_around_xyz(vec3 position, vec3 rotation, mat44 matrix) { +void matrix_4x4_set_position_and_rotation_around_xyz(vec3 position, vec3 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, mat44 matrix) { +void matrix_4x4_set_identity_and_position(vec3 position, Mtxf *matrix) { matrix_4x4_set_identity(matrix); matrix_4x4_set_position(position, matrix); } -void matrix_4x4_set_position(vec3 position, mat44 matrix) { - matrix[3][0] = position[0]; - matrix[3][1] = position[1]; - matrix[3][2] = position[2]; +void matrix_4x4_set_position(vec3 position, Mtxf *matrix) { + matrix->m[3][0] = position[0]; + matrix->m[3][1] = position[1]; + matrix->m[3][2] = position[2]; } void matrix_column_1_scalar_multiply(f32 scalar, f32* matrix) { @@ -595,16 +359,16 @@ void matrix_scalar_multiply_3(f32 scalar, f32* matrix) { matrix[14] *= scalar; } -void sub_GAME_7F058C4C(f32 arg0) { +void matrix_4x4_7F058C4C(f32 arg0) { D_80032310[0] = (65536.0f * arg0); } -void sub_GAME_7F058C64(void) { +void matrix_4x4_7F058C64(void) { flt_CODE_bss_80075DA0 = D_80032310[0]; D_80032310[0] = 65536.0f; } -void sub_GAME_7F058C88(void) { +void matrix_4x4_7F058C88(void) { D_80032310[0] = flt_CODE_bss_80075DA0; } @@ -617,7 +381,26 @@ void sub_GAME_7F058C88(void) { // var2 = (s32)(matrix[(index) * 2 + 1] * D_80032310[(index) & 1]); \ // result[index + 0] = GET_HIGH_S16(var1, var2); \ // result[index + 8] = GET_LOW_S16(var1, var2); -// void sub_GAME_7F058C9C(f32* matrix, s32* result) { +#define FTOFIX32(x) (long)((x) * D_80032310[0]) + +void sub_GAME_7F058C9C(f32 mf[4][4], s32 ms[4][4]) { + int i, j; + int e1,e2; + int *ai,*af; + + ai=(int*)&ms[0][0]; + af=(int*)&ms[2][0]; + + for (i=0; i<4; i++) + for (j=0; j<2; j++) { + e1=FTOFIX32(mf[i][j*2]); + e2=FTOFIX32(mf[i][j*2+1]); + *(ai++) = (e1 & 0xffff0000 ) | ((e2 >> 16)&0xffff); + *(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff); + } +} + + // // s32 i; // // s32 x; // // s32 y; @@ -921,175 +704,203 @@ glabel sub_GAME_7F058E78 ) #endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F059044(void) { - +void matrix_4x4_7F059044(Mtxf *arg0, Mtx* arg1) { + s32 i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + arg1->m[i][j] = arg0->m[i][j] * 65536.0f; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F059044 -/* 08DB74 7F059044 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 08DB78 7F059048 00803025 */ move $a2, $a0 -/* 08DB7C 7F05904C 44810000 */ mtc1 $at, $f0 -/* 08DB80 7F059050 24040004 */ li $a0, 4 -/* 08DB84 7F059054 00001025 */ move $v0, $zero -/* 08DB88 7F059058 00A01825 */ move $v1, $a1 -/* 08DB8C 7F05905C C4D00000 */ lwc1 $f16, ($a2) -/* 08DB90 7F059060 24420001 */ addiu $v0, $v0, 1 -/* 08DB94 7F059064 46008482 */ mul.s $f18, $f16, $f0 -/* 08DB98 7F059068 5044001F */ beql $v0, $a0, .L7F0590E8 -/* 08DB9C 7F05906C 4600940D */ trunc.w.s $f16, $f18 -/* 08DBA0 7F059070 4600940D */ trunc.w.s $f16, $f18 -.L7F059074: -/* 08DBA4 7F059074 24420001 */ addiu $v0, $v0, 1 -/* 08DBA8 7F059078 24630010 */ addiu $v1, $v1, 0x10 -/* 08DBAC 7F05907C 24C60010 */ addiu $a2, $a2, 0x10 -/* 08DBB0 7F059080 440F8000 */ mfc1 $t7, $f16 -/* 08DBB4 7F059084 00000000 */ nop -/* 08DBB8 7F059088 AC6FFFF0 */ sw $t7, -0x10($v1) -/* 08DBBC 7F05908C C4D0FFF4 */ lwc1 $f16, -0xc($a2) -/* 08DBC0 7F059090 46008402 */ mul.s $f16, $f16, $f0 -/* 08DBC4 7F059094 4600840D */ trunc.w.s $f16, $f16 -/* 08DBC8 7F059098 44198000 */ mfc1 $t9, $f16 -/* 08DBCC 7F05909C 00000000 */ nop -/* 08DBD0 7F0590A0 AC79FFF4 */ sw $t9, -0xc($v1) -/* 08DBD4 7F0590A4 C4D0FFF8 */ lwc1 $f16, -8($a2) -/* 08DBD8 7F0590A8 46008402 */ mul.s $f16, $f16, $f0 -/* 08DBDC 7F0590AC 4600840D */ trunc.w.s $f16, $f16 -/* 08DBE0 7F0590B0 44098000 */ mfc1 $t1, $f16 -/* 08DBE4 7F0590B4 00000000 */ nop -/* 08DBE8 7F0590B8 AC69FFF8 */ sw $t1, -8($v1) -/* 08DBEC 7F0590BC C4D0FFFC */ lwc1 $f16, -4($a2) -/* 08DBF0 7F0590C0 46008402 */ mul.s $f16, $f16, $f0 -/* 08DBF4 7F0590C4 4600840D */ trunc.w.s $f16, $f16 -/* 08DBF8 7F0590C8 440B8000 */ mfc1 $t3, $f16 -/* 08DBFC 7F0590CC 00000000 */ nop -/* 08DC00 7F0590D0 AC6BFFFC */ sw $t3, -4($v1) -/* 08DC04 7F0590D4 C4D00000 */ lwc1 $f16, ($a2) -/* 08DC08 7F0590D8 46008482 */ mul.s $f18, $f16, $f0 -/* 08DC0C 7F0590DC 5444FFE5 */ bnel $v0, $a0, .L7F059074 -/* 08DC10 7F0590E0 4600940D */ trunc.w.s $f16, $f18 -/* 08DC14 7F0590E4 4600940D */ trunc.w.s $f16, $f18 -.L7F0590E8: -/* 08DC18 7F0590E8 24630010 */ addiu $v1, $v1, 0x10 -/* 08DC1C 7F0590EC 24C60010 */ addiu $a2, $a2, 0x10 -/* 08DC20 7F0590F0 440F8000 */ mfc1 $t7, $f16 -/* 08DC24 7F0590F4 00000000 */ nop -/* 08DC28 7F0590F8 AC6FFFF0 */ sw $t7, -0x10($v1) -/* 08DC2C 7F0590FC C4D0FFF4 */ lwc1 $f16, -0xc($a2) -/* 08DC30 7F059100 46008402 */ mul.s $f16, $f16, $f0 -/* 08DC34 7F059104 4600840D */ trunc.w.s $f16, $f16 -/* 08DC38 7F059108 44198000 */ mfc1 $t9, $f16 -/* 08DC3C 7F05910C 00000000 */ nop -/* 08DC40 7F059110 AC79FFF4 */ sw $t9, -0xc($v1) -/* 08DC44 7F059114 C4D0FFF8 */ lwc1 $f16, -8($a2) -/* 08DC48 7F059118 46008402 */ mul.s $f16, $f16, $f0 -/* 08DC4C 7F05911C 4600840D */ trunc.w.s $f16, $f16 -/* 08DC50 7F059120 44098000 */ mfc1 $t1, $f16 -/* 08DC54 7F059124 00000000 */ nop -/* 08DC58 7F059128 AC69FFF8 */ sw $t1, -8($v1) -/* 08DC5C 7F05912C C4D0FFFC */ lwc1 $f16, -4($a2) -/* 08DC60 7F059130 46008402 */ mul.s $f16, $f16, $f0 -/* 08DC64 7F059134 4600840D */ trunc.w.s $f16, $f16 -/* 08DC68 7F059138 440B8000 */ mfc1 $t3, $f16 -/* 08DC6C 7F05913C 00000000 */ nop -/* 08DC70 7F059140 AC6BFFFC */ sw $t3, -4($v1) -/* 08DC74 7F059144 03E00008 */ jr $ra -/* 08DC78 7F059148 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F05914C(void) { +void matrix_4x4_7F05914C(Mtx* arg0, Mtxf *arg1) { + s32 i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + arg1->m[i][j] = arg0->m[i][j] / 65536.0f; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05914C -/* 08DC7C 7F05914C 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 08DC80 7F059150 00803025 */ move $a2, $a0 -/* 08DC84 7F059154 44810000 */ mtc1 $at, $f0 -/* 08DC88 7F059158 24040004 */ li $a0, 4 -/* 08DC8C 7F05915C 00001025 */ move $v0, $zero -/* 08DC90 7F059160 00A01825 */ move $v1, $a1 -/* 08DC94 7F059164 24420001 */ addiu $v0, $v0, 1 -/* 08DC98 7F059168 1044001C */ beq $v0, $a0, .L7F0591DC -/* 08DC9C 7F05916C 8CCE0000 */ lw $t6, ($a2) -.L7F059170: -/* 08DCA0 7F059170 448E9000 */ mtc1 $t6, $f18 -/* 08DCA4 7F059174 24420001 */ addiu $v0, $v0, 1 -/* 08DCA8 7F059178 24630010 */ addiu $v1, $v1, 0x10 -/* 08DCAC 7F05917C 468094A0 */ cvt.s.w $f18, $f18 -/* 08DCB0 7F059180 24C60010 */ addiu $a2, $a2, 0x10 -/* 08DCB4 7F059184 46009483 */ div.s $f18, $f18, $f0 -/* 08DCB8 7F059188 E472FFF0 */ swc1 $f18, -0x10($v1) -/* 08DCBC 7F05918C 8CCFFFF4 */ lw $t7, -0xc($a2) -/* 08DCC0 7F059190 448F9000 */ mtc1 $t7, $f18 -/* 08DCC4 7F059194 00000000 */ nop -/* 08DCC8 7F059198 468094A0 */ cvt.s.w $f18, $f18 -/* 08DCCC 7F05919C 46009483 */ div.s $f18, $f18, $f0 -/* 08DCD0 7F0591A0 E472FFF4 */ swc1 $f18, -0xc($v1) -/* 08DCD4 7F0591A4 8CD8FFF8 */ lw $t8, -8($a2) -/* 08DCD8 7F0591A8 44989000 */ mtc1 $t8, $f18 -/* 08DCDC 7F0591AC 00000000 */ nop -/* 08DCE0 7F0591B0 468094A0 */ cvt.s.w $f18, $f18 -/* 08DCE4 7F0591B4 46009483 */ div.s $f18, $f18, $f0 -/* 08DCE8 7F0591B8 E472FFF8 */ swc1 $f18, -8($v1) -/* 08DCEC 7F0591BC 8CD9FFFC */ lw $t9, -4($a2) -/* 08DCF0 7F0591C0 44999000 */ mtc1 $t9, $f18 -/* 08DCF4 7F0591C4 00000000 */ nop -/* 08DCF8 7F0591C8 468094A0 */ cvt.s.w $f18, $f18 -/* 08DCFC 7F0591CC 46009483 */ div.s $f18, $f18, $f0 -/* 08DD00 7F0591D0 E472FFFC */ swc1 $f18, -4($v1) -/* 08DD04 7F0591D4 1444FFE6 */ bne $v0, $a0, .L7F059170 -/* 08DD08 7F0591D8 8CCE0000 */ lw $t6, ($a2) -.L7F0591DC: -/* 08DD0C 7F0591DC 448E9000 */ mtc1 $t6, $f18 -/* 08DD10 7F0591E0 24630010 */ addiu $v1, $v1, 0x10 -/* 08DD14 7F0591E4 24C60010 */ addiu $a2, $a2, 0x10 -/* 08DD18 7F0591E8 468094A0 */ cvt.s.w $f18, $f18 -/* 08DD1C 7F0591EC 46009483 */ div.s $f18, $f18, $f0 -/* 08DD20 7F0591F0 E472FFF0 */ swc1 $f18, -0x10($v1) -/* 08DD24 7F0591F4 8CCFFFF4 */ lw $t7, -0xc($a2) -/* 08DD28 7F0591F8 448F9000 */ mtc1 $t7, $f18 -/* 08DD2C 7F0591FC 00000000 */ nop -/* 08DD30 7F059200 468094A0 */ cvt.s.w $f18, $f18 -/* 08DD34 7F059204 46009483 */ div.s $f18, $f18, $f0 -/* 08DD38 7F059208 E472FFF4 */ swc1 $f18, -0xc($v1) -/* 08DD3C 7F05920C 8CD8FFF8 */ lw $t8, -8($a2) -/* 08DD40 7F059210 44989000 */ mtc1 $t8, $f18 -/* 08DD44 7F059214 00000000 */ nop -/* 08DD48 7F059218 468094A0 */ cvt.s.w $f18, $f18 -/* 08DD4C 7F05921C 46009483 */ div.s $f18, $f18, $f0 -/* 08DD50 7F059220 E472FFF8 */ swc1 $f18, -8($v1) -/* 08DD54 7F059224 8CD9FFFC */ lw $t9, -4($a2) -/* 08DD58 7F059228 44999000 */ mtc1 $t9, $f18 -/* 08DD5C 7F05922C 00000000 */ nop -/* 08DD60 7F059230 468094A0 */ cvt.s.w $f18, $f18 -/* 08DD64 7F059234 46009483 */ div.s $f18, $f18, $f0 -/* 08DD68 7F059238 E472FFFC */ swc1 $f18, -4($v1) -/* 08DD6C 7F05923C 03E00008 */ jr $ra -/* 08DD70 7F059240 00000000 */ nop -) -#endif + +//#ifdef NONMATCHING +#if 0 +#define MTX_INTPART_PACK(w1, w2) (((w1) & 0xFFFF0000) | ((w2) >> 16)) +#define MTX_FRACPART_PACK(w1, w2) (((w1) << 16) | ((w2) & 0xFFFF)) + +void sub_GAME_7F059244(Mtx* a0, Mtx* a1) { + // s32 i; + // s32 j; + // u32 w1; + // u32 w2; + // for (i = 0; i < 2; i++) { + // for (j = 0; j < 4; j++) { + // w1 = a0->m[i * 2 + j / 2][((j * 2) % 4) + 0]; + // w2 = a0->m[i * 2 + j / 2][((j * 2) % 4) + 1]; + // a1->m[i + 0][j] = MTX_INTPART_PACK(w1, w2); + // a1->m[i + 2][j] = MTX_FRACPART_PACK(w1, w2); + // } + // } + + // Reg alloc and iteration mostly! + // s32 i; + // s32 j; + // for (i = 0; i < 2; i++) { + // for (j = 0; j < 4; j++) { + // u32 w1 = a0[i * 2 + j / 2][(j % 2) * 2 + 0]; + // u32 w2 = a0[i * 2 + j / 2][(j % 2) * 2 + 1]; + // a1[i + 0][j] = MTX_INTPART_PACK(w1, w2); + // a1[i + 2][j] = MTX_FRACPART_PACK(w1, w2); + // } + // } + + // s32 i; + // s32 j; + // s32 *mtxInt = (s32 *)&a1[0][0]; + // s32 *mtxFrc = (s32 *)&a1[2][0]; + // for (i = 0; i < 8; i++) { + // *mtxInt++ = MTX_INTPART_PACK(a0[i * 2], (u32)a0[i * 2 + 1]); + // *mtxFrc++ = MTX_FRACPART_PACK(a0[i * 2], a0[i * 2 + 1]); + // } + + // s32 i; + // s32 j; + // s32 *mtxInt = (s32 *)&a1[0][0]; + // s32 *mtxFrc = (s32 *)&a1[2][0]; + // for (i = 0; i < 8; i++) { + // *mtxInt++ = MTX_INTPART_PACK(a0[i * 2], (u32)a0[i * 2 + 1]); + // *mtxFrc++ = MTX_FRACPART_PACK(a0[i * 2], a0[i * 2 + 1]); + // } + // s32 i; + // s32 j; + // for (i = 0; i < 2; i++) { + // for (j = 0; j < 4; j++) { + // a1[i + 0][j] = MTX_INTPART_PACK(a0[i * 8 + j * 2], (u32)a0[i * 8 + j*2 + 1]); + // a1[i + 2][j] = MTX_FRACPART_PACK(a0[i * 8 + j * 2], a0[i * 8 + j*2 + 1]); + // } + // } + + s32 i; + s32 j; + s32* ptr = &a0->m[0][0]; + for (i = 0; i < 2; i++) { + for (j = 0; j < 4; j++) { + s32 w1 = *ptr++; + s32 w2 = *ptr++; + a1->m[i + 0][j] = MTX_INTPART_PACK(w1, (u32)w2); + a1->m[i + 2][j] = MTX_FRACPART_PACK(w1, w2); + } + } + + // s32 i; + // s32 j; + // s32 w1; + // s32 w2; + // for (i = 0; i < 2; i++) { + // for (j = 0; j < 4; j++) { + // w1 = a0[i * 8 + j * 2 + 0]; + // w2 = a0[i * 8 + j * 2 + 1]; + // a1[i + 0][j] = MTX_INTPART_PACK(w1, (u32)w2); + // a1[i + 2][j] = MTX_FRACPART_PACK(w1, w2); + // } + // } + + // s32 i = 0; + // s32 *w1 = &a0[0][0]; + // s32 *w2 = &a0[0][1]; + // for (i = 0; i < 2; i++) { + // a1[i + 0][0] = MTX_INTPART_PACK(*w1, (u32)*w2); + // a1[i + 2][0] = MTX_FRACPART_PACK(*w1, *w2); + // w1 += 2; + // w2 += 2; + // a1[i + 0][1] = MTX_INTPART_PACK(*w1, (u32)*w2); + // a1[i + 2][1] = MTX_FRACPART_PACK(*w1, *w2); + // w1 += 2; + // w2 += 2; + // a1[i + 0][2] = MTX_INTPART_PACK(*w1, (u32)*w2); + // a1[i + 2][2] = MTX_FRACPART_PACK(*w1, *w2); + // w1 += 2; + // w2 += 2; + // a1[i + 0][3] = MTX_INTPART_PACK(*w1, (u32)*w2); + // a1[i + 2][3] = MTX_FRACPART_PACK(*w1, *w2); + // } + + // s32 i = 0; + // s32 w1; + // s32 w2; + // for (i = 0; i < 2; i++) { + // w1 = a0[i * 2 + 0][0]; + // w2 = a0[i * 2 + 0][1]; + // a1[i + 0][0] = MTX_INTPART_PACK(w1, (u32)w2); + // a1[i + 2][0] = MTX_FRACPART_PACK(w1, w2); + // w1 = a0[i * 2 + 0][2]; + // w2 = a0[i * 2 + 0][3]; + // a1[i + 0][1] = MTX_INTPART_PACK(w1, (u32)w2); + // a1[i + 2][1] = MTX_FRACPART_PACK(w1, w2); + // w1 = a0[i * 2 + 1][0]; + // w2 = a0[i * 2 + 1][1]; + // a1[i + 0][2] = MTX_INTPART_PACK(w1, (u32)w2); + // a1[i + 2][2] = MTX_FRACPART_PACK(w1, w2); + // w1 = a0[i * 2 + 1][2]; + // w2 = a0[i * 2 + 1][3]; + // a1[i + 0][3] = MTX_INTPART_PACK(w1, (u32)w2); + // a1[i + 2][3] = MTX_FRACPART_PACK(w1, w2); + // } + // s32 i; + // for (i = 0; i < 2; i++) { + // a1[i + 0][0] = MTX_INTPART_PACK(a0[i * 2 + 0][0], (u32)a0[i * 2 + 0][1]); + // a1[i + 2][0] = MTX_FRACPART_PACK(a0[i * 2 + 0][0], a0[i * 2 + 0][1]); + // a1[i + 0][1] = MTX_INTPART_PACK(a0[i * 2 + 0][2], (u32)a0[i * 2 + 0][3]); + // a1[i + 2][1] = MTX_FRACPART_PACK(a0[i * 2 + 0][2], a0[i * 2 + 0][3]); + // a1[i + 0][2] = MTX_INTPART_PACK(a0[i * 2 + 1][0], (u32)a0[i * 2 + 1][1]); + // a1[i + 2][2] = MTX_FRACPART_PACK(a0[i * 2 + 1][0], a0[i * 2 + 1][1]); + // a1[i + 0][3] = MTX_INTPART_PACK(a0[i * 2 + 1][2], (u32)a0[i * 2 + 1][3]); + // a1[i + 2][3] = MTX_FRACPART_PACK(a0[i * 2 + 1][2], a0[i * 2 + 1][3]); + // } + // a1[0][0] = MTX_INTPART_PACK(a0[0][0], (u32)a0[0][1]); + // a1[2][0] = MTX_FRACPART_PACK(a0[0][0], a0[0][1]); + // a1[0][1] = MTX_INTPART_PACK(a0[0][2], (u32)a0[0][3]); + // a1[2][1] = MTX_FRACPART_PACK(a0[0][2], a0[0][3]); + // a1[0][2] = MTX_INTPART_PACK(a0[1][0], (u32)a0[1][1]); + // a1[2][2] = MTX_FRACPART_PACK(a0[1][0], a0[1][1]); + // a1[0][3] = MTX_INTPART_PACK(a0[1][2], (u32)a0[1][3]); + // a1[2][3] = MTX_FRACPART_PACK(a0[1][2], a0[1][3]); -#ifdef NONMATCHING -void sub_GAME_7F059244(void) { + // a1[1][0] = MTX_INTPART_PACK(a0[2][0], (u32)a0[2][1]); + // a1[3][0] = MTX_FRACPART_PACK(a0[2][0], a0[2][1]); + // a1[1][1] = MTX_INTPART_PACK(a0[2][2], (u32)a0[2][3]); + // a1[3][1] = MTX_FRACPART_PACK(a0[2][2], a0[2][3]); + // a1[1][2] = MTX_INTPART_PACK(a0[3][0], (u32)a0[3][1]); + // a1[3][2] = MTX_FRACPART_PACK(a0[3][0], a0[3][1]); + // a1[1][3] = MTX_INTPART_PACK(a0[3][2], (u32)a0[3][3]); + // a1[3][3] = MTX_FRACPART_PACK(a0[3][2], a0[3][3]); +/* $v0 = 0 + loop: + $a1 += 0x10 + $v1 = *($a0 + $v0 * 8 + 0x00) + $a2 = *($a0 + $v0 * 8 + 0x04) + *($a1 - 0x10) = MTX_INTPART_PACK($v1, (u32)$a2) + *($a1 + 0x10) = MTX_FRACPART_PACK($v1, $a2) + $v1 = *($a0 + ($v0 + 1) * 8 + 0x00) + $a2 = *($a0 + ($v0 + 1) * 8 + 0x04) + *($a1 - 0x0C) = MTX_INTPART_PACK($v1, (u32)$a2) + *($a1 + 0x14) = MTX_FRACPART_PACK($v1, $a2) + $v1 = *($a0 + ($v0 + 2) * 8 + 0x00) + $a2 = *($a0 + ($v0 + 2) * 8 + 0x04) + *($a1 - 0x08) = MTX_INTPART_PACK($v1, (u32)$a2) + *($a1 + 0x18) = MTX_FRACPART_PACK($v1, $a2) + $v1 = *($a0 + ($v0 + 3) * 8 + 0x00) + $a2 = *($a0 + ($v0 + 3) * 8 + 0x04) + *($a1 - 0x04) = MTX_INTPART_PACK($v1, (u32)$a2) + *($a1 + 0x1C) = MTX_FRACPART_PACK($v1, $a2) + $v0 += 4 + if ($v0 != 8) { + goto loop; + }*/ } #else GLOBAL_ASM( @@ -1206,53 +1017,90 @@ loop: return */ -//typedef s32 mat4s[4][4]; +/* +0, 0 +0, 1 +0, 2 +0, 3 +1, 0 +1, 1 +1, 2 +1, 3 +2, 0 +*/ -//void sub_GAME_7F059334(mat4s arg0, mat4s arg1) { -//sub_GAME_7F059334(s32* arg0, s32* arg1) { - //s32* var1 = arg0; - //s32* var2 = arg1; - //for (i = 0; i < 2; i++) { - // for (; var1 < (arg0 + 8); var1++, var2 += 4) - // var1 = arg0[i + 0][0]; - // var2 = arg0[i + 2][0]; - // arg1[i * 2 + 0][0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 0][1] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][1]; - // var2 = arg0[i + 2][1]; - // arg1[i * 2 + 0][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 0][3] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][2]; - // var2 = arg0[i + 2][2]; - // arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); - // arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][3]; - // var2 = arg0[i + 2][3]; - // arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); - // } +// void sub_GAME_7F059334(mat4s arg0, mat4s arg1) { +// s32 var1; +// s32 var2; +// s32 i, j; +// for (i = 0; i < 2; i++) { +// for (j = 0; j < 2; j++) { +// var1 = arg0[i + 0][j + 0]; +// var2 = arg0[i + 2][j + 0]; +// arg1[i * 2 + 0][] [i * 8 + j * 2 + 0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 0] * 2 + 1] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][j + 1]; +// var2 = arg0[i + 2][j + 1]; +// arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xFFFF)); +// // var1 = arg0[i + 0][2]; +// // var2 = arg0[i + 2][2]; +// // arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); +// // arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); +// // var1 = arg0[i + 0][3]; +// // var2 = arg0[i + 2][3]; +// // arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// // arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); +// } +// } - // s32 var1; - // s32 var2; - // s32 i; - // for (i = 0; i < 2; i++) { - // var1 = arg0[i + 0][0]; - // var2 = arg0[i + 2][0]; - // arg1[i * 2 + 0][0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 0][1] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][1]; - // var2 = arg0[i + 2][1]; - // arg1[i * 2 + 0][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 0][3] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][2]; - // var2 = arg0[i + 2][2]; - // arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); - // arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); - // var1 = arg0[i + 0][3]; - // var2 = arg0[i + 2][3]; - // arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); - // arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); - // } + + + +// sub_GAME_7F059334(s32* arg0, s32* arg1) { +// s32* var1 = arg0; +// s32* var2 = arg1; +// for (i = 0; i < 2; i++) { +// for (; var1 < (arg0 + 8); var1++, var2 += 4) +// var1 = arg0[i + 0][0]; +// var2 = arg0[i + 2][0]; +// arg1[i * 2 + 0][0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 0][1] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][1]; +// var2 = arg0[i + 2][1]; +// arg1[i * 2 + 0][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 0][3] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][2]; +// var2 = arg0[i + 2][2]; +// arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); +// arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][3]; +// var2 = arg0[i + 2][3]; +// arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); +// } + +// s32 var1; +// s32 var2; +// s32 i; +// for (i = 0; i < 2; i++) { +// var1 = arg0[i + 0][0]; +// var2 = arg0[i + 2][0]; +// arg1[i * 2 + 0][0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 0][1] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][1]; +// var2 = arg0[i + 2][1]; +// arg1[i * 2 + 0][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 0][3] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][2]; +// var2 = arg0[i + 2][2]; +// arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); +// arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); +// var1 = arg0[i + 0][3]; +// var2 = arg0[i + 2][3]; +// arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); +// arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); +// } // s32 temp_v1; // s32 temp_v1_2; @@ -1285,9 +1133,79 @@ return //} #ifdef NONMATCHING -void sub_GAME_7F059334(void) { +#define MTX_INTPART_PACK(w1, w2) (((w1) & 0xFFFF0000) | (((w2) >> 16)/* & 0xFFFF*/)) +#define MTX_FRACPART_PACK(w1, w2) ((((w1) << 16) & 0xFFFF0000) | ((w2) & 0xFFFF)) -} +// void sub_GAME_7F059334(s32 arg0[4][4], s32 arg1[4][4]) { +// s32 i; +// s32 j; +// u32 *m1 = (u32*)&arg0[0][0]; +// u32 *m2 = (u32*)&arg0[2][0]; +// for (i = 0; i < 4; i++) { +// for (j = 0; j < 2; j++) { +// arg1[i][j * 2 + 0] = MTX_INTPART_PACK((*m1), (*m2)); +// m1++; +// arg1[i][j * 2 + 1] = MTX_FRACPART_PACK((*m1), (*m2)); +// m2++; +// } +// } + + + // s32 var1; + // u32 var2; + // s32 i; + // for () + // for (i = 0; i < 2; i++) { + // var1 = arg0[i + 0][0]; + // var2 = arg0[i + 2][0]; + // arg1[i * 2 + 0][0] = ((var1 & 0xFFFF0000) | (var2 >> 16)); + // arg1[i * 2 + 0][1] = ((var1 << 16) | (var2 & 0xFFFF)); + // var1 = arg0[i + 0][1]; + // var2 = arg0[i + 2][1]; + // arg1[i * 2 + 0][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); + // arg1[i * 2 + 0][3] = ((var1 << 16) | (var2 & 0xFFFF)); + // var1 = arg0[i + 0][2]; + // var2 = arg0[i + 2][2]; + // arg1[i * 2 + 1][0] = ((var1 & 0xFFFF0000) | (var2 << 16)); + // arg1[i * 2 + 1][1] = ((var1 << 16) | (var2 & 0xFFFF)); + // var1 = arg0[i + 0][3]; + // var2 = arg0[i + 2][3]; + // arg1[i * 2 + 1][2] = ((var1 & 0xFFFF0000) | (var2 >> 16)); + // arg1[i * 2 + 1][3] = ((var1 << 16) | (var2 & 0xffff)); + // } +//} +// void sub_GAME_7F059334(s32 m1[4][4], s32 m2[4][4]) { +// int i; +// int j; +// int *ai = &m1[0][0]; +// u32 *af = &m1[2][0]; + +// for (j=0; j<2; j++) { +// for (i=0; i<4; i++) { +// m2[i][j*2+0] = (*ai & 0xffff0000) | ((*af >> 16) & 0xffff); +// m2[i][j*2+1] = ((*(ai++) << 16) & 0xffff0000) | (*(af++) & 0xffff); +// } +// } +// } + +//void sub_GAME_7F059334(s32 m1[16], s32 m2[16]) { + // s32 i; + // for (i = 0; i < 8; i++) { + // s32 t1 = m1[i+0]; + // s32 t2 = m1[i+8]; + // m2[i * 2 + 0] = MTX_INTPART_PACK(t1, t2); + // m2[i * 2 + 1] = MTX_FRACPART_PACK(t1, t2); + // } + // s32 i, j; + // for (i = 0; i < 2; i++) { + // for (j = 0; j < 4; j++) { + // s32 t1 = m1[i+0][j]; + // s32 t2 = m1[i+2][j]; + // m2[i*8+j*2+0] = MTX_INTPART_PACK(t1, t2); + // m2[i*8+j*2+1] = MTX_FRACPART_PACK(t1, t2); + // } + // } +//} #else GLOBAL_ASM( .text @@ -1356,7 +1274,7 @@ glabel sub_GAME_7F059334 ) #endif -void sub_GAME_7F059424(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { +void matrix_4x4_7F059424(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { f32 temp_f26; f32 temp_f28; f32 temp_f2_2; @@ -1380,31 +1298,31 @@ void sub_GAME_7F059424(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 a arg7 *= temp_f2_3; arg8 *= temp_f2_3; arg9 *= temp_f2_3; - arg0[0][0] = temp_f26; - arg0[1][0] = temp_f28; - arg0[2][0] = temp_f30; - arg0[3][0] = -((arg1 * temp_f26) + (arg2 * temp_f28) + (arg3 * temp_f30)); - arg0[0][1] = arg7; - arg0[1][1] = arg8; - arg0[2][1] = arg9; - arg0[3][1] = -((arg1 * arg7) + (arg2 * arg8) + (arg3 * arg9)); - arg0[0][2] = arg4; - arg0[1][2] = arg5; - arg0[2][2] = arg6; - arg0[3][2] = -((arg1 * arg4) + (arg2 * arg5) + (arg3 * arg6)); - arg0[0][3] = 0.0f; - arg0[1][3] = 0.0f; - arg0[2][3] = 0.0f; - arg0[3][3] = 1.0f; + arg0->m[0][0] = temp_f26; + arg0->m[1][0] = temp_f28; + arg0->m[2][0] = temp_f30; + arg0->m[3][0] = -((arg1 * temp_f26) + (arg2 * temp_f28) + (arg3 * temp_f30)); + arg0->m[0][1] = arg7; + arg0->m[1][1] = arg8; + arg0->m[2][1] = arg9; + arg0->m[3][1] = -((arg1 * arg7) + (arg2 * arg8) + (arg3 * arg9)); + arg0->m[0][2] = arg4; + arg0->m[1][2] = arg5; + arg0->m[2][2] = arg6; + arg0->m[3][2] = -((arg1 * arg4) + (arg2 * arg5) + (arg3 * arg6)); + arg0->m[0][3] = 0.0f; + arg0->m[1][3] = 0.0f; + arg0->m[2][3] = 0.0f; + arg0->m[3][3] = 1.0f; } -void sub_GAME_7F059424(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); +void matrix_4x4_7F059424(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); -void sub_GAME_7F059694(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { - sub_GAME_7F059424(arg0, arg1, arg2, arg3, arg4 - arg1, arg5 - arg2, arg6 - arg3, arg7, arg8, arg9); +void matrix_4x4_7F059694(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { + matrix_4x4_7F059424(arg0, arg1, arg2, arg3, arg4 - arg1, arg5 - arg2, arg6 - arg3, arg7, arg8, arg9); } -void sub_GAME_7F059708(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { +void matrix_4x4_7F059708(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { f32 temp_f26; f32 temp_f28; f32 temp_f2_2; @@ -1428,52 +1346,40 @@ void sub_GAME_7F059708(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 a arg7 *= temp_f2_3; arg8 *= temp_f2_3; arg9 *= temp_f2_3; - arg0[0][0] = temp_f26; - arg0[1][0] = arg7; - arg0[2][0] = arg4; - arg0[3][0] = arg1; - arg0[0][1] = temp_f28; - arg0[1][1] = arg8; - arg0[2][1] = arg5; - arg0[3][1] = arg2; - arg0[0][2] = temp_f30; - arg0[1][2] = arg9; - arg0[2][2] = arg6; - arg0[3][2] = arg3; - arg0[0][3] = 0.0f; - arg0[1][3] = 0.0f; - arg0[2][3] = 0.0f; - arg0[3][3] = 1.0f; + arg0->m[0][0] = temp_f26; + arg0->m[1][0] = arg7; + arg0->m[2][0] = arg4; + arg0->m[3][0] = arg1; + arg0->m[0][1] = temp_f28; + arg0->m[1][1] = arg8; + arg0->m[2][1] = arg5; + arg0->m[3][1] = arg2; + arg0->m[0][2] = temp_f30; + arg0->m[1][2] = arg9; + arg0->m[2][2] = arg6; + arg0->m[3][2] = arg3; + arg0->m[0][3] = 0.0f; + arg0->m[1][3] = 0.0f; + arg0->m[2][3] = 0.0f; + arg0->m[3][3] = 1.0f; } -void sub_GAME_7F059908(mat44 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { - sub_GAME_7F059708(arg0, arg1, arg2, arg3, arg4 - arg1, arg5 - arg2, arg6 - arg3, arg7, arg8, arg9); +void matrix_4x4_7F059908(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { + matrix_4x4_7F059708(arg0, arg1, arg2, arg3, arg4 - arg1, arg5 - arg2, arg6 - arg3, arg7, arg8, arg9); } #ifdef NONMATCHING -//< 8e568: 3043ffff andi v1,v0,0xffff -//--- -//> 8e568: 31e3ffff andi v1,t7,0xffff -//57,58c57,58 -//< 8e570: 03e00008 jr ra -//< 8e574: 00601025 move v0,v1 -//--- -//> 8e570: 00601025 move v0,v1 -//> 8e574: 03e00008 jr ra -s32 sub_GAME_7F05997C(f32 arg0, f32 arg1) { - f32 temp_f0; - u32 temp_v0; - s32 phi_v1; - - temp_f0 = arg0 + arg1; - if (temp_f0 <= 2.0f) { - return 0xFFFF; - } - temp_v0 = (u32) (131072.0f / temp_f0) & 0xFFFF; - phi_v1 = temp_v0 & 0xFFFF; - if ((s32)temp_v0 <= 0) { +// > 8e570: move v0,v1 +// 8e570: jr ra 8e574: jr ra +// 8e574: move v0,v1 | 8e578: nop +u16 sub_GAME_7F05997C(f32 arg0, f32 arg1) { + u16 phi_v1; + f32 temp_f0 = arg0 + arg1; + if (temp_f0 <= 2.0f) + return -1; + phi_v1 = (131072.0f / temp_f0); + if (phi_v1 <= 0) phi_v1 = 1; - } return phi_v1; } #else @@ -1540,27 +1446,27 @@ glabel sub_GAME_7F05997C ) #endif -s16 sub_GAME_7F05997C(f32 arg0, f32 arg1); +u16 sub_GAME_7F05997C(f32 arg0, f32 arg1); -void sub_GAME_7F059A48(mat44 matrix, s16* arg1, f32 angle, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { +void matrix_4x4_7F059A48(Mtxf *matrix, u16* arg1, f32 angle, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { f32 temp_f12_2 = cosf(angle * 0.5f) / sinf(angle * 0.5f); arg6 *= 65536.0f; - matrix[0][0] = ((temp_f12_2 / arg3) * arg6); - matrix[1][1] = (temp_f12_2 * arg6); - matrix[1][0] = 0.0f; - matrix[2][0] = 0.0f; - matrix[3][0] = 0.0f; - matrix[0][1] = 0.0f; - matrix[2][1] = 0.0f; - matrix[3][1] = 0.0f; - matrix[0][2] = 0.0f; - matrix[1][2] = 0.0f; - matrix[2][2] = (((arg4 + arg5) / (arg4 - arg5)) * arg6); - matrix[3][2] = ((((arg4 + arg4) * arg5) / (arg4 - arg5)) * arg6); - matrix[2][3] = -arg6; - matrix[0][3] = 0.0f; - matrix[1][3] = 0.0f; - matrix[3][3] = 0.0f; + matrix->m[0][0] = ((temp_f12_2 / arg3) * arg6); + matrix->m[1][1] = (temp_f12_2 * arg6); + matrix->m[1][0] = 0.0f; + matrix->m[2][0] = 0.0f; + matrix->m[3][0] = 0.0f; + matrix->m[0][1] = 0.0f; + matrix->m[2][1] = 0.0f; + matrix->m[3][1] = 0.0f; + matrix->m[0][2] = 0.0f; + matrix->m[1][2] = 0.0f; + matrix->m[2][2] = (((arg4 + arg5) / (arg4 - arg5)) * arg6); + matrix->m[3][2] = ((((arg4 + arg4) * arg5) / (arg4 - arg5)) * arg6); + matrix->m[2][3] = -arg6; + matrix->m[0][3] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[3][3] = 0.0f; if (arg1 != 0) { *arg1 = sub_GAME_7F05997C(arg4, arg5); } @@ -1568,7 +1474,7 @@ void sub_GAME_7F059A48(mat44 matrix, s16* arg1, f32 angle, f32 arg3, f32 arg4, f void guNormalize(f32 *x, f32 *y, f32 *z); -void sub_GAME_7F059B58(mat44 matrix, f32 angle, f32 x, f32 y, f32 z) { +void matrix_4x4_7F059B58(Mtxf *matrix, f32 angle, f32 x, f32 y, f32 z) { f32 sine; f32 cosine; f32 norm; @@ -1587,22 +1493,22 @@ void sub_GAME_7F059B58(mat44 matrix, f32 angle, f32 x, f32 y, f32 z) { cos_z = z * cosine; sin_z = z * sine; invnorm = 1.0f / norm; - matrix[0][0] = ((-cos_z - (y * sin_x)) * invnorm); - matrix[1][0] = (sine * norm); - matrix[2][0] = ((cos_x - (y * sin_z)) * invnorm); - matrix[3][0] = 0.0f; - matrix[0][1] = ((sin_z - (y * cos_x)) * invnorm); - matrix[1][1] = (cosine * norm); - matrix[2][1] = ((-sin_x - (y * cos_z)) * invnorm); - matrix[3][1] = 0.0f; - matrix[0][2] = -x; - matrix[1][2] = -y; - matrix[2][2] = -z; - matrix[3][2] = 0.0f; - matrix[0][3] = 0.0f; - matrix[1][3] = 0.0f; - matrix[2][3] = 0.0f; - matrix[3][3] = 1.0f; + matrix->m[0][0] = ((-cos_z - (y * sin_x)) * invnorm); + matrix->m[1][0] = (sine * norm); + matrix->m[2][0] = ((cos_x - (y * sin_z)) * invnorm); + matrix->m[3][0] = 0.0f; + matrix->m[0][1] = ((sin_z - (y * cos_x)) * invnorm); + matrix->m[1][1] = (cosine * norm); + matrix->m[2][1] = ((-sin_x - (y * cos_z)) * invnorm); + matrix->m[3][1] = 0.0f; + matrix->m[0][2] = -x; + matrix->m[1][2] = -y; + matrix->m[2][2] = -z; + matrix->m[3][2] = 0.0f; + matrix->m[0][3] = 0.0f; + matrix->m[1][3] = 0.0f; + matrix->m[2][3] = 0.0f; + matrix->m[3][3] = 1.0f; return; } matrix_4x4_set_identity(matrix); @@ -1612,97 +1518,97 @@ void guAlignF(float mf[4][4], float a, float x, float y, float z); #define RAD2DEG(x) x * 57.295776f -void matrix_4x4_align(mat44 matrix, f32 angle, f32 x, f32 y, f32 z) { +void matrix_4x4_align(Mtxf *matrix, f32 angle, f32 x, f32 y, f32 z) { angle = RAD2DEG(angle); - guAlignF(matrix, angle, x, y, z); + guAlignF(matrix->m, angle, x, y, z); } -void sub_GAME_7F059D30(u32 arg0) { +void matrix_4x4_7F059D30(u32 arg0) { return; } -void matrix_4x4_set_rotation_inverse(mat44 rotation, mat44 transpose) { - transpose[0][0] = rotation[0][0]; - transpose[0][1] = rotation[1][0]; - transpose[0][2] = rotation[2][0]; - transpose[1][0] = rotation[0][1]; - transpose[1][1] = rotation[1][1]; - transpose[1][2] = rotation[2][1]; - transpose[2][0] = rotation[0][2]; - transpose[2][1] = rotation[1][2]; - transpose[2][2] = rotation[2][2]; - transpose[3][0] = 0.0f; - transpose[3][1] = 0.0f; - transpose[3][2] = 0.0f; - transpose[0][3] = 0.0f; - transpose[1][3] = 0.0f; - transpose[2][3] = 0.0f; - transpose[3][3] = 1.0f; +void matrix_4x4_set_rotation_inverse(Mtxf *rotation, Mtxf *transpose) { + transpose->m[0][0] = rotation->m[0][0]; + transpose->m[0][1] = rotation->m[1][0]; + transpose->m[0][2] = rotation->m[2][0]; + transpose->m[1][0] = rotation->m[0][1]; + transpose->m[1][1] = rotation->m[1][1]; + transpose->m[1][2] = rotation->m[2][1]; + transpose->m[2][0] = rotation->m[0][2]; + transpose->m[2][1] = rotation->m[1][2]; + transpose->m[2][2] = rotation->m[2][2]; + transpose->m[3][0] = 0.0f; + transpose->m[3][1] = 0.0f; + transpose->m[3][2] = 0.0f; + transpose->m[0][3] = 0.0f; + transpose->m[1][3] = 0.0f; + transpose->m[2][3] = 0.0f; + transpose->m[3][3] = 1.0f; } -void sub_GAME_7F059DAC(mat44 arg0, mat44 arg1) { - f32 temp_f0 = ((arg0[0][0] * arg0[0][0]) + (arg0[1][0] * arg0[1][0]) + (arg0[2][0] * arg0[2][0])); +void matrix_4x4_7F059DAC(Mtxf *arg0, Mtxf *arg1) { + f32 temp_f0 = ((arg0->m[0][0] * arg0->m[0][0]) + (arg0->m[1][0] * arg0->m[1][0]) + (arg0->m[2][0] * arg0->m[2][0])); temp_f0 = 1.0f / temp_f0; - arg1[0][0] = (arg0[0][0] * temp_f0); - arg1[0][1] = (arg0[1][0] * temp_f0); - arg1[0][2] = (arg0[2][0] * temp_f0); - arg1[1][0] = (arg0[0][1] * temp_f0); - arg1[1][1] = (arg0[1][1] * temp_f0); - arg1[1][2] = (arg0[2][1] * temp_f0); - arg1[2][0] = (arg0[0][2] * temp_f0); - arg1[2][1] = (arg0[1][2] * temp_f0); - arg1[2][2] = (arg0[2][2] * temp_f0); - arg1[3][0] = 0.0f; - arg1[3][1] = 0.0f; - arg1[3][2] = 0.0f; - arg1[0][3] = 0.0f; - arg1[1][3] = 0.0f; - arg1[2][3] = 0.0f; - arg1[3][3] = 1.0f; + arg1->m[0][0] = (arg0->m[0][0] * temp_f0); + arg1->m[0][1] = (arg0->m[1][0] * temp_f0); + arg1->m[0][2] = (arg0->m[2][0] * temp_f0); + arg1->m[1][0] = (arg0->m[0][1] * temp_f0); + arg1->m[1][1] = (arg0->m[1][1] * temp_f0); + arg1->m[1][2] = (arg0->m[2][1] * temp_f0); + arg1->m[2][0] = (arg0->m[0][2] * temp_f0); + arg1->m[2][1] = (arg0->m[1][2] * temp_f0); + arg1->m[2][2] = (arg0->m[2][2] * temp_f0); + arg1->m[3][0] = 0.0f; + arg1->m[3][1] = 0.0f; + arg1->m[3][2] = 0.0f; + arg1->m[0][3] = 0.0f; + arg1->m[1][3] = 0.0f; + arg1->m[2][3] = 0.0f; + arg1->m[3][3] = 1.0f; } -void sub_GAME_7F059E64(mat44 arg0, mat44 arg1) { - f32 temp_f0 = (arg0[0][0] * arg0[0][0]) + (arg0[1][0] * arg0[1][0]) + (arg0[2][0] * arg0[2][0]); +void matrix_4x4_7F059E64(Mtxf *arg0, Mtxf *arg1) { + f32 temp_f0 = (arg0->m[0][0] * arg0->m[0][0]) + (arg0->m[1][0] * arg0->m[1][0]) + (arg0->m[2][0] * arg0->m[2][0]); temp_f0 = 1.0f / temp_f0; - arg1[0][0] = (arg0[0][0] * temp_f0); - arg1[0][1] = (arg0[1][0] * temp_f0); - arg1[0][2] = (arg0[2][0] * temp_f0); - arg1[1][0] = (arg0[0][1] * temp_f0); - arg1[1][1] = (arg0[1][1] * temp_f0); - arg1[1][2] = (arg0[2][1] * temp_f0); - arg1[2][0] = (arg0[0][2] * temp_f0); - arg1[2][1] = (arg0[1][2] * temp_f0); - arg1[2][2] = (arg0[2][2] * temp_f0); - arg1[3][0] = -((arg1[0][0] * arg0[3][0]) + (arg1[1][0] * arg0[3][1]) + (arg1[2][0] * arg0[3][2])); - arg1[3][1] = -((arg1[0][1] * arg0[3][0]) + (arg1[1][1] * arg0[3][1]) + (arg1[2][1] * arg0[3][2])); - arg1[3][2] = -((arg1[0][2] * arg0[3][0]) + (arg1[1][2] * arg0[3][1]) + (arg1[2][2] * arg0[3][2])); - arg1[3][3] = 1.0f; - arg1[0][3] = 0.0f; - arg1[1][3] = 0.0f; - arg1[2][3] = 0.0f; + arg1->m[0][0] = (arg0->m[0][0] * temp_f0); + arg1->m[0][1] = (arg0->m[1][0] * temp_f0); + arg1->m[0][2] = (arg0->m[2][0] * temp_f0); + arg1->m[1][0] = (arg0->m[0][1] * temp_f0); + arg1->m[1][1] = (arg0->m[1][1] * temp_f0); + arg1->m[1][2] = (arg0->m[2][1] * temp_f0); + arg1->m[2][0] = (arg0->m[0][2] * temp_f0); + arg1->m[2][1] = (arg0->m[1][2] * temp_f0); + arg1->m[2][2] = (arg0->m[2][2] * temp_f0); + arg1->m[3][0] = -((arg1->m[0][0] * arg0->m[3][0]) + (arg1->m[1][0] * arg0->m[3][1]) + (arg1->m[2][0] * arg0->m[3][2])); + arg1->m[3][1] = -((arg1->m[0][1] * arg0->m[3][0]) + (arg1->m[1][1] * arg0->m[3][1]) + (arg1->m[2][1] * arg0->m[3][2])); + arg1->m[3][2] = -((arg1->m[0][2] * arg0->m[3][0]) + (arg1->m[1][2] * arg0->m[3][1]) + (arg1->m[2][2] * arg0->m[3][2])); + arg1->m[3][3] = 1.0f; + arg1->m[0][3] = 0.0f; + arg1->m[1][3] = 0.0f; + arg1->m[2][3] = 0.0f; } #ifdef NONMATCHING -void sub_GAME_7F059FB8(mat44 arg0, mat44 arg1) { - f32 temp_f0 = (arg0[0][0] * arg0[1][1] * arg0[2][2]) + (arg0[0][1] * arg0[1][2] * arg0[2][0]) + (arg0[0][2] * arg0[1][0] * arg0[2][1]) - (arg0[0][2] * arg0[1][1] * arg0[2][0]) - (arg0[0][1] * arg0[1][0] * arg0[2][2]) - (arg0[0][0] * arg0[1][2] * arg0[2][1]); +void sub_GAME_7F059FB8(Mtxf *arg0, Mtxf *arg1) { + f32 temp_f0 = (arg0->m[0][0] * arg0->m[1][1] * arg0->m[2][2]) + (arg0->m[0][1] * arg0->m[1][2] * arg0->m[2][0]) + (arg0->m[0][2] * arg0->m[1][0] * arg0->m[2][1]) - (arg0->m[0][2] * arg0->m[1][1] * arg0->m[2][0]) - (arg0->m[0][1] * arg0->m[1][0] * arg0->m[2][2]) - (arg0->m[0][0] * arg0->m[1][2] * arg0->m[2][1]); temp_f0 = 1.0f / temp_f0; - arg1[0][0] = (((arg0[1][1] * arg0[2][2]) - (arg0[2][1] * arg0[1][2])) * temp_f0); - arg1[1][0] = (((arg0[1][2] * arg0[2][0]) - (arg0[2][2] * arg0[1][0])) * temp_f0); - arg1[2][0] = (((arg0[1][0] * arg0[2][1]) - (arg0[2][0] * arg0[1][1])) * temp_f0); - arg1[0][1] = (((arg0[0][2] * arg0[2][1]) - (arg0[2][2] * arg0[0][1])) * temp_f0); - arg1[1][1] = (((arg0[0][0] * arg0[2][2]) - (arg0[2][0] * arg0[0][2])) * temp_f0); - arg1[2][1] = (((arg0[0][1] * arg0[2][0]) - (arg0[2][1] * arg0[0][0])) * temp_f0); - arg1[0][2] = (((arg0[0][1] * arg0[1][2]) - (arg0[1][1] * arg0[0][2])) * temp_f0); - arg1[1][2] = (((arg0[0][2] * arg0[1][0]) - (arg0[1][2] * arg0[0][0])) * temp_f0); - arg1[2][2] = (((arg0[0][0] * arg0[1][1]) - (arg0[1][0] * arg0[0][1])) * temp_f0); - arg1[3][0] = -((arg1[0][0] * arg0[3][0]) + (arg1[1][0] * arg0[3][1]) + (arg1[2][0] * arg0[3][2])); - arg1[3][1] = -((arg1[0][1] * arg0[3][0]) + (arg1[1][1] * arg0[3][1]) + (arg1[2][1] * arg0[3][2])); - arg1[3][2] = -((arg1[0][2] * arg0[3][0]) + (arg1[1][2] * arg0[3][1]) + (arg1[2][2] * arg0[3][2])); - arg1[3][3] = 1.0f; - arg1[0][3] = 0.0f; - arg1[1][3] = 0.0f; - arg1[2][3] = 0.0f; + arg1->m[0][0] = (((arg0->m[1][1] * arg0->m[2][2]) - (arg0->m[2][1] * arg0->m[1][2])) * temp_f0); + arg1->m[1][0] = (((arg0->m[1][2] * arg0->m[2][0]) - (arg0->m[2][2] * arg0->m[1][0])) * temp_f0); + arg1->m[2][0] = (((arg0->m[1][0] * arg0->m[2][1]) - (arg0->m[2][0] * arg0->m[1][1])) * temp_f0); + arg1->m[0][1] = (((arg0->m[0][2] * arg0->m[2][1]) - (arg0->m[2][2] * arg0->m[0][1])) * temp_f0); + arg1->m[1][1] = (((arg0->m[0][0] * arg0->m[2][2]) - (arg0->m[2][0] * arg0->m[0][2])) * temp_f0); + arg1->m[2][1] = (((arg0->m[0][1] * arg0->m[2][0]) - (arg0->m[2][1] * arg0->m[0][0])) * temp_f0); + arg1->m[0][2] = (((arg0->m[0][1] * arg0->m[1][2]) - (arg0->m[1][1] * arg0->m[0][2])) * temp_f0); + arg1->m[1][2] = (((arg0->m[0][2] * arg0->m[1][0]) - (arg0->m[1][2] * arg0->m[0][0])) * temp_f0); + arg1->m[2][2] = (((arg0->m[0][0] * arg0->m[1][1]) - (arg0->m[1][0] * arg0->m[0][1])) * temp_f0); + arg1->m[3][0] = -((arg1->m[0][0] * arg0->m[3][0]) + (arg1->m[1][0] * arg0->m[3][1]) + (arg1->m[2][0] * arg0->m[3][2])); + arg1->m[3][1] = -((arg1->m[0][1] * arg0->m[3][0]) + (arg1->m[1][1] * arg0->m[3][1]) + (arg1->m[2][1] * arg0->m[3][2])); + arg1->m[3][2] = -((arg1->m[0][2] * arg0->m[3][0]) + (arg1->m[1][2] * arg0->m[3][1]) + (arg1->m[2][2] * arg0->m[3][2])); + arg1->m[3][3] = 1.0f; + arg1->m[0][3] = 0.0f; + arg1->m[1][3] = 0.0f; + arg1->m[2][3] = 0.0f; } #else GLOBAL_ASM( @@ -1877,83 +1783,63 @@ glabel sub_GAME_7F059FB8 ) #endif +void matrix_4x4_7F05A310(Mtxf *arg0, Mtxf *arg1); +f32 matrix_4x4_determinant(Mtxf *matrix); - +void matrix_4x4_7F05A250(Mtxf *arg0, Mtxf *arg1) { + s32 i, j; + f32 inv_det; + matrix_4x4_7F05A310(arg0, arg1); + inv_det = 1.0f / matrix_4x4_determinant(arg0); + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + arg1->m[i][j] *= inv_det; + } + } +} #ifdef NONMATCHING -void sub_GAME_7F05A250(void) { - +f32 matrix_3x3_determinant(f32 a, f32 d, f32 g, f32 b, f32 e, f32 h, f32 c, f32 f, f32 i); +// Stack pointer mostly +void matrix_4x4_7F05A310(Mtxf arg0, Mtxf arg1) { + f32 m00 = arg0->m[0][0]; + f32 m01 = arg0->m[0][1]; + f32 m02 = arg0->m[0][2]; + f32 m03 = arg0->m[0][3]; + f32 m10 = arg0->m[1][0]; + f32 m11 = arg0->m[1][1]; + f32 m12 = arg0->m[1][2]; + f32 m13 = arg0->m[1][3]; + f32 m20 = arg0->m[2][0]; + f32 m21 = arg0->m[2][1]; + f32 m22 = arg0->m[2][2]; + f32 m23 = arg0->m[2][3]; + f32 m30 = arg0->m[3][0]; + f32 m31 = arg0->m[3][1]; + f32 m32 = arg0->m[3][2]; + f32 m33 = arg0->m[3][3]; + arg1->m[0][0] = matrix_3x3_determinant(m11, m21, m31, m12, m22, m32, m13, m23, m33); + arg1->m[1][0] = -matrix_3x3_determinant(m10, m20, m30, m12, m22, m32, m13, m23, m33); + arg1->m[2][0] = matrix_3x3_determinant(m10, m20, m30, m11, m21, m31, m13, m23, m33); + arg1->m[3][0] = -matrix_3x3_determinant(m10, m20, m30, m11, m21, m31, m12, m22, m32); + arg1->m[0][1] = -matrix_3x3_determinant(m01, m21, m31, m02, m22, m32, m03, m23, m33); + arg1->m[1][1] = matrix_3x3_determinant(m00, m20, m30, m02, m22, m32, m03, m23, m33); + arg1->m[2][1] = -matrix_3x3_determinant(m00, m20, m30, m01, m21, m31, m03, m23, m33); + arg1->m[3][1] = matrix_3x3_determinant(m00, m20, m30, m01, m21, m31, m02, m22, m32); + arg1->m[0][2] = matrix_3x3_determinant(m01, m11, m31, m02, m12, m32, m03, m13, m33); + arg1->m[1][2] = -matrix_3x3_determinant(m00, m10, m30, m02, m12, m32, m03, m13, m33); + arg1->m[2][2] = matrix_3x3_determinant(m00, m10, m30, m01, m11, m31, m03, m13, m33); + arg1->m[3][2] = -matrix_3x3_determinant(m00, m10, m30, m01, m11, m31, m02, m12, m32); + arg1->m[0][3] = -matrix_3x3_determinant(m01, m11, m21, m02, m12, m22, m03, m13, m23); + arg1->m[1][3] = matrix_3x3_determinant(m00, m10, m20, m02, m12, m22, m03, m13, m23); + arg1->m[2][3] = -matrix_3x3_determinant(m00, m10, m20, m01, m11, m21, m03, m13, m23); + arg1->m[3][3] = matrix_3x3_determinant(m00, m10, m20, m01, m11, m21, m02, m12, m22); } #else GLOBAL_ASM( .text -glabel sub_GAME_7F05A250 -/* 08ED80 7F05A250 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 08ED84 7F05A254 AFBF0014 */ sw $ra, 0x14($sp) -/* 08ED88 7F05A258 AFA40018 */ sw $a0, 0x18($sp) -/* 08ED8C 7F05A25C 0FC168C4 */ jal sub_GAME_7F05A310 -/* 08ED90 7F05A260 AFA5001C */ sw $a1, 0x1c($sp) -/* 08ED94 7F05A264 0FC169DD */ jal matrix_4x4_determinant -/* 08ED98 7F05A268 8FA40018 */ lw $a0, 0x18($sp) -/* 08ED9C 7F05A26C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08EDA0 7F05A270 44812000 */ mtc1 $at, $f4 -/* 08EDA4 7F05A274 00001825 */ move $v1, $zero -/* 08EDA8 7F05A278 8FA2001C */ lw $v0, 0x1c($sp) -/* 08EDAC 7F05A27C 24040004 */ li $a0, 4 -/* 08EDB0 7F05A280 46002083 */ div.s $f2, $f4, $f0 -/* 08EDB4 7F05A284 C4480000 */ lwc1 $f8, ($v0) -/* 08EDB8 7F05A288 24630001 */ addiu $v1, $v1, 1 -/* 08EDBC 7F05A28C C44E0004 */ lwc1 $f14, 4($v0) -/* 08EDC0 7F05A290 46024402 */ mul.s $f16, $f8, $f2 -/* 08EDC4 7F05A294 C44C0008 */ lwc1 $f12, 8($v0) -/* 08EDC8 7F05A298 10640010 */ beq $v1, $a0, .L7F05A2DC -/* 08EDCC 7F05A29C C452000C */ lwc1 $f18, 0xc($v0) -.L7F05A2A0: -/* 08EDD0 7F05A2A0 46027282 */ mul.s $f10, $f14, $f2 -/* 08EDD4 7F05A2A4 C4480010 */ lwc1 $f8, 0x10($v0) -/* 08EDD8 7F05A2A8 C44E0014 */ lwc1 $f14, 0x14($v0) -/* 08EDDC 7F05A2AC 46026182 */ mul.s $f6, $f12, $f2 -/* 08EDE0 7F05A2B0 C44C0018 */ lwc1 $f12, 0x18($v0) -/* 08EDE4 7F05A2B4 24630001 */ addiu $v1, $v1, 1 -/* 08EDE8 7F05A2B8 46029102 */ mul.s $f4, $f18, $f2 -/* 08EDEC 7F05A2BC C452001C */ lwc1 $f18, 0x1c($v0) -/* 08EDF0 7F05A2C0 E4500000 */ swc1 $f16, ($v0) -/* 08EDF4 7F05A2C4 46024402 */ mul.s $f16, $f8, $f2 -/* 08EDF8 7F05A2C8 E44A0004 */ swc1 $f10, 4($v0) -/* 08EDFC 7F05A2CC E4460008 */ swc1 $f6, 8($v0) -/* 08EE00 7F05A2D0 24420010 */ addiu $v0, $v0, 0x10 -/* 08EE04 7F05A2D4 1464FFF2 */ bne $v1, $a0, .L7F05A2A0 -/* 08EE08 7F05A2D8 E444FFFC */ swc1 $f4, -4($v0) -.L7F05A2DC: -/* 08EE0C 7F05A2DC 46027282 */ mul.s $f10, $f14, $f2 -/* 08EE10 7F05A2E0 24420010 */ addiu $v0, $v0, 0x10 -/* 08EE14 7F05A2E4 E450FFF0 */ swc1 $f16, -0x10($v0) -/* 08EE18 7F05A2E8 46026182 */ mul.s $f6, $f12, $f2 -/* 08EE1C 7F05A2EC 00000000 */ nop -/* 08EE20 7F05A2F0 46029102 */ mul.s $f4, $f18, $f2 -/* 08EE24 7F05A2F4 E44AFFF4 */ swc1 $f10, -0xc($v0) -/* 08EE28 7F05A2F8 E446FFF8 */ swc1 $f6, -8($v0) -/* 08EE2C 7F05A2FC E444FFFC */ swc1 $f4, -4($v0) -/* 08EE30 7F05A300 8FBF0014 */ lw $ra, 0x14($sp) -/* 08EE34 7F05A304 27BD0018 */ addiu $sp, $sp, 0x18 -/* 08EE38 7F05A308 03E00008 */ jr $ra -/* 08EE3C 7F05A30C 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F05A310(void) { - -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05A310 +glabel matrix_4x4_7F05A310 /* 08EE40 7F05A310 27BDFF58 */ addiu $sp, $sp, -0xa8 /* 08EE44 7F05A314 AFBF0064 */ sw $ra, 0x64($sp) /* 08EE48 7F05A318 AFB00060 */ sw $s0, 0x60($sp) @@ -2238,29 +2124,29 @@ glabel sub_GAME_7F05A310 ) #endif -f32 matrix_3x3_determinant(f32 m11, f32 m21, f32 m31, f32 m12, f32 m22, f32 m32, f32 m13, f32 m23, f32 m33); - #ifdef NONMATCHING +f32 matrix_3x3_determinant(f32 a, f32 d, f32 g, f32 b, f32 e, f32 h, f32 c, f32 f, f32 i); // Stack pointer mostly -f32 matrix_4x4_determinant(mat44 matrix) { +f32 matrix_4x4_determinant(Mtxf *matrix) { f32 det; - f32 a = matrix[0][0]; - f32 b = matrix[0][1]; - f32 c = matrix[0][2]; - f32 d = matrix[0][3]; - f32 e = matrix[1][0]; - f32 f = matrix[1][1]; - f32 g = matrix[1][2]; - f32 h = matrix[1][3]; - f32 i = matrix[2][0]; - f32 j = matrix[2][1]; - f32 k = matrix[2][2]; - f32 l = matrix[2][3]; - f32 m = matrix[3][0]; - f32 n = matrix[3][1]; - f32 o = matrix[3][2]; - f32 p = matrix[3][3]; + f32 a = matrix->m[0][0]; + f32 b = matrix->m[0][1]; + f32 c = matrix->m[0][2]; + f32 d = matrix->m[0][3]; + f32 e = matrix->m[1][0]; + f32 f = matrix->m[1][1]; + f32 g = matrix->m[1][2]; + f32 h = matrix->m[1][3]; + f32 i = matrix->m[2][0]; + f32 j = matrix->m[2][1]; + f32 k = matrix->m[2][2]; + f32 l = matrix->m[2][3]; + f32 m = matrix->m[3][0]; + f32 n = matrix->m[3][1]; + f32 o = matrix->m[3][2]; + f32 p = matrix->m[3][3]; det = (a * matrix_3x3_determinant(f, j, n, g, k, o, h, l, p)) - (b * matrix_3x3_determinant(e, i, m, g, k, o, h, l, p)) + (c * matrix_3x3_determinant(e, i, m, f, j, n, h, l, p)) - (d * matrix_3x3_determinant(e, i, m, f, j, n, g, k, o)); + // det = (a * matrix_3x3_determinant(f, g, h, j, k, l, n, o, p)) - (b * matrix_3x3_determinant(e, g, h, i, k, l, m, o, p)) + (c * matrix_3x3_determinant(e, f, h, i, j, l, m, n, p)) - (d * matrix_3x3_determinant(e, f, g, i, j, k, m, n, o)); return det; } #else diff --git a/src/game/matrixmath.h b/src/game/matrixmath.h new file mode 100644 index 00000000..3d547e89 --- /dev/null +++ b/src/game/matrixmath.h @@ -0,0 +1,19 @@ +#ifndef MATRIXMATH_H +#define MATRIXMATH_H + +#include "ultra64.h" + +typedef f32 vec3[3]; + +// Float version of a graphics matrix, which has higher precision than an Mtx. +// Matrices are stored as Mtxfs then converted to an Mtx when passed to the GPU. +// Mtxs use a union and a long long int to force alignments. Mtxfs are not +// aligned but still use the union for consistency with Mtx. +typedef union { + f32 m[4][4]; + s32 unused; +} Mtxf; + +void matrix_4x4_rotate_vector_in_place(Mtxf *matrix, vec3 vector); + +#endif diff --git a/src/game/mp_watch.c b/src/game/mp_watch.c index 0c9aa63f..edc45e62 100644 --- a/src/game/mp_watch.c +++ b/src/game/mp_watch.c @@ -761,7 +761,7 @@ GLOBAL_ASM( glabel sub_GAME_7F0C24BC /* 0F6FEC 7F0C24BC 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0F6FF0 7F0C24C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F6FF4 7F0C24C4 0FC26919 */ jal get_num_players +/* 0F6FF4 7F0C24C4 0FC26919 */ jal getPlayerCount /* 0F6FF8 7F0C24C8 00000000 */ nop /* 0F6FFC 7F0C24CC 24010001 */ li $at, 1 /* 0F7000 7F0C24D0 14410003 */ bne $v0, $at, .L7F0C24E0 @@ -827,7 +827,7 @@ glabel sub_GAME_7F0C2530 /* 0F7080 7F0C2550 AFB40030 */ sw $s4, 0x30($sp) /* 0F7084 7F0C2554 AFB3002C */ sw $s3, 0x2c($sp) /* 0F7088 7F0C2558 AFB20028 */ sw $s2, 0x28($sp) -/* 0F708C 7F0C255C 0FC26919 */ jal get_num_players +/* 0F708C 7F0C255C 0FC26919 */ jal getPlayerCount /* 0F7090 7F0C2560 AFB00020 */ sw $s0, 0x20($sp) /* 0F7094 7F0C2564 0FC22FEE */ jal get_mission_timer /* 0F7098 7F0C2568 0040F025 */ move $fp, $v0 @@ -1370,9 +1370,9 @@ glabel sub_GAME_7F0C2530 /* 0F7868 7F0C2D38 1320000F */ beqz $t9, .L7F0C2D78 /* 0F786C 7F0C2D3C 00405827 */ not $t3, $v0 /* 0F7870 7F0C2D40 00056840 */ sll $t5, $a1, 1 -/* 0F7874 7F0C2D44 3C188008 */ lui $t8, %hi(ptr_BONDdata_p1) +/* 0F7874 7F0C2D44 3C188008 */ lui $t8, %hi(players) /* 0F7878 7F0C2D48 020B6024 */ and $t4, $s0, $t3 -/* 0F787C 7F0C2D4C 27189EE0 */ addiu $t8, %lo(ptr_BONDdata_p1) # addiu $t8, $t8, -0x6120 +/* 0F787C 7F0C2D4C 27189EE0 */ addiu $t8, %lo(players) # addiu $t8, $t8, -0x6120 /* 0F7880 7F0C2D50 028D7021 */ addu $t6, $s4, $t5 /* 0F7884 7F0C2D54 00167880 */ sll $t7, $s6, 2 /* 0F7888 7F0C2D58 AE4C002C */ sw $t4, 0x2c($s2) @@ -1420,9 +1420,9 @@ glabel sub_GAME_7F0C2530 /* 0F791C 7F0C2DEC 006B6004 */ sllv $t4, $t3, $v1 /* 0F7920 7F0C2DF0 01806827 */ not $t5, $t4 /* 0F7924 7F0C2DF4 00037840 */ sll $t7, $v1, 1 -/* 0F7928 7F0C2DF8 3C098008 */ lui $t1, %hi(ptr_BONDdata_p1) +/* 0F7928 7F0C2DF8 3C098008 */ lui $t1, %hi(players) /* 0F792C 7F0C2DFC 020D7024 */ and $t6, $s0, $t5 -/* 0F7930 7F0C2E00 25299EE0 */ addiu $t1, %lo(ptr_BONDdata_p1) # addiu $t1, $t1, -0x6120 +/* 0F7930 7F0C2E00 25299EE0 */ addiu $t1, %lo(players) # addiu $t1, $t1, -0x6120 /* 0F7934 7F0C2E04 028FC021 */ addu $t8, $s4, $t7 /* 0F7938 7F0C2E08 00164080 */ sll $t0, $s6, 2 /* 0F793C 7F0C2E0C AE4E002C */ sw $t6, 0x2c($s2) @@ -1477,7 +1477,7 @@ glabel sub_GAME_7F0C2E80 /* 0F79B4 7F0C2E84 AFBF0014 */ sw $ra, 0x14($sp) /* 0F79B8 7F0C2E88 0FC26C54 */ jal get_cur_playernum /* 0F79BC 7F0C2E8C 00000000 */ nop -/* 0F79C0 7F0C2E90 0FC26919 */ jal get_num_players +/* 0F79C0 7F0C2E90 0FC26919 */ jal getPlayerCount /* 0F79C4 7F0C2E94 AFA20034 */ sw $v0, 0x34($sp) /* 0F79C8 7F0C2E98 83A40037 */ lb $a0, 0x37($sp) /* 0F79CC 7F0C2E9C 2405FFFE */ li $a1, -2 @@ -1801,8 +1801,8 @@ glabel sub_GAME_7F0C2E80 /* 0F7E74 7F0C3344 31070003 */ andi $a3, $t0, 3 /* 0F7E78 7F0C3348 10E0000E */ beqz $a3, .L7F0C3384 /* 0F7E7C 7F0C334C 00E02825 */ move $a1, $a3 -/* 0F7E80 7F0C3350 3C0B8008 */ lui $t3, %hi(ptr_BONDdata_p1) -/* 0F7E84 7F0C3354 256B9EE0 */ addiu $t3, %lo(ptr_BONDdata_p1) # addiu $t3, $t3, -0x6120 +/* 0F7E80 7F0C3350 3C0B8008 */ lui $t3, %hi(players) +/* 0F7E84 7F0C3354 256B9EE0 */ addiu $t3, %lo(players) # addiu $t3, $t3, -0x6120 /* 0F7E88 7F0C3358 00005080 */ sll $t2, $zero, 2 /* 0F7E8C 7F0C335C 014B1021 */ addu $v0, $t2, $t3 .L7F0C3360: @@ -1817,8 +1817,8 @@ glabel sub_GAME_7F0C2E80 /* 0F7EAC 7F0C337C 24420004 */ addiu $v0, $v0, 4 /* 0F7EB0 7F0C3380 1088001D */ beq $a0, $t0, .L7F0C33F8 .L7F0C3384: -/* 0F7EB4 7F0C3384 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p1) -/* 0F7EB8 7F0C3388 25EF9EE0 */ addiu $t7, %lo(ptr_BONDdata_p1) # addiu $t7, $t7, -0x6120 +/* 0F7EB4 7F0C3384 3C0F8008 */ lui $t7, %hi(players) +/* 0F7EB8 7F0C3388 25EF9EE0 */ addiu $t7, %lo(players) # addiu $t7, $t7, -0x6120 /* 0F7EBC 7F0C338C 00046880 */ sll $t5, $a0, 2 /* 0F7EC0 7F0C3390 0008C080 */ sll $t8, $t0, 2 /* 0F7EC4 7F0C3394 030F2821 */ addu $a1, $t8, $t7 @@ -2246,7 +2246,7 @@ glabel get_points_for_mp_player /* 0F8428 7F0C38F8 AFBF0014 */ sw $ra, 0x14($sp) /* 0F842C 7F0C38FC AFAB0018 */ sw $t3, 0x18($sp) /* 0F8430 7F0C3900 AFA40038 */ sw $a0, 0x38($sp) -/* 0F8434 7F0C3904 0FC26919 */ jal get_num_players +/* 0F8434 7F0C3904 0FC26919 */ jal getPlayerCount /* 0F8438 7F0C3908 AFA70034 */ sw $a3, 0x34($sp) /* 0F843C 7F0C390C AFA00024 */ sw $zero, 0x24($sp) /* 0F8440 7F0C3910 0FC051D6 */ jal get_scenario @@ -2532,7 +2532,7 @@ glabel write_playerrank_to_buffer /* 0F87D0 7F0C3CA0 AFA40080 */ sw $a0, 0x80($sp) /* 0F87D4 7F0C3CA4 0FC051D6 */ jal get_scenario /* 0F87D8 7F0C3CA8 AFA50084 */ sw $a1, 0x84($sp) -/* 0F87DC 7F0C3CAC 0FC26919 */ jal get_num_players +/* 0F87DC 7F0C3CAC 0FC26919 */ jal getPlayerCount /* 0F87E0 7F0C3CB0 AFA2007C */ sw $v0, 0x7c($sp) /* 0F87E4 7F0C3CB4 00405825 */ move $t3, $v0 /* 0F87E8 7F0C3CB8 18400013 */ blez $v0, .L7F0C3D08 @@ -2876,7 +2876,7 @@ glabel mp_watch_menu_display /* 0F8B60 7F0C4030 00808825 */ move $s1, $a0 /* 0F8B64 7F0C4034 0FC26C54 */ jal get_cur_playernum /* 0F8B68 7F0C4038 AFB00034 */ sw $s0, 0x34($sp) -/* 0F8B6C 7F0C403C 0FC26919 */ jal get_num_players +/* 0F8B6C 7F0C403C 0FC26919 */ jal getPlayerCount /* 0F8B70 7F0C4040 AFA200D4 */ sw $v0, 0xd4($sp) /* 0F8B74 7F0C4044 24010001 */ li $at, 1 /* 0F8B78 7F0C4048 00404025 */ move $t0, $v0 @@ -2965,7 +2965,7 @@ text_pause_unpause: text_exit: /* 0F8CA0 7F0C4170 0FC30776 */ jal get_textptr_for_textID /* 0F8CA4 7F0C4174 3404A01A */ li $a0, 40986 -/* 0F8CA8 7F0C4178 0C001145 */ jal get_video2_settings_ulx +/* 0F8CA8 7F0C4178 0C001145 */ jal viGetViewLeft /* 0F8CAC 7F0C417C AFA200A4 */ sw $v0, 0xa4($sp) /* 0F8CB0 7F0C4180 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0F8CB4 7F0C4184 004F2021 */ addu $a0, $v0, $t7 @@ -2983,7 +2983,7 @@ def_7F0C40C0: /* 0F8CDC 7F0C41AC AFA00014 */ sw $zero, 0x14($sp) /* 0F8CE0 7F0C41B0 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F8CE4 7F0C41B4 AFB80010 */ sw $t8, 0x10($sp) -/* 0F8CE8 7F0C41B8 0C001145 */ jal get_video2_settings_ulx +/* 0F8CE8 7F0C41B8 0C001145 */ jal viGetViewLeft /* 0F8CEC 7F0C41BC 00000000 */ nop /* 0F8CF0 7F0C41C0 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F8CF4 7F0C41C4 8FAA00C0 */ lw $t2, 0xc0($sp) @@ -2991,7 +2991,7 @@ def_7F0C40C0: /* 0F8CFC 7F0C41CC 000A5843 */ sra $t3, $t2, 1 /* 0F8D00 7F0C41D0 012B2023 */ subu $a0, $t1, $t3 /* 0F8D04 7F0C41D4 24840050 */ addiu $a0, $a0, 0x50 -/* 0F8D08 7F0C41D8 0C001149 */ jal get_video2_settings_uly +/* 0F8D08 7F0C41D8 0C001149 */ jal viGetViewTop /* 0F8D0C 7F0C41DC AFA400CC */ sw $a0, 0xcc($sp) /* 0F8D10 7F0C41E0 8FAC00BC */ lw $t4, 0xbc($sp) /* 0F8D14 7F0C41E4 000C6843 */ sra $t5, $t4, 1 @@ -3059,7 +3059,7 @@ def_7F0C40C0: /* 0F8E04 7F0C42D4 00000000 */ nop /* 0F8E08 7F0C42D8 10400056 */ beqz $v0, .L7F0C4434 /* 0F8E0C 7F0C42DC 00000000 */ nop -/* 0F8E10 7F0C42E0 0C001145 */ jal get_video2_settings_ulx +/* 0F8E10 7F0C42E0 0C001145 */ jal viGetViewLeft /* 0F8E14 7F0C42E4 00000000 */ nop /* 0F8E18 7F0C42E8 3C038009 */ lui $v1, %hi(is_gameover_flag) /* 0F8E1C 7F0C42EC 8C63C704 */ lw $v1, %lo(is_gameover_flag)($v1) @@ -3082,7 +3082,7 @@ def_7F0C40C0: /* 0F8E5C 7F0C432C 2484FFF8 */ addiu $a0, $a0, -8 /* 0F8E60 7F0C4330 AFA400CC */ sw $a0, 0xcc($sp) .L7F0C4334: -/* 0F8E64 7F0C4334 0C001149 */ jal get_video2_settings_uly +/* 0F8E64 7F0C4334 0C001149 */ jal viGetViewTop /* 0F8E68 7F0C4338 00000000 */ nop /* 0F8E6C 7F0C433C 3C0E8009 */ lui $t6, %hi(dword_CODE_bss_8008C708) /* 0F8E70 7F0C4340 8DCEC708 */ lw $t6, %lo(dword_CODE_bss_8008C708)($t6) @@ -3152,7 +3152,7 @@ def_7F0C40C0: /* 0F8F68 7F0C4438 00000000 */ nop /* 0F8F6C 7F0C443C 10400056 */ beqz $v0, .L7F0C4598 /* 0F8F70 7F0C4440 00000000 */ nop -/* 0F8F74 7F0C4444 0C001145 */ jal get_video2_settings_ulx +/* 0F8F74 7F0C4444 0C001145 */ jal viGetViewLeft /* 0F8F78 7F0C4448 00000000 */ nop /* 0F8F7C 7F0C444C 3C038009 */ lui $v1, %hi(is_gameover_flag) /* 0F8F80 7F0C4450 8C63C704 */ lw $v1, %lo(is_gameover_flag)($v1) @@ -3175,7 +3175,7 @@ def_7F0C40C0: /* 0F8FC0 7F0C4490 24840008 */ addiu $a0, $a0, 8 /* 0F8FC4 7F0C4494 AFA400CC */ sw $a0, 0xcc($sp) .L7F0C4498: -/* 0F8FC8 7F0C4498 0C001149 */ jal get_video2_settings_uly +/* 0F8FC8 7F0C4498 0C001149 */ jal viGetViewTop /* 0F8FCC 7F0C449C 00000000 */ nop /* 0F8FD0 7F0C44A0 3C0D8009 */ lui $t5, %hi(dword_CODE_bss_8008C708) /* 0F8FD4 7F0C44A4 8DADC708 */ lw $t5, %lo(dword_CODE_bss_8008C708)($t5) @@ -3293,7 +3293,7 @@ def_7F0C40C0: /* 0F917C 7F0C464C AFA00014 */ sw $zero, 0x14($sp) /* 0F9180 7F0C4650 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F9184 7F0C4654 AFAA0010 */ sw $t2, 0x10($sp) -/* 0F9188 7F0C4658 0C001145 */ jal get_video2_settings_ulx +/* 0F9188 7F0C4658 0C001145 */ jal viGetViewLeft /* 0F918C 7F0C465C 00000000 */ nop /* 0F9190 7F0C4660 8FA900A8 */ lw $t1, 0xa8($sp) /* 0F9194 7F0C4664 8FAC00C0 */ lw $t4, 0xc0($sp) @@ -3301,7 +3301,7 @@ def_7F0C40C0: /* 0F919C 7F0C466C 000C6843 */ sra $t5, $t4, 1 /* 0F91A0 7F0C4670 016D2023 */ subu $a0, $t3, $t5 /* 0F91A4 7F0C4674 24840050 */ addiu $a0, $a0, 0x50 -/* 0F91A8 7F0C4678 0C001149 */ jal get_video2_settings_uly +/* 0F91A8 7F0C4678 0C001149 */ jal viGetViewTop /* 0F91AC 7F0C467C AFA400CC */ sw $a0, 0xcc($sp) /* 0F91B0 7F0C4680 8FAE00BC */ lw $t6, 0xbc($sp) /* 0F91B4 7F0C4684 000E7843 */ sra $t7, $t6, 1 @@ -3363,7 +3363,7 @@ def_7F0C40C0: /* 0F928C 7F0C475C AFA00014 */ sw $zero, 0x14($sp) /* 0F9290 7F0C4760 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F9294 7F0C4764 AFAF0010 */ sw $t7, 0x10($sp) -/* 0F9298 7F0C4768 0C001145 */ jal get_video2_settings_ulx +/* 0F9298 7F0C4768 0C001145 */ jal viGetViewLeft /* 0F929C 7F0C476C 00000000 */ nop /* 0F92A0 7F0C4770 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F92A4 7F0C4774 8FAA00C0 */ lw $t2, 0xc0($sp) @@ -3371,7 +3371,7 @@ def_7F0C40C0: /* 0F92AC 7F0C477C 000A4843 */ sra $t1, $t2, 1 /* 0F92B0 7F0C4780 03092023 */ subu $a0, $t8, $t1 /* 0F92B4 7F0C4784 24840050 */ addiu $a0, $a0, 0x50 -/* 0F92B8 7F0C4788 0C001149 */ jal get_video2_settings_uly +/* 0F92B8 7F0C4788 0C001149 */ jal viGetViewTop /* 0F92BC 7F0C478C AFA400CC */ sw $a0, 0xcc($sp) /* 0F92C0 7F0C4790 8FAC00BC */ lw $t4, 0xbc($sp) /* 0F92C4 7F0C4794 000C5843 */ sra $t3, $t4, 1 @@ -3447,11 +3447,11 @@ def_7F0C40C0: /* 0F93CC 7F0C489C 24010002 */ li $at, 2 /* 0F93D0 7F0C48A0 1581004E */ bne $t4, $at, .L7F0C49DC /* 0F93D4 7F0C48A4 00000000 */ nop -/* 0F93D8 7F0C48A8 0C001145 */ jal get_video2_settings_ulx +/* 0F93D8 7F0C48A8 0C001145 */ jal viGetViewLeft /* 0F93DC 7F0C48AC 00000000 */ nop /* 0F93E0 7F0C48B0 00028400 */ sll $s0, $v0, 0x10 /* 0F93E4 7F0C48B4 00105C03 */ sra $t3, $s0, 0x10 -/* 0F93E8 7F0C48B8 0C001149 */ jal get_video2_settings_uly +/* 0F93E8 7F0C48B8 0C001149 */ jal viGetViewTop /* 0F93EC 7F0C48BC 01608025 */ move $s0, $t3 /* 0F93F0 7F0C48C0 8FA800D4 */ lw $t0, 0xd4($sp) /* 0F93F4 7F0C48C4 00021C00 */ sll $v1, $v0, 0x10 @@ -3487,11 +3487,11 @@ def_7F0C40C0: /* 0F9460 7F0C4930 8FA70094 */ lw $a3, 0x94($sp) /* 0F9464 7F0C4934 0FC30D68 */ jal display_text_for_playerdata_on_MP_menu /* 0F9468 7F0C4938 AFA90010 */ sw $t1, 0x10($sp) -/* 0F946C 7F0C493C 0C001145 */ jal get_video2_settings_ulx +/* 0F946C 7F0C493C 0C001145 */ jal viGetViewLeft /* 0F9470 7F0C4940 00408825 */ move $s1, $v0 /* 0F9474 7F0C4944 00028400 */ sll $s0, $v0, 0x10 /* 0F9478 7F0C4948 00106403 */ sra $t4, $s0, 0x10 -/* 0F947C 7F0C494C 0C001149 */ jal get_video2_settings_uly +/* 0F947C 7F0C494C 0C001149 */ jal viGetViewTop /* 0F9480 7F0C4950 01808025 */ move $s0, $t4 /* 0F9484 7F0C4954 8FA400D4 */ lw $a0, 0xd4($sp) /* 0F9488 7F0C4958 00021C00 */ sll $v1, $v0, 0x10 @@ -3531,11 +3531,11 @@ def_7F0C40C0: /* 0F9504 7F0C49D4 1000009E */ b .L7F0C4C50 /* 0F9508 7F0C49D8 00408825 */ move $s1, $v0 .L7F0C49DC: -/* 0F950C 7F0C49DC 0C001145 */ jal get_video2_settings_ulx +/* 0F950C 7F0C49DC 0C001145 */ jal viGetViewLeft /* 0F9510 7F0C49E0 00000000 */ nop /* 0F9514 7F0C49E4 00028400 */ sll $s0, $v0, 0x10 /* 0F9518 7F0C49E8 00106403 */ sra $t4, $s0, 0x10 -/* 0F951C 7F0C49EC 0C001149 */ jal get_video2_settings_uly +/* 0F951C 7F0C49EC 0C001149 */ jal viGetViewTop /* 0F9520 7F0C49F0 01808025 */ move $s0, $t4 /* 0F9524 7F0C49F4 8FA800D4 */ lw $t0, 0xd4($sp) /* 0F9528 7F0C49F8 00021C00 */ sll $v1, $v0, 0x10 @@ -3571,11 +3571,11 @@ def_7F0C40C0: /* 0F9594 7F0C4A64 8FA70094 */ lw $a3, 0x94($sp) /* 0F9598 7F0C4A68 0FC30D68 */ jal display_text_for_playerdata_on_MP_menu /* 0F959C 7F0C4A6C AFB80010 */ sw $t8, 0x10($sp) -/* 0F95A0 7F0C4A70 0C001145 */ jal get_video2_settings_ulx +/* 0F95A0 7F0C4A70 0C001145 */ jal viGetViewLeft /* 0F95A4 7F0C4A74 00408825 */ move $s1, $v0 /* 0F95A8 7F0C4A78 00028400 */ sll $s0, $v0, 0x10 /* 0F95AC 7F0C4A7C 00104C03 */ sra $t1, $s0, 0x10 -/* 0F95B0 7F0C4A80 0C001149 */ jal get_video2_settings_uly +/* 0F95B0 7F0C4A80 0C001149 */ jal viGetViewTop /* 0F95B4 7F0C4A84 01208025 */ move $s0, $t1 /* 0F95B8 7F0C4A88 8FA800D4 */ lw $t0, 0xd4($sp) /* 0F95BC 7F0C4A8C 00021C00 */ sll $v1, $v0, 0x10 @@ -3612,11 +3612,11 @@ def_7F0C40C0: /* 0F962C 7F0C4AFC 8FA70098 */ lw $a3, 0x98($sp) /* 0F9630 7F0C4B00 0FC30D68 */ jal display_text_for_playerdata_on_MP_menu /* 0F9634 7F0C4B04 AFAA0010 */ sw $t2, 0x10($sp) -/* 0F9638 7F0C4B08 0C001145 */ jal get_video2_settings_ulx +/* 0F9638 7F0C4B08 0C001145 */ jal viGetViewLeft /* 0F963C 7F0C4B0C 00408825 */ move $s1, $v0 /* 0F9640 7F0C4B10 00028400 */ sll $s0, $v0, 0x10 /* 0F9644 7F0C4B14 0010C403 */ sra $t8, $s0, 0x10 -/* 0F9648 7F0C4B18 0C001149 */ jal get_video2_settings_uly +/* 0F9648 7F0C4B18 0C001149 */ jal viGetViewTop /* 0F964C 7F0C4B1C 03008025 */ move $s0, $t8 /* 0F9650 7F0C4B20 8FA800D4 */ lw $t0, 0xd4($sp) /* 0F9654 7F0C4B24 00021C00 */ sll $v1, $v0, 0x10 @@ -3658,11 +3658,11 @@ def_7F0C40C0: /* 0F96D8 7F0C4BA8 00408825 */ move $s1, $v0 /* 0F96DC 7F0C4BAC 15410028 */ bne $t2, $at, .L7F0C4C50 /* 0F96E0 7F0C4BB0 00000000 */ nop -/* 0F96E4 7F0C4BB4 0C001145 */ jal get_video2_settings_ulx +/* 0F96E4 7F0C4BB4 0C001145 */ jal viGetViewLeft /* 0F96E8 7F0C4BB8 00000000 */ nop /* 0F96EC 7F0C4BBC 00028400 */ sll $s0, $v0, 0x10 /* 0F96F0 7F0C4BC0 0010C403 */ sra $t8, $s0, 0x10 -/* 0F96F4 7F0C4BC4 0C001149 */ jal get_video2_settings_uly +/* 0F96F4 7F0C4BC4 0C001149 */ jal viGetViewTop /* 0F96F8 7F0C4BC8 03008025 */ move $s0, $t8 /* 0F96FC 7F0C4BCC 8FA400D4 */ lw $a0, 0xd4($sp) /* 0F9700 7F0C4BD0 00021C00 */ sll $v1, $v0, 0x10 @@ -3733,7 +3733,7 @@ def_7F0C40C0: /* 0F97EC 7F0C4CBC AFA00014 */ sw $zero, 0x14($sp) /* 0F97F0 7F0C4CC0 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F97F4 7F0C4CC4 AFAC0010 */ sw $t4, 0x10($sp) -/* 0F97F8 7F0C4CC8 0C001145 */ jal get_video2_settings_ulx +/* 0F97F8 7F0C4CC8 0C001145 */ jal viGetViewLeft /* 0F97FC 7F0C4CCC 00000000 */ nop /* 0F9800 7F0C4CD0 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0F9804 7F0C4CD4 8FAF00C0 */ lw $t7, 0xc0($sp) @@ -3741,7 +3741,7 @@ def_7F0C40C0: /* 0F980C 7F0C4CDC 000FC843 */ sra $t9, $t7, 1 /* 0F9810 7F0C4CE0 01B92023 */ subu $a0, $t5, $t9 /* 0F9814 7F0C4CE4 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9818 7F0C4CE8 0C001149 */ jal get_video2_settings_uly +/* 0F9818 7F0C4CE8 0C001149 */ jal viGetViewTop /* 0F981C 7F0C4CEC AFA400CC */ sw $a0, 0xcc($sp) /* 0F9820 7F0C4CF0 8FAE00BC */ lw $t6, 0xbc($sp) /* 0F9824 7F0C4CF4 000E5043 */ sra $t2, $t6, 1 @@ -3796,7 +3796,7 @@ def_7F0C40C0: /* 0F98E4 7F0C4DB4 AFA00014 */ sw $zero, 0x14($sp) /* 0F98E8 7F0C4DB8 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F98EC 7F0C4DBC AFB90010 */ sw $t9, 0x10($sp) -/* 0F98F0 7F0C4DC0 0C001145 */ jal get_video2_settings_ulx +/* 0F98F0 7F0C4DC0 0C001145 */ jal viGetViewLeft /* 0F98F4 7F0C4DC4 00000000 */ nop /* 0F98F8 7F0C4DC8 8FAE00A8 */ lw $t6, 0xa8($sp) /* 0F98FC 7F0C4DCC 8FB800C0 */ lw $t8, 0xc0($sp) @@ -3804,7 +3804,7 @@ def_7F0C40C0: /* 0F9904 7F0C4DD4 00184843 */ sra $t1, $t8, 1 /* 0F9908 7F0C4DD8 01492023 */ subu $a0, $t2, $t1 /* 0F990C 7F0C4DDC 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9910 7F0C4DE0 0C001149 */ jal get_video2_settings_uly +/* 0F9910 7F0C4DE0 0C001149 */ jal viGetViewTop /* 0F9914 7F0C4DE4 AFA400CC */ sw $a0, 0xcc($sp) /* 0F9918 7F0C4DE8 8FAC00BC */ lw $t4, 0xbc($sp) /* 0F991C 7F0C4DEC 000C5843 */ sra $t3, $t4, 1 @@ -3842,11 +3842,11 @@ def_7F0C40C0: /* 0F999C 7F0C4E6C 8FA200D4 */ lw $v0, 0xd4($sp) /* 0F99A0 7F0C4E70 50400018 */ beql $v0, $zero, .L7F0C4ED4 /* 0F99A4 7F0C4E74 24010001 */ li $at, 1 -/* 0F99A8 7F0C4E78 0C001145 */ jal get_video2_settings_ulx +/* 0F99A8 7F0C4E78 0C001145 */ jal viGetViewLeft /* 0F99AC 7F0C4E7C 00000000 */ nop /* 0F99B0 7F0C4E80 00028400 */ sll $s0, $v0, 0x10 /* 0F99B4 7F0C4E84 00106403 */ sra $t4, $s0, 0x10 -/* 0F99B8 7F0C4E88 0C001149 */ jal get_video2_settings_uly +/* 0F99B8 7F0C4E88 0C001149 */ jal viGetViewTop /* 0F99BC 7F0C4E8C 01808025 */ move $s0, $t4 /* 0F99C0 7F0C4E90 8FAF00D4 */ lw $t7, 0xd4($sp) /* 0F99C4 7F0C4E94 8FAB00A8 */ lw $t3, 0xa8($sp) @@ -3873,11 +3873,11 @@ def_7F0C40C0: /* 0F9A14 7F0C4EE4 25CE9EF0 */ addiu $t6, %lo(player1_player_data) # addiu $t6, $t6, -0x6110 /* 0F9A18 7F0C4EE8 0019C900 */ sll $t9, $t9, 4 /* 0F9A1C 7F0C4EEC 032EC021 */ addu $t8, $t9, $t6 -/* 0F9A20 7F0C4EF0 0C001145 */ jal get_video2_settings_ulx +/* 0F9A20 7F0C4EF0 0C001145 */ jal viGetViewLeft /* 0F9A24 7F0C4EF4 AFB80044 */ sw $t8, 0x44($sp) /* 0F9A28 7F0C4EF8 00028400 */ sll $s0, $v0, 0x10 /* 0F9A2C 7F0C4EFC 00105403 */ sra $t2, $s0, 0x10 -/* 0F9A30 7F0C4F00 0C001149 */ jal get_video2_settings_uly +/* 0F9A30 7F0C4F00 0C001149 */ jal viGetViewTop /* 0F9A34 7F0C4F04 01408025 */ move $s0, $t2 /* 0F9A38 7F0C4F08 8FA900A8 */ lw $t1, 0xa8($sp) /* 0F9A3C 7F0C4F0C 8FAC0044 */ lw $t4, 0x44($sp) @@ -3893,11 +3893,11 @@ def_7F0C40C0: .L7F0C4F34: /* 0F9A64 7F0C4F34 50400018 */ beql $v0, $zero, .L7F0C4F98 /* 0F9A68 7F0C4F38 24010001 */ li $at, 1 -/* 0F9A6C 7F0C4F3C 0C001145 */ jal get_video2_settings_ulx +/* 0F9A6C 7F0C4F3C 0C001145 */ jal viGetViewLeft /* 0F9A70 7F0C4F40 00000000 */ nop /* 0F9A74 7F0C4F44 00028400 */ sll $s0, $v0, 0x10 /* 0F9A78 7F0C4F48 00105C03 */ sra $t3, $s0, 0x10 -/* 0F9A7C 7F0C4F4C 0C001149 */ jal get_video2_settings_uly +/* 0F9A7C 7F0C4F4C 0C001149 */ jal viGetViewTop /* 0F9A80 7F0C4F50 01608025 */ move $s0, $t3 /* 0F9A84 7F0C4F54 8FAD00D4 */ lw $t5, 0xd4($sp) /* 0F9A88 7F0C4F58 8FAF00A8 */ lw $t7, 0xa8($sp) @@ -3924,11 +3924,11 @@ def_7F0C40C0: /* 0F9AD8 7F0C4FA8 27189EF0 */ addiu $t8, %lo(player1_player_data) # addiu $t8, $t8, -0x6110 /* 0F9ADC 7F0C4FAC 000E7100 */ sll $t6, $t6, 4 /* 0F9AE0 7F0C4FB0 01D85021 */ addu $t2, $t6, $t8 -/* 0F9AE4 7F0C4FB4 0C001145 */ jal get_video2_settings_ulx +/* 0F9AE4 7F0C4FB4 0C001145 */ jal viGetViewLeft /* 0F9AE8 7F0C4FB8 AFAA0044 */ sw $t2, 0x44($sp) /* 0F9AEC 7F0C4FBC 00028400 */ sll $s0, $v0, 0x10 /* 0F9AF0 7F0C4FC0 00104C03 */ sra $t1, $s0, 0x10 -/* 0F9AF4 7F0C4FC4 0C001149 */ jal get_video2_settings_uly +/* 0F9AF4 7F0C4FC4 0C001149 */ jal viGetViewTop /* 0F9AF8 7F0C4FC8 01208025 */ move $s0, $t1 /* 0F9AFC 7F0C4FCC 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0F9B00 7F0C4FD0 8FAB0044 */ lw $t3, 0x44($sp) @@ -3950,11 +3950,11 @@ def_7F0C40C0: /* 0F9B3C 7F0C500C 25AD9EF0 */ addiu $t5, %lo(player1_player_data) # addiu $t5, $t5, -0x6110 /* 0F9B40 7F0C5010 000F7900 */ sll $t7, $t7, 4 /* 0F9B44 7F0C5014 01EDC821 */ addu $t9, $t7, $t5 -/* 0F9B48 7F0C5018 0C001145 */ jal get_video2_settings_ulx +/* 0F9B48 7F0C5018 0C001145 */ jal viGetViewLeft /* 0F9B4C 7F0C501C AFB90044 */ sw $t9, 0x44($sp) /* 0F9B50 7F0C5020 00028400 */ sll $s0, $v0, 0x10 /* 0F9B54 7F0C5024 00107403 */ sra $t6, $s0, 0x10 -/* 0F9B58 7F0C5028 0C001149 */ jal get_video2_settings_uly +/* 0F9B58 7F0C5028 0C001149 */ jal viGetViewTop /* 0F9B5C 7F0C502C 01C08025 */ move $s0, $t6 /* 0F9B60 7F0C5030 8FB800A8 */ lw $t8, 0xa8($sp) /* 0F9B64 7F0C5034 8FAA0044 */ lw $t2, 0x44($sp) @@ -3979,11 +3979,11 @@ def_7F0C40C0: /* 0F9BAC 7F0C507C 256B9EF0 */ addiu $t3, %lo(player1_player_data) # addiu $t3, $t3, -0x6110 /* 0F9BB0 7F0C5080 000C6100 */ sll $t4, $t4, 4 /* 0F9BB4 7F0C5084 018B7821 */ addu $t7, $t4, $t3 -/* 0F9BB8 7F0C5088 0C001145 */ jal get_video2_settings_ulx +/* 0F9BB8 7F0C5088 0C001145 */ jal viGetViewLeft /* 0F9BBC 7F0C508C AFAF0044 */ sw $t7, 0x44($sp) /* 0F9BC0 7F0C5090 00028400 */ sll $s0, $v0, 0x10 /* 0F9BC4 7F0C5094 00106C03 */ sra $t5, $s0, 0x10 -/* 0F9BC8 7F0C5098 0C001149 */ jal get_video2_settings_uly +/* 0F9BC8 7F0C5098 0C001149 */ jal viGetViewTop /* 0F9BCC 7F0C509C 01A08025 */ move $s0, $t5 /* 0F9BD0 7F0C50A0 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F9BD4 7F0C50A4 8FAE0044 */ lw $t6, 0x44($sp) @@ -4028,7 +4028,7 @@ def_7F0C40C0: /* 0F9C64 7F0C5134 AFA00014 */ sw $zero, 0x14($sp) /* 0F9C68 7F0C5138 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F9C6C 7F0C513C AFA90010 */ sw $t1, 0x10($sp) -/* 0F9C70 7F0C5140 0C001145 */ jal get_video2_settings_ulx +/* 0F9C70 7F0C5140 0C001145 */ jal viGetViewLeft /* 0F9C74 7F0C5144 00000000 */ nop /* 0F9C78 7F0C5148 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0F9C7C 7F0C514C 8FAF00C0 */ lw $t7, 0xc0($sp) @@ -4036,7 +4036,7 @@ def_7F0C40C0: /* 0F9C84 7F0C5154 000F6843 */ sra $t5, $t7, 1 /* 0F9C88 7F0C5158 016D2023 */ subu $a0, $t3, $t5 /* 0F9C8C 7F0C515C 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9C90 7F0C5160 0C001149 */ jal get_video2_settings_uly +/* 0F9C90 7F0C5160 0C001149 */ jal viGetViewTop /* 0F9C94 7F0C5164 AFA400CC */ sw $a0, 0xcc($sp) /* 0F9C98 7F0C5168 8FB900BC */ lw $t9, 0xbc($sp) /* 0F9C9C 7F0C516C 00197043 */ sra $t6, $t9, 1 @@ -4091,7 +4091,7 @@ def_7F0C40C0: /* 0F9D5C 7F0C522C AFA00014 */ sw $zero, 0x14($sp) /* 0F9D60 7F0C5230 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0F9D64 7F0C5234 AFAD0010 */ sw $t5, 0x10($sp) -/* 0F9D68 7F0C5238 0C001145 */ jal get_video2_settings_ulx +/* 0F9D68 7F0C5238 0C001145 */ jal viGetViewLeft /* 0F9D6C 7F0C523C 00000000 */ nop /* 0F9D70 7F0C5240 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F9D74 7F0C5244 8FB800C0 */ lw $t8, 0xc0($sp) @@ -4099,7 +4099,7 @@ def_7F0C40C0: /* 0F9D7C 7F0C524C 00185043 */ sra $t2, $t8, 1 /* 0F9D80 7F0C5250 01CA2023 */ subu $a0, $t6, $t2 /* 0F9D84 7F0C5254 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9D88 7F0C5258 0C001149 */ jal get_video2_settings_uly +/* 0F9D88 7F0C5258 0C001149 */ jal viGetViewTop /* 0F9D8C 7F0C525C AFA400CC */ sw $a0, 0xcc($sp) /* 0F9D90 7F0C5260 8FA900BC */ lw $t1, 0xbc($sp) /* 0F9D94 7F0C5264 00096043 */ sra $t4, $t1, 1 @@ -4138,11 +4138,11 @@ def_7F0C40C0: /* 0F9E18 7F0C52E8 3C0D8008 */ lui $t5, %hi(player1_player_data + 0x24) /* 0F9E1C 7F0C52EC 10400016 */ beqz $v0, .L7F0C5348 /* 0F9E20 7F0C52F0 00000000 */ nop -/* 0F9E24 7F0C52F4 0C001145 */ jal get_video2_settings_ulx +/* 0F9E24 7F0C52F4 0C001145 */ jal viGetViewLeft /* 0F9E28 7F0C52F8 00000000 */ nop /* 0F9E2C 7F0C52FC 00028400 */ sll $s0, $v0, 0x10 /* 0F9E30 7F0C5300 00104C03 */ sra $t1, $s0, 0x10 -/* 0F9E34 7F0C5304 0C001149 */ jal get_video2_settings_uly +/* 0F9E34 7F0C5304 0C001149 */ jal viGetViewTop /* 0F9E38 7F0C5308 01208025 */ move $s0, $t1 /* 0F9E3C 7F0C530C 8FAF00D4 */ lw $t7, 0xd4($sp) /* 0F9E40 7F0C5310 8FAC00A8 */ lw $t4, 0xa8($sp) @@ -4163,11 +4163,11 @@ def_7F0C40C0: /* 0F9E78 7F0C5348 8DAD9F14 */ lw $t5, %lo(player1_player_data + 0x24)($t5) /* 0F9E7C 7F0C534C 59A00017 */ blezl $t5, .L7F0C53AC /* 0F9E80 7F0C5350 24010001 */ li $at, 1 -/* 0F9E84 7F0C5354 0C001145 */ jal get_video2_settings_ulx +/* 0F9E84 7F0C5354 0C001145 */ jal viGetViewLeft /* 0F9E88 7F0C5358 00000000 */ nop /* 0F9E8C 7F0C535C 00028400 */ sll $s0, $v0, 0x10 /* 0F9E90 7F0C5360 0010CC03 */ sra $t9, $s0, 0x10 -/* 0F9E94 7F0C5364 0C001149 */ jal get_video2_settings_uly +/* 0F9E94 7F0C5364 0C001149 */ jal viGetViewTop /* 0F9E98 7F0C5368 03208025 */ move $s0, $t9 /* 0F9E9C 7F0C536C 8FAE00D4 */ lw $t6, 0xd4($sp) /* 0F9EA0 7F0C5370 8FB800A8 */ lw $t8, 0xa8($sp) @@ -4193,11 +4193,11 @@ def_7F0C40C0: /* 0F9EE8 7F0C53B8 25EF9EF0 */ addiu $t7, %lo(player1_player_data) # addiu $t7, $t7, -0x6110 /* 0F9EEC 7F0C53BC 00026080 */ sll $t4, $v0, 2 /* 0F9EF0 7F0C53C0 018F5821 */ addu $t3, $t4, $t7 -/* 0F9EF4 7F0C53C4 0C001145 */ jal get_video2_settings_ulx +/* 0F9EF4 7F0C53C4 0C001145 */ jal viGetViewLeft /* 0F9EF8 7F0C53C8 AFAB0044 */ sw $t3, 0x44($sp) /* 0F9EFC 7F0C53CC 00028400 */ sll $s0, $v0, 0x10 /* 0F9F00 7F0C53D0 00106C03 */ sra $t5, $s0, 0x10 -/* 0F9F04 7F0C53D4 0C001149 */ jal get_video2_settings_uly +/* 0F9F04 7F0C53D4 0C001149 */ jal viGetViewTop /* 0F9F08 7F0C53D8 01A08025 */ move $s0, $t5 /* 0F9F0C 7F0C53DC 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F9F10 7F0C53E0 8FB80044 */ lw $t8, 0x44($sp) @@ -4217,11 +4217,11 @@ def_7F0C40C0: /* 0F9F44 7F0C5414 19C000D7 */ blez $t6, .L7F0C5774 /* 0F9F48 7F0C5418 00025080 */ sll $t2, $v0, 2 /* 0F9F4C 7F0C541C 01496021 */ addu $t4, $t2, $t1 -/* 0F9F50 7F0C5420 0C001145 */ jal get_video2_settings_ulx +/* 0F9F50 7F0C5420 0C001145 */ jal viGetViewLeft /* 0F9F54 7F0C5424 AFAC0044 */ sw $t4, 0x44($sp) /* 0F9F58 7F0C5428 00028400 */ sll $s0, $v0, 0x10 /* 0F9F5C 7F0C542C 00107C03 */ sra $t7, $s0, 0x10 -/* 0F9F60 7F0C5430 0C001149 */ jal get_video2_settings_uly +/* 0F9F60 7F0C5430 0C001149 */ jal viGetViewTop /* 0F9F64 7F0C5434 01E08025 */ move $s0, $t7 /* 0F9F68 7F0C5438 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0F9F6C 7F0C543C 8FAD0044 */ lw $t5, 0x44($sp) @@ -4238,11 +4238,11 @@ def_7F0C40C0: .L7F0C5468: /* 0F9F98 7F0C5468 13000015 */ beqz $t8, .L7F0C54C0 /* 0F9F9C 7F0C546C 3C0F8008 */ lui $t7, %hi(player1_player_data + 0x24) -/* 0F9FA0 7F0C5470 0C001145 */ jal get_video2_settings_ulx +/* 0F9FA0 7F0C5470 0C001145 */ jal viGetViewLeft /* 0F9FA4 7F0C5474 00000000 */ nop /* 0F9FA8 7F0C5478 00028400 */ sll $s0, $v0, 0x10 /* 0F9FAC 7F0C547C 00107403 */ sra $t6, $s0, 0x10 -/* 0F9FB0 7F0C5480 0C001149 */ jal get_video2_settings_uly +/* 0F9FB0 7F0C5480 0C001149 */ jal viGetViewTop /* 0F9FB4 7F0C5484 01C08025 */ move $s0, $t6 /* 0F9FB8 7F0C5488 8FA900D4 */ lw $t1, 0xd4($sp) /* 0F9FBC 7F0C548C 8FAA00A8 */ lw $t2, 0xa8($sp) @@ -4262,11 +4262,11 @@ def_7F0C40C0: /* 0F9FF0 7F0C54C0 8DEF9F14 */ lw $t7, %lo(player1_player_data + 0x24)($t7) /* 0F9FF4 7F0C54C4 59E00016 */ blezl $t7, .L7F0C5520 /* 0F9FF8 7F0C54C8 8FAA00D4 */ lw $t2, 0xd4($sp) -/* 0F9FFC 7F0C54CC 0C001145 */ jal get_video2_settings_ulx +/* 0F9FFC 7F0C54CC 0C001145 */ jal viGetViewLeft /* 0FA000 7F0C54D0 00000000 */ nop /* 0FA004 7F0C54D4 00028400 */ sll $s0, $v0, 0x10 /* 0FA008 7F0C54D8 00105C03 */ sra $t3, $s0, 0x10 -/* 0FA00C 7F0C54DC 0C001149 */ jal get_video2_settings_uly +/* 0FA00C 7F0C54DC 0C001149 */ jal viGetViewTop /* 0FA010 7F0C54E0 01608025 */ move $s0, $t3 /* 0FA014 7F0C54E4 8FB900D4 */ lw $t9, 0xd4($sp) /* 0FA018 7F0C54E8 8FAD00A8 */ lw $t5, 0xa8($sp) @@ -4292,11 +4292,11 @@ def_7F0C40C0: /* 0FA060 7F0C5530 3C0C8008 */ lui $t4, %hi(player1_player_data) /* 0FA064 7F0C5534 258C9EF0 */ addiu $t4, %lo(player1_player_data) # addiu $t4, $t4, -0x6110 /* 0FA068 7F0C5538 012C7821 */ addu $t7, $t1, $t4 -/* 0FA06C 7F0C553C 0C001145 */ jal get_video2_settings_ulx +/* 0FA06C 7F0C553C 0C001145 */ jal viGetViewLeft /* 0FA070 7F0C5540 AFAF0044 */ sw $t7, 0x44($sp) /* 0FA074 7F0C5544 00028400 */ sll $s0, $v0, 0x10 /* 0FA078 7F0C5548 00105C03 */ sra $t3, $s0, 0x10 -/* 0FA07C 7F0C554C 0C001149 */ jal get_video2_settings_uly +/* 0FA07C 7F0C554C 0C001149 */ jal viGetViewTop /* 0FA080 7F0C5550 01608025 */ move $s0, $t3 /* 0FA084 7F0C5554 8FAD00A8 */ lw $t5, 0xa8($sp) /* 0FA088 7F0C5558 8FB90044 */ lw $t9, 0x44($sp) @@ -4317,11 +4317,11 @@ def_7F0C40C0: /* 0FA0C0 7F0C5590 000E5080 */ sll $t2, $t6, 2 /* 0FA0C4 7F0C5594 25299EF0 */ addiu $t1, %lo(player1_player_data) # addiu $t1, $t1, -0x6110 /* 0FA0C8 7F0C5598 01496021 */ addu $t4, $t2, $t1 -/* 0FA0CC 7F0C559C 0C001145 */ jal get_video2_settings_ulx +/* 0FA0CC 7F0C559C 0C001145 */ jal viGetViewLeft /* 0FA0D0 7F0C55A0 AFAC0044 */ sw $t4, 0x44($sp) /* 0FA0D4 7F0C55A4 00028400 */ sll $s0, $v0, 0x10 /* 0FA0D8 7F0C55A8 00107C03 */ sra $t7, $s0, 0x10 -/* 0FA0DC 7F0C55AC 0C001149 */ jal get_video2_settings_uly +/* 0FA0DC 7F0C55AC 0C001149 */ jal viGetViewTop /* 0FA0E0 7F0C55B0 01E08025 */ move $s0, $t7 /* 0FA0E4 7F0C55B4 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FA0E8 7F0C55B8 8FAD0044 */ lw $t5, 0x44($sp) @@ -4343,11 +4343,11 @@ def_7F0C40C0: /* 0FA124 7F0C55F4 3C0A8008 */ lui $t2, %hi(player1_player_data) /* 0FA128 7F0C55F8 254A9EF0 */ addiu $t2, %lo(player1_player_data) # addiu $t2, $t2, -0x6110 /* 0FA12C 7F0C55FC 01CA4821 */ addu $t1, $t6, $t2 -/* 0FA130 7F0C5600 0C001145 */ jal get_video2_settings_ulx +/* 0FA130 7F0C5600 0C001145 */ jal viGetViewLeft /* 0FA134 7F0C5604 AFA90044 */ sw $t1, 0x44($sp) /* 0FA138 7F0C5608 00028400 */ sll $s0, $v0, 0x10 /* 0FA13C 7F0C560C 00106403 */ sra $t4, $s0, 0x10 -/* 0FA140 7F0C5610 0C001149 */ jal get_video2_settings_uly +/* 0FA140 7F0C5610 0C001149 */ jal viGetViewTop /* 0FA144 7F0C5614 01808025 */ move $s0, $t4 /* 0FA148 7F0C5618 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0FA14C 7F0C561C 8FAB0044 */ lw $t3, 0x44($sp) @@ -4368,11 +4368,11 @@ def_7F0C40C0: /* 0FA184 7F0C5654 0019C080 */ sll $t8, $t9, 2 /* 0FA188 7F0C5658 25CE9EF0 */ addiu $t6, %lo(player1_player_data) # addiu $t6, $t6, -0x6110 /* 0FA18C 7F0C565C 030E5021 */ addu $t2, $t8, $t6 -/* 0FA190 7F0C5660 0C001145 */ jal get_video2_settings_ulx +/* 0FA190 7F0C5660 0C001145 */ jal viGetViewLeft /* 0FA194 7F0C5664 AFAA0044 */ sw $t2, 0x44($sp) /* 0FA198 7F0C5668 00028400 */ sll $s0, $v0, 0x10 /* 0FA19C 7F0C566C 00104C03 */ sra $t1, $s0, 0x10 -/* 0FA1A0 7F0C5670 0C001149 */ jal get_video2_settings_uly +/* 0FA1A0 7F0C5670 0C001149 */ jal viGetViewTop /* 0FA1A4 7F0C5674 01208025 */ move $s0, $t1 /* 0FA1A8 7F0C5678 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0FA1AC 7F0C567C 8FAF0044 */ lw $t7, 0x44($sp) @@ -4397,11 +4397,11 @@ def_7F0C40C0: /* 0FA1F4 7F0C56C4 25CE9EF0 */ addiu $t6, %lo(player1_player_data) # addiu $t6, $t6, -0x6110 /* 0FA1F8 7F0C56C8 0019C080 */ sll $t8, $t9, 2 /* 0FA1FC 7F0C56CC 030E5021 */ addu $t2, $t8, $t6 -/* 0FA200 7F0C56D0 0C001145 */ jal get_video2_settings_ulx +/* 0FA200 7F0C56D0 0C001145 */ jal viGetViewLeft /* 0FA204 7F0C56D4 AFAA0044 */ sw $t2, 0x44($sp) /* 0FA208 7F0C56D8 00028400 */ sll $s0, $v0, 0x10 /* 0FA20C 7F0C56DC 00104C03 */ sra $t1, $s0, 0x10 -/* 0FA210 7F0C56E0 0C001149 */ jal get_video2_settings_uly +/* 0FA210 7F0C56E0 0C001149 */ jal viGetViewTop /* 0FA214 7F0C56E4 01208025 */ move $s0, $t1 /* 0FA218 7F0C56E8 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0FA21C 7F0C56EC 8FAF0044 */ lw $t7, 0x44($sp) @@ -4422,11 +4422,11 @@ def_7F0C40C0: /* 0FA254 7F0C5724 000DC880 */ sll $t9, $t5, 2 /* 0FA258 7F0C5728 27189EF0 */ addiu $t8, %lo(player1_player_data) # addiu $t8, $t8, -0x6110 /* 0FA25C 7F0C572C 03387021 */ addu $t6, $t9, $t8 -/* 0FA260 7F0C5730 0C001145 */ jal get_video2_settings_ulx +/* 0FA260 7F0C5730 0C001145 */ jal viGetViewLeft /* 0FA264 7F0C5734 AFAE0044 */ sw $t6, 0x44($sp) /* 0FA268 7F0C5738 00028400 */ sll $s0, $v0, 0x10 /* 0FA26C 7F0C573C 00105403 */ sra $t2, $s0, 0x10 -/* 0FA270 7F0C5740 0C001149 */ jal get_video2_settings_uly +/* 0FA270 7F0C5740 0C001149 */ jal viGetViewTop /* 0FA274 7F0C5744 01408025 */ move $s0, $t2 /* 0FA278 7F0C5748 8FA900A8 */ lw $t1, 0xa8($sp) /* 0FA27C 7F0C574C 8FAC0044 */ lw $t4, 0x44($sp) @@ -4475,7 +4475,7 @@ def_7F0C40C0: /* 0FA318 7F0C57E8 AFA00014 */ sw $zero, 0x14($sp) /* 0FA31C 7F0C57EC 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA320 7F0C57F0 AFAC0010 */ sw $t4, 0x10($sp) -/* 0FA324 7F0C57F4 0C001145 */ jal get_video2_settings_ulx +/* 0FA324 7F0C57F4 0C001145 */ jal viGetViewLeft /* 0FA328 7F0C57F8 00000000 */ nop /* 0FA32C 7F0C57FC 8FAF0074 */ lw $t7, 0x74($sp) /* 0FA330 7F0C5800 8FB90078 */ lw $t9, 0x78($sp) @@ -4483,7 +4483,7 @@ def_7F0C40C0: /* 0FA338 7F0C5808 0019C043 */ sra $t8, $t9, 1 /* 0FA33C 7F0C580C 01B82023 */ subu $a0, $t5, $t8 /* 0FA340 7F0C5810 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA344 7F0C5814 0C001149 */ jal get_video2_settings_uly +/* 0FA344 7F0C5814 0C001149 */ jal viGetViewTop /* 0FA348 7F0C5818 AFA400CC */ sw $a0, 0xcc($sp) /* 0FA34C 7F0C581C 8FAB007C */ lw $t3, 0x7c($sp) /* 0FA350 7F0C5820 000B7043 */ sra $t6, $t3, 1 @@ -4528,7 +4528,7 @@ def_7F0C40C0: /* 0FA3EC 7F0C58BC AFA00014 */ sw $zero, 0x14($sp) /* 0FA3F0 7F0C58C0 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA3F4 7F0C58C4 AFB80010 */ sw $t8, 0x10($sp) -/* 0FA3F8 7F0C58C8 0C001145 */ jal get_video2_settings_ulx +/* 0FA3F8 7F0C58C8 0C001145 */ jal viGetViewLeft /* 0FA3FC 7F0C58CC 00000000 */ nop /* 0FA400 7F0C58D0 8FAB0074 */ lw $t3, 0x74($sp) /* 0FA404 7F0C58D4 8FAA0078 */ lw $t2, 0x78($sp) @@ -4536,7 +4536,7 @@ def_7F0C40C0: /* 0FA40C 7F0C58DC 000A4843 */ sra $t1, $t2, 1 /* 0FA410 7F0C58E0 01C92023 */ subu $a0, $t6, $t1 /* 0FA414 7F0C58E4 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA418 7F0C58E8 0C001149 */ jal get_video2_settings_uly +/* 0FA418 7F0C58E8 0C001149 */ jal viGetViewTop /* 0FA41C 7F0C58EC AFA400CC */ sw $a0, 0xcc($sp) /* 0FA420 7F0C58F0 3C0F8005 */ lui $t7, %hi(j_text_trigger) /* 0FA424 7F0C58F4 8DEF84D0 */ lw $t7, %lo(j_text_trigger)($t7) @@ -4594,7 +4594,7 @@ def_7F0C40C0: /* 0FA4EC 7F0C59BC AFA800A4 */ sw $t0, 0xa4($sp) /* 0FA4F0 7F0C59C0 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA4F4 7F0C59C4 AFAD0010 */ sw $t5, 0x10($sp) -/* 0FA4F8 7F0C59C8 0C001145 */ jal get_video2_settings_ulx +/* 0FA4F8 7F0C59C8 0C001145 */ jal viGetViewLeft /* 0FA4FC 7F0C59CC 00000000 */ nop /* 0FA500 7F0C59D0 8FB90074 */ lw $t9, 0x74($sp) /* 0FA504 7F0C59D4 8FAB0078 */ lw $t3, 0x78($sp) @@ -4602,7 +4602,7 @@ def_7F0C40C0: /* 0FA50C 7F0C59DC 000B5043 */ sra $t2, $t3, 1 /* 0FA510 7F0C59E0 030A2023 */ subu $a0, $t8, $t2 /* 0FA514 7F0C59E4 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA518 7F0C59E8 0C001149 */ jal get_video2_settings_uly +/* 0FA518 7F0C59E8 0C001149 */ jal viGetViewTop /* 0FA51C 7F0C59EC AFA400CC */ sw $a0, 0xcc($sp) /* 0FA520 7F0C59F0 8FAE007C */ lw $t6, 0x7c($sp) /* 0FA524 7F0C59F4 000E4843 */ sra $t1, $t6, 1 @@ -4649,7 +4649,7 @@ def_7F0C40C0: /* 0FA5C4 7F0C5A94 AFA200A4 */ sw $v0, 0xa4($sp) /* 0FA5C8 7F0C5A98 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA5CC 7F0C5A9C AFAA0010 */ sw $t2, 0x10($sp) -/* 0FA5D0 7F0C5AA0 0C001145 */ jal get_video2_settings_ulx +/* 0FA5D0 7F0C5AA0 0C001145 */ jal viGetViewLeft /* 0FA5D4 7F0C5AA4 00000000 */ nop /* 0FA5D8 7F0C5AA8 8FAE0074 */ lw $t6, 0x74($sp) /* 0FA5DC 7F0C5AAC 8FAC0078 */ lw $t4, 0x78($sp) @@ -4657,7 +4657,7 @@ def_7F0C40C0: /* 0FA5E4 7F0C5AB4 000C7843 */ sra $t7, $t4, 1 /* 0FA5E8 7F0C5AB8 012F2023 */ subu $a0, $t1, $t7 /* 0FA5EC 7F0C5ABC 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA5F0 7F0C5AC0 0C001149 */ jal get_video2_settings_uly +/* 0FA5F0 7F0C5AC0 0C001149 */ jal viGetViewTop /* 0FA5F4 7F0C5AC4 AFA400CC */ sw $a0, 0xcc($sp) /* 0FA5F8 7F0C5AC8 8FAD007C */ lw $t5, 0x7c($sp) /* 0FA5FC 7F0C5ACC 000DC843 */ sra $t9, $t5, 1 @@ -4709,7 +4709,7 @@ def_7F0C40C0: /* 0FA6AC 7F0C5B7C AFA00014 */ sw $zero, 0x14($sp) /* 0FA6B0 7F0C5B80 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA6B4 7F0C5B84 AFAD0010 */ sw $t5, 0x10($sp) -/* 0FA6B8 7F0C5B88 0C001145 */ jal get_video2_settings_ulx +/* 0FA6B8 7F0C5B88 0C001145 */ jal viGetViewLeft /* 0FA6BC 7F0C5B8C 00000000 */ nop /* 0FA6C0 7F0C5B90 8FB900A8 */ lw $t9, 0xa8($sp) /* 0FA6C4 7F0C5B94 8FB800C0 */ lw $t8, 0xc0($sp) @@ -4717,7 +4717,7 @@ def_7F0C40C0: /* 0FA6CC 7F0C5B9C 00185043 */ sra $t2, $t8, 1 /* 0FA6D0 7F0C5BA0 016A2023 */ subu $a0, $t3, $t2 /* 0FA6D4 7F0C5BA4 24840036 */ addiu $a0, $a0, 0x36 -/* 0FA6D8 7F0C5BA8 0C001149 */ jal get_video2_settings_uly +/* 0FA6D8 7F0C5BA8 0C001149 */ jal viGetViewTop /* 0FA6DC 7F0C5BAC AFA400CC */ sw $a0, 0xcc($sp) /* 0FA6E0 7F0C5BB0 8FAE00BC */ lw $t6, 0xbc($sp) /* 0FA6E4 7F0C5BB4 3C0D8008 */ lui $t5, %hi(pPlayer) @@ -4798,7 +4798,7 @@ def_7F0C40C0: /* 0FA808 7F0C5CD8 AFA00014 */ sw $zero, 0x14($sp) /* 0FA80C 7F0C5CDC 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FA810 7F0C5CE0 AFB80010 */ sw $t8, 0x10($sp) -/* 0FA814 7F0C5CE4 0C001145 */ jal get_video2_settings_ulx +/* 0FA814 7F0C5CE4 0C001145 */ jal viGetViewLeft /* 0FA818 7F0C5CE8 00000000 */ nop /* 0FA81C 7F0C5CEC 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FA820 7F0C5CF0 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -4806,7 +4806,7 @@ def_7F0C40C0: /* 0FA828 7F0C5CF8 000E6043 */ sra $t4, $t6, 1 /* 0FA82C 7F0C5CFC 014C2023 */ subu $a0, $t2, $t4 /* 0FA830 7F0C5D00 24840068 */ addiu $a0, $a0, 0x68 -/* 0FA834 7F0C5D04 0C001149 */ jal get_video2_settings_uly +/* 0FA834 7F0C5D04 0C001149 */ jal viGetViewTop /* 0FA838 7F0C5D08 AFA400CC */ sw $a0, 0xcc($sp) /* 0FA83C 7F0C5D0C 8FA900BC */ lw $t1, 0xbc($sp) /* 0FA840 7F0C5D10 3C188008 */ lui $t8, %hi(pPlayer) @@ -4970,9 +4970,9 @@ def_7F0C40C0: /* 0FAA98 7F0C5F68 AFA00014 */ sw $zero, 0x14($sp) /* 0FAA9C 7F0C5F6C 0FC2BA63 */ jal sub_GAME_7F0AE98C /* 0FAAA0 7F0C5F70 AFA90010 */ sw $t1, 0x10($sp) -/* 0FAAA4 7F0C5F74 0C001145 */ jal get_video2_settings_ulx +/* 0FAAA4 7F0C5F74 0C001145 */ jal viGetViewLeft /* 0FAAA8 7F0C5F78 00000000 */ nop -/* 0FAAAC 7F0C5F7C 0C001127 */ jal get_video2_settings_width +/* 0FAAAC 7F0C5F7C 0C001127 */ jal viGetViewWidth /* 0FAAB0 7F0C5F80 A7A20056 */ sh $v0, 0x56($sp) /* 0FAAB4 7F0C5F84 87A30056 */ lh $v1, 0x56($sp) /* 0FAAB8 7F0C5F88 8FAD0068 */ lw $t5, 0x68($sp) @@ -4980,9 +4980,9 @@ def_7F0C40C0: /* 0FAAC0 7F0C5F90 01E3C821 */ addu $t9, $t7, $v1 /* 0FAAC4 7F0C5F94 000DC043 */ sra $t8, $t5, 1 /* 0FAAC8 7F0C5F98 03385823 */ subu $t3, $t9, $t8 -/* 0FAACC 7F0C5F9C 0C001149 */ jal get_video2_settings_uly +/* 0FAACC 7F0C5F9C 0C001149 */ jal viGetViewTop /* 0FAAD0 7F0C5FA0 AFAB0070 */ sw $t3, 0x70($sp) -/* 0FAAD4 7F0C5FA4 0C00112B */ jal get_video2_settings_height +/* 0FAAD4 7F0C5FA4 0C00112B */ jal viGetViewHeight /* 0FAAD8 7F0C5FA8 A7A20056 */ sh $v0, 0x56($sp) /* 0FAADC 7F0C5FAC 87A30056 */ lh $v1, 0x56($sp) /* 0FAAE0 7F0C5FB0 8FAC0064 */ lw $t4, 0x64($sp) @@ -5053,7 +5053,7 @@ glabel mp_watch_menu_display /* 0F9850 7F0C4CE0 00808825 */ move $s1, $a0 /* 0F9854 7F0C4CE4 0FC26F3C */ jal get_cur_playernum /* 0F9858 7F0C4CE8 AFB00034 */ sw $s0, 0x34($sp) -/* 0F985C 7F0C4CEC 0FC26C01 */ jal get_num_players +/* 0F985C 7F0C4CEC 0FC26C01 */ jal getPlayerCount /* 0F9860 7F0C4CF0 AFA200D4 */ sw $v0, 0xd4($sp) /* 0F9864 7F0C4CF4 24010001 */ li $at, 1 /* 0F9868 7F0C4CF8 00404025 */ move $t0, $v0 @@ -5142,7 +5142,7 @@ text_pause_unpause: text_exit: /* 0F9990 7F0C4E20 0FC30AA2 */ jal get_textptr_for_textID /* 0F9994 7F0C4E24 3404A01A */ li $a0, 40986 -/* 0F9998 7F0C4E28 0C001145 */ jal get_video2_settings_ulx +/* 0F9998 7F0C4E28 0C001145 */ jal viGetViewLeft /* 0F999C 7F0C4E2C AFA200A4 */ sw $v0, 0xa4($sp) /* 0F99A0 7F0C4E30 8FB900A8 */ lw $t9, 0xa8($sp) /* 0F99A4 7F0C4E34 00592021 */ addu $a0, $v0, $t9 @@ -5160,7 +5160,7 @@ def_7F0C40C0: /* 0F99CC 7F0C4E5C AFA00014 */ sw $zero, 0x14($sp) /* 0F99D0 7F0C4E60 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0F99D4 7F0C4E64 AFAB0010 */ sw $t3, 0x10($sp) -/* 0F99D8 7F0C4E68 0C001145 */ jal get_video2_settings_ulx +/* 0F99D8 7F0C4E68 0C001145 */ jal viGetViewLeft /* 0F99DC 7F0C4E6C 00000000 */ nop /* 0F99E0 7F0C4E70 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0F99E4 7F0C4E74 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -5168,7 +5168,7 @@ def_7F0C40C0: /* 0F99EC 7F0C4E7C 000E7843 */ sra $t7, $t6, 1 /* 0F99F0 7F0C4E80 01AF2023 */ subu $a0, $t5, $t7 /* 0F99F4 7F0C4E84 24840050 */ addiu $a0, $a0, 0x50 -/* 0F99F8 7F0C4E88 0C001149 */ jal get_video2_settings_uly +/* 0F99F8 7F0C4E88 0C001149 */ jal viGetViewTop /* 0F99FC 7F0C4E8C AFA400CC */ sw $a0, 0xcc($sp) /* 0F9A00 7F0C4E90 8FB800BC */ lw $t8, 0xbc($sp) /* 0F9A04 7F0C4E94 0018C843 */ sra $t9, $t8, 1 @@ -5236,7 +5236,7 @@ def_7F0C40C0: /* 0F9AF4 7F0C4F84 00000000 */ nop /* 0F9AF8 7F0C4F88 10400056 */ beqz $v0, .Ljp7F0C50E4 /* 0F9AFC 7F0C4F8C 00000000 */ nop -/* 0F9B00 7F0C4F90 0C001145 */ jal get_video2_settings_ulx +/* 0F9B00 7F0C4F90 0C001145 */ jal viGetViewLeft /* 0F9B04 7F0C4F94 00000000 */ nop /* 0F9B08 7F0C4F98 3C038009 */ lui $v1, %hi(is_gameover_flag) # $v1, 0x8009 /* 0F9B0C 7F0C4F9C 8C63C774 */ lw $v1, %lo(is_gameover_flag)($v1) @@ -5259,7 +5259,7 @@ def_7F0C40C0: /* 0F9B4C 7F0C4FDC 2484FFF8 */ addiu $a0, $a0, -8 /* 0F9B50 7F0C4FE0 AFA400CC */ sw $a0, 0xcc($sp) .Ljp7F0C4FE4: -/* 0F9B54 7F0C4FE4 0C001149 */ jal get_video2_settings_uly +/* 0F9B54 7F0C4FE4 0C001149 */ jal viGetViewTop /* 0F9B58 7F0C4FE8 00000000 */ nop /* 0F9B5C 7F0C4FEC 3C0F8009 */ lui $t7, %hi(dword_CODE_bss_8008C708) # $t7, 0x8009 /* 0F9B60 7F0C4FF0 8DEFC778 */ lw $t7, %lo(dword_CODE_bss_8008C708)($t7) @@ -5329,7 +5329,7 @@ def_7F0C40C0: /* 0F9C58 7F0C50E8 00000000 */ nop /* 0F9C5C 7F0C50EC 10400056 */ beqz $v0, .Ljp7F0C5248 /* 0F9C60 7F0C50F0 00000000 */ nop -/* 0F9C64 7F0C50F4 0C001145 */ jal get_video2_settings_ulx +/* 0F9C64 7F0C50F4 0C001145 */ jal viGetViewLeft /* 0F9C68 7F0C50F8 00000000 */ nop /* 0F9C6C 7F0C50FC 3C038009 */ lui $v1, %hi(is_gameover_flag) # $v1, 0x8009 /* 0F9C70 7F0C5100 8C63C774 */ lw $v1, %lo(is_gameover_flag)($v1) @@ -5352,7 +5352,7 @@ def_7F0C40C0: /* 0F9CB0 7F0C5140 24840008 */ addiu $a0, $a0, 8 /* 0F9CB4 7F0C5144 AFA400CC */ sw $a0, 0xcc($sp) .Ljp7F0C5148: -/* 0F9CB8 7F0C5148 0C001149 */ jal get_video2_settings_uly +/* 0F9CB8 7F0C5148 0C001149 */ jal viGetViewTop /* 0F9CBC 7F0C514C 00000000 */ nop /* 0F9CC0 7F0C5150 3C0B8009 */ lui $t3, %hi(dword_CODE_bss_8008C708) # $t3, 0x8009 /* 0F9CC4 7F0C5154 8D6BC778 */ lw $t3, %lo(dword_CODE_bss_8008C708)($t3) @@ -5470,7 +5470,7 @@ def_7F0C40C0: /* 0F9E6C 7F0C52FC AFA00014 */ sw $zero, 0x14($sp) /* 0F9E70 7F0C5300 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0F9E74 7F0C5304 AFAB0010 */ sw $t3, 0x10($sp) -/* 0F9E78 7F0C5308 0C001145 */ jal get_video2_settings_ulx +/* 0F9E78 7F0C5308 0C001145 */ jal viGetViewLeft /* 0F9E7C 7F0C530C 00000000 */ nop /* 0F9E80 7F0C5310 8FAE00A8 */ lw $t6, 0xa8($sp) /* 0F9E84 7F0C5314 8FAD00C0 */ lw $t5, 0xc0($sp) @@ -5478,7 +5478,7 @@ def_7F0C40C0: /* 0F9E8C 7F0C531C 000D7843 */ sra $t7, $t5, 1 /* 0F9E90 7F0C5320 018F2023 */ subu $a0, $t4, $t7 /* 0F9E94 7F0C5324 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9E98 7F0C5328 0C001149 */ jal get_video2_settings_uly +/* 0F9E98 7F0C5328 0C001149 */ jal viGetViewTop /* 0F9E9C 7F0C532C AFA400CC */ sw $a0, 0xcc($sp) /* 0F9EA0 7F0C5330 8FB800BC */ lw $t8, 0xbc($sp) /* 0F9EA4 7F0C5334 0018C843 */ sra $t9, $t8, 1 @@ -5540,7 +5540,7 @@ def_7F0C40C0: /* 0F9F7C 7F0C540C AFA00014 */ sw $zero, 0x14($sp) /* 0F9F80 7F0C5410 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0F9F84 7F0C5414 AFAE0010 */ sw $t6, 0x10($sp) -/* 0F9F88 7F0C5418 0C001145 */ jal get_video2_settings_ulx +/* 0F9F88 7F0C5418 0C001145 */ jal viGetViewLeft /* 0F9F8C 7F0C541C 00000000 */ nop /* 0F9F90 7F0C5420 8FAD00A8 */ lw $t5, 0xa8($sp) /* 0F9F94 7F0C5424 8FAF00C0 */ lw $t7, 0xc0($sp) @@ -5548,7 +5548,7 @@ def_7F0C40C0: /* 0F9F9C 7F0C542C 000FC043 */ sra $t8, $t7, 1 /* 0F9FA0 7F0C5430 01982023 */ subu $a0, $t4, $t8 /* 0F9FA4 7F0C5434 24840050 */ addiu $a0, $a0, 0x50 -/* 0F9FA8 7F0C5438 0C001149 */ jal get_video2_settings_uly +/* 0F9FA8 7F0C5438 0C001149 */ jal viGetViewTop /* 0F9FAC 7F0C543C AFA400CC */ sw $a0, 0xcc($sp) /* 0F9FB0 7F0C5440 8FB900BC */ lw $t9, 0xbc($sp) /* 0F9FB4 7F0C5444 00195843 */ sra $t3, $t9, 1 @@ -5624,11 +5624,11 @@ def_7F0C40C0: /* 0FA0BC 7F0C554C 24010002 */ li $at, 2 /* 0FA0C0 7F0C5550 15E1004E */ bne $t7, $at, .Ljp7F0C568C /* 0FA0C4 7F0C5554 00000000 */ nop -/* 0FA0C8 7F0C5558 0C001145 */ jal get_video2_settings_ulx +/* 0FA0C8 7F0C5558 0C001145 */ jal viGetViewLeft /* 0FA0CC 7F0C555C 00000000 */ nop /* 0FA0D0 7F0C5560 00028400 */ sll $s0, $v0, 0x10 /* 0FA0D4 7F0C5564 00106403 */ sra $t4, $s0, 0x10 -/* 0FA0D8 7F0C5568 0C001149 */ jal get_video2_settings_uly +/* 0FA0D8 7F0C5568 0C001149 */ jal viGetViewTop /* 0FA0DC 7F0C556C 01808025 */ move $s0, $t4 /* 0FA0E0 7F0C5570 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA0E4 7F0C5574 00024400 */ sll $t0, $v0, 0x10 @@ -5664,11 +5664,11 @@ def_7F0C40C0: /* 0FA150 7F0C55E0 8FA70094 */ lw $a3, 0x94($sp) /* 0FA154 7F0C55E4 0FC31094 */ jal display_text_for_playerdata_on_MP_menu /* 0FA158 7F0C55E8 AFAC0010 */ sw $t4, 0x10($sp) -/* 0FA15C 7F0C55EC 0C001145 */ jal get_video2_settings_ulx +/* 0FA15C 7F0C55EC 0C001145 */ jal viGetViewLeft /* 0FA160 7F0C55F0 00408825 */ move $s1, $v0 /* 0FA164 7F0C55F4 00028400 */ sll $s0, $v0, 0x10 /* 0FA168 7F0C55F8 0010C403 */ sra $t8, $s0, 0x10 -/* 0FA16C 7F0C55FC 0C001149 */ jal get_video2_settings_uly +/* 0FA16C 7F0C55FC 0C001149 */ jal viGetViewTop /* 0FA170 7F0C5600 03008025 */ move $s0, $t8 /* 0FA174 7F0C5604 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA178 7F0C5608 00024400 */ sll $t0, $v0, 0x10 @@ -5708,11 +5708,11 @@ def_7F0C40C0: /* 0FA1F4 7F0C5684 1000009E */ b .Ljp7F0C5900 /* 0FA1F8 7F0C5688 00408825 */ move $s1, $v0 .Ljp7F0C568C: -/* 0FA1FC 7F0C568C 0C001145 */ jal get_video2_settings_ulx +/* 0FA1FC 7F0C568C 0C001145 */ jal viGetViewLeft /* 0FA200 7F0C5690 00000000 */ nop /* 0FA204 7F0C5694 00028400 */ sll $s0, $v0, 0x10 /* 0FA208 7F0C5698 00107403 */ sra $t6, $s0, 0x10 -/* 0FA20C 7F0C569C 0C001149 */ jal get_video2_settings_uly +/* 0FA20C 7F0C569C 0C001149 */ jal viGetViewTop /* 0FA210 7F0C56A0 01C08025 */ move $s0, $t6 /* 0FA214 7F0C56A4 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA218 7F0C56A8 00024400 */ sll $t0, $v0, 0x10 @@ -5748,11 +5748,11 @@ def_7F0C40C0: /* 0FA284 7F0C5714 8FA70094 */ lw $a3, 0x94($sp) /* 0FA288 7F0C5718 0FC31094 */ jal display_text_for_playerdata_on_MP_menu /* 0FA28C 7F0C571C AFAE0010 */ sw $t6, 0x10($sp) -/* 0FA290 7F0C5720 0C001145 */ jal get_video2_settings_ulx +/* 0FA290 7F0C5720 0C001145 */ jal viGetViewLeft /* 0FA294 7F0C5724 00408825 */ move $s1, $v0 /* 0FA298 7F0C5728 00028400 */ sll $s0, $v0, 0x10 /* 0FA29C 7F0C572C 00106C03 */ sra $t5, $s0, 0x10 -/* 0FA2A0 7F0C5730 0C001149 */ jal get_video2_settings_uly +/* 0FA2A0 7F0C5730 0C001149 */ jal viGetViewTop /* 0FA2A4 7F0C5734 01A08025 */ move $s0, $t5 /* 0FA2A8 7F0C5738 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA2AC 7F0C573C 00024400 */ sll $t0, $v0, 0x10 @@ -5789,11 +5789,11 @@ def_7F0C40C0: /* 0FA31C 7F0C57AC 8FA70098 */ lw $a3, 0x98($sp) /* 0FA320 7F0C57B0 0FC31094 */ jal display_text_for_playerdata_on_MP_menu /* 0FA324 7F0C57B4 AFAD0010 */ sw $t5, 0x10($sp) -/* 0FA328 7F0C57B8 0C001145 */ jal get_video2_settings_ulx +/* 0FA328 7F0C57B8 0C001145 */ jal viGetViewLeft /* 0FA32C 7F0C57BC 00408825 */ move $s1, $v0 /* 0FA330 7F0C57C0 00028400 */ sll $s0, $v0, 0x10 /* 0FA334 7F0C57C4 00107C03 */ sra $t7, $s0, 0x10 -/* 0FA338 7F0C57C8 0C001149 */ jal get_video2_settings_uly +/* 0FA338 7F0C57C8 0C001149 */ jal viGetViewTop /* 0FA33C 7F0C57CC 01E08025 */ move $s0, $t7 /* 0FA340 7F0C57D0 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA344 7F0C57D4 00024400 */ sll $t0, $v0, 0x10 @@ -5835,11 +5835,11 @@ def_7F0C40C0: /* 0FA3C8 7F0C5858 00408825 */ move $s1, $v0 /* 0FA3CC 7F0C585C 15810028 */ bne $t4, $at, .Ljp7F0C5900 /* 0FA3D0 7F0C5860 00000000 */ nop -/* 0FA3D4 7F0C5864 0C001145 */ jal get_video2_settings_ulx +/* 0FA3D4 7F0C5864 0C001145 */ jal viGetViewLeft /* 0FA3D8 7F0C5868 00000000 */ nop /* 0FA3DC 7F0C586C 00028400 */ sll $s0, $v0, 0x10 /* 0FA3E0 7F0C5870 0010C403 */ sra $t8, $s0, 0x10 -/* 0FA3E4 7F0C5874 0C001149 */ jal get_video2_settings_uly +/* 0FA3E4 7F0C5874 0C001149 */ jal viGetViewTop /* 0FA3E8 7F0C5878 03008025 */ move $s0, $t8 /* 0FA3EC 7F0C587C 8FA300D4 */ lw $v1, 0xd4($sp) /* 0FA3F0 7F0C5880 00024400 */ sll $t0, $v0, 0x10 @@ -5910,7 +5910,7 @@ def_7F0C40C0: /* 0FA4DC 7F0C596C AFA00014 */ sw $zero, 0x14($sp) /* 0FA4E0 7F0C5970 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FA4E4 7F0C5974 AFAF0010 */ sw $t7, 0x10($sp) -/* 0FA4E8 7F0C5978 0C001145 */ jal get_video2_settings_ulx +/* 0FA4E8 7F0C5978 0C001145 */ jal viGetViewLeft /* 0FA4EC 7F0C597C 00000000 */ nop /* 0FA4F0 7F0C5980 8FAE00A8 */ lw $t6, 0xa8($sp) /* 0FA4F4 7F0C5984 8FB800C0 */ lw $t8, 0xc0($sp) @@ -5918,7 +5918,7 @@ def_7F0C40C0: /* 0FA4FC 7F0C598C 0018C843 */ sra $t9, $t8, 1 /* 0FA500 7F0C5990 01992023 */ subu $a0, $t4, $t9 /* 0FA504 7F0C5994 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA508 7F0C5998 0C001149 */ jal get_video2_settings_uly +/* 0FA508 7F0C5998 0C001149 */ jal viGetViewTop /* 0FA50C 7F0C599C AFA400CC */ sw $a0, 0xcc($sp) /* 0FA510 7F0C59A0 8FAB00BC */ lw $t3, 0xbc($sp) /* 0FA514 7F0C59A4 000B6843 */ sra $t5, $t3, 1 @@ -5973,7 +5973,7 @@ def_7F0C40C0: /* 0FA5D4 7F0C5A64 AFA00014 */ sw $zero, 0x14($sp) /* 0FA5D8 7F0C5A68 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FA5DC 7F0C5A6C AFAD0010 */ sw $t5, 0x10($sp) -/* 0FA5E0 7F0C5A70 0C001145 */ jal get_video2_settings_ulx +/* 0FA5E0 7F0C5A70 0C001145 */ jal viGetViewLeft /* 0FA5E4 7F0C5A74 00000000 */ nop /* 0FA5E8 7F0C5A78 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0FA5EC 7F0C5A7C 8FB800C0 */ lw $t8, 0xc0($sp) @@ -5981,7 +5981,7 @@ def_7F0C40C0: /* 0FA5F4 7F0C5A84 00186043 */ sra $t4, $t8, 1 /* 0FA5F8 7F0C5A88 01CC2023 */ subu $a0, $t6, $t4 /* 0FA5FC 7F0C5A8C 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA600 7F0C5A90 0C001149 */ jal get_video2_settings_uly +/* 0FA600 7F0C5A90 0C001149 */ jal viGetViewTop /* 0FA604 7F0C5A94 AFA400CC */ sw $a0, 0xcc($sp) /* 0FA608 7F0C5A98 8FB900BC */ lw $t9, 0xbc($sp) /* 0FA60C 7F0C5A9C 00195843 */ sra $t3, $t9, 1 @@ -6019,11 +6019,11 @@ def_7F0C40C0: /* 0FA68C 7F0C5B1C 8FA200D4 */ lw $v0, 0xd4($sp) /* 0FA690 7F0C5B20 50400018 */ beql $v0, $zero, .Ljp7F0C5B84 /* 0FA694 7F0C5B24 24010001 */ li $at, 1 -/* 0FA698 7F0C5B28 0C001145 */ jal get_video2_settings_ulx +/* 0FA698 7F0C5B28 0C001145 */ jal viGetViewLeft /* 0FA69C 7F0C5B2C 00000000 */ nop /* 0FA6A0 7F0C5B30 00028400 */ sll $s0, $v0, 0x10 /* 0FA6A4 7F0C5B34 00106C03 */ sra $t5, $s0, 0x10 -/* 0FA6A8 7F0C5B38 0C001149 */ jal get_video2_settings_uly +/* 0FA6A8 7F0C5B38 0C001149 */ jal viGetViewTop /* 0FA6AC 7F0C5B3C 01A08025 */ move $s0, $t5 /* 0FA6B0 7F0C5B40 8FB800D4 */ lw $t8, 0xd4($sp) /* 0FA6B4 7F0C5B44 8FAF00A8 */ lw $t7, 0xa8($sp) @@ -6050,11 +6050,11 @@ def_7F0C40C0: /* 0FA704 7F0C5B94 27399F60 */ addiu $t9, %lo(player1_player_data) # addiu $t9, $t9, -0x60a0 /* 0FA708 7F0C5B98 000C6100 */ sll $t4, $t4, 4 /* 0FA70C 7F0C5B9C 01995821 */ addu $t3, $t4, $t9 -/* 0FA710 7F0C5BA0 0C001145 */ jal get_video2_settings_ulx +/* 0FA710 7F0C5BA0 0C001145 */ jal viGetViewLeft /* 0FA714 7F0C5BA4 AFAB0044 */ sw $t3, 0x44($sp) /* 0FA718 7F0C5BA8 00028400 */ sll $s0, $v0, 0x10 /* 0FA71C 7F0C5BAC 00106C03 */ sra $t5, $s0, 0x10 -/* 0FA720 7F0C5BB0 0C001149 */ jal get_video2_settings_uly +/* 0FA720 7F0C5BB0 0C001149 */ jal viGetViewTop /* 0FA724 7F0C5BB4 01A08025 */ move $s0, $t5 /* 0FA728 7F0C5BB8 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0FA72C 7F0C5BBC 8FB80044 */ lw $t8, 0x44($sp) @@ -6070,11 +6070,11 @@ def_7F0C40C0: .Ljp7F0C5BE4: /* 0FA754 7F0C5BE4 50400018 */ beql $v0, $zero, .Ljp7F0C5C48 /* 0FA758 7F0C5BE8 24010001 */ li $at, 1 -/* 0FA75C 7F0C5BEC 0C001145 */ jal get_video2_settings_ulx +/* 0FA75C 7F0C5BEC 0C001145 */ jal viGetViewLeft /* 0FA760 7F0C5BF0 00000000 */ nop /* 0FA764 7F0C5BF4 00028400 */ sll $s0, $v0, 0x10 /* 0FA768 7F0C5BF8 00107403 */ sra $t6, $s0, 0x10 -/* 0FA76C 7F0C5BFC 0C001149 */ jal get_video2_settings_uly +/* 0FA76C 7F0C5BFC 0C001149 */ jal viGetViewTop /* 0FA770 7F0C5C00 01C08025 */ move $s0, $t6 /* 0FA774 7F0C5C04 8FB900D4 */ lw $t9, 0xd4($sp) /* 0FA778 7F0C5C08 8FAC00A8 */ lw $t4, 0xa8($sp) @@ -6101,11 +6101,11 @@ def_7F0C40C0: /* 0FA7C8 7F0C5C58 25EF9F60 */ addiu $t7, %lo(player1_player_data) # addiu $t7, $t7, -0x60a0 /* 0FA7CC 7F0C5C5C 000D6900 */ sll $t5, $t5, 4 /* 0FA7D0 7F0C5C60 01AFC021 */ addu $t8, $t5, $t7 -/* 0FA7D4 7F0C5C64 0C001145 */ jal get_video2_settings_ulx +/* 0FA7D4 7F0C5C64 0C001145 */ jal viGetViewLeft /* 0FA7D8 7F0C5C68 AFB80044 */ sw $t8, 0x44($sp) /* 0FA7DC 7F0C5C6C 00028400 */ sll $s0, $v0, 0x10 /* 0FA7E0 7F0C5C70 00107403 */ sra $t6, $s0, 0x10 -/* 0FA7E4 7F0C5C74 0C001149 */ jal get_video2_settings_uly +/* 0FA7E4 7F0C5C74 0C001149 */ jal viGetViewTop /* 0FA7E8 7F0C5C78 01C08025 */ move $s0, $t6 /* 0FA7EC 7F0C5C7C 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0FA7F0 7F0C5C80 8FB90044 */ lw $t9, 0x44($sp) @@ -6127,11 +6127,11 @@ def_7F0C40C0: /* 0FA82C 7F0C5CBC 25AD9F60 */ addiu $t5, %lo(player1_player_data) # addiu $t5, $t5, -0x60a0 /* 0FA830 7F0C5CC0 000B5900 */ sll $t3, $t3, 4 /* 0FA834 7F0C5CC4 016D7821 */ addu $t7, $t3, $t5 -/* 0FA838 7F0C5CC8 0C001145 */ jal get_video2_settings_ulx +/* 0FA838 7F0C5CC8 0C001145 */ jal viGetViewLeft /* 0FA83C 7F0C5CCC AFAF0044 */ sw $t7, 0x44($sp) /* 0FA840 7F0C5CD0 00028400 */ sll $s0, $v0, 0x10 /* 0FA844 7F0C5CD4 0010C403 */ sra $t8, $s0, 0x10 -/* 0FA848 7F0C5CD8 0C001149 */ jal get_video2_settings_uly +/* 0FA848 7F0C5CD8 0C001149 */ jal viGetViewTop /* 0FA84C 7F0C5CDC 03008025 */ move $s0, $t8 /* 0FA850 7F0C5CE0 8FAE00A8 */ lw $t6, 0xa8($sp) /* 0FA854 7F0C5CE4 8FAC0044 */ lw $t4, 0x44($sp) @@ -6156,11 +6156,11 @@ def_7F0C40C0: /* 0FA89C 7F0C5D2C 25AD9F60 */ addiu $t5, %lo(player1_player_data) # addiu $t5, $t5, -0x60a0 /* 0FA8A0 7F0C5D30 000B5900 */ sll $t3, $t3, 4 /* 0FA8A4 7F0C5D34 016D7821 */ addu $t7, $t3, $t5 -/* 0FA8A8 7F0C5D38 0C001145 */ jal get_video2_settings_ulx +/* 0FA8A8 7F0C5D38 0C001145 */ jal viGetViewLeft /* 0FA8AC 7F0C5D3C AFAF0044 */ sw $t7, 0x44($sp) /* 0FA8B0 7F0C5D40 00028400 */ sll $s0, $v0, 0x10 /* 0FA8B4 7F0C5D44 0010C403 */ sra $t8, $s0, 0x10 -/* 0FA8B8 7F0C5D48 0C001149 */ jal get_video2_settings_uly +/* 0FA8B8 7F0C5D48 0C001149 */ jal viGetViewTop /* 0FA8BC 7F0C5D4C 03008025 */ move $s0, $t8 /* 0FA8C0 7F0C5D50 8FAE00A8 */ lw $t6, 0xa8($sp) /* 0FA8C4 7F0C5D54 8FAC0044 */ lw $t4, 0x44($sp) @@ -6205,7 +6205,7 @@ def_7F0C40C0: /* 0FA954 7F0C5DE4 AFA00014 */ sw $zero, 0x14($sp) /* 0FA958 7F0C5DE8 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FA95C 7F0C5DEC AFAD0010 */ sw $t5, 0x10($sp) -/* 0FA960 7F0C5DF0 0C001145 */ jal get_video2_settings_ulx +/* 0FA960 7F0C5DF0 0C001145 */ jal viGetViewLeft /* 0FA964 7F0C5DF4 00000000 */ nop /* 0FA968 7F0C5DF8 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0FA96C 7F0C5DFC 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -6213,7 +6213,7 @@ def_7F0C40C0: /* 0FA974 7F0C5E04 000E6043 */ sra $t4, $t6, 1 /* 0FA978 7F0C5E08 030C2023 */ subu $a0, $t8, $t4 /* 0FA97C 7F0C5E0C 24840050 */ addiu $a0, $a0, 0x50 -/* 0FA980 7F0C5E10 0C001149 */ jal get_video2_settings_uly +/* 0FA980 7F0C5E10 0C001149 */ jal viGetViewTop /* 0FA984 7F0C5E14 AFA400CC */ sw $a0, 0xcc($sp) /* 0FA988 7F0C5E18 8FB900BC */ lw $t9, 0xbc($sp) /* 0FA98C 7F0C5E1C 00195843 */ sra $t3, $t9, 1 @@ -6268,7 +6268,7 @@ def_7F0C40C0: /* 0FAA4C 7F0C5EDC AFA00014 */ sw $zero, 0x14($sp) /* 0FAA50 7F0C5EE0 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FAA54 7F0C5EE4 AFAB0010 */ sw $t3, 0x10($sp) -/* 0FAA58 7F0C5EE8 0C001145 */ jal get_video2_settings_ulx +/* 0FAA58 7F0C5EE8 0C001145 */ jal viGetViewLeft /* 0FAA5C 7F0C5EEC 00000000 */ nop /* 0FAA60 7F0C5EF0 8FAD00A8 */ lw $t5, 0xa8($sp) /* 0FAA64 7F0C5EF4 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -6276,7 +6276,7 @@ def_7F0C40C0: /* 0FAA6C 7F0C5EFC 000EC043 */ sra $t8, $t6, 1 /* 0FAA70 7F0C5F00 01F82023 */ subu $a0, $t7, $t8 /* 0FAA74 7F0C5F04 24840050 */ addiu $a0, $a0, 0x50 -/* 0FAA78 7F0C5F08 0C001149 */ jal get_video2_settings_uly +/* 0FAA78 7F0C5F08 0C001149 */ jal viGetViewTop /* 0FAA7C 7F0C5F0C AFA400CC */ sw $a0, 0xcc($sp) /* 0FAA80 7F0C5F10 8FAC00BC */ lw $t4, 0xbc($sp) /* 0FAA84 7F0C5F14 000CC843 */ sra $t9, $t4, 1 @@ -6315,11 +6315,11 @@ def_7F0C40C0: /* 0FAB08 7F0C5F98 3C188008 */ lui $t8, %hi(player1_player_data + 0x24) # $t8, 0x8008 /* 0FAB0C 7F0C5F9C 10400016 */ beqz $v0, .Ljp7F0C5FF8 /* 0FAB10 7F0C5FA0 00000000 */ nop -/* 0FAB14 7F0C5FA4 0C001145 */ jal get_video2_settings_ulx +/* 0FAB14 7F0C5FA4 0C001145 */ jal viGetViewLeft /* 0FAB18 7F0C5FA8 00000000 */ nop /* 0FAB1C 7F0C5FAC 00028400 */ sll $s0, $v0, 0x10 /* 0FAB20 7F0C5FB0 00105C03 */ sra $t3, $s0, 0x10 -/* 0FAB24 7F0C5FB4 0C001149 */ jal get_video2_settings_uly +/* 0FAB24 7F0C5FB4 0C001149 */ jal viGetViewTop /* 0FAB28 7F0C5FB8 01608025 */ move $s0, $t3 /* 0FAB2C 7F0C5FBC 8FAE00D4 */ lw $t6, 0xd4($sp) /* 0FAB30 7F0C5FC0 8FAD00A8 */ lw $t5, 0xa8($sp) @@ -6340,11 +6340,11 @@ def_7F0C40C0: /* 0FAB68 7F0C5FF8 8F189F84 */ lw $t8, %lo(player1_player_data + 0x24)($t8) /* 0FAB6C 7F0C5FFC 5B000017 */ blezl $t8, .Ljp7F0C605C /* 0FAB70 7F0C6000 24010001 */ li $at, 1 -/* 0FAB74 7F0C6004 0C001145 */ jal get_video2_settings_ulx +/* 0FAB74 7F0C6004 0C001145 */ jal viGetViewLeft /* 0FAB78 7F0C6008 00000000 */ nop /* 0FAB7C 7F0C600C 00028400 */ sll $s0, $v0, 0x10 /* 0FAB80 7F0C6010 00106403 */ sra $t4, $s0, 0x10 -/* 0FAB84 7F0C6014 0C001149 */ jal get_video2_settings_uly +/* 0FAB84 7F0C6014 0C001149 */ jal viGetViewTop /* 0FAB88 7F0C6018 01808025 */ move $s0, $t4 /* 0FAB8C 7F0C601C 8FAB00D4 */ lw $t3, 0xd4($sp) /* 0FAB90 7F0C6020 8FB900A8 */ lw $t9, 0xa8($sp) @@ -6370,11 +6370,11 @@ def_7F0C40C0: /* 0FABD8 7F0C6068 27189F60 */ addiu $t8, %lo(player1_player_data) # addiu $t8, $t8, -0x60a0 /* 0FABDC 7F0C606C 00027880 */ sll $t7, $v0, 2 /* 0FABE0 7F0C6070 01F86021 */ addu $t4, $t7, $t8 -/* 0FABE4 7F0C6074 0C001145 */ jal get_video2_settings_ulx +/* 0FABE4 7F0C6074 0C001145 */ jal viGetViewLeft /* 0FABE8 7F0C6078 AFAC0044 */ sw $t4, 0x44($sp) /* 0FABEC 7F0C607C 00028400 */ sll $s0, $v0, 0x10 /* 0FABF0 7F0C6080 0010CC03 */ sra $t9, $s0, 0x10 -/* 0FABF4 7F0C6084 0C001149 */ jal get_video2_settings_uly +/* 0FABF4 7F0C6084 0C001149 */ jal viGetViewTop /* 0FABF8 7F0C6088 03208025 */ move $s0, $t9 /* 0FABFC 7F0C608C 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FAC00 7F0C6090 8FAD0044 */ lw $t5, 0x44($sp) @@ -6394,11 +6394,11 @@ def_7F0C40C0: /* 0FAC34 7F0C60C4 19C000D7 */ blez $t6, .Ljp7F0C6424 /* 0FAC38 7F0C60C8 00027880 */ sll $t7, $v0, 2 /* 0FAC3C 7F0C60CC 01F86021 */ addu $t4, $t7, $t8 -/* 0FAC40 7F0C60D0 0C001145 */ jal get_video2_settings_ulx +/* 0FAC40 7F0C60D0 0C001145 */ jal viGetViewLeft /* 0FAC44 7F0C60D4 AFAC0044 */ sw $t4, 0x44($sp) /* 0FAC48 7F0C60D8 00028400 */ sll $s0, $v0, 0x10 /* 0FAC4C 7F0C60DC 0010CC03 */ sra $t9, $s0, 0x10 -/* 0FAC50 7F0C60E0 0C001149 */ jal get_video2_settings_uly +/* 0FAC50 7F0C60E0 0C001149 */ jal viGetViewTop /* 0FAC54 7F0C60E4 03208025 */ move $s0, $t9 /* 0FAC58 7F0C60E8 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FAC5C 7F0C60EC 8FAD0044 */ lw $t5, 0x44($sp) @@ -6415,11 +6415,11 @@ def_7F0C40C0: .Ljp7F0C6118: /* 0FAC88 7F0C6118 11E00015 */ beqz $t7, .Ljp7F0C6170 /* 0FAC8C 7F0C611C 3C0D8008 */ lui $t5, %hi(player1_player_data + 0x24) # $t5, 0x8008 -/* 0FAC90 7F0C6120 0C001145 */ jal get_video2_settings_ulx +/* 0FAC90 7F0C6120 0C001145 */ jal viGetViewLeft /* 0FAC94 7F0C6124 00000000 */ nop /* 0FAC98 7F0C6128 00028400 */ sll $s0, $v0, 0x10 /* 0FAC9C 7F0C612C 0010C403 */ sra $t8, $s0, 0x10 -/* 0FACA0 7F0C6130 0C001149 */ jal get_video2_settings_uly +/* 0FACA0 7F0C6130 0C001149 */ jal viGetViewTop /* 0FACA4 7F0C6134 03008025 */ move $s0, $t8 /* 0FACA8 7F0C6138 8FB900D4 */ lw $t9, 0xd4($sp) /* 0FACAC 7F0C613C 8FAC00A8 */ lw $t4, 0xa8($sp) @@ -6439,11 +6439,11 @@ def_7F0C40C0: /* 0FACE0 7F0C6170 8DAD9F84 */ lw $t5, %lo(player1_player_data + 0x24)($t5) /* 0FACE4 7F0C6174 59A00016 */ blezl $t5, .Ljp7F0C61D0 /* 0FACE8 7F0C6178 8FAB00D4 */ lw $t3, 0xd4($sp) -/* 0FACEC 7F0C617C 0C001145 */ jal get_video2_settings_ulx +/* 0FACEC 7F0C617C 0C001145 */ jal viGetViewLeft /* 0FACF0 7F0C6180 00000000 */ nop /* 0FACF4 7F0C6184 00028400 */ sll $s0, $v0, 0x10 /* 0FACF8 7F0C6188 00107403 */ sra $t6, $s0, 0x10 -/* 0FACFC 7F0C618C 0C001149 */ jal get_video2_settings_uly +/* 0FACFC 7F0C618C 0C001149 */ jal viGetViewTop /* 0FAD00 7F0C6190 01C08025 */ move $s0, $t6 /* 0FAD04 7F0C6194 8FB800D4 */ lw $t8, 0xd4($sp) /* 0FAD08 7F0C6198 8FAF00A8 */ lw $t7, 0xa8($sp) @@ -6468,11 +6468,11 @@ def_7F0C40C0: /* 0FAD4C 7F0C61DC 000B6880 */ sll $t5, $t3, 2 /* 0FAD50 7F0C61E0 25CE9F60 */ addiu $t6, %lo(player1_player_data) # addiu $t6, $t6, -0x60a0 /* 0FAD54 7F0C61E4 01AE7821 */ addu $t7, $t5, $t6 -/* 0FAD58 7F0C61E8 0C001145 */ jal get_video2_settings_ulx +/* 0FAD58 7F0C61E8 0C001145 */ jal viGetViewLeft /* 0FAD5C 7F0C61EC AFAF0044 */ sw $t7, 0x44($sp) /* 0FAD60 7F0C61F0 00028400 */ sll $s0, $v0, 0x10 /* 0FAD64 7F0C61F4 0010C403 */ sra $t8, $s0, 0x10 -/* 0FAD68 7F0C61F8 0C001149 */ jal get_video2_settings_uly +/* 0FAD68 7F0C61F8 0C001149 */ jal viGetViewTop /* 0FAD6C 7F0C61FC 03008025 */ move $s0, $t8 /* 0FAD70 7F0C6200 8FAC00A8 */ lw $t4, 0xa8($sp) /* 0FAD74 7F0C6204 8FB90044 */ lw $t9, 0x44($sp) @@ -6494,11 +6494,11 @@ def_7F0C40C0: /* 0FADB0 7F0C6240 000D7080 */ sll $t6, $t5, 2 /* 0FADB4 7F0C6244 25EF9F60 */ addiu $t7, %lo(player1_player_data) # addiu $t7, $t7, -0x60a0 /* 0FADB8 7F0C6248 01CFC021 */ addu $t8, $t6, $t7 -/* 0FADBC 7F0C624C 0C001145 */ jal get_video2_settings_ulx +/* 0FADBC 7F0C624C 0C001145 */ jal viGetViewLeft /* 0FADC0 7F0C6250 AFB80044 */ sw $t8, 0x44($sp) /* 0FADC4 7F0C6254 00028400 */ sll $s0, $v0, 0x10 /* 0FADC8 7F0C6258 00106403 */ sra $t4, $s0, 0x10 -/* 0FADCC 7F0C625C 0C001149 */ jal get_video2_settings_uly +/* 0FADCC 7F0C625C 0C001149 */ jal viGetViewTop /* 0FADD0 7F0C6260 01808025 */ move $s0, $t4 /* 0FADD4 7F0C6264 8FB900A8 */ lw $t9, 0xa8($sp) /* 0FADD8 7F0C6268 8FAB0044 */ lw $t3, 0x44($sp) @@ -6519,11 +6519,11 @@ def_7F0C40C0: /* 0FAE10 7F0C62A0 000E7880 */ sll $t7, $t6, 2 /* 0FAE14 7F0C62A4 27189F60 */ addiu $t8, %lo(player1_player_data) # addiu $t8, $t8, -0x60a0 /* 0FAE18 7F0C62A8 01F86021 */ addu $t4, $t7, $t8 -/* 0FAE1C 7F0C62AC 0C001145 */ jal get_video2_settings_ulx +/* 0FAE1C 7F0C62AC 0C001145 */ jal viGetViewLeft /* 0FAE20 7F0C62B0 AFAC0044 */ sw $t4, 0x44($sp) /* 0FAE24 7F0C62B4 00028400 */ sll $s0, $v0, 0x10 /* 0FAE28 7F0C62B8 0010CC03 */ sra $t9, $s0, 0x10 -/* 0FAE2C 7F0C62BC 0C001149 */ jal get_video2_settings_uly +/* 0FAE2C 7F0C62BC 0C001149 */ jal viGetViewTop /* 0FAE30 7F0C62C0 03208025 */ move $s0, $t9 /* 0FAE34 7F0C62C4 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FAE38 7F0C62C8 8FAD0044 */ lw $t5, 0x44($sp) @@ -6545,11 +6545,11 @@ def_7F0C40C0: /* 0FAE74 7F0C6304 000FC080 */ sll $t8, $t7, 2 /* 0FAE78 7F0C6308 258C9F60 */ addiu $t4, %lo(player1_player_data) # addiu $t4, $t4, -0x60a0 /* 0FAE7C 7F0C630C 030CC821 */ addu $t9, $t8, $t4 -/* 0FAE80 7F0C6310 0C001145 */ jal get_video2_settings_ulx +/* 0FAE80 7F0C6310 0C001145 */ jal viGetViewLeft /* 0FAE84 7F0C6314 AFB90044 */ sw $t9, 0x44($sp) /* 0FAE88 7F0C6318 00028400 */ sll $s0, $v0, 0x10 /* 0FAE8C 7F0C631C 00105C03 */ sra $t3, $s0, 0x10 -/* 0FAE90 7F0C6320 0C001149 */ jal get_video2_settings_uly +/* 0FAE90 7F0C6320 0C001149 */ jal viGetViewTop /* 0FAE94 7F0C6324 01608025 */ move $s0, $t3 /* 0FAE98 7F0C6328 8FAD00A8 */ lw $t5, 0xa8($sp) /* 0FAE9C 7F0C632C 8FAE0044 */ lw $t6, 0x44($sp) @@ -6573,11 +6573,11 @@ def_7F0C40C0: /* 0FAEE0 7F0C6370 3C0B8008 */ lui $t3, %hi(player1_player_data) # $t3, 0x8008 /* 0FAEE4 7F0C6374 256B9F60 */ addiu $t3, %lo(player1_player_data) # addiu $t3, $t3, -0x60a0 /* 0FAEE8 7F0C6378 032B6821 */ addu $t5, $t9, $t3 -/* 0FAEEC 7F0C637C 0C001145 */ jal get_video2_settings_ulx +/* 0FAEEC 7F0C637C 0C001145 */ jal viGetViewLeft /* 0FAEF0 7F0C6380 AFAD0044 */ sw $t5, 0x44($sp) /* 0FAEF4 7F0C6384 00028400 */ sll $s0, $v0, 0x10 /* 0FAEF8 7F0C6388 00107403 */ sra $t6, $s0, 0x10 -/* 0FAEFC 7F0C638C 0C001149 */ jal get_video2_settings_uly +/* 0FAEFC 7F0C638C 0C001149 */ jal viGetViewTop /* 0FAF00 7F0C6390 01C08025 */ move $s0, $t6 /* 0FAF04 7F0C6394 8FAF00A8 */ lw $t7, 0xa8($sp) /* 0FAF08 7F0C6398 8FB80044 */ lw $t8, 0x44($sp) @@ -6599,11 +6599,11 @@ def_7F0C40C0: /* 0FAF44 7F0C63D4 00195880 */ sll $t3, $t9, 2 /* 0FAF48 7F0C63D8 25AD9F60 */ addiu $t5, %lo(player1_player_data) # addiu $t5, $t5, -0x60a0 /* 0FAF4C 7F0C63DC 016D7021 */ addu $t6, $t3, $t5 -/* 0FAF50 7F0C63E0 0C001145 */ jal get_video2_settings_ulx +/* 0FAF50 7F0C63E0 0C001145 */ jal viGetViewLeft /* 0FAF54 7F0C63E4 AFAE0044 */ sw $t6, 0x44($sp) /* 0FAF58 7F0C63E8 00028400 */ sll $s0, $v0, 0x10 /* 0FAF5C 7F0C63EC 00107C03 */ sra $t7, $s0, 0x10 -/* 0FAF60 7F0C63F0 0C001149 */ jal get_video2_settings_uly +/* 0FAF60 7F0C63F0 0C001149 */ jal viGetViewTop /* 0FAF64 7F0C63F4 01E08025 */ move $s0, $t7 /* 0FAF68 7F0C63F8 8FB800A8 */ lw $t8, 0xa8($sp) /* 0FAF6C 7F0C63FC 8FAC0044 */ lw $t4, 0x44($sp) @@ -6652,7 +6652,7 @@ def_7F0C40C0: /* 0FB008 7F0C6498 AFA00014 */ sw $zero, 0x14($sp) /* 0FB00C 7F0C649C 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB010 7F0C64A0 AFAD0010 */ sw $t5, 0x10($sp) -/* 0FB014 7F0C64A4 0C001145 */ jal get_video2_settings_ulx +/* 0FB014 7F0C64A4 0C001145 */ jal viGetViewLeft /* 0FB018 7F0C64A8 00000000 */ nop /* 0FB01C 7F0C64AC 8FAE0074 */ lw $t6, 0x74($sp) /* 0FB020 7F0C64B0 8FAB0078 */ lw $t3, 0x78($sp) @@ -6660,7 +6660,7 @@ def_7F0C40C0: /* 0FB028 7F0C64B8 000BC043 */ sra $t8, $t3, 1 /* 0FB02C 7F0C64BC 01F82023 */ subu $a0, $t7, $t8 /* 0FB030 7F0C64C0 24840050 */ addiu $a0, $a0, 0x50 -/* 0FB034 7F0C64C4 0C001149 */ jal get_video2_settings_uly +/* 0FB034 7F0C64C4 0C001149 */ jal viGetViewTop /* 0FB038 7F0C64C8 AFA400CC */ sw $a0, 0xcc($sp) /* 0FB03C 7F0C64CC 8FAC007C */ lw $t4, 0x7c($sp) /* 0FB040 7F0C64D0 000CC843 */ sra $t9, $t4, 1 @@ -6705,7 +6705,7 @@ def_7F0C40C0: /* 0FB0DC 7F0C656C AFA00014 */ sw $zero, 0x14($sp) /* 0FB0E0 7F0C6570 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB0E4 7F0C6574 AFB90010 */ sw $t9, 0x10($sp) -/* 0FB0E8 7F0C6578 0C001145 */ jal get_video2_settings_ulx +/* 0FB0E8 7F0C6578 0C001145 */ jal viGetViewLeft /* 0FB0EC 7F0C657C 00000000 */ nop /* 0FB0F0 7F0C6580 8FAD0074 */ lw $t5, 0x74($sp) /* 0FB0F4 7F0C6584 8FAB0078 */ lw $t3, 0x78($sp) @@ -6713,7 +6713,7 @@ def_7F0C40C0: /* 0FB0FC 7F0C658C 000B7843 */ sra $t7, $t3, 1 /* 0FB100 7F0C6590 01CF2023 */ subu $a0, $t6, $t7 /* 0FB104 7F0C6594 24840050 */ addiu $a0, $a0, 0x50 -/* 0FB108 7F0C6598 0C001149 */ jal get_video2_settings_uly +/* 0FB108 7F0C6598 0C001149 */ jal viGetViewTop /* 0FB10C 7F0C659C AFA400CC */ sw $a0, 0xcc($sp) /* 0FB110 7F0C65A0 3C0C8005 */ lui $t4, %hi(j_text_trigger) # $t4, 0x8005 /* 0FB114 7F0C65A4 8D8C8500 */ lw $t4, %lo(j_text_trigger)($t4) @@ -6771,7 +6771,7 @@ def_7F0C40C0: /* 0FB1DC 7F0C666C AFA800A4 */ sw $t0, 0xa4($sp) /* 0FB1E0 7F0C6670 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB1E4 7F0C6674 AFAB0010 */ sw $t3, 0x10($sp) -/* 0FB1E8 7F0C6678 0C001145 */ jal get_video2_settings_ulx +/* 0FB1E8 7F0C6678 0C001145 */ jal viGetViewLeft /* 0FB1EC 7F0C667C 00000000 */ nop /* 0FB1F0 7F0C6680 8FAE0074 */ lw $t6, 0x74($sp) /* 0FB1F4 7F0C6684 8FB80078 */ lw $t8, 0x78($sp) @@ -6779,7 +6779,7 @@ def_7F0C40C0: /* 0FB1FC 7F0C668C 00186043 */ sra $t4, $t8, 1 /* 0FB200 7F0C6690 01EC2023 */ subu $a0, $t7, $t4 /* 0FB204 7F0C6694 24840050 */ addiu $a0, $a0, 0x50 -/* 0FB208 7F0C6698 0C001149 */ jal get_video2_settings_uly +/* 0FB208 7F0C6698 0C001149 */ jal viGetViewTop /* 0FB20C 7F0C669C AFA400CC */ sw $a0, 0xcc($sp) /* 0FB210 7F0C66A0 8FAD007C */ lw $t5, 0x7c($sp) /* 0FB214 7F0C66A4 000DC843 */ sra $t9, $t5, 1 @@ -6826,7 +6826,7 @@ def_7F0C40C0: /* 0FB2B4 7F0C6744 AFA200A4 */ sw $v0, 0xa4($sp) /* 0FB2B8 7F0C6748 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB2BC 7F0C674C AFB90010 */ sw $t9, 0x10($sp) -/* 0FB2C0 7F0C6750 0C001145 */ jal get_video2_settings_ulx +/* 0FB2C0 7F0C6750 0C001145 */ jal viGetViewLeft /* 0FB2C4 7F0C6754 00000000 */ nop /* 0FB2C8 7F0C6758 8FAB0074 */ lw $t3, 0x74($sp) /* 0FB2CC 7F0C675C 8FB80078 */ lw $t8, 0x78($sp) @@ -6834,7 +6834,7 @@ def_7F0C40C0: /* 0FB2D4 7F0C6764 00187843 */ sra $t7, $t8, 1 /* 0FB2D8 7F0C6768 01CF2023 */ subu $a0, $t6, $t7 /* 0FB2DC 7F0C676C 24840050 */ addiu $a0, $a0, 0x50 -/* 0FB2E0 7F0C6770 0C001149 */ jal get_video2_settings_uly +/* 0FB2E0 7F0C6770 0C001149 */ jal viGetViewTop /* 0FB2E4 7F0C6774 AFA400CC */ sw $a0, 0xcc($sp) /* 0FB2E8 7F0C6778 8FAC007C */ lw $t4, 0x7c($sp) /* 0FB2EC 7F0C677C 000C6843 */ sra $t5, $t4, 1 @@ -6886,7 +6886,7 @@ def_7F0C40C0: /* 0FB39C 7F0C682C AFA00014 */ sw $zero, 0x14($sp) /* 0FB3A0 7F0C6830 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB3A4 7F0C6834 AFB90010 */ sw $t9, 0x10($sp) -/* 0FB3A8 7F0C6838 0C001145 */ jal get_video2_settings_ulx +/* 0FB3A8 7F0C6838 0C001145 */ jal viGetViewLeft /* 0FB3AC 7F0C683C 00000000 */ nop /* 0FB3B0 7F0C6840 8FAB00A8 */ lw $t3, 0xa8($sp) /* 0FB3B4 7F0C6844 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -6894,7 +6894,7 @@ def_7F0C40C0: /* 0FB3BC 7F0C684C 000E7843 */ sra $t7, $t6, 1 /* 0FB3C0 7F0C6850 030F2023 */ subu $a0, $t8, $t7 /* 0FB3C4 7F0C6854 24840036 */ addiu $a0, $a0, 0x36 -/* 0FB3C8 7F0C6858 0C001149 */ jal get_video2_settings_uly +/* 0FB3C8 7F0C6858 0C001149 */ jal viGetViewTop /* 0FB3CC 7F0C685C AFA400CC */ sw $a0, 0xcc($sp) /* 0FB3D0 7F0C6860 8FAC00BC */ lw $t4, 0xbc($sp) /* 0FB3D4 7F0C6864 3C0E8008 */ lui $t6, %hi(pPlayer) # $t6, 0x8008 @@ -6975,7 +6975,7 @@ def_7F0C40C0: /* 0FB4F8 7F0C6988 AFA00014 */ sw $zero, 0x14($sp) /* 0FB4FC 7F0C698C 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB500 7F0C6990 AFAD0010 */ sw $t5, 0x10($sp) -/* 0FB504 7F0C6994 0C001145 */ jal get_video2_settings_ulx +/* 0FB504 7F0C6994 0C001145 */ jal viGetViewLeft /* 0FB508 7F0C6998 00000000 */ nop /* 0FB50C 7F0C699C 8FB900A8 */ lw $t9, 0xa8($sp) /* 0FB510 7F0C69A0 8FAE00C0 */ lw $t6, 0xc0($sp) @@ -6983,7 +6983,7 @@ def_7F0C40C0: /* 0FB518 7F0C69A8 000EC043 */ sra $t8, $t6, 1 /* 0FB51C 7F0C69AC 01782023 */ subu $a0, $t3, $t8 /* 0FB520 7F0C69B0 24840068 */ addiu $a0, $a0, 0x68 -/* 0FB524 7F0C69B4 0C001149 */ jal get_video2_settings_uly +/* 0FB524 7F0C69B4 0C001149 */ jal viGetViewTop /* 0FB528 7F0C69B8 AFA400CC */ sw $a0, 0xcc($sp) /* 0FB52C 7F0C69BC 8FAF00BC */ lw $t7, 0xbc($sp) /* 0FB530 7F0C69C0 3C0E8008 */ lui $t6, %hi(pPlayer) # $t6, 0x8008 @@ -7147,9 +7147,9 @@ def_7F0C40C0: /* 0FB788 7F0C6C18 AFA00014 */ sw $zero, 0x14($sp) /* 0FB78C 7F0C6C1C 0FC2BD4F */ jal sub_GAME_7F0AE98C /* 0FB790 7F0C6C20 AFB80010 */ sw $t8, 0x10($sp) -/* 0FB794 7F0C6C24 0C001145 */ jal get_video2_settings_ulx +/* 0FB794 7F0C6C24 0C001145 */ jal viGetViewLeft /* 0FB798 7F0C6C28 00000000 */ nop -/* 0FB79C 7F0C6C2C 0C001127 */ jal get_video2_settings_width +/* 0FB79C 7F0C6C2C 0C001127 */ jal viGetViewWidth /* 0FB7A0 7F0C6C30 A7A20056 */ sh $v0, 0x56($sp) /* 0FB7A4 7F0C6C34 87A80056 */ lh $t0, 0x56($sp) /* 0FB7A8 7F0C6C38 8FAE0068 */ lw $t6, 0x68($sp) @@ -7157,9 +7157,9 @@ def_7F0C40C0: /* 0FB7B0 7F0C6C40 01A8C821 */ addu $t9, $t5, $t0 /* 0FB7B4 7F0C6C44 000E7843 */ sra $t7, $t6, 1 /* 0FB7B8 7F0C6C48 032F5023 */ subu $t2, $t9, $t7 -/* 0FB7BC 7F0C6C4C 0C001149 */ jal get_video2_settings_uly +/* 0FB7BC 7F0C6C4C 0C001149 */ jal viGetViewTop /* 0FB7C0 7F0C6C50 AFAA0070 */ sw $t2, 0x70($sp) -/* 0FB7C4 7F0C6C54 0C00112B */ jal get_video2_settings_height +/* 0FB7C4 7F0C6C54 0C00112B */ jal viGetViewHeight /* 0FB7C8 7F0C6C58 A7A20056 */ sh $v0, 0x56($sp) /* 0FB7CC 7F0C6C5C 87A80056 */ lh $t0, 0x56($sp) /* 0FB7D0 7F0C6C60 8FA90064 */ lw $t1, 0x64($sp) diff --git a/src/game/objecthandler_2.c b/src/game/objecthandler_2.c index 0b2e6c7e..421e3544 100644 --- a/src/game/objecthandler_2.c +++ b/src/game/objecthandler_2.c @@ -1,4 +1,5 @@ #include "ultra64.h" +#include "structs.h" //D:80054600 const char aGetsubmatrixNoObjinst[] = "getsubmatrix: no objinst!\n"; @@ -1072,38 +1073,14 @@ glabel getinstsize - -#ifdef NONMATCHING -void sub_GAME_7F06D07C(void) { - +// Also matches with float*s +void interpolate3dVectors(struct float3 *v,struct float3 *w,float k) +{ + v->x += (w->x - v->x) * k; + v->y += (w->y - v->y) * k; + v->z += (w->z - v->z) * k; + return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F06D07C -/* 0A1BAC 7F06D07C C4800000 */ lwc1 $f0, ($a0) -/* 0A1BB0 7F06D080 C4A40000 */ lwc1 $f4, ($a1) -/* 0A1BB4 7F06D084 44866000 */ mtc1 $a2, $f12 -/* 0A1BB8 7F06D088 C4820004 */ lwc1 $f2, 4($a0) -/* 0A1BBC 7F06D08C 46002181 */ sub.s $f6, $f4, $f0 -/* 0A1BC0 7F06D090 C48E0008 */ lwc1 $f14, 8($a0) -/* 0A1BC4 7F06D094 460C3202 */ mul.s $f8, $f6, $f12 -/* 0A1BC8 7F06D098 46080280 */ add.s $f10, $f0, $f8 -/* 0A1BCC 7F06D09C E48A0000 */ swc1 $f10, ($a0) -/* 0A1BD0 7F06D0A0 C4B00004 */ lwc1 $f16, 4($a1) -/* 0A1BD4 7F06D0A4 46028481 */ sub.s $f18, $f16, $f2 -/* 0A1BD8 7F06D0A8 460C9102 */ mul.s $f4, $f18, $f12 -/* 0A1BDC 7F06D0AC 46041180 */ add.s $f6, $f2, $f4 -/* 0A1BE0 7F06D0B0 E4860004 */ swc1 $f6, 4($a0) -/* 0A1BE4 7F06D0B4 C4A80008 */ lwc1 $f8, 8($a1) -/* 0A1BE8 7F06D0B8 460E4281 */ sub.s $f10, $f8, $f14 -/* 0A1BEC 7F06D0BC 460C5402 */ mul.s $f16, $f10, $f12 -/* 0A1BF0 7F06D0C0 46107480 */ add.s $f18, $f14, $f16 -/* 0A1BF4 7F06D0C4 03E00008 */ jr $ra -/* 0A1BF8 7F06D0C8 E4920008 */ swc1 $f18, 8($a0) -) -#endif - @@ -1485,7 +1462,7 @@ glabel sub_GAME_7F06D490 /* 0A2028 7F06D4F8 51E0000B */ beql $t7, $zero, .L7F06D528 /* 0A202C 7F06D4FC 8E380054 */ lw $t8, 0x54($s1) /* 0A2030 7F06D500 44060000 */ mfc1 $a2, $f0 -/* 0A2034 7F06D504 0FC1B41F */ jal sub_GAME_7F06D07C +/* 0A2034 7F06D504 0FC1B41F */ jal interpolate3dVectors /* 0A2038 7F06D508 24450024 */ addiu $a1, $v0, 0x24 /* 0A203C 7F06D50C C60C0030 */ lwc1 $f12, 0x30($s0) /* 0A2040 7F06D510 C60E0020 */ lwc1 $f14, 0x20($s0) diff --git a/src/game/playerstats_007770.c b/src/game/playerstats_007770.c index 60b9ecba..f78db683 100644 --- a/src/game/playerstats_007770.c +++ b/src/game/playerstats_007770.c @@ -15,7 +15,7 @@ glabel sub_GAME_7F007770 /* 03C2A8 7F007778 AFB30020 */ sw $s3, 0x20($sp) /* 03C2AC 7F00777C AFB2001C */ sw $s2, 0x1c($sp) /* 03C2B0 7F007780 AFB10018 */ sw $s1, 0x18($sp) -/* 03C2B4 7F007784 0FC26919 */ jal get_num_players +/* 03C2B4 7F007784 0FC26919 */ jal getPlayerCount /* 03C2B8 7F007788 AFB00014 */ sw $s0, 0x14($sp) /* 03C2BC 7F00778C 0FC26C54 */ jal get_cur_playernum /* 03C2C0 7F007790 00409825 */ move $s3, $v0 diff --git a/src/game/prop.c b/src/game/prop.c index 69f80e6c..785686c3 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -286,7 +286,7 @@ glabel prepare_load_objects /* 036938 7F001E08 00000000 */ nop /* 03693C 7F001E0C 468041A0 */ cvt.s.w $f6, $f8 /* 036940 7F001E10 460A3103 */ div.s $f4, $f6, $f10 -/* 036944 7F001E14 0FC26919 */ jal get_num_players +/* 036944 7F001E14 0FC26919 */ jal getPlayerCount /* 036948 7F001E18 E6240074 */ swc1 $f4, 0x74($s1) /* 03694C 7F001E1C 28410002 */ slti $at, $v0, 2 /* 036950 7F001E20 1420001B */ bnez $at, .L7F001E90 @@ -407,7 +407,7 @@ glabel prepare_load_objects /* 036AF8 7F001FC8 00000000 */ nop /* 036AFC 7F001FCC 8FAE006C */ lw $t6, 0x6c($sp) /* 036B00 7F001FD0 02002025 */ move $a0, $s0 -/* 036B04 7F001FD4 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 036B04 7F001FD4 0FC0E969 */ jal attachNewChild /* 036B08 7F001FD8 8DC50018 */ lw $a1, 0x18($t6) /* 036B0C 7F001FDC 100001D2 */ b .L7F002728 /* 036B10 7F001FE0 8FBF0034 */ lw $ra, 0x34($sp) @@ -445,7 +445,7 @@ glabel prepare_load_objects /* 036B8C 7F00205C E7A60020 */ swc1 $f6, 0x20($sp) /* 036B90 7F002060 C44A0014 */ lwc1 $f10, 0x14($v0) /* 036B94 7F002064 AFA20064 */ sw $v0, 0x64($sp) -/* 036B98 7F002068 0FC16642 */ jal sub_GAME_7F059908 +/* 036B98 7F002068 0FC16642 */ jal matrix_4x4_7F059908 /* 036B9C 7F00206C E7AA0024 */ swc1 $f10, 0x24($sp) /* 036BA0 7F002070 8FA20064 */ lw $v0, 0x64($sp) /* 036BA4 7F002074 C4440000 */ lwc1 $f4, ($v0) @@ -503,7 +503,7 @@ glabel prepare_load_objects /* 036C68 7F002138 C6040010 */ lwc1 $f4, 0x10($s0) /* 036C6C 7F00213C E7A40020 */ swc1 $f4, 0x20($sp) /* 036C70 7F002140 C6080014 */ lwc1 $f8, 0x14($s0) -/* 036C74 7F002144 0FC16642 */ jal sub_GAME_7F059908 +/* 036C74 7F002144 0FC16642 */ jal matrix_4x4_7F059908 /* 036C78 7F002148 E7A80024 */ swc1 $f8, 0x24($sp) /* 036C7C 7F00214C 8E2C000C */ lw $t4, 0xc($s1) /* 036C80 7F002150 02002025 */ move $a0, $s0 @@ -1025,7 +1025,7 @@ glabel expand_08_obj_set_guard_MP_weapons /* 037330 7F002800 24050001 */ li $a1, 1 .L7F002804: /* 037334 7F002804 AFA50018 */ sw $a1, 0x18($sp) -/* 037338 7F002808 0FC26919 */ jal get_num_players +/* 037338 7F002808 0FC26919 */ jal getPlayerCount /* 03733C 7F00280C AFA7002C */ sw $a3, 0x2c($sp) /* 037340 7F002810 28410002 */ slti $at, $v0, 2 /* 037344 7F002814 8FA50018 */ lw $a1, 0x18($sp) @@ -1327,7 +1327,7 @@ glabel sub_GAME_7F002A3C /* 037698 7F002B68 46062281 */ sub.s $f10, $f4, $f6 /* 03769C 7F002B6C E7A0001C */ swc1 $f0, 0x1c($sp) /* 0376A0 7F002B70 E7A80020 */ swc1 $f8, 0x20($sp) -/* 0376A4 7F002B74 0FC16642 */ jal sub_GAME_7F059908 +/* 0376A4 7F002B74 0FC16642 */ jal matrix_4x4_7F059908 /* 0376A8 7F002B78 E7AA0018 */ swc1 $f10, 0x18($sp) /* 0376AC 7F002B7C 8E0F0014 */ lw $t7, 0x14($s0) /* 0376B0 7F002B80 8FA5003C */ lw $a1, 0x3c($sp) @@ -1597,7 +1597,7 @@ glabel sub_GAME_7F002E3C /* 037A5C 7F002F2C 00000000 */ nop /* 037A60 7F002F30 46809120 */ cvt.s.w $f4, $f18 /* 037A64 7F002F34 46082183 */ div.s $f6, $f4, $f8 -/* 037A68 7F002F38 0FC26919 */ jal get_num_players +/* 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 @@ -1670,7 +1670,7 @@ glabel sub_GAME_7F002E3C /* 037B70 7F003040 ADAC001C */ sw $t4, 0x1c($t5) .L7F003044: /* 037B74 7F003044 8FA40024 */ lw $a0, 0x24($sp) -/* 037B78 7F003048 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 037B78 7F003048 0FC0E969 */ jal attachNewChild /* 037B7C 7F00304C 8E250010 */ lw $a1, 0x10($s1) /* 037B80 7F003050 8E05006C */ lw $a1, 0x6c($s0) /* 037B84 7F003054 3C018005 */ lui $at, %hi(D_8004EF58) @@ -2178,7 +2178,7 @@ glabel sub_GAME_7F003480 /* 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 sub_GAME_7F059908 +/* 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) @@ -2687,7 +2687,7 @@ glabel proplvreset2 /* 03884C 7F003D1C AD410000 */ sw $at, ($t2) /* 038850 7F003D20 904B0000 */ lbu $t3, ($v0) /* 038854 7F003D24 A3A00175 */ sb $zero, 0x175($sp) -/* 038858 7F003D28 0FC26919 */ jal get_num_players +/* 038858 7F003D28 0FC26919 */ jal getPlayerCount /* 03885C 7F003D2C A3AB0174 */ sb $t3, 0x174($sp) /* 038860 7F003D30 28410002 */ slti $at, $v0, 2 /* 038864 7F003D34 14200004 */ bnez $at, .L7F003D48 @@ -3069,7 +3069,7 @@ glabel proplvreset2 /* 038DD8 7F0042A8 02602025 */ move $a0, $s3 /* 038DDC 7F0042AC 0FC01589 */ jal sub_GAME_7F005624 /* 038DE0 7F0042B0 02802025 */ move $a0, $s4 -/* 038DE4 7F0042B4 0FC26919 */ jal get_num_players +/* 038DE4 7F0042B4 0FC26919 */ jal getPlayerCount /* 038DE8 7F0042B8 00008025 */ move $s0, $zero /* 038DEC 7F0042BC 1840000C */ blez $v0, .L7F0042F0 /* 038DF0 7F0042C0 00000000 */ nop @@ -3080,7 +3080,7 @@ glabel proplvreset2 /* 038E00 7F0042D0 2404000E */ li $a0, 14 /* 038E04 7F0042D4 0FC01897 */ jal alloc_additional_item_slots /* 038E08 7F0042D8 00402025 */ move $a0, $v0 -/* 038E0C 7F0042DC 0FC26919 */ jal get_num_players +/* 038E0C 7F0042DC 0FC26919 */ jal getPlayerCount /* 038E10 7F0042E0 26100001 */ addiu $s0, $s0, 1 /* 038E14 7F0042E4 0202082A */ slt $at, $s0, $v0 /* 038E18 7F0042E8 1420FFF6 */ bnez $at, .L7F0042C4 @@ -3094,12 +3094,12 @@ glabel proplvreset2 /* 038E34 7F004304 00000000 */ nop /* 038E38 7F004308 244C0004 */ addiu $t4, $v0, 4 /* 038E3C 7F00430C 240D0001 */ li $t5, 1 -/* 038E40 7F004310 0FC26919 */ jal get_num_players +/* 038E40 7F004310 0FC26919 */ jal getPlayerCount /* 038E44 7F004314 018DA004 */ sllv $s4, $t5, $t4 /* 038E48 7F004318 28410002 */ slti $at, $v0, 2 /* 038E4C 7F00431C 14200007 */ bnez $at, .L7F00433C /* 038E50 7F004320 00000000 */ nop -/* 038E54 7F004324 0FC26919 */ jal get_num_players +/* 038E54 7F004324 0FC26919 */ jal getPlayerCount /* 038E58 7F004328 00000000 */ nop /* 038E5C 7F00432C 244E0014 */ addiu $t6, $v0, 0x14 /* 038E60 7F004330 240F0001 */ li $t7, 1 @@ -3390,7 +3390,7 @@ obj_03_expand: /* 039288 7F004758 100000E8 */ b other_obj_expand /* 03928C 7F00475C 00000000 */ nop ammo_box_expand: -/* 039290 7F004760 0FC26919 */ jal get_num_players +/* 039290 7F004760 0FC26919 */ jal getPlayerCount /* 039294 7F004764 24100001 */ li $s0, 1 /* 039298 7F004768 28410002 */ slti $at, $v0, 2 /* 03929C 7F00476C 1420000E */ bnez $at, .L7F0047A8 @@ -3694,7 +3694,7 @@ other_obj_expand: /* 0396EC 7F004BBC 0FC1B39E */ jal set_obj_instance_controller_scale /* 0396F0 7F004BC0 8C850014 */ lw $a1, 0x14($a0) /* 0396F4 7F004BC4 8E440010 */ lw $a0, 0x10($s2) -/* 0396F8 7F004BC8 0FC0E969 */ jal sub_GAME_7F03A5A4 +/* 0396F8 7F004BC8 0FC0E969 */ jal attachNewChild /* 0396FC 7F004BCC 8E050010 */ lw $a1, 0x10($s0) /* 039700 7F004BD0 10000084 */ b .L7F004DE4 /* 039704 7F004BD4 00000000 */ nop @@ -4080,7 +4080,7 @@ glabel jpt_8004F02C /* 03888C 7F003D1C AD410000 */ sw $at, ($t2) /* 038890 7F003D20 904B0000 */ lbu $t3, ($v0) /* 038894 7F003D24 A3A00175 */ sb $zero, 0x175($sp) -/* 038898 7F003D28 0FC26C01 */ jal get_num_players +/* 038898 7F003D28 0FC26C01 */ jal getPlayerCount /* 03889C 7F003D2C A3AB0174 */ sb $t3, 0x174($sp) /* 0388A0 7F003D30 28410002 */ slti $at, $v0, 2 /* 0388A4 7F003D34 14200004 */ bnez $at, .L7F003D48 @@ -4462,7 +4462,7 @@ glabel jpt_8004F02C /* 038E18 7F0042A8 02602025 */ move $a0, $s3 /* 038E1C 7F0042AC 0FC01591 */ jal sub_GAME_7F005624 /* 038E20 7F0042B0 02802025 */ move $a0, $s4 -/* 038E24 7F0042B4 0FC26C01 */ jal get_num_players +/* 038E24 7F0042B4 0FC26C01 */ jal getPlayerCount /* 038E28 7F0042B8 00008025 */ move $s0, $zero /* 038E2C 7F0042BC 1840000C */ blez $v0, .L7F0042F0 /* 038E30 7F0042C0 00000000 */ nop @@ -4473,7 +4473,7 @@ glabel jpt_8004F02C /* 038E40 7F0042D0 2404000E */ li $a0, 14 /* 038E44 7F0042D4 0FC01897 */ jal alloc_additional_item_slots /* 038E48 7F0042D8 00402025 */ move $a0, $v0 -/* 038E4C 7F0042DC 0FC26C01 */ jal get_num_players +/* 038E4C 7F0042DC 0FC26C01 */ jal getPlayerCount /* 038E50 7F0042E0 26100001 */ addiu $s0, $s0, 1 /* 038E54 7F0042E4 0202082A */ slt $at, $s0, $v0 /* 038E58 7F0042E8 1420FFF6 */ bnez $at, .L7F0042C4 @@ -4487,12 +4487,12 @@ glabel jpt_8004F02C /* 038E74 7F004304 00000000 */ nop /* 038E78 7F004308 244C0004 */ addiu $t4, $v0, 4 /* 038E7C 7F00430C 240D0001 */ li $t5, 1 -/* 038E80 7F004310 0FC26C01 */ jal get_num_players +/* 038E80 7F004310 0FC26C01 */ jal getPlayerCount /* 038E84 7F004314 018DA004 */ sllv $s4, $t5, $t4 /* 038E88 7F004318 28410002 */ slti $at, $v0, 2 /* 038E8C 7F00431C 14200007 */ bnez $at, .L7F00433C /* 038E90 7F004320 00000000 */ nop -/* 038E94 7F004324 0FC26C01 */ jal get_num_players +/* 038E94 7F004324 0FC26C01 */ jal getPlayerCount /* 038E98 7F004328 00000000 */ nop /* 038E9C 7F00432C 244E0014 */ addiu $t6, $v0, 0x14 /* 038EA0 7F004330 240F0001 */ li $t7, 1 @@ -4788,7 +4788,7 @@ obj_03_expand: /* 0392D8 7F004768 100000E8 */ b other_obj_expand /* 0392DC 7F00476C 00000000 */ nop ammo_box_expand: -/* 0392E0 7F004770 0FC26C01 */ jal get_num_players +/* 0392E0 7F004770 0FC26C01 */ jal getPlayerCount /* 0392E4 7F004774 24100001 */ li $s0, 1 /* 0392E8 7F004778 28410002 */ slti $at, $v0, 2 /* 0392EC 7F00477C 1420000E */ bnez $at, .L7F0047B8 @@ -5092,7 +5092,7 @@ other_obj_expand: /* 03973C 7F004BCC 0FC1B51A */ jal set_obj_instance_controller_scale /* 039740 7F004BD0 8C850014 */ lw $a1, 0x14($a0) /* 039744 7F004BD4 8E440010 */ lw $a0, 0x10($s2) -/* 039748 7F004BD8 0FC0EA29 */ jal sub_GAME_7F03A5A4 +/* 039748 7F004BD8 0FC0EA29 */ jal attachNewChild /* 03974C 7F004BDC 8E050010 */ lw $a1, 0x10($s0) /* 039750 7F004BE0 10000084 */ b .L7F004DF4 /* 039754 7F004BE4 00000000 */ nop diff --git a/src/game/radar.c b/src/game/radar.c index 6f7b6e99..6e855ac6 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -37,7 +37,7 @@ glabel display_red_blue_on_radar /* 0FAC04 7F0C60D4 AFA40088 */ sw $a0, 0x88($sp) /* 0FAC08 7F0C60D8 0FC26C54 */ jal get_cur_playernum /* 0FAC0C 7F0C60DC 0040A025 */ move $s4, $v0 -/* 0FAC10 7F0C60E0 0FC26919 */ jal get_num_players +/* 0FAC10 7F0C60E0 0FC26919 */ jal getPlayerCount /* 0FAC14 7F0C60E4 AFA20070 */ sw $v0, 0x70($sp) /* 0FAC18 7F0C60E8 24010001 */ li $at, 1 /* 0FAC1C 7F0C60EC 14410003 */ bne $v0, $at, .L7F0C60FC @@ -65,14 +65,14 @@ glabel display_red_blue_on_radar /* 0FAC68 7F0C6138 10000113 */ b .L7F0C6588 /* 0FAC6C 7F0C613C 8FA20088 */ lw $v0, 0x88($sp) .L7F0C6140: -/* 0FAC70 7F0C6140 0C001145 */ jal get_video2_settings_ulx +/* 0FAC70 7F0C6140 0C001145 */ jal viGetViewLeft /* 0FAC74 7F0C6144 00000000 */ nop /* 0FAC78 7F0C6148 00028400 */ sll $s0, $v0, 0x10 /* 0FAC7C 7F0C614C 0010C403 */ sra $t8, $s0, 0x10 -/* 0FAC80 7F0C6150 0C001127 */ jal get_video2_settings_width +/* 0FAC80 7F0C6150 0C001127 */ jal viGetViewWidth /* 0FAC84 7F0C6154 03008025 */ move $s0, $t8 /* 0FAC88 7F0C6158 0050A821 */ addu $s5, $v0, $s0 -/* 0FAC8C 7F0C615C 0C001149 */ jal get_video2_settings_uly +/* 0FAC8C 7F0C615C 0C001149 */ jal viGetViewTop /* 0FAC90 7F0C6160 26B5FFD7 */ addiu $s5, $s5, -0x29 /* 0FAC94 7F0C6164 8FB90074 */ lw $t9, 0x74($sp) /* 0FAC98 7F0C6168 2456001A */ addiu $s6, $v0, 0x1a @@ -217,10 +217,10 @@ glabel display_red_blue_on_radar /* 0FAEA8 7F0C6378 8FAA0070 */ lw $t2, 0x70($sp) .L7F0C637C: /* 0FAEAC 7F0C637C 00135880 */ sll $t3, $s3, 2 -/* 0FAEB0 7F0C6380 3C048008 */ lui $a0, %hi(ptr_BONDdata_p1) +/* 0FAEB0 7F0C6380 3C048008 */ lui $a0, %hi(players) /* 0FAEB4 7F0C6384 126A007A */ beq $s3, $t2, .L7F0C6570 /* 0FAEB8 7F0C6388 008B2021 */ addu $a0, $a0, $t3 -/* 0FAEBC 7F0C638C 8C849EE0 */ lw $a0, %lo(ptr_BONDdata_p1)($a0) +/* 0FAEBC 7F0C638C 8C849EE0 */ lw $a0, %lo(players)($a0) /* 0FAEC0 7F0C6390 8C8C00D8 */ lw $t4, 0xd8($a0) /* 0FAEC4 7F0C6394 55800077 */ bnezl $t4, .L7F0C6574 /* 0FAEC8 7F0C6398 8FB80074 */ lw $t8, 0x74($sp) diff --git a/src/game/stan.c b/src/game/stan.c index 2fb0fb24..dc5ded1b 100644 --- a/src/game/stan.c +++ b/src/game/stan.c @@ -1,10 +1,20 @@ #include "ultra64.h" +#include "game/stan.h" +#include "structs.h" +#include "game/bg.h" // bss -//CODE.bss:8007B120 -s32 clippingfile; -//CODE.bss:8007B124 -s32 ptr_firstroom; +struct StanPrefixRecord { + //CODE.bss:8007B120 + s32 clippingfile; + //CODE.bss:8007B124 + struct StandTile* ptr_firstroom; // read as offset 4, hence the struct +}; + +struct StanPrefixRecord stan_prefix; + + + //CODE.bss:8007B128 s32 dword_CODE_bss_8007B128; //CODE.bss:8007B12C @@ -25,40 +35,42 @@ s32 dword_CODE_bss_8007B358[0x1a1]; s32 dword_CODE_bss_8007B9DC; //CODE.bss:8007B9E0 s32 dword_CODE_bss_8007B9E0; + + + +// All relating to a saved collision, but not one struct //CODE.bss:8007B9E4 -s32 dword_CODE_bss_8007B9E4; +struct StandTile* stanSavedColl_tile; //CODE.bss:8007B9E8 -s32 dword_CODE_bss_8007B9E8; +s32 stanSavedColl_pointI; //CODE.bss:8007B9EC -s32 dword_CODE_bss_8007B9EC; +s32 stanSavedColl_unknown; //CODE.bss:8007B9F0 -f32 flt_CODE_bss_8007B9F0; -//CODE.bss:8007B9F4 -f32 flt_CODE_bss_8007B9F4; +struct float2 stanSavedColl_pntA; //CODE.bss:8007B9F8 -f32 flt_CODE_bss_8007B9F8; -//CODE.bss:8007B9FC -f32 flt_CODE_bss_8007B9FC; +struct float2 stanSavedColl_pntB; //CODE.bss:8007BA00 -f32 flt_CODE_bss_8007BA00; +f32 stanSavedColl_someMin; //CODE.bss:8007BA04 -s32 dword_CODE_bss_8007BA04; +s32 stanSavedColl_posData; + + //CODE.bss:8007BA08 s32 dword_CODE_bss_8007BA08; //CODE.bss:8007BA0C s32 dword_CODE_bss_8007BA0C; //CODE.bss:8007BA10 -char dword_CODE_bss_8007BA10[0x580]; +struct StandTile* bfsTileStack[352]; // data //D:80040F30 -s32 D_80040F30[] = {0x8D8604C5, 0x9DA40000, 0, 0}; +u8 D_80040F30[] = {0x8D, 0x86, 0x04, 0xC5, 0x9D, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; s32 stan_c_debug_notice_list_entry = 0; //D:80040F44 -f32 D_80040F44 = 1.0; +f32 level_scale = 1.0; //D:80040F48 -f32 D_80040F48 = 1.0; +f32 inv_level_scale = 1.0; //D:80040F4C u8 list_of_tilesizes[] = { 0x20,0x20,0x20,0x20, @@ -66,7 +78,7 @@ u8 list_of_tilesizes[] = { 0x48,0x50,0x58,0x00 }; //D:80040F58 -s32 base_ptr_connection_vals = 0; +s32 standTileStart = 0; //D:80040F5C s32 ptr_firstroom_0 = 0; //D:80040F60 @@ -273,11 +285,11 @@ loop_1: goto loop_1; } // Node 2 - if (*clippingfile->unk4 != 0) + if (*stan_prefix.ptr_firstroom != 0) { // Node 3 phi_a1 = 0xff; - phi_a0 = clippingfile->unk4; + phi_a0 = stan_prefix.ptr_firstroom; phi_a2 = 0xff; loop_4: // Node 4 @@ -397,8 +409,8 @@ glabel sub_GAME_7F0AF038 /* 0E3BC4 7F0AF094 AC60FFF8 */ sw $zero, -8($v1) /* 0E3BC8 7F0AF098 1462FFFB */ bne $v1, $v0, .L7F0AF088 /* 0E3BCC 7F0AF09C AC60FFFC */ sw $zero, -4($v1) -/* 0E3BD0 7F0AF0A0 3C0E8008 */ lui $t6, %hi(clippingfile) -/* 0E3BD4 7F0AF0A4 8DCEB120 */ lw $t6, %lo(clippingfile)($t6) +/* 0E3BD0 7F0AF0A0 3C0E8008 */ lui $t6, %hi(stan_prefix) +/* 0E3BD4 7F0AF0A4 8DCEB120 */ lw $t6, %lo(stan_prefix)($t6) /* 0E3BD8 7F0AF0A8 3C0D8004 */ lui $t5, %hi(list_of_tilesizes) /* 0E3BDC 7F0AF0AC 25AD0F4C */ addiu $t5, %lo(list_of_tilesizes) # addiu $t5, $t5, 0xf4c /* 0E3BE0 7F0AF0B0 8DC40004 */ lw $a0, 4($t6) @@ -540,8 +552,8 @@ glabel sub_GAME_7F0AF20C /* 0E3D84 7F0AF254 AFA500CC */ sw $a1, 0xcc($sp) /* 0E3D88 7F0AF258 AFA600D0 */ sw $a2, 0xd0($sp) /* 0E3D8C 7F0AF25C AFA0009C */ sw $zero, 0x9c($sp) -/* 0E3D90 7F0AF260 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E3D94 7F0AF264 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) +/* 0E3D90 7F0AF260 3C018004 */ lui $at, %hi(level_scale) +/* 0E3D94 7F0AF264 C4200F44 */ lwc1 $f0, %lo(level_scale)($at) /* 0E3D98 7F0AF268 C4840000 */ lwc1 $f4, ($a0) /* 0E3D9C 7F0AF26C 0080A025 */ move $s4, $a0 /* 0E3DA0 7F0AF270 3C178004 */ lui $s7, %hi(list_of_tilesizes) @@ -671,7 +683,7 @@ glabel sub_GAME_7F0AF20C /* 0E3F6C 7F0AF43C 02202025 */ move $a0, $s1 /* 0E3F70 7F0AF440 44060000 */ mfc1 $a2, $f0 /* 0E3F74 7F0AF444 44071000 */ mfc1 $a3, $f2 -/* 0E3F78 7F0AF448 0FC2BF9C */ jal sub_GAME_7F0AFE70 +/* 0E3F78 7F0AF448 0FC2BF9C */ jal getShortest2dDispToInfTripleEdge /* 0E3F7C 7F0AF44C 02002825 */ move $a1, $s0 /* 0E3F80 7F0AF450 4614003C */ c.lt.s $f0, $f20 /* 0E3F84 7F0AF454 26100001 */ addiu $s0, $s0, 1 @@ -691,7 +703,7 @@ glabel sub_GAME_7F0AF20C /* 0E3FB8 7F0AF488 86220006 */ lh $v0, 6($s1) /* 0E3FBC 7F0AF48C 1240000E */ beqz $s2, .L7F0AF4C8 /* 0E3FC0 7F0AF490 02202025 */ move $a0, $s1 -/* 0E3FC4 7F0AF494 0FC2BE49 */ jal sub_GAME_7F0AF924 +/* 0E3FC4 7F0AF494 0FC2BE49 */ jal getTileMidPoint /* 0E3FC8 7F0AF498 03C02825 */ move $a1, $fp /* 0E3FCC 7F0AF49C AFB100A0 */ sw $s1, 0xa0($sp) /* 0E3FD0 7F0AF4A0 C6900008 */ lwc1 $f16, 8($s4) @@ -782,33 +794,33 @@ glabel sub_GAME_7F0AF20C #ifdef NONMATCHING void stanLoadFile(void *arg0) { stanLoaded = 1; - clippingfile = arg0; - base_ptr_connection_vals = (s32) (arg0->unk4 + -0x80); + stan_prefix.clippingfile = arg0; + standTileStart = (s32) (arg0->unk4 + -0x80); if (check_token(1, "-stanlinelog") != 0) { stanlinelog_flag = 1; } sub_GAME_7F0AF038(); - sub_GAME_7F0B2950(1.0); + setLevelScale(1.0); } #else GLOBAL_ASM( .text glabel stanLoadFile -/* 0E40E8 7F0AF5B8 3C028008 */ lui $v0, %hi(clippingfile) +/* 0E40E8 7F0AF5B8 3C028008 */ lui $v0, %hi(stan_prefix) /* 0E40EC 7F0AF5BC 240E0001 */ li $t6, 1 /* 0E40F0 7F0AF5C0 3C018004 */ lui $at, %hi(stanLoaded) -/* 0E40F4 7F0AF5C4 2442B120 */ addiu $v0, %lo(clippingfile) # addiu $v0, $v0, -0x4ee0 +/* 0E40F4 7F0AF5C4 2442B120 */ addiu $v0, %lo(stan_prefix) # addiu $v0, $v0, -0x4ee0 /* 0E40F8 7F0AF5C8 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0E40FC 7F0AF5CC AC2E0FB0 */ sw $t6, %lo(stanLoaded)($at) /* 0E4100 7F0AF5D0 AFBF0014 */ sw $ra, 0x14($sp) /* 0E4104 7F0AF5D4 AC440000 */ sw $a0, ($v0) /* 0E4108 7F0AF5D8 8C980004 */ lw $t8, 4($a0) -/* 0E410C 7F0AF5DC 3C018004 */ lui $at, %hi(base_ptr_connection_vals) +/* 0E410C 7F0AF5DC 3C018004 */ lui $at, %hi(standTileStart) /* 0E4110 7F0AF5E0 3C058006 */ lui $a1, %hi(aStanlinelog) /* 0E4114 7F0AF5E4 2719FF80 */ addiu $t9, $t8, -0x80 -/* 0E4118 7F0AF5E8 AC390F58 */ sw $t9, %lo(base_ptr_connection_vals)($at) +/* 0E4118 7F0AF5E8 AC390F58 */ sw $t9, %lo(standTileStart)($at) /* 0E411C 7F0AF5EC 24A585BC */ addiu $a1, %lo(aStanlinelog) # addiu $a1, $a1, -0x7a44 /* 0E4120 7F0AF5F0 0C0029A8 */ jal check_token /* 0E4124 7F0AF5F4 24040001 */ li $a0, 1 @@ -821,7 +833,7 @@ glabel stanLoadFile /* 0E413C 7F0AF60C 00000000 */ nop /* 0E4140 7F0AF610 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0E4144 7F0AF614 44816000 */ mtc1 $at, $f12 -/* 0E4148 7F0AF618 0FC2CA54 */ jal sub_GAME_7F0B2950 +/* 0E4148 7F0AF618 0FC2CA54 */ jal setLevelScale /* 0E414C 7F0AF61C 00000000 */ nop /* 0E4150 7F0AF620 8FBF0014 */ lw $ra, 0x14($sp) /* 0E4154 7F0AF624 27BD0018 */ addiu $sp, $sp, 0x18 @@ -919,7 +931,7 @@ loop_5: if ((temp_v0 >> 4) != 0) { // Node 6 - temp_v1 = ((temp_v0 * 8) + base_ptr_connection_vals); + temp_v1 = ((temp_v0 * 8) + standTileStart); phi_a1_2 = phi_a1_3; phi_s2_3 = phi_s2_2; phi_s1_2 = phi_s1_4; @@ -973,12 +985,12 @@ glabel sub_GAME_7F0AF638 /* 0E4188 7F0AF658 AFB30020 */ sw $s3, 0x20($sp) /* 0E418C 7F0AF65C AFB00014 */ sw $s0, 0x14($sp) /* 0E4190 7F0AF660 AFA5003C */ sw $a1, 0x3c($sp) -/* 0E4194 7F0AF664 3C168004 */ lui $s6, %hi(base_ptr_connection_vals) +/* 0E4194 7F0AF664 3C168004 */ lui $s6, %hi(standTileStart) /* 0E4198 7F0AF668 30B400FF */ andi $s4, $a1, 0xff /* 0E419C 7F0AF66C 0000B825 */ move $s7, $zero /* 0E41A0 7F0AF670 ACC40000 */ sw $a0, ($a2) /* 0E41A4 7F0AF674 24110001 */ li $s1, 1 -/* 0E41A8 7F0AF678 26D60F58 */ addiu $s6, %lo(base_ptr_connection_vals) # addiu $s6, $s6, 0xf58 +/* 0E41A8 7F0AF678 26D60F58 */ addiu $s6, %lo(standTileStart) # addiu $s6, $s6, 0xf58 /* 0E41AC 7F0AF67C 24D20004 */ addiu $s2, $a2, 4 /* 0E41B0 7F0AF680 8E53FFFC */ lw $s3, -4($s2) .L7F0AF684: @@ -1049,33 +1061,49 @@ glabel sub_GAME_7F0AF638 #ifdef NONMATCHING -s32 sub_GAME_7F0AF760(void *arg0) { - u32 sp0; - s32 sp8; - s32 sp10; - s32 sp14; - s32 sp1C; - void *temp_t1; - void *temp_t0; - void *temp_t2; - s32 temp_t5; - s32 temp_t8; - u32 temp_t8_2; - // Node 0 - temp_t1 = (arg0 + ((((s32) arg0->unk6 >> 8) & 0xf) * 8)); - temp_t0 = (arg0 + ((((s32) arg0->unk6 >> 4) & 0xf) * 8)); - sp14 = (s32) (temp_t0->unk8 - temp_t1->unk8); - temp_t2 = (arg0 + ((arg0->unk6 & 0xf) * 8)); - sp1C = (s32) (temp_t0->unkC - temp_t1->unkC); - temp_t5 = (temp_t2->unk8 - temp_t1->unk8); - sp8 = temp_t5; - temp_t8 = (temp_t2->unkC - temp_t1->unkC); - sp10 = temp_t8; - temp_t8_2 = ((sp1C * temp_t5) - (temp_t8 * sp14)); - sp0 = temp_t8_2; - return (temp_t8_2 < 1U); +// A decent start, mostly my code isn't saving the AB.x and AB.z to the stack + +struct int3 { + s32 x; + s32 y; + s32 z; +}; + +s32 sub_GAME_7F0AF760(struct StandTile *tile) { + // Perhaps it's a coincidence but there is a gap between their uses of x and z + // Suggests there could be an unused y, which makes sense when their points are 3D + + u32 iA; + u32 iB; + u32 iC; + + s32 crossProduct; + + struct int3 AB; + struct int3 AC; + + + iA = (tile->hdrTail >> 0x8 & 0xf); // t1 + iB = (tile->hdrTail >> 0x4 & 0xf); // t0 + // Actually saving iC somewhere has prevented it being computed early + iC = (tile->hdrTail & 0xf); // t2 + + AB.x = (tile->points[iB].x - tile->points[iA].x); + AB.y = 0; + AB.z = (tile->points[iB].z - tile->points[iA].z); + + + AC.x = (tile->points[iC].x - tile->points[iA].x); + AC.y = 0; + AC.z = (tile->points[iC].z - tile->points[iA].z); + + crossProduct = ((AB.z * AC.x) - (AB.x * AC.z)); // potential overflow. + + return (crossProduct == 0); } + + #else GLOBAL_ASM( .text @@ -1132,14 +1160,50 @@ glabel sub_GAME_7F0AF760 #ifdef NONMATCHING void sub_GAME_7F0AF808(void) { +// Still quite a long way off. +struct StandTile* sub_GAME_7F0AF808(float f1,float f2,float f3,float f4) +{ + // 'findSomeTile' atm + // It seems a silly thing to be doing during runtime. + + struct StandTile* tile; + struct StandTile* tileStack[2]; + + tile = stan_prefix.ptr_firstroom; + + // this test may be reading a field but it could well look like this, + // since 0 signals that there is no more data, so 'tile' isn't really a struct StandTile* + + while (*(u32*)tile != 0) + { + tileStack[0] = tile; + + if ( + (!sub_GAME_7F0AF760(tile)) && + (isPointInsideTriStandTileUnscaled_Maybe(tile,f1,f3) != 0) && + (FUN_7f0b20d0(tileStack,f1,f3,f4) != 0) && + (tile == tileStack[0]) && + (getCrossProductY_and_distToPlaneMaybe(tile,f1,f3) < f2) + ) + { + return tile; + } + + tile = (struct StandTile*) ( + ((s32)tile) + list_of_tilesizes[STAN_POINT_COUNT(tile)] + ); + + } + + return (struct StandTile*)0x0; } #else GLOBAL_ASM( .text glabel sub_GAME_7F0AF808 /* 0E4338 7F0AF808 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0E433C 7F0AF80C 3C0E8008 */ lui $t6, %hi(clippingfile) -/* 0E4340 7F0AF810 8DCEB120 */ lw $t6, %lo(clippingfile)($t6) +/* 0E433C 7F0AF80C 3C0E8008 */ lui $t6, %hi(stan_prefix) +/* 0E4340 7F0AF810 8DCEB120 */ lw $t6, %lo(stan_prefix)($t6) /* 0E4344 7F0AF814 AFBF0044 */ sw $ra, 0x44($sp) /* 0E4348 7F0AF818 AFB20040 */ sw $s2, 0x40($sp) /* 0E434C 7F0AF81C AFB1003C */ sw $s1, 0x3c($sp) @@ -1166,7 +1230,7 @@ glabel sub_GAME_7F0AF808 /* 0E439C 7F0AF86C 86020006 */ lh $v0, 6($s0) /* 0E43A0 7F0AF870 4405A000 */ mfc1 $a1, $f20 /* 0E43A4 7F0AF874 4406B000 */ mfc1 $a2, $f22 -/* 0E43A8 7F0AF878 0FC2C0DB */ jal sub_GAME_7F0B036C +/* 0E43A8 7F0AF878 0FC2C0DB */ jal isPointInsideTriStandTileUnscaled_Maybe /* 0E43AC 7F0AF87C 02002025 */ move $a0, $s0 /* 0E43B0 7F0AF880 50400015 */ beql $v0, $zero, .L7F0AF8D8 /* 0E43B4 7F0AF884 86020006 */ lh $v0, 6($s0) @@ -1221,24 +1285,36 @@ glabel sub_GAME_7F0AF808 #ifdef NONMATCHING -f32 sub_GAME_7F0AF924(void *arg0, void *arg1) { - void *temp_t2; - void *temp_t1; - void *temp_t0; +// 2 instructions swapped, regalloc. +// I've tried all orderings of the A,B,C assignments, both as indices and as pointers to StandTilePoints +// Summing the x,y,z components first just makes more regalloc issues +// Placing the macros directly in the indexing doesn't help either. +// Making midPnt a float* did nothing. - // Node 0 - temp_t2 = (arg0 + ((((s32) arg0->unk6 >> 4) & 0xf) * 8)); - temp_t1 = (arg0 + ((((s32) arg0->unk6 >> 8) & 0xf) * 8)); - temp_t0 = (arg0 + ((arg0->unk6 & 0xf) * 8)); - *arg1 = (f32) ((((f32) temp_t0->unk8 + ((f32) temp_t1->unk8 + (f32) temp_t2->unk8)) / 3.0f) * D_80040F48); - arg1->unk4 = (f32) ((((f32) temp_t0->unkA + ((f32) temp_t1->unkA + (f32) temp_t2->unkA)) / 3.0f) * D_80040F48); - arg1->unk8 = (f32) ((((f32) temp_t0->unkC + ((f32) temp_t1->unkC + (f32) temp_t2->unkC)) / 3.0f) * D_80040F48); - return 3.0f; +// I'm out of ideas. +void getTileMidPoint(struct StandTile *tile, struct float3 *midPnt) +{ + short headerTail; + // may be RGB + s32 indexA; + s32 indexB; + s32 indexC; + + indexA = STAN_TRIPLE_TO_PNT_INDEX(tile, 0); + indexB = STAN_TRIPLE_TO_PNT_INDEX(tile, 1); + indexC = STAN_TRIPLE_TO_PNT_INDEX(tile, 2); + + midPnt->x = ((float)tile->points[indexA].x + tile->points[indexB].x + tile->points[indexC].x) / 3 * inv_level_scale; + midPnt->y = ((float)tile->points[indexA].y + tile->points[indexB].y + tile->points[indexC].y) / 3 * inv_level_scale; + midPnt->z = ((float)tile->points[indexA].z + tile->points[indexB].z + tile->points[indexC].z) / 3 * inv_level_scale; + + return; } + #else GLOBAL_ASM( .text -glabel sub_GAME_7F0AF924 +glabel getTileMidPoint /* 0E4454 7F0AF924 84870006 */ lh $a3, 6($a0) /* 0E4458 7F0AF928 3C014040 */ li $at, 0x40400000 # 3.000000 /* 0E445C 7F0AF92C 44810000 */ mtc1 $at, $f0 @@ -1259,9 +1335,9 @@ glabel sub_GAME_7F0AF924 /* 0E4498 7F0AF968 008D4021 */ addu $t0, $a0, $t5 /* 0E449C 7F0AF96C 850C0008 */ lh $t4, 8($t0) /* 0E44A0 7F0AF970 468021A0 */ cvt.s.w $f6, $f4 -/* 0E44A4 7F0AF974 3C0B8004 */ lui $t3, %hi(D_80040F48) +/* 0E44A4 7F0AF974 3C0B8004 */ lui $t3, %hi(inv_level_scale) /* 0E44A8 7F0AF978 448C9000 */ mtc1 $t4, $f18 -/* 0E44AC 7F0AF97C 256B0F48 */ addiu $t3, %lo(D_80040F48) # addiu $t3, $t3, 0xf48 +/* 0E44AC 7F0AF97C 256B0F48 */ addiu $t3, %lo(inv_level_scale) # addiu $t3, $t3, 0xf48 /* 0E44B0 7F0AF980 468042A0 */ cvt.s.w $f10, $f8 /* 0E44B4 7F0AF984 46809120 */ cvt.s.w $f4, $f18 /* 0E44B8 7F0AF988 460A3400 */ add.s $f16, $f6, $f10 @@ -1309,22 +1385,27 @@ glabel sub_GAME_7F0AF924 #ifdef NONMATCHING -f32 sub_GAME_7F0AFA1C(void *arg0, s32 arg1, void *arg2) { - f32 sp1C; - s32 temp_a3; - void *temp_v0; +// Saves a1 (tripleIndex) to the stack completely unnecessarily +// Otherwise just regalloc, but maybe that alone fixes it. +void getPointJustInsideOfTileTriple(struct StandTile* tile, s32 tripleIndex, struct float3* pnt) +{ + struct float3 midPoint; + s32 pntIndex; - // Node 0 - temp_a3 = ((s32) arg0->unk6 >> (8 - (arg1 * 4))); - temp_v0 = (arg0 + ((temp_a3 & 0xf) * 8)); - *arg2 = (f32) ((f32) temp_v0->unk8 * D_80040F48); - arg2->unk4 = (f32) ((f32) temp_v0->unkA * D_80040F48); - arg2->unk8 = (f32) ((f32) temp_v0->unkC * D_80040F48); - sub_GAME_7F0AF924(&sp1C, temp_a3); - *arg2 = (f32) ((sp1C * D_800585D8) + (D_800585DC * *arg2)); - arg2->unk4 = (f32) ((sp20 * D_800585D8) + (D_800585DC * arg2->unk4)); - arg2->unk8 = (f32) ((sp24 * D_800585D8) + (D_800585DC * arg2->unk8)); - return D_800585D8; + pntIndex = STAN_TRIPLE_TO_PNT_INDEX(tile, tripleIndex); + + pnt->x = tile->points[pntIndex].x * inv_level_scale; + pnt->y = tile->points[pntIndex].y * inv_level_scale; + pnt->z = tile->points[pntIndex].z * inv_level_scale; + + getTileMidPoint(tile,&midPoint); + + // 10% of the way from the actual tile point towards the tile's centre. + pnt->x = midPoint.x * 0.1f + pnt->x * 0.9f; + pnt->y = midPoint.y * 0.1f + pnt->y * 0.9f; + pnt->z = midPoint.z * 0.1f + pnt->z * 0.9f; + + return; } #else GLOBAL_ASM( @@ -1334,7 +1415,7 @@ glabel D_800585D8 glabel D_800585DC .word 0x3f666666 /*0.89999998*/ .text -glabel sub_GAME_7F0AFA1C +glabel getPointJustInsideOfTileTriple /* 0E454C 7F0AFA1C 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 0E4550 7F0AFA20 AFBF0014 */ sw $ra, 0x14($sp) /* 0E4554 7F0AFA24 848E0006 */ lh $t6, 6($a0) @@ -1346,8 +1427,8 @@ glabel sub_GAME_7F0AFA1C /* 0E456C 7F0AFA3C 000848C0 */ sll $t1, $t0, 3 /* 0E4570 7F0AFA40 00891021 */ addu $v0, $a0, $t1 /* 0E4574 7F0AFA44 844A0008 */ lh $t2, 8($v0) -/* 0E4578 7F0AFA48 3C038004 */ lui $v1, %hi(D_80040F48) -/* 0E457C 7F0AFA4C 24630F48 */ addiu $v1, %lo(D_80040F48) # addiu $v1, $v1, 0xf48 +/* 0E4578 7F0AFA48 3C038004 */ lui $v1, %hi(inv_level_scale) +/* 0E457C 7F0AFA4C 24630F48 */ addiu $v1, %lo(inv_level_scale) # addiu $v1, $v1, 0xf48 /* 0E4580 7F0AFA50 448A2000 */ mtc1 $t2, $f4 /* 0E4584 7F0AFA54 C4680000 */ lwc1 $f8, ($v1) /* 0E4588 7F0AFA58 27A5001C */ addiu $a1, $sp, 0x1c @@ -1368,7 +1449,7 @@ glabel sub_GAME_7F0AFA1C /* 0E45C4 7F0AFA94 468042A0 */ cvt.s.w $f10, $f8 /* 0E45C8 7F0AFA98 46105482 */ mul.s $f18, $f10, $f16 /* 0E45CC 7F0AFA9C E4D20008 */ swc1 $f18, 8($a2) -/* 0E45D0 7F0AFAA0 0FC2BE49 */ jal sub_GAME_7F0AF924 +/* 0E45D0 7F0AFAA0 0FC2BE49 */ jal getTileMidPoint /* 0E45D4 7F0AFAA4 AFA60030 */ sw $a2, 0x30($sp) /* 0E45D8 7F0AFAA8 3C018006 */ lui $at, %hi(D_800585D8) /* 0E45DC 7F0AFAAC C42085D8 */ lwc1 $f0, %lo(D_800585D8)($at) @@ -1407,20 +1488,14 @@ glabel sub_GAME_7F0AFA1C #ifdef NONMATCHING -f32 sub_GAME_7F0AFB1C(void *arg0, void *arg1) { - f32 sp4; - f32 sp8; - f32 spC; - f32 temp_f18; - f32 temp_f8; - - // Node 0 - sp4 = (f32) (*arg1 - *arg0); - temp_f18 = (arg1->unk4 - arg0->unk4); - sp8 = temp_f18; - temp_f8 = (arg1->unk8 - arg0->unk8); - spC = temp_f8; - return ((temp_f8 * temp_f8) + ((sp4 * sp4) + (temp_f18 * temp_f18))); +// Missing addiu sp, sp, -0x10 : I can't get it to use the stack at all. +float sub_GAME_7F0AFB1C(struct float3 *p,struct float3 *q) +{ + float xDiff = q->x - p->x; + float yDiff = q->y - p->y; + float zDiff = q->z - p->z; + + return xDiff*xDiff + yDiff*yDiff + zDiff*zDiff; } #else GLOBAL_ASM( @@ -1479,8 +1554,8 @@ glabel sub_GAME_7F0AFB78 /* 0E46D8 7F0AFBA8 F7B40018 */ sdc1 $f20, 0x18($sp) /* 0E46DC 7F0AFBAC AFA00078 */ sw $zero, 0x78($sp) /* 0E46E0 7F0AFBB0 C4840000 */ lwc1 $f4, ($a0) -/* 0E46E4 7F0AFBB4 3C0E8008 */ lui $t6, %hi(clippingfile) -/* 0E46E8 7F0AFBB8 8DCEB120 */ lw $t6, %lo(clippingfile)($t6) +/* 0E46E4 7F0AFBB4 3C0E8008 */ lui $t6, %hi(stan_prefix) +/* 0E46E8 7F0AFBB8 8DCEB120 */ lw $t6, %lo(stan_prefix)($t6) /* 0E46EC 7F0AFBBC E7A40064 */ swc1 $f4, 0x64($sp) /* 0E46F0 7F0AFBC0 C4A60000 */ lwc1 $f6, ($a1) /* 0E46F4 7F0AFBC4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 @@ -1514,13 +1589,13 @@ glabel sub_GAME_7F0AFB78 /* 0E475C 7F0AFC2C 16160006 */ bne $s0, $s6, .L7F0AFC48 /* 0E4760 7F0AFC30 02202025 */ move $a0, $s1 /* 0E4764 7F0AFC34 02202025 */ move $a0, $s1 -/* 0E4768 7F0AFC38 0FC2BE49 */ jal sub_GAME_7F0AF924 +/* 0E4768 7F0AFC38 0FC2BE49 */ jal getTileMidPoint /* 0E476C 7F0AFC3C 02402825 */ move $a1, $s2 /* 0E4770 7F0AFC40 10000005 */ b .L7F0AFC58 /* 0E4774 7F0AFC44 4407B000 */ mfc1 $a3, $f22 .L7F0AFC48: /* 0E4778 7F0AFC48 02002825 */ move $a1, $s0 -/* 0E477C 7F0AFC4C 0FC2BE87 */ jal sub_GAME_7F0AFA1C +/* 0E477C 7F0AFC4C 0FC2BE87 */ jal getPointJustInsideOfTileTriple /* 0E4780 7F0AFC50 02403025 */ move $a2, $s2 /* 0E4784 7F0AFC54 4407B000 */ mfc1 $a3, $f22 .L7F0AFC58: @@ -1584,189 +1659,127 @@ glabel sub_GAME_7F0AFB78 +// Returns the shortest distance from (p_x,p_z) to the infinite extention of tile's index-th edge, projected into XZ. +// Where the edge is vertical (or degenerate) they just return the distance between the points. +float getShortest2dDispToInfTileEdge(struct StandTile *tile,s32 index,float p_x,float p_z) +{ + s32 nextIndex; + float edge_x; + float edge_z; + float edge_len; -#ifdef NONMATCHING -f32 sub_GAME_7F0AFD1C(void *arg0, s32 arg1, f32 arg2, f32 arg3) { - void *sp18; - void *sp1C; - f32 sp40; - s32 temp_hi; - void *temp_v0; - void *temp_v1; - f32 temp_f2; - f32 temp_f14; - ? temp_ret; - f32 temp_f0; - f32 temp_f2_2; + float v_x; + float v_z; + float crossProduct; - // Node 0 - temp_hi = ((s32) (arg1 + 1) % (s32) (((s32) arg0->unk6 >> 0xc) & 0xf)); - temp_v0 = (arg0 + (temp_hi * 8)); - temp_v1 = (arg0 + (arg1 * 8)); - temp_f2 = (f32) (temp_v0->unk8 - temp_v1->unk8); - temp_f14 = (f32) (temp_v0->unkC - temp_v1->unkC); - sp40 = temp_f2; - sp18 = temp_v1; - sp1C = temp_v0; - temp_ret = sqrtf(((temp_f2 * temp_f2) + (temp_f14 * temp_f14)), temp_f14, temp_hi); - if (temp_ret != 0.0f) - { - // Node 2 - // Node 3 - return ((((arg3 - (f32) temp_v1->unkC) * -temp_f2) + (sp3C * (arg2 - (f32) temp_v1->unk8))) / temp_ret); - } - // Node 1 - temp_f0 = (arg2 - (f32) temp_v0->unk8); - temp_f2_2 = (arg3 - (f32) temp_v0->unkC); - return ((((arg3 - (f32) temp_v1->unkC) * -temp_f2) + (sp3C * (arg2 - (f32) temp_v1->unk8))) / temp_ret); -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0AFD1C -/* 0E484C 7F0AFD1C 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0E4850 7F0AFD20 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E4854 7F0AFD24 AFA60050 */ sw $a2, 0x50($sp) -/* 0E4858 7F0AFD28 AFA70054 */ sw $a3, 0x54($sp) -/* 0E485C 7F0AFD2C 848F0006 */ lh $t7, 6($a0) -/* 0E4860 7F0AFD30 24AE0001 */ addiu $t6, $a1, 1 -/* 0E4864 7F0AFD34 000548C0 */ sll $t1, $a1, 3 -/* 0E4868 7F0AFD38 000FC303 */ sra $t8, $t7, 0xc -/* 0E486C 7F0AFD3C 3319000F */ andi $t9, $t8, 0xf -/* 0E4870 7F0AFD40 01D9001A */ div $zero, $t6, $t9 -/* 0E4874 7F0AFD44 00003010 */ mfhi $a2 -/* 0E4878 7F0AFD48 000640C0 */ sll $t0, $a2, 3 -/* 0E487C 7F0AFD4C 00881021 */ addu $v0, $a0, $t0 -/* 0E4880 7F0AFD50 00891821 */ addu $v1, $a0, $t1 -/* 0E4884 7F0AFD54 846B0008 */ lh $t3, 8($v1) -/* 0E4888 7F0AFD58 844A0008 */ lh $t2, 8($v0) -/* 0E488C 7F0AFD5C 846F000C */ lh $t7, 0xc($v1) -/* 0E4890 7F0AFD60 844D000C */ lh $t5, 0xc($v0) -/* 0E4894 7F0AFD64 014B6023 */ subu $t4, $t2, $t3 -/* 0E4898 7F0AFD68 448C2000 */ mtc1 $t4, $f4 -/* 0E489C 7F0AFD6C 01AFC023 */ subu $t8, $t5, $t7 -/* 0E48A0 7F0AFD70 44983000 */ mtc1 $t8, $f6 -/* 0E48A4 7F0AFD74 468020A0 */ cvt.s.w $f2, $f4 -/* 0E48A8 7F0AFD78 17200002 */ bnez $t9, .L7F0AFD84 -/* 0E48AC 7F0AFD7C 00000000 */ nop -/* 0E48B0 7F0AFD80 0007000D */ break 7 -.L7F0AFD84: -/* 0E48B4 7F0AFD84 2401FFFF */ li $at, -1 -/* 0E48B8 7F0AFD88 17210004 */ bne $t9, $at, .L7F0AFD9C -/* 0E48BC 7F0AFD8C 3C018000 */ lui $at, 0x8000 -/* 0E48C0 7F0AFD90 15C10002 */ bne $t6, $at, .L7F0AFD9C -/* 0E48C4 7F0AFD94 00000000 */ nop -/* 0E48C8 7F0AFD98 0006000D */ break 6 -.L7F0AFD9C: -/* 0E48CC 7F0AFD9C 468033A0 */ cvt.s.w $f14, $f6 -/* 0E48D0 7F0AFDA0 46021202 */ mul.s $f8, $f2, $f2 -/* 0E48D4 7F0AFDA4 E7A20040 */ swc1 $f2, 0x40($sp) -/* 0E48D8 7F0AFDA8 AFA30018 */ sw $v1, 0x18($sp) -/* 0E48DC 7F0AFDAC AFA2001C */ sw $v0, 0x1c($sp) -/* 0E48E0 7F0AFDB0 460E7282 */ mul.s $f10, $f14, $f14 -/* 0E48E4 7F0AFDB4 E7AE003C */ swc1 $f14, 0x3c($sp) -/* 0E48E8 7F0AFDB8 0C007DF8 */ jal sqrtf -/* 0E48EC 7F0AFDBC 460A4300 */ add.s $f12, $f8, $f10 -/* 0E48F0 7F0AFDC0 44802000 */ mtc1 $zero, $f4 -/* 0E48F4 7F0AFDC4 8FA2001C */ lw $v0, 0x1c($sp) -/* 0E48F8 7F0AFDC8 8FA30018 */ lw $v1, 0x18($sp) -/* 0E48FC 7F0AFDCC 46040032 */ c.eq.s $f0, $f4 -/* 0E4900 7F0AFDD0 C7A20040 */ lwc1 $f2, 0x40($sp) -/* 0E4904 7F0AFDD4 C7AE003C */ lwc1 $f14, 0x3c($sp) -/* 0E4908 7F0AFDD8 C7B20050 */ lwc1 $f18, 0x50($sp) -/* 0E490C 7F0AFDDC 45000011 */ bc1f .L7F0AFE24 -/* 0E4910 7F0AFDE0 46000406 */ mov.s $f16, $f0 -/* 0E4914 7F0AFDE4 844E0008 */ lh $t6, 8($v0) -/* 0E4918 7F0AFDE8 8459000C */ lh $t9, 0xc($v0) -/* 0E491C 7F0AFDEC C7AA0054 */ lwc1 $f10, 0x54($sp) -/* 0E4920 7F0AFDF0 448E3000 */ mtc1 $t6, $f6 -/* 0E4924 7F0AFDF4 44992000 */ mtc1 $t9, $f4 -/* 0E4928 7F0AFDF8 46803220 */ cvt.s.w $f8, $f6 -/* 0E492C 7F0AFDFC 468021A0 */ cvt.s.w $f6, $f4 -/* 0E4930 7F0AFE00 46089001 */ sub.s $f0, $f18, $f8 -/* 0E4934 7F0AFE04 46065081 */ sub.s $f2, $f10, $f6 -/* 0E4938 7F0AFE08 46000202 */ mul.s $f8, $f0, $f0 -/* 0E493C 7F0AFE0C 00000000 */ nop -/* 0E4940 7F0AFE10 46021102 */ mul.s $f4, $f2, $f2 -/* 0E4944 7F0AFE14 0C007DF8 */ jal sqrtf -/* 0E4948 7F0AFE18 46044300 */ add.s $f12, $f8, $f4 -/* 0E494C 7F0AFE1C 10000011 */ b .L7F0AFE64 -/* 0E4950 7F0AFE20 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0AFE24: -/* 0E4954 7F0AFE24 8468000C */ lh $t0, 0xc($v1) -/* 0E4958 7F0AFE28 C7AA0054 */ lwc1 $f10, 0x54($sp) -/* 0E495C 7F0AFE2C 84690008 */ lh $t1, 8($v1) -/* 0E4960 7F0AFE30 44883000 */ mtc1 $t0, $f6 -/* 0E4964 7F0AFE34 00000000 */ nop -/* 0E4968 7F0AFE38 46803220 */ cvt.s.w $f8, $f6 -/* 0E496C 7F0AFE3C 46001187 */ neg.s $f6, $f2 -/* 0E4970 7F0AFE40 46085101 */ sub.s $f4, $f10, $f8 -/* 0E4974 7F0AFE44 44894000 */ mtc1 $t1, $f8 -/* 0E4978 7F0AFE48 46062282 */ mul.s $f10, $f4, $f6 -/* 0E497C 7F0AFE4C 46804120 */ cvt.s.w $f4, $f8 -/* 0E4980 7F0AFE50 46049181 */ sub.s $f6, $f18, $f4 -/* 0E4984 7F0AFE54 46067202 */ mul.s $f8, $f14, $f6 -/* 0E4988 7F0AFE58 46085300 */ add.s $f12, $f10, $f8 -/* 0E498C 7F0AFE5C 46106003 */ div.s $f0, $f12, $f16 -/* 0E4990 7F0AFE60 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0AFE64: -/* 0E4994 7F0AFE64 27BD0048 */ addiu $sp, $sp, 0x48 -/* 0E4998 7F0AFE68 03E00008 */ jr $ra -/* 0E499C 7F0AFE6C 00000000 */ nop -) -#endif + // 3 unused. We use 2 for the points to make our code cleaner, + // though it seems much more likely that the variables were used in the else clause. + struct StandTilePoint* currPnt; + struct StandTilePoint* nextPnt; + float UNUSED; + // Omiting the '& 0xF' is equivalent, but keeping it is necessary to match. + // Perhaps the structure isn't correct but this seems much cleaner than doing an explicit >> 0xC. + nextIndex = (index + 1) % STAN_POINT_COUNT(tile); + nextPnt = &tile->points[nextIndex]; + currPnt = &tile->points[index]; + edge_x = (float)(nextPnt->x - currPnt->x); + edge_z = (float)(nextPnt->z - currPnt->z); + edge_len = sqrtf(edge_x * edge_x + edge_z * edge_z); - -#ifdef NONMATCHING -f32 sub_GAME_7F0AFE70(void *arg0, s32 arg1, f32 arg2, f32 arg3) { - f32 sp40; - s32 temp_a1; - void *temp_a2; - void *temp_a0; - f32 temp_f2; - f32 temp_f14; - ? temp_ret; - f32 temp_f0; - f32 temp_f2_2; - s32 phi_v1; - - // Node 0 - if (arg1 != 2) - { - // Node 1 - phi_v1 = (arg1 + 1); + if (edge_len == 0) { + // Degenerate case, edge is vertical + // They just return the distance between the points, which is sensible and the correct value in 3 dimensions. + v_x = p_x - (float)tile->points[nextIndex].x; + v_z = p_z - (float)tile->points[nextIndex].z; + return sqrtf(v_x * v_x + v_z * v_z); } else { - // Node 2 - phi_v1 = 0; + // | (AP x AB) / ||AB|| | = ||PA|| sin(a), + // so we're returning the SIGNED displacement + crossProduct = ( + edge_z * (p_x - (float)tile->points[index].x) + + + -edge_x * (p_z - (float)tile->points[index].z) + ); + return crossProduct / edge_len; } - // Node 3 - temp_a1 = ((s32) arg0->unk6 >> (8 - (arg1 * 4))); - temp_a2 = (arg0 + ((temp_a1 & 0xf) * 8)); - temp_a0 = (arg0 + ((((s32) arg0->unk6 >> (8 - (phi_v1 * 4))) & 0xf) * 8)); - temp_f2 = (f32) (temp_a0->unk8 - temp_a2->unk8); - temp_f14 = (f32) (temp_a0->unkC - temp_a2->unkC); - sp40 = 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) - { - // Node 5 - // Node 6 - return ((((arg3 - (f32) sp18->unkC) * -temp_f2) + (sp3C * (arg2 - (f32) sp18->unk8))) / temp_ret); - } - // Node 4 - temp_f0 = (arg2 - (f32) sp1C->unk8); - temp_f2_2 = (arg3 - (f32) sp1C->unkC); - return ((((arg3 - (f32) sp18->unkC) * -temp_f2) + (sp3C * (arg2 - (f32) sp18->unk8))) / temp_ret); + } + + +// Sig needed for caller matches. +float getShortest2dDispToInfTripleEdge(struct StandTile *tile,s32 start3index,float p_x,float p_z); + +#ifdef NONMATCHING +// Only regalloc incorrect essentially. Any change I make seems to make things much worse though, +// and my ability to reorder statements is very limited. + +// Similar to getShortest2dDispToInfTileEdge +// 2nd arg must be in {0,1,2} +// New name needed though: getShortest2dDispToInfTripleEdge +float getShortest2dDispToInfTripleEdge(struct StandTile *tile,s32 start3index,float p_x,float p_z) +{ + s32 end3index; // types seem correct, changing introduces more instructions + + float edge_x; // 0x40 (8) + float edge_z; // 0x3C + float edge_len; + + s32 currPntI; + s32 nextPntI; + + float v_x; + float v_z; + float crossProduct; + + + // end3index = (start3index + 1) % 3, start3index in [0,3) + if (start3index != 2) { + end3index = start3index + 1; + } + else { + end3index = 0; + } + + // making and reusing macros of these introduces extra instructions later + currPntI = STAN_TRIPLE_TO_PNT_INDEX(tile, start3index); + nextPntI = STAN_TRIPLE_TO_PNT_INDEX(tile, end3index); + + edge_x = (float)(tile->points[nextPntI].x - tile->points[currPntI].x); + edge_z = (float)(tile->points[nextPntI].z - tile->points[currPntI].z); + + + // Identical to getShortest2dDispToInfTileEdge from here + + edge_len = sqrtf(edge_x * edge_x + edge_z * edge_z); + + if (edge_len == 0) { + // Degenerate case, edge is vertical + // They just return the distance between the points, which is sensible and the correct value in 3 dimensions. + v_x = p_x - (float)tile->points[nextPntI].x; + v_z = p_z - (float)tile->points[nextPntI].z; + return sqrtf(v_x * v_x + v_z * v_z); + } + else + { + // - (AP x AB) / ||AB|| = ||PA|| sin(a) + crossProduct = ( + edge_z * (p_x - (float)tile->points[currPntI].x) + + + -edge_x * (p_z - (float)tile->points[currPntI].z) + ); + return crossProduct / edge_len; + } +} + #else GLOBAL_ASM( .text -glabel sub_GAME_7F0AFE70 +glabel getShortest2dDispToInfTripleEdge /* 0E49A0 7F0AFE70 27BDFFB8 */ addiu $sp, $sp, -0x48 /* 0E49A4 7F0AFE74 AFA70054 */ sw $a3, 0x54($sp) /* 0E49A8 7F0AFE78 24010002 */ li $at, 2 @@ -1865,127 +1878,54 @@ glabel sub_GAME_7F0AFE70 -#ifdef NONMATCHING -f32 sub_GAME_7F0AFFCC(f32 arg2, f32 arg3) { - // Node 0 - return (sub_GAME_7F0AFD1C(arg2, arg3, (arg2 * D_80040F44), (arg3 * D_80040F44)) * D_80040F48); +float getShortest2dDispToInfTileEdgeUnscaled(struct StandTile *tile, int index,float x,float z) +{ + float disp; + + disp = getShortest2dDispToInfTileEdge(tile, index, x * level_scale, z * level_scale); + return disp * inv_level_scale; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0AFFCC -/* 0E4AFC 7F0AFFCC 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E4B00 7F0AFFD0 44866000 */ mtc1 $a2, $f12 -/* 0E4B04 7F0AFFD4 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) -/* 0E4B08 7F0AFFD8 44877000 */ mtc1 $a3, $f14 -/* 0E4B0C 7F0AFFDC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E4B10 7F0AFFE0 46006102 */ mul.s $f4, $f12, $f0 -/* 0E4B14 7F0AFFE4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E4B18 7F0AFFE8 46007182 */ mul.s $f6, $f14, $f0 -/* 0E4B1C 7F0AFFEC 44062000 */ mfc1 $a2, $f4 -/* 0E4B20 7F0AFFF0 44073000 */ mfc1 $a3, $f6 -/* 0E4B24 7F0AFFF4 0FC2BF47 */ jal sub_GAME_7F0AFD1C -/* 0E4B28 7F0AFFF8 00000000 */ nop -/* 0E4B2C 7F0AFFFC 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E4B30 7F0B0000 C4280F48 */ lwc1 $f8, %lo(D_80040F48)($at) -/* 0E4B34 7F0B0004 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E4B38 7F0B0008 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E4B3C 7F0B000C 46080002 */ mul.s $f0, $f0, $f8 -/* 0E4B40 7F0B0010 03E00008 */ jr $ra -/* 0E4B44 7F0B0014 00000000 */ nop -) -#endif -#ifdef NONMATCHING -f32 sub_GAME_7F0B0018(f32 arg2, f32 arg3) { - // Node 0 - return (sub_GAME_7F0AFE70(arg2, arg3, (arg2 * D_80040F44), (arg3 * D_80040F44)) * D_80040F48); + +float getShortest2dDispToInfTripleEdgeUnscaled(struct StandTile *tile,s32 start3index,float p_x,float p_z) +{ + float disp; + + disp = getShortest2dDispToInfTripleEdge(tile, start3index, p_x * level_scale, p_z * level_scale); + return disp * inv_level_scale; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0018 -/* 0E4B48 7F0B0018 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E4B4C 7F0B001C 44866000 */ mtc1 $a2, $f12 -/* 0E4B50 7F0B0020 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) -/* 0E4B54 7F0B0024 44877000 */ mtc1 $a3, $f14 -/* 0E4B58 7F0B0028 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E4B5C 7F0B002C 46006102 */ mul.s $f4, $f12, $f0 -/* 0E4B60 7F0B0030 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E4B64 7F0B0034 46007182 */ mul.s $f6, $f14, $f0 -/* 0E4B68 7F0B0038 44062000 */ mfc1 $a2, $f4 -/* 0E4B6C 7F0B003C 44073000 */ mfc1 $a3, $f6 -/* 0E4B70 7F0B0040 0FC2BF9C */ jal sub_GAME_7F0AFE70 -/* 0E4B74 7F0B0044 00000000 */ nop -/* 0E4B78 7F0B0048 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E4B7C 7F0B004C C4280F48 */ lwc1 $f8, %lo(D_80040F48)($at) -/* 0E4B80 7F0B0050 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E4B84 7F0B0054 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E4B88 7F0B0058 46080002 */ mul.s $f0, $f0, $f8 -/* 0E4B8C 7F0B005C 03E00008 */ jr $ra -/* 0E4B90 7F0B0060 00000000 */ nop -) -#endif - -#ifdef NONMATCHING -void sub_GAME_7F0B0064(s32 arg0, s32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - f32 temp_f18; - f32 temp_f14; - - // Node 0 - temp_v0 = (arg0 + (arg1 * 8)); - temp_f18 = (arg3 - (f32) temp_v0->unkC); - temp_f14 = (arg2 - (f32) temp_v0->unk8); - arg3 = temp_f18; - return sqrtf(((temp_f14 * temp_f14) + (temp_f18 * temp_f18)), temp_f14); +float distToTilePnt2D(struct StandTile *tile,int pntI,float p_x,float p_z) +{ + float len; + + p_x -= (float)tile->points[pntI].x; + p_z -= (float)tile->points[pntI].z; + return sqrtf(p_x * p_x + p_z * p_z); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0064 -/* 0E4B94 7F0B0064 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E4B98 7F0B0068 000570C0 */ sll $t6, $a1, 3 -/* 0E4B9C 7F0B006C AFBF0014 */ sw $ra, 0x14($sp) -/* 0E4BA0 7F0B0070 AFA70024 */ sw $a3, 0x24($sp) -/* 0E4BA4 7F0B0074 008E1021 */ addu $v0, $a0, $t6 -/* 0E4BA8 7F0B0078 8458000C */ lh $t8, 0xc($v0) -/* 0E4BAC 7F0B007C 844F0008 */ lh $t7, 8($v0) -/* 0E4BB0 7F0B0080 C7A80024 */ lwc1 $f8, 0x24($sp) -/* 0E4BB4 7F0B0084 44985000 */ mtc1 $t8, $f10 -/* 0E4BB8 7F0B0088 448F2000 */ mtc1 $t7, $f4 -/* 0E4BBC 7F0B008C 44867000 */ mtc1 $a2, $f14 -/* 0E4BC0 7F0B0090 46805420 */ cvt.s.w $f16, $f10 -/* 0E4BC4 7F0B0094 468021A0 */ cvt.s.w $f6, $f4 -/* 0E4BC8 7F0B0098 46104481 */ sub.s $f18, $f8, $f16 -/* 0E4BCC 7F0B009C 46067381 */ sub.s $f14, $f14, $f6 -/* 0E4BD0 7F0B00A0 46129102 */ mul.s $f4, $f18, $f18 -/* 0E4BD4 7F0B00A4 E7B20024 */ swc1 $f18, 0x24($sp) -/* 0E4BD8 7F0B00A8 460E7182 */ mul.s $f6, $f14, $f14 -/* 0E4BDC 7F0B00AC 0C007DF8 */ jal sqrtf -/* 0E4BE0 7F0B00B0 46043300 */ add.s $f12, $f6, $f4 -/* 0E4BE4 7F0B00B4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E4BE8 7F0B00B8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E4BEC 7F0B00BC 03E00008 */ jr $ra -/* 0E4BF0 7F0B00C0 00000000 */ nop -) -#endif - #ifdef NONMATCHING -void sub_GAME_7F0B00C4(void) { - +float sub_GAME_7F0B00C4(struct StandTile* tile,s32 index,float p_x,float p_z) +{ + float v_x; + float v_z; + float dist; + + v_x = p_x * level_scale - (float)tile->points[index].x; + v_z = p_z * level_scale - (float)tile->points[index].z; + dist = sqrtf(v_x * v_x + v_z * v_z); + + return dist * inv_level_scale; } #else GLOBAL_ASM( @@ -1997,9 +1937,9 @@ glabel sub_GAME_7F0B00C4 /* 0E4C00 7F0B00D0 F7B40010 */ sdc1 $f20, 0x10($sp) /* 0E4C04 7F0B00D4 008E1021 */ addu $v0, $a0, $t6 /* 0E4C08 7F0B00D8 844F0008 */ lh $t7, 8($v0) -/* 0E4C0C 7F0B00DC 3C018004 */ lui $at, %hi(D_80040F44) +/* 0E4C0C 7F0B00DC 3C018004 */ lui $at, %hi(level_scale) /* 0E4C10 7F0B00E0 44867000 */ mtc1 $a2, $f14 -/* 0E4C14 7F0B00E4 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) +/* 0E4C14 7F0B00E4 C4200F44 */ lwc1 $f0, %lo(level_scale)($at) /* 0E4C18 7F0B00E8 8458000C */ lh $t8, 0xc($v0) /* 0E4C1C 7F0B00EC 448F2000 */ mtc1 $t7, $f4 /* 0E4C20 7F0B00F0 46007382 */ mul.s $f14, $f14, $f0 @@ -2015,8 +1955,8 @@ glabel sub_GAME_7F0B00C4 /* 0E4C48 7F0B0118 4614A482 */ mul.s $f18, $f20, $f20 /* 0E4C4C 7F0B011C 0C007DF8 */ jal sqrtf /* 0E4C50 7F0B0120 46128300 */ add.s $f12, $f16, $f18 -/* 0E4C54 7F0B0124 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E4C58 7F0B0128 C4240F48 */ lwc1 $f4, %lo(D_80040F48)($at) +/* 0E4C54 7F0B0124 3C018004 */ lui $at, %hi(inv_level_scale) +/* 0E4C58 7F0B0128 C4240F48 */ lwc1 $f4, %lo(inv_level_scale)($at) /* 0E4C5C 7F0B012C 8FBF001C */ lw $ra, 0x1c($sp) /* 0E4C60 7F0B0130 D7B40010 */ ldc1 $f20, 0x10($sp) /* 0E4C64 7F0B0134 46040002 */ mul.s $f0, $f0, $f4 @@ -2030,21 +1970,26 @@ glabel sub_GAME_7F0B00C4 #ifdef NONMATCHING -f32 sub_GAME_7F0B0140(s32 arg0, s32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - // Node 0 - temp_v0 = (arg0 + (arg1 * 8)); - return ((((f32) temp_v0->unkC * (arg3 * D_80040F44)) + ((arg2 * D_80040F44) * (f32) temp_v0->unk8)) * D_80040F48); +// dot product +f32 sub_GAME_7F0B0140(struct StandTile* tile, s32 index, float p_x, float p_z) +{ + float d_x; + float d_z; + + d_x = (p_x * level_scale) * tile->points[index].x; + d_z = (p_z * level_scale) * tile->points[index].z; // was originally commuted + + return (d_x + d_z) * inv_level_scale); } #else GLOBAL_ASM( .text glabel sub_GAME_7F0B0140 -/* 0E4C70 7F0B0140 3C018004 */ lui $at, %hi(D_80040F44) +/* 0E4C70 7F0B0140 3C018004 */ lui $at, %hi(level_scale) /* 0E4C74 7F0B0144 000570C0 */ sll $t6, $a1, 3 /* 0E4C78 7F0B0148 44866000 */ mtc1 $a2, $f12 -/* 0E4C7C 7F0B014C C4220F44 */ lwc1 $f2, %lo(D_80040F44)($at) +/* 0E4C7C 7F0B014C C4220F44 */ lwc1 $f2, %lo(level_scale)($at) /* 0E4C80 7F0B0150 008E1021 */ addu $v0, $a0, $t6 /* 0E4C84 7F0B0154 844F000C */ lh $t7, 0xc($v0) /* 0E4C88 7F0B0158 46026302 */ mul.s $f12, $f12, $f2 @@ -2053,11 +1998,11 @@ glabel sub_GAME_7F0B0140 /* 0E4C94 7F0B0164 448F2000 */ mtc1 $t7, $f4 /* 0E4C98 7F0B0168 46027382 */ mul.s $f14, $f14, $f2 /* 0E4C9C 7F0B016C 44985000 */ mtc1 $t8, $f10 -/* 0E4CA0 7F0B0170 3C018004 */ lui $at, %hi(D_80040F48) +/* 0E4CA0 7F0B0170 3C018004 */ lui $at, %hi(inv_level_scale) /* 0E4CA4 7F0B0174 468021A0 */ cvt.s.w $f6, $f4 /* 0E4CA8 7F0B0178 46805420 */ cvt.s.w $f16, $f10 /* 0E4CAC 7F0B017C 460E3202 */ mul.s $f8, $f6, $f14 -/* 0E4CB0 7F0B0180 C4260F48 */ lwc1 $f6, %lo(D_80040F48)($at) +/* 0E4CB0 7F0B0180 C4260F48 */ lwc1 $f6, %lo(inv_level_scale)($at) /* 0E4CB4 7F0B0184 46106482 */ mul.s $f18, $f12, $f16 /* 0E4CB8 7F0B0188 46124100 */ add.s $f4, $f8, $f18 /* 0E4CBC 7F0B018C 46062002 */ mul.s $f0, $f4, $f6 @@ -2071,6 +2016,7 @@ glabel sub_GAME_7F0B0140 #ifdef NONMATCHING +// Similar to others f32 sub_GAME_7F0B0198(void *arg0, s32 arg1, f32 arg2, f32 arg3) { void *temp_v0; void *temp_v0_2; @@ -2252,117 +2198,48 @@ glabel sub_GAME_7F0B0198 -#ifdef NONMATCHING -void sub_GAME_7F0B02D8(void) { +// Determines if inside (presumably - it effectively does an && of the checks on signs of cross products) +// based on the 3 edges. So probably only for triangular tiles. +s32 isPointInsideTriStandTile_Maybe(struct StandTile *tile, float p_x, float p_z) +{ + float disp; + s32 i; + for (i = 0; i != 3; i++) + { + disp = getShortest2dDispToInfTripleEdge(tile,i,p_x,p_z); + if (disp < 0) { + return 0; + } + } + + return 1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B02D8 -/* 0E4E08 7F0B02D8 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0E4E0C 7F0B02DC F7B80028 */ sdc1 $f24, 0x28($sp) -/* 0E4E10 7F0B02E0 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 0E4E14 7F0B02E4 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0E4E18 7F0B02E8 AFB20038 */ sw $s2, 0x38($sp) -/* 0E4E1C 7F0B02EC AFB10034 */ sw $s1, 0x34($sp) -/* 0E4E20 7F0B02F0 AFB00030 */ sw $s0, 0x30($sp) -/* 0E4E24 7F0B02F4 4485A000 */ mtc1 $a1, $f20 -/* 0E4E28 7F0B02F8 4486B000 */ mtc1 $a2, $f22 -/* 0E4E2C 7F0B02FC 4480C000 */ mtc1 $zero, $f24 -/* 0E4E30 7F0B0300 00808825 */ move $s1, $a0 -/* 0E4E34 7F0B0304 AFBF003C */ sw $ra, 0x3c($sp) -/* 0E4E38 7F0B0308 00008025 */ move $s0, $zero -/* 0E4E3C 7F0B030C 24120003 */ li $s2, 3 -/* 0E4E40 7F0B0310 4406A000 */ mfc1 $a2, $f20 -.L7F0B0314: -/* 0E4E44 7F0B0314 4407B000 */ mfc1 $a3, $f22 -/* 0E4E48 7F0B0318 02202025 */ move $a0, $s1 -/* 0E4E4C 7F0B031C 0FC2BF9C */ jal sub_GAME_7F0AFE70 -/* 0E4E50 7F0B0320 02002825 */ move $a1, $s0 -/* 0E4E54 7F0B0324 4618003C */ c.lt.s $f0, $f24 -/* 0E4E58 7F0B0328 26100001 */ addiu $s0, $s0, 1 -/* 0E4E5C 7F0B032C 45000003 */ bc1f .L7F0B033C -/* 0E4E60 7F0B0330 00000000 */ nop -/* 0E4E64 7F0B0334 10000004 */ b .L7F0B0348 -/* 0E4E68 7F0B0338 00001025 */ move $v0, $zero -.L7F0B033C: -/* 0E4E6C 7F0B033C 5612FFF5 */ bnel $s0, $s2, .L7F0B0314 -/* 0E4E70 7F0B0340 4406A000 */ mfc1 $a2, $f20 -/* 0E4E74 7F0B0344 24020001 */ li $v0, 1 -.L7F0B0348: -/* 0E4E78 7F0B0348 8FBF003C */ lw $ra, 0x3c($sp) -/* 0E4E7C 7F0B034C D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0E4E80 7F0B0350 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 0E4E84 7F0B0354 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 0E4E88 7F0B0358 8FB00030 */ lw $s0, 0x30($sp) -/* 0E4E8C 7F0B035C 8FB10034 */ lw $s1, 0x34($sp) -/* 0E4E90 7F0B0360 8FB20038 */ lw $s2, 0x38($sp) -/* 0E4E94 7F0B0364 03E00008 */ jr $ra -/* 0E4E98 7F0B0368 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif +s32 isPointInsideTriStandTileUnscaled_Maybe(struct StandTile *tile, float p_x, float p_z) +{ + float disp; + s32 i; + for (i = 0; i != 3; i++) + { + disp = getShortest2dDispToInfTripleEdgeUnscaled(tile,i,p_x,p_z); + if (disp < 0) { + return 0; + } + } -#ifdef NONMATCHING -void sub_GAME_7F0B036C(void) { - + return 1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B036C -/* 0E4E9C 7F0B036C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0E4EA0 7F0B0370 F7B80028 */ sdc1 $f24, 0x28($sp) -/* 0E4EA4 7F0B0374 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 0E4EA8 7F0B0378 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0E4EAC 7F0B037C AFB20038 */ sw $s2, 0x38($sp) -/* 0E4EB0 7F0B0380 AFB10034 */ sw $s1, 0x34($sp) -/* 0E4EB4 7F0B0384 AFB00030 */ sw $s0, 0x30($sp) -/* 0E4EB8 7F0B0388 4485A000 */ mtc1 $a1, $f20 -/* 0E4EBC 7F0B038C 4486B000 */ mtc1 $a2, $f22 -/* 0E4EC0 7F0B0390 4480C000 */ mtc1 $zero, $f24 -/* 0E4EC4 7F0B0394 00808825 */ move $s1, $a0 -/* 0E4EC8 7F0B0398 AFBF003C */ sw $ra, 0x3c($sp) -/* 0E4ECC 7F0B039C 00008025 */ move $s0, $zero -/* 0E4ED0 7F0B03A0 24120003 */ li $s2, 3 -/* 0E4ED4 7F0B03A4 4406A000 */ mfc1 $a2, $f20 -.L7F0B03A8: -/* 0E4ED8 7F0B03A8 4407B000 */ mfc1 $a3, $f22 -/* 0E4EDC 7F0B03AC 02202025 */ move $a0, $s1 -/* 0E4EE0 7F0B03B0 0FC2C006 */ jal sub_GAME_7F0B0018 -/* 0E4EE4 7F0B03B4 02002825 */ move $a1, $s0 -/* 0E4EE8 7F0B03B8 4618003C */ c.lt.s $f0, $f24 -/* 0E4EEC 7F0B03BC 26100001 */ addiu $s0, $s0, 1 -/* 0E4EF0 7F0B03C0 45000003 */ bc1f .L7F0B03D0 -/* 0E4EF4 7F0B03C4 00000000 */ nop -/* 0E4EF8 7F0B03C8 10000004 */ b .L7F0B03DC -/* 0E4EFC 7F0B03CC 00001025 */ move $v0, $zero -.L7F0B03D0: -/* 0E4F00 7F0B03D0 5612FFF5 */ bnel $s0, $s2, .L7F0B03A8 -/* 0E4F04 7F0B03D4 4406A000 */ mfc1 $a2, $f20 -/* 0E4F08 7F0B03D8 24020001 */ li $v0, 1 -.L7F0B03DC: -/* 0E4F0C 7F0B03DC 8FBF003C */ lw $ra, 0x3c($sp) -/* 0E4F10 7F0B03E0 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0E4F14 7F0B03E4 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 0E4F18 7F0B03E8 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 0E4F1C 7F0B03EC 8FB00030 */ lw $s0, 0x30($sp) -/* 0E4F20 7F0B03F0 8FB10034 */ lw $s1, 0x34($sp) -/* 0E4F24 7F0B03F4 8FB20038 */ lw $s2, 0x38($sp) -/* 0E4F28 7F0B03F8 03E00008 */ jr $ra -/* 0E4F2C 7F0B03FC 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif - - +// Sig for caller matches +float sub_GAME_7F0B0400(struct StandTile *tile, s32 start3index, float p_x,float 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; @@ -2488,173 +2365,55 @@ glabel sub_GAME_7F0B0400 -#ifdef NONMATCHING -void sub_GAME_7F0B0518(void) { +s32 sub_GAME_7F0B0518(struct StandTile *tile, float p_x, float p_z) +{ + float unk; + s32 i; + p_x *= level_scale; + p_z *= level_scale; + + for (i = 0; i != 3; i++) + { + unk = sub_GAME_7F0B0400(tile,i,p_x,p_z); + if (unk < -2) { + return 0; + } + } + + return 1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0518 -/* 0E5048 7F0B0518 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0E504C 7F0B051C F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0E5050 7F0B0520 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E5054 7F0B0524 4485A000 */ mtc1 $a1, $f20 -/* 0E5058 7F0B0528 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) -/* 0E505C 7F0B052C F7B60020 */ sdc1 $f22, 0x20($sp) -/* 0E5060 7F0B0530 4486B000 */ mtc1 $a2, $f22 -/* 0E5064 7F0B0534 4600A502 */ mul.s $f20, $f20, $f0 -/* 0E5068 7F0B0538 F7B80028 */ sdc1 $f24, 0x28($sp) -/* 0E506C 7F0B053C 3C01C000 */ li $at, 0xC0000000 # -2.000000 -/* 0E5070 7F0B0540 AFB20038 */ sw $s2, 0x38($sp) -/* 0E5074 7F0B0544 AFB10034 */ sw $s1, 0x34($sp) -/* 0E5078 7F0B0548 AFB00030 */ sw $s0, 0x30($sp) -/* 0E507C 7F0B054C 4481C000 */ mtc1 $at, $f24 -/* 0E5080 7F0B0550 4600B582 */ mul.s $f22, $f22, $f0 -/* 0E5084 7F0B0554 00808825 */ move $s1, $a0 -/* 0E5088 7F0B0558 AFBF003C */ sw $ra, 0x3c($sp) -/* 0E508C 7F0B055C 00008025 */ move $s0, $zero -/* 0E5090 7F0B0560 24120003 */ li $s2, 3 -/* 0E5094 7F0B0564 4406A000 */ mfc1 $a2, $f20 -.L7F0B0568: -/* 0E5098 7F0B0568 4407B000 */ mfc1 $a3, $f22 -/* 0E509C 7F0B056C 02202025 */ move $a0, $s1 -/* 0E50A0 7F0B0570 0FC2C100 */ jal sub_GAME_7F0B0400 -/* 0E50A4 7F0B0574 02002825 */ move $a1, $s0 -/* 0E50A8 7F0B0578 4618003C */ c.lt.s $f0, $f24 -/* 0E50AC 7F0B057C 26100001 */ addiu $s0, $s0, 1 -/* 0E50B0 7F0B0580 45000003 */ bc1f .L7F0B0590 -/* 0E50B4 7F0B0584 00000000 */ nop -/* 0E50B8 7F0B0588 10000004 */ b .L7F0B059C -/* 0E50BC 7F0B058C 00001025 */ move $v0, $zero -.L7F0B0590: -/* 0E50C0 7F0B0590 5612FFF5 */ bnel $s0, $s2, .L7F0B0568 -/* 0E50C4 7F0B0594 4406A000 */ mfc1 $a2, $f20 -/* 0E50C8 7F0B0598 24020001 */ li $v0, 1 -.L7F0B059C: -/* 0E50CC 7F0B059C 8FBF003C */ lw $ra, 0x3c($sp) -/* 0E50D0 7F0B05A0 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0E50D4 7F0B05A4 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 0E50D8 7F0B05A8 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 0E50DC 7F0B05AC 8FB00030 */ lw $s0, 0x30($sp) -/* 0E50E0 7F0B05B0 8FB10034 */ lw $s1, 0x34($sp) -/* 0E50E4 7F0B05B4 8FB20038 */ lw $s2, 0x38($sp) -/* 0E50E8 7F0B05B8 03E00008 */ jr $ra -/* 0E50EC 7F0B05BC 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif - - -#ifdef NONMATCHING -void sub_GAME_7F0B05C0(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { - f32 temp_f0; - f32 temp_f2; - - // Node 0 - temp_f0 = (arg1 * arg2); - temp_f2 = (arg0 * arg3); - if (temp_f0 < temp_f2) - { - // Node 1 +// A->B ACWS returns 1, CWS (including opposite) returns -1. +// Identical direction and |A| >= |B| returns 0 +int getRotationalDirectionBetween(float a_x,float a_z,float b_x,float b_z) +{ + // The main 2 cases : return the sign of AxB where it's non-zero + if (a_z * b_x < a_x * b_z) { return 1; } - // Node 2 - if (temp_f2 < temp_f0) - { - // Node 3 + if (a_x * b_z < a_z * b_x) { return -1; } - // Node 4 - if ((arg0 * arg2) < 0.0f) - { - // Node 6 - return -1; + + // [AxB == 0 now] + + // If the vectors are opposite, default to clockwise + if ((a_x * b_x < 0) || (a_z * b_z < 0)) { + return -1; } - // Node 5 - if ((arg1 * arg3) < 0.0f) - { - // Node 6 - return -1; + + // If A is shorter, return anti-clockwise + if (a_x * a_x + a_z * a_z < b_x * b_x + b_z * b_z) { + return 1; // ACWS } - // Node 7 - if (((arg0 * arg0) + (arg1 * arg1)) < ((arg2 * arg2) + (arg3 * arg3))) - { - // Node 8 - return 1; - } - // Node 9 + + // Identical direction, |A| >= |B| return 0; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B05C0 -/* 0E50F0 7F0B05C0 AFA60008 */ sw $a2, 8($sp) -/* 0E50F4 7F0B05C4 C7A40008 */ lwc1 $f4, 8($sp) -/* 0E50F8 7F0B05C8 AFA7000C */ sw $a3, 0xc($sp) -/* 0E50FC 7F0B05CC C7A6000C */ lwc1 $f6, 0xc($sp) -/* 0E5100 7F0B05D0 46047002 */ mul.s $f0, $f14, $f4 -/* 0E5104 7F0B05D4 00000000 */ nop -/* 0E5108 7F0B05D8 46066082 */ mul.s $f2, $f12, $f6 -/* 0E510C 7F0B05DC 4602003C */ c.lt.s $f0, $f2 -/* 0E5110 7F0B05E0 00000000 */ nop -/* 0E5114 7F0B05E4 45000003 */ bc1f .L7F0B05F4 -/* 0E5118 7F0B05E8 00000000 */ nop -/* 0E511C 7F0B05EC 03E00008 */ jr $ra -/* 0E5120 7F0B05F0 24020001 */ li $v0, 1 - -.L7F0B05F4: -/* 0E5124 7F0B05F4 4600103C */ c.lt.s $f2, $f0 -/* 0E5128 7F0B05F8 C7A80008 */ lwc1 $f8, 8($sp) -/* 0E512C 7F0B05FC 45000003 */ bc1f .L7F0B060C -/* 0E5130 7F0B0600 00000000 */ nop -/* 0E5134 7F0B0604 03E00008 */ jr $ra -/* 0E5138 7F0B0608 2402FFFF */ li $v0, -1 - -.L7F0B060C: -/* 0E513C 7F0B060C 46086282 */ mul.s $f10, $f12, $f8 -/* 0E5140 7F0B0610 44800000 */ mtc1 $zero, $f0 -/* 0E5144 7F0B0614 C7B0000C */ lwc1 $f16, 0xc($sp) -/* 0E5148 7F0B0618 4600503C */ c.lt.s $f10, $f0 -/* 0E514C 7F0B061C 00000000 */ nop -/* 0E5150 7F0B0620 45010006 */ bc1t .L7F0B063C -/* 0E5154 7F0B0624 00000000 */ nop -/* 0E5158 7F0B0628 46107482 */ mul.s $f18, $f14, $f16 -/* 0E515C 7F0B062C 4600903C */ c.lt.s $f18, $f0 -/* 0E5160 7F0B0630 00000000 */ nop -/* 0E5164 7F0B0634 45000003 */ bc1f .L7F0B0644 -/* 0E5168 7F0B0638 00000000 */ nop -.L7F0B063C: -/* 0E516C 7F0B063C 03E00008 */ jr $ra -/* 0E5170 7F0B0640 2402FFFF */ li $v0, -1 - -.L7F0B0644: -/* 0E5174 7F0B0644 460C6102 */ mul.s $f4, $f12, $f12 -/* 0E5178 7F0B0648 C7AA0008 */ lwc1 $f10, 8($sp) -/* 0E517C 7F0B064C C7B2000C */ lwc1 $f18, 0xc($sp) -/* 0E5180 7F0B0650 460E7182 */ mul.s $f6, $f14, $f14 -/* 0E5184 7F0B0654 00001025 */ move $v0, $zero -/* 0E5188 7F0B0658 460A5402 */ mul.s $f16, $f10, $f10 -/* 0E518C 7F0B065C 46062200 */ add.s $f8, $f4, $f6 -/* 0E5190 7F0B0660 46129102 */ mul.s $f4, $f18, $f18 -/* 0E5194 7F0B0664 46048180 */ add.s $f6, $f16, $f4 -/* 0E5198 7F0B0668 4606403C */ c.lt.s $f8, $f6 -/* 0E519C 7F0B066C 00000000 */ nop -/* 0E51A0 7F0B0670 45000003 */ bc1f .L7F0B0680 -/* 0E51A4 7F0B0674 00000000 */ nop -/* 0E51A8 7F0B0678 03E00008 */ jr $ra -/* 0E51AC 7F0B067C 24020001 */ li $v0, 1 - -.L7F0B0680: -/* 0E51B0 7F0B0680 03E00008 */ jr $ra -/* 0E51B4 7F0B0684 00000000 */ nop -) -#endif - @@ -2675,14 +2434,14 @@ s32 sub_GAME_7F0B0688(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5 temp_f2 = (arg1 - arg5); sp24 = temp_f0; sp20 = temp_f2; - sp2C = sub_GAME_7F0B05C0((arg2 - arg0), (arg3 - arg1), -temp_f0, -temp_f2); - temp_t7 = ((sub_GAME_7F0B05C0(sp1C, sp18, (arg6 - arg0), (arg7 - arg1)) * sp2C) < 1); + 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 = sub_GAME_7F0B05C0((arg6 - arg4), (arg7 - arg5), sp24, sp20); - phi_return = ((sub_GAME_7F0B05C0(sp1C, sp18, (arg2 - arg4), (arg3 - arg5)) * sp28) < 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; @@ -2715,7 +2474,7 @@ glabel sub_GAME_7F0B0688 /* 0E5208 7F0B06D8 46001407 */ neg.s $f16, $f2 /* 0E520C 7F0B06DC 44064000 */ mfc1 $a2, $f8 /* 0E5210 7F0B06E0 44078000 */ mfc1 $a3, $f16 -/* 0E5214 7F0B06E4 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 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) @@ -2728,7 +2487,7 @@ glabel sub_GAME_7F0B0688 /* 0E523C 7F0B070C 44069000 */ mfc1 $a2, $f18 /* 0E5240 7F0B0710 AFA2002C */ sw $v0, 0x2c($sp) /* 0E5244 7F0B0714 44074000 */ mfc1 $a3, $f8 -/* 0E5248 7F0B0718 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E5248 7F0B0718 0FC2C170 */ jal getRotationalDirectionBetween /* 0E524C 7F0B071C 00000000 */ nop /* 0E5250 7F0B0720 8FAE002C */ lw $t6, 0x2c($sp) /* 0E5254 7F0B0724 C7A60060 */ lwc1 $f6, 0x60($sp) @@ -2745,7 +2504,7 @@ glabel sub_GAME_7F0B0688 /* 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 sub_GAME_7F0B05C0 +/* 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) @@ -2758,7 +2517,7 @@ glabel sub_GAME_7F0B0688 /* 0E52B4 7F0B0784 44063000 */ mfc1 $a2, $f6 /* 0E52B8 7F0B0788 AFA20028 */ sw $v0, 0x28($sp) /* 0E52BC 7F0B078C 44075000 */ mfc1 $a3, $f10 -/* 0E52C0 7F0B0790 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E52C0 7F0B0790 0FC2C170 */ jal getRotationalDirectionBetween /* 0E52C4 7F0B0794 00000000 */ nop /* 0E52C8 7F0B0798 8FB80028 */ lw $t8, 0x28($sp) /* 0E52CC 7F0B079C 00580019 */ multu $v0, $t8 @@ -2794,9 +2553,9 @@ glabel sub_GAME_7F0B0688 sp44 = 1; sp28 = temp_f0; sp24 = temp_f2; - sp2C = sub_GAME_7F0B05C0((arg2 - arg0), (arg3 - arg1), -temp_f0, -temp_f2); - sp4C = (s32) (sub_GAME_7F0B05C0(sp20, sp1C, (arg6 - arg0), (arg7 - arg1)) * sp2C); - sp2C = sub_GAME_7F0B05C0((arg6 - arg4), (arg7 - arg5), sp28, sp24); + sp2C = getRotationalDirectionBetween((arg2 - arg0), (arg3 - arg1), -temp_f0, -temp_f2); + sp4C = (s32) (getRotationalDirectionBetween(sp20, sp1C, (arg6 - arg0), (arg7 - arg1)) * sp2C); + sp2C = getRotationalDirectionBetween((arg6 - arg4), (arg7 - arg5), sp28, sp24); if (sp4C >= arg8) { // Node 1 @@ -2804,7 +2563,7 @@ glabel sub_GAME_7F0B0688 } // Node 2 phi_a0 = sp44; - if ((sub_GAME_7F0B05C0(sp20, sp1C, (arg2 - arg4), (arg3 - arg5)) * sp2C) >= arg8) + if ((getRotationalDirectionBetween(sp20, sp1C, (arg2 - arg4), (arg3 - arg5)) * sp2C) >= arg8) { // Node 3 phi_a0 = 0; @@ -2842,7 +2601,7 @@ glabel sub_GAME_7F0B07BC /* 0E5344 7F0B0814 44074000 */ mfc1 $a3, $f8 /* 0E5348 7F0B0818 44069000 */ mfc1 $a2, $f18 /* 0E534C 7F0B081C E7AE001C */ swc1 $f14, 0x1c($sp) -/* 0E5350 7F0B0820 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E5350 7F0B0820 0FC2C170 */ jal getRotationalDirectionBetween /* 0E5354 7F0B0824 E7AC0020 */ swc1 $f12, 0x20($sp) /* 0E5358 7F0B0828 C7A60080 */ lwc1 $f6, 0x80($sp) /* 0E535C 7F0B082C C7B00068 */ lwc1 $f16, 0x68($sp) @@ -2855,7 +2614,7 @@ glabel sub_GAME_7F0B07BC /* 0E5378 7F0B0848 44069000 */ mfc1 $a2, $f18 /* 0E537C 7F0B084C AFA2002C */ sw $v0, 0x2c($sp) /* 0E5380 7F0B0850 44074000 */ mfc1 $a3, $f8 -/* 0E5384 7F0B0854 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E5384 7F0B0854 0FC2C170 */ jal getRotationalDirectionBetween /* 0E5388 7F0B0858 00000000 */ nop /* 0E538C 7F0B085C 8FAF002C */ lw $t7, 0x2c($sp) /* 0E5390 7F0B0860 C7A60080 */ lwc1 $f6, 0x80($sp) @@ -2870,7 +2629,7 @@ glabel sub_GAME_7F0B07BC /* 0E53B4 7F0B0884 E7AC0020 */ swc1 $f12, 0x20($sp) /* 0E53B8 7F0B0888 0000C012 */ mflo $t8 /* 0E53BC 7F0B088C AFB8004C */ sw $t8, 0x4c($sp) -/* 0E53C0 7F0B0890 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E53C0 7F0B0890 0FC2C170 */ jal getRotationalDirectionBetween /* 0E53C4 7F0B0894 E7AE001C */ swc1 $f14, 0x1c($sp) /* 0E53C8 7F0B0898 C7A40070 */ lwc1 $f4, 0x70($sp) /* 0E53CC 7F0B089C C7A80078 */ lwc1 $f8, 0x78($sp) @@ -2883,7 +2642,7 @@ glabel sub_GAME_7F0B07BC /* 0E53E8 7F0B08B8 44063000 */ mfc1 $a2, $f6 /* 0E53EC 7F0B08BC AFA2002C */ sw $v0, 0x2c($sp) /* 0E53F0 7F0B08C0 44075000 */ mfc1 $a3, $f10 -/* 0E53F4 7F0B08C4 0FC2C170 */ jal sub_GAME_7F0B05C0 +/* 0E53F4 7F0B08C4 0FC2C170 */ jal getRotationalDirectionBetween /* 0E53F8 7F0B08C8 00000000 */ nop /* 0E53FC 7F0B08CC 8FA30088 */ lw $v1, 0x88($sp) /* 0E5400 7F0B08D0 8FB9004C */ lw $t9, 0x4c($sp) @@ -2911,6 +2670,11 @@ glabel sub_GAME_7F0B07BC +// 'walkTilesBetweenPoints_withCallback' +// sig declared for caller matches +s32 sub_GAME_7F0B0914(struct StandTile **tileStack, float start_x, float start_z, float dest_x, float dest_z, + standTileWalkCallback_t func, struct StandTileWalkCallbackRecord *funcData); + #ifdef NONMATCHING void sub_GAME_7F0B0914(void) { @@ -2922,9 +2686,9 @@ GLOBAL_ASM( glabel sub_GAME_7F0B0914 /* 0E5444 7F0B0914 27BDFF48 */ addiu $sp, $sp, -0xb8 /* 0E5448 7F0B0918 F7B40030 */ sdc1 $f20, 0x30($sp) -/* 0E544C 7F0B091C 3C018004 */ lui $at, %hi(D_80040F44) +/* 0E544C 7F0B091C 3C018004 */ lui $at, %hi(level_scale) /* 0E5450 7F0B0920 4485A000 */ mtc1 $a1, $f20 -/* 0E5454 7F0B0924 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) +/* 0E5454 7F0B0924 C4200F44 */ lwc1 $f0, %lo(level_scale)($at) /* 0E5458 7F0B0928 F7B60038 */ sdc1 $f22, 0x38($sp) /* 0E545C 7F0B092C 4486B000 */ mtc1 $a2, $f22 /* 0E5460 7F0B0930 4600A502 */ mul.s $f20, $f20, $f0 @@ -3036,8 +2800,8 @@ glabel sub_GAME_7F0B0914 /* 0E55F4 7F0B0AC4 50400012 */ beql $v0, $zero, .L7F0B0B10 /* 0E55F8 7F0B0AC8 86640006 */ lh $a0, 6($s3) /* 0E55FC 7F0B0ACC 9603000E */ lhu $v1, 0xe($s0) -/* 0E5600 7F0B0AD0 3C198004 */ lui $t9, %hi(base_ptr_connection_vals) -/* 0E5604 7F0B0AD4 8F390F58 */ lw $t9, %lo(base_ptr_connection_vals)($t9) +/* 0E5600 7F0B0AD0 3C198004 */ lui $t9, %hi(standTileStart) +/* 0E5604 7F0B0AD4 8F390F58 */ lw $t9, %lo(standTileStart)($t9) /* 0E5608 7F0B0AD8 0003C0C0 */ sll $t8, $v1, 3 /* 0E560C 7F0B0ADC 26940001 */ addiu $s4, $s4, 1 /* 0E5610 7F0B0AE0 03191021 */ addu $v0, $t8, $t9 @@ -3085,10 +2849,10 @@ glabel sub_GAME_7F0B0914 /* 0E56A0 7F0B0B70 16800007 */ bnez $s4, .L7F0B0B90 /* 0E56A4 7F0B0B74 00008825 */ move $s1, $zero .L7F0B0B78: -/* 0E56A8 7F0B0B78 3C018008 */ lui $at, %hi(dword_CODE_bss_8007B9E4) -/* 0E56AC 7F0B0B7C AC36B9E4 */ sw $s6, %lo(dword_CODE_bss_8007B9E4)($at) -/* 0E56B0 7F0B0B80 3C018008 */ lui $at, %hi(dword_CODE_bss_8007B9E8) -/* 0E56B4 7F0B0B84 AC3EB9E8 */ sw $fp, %lo(dword_CODE_bss_8007B9E8)($at) +/* 0E56A8 7F0B0B78 3C018008 */ lui $at, %hi(stanSavedColl_tile) +/* 0E56AC 7F0B0B7C AC36B9E4 */ sw $s6, %lo(stanSavedColl_tile)($at) +/* 0E56B0 7F0B0B80 3C018008 */ lui $at, %hi(stanSavedColl_pointI) +/* 0E56B4 7F0B0B84 AC3EB9E8 */ sw $fp, %lo(stanSavedColl_pointI)($at) /* 0E56B8 7F0B0B88 10000004 */ b .L7F0B0B9C /* 0E56BC 7F0B0B8C 00001025 */ move $v0, $zero .L7F0B0B90: @@ -3119,211 +2883,123 @@ glabel sub_GAME_7F0B0914 - - -#ifdef NONMATCHING -void sub_GAME_7F0B0BE4(s32 arg1, ? arg2, ? arg3, f32 arg4) { - sub_GAME_7F0B0914(arg1, arg2, arg1, arg2, arg4, 0, 0); +// 'walkTilesBetweenPoints_NoCallback' +s32 sub_GAME_7F0B0BE4(struct StandTile **tileStack, float start_x, float start_z, float dest_x, float dest_z) +{ + return sub_GAME_7F0B0914(tileStack, start_x, start_z, dest_x, dest_z, 0, 0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0BE4 -/* 0E5714 7F0B0BE4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0E5718 7F0B0BE8 44856000 */ mtc1 $a1, $f12 -/* 0E571C 7F0B0BEC 44867000 */ mtc1 $a2, $f14 -/* 0E5720 7F0B0BF0 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 0E5724 7F0B0BF4 AFBF0024 */ sw $ra, 0x24($sp) -/* 0E5728 7F0B0BF8 44056000 */ mfc1 $a1, $f12 -/* 0E572C 7F0B0BFC 44067000 */ mfc1 $a2, $f14 -/* 0E5730 7F0B0C00 AFA70034 */ sw $a3, 0x34($sp) -/* 0E5734 7F0B0C04 AFA00014 */ sw $zero, 0x14($sp) -/* 0E5738 7F0B0C08 AFA00018 */ sw $zero, 0x18($sp) -/* 0E573C 7F0B0C0C 0FC2C245 */ jal sub_GAME_7F0B0914 -/* 0E5740 7F0B0C10 E7A40010 */ swc1 $f4, 0x10($sp) -/* 0E5744 7F0B0C14 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E5748 7F0B0C18 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0E574C 7F0B0C1C 03E00008 */ jr $ra -/* 0E5750 7F0B0C20 00000000 */ nop -) -#endif +// 'walkTilesBetweenPoints_NotingRooms' +s32 sub_GAME_7F0B0C24(struct StandTile **tileStack, float start_x, float start_z, float dest_x, float dest_z, s32 *roomBuffer, s32 *rtnCountSize, s32 maxBufSize) +{ + struct StandTileWalkCallbackRecord callbackData; + s32 rtn; -#ifdef NONMATCHING -void sub_GAME_7F0B0C24(s32 arg1, ? arg2, ? arg3, f32 arg4, ?32 arg5, void *arg6, ?32 arg7) { - ?32 sp30; - ?32 sp34; - ?32 sp38; - ?32 sp3C; + callbackData.roomBuf = roomBuffer; + callbackData.count = 0; + callbackData.bufMax = maxBufSize; + callbackData.lastRoom = -1; - // Node 0 - sp34 = 0; - sp3C = -1; - sp30 = arg5; - sp38 = arg7; - *arg6 = sp34; - return sub_GAME_7F0B0914(arg1, arg2, arg1, arg2, arg4, &sub_GAME_7F0B0C98, &sp30); + rtn = sub_GAME_7F0B0914(tileStack, start_x, start_z, dest_x, dest_z, noteTileRoomIfDifferentToPrev, &callbackData); + + *rtnCountSize = callbackData.count; + return rtn; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0C24 -/* 0E5754 7F0B0C24 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0E5758 7F0B0C28 44856000 */ mtc1 $a1, $f12 -/* 0E575C 7F0B0C2C 44867000 */ mtc1 $a2, $f14 -/* 0E5760 7F0B0C30 8FAE0054 */ lw $t6, 0x54($sp) -/* 0E5764 7F0B0C34 8FAF005C */ lw $t7, 0x5c($sp) -/* 0E5768 7F0B0C38 C7A40050 */ lwc1 $f4, 0x50($sp) -/* 0E576C 7F0B0C3C 3C197F0B */ lui $t9, %hi(sub_GAME_7F0B0C98) # $t9, 0x7f0b -/* 0E5770 7F0B0C40 AFBF0024 */ sw $ra, 0x24($sp) -/* 0E5774 7F0B0C44 2418FFFF */ li $t8, -1 -/* 0E5778 7F0B0C48 27390C98 */ addiu $t9, %lo(sub_GAME_7F0B0C98) # addiu $t9, $t9, 0xc98 -/* 0E577C 7F0B0C4C 27A80030 */ addiu $t0, $sp, 0x30 -/* 0E5780 7F0B0C50 44056000 */ mfc1 $a1, $f12 -/* 0E5784 7F0B0C54 44067000 */ mfc1 $a2, $f14 -/* 0E5788 7F0B0C58 AFA7004C */ sw $a3, 0x4c($sp) -/* 0E578C 7F0B0C5C AFA00034 */ sw $zero, 0x34($sp) -/* 0E5790 7F0B0C60 AFB8003C */ sw $t8, 0x3c($sp) -/* 0E5794 7F0B0C64 AFA80018 */ sw $t0, 0x18($sp) -/* 0E5798 7F0B0C68 AFB90014 */ sw $t9, 0x14($sp) -/* 0E579C 7F0B0C6C AFAE0030 */ sw $t6, 0x30($sp) -/* 0E57A0 7F0B0C70 AFAF0038 */ sw $t7, 0x38($sp) -/* 0E57A4 7F0B0C74 0FC2C245 */ jal sub_GAME_7F0B0914 -/* 0E57A8 7F0B0C78 E7A40010 */ swc1 $f4, 0x10($sp) -/* 0E57AC 7F0B0C7C 8FA90034 */ lw $t1, 0x34($sp) -/* 0E57B0 7F0B0C80 8FAA0058 */ lw $t2, 0x58($sp) -/* 0E57B4 7F0B0C84 AD490000 */ sw $t1, ($t2) -/* 0E57B8 7F0B0C88 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E57BC 7F0B0C8C 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0E57C0 7F0B0C90 03E00008 */ jr $ra -/* 0E57C4 7F0B0C94 00000000 */ nop -) -#endif +void noteTileRoomIfDifferentToPrev(struct StandTile *tile, struct StandTile *unused, struct StandTileWalkCallbackRecord *data) +{ + s32 newRoom; - - -#ifdef NONMATCHING -s32 sub_GAME_7F0B0C98(void *arg0, s32 arg1, void *arg2) { - // Node 0 - if (arg2->unkC != arg0->unk3) + if (tile->room != data->lastRoom && data->count < data->bufMax) { - // Node 1 - if (arg2->unk4 < arg2->unk8) - { - // Node 2 - **arg2 = (s32) arg0->unk3; - arg2->unkC = (s32) arg0->unk3; - *arg2 = (void *) (*arg2 + 4); - arg2->unk4 = (s32) (arg2->unk4 + 1); + newRoom = (s32)tile->room; + *data->roomBuf = newRoom; + data->lastRoom = newRoom; + data->roomBuf += 1; + data->count += 1; + } + + return; +} + + + + +void noteTileRoomIfDifferentToPrev_2(struct StandTile *tile, struct StandTile *unused, struct StandTileWalkCallbackRecord *data) { + noteTileRoomIfDifferentToPrev(tile, unused, data); +} + + + + + + +#ifdef NONMATCHING +// Not too close + +s32 sub_GAME_7F0B0D0C(struct StandTile *tile, float start_x, float start_z, struct StandTile **tilePtr, + float end_x, float end_z, s32 *roomBuf, s32 maxBufSize) +{ + s32 roomA; + s32 roomB; + s32 bufCount; + struct StandTile* tileStack[2]; // unknown size + struct StandTile* unkTile; + + + bufCount = 0; + tileStack[0] = tile; + + if (*tilePtr != 0x0) { + + roomA = tile->room; + roomB = (*tilePtr)->room; + + if (roomA == roomB) { + *roomBuf = roomA; + return 1; + } + + // function related to portals + // funny & 0xFFs here which we can't reproduce + if (FUN_7f0b8fd0(roomA & 0xFF, roomB & 0xFF) != 0) { + *roomBuf = (s32)tile->room; + roomBuf[1] = (s32)(*tilePtr)->room; + return 2; + } + + } + + if (sub_GAME_7F0B0C24(tileStack,start_x,start_z,end_x,end_z, + roomBuf,&bufCount,maxBufSize) == 0 ) + { + bufCount = 0; + } + else { + if (maxBufSize < bufCount) { + bufCount = maxBufSize; } - } - // Node 3 - return arg0->unk3; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0C98 -/* 0E57C8 7F0B0C98 AFA50004 */ sw $a1, 4($sp) -/* 0E57CC 7F0B0C9C 8CCE000C */ lw $t6, 0xc($a2) -/* 0E57D0 7F0B0CA0 90820003 */ lbu $v0, 3($a0) -/* 0E57D4 7F0B0CA4 11C2000F */ beq $t6, $v0, .L7F0B0CE4 -/* 0E57D8 7F0B0CA8 00000000 */ nop -/* 0E57DC 7F0B0CAC 8CCF0004 */ lw $t7, 4($a2) -/* 0E57E0 7F0B0CB0 8CD80008 */ lw $t8, 8($a2) -/* 0E57E4 7F0B0CB4 01F8082A */ slt $at, $t7, $t8 -/* 0E57E8 7F0B0CB8 1020000A */ beqz $at, .L7F0B0CE4 -/* 0E57EC 7F0B0CBC 00000000 */ nop -/* 0E57F0 7F0B0CC0 8CD90000 */ lw $t9, ($a2) -/* 0E57F4 7F0B0CC4 AF220000 */ sw $v0, ($t9) -/* 0E57F8 7F0B0CC8 8CC80000 */ lw $t0, ($a2) -/* 0E57FC 7F0B0CCC 8CCA0004 */ lw $t2, 4($a2) -/* 0E5800 7F0B0CD0 ACC2000C */ sw $v0, 0xc($a2) -/* 0E5804 7F0B0CD4 25090004 */ addiu $t1, $t0, 4 -/* 0E5808 7F0B0CD8 254B0001 */ addiu $t3, $t2, 1 -/* 0E580C 7F0B0CDC ACC90000 */ sw $t1, ($a2) -/* 0E5810 7F0B0CE0 ACCB0004 */ sw $t3, 4($a2) -.L7F0B0CE4: -/* 0E5814 7F0B0CE4 03E00008 */ jr $ra -/* 0E5818 7F0B0CE8 00000000 */ nop -) -#endif + // Not sure what's going on here. + unkTile = *tilePtr; - - - -void sub_GAME_7F0B0CEC(void) { - sub_GAME_7F0B0C98(); -} - - - - - - -#ifdef NONMATCHING -s32 sub_GAME_7F0B0D0C(void *arg0, s32 arg1, ? arg2, void *arg3, ? arg4, f32 arg5, void *arg6, s32 arg7) { - s32 sp40; - void *sp44; - void *phi_v0; - - // Node 0 - sp40 = 0; - if (*arg3 != 0) - { - // Node 1 - if (arg0->unk3 == *arg3->unk3) - { - // Node 2 - *arg6 = (s32) arg0->unk3; - return sp40; + if (unkTile == 0) { + *tilePtr = tileStack[0]; + unkTile = tileStack[0]; } - // Node 3 - if (sub_GAME_7F0B8FD0((arg0->unk3 & 0xff), (*arg3->unk3 & 0xff), arg0->unk3, *arg3->unk3) != 0) - { - // Node 4 - *arg6 = (s32) arg0->unk3; - arg6->unk4 = (s32) *arg3->unk3; - return sp40; + + if (tileStack[0] != unkTile) { + bufCount = 0; } - } - // Node 5 - if (sub_GAME_7F0B0C24(&sp44, arg1, arg2, arg4, arg5, arg6, &sp40, arg7) == 0) - { - // Node 6 - return sp40; - } - // Node 7 - if (arg7 < sp40) - { - // Node 8 - sp40 = arg7; - } - // Node 9 - phi_v0 = *arg3; - if (*arg3 == 0) - { - // Node 10 - *arg3 = sp44; - phi_v0 = sp44; - } - // Node 11 - if (sp44 == phi_v0) - { - // Node 13 - // Node 14 - return sp40; - } - // Node 12 - return sp40; + } + + return bufCount; } #else GLOBAL_ASM( @@ -3410,11 +3086,14 @@ glabel sub_GAME_7F0B0D0C #endif - - +// sig for caller matches +int sub_GAME_7F0B0E24(struct StandTile **pTile, float p_x, float p_z, float dest_x, float dest_z, + int objFlags, float unkHeight, float unkA, float unkB, float unkC); #ifdef NONMATCHING -void sub_GAME_7F0B0E24(void) { +// 'testLineUnobstructed' +int sub_GAME_7F0B0E24(struct StandTile **pTile, float p_x, float p_z, float dest_x, float dest_z, + int objFlags, float unkHeight, float unkA, float unkB, float unkC) { } #else @@ -3477,20 +3156,20 @@ glabel sub_GAME_7F0B0E24 /* 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(flt_CODE_bss_8007B9F8) +/* 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(flt_CODE_bss_8007B9F8) # addiu $a3, $a3, -0x4608 +/* 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(flt_CODE_bss_8007B9F0) -/* 0E5A54 7F0B0F24 3C028008 */ lui $v0, %hi(dword_CODE_bss_8007B9E4) -/* 0E5A58 7F0B0F28 8C42B9E4 */ lw $v0, %lo(dword_CODE_bss_8007B9E4)($v0) -/* 0E5A5C 7F0B0F2C 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007B9E8) -/* 0E5A60 7F0B0F30 8C63B9E8 */ lw $v1, %lo(dword_CODE_bss_8007B9E8)($v1) +/* 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 @@ -3499,7 +3178,7 @@ glabel sub_GAME_7F0B0E24 /* 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(flt_CODE_bss_8007B9F0) # addiu $fp, $fp, -0x4610 +/* 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 @@ -3514,8 +3193,8 @@ glabel sub_GAME_7F0B0E24 /* 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(D_80040F48) -/* 0E5ABC 7F0B0F8C C4200F48 */ lwc1 $f0, %lo(D_80040F48)($at) +/* 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 @@ -3548,12 +3227,12 @@ glabel sub_GAME_7F0B0E24 /* 0E5B34 7F0B1004 10000003 */ b .L7F0B1014 /* 0E5B38 7F0B1008 46000706 */ mov.s $f28, $f0 .L7F0B100C: -/* 0E5B3C 7F0B100C 3C1E8008 */ lui $fp, %hi(flt_CODE_bss_8007B9F0) -/* 0E5B40 7F0B1010 27DEB9F0 */ addiu $fp, %lo(flt_CODE_bss_8007B9F0) # addiu $fp, $fp, -0x4610 +/* 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(dword_CODE_bss_8007BA04) -/* 0E5B4C 7F0B101C 26F7BA04 */ addiu $s7, %lo(dword_CODE_bss_8007BA04) # addiu $s7, $s7, -0x45fc +/* 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) @@ -3742,19 +3421,19 @@ glabel sub_GAME_7F0B0E24 /* 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(flt_CODE_bss_8007B9F8) +/* 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(flt_CODE_bss_8007B9F8) # addiu $t6, $t6, -0x4608 +/* 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(dword_CODE_bss_8007B9E4) +/* 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(dword_CODE_bss_8007B9E4)($at) -/* 0E5E4C 7F0B131C 3C018008 */ lui $at, %hi(dword_CODE_bss_8007B9E8) -/* 0E5E50 7F0B1320 AC20B9E8 */ sw $zero, %lo(dword_CODE_bss_8007B9E8)($at) +/* 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: @@ -3799,10 +3478,10 @@ glabel sub_GAME_7F0B0E24 /* 0E5EE0 7F0B13B0 8FAB0154 */ lw $t3, 0x154($sp) .L7F0B13B4: /* 0E5EE4 7F0B13B4 8FB90160 */ lw $t9, 0x160($sp) -/* 0E5EE8 7F0B13B8 3C018008 */ lui $at, %hi(flt_CODE_bss_8007BA00) +/* 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(flt_CODE_bss_8007BA00)($at) +/* 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) @@ -4027,32 +3706,41 @@ glabel sub_GAME_7F0B1410 #ifdef NONMATCHING -f32 sub_GAME_7F0B16C4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { - f32 sp1C; - f32 sp20; - f32 temp_f2; - f32 temp_f16; - ? temp_ret; - f32 temp_f0; - f32 temp_f2_2; +// general regalloc +float sub_GAME_7F0B16C4(float a_x,float a_z,float b_x,float b_z,float c_x,float c_z) +{ + float AB_x; + float AB_y; // unused + float AB_z; - // Node 0 - temp_f2 = (arg2 - arg0); - temp_f16 = (arg3 - arg1); - sp20 = temp_f2; - sp1C = temp_f16; - temp_ret = sqrtf(((temp_f2 * temp_f2) + (temp_f16 * temp_f16))); - if (temp_ret != 0.0f) - { - // Node 2 - // Node 3 - return (((temp_f16 * (arg4 - arg0)) + (-temp_f2 * (arg5 - arg1))) / temp_ret); + float dist; + + float BC_x; + float BC_y; // unused + float BC_z; + + float AC_x; + float AC_y; // unused + float AC_z; + + AB_x = b_x - a_x; + AB_z = b_z - a_z; + dist = sqrtf(AB_x * AB_x + AB_z * AB_z); + + if (dist == 0) { + BC_x = c_x - b_x; + BC_z = c_z - b_z; + return sqrtf(BC_x*BC_x + BC_z*BC_z); } - // Node 1 - temp_f0 = (arg4 - arg2); - temp_f2_2 = (arg5 - arg3); - return (((temp_f16 * (arg4 - arg0)) + (-temp_f2 * (arg5 - arg1))) / temp_ret); + else { + AC_x = c_x - a_x; + AC_z = c_z - a_z; + return (AB_z * AC_x + -AB_x * AC_z) / dist; + } + + return dist; } + #else GLOBAL_ASM( .text @@ -4117,125 +3805,50 @@ glabel sub_GAME_7F0B16C4 - -#ifdef NONMATCHING -void sub_GAME_7F0B1794(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { - f32 temp_f8; - f32 temp_f16; - - // Node 0 - temp_f8 = (arg2 - arg0); - temp_f16 = (arg3 - arg1); - arg2 = temp_f8; - arg3 = temp_f16; - sqrtf(((temp_f8 * temp_f8) + (temp_f16 * temp_f16))); +float distBetweenPoints2d(float o_x,float o_z,float p_x,float p_z) +{ + p_x -= o_x; + p_z -= o_z; + return sqrtf(p_x*p_x + p_z*p_z); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B1794 -/* 0E62C4 7F0B1794 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E62C8 7F0B1798 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0E62CC 7F0B179C AFA60020 */ sw $a2, 0x20($sp) -/* 0E62D0 7F0B17A0 C7A40020 */ lwc1 $f4, 0x20($sp) -/* 0E62D4 7F0B17A4 C7A60018 */ lwc1 $f6, 0x18($sp) -/* 0E62D8 7F0B17A8 AFA70024 */ sw $a3, 0x24($sp) -/* 0E62DC 7F0B17AC C7AA0024 */ lwc1 $f10, 0x24($sp) -/* 0E62E0 7F0B17B0 46062201 */ sub.s $f8, $f4, $f6 -/* 0E62E4 7F0B17B4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E62E8 7F0B17B8 460E5401 */ sub.s $f16, $f10, $f14 -/* 0E62EC 7F0B17BC 46084482 */ mul.s $f18, $f8, $f8 -/* 0E62F0 7F0B17C0 E7A80020 */ swc1 $f8, 0x20($sp) -/* 0E62F4 7F0B17C4 46108102 */ mul.s $f4, $f16, $f16 -/* 0E62F8 7F0B17C8 E7B00024 */ swc1 $f16, 0x24($sp) -/* 0E62FC 7F0B17CC 0C007DF8 */ jal sqrtf -/* 0E6300 7F0B17D0 46049300 */ add.s $f12, $f18, $f4 -/* 0E6304 7F0B17D4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E6308 7F0B17D8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E630C 7F0B17DC 03E00008 */ jr $ra -/* 0E6310 7F0B17E0 00000000 */ nop -) -#endif #ifdef NONMATCHING -s32 sub_GAME_7F0B17E4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { - f32 temp_f6; - f32 temp_f10; - f32 temp_f0; - f32 temp_f2; - f32 temp_f18; - f32 temp_f16; - s32 phi_v0; - s32 phi_v0_2; - s32 phi_v0_3; +// Not 100% sure it's logically equivalent. +// Pretty sure the test at least needs rephrasing to match. +s32 sub_GAME_7F0B17E4(float a_x,float a_z,float b_x,float b_z,float c_x,float c_z) +{ + float AB_x; + float AB_z; + float len_AB_sq; + float AC_x; + float AC_z; + float AC_dot_AB; + + AB_x = b_x - a_x; + AB_z = b_z - a_z; + len_AB_sq = AB_x * AB_x + AB_z * AB_z; - // Node 0 - temp_f6 = (arg4 - arg0); - temp_f10 = (arg5 - arg1); - arg4 = temp_f6; - temp_f0 = (arg2 - arg0); - arg5 = temp_f10; - temp_f2 = (arg3 - arg1); - temp_f18 = ((temp_f0 * temp_f0) + (temp_f2 * temp_f2)); - temp_f16 = ((temp_f6 * temp_f0) + (temp_f10 * temp_f2)); - phi_v0 = 0; - if (temp_f18 < temp_f16) - { - // Node 1 - phi_v0 = 1; + AC_x = c_x - a_x; + AC_z = c_z - a_z; + AC_dot_AB = AC_x * AB_x + AC_z * AB_z; + + // This appears to be A correct formulation, but the first statement is obviously false (requires length < 0) + // + if ( + ((AC_dot_AB > len_AB_sq) && (AC_dot_AB < 0)) // = false + || (0 < AC_dot_AB && AC_dot_AB < len_AB_sq) // AC_dot_AB in (0, len_AB_sq) + ){ + return 1; } - // Node 2 - if ((phi_v0 != 0) && (temp_f16 < 0.0f)) - { - // Node 4 - phi_v0_2 = 1; - // Node 5 - if (phi_v0_2 == 0) - { - // Node 6 - phi_v0_3 = 0; - if (0.0f < temp_f16) - { - // Node 7 - phi_v0_3 = 1; - } - // Node 8 - if (phi_v0_3 != 0) - { - // Node 9 - if (temp_f16 < temp_f18) - { - // Node 10 - } - } - } - } - else - { - // Node 6 - phi_v0_3 = 0; - if (0.0f < temp_f16) - { - // Node 7 - phi_v0_3 = 1; - } - // Node 8 - if (phi_v0_3 != 0) - { - // Node 9 - if (temp_f16 < temp_f18) - { - // Node 10 - } - } - } - // Node 11 + return 0; + } + #else GLOBAL_ASM( .text @@ -4365,8 +3978,8 @@ glabel sub_GAME_7F0B18B8 /* 0E64A4 7F0B1974 AFB900FC */ sw $t9, 0xfc($sp) .L7F0B1978: /* 0E64A8 7F0B1978 8FA80130 */ lw $t0, 0x130($sp) -/* 0E64AC 7F0B197C 3C018008 */ lui $at, %hi(dword_CODE_bss_8007BA04) -/* 0E64B0 7F0B1980 AC20BA04 */ sw $zero, %lo(dword_CODE_bss_8007BA04)($at) +/* 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 @@ -4391,17 +4004,17 @@ glabel sub_GAME_7F0B18B8 /* 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(dword_CODE_bss_8007B9E4) +/* 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(dword_CODE_bss_8007B9E4) # addiu $fp, $fp, -0x461c +/* 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(flt_CODE_bss_8007B9F8) -/* 0E6530 7F0B1A00 3C138008 */ lui $s3, %hi(flt_CODE_bss_8007B9F0) -/* 0E6534 7F0B1A04 2673B9F0 */ addiu $s3, %lo(flt_CODE_bss_8007B9F0) # addiu $s3, $s3, -0x4610 -/* 0E6538 7F0B1A08 2694B9F8 */ addiu $s4, %lo(flt_CODE_bss_8007B9F8) # addiu $s4, $s4, -0x4608 +/* 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: @@ -4490,7 +4103,7 @@ glabel sub_GAME_7F0B18B8 /* 0E6678 7F0B1B48 4407E000 */ mfc1 $a3, $f28 /* 0E667C 7F0B1B4C 01911021 */ addu $v0, $t4, $s1 /* 0E6680 7F0B1B50 C44C0000 */ lwc1 $f12, ($v0) -/* 0E6684 7F0B1B54 0FC2C5E5 */ jal sub_GAME_7F0B1794 +/* 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 @@ -4499,7 +4112,7 @@ glabel sub_GAME_7F0B18B8 /* 0E669C 7F0B1B6C 01B01821 */ addu $v1, $t5, $s0 /* 0E66A0 7F0B1B70 46000586 */ mov.s $f22, $f0 /* 0E66A4 7F0B1B74 C46C0000 */ lwc1 $f12, ($v1) -/* 0E66A8 7F0B1B78 0FC2C5E5 */ jal sub_GAME_7F0B1794 +/* 0E66A8 7F0B1B78 0FC2C5E5 */ jal distBetweenPoints2d /* 0E66AC 7F0B1B7C C46E0004 */ lwc1 $f14, 4($v1) /* 0E66B0 7F0B1B80 461EA03C */ c.lt.s $f20, $f30 /* 0E66B4 7F0B1B84 00000000 */ nop @@ -4532,7 +4145,7 @@ glabel sub_GAME_7F0B18B8 /* 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(dword_CODE_bss_8007B9E8) +/* 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 @@ -4542,9 +4155,9 @@ glabel sub_GAME_7F0B18B8 /* 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(dword_CODE_bss_8007B9E8)($at) -/* 0E6754 7F0B1C24 3C018008 */ lui $at, %hi(dword_CODE_bss_8007BA04) -/* 0E6758 7F0B1C28 AC35BA04 */ sw $s5, %lo(dword_CODE_bss_8007BA04)($at) +/* 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 @@ -4598,48 +4211,55 @@ glabel sub_GAME_7F0B18B8 void sub_GAME_7F0B1CC4(void) { - dword_CODE_bss_8007B9E4 = 0; - dword_CODE_bss_8007B9E8 = 0; + stanSavedColl_tile = 0; + stanSavedColl_pointI = 0; D_800413BC = 0; } -s32 sub_GAME_7F0B1CE0(void) { - return dword_CODE_bss_8007B9E4; +struct StandTile* sub_GAME_7F0B1CE0(void) { + return stanSavedColl_tile; } s32 sub_GAME_7F0B1CEC(void) { - return dword_CODE_bss_8007B9E8; + return stanSavedColl_pointI; } - - +// sig for caller matches +void getTileEdgePoints(struct StandTile *tile, s32 pointI, struct float3 *currPntRtn, struct float3 *nextPointRtn); #ifdef NONMATCHING -void *sub_GAME_7F0B1CF8(void *arg0, s32 arg1, void *arg2, void *arg3) { - void *temp_v0; - void *temp_v0_2; +// Not debugged at all - can't be far wrong though. +void getTileEdgePoints(struct StandTile *tile, s32 pointI, struct float3 *currPntRtn, struct float3 *nextPointRtn) +{ + struct StandTilePoint *tilePntA; + struct StandTilePoint *tilePntB; + s32 pointCount; + + tilePntA = &tile->points[pointI]; - // Node 0 - temp_v0 = (arg0 + (arg1 * 8)); - *arg2 = (f32) ((f32) temp_v0->unk8 * D_80040F48); - arg2->unk4 = (f32) ((f32) temp_v0->unkA * D_80040F48); - arg2->unk8 = (f32) ((f32) temp_v0->unkC * D_80040F48); - temp_v0_2 = (arg0 + (((s32) (arg1 + 1) % (s32) (((s32) arg0->unk6 >> 0xc) & 0xf)) * 8)); - *arg3 = (f32) ((f32) temp_v0_2->unk8 * D_80040F48); - arg3->unk4 = (f32) ((f32) temp_v0_2->unkA * D_80040F48); - arg3->unk8 = (f32) ((f32) temp_v0_2->unkC * D_80040F48); - return temp_v0_2; + currPntRtn->x = (float)tilePntA->x * inv_level_scale; + currPntRtn->y = (float)tilePntA->y * inv_level_scale; + currPntRtn->z = (float)tilePntA->z * inv_level_scale; + + pointCount = STAN_POINT_COUNT(tile); + tilePntB = &tile->points[(pointI + 1) % pointCount]; + + + nextPointRtn->x = (float)tilePntB->x * inv_level_scale; + nextPointRtn->y = (float)tilePntB->y * inv_level_scale; + nextPointRtn->z = (float)tilePntB->z * inv_level_scale; + } #else GLOBAL_ASM( .text -glabel sub_GAME_7F0B1CF8 +glabel getTileEdgePoints /* 0E6828 7F0B1CF8 000570C0 */ sll $t6, $a1, 3 /* 0E682C 7F0B1CFC 008E1021 */ addu $v0, $a0, $t6 /* 0E6830 7F0B1D00 844F0008 */ lh $t7, 8($v0) -/* 0E6834 7F0B1D04 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E6838 7F0B1D08 C4200F48 */ lwc1 $f0, %lo(D_80040F48)($at) +/* 0E6834 7F0B1D04 3C018004 */ lui $at, %hi(inv_level_scale) +/* 0E6838 7F0B1D08 C4200F48 */ lwc1 $f0, %lo(inv_level_scale)($at) /* 0E683C 7F0B1D0C 448F2000 */ mtc1 $t7, $f4 /* 0E6840 7F0B1D10 24A80001 */ addiu $t0, $a1, 1 /* 0E6844 7F0B1D14 468021A0 */ cvt.s.w $f6, $f4 @@ -4697,9 +4317,12 @@ glabel sub_GAME_7F0B1CF8 ) #endif - - - +// Sig for caller matches +// Note it's not clear from caller usage alone what the type of C's 5th parameter is +s32 sub_GAME_7F0B1DDC(struct StandTile**, float, float, float, + standTileLocusCallback_A_t, standTileLocusCallback_B_t, standTileLocusCallback_C_t, + struct StandTileLocusCallbackRecord* +); #ifdef NONMATCHING void sub_GAME_7F0B1DDC(void) { @@ -4711,9 +4334,9 @@ GLOBAL_ASM( glabel sub_GAME_7F0B1DDC /* 0E690C 7F0B1DDC 27BDFEB0 */ addiu $sp, $sp, -0x150 /* 0E6910 7F0B1DE0 F7BA0038 */ sdc1 $f26, 0x38($sp) -/* 0E6914 7F0B1DE4 3C018004 */ lui $at, %hi(D_80040F44) +/* 0E6914 7F0B1DE4 3C018004 */ lui $at, %hi(level_scale) /* 0E6918 7F0B1DE8 4485D000 */ mtc1 $a1, $f26 -/* 0E691C 7F0B1DEC C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) +/* 0E691C 7F0B1DEC C4200F44 */ lwc1 $f0, %lo(level_scale)($at) /* 0E6920 7F0B1DF0 F7BC0040 */ sdc1 $f28, 0x40($sp) /* 0E6924 7F0B1DF4 4486E000 */ mtc1 $a2, $f28 /* 0E6928 7F0B1DF8 4600D682 */ mul.s $f26, $f26, $f0 @@ -4782,19 +4405,19 @@ glabel sub_GAME_7F0B1DDC .L7F0B1EE4: /* 0E6A14 7F0B1EE4 4407E000 */ mfc1 $a3, $f28 /* 0E6A18 7F0B1EE8 02602025 */ move $a0, $s3 -/* 0E6A1C 7F0B1EEC 0FC2BF47 */ jal sub_GAME_7F0AFD1C +/* 0E6A1C 7F0B1EEC 0FC2BF47 */ jal getShortest2dDispToInfTileEdge /* 0E6A20 7F0B1EF0 02002825 */ move $a1, $s0 /* 0E6A24 7F0B1EF4 4406D000 */ mfc1 $a2, $f26 /* 0E6A28 7F0B1EF8 4407E000 */ mfc1 $a3, $f28 /* 0E6A2C 7F0B1EFC 46000586 */ mov.s $f22, $f0 /* 0E6A30 7F0B1F00 02602025 */ move $a0, $s3 -/* 0E6A34 7F0B1F04 0FC2C019 */ jal sub_GAME_7F0B0064 +/* 0E6A34 7F0B1F04 0FC2C019 */ jal distToTilePnt2D /* 0E6A38 7F0B1F08 02002825 */ move $a1, $s0 /* 0E6A3C 7F0B1F0C 4406D000 */ mfc1 $a2, $f26 /* 0E6A40 7F0B1F10 4407E000 */ mfc1 $a3, $f28 /* 0E6A44 7F0B1F14 46000506 */ mov.s $f20, $f0 /* 0E6A48 7F0B1F18 02602025 */ move $a0, $s3 -/* 0E6A4C 7F0B1F1C 0FC2C019 */ jal sub_GAME_7F0B0064 +/* 0E6A4C 7F0B1F1C 0FC2C019 */ jal distToTilePnt2D /* 0E6A50 7F0B1F20 02202825 */ move $a1, $s1 /* 0E6A54 7F0B1F24 461EB03C */ c.lt.s $f22, $f30 /* 0E6A58 7F0B1F28 46000606 */ mov.s $f24, $f0 @@ -4828,12 +4451,12 @@ glabel sub_GAME_7F0B1DDC /* 0E6AC0 7F0B1F90 001068C0 */ sll $t5, $s0, 3 /* 0E6AC4 7F0B1F94 026D7021 */ addu $t6, $s3, $t5 /* 0E6AC8 7F0B1F98 95C4000E */ lhu $a0, 0xe($t6) -/* 0E6ACC 7F0B1F9C 3C088004 */ lui $t0, %hi(base_ptr_connection_vals) +/* 0E6ACC 7F0B1F9C 3C088004 */ lui $t0, %hi(standTileStart) /* 0E6AD0 7F0B1FA0 2682FFFF */ addiu $v0, $s4, -1 /* 0E6AD4 7F0B1FA4 00047903 */ sra $t7, $a0, 4 /* 0E6AD8 7F0B1FA8 11E00014 */ beqz $t7, .L7F0B1FFC /* 0E6ADC 7F0B1FAC 0004C8C0 */ sll $t9, $a0, 3 -/* 0E6AE0 7F0B1FB0 8D080F58 */ lw $t0, %lo(base_ptr_connection_vals)($t0) +/* 0E6AE0 7F0B1FB0 8D080F58 */ lw $t0, %lo(standTileStart)($t0) /* 0E6AE4 7F0B1FB4 00402825 */ move $a1, $v0 /* 0E6AE8 7F0B1FB8 0440000B */ bltz $v0, .L7F0B1FE8 /* 0E6AEC 7F0B1FBC 03281821 */ addu $v1, $t9, $t0 @@ -4855,11 +4478,11 @@ glabel sub_GAME_7F0B1DDC /* 0E6B24 7F0B1FF4 1000000F */ b .L7F0B2034 /* 0E6B28 7F0B1FF8 26940001 */ addiu $s4, $s4, 1 .L7F0B1FFC: -/* 0E6B2C 7F0B1FFC 3C018008 */ lui $at, %hi(dword_CODE_bss_8007B9E4) -/* 0E6B30 7F0B2000 AC33B9E4 */ sw $s3, %lo(dword_CODE_bss_8007B9E4)($at) -/* 0E6B34 7F0B2004 3C018008 */ lui $at, %hi(dword_CODE_bss_8007B9E8) +/* 0E6B2C 7F0B1FFC 3C018008 */ lui $at, %hi(stanSavedColl_tile) +/* 0E6B30 7F0B2000 AC33B9E4 */ sw $s3, %lo(stanSavedColl_tile)($at) +/* 0E6B34 7F0B2004 3C018008 */ lui $at, %hi(stanSavedColl_pointI) /* 0E6B38 7F0B2008 13C00008 */ beqz $fp, .L7F0B202C -/* 0E6B3C 7F0B200C AC30B9E8 */ sw $s0, %lo(dword_CODE_bss_8007B9E8)($at) +/* 0E6B3C 7F0B200C AC30B9E8 */ sw $s0, %lo(stanSavedColl_pointI)($at) /* 0E6B40 7F0B2010 27A400B0 */ addiu $a0, $sp, 0xb0 /* 0E6B44 7F0B2014 02802825 */ move $a1, $s4 /* 0E6B48 7F0B2018 03C0F809 */ jalr $fp @@ -4921,78 +4544,39 @@ glabel sub_GAME_7F0B1DDC - -#ifdef NONMATCHING -void sub_GAME_7F0B20D0(s32 arg1, ? arg2, ? arg3) { - // Node 0 - sub_GAME_7F0B1DDC(arg1, arg2, arg1, arg2, 0, 0, 0, 0); +s32 sub_GAME_7F0B20D0(struct StandTile** tileStack, float target_x, float target_z, float unknown) { + return sub_GAME_7F0B1DDC(tileStack, target_x, target_z, unknown, 0, 0, 0, 0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B20D0 -/* 0E6C00 7F0B20D0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0E6C04 7F0B20D4 44856000 */ mtc1 $a1, $f12 -/* 0E6C08 7F0B20D8 44867000 */ mtc1 $a2, $f14 -/* 0E6C0C 7F0B20DC AFBF0024 */ sw $ra, 0x24($sp) -/* 0E6C10 7F0B20E0 44056000 */ mfc1 $a1, $f12 -/* 0E6C14 7F0B20E4 44067000 */ mfc1 $a2, $f14 -/* 0E6C18 7F0B20E8 AFA70034 */ sw $a3, 0x34($sp) -/* 0E6C1C 7F0B20EC AFA00010 */ sw $zero, 0x10($sp) -/* 0E6C20 7F0B20F0 AFA00014 */ sw $zero, 0x14($sp) -/* 0E6C24 7F0B20F4 AFA00018 */ sw $zero, 0x18($sp) -/* 0E6C28 7F0B20F8 0FC2C777 */ jal sub_GAME_7F0B1DDC -/* 0E6C2C 7F0B20FC AFA0001C */ sw $zero, 0x1c($sp) -/* 0E6C30 7F0B2100 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E6C34 7F0B2104 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0E6C38 7F0B2108 03E00008 */ jr $ra -/* 0E6C3C 7F0B210C 00000000 */ nop -) -#endif - - - +// sig for caller matches +s32 sub_GAME_7F0B2110(struct StandTile* tile, struct StandTileLocusCallbackRecord*); #ifdef NONMATCHING -void sub_GAME_7F0B2110(void *arg0, void *arg1) { - s32 temp_v1; - void *phi_t0; - s32 phi_v1; - // Node 0 - if (arg1->unk4 > 0) +// Regalloc and a little reordering to solve, but there just seems to be nothing to work with in the loop. +// Indexing roomBuf makes sense and generates closer code. +// 'addTileRoomIfNew' +s32 sub_GAME_7F0B2110(struct StandTile* tile, struct StandTileLocusCallbackRecord* data) +{ + s32 i; + s32 room; + + for (i = 0; i < data->count; i++) { - // Node 1 - phi_t0 = *arg1; - phi_v1 = 0; -loop_2: - // Node 2 - if (arg0->unk3 == *phi_t0) - { - // Node 3 + if (data->roomBuf[i] == tile->room) { return 0; } - // Node 4 - temp_v1 = (phi_v1 + 1); - phi_t0 = (phi_t0 + 4); - phi_v1 = temp_v1; - if (temp_v1 < arg1->unk4) - { - goto loop_2; - } } - // Node 5 - if (arg1->unk4 < arg1->unk8) - { - // Node 6 - *(*arg1 + (arg1->unk4 * 4)) = (s32) arg0->unk3; - arg1->unk4 = (s32) (arg1->unk4 + 1); + + if (data->count < data->bufMax) { + data->roomBuf[data->count] = tile->room; + data->count++; } - // Node 7 + return 0; } + #else GLOBAL_ASM( .text @@ -5041,111 +4625,53 @@ glabel sub_GAME_7F0B2110 - -#ifdef NONMATCHING -void sub_GAME_7F0B2194(s32 arg0, s32 arg1, void *arg2) { - // Node 0 - arg2->unkC = (s32) (arg2->unkC + 1); +s32 incrNearEdgeCount(struct StandTile** tileStack, s32 stackHeight, struct StandTileLocusCallbackRecord* data) { + data->nearEdgeCount += 1; return 1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2194 -/* 0E6CC4 7F0B2194 AFA40000 */ sw $a0, ($sp) -/* 0E6CC8 7F0B2198 AFA50004 */ sw $a1, 4($sp) -/* 0E6CCC 7F0B219C 8CCE000C */ lw $t6, 0xc($a2) -/* 0E6CD0 7F0B21A0 24020001 */ li $v0, 1 -/* 0E6CD4 7F0B21A4 25CF0001 */ addiu $t7, $t6, 1 -/* 0E6CD8 7F0B21A8 03E00008 */ jr $ra -/* 0E6CDC 7F0B21AC ACCF000C */ sw $t7, 0xc($a2) -) -#endif +s32 sub_GAME_7F0B21B0(struct StandTile **tileStack, float target_x, float target_z, float unknown, s32 *roomBuf, s32 *count_rtn, s32 bufMax){ + struct StandTileLocusCallbackRecord data; + s32 rtn; -#ifdef NONMATCHING -s32 sub_GAME_7F0B21B0(s32 arg1, ? arg2, ? arg3, ?32 arg4, void *arg5, ?32 arg6) { - ?32 sp30; - ?32 sp34; - ?32 sp38; - s32 sp3C; + data.roomBuf = roomBuf; + data.count = 0; + data.bufMax = bufMax; + data.nearEdgeCount = 0; - // Node 0 - sp34 = 0; - sp3C = 0; - sp30 = arg4; - sp38 = arg6; - *arg5 = sp34; - if (sp3C >= 2) - { - // Node 1 + rtn = sub_GAME_7F0B1DDC(tileStack, target_x, target_z, unknown, + sub_GAME_7F0B2110, 0x0, incrNearEdgeCount, &data + ); + + *count_rtn = data.count; + + if (1 < data.nearEdgeCount) { + return 2; } - // Node 2 - return sub_GAME_7F0B1DDC(arg1, arg2, arg1, arg2, &sub_GAME_7F0B2110, 0, &sub_GAME_7F0B2194, &sp30); + + return rtn; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B21B0 -/* 0E6CE0 7F0B21B0 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0E6CE4 7F0B21B4 44856000 */ mtc1 $a1, $f12 -/* 0E6CE8 7F0B21B8 44867000 */ mtc1 $a2, $f14 -/* 0E6CEC 7F0B21BC 8FAE0050 */ lw $t6, 0x50($sp) -/* 0E6CF0 7F0B21C0 8FAF0058 */ lw $t7, 0x58($sp) -/* 0E6CF4 7F0B21C4 3C187F0B */ lui $t8, %hi(sub_GAME_7F0B2110) # $t8, 0x7f0b -/* 0E6CF8 7F0B21C8 3C197F0B */ lui $t9, %hi(sub_GAME_7F0B2194) # $t9, 0x7f0b -/* 0E6CFC 7F0B21CC AFBF0024 */ sw $ra, 0x24($sp) -/* 0E6D00 7F0B21D0 27392194 */ addiu $t9, %lo(sub_GAME_7F0B2194) # addiu $t9, $t9, 0x2194 -/* 0E6D04 7F0B21D4 27182110 */ addiu $t8, %lo(sub_GAME_7F0B2110) # addiu $t8, $t8, 0x2110 -/* 0E6D08 7F0B21D8 27A80030 */ addiu $t0, $sp, 0x30 -/* 0E6D0C 7F0B21DC 44056000 */ mfc1 $a1, $f12 -/* 0E6D10 7F0B21E0 44067000 */ mfc1 $a2, $f14 -/* 0E6D14 7F0B21E4 AFA7004C */ sw $a3, 0x4c($sp) -/* 0E6D18 7F0B21E8 AFA00034 */ sw $zero, 0x34($sp) -/* 0E6D1C 7F0B21EC AFA0003C */ sw $zero, 0x3c($sp) -/* 0E6D20 7F0B21F0 AFA8001C */ sw $t0, 0x1c($sp) -/* 0E6D24 7F0B21F4 AFB80010 */ sw $t8, 0x10($sp) -/* 0E6D28 7F0B21F8 AFB90018 */ sw $t9, 0x18($sp) -/* 0E6D2C 7F0B21FC AFA00014 */ sw $zero, 0x14($sp) -/* 0E6D30 7F0B2200 AFAE0030 */ sw $t6, 0x30($sp) -/* 0E6D34 7F0B2204 0FC2C777 */ jal sub_GAME_7F0B1DDC -/* 0E6D38 7F0B2208 AFAF0038 */ sw $t7, 0x38($sp) -/* 0E6D3C 7F0B220C 8FA90034 */ lw $t1, 0x34($sp) -/* 0E6D40 7F0B2210 8FAA0054 */ lw $t2, 0x54($sp) -/* 0E6D44 7F0B2214 00401825 */ move $v1, $v0 -/* 0E6D48 7F0B2218 00601025 */ move $v0, $v1 -/* 0E6D4C 7F0B221C AD490000 */ sw $t1, ($t2) -/* 0E6D50 7F0B2220 8FAB003C */ lw $t3, 0x3c($sp) -/* 0E6D54 7F0B2224 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E6D58 7F0B2228 29610002 */ slti $at, $t3, 2 -/* 0E6D5C 7F0B222C 14200003 */ bnez $at, .L7F0B223C -/* 0E6D60 7F0B2230 00000000 */ nop -/* 0E6D64 7F0B2234 10000001 */ b .L7F0B223C -/* 0E6D68 7F0B2238 24020002 */ li $v0, 2 -.L7F0B223C: -/* 0E6D6C 7F0B223C 03E00008 */ jr $ra -/* 0E6D70 7F0B2240 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif #ifdef NONMATCHING -void sub_GAME_7F0B2244(void *arg0, void *arg1) { - // Node 0 - if ((*(&D_80040F30 + ((s32) arg0->unk4 >> 0xc)) & 2) != 0) + +// TODO +// s16 headerA : 4 gives just regalloc +s32 sub_GAME_7F0B2244(struct StandTile *tile, u8 *rtn) { + if (D_80040F30[tile->headerMid >> 0xC] & 2) { - // Node 1 - *arg1 = 1; + *rtn = 1; } - // Node 2 + return 0; } + #else GLOBAL_ASM( .text @@ -5169,8 +4695,8 @@ glabel sub_GAME_7F0B2244 - #ifdef NONMATCHING +// TODO void sub_GAME_7F0B2274(s32 arg0, s32 arg1, ? arg2, ? arg3, void *arg5) { void *temp_t7; void *temp_v1; @@ -5180,7 +4706,7 @@ void sub_GAME_7F0B2274(s32 arg0, s32 arg1, ? arg2, ? arg3, void *arg5) { if (((s32) temp_t7->unkE >> 4) != 0) { // Node 1 - temp_v1 = ((temp_t7->unkE * 8) + base_ptr_connection_vals); + temp_v1 = ((temp_t7->unkE * 8) + standTileStart); if ((*(&D_80040F30 + ((s32) temp_v1->unk4 >> 0xc)) & 2) != 0) { // Node 2 @@ -5208,11 +4734,11 @@ glabel sub_GAME_7F0B2274 /* 0E6DAC 7F0B227C AFA7000C */ sw $a3, 0xc($sp) /* 0E6DB0 7F0B2280 008E7821 */ addu $t7, $a0, $t6 /* 0E6DB4 7F0B2284 95E2000E */ lhu $v0, 0xe($t7) -/* 0E6DB8 7F0B2288 3C088004 */ lui $t0, %hi(base_ptr_connection_vals) +/* 0E6DB8 7F0B2288 3C088004 */ lui $t0, %hi(standTileStart) /* 0E6DBC 7F0B228C 0002C103 */ sra $t8, $v0, 4 /* 0E6DC0 7F0B2290 5300001E */ beql $t8, $zero, .L7F0B230C /* 0E6DC4 7F0B2294 00001025 */ move $v0, $zero -/* 0E6DC8 7F0B2298 8D080F58 */ lw $t0, %lo(base_ptr_connection_vals)($t0) +/* 0E6DC8 7F0B2298 8D080F58 */ lw $t0, %lo(standTileStart)($t0) /* 0E6DCC 7F0B229C 0002C8C0 */ sll $t9, $v0, 3 /* 0E6DD0 7F0B22A0 3C058004 */ lui $a1, %hi(D_80040F30) /* 0E6DD4 7F0B22A4 03281821 */ addu $v1, $t9, $t0 @@ -5256,6 +4782,8 @@ glabel sub_GAME_7F0B2274 #ifdef NONMATCHING +// I think they might have abused c a little here, which is what's led to the strange zero-ing. +// The use the struct (size 0x10) to just hold a bool. void sub_GAME_7F0B2314(s32 arg0, s32 arg1, ? arg2, ? arg3, void *arg4) { s32 temp_v1; void *phi_v0; @@ -5363,16 +4891,18 @@ glabel sub_GAME_7F0B23A4 #ifdef NONMATCHING -f32 sub_GAME_7F0B23AC(void *arg0, s32 arg1, void *arg2) { - void *temp_v0; +// regalloc only really +// Duplicating the macro does nothing +void sub_GAME_7F0B23AC(struct StandTile *tile, s32 tripleIndex, struct float3 *pnt) +{ + s32 pntIndex = STAN_TRIPLE_TO_PNT_INDEX(tile, tripleIndex); - // Node 0 - temp_v0 = (arg0 + ((((s32) arg0->unk6 >> (8 - (arg1 * 4))) & 0xf) * 8)); - *arg2 = (f32) ((f32) temp_v0->unk8 * D_80040F48); - arg2->unk4 = (f32) ((f32) temp_v0->unkA * D_80040F48); - arg2->unk8 = (f32) ((f32) temp_v0->unkC * D_80040F48); - return D_80040F48; + pnt->x = (float)tile->points[pntIndex].x * inv_level_scale; + pnt->y = (float)tile->points[pntIndex].y * inv_level_scale; + pnt->z = (float)tile->points[pntIndex].z * inv_level_scale; + return; } + #else GLOBAL_ASM( .text @@ -5386,8 +4916,8 @@ glabel sub_GAME_7F0B23AC /* 0E6EF4 7F0B23C4 000848C0 */ sll $t1, $t0, 3 /* 0E6EF8 7F0B23C8 00891021 */ addu $v0, $a0, $t1 /* 0E6EFC 7F0B23CC 844A0008 */ lh $t2, 8($v0) -/* 0E6F00 7F0B23D0 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E6F04 7F0B23D4 C4200F48 */ lwc1 $f0, %lo(D_80040F48)($at) +/* 0E6F00 7F0B23D0 3C018004 */ lui $at, %hi(inv_level_scale) +/* 0E6F04 7F0B23D4 C4200F48 */ lwc1 $f0, %lo(inv_level_scale)($at) /* 0E6F08 7F0B23D8 448A2000 */ mtc1 $t2, $f4 /* 0E6F0C 7F0B23DC 00000000 */ nop /* 0E6F10 7F0B23E0 468021A0 */ cvt.s.w $f6, $f4 @@ -5414,6 +4944,7 @@ glabel sub_GAME_7F0B23AC #ifdef NONMATCHING +// TODO void sub_GAME_7F0B2420(void) { } @@ -5442,10 +4973,10 @@ glabel sub_GAME_7F0B2420 /* 0E6F98 7F0B2468 00C0A825 */ move $s5, $a2 /* 0E6F9C 7F0B246C 1900005B */ blez $t0, .L7F0B25DC /* 0E6FA0 7F0B2470 00003825 */ move $a3, $zero -/* 0E6FA4 7F0B2474 3C048004 */ lui $a0, %hi(base_ptr_connection_vals) +/* 0E6FA4 7F0B2474 3C048004 */ lui $a0, %hi(standTileStart) /* 0E6FA8 7F0B2478 3C058004 */ lui $a1, %hi(D_80040F30) /* 0E6FAC 7F0B247C 24A50F30 */ addiu $a1, %lo(D_80040F30) # addiu $a1, $a1, 0xf30 -/* 0E6FB0 7F0B2480 8C840F58 */ lw $a0, %lo(base_ptr_connection_vals)($a0) +/* 0E6FB0 7F0B2480 8C840F58 */ lw $a0, %lo(standTileStart)($a0) /* 0E6FB4 7F0B2484 01201825 */ move $v1, $t1 .L7F0B2488: /* 0E6FB8 7F0B2488 9462000E */ lhu $v0, 0xe($v1) @@ -5560,20 +5091,22 @@ glabel sub_GAME_7F0B2420 #ifdef NONMATCHING -void sub_GAME_7F0B260C(void *arg0, s32 arg1, ? arg2, ? arg3, void *arg5) { - // Node 0 - if (*arg5 < (f32) (arg0 + (arg1 * 8))->unkA) - { - // Node 1 - if (*arg5 < (f32) (arg0 + (((s32) (arg1 + 1) % (s32) (((s32) arg0->unk6 >> 0xc) & 0xf)) * 8))->unkA) +// Tests do appear to be lts +s32 sub_GAME_7F0B260C(struct StandTile *tile, s32 index, float p_x,float p_z, void, float *rtn) +{ + s32 nextIndex; + + if (*rtn < (float)tile->points[index].y) { + if (*rtn < (float)tile->points[(index + 1) % STAN_POINT_COUNT(tile)].y) { - // Node 2 return 1; } } - // Node 3 - return 0; + else { + return 0; + } } + #else GLOBAL_ASM( .text @@ -5633,20 +5166,26 @@ glabel sub_GAME_7F0B260C #ifdef NONMATCHING -void sub_GAME_7F0B26B8(s32 arg1, ? arg2, ? arg3, f32 arg4) { - f32 sp2C; - - // Node 0 - sp2C = (f32) (arg4 * D_80040F44); - sub_GAME_7F0B1DDC(arg1, arg2, arg1, arg2, 0, &sub_GAME_7F0B260C, 0, &sp2C); +// We'll wait to decomp sub_GAME_7F0B260C properly, the reference to the float seems to be misbehaving and pointless. +void sub_GAME_7F0B26B8(struct StandTile **tile, float target_x, float target_z, float b_z, float param_5) +{ + float 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 + ); } + #else GLOBAL_ASM( .text glabel sub_GAME_7F0B26B8 /* 0E71E8 7F0B26B8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0E71EC 7F0B26BC 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E71F0 7F0B26C0 C4260F44 */ lwc1 $f6, %lo(D_80040F44)($at) +/* 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 @@ -5673,11 +5212,93 @@ glabel sub_GAME_7F0B26B8 - - #ifdef NONMATCHING -void sub_GAME_7F0B2718(void) { +// Horrifc BFS on tiles +struct StandTile* sub_GAME_7F0B2718(struct StandTile* srcTile, tilePredicate_t tilePred) +{ + struct StandTile* tile; + u32 i; + u32 pointCount; + s32 link; + struct StandTile* linkTile; + s32 countForIter; + + s32 pntI; + s32 seenCount; + s32 linkI; + s32 linkOffset; + s32 madeProgress; // bool + + // 0x44(sp) looks to be the ptr onto the stack + + // madeProgress = + if (tilePred(srcTile)) { + return srcTile; + } + + bfsTileStack[0] = srcTile; + seenCount = 1; + countForIter = seenCount; + + do { + // Loop over everyone for this iteration + for(pntI=0; pntI < countForIter; pntI++) + { + + tile = bfsTileStack[pntI]; + pointCount = STAN_POINT_COUNT(tile); + + // Loop over linked tiles + for (linkI = 0; linkI < pointCount; linkI++) + { + link = tile->points[linkI].link; + linkOffset = link * 8; // somehow it's doing this << 3 before testing the >> 4, but this isn't working. + + if (link >> 4 != 0) { + linkTile = (struct StandTile*)((s32)standTileStart + linkOffset); + + // Loop to see if this is a new tile (disgusting) + // If was a < and the while was a != though + for (i = 0; i < seenCount; i++) + { + if (bfsTileStack[i] == linkTile) { + goto LAB_7f0b283c; // continue named loop? + } + } + + if (tilePred(linkTile)) { + return linkTile; + } + + bfsTileStack[seenCount] = linkTile; + if (350 < seenCount + 1) { // as written + return 0; + } + + pointCount = STAN_POINT_COUNT(tile); + seenCount = seenCount + 1; + + } + + // they may also have needed something to put by the label + LAB_7f0b283c: linkI = linkI; + } + + } + + // We only continue if we made progress with this iteration + if (seenCount == countForIter){ + break; + } + + // does appear to be down here - two li,X,1s initially and a mov zero in the delay slot + countForIter = seenCount; + + } while (1); + + + return 0; } #else GLOBAL_ASM( @@ -5698,23 +5319,23 @@ glabel sub_GAME_7F0B2718 /* 0E7278 7F0B2748 00A0F809 */ jalr $a1 /* 0E727C 7F0B274C AFB00018 */ sw $s0, 0x18($sp) /* 0E7280 7F0B2750 10400003 */ beqz $v0, .L7F0B2760 -/* 0E7284 7F0B2754 3C018008 */ lui $at, %hi(dword_CODE_bss_8007BA10) +/* 0E7284 7F0B2754 3C018008 */ lui $at, %hi(bfsTileStack) /* 0E7288 7F0B2758 10000049 */ b .L7F0B2880 /* 0E728C 7F0B275C 02801025 */ move $v0, $s4 .L7F0B2760: /* 0E7290 7F0B2760 240E0001 */ li $t6, 1 -/* 0E7294 7F0B2764 3C178008 */ lui $s7, %hi(dword_CODE_bss_8007BA10) -/* 0E7298 7F0B2768 3C168004 */ lui $s6, %hi(base_ptr_connection_vals) -/* 0E729C 7F0B276C AC34BA10 */ sw $s4, %lo(dword_CODE_bss_8007BA10)($at) +/* 0E7294 7F0B2764 3C178008 */ lui $s7, %hi(bfsTileStack) +/* 0E7298 7F0B2768 3C168004 */ lui $s6, %hi(standTileStart) +/* 0E729C 7F0B276C AC34BA10 */ sw $s4, %lo(bfsTileStack)($at) /* 0E72A0 7F0B2770 24110001 */ li $s1, 1 -/* 0E72A4 7F0B2774 26D60F58 */ addiu $s6, %lo(base_ptr_connection_vals) # addiu $s6, $s6, 0xf58 -/* 0E72A8 7F0B2778 26F7BA10 */ addiu $s7, %lo(dword_CODE_bss_8007BA10) # addiu $s7, $s7, -0x45f0 +/* 0E72A4 7F0B2774 26D60F58 */ addiu $s6, %lo(standTileStart) # addiu $s6, $s6, 0xf58 +/* 0E72A8 7F0B2778 26F7BA10 */ addiu $s7, %lo(bfsTileStack) # addiu $s7, $s7, -0x45f0 /* 0E72AC 7F0B277C AFAE0058 */ sw $t6, 0x58($sp) /* 0E72B0 7F0B2780 0000F025 */ move $fp, $zero .L7F0B2784: /* 0E72B4 7F0B2784 1A200037 */ blez $s1, .L7F0B2864 -/* 0E72B8 7F0B2788 3C0F8008 */ lui $t7, %hi(dword_CODE_bss_8007BA10) -/* 0E72BC 7F0B278C 25EFBA10 */ addiu $t7, %lo(dword_CODE_bss_8007BA10) # addiu $t7, $t7, -0x45f0 +/* 0E72B8 7F0B2788 3C0F8008 */ lui $t7, %hi(bfsTileStack) +/* 0E72BC 7F0B278C 25EFBA10 */ addiu $t7, %lo(bfsTileStack) # addiu $t7, $t7, -0x45f0 /* 0E72C0 7F0B2790 AFAF0044 */ sw $t7, 0x44($sp) .L7F0B2794: /* 0E72C4 7F0B2794 8FB80044 */ lw $t8, 0x44($sp) @@ -5735,8 +5356,8 @@ glabel sub_GAME_7F0B2718 /* 0E72FC 7F0B27CC 012A8021 */ addu $s0, $t1, $t2 /* 0E7300 7F0B27D0 1A200009 */ blez $s1, .L7F0B27F8 /* 0E7304 7F0B27D4 00001025 */ move $v0, $zero -/* 0E7308 7F0B27D8 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007BA10) -/* 0E730C 7F0B27DC 2463BA10 */ addiu $v1, %lo(dword_CODE_bss_8007BA10) # addiu $v1, $v1, -0x45f0 +/* 0E7308 7F0B27D8 3C038008 */ lui $v1, %hi(bfsTileStack) +/* 0E730C 7F0B27DC 2463BA10 */ addiu $v1, %lo(bfsTileStack) # addiu $v1, $v1, -0x45f0 .L7F0B27E0: /* 0E7310 7F0B27E0 8C6C0000 */ lw $t4, ($v1) /* 0E7314 7F0B27E4 24420001 */ addiu $v0, $v0, 1 @@ -5805,112 +5426,44 @@ glabel sub_GAME_7F0B2718 -#ifdef NONMATCHING -void sub_GAME_7F0B28B0(void *arg0, void *arg1) { - s32 sp1C; +s32 getCollisionEdge_maybe(struct float3 *pntA, struct float3 *pntB) +{ + // The moral is that they prefer == 0 tests? - // Node 0 - sp1C = (s32) dword_CODE_bss_8007B9E4; - if (dword_CODE_bss_8007B9E4 != 0) - { - // Node 1 - sub_GAME_7F0B1CF8(dword_CODE_bss_8007B9E4, dword_CODE_bss_8007B9E8, arg0, arg1); - return 0; + if (stanSavedColl_tile) { + getTileEdgePoints(stanSavedColl_tile, stanSavedColl_pointI, pntA, pntB); + return 1; } - // Node 2 - if (D_800413BC == 0) - { - // Node 4 - // Node 5 - return 0; + else { + if (D_800413BC) { + pntA->x = stanSavedColl_pntA.x; + pntA->y = 0; + pntA->z = stanSavedColl_pntA.z; + + pntB->x = stanSavedColl_pntB.x; + pntB->y = 0; + pntB->z = stanSavedColl_pntB.z; + + return 1; + } + else { + return 0; + } } - // Node 3 - arg0->unk4 = 0.0f; - *arg0 = (f32) flt_CODE_bss_8007B9F0; - arg0->unk8 = (f32) flt_CODE_bss_8007B9F0.unk4; - arg1->unk4 = 0.0f; - *arg1 = (f32) flt_CODE_bss_8007B9F8; - arg1->unk8 = (f32) flt_CODE_bss_8007B9F8.unk4; - return 0; + } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B28B0 -/* 0E73E0 7F0B28B0 3C0E8008 */ lui $t6, %hi(dword_CODE_bss_8007B9E4) -/* 0E73E4 7F0B28B4 8DCEB9E4 */ lw $t6, %lo(dword_CODE_bss_8007B9E4)($t6) -/* 0E73E8 7F0B28B8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0E73EC 7F0B28BC AFBF0014 */ sw $ra, 0x14($sp) -/* 0E73F0 7F0B28C0 00803025 */ move $a2, $a0 -/* 0E73F4 7F0B28C4 00A03825 */ move $a3, $a1 -/* 0E73F8 7F0B28C8 11C00007 */ beqz $t6, .L7F0B28E8 -/* 0E73FC 7F0B28CC AFAE001C */ sw $t6, 0x1c($sp) -/* 0E7400 7F0B28D0 3C058008 */ lui $a1, %hi(dword_CODE_bss_8007B9E8) -/* 0E7404 7F0B28D4 8CA5B9E8 */ lw $a1, %lo(dword_CODE_bss_8007B9E8)($a1) -/* 0E7408 7F0B28D8 0FC2C73E */ jal sub_GAME_7F0B1CF8 -/* 0E740C 7F0B28DC 01C02025 */ move $a0, $t6 -/* 0E7410 7F0B28E0 10000017 */ b .L7F0B2940 -/* 0E7414 7F0B28E4 24020001 */ li $v0, 1 -.L7F0B28E8: -/* 0E7418 7F0B28E8 3C0F8004 */ lui $t7, %hi(D_800413BC) -/* 0E741C 7F0B28EC 8DEF13BC */ lw $t7, %lo(D_800413BC)($t7) -/* 0E7420 7F0B28F0 3C038008 */ lui $v1, %hi(flt_CODE_bss_8007B9F0) -/* 0E7424 7F0B28F4 2463B9F0 */ addiu $v1, %lo(flt_CODE_bss_8007B9F0) # addiu $v1, $v1, -0x4610 -/* 0E7428 7F0B28F8 51E00011 */ beql $t7, $zero, .L7F0B2940 -/* 0E742C 7F0B28FC 00001025 */ move $v0, $zero -/* 0E7430 7F0B2900 44800000 */ mtc1 $zero, $f0 -/* 0E7434 7F0B2904 C4640000 */ lwc1 $f4, ($v1) -/* 0E7438 7F0B2908 3C048008 */ lui $a0, %hi(flt_CODE_bss_8007B9F8) -/* 0E743C 7F0B290C E4C00004 */ swc1 $f0, 4($a2) -/* 0E7440 7F0B2910 E4C40000 */ swc1 $f4, ($a2) -/* 0E7444 7F0B2914 C4660004 */ lwc1 $f6, 4($v1) -/* 0E7448 7F0B2918 2484B9F8 */ addiu $a0, %lo(flt_CODE_bss_8007B9F8) # addiu $a0, $a0, -0x4608 -/* 0E744C 7F0B291C 24020001 */ li $v0, 1 -/* 0E7450 7F0B2920 E4C60008 */ swc1 $f6, 8($a2) -/* 0E7454 7F0B2924 C4880000 */ lwc1 $f8, ($a0) -/* 0E7458 7F0B2928 E4E00004 */ swc1 $f0, 4($a3) -/* 0E745C 7F0B292C E4E80000 */ swc1 $f8, ($a3) -/* 0E7460 7F0B2930 C48A0004 */ lwc1 $f10, 4($a0) -/* 0E7464 7F0B2934 10000002 */ b .L7F0B2940 -/* 0E7468 7F0B2938 E4EA0008 */ swc1 $f10, 8($a3) -/* 0E746C 7F0B293C 00001025 */ move $v0, $zero -.L7F0B2940: -/* 0E7470 7F0B2940 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E7474 7F0B2944 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0E7478 7F0B2948 03E00008 */ jr $ra -/* 0E747C 7F0B294C 00000000 */ nop -) -#endif - - -#ifdef NONMATCHING -void sub_GAME_7F0B2950(f32 arg0) { - // Node 0 - D_80040F44 = arg0; - D_80040F48 = (f32) (1.0f / arg0); +void setLevelScale(float ls) { + level_scale = ls; + inv_level_scale = (1.0f / ls); return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2950 -/* 0E7480 7F0B2950 3C018004 */ lui $at, %hi(D_80040F44) -/* 0E7484 7F0B2954 E42C0F44 */ swc1 $f12, %lo(D_80040F44)($at) -/* 0E7488 7F0B2958 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0E748C 7F0B295C 44812000 */ mtc1 $at, $f4 -/* 0E7490 7F0B2960 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E7494 7F0B2964 460C2183 */ div.s $f6, $f4, $f12 -/* 0E7498 7F0B2968 03E00008 */ jr $ra -/* 0E749C 7F0B296C E4260F48 */ swc1 $f6, %lo(D_80040F48)($at) -) -#endif - +float sub_GAME_7F0B2970(struct StandTile* tile, float p_x, float p_z); #ifdef NONMATCHING f32 sub_GAME_7F0B2970(void *arg0, s32 arg1, f32 arg2) { @@ -5958,7 +5511,7 @@ f32 sub_GAME_7F0B2970(void *arg0, s32 arg1, f32 arg2) { // Node 0 temp_a1 = ((s32) arg0->unk6 >> 8); temp_a2 = ((s32) arg0->unk6 >> 4); - arg2 = (f32) (arg2 * D_80040F44); + arg2 = (f32) (arg2 * level_scale); temp_s0 = (arg0 + ((temp_a1 & 0xf) * 8)); temp_v1 = (arg0 + ((temp_a2 & 0xf) * 8)); temp_a3 = (arg0->unk6 & 0xf); @@ -5974,7 +5527,7 @@ f32 sub_GAME_7F0B2970(void *arg0, s32 arg1, f32 arg2) { sp7C = temp_f4; temp_f10_2 = (f32) (temp_t0->unkC - temp_s0->unkC); sp80 = temp_f10_2; - temp_ret = __f_to_ll(((temp_f18 * temp_f10_2) - (temp_f4 * temp_f6)), (arg1 * D_80040F44), temp_a1, temp_a2, temp_a3); + temp_ret = __f_to_ll(((temp_f18 * temp_f10_2) - (temp_f4 * temp_f6)), (arg1 * level_scale), temp_a1, temp_a2, temp_a3); sp60 = temp_ret; sp64 = temp_ret; temp_ret_2 = __f_to_ll(((sp8C * temp_f10) - (sp80 * sp84))); @@ -6001,7 +5554,7 @@ f32 sub_GAME_7F0B2970(void *arg0, s32 arg1, f32 arg2) { sp28 = __ll_to_d(sp60, sp64); sp30 = __ll_to_d(sp58, sp5C); // Node 4 - return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * D_80040F48); + return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * inv_level_scale); } // Node 1 if (sp6C != 0) @@ -6011,18 +5564,18 @@ f32 sub_GAME_7F0B2970(void *arg0, s32 arg1, f32 arg2) { sp28 = __ll_to_d(sp60, sp64); sp30 = __ll_to_d(sp58, sp5C); // Node 4 - return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * D_80040F48); + return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * inv_level_scale); } // Node 2 - return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * D_80040F48); + return ((f32) (((sp30 - ((f64) arg1 * sp28)) - ((f64) arg2 * sp20)) / __ll_to_d(sp68, sp6C)) * inv_level_scale); } #else GLOBAL_ASM( .text glabel sub_GAME_7F0B2970 -/* 0E74A0 7F0B2970 3C018004 */ lui $at, %hi(D_80040F44) +/* 0E74A0 7F0B2970 3C018004 */ lui $at, %hi(level_scale) /* 0E74A4 7F0B2974 44857000 */ mtc1 $a1, $f14 -/* 0E74A8 7F0B2978 C4200F44 */ lwc1 $f0, %lo(D_80040F44)($at) +/* 0E74A8 7F0B2978 C4200F44 */ lwc1 $f0, %lo(level_scale)($at) /* 0E74AC 7F0B297C 27BDFF70 */ addiu $sp, $sp, -0x90 /* 0E74B0 7F0B2980 AFA60098 */ sw $a2, 0x98($sp) /* 0E74B4 7F0B2984 46007382 */ mul.s $f14, $f14, $f0 @@ -6150,8 +5703,8 @@ glabel sub_GAME_7F0B2970 /* 0E769C 7F0B2B6C 55E0000B */ bnezl $t7, .L7F0B2B9C /* 0E76A0 7F0B2B70 8FA40070 */ lw $a0, 0x70($sp) /* 0E76A4 7F0B2B74 8609000A */ lh $t1, 0xa($s0) -/* 0E76A8 7F0B2B78 3C018004 */ lui $at, %hi(D_80040F48) -/* 0E76AC 7F0B2B7C C4300F48 */ lwc1 $f16, %lo(D_80040F48)($at) +/* 0E76A8 7F0B2B78 3C018004 */ lui $at, %hi(inv_level_scale) +/* 0E76AC 7F0B2B7C C4300F48 */ lwc1 $f16, %lo(inv_level_scale)($at) /* 0E76B0 7F0B2B80 44899000 */ mtc1 $t1, $f18 /* 0E76B4 7F0B2B84 00000000 */ nop /* 0E76B8 7F0B2B88 468092A0 */ cvt.s.w $f10, $f18 @@ -6183,10 +5736,10 @@ glabel sub_GAME_7F0B2970 /* 0E7718 7F0B2BE8 46283482 */ mul.d $f18, $f6, $f8 /* 0E771C 7F0B2BEC 46005421 */ cvt.d.s $f16, $f10 /* 0E7720 7F0B2BF0 D7AC0030 */ ldc1 $f12, 0x30($sp) -/* 0E7724 7F0B2BF4 3C018004 */ lui $at, %hi(D_80040F48) +/* 0E7724 7F0B2BF4 3C018004 */ lui $at, %hi(inv_level_scale) /* 0E7728 7F0B2BF8 46228102 */ mul.d $f4, $f16, $f2 /* 0E772C 7F0B2BFC 46246181 */ sub.d $f6, $f12, $f4 -/* 0E7730 7F0B2C00 C4240F48 */ lwc1 $f4, %lo(D_80040F48)($at) +/* 0E7730 7F0B2C00 C4240F48 */ lwc1 $f4, %lo(inv_level_scale)($at) /* 0E7734 7F0B2C04 46323201 */ sub.d $f8, $f6, $f18 /* 0E7738 7F0B2C08 46204283 */ div.d $f10, $f8, $f0 /* 0E773C 7F0B2C0C 46205420 */ cvt.s.d $f16, $f10 @@ -6206,21 +5759,22 @@ glabel sub_GAME_7F0B2970 #ifdef NONMATCHING -s32 copy_tile_RGB_as_24bit(void *arg0, s32 arg1, ? arg2, void *arg3) { - s32 temp_v0; - s32 temp_t7; - s32 temp_t9; - s32 temp_t3; - // Node 0 - temp_v0 = ((s32) arg0->unk4 >> 8); - temp_t7 = (temp_v0 & 0xf); - temp_t9 = (((s32) arg0->unk4 >> 4) & 0xf); - temp_t3 = (arg0->unk4 & 0xf); - *arg3 = (s8) ((temp_t7 * 0x10) | temp_t7); - arg3->unk1 = (s8) ((temp_t9 * 0x10) | temp_t9); - arg3->unk2 = (s8) ((temp_t3 * 0x10) | temp_t3); - return temp_v0; +// Some instructions misordered +s32 copy_tile_RGB_as_24bit(struct StandTile* tile, float p_x, float p_z, u8* rtn) { + + u8 B; + u8 C; + u8 D; + + B = tile->headerMid >> 0x8 & 0xF; + C = tile->headerMid >> 0x4 & 0xF; + D = tile->headerMid & 0xF; + + rtn[0] = (B << 4) | B; + rtn[1] = (C << 4) | C; + rtn[2] = (D << 4) | D; + } #else GLOBAL_ASM( @@ -6249,51 +5803,33 @@ glabel copy_tile_RGB_as_24bit - +float sub_GAME_7F0B2C74(struct StandTile *tile, float *heights); #ifdef NONMATCHING -f32 sub_GAME_7F0B2C74(void *arg0, void *arg1) { - f32 temp_f2; - f32 phi_f16; - f32 phi_f2; - // Node 0 - temp_f2 = (f32) (arg0 + ((((s32) arg0->unk6 >> 8) & 0xf) * 8))->unkA; - if (temp_f2 < temp_f2) - { - // Node 1 - } - // Node 2 - phi_f16 = temp_f2; - if (temp_f2 < temp_f2) - { - // Node 3 - phi_f16 = temp_f2; - } - // Node 4 - if (temp_f2 < temp_f2) - { - // Node 5 - } - // Node 6 - phi_f2 = temp_f2; - if (temp_f2 < temp_f2) - { - // Node 7 - phi_f2 = temp_f2; - } - // Node 8 - *arg1 = (f32) (phi_f16 * D_80040F48); - arg1->unk4 = (f32) (phi_f2 * D_80040F48); - return temp_f2; +// Very interesting. The target has a load of filler crap including instructions like "c.lt.S f2,f2" +// Presumably something has been generated from a macro but using the fixed value 0 + +float sub_GAME_7F0B2C74(struct StandTile *tile, float *heights) +{ + float y; + + y = tile->points[STAN_TRIPLE_TO_PNT_INDEX(tile, 0)].y; + + heights[0] = y * inv_level_scale; + heights[1] = y * inv_level_scale; + + return; + } + #else GLOBAL_ASM( .text glabel sub_GAME_7F0B2C74 /* 0E77A4 7F0B2C74 848E0006 */ lh $t6, 6($a0) -/* 0E77A8 7F0B2C78 3C028004 */ lui $v0, %hi(D_80040F48) -/* 0E77AC 7F0B2C7C 24420F48 */ addiu $v0, %lo(D_80040F48) # addiu $v0, $v0, 0xf48 +/* 0E77A8 7F0B2C78 3C028004 */ lui $v0, %hi(inv_level_scale) +/* 0E77AC 7F0B2C7C 24420F48 */ addiu $v0, %lo(inv_level_scale) # addiu $v0, $v0, 0xf48 /* 0E77B0 7F0B2C80 000E7A03 */ sra $t7, $t6, 8 /* 0E77B4 7F0B2C84 31F8000F */ andi $t8, $t7, 0xf /* 0E77B8 7F0B2C88 0018C8C0 */ sll $t9, $t8, 3 @@ -6341,31 +5877,12 @@ glabel sub_GAME_7F0B2C74 +float sub_GAME_7F0B2D14(struct StandTile* tile) { + float vs[2]; -#ifdef NONMATCHING -void sub_GAME_7F0B2D14(void) { - ? sp18; - - // Node 0 - sub_GAME_7F0B2C74(&sp18); - return sp18; + sub_GAME_7F0B2C74(tile, vs); + return vs[0]; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2D14 -/* 0E7844 7F0B2D14 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0E7848 7F0B2D18 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E784C 7F0B2D1C 0FC2CB1D */ jal sub_GAME_7F0B2C74 -/* 0E7850 7F0B2D20 27A50018 */ addiu $a1, $sp, 0x18 -/* 0E7854 7F0B2D24 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E7858 7F0B2D28 C7A00018 */ lwc1 $f0, 0x18($sp) -/* 0E785C 7F0B2D2C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0E7860 7F0B2D30 03E00008 */ jr $ra -/* 0E7864 7F0B2D34 00000000 */ nop -) -#endif - @@ -6581,6 +6098,7 @@ glabel stanConvertNameStringToS32 #ifdef NONMATCHING +// TODO void stanMatchTileName(void) { } @@ -6599,8 +6117,8 @@ glabel stanMatchTileName .L7F0B2E78: /* 0E79A8 7F0B2E78 0FC2CB54 */ jal stanConvertNameStringToS32 /* 0E79AC 7F0B2E7C 27A60021 */ addiu $a2, $sp, 0x21 -/* 0E79B0 7F0B2E80 3C0F8008 */ lui $t7, %hi(clippingfile) -/* 0E79B4 7F0B2E84 8DEFB120 */ lw $t7, %lo(clippingfile)($t7) +/* 0E79B0 7F0B2E80 3C0F8008 */ lui $t7, %hi(stan_prefix) +/* 0E79B4 7F0B2E84 8DEFB120 */ lw $t7, %lo(stan_prefix)($t7) /* 0E79B8 7F0B2E88 3C058004 */ lui $a1, %hi(list_of_tilesizes) /* 0E79BC 7F0B2E8C 24A50F4C */ addiu $a1, %lo(list_of_tilesizes) # addiu $a1, $a1, 0xf4c /* 0E79C0 7F0B2E90 8DE30004 */ lw $v1, 4($t7) @@ -6673,6 +6191,7 @@ glabel sub_GAME_7F0B2F00 #ifdef NONMATCHING +// To try void *stanDetermineEOF(void *arg0, s32 arg1, s32 arg2) { s32 temp_v0; void *temp_a3; @@ -6686,9 +6205,9 @@ void *stanDetermineEOF(void *arg0, s32 arg1, s32 arg2) { void *phi_v0; // Node 0 - clippingfile = arg0; + stan_prefix.clippingfile = arg0; temp_v0 = (arg2 - arg1); - base_ptr_connection_vals = (s32) ((arg0->unk4 + temp_v0) + -0x80); + standTileStart = (s32) ((arg0->unk4 + temp_v0) + -0x80); ptr_firstroom_0 = (s32) (arg0->unk4 + temp_v0); temp_a3 = (arg0 + 4); phi_a3_2 = temp_a3; @@ -6726,22 +6245,22 @@ loop_4: } } // Node 5 - clippingfile = arg0; + stan_prefix.clippingfile = arg0; return temp_v0_2; } #else GLOBAL_ASM( .text glabel stanDetermineEOF -/* 0E7A5C 7F0B2F2C 3C088008 */ lui $t0, %hi(clippingfile) -/* 0E7A60 7F0B2F30 2508B120 */ addiu $t0, %lo(clippingfile) # addiu $t0, $t0, -0x4ee0 +/* 0E7A5C 7F0B2F2C 3C088008 */ lui $t0, %hi(stan_prefix) +/* 0E7A60 7F0B2F30 2508B120 */ addiu $t0, %lo(stan_prefix) # addiu $t0, $t0, -0x4ee0 /* 0E7A64 7F0B2F34 AD040000 */ sw $a0, ($t0) /* 0E7A68 7F0B2F38 8C8E0004 */ lw $t6, 4($a0) /* 0E7A6C 7F0B2F3C 00C51023 */ subu $v0, $a2, $a1 -/* 0E7A70 7F0B2F40 3C018004 */ lui $at, %hi(base_ptr_connection_vals) +/* 0E7A70 7F0B2F40 3C018004 */ lui $at, %hi(standTileStart) /* 0E7A74 7F0B2F44 01C27821 */ addu $t7, $t6, $v0 /* 0E7A78 7F0B2F48 25F8FF80 */ addiu $t8, $t7, -0x80 -/* 0E7A7C 7F0B2F4C AC380F58 */ sw $t8, %lo(base_ptr_connection_vals)($at) +/* 0E7A7C 7F0B2F4C AC380F58 */ sw $t8, %lo(standTileStart)($at) /* 0E7A80 7F0B2F50 8C990004 */ lw $t9, 4($a0) /* 0E7A84 7F0B2F54 3C018004 */ lui $at, %hi(ptr_firstroom_0) /* 0E7A88 7F0B2F58 3C068004 */ lui $a2, %hi(list_of_tilesizes) @@ -6785,68 +6304,29 @@ glabel stanDetermineEOF - - -#ifdef NONMATCHING -s32 sub_GAME_7F0B2FD8(void *arg0) { - return arg0->unk3; +u8 getTileRoom(struct StandTile* tile) { + return tile->room; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2FD8 -/* 0E7B08 7F0B2FD8 03E00008 */ jr $ra -/* 0E7B0C 7F0B2FDC 90820003 */ lbu $v0, 3($a0) -) -#endif +s32 sub_GAME_7F0B2FE0(struct StandTile* tile) { + // u8 -> s32 -> u8 causes the odd asm -#ifdef NONMATCHING -void sub_GAME_7F0B2FE0(void *arg0) { - sub_GAME_7F0B4F9C(arg0->unk3); + s32 room = tile->room; + + return sub_GAME_7F0B4F9C(room); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2FE0 -/* 0E7B10 7F0B2FE0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E7B14 7F0B2FE4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E7B18 7F0B2FE8 90820003 */ lbu $v0, 3($a0) -/* 0E7B1C 7F0B2FEC 0FC2D3E7 */ jal sub_GAME_7F0B4F9C -/* 0E7B20 7F0B2FF0 00402025 */ move $a0, $v0 -/* 0E7B24 7F0B2FF4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E7B28 7F0B2FF8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E7B2C 7F0B2FFC 03E00008 */ jr $ra -/* 0E7B30 7F0B3000 00000000 */ nop -) -#endif -#ifdef NONMATCHING -void sub_GAME_7F0B3004(void) { - sub_GAME_7F0B2D14(); +float sub_GAME_7F0B3004(struct StandTile* tile) { + return sub_GAME_7F0B2D14(tile); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B3004 -/* 0E7B34 7F0B3004 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E7B38 7F0B3008 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E7B3C 7F0B300C 0FC2CB45 */ jal sub_GAME_7F0B2D14 -/* 0E7B40 7F0B3010 00000000 */ nop -/* 0E7B44 7F0B3014 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E7B48 7F0B3018 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E7B4C 7F0B301C 03E00008 */ jr $ra -/* 0E7B50 7F0B3020 00000000 */ nop -) -#endif @@ -6983,9 +6463,12 @@ glabel sub_GAME_7F0B312C #ifdef NONMATCHING -void sub_GAME_7F0B3138(s32 arg0, s32 arg1, ? arg2, ? arg3, ? arg4, f32 arg5, ?32 arg6, f32 arg7, f32 arg8) { - // Node 0 - return sub_GAME_7F0B0E24(arg2, arg3, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, 0.0f, 1.0f); +// Only difference is an extra sw a1,0x34(sp) appearing. +// There is the unused first argument which may have the wrong type +int sub_GAME_7F0B3138(void* unused, struct StandTile **pTile, float p_x, float p_z, float dest_x, float dest_z, + int objFlags, float unkHeight, float unkA) { + + return sub_GAME_7F0B0E24(pTile, p_x, p_z, dest_x, dest_z, objFlags, unkHeight, unkA, 0, 1); } #else GLOBAL_ASM( diff --git a/src/game/stan.h b/src/game/stan.h index f758b23e..78db3787 100644 --- a/src/game/stan.h +++ b/src/game/stan.h @@ -2,6 +2,65 @@ #define _STAN_H_ #include "ultra64.h" + +struct StandTilePoint { + s16 x; + s16 y; + s16 z; + u16 link; +}; + +struct StandTileHeaderTail { + s16 pointCount : 4; // seen lh, not lhu. Also seen with an explicit unnecessary '& 0xF' + s16 headerC : 4; + s16 headerD : 4; + s16 headerE : 4; +}; + +struct StandTile { + u16 name1; + u8 name2; + u8 room; // compared to 0xFF, not -1 in a function. Seen LBUs. + s16 headerMid; + + /* 0x06 */ + // They appear to have performed the bit field work themselves here, + // but we provide the StandTileHeaderTail member for clarity - it should be unused I believe. + s16 hdrTail; + + /* 0x08 */ + struct StandTilePoint points[1]; +}; + +// RGB? I've called them 'triple' because I don't really know what RGB is +// No parens around params +#define STAN_TRIPLE_TO_PNT_INDEX(tile, tripleIndex) (tile->hdrTail >> (8 - 4*tripleIndex) & 0xF) +#define STAN_POINT_COUNT(tile) (tile->hdrTail >> 0xC & 0xF) + +// May be internal only, nice here. +struct StandTileWalkCallbackRecord { + s32 * roomBuf; + s32 count; + s32 bufMax; + s32 lastRoom; +}; +typedef void (*standTileWalkCallback_t)(struct StandTile*, struct StandTile*, struct StandTileWalkCallbackRecord*); +// Necessary forward declaration +void noteTileRoomIfDifferentToPrev(struct StandTile *tile, struct StandTile *unused, struct StandTileWalkCallbackRecord *data); + +// Very similar but definitely different to the above? +struct StandTileLocusCallbackRecord { + s32 * roomBuf; + s32 count; + s32 bufMax; + s32 nearEdgeCount; +}; +typedef s32 (*standTileLocusCallback_A_t)(struct StandTile*, struct StandTileLocusCallbackRecord*); +typedef s32 (*standTileLocusCallback_B_t)(struct StandTile*, s32, float, float, void, float*); // 5th parameter uncertain +typedef s32 (*standTileLocusCallback_C_t)(struct StandTile**, s32, struct StandTileLocusCallbackRecord*); + +typedef s32 (*tilePredicate_t)(struct StandTile*); + void stanInitDebugNoticeList(void); #endif diff --git a/src/game/unk_007980.c b/src/game/unk_007980.c index 31558a55..27166756 100644 --- a/src/game/unk_007980.c +++ b/src/game/unk_007980.c @@ -16,12 +16,12 @@ void cleanupplayersoundrelated(void) { ? phi_return; // Node 0 - temp_ret = get_num_players(); + temp_ret = getPlayerCount(); phi_return = temp_ret; if (temp_ret > 0) { // Node 1 - phi_s2 = ((0 * 4) + &ptr_BONDdata_p1); + phi_s2 = ((0 * 4) + &players); phi_s4 = 0; loop_2: // Node 2 @@ -47,7 +47,7 @@ loop_3: } // Node 7 temp_s4 = (phi_s4 + 1); - temp_ret_2 = get_num_players(); + temp_ret_2 = getPlayerCount(); phi_s2 = (phi_s2 + 4); phi_s4 = temp_s4; phi_return = temp_ret_2; @@ -71,12 +71,12 @@ glabel cleanupplayersoundrelated /* 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 get_num_players +/* 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(ptr_BONDdata_p1) -/* 03C4E0 7F0079B0 25EF9EE0 */ addiu $t7, %lo(ptr_BONDdata_p1) # addiu $t7, $t7, -0x6120 +/* 03C4DC 7F0079AC 3C0F8008 */ lui $t7, %hi(players) +/* 03C4E0 7F0079B0 25EF9EE0 */ addiu $t7, %lo(players) # addiu $t7, $t7, -0x6120 /* 03C4E4 7F0079B4 01CF9021 */ addu $s2, $t6, $t7 /* 03C4E8 7F0079B8 24130750 */ li $s3, 1872 /* 03C4EC 7F0079BC 00008825 */ move $s1, $zero @@ -99,7 +99,7 @@ glabel cleanupplayersoundrelated /* 03C524 7F0079F4 5633FFF3 */ bnel $s1, $s3, .L7F0079C4 /* 03C528 7F0079F8 8E580000 */ lw $t8, ($s2) /* 03C52C 7F0079FC 26940001 */ addiu $s4, $s4, 1 -/* 03C530 7F007A00 0FC26919 */ jal get_num_players +/* 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 diff --git a/src/game/unk_08DBB0.c b/src/game/unk_08DBB0.c index 96a979d7..a20d0246 100644 --- a/src/game/unk_08DBB0.c +++ b/src/game/unk_08DBB0.c @@ -1,6 +1,7 @@ #include "ultra64.h" #include "game/lvl.h" #include "game/unk_093880.h" +#include "game/chrai.h" // data //D:80036AD0 @@ -60,388 +61,98 @@ u32 D_80036B6C = 0; // rodata +void currentPlayerToggle5BC() { + pPlayer->field_5BC = !pPlayer->field_5BC; +} +u32 get_random_value(); +#define U32_MAX 4294967295 +void currentPlayerUpdateIdleHeadRoll() { + f32 mult = 1.0f / U32_MAX; -#ifdef NONMATCHING// -void sub_GAME_7F08DBB0(void) + pPlayer->standlook[pPlayer->standcnt][0] = ((f32)get_random_value() * mult - 0.5f) * 0.02f; + pPlayer->standlook[pPlayer->standcnt][2] = 1; + pPlayer->standup[pPlayer->standcnt][0] = ((f32)get_random_value() * mult - 0.5f) * 0.02f; + pPlayer->standup[pPlayer->standcnt][1] = 1; + + if (pPlayer->standcnt) { + pPlayer->standlook[pPlayer->standcnt][1] = (f32)get_random_value() * mult * 0.01f; + pPlayer->standup[pPlayer->standcnt][2] = (f32)get_random_value() * mult * -0.01f; + } else { + pPlayer->standlook[pPlayer->standcnt][1] = (f32)get_random_value() * mult * -0.01f; + pPlayer->standup[pPlayer->standcnt][2] = (f32)get_random_value() * mult * 0.01f; + } + + pPlayer->standcnt = 1 - pPlayer->standcnt; +} + +void currentPlayerUpdateHeadPos(vec3 vel) { + s32 i; + + if (pPlayer->resetheadpos) { + pPlayer->headpossum[0] = 0.0f; + pPlayer->headpossum[1] = (vel[1] / (1.0f - 0.93f)); + pPlayer->headpossum[2] = 0.0f; + + pPlayer->resetheadpos = FALSE; + } + + for (i = 0; i < clock_timer; i++) { + pPlayer->headpossum[0] = ((0.93f * pPlayer->headpossum[0]) + vel[0]); + pPlayer->headpossum[1] = ((0.93f * pPlayer->headpossum[1]) + vel[1]); + pPlayer->headpossum[2] = ((0.93f * pPlayer->headpossum[2]) + vel[2]); + } + + pPlayer->headpos[0] = (pPlayer->headpossum[0] * (1.0f - 0.93f)); + pPlayer->headpos[1] = (pPlayer->headpossum[1] * (1.0f - 0.93f)); + pPlayer->headpos[2] = (pPlayer->headpossum[2] * (1.0f - 0.93f)); +} + +void currentPlayerUpdateHeadRot(vec3 lookvel, vec3 upvel) { - pPlayer->field_5BC = (pPlayer->field_5BC == 0); + s32 i; + + if (pPlayer->resetheadrot) { + pPlayer->headlooksum[0] = lookvel[0] / (1.0f - pPlayer->headdamp); + pPlayer->headlooksum[1] = lookvel[1] / (1.0f - pPlayer->headdamp); + pPlayer->headlooksum[2] = lookvel[2] / (1.0f - pPlayer->headdamp); + pPlayer->headupsum[0] = upvel[0] / (1.0f - pPlayer->headdamp); + pPlayer->headupsum[1] = upvel[1] / (1.0f - pPlayer->headdamp); + pPlayer->headupsum[2] = upvel[2] / (1.0f - pPlayer->headdamp); + + pPlayer->resetheadrot = FALSE; + } + + for (i = 0; i < clock_timer; i++) { + pPlayer->headlooksum[0] = pPlayer->headdamp * pPlayer->headlooksum[0] + lookvel[0]; + pPlayer->headlooksum[1] = pPlayer->headdamp * pPlayer->headlooksum[1] + lookvel[1]; + pPlayer->headlooksum[2] = pPlayer->headdamp * pPlayer->headlooksum[2] + lookvel[2]; + pPlayer->headupsum[0] = pPlayer->headdamp * pPlayer->headupsum[0] + upvel[0]; + pPlayer->headupsum[1] = pPlayer->headdamp * pPlayer->headupsum[1] + upvel[1]; + pPlayer->headupsum[2] = pPlayer->headdamp * pPlayer->headupsum[2] + upvel[2]; + } + + pPlayer->headlook[0] = pPlayer->headlooksum[0] * (1.0f - pPlayer->headdamp); + pPlayer->headlook[1] = pPlayer->headlooksum[1] * (1.0f - pPlayer->headdamp); + pPlayer->headlook[2] = pPlayer->headlooksum[2] * (1.0f - pPlayer->headdamp); + pPlayer->headup[0] = pPlayer->headupsum[0] * (1.0f - pPlayer->headdamp); + pPlayer->headup[1] = pPlayer->headupsum[1] * (1.0f - pPlayer->headdamp); + pPlayer->headup[2] = pPlayer->headupsum[2] * (1.0f - pPlayer->headdamp); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08DBB0 -/* 0C26E0 7F08DBB0 3C038008 */ lui $v1, %hi(pPlayer) -/* 0C26E4 7F08DBB4 8C63A0B0 */ lw $v1, %lo(pPlayer)($v1) -/* 0C26E8 7F08DBB8 806205BC */ lb $v0, 0x5bc($v1) -/* 0C26EC 7F08DBBC 2C4E0001 */ sltiu $t6, $v0, 1 -/* 0C26F0 7F08DBC0 03E00008 */ jr $ra -/* 0C26F4 7F08DBC4 A06E05BC */ sb $t6, 0x5bc($v1) -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F08DBC8(void) { - -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_800552E0 -.word 0x3ca3d70a /*0.02*/ -glabel D_800552E4 -.word 0x3ca3d70a /*0.02*/ -glabel D_800552E8 -.word 0x3c23d70a /*0.0099999998*/ -glabel D_800552EC -.word 0xbc23d70a /*-0.0099999998*/ -glabel D_800552F0 -.word 0xbc23d70a /*-0.0099999998*/ -glabel D_800552F4 -.word 0x3c23d70a /*0.0099999998*/ -.text -glabel sub_GAME_7F08DBC8 -/* 0C26F8 7F08DBC8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0C26FC 7F08DBCC AFBF002C */ sw $ra, 0x2c($sp) -/* 0C2700 7F08DBD0 AFB20028 */ sw $s2, 0x28($sp) -/* 0C2704 7F08DBD4 AFB10024 */ sw $s1, 0x24($sp) -/* 0C2708 7F08DBD8 AFB00020 */ sw $s0, 0x20($sp) -/* 0C270C 7F08DBDC 0C002914 */ jal get_random_value -/* 0C2710 7F08DBE0 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0C2714 7F08DBE4 44822000 */ mtc1 $v0, $f4 -/* 0C2718 7F08DBE8 3C118008 */ lui $s1, %hi(pPlayer) -/* 0C271C 7F08DBEC 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0C2720 7F08DBF0 4481A000 */ mtc1 $at, $f20 -/* 0C2724 7F08DBF4 2631A0B0 */ addiu $s1, %lo(pPlayer) # addiu $s1, $s1, -0x5f50 -/* 0C2728 7F08DBF8 8E300000 */ lw $s0, ($s1) -/* 0C272C 7F08DBFC 2412000C */ li $s2, 12 -/* 0C2730 7F08DC00 04410005 */ bgez $v0, .L7F08DC18 -/* 0C2734 7F08DC04 468021A0 */ cvt.s.w $f6, $f4 -/* 0C2738 7F08DC08 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C273C 7F08DC0C 44814000 */ mtc1 $at, $f8 -/* 0C2740 7F08DC10 00000000 */ nop -/* 0C2744 7F08DC14 46083180 */ add.s $f6, $f6, $f8 -.L7F08DC18: -/* 0C2748 7F08DC18 46143282 */ mul.s $f10, $f6, $f20 -/* 0C274C 7F08DC1C 8E0E0594 */ lw $t6, 0x594($s0) -/* 0C2750 7F08DC20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0C2754 7F08DC24 44818000 */ mtc1 $at, $f16 -/* 0C2758 7F08DC28 01D20019 */ multu $t6, $s2 -/* 0C275C 7F08DC2C 3C018005 */ lui $at, %hi(D_800552E0) -/* 0C2760 7F08DC30 C42452E0 */ lwc1 $f4, %lo(D_800552E0)($at) -/* 0C2764 7F08DC34 46105481 */ sub.s $f18, $f10, $f16 -/* 0C2768 7F08DC38 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C276C 7F08DC3C 44813000 */ mtc1 $at, $f6 -/* 0C2770 7F08DC40 46049202 */ mul.s $f8, $f18, $f4 -/* 0C2774 7F08DC44 00007812 */ mflo $t7 -/* 0C2778 7F08DC48 020FC021 */ addu $t8, $s0, $t7 -/* 0C277C 7F08DC4C E7080564 */ swc1 $f8, 0x564($t8) -/* 0C2780 7F08DC50 8E300000 */ lw $s0, ($s1) -/* 0C2784 7F08DC54 8E190594 */ lw $t9, 0x594($s0) -/* 0C2788 7F08DC58 03320019 */ multu $t9, $s2 -/* 0C278C 7F08DC5C 00004012 */ mflo $t0 -/* 0C2790 7F08DC60 02084821 */ addu $t1, $s0, $t0 -/* 0C2794 7F08DC64 0C002914 */ jal get_random_value -/* 0C2798 7F08DC68 E526056C */ swc1 $f6, 0x56c($t1) -/* 0C279C 7F08DC6C 44825000 */ mtc1 $v0, $f10 -/* 0C27A0 7F08DC70 8E300000 */ lw $s0, ($s1) -/* 0C27A4 7F08DC74 04410005 */ bgez $v0, .L7F08DC8C -/* 0C27A8 7F08DC78 46805420 */ cvt.s.w $f16, $f10 -/* 0C27AC 7F08DC7C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C27B0 7F08DC80 44819000 */ mtc1 $at, $f18 -/* 0C27B4 7F08DC84 00000000 */ nop -/* 0C27B8 7F08DC88 46128400 */ add.s $f16, $f16, $f18 -.L7F08DC8C: -/* 0C27BC 7F08DC8C 46148102 */ mul.s $f4, $f16, $f20 -/* 0C27C0 7F08DC90 8E0A0594 */ lw $t2, 0x594($s0) -/* 0C27C4 7F08DC94 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0C27C8 7F08DC98 44814000 */ mtc1 $at, $f8 -/* 0C27CC 7F08DC9C 01520019 */ multu $t2, $s2 -/* 0C27D0 7F08DCA0 3C018005 */ lui $at, %hi(D_800552E4) -/* 0C27D4 7F08DCA4 C42A52E4 */ lwc1 $f10, %lo(D_800552E4)($at) -/* 0C27D8 7F08DCA8 46082181 */ sub.s $f6, $f4, $f8 -/* 0C27DC 7F08DCAC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0C27E0 7F08DCB0 44818000 */ mtc1 $at, $f16 -/* 0C27E4 7F08DCB4 460A3482 */ mul.s $f18, $f6, $f10 -/* 0C27E8 7F08DCB8 00005812 */ mflo $t3 -/* 0C27EC 7F08DCBC 020B6021 */ addu $t4, $s0, $t3 -/* 0C27F0 7F08DCC0 E592057C */ swc1 $f18, 0x57c($t4) -/* 0C27F4 7F08DCC4 8E300000 */ lw $s0, ($s1) -/* 0C27F8 7F08DCC8 8E0D0594 */ lw $t5, 0x594($s0) -/* 0C27FC 7F08DCCC 01B20019 */ multu $t5, $s2 -/* 0C2800 7F08DCD0 00007012 */ mflo $t6 -/* 0C2804 7F08DCD4 020E7821 */ addu $t7, $s0, $t6 -/* 0C2808 7F08DCD8 E5F00580 */ swc1 $f16, 0x580($t7) -/* 0C280C 7F08DCDC 8E380000 */ lw $t8, ($s1) -/* 0C2810 7F08DCE0 8F190594 */ lw $t9, 0x594($t8) -/* 0C2814 7F08DCE4 13200027 */ beqz $t9, .L7F08DD84 -/* 0C2818 7F08DCE8 00000000 */ nop -/* 0C281C 7F08DCEC 0C002914 */ jal get_random_value -/* 0C2820 7F08DCF0 00000000 */ nop -/* 0C2824 7F08DCF4 44822000 */ mtc1 $v0, $f4 -/* 0C2828 7F08DCF8 8E300000 */ lw $s0, ($s1) -/* 0C282C 7F08DCFC 04410005 */ bgez $v0, .L7F08DD14 -/* 0C2830 7F08DD00 46802220 */ cvt.s.w $f8, $f4 -/* 0C2834 7F08DD04 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C2838 7F08DD08 44813000 */ mtc1 $at, $f6 -/* 0C283C 7F08DD0C 00000000 */ nop -/* 0C2840 7F08DD10 46064200 */ add.s $f8, $f8, $f6 -.L7F08DD14: -/* 0C2844 7F08DD14 8E080594 */ lw $t0, 0x594($s0) -/* 0C2848 7F08DD18 46144282 */ mul.s $f10, $f8, $f20 -/* 0C284C 7F08DD1C 3C018005 */ lui $at, %hi(D_800552E8) -/* 0C2850 7F08DD20 01120019 */ multu $t0, $s2 -/* 0C2854 7F08DD24 C43252E8 */ lwc1 $f18, %lo(D_800552E8)($at) -/* 0C2858 7F08DD28 46125402 */ mul.s $f16, $f10, $f18 -/* 0C285C 7F08DD2C 00004812 */ mflo $t1 -/* 0C2860 7F08DD30 02095021 */ addu $t2, $s0, $t1 -/* 0C2864 7F08DD34 0C002914 */ jal get_random_value -/* 0C2868 7F08DD38 E5500568 */ swc1 $f16, 0x568($t2) -/* 0C286C 7F08DD3C 44822000 */ mtc1 $v0, $f4 -/* 0C2870 7F08DD40 8E300000 */ lw $s0, ($s1) -/* 0C2874 7F08DD44 04410005 */ bgez $v0, .L7F08DD5C -/* 0C2878 7F08DD48 468021A0 */ cvt.s.w $f6, $f4 -/* 0C287C 7F08DD4C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C2880 7F08DD50 44814000 */ mtc1 $at, $f8 -/* 0C2884 7F08DD54 00000000 */ nop -/* 0C2888 7F08DD58 46083180 */ add.s $f6, $f6, $f8 -.L7F08DD5C: -/* 0C288C 7F08DD5C 8E0B0594 */ lw $t3, 0x594($s0) -/* 0C2890 7F08DD60 46143282 */ mul.s $f10, $f6, $f20 -/* 0C2894 7F08DD64 3C018005 */ lui $at, %hi(D_800552EC) -/* 0C2898 7F08DD68 01720019 */ multu $t3, $s2 -/* 0C289C 7F08DD6C C43252EC */ lwc1 $f18, %lo(D_800552EC)($at) -/* 0C28A0 7F08DD70 46125402 */ mul.s $f16, $f10, $f18 -/* 0C28A4 7F08DD74 00006012 */ mflo $t4 -/* 0C28A8 7F08DD78 020C6821 */ addu $t5, $s0, $t4 -/* 0C28AC 7F08DD7C 10000026 */ b .L7F08DE18 -/* 0C28B0 7F08DD80 E5B00584 */ swc1 $f16, 0x584($t5) -.L7F08DD84: -/* 0C28B4 7F08DD84 0C002914 */ jal get_random_value -/* 0C28B8 7F08DD88 00000000 */ nop -/* 0C28BC 7F08DD8C 44822000 */ mtc1 $v0, $f4 -/* 0C28C0 7F08DD90 8E300000 */ lw $s0, ($s1) -/* 0C28C4 7F08DD94 04410005 */ bgez $v0, .L7F08DDAC -/* 0C28C8 7F08DD98 46802220 */ cvt.s.w $f8, $f4 -/* 0C28CC 7F08DD9C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C28D0 7F08DDA0 44813000 */ mtc1 $at, $f6 -/* 0C28D4 7F08DDA4 00000000 */ nop -/* 0C28D8 7F08DDA8 46064200 */ add.s $f8, $f8, $f6 -.L7F08DDAC: -/* 0C28DC 7F08DDAC 8E0E0594 */ lw $t6, 0x594($s0) -/* 0C28E0 7F08DDB0 46144282 */ mul.s $f10, $f8, $f20 -/* 0C28E4 7F08DDB4 3C018005 */ lui $at, %hi(D_800552F0) -/* 0C28E8 7F08DDB8 01D20019 */ multu $t6, $s2 -/* 0C28EC 7F08DDBC C43252F0 */ lwc1 $f18, %lo(D_800552F0)($at) -/* 0C28F0 7F08DDC0 46125402 */ mul.s $f16, $f10, $f18 -/* 0C28F4 7F08DDC4 00007812 */ mflo $t7 -/* 0C28F8 7F08DDC8 020FC021 */ addu $t8, $s0, $t7 -/* 0C28FC 7F08DDCC 0C002914 */ jal get_random_value -/* 0C2900 7F08DDD0 E7100568 */ swc1 $f16, 0x568($t8) -/* 0C2904 7F08DDD4 44822000 */ mtc1 $v0, $f4 -/* 0C2908 7F08DDD8 8E300000 */ lw $s0, ($s1) -/* 0C290C 7F08DDDC 04410005 */ bgez $v0, .L7F08DDF4 -/* 0C2910 7F08DDE0 468021A0 */ cvt.s.w $f6, $f4 -/* 0C2914 7F08DDE4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0C2918 7F08DDE8 44814000 */ mtc1 $at, $f8 -/* 0C291C 7F08DDEC 00000000 */ nop -/* 0C2920 7F08DDF0 46083180 */ add.s $f6, $f6, $f8 -.L7F08DDF4: -/* 0C2924 7F08DDF4 8E190594 */ lw $t9, 0x594($s0) -/* 0C2928 7F08DDF8 46143282 */ mul.s $f10, $f6, $f20 -/* 0C292C 7F08DDFC 3C018005 */ lui $at, %hi(D_800552F4) -/* 0C2930 7F08DE00 03320019 */ multu $t9, $s2 -/* 0C2934 7F08DE04 C43252F4 */ lwc1 $f18, %lo(D_800552F4)($at) -/* 0C2938 7F08DE08 46125402 */ mul.s $f16, $f10, $f18 -/* 0C293C 7F08DE0C 00004012 */ mflo $t0 -/* 0C2940 7F08DE10 02084821 */ addu $t1, $s0, $t0 -/* 0C2944 7F08DE14 E5300584 */ swc1 $f16, 0x584($t1) -.L7F08DE18: -/* 0C2948 7F08DE18 8E300000 */ lw $s0, ($s1) -/* 0C294C 7F08DE1C 240B0001 */ li $t3, 1 -/* 0C2950 7F08DE20 8E0A0594 */ lw $t2, 0x594($s0) -/* 0C2954 7F08DE24 016A6023 */ subu $t4, $t3, $t2 -/* 0C2958 7F08DE28 AE0C0594 */ sw $t4, 0x594($s0) -/* 0C295C 7F08DE2C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0C2960 7F08DE30 8FB20028 */ lw $s2, 0x28($sp) -/* 0C2964 7F08DE34 8FB10024 */ lw $s1, 0x24($sp) -/* 0C2968 7F08DE38 8FB00020 */ lw $s0, 0x20($sp) -/* 0C296C 7F08DE3C D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0C2970 7F08DE40 03E00008 */ jr $ra -/* 0C2974 7F08DE44 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F08DE48(struct xyzpoint *param_1) +void currentPlayerSetHeadDamp(f32 headdamp) { - int i; - - if (pPlayer->field_4DC != 0) - { - (pPlayer->velocity).x = 0.00000000f; - (pPlayer->velocity).y = param_1->y / 0.06999999f; - (pPlayer->velocity).z = 0.00000000f; - pPlayer->field_4DC = 0; - } - for (i = 0; i < clock_timer; ++i) - { - //wrong register allocation for mult - (pPlayer->velocity).x = param_1->x + ((pPlayer->velocity).x * 0.93f); - (pPlayer->velocity).y = param_1->y + ((pPlayer->velocity).y * 0.93f); - (pPlayer->velocity).z = param_1->z + ((pPlayer->velocity).z * 0.93f); - } - (pPlayer->scaled_velocity).x = (pPlayer->velocity).x * 0.06999999f; - (pPlayer->scaled_velocity).y = (pPlayer->velocity).y * 0.06999999f; - (pPlayer->scaled_velocity).z = (pPlayer->velocity).z * 0.06999999f; + if (headdamp != pPlayer->headdamp) { + f32 divisor = 1.0f - headdamp; + pPlayer->headlooksum[0] = (pPlayer->headlooksum[0] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headlooksum[1] = (pPlayer->headlooksum[1] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headlooksum[2] = (pPlayer->headlooksum[2] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headupsum[0] = (pPlayer->headupsum[0] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headupsum[1] = (pPlayer->headupsum[1] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headupsum[2] = (pPlayer->headupsum[2] * (1.0f - pPlayer->headdamp)) / divisor; + pPlayer->headdamp = headdamp; + } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800552F8 -.word 0x3d8f5c28 /*0.069999993*/ -glabel master_player_perspective -.word 0x3d8f5c28 /*0.069999993*/ -glabel D_80055300 -.word 0x3f6e147b /*0.93000001*/ -.text -glabel sub_GAME_7F08DE48 -/* 0C2978 7F08DE48 3C058008 */ lui $a1, %hi(pPlayer) -/* 0C297C 7F08DE4C 24A5A0B0 */ addiu $a1, %lo(pPlayer) # addiu $a1, $a1, -0x5f50 -/* 0C2980 7F08DE50 8CA20000 */ lw $v0, ($a1) -/* 0C2984 7F08DE54 3C068005 */ lui $a2, %hi(clock_timer) -/* 0C2988 7F08DE58 24C68374 */ addiu $a2, %lo(clock_timer) # addiu $a2, $a2, -0x7c8c -/* 0C298C 7F08DE5C 8C4E04DC */ lw $t6, 0x4dc($v0) -/* 0C2990 7F08DE60 51C0000E */ beql $t6, $zero, .L7F08DE9C -/* 0C2994 7F08DE64 8CC80000 */ lw $t0, ($a2) -/* 0C2998 7F08DE68 44800000 */ mtc1 $zero, $f0 -/* 0C299C 7F08DE6C 3C018005 */ lui $at, %hi(D_800552F8) -/* 0C29A0 7F08DE70 C42252F8 */ lwc1 $f2, %lo(D_800552F8)($at) -/* 0C29A4 7F08DE74 E4400520 */ swc1 $f0, 0x520($v0) -/* 0C29A8 7F08DE78 C4840004 */ lwc1 $f4, 4($a0) -/* 0C29AC 7F08DE7C 8CAF0000 */ lw $t7, ($a1) -/* 0C29B0 7F08DE80 46022183 */ div.s $f6, $f4, $f2 -/* 0C29B4 7F08DE84 E5E60524 */ swc1 $f6, 0x524($t7) -/* 0C29B8 7F08DE88 8CB80000 */ lw $t8, ($a1) -/* 0C29BC 7F08DE8C E7000528 */ swc1 $f0, 0x528($t8) -/* 0C29C0 7F08DE90 8CB90000 */ lw $t9, ($a1) -/* 0C29C4 7F08DE94 AF2004DC */ sw $zero, 0x4dc($t9) -/* 0C29C8 7F08DE98 8CC80000 */ lw $t0, ($a2) -.L7F08DE9C: -/* 0C29CC 7F08DE9C 3C018005 */ lui $at, %hi(master_player_perspective) -/* 0C29D0 7F08DEA0 C42252FC */ lwc1 $f2, %lo(master_player_perspective)($at) -/* 0C29D4 7F08DEA4 1900001A */ blez $t0, .L7F08DF10 -/* 0C29D8 7F08DEA8 00001825 */ move $v1, $zero -/* 0C29DC 7F08DEAC 3C018005 */ lui $at, %hi(D_80055300) -/* 0C29E0 7F08DEB0 C4205300 */ lwc1 $f0, %lo(D_80055300)($at) -/* 0C29E4 7F08DEB4 8CA20000 */ lw $v0, ($a1) -.L7F08DEB8: -/* 0C29E8 7F08DEB8 C4880000 */ lwc1 $f8, ($a0) -/* 0C29EC 7F08DEBC 24630001 */ addiu $v1, $v1, 1 -/* 0C29F0 7F08DEC0 C44A0520 */ lwc1 $f10, 0x520($v0) -/* 0C29F4 7F08DEC4 460A0402 */ mul.s $f16, $f0, $f10 -/* 0C29F8 7F08DEC8 46104480 */ add.s $f18, $f8, $f16 -/* 0C29FC 7F08DECC E4520520 */ swc1 $f18, 0x520($v0) -/* 0C2A00 7F08DED0 8CA20000 */ lw $v0, ($a1) -/* 0C2A04 7F08DED4 C4840004 */ lwc1 $f4, 4($a0) -/* 0C2A08 7F08DED8 C4460524 */ lwc1 $f6, 0x524($v0) -/* 0C2A0C 7F08DEDC 46060282 */ mul.s $f10, $f0, $f6 -/* 0C2A10 7F08DEE0 460A2200 */ add.s $f8, $f4, $f10 -/* 0C2A14 7F08DEE4 E4480524 */ swc1 $f8, 0x524($v0) -/* 0C2A18 7F08DEE8 8CA20000 */ lw $v0, ($a1) -/* 0C2A1C 7F08DEEC C4900008 */ lwc1 $f16, 8($a0) -/* 0C2A20 7F08DEF0 C4520528 */ lwc1 $f18, 0x528($v0) -/* 0C2A24 7F08DEF4 46120182 */ mul.s $f6, $f0, $f18 -/* 0C2A28 7F08DEF8 46068100 */ add.s $f4, $f16, $f6 -/* 0C2A2C 7F08DEFC E4440528 */ swc1 $f4, 0x528($v0) -/* 0C2A30 7F08DF00 8CC90000 */ lw $t1, ($a2) -/* 0C2A34 7F08DF04 0069082A */ slt $at, $v1, $t1 -/* 0C2A38 7F08DF08 5420FFEB */ bnezl $at, .L7F08DEB8 -/* 0C2A3C 7F08DF0C 8CA20000 */ lw $v0, ($a1) -.L7F08DF10: -/* 0C2A40 7F08DF10 8CA20000 */ lw $v0, ($a1) -/* 0C2A44 7F08DF14 C44A0520 */ lwc1 $f10, 0x520($v0) -/* 0C2A48 7F08DF18 46025202 */ mul.s $f8, $f10, $f2 -/* 0C2A4C 7F08DF1C E44804FC */ swc1 $f8, 0x4fc($v0) -/* 0C2A50 7F08DF20 8CA20000 */ lw $v0, ($a1) -/* 0C2A54 7F08DF24 C4520524 */ lwc1 $f18, 0x524($v0) -/* 0C2A58 7F08DF28 46029402 */ mul.s $f16, $f18, $f2 -/* 0C2A5C 7F08DF2C E4500500 */ swc1 $f16, 0x500($v0) -/* 0C2A60 7F08DF30 8CA20000 */ lw $v0, ($a1) -/* 0C2A64 7F08DF34 C4460528 */ lwc1 $f6, 0x528($v0) -/* 0C2A68 7F08DF38 46023102 */ mul.s $f4, $f6, $f2 -/* 0C2A6C 7F08DF3C 03E00008 */ jr $ra -/* 0C2A70 7F08DF40 E4440504 */ swc1 $f4, 0x504($v0) -) -#endif - - - - - - -void sub_GAME_7F08DF44(struct xyzpoint *param_1, struct xyzpoint *param_2) -{ - int i; - - if (pPlayer->field_4E0 != 0) - { - (pPlayer->field_52C).x = param_1->x / (1.0f - pPlayer->field_4EC); - (pPlayer->field_52C).y = param_1->y / (1.0f - pPlayer->field_4EC); - (pPlayer->field_52C).z = param_1->z / (1.0f - pPlayer->field_4EC); - (pPlayer->field_538).x = param_2->x / (1.0f - pPlayer->field_4EC); - (pPlayer->field_538).y = param_2->y / (1.0f - pPlayer->field_4EC); - (pPlayer->field_538).z = param_2->z / (1.0f - pPlayer->field_4EC); - pPlayer->field_4E0 = 0; - } - - for (i = 0; i < clock_timer; ++i) - { - (pPlayer->field_52C).x = param_1->x + pPlayer->field_4EC * (pPlayer->field_52C).x; - (pPlayer->field_52C).y = param_1->y + pPlayer->field_4EC * (pPlayer->field_52C).y; - (pPlayer->field_52C).z = param_1->z + pPlayer->field_4EC * (pPlayer->field_52C).z; - (pPlayer->field_538).x = param_2->x + pPlayer->field_4EC * (pPlayer->field_538).x; - (pPlayer->field_538).y = param_2->y + pPlayer->field_4EC * (pPlayer->field_538).y; - (pPlayer->field_538).z = param_2->z + pPlayer->field_4EC * (pPlayer->field_538).z; - } - - (pPlayer->field_508).x = (pPlayer->field_52C).x * (1.0f - pPlayer->field_4EC); - (pPlayer->field_508).y = (pPlayer->field_52C).y * (1.0f - pPlayer->field_4EC); - (pPlayer->field_508).z = (pPlayer->field_52C).z * (1.0f - pPlayer->field_4EC); - (pPlayer->field_514).x = (pPlayer->field_538).x * (1.0f - pPlayer->field_4EC); - (pPlayer->field_514).y = (pPlayer->field_538).y * (1.0f - pPlayer->field_4EC); - (pPlayer->field_514).z = (pPlayer->field_538).z * (1.0f - pPlayer->field_4EC); - -} - - -void sub_GAME_7F08E164(float param_1) -{ - float fVar1; - - if (param_1 != pPlayer->field_4EC) { - fVar1 = 1.0f - param_1; - (pPlayer->field_52C).x = ((pPlayer->field_52C).x * (1.0f - pPlayer->field_4EC)) / fVar1; - (pPlayer->field_52C).y = ((pPlayer->field_52C).y * (1.0f - pPlayer->field_4EC)) / fVar1; - (pPlayer->field_52C).z = ((pPlayer->field_52C).z * (1.0f - pPlayer->field_4EC)) / fVar1; - - (pPlayer->field_538).x = ((pPlayer->field_538).x * (1.0f - pPlayer->field_4EC)) / fVar1; - (pPlayer->field_538).y = ((pPlayer->field_538).y * (1.0f - pPlayer->field_4EC)) / fVar1; - (pPlayer->field_538).z = ((pPlayer->field_538).z * (1.0f - pPlayer->field_4EC)) / fVar1; - pPlayer->field_4EC = param_1; - } -} - - - #ifdef NONMATCHING void sub_GAME_7F08E240(void) { @@ -745,13 +456,13 @@ glabel sub_GAME_7F08E240 /* 0C3174 7F08E644 2B01003D */ slti $at, $t8, 0x3d /* 0C3178 7F08E648 14200005 */ bnez $at, .L7F08E660 /* 0C317C 7F08E64C 3C018005 */ lui $at, %hi(D_80055320) -/* 0C3180 7F08E650 0FC23859 */ jal sub_GAME_7F08E164 +/* 0C3180 7F08E650 0FC23859 */ jal currentPlayerSetHeadDamp /* 0C3184 7F08E654 C42C5320 */ lwc1 $f12, %lo(D_80055320)($at) /* 0C3188 7F08E658 1000008E */ b .L7F08E894 /* 0C318C 7F08E65C 00000000 */ nop .L7F08E660: /* 0C3190 7F08E660 3C018005 */ lui $at, %hi(D_80055324) -/* 0C3194 7F08E664 0FC23859 */ jal sub_GAME_7F08E164 +/* 0C3194 7F08E664 0FC23859 */ jal currentPlayerSetHeadDamp /* 0C3198 7F08E668 C42C5324 */ lwc1 $f12, %lo(D_80055324)($at) /* 0C319C 7F08E66C 10000089 */ b .L7F08E894 /* 0C31A0 7F08E670 00000000 */ nop @@ -769,7 +480,7 @@ glabel sub_GAME_7F08E240 /* 0C31CC 7F08E69C C44806E4 */ lwc1 $f8, 0x6e4($v0) /* 0C31D0 7F08E6A0 E7A800C8 */ swc1 $f8, 0xc8($sp) /* 0C31D4 7F08E6A4 C44A06E8 */ lwc1 $f10, 0x6e8($v0) -/* 0C31D8 7F08E6A8 0FC23859 */ jal sub_GAME_7F08E164 +/* 0C31D8 7F08E6A8 0FC23859 */ jal currentPlayerSetHeadDamp /* 0C31DC 7F08E6AC E7AA00CC */ swc1 $f10, 0xcc($sp) /* 0C31E0 7F08E6B0 10000078 */ b .L7F08E894 /* 0C31E4 7F08E6B4 00000000 */ nop @@ -790,7 +501,7 @@ glabel sub_GAME_7F08E240 /* 0C321C 7F08E6EC E7A000E4 */ swc1 $f0, 0xe4($sp) /* 0C3220 7F08E6F0 E7A600E0 */ swc1 $f6, 0xe0($sp) /* 0C3224 7F08E6F4 AC4004F0 */ sw $zero, 0x4f0($v0) -/* 0C3228 7F08E6F8 0FC23859 */ jal sub_GAME_7F08E164 +/* 0C3228 7F08E6F8 0FC23859 */ jal currentPlayerSetHeadDamp /* 0C322C 7F08E6FC C42C532C */ lwc1 $f12, %lo(D_8005532C)($at) /* 0C3230 7F08E700 0FC227B5 */ jal get_BONDdata_bondfadefracnew /* 0C3234 7F08E704 00000000 */ nop @@ -816,7 +527,7 @@ glabel sub_GAME_7F08E240 /* 0C3284 7F08E754 00000000 */ nop /* 0C3288 7F08E758 4502000C */ bc1fl .L7F08E78C /* 0C328C 7F08E75C 8C430594 */ lw $v1, 0x594($v0) -/* 0C3290 7F08E760 0FC236F2 */ jal sub_GAME_7F08DBC8 +/* 0C3290 7F08E760 0FC236F2 */ jal currentPlayerUpdateIdleHeadRoll /* 0C3294 7F08E764 00000000 */ nop /* 0C3298 7F08E768 8E020000 */ lw $v0, ($s0) /* 0C329C 7F08E76C 3C013F80 */ li $at, 0x3F800000 # 1.000000 @@ -895,10 +606,10 @@ glabel sub_GAME_7F08E240 /* 0C33BC 7F08E88C 46049282 */ mul.s $f10, $f18, $f4 /* 0C33C0 7F08E890 E7AA00CC */ swc1 $f10, 0xcc($sp) .L7F08E894: -/* 0C33C4 7F08E894 0FC23792 */ jal sub_GAME_7F08DE48 +/* 0C33C4 7F08E894 0FC23792 */ jal currentPlayerUpdateHeadPos /* 0C33C8 7F08E898 27A400DC */ addiu $a0, $sp, 0xdc /* 0C33CC 7F08E89C 27A400D0 */ addiu $a0, $sp, 0xd0 -/* 0C33D0 7F08E8A0 0FC237D1 */ jal sub_GAME_7F08DF44 +/* 0C33D0 7F08E8A0 0FC237D1 */ jal currentPlayerUpdateHeadRot /* 0C33D4 7F08E8A4 27A500C4 */ addiu $a1, $sp, 0xc4 /* 0C33D8 7F08E8A8 8FBF001C */ lw $ra, 0x1c($sp) /* 0C33DC 7F08E8AC 8FB00018 */ lw $s0, 0x18($sp) @@ -990,8 +701,8 @@ glabel sub_GAME_7F08E8BC /* 0C34F0 7F08E9C0 24840598 */ addiu $a0, $a0, 0x598 /* 0C34F4 7F08E9C4 3C048008 */ lui $a0, %hi(pPlayer) /* 0C34F8 7F08E9C8 8C84A0B0 */ lw $a0, %lo(pPlayer)($a0) -/* 0C34FC 7F08E9CC 3C057F09 */ lui $a1, %hi(sub_GAME_7F08DBB0) # $a1, 0x7f09 -/* 0C3500 7F08E9D0 24A5DBB0 */ addiu $a1, %lo(sub_GAME_7F08DBB0) # addiu $a1, $a1, -0x2450 +/* 0C34FC 7F08E9CC 3C057F09 */ lui $a1, %hi(currentPlayerToggle5BC) # $a1, 0x7f09 +/* 0C3500 7F08E9D0 24A5DBB0 */ addiu $a1, %lo(currentPlayerToggle5BC) # addiu $a1, $a1, -0x2450 /* 0C3504 7F08E9D4 0FC1BF8F */ jal sub_GAME_7F06FE3C /* 0C3508 7F08E9D8 24840598 */ addiu $a0, $a0, 0x598 /* 0C350C 7F08E9DC 3C198008 */ lui $t9, %hi(pPlayer) @@ -1637,12 +1348,28 @@ glabel sub_GAME_7F08EFA0 #endif - - - #ifdef NONMATCHING -void sub_GAME_7F08F090(void) { +struct Pad* sub_GAME_7F08F090(s32 *padNumList,s32 desiredDist, u32 setIndex) // findPadWithDistAndSet +{ + s32 padNum; + struct Pad *currPad; + padNum = padNumList[0]; + + while (padNum >= 0) + { + currPad = ptr_setup_path_tbl + padNum; + if (setIndex == currPad->pathSetIndex) { + if (desiredDist == currPad->dist_tmp) { + return currPad; + } + } + + padNumList += 1; + padNum = *padNumList; + } + + return (struct Pad*)0; } #else GLOBAL_ASM( @@ -1680,7 +1407,6 @@ glabel sub_GAME_7F08F090 - #ifdef NONMATCHING void sub_GAME_7F08F0E8(void) { @@ -1859,9 +1585,26 @@ glabel sub_GAME_7F08F1D8 -#ifdef NONMATCHING -void sub_GAME_7F08F2CC(void) { + +#ifdef NONMATCHING +void sub_GAME_7F08F2CC(struct Pad *startPad,struct Pad *endPad) +{ + s32 dist; + + sub_GAME_7F08F1D8(startPad,endPad,0); // do_BFS_withinPathSet + dist = endPad->dist_tmp + -1; + + while (dist >= 0) { + endPad->dist_tmp = endPad->dist_tmp + 10000; + endPad = sub_GAME_7F08F090(endPad->neighbours,dist,startPad->pathSetIndex); // findPadWithDistAndSet + dist = dist + -1; + } + + + dist = endPad->dist_tmp; + endPad->dist_tmp = dist + 10000; + return; } #else GLOBAL_ASM( diff --git a/src/game/unk_091080.c b/src/game/unk_091080.c index 1947e395..0c2597d5 100644 --- a/src/game/unk_091080.c +++ b/src/game/unk_091080.c @@ -610,7 +610,7 @@ glabel sub_GAME_7F09166C #ifdef NONMATCHING void sub_GAME_7F0916F4(void) { - struct xyzpoint *pos; + struct coord *pos; pos = get_BONDdata_position(); stanbondx.x = pos->x; diff --git a/src/game/unk_093880.c b/src/game/unk_093880.c index 73921c88..e6d3eeeb 100644 --- a/src/game/unk_093880.c +++ b/src/game/unk_093880.c @@ -8,17 +8,14 @@ s32 copyof_stagenum; s32 dword_CODE_bss_80079E94; char dword_CODE_bss_80079E98[0x48]; -u32 *ptr_BONDdata_p1; -u32 *ptr_BONDdata_p2; -u32 *ptr_BONDdata_p3; -u32 *ptr_BONDdata_p4; +struct player *players[4]; struct player_data player1_player_data; struct player_data player2_player_data; struct player_data player3_player_data; struct player_data player4_player_data; -struct Player *pPlayer; +struct player *pPlayer; struct player_data *pPlayersPerm; s32 player_num; s32 random_byte; @@ -38,7 +35,7 @@ void sub_GAME_7F093880(f32 arg0, f32 arg1, ? arg2) { s32 sp24; // Node 0 - sp24 = sub_GAME_7F078444(); + sp24 = currentPlayerGetMatrix10D4(); sp1C = (f32) (getPlayer_c_screenleft() + arg0); sp18 = getPlayer_c_screentop(); sp20 = (f32) (get_ptr_currentdata()->unk38 + (arg1 + sp18)); @@ -54,7 +51,7 @@ glabel sub_GAME_7F093880 /* 0C83B4 7F093884 AFBF0014 */ sw $ra, 0x14($sp) /* 0C83B8 7F093888 E7AC0028 */ swc1 $f12, 0x28($sp) /* 0C83BC 7F09388C E7AE002C */ swc1 $f14, 0x2c($sp) -/* 0C83C0 7F093890 0FC1E111 */ jal sub_GAME_7F078444 +/* 0C83C0 7F093890 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0C83C4 7F093894 AFA60030 */ sw $a2, 0x30($sp) /* 0C83C8 7F093898 0FC1E131 */ jal getPlayer_c_screenleft /* 0C83CC 7F09389C AFA20024 */ sw $v0, 0x24($sp) @@ -1178,7 +1175,7 @@ glabel sub_GAME_7F094488 /* 0C9004 7F0944D4 8FA406B0 */ lw $a0, 0x6b0($sp) /* 0C9008 7F0944D8 55C0007B */ bnezl $t6, .L7F0946C8 /* 0C900C 7F0944DC 92050008 */ lbu $a1, 8($s0) -/* 0C9010 7F0944E0 0FC26919 */ jal get_num_players +/* 0C9010 7F0944E0 0FC26919 */ jal getPlayerCount /* 0C9014 7F0944E4 00000000 */ nop /* 0C9018 7F0944E8 24010001 */ li $at, 1 /* 0C901C 7F0944EC 1441003B */ bne $v0, $at, .L7F0945DC @@ -1198,15 +1195,15 @@ glabel sub_GAME_7F094488 /* 0C9054 7F094524 8FA406B0 */ lw $a0, 0x6b0($sp) /* 0C9058 7F094528 244B0008 */ addiu $t3, $v0, 8 /* 0C905C 7F09452C AFAB06B0 */ sw $t3, 0x6b0($sp) -/* 0C9060 7F094530 0C001127 */ jal get_video2_settings_width +/* 0C9060 7F094530 0C001127 */ jal viGetViewWidth /* 0C9064 7F094534 00408825 */ move $s1, $v0 -/* 0C9068 7F094538 0C001145 */ jal get_video2_settings_ulx +/* 0C9068 7F094538 0C001145 */ jal viGetViewLeft /* 0C906C 7F09453C A7A2007A */ sh $v0, 0x7a($sp) -/* 0C9070 7F094540 0C001149 */ jal get_video2_settings_uly +/* 0C9070 7F094540 0C001149 */ jal viGetViewTop /* 0C9074 7F094544 A7A2007C */ sh $v0, 0x7c($sp) /* 0C9078 7F094548 00028400 */ sll $s0, $v0, 0x10 /* 0C907C 7F09454C 00106403 */ sra $t4, $s0, 0x10 -/* 0C9080 7F094550 0C00112B */ jal get_video2_settings_height +/* 0C9080 7F094550 0C00112B */ jal viGetViewHeight /* 0C9084 7F094554 01808025 */ move $s0, $t4 /* 0C9088 7F094558 87AD007C */ lh $t5, 0x7c($sp) /* 0C908C 7F09455C 87AE007A */ lh $t6, 0x7a($sp) @@ -1221,11 +1218,11 @@ glabel sub_GAME_7F094488 /* 0C90B0 7F094580 01C17825 */ or $t7, $t6, $at /* 0C90B4 7F094584 00195380 */ sll $t2, $t9, 0xe /* 0C90B8 7F094588 01EAC025 */ or $t8, $t7, $t2 -/* 0C90BC 7F09458C 0C001145 */ jal get_video2_settings_ulx +/* 0C90BC 7F09458C 0C001145 */ jal viGetViewLeft /* 0C90C0 7F094590 AE380000 */ sw $t8, ($s1) /* 0C90C4 7F094594 00028400 */ sll $s0, $v0, 0x10 /* 0C90C8 7F094598 0010CC03 */ sra $t9, $s0, 0x10 -/* 0C90CC 7F09459C 0C001149 */ jal get_video2_settings_uly +/* 0C90CC 7F09459C 0C001149 */ jal viGetViewTop /* 0C90D0 7F0945A0 03208025 */ move $s0, $t9 /* 0C90D4 7F0945A4 304B03FF */ andi $t3, $v0, 0x3ff /* 0C90D8 7F0945A8 320D03FF */ andi $t5, $s0, 0x3ff @@ -2409,9 +2406,9 @@ def_7F094A38: .L7F0957AC: /* 0CA2DC 7F0957AC 5A20018E */ blezl $s1, .L7F095DE8 /* 0CA2E0 7F0957B0 8FAA005C */ lw $t2, 0x5c($sp) -/* 0CA2E4 7F0957B4 0FC1E0F9 */ jal get_BONDdata_field_10DC +/* 0CA2E4 7F0957B4 0FC1E0F9 */ jal currentPlayerGetProjectionMatrixF /* 0CA2E8 7F0957B8 00000000 */ nop -/* 0CA2EC 7F0957BC 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0CA2EC 7F0957BC 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0CA2F0 7F0957C0 00408025 */ move $s0, $v0 /* 0CA2F4 7F0957C4 02002025 */ move $a0, $s0 /* 0CA2F8 7F0957C8 00402825 */ move $a1, $v0 @@ -3939,9 +3936,9 @@ def_7F095E0C: /* 0CBA18 7F096EE8 3739FE81 */ ori $t9, (0xFC40FE81 & 0xFFFF) # ori $t9, $t9, 0xfe81 /* 0CBA1C 7F096EEC 35ADF97C */ ori $t5, (0x55FEF97C & 0xFFFF) # ori $t5, $t5, 0xf97c /* 0CBA20 7F096EF0 ADED0004 */ sw $t5, 4($t7) -/* 0CBA24 7F096EF4 0FC1E0F9 */ jal get_BONDdata_field_10DC +/* 0CBA24 7F096EF4 0FC1E0F9 */ jal currentPlayerGetProjectionMatrixF /* 0CBA28 7F096EF8 ADF90000 */ sw $t9, ($t7) -/* 0CBA2C 7F096EFC 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0CBA2C 7F096EFC 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0CBA30 7F096F00 00408025 */ move $s0, $v0 /* 0CBA34 7F096F04 02002025 */ move $a0, $s0 /* 0CBA38 7F096F08 00402825 */ move $a1, $v0 @@ -7516,10 +7513,10 @@ glabel default_player_perspective_and_height #ifdef NONMATCHING void reset_play_data_ptrs(void) { - ptr_BONDdata_p1[0] = NULL; - ptr_BONDdata_p1[1] = NULL; - ptr_BONDdata_p1[2] = NULL; - ptr_BONDdata_p1[3] = NULL; + players[0] = NULL; + players[1] = NULL; + players[2] = NULL; + players[3] = NULL; pPlayer = NULL; pPlayersPerm = NULL; player_num = 0; @@ -7533,8 +7530,8 @@ void reset_play_data_ptrs(void) GLOBAL_ASM( .text glabel reset_play_data_ptrs -/* 0CEE5C 7F09A32C 3C028008 */ lui $v0, %hi(ptr_BONDdata_p1) -/* 0CEE60 7F09A330 24429EE0 */ addiu $v0, %lo(ptr_BONDdata_p1) # addiu $v0, $v0, -0x6120 +/* 0CEE5C 7F09A32C 3C028008 */ lui $v0, %hi(players) +/* 0CEE60 7F09A330 24429EE0 */ addiu $v0, %lo(players) # addiu $v0, $v0, -0x6120 /* 0CEE64 7F09A334 AC400000 */ sw $zero, ($v0) /* 0CEE68 7F09A338 AC400004 */ sw $zero, 4($v0) /* 0CEE6C 7F09A33C AC400008 */ sw $zero, 8($v0) @@ -7568,17 +7565,17 @@ void init_player_data_ptrs_construct_viewports(int playercount) { int player; - ptr_BONDdata_p1[0] = NULL; - ptr_BONDdata_p1[1] = NULL; - ptr_BONDdata_p1[2] = NULL; - ptr_BONDdata_p1[3] = NULL; + players[0] = NULL; + players[1] = NULL; + players[2] = NULL; + players[3] = NULL; random_byte = get_random_value() & 0xff; if (playercount < 1) { initBONDdataforPlayer(0); set_cur_player(0); - set_cur_player_screen_size( get_video2_settings_width(), get_video2_settings_height() ); - set_cur_player_viewport_size( get_video2_settings_ulx(), get_video2_settings_uly() ); + set_cur_player_screen_size( viGetViewWidth(), viGetViewHeight() ); + set_cur_player_viewport_size( viGetViewLeft(), viGetViewTop() ); } else { for (player = 0; player != playercount; player++) @@ -7593,8 +7590,8 @@ void init_player_data_ptrs_construct_viewports(int playercount) GLOBAL_ASM( .text glabel init_player_data_ptrs_construct_viewports -/* 0CEEBC 7F09A38C 3C028008 */ lui $v0, %hi(ptr_BONDdata_p1) -/* 0CEEC0 7F09A390 24429EE0 */ addiu $v0, %lo(ptr_BONDdata_p1) # addiu $v0, $v0, -0x6120 +/* 0CEEBC 7F09A38C 3C028008 */ lui $v0, %hi(players) +/* 0CEEC0 7F09A390 24429EE0 */ addiu $v0, %lo(players) # addiu $v0, $v0, -0x6120 /* 0CEEC4 7F09A394 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0CEEC8 7F09A398 AFBF001C */ sw $ra, 0x1c($sp) /* 0CEECC 7F09A39C AFB10018 */ sw $s1, 0x18($sp) @@ -7627,20 +7624,20 @@ glabel init_player_data_ptrs_construct_viewports /* 0CEF2C 7F09A3FC 00002025 */ move $a0, $zero /* 0CEF30 7F09A400 0FC26C43 */ jal set_cur_player /* 0CEF34 7F09A404 00002025 */ move $a0, $zero -/* 0CEF38 7F09A408 0C001127 */ jal get_video2_settings_width +/* 0CEF38 7F09A408 0C001127 */ jal viGetViewWidth /* 0CEF3C 7F09A40C 00000000 */ nop /* 0CEF40 7F09A410 00028400 */ sll $s0, $v0, 0x10 /* 0CEF44 7F09A414 00107C03 */ sra $t7, $s0, 0x10 -/* 0CEF48 7F09A418 0C00112B */ jal get_video2_settings_height +/* 0CEF48 7F09A418 0C00112B */ jal viGetViewHeight /* 0CEF4C 7F09A41C 01E08025 */ move $s0, $t7 /* 0CEF50 7F09A420 02002025 */ move $a0, $s0 /* 0CEF54 7F09A424 0FC26C77 */ jal set_cur_player_screen_size /* 0CEF58 7F09A428 00402825 */ move $a1, $v0 -/* 0CEF5C 7F09A42C 0C001145 */ jal get_video2_settings_ulx +/* 0CEF5C 7F09A42C 0C001145 */ jal viGetViewLeft /* 0CEF60 7F09A430 00000000 */ nop /* 0CEF64 7F09A434 00028400 */ sll $s0, $v0, 0x10 /* 0CEF68 7F09A438 0010C403 */ sra $t8, $s0, 0x10 -/* 0CEF6C 7F09A43C 0C001149 */ jal get_video2_settings_uly +/* 0CEF6C 7F09A43C 0C001149 */ jal viGetViewTop /* 0CEF70 7F09A440 03008025 */ move $s0, $t8 /* 0CEF74 7F09A444 02002025 */ move $a0, $s0 /* 0CEF78 7F09A448 0FC26C7E */ jal set_cur_player_viewport_size @@ -7654,74 +7651,28 @@ glabel init_player_data_ptrs_construct_viewports ) #endif - - - - -#ifdef NONMATCHING -u32 get_num_players(void) +s32 getPlayerCount(void) { - u32 uVar1; - - uVar1 = (u32)(ptr_BONDdata_p1[0] != NULL); - if (ptr_BONDdata_p1[1] != NULL) { - uVar1 = (uint)(ptr_BONDdata_p1[0] != NULL) + 1; + s32 count = 0; + s32 i; + for (i = 0; i < 4; i++) { + if (players[i] != NULL) { + count++; + } } - if (ptr_BONDdata_p1[2] != NULL) { - uVar1 = uVar1 + 1; - } - if (ptr_BONDdata_p1[3] != NULL) { - uVar1 = uVar1 + 1; - } - return uVar1; + return count; } -#else -GLOBAL_ASM( -.text -glabel get_num_players -/* 0CEF94 7F09A464 3C0E8008 */ lui $t6, %hi(ptr_BONDdata_p1) -/* 0CEF98 7F09A468 8DCE9EE0 */ lw $t6, %lo(ptr_BONDdata_p1)($t6) -/* 0CEF9C 7F09A46C 00001825 */ move $v1, $zero -/* 0CEFA0 7F09A470 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p2) -/* 0CEFA4 7F09A474 11C00002 */ beqz $t6, .L7F09A480 -/* 0CEFA8 7F09A478 3C188008 */ lui $t8, %hi(ptr_BONDdata_p3) -/* 0CEFAC 7F09A47C 24030001 */ li $v1, 1 -.L7F09A480: -/* 0CEFB0 7F09A480 8DEF9EE4 */ lw $t7, %lo(ptr_BONDdata_p2)($t7) -/* 0CEFB4 7F09A484 3C198008 */ lui $t9, %hi(ptr_BONDdata_p4) -/* 0CEFB8 7F09A488 11E00002 */ beqz $t7, .L7F09A494 -/* 0CEFBC 7F09A48C 00000000 */ nop -/* 0CEFC0 7F09A490 24630001 */ addiu $v1, $v1, 1 -.L7F09A494: -/* 0CEFC4 7F09A494 8F189EE8 */ lw $t8, %lo(ptr_BONDdata_p3)($t8) -/* 0CEFC8 7F09A498 13000002 */ beqz $t8, .L7F09A4A4 -/* 0CEFCC 7F09A49C 00000000 */ nop -/* 0CEFD0 7F09A4A0 24630001 */ addiu $v1, $v1, 1 -.L7F09A4A4: -/* 0CEFD4 7F09A4A4 8F399EEC */ lw $t9, %lo(ptr_BONDdata_p4)($t9) -/* 0CEFD8 7F09A4A8 13200002 */ beqz $t9, .L7F09A4B4 -/* 0CEFDC 7F09A4AC 00000000 */ nop -/* 0CEFE0 7F09A4B0 24630001 */ addiu $v1, $v1, 1 -.L7F09A4B4: -/* 0CEFE4 7F09A4B4 03E00008 */ jr $ra -/* 0CEFE8 7F09A4B8 00601025 */ move $v0, $v1 -) -#endif - - - - #ifdef NONMATCHING void initBONDdataforPlayer(PLAYER_ID player) { int iVar1; int iVar2; - Player **ppPVar3; + player **ppPVar3; int *dest; int *src; int *src_next; - Player *pPVar4; + player *pPVar4; int array234undefined4 [234]; int iStack4; f32 temp_3f36e15f8e; @@ -7736,8 +7687,8 @@ void initBONDdataforPlayer(PLAYER_ID player) src = src_next; dest = dest + 3; } while (src_next != (int *)0x80040148); - pPVar4 = (Player *)mempAllocBytesInBank(0x2a80,4); - ppPVar3 = ptr_BONDdata_p1 + player; + pPVar4 = (player *)mempAllocBytesInBank(0x2a80,4); + ppPVar3 = players + player; *ppPVar3 = pPVar4; pPVar4->unknown = 0; (*ppPVar3)->xpos = 0.00000000; @@ -7774,14 +7725,14 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_90 = 0.00000000; (*ppPVar3)->field_94 = 0; (*ppPVar3)->field_98 = 0.00000000; - (*ppPVar3)->field_1274 = 0.00000000; + (*ppPVar3)->swaytarget = 0.00000000; (*ppPVar3)->field_1278 = 0.00000000; (*ppPVar3)->field_127C = 0.00000000; - (*ppPVar3)->crouchposition = 2; - (*ppPVar3)->field_29FC = 2; + (*ppPVar3)->crouchpos = 2; + (*ppPVar3)->autocrouchpos = 2; (*ppPVar3)->ducking_height_offset = 0.00000000; (*ppPVar3)->field_A4 = 0.00000000; - (*ppPVar3)->position_data_pointer = 0; + (*ppPVar3)->prop = 0; (*ppPVar3)->field_AC = 1; (*ppPVar3)->field_D0 = 0; (*ppPVar3)->ptr_char_objectinstance = 0; @@ -7828,11 +7779,11 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->boost_factor_x = 0.00000000; (*ppPVar3)->boost_factor_y = 0.00000000; (*ppPVar3)->boost_factor_z = 0.00000000; - (*ppPVar3)->viewport_alpha = -1.00000000; (*ppPVar3)->bondfadetime60 = -1.00000000; - (*ppPVar3)->bondfadetimemax = 0.00000000; + (*ppPVar3)->bondfadetimemax60 = -1.00000000; (*ppPVar3)->bondfadefracold = 0.00000000; (*ppPVar3)->bondfadefracnew = 0.00000000; + (*ppPVar3)->field_19C = 0.00000000; (*ppPVar3)->field_1A0 = 0; (*ppPVar3)->field_1C0 = 0; (*ppPVar3)->field_1C4 = 0; @@ -7866,20 +7817,20 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_3C4 = 0.00000000; (*ppPVar3)->field_3C8 = 0.00000000; (*ppPVar3)->field_3CC = 1.00000000; - (*ppPVar3)->tint_red = 0xff; - (*ppPVar3)->tint_green = 0xff; - (*ppPVar3)->tint_blue = 0xff; - (*ppPVar3)->tint_alpha = 0.00000000; + (*ppPVar3)->colourscreenred = 0xff; + (*ppPVar3)->colourscreengreen = 0xff; + (*ppPVar3)->colourscreenblue = 0xff; + (*ppPVar3)->colourscreenfrac = 0.00000000; (*ppPVar3)->field_3E0 = -1.00000000; (*ppPVar3)->timer_for_fade = -1.00000000; - (*ppPVar3)->field_3E8 = 0xff; - (*ppPVar3)->field_3EC = 0xff; - (*ppPVar3)->field_3F0 = 0xff; - (*ppPVar3)->field_3F4 = 0xff; - (*ppPVar3)->field_3F8 = 0xff; - (*ppPVar3)->field_3FC = 0xff; - (*ppPVar3)->field_400 = 0.00000000; - (*ppPVar3)->field_404 = 0.00000000; + (*ppPVar3)->colourfaderedold = 0xff; + (*ppPVar3)->colourfaderednew = 0xff; + (*ppPVar3)->colourfadegreenold = 0xff; + (*ppPVar3)->colourfadegreennew = 0xff; + (*ppPVar3)->colourfadeblueold = 0xff; + (*ppPVar3)->colourfadebluenew = 0xff; + (*ppPVar3)->colourfadefracold = 0.00000000; + (*ppPVar3)->colourfadefracnew = 0.00000000; (*ppPVar3)->cuff_value = CUFF_BLUE; (*ppPVar3)->field_420 = 1; (*ppPVar3)->field_424 = 0; @@ -7894,7 +7845,7 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_4F0 = 0; (*ppPVar3)->field_4F4 = 1.00000000; (*ppPVar3)->field_4F8 = 1.00000000; - (*ppPVar3)->scaled_velocity = 0.00000000; + (*ppPVar3)->headpos = 0.00000000; (*ppPVar3)->field_500 = 0.00000000; (*ppPVar3)->field_504 = 0.00000000; (*ppPVar3)->field_508 = 0.00000000; @@ -7903,7 +7854,7 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_514 = 0.00000000; (*ppPVar3)->field_518 = 1.00000000; (*ppPVar3)->field_51C = 0.00000000; - (*ppPVar3)->velocity = 0.00000000; + (*ppPVar3)->headpossum = 0.00000000; (*ppPVar3)->field_524 = 0.00000000; (*ppPVar3)->field_528 = 0.00000000; (*ppPVar3)->field_52C = 0.00000000; @@ -7932,7 +7883,7 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_588 = 0.00000000; (*ppPVar3)->field_58C = 1.00000000; (*ppPVar3)->field_590 = 0.00000000; - (*ppPVar3)->field_594 = 0; + (*ppPVar3)->standcnt = 0; iVar1 = 0; do { *(undefined2 *)((int)&((*ppPVar3)->field_7D0).field_7D0 + iVar1) = 0x280; @@ -7967,7 +7918,7 @@ void initBONDdataforPlayer(PLAYER_ID player) pPVar4->right_weapon = *src; pPVar4->right_weapon_attack = src[1]; pPVar4->previous_right_weapon = src[2]; - pPVar4 = (Player *)&pPVar4->zpos; + pPVar4 = (player *)&pPVar4->zpos; src = dest; } while (dest != &iStack4); src = array234undefined4; @@ -7978,7 +7929,7 @@ void initBONDdataforPlayer(PLAYER_ID player) pPVar4->left_weapon_attack = src[1]; pPVar4->left_weapon_previous = src[2]; src = dest; - pPVar4 = (Player *)&pPVar4->zpos; + pPVar4 = (player *)&pPVar4->zpos; } while (dest != &iStack4); (*ppPVar3)->field_FC0 = 1.00000000; (*ppPVar3)->field_FC4 = 1.00000000; @@ -8036,8 +7987,8 @@ void initBONDdataforPlayer(PLAYER_ID player) (*ppPVar3)->field_10CC = 0; (*ppPVar3)->field_10D0 = 0; (*ppPVar3)->field_10D4 = 0; - (*ppPVar3)->field_10D8 = 0; - (*ppPVar3)->field_10DC = 0; + (*ppPVar3)->projmatrix = 0; + (*ppPVar3)->projmatrixf = 0; (*ppPVar3)->field_10E0 = 0; (*ppPVar3)->field_10E4 = 0; (*ppPVar3)->field_10E8 = 0; @@ -8142,8 +8093,8 @@ glabel initBONDdataforPlayer /* 0CF030 7F09A500 0C0025C8 */ jal mempAllocBytesInBank /* 0CF034 7F09A504 24050004 */ li $a1, 4 /* 0CF038 7F09A508 8FAC03D0 */ lw $t4, 0x3d0($sp) -/* 0CF03C 7F09A50C 3C198008 */ lui $t9, %hi(ptr_BONDdata_p1) -/* 0CF040 7F09A510 27399EE0 */ addiu $t9, %lo(ptr_BONDdata_p1) # addiu $t9, $t9, -0x6120 +/* 0CF03C 7F09A50C 3C198008 */ lui $t9, %hi(players) +/* 0CF040 7F09A510 27399EE0 */ addiu $t9, %lo(players) # addiu $t9, $t9, -0x6120 /* 0CF044 7F09A514 000C6880 */ sll $t5, $t4, 2 /* 0CF048 7F09A518 01B91821 */ addu $v1, $t5, $t9 /* 0CF04C 7F09A51C AC620000 */ sw $v0, ($v1) @@ -8956,8 +8907,8 @@ glabel initBONDdataforPlayer /* 0CFC10 7F09B0A0 0C0025CC */ jal mempAllocBytesInBank /* 0CFC14 7F09B0A4 24050004 */ li $a1, 4 /* 0CFC18 7F09B0A8 8FAC03D0 */ lw $t4, 0x3d0($sp) -/* 0CFC1C 7F09B0AC 3C198008 */ lui $t9, %hi(ptr_BONDdata_p1) # $t9, 0x8008 -/* 0CFC20 7F09B0B0 27399F50 */ addiu $t9, %lo(ptr_BONDdata_p1) # addiu $t9, $t9, -0x60b0 +/* 0CFC1C 7F09B0AC 3C198008 */ lui $t9, %hi(players) # $t9, 0x8008 +/* 0CFC20 7F09B0B0 27399F50 */ addiu $t9, %lo(players) # addiu $t9, $t9, -0x60b0 /* 0CFC24 7F09B0B4 000C6880 */ sll $t5, $t4, 2 /* 0CFC28 7F09B0B8 01B91821 */ addu $v1, $t5, $t9 /* 0CFC2C 7F09B0BC AC620000 */ sw $v0, ($v1) @@ -9737,7 +9688,7 @@ glabel initBONDdataforPlayer #ifdef NONMATCHING void set_cur_player(PLAYER_ID playernum) { - pPlayer = ptr_BONDdata_p1[playernum]; + pPlayer = players[playernum]; pPlayersPerm = player1_playerdata[playernum]; player_num = playernum; return; @@ -9747,9 +9698,9 @@ GLOBAL_ASM( .text glabel set_cur_player /* 0CFC3C 7F09B10C 00047080 */ sll $t6, $a0, 2 -/* 0CFC40 7F09B110 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p1) +/* 0CFC40 7F09B110 3C0F8008 */ lui $t7, %hi(players) /* 0CFC44 7F09B114 01EE7821 */ addu $t7, $t7, $t6 -/* 0CFC48 7F09B118 8DEF9EE0 */ lw $t7, %lo(ptr_BONDdata_p1)($t7) +/* 0CFC48 7F09B118 8DEF9EE0 */ lw $t7, %lo(players)($t7) /* 0CFC4C 7F09B11C 3C018008 */ lui $at, %hi(player_num) /* 0CFC50 7F09B120 AC24A0B8 */ sw $a0, %lo(player_num)($at) /* 0CFC54 7F09B124 0004C0C0 */ sll $t8, $a0, 3 @@ -9779,21 +9730,21 @@ s32 get_cur_playernum(void) { #ifdef NONMATCHING -void proc_7F09B15C(int position_data_pointer) +void proc_7F09B15C(int prop) { - Player *pPVar1; + player *pPVar1; s32 numplayers; - Player **ppPVar2; + player **ppPVar2; int i; i = 0; - numplayers = get_num_players(); + numplayers = getPlayerCount(); if (0 < numplayers) { - ppPVar2 = ptr_BONDdata_p1; - pPVar1 = ptr_BONDdata_p1[0]; - while (ppPVar2 = ppPVar2 + 1, position_data_pointer != pPVar1->position_data_pointer) { + ppPVar2 = players; + pPVar1 = players[0]; + while (ppPVar2 = ppPVar2 + 1, prop != pPVar1->prop) { i = i + 1; - numplayers = get_num_players(); + numplayers = getPlayerCount(); if (numplayers <= i) { return; } @@ -9812,12 +9763,12 @@ glabel sub_GAME_7F09B15C /* 0CFC98 7F09B168 AFB1001C */ sw $s1, 0x1c($sp) /* 0CFC9C 7F09B16C 00809025 */ move $s2, $a0 /* 0CFCA0 7F09B170 AFB00018 */ sw $s0, 0x18($sp) -/* 0CFCA4 7F09B174 0FC26919 */ jal get_num_players +/* 0CFCA4 7F09B174 0FC26919 */ jal getPlayerCount /* 0CFCA8 7F09B178 00008825 */ move $s1, $zero /* 0CFCAC 7F09B17C 18400010 */ blez $v0, .L7F09B1C0 /* 0CFCB0 7F09B180 00117080 */ sll $t6, $s1, 2 -/* 0CFCB4 7F09B184 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p1) -/* 0CFCB8 7F09B188 25EF9EE0 */ addiu $t7, %lo(ptr_BONDdata_p1) # addiu $t7, $t7, -0x6120 +/* 0CFCB4 7F09B184 3C0F8008 */ lui $t7, %hi(players) +/* 0CFCB8 7F09B188 25EF9EE0 */ addiu $t7, %lo(players) # addiu $t7, $t7, -0x6120 /* 0CFCBC 7F09B18C 01CF8021 */ addu $s0, $t6, $t7 /* 0CFCC0 7F09B190 8E180000 */ lw $t8, ($s0) .L7F09B194: @@ -9828,7 +9779,7 @@ glabel sub_GAME_7F09B15C /* 0CFCD4 7F09B1A4 10000007 */ b .L7F09B1C4 /* 0CFCD8 7F09B1A8 02201025 */ move $v0, $s1 .L7F09B1AC: -/* 0CFCDC 7F09B1AC 0FC26919 */ jal get_num_players +/* 0CFCDC 7F09B1AC 0FC26919 */ jal getPlayerCount /* 0CFCE0 7F09B1B0 26310001 */ addiu $s1, $s1, 1 /* 0CFCE4 7F09B1B4 0222082A */ slt $at, $s1, $v0 /* 0CFCE8 7F09B1B8 5420FFF6 */ bnezl $at, .L7F09B194 @@ -10284,7 +10235,7 @@ loop_1: { // Node 2 phi_v1_2 = phi_v1_3; - if (*(&ptr_BONDdata_p1 + (temp_v0 * 4)) != 0) + if (*(&players + (temp_v0 * 4)) != 0) { // Node 3 phi_v1_2 = (phi_v1_3 + 1); @@ -10307,9 +10258,9 @@ GLOBAL_ASM( glabel sub_GAME_7F09B4D8 /* 0D0008 7F09B4D8 3C058008 */ lui $a1, %hi(dword_CODE_bss_8007A0C0) /* 0D000C 7F09B4DC 3C078008 */ lui $a3, %hi(dword_CODE_bss_8007A0D0) -/* 0D0010 7F09B4E0 3C068008 */ lui $a2, %hi(ptr_BONDdata_p1) +/* 0D0010 7F09B4E0 3C068008 */ lui $a2, %hi(players) /* 0D0014 7F09B4E4 00001825 */ move $v1, $zero -/* 0D0018 7F09B4E8 24C69EE0 */ addiu $a2, %lo(ptr_BONDdata_p1) # addiu $a2, $a2, -0x6120 +/* 0D0018 7F09B4E8 24C69EE0 */ addiu $a2, %lo(players) # addiu $a2, $a2, -0x6120 /* 0D001C 7F09B4EC 24E7A0D0 */ addiu $a3, %lo(dword_CODE_bss_8007A0D0) # addiu $a3, $a3, -0x5f30 /* 0D0020 7F09B4F0 24A5A0C0 */ addiu $a1, %lo(dword_CODE_bss_8007A0C0) # addiu $a1, $a1, -0x5f40 /* 0D0024 7F09B4F4 8CA20000 */ lw $v0, ($a1) @@ -10338,25 +10289,25 @@ glabel sub_GAME_7F09B4D8 #ifdef NONMATCHING int proc_7F09B528(int param_1) { - if (ptr_BONDdata_p1[dword_CODE_bss_8007A0C0] != NULL) { + if (players[dword_CODE_bss_8007A0C0] != NULL) { if (param_1 == 0) { return dword_CODE_bss_8007A0C0; } param_1--; } - if (ptr_BONDdata_p1[dword_CODE_bss_8007A0C4] != NULL) { + if (players[dword_CODE_bss_8007A0C4] != NULL) { if (param_1 == 0) { return dword_CODE_bss_8007A0C4; } param_1--; } - if (ptr_BONDdata_p1[dword_CODE_bss_8007A0C8] != NULL) { + if (players[dword_CODE_bss_8007A0C8] != NULL) { if (param_1 == 0) { return dword_CODE_bss_8007A0C8; } param_1--; } - if ((ptr_BONDdata_p1[dword_CODE_bss_8007A0CC] != NULL) && (param_1 == 0)) { + if ((players[dword_CODE_bss_8007A0CC] != NULL) && (param_1 == 0)) { return dword_CODE_bss_8007A0CC; } return 0; @@ -10367,8 +10318,8 @@ GLOBAL_ASM( glabel sub_GAME_7F09B528 /* 0D0058 7F09B528 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007A0C0) /* 0D005C 7F09B52C 8C63A0C0 */ lw $v1, %lo(dword_CODE_bss_8007A0C0)($v1) -/* 0D0060 7F09B530 3C028008 */ lui $v0, %hi(ptr_BONDdata_p1) -/* 0D0064 7F09B534 24429EE0 */ addiu $v0, %lo(ptr_BONDdata_p1) # addiu $v0, $v0, -0x6120 +/* 0D0060 7F09B530 3C028008 */ lui $v0, %hi(players) +/* 0D0064 7F09B534 24429EE0 */ addiu $v0, %lo(players) # addiu $v0, $v0, -0x6120 /* 0D0068 7F09B538 00037080 */ sll $t6, $v1, 2 /* 0D006C 7F09B53C 004E7821 */ addu $t7, $v0, $t6 /* 0D0070 7F09B540 8DF80000 */ lw $t8, ($t7) diff --git a/src/game/unk_093880.h b/src/game/unk_093880.h index 61e33746..2e473c32 100644 --- a/src/game/unk_093880.h +++ b/src/game/unk_093880.h @@ -37,11 +37,13 @@ struct player_data { int killed_civilians; }; +extern struct player *players[4]; + extern struct player_data player1_player_data; extern struct player_data player2_player_data; extern struct player_data player3_player_data; extern struct player_data player4_player_data; -extern struct Player * pPlayer; +extern struct player *pPlayer; extern struct player_data *pPlayersPerm; #endif diff --git a/src/game/unk_09B7A0.c b/src/game/unk_09B7A0.c index d322af87..b9c146b3 100644 --- a/src/game/unk_09B7A0.c +++ b/src/game/unk_09B7A0.c @@ -105,7 +105,7 @@ GLOBAL_ASM( glabel sub_GAME_7F09B820 /* 0D0350 7F09B820 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0D0354 7F09B824 AFBF0014 */ sw $ra, 0x14($sp) -/* 0D0358 7F09B828 0FC26919 */ jal get_num_players +/* 0D0358 7F09B828 0FC26919 */ jal getPlayerCount /* 0D035C 7F09B82C 00000000 */ nop /* 0D0360 7F09B830 28410002 */ slti $at, $v0, 2 /* 0D0364 7F09B834 1420000F */ bnez $at, .L7F09B874 diff --git a/src/game/unk_09C250.c b/src/game/unk_09C250.c index f179fdfd..0bfe2189 100644 --- a/src/game/unk_09C250.c +++ b/src/game/unk_09C250.c @@ -345,7 +345,7 @@ glabel sub_GAME_7F09C250 /* 0D0FBC 7F09C48C E51203D4 */ swc1 $f18, 0x3d4($t0) /* 0D0FC0 7F09C490 C5240010 */ lwc1 $f4, 0x10($t1) /* 0D0FC4 7F09C494 E50403D8 */ swc1 $f4, 0x3d8($t0) -/* 0D0FC8 7F09C498 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 0D0FC8 7F09C498 0FC2CBF6 */ jal getTileRoom /* 0D0FCC 7F09C49C 8D240014 */ lw $a0, 0x14($t1) /* 0D0FD0 7F09C4A0 8FA80040 */ lw $t0, 0x40($sp) /* 0D0FD4 7F09C4A4 10000016 */ b .L7F09C500 @@ -365,7 +365,7 @@ glabel sub_GAME_7F09C250 /* 0D1008 7F09C4D8 E50A03D4 */ swc1 $f10, 0x3d4($t0) /* 0D100C 7F09C4DC C6700008 */ lwc1 $f16, 8($s3) /* 0D1010 7F09C4E0 E51003D8 */ swc1 $f16, 0x3d8($t0) -/* 0D1014 7F09C4E4 0FC2CBF6 */ jal sub_GAME_7F0B2FD8 +/* 0D1014 7F09C4E4 0FC2CBF6 */ jal getTileRoom /* 0D1018 7F09C4E8 8FA40050 */ lw $a0, 0x50($sp) /* 0D101C 7F09C4EC 8FA80040 */ lw $t0, 0x40($sp) /* 0D1020 7F09C4F0 10000003 */ b .L7F09C500 @@ -450,7 +450,7 @@ glabel sub_GAME_7F09C250 /* 0D1148 7F09C618 5420FFF5 */ bnezl $at, .L7F09C5F0 /* 0D114C 7F09C61C C6280028 */ lwc1 $f8, 0x28($s1) .L7F09C620: -/* 0D1150 7F09C620 0FC26919 */ jal get_num_players +/* 0D1150 7F09C620 0FC26919 */ jal getPlayerCount /* 0D1154 7F09C624 00000000 */ nop /* 0D1158 7F09C628 28410002 */ slti $at, $v0, 2 /* 0D115C 7F09C62C 14200058 */ bnez $at, .L7F09C790 @@ -714,7 +714,7 @@ glabel sub_GAME_7F09C250 /* 0D1B7C 7F09D00C E69203D4 */ swc1 $f18, 0x3d4($s4) /* 0D1B80 7F09D010 C5040010 */ lwc1 $f4, 0x10($t0) /* 0D1B84 7F09D014 E68403D8 */ swc1 $f4, 0x3d8($s4) -/* 0D1B88 7F09D018 0FC2CEE2 */ jal sub_GAME_7F0B2FD8 +/* 0D1B88 7F09D018 0FC2CEE2 */ jal getTileRoom /* 0D1B8C 7F09D01C 8D040014 */ lw $a0, 0x14($t0) /* 0D1B90 7F09D020 10000014 */ b .Ljp7F09D074 /* 0D1B94 7F09D024 A68203DC */ sh $v0, 0x3dc($s4) @@ -732,7 +732,7 @@ glabel sub_GAME_7F09C250 /* 0D1BC0 7F09D050 E68A03D4 */ swc1 $f10, 0x3d4($s4) /* 0D1BC4 7F09D054 C6700008 */ lwc1 $f16, 8($s3) /* 0D1BC8 7F09D058 E69003D8 */ swc1 $f16, 0x3d8($s4) -/* 0D1BCC 7F09D05C 0FC2CEE2 */ jal sub_GAME_7F0B2FD8 +/* 0D1BCC 7F09D05C 0FC2CEE2 */ jal getTileRoom /* 0D1BD0 7F09D060 8FA40058 */ lw $a0, 0x58($sp) /* 0D1BD4 7F09D064 10000003 */ b .Ljp7F09D074 /* 0D1BD8 7F09D068 A68203DC */ sh $v0, 0x3dc($s4) @@ -814,7 +814,7 @@ glabel sub_GAME_7F09C250 /* 0D1CF4 7F09D184 5420FFF5 */ bnezl $at, .Ljp7F09D15C /* 0D1CF8 7F09D188 C6280028 */ lwc1 $f8, 0x28($s1) .Ljp7F09D18C: -/* 0D1CFC 7F09D18C 0FC26C01 */ jal get_num_players +/* 0D1CFC 7F09D18C 0FC26C01 */ jal getPlayerCount /* 0D1D00 7F09D190 00000000 */ nop /* 0D1D04 7F09D194 28410002 */ slti $at, $v0, 2 /* 0D1D08 7F09D198 14200058 */ bnez $at, .Ljp7F09D2FC @@ -1568,7 +1568,7 @@ glabel sub_GAME_7F09C9D8 /* 0D195C 7F09CE2C 02002025 */ move $a0, $s0 /* 0D1960 7F09CE30 0FC26C43 */ jal set_cur_player /* 0D1964 7F09CE34 00402025 */ move $a0, $v0 -/* 0D1968 7F09CE38 0FC26919 */ jal get_num_players +/* 0D1968 7F09CE38 0FC26919 */ jal getPlayerCount /* 0D196C 7F09CE3C 00000000 */ nop /* 0D1970 7F09CE40 14540004 */ bne $v0, $s4, .L7F09CE54 /* 0D1974 7F09CE44 3C018004 */ lui $at, %hi(D_80040178) @@ -2066,7 +2066,7 @@ GLOBAL_ASM( glabel sub_GAME_7F09D4EC /* 0D201C 7F09D4EC 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0D2020 7F09D4F0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0D2024 7F09D4F4 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0D2024 7F09D4F4 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0D2028 7F09D4F8 AFA40018 */ sw $a0, 0x18($sp) /* 0D202C 7F09D4FC 8FA40018 */ lw $a0, 0x18($sp) /* 0D2030 7F09D500 C4440008 */ lwc1 $f4, 8($v0) @@ -2244,7 +2244,7 @@ glabel sub_GAME_7F09D5A0 /* 0D227C 7F09D74C 37180040 */ ori $t8, (0x01030040 & 0xFFFF) # ori $t8, $t8, 0x40 /* 0D2280 7F09D750 02809025 */ move $s2, $s4 /* 0D2284 7F09D754 AE580000 */ sw $t8, ($s2) -/* 0D2288 7F09D758 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0D2288 7F09D758 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0D228C 7F09D75C 26940008 */ addiu $s4, $s4, 8 /* 0D2290 7F09D760 0C003A2C */ jal osVirtualToPhysical /* 0D2294 7F09D764 00402025 */ move $a0, $v0 @@ -2336,7 +2336,7 @@ glabel sub_GAME_7F09D82C /* 0D2398 7F09D868 00C08825 */ move $s1, $a2 /* 0D239C 7F09D86C 00A09025 */ move $s2, $a1 /* 0D23A0 7F09D870 ADC8000C */ sw $t0, 0xc($t6) -/* 0D23A4 7F09D874 0FC1E111 */ jal sub_GAME_7F078444 +/* 0D23A4 7F09D874 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0D23A8 7F09D878 ADC10008 */ sw $at, 8($t6) /* 0D23AC 7F09D87C 0FC227F5 */ jal get_BONDdata_position /* 0D23B0 7F09D880 AFA2009C */ sw $v0, 0x9c($sp) @@ -2716,7 +2716,7 @@ glabel sub_GAME_7F09DDA4 /* 0D2924 7F09DDF4 00809025 */ move $s2, $a0 /* 0D2928 7F09DDF8 00E09825 */ move $s3, $a3 /* 0D292C 7F09DDFC ADC8000C */ sw $t0, 0xc($t6) -/* 0D2930 7F09DE00 0FC1E111 */ jal sub_GAME_7F078444 +/* 0D2930 7F09DE00 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0D2934 7F09DE04 ADC10008 */ sw $at, 8($t6) /* 0D2938 7F09DE08 0FC227F5 */ jal get_BONDdata_position /* 0D293C 7F09DE0C AFA200BC */ sw $v0, 0xbc($sp) @@ -3328,7 +3328,7 @@ glabel sub_GAME_7F09E700 /* 0D323C 7F09E70C AFA50034 */ sw $a1, 0x34($sp) /* 0D3240 7F09E710 AFA60038 */ sw $a2, 0x38($sp) /* 0D3244 7F09E714 AFA7003C */ sw $a3, 0x3c($sp) -/* 0D3248 7F09E718 0FC26919 */ jal get_num_players +/* 0D3248 7F09E718 0FC26919 */ jal getPlayerCount /* 0D324C 7F09E71C AFA0002C */ sw $zero, 0x2c($sp) /* 0D3250 7F09E720 3C0B8004 */ lui $t3, %hi(D_8004017C) /* 0D3254 7F09E724 3C078008 */ lui $a3, %hi(ptr_smoke_buf) @@ -3962,7 +3962,7 @@ GLOBAL_ASM( glabel sub_GAME_7F09EF9C /* 0D3ACC 7F09EF9C 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0D3AD0 7F09EFA0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0D3AD4 7F09EFA4 0FC1E0F1 */ jal get_BONDdata_field_10CC +/* 0D3AD4 7F09EFA4 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0D3AD8 7F09EFA8 AFA40018 */ sw $a0, 0x18($sp) /* 0D3ADC 7F09EFAC 8FA40018 */ lw $a0, 0x18($sp) /* 0D3AE0 7F09EFB0 C4440008 */ lwc1 $f4, 8($v0) @@ -4140,7 +4140,7 @@ glabel sub_GAME_7F09F03C /* 0D3D38 7F09F208 35EF0040 */ ori $t7, (0x01030040 & 0xFFFF) # ori $t7, $t7, 0x40 /* 0D3D3C 7F09F20C 02408025 */ move $s0, $s2 /* 0D3D40 7F09F210 AE0F0000 */ sw $t7, ($s0) -/* 0D3D44 7F09F214 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0D3D44 7F09F214 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0D3D48 7F09F218 26520008 */ addiu $s2, $s2, 8 /* 0D3D4C 7F09F21C 0C003A2C */ jal osVirtualToPhysical /* 0D3D50 7F09F220 00402025 */ move $a0, $v0 @@ -5213,7 +5213,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 get_BONDdata_field_10CC +/* 0D4C70 7F0A0140 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0D4C74 7F0A0144 00000000 */ nop /* 0D4C78 7F0A0148 00402025 */ move $a0, $v0 /* 0D4C7C 7F0A014C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -5364,7 +5364,7 @@ glabel sub_GAME_7F0A027C /* 0D4E5C 7F0A032C A3AA004B */ sb $t2, 0x4b($sp) /* 0D4E60 7F0A0330 0FC2F285 */ jal sub_GAME_7F0BCA14 /* 0D4E64 7F0A0334 87A40072 */ lh $a0, 0x72($sp) -/* 0D4E68 7F0A0338 0FC26919 */ jal get_num_players +/* 0D4E68 7F0A0338 0FC26919 */ jal getPlayerCount /* 0D4E6C 7F0A033C 00408025 */ move $s0, $v0 /* 0D4E70 7F0A0340 28410002 */ slti $at, $v0, 2 /* 0D4E74 7F0A0344 102001D2 */ beqz $at, .L7F0A0A90 @@ -5872,7 +5872,7 @@ glabel sub_GAME_7F0A0AB4 /* 0D5604 7F0A0AD4 AFB10020 */ sw $s1, 0x20($sp) /* 0D5608 7F0A0AD8 AFB0001C */ sw $s0, 0x1c($sp) /* 0D560C 7F0A0ADC AFA40040 */ sw $a0, 0x40($sp) -/* 0D5610 7F0A0AE0 0FC26919 */ jal get_num_players +/* 0D5610 7F0A0AE0 0FC26919 */ jal getPlayerCount /* 0D5614 7F0A0AE4 2413FFFF */ li $s3, -1 /* 0D5618 7F0A0AE8 28410002 */ slti $at, $v0, 2 /* 0D561C 7F0A0AEC 14200003 */ bnez $at, .L7F0A0AFC diff --git a/src/game/unk_0A1DA0.c b/src/game/unk_0A1DA0.c index 09f4e151..37351fc8 100644 --- a/src/game/unk_0A1DA0.c +++ b/src/game/unk_0A1DA0.c @@ -41,8 +41,8 @@ u32 D_80040988 = 0; u32 D_8004098C = 0; u32 D_80040990 = 0; u32 watch_screen_index = 0; -u32 D_80040998 = 0; -u32 D_8004099C = 0; +u32 controller_options_index = 0; +u32 game_options_index = 0; // rodata @@ -1264,7 +1264,7 @@ glabel sub_GAME_7F0A2C44 /* 0D79F4 7F0A2EC4 356B0040 */ ori $t3, (0x01030040 & 0xFFFF) # ori $t3, $t3, 0x40 /* 0D79F8 7F0A2EC8 260A0008 */ addiu $t2, $s0, 8 /* 0D79FC 7F0A2ECC AFAA00D0 */ sw $t2, 0xd0($sp) -/* 0D7A00 7F0A2ED0 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0D7A00 7F0A2ED0 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0D7A04 7F0A2ED4 AE0B0000 */ sw $t3, ($s0) /* 0D7A08 7F0A2ED8 AE020004 */ sw $v0, 4($s0) /* 0D7A0C 7F0A2EDC 8FB100D0 */ lw $s1, 0xd0($sp) @@ -1272,7 +1272,7 @@ glabel sub_GAME_7F0A2C44 /* 0D7A14 7F0A2EE4 35CE0040 */ ori $t6, (0x01020040 & 0xFFFF) # ori $t6, $t6, 0x40 /* 0D7A18 7F0A2EE8 262D0008 */ addiu $t5, $s1, 8 /* 0D7A1C 7F0A2EEC AFAD00D0 */ sw $t5, 0xd0($sp) -/* 0D7A20 7F0A2EF0 0FC1E0D5 */ jal get_BONDdata_field_10C8 +/* 0D7A20 7F0A2EF0 0FC1E0D5 */ jal currentPlayerGetMatrix10C8 /* 0D7A24 7F0A2EF4 AE2E0000 */ sw $t6, ($s1) /* 0D7A28 7F0A2EF8 AE220004 */ sw $v0, 4($s1) /* 0D7A2C 7F0A2EFC 8FBF0044 */ lw $ra, 0x44($sp) @@ -2595,7 +2595,7 @@ glabel sub_GAME_7F0A3F04 /* 0D8A98 7F0A3F68 8F29000C */ lw $t1, 0xc($t9) /* 0D8A9C 7F0A3F6C 8F210008 */ lw $at, 8($t9) /* 0D8AA0 7F0A3F70 AF09000C */ sw $t1, 0xc($t8) -/* 0D8AA4 7F0A3F74 0FC1E111 */ jal sub_GAME_7F078444 +/* 0D8AA4 7F0A3F74 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0D8AA8 7F0A3F78 AF010008 */ sw $at, 8($t8) /* 0D8AAC 7F0A3F7C 8FAA00BC */ lw $t2, 0xbc($sp) /* 0D8AB0 7F0A3F80 24040004 */ li $a0, 4 @@ -2946,7 +2946,7 @@ glabel sub_GAME_7F0A3F04 /* 0D9014 7F0A44E4 358C0040 */ ori $t4, (0x01030040 & 0xFFFF) # ori $t4, $t4, 0x40 /* 0D9018 7F0A44E8 262D0008 */ addiu $t5, $s1, 8 /* 0D901C 7F0A44EC AFAD00A0 */ sw $t5, 0xa0($sp) -/* 0D9020 7F0A44F0 0FC1E0DD */ jal get_BONDdata_field_10D8 +/* 0D9020 7F0A44F0 0FC1E0DD */ jal currentPlayerGetProjectionMatrix /* 0D9024 7F0A44F4 AE2C0000 */ sw $t4, ($s1) /* 0D9028 7F0A44F8 0C003A2C */ jal osVirtualToPhysical /* 0D902C 7F0A44FC 00402025 */ move $a0, $v0 @@ -3027,7 +3027,7 @@ 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 get_BONDdata_field_10CC +/* 0D90E0 7F0A45B0 0FC1E0F1 */ jal currentPlayerGetMatrix10CC /* 0D90E4 7F0A45B4 E7A80024 */ swc1 $f8, 0x24($sp) /* 0D90E8 7F0A45B8 00402025 */ move $a0, $v0 /* 0D90EC 7F0A45BC 0FC1611D */ jal matrix_4x4_transform_vector_in_place diff --git a/src/game/unk_0A1DA0.h b/src/game/unk_0A1DA0.h index c118f9de..9cab70aa 100644 --- a/src/game/unk_0A1DA0.h +++ b/src/game/unk_0A1DA0.h @@ -10,7 +10,7 @@ extern u32 D_80040988; extern u32 D_8004098C; extern u32 D_80040990; extern u32 watch_screen_index; -extern u32 D_80040998; -extern u32 D_8004099C; +extern u32 controller_options_index; +extern u32 game_options_index; #endif diff --git a/src/game/unk_0B3200.c b/src/game/unk_0B3200.c index 426bb688..4c0d5d5a 100644 --- a/src/game/unk_0B3200.c +++ b/src/game/unk_0B3200.c @@ -90,7 +90,7 @@ glabel sub_GAME_7F0B3200 #ifdef NONMATCHING -f32 sub_GAME_7F0B32D8(struct xyzpoint *param_1,struct xyzpoint *param_2,struct xyzpoint *param_3) +f32 sub_GAME_7F0B32D8(struct coord *param_1,struct coord *param_2,struct coord *param_3) { diff --git a/src/game/unk_0BC530.c b/src/game/unk_0BC530.c index d346af35..7d273f04 100644 --- a/src/game/unk_0BC530.c +++ b/src/game/unk_0BC530.c @@ -22,19 +22,19 @@ glabel sub_GAME_7F0BC530 /* 0F1068 7F0BC538 AFB00018 */ sw $s0, 0x18($sp) /* 0F106C 7F0BC53C AFB20020 */ sw $s2, 0x20($sp) /* 0F1070 7F0BC540 AFB1001C */ sw $s1, 0x1c($sp) -/* 0F1074 7F0BC544 0FC26919 */ jal get_num_players +/* 0F1074 7F0BC544 0FC26919 */ jal getPlayerCount /* 0F1078 7F0BC548 00008025 */ move $s0, $zero /* 0F107C 7F0BC54C 1840000D */ blez $v0, .L7F0BC584 /* 0F1080 7F0BC550 00107080 */ sll $t6, $s0, 2 -/* 0F1084 7F0BC554 3C0F8008 */ lui $t7, %hi(ptr_BONDdata_p1) -/* 0F1088 7F0BC558 25EF9EE0 */ addiu $t7, %lo(ptr_BONDdata_p1) # addiu $t7, $t7, -0x6120 +/* 0F1084 7F0BC554 3C0F8008 */ lui $t7, %hi(players) +/* 0F1088 7F0BC558 25EF9EE0 */ addiu $t7, %lo(players) # addiu $t7, $t7, -0x6120 /* 0F108C 7F0BC55C 01CF8821 */ addu $s1, $t6, $t7 /* 0F1090 7F0BC560 2412FFFF */ li $s2, -1 /* 0F1094 7F0BC564 8E380000 */ lw $t8, ($s1) .L7F0BC568: /* 0F1098 7F0BC568 26100001 */ addiu $s0, $s0, 1 /* 0F109C 7F0BC56C 26310004 */ addiu $s1, $s1, 4 -/* 0F10A0 7F0BC570 0FC26919 */ jal get_num_players +/* 0F10A0 7F0BC570 0FC26919 */ jal getPlayerCount /* 0F10A4 7F0BC574 AF12108C */ sw $s2, 0x108c($t8) /* 0F10A8 7F0BC578 0202082A */ slt $at, $s0, $v0 /* 0F10AC 7F0BC57C 5420FFFA */ bnezl $at, .L7F0BC568 diff --git a/src/game/unk_0C0A70.c b/src/game/unk_0C0A70.c index 2b1c6718..fab73eca 100644 --- a/src/game/unk_0C0A70.c +++ b/src/game/unk_0C0A70.c @@ -207,7 +207,7 @@ void sub_GAME_7F0C0BE4(s32 arg0) { } void sub_GAME_7F0C0BF0(void) { - sub_GAME_7F0A9358(); + get_mTrack2Vol(); } diff --git a/src/game/viewport.c b/src/game/viewport.c index fd2a2c52..05bf5451 100644 --- a/src/game/viewport.c +++ b/src/game/viewport.c @@ -2,298 +2,81 @@ #include "game/bond.h" // bss -s32 viewport_img_width; -s32 viewport_img_height; - +s32 z_buffer_width; +s32 z_buffer_height; // data -s32 viewport_img = 0; +s32 z_buffer = 0; - -void remove_viewport_buffer(void) { - viewport_img = 0; +void zbufDeallocate(void) { + z_buffer = 0; } - -#ifdef NONMATCHING -void allocate_viewport_buffer(void) { - -} -#else -GLOBAL_ASM( -.text -glabel allocate_viewport_buffer -/* 106EBC 7F0D238C 3C0E8003 */ lui $t6, %hi(resolution) -/* 106EC0 7F0D2390 8DCE6428 */ lw $t6, %lo(resolution)($t6) -/* 106EC4 7F0D2394 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 106EC8 7F0D2398 AFBF0014 */ sw $ra, 0x14($sp) -/* 106ECC 7F0D239C 11C00008 */ beqz $t6, .L7F0D23C0 -/* 106ED0 7F0D23A0 3C028009 */ lui $v0, %hi(viewport_img_height) -/* 106ED4 7F0D23A4 240F01B8 */ li $t7, 440 -/* 106ED8 7F0D23A8 3C018009 */ lui $at, %hi(viewport_img_width) -/* 106EDC 7F0D23AC 2442E314 */ addiu $v0, %lo(viewport_img_height) # addiu $v0, $v0, -0x1cec -/* 106EE0 7F0D23B0 AC2FE310 */ sw $t7, %lo(viewport_img_width)($at) -/* 106EE4 7F0D23B4 2418014A */ li $t8, 330 -/* 106EE8 7F0D23B8 10000010 */ b .L7F0D23FC -/* 106EEC 7F0D23BC AC580000 */ sw $t8, ($v0) -.L7F0D23C0: -/* 106EF0 7F0D23C0 24190140 */ li $t9, 320 -/* 106EF4 7F0D23C4 3C018009 */ lui $at, %hi(viewport_img_width) -/* 106EF8 7F0D23C8 0FC26919 */ jal get_num_players -/* 106EFC 7F0D23CC AC39E310 */ sw $t9, %lo(viewport_img_width)($at) -/* 106F00 7F0D23D0 24010001 */ li $at, 1 -/* 106F04 7F0D23D4 14410005 */ bne $v0, $at, .L7F0D23EC -/* 106F08 7F0D23D8 3C028009 */ lui $v0, %hi(viewport_img_height) -/* 106F0C 7F0D23DC 2442E314 */ addiu $v0, %lo(viewport_img_height) # addiu $v0, $v0, -0x1cec -/* 106F10 7F0D23E0 240800F0 */ li $t0, 240 -/* 106F14 7F0D23E4 10000005 */ b .L7F0D23FC -/* 106F18 7F0D23E8 AC480000 */ sw $t0, ($v0) -.L7F0D23EC: -/* 106F1C 7F0D23EC 3C028009 */ lui $v0, %hi(viewport_img_height) -/* 106F20 7F0D23F0 2442E314 */ addiu $v0, %lo(viewport_img_height) # addiu $v0, $v0, -0x1cec -/* 106F24 7F0D23F4 24090078 */ li $t1, 120 -/* 106F28 7F0D23F8 AC490000 */ sw $t1, ($v0) -.L7F0D23FC: -/* 106F2C 7F0D23FC 3C0A8009 */ lui $t2, %hi(viewport_img_width) -/* 106F30 7F0D2400 8D4AE310 */ lw $t2, %lo(viewport_img_width)($t2) -/* 106F34 7F0D2404 8C4B0000 */ lw $t3, ($v0) -/* 106F38 7F0D2408 24050004 */ li $a1, 4 -/* 106F3C 7F0D240C 014B0019 */ multu $t2, $t3 -/* 106F40 7F0D2410 00002012 */ mflo $a0 -/* 106F44 7F0D2414 00046040 */ sll $t4, $a0, 1 -/* 106F48 7F0D2418 0C0025C8 */ jal mempAllocBytesInBank -/* 106F4C 7F0D241C 25840040 */ addiu $a0, $t4, 0x40 -/* 106F50 7F0D2420 8FBF0014 */ lw $ra, 0x14($sp) -/* 106F54 7F0D2424 3C038005 */ lui $v1, %hi(viewport_img) -/* 106F58 7F0D2428 2463EB00 */ addiu $v1, %lo(viewport_img) # addiu $v1, $v1, -0x1500 -/* 106F5C 7F0D242C 244E003F */ addiu $t6, $v0, 0x3f -/* 106F60 7F0D2430 2401FFC0 */ li $at, -64 -/* 106F64 7F0D2434 AC620000 */ sw $v0, ($v1) -/* 106F68 7F0D2438 01C17824 */ and $t7, $t6, $at -/* 106F6C 7F0D243C AC6F0000 */ sw $t7, ($v1) -/* 106F70 7F0D2440 03E00008 */ jr $ra -/* 106F74 7F0D2444 27BD0018 */ addiu $sp, $sp, 0x18 -) -#endif - - -void sub_GAME_7F0D2448(s32 vp_image, s32 vp_width, s32 vp_height) { - viewport_img = vp_image; - viewport_img_width = vp_width; - viewport_img_height = vp_height; +#define ALIGN64(val) (((val) + 0x3F) & ~0x3F) +u32 mempAllocBytesInBank(u32 bytes,u8 bank); +s32 getPlayerCount(void); +void zbufAllocate(void) { + if (resolution != 0) { + z_buffer_width = 440; + z_buffer_height = 330; + } else { + z_buffer_width = 320; + if (getPlayerCount() == 1) { + z_buffer_height = 240; + } else { + z_buffer_height = 120; + } + } + z_buffer = mempAllocBytesInBank((z_buffer_width * z_buffer_height * 2) + 64, 4); + z_buffer = ALIGN64(z_buffer); } - - - -#ifdef NONMATCHING -void sub_GAME_7F0D2464(void) { - +void zbufSetBuffer(s32 buffer, s32 width, s32 height) { + z_buffer = buffer; + z_buffer_width = width; + z_buffer_height = height; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0D2464 -/* 106F94 7F0D2464 3C0E8005 */ lui $t6, %hi(viewport_img) -/* 106F98 7F0D2468 8DCEEB00 */ lw $t6, %lo(viewport_img)($t6) -/* 106F9C 7F0D246C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 106FA0 7F0D2470 AFBF0014 */ sw $ra, 0x14($sp) -/* 106FA4 7F0D2474 15C00004 */ bnez $t6, .L7F0D2488 -/* 106FA8 7F0D2478 00803025 */ move $a2, $a0 -/* 106FAC 7F0D247C 0FC348E3 */ jal allocate_viewport_buffer -/* 106FB0 7F0D2480 AFA40018 */ sw $a0, 0x18($sp) -/* 106FB4 7F0D2484 8FA60018 */ lw $a2, 0x18($sp) -.L7F0D2488: -/* 106FB8 7F0D2488 0FC26C54 */ jal get_cur_playernum -/* 106FBC 7F0D248C AFA60018 */ sw $a2, 0x18($sp) -/* 106FC0 7F0D2490 28410002 */ slti $at, $v0, 2 -/* 106FC4 7F0D2494 1020000B */ beqz $at, .L7F0D24C4 -/* 106FC8 7F0D2498 8FA60018 */ lw $a2, 0x18($sp) -/* 106FCC 7F0D249C 0FC26919 */ jal get_num_players -/* 106FD0 7F0D24A0 AFA60018 */ sw $a2, 0x18($sp) -/* 106FD4 7F0D24A4 24010002 */ li $at, 2 -/* 106FD8 7F0D24A8 14410009 */ bne $v0, $at, .L7F0D24D0 -/* 106FDC 7F0D24AC 8FA60018 */ lw $a2, 0x18($sp) -/* 106FE0 7F0D24B0 0FC26C54 */ jal get_cur_playernum -/* 106FE4 7F0D24B4 AFA60018 */ sw $a2, 0x18($sp) -/* 106FE8 7F0D24B8 24010001 */ li $at, 1 -/* 106FEC 7F0D24BC 14410004 */ bne $v0, $at, .L7F0D24D0 -/* 106FF0 7F0D24C0 8FA60018 */ lw $a2, 0x18($sp) -.L7F0D24C4: -/* 106FF4 7F0D24C4 3C070001 */ lui $a3, (0x00012C00 >> 16) # lui $a3, 1 -/* 106FF8 7F0D24C8 10000002 */ b .L7F0D24D4 -/* 106FFC 7F0D24CC 34E72C00 */ ori $a3, (0x00012C00 & 0xFFFF) # ori $a3, $a3, 0x2c00 -.L7F0D24D0: -/* 107000 7F0D24D0 00003825 */ move $a3, $zero -.L7F0D24D4: -/* 107004 7F0D24D4 3C0F8005 */ lui $t7, %hi(viewport_img) -/* 107008 7F0D24D8 8DEFEB00 */ lw $t7, %lo(viewport_img)($t7) -/* 10700C 7F0D24DC 3C19E700 */ lui $t9, 0xe700 -/* 107010 7F0D24E0 2401FFC0 */ li $at, -64 -/* 107014 7F0D24E4 ACD90000 */ sw $t9, ($a2) -/* 107018 7F0D24E8 ACC00004 */ sw $zero, 4($a2) -/* 10701C 7F0D24EC 24C50008 */ addiu $a1, $a2, 8 -/* 107020 7F0D24F0 01E71823 */ subu $v1, $t7, $a3 -/* 107024 7F0D24F4 0061C024 */ and $t8, $v1, $at -/* 107028 7F0D24F8 3C08FE00 */ lui $t0, 0xfe00 -/* 10702C 7F0D24FC ACA80000 */ sw $t0, ($a1) -/* 107030 7F0D2500 ACB80004 */ sw $t8, 4($a1) -/* 107034 7F0D2504 8FBF0014 */ lw $ra, 0x14($sp) -/* 107038 7F0D2508 24A20008 */ addiu $v0, $a1, 8 -/* 10703C 7F0D250C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 107040 7F0D2510 03E00008 */ jr $ra -/* 107044 7F0D2514 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F0D2518(void) { +Gfx *zbufInit(Gfx *gdl) { + s32 phi_a3; + s32 test; + if (z_buffer == 0) { + zbufAllocate(); + } + if (!(get_cur_playernum() < 2) || ((getPlayerCount() == 2) && (get_cur_playernum() == 1))) { + phi_a3 = 320 * 240; + } else { + phi_a3 = 0; + } + test = (z_buffer - phi_a3); + test = test & ~0x3F; + gDPPipeSync(gdl++); + gDPSetDepthImage(gdl++, test); + return gdl; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0D2518 -/* 107048 7F0D2518 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 10704C 7F0D251C AFB00018 */ sw $s0, 0x18($sp) -/* 107050 7F0D2520 AFBF001C */ sw $ra, 0x1c($sp) -/* 107054 7F0D2524 24900008 */ addiu $s0, $a0, 8 -/* 107058 7F0D2528 3C0EE700 */ lui $t6, 0xe700 -/* 10705C 7F0D252C AC8E0000 */ sw $t6, ($a0) -/* 107060 7F0D2530 AC800004 */ sw $zero, 4($a0) -/* 107064 7F0D2534 02001825 */ move $v1, $s0 -/* 107068 7F0D2538 3C0FB900 */ lui $t7, (0xB900031D >> 16) # lui $t7, 0xb900 -/* 10706C 7F0D253C 35EF031D */ ori $t7, (0xB900031D & 0xFFFF) # ori $t7, $t7, 0x31d -/* 107070 7F0D2540 AC6F0000 */ sw $t7, ($v1) -/* 107074 7F0D2544 AC600004 */ sw $zero, 4($v1) -/* 107078 7F0D2548 3C188009 */ lui $t8, %hi(viewport_img_width) -/* 10707C 7F0D254C 8F18E310 */ lw $t8, %lo(viewport_img_width)($t8) -/* 107080 7F0D2550 26100008 */ addiu $s0, $s0, 8 -/* 107084 7F0D2554 3C01FF10 */ lui $at, 0xff10 -/* 107088 7F0D2558 2719FFFF */ addiu $t9, $t8, -1 -/* 10708C 7F0D255C 33280FFF */ andi $t0, $t9, 0xfff -/* 107090 7F0D2560 01014825 */ or $t1, $t0, $at -/* 107094 7F0D2564 02002825 */ move $a1, $s0 -/* 107098 7F0D2568 ACA90000 */ sw $t1, ($a1) -/* 10709C 7F0D256C 3C0A8005 */ lui $t2, %hi(viewport_img) -/* 1070A0 7F0D2570 8D4AEB00 */ lw $t2, %lo(viewport_img)($t2) -/* 1070A4 7F0D2574 26100008 */ addiu $s0, $s0, 8 -/* 1070A8 7F0D2578 3C018000 */ lui $at, 0x8000 -/* 1070AC 7F0D257C 02003025 */ move $a2, $s0 -/* 1070B0 7F0D2580 01415821 */ addu $t3, $t2, $at -/* 1070B4 7F0D2584 ACAB0004 */ sw $t3, 4($a1) -/* 1070B8 7F0D2588 26100008 */ addiu $s0, $s0, 8 -/* 1070BC 7F0D258C 3C0CBA00 */ lui $t4, (0xBA001402 >> 16) # lui $t4, 0xba00 -/* 1070C0 7F0D2590 358C1402 */ ori $t4, (0xBA001402 & 0xFFFF) # ori $t4, $t4, 0x1402 -/* 1070C4 7F0D2594 3C0D0030 */ lui $t5, 0x30 -/* 1070C8 7F0D2598 02003825 */ move $a3, $s0 -/* 1070CC 7F0D259C ACCD0004 */ sw $t5, 4($a2) -/* 1070D0 7F0D25A0 ACCC0000 */ sw $t4, ($a2) -/* 1070D4 7F0D25A4 3C0FFFFC */ lui $t7, (0xFFFCFFFC >> 16) # lui $t7, 0xfffc -/* 1070D8 7F0D25A8 35EFFFFC */ ori $t7, (0xFFFCFFFC & 0xFFFF) # ori $t7, $t7, 0xfffc -/* 1070DC 7F0D25AC 26100008 */ addiu $s0, $s0, 8 -/* 1070E0 7F0D25B0 3C0EF700 */ lui $t6, 0xf700 -/* 1070E4 7F0D25B4 ACEE0000 */ sw $t6, ($a3) -/* 1070E8 7F0D25B8 ACEF0004 */ sw $t7, 4($a3) -/* 1070EC 7F0D25BC 02001025 */ move $v0, $s0 -/* 1070F0 7F0D25C0 3C18ED00 */ lui $t8, 0xed00 -/* 1070F4 7F0D25C4 AC580000 */ sw $t8, ($v0) -/* 1070F8 7F0D25C8 AFA20030 */ sw $v0, 0x30($sp) -/* 1070FC 7F0D25CC 0C001107 */ jal get_video2_settings_txtClipW -/* 107100 7F0D25D0 26100008 */ addiu $s0, $s0, 8 -/* 107104 7F0D25D4 0C00110B */ jal get_video2_settings_txtClipH -/* 107108 7F0D25D8 A7A20026 */ sh $v0, 0x26($sp) -/* 10710C 7F0D25DC 44822000 */ mtc1 $v0, $f4 -/* 107110 7F0D25E0 87AA0026 */ lh $t2, 0x26($sp) -/* 107114 7F0D25E4 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 107118 7F0D25E8 468021A0 */ cvt.s.w $f6, $f4 -/* 10711C 7F0D25EC 448A8000 */ mtc1 $t2, $f16 -/* 107120 7F0D25F0 44810000 */ mtc1 $at, $f0 -/* 107124 7F0D25F4 8FB80030 */ lw $t8, 0x30($sp) -/* 107128 7F0D25F8 468084A0 */ cvt.s.w $f18, $f16 -/* 10712C 7F0D25FC 46003202 */ mul.s $f8, $f6, $f0 -/* 107130 7F0D2600 00000000 */ nop -/* 107134 7F0D2604 46009102 */ mul.s $f4, $f18, $f0 -/* 107138 7F0D2608 4600428D */ trunc.w.s $f10, $f8 -/* 10713C 7F0D260C 4600218D */ trunc.w.s $f6, $f4 -/* 107140 7F0D2610 44085000 */ mfc1 $t0, $f10 -/* 107144 7F0D2614 440C3000 */ mfc1 $t4, $f6 -/* 107148 7F0D2618 31090FFF */ andi $t1, $t0, 0xfff -/* 10714C 7F0D261C 318D0FFF */ andi $t5, $t4, 0xfff -/* 107150 7F0D2620 000D7300 */ sll $t6, $t5, 0xc -/* 107154 7F0D2624 012E7825 */ or $t7, $t1, $t6 -/* 107158 7F0D2628 0FC26919 */ jal get_num_players -/* 10715C 7F0D262C AF0F0004 */ sw $t7, 4($t8) -/* 107160 7F0D2630 28410003 */ slti $at, $v0, 3 -/* 107164 7F0D2634 10200005 */ beqz $at, .L7F0D264C -/* 107168 7F0D2638 00000000 */ nop -/* 10716C 7F0D263C 0C001107 */ jal get_video2_settings_txtClipW -/* 107170 7F0D2640 AFA0004C */ sw $zero, 0x4c($sp) -/* 107174 7F0D2644 1000001B */ b .L7F0D26B4 -/* 107178 7F0D2648 2445FFFF */ addiu $a1, $v0, -1 -.L7F0D264C: -/* 10717C 7F0D264C 0FC26C54 */ jal get_cur_playernum -/* 107180 7F0D2650 00000000 */ nop -/* 107184 7F0D2654 10400006 */ beqz $v0, .L7F0D2670 -/* 107188 7F0D2658 00000000 */ nop -/* 10718C 7F0D265C 0FC26C54 */ jal get_cur_playernum -/* 107190 7F0D2660 00000000 */ nop -/* 107194 7F0D2664 24010002 */ li $at, 2 -/* 107198 7F0D2668 14410009 */ bne $v0, $at, .L7F0D2690 -/* 10719C 7F0D266C 00000000 */ nop -.L7F0D2670: -/* 1071A0 7F0D2670 0C001107 */ jal get_video2_settings_txtClipW -/* 1071A4 7F0D2674 AFA0004C */ sw $zero, 0x4c($sp) -/* 1071A8 7F0D2678 04410003 */ bgez $v0, .L7F0D2688 -/* 1071AC 7F0D267C 00022843 */ sra $a1, $v0, 1 -/* 1071B0 7F0D2680 24410001 */ addiu $at, $v0, 1 -/* 1071B4 7F0D2684 00012843 */ sra $a1, $at, 1 -.L7F0D2688: -/* 1071B8 7F0D2688 1000000A */ b .L7F0D26B4 -/* 1071BC 7F0D268C 24A5FFFF */ addiu $a1, $a1, -1 -.L7F0D2690: -/* 1071C0 7F0D2690 0C001107 */ jal get_video2_settings_txtClipW -/* 1071C4 7F0D2694 00000000 */ nop -/* 1071C8 7F0D2698 04410003 */ bgez $v0, .L7F0D26A8 -/* 1071CC 7F0D269C 0002C843 */ sra $t9, $v0, 1 -/* 1071D0 7F0D26A0 24410001 */ addiu $at, $v0, 1 -/* 1071D4 7F0D26A4 0001C843 */ sra $t9, $at, 1 -.L7F0D26A8: -/* 1071D8 7F0D26A8 0C001107 */ jal get_video2_settings_txtClipW -/* 1071DC 7F0D26AC AFB9004C */ sw $t9, 0x4c($sp) -/* 1071E0 7F0D26B0 2445FFFF */ addiu $a1, $v0, -1 -.L7F0D26B4: -/* 1071E4 7F0D26B4 3C0C8009 */ lui $t4, %hi(viewport_img_height) -/* 1071E8 7F0D26B8 8D8CE314 */ lw $t4, %lo(viewport_img_height)($t4) -/* 1071EC 7F0D26BC 30A803FF */ andi $t0, $a1, 0x3ff -/* 1071F0 7F0D26C0 00085380 */ sll $t2, $t0, 0xe -/* 1071F4 7F0D26C4 258DFFFF */ addiu $t5, $t4, -1 -/* 1071F8 7F0D26C8 31A903FF */ andi $t1, $t5, 0x3ff -/* 1071FC 7F0D26CC 3C01F600 */ lui $at, 0xf600 -/* 107200 7F0D26D0 01415825 */ or $t3, $t2, $at -/* 107204 7F0D26D4 00097080 */ sll $t6, $t1, 2 -/* 107208 7F0D26D8 016E7825 */ or $t7, $t3, $t6 -/* 10720C 7F0D26DC 02001825 */ move $v1, $s0 -/* 107210 7F0D26E0 AC6F0000 */ sw $t7, ($v1) -/* 107214 7F0D26E4 8FB8004C */ lw $t8, 0x4c($sp) -/* 107218 7F0D26E8 26100008 */ addiu $s0, $s0, 8 -/* 10721C 7F0D26EC 02002025 */ move $a0, $s0 -/* 107220 7F0D26F0 331903FF */ andi $t9, $t8, 0x3ff -/* 107224 7F0D26F4 00194380 */ sll $t0, $t9, 0xe -/* 107228 7F0D26F8 AC680004 */ sw $t0, 4($v1) -/* 10722C 7F0D26FC 3C0AE700 */ lui $t2, 0xe700 -/* 107230 7F0D2700 AC8A0000 */ sw $t2, ($a0) -/* 107234 7F0D2704 AC800004 */ sw $zero, 4($a0) -/* 107238 7F0D2708 8FBF001C */ lw $ra, 0x1c($sp) -/* 10723C 7F0D270C 26020008 */ addiu $v0, $s0, 8 -/* 107240 7F0D2710 8FB00018 */ lw $s0, 0x18($sp) -/* 107244 7F0D2714 03E00008 */ jr $ra -/* 107248 7F0D2718 27BD0050 */ addiu $sp, $sp, 0x50 -) -#endif - +s16 get_video2_settings_txtClipW(void); +s16 get_video2_settings_txtClipH(void); +Gfx *zbufClearCurrentPlayer(Gfx *gdl) { + s32 start_x; + s32 end_x; + gDPPipeSync(gdl++); + gDPSetRenderMode(gdl++, G_RM_NOOP, G_RM_NOOP2); + gDPSetColorImage(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, z_buffer_width, (z_buffer + 0x80000000)); + gDPSetCycleType(gdl++, G_CYC_FILL); + gDPSetFillColor(gdl++, (GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0))); + gDPSetScissor(gdl++, G_SC_NON_INTERLACE, 0, 0, get_video2_settings_txtClipW(), get_video2_settings_txtClipH()); + if (getPlayerCount() < 3) { + start_x = 0; + end_x = get_video2_settings_txtClipW() - 1; + } else if ((get_cur_playernum() == 0) || (get_cur_playernum() == 2)) { + start_x = 0; + end_x = (get_video2_settings_txtClipW() / 2) - 1; + } else { + start_x = get_video2_settings_txtClipW() / 2; + end_x = get_video2_settings_txtClipW() - 1; + } + gDPFillRectangle(gdl++, start_x, 0, end_x, (z_buffer_height - 1)); + gDPPipeSync(gdl++); + return gdl; +} diff --git a/src/game/watch.c b/src/game/watch.c index ad64232b..d7d92455 100644 --- a/src/game/watch.c +++ b/src/game/watch.c @@ -2,9 +2,12 @@ #include "game/watch.h" #include "game/unk_093880.h" #include "game/unk_0A1DA0.h" +#include "game/unk_0C0A70.h" #include "game/mainmenu.h" #include "game/lvl_text.h" +#include "game/textrelated.h" #include "music.h" +#include "bondconstants.h" // bss char dword_CODE_bss_8007B0A0[0x40]; @@ -13,7 +16,7 @@ char dword_CODE_bss_8007B0E0[0x40]; // data //D:800409A0 -s32 D_800409A0 = 4; +s32 mission_brief_index = BRIEF_INDEX_OBJECTIVES; //D:800409A4 s32 D_800409A4 = 0; //D:800409A8 @@ -44,60 +47,27 @@ f32 D_800409D4 = 0.0f; s32 D_800409D8 = 8; //D:800409DC u16 D_800409DC[] = { - 0xAC09, 0xAC03, 0xAC02, 0xAC00, - 0xAC01, 0xAC01, 0xAC06, 0xAC06, - 0xAC04, 0xAC05, 0xAC0A, 0xAC03, - 0xAC02, 0xAC00, 0xAC01, 0xAC01, - 0xAC05, 0xAC05, 0xAC04, 0xAC06, - 0xAC0B, 0xAC00, 0xAC02, 0xAC01, - 0xAC03, 0xAC03, 0xAC06, 0xAC06, - 0xAC04, 0xAC05, 0xAC0C, 0xAC00, - 0xAC02, 0xAC01, 0xAC03, 0xAC03, - 0xAC05, 0xAC05, 0xAC04, 0xAC06, - 0xAC0D, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC0E, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07, - 0xAC0F, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC10, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07, - 0xAC07, 0xAC07, 0xAC07, 0xAC07 + /*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) +}; + +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 }; -//D:80040A7C -u16 D_80040A7C[] = {0xAC11, 0xAC1C, 0xAC1B, 0}; -//D:80040A84 -u32 cur_player_look_vertical_inverted = 0; -//D:80040A88 -u16 D_80040A88[] = {0xAC12, 0xAC1A, 0xAC19, 0}; -//D:80040A90 -u32 cur_player_autoaim_setting = 1; -//D:80040A94 -u16 D_80040A94[] = {0xAC14, 0xAC1E, 0xAC1D, 0}; -//D:80040A9C -u32 cur_player_aim_control = 0; -//D:80040AA0 -u16 D_80040AA0[] = {0xAC15, 0xAC1A, 0xAC19, 0}; -//D:80040AA8 -u32 cur_player_sight_onscreen = 1; -//D:80040AAC -u16 D_80040AAC[] = {0xAC13, 0xAC1A, 0xAC19, 0}; -//D:80040AB4 -u32 cur_player_lookahead_setting = 1; -//D:80040AB8 -u16 D_80040AB8[] = {0xAC16, 0xAC1A, 0xAC19, 0}; -//D:80040AC0 -u32 cur_player_ammo_onscreen_setting = 1; -//D:80040AC4 -u16 D_80040AC4[] = {0xAC17, 0xAC1F, 0xAC20, 0xAC21}; -//D:80040ACC -u32 cur_player_screen_setting = 0; -//D:80040AD0 -u16 D_80040AD0[] = {0xAC18, 0xAC22, 0xAC23, 0}; -//D:80040AD8 -u32 screen_ratio = 0; //D:80040ADC u32 controlstick_lr_enabled = 0; //D:80040AE0 @@ -119,7 +89,7 @@ u32 D_80040AFC = 0xFF; //D:80040B00 u32 D_80040B00 = 0xA; //D:80040B04 -u32 D_80040B04 = 0xE0; +s32 D_80040B04 = 0xE0; //D:80040B08 u32 D_80040B08 = 0; //D:80040B0C @@ -149,9 +119,9 @@ f32 D_80040B38 = 0.0f; //D:80040B3C u32 D_80040B3C = 0; //D:80040B40 -u32 D_80040B40 = 0; +s32 D_80040B40 = 0; //D:80040B44 -u32 D_80040B44 = 0x10000; +s16 D_80040B44 = 0x1; //D:80040B48 u32 D_80040B48 = 0x32; //D:80040B4C @@ -324,33 +294,9 @@ const u32 D_800577C4[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -//D:80057FC0 -const u32 D_80057FC0[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; -//D:80058440 -const char D_80058440[] = " \n"; -//D:80058444 -const char D_80058444[] = " \n\n"; -//D:80058448 -const char aC_2[] = "%c: "; -//D:80058450 -const char D_80058450[] = " \n"; -//D:80058454 -const char D_80058454[] = " \n\n"; + + @@ -367,10 +313,10 @@ void nullsub_7F0A4860(void) { #ifdef NONMATCHING void init_watch_at_start_of_stage(void) { - watch_screen_index = 0; - D_80040998 = 0; - D_8004099C = 0; - D_800409A0 = 4; + watch_screen_index = WATCH_INDEX_MISSION_STATUS; + controller_options_index = CONTROLLER_OPTIONS_INDEX_STYLE; + game_options_index = GAME_OPTIONS_INDEX_MUSIC; + mission_brief_index = BRIEF_INDEX_OBJECTIVES; D_800409A4 = 0; watch_soundrelated_maybe = 0; D_800409AC = 0; @@ -437,13 +383,13 @@ GLOBAL_ASM( glabel init_watch_at_start_of_stage /* 0D9398 7F0A4868 3C018004 */ lui $at, %hi(watch_screen_index) /* 0D939C 7F0A486C AC200994 */ sw $zero, %lo(watch_screen_index)($at) -/* 0D93A0 7F0A4870 3C018004 */ lui $at, %hi(D_80040998) -/* 0D93A4 7F0A4874 AC200998 */ sw $zero, %lo(D_80040998)($at) -/* 0D93A8 7F0A4878 3C018004 */ lui $at, %hi(D_8004099C) -/* 0D93AC 7F0A487C AC20099C */ sw $zero, %lo(D_8004099C)($at) -/* 0D93B0 7F0A4880 3C018004 */ lui $at, %hi(D_800409A0) +/* 0D93A0 7F0A4870 3C018004 */ lui $at, %hi(controller_options_index) +/* 0D93A4 7F0A4874 AC200998 */ sw $zero, %lo(controller_options_index)($at) +/* 0D93A8 7F0A4878 3C018004 */ lui $at, %hi(game_options_index) +/* 0D93AC 7F0A487C AC20099C */ sw $zero, %lo(game_options_index)($at) +/* 0D93B0 7F0A4880 3C018004 */ lui $at, %hi(mission_brief_index) /* 0D93B4 7F0A4884 240E0004 */ li $t6, 4 -/* 0D93B8 7F0A4888 AC2E09A0 */ sw $t6, %lo(D_800409A0)($at) +/* 0D93B8 7F0A4888 AC2E09A0 */ sw $t6, %lo(mission_brief_index)($at) /* 0D93BC 7F0A488C 3C018004 */ lui $at, %hi(D_800409A4) /* 0D93C0 7F0A4890 AC2009A4 */ sw $zero, %lo(D_800409A4)($at) /* 0D93C4 7F0A4894 3C018004 */ lui $at, %hi(watch_soundrelated_maybe) @@ -843,29 +789,78 @@ void cur_player_set_control_type(int type) } -u32 get_cur_player_look_vertical_inverted(void) {return cur_player_look_vertical_inverted;} -void set_cur_player_look_vertical_inverted(u32 param_1) {cur_player_look_vertical_inverted = param_1;} +u32 get_cur_player_look_vertical_inverted(void) +{ + return game_options_entries[PLAYER_OPTION_LOOK].current_value; +} +void set_cur_player_look_vertical_inverted(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_LOOK].current_value = param_1; +} -u32 cur_player_get_autoaim(void) {return cur_player_autoaim_setting;} -void cur_player_set_autoaim(u32 uParm1) {cur_player_autoaim_setting = uParm1;} +u32 cur_player_get_autoaim(void) +{ + return game_options_entries[PLAYER_OPTION_AUTOAIM].current_value; +} +void cur_player_set_autoaim(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_AUTOAIM].current_value = param_1; +} -u32 cur_player_get_lookahead(void) {return cur_player_lookahead_setting;} -void cur_player_set_lookahead(u32 uParm1) {cur_player_lookahead_setting = uParm1;} +u32 cur_player_get_lookahead(void) +{ + return game_options_entries[PLAYER_OPTION_LOOKAHEAD].current_value; +} +void cur_player_set_lookahead(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_LOOKAHEAD].current_value = param_1; +} -u32 cur_player_get_aim_control(void) {return cur_player_aim_control;} -void cur_player_set_aim_control(u32 uParm1) {cur_player_aim_control = uParm1;} +u32 cur_player_get_aim_control(void) +{ + return game_options_entries[PLAYER_OPTION_AIM].current_value; +} +void cur_player_set_aim_control(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_AIM].current_value = param_1; +} -u32 cur_player_get_sight_onscreen_control(void) {return cur_player_sight_onscreen;} -void cur_player_set_sight_onscreen_control(u32 uParm1) {cur_player_sight_onscreen = uParm1;} +u32 cur_player_get_sight_onscreen_control(void) +{ + return game_options_entries[PLAYER_OPTION_SIGHT].current_value; +} +void cur_player_set_sight_onscreen_control(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_SIGHT].current_value = param_1; +} -u32 cur_player_get_ammo_onscreen_setting(void) {return cur_player_ammo_onscreen_setting;} -void cur_player_set_ammo_onscreen_setting(u32 uParm1) {cur_player_ammo_onscreen_setting = uParm1;} +u32 cur_player_get_ammo_onscreen_setting(void) +{ + return game_options_entries[PLAYER_OPTION_AMMODISPLAY].current_value; +} +void cur_player_set_ammo_onscreen_setting(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_AMMODISPLAY].current_value = param_1; +} -u32 cur_player_get_screen_setting(void) {return cur_player_screen_setting;} -void cur_player_set_screen_setting(u32 uParm1) {cur_player_screen_setting = uParm1;} +u32 cur_player_get_screen_setting(void) +{ + return game_options_entries[PLAYER_OPTION_SCREEN].current_value; +} +void cur_player_set_screen_setting(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_SCREEN].current_value = param_1; +} + +u32 get_screen_ratio(void) +{ + return game_options_entries[PLAYER_OPTION_RATIO].current_value; +} +void set_screen_ratio(u32 param_1) +{ + game_options_entries[PLAYER_OPTION_RATIO].current_value = param_1; +} -u32 get_screen_ratio(void) {return screen_ratio;} -void set_screen_ratio(u32 uParm1) {screen_ratio = uParm1;} void sub_GAME_7F0A4EF8(void) { @@ -879,7 +874,7 @@ void sub_GAME_7F0A4EF8(void) { } } -void sub_GAME_7F0A4F44(void){ +void reset_watch_soundrelated_maybe(void){ watch_soundrelated_maybe = 0; } @@ -994,41 +989,41 @@ void watch_screen0_navigation(void) if (watch_soundrelated_maybe == 0) { - goto_watch_screen_index_4 = 0; - goto_watch_screen_index_1 = 0; + goto_watch_screen_index_4 = FALSE; + goto_watch_screen_index_1 = FALSE; if (get_debug_gunwatchpos_flag() == 0) { if (get_controller_buttons_pressed(0, L_TRIG|L_CBUTTONS)) { - goto_watch_screen_index_4 = 1; + goto_watch_screen_index_4 = TRUE; } if (get_controller_buttons_pressed(0, R_TRIG|R_CBUTTONS)) { - goto_watch_screen_index_1 = 1; + goto_watch_screen_index_1 = TRUE; } } if ((get_controller_buttons_pressed(0, L_JPAD)) || (sub_GAME_7F0A4FB0())) { - goto_watch_screen_index_4 = 1; + goto_watch_screen_index_4 = TRUE; } if ((get_controller_buttons_pressed(0, R_JPAD)) || (sub_GAME_7F0A4FEC())) { - goto_watch_screen_index_1 = 1; + goto_watch_screen_index_1 = TRUE; } if (goto_watch_screen_index_4) { - watch_screen_index = 4; + watch_screen_index = WATCH_INDEX_MISSION_BRIEFING; sub_GAME_7F0A5210(); trigger_watch_zoom(4.6f, 15.0f); } if (goto_watch_screen_index_1) { - watch_screen_index = 1; + watch_screen_index = WATCH_INDEX_INVENTORY; sub_GAME_7F0A5210(); trigger_watch_zoom(4.6f, 15.0f); return; @@ -1079,7 +1074,7 @@ void watch_screen1_navigation(void) if (goto_watch_screen_index_0) { - watch_screen_index = 0; + watch_screen_index = WATCH_INDEX_MISSION_STATUS; zero_D_800409A4(); sub_GAME_7F0A5210(); trigger_watch_zoom(5.9f, 15.0f); @@ -1087,7 +1082,7 @@ void watch_screen1_navigation(void) if (goto_watch_screen_index_2) { - watch_screen_index = 2; + watch_screen_index = WATCH_INDEX_CONTROL_OPTIONS; set_controlstick_lr_disabled(); sub_GAME_7F0A5210(); trigger_watch_zoom(3.95f, 15.0f); @@ -1102,7 +1097,7 @@ void unused_watch_screen_navigation(void) { { if (watch_soundrelated_maybe == 0) { - watch_screen_index = 1; + watch_screen_index = WATCH_INDEX_INVENTORY; set_controlstick_lr_disabled(); return; } @@ -1111,8 +1106,8 @@ void unused_watch_screen_navigation(void) { { if (watch_soundrelated_maybe == 0) { - watch_screen_index = 2; - zero_D_80040998(); + watch_screen_index = WATCH_INDEX_CONTROL_OPTIONS; + reset_controller_options_index(); sub_GAME_7F0A5210(); trigger_watch_zoom(3.95f, 15.0f); } @@ -1126,7 +1121,7 @@ void watch_screen2_navigation(void) { { if ((get_controller_buttons_held(0, Z_TRIG) == 0) && (watch_soundrelated_maybe == 0)) { - watch_screen_index = 1; + watch_screen_index = WATCH_INDEX_INVENTORY; sub_GAME_7F0A5210(); trigger_watch_zoom(4.6f, 15.0f); return; @@ -1136,8 +1131,8 @@ void watch_screen2_navigation(void) { { if ((get_controller_buttons_held(0, Z_TRIG) == 0) && (watch_soundrelated_maybe == 0)) { - watch_screen_index = 3; - zero_D_8004099C(); + watch_screen_index = WATCH_INDEX_GAME_OPTIONS; + reset_game_options_index(); set_controlstick_lr_disabled(); } } @@ -1150,8 +1145,8 @@ void watch_screen3_navigation(void) { { if ((get_controller_buttons_held(0, Z_TRIG) == 0) && (watch_soundrelated_maybe == 0)) { - watch_screen_index = 2; - zero_D_80040998(); + watch_screen_index = WATCH_INDEX_CONTROL_OPTIONS; + reset_controller_options_index(); set_controlstick_lr_disabled(); return; } @@ -1160,7 +1155,7 @@ void watch_screen3_navigation(void) { { if ((get_controller_buttons_held(0, Z_TRIG) == 0) && (watch_soundrelated_maybe == 0)) { - watch_screen_index = 4; + watch_screen_index = WATCH_INDEX_MISSION_BRIEFING; sub_GAME_7F0A5210(); trigger_watch_zoom(4.6f, 15.0f); } @@ -1174,8 +1169,8 @@ void watch_screen4_navigation(void) { { if (watch_soundrelated_maybe == 0) { - watch_screen_index = 3; - zero_D_8004099C(); + watch_screen_index = WATCH_INDEX_GAME_OPTIONS; + reset_game_options_index(); sub_GAME_7F0A5210(); trigger_watch_zoom(3.95f, 15.0f); return; @@ -1185,7 +1180,7 @@ void watch_screen4_navigation(void) { { if (watch_soundrelated_maybe == 0) { - watch_screen_index = 0; + watch_screen_index = WATCH_INDEX_MISSION_STATUS; zero_D_800409A4(); sub_GAME_7F0A5210(); trigger_watch_zoom(5.9f, 15.0f); @@ -1194,13 +1189,13 @@ void watch_screen4_navigation(void) { } -void sub_GAME_7F0A5860(void) +void controller_options_controlstyle_navigation(void) { if ((get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD)) || (sub_GAME_7F0A5088())) { if (watch_soundrelated_maybe == 0) { - D_80040998 = 1; + controller_options_index = CONTROLLER_OPTIONS_INDEX_INPUTS; set_D_80040AE0_0(); return; } @@ -1209,19 +1204,19 @@ void sub_GAME_7F0A5860(void) { if (watch_soundrelated_maybe == 0) { - D_80040998 = 1; + controller_options_index = CONTROLLER_OPTIONS_INDEX_INPUTS; set_D_80040AE0_0(); } } } -void sub_GAME_7F0A5900(void) +void controller_options_inputs_navigation(void) { if ((get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD)) || (sub_GAME_7F0A5088())) { if (watch_soundrelated_maybe == 0) { - D_80040998 = 0; + controller_options_index = CONTROLLER_OPTIONS_INDEX_STYLE; set_D_80040AE0_0(); return; } @@ -1230,251 +1225,78 @@ void sub_GAME_7F0A5900(void) { if (watch_soundrelated_maybe == 0) { - D_80040998 = 0; + controller_options_index = CONTROLLER_OPTIONS_INDEX_STYLE; set_D_80040AE0_0(); } } } - - - - -#ifdef NONMATCHING void sub_GAME_7F0A5998(void) { - if ((get_controller_buttons_pressed('\0',U_CBUTTONS|U_JPAD) != 0) || (sub_GAME_7F0A5088() != 0)) - { - D_8004099C = (s32) (D_8004099C - 1); - set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); - } - else - { - if ((get_controller_buttons_pressed('\0',D_CBUTTONS|D_JPAD) != 0) || (sub_GAME_7F0A50C4() != 0)) - { - D_8004099C = (s32) (D_8004099C + 1); - set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); - } - else - { + s32 aux; - } - } - if (D_8004099C >= 0xa) + if ((get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD)) || (sub_GAME_7F0A5088())) { - D_8004099C = 0; + game_options_index = game_options_index - 1; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } + else if ((get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD)) || (sub_GAME_7F0A50C4())) + { + game_options_index = game_options_index + 1; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } + + aux = game_options_index; + + if (aux >= 10) + { + game_options_index = GAME_OPTIONS_INDEX_MUSIC; return; } - if (D_8004099C < 0) + + if (aux < 0) { - D_8004099C = 9; + game_options_index = GAME_OPTIONS_INDEX_RATIO; } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A5998 -/* 0DA4C8 7F0A5998 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DA4CC 7F0A599C AFBF0014 */ sw $ra, 0x14($sp) -/* 0DA4D0 7F0A59A0 00002025 */ move $a0, $zero -/* 0DA4D4 7F0A59A4 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA4D8 7F0A59A8 24050808 */ li $a1, 2056 -/* 0DA4DC 7F0A59AC 14400005 */ bnez $v0, .L7F0A59C4 -/* 0DA4E0 7F0A59B0 00000000 */ nop -/* 0DA4E4 7F0A59B4 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DA4E8 7F0A59B8 00000000 */ nop -/* 0DA4EC 7F0A59BC 1040000B */ beqz $v0, .L7F0A59EC -/* 0DA4F0 7F0A59C0 00002025 */ move $a0, $zero -.L7F0A59C4: -/* 0DA4F4 7F0A59C4 3C028004 */ lui $v0, %hi(D_8004099C) -/* 0DA4F8 7F0A59C8 2442099C */ addiu $v0, %lo(D_8004099C) # addiu $v0, $v0, 0x99c -/* 0DA4FC 7F0A59CC 8C4E0000 */ lw $t6, ($v0) -/* 0DA500 7F0A59D0 25CFFFFF */ addiu $t7, $t6, -1 -/* 0DA504 7F0A59D4 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA508 7F0A59D8 AC4F0000 */ sw $t7, ($v0) -/* 0DA50C 7F0A59DC 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA510 7F0A59E0 00000000 */ nop -/* 0DA514 7F0A59E4 10000010 */ b .L7F0A5A28 -/* 0DA518 7F0A59E8 00000000 */ nop -.L7F0A59EC: -/* 0DA51C 7F0A59EC 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA520 7F0A59F0 24050404 */ li $a1, 1028 -/* 0DA524 7F0A59F4 14400004 */ bnez $v0, .L7F0A5A08 -/* 0DA528 7F0A59F8 00000000 */ nop -/* 0DA52C 7F0A59FC 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DA530 7F0A5A00 00000000 */ nop -/* 0DA534 7F0A5A04 10400008 */ beqz $v0, .L7F0A5A28 -.L7F0A5A08: -/* 0DA538 7F0A5A08 3C188004 */ lui $t8, %hi(D_8004099C) -/* 0DA53C 7F0A5A0C 8F18099C */ lw $t8, %lo(D_8004099C)($t8) -/* 0DA540 7F0A5A10 3C018004 */ lui $at, %hi(D_8004099C) -/* 0DA544 7F0A5A14 27190001 */ addiu $t9, $t8, 1 -/* 0DA548 7F0A5A18 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA54C 7F0A5A1C AC39099C */ sw $t9, %lo(D_8004099C)($at) -/* 0DA550 7F0A5A20 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA554 7F0A5A24 00000000 */ nop -.L7F0A5A28: -/* 0DA558 7F0A5A28 3C038004 */ lui $v1, %hi(D_8004099C) -/* 0DA55C 7F0A5A2C 2463099C */ addiu $v1, %lo(D_8004099C) # addiu $v1, $v1, 0x99c -/* 0DA560 7F0A5A30 8C620000 */ lw $v0, ($v1) -/* 0DA564 7F0A5A34 2841000A */ slti $at, $v0, 0xa -/* 0DA568 7F0A5A38 14200003 */ bnez $at, .L7F0A5A48 -/* 0DA56C 7F0A5A3C 00000000 */ nop -/* 0DA570 7F0A5A40 10000004 */ b .L7F0A5A54 -/* 0DA574 7F0A5A44 AC600000 */ sw $zero, ($v1) -.L7F0A5A48: -/* 0DA578 7F0A5A48 04410002 */ bgez $v0, .L7F0A5A54 -/* 0DA57C 7F0A5A4C 24080009 */ li $t0, 9 -/* 0DA580 7F0A5A50 AC680000 */ sw $t0, ($v1) -.L7F0A5A54: -/* 0DA584 7F0A5A54 8FBF0014 */ lw $ra, 0x14($sp) -/* 0DA588 7F0A5A58 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DA58C 7F0A5A5C 03E00008 */ jr $ra -/* 0DA590 7F0A5A60 00000000 */ nop -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F0A5A64(void) +void game_options_music_volume_navigation(void) { - if ((get_controller_buttons_pressed('\0',U_CBUTTONS|U_JPAD) == 0) && (sub_GAME_7F0A5088() == 0)) { - if ((get_controller_buttons_pressed('\0',D_CBUTTONS|D_JPAD) != 0) || (sub_GAME_7F0A50C4() != 0)) { - D_8004099C = 1; - set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); - } - } - else { - D_8004099C = 9; + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + game_options_index = GAME_OPTIONS_INDEX_RATIO; set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + game_options_index = GAME_OPTIONS_INDEX_FX; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); } - return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A5A64 -/* 0DA594 7F0A5A64 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DA598 7F0A5A68 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DA59C 7F0A5A6C 00002025 */ move $a0, $zero -/* 0DA5A0 7F0A5A70 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA5A4 7F0A5A74 24050808 */ li $a1, 2056 -/* 0DA5A8 7F0A5A78 54400006 */ bnezl $v0, .L7F0A5A94 -/* 0DA5AC 7F0A5A7C 240E0009 */ li $t6, 9 -/* 0DA5B0 7F0A5A80 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DA5B4 7F0A5A84 00000000 */ nop -/* 0DA5B8 7F0A5A88 10400009 */ beqz $v0, .L7F0A5AB0 -/* 0DA5BC 7F0A5A8C 00002025 */ move $a0, $zero -/* 0DA5C0 7F0A5A90 240E0009 */ li $t6, 9 -.L7F0A5A94: -/* 0DA5C4 7F0A5A94 3C018004 */ lui $at, %hi(D_8004099C) -/* 0DA5C8 7F0A5A98 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA5CC 7F0A5A9C AC2E099C */ sw $t6, %lo(D_8004099C)($at) -/* 0DA5D0 7F0A5AA0 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA5D4 7F0A5AA4 00000000 */ nop -/* 0DA5D8 7F0A5AA8 1000000F */ b .L7F0A5AE8 -/* 0DA5DC 7F0A5AAC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A5AB0: -/* 0DA5E0 7F0A5AB0 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA5E4 7F0A5AB4 24050404 */ li $a1, 1028 -/* 0DA5E8 7F0A5AB8 54400005 */ bnezl $v0, .L7F0A5AD0 -/* 0DA5EC 7F0A5ABC 240F0001 */ li $t7, 1 -/* 0DA5F0 7F0A5AC0 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DA5F4 7F0A5AC4 00000000 */ nop -/* 0DA5F8 7F0A5AC8 10400006 */ beqz $v0, .L7F0A5AE4 -/* 0DA5FC 7F0A5ACC 240F0001 */ li $t7, 1 -.L7F0A5AD0: -/* 0DA600 7F0A5AD0 3C018004 */ lui $at, %hi(D_8004099C) -/* 0DA604 7F0A5AD4 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA608 7F0A5AD8 AC2F099C */ sw $t7, %lo(D_8004099C)($at) -/* 0DA60C 7F0A5ADC 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA610 7F0A5AE0 00000000 */ nop -.L7F0A5AE4: -/* 0DA614 7F0A5AE4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A5AE8: -/* 0DA618 7F0A5AE8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DA61C 7F0A5AEC 03E00008 */ jr $ra -/* 0DA620 7F0A5AF0 00000000 */ nop -) -#endif - - - - -#ifdef NONMATCHING -void sub_GAME_7F0A5AF4(void) +void game_options_fx_volume_navigation(void) { - if ((get_controller_buttons_pressed('\0',U_CBUTTONS|U_JPAD) == 0) && (sub_GAME_7F0A5088() == 0)) { - if ((get_controller_buttons_pressed('\0',D_CBUTTONS|D_JPAD) != 0) || (sub_GAME_7F0A50C4() != 0)) { - D_8004099c = 2; - set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); - } - } - else { - D_8004099c = 0; + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + game_options_index = GAME_OPTIONS_INDEX_MUSIC; set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + game_options_index = GAME_OPTIONS_INDEX_LOOK_UPDOWN; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); } - return; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A5AF4 -/* 0DA624 7F0A5AF4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DA628 7F0A5AF8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DA62C 7F0A5AFC 00002025 */ move $a0, $zero -/* 0DA630 7F0A5B00 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA634 7F0A5B04 24050808 */ li $a1, 2056 -/* 0DA638 7F0A5B08 14400005 */ bnez $v0, .L7F0A5B20 -/* 0DA63C 7F0A5B0C 00000000 */ nop -/* 0DA640 7F0A5B10 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DA644 7F0A5B14 00000000 */ nop -/* 0DA648 7F0A5B18 10400008 */ beqz $v0, .L7F0A5B3C -/* 0DA64C 7F0A5B1C 00002025 */ move $a0, $zero -.L7F0A5B20: -/* 0DA650 7F0A5B20 3C018004 */ lui $at, %hi(D_8004099C) -/* 0DA654 7F0A5B24 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA658 7F0A5B28 AC20099C */ sw $zero, %lo(D_8004099C)($at) -/* 0DA65C 7F0A5B2C 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA660 7F0A5B30 00000000 */ nop -/* 0DA664 7F0A5B34 1000000F */ b .L7F0A5B74 -/* 0DA668 7F0A5B38 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A5B3C: -/* 0DA66C 7F0A5B3C 0C0030EB */ jal get_controller_buttons_pressed -/* 0DA670 7F0A5B40 24050404 */ li $a1, 1028 -/* 0DA674 7F0A5B44 54400005 */ bnezl $v0, .L7F0A5B5C -/* 0DA678 7F0A5B48 240E0002 */ li $t6, 2 -/* 0DA67C 7F0A5B4C 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DA680 7F0A5B50 00000000 */ nop -/* 0DA684 7F0A5B54 10400006 */ beqz $v0, .L7F0A5B70 -/* 0DA688 7F0A5B58 240E0002 */ li $t6, 2 -.L7F0A5B5C: -/* 0DA68C 7F0A5B5C 3C018004 */ lui $at, %hi(D_8004099C) -/* 0DA690 7F0A5B60 0FC2941F */ jal set_D_80040AE0_0 -/* 0DA694 7F0A5B64 AC2E099C */ sw $t6, %lo(D_8004099C)($at) -/* 0DA698 7F0A5B68 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DA69C 7F0A5B6C 00000000 */ nop -.L7F0A5B70: -/* 0DA6A0 7F0A5B70 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A5B74: -/* 0DA6A4 7F0A5B74 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DA6A8 7F0A5B78 03E00008 */ jr $ra -/* 0DA6AC 7F0A5B7C 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -2260,247 +2082,96 @@ glabel sub_GAME_7F0A611C -void sub_GAME_7F0A6618(void) +void mission_brief_background_navigation(void) { if ((get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD)) || (sub_GAME_7F0A5088())) { - D_800409A0 = 4; + mission_brief_index = BRIEF_INDEX_OBJECTIVES; set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); + reset_watch_soundrelated_maybe(); } if ((get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD)) || (sub_GAME_7F0A50C4())) { - D_800409A0 = 1; + mission_brief_index = BRIEF_INDEX_M; set_D_80040AE0_0(); - sub_GAME_7F0A4F44(); + reset_watch_soundrelated_maybe(); } } - - - -#ifdef NONMATCHING -void sub_GAME_7F0A66A0(void) { - +void mission_brief_m_briefing_navigation(void) +{ + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + mission_brief_index = BRIEF_INDEX_BACKGROUND; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + mission_brief_index = BRIEF_INDEX_Q; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A66A0 -/* 0DB1D0 7F0A66A0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DB1D4 7F0A66A4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DB1D8 7F0A66A8 00002025 */ move $a0, $zero -/* 0DB1DC 7F0A66AC 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB1E0 7F0A66B0 24050808 */ li $a1, 2056 -/* 0DB1E4 7F0A66B4 14400005 */ bnez $v0, .L7F0A66CC -/* 0DB1E8 7F0A66B8 00000000 */ nop -/* 0DB1EC 7F0A66BC 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DB1F0 7F0A66C0 00000000 */ nop -/* 0DB1F4 7F0A66C4 10400008 */ beqz $v0, .L7F0A66E8 -/* 0DB1F8 7F0A66C8 00002025 */ move $a0, $zero -.L7F0A66CC: -/* 0DB1FC 7F0A66CC 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB200 7F0A66D0 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB204 7F0A66D4 AC2009A0 */ sw $zero, %lo(D_800409A0)($at) -/* 0DB208 7F0A66D8 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB20C 7F0A66DC 00000000 */ nop -/* 0DB210 7F0A66E0 1000000F */ b .L7F0A6720 -/* 0DB214 7F0A66E4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A66E8: -/* 0DB218 7F0A66E8 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB21C 7F0A66EC 24050404 */ li $a1, 1028 -/* 0DB220 7F0A66F0 54400005 */ bnezl $v0, .L7F0A6708 -/* 0DB224 7F0A66F4 240E0002 */ li $t6, 2 -/* 0DB228 7F0A66F8 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DB22C 7F0A66FC 00000000 */ nop -/* 0DB230 7F0A6700 10400006 */ beqz $v0, .L7F0A671C -/* 0DB234 7F0A6704 240E0002 */ li $t6, 2 -.L7F0A6708: -/* 0DB238 7F0A6708 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB23C 7F0A670C 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB240 7F0A6710 AC2E09A0 */ sw $t6, %lo(D_800409A0)($at) -/* 0DB244 7F0A6714 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB248 7F0A6718 00000000 */ nop -.L7F0A671C: -/* 0DB24C 7F0A671C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6720: -/* 0DB250 7F0A6720 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DB254 7F0A6724 03E00008 */ jr $ra -/* 0DB258 7F0A6728 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F0A672C(void) { - +void mission_brief_q_branch_navigation(void) +{ + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + mission_brief_index = BRIEF_INDEX_M; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + mission_brief_index = BRIEF_INDEX_MONEYPENNY; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A672C -/* 0DB25C 7F0A672C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DB260 7F0A6730 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DB264 7F0A6734 00002025 */ move $a0, $zero -/* 0DB268 7F0A6738 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB26C 7F0A673C 24050808 */ li $a1, 2056 -/* 0DB270 7F0A6740 54400006 */ bnezl $v0, .L7F0A675C -/* 0DB274 7F0A6744 240E0001 */ li $t6, 1 -/* 0DB278 7F0A6748 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DB27C 7F0A674C 00000000 */ nop -/* 0DB280 7F0A6750 10400009 */ beqz $v0, .L7F0A6778 -/* 0DB284 7F0A6754 00002025 */ move $a0, $zero -/* 0DB288 7F0A6758 240E0001 */ li $t6, 1 -.L7F0A675C: -/* 0DB28C 7F0A675C 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB290 7F0A6760 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB294 7F0A6764 AC2E09A0 */ sw $t6, %lo(D_800409A0)($at) -/* 0DB298 7F0A6768 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB29C 7F0A676C 00000000 */ nop -/* 0DB2A0 7F0A6770 1000000F */ b .L7F0A67B0 -/* 0DB2A4 7F0A6774 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6778: -/* 0DB2A8 7F0A6778 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB2AC 7F0A677C 24050404 */ li $a1, 1028 -/* 0DB2B0 7F0A6780 54400005 */ bnezl $v0, .L7F0A6798 -/* 0DB2B4 7F0A6784 240F0003 */ li $t7, 3 -/* 0DB2B8 7F0A6788 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DB2BC 7F0A678C 00000000 */ nop -/* 0DB2C0 7F0A6790 10400006 */ beqz $v0, .L7F0A67AC -/* 0DB2C4 7F0A6794 240F0003 */ li $t7, 3 -.L7F0A6798: -/* 0DB2C8 7F0A6798 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB2CC 7F0A679C 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB2D0 7F0A67A0 AC2F09A0 */ sw $t7, %lo(D_800409A0)($at) -/* 0DB2D4 7F0A67A4 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB2D8 7F0A67A8 00000000 */ nop -.L7F0A67AC: -/* 0DB2DC 7F0A67AC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A67B0: -/* 0DB2E0 7F0A67B0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DB2E4 7F0A67B4 03E00008 */ jr $ra -/* 0DB2E8 7F0A67B8 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F0A67BC(void) { +void mission_brief_moneypenny_navigation(void) +{ + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + mission_brief_index = BRIEF_INDEX_Q; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + mission_brief_index = BRIEF_INDEX_OBJECTIVES; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A67BC -/* 0DB2EC 7F0A67BC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DB2F0 7F0A67C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DB2F4 7F0A67C4 00002025 */ move $a0, $zero -/* 0DB2F8 7F0A67C8 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB2FC 7F0A67CC 24050808 */ li $a1, 2056 -/* 0DB300 7F0A67D0 54400006 */ bnezl $v0, .L7F0A67EC -/* 0DB304 7F0A67D4 240E0002 */ li $t6, 2 -/* 0DB308 7F0A67D8 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DB30C 7F0A67DC 00000000 */ nop -/* 0DB310 7F0A67E0 10400009 */ beqz $v0, .L7F0A6808 -/* 0DB314 7F0A67E4 00002025 */ move $a0, $zero -/* 0DB318 7F0A67E8 240E0002 */ li $t6, 2 -.L7F0A67EC: -/* 0DB31C 7F0A67EC 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB320 7F0A67F0 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB324 7F0A67F4 AC2E09A0 */ sw $t6, %lo(D_800409A0)($at) -/* 0DB328 7F0A67F8 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB32C 7F0A67FC 00000000 */ nop -/* 0DB330 7F0A6800 1000000F */ b .L7F0A6840 -/* 0DB334 7F0A6804 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6808: -/* 0DB338 7F0A6808 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB33C 7F0A680C 24050404 */ li $a1, 1028 -/* 0DB340 7F0A6810 54400005 */ bnezl $v0, .L7F0A6828 -/* 0DB344 7F0A6814 240F0004 */ li $t7, 4 -/* 0DB348 7F0A6818 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DB34C 7F0A681C 00000000 */ nop -/* 0DB350 7F0A6820 10400006 */ beqz $v0, .L7F0A683C -/* 0DB354 7F0A6824 240F0004 */ li $t7, 4 -.L7F0A6828: -/* 0DB358 7F0A6828 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB35C 7F0A682C 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB360 7F0A6830 AC2F09A0 */ sw $t7, %lo(D_800409A0)($at) -/* 0DB364 7F0A6834 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB368 7F0A6838 00000000 */ nop -.L7F0A683C: -/* 0DB36C 7F0A683C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6840: -/* 0DB370 7F0A6840 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DB374 7F0A6844 03E00008 */ jr $ra -/* 0DB378 7F0A6848 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F0A684C(void) { +void mission_brief_objectives_navigation(void) +{ + if (get_controller_buttons_pressed(0, U_CBUTTONS|U_JPAD) || sub_GAME_7F0A5088()) + { + mission_brief_index = BRIEF_INDEX_MONEYPENNY; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + return; + } + + if (get_controller_buttons_pressed(0, D_CBUTTONS|D_JPAD) || sub_GAME_7F0A50C4()) + { + mission_brief_index = BRIEF_INDEX_BACKGROUND; + set_D_80040AE0_0(); + reset_watch_soundrelated_maybe(); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A684C -/* 0DB37C 7F0A684C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DB380 7F0A6850 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DB384 7F0A6854 00002025 */ move $a0, $zero -/* 0DB388 7F0A6858 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB38C 7F0A685C 24050808 */ li $a1, 2056 -/* 0DB390 7F0A6860 54400006 */ bnezl $v0, .L7F0A687C -/* 0DB394 7F0A6864 240E0003 */ li $t6, 3 -/* 0DB398 7F0A6868 0FC29422 */ jal sub_GAME_7F0A5088 -/* 0DB39C 7F0A686C 00000000 */ nop -/* 0DB3A0 7F0A6870 10400009 */ beqz $v0, .L7F0A6898 -/* 0DB3A4 7F0A6874 00002025 */ move $a0, $zero -/* 0DB3A8 7F0A6878 240E0003 */ li $t6, 3 -.L7F0A687C: -/* 0DB3AC 7F0A687C 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB3B0 7F0A6880 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB3B4 7F0A6884 AC2E09A0 */ sw $t6, %lo(D_800409A0)($at) -/* 0DB3B8 7F0A6888 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB3BC 7F0A688C 00000000 */ nop -/* 0DB3C0 7F0A6890 1000000E */ b .L7F0A68CC -/* 0DB3C4 7F0A6894 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6898: -/* 0DB3C8 7F0A6898 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB3CC 7F0A689C 24050404 */ li $a1, 1028 -/* 0DB3D0 7F0A68A0 14400004 */ bnez $v0, .L7F0A68B4 -/* 0DB3D4 7F0A68A4 00000000 */ nop -/* 0DB3D8 7F0A68A8 0FC29431 */ jal sub_GAME_7F0A50C4 -/* 0DB3DC 7F0A68AC 00000000 */ nop -/* 0DB3E0 7F0A68B0 10400005 */ beqz $v0, .L7F0A68C8 -.L7F0A68B4: -/* 0DB3E4 7F0A68B4 3C018004 */ lui $at, %hi(D_800409A0) -/* 0DB3E8 7F0A68B8 0FC2941F */ jal set_D_80040AE0_0 -/* 0DB3EC 7F0A68BC AC2009A0 */ sw $zero, %lo(D_800409A0)($at) -/* 0DB3F0 7F0A68C0 0FC293D1 */ jal sub_GAME_7F0A4F44 -/* 0DB3F4 7F0A68C4 00000000 */ nop -.L7F0A68C8: -/* 0DB3F8 7F0A68C8 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A68CC: -/* 0DB3FC 7F0A68CC 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DB400 7F0A68D0 03E00008 */ jr $ra -/* 0DB404 7F0A68D4 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -2582,421 +2253,185 @@ void sub_GAME_7F0A69A8(void) { D_800409D8 = 8; } - sub_GAME_7F0A4F44(); - watch_screen_index = 0; - D_800409A0 = 4; + reset_watch_soundrelated_maybe(); + watch_screen_index = WATCH_INDEX_MISSION_STATUS; + mission_brief_index = BRIEF_INDEX_OBJECTIVES; D_800409C8 = 0.999f; D_800409CC = 0.9999f; calculate_equip_cur_item(); } -#ifdef NONMATCHING -f32 sub_GAME_7F0A6A2C(f32 arg0) { - f32 phi_f12; - - if (3.1415927f < arg0) { - return arg0 - 6.2831855f; +f32 sub_GAME_7F0A6A2C(f32 arg0) +{ + if (arg0 > 3.1415927f) + { + arg0 = arg0 - 6.2831855f; } - - phi_f12 = arg0; - - if (-3.1415927f > arg0) { - return arg0 + 6.2831855f; + else if (arg0 < -3.1415927f) + { + arg0 = arg0 + 6.2831855f; } - return phi_f12; + return arg0; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800584B8 -.word 0x40490fdb /*3.1415927*/ -glabel D_800584BC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800584C0 -.word 0xc0490fdb /*-3.1415927*/ -glabel D_800584C4 -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F0A6A2C -/* 0DB55C 7F0A6A2C 3C018006 */ lui $at, %hi(D_800584B8) -/* 0DB560 7F0A6A30 C42484B8 */ lwc1 $f4, %lo(D_800584B8)($at) -/* 0DB564 7F0A6A34 3C018006 */ lui $at, %hi(D_800584C0) -/* 0DB568 7F0A6A38 460C203C */ c.lt.s $f4, $f12 -/* 0DB56C 7F0A6A3C 00000000 */ nop -/* 0DB570 7F0A6A40 45000005 */ bc1f .L7F0A6A58 -/* 0DB574 7F0A6A44 00000000 */ nop -/* 0DB578 7F0A6A48 3C018006 */ lui $at, %hi(D_800584BC) -/* 0DB57C 7F0A6A4C C42684BC */ lwc1 $f6, %lo(D_800584BC)($at) -/* 0DB580 7F0A6A50 03E00008 */ jr $ra -/* 0DB584 7F0A6A54 46066001 */ sub.s $f0, $f12, $f6 - -.L7F0A6A58: -/* 0DB588 7F0A6A58 C42884C0 */ lwc1 $f8, %lo(D_800584C0)($at) -/* 0DB58C 7F0A6A5C 3C018006 */ lui $at, %hi(D_800584C4) -/* 0DB590 7F0A6A60 4608603C */ c.lt.s $f12, $f8 -/* 0DB594 7F0A6A64 00000000 */ nop -/* 0DB598 7F0A6A68 45000003 */ bc1f .L7F0A6A78 -/* 0DB59C 7F0A6A6C 00000000 */ nop -/* 0DB5A0 7F0A6A70 C42A84C4 */ lwc1 $f10, %lo(D_800584C4)($at) -/* 0DB5A4 7F0A6A74 460A6300 */ add.s $f12, $f12, $f10 -.L7F0A6A78: -/* 0DB5A8 7F0A6A78 03E00008 */ jr $ra -/* 0DB5AC 7F0A6A7C 46006006 */ mov.s $f0, $f12 -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F0A6A80(void) { - -} -#else #ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_800584C8 -.word 0x40c90fdb /*6.2831855*/ +void sub_GAME_7F0A6A80(void) +{ + u32 temp_1; + s32 temp_2; + s32 temp_3; + u32 random_value; -/*D:800584CC*/ -glabel jpt_800584CC -.word .L7F0A6E04 -.word .L7F0A6ED0 -.word .L7F0A6E14 -.word .L7F0A6E60 -.word .L7F0A6EC0 + if (get_controller_buttons_pressed(0, 0x1000)) + { + set_open_close_solo_watch_menu_to1(); + } -/*D:800584E0*/ -glabel jpt_800584E0 -.word .L7F0A6E88 -.word .L7F0A6E98 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 -.word .L7F0A6EA8 + if (controlstick_lr_enabled == 0) + { + if ((get_cur_controller_horz_stick_pos(0) >= -0xA) && (get_cur_controller_horz_stick_pos(0) < 0xB)) + { + controlstick_lr_enabled = 1; + } + else if ((get_cur_controller_horz_stick_pos(0) < 0xB) && (controller_7000C174(0) >= 0xB)) + { + controlstick_lr_enabled = 1; + } + else if ((get_cur_controller_horz_stick_pos(0) >= -0xA) && (controller_7000C174(0) < -0xA)) + { + controlstick_lr_enabled = 1; + } + } -.text -glabel sub_GAME_7F0A6A80 -/* 0DB5B0 7F0A6A80 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0DB5B4 7F0A6A84 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DB5B8 7F0A6A88 00002025 */ move $a0, $zero -/* 0DB5BC 7F0A6A8C 0C0030EB */ jal get_controller_buttons_pressed -/* 0DB5C0 7F0A6A90 24051000 */ li $a1, 4096 -/* 0DB5C4 7F0A6A94 10400003 */ beqz $v0, .L7F0A6AA4 -/* 0DB5C8 7F0A6A98 00000000 */ nop -/* 0DB5CC 7F0A6A9C 0FC1FE18 */ jal set_open_close_solo_watch_menu_to1 -/* 0DB5D0 7F0A6AA0 00000000 */ nop -.L7F0A6AA4: -/* 0DB5D4 7F0A6AA4 3C0E8004 */ lui $t6, %hi(controlstick_lr_enabled) -/* 0DB5D8 7F0A6AA8 8DCE0ADC */ lw $t6, %lo(controlstick_lr_enabled)($t6) -/* 0DB5DC 7F0A6AAC 15C00027 */ bnez $t6, .L7F0A6B4C -/* 0DB5E0 7F0A6AB0 00000000 */ nop -/* 0DB5E4 7F0A6AB4 0C00303B */ jal get_cur_controller_horz_stick_pos -/* 0DB5E8 7F0A6AB8 00002025 */ move $a0, $zero -/* 0DB5EC 7F0A6ABC 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB5F0 7F0A6AC0 14200009 */ bnez $at, .L7F0A6AE8 -/* 0DB5F4 7F0A6AC4 00000000 */ nop -/* 0DB5F8 7F0A6AC8 0C00303B */ jal get_cur_controller_horz_stick_pos -/* 0DB5FC 7F0A6ACC 00002025 */ move $a0, $zero -/* 0DB600 7F0A6AD0 2841000B */ slti $at, $v0, 0xb -/* 0DB604 7F0A6AD4 10200004 */ beqz $at, .L7F0A6AE8 -/* 0DB608 7F0A6AD8 240F0001 */ li $t7, 1 -/* 0DB60C 7F0A6ADC 3C018004 */ lui $at, %hi(controlstick_lr_enabled) -/* 0DB610 7F0A6AE0 1000001A */ b .L7F0A6B4C -/* 0DB614 7F0A6AE4 AC2F0ADC */ sw $t7, %lo(controlstick_lr_enabled)($at) -.L7F0A6AE8: -/* 0DB618 7F0A6AE8 0C00303B */ jal get_cur_controller_horz_stick_pos -/* 0DB61C 7F0A6AEC 00002025 */ move $a0, $zero -/* 0DB620 7F0A6AF0 2841000B */ slti $at, $v0, 0xb -/* 0DB624 7F0A6AF4 10200009 */ beqz $at, .L7F0A6B1C -/* 0DB628 7F0A6AF8 00000000 */ nop -/* 0DB62C 7F0A6AFC 0C00305D */ jal controller_7000C174 -/* 0DB630 7F0A6B00 00002025 */ move $a0, $zero -/* 0DB634 7F0A6B04 2841000B */ slti $at, $v0, 0xb -/* 0DB638 7F0A6B08 14200004 */ bnez $at, .L7F0A6B1C -/* 0DB63C 7F0A6B0C 24180001 */ li $t8, 1 -/* 0DB640 7F0A6B10 3C018004 */ lui $at, %hi(controlstick_lr_enabled) -/* 0DB644 7F0A6B14 1000000D */ b .L7F0A6B4C -/* 0DB648 7F0A6B18 AC380ADC */ sw $t8, %lo(controlstick_lr_enabled)($at) -.L7F0A6B1C: -/* 0DB64C 7F0A6B1C 0C00303B */ jal get_cur_controller_horz_stick_pos -/* 0DB650 7F0A6B20 00002025 */ move $a0, $zero -/* 0DB654 7F0A6B24 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB658 7F0A6B28 14200008 */ bnez $at, .L7F0A6B4C -/* 0DB65C 7F0A6B2C 00000000 */ nop -/* 0DB660 7F0A6B30 0C00305D */ jal controller_7000C174 -/* 0DB664 7F0A6B34 00002025 */ move $a0, $zero -/* 0DB668 7F0A6B38 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB66C 7F0A6B3C 10200003 */ beqz $at, .L7F0A6B4C -/* 0DB670 7F0A6B40 24190001 */ li $t9, 1 -/* 0DB674 7F0A6B44 3C018004 */ lui $at, %hi(controlstick_lr_enabled) -/* 0DB678 7F0A6B48 AC390ADC */ sw $t9, %lo(controlstick_lr_enabled)($at) -.L7F0A6B4C: -/* 0DB67C 7F0A6B4C 3C088004 */ lui $t0, %hi(D_80040AE0) -/* 0DB680 7F0A6B50 8D080AE0 */ lw $t0, %lo(D_80040AE0)($t0) -/* 0DB684 7F0A6B54 15000027 */ bnez $t0, .L7F0A6BF4 -/* 0DB688 7F0A6B58 00000000 */ nop -/* 0DB68C 7F0A6B5C 0C00307F */ jal get_cur_controller_vert_stick_pos -/* 0DB690 7F0A6B60 00002025 */ move $a0, $zero -/* 0DB694 7F0A6B64 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB698 7F0A6B68 14200009 */ bnez $at, .L7F0A6B90 -/* 0DB69C 7F0A6B6C 00000000 */ nop -/* 0DB6A0 7F0A6B70 0C00307F */ jal get_cur_controller_vert_stick_pos -/* 0DB6A4 7F0A6B74 00002025 */ move $a0, $zero -/* 0DB6A8 7F0A6B78 2841000B */ slti $at, $v0, 0xb -/* 0DB6AC 7F0A6B7C 10200004 */ beqz $at, .L7F0A6B90 -/* 0DB6B0 7F0A6B80 24090001 */ li $t1, 1 -/* 0DB6B4 7F0A6B84 3C018004 */ lui $at, %hi(D_80040AE0) -/* 0DB6B8 7F0A6B88 1000001A */ b .L7F0A6BF4 -/* 0DB6BC 7F0A6B8C AC290AE0 */ sw $t1, %lo(D_80040AE0)($at) -.L7F0A6B90: -/* 0DB6C0 7F0A6B90 0C00307F */ jal get_cur_controller_vert_stick_pos -/* 0DB6C4 7F0A6B94 00002025 */ move $a0, $zero -/* 0DB6C8 7F0A6B98 2841000B */ slti $at, $v0, 0xb -/* 0DB6CC 7F0A6B9C 10200009 */ beqz $at, .L7F0A6BC4 -/* 0DB6D0 7F0A6BA0 00000000 */ nop -/* 0DB6D4 7F0A6BA4 0C0030A1 */ jal controller_7000C284 -/* 0DB6D8 7F0A6BA8 00002025 */ move $a0, $zero -/* 0DB6DC 7F0A6BAC 2841000B */ slti $at, $v0, 0xb -/* 0DB6E0 7F0A6BB0 14200004 */ bnez $at, .L7F0A6BC4 -/* 0DB6E4 7F0A6BB4 240A0001 */ li $t2, 1 -/* 0DB6E8 7F0A6BB8 3C018004 */ lui $at, %hi(D_80040AE0) -/* 0DB6EC 7F0A6BBC 1000000D */ b .L7F0A6BF4 -/* 0DB6F0 7F0A6BC0 AC2A0AE0 */ sw $t2, %lo(D_80040AE0)($at) -.L7F0A6BC4: -/* 0DB6F4 7F0A6BC4 0C00307F */ jal get_cur_controller_vert_stick_pos -/* 0DB6F8 7F0A6BC8 00002025 */ move $a0, $zero -/* 0DB6FC 7F0A6BCC 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB700 7F0A6BD0 14200008 */ bnez $at, .L7F0A6BF4 -/* 0DB704 7F0A6BD4 00000000 */ nop -/* 0DB708 7F0A6BD8 0C0030A1 */ jal controller_7000C284 -/* 0DB70C 7F0A6BDC 00002025 */ move $a0, $zero -/* 0DB710 7F0A6BE0 2841FFF6 */ slti $at, $v0, -0xa -/* 0DB714 7F0A6BE4 10200003 */ beqz $at, .L7F0A6BF4 -/* 0DB718 7F0A6BE8 240B0001 */ li $t3, 1 -/* 0DB71C 7F0A6BEC 3C018004 */ lui $at, %hi(D_80040AE0) -/* 0DB720 7F0A6BF0 AC2B0AE0 */ sw $t3, %lo(D_80040AE0)($at) -.L7F0A6BF4: -/* 0DB724 7F0A6BF4 3C038004 */ lui $v1, %hi(D_80040AF8) -/* 0DB728 7F0A6BF8 24630AF8 */ addiu $v1, %lo(D_80040AF8) # addiu $v1, $v1, 0xaf8 -/* 0DB72C 7F0A6BFC 8C620000 */ lw $v0, ($v1) -/* 0DB730 7F0A6C00 04410007 */ bgez $v0, .L7F0A6C20 -/* 0DB734 7F0A6C04 244EFFFF */ addiu $t6, $v0, -1 -/* 0DB738 7F0A6C08 3C048004 */ lui $a0, %hi(D_80040AF4) -/* 0DB73C 7F0A6C0C 24840AF4 */ addiu $a0, %lo(D_80040AF4) # addiu $a0, $a0, 0xaf4 -/* 0DB740 7F0A6C10 8C8C0000 */ lw $t4, ($a0) -/* 0DB744 7F0A6C14 3C01FFF0 */ lui $at, 0xfff0 -/* 0DB748 7F0A6C18 01816821 */ addu $t5, $t4, $at -/* 0DB74C 7F0A6C1C AC8D0000 */ sw $t5, ($a0) -.L7F0A6C20: -/* 0DB750 7F0A6C20 3C048004 */ lui $a0, %hi(D_80040AF4) -/* 0DB754 7F0A6C24 24840AF4 */ addiu $a0, %lo(D_80040AF4) # addiu $a0, $a0, 0xaf4 -/* 0DB758 7F0A6C28 8C8F0000 */ lw $t7, ($a0) -/* 0DB75C 7F0A6C2C 3C01005F */ lui $at, (0x005F00A1 >> 16) # lui $at, 0x5f -/* 0DB760 7F0A6C30 342100A1 */ ori $at, (0x005F00A1 & 0xFFFF) # ori $at, $at, 0xa1 -/* 0DB764 7F0A6C34 01E1082B */ sltu $at, $t7, $at -/* 0DB768 7F0A6C38 10200006 */ beqz $at, .L7F0A6C54 -/* 0DB76C 7F0A6C3C AC6E0000 */ sw $t6, ($v1) -/* 0DB770 7F0A6C40 3C1800FF */ lui $t8, (0x00FF00A0 >> 16) # lui $t8, 0xff -/* 0DB774 7F0A6C44 371800A0 */ ori $t8, (0x00FF00A0 & 0xFFFF) # ori $t8, $t8, 0xa0 -/* 0DB778 7F0A6C48 2419000F */ li $t9, 15 -/* 0DB77C 7F0A6C4C AC980000 */ sw $t8, ($a0) -/* 0DB780 7F0A6C50 AC790000 */ sw $t9, ($v1) -.L7F0A6C54: -/* 0DB784 7F0A6C54 3C038004 */ lui $v1, %hi(D_80040B00) -/* 0DB788 7F0A6C58 24630B00 */ addiu $v1, %lo(D_80040B00) # addiu $v1, $v1, 0xb00 -/* 0DB78C 7F0A6C5C 8C620000 */ lw $v0, ($v1) -/* 0DB790 7F0A6C60 3C048004 */ lui $a0, %hi(D_80040AFC) -/* 0DB794 7F0A6C64 24840AFC */ addiu $a0, %lo(D_80040AFC) # addiu $a0, $a0, 0xafc -/* 0DB798 7F0A6C68 04410004 */ bgez $v0, .L7F0A6C7C -/* 0DB79C 7F0A6C6C 3C0E8005 */ lui $t6, %hi(D_80048498) -/* 0DB7A0 7F0A6C70 8C880000 */ lw $t0, ($a0) -/* 0DB7A4 7F0A6C74 2509FFF0 */ addiu $t1, $t0, -0x10 -/* 0DB7A8 7F0A6C78 AC890000 */ sw $t1, ($a0) -.L7F0A6C7C: -/* 0DB7AC 7F0A6C7C 3C048004 */ lui $a0, %hi(D_80040AFC) -/* 0DB7B0 7F0A6C80 24840AFC */ addiu $a0, %lo(D_80040AFC) # addiu $a0, $a0, 0xafc -/* 0DB7B4 7F0A6C84 8C8B0000 */ lw $t3, ($a0) -/* 0DB7B8 7F0A6C88 244AFFFF */ addiu $t2, $v0, -1 -/* 0DB7BC 7F0A6C8C AC6A0000 */ sw $t2, ($v1) -/* 0DB7C0 7F0A6C90 2D610060 */ sltiu $at, $t3, 0x60 -/* 0DB7C4 7F0A6C94 10200004 */ beqz $at, .L7F0A6CA8 -/* 0DB7C8 7F0A6C98 240C00FF */ li $t4, 255 -/* 0DB7CC 7F0A6C9C 240D000F */ li $t5, 15 -/* 0DB7D0 7F0A6CA0 AC8C0000 */ sw $t4, ($a0) -/* 0DB7D4 7F0A6CA4 AC6D0000 */ sw $t5, ($v1) -.L7F0A6CA8: -/* 0DB7D8 7F0A6CA8 8DCE8498 */ lw $t6, %lo(D_80048498)($t6) -/* 0DB7DC 7F0A6CAC 3C018004 */ lui $at, %hi(D_80040B1C) -/* 0DB7E0 7F0A6CB0 C4240B1C */ lwc1 $f4, %lo(D_80040B1C)($at) -/* 0DB7E4 7F0A6CB4 448E3000 */ mtc1 $t6, $f6 -/* 0DB7E8 7F0A6CB8 3C018006 */ lui $at, %hi(D_800584C8) -/* 0DB7EC 7F0A6CBC C43084C8 */ lwc1 $f16, %lo(D_800584C8)($at) -/* 0DB7F0 7F0A6CC0 46803220 */ cvt.s.w $f8, $f6 -/* 0DB7F4 7F0A6CC4 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0DB7F8 7F0A6CC8 44813000 */ mtc1 $at, $f6 -/* 0DB7FC 7F0A6CCC 3C028004 */ lui $v0, %hi(D_80040B14) -/* 0DB800 7F0A6CD0 24420B14 */ addiu $v0, %lo(D_80040B14) # addiu $v0, $v0, 0xb14 -/* 0DB804 7F0A6CD4 46082282 */ mul.s $f10, $f4, $f8 -/* 0DB808 7F0A6CD8 C4480000 */ lwc1 $f8, ($v0) -/* 0DB80C 7F0A6CDC 46105482 */ mul.s $f18, $f10, $f16 -/* 0DB810 7F0A6CE0 46069103 */ div.s $f4, $f18, $f6 -/* 0DB814 7F0A6CE4 46044280 */ add.s $f10, $f8, $f4 -/* 0DB818 7F0A6CE8 E44A0000 */ swc1 $f10, ($v0) -/* 0DB81C 7F0A6CEC 0FC29A8B */ jal sub_GAME_7F0A6A2C -/* 0DB820 7F0A6CF0 C44C0000 */ lwc1 $f12, ($v0) -/* 0DB824 7F0A6CF4 3C028004 */ lui $v0, %hi(D_80040B14) -/* 0DB828 7F0A6CF8 24420B14 */ addiu $v0, %lo(D_80040B14) # addiu $v0, $v0, 0xb14 -/* 0DB82C 7F0A6CFC E4400000 */ swc1 $f0, ($v0) -/* 0DB830 7F0A6D00 3C0F8004 */ lui $t7, %hi(D_80040B0C) -/* 0DB834 7F0A6D04 8DEF0B0C */ lw $t7, %lo(D_80040B0C)($t7) -/* 0DB838 7F0A6D08 000FC400 */ sll $t8, $t7, 0x10 -/* 0DB83C 7F0A6D0C 0C002914 */ jal get_random_value -/* 0DB840 7F0A6D10 AFB8001C */ sw $t8, 0x1c($sp) -/* 0DB844 7F0A6D14 8FB9001C */ lw $t9, 0x1c($sp) -/* 0DB848 7F0A6D18 0322082B */ sltu $at, $t9, $v0 -/* 0DB84C 7F0A6D1C 10200003 */ beqz $at, .L7F0A6D2C -/* 0DB850 7F0A6D20 00000000 */ nop -/* 0DB854 7F0A6D24 0FC29476 */ jal sub_GAME_7F0A51D8 -/* 0DB858 7F0A6D28 00000000 */ nop -.L7F0A6D2C: -/* 0DB85C 7F0A6D2C 3C048004 */ lui $a0, %hi(D_80040B04) -/* 0DB860 7F0A6D30 24840B04 */ addiu $a0, %lo(D_80040B04) # addiu $a0, $a0, 0xb04 -/* 0DB864 7F0A6D34 8C830000 */ lw $v1, ($a0) -/* 0DB868 7F0A6D38 286100E0 */ slti $at, $v1, 0xe0 -/* 0DB86C 7F0A6D3C 5020000A */ beql $at, $zero, .L7F0A6D68 -/* 0DB870 7F0A6D40 286100E1 */ slti $at, $v1, 0xe1 -/* 0DB874 7F0A6D44 0C002914 */ jal get_random_value -/* 0DB878 7F0A6D48 00000000 */ nop -/* 0DB87C 7F0A6D4C 3C048004 */ lui $a0, %hi(D_80040B04) -/* 0DB880 7F0A6D50 24840B04 */ addiu $a0, %lo(D_80040B04) # addiu $a0, $a0, 0xb04 -/* 0DB884 7F0A6D54 8C880000 */ lw $t0, ($a0) -/* 0DB888 7F0A6D58 00024F82 */ srl $t1, $v0, 0x1e -/* 0DB88C 7F0A6D5C 01091821 */ addu $v1, $t0, $t1 -/* 0DB890 7F0A6D60 AC830000 */ sw $v1, ($a0) -/* 0DB894 7F0A6D64 286100E1 */ slti $at, $v1, 0xe1 -.L7F0A6D68: -/* 0DB898 7F0A6D68 14200003 */ bnez $at, .L7F0A6D78 -/* 0DB89C 7F0A6D6C 24080156 */ li $t0, 342 -/* 0DB8A0 7F0A6D70 240300E0 */ li $v1, 224 -/* 0DB8A4 7F0A6D74 AC830000 */ sw $v1, ($a0) -.L7F0A6D78: -/* 0DB8A8 7F0A6D78 00036023 */ negu $t4, $v1 -/* 0DB8AC 7F0A6D7C 000C6880 */ sll $t5, $t4, 2 -/* 0DB8B0 7F0A6D80 3C048004 */ lui $a0, %hi(D_80040B40) -/* 0DB8B4 7F0A6D84 25AE0380 */ addiu $t6, $t5, 0x380 -/* 0DB8B8 7F0A6D88 3C018004 */ lui $at, %hi(D_80040B08) -/* 0DB8BC 7F0A6D8C 24840B40 */ addiu $a0, %lo(D_80040B40) # addiu $a0, $a0, 0xb40 -/* 0DB8C0 7F0A6D90 AC2E0B08 */ sw $t6, %lo(D_80040B08)($at) -/* 0DB8C4 7F0A6D94 8C8F0000 */ lw $t7, ($a0) -/* 0DB8C8 7F0A6D98 25E2FFFC */ addiu $v0, $t7, -4 -/* 0DB8CC 7F0A6D9C 28410157 */ slti $at, $v0, 0x157 -/* 0DB8D0 7F0A6DA0 14200003 */ bnez $at, .L7F0A6DB0 -/* 0DB8D4 7F0A6DA4 AC820000 */ sw $v0, ($a0) -/* 0DB8D8 7F0A6DA8 2402FEAA */ li $v0, -342 -/* 0DB8DC 7F0A6DAC AC820000 */ sw $v0, ($a0) -.L7F0A6DB0: -/* 0DB8E0 7F0A6DB0 2841FEAA */ slti $at, $v0, -0x156 -/* 0DB8E4 7F0A6DB4 10200002 */ beqz $at, .L7F0A6DC0 -/* 0DB8E8 7F0A6DB8 3C028004 */ lui $v0, %hi(D_80040B44) -/* 0DB8EC 7F0A6DBC AC880000 */ sw $t0, ($a0) -.L7F0A6DC0: -/* 0DB8F0 7F0A6DC0 24420B44 */ addiu $v0, %lo(D_80040B44) # addiu $v0, $v0, 0xb44 -/* 0DB8F4 7F0A6DC4 84490000 */ lh $t1, ($v0) -/* 0DB8F8 7F0A6DC8 3C0D8004 */ lui $t5, %hi(watch_screen_index) -/* 0DB8FC 7F0A6DCC 252A0001 */ addiu $t2, $t1, 1 -/* 0DB900 7F0A6DD0 A44A0000 */ sh $t2, ($v0) -/* 0DB904 7F0A6DD4 844B0000 */ lh $t3, ($v0) -/* 0DB908 7F0A6DD8 316C0001 */ andi $t4, $t3, 1 -/* 0DB90C 7F0A6DDC A44C0000 */ sh $t4, ($v0) -/* 0DB910 7F0A6DE0 8DAD0994 */ lw $t5, %lo(watch_screen_index)($t5) -/* 0DB914 7F0A6DE4 2DA10005 */ sltiu $at, $t5, 5 -/* 0DB918 7F0A6DE8 1020003B */ beqz $at, .L7F0A6ED8 -/* 0DB91C 7F0A6DEC 000D6880 */ sll $t5, $t5, 2 -/* 0DB920 7F0A6DF0 3C018006 */ lui $at, %hi(jpt_800584CC) -/* 0DB924 7F0A6DF4 002D0821 */ addu $at, $at, $t5 -/* 0DB928 7F0A6DF8 8C2D84CC */ lw $t5, %lo(jpt_800584CC)($at) -/* 0DB92C 7F0A6DFC 01A00008 */ jr $t5 -/* 0DB930 7F0A6E00 00000000 */ nop -.L7F0A6E04: -/* 0DB934 7F0A6E04 0FC2949B */ jal watch_screen0_navigation -/* 0DB938 7F0A6E08 00000000 */ nop -/* 0DB93C 7F0A6E0C 10000033 */ b .L7F0A6EDC -/* 0DB940 7F0A6E10 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6E14: -/* 0DB944 7F0A6E14 3C028004 */ lui $v0, %hi(D_80040998) -/* 0DB948 7F0A6E18 8C420998 */ lw $v0, %lo(D_80040998)($v0) -/* 0DB94C 7F0A6E1C 24010001 */ li $at, 1 -/* 0DB950 7F0A6E20 10400005 */ beqz $v0, .L7F0A6E38 -/* 0DB954 7F0A6E24 00000000 */ nop -/* 0DB958 7F0A6E28 10410007 */ beq $v0, $at, .L7F0A6E48 -/* 0DB95C 7F0A6E2C 00000000 */ nop -/* 0DB960 7F0A6E30 10000007 */ b .L7F0A6E50 -/* 0DB964 7F0A6E34 00000000 */ nop -.L7F0A6E38: -/* 0DB968 7F0A6E38 0FC29618 */ jal sub_GAME_7F0A5860 -/* 0DB96C 7F0A6E3C 00000000 */ nop -/* 0DB970 7F0A6E40 10000003 */ b .L7F0A6E50 -/* 0DB974 7F0A6E44 00000000 */ nop -.L7F0A6E48: -/* 0DB978 7F0A6E48 0FC29640 */ jal sub_GAME_7F0A5900 -/* 0DB97C 7F0A6E4C 00000000 */ nop -.L7F0A6E50: -/* 0DB980 7F0A6E50 0FC29571 */ jal watch_screen2_navigation -/* 0DB984 7F0A6E54 00000000 */ nop -/* 0DB988 7F0A6E58 10000020 */ b .L7F0A6EDC -/* 0DB98C 7F0A6E5C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6E60: -/* 0DB990 7F0A6E60 3C0E8004 */ lui $t6, %hi(D_8004099C) -/* 0DB994 7F0A6E64 8DCE099C */ lw $t6, %lo(D_8004099C)($t6) -/* 0DB998 7F0A6E68 2DC1000A */ sltiu $at, $t6, 0xa -/* 0DB99C 7F0A6E6C 10200010 */ beqz $at, .L7F0A6EB0 -/* 0DB9A0 7F0A6E70 000E7080 */ sll $t6, $t6, 2 -/* 0DB9A4 7F0A6E74 3C018006 */ lui $at, %hi(jpt_800584E0) -/* 0DB9A8 7F0A6E78 002E0821 */ addu $at, $at, $t6 -/* 0DB9AC 7F0A6E7C 8C2E84E0 */ lw $t6, %lo(jpt_800584E0)($at) -/* 0DB9B0 7F0A6E80 01C00008 */ jr $t6 -/* 0DB9B4 7F0A6E84 00000000 */ nop -.L7F0A6E88: -/* 0DB9B8 7F0A6E88 0FC29699 */ jal sub_GAME_7F0A5A64 -/* 0DB9BC 7F0A6E8C 00000000 */ nop -/* 0DB9C0 7F0A6E90 10000007 */ b .L7F0A6EB0 -/* 0DB9C4 7F0A6E94 00000000 */ nop -.L7F0A6E98: -/* 0DB9C8 7F0A6E98 0FC296BD */ jal sub_GAME_7F0A5AF4 -/* 0DB9CC 7F0A6E9C 00000000 */ nop -/* 0DB9D0 7F0A6EA0 10000003 */ b .L7F0A6EB0 -/* 0DB9D4 7F0A6EA4 00000000 */ nop -.L7F0A6EA8: -/* 0DB9D8 7F0A6EA8 0FC29666 */ jal sub_GAME_7F0A5998 -/* 0DB9DC 7F0A6EAC 00000000 */ nop -.L7F0A6EB0: -/* 0DB9E0 7F0A6EB0 0FC295A9 */ jal watch_screen3_navigation -/* 0DB9E4 7F0A6EB4 00000000 */ nop -/* 0DB9E8 7F0A6EB8 10000008 */ b .L7F0A6EDC -/* 0DB9EC 7F0A6EBC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6EC0: -/* 0DB9F0 7F0A6EC0 0FC295E1 */ jal watch_screen4_navigation -/* 0DB9F4 7F0A6EC4 00000000 */ nop -/* 0DB9F8 7F0A6EC8 10000004 */ b .L7F0A6EDC -/* 0DB9FC 7F0A6ECC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6ED0: -/* 0DBA00 7F0A6ED0 0FC294F6 */ jal watch_screen1_navigation -/* 0DBA04 7F0A6ED4 00000000 */ nop -.L7F0A6ED8: -/* 0DBA08 7F0A6ED8 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A6EDC: -/* 0DBA0C 7F0A6EDC 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0DBA10 7F0A6EE0 03E00008 */ jr $ra -/* 0DBA14 7F0A6EE4 00000000 */ nop -) + if (D_80040AE0 == 0) + { + if ((get_cur_controller_vert_stick_pos(0) >= -0xA) && (get_cur_controller_vert_stick_pos(0) < 0xB)) + { + D_80040AE0 = 1; + } + else if ((get_cur_controller_vert_stick_pos(0) < 0xB) && (controller_7000C284(0) >= 0xB)) + { + D_80040AE0 = 1; + } + else if ((get_cur_controller_vert_stick_pos(0) >= -0xA) && (controller_7000C284(0) < -0xA)) + { + D_80040AE0 = 1; + } + } + + temp_2 = D_80040AF8; + if (temp_2 < 0) + { + D_80040AF4 = D_80040AF4 + 0xFFF00000; + } + D_80040AF8 = temp_2 - 1; + + if (D_80040AF4 < 0x5F00A1U) + { + D_80040AF4 = 0xFF00A0U; + D_80040AF8 = 0xF; + } + + temp_3 = D_80040B00; + if (temp_3 < 0) + { + D_80040AFC = D_80040AFC - 0x10; + } + D_80040B00 = temp_3 - 1; + + if (D_80040AFC < 0x60U) + { + D_80040AFC = 0xFFU; + D_80040B00 = 0xF; + } + + D_80040B14 += ((D_80040B1C * D_80048498 * 6.2831855f) / 360.0f); + + D_80040B14 = sub_GAME_7F0A6A2C(D_80040B14); + + temp_1 = D_80040B0C << 0x10; + if (temp_1 < get_random_value()) + { + sub_GAME_7F0A51D8(); + } + + if (D_80040B04 < 0xE0) + { + random_value = get_random_value(); + D_80040B04 += (random_value >> 0x1E); + } + + if (D_80040B04 > 0xe0) { + D_80040B04 = 0xe0; + } + + D_80040B08 = ((-D_80040B04 * 4) + 0x380); + D_80040B40 = D_80040B40 - 4; + + if (D_80040B40 >= 0x157) { + D_80040B40 = -0x156; + } + + if (D_80040B40 < -0x156) { + D_80040B40 = 0x156; + } + + D_80040B44 = D_80040B44 + 1; + D_80040B44 = D_80040B44 & 1; + + switch (watch_screen_index) + { + case WATCH_INDEX_MISSION_STATUS: + watch_screen0_navigation(); + break; + + case WATCH_INDEX_CONTROL_OPTIONS: + switch (controller_options_index) + { + case CONTROLLER_OPTIONS_INDEX_STYLE: + controller_options_controlstyle_navigation(); + break; + + case CONTROLLER_OPTIONS_INDEX_INPUTS: + controller_options_inputs_navigation(); + } + watch_screen2_navigation(); + break; + + case WATCH_INDEX_GAME_OPTIONS: + switch (game_options_index) + { + case GAME_OPTIONS_INDEX_MUSIC: + game_options_music_volume_navigation(); + break; + + case GAME_OPTIONS_INDEX_FX: + game_options_fx_volume_navigation(); + break; + + case GAME_OPTIONS_INDEX_LOOK_UPDOWN: + case GAME_OPTIONS_INDEX_AUTO_AIM: + case GAME_OPTIONS_INDEX_AIM_CONTROL: + case GAME_OPTIONS_INDEX_SIGHT_ONSCREEN: + case GAME_OPTIONS_INDEX_LOOK_AHEAD: + case GAME_OPTIONS_INDEX_AMMO_ONSCREEN: + case GAME_OPTIONS_INDEX_SCREEN_SIZE: + case GAME_OPTIONS_INDEX_RATIO: + sub_GAME_7F0A5998(); + } + watch_screen3_navigation(); + break; + + case WATCH_INDEX_MISSION_BRIEFING: + watch_screen4_navigation(); + break; + + case WATCH_INDEX_INVENTORY: + watch_screen1_navigation(); + } +} #endif #ifdef VERSION_JP @@ -3273,8 +2708,8 @@ glabel sub_GAME_7F0A6A80 /* 0DC514 7F0A79A4 10000033 */ b .Ljp7F0A7A74 /* 0DC518 7F0A79A8 8FBF0014 */ lw $ra, 0x14($sp) .Ljp7F0A6E14: -/* 0DC51C 7F0A79AC 3C028004 */ lui $v0, %hi(D_80040998) # $v0, 0x8004 -/* 0DC520 7F0A79B0 8C4209C8 */ lw $v0, %lo(D_80040998)($v0) +/* 0DC51C 7F0A79AC 3C028004 */ lui $v0, %hi(controller_options_index) # $v0, 0x8004 +/* 0DC520 7F0A79B0 8C4209C8 */ lw $v0, %lo(controller_options_index)($v0) /* 0DC524 7F0A79B4 24010001 */ li $at, 1 /* 0DC528 7F0A79B8 10400005 */ beqz $v0, .Ljp7F0A79D0 /* 0DC52C 7F0A79BC 00000000 */ nop @@ -3283,12 +2718,12 @@ glabel sub_GAME_7F0A6A80 /* 0DC538 7F0A79C8 10000007 */ b .Ljp7F0A79E8 /* 0DC53C 7F0A79CC 00000000 */ nop .Ljp7F0A79D0: -/* 0DC540 7F0A79D0 0FC29900 */ jal sub_GAME_7F0A5860 +/* 0DC540 7F0A79D0 0FC29900 */ jal controller_options_controlstyle_navigation /* 0DC544 7F0A79D4 00000000 */ nop /* 0DC548 7F0A79D8 10000003 */ b .Ljp7F0A79E8 /* 0DC54C 7F0A79DC 00000000 */ nop .Ljp7F0A79E0: -/* 0DC550 7F0A79E0 0FC29928 */ jal sub_GAME_7F0A5900 +/* 0DC550 7F0A79E0 0FC29928 */ jal controller_options_inputs_navigation /* 0DC554 7F0A79E4 00000000 */ nop .Ljp7F0A79E8: /* 0DC558 7F0A79E8 0FC29859 */ jal watch_screen2_navigation @@ -3296,8 +2731,8 @@ glabel sub_GAME_7F0A6A80 /* 0DC560 7F0A79F0 10000020 */ b .Ljp7F0A7A74 /* 0DC564 7F0A79F4 8FBF0014 */ lw $ra, 0x14($sp) .Ljp7F0A6E60: -/* 0DC568 7F0A79F8 3C0D8004 */ lui $t5, %hi(D_8004099C) # $t5, 0x8004 -/* 0DC56C 7F0A79FC 8DAD09CC */ lw $t5, %lo(D_8004099C)($t5) +/* 0DC568 7F0A79F8 3C0D8004 */ lui $t5, %hi(game_options_index) # $t5, 0x8004 +/* 0DC56C 7F0A79FC 8DAD09CC */ lw $t5, %lo(game_options_index)($t5) /* 0DC570 7F0A7A00 2DA1000A */ sltiu $at, $t5, 0xa /* 0DC574 7F0A7A04 10200010 */ beqz $at, .Ljp7F0A7A48 /* 0DC578 7F0A7A08 000D6880 */ sll $t5, $t5, 2 @@ -3307,12 +2742,12 @@ glabel sub_GAME_7F0A6A80 /* 0DC588 7F0A7A18 01A00008 */ jr $t5 /* 0DC58C 7F0A7A1C 00000000 */ nop .Ljp7F0A6E88: -/* 0DC590 7F0A7A20 0FC29981 */ jal sub_GAME_7F0A5A64 +/* 0DC590 7F0A7A20 0FC29981 */ jal game_options_music_volume_navigation /* 0DC594 7F0A7A24 00000000 */ nop /* 0DC598 7F0A7A28 10000007 */ b .Ljp7F0A7A48 /* 0DC59C 7F0A7A2C 00000000 */ nop .Ljp7F0A6E98: -/* 0DC5A0 7F0A7A30 0FC299A5 */ jal sub_GAME_7F0A5AF4 +/* 0DC5A0 7F0A7A30 0FC299A5 */ jal game_options_fx_volume_navigation /* 0DC5A4 7F0A7A34 00000000 */ nop /* 0DC5A8 7F0A7A38 10000003 */ b .Ljp7F0A7A48 /* 0DC5AC 7F0A7A3C 00000000 */ nop @@ -3341,8 +2776,6 @@ glabel sub_GAME_7F0A6A80 ) #endif -#endif - #ifdef NONMATCHING @@ -3533,7 +2966,7 @@ glabel sub_GAME_7F0A70AC #ifdef NONMATCHING -void sub_GAME_7F0A714C(void) { +void draw_background_health_and_armor(void) { } #else @@ -3542,7 +2975,7 @@ GLOBAL_ASM( glabel D_80058508 .word 0x3d4ccccd /*0.050000001*/ .text -glabel sub_GAME_7F0A714C +glabel draw_background_health_and_armor /* 0DBC7C 7F0A714C 27BDFFB0 */ addiu $sp, $sp, -0x50 /* 0DBC80 7F0A7150 AFB00018 */ sw $s0, 0x18($sp) /* 0DBC84 7F0A7154 00808025 */ move $s0, $a0 @@ -3972,7 +3405,7 @@ glabel sub_GAME_7F0A714C void sub_GAME_7F0A77A8(u32 param_1,u32 param_2) { - sub_GAME_7F0A714C(param_1,param_2,1); + draw_background_health_and_armor(param_1,param_2,1); } @@ -4395,155 +3828,76 @@ glabel sub_GAME_7F0A77C8 #endif +s32 draw_text_mission_status(s32 arg0) +{ + s32 txtptr_1; + s32 txtptr_2; + s32 sp64; + s32 sp60; + s32 sp5C; + s32 sp58; + s32 ptr_first_font; + s32 ptr_second_font; + s32 sp4C; + s32 joffset; + + txtptr_1 = get_textptr_for_textID(0xAC27); + ptr_first_font = ptrFirstFontTableSmall; + ptr_second_font = ptrSecondFontTableSmall; + + if (check_objectives_complete()) + { + sp4C = 0xFF00B0; + txtptr_2 = get_textptr_for_textID(0xAC28); + } + else + { + sp4C = D_80040AF4; + txtptr_2 = get_textptr_for_textID(0xAC29); + } + arg0 = microcode_constructor(arg0); + sub_GAME_7F0AE98C(&sp5C, &sp58, txtptr_1, ptr_second_font, ptr_first_font, 0); + sp64 = 0x51; + sp60 = 0x41; + arg0 = en_text_write_stuff(arg0, &sp64, &sp60, txtptr_1, ptr_second_font, ptr_first_font, 0xFF00B0, sp58, sp5C, 0, 0); + + if (j_text_trigger) + { + joffset = 0x22; + } + else + { + joffset = 0; + } + + sp64 = sp64 + sp58 + joffset + 4; + sp60 = sp60 - sp5C; + sub_GAME_7F0AE98C(&sp5C, &sp58, txtptr_2, ptr_second_font, ptr_first_font, 0); + arg0 = en_text_write_stuff(arg0, &sp64, &sp60, txtptr_2, ptr_second_font, ptr_first_font, sp4C, sp58, sp5C, 0, 0); + arg0 = sub_GAME_7F0A77C8(arg0); - -#ifdef NONMATCHING -void sub_GAME_7F0A7C18(void) { - -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A7C18 -/* 0DC748 7F0A7C18 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0DC74C 7F0A7C1C AFB20040 */ sw $s2, 0x40($sp) -/* 0DC750 7F0A7C20 00809025 */ move $s2, $a0 -/* 0DC754 7F0A7C24 AFBF0044 */ sw $ra, 0x44($sp) -/* 0DC758 7F0A7C28 AFB1003C */ sw $s1, 0x3c($sp) -/* 0DC75C 7F0A7C2C AFB00038 */ sw $s0, 0x38($sp) -/* 0DC760 7F0A7C30 0FC30776 */ jal get_textptr_for_textID -/* 0DC764 7F0A7C34 3404AC27 */ li $a0, 44071 -/* 0DC768 7F0A7C38 3C108004 */ lui $s0, %hi(ptrFirstFontTableSmall) -/* 0DC76C 7F0A7C3C 3C118004 */ lui $s1, %hi(ptrSecondFontTableSmall) -/* 0DC770 7F0A7C40 AFA2006C */ sw $v0, 0x6c($sp) -/* 0DC774 7F0A7C44 8E100EAC */ lw $s0, %lo(ptrFirstFontTableSmall)($s0) -/* 0DC778 7F0A7C48 0FC15D2E */ jal check_objectives_complete -/* 0DC77C 7F0A7C4C 8E310EB0 */ lw $s1, %lo(ptrSecondFontTableSmall)($s1) -/* 0DC780 7F0A7C50 10400008 */ beqz $v0, .L7F0A7C74 -/* 0DC784 7F0A7C54 3C0F8004 */ lui $t7, %hi(D_80040AF4) -/* 0DC788 7F0A7C58 3C0E00FF */ lui $t6, (0x00FF00B0 >> 16) # lui $t6, 0xff -/* 0DC78C 7F0A7C5C 35CE00B0 */ ori $t6, (0x00FF00B0 & 0xFFFF) # ori $t6, $t6, 0xb0 -/* 0DC790 7F0A7C60 AFAE004C */ sw $t6, 0x4c($sp) -/* 0DC794 7F0A7C64 0FC30776 */ jal get_textptr_for_textID -/* 0DC798 7F0A7C68 3404AC28 */ li $a0, 44072 -/* 0DC79C 7F0A7C6C 10000006 */ b .L7F0A7C88 -/* 0DC7A0 7F0A7C70 AFA20068 */ sw $v0, 0x68($sp) -.L7F0A7C74: -/* 0DC7A4 7F0A7C74 8DEF0AF4 */ lw $t7, %lo(D_80040AF4)($t7) -/* 0DC7A8 7F0A7C78 3404AC29 */ li $a0, 44073 -/* 0DC7AC 7F0A7C7C 0FC30776 */ jal get_textptr_for_textID -/* 0DC7B0 7F0A7C80 AFAF004C */ sw $t7, 0x4c($sp) -/* 0DC7B4 7F0A7C84 AFA20068 */ sw $v0, 0x68($sp) -.L7F0A7C88: -/* 0DC7B8 7F0A7C88 0FC2B366 */ jal microcode_constructor -/* 0DC7BC 7F0A7C8C 02402025 */ move $a0, $s2 -/* 0DC7C0 7F0A7C90 00409025 */ move $s2, $v0 -/* 0DC7C4 7F0A7C94 27A4005C */ addiu $a0, $sp, 0x5c -/* 0DC7C8 7F0A7C98 27A50058 */ addiu $a1, $sp, 0x58 -/* 0DC7CC 7F0A7C9C 8FA6006C */ lw $a2, 0x6c($sp) -/* 0DC7D0 7F0A7CA0 02203825 */ move $a3, $s1 -/* 0DC7D4 7F0A7CA4 AFB00010 */ sw $s0, 0x10($sp) -/* 0DC7D8 7F0A7CA8 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0DC7DC 7F0A7CAC AFA00014 */ sw $zero, 0x14($sp) -/* 0DC7E0 7F0A7CB0 8FA90058 */ lw $t1, 0x58($sp) -/* 0DC7E4 7F0A7CB4 8FAA005C */ lw $t2, 0x5c($sp) -/* 0DC7E8 7F0A7CB8 3C0800FF */ lui $t0, (0x00FF00B0 >> 16) # lui $t0, 0xff -/* 0DC7EC 7F0A7CBC 24180051 */ li $t8, 81 -/* 0DC7F0 7F0A7CC0 24190041 */ li $t9, 65 -/* 0DC7F4 7F0A7CC4 350800B0 */ ori $t0, (0x00FF00B0 & 0xFFFF) # ori $t0, $t0, 0xb0 -/* 0DC7F8 7F0A7CC8 AFB80064 */ sw $t8, 0x64($sp) -/* 0DC7FC 7F0A7CCC AFB90060 */ sw $t9, 0x60($sp) -/* 0DC800 7F0A7CD0 AFA80018 */ sw $t0, 0x18($sp) -/* 0DC804 7F0A7CD4 02402025 */ move $a0, $s2 -/* 0DC808 7F0A7CD8 27A50064 */ addiu $a1, $sp, 0x64 -/* 0DC80C 7F0A7CDC 27A60060 */ addiu $a2, $sp, 0x60 -/* 0DC810 7F0A7CE0 8FA7006C */ lw $a3, 0x6c($sp) -/* 0DC814 7F0A7CE4 AFB10010 */ sw $s1, 0x10($sp) -/* 0DC818 7F0A7CE8 AFB00014 */ sw $s0, 0x14($sp) -/* 0DC81C 7F0A7CEC AFA00024 */ sw $zero, 0x24($sp) -/* 0DC820 7F0A7CF0 AFA00028 */ sw $zero, 0x28($sp) -/* 0DC824 7F0A7CF4 AFA9001C */ sw $t1, 0x1c($sp) -/* 0DC828 7F0A7CF8 0FC2B6AF */ jal en_text_write_stuff -/* 0DC82C 7F0A7CFC AFAA0020 */ sw $t2, 0x20($sp) -/* 0DC830 7F0A7D00 3C0B8005 */ lui $t3, %hi(j_text_trigger) -/* 0DC834 7F0A7D04 8D6B84D0 */ lw $t3, %lo(j_text_trigger)($t3) -/* 0DC838 7F0A7D08 00409025 */ move $s2, $v0 -/* 0DC83C 7F0A7D0C 8FAC0064 */ lw $t4, 0x64($sp) -/* 0DC840 7F0A7D10 11600003 */ beqz $t3, .L7F0A7D20 -/* 0DC844 7F0A7D14 8FAD0058 */ lw $t5, 0x58($sp) -/* 0DC848 7F0A7D18 10000002 */ b .L7F0A7D24 -/* 0DC84C 7F0A7D1C 24020022 */ li $v0, 34 -.L7F0A7D20: -/* 0DC850 7F0A7D20 00001025 */ move $v0, $zero -.L7F0A7D24: -/* 0DC854 7F0A7D24 8FB90060 */ lw $t9, 0x60($sp) -/* 0DC858 7F0A7D28 8FA8005C */ lw $t0, 0x5c($sp) -/* 0DC85C 7F0A7D2C 018D7021 */ addu $t6, $t4, $t5 -/* 0DC860 7F0A7D30 01C27821 */ addu $t7, $t6, $v0 -/* 0DC864 7F0A7D34 25F80004 */ addiu $t8, $t7, 4 -/* 0DC868 7F0A7D38 03284823 */ subu $t1, $t9, $t0 -/* 0DC86C 7F0A7D3C AFB80064 */ sw $t8, 0x64($sp) -/* 0DC870 7F0A7D40 AFA90060 */ sw $t1, 0x60($sp) -/* 0DC874 7F0A7D44 27A4005C */ addiu $a0, $sp, 0x5c -/* 0DC878 7F0A7D48 27A50058 */ addiu $a1, $sp, 0x58 -/* 0DC87C 7F0A7D4C 8FA60068 */ lw $a2, 0x68($sp) -/* 0DC880 7F0A7D50 02203825 */ move $a3, $s1 -/* 0DC884 7F0A7D54 AFB00010 */ sw $s0, 0x10($sp) -/* 0DC888 7F0A7D58 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0DC88C 7F0A7D5C AFA00014 */ sw $zero, 0x14($sp) -/* 0DC890 7F0A7D60 8FAA004C */ lw $t2, 0x4c($sp) -/* 0DC894 7F0A7D64 8FAB0058 */ lw $t3, 0x58($sp) -/* 0DC898 7F0A7D68 8FAC005C */ lw $t4, 0x5c($sp) -/* 0DC89C 7F0A7D6C 02402025 */ move $a0, $s2 -/* 0DC8A0 7F0A7D70 27A50064 */ addiu $a1, $sp, 0x64 -/* 0DC8A4 7F0A7D74 27A60060 */ addiu $a2, $sp, 0x60 -/* 0DC8A8 7F0A7D78 8FA70068 */ lw $a3, 0x68($sp) -/* 0DC8AC 7F0A7D7C AFB10010 */ sw $s1, 0x10($sp) -/* 0DC8B0 7F0A7D80 AFB00014 */ sw $s0, 0x14($sp) -/* 0DC8B4 7F0A7D84 AFA00024 */ sw $zero, 0x24($sp) -/* 0DC8B8 7F0A7D88 AFA00028 */ sw $zero, 0x28($sp) -/* 0DC8BC 7F0A7D8C AFAA0018 */ sw $t2, 0x18($sp) -/* 0DC8C0 7F0A7D90 AFAB001C */ sw $t3, 0x1c($sp) -/* 0DC8C4 7F0A7D94 0FC2B6AF */ jal en_text_write_stuff -/* 0DC8C8 7F0A7D98 AFAC0020 */ sw $t4, 0x20($sp) -/* 0DC8CC 7F0A7D9C 0FC29DF2 */ jal sub_GAME_7F0A77C8 -/* 0DC8D0 7F0A7DA0 00402025 */ move $a0, $v0 -/* 0DC8D4 7F0A7DA4 8FBF0044 */ lw $ra, 0x44($sp) -/* 0DC8D8 7F0A7DA8 8FB00038 */ lw $s0, 0x38($sp) -/* 0DC8DC 7F0A7DAC 8FB1003C */ lw $s1, 0x3c($sp) -/* 0DC8E0 7F0A7DB0 8FB20040 */ lw $s2, 0x40($sp) -/* 0DC8E4 7F0A7DB4 03E00008 */ jr $ra -/* 0DC8E8 7F0A7DB8 27BD0070 */ addiu $sp, $sp, 0x70 -) -#endif - - - - - -u32 sub_GAME_7F0A7DBC(u32 uParm1) { - return uParm1; + return arg0; } +u32 empty_draw_function(u32 param) { + return param; +} - - - -#ifdef NONMATCHING -void sub_GAME_7F0A7DC4(s32 arg0) +s32 draw_text_q_watch_v201_beta(s32 arg0) { s32 txtptr; s32 sp50; - ?32 sp4C; + s32 sp4C; s32 sp48; s32 sp44; s32 pFirstFontTable; s32 pSecondFontTable; s32 joffset; - txtptr = get_textptr_for_textID(0xac2b); - if (j_text_trigger != 0) + txtptr = get_textptr_for_textID(0xAC2B); + + if (j_text_trigger) { joffset = -5; } @@ -4551,88 +3905,19 @@ void sub_GAME_7F0A7DC4(s32 arg0) { joffset = 0; } - sp50 = (s32) (joffset + 0x65); + sp50 = joffset + 0x65; sp4C = 0x31; sp48 = 0; sp44 = 0; - pFirstFontTable = (s32) ptrFirstFontTableSmall; - pSecondFontTable = (s32) ptrSecondFontTableSmall; + pFirstFontTable = ptrFirstFontTableSmall; + pSecondFontTable = ptrSecondFontTableSmall; arg0 = microcode_constructor(arg0); sub_GAME_7F0AE98C(&sp48, &sp44, txtptr, pSecondFontTable, pFirstFontTable, 0); - en_text_write_stuff(arg0, &sp50, &sp4C, txtptr, pSecondFontTable, pFirstFontTable, 0xff00b0, sp44, sp48, 0, 0); + return en_text_write_stuff(arg0, &sp50, &sp4C, txtptr, pSecondFontTable, pFirstFontTable, 0xFF00B0, sp44, sp48, 0, 0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A7DC4 -/* 0DC8F4 7F0A7DC4 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 0DC8F8 7F0A7DC8 AFBF0034 */ sw $ra, 0x34($sp) -/* 0DC8FC 7F0A7DCC AFA40058 */ sw $a0, 0x58($sp) -/* 0DC900 7F0A7DD0 0FC30776 */ jal get_textptr_for_textID -/* 0DC904 7F0A7DD4 3404AC2B */ li $a0, 44075 -/* 0DC908 7F0A7DD8 3C0E8005 */ lui $t6, %hi(j_text_trigger) -/* 0DC90C 7F0A7DDC 8DCE84D0 */ lw $t6, %lo(j_text_trigger)($t6) -/* 0DC910 7F0A7DE0 AFA20054 */ sw $v0, 0x54($sp) -/* 0DC914 7F0A7DE4 24180031 */ li $t8, 49 -/* 0DC918 7F0A7DE8 11C00003 */ beqz $t6, .L7F0A7DF8 -/* 0DC91C 7F0A7DEC 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 0DC920 7F0A7DF0 10000002 */ b .L7F0A7DFC -/* 0DC924 7F0A7DF4 2402FFFB */ li $v0, -5 -.L7F0A7DF8: -/* 0DC928 7F0A7DF8 00001025 */ move $v0, $zero -.L7F0A7DFC: -/* 0DC92C 7F0A7DFC 3C088004 */ lui $t0, %hi(ptrSecondFontTableSmall) -/* 0DC930 7F0A7E00 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0DC934 7F0A7E04 8D080EB0 */ lw $t0, %lo(ptrSecondFontTableSmall)($t0) -/* 0DC938 7F0A7E08 244F0065 */ addiu $t7, $v0, 0x65 -/* 0DC93C 7F0A7E0C AFAF0050 */ sw $t7, 0x50($sp) -/* 0DC940 7F0A7E10 AFB8004C */ sw $t8, 0x4c($sp) -/* 0DC944 7F0A7E14 AFA00048 */ sw $zero, 0x48($sp) -/* 0DC948 7F0A7E18 AFA00044 */ sw $zero, 0x44($sp) -/* 0DC94C 7F0A7E1C 8FA40058 */ lw $a0, 0x58($sp) -/* 0DC950 7F0A7E20 AFB90040 */ sw $t9, 0x40($sp) -/* 0DC954 7F0A7E24 0FC2B366 */ jal microcode_constructor -/* 0DC958 7F0A7E28 AFA8003C */ sw $t0, 0x3c($sp) -/* 0DC95C 7F0A7E2C 8FA90040 */ lw $t1, 0x40($sp) -/* 0DC960 7F0A7E30 AFA20058 */ sw $v0, 0x58($sp) -/* 0DC964 7F0A7E34 27A40048 */ addiu $a0, $sp, 0x48 -/* 0DC968 7F0A7E38 27A50044 */ addiu $a1, $sp, 0x44 -/* 0DC96C 7F0A7E3C 8FA60054 */ lw $a2, 0x54($sp) -/* 0DC970 7F0A7E40 8FA7003C */ lw $a3, 0x3c($sp) -/* 0DC974 7F0A7E44 AFA00014 */ sw $zero, 0x14($sp) -/* 0DC978 7F0A7E48 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0DC97C 7F0A7E4C AFA90010 */ sw $t1, 0x10($sp) -/* 0DC980 7F0A7E50 8FAA003C */ lw $t2, 0x3c($sp) -/* 0DC984 7F0A7E54 8FAB0040 */ lw $t3, 0x40($sp) -/* 0DC988 7F0A7E58 8FAD0044 */ lw $t5, 0x44($sp) -/* 0DC98C 7F0A7E5C 8FAE0048 */ lw $t6, 0x48($sp) -/* 0DC990 7F0A7E60 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff -/* 0DC994 7F0A7E64 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 -/* 0DC998 7F0A7E68 AFAC0018 */ sw $t4, 0x18($sp) -/* 0DC99C 7F0A7E6C 8FA40058 */ lw $a0, 0x58($sp) -/* 0DC9A0 7F0A7E70 27A50050 */ addiu $a1, $sp, 0x50 -/* 0DC9A4 7F0A7E74 27A6004C */ addiu $a2, $sp, 0x4c -/* 0DC9A8 7F0A7E78 8FA70054 */ lw $a3, 0x54($sp) -/* 0DC9AC 7F0A7E7C AFA00024 */ sw $zero, 0x24($sp) -/* 0DC9B0 7F0A7E80 AFA00028 */ sw $zero, 0x28($sp) -/* 0DC9B4 7F0A7E84 AFAA0010 */ sw $t2, 0x10($sp) -/* 0DC9B8 7F0A7E88 AFAB0014 */ sw $t3, 0x14($sp) -/* 0DC9BC 7F0A7E8C AFAD001C */ sw $t5, 0x1c($sp) -/* 0DC9C0 7F0A7E90 0FC2B6AF */ jal en_text_write_stuff -/* 0DC9C4 7F0A7E94 AFAE0020 */ sw $t6, 0x20($sp) -/* 0DC9C8 7F0A7E98 8FBF0034 */ lw $ra, 0x34($sp) -/* 0DC9CC 7F0A7E9C 27BD0058 */ addiu $sp, $sp, 0x58 -/* 0DC9D0 7F0A7EA0 03E00008 */ jr $ra -/* 0DC9D4 7F0A7EA4 00000000 */ nop -) -#endif - - - - #ifdef NONMATCHING -void debug_gun_watch_move_related(void) { +void draw_current_hand_item_and_ammo(void) { } #else @@ -4659,7 +3944,7 @@ glabel D_8005852C glabel D_80058530 .word 0x40c90fdb /*6.2831855*/ .text -glabel debug_gun_watch_move_related +glabel draw_current_hand_item_and_ammo /* 0DC9D8 7F0A7EA8 27BDFEE8 */ addiu $sp, $sp, -0x118 /* 0DC9DC 7F0A7EAC AFBF003C */ sw $ra, 0x3c($sp) /* 0DC9E0 7F0A7EB0 AFB00038 */ sw $s0, 0x38($sp) @@ -4848,7 +4133,7 @@ glabel debug_gun_watch_move_related /* 0DCCA0 7F0A8170 E7A0001C */ swc1 $f0, 0x1c($sp) /* 0DCCA4 7F0A8174 E7A00024 */ swc1 $f0, 0x24($sp) /* 0DCCA8 7F0A8178 E7AC0014 */ swc1 $f12, 0x14($sp) -/* 0DCCAC 7F0A817C 0FC165A5 */ jal sub_GAME_7F059694 +/* 0DCCAC 7F0A817C 0FC165A5 */ jal matrix_4x4_7F059694 /* 0DCCB0 7F0A8180 E7B20020 */ swc1 $f18, 0x20($sp) /* 0DCCB4 7F0A8184 27A40090 */ addiu $a0, $sp, 0x90 /* 0DCCB8 7F0A8188 0FC1601A */ jal matrix_4x4_multiply_in_place @@ -4954,142 +4239,44 @@ glabel debug_gun_watch_move_related #endif - - - -#ifdef NONMATCHING -s32 sub_GAME_7F0A830C(void) +s32 draw_watch_mission_status_page(s32 param_1, s32 param_2) { - s32 temp_s0; - s32 phi_s0; - - temp_s0 = sub_GAME_7F0A714C(0); + param_1 = draw_background_health_and_armor(param_1, param_2, 0); + if (check_watch_page_transistion_running() != 1) { - phi_s0 = debug_gun_watch_move_related(sub_GAME_7F0A7DBC(sub_GAME_7F0A7C18(sub_GAME_7F0A7DC4(temp_s0)))); + param_1 = draw_text_q_watch_v201_beta(param_1); + param_1 = draw_text_mission_status(param_1); + param_1 = draw_current_hand_item_and_ammo(empty_draw_function(param_1)); } else { check_watch_page_transistion_running(); - phi_s0 = temp_s0; } - return phi_s0; + + return param_1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A830C -/* 0DCE3C 7F0A830C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0DCE40 7F0A8310 AFBF001C */ sw $ra, 0x1c($sp) -/* 0DCE44 7F0A8314 AFB00018 */ sw $s0, 0x18($sp) -/* 0DCE48 7F0A8318 0FC29C53 */ jal sub_GAME_7F0A714C -/* 0DCE4C 7F0A831C 00003025 */ move $a2, $zero -/* 0DCE50 7F0A8320 0FC1F97F */ jal check_watch_page_transistion_running -/* 0DCE54 7F0A8324 00408025 */ move $s0, $v0 -/* 0DCE58 7F0A8328 24010001 */ li $at, 1 -/* 0DCE5C 7F0A832C 1041000B */ beq $v0, $at, .L7F0A835C -/* 0DCE60 7F0A8330 00000000 */ nop -/* 0DCE64 7F0A8334 0FC29F71 */ jal sub_GAME_7F0A7DC4 -/* 0DCE68 7F0A8338 02002025 */ move $a0, $s0 -/* 0DCE6C 7F0A833C 0FC29F06 */ jal sub_GAME_7F0A7C18 -/* 0DCE70 7F0A8340 00402025 */ move $a0, $v0 -/* 0DCE74 7F0A8344 0FC29F6F */ jal sub_GAME_7F0A7DBC -/* 0DCE78 7F0A8348 00402025 */ move $a0, $v0 -/* 0DCE7C 7F0A834C 0FC29FAA */ jal debug_gun_watch_move_related -/* 0DCE80 7F0A8350 00402025 */ move $a0, $v0 -/* 0DCE84 7F0A8354 10000003 */ b .L7F0A8364 -/* 0DCE88 7F0A8358 00408025 */ move $s0, $v0 -.L7F0A835C: -/* 0DCE8C 7F0A835C 0FC1F97F */ jal check_watch_page_transistion_running -/* 0DCE90 7F0A8360 00000000 */ nop -.L7F0A8364: -/* 0DCE94 7F0A8364 8FBF001C */ lw $ra, 0x1c($sp) -/* 0DCE98 7F0A8368 02001025 */ move $v0, $s0 -/* 0DCE9C 7F0A836C 8FB00018 */ lw $s0, 0x18($sp) -/* 0DCEA0 7F0A8370 03E00008 */ jr $ra -/* 0DCEA4 7F0A8374 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif - - -#ifdef NONMATCHING void sub_GAME_7F0A8378(void) { - s32 sp1C; - - if ((get_controller_buttons_pressed(0, 0xa000) == 0) && (get_controller_buttons_pressed(0, 0x1000) != 0)) - { - sp1C = get_item_in_hand(0); - if (get_weaponnum_by_inv_index(D_800409B8) != sp1C) + if (get_controller_buttons_pressed('\0', 0xa000) == 0) { + if (get_controller_buttons_pressed('\0', START_BUTTON) == 0) { - remove_hands_item(0, get_weaponnum_by_inv_index(D_800409B8)); - remove_hands_item(1, 0); - set_BONDdata_equipcuritem(D_800409B8); - D_800409C4 = 0xa; - play_sfx_a1(ptr_sfx_buf, 0x9f, 0); + return; + } + + if (get_item_in_hand(0) == get_weaponnum_by_inv_index(D_800409B8)) + { + return; } } - else - { - } + remove_hands_item(0, get_weaponnum_by_inv_index(D_800409B8)); + remove_hands_item(1, 0); + set_BONDdata_equipcuritem(D_800409B8); + D_800409C4 = 10; + play_sfx_a1(ptr_sfx_buf, 0x9F, 0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A8378 -/* 0DCEA8 7F0A8378 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0DCEAC 7F0A837C AFBF0014 */ sw $ra, 0x14($sp) -/* 0DCEB0 7F0A8380 00002025 */ move $a0, $zero -/* 0DCEB4 7F0A8384 0C0030EB */ jal get_controller_buttons_pressed -/* 0DCEB8 7F0A8388 3405A000 */ li $a1, 40960 -/* 0DCEBC 7F0A838C 1440000D */ bnez $v0, .L7F0A83C4 -/* 0DCEC0 7F0A8390 00002025 */ move $a0, $zero -/* 0DCEC4 7F0A8394 0C0030EB */ jal get_controller_buttons_pressed -/* 0DCEC8 7F0A8398 24051000 */ li $a1, 4096 -/* 0DCECC 7F0A839C 5040001E */ beql $v0, $zero, .L7F0A8418 -/* 0DCED0 7F0A83A0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0DCED4 7F0A83A4 0FC17674 */ jal get_item_in_hand -/* 0DCED8 7F0A83A8 00002025 */ move $a0, $zero -/* 0DCEDC 7F0A83AC 3C048004 */ lui $a0, %hi(D_800409B8) -/* 0DCEE0 7F0A83B0 8C8409B8 */ lw $a0, %lo(D_800409B8)($a0) -/* 0DCEE4 7F0A83B4 0FC234AA */ jal get_weaponnum_by_inv_index -/* 0DCEE8 7F0A83B8 AFA2001C */ sw $v0, 0x1c($sp) -/* 0DCEEC 7F0A83BC 8FAE001C */ lw $t6, 0x1c($sp) -/* 0DCEF0 7F0A83C0 104E0014 */ beq $v0, $t6, .L7F0A8414 -.L7F0A83C4: -/* 0DCEF4 7F0A83C4 3C048004 */ lui $a0, %hi(D_800409B8) -/* 0DCEF8 7F0A83C8 0FC234AA */ jal get_weaponnum_by_inv_index -/* 0DCEFC 7F0A83CC 8C8409B8 */ lw $a0, %lo(D_800409B8)($a0) -/* 0DCF00 7F0A83D0 00002025 */ move $a0, $zero -/* 0DCF04 7F0A83D4 0FC176D5 */ jal remove_hands_item -/* 0DCF08 7F0A83D8 00402825 */ move $a1, $v0 -/* 0DCF0C 7F0A83DC 24040001 */ li $a0, 1 -/* 0DCF10 7F0A83E0 0FC176D5 */ jal remove_hands_item -/* 0DCF14 7F0A83E4 00002825 */ move $a1, $zero -/* 0DCF18 7F0A83E8 3C048004 */ lui $a0, %hi(D_800409B8) -/* 0DCF1C 7F0A83EC 0FC23634 */ jal set_BONDdata_equipcuritem -/* 0DCF20 7F0A83F0 8C8409B8 */ lw $a0, %lo(D_800409B8)($a0) -/* 0DCF24 7F0A83F4 240F000A */ li $t7, 10 -/* 0DCF28 7F0A83F8 3C018004 */ lui $at, %hi(D_800409C4) -/* 0DCF2C 7F0A83FC 3C048006 */ lui $a0, %hi(ptr_sfx_buf) -/* 0DCF30 7F0A8400 AC2F09C4 */ sw $t7, %lo(D_800409C4)($at) -/* 0DCF34 7F0A8404 8C843720 */ lw $a0, %lo(ptr_sfx_buf)($a0) -/* 0DCF38 7F0A8408 2405009F */ li $a1, 159 -/* 0DCF3C 7F0A840C 0C002382 */ jal play_sfx_a1 -/* 0DCF40 7F0A8410 00003025 */ move $a2, $zero -.L7F0A8414: -/* 0DCF44 7F0A8414 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0A8418: -/* 0DCF48 7F0A8418 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0DCF4C 7F0A841C 03E00008 */ jr $ra -/* 0DCF50 7F0A8420 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -5104,7 +4291,7 @@ glabel debug_gun_watch_move_related2 /* 0DCF54 7F0A8424 27BDF6D8 */ addiu $sp, $sp, -0x928 /* 0DCF58 7F0A8428 AFBF003C */ sw $ra, 0x3c($sp) /* 0DCF5C 7F0A842C AFB00038 */ sw $s0, 0x38($sp) -/* 0DCF60 7F0A8430 0FC29C53 */ jal sub_GAME_7F0A714C +/* 0DCF60 7F0A8430 0FC29C53 */ jal draw_background_health_and_armor /* 0DCF64 7F0A8434 00003025 */ move $a2, $zero /* 0DCF68 7F0A8438 0FC1F97F */ jal check_watch_page_transistion_running /* 0DCF6C 7F0A843C AFA20928 */ sw $v0, 0x928($sp) @@ -5288,7 +4475,7 @@ glabel debug_gun_watch_move_related2 /* 0DD218 7F0A86E8 44075000 */ mfc1 $a3, $f10 /* 0DD21C 7F0A86EC E7A20024 */ swc1 $f2, 0x24($sp) /* 0DD220 7F0A86F0 E7AC0014 */ swc1 $f12, 0x14($sp) -/* 0DD224 7F0A86F4 0FC165A5 */ jal sub_GAME_7F059694 +/* 0DD224 7F0A86F4 0FC165A5 */ jal matrix_4x4_7F059694 /* 0DD228 7F0A86F8 E7B00020 */ swc1 $f16, 0x20($sp) /* 0DD22C 7F0A86FC 02002025 */ move $a0, $s0 /* 0DD230 7F0A8700 0FC1601A */ jal matrix_4x4_multiply_in_place @@ -5587,7 +4774,7 @@ glabel debug_gun_watch_move_related2 /* 0DDB2C 7F0A8FBC 27BDF6D0 */ addiu $sp, $sp, -0x930 /* 0DDB30 7F0A8FC0 AFBF003C */ sw $ra, 0x3c($sp) /* 0DDB34 7F0A8FC4 AFB00038 */ sw $s0, 0x38($sp) -/* 0DDB38 7F0A8FC8 0FC29F39 */ jal sub_GAME_7F0A714C +/* 0DDB38 7F0A8FC8 0FC29F39 */ jal draw_background_health_and_armor /* 0DDB3C 7F0A8FCC 00003025 */ move $a2, $zero /* 0DDB40 7F0A8FD0 0FC1FB08 */ jal check_watch_page_transistion_running /* 0DDB44 7F0A8FD4 AFA20930 */ sw $v0, 0x930($sp) @@ -5771,7 +4958,7 @@ glabel debug_gun_watch_move_related2 /* 0DDDF0 7F0A9280 44075000 */ mfc1 $a3, $f10 /* 0DDDF4 7F0A9284 E7A20024 */ swc1 $f2, 0x24($sp) /* 0DDDF8 7F0A9288 E7AC0014 */ swc1 $f12, 0x14($sp) -/* 0DDDFC 7F0A928C 0FC166ED */ jal sub_GAME_7F059694 +/* 0DDDFC 7F0A928C 0FC166ED */ jal matrix_4x4_7F059694 /* 0DDE00 7F0A9290 E7B00020 */ swc1 $f16, 0x20($sp) /* 0DDE04 7F0A9294 02002025 */ move $a0, $s0 /* 0DDE08 7F0A9298 0FC16162 */ jal matrix_4x4_multiply_in_place @@ -6106,7 +5293,7 @@ glabel sub_GAME_7F0A8B10 /* 0DD680 7F0A8B50 AFA20048 */ sw $v0, 0x48($sp) /* 0DD684 7F0A8B54 02002025 */ move $a0, $s0 /* 0DD688 7F0A8B58 8FA5007C */ lw $a1, 0x7c($sp) -/* 0DD68C 7F0A8B5C 0FC29C53 */ jal sub_GAME_7F0A714C +/* 0DD68C 7F0A8B5C 0FC29C53 */ jal draw_background_health_and_armor /* 0DD690 7F0A8B60 00003025 */ move $a2, $zero /* 0DD694 7F0A8B64 0FC1F97F */ jal check_watch_page_transistion_running /* 0DD698 7F0A8B68 00408025 */ move $s0, $v0 @@ -6480,10 +5667,10 @@ glabel sub_GAME_7F0A8FEC /* 0DDB3C 7F0A900C 3C0E8004 */ lui $t6, %hi(watch_soundrelated_maybe) /* 0DDB40 7F0A9010 8DCE09A8 */ lw $t6, %lo(watch_soundrelated_maybe)($t6) /* 0DDB44 7F0A9014 A7A20046 */ sh $v0, 0x46($sp) -/* 0DDB48 7F0A9018 3C0F8004 */ lui $t7, %hi(D_8004099C) +/* 0DDB48 7F0A9018 3C0F8004 */ lui $t7, %hi(game_options_index) /* 0DDB4C 7F0A901C 51C00008 */ beql $t6, $zero, .L7F0A9040 /* 0DDB50 7F0A9020 97B80046 */ lhu $t8, 0x46($sp) -/* 0DDB54 7F0A9024 8DEF099C */ lw $t7, %lo(D_8004099C)($t7) +/* 0DDB54 7F0A9024 8DEF099C */ lw $t7, %lo(game_options_index)($t7) /* 0DDB58 7F0A9028 24010001 */ li $at, 1 /* 0DDB5C 7F0A902C 55E10004 */ bnel $t7, $at, .L7F0A9040 /* 0DDB60 7F0A9030 97B80046 */ lhu $t8, 0x46($sp) @@ -6576,22 +5763,16 @@ glabel sub_GAME_7F0A8FEC #endif - - - void call_sfx_c_700091C8(void) { sfx_c_700091C8(); } - - - - #ifdef NONMATCHING +//TODO: Use t6 instead of a1 void sub_GAME_7F0A91A0(u16 arg0) { - sfx_c_700091E8(0xffff & arg0); + sfx_c_700091E8(arg0); } #else GLOBAL_ASM( @@ -6631,15 +5812,15 @@ glabel sub_GAME_7F0A91C8 /* 0DDD04 7F0A91D4 AFBF002C */ sw $ra, 0x2c($sp) /* 0DDD08 7F0A91D8 0FC2F5B1 */ jal sub_GAME_7F0BD6C4 /* 0DDD0C 7F0A91DC 2404000C */ li $a0, 12 -/* 0DDD10 7F0A91E0 0FC2A4D6 */ jal sub_GAME_7F0A9358 +/* 0DDD10 7F0A91E0 0FC2A4D6 */ jal get_mTrack2Vol /* 0DDD14 7F0A91E4 AFA2003C */ sw $v0, 0x3c($sp) /* 0DDD18 7F0A91E8 3C0E8004 */ lui $t6, %hi(watch_soundrelated_maybe) /* 0DDD1C 7F0A91EC 8DCE09A8 */ lw $t6, %lo(watch_soundrelated_maybe)($t6) /* 0DDD20 7F0A91F0 A7A20046 */ sh $v0, 0x46($sp) -/* 0DDD24 7F0A91F4 3C0F8004 */ lui $t7, %hi(D_8004099C) +/* 0DDD24 7F0A91F4 3C0F8004 */ lui $t7, %hi(game_options_index) /* 0DDD28 7F0A91F8 51C00007 */ beql $t6, $zero, .L7F0A9218 /* 0DDD2C 7F0A91FC 97B80046 */ lhu $t8, 0x46($sp) -/* 0DDD30 7F0A9200 8DEF099C */ lw $t7, %lo(D_8004099C)($t7) +/* 0DDD30 7F0A9200 8DEF099C */ lw $t7, %lo(game_options_index)($t7) /* 0DDD34 7F0A9204 55E00004 */ bnezl $t7, .L7F0A9218 /* 0DDD38 7F0A9208 97B80046 */ lhu $t8, 0x46($sp) /* 0DDD3C 7F0A920C 0FC2A3B4 */ jal sub_GAME_7F0A8ED0 @@ -6658,7 +5839,7 @@ glabel sub_GAME_7F0A91C8 /* 0DDD68 7F0A9238 C42A853C */ lwc1 $f10, %lo(D_8005853C)($at) /* 0DDD6C 7F0A923C 03002025 */ move $a0, $t8 /* 0DDD70 7F0A9240 460A3403 */ div.s $f16, $f6, $f10 -/* 0DDD74 7F0A9244 0FC2A4D9 */ jal sub_GAME_7F0A9364 +/* 0DDD74 7F0A9244 0FC2A4D9 */ jal set_mTrack2Vol /* 0DDD78 7F0A9248 E7B00040 */ swc1 $f16, 0x40($sp) /* 0DDD7C 7F0A924C 02001025 */ move $v0, $s0 /* 0DDD80 7F0A9250 3C19B900 */ lui $t9, (0xB900031D >> 16) # lui $t9, 0xb900 @@ -6731,43 +5912,16 @@ glabel sub_GAME_7F0A91C8 #endif -u16 sub_GAME_7F0A9358(void) +u16 get_mTrack2Vol(void) { return mTrack2Vol; } - - -#ifdef NONMATCHING -void sub_GAME_7F0A9364(s16 param_1) - +void set_mTrack2Vol(u16 param_1) { mTrack2Vol = param_1; - musicTrack2Vol(param_1); - return; + musicTrack2Vol(mTrack2Vol); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A9364 -/* 0DDE94 7F0A9364 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0DDE98 7F0A9368 3C028004 */ lui $v0, %hi(mTrack2Vol) -/* 0DDE9C 7F0A936C 24420B58 */ addiu $v0, %lo(mTrack2Vol) # addiu $v0, $v0, 0xb58 -/* 0DDEA0 7F0A9370 AFBF0014 */ sw $ra, 0x14($sp) -/* 0DDEA4 7F0A9374 AFA40018 */ sw $a0, 0x18($sp) -/* 0DDEA8 7F0A9378 00802825 */ move $a1, $a0 -/* 0DDEAC 7F0A937C A4450000 */ sh $a1, ($v0) -/* 0DDEB0 7F0A9380 0C001CF1 */ jal musicTrack2Vol -/* 0DDEB4 7F0A9384 30A4FFFF */ andi $a0, $a1, 0xffff -/* 0DDEB8 7F0A9388 8FBF0014 */ lw $ra, 0x14($sp) -/* 0DDEBC 7F0A938C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0DDEC0 7F0A9390 03E00008 */ jr $ra -/* 0DDEC4 7F0A9394 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -6930,101 +6084,31 @@ glabel sub_GAME_7F0A9398 - - -#ifdef NONMATCHING -f32 sub_GAME_7F0A95C4(f32 param_1,f32 param_2,f32 param_3) +f32 sub_GAME_7F0A95C4(f32 param_1, f32 param_2, f32 param_3) { if (param_1 < param_2) { - return param_1 + (param_2 - param_1) / param_3; + param_1 += (param_2 - param_1) / param_3; + } else if (param_2 < param_1) { + param_1 -= (param_1 - param_2) / param_3; } - if (param_2 < param_1) { - return param_1 - (param_1 - param_2) / param_3; + + return param_1; +} + + +s32 sub_GAME_7F0A9610(void) { + + if ((D_80040B24 < 0.1f) && + (D_80040B24 > -0.1f) && + (D_80040B20 < 0.1f) && + (D_80040B20 > -0.1f)) + { + + return 1; + } + return 0; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A95C4 -/* 0DE0F4 7F0A95C4 460E603C */ c.lt.s $f12, $f14 -/* 0DE0F8 7F0A95C8 AFA60008 */ sw $a2, 8($sp) -/* 0DE0FC 7F0A95CC 45020007 */ bc1fl .L7F0A95EC -/* 0DE100 7F0A95D0 460C703C */ c.lt.s $f14, $f12 -/* 0DE104 7F0A95D4 460C7101 */ sub.s $f4, $f14, $f12 -/* 0DE108 7F0A95D8 C7A60008 */ lwc1 $f6, 8($sp) -/* 0DE10C 7F0A95DC 46062203 */ div.s $f8, $f4, $f6 -/* 0DE110 7F0A95E0 03E00008 */ jr $ra -/* 0DE114 7F0A95E4 46086000 */ add.s $f0, $f12, $f8 - -/* 0DE118 7F0A95E8 460C703C */ c.lt.s $f14, $f12 -.L7F0A95EC: -/* 0DE11C 7F0A95EC 00000000 */ nop -/* 0DE120 7F0A95F0 45000005 */ bc1f .L7F0A9608 -/* 0DE124 7F0A95F4 00000000 */ nop -/* 0DE128 7F0A95F8 460E6281 */ sub.s $f10, $f12, $f14 -/* 0DE12C 7F0A95FC C7B00008 */ lwc1 $f16, 8($sp) -/* 0DE130 7F0A9600 46105483 */ div.s $f18, $f10, $f16 -/* 0DE134 7F0A9604 46126301 */ sub.s $f12, $f12, $f18 -.L7F0A9608: -/* 0DE138 7F0A9608 03E00008 */ jr $ra -/* 0DE13C 7F0A960C 46006006 */ mov.s $f0, $f12 -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F0A9610(void) { - -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80058540 -.word 0x3dcccccd /*0.1*/ -glabel D_80058544 -.word 0xbdcccccd /*-0.1*/ -.text -glabel sub_GAME_7F0A9610 -/* 0DE140 7F0A9610 3C018006 */ lui $at, %hi(D_80058540) -/* 0DE144 7F0A9614 C4228540 */ lwc1 $f2, %lo(D_80058540)($at) -/* 0DE148 7F0A9618 3C018004 */ lui $at, %hi(D_80040B24) -/* 0DE14C 7F0A961C C4200B24 */ lwc1 $f0, %lo(D_80040B24)($at) -/* 0DE150 7F0A9620 3C018006 */ lui $at, %hi(D_80058544) -/* 0DE154 7F0A9624 00001025 */ move $v0, $zero -/* 0DE158 7F0A9628 4602003C */ c.lt.s $f0, $f2 -/* 0DE15C 7F0A962C 00000000 */ nop -/* 0DE160 7F0A9630 45000012 */ bc1f .L7F0A967C -/* 0DE164 7F0A9634 00000000 */ nop -/* 0DE168 7F0A9638 C42C8544 */ lwc1 $f12, %lo(D_80058544)($at) -/* 0DE16C 7F0A963C 3C018004 */ lui $at, %hi(D_80040B20) -/* 0DE170 7F0A9640 4600603C */ c.lt.s $f12, $f0 -/* 0DE174 7F0A9644 00000000 */ nop -/* 0DE178 7F0A9648 4500000C */ bc1f .L7F0A967C -/* 0DE17C 7F0A964C 00000000 */ nop -/* 0DE180 7F0A9650 C4200B20 */ lwc1 $f0, %lo(D_80040B20)($at) -/* 0DE184 7F0A9654 4602003C */ c.lt.s $f0, $f2 -/* 0DE188 7F0A9658 00000000 */ nop -/* 0DE18C 7F0A965C 45000007 */ bc1f .L7F0A967C -/* 0DE190 7F0A9660 00000000 */ nop -/* 0DE194 7F0A9664 4600603C */ c.lt.s $f12, $f0 -/* 0DE198 7F0A9668 00000000 */ nop -/* 0DE19C 7F0A966C 45000003 */ bc1f .L7F0A967C -/* 0DE1A0 7F0A9670 00000000 */ nop -/* 0DE1A4 7F0A9674 03E00008 */ jr $ra -/* 0DE1A8 7F0A9678 24020001 */ li $v0, 1 - -.L7F0A967C: -/* 0DE1AC 7F0A967C 03E00008 */ jr $ra -/* 0DE1B0 7F0A9680 00000000 */ nop -) -#endif - - - - #ifdef NONMATCHING void sub_GAME_7F0A9684(void) { @@ -7059,10 +6143,10 @@ glabel sub_GAME_7F0A9684 .L7F0A96C8: /* 0DE1F8 7F0A96C8 3C0E8004 */ lui $t6, %hi(watch_soundrelated_maybe) /* 0DE1FC 7F0A96CC 8DCE09A8 */ lw $t6, %lo(watch_soundrelated_maybe)($t6) -/* 0DE200 7F0A96D0 3C0F8004 */ lui $t7, %hi(D_80040998) +/* 0DE200 7F0A96D0 3C0F8004 */ lui $t7, %hi(controller_options_index) /* 0DE204 7F0A96D4 51C00007 */ beql $t6, $zero, .L7F0A96F4 /* 0DE208 7F0A96D8 8CA20000 */ lw $v0, ($a1) -/* 0DE20C 7F0A96DC 8DEF0998 */ lw $t7, %lo(D_80040998)($t7) +/* 0DE20C 7F0A96DC 8DEF0998 */ lw $t7, %lo(controller_options_index)($t7) /* 0DE210 7F0A96E0 24010001 */ li $at, 1 /* 0DE214 7F0A96E4 00001025 */ move $v0, $zero /* 0DE218 7F0A96E8 51E10009 */ beql $t7, $at, .L7F0A9710 @@ -7096,10 +6180,10 @@ glabel sub_GAME_7F0A9684 /* 0DE27C 7F0A974C E5200000 */ swc1 $f0, ($t1) .L7F0A9750: /* 0DE280 7F0A9750 8D4A09A8 */ lw $t2, %lo(watch_soundrelated_maybe)($t2) -/* 0DE284 7F0A9754 3C0B8004 */ lui $t3, %hi(D_80040998) +/* 0DE284 7F0A9754 3C0B8004 */ lui $t3, %hi(controller_options_index) /* 0DE288 7F0A9758 5140001A */ beql $t2, $zero, .L7F0A97C4 /* 0DE28C 7F0A975C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0DE290 7F0A9760 8D6B0998 */ lw $t3, %lo(D_80040998)($t3) +/* 0DE290 7F0A9760 8D6B0998 */ lw $t3, %lo(controller_options_index)($t3) /* 0DE294 7F0A9764 24010001 */ li $at, 1 /* 0DE298 7F0A9768 55610016 */ bnel $t3, $at, .L7F0A97C4 /* 0DE29C 7F0A976C 8FBF0014 */ lw $ra, 0x14($sp) @@ -7180,10 +6264,10 @@ glabel sub_GAME_7F0A97D0 .L7F0A9850: /* 0DE380 7F0A9850 3C188004 */ lui $t8, %hi(watch_soundrelated_maybe) /* 0DE384 7F0A9854 8F1809A8 */ lw $t8, %lo(watch_soundrelated_maybe)($t8) -/* 0DE388 7F0A9858 3C198004 */ lui $t9, %hi(D_80040998) +/* 0DE388 7F0A9858 3C198004 */ lui $t9, %hi(controller_options_index) /* 0DE38C 7F0A985C 13000019 */ beqz $t8, .L7F0A98C4 /* 0DE390 7F0A9860 00000000 */ nop -/* 0DE394 7F0A9864 8F390998 */ lw $t9, %lo(D_80040998)($t9) +/* 0DE394 7F0A9864 8F390998 */ lw $t9, %lo(controller_options_index)($t9) /* 0DE398 7F0A9868 3C118005 */ lui $s1, %hi(j_text_trigger) /* 0DE39C 7F0A986C 263184D0 */ addiu $s1, %lo(j_text_trigger) # addiu $s1, $s1, -0x7b30 /* 0DE3A0 7F0A9870 17200014 */ bnez $t9, .L7F0A98C4 @@ -7361,8 +6445,8 @@ void sub_GAME_7F0A9AB8(void) { GLOBAL_ASM( .text glabel sub_GAME_7F0A9AB8 -/* 0DE5E8 7F0A9AB8 3C0E8004 */ lui $t6, %hi(cur_player_look_vertical_inverted) -/* 0DE5EC 7F0A9ABC 8DCE0A84 */ lw $t6, %lo(cur_player_look_vertical_inverted)($t6) +/* 0DE5E8 7F0A9AB8 3C0E8004 */ lui $t6, %hi(game_options_entries) +/* 0DE5EC 7F0A9ABC 8DCE0A84 */ lw $t6, %lo(game_options_entries + 0x8)($t6) /* 0DE5F0 7F0A9AC0 27BDFF50 */ addiu $sp, $sp, -0xb0 /* 0DE5F4 7F0A9AC4 AFB00038 */ sw $s0, 0x38($sp) /* 0DE5F8 7F0A9AC8 24010001 */ li $at, 1 @@ -7529,8 +6613,8 @@ glabel sub_GAME_7F0A9AB8 /* 0DE870 7F0A9D40 AFA00028 */ sw $zero, 0x28($sp) /* 0DE874 7F0A9D44 00408025 */ move $s0, $v0 .L7F0A9D48: -/* 0DE878 7F0A9D48 3C098004 */ lui $t1, %hi(D_80040998) -/* 0DE87C 7F0A9D4C 8D290998 */ lw $t1, %lo(D_80040998)($t1) +/* 0DE878 7F0A9D48 3C098004 */ lui $t1, %hi(controller_options_index) +/* 0DE87C 7F0A9D4C 8D290998 */ lw $t1, %lo(controller_options_index)($t1) /* 0DE880 7F0A9D50 2418006B */ li $t8, 107 /* 0DE884 7F0A9D54 24010001 */ li $at, 1 /* 0DE888 7F0A9D58 1521000A */ bne $t1, $at, .L7F0A9D84 @@ -7861,8 +6945,8 @@ glabel sub_GAME_7F0A9AB8 .L7F0AA234: /* 0DED64 7F0AA234 8FA9004C */ lw $t1, 0x4c($sp) .L7F0AA238: -/* 0DED68 7F0AA238 3C0B8004 */ lui $t3, %hi(D_80040998) -/* 0DED6C 7F0AA23C 8D6B0998 */ lw $t3, %lo(D_80040998)($t3) +/* 0DED68 7F0AA238 3C0B8004 */ lui $t3, %hi(controller_options_index) +/* 0DED6C 7F0AA23C 8D6B0998 */ lw $t3, %lo(controller_options_index)($t3) /* 0DED70 7F0AA240 24010001 */ li $at, 1 /* 0DED74 7F0AA244 252A0019 */ addiu $t2, $t1, 0x19 /* 0DED78 7F0AA248 1561000A */ bne $t3, $at, .L7F0AA274 @@ -8238,512 +7322,107 @@ glabel sub_GAME_7F0A9AB8 #endif - - - -#ifdef NONMATCHING -void sub_GAME_7F0AA7C8(u32 * displayList) +s32 display_text_buttons_dual_control(s32 param_1) { - u32 * DL; - u8 * txtptr; - - DL = microcode_constructor(displayList); - if (get_controller_buttons_held('\0',A_BUTTON) != 0) + s32 textptr_aux; + + param_1 = microcode_constructor(param_1); + + if (get_controller_buttons_held(0, A_BUTTON)) { - sub_GAME_7F0A9398(DL, 0x5a, 0xa7, get_textptr_for_textID(0xac03), -1, 1, 0x7000a0, 0, 0, 0x3000b0, 0); - } else { - sub_GAME_7F0A9398(DL, 0x5a, 0xa7, get_textptr_for_textID(0xac03), 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 0); + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0xA7, get_textptr_for_textID(0xAC03), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); } - - if (get_controller_buttons_held('\0',B_BUTTON) != 0) + else { - sub_GAME_7F0A9398(DL, 0x5a, 0x95, get_textptr_for_textID(0xac02), -1, 1, 0x7000a0, 0, 0, 0x3000b0, 0); - } else { - sub_GAME_7F0A9398(DL, 0x5a, 0x95, get_textptr_for_textID(0xac02), 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 0); + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0xA7, get_textptr_for_textID(0xAC03), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); + } + + if (get_controller_buttons_held(0, B_BUTTON)) + { + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0x95, get_textptr_for_textID(0xAC02), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); + } + else + { + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0x95, get_textptr_for_textID(0xAC02), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); } - - if ((pPlayer->cur_player_control_type_0 == 4) || (pPlayer->cur_player_control_type_0 == 5)) { - txtptr = get_textptr_for_textID(0xac00); - } else { - txtptr = get_textptr_for_textID(0xac01); + textptr_aux = get_textptr_for_textID(0xAC00); } - - if (get_controller_buttons_held('\0',Z_TRIG) != 0) + else { - sub_GAME_7F0A9398(DL, 0x5a, 0xb9, txtptr, -1, 1, 0x7000a0, 0, 0, 0x3000b0, 0); - } else { - sub_GAME_7F0A9398(DL, 0x5a, 0xb9, txtptr, 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 0); + textptr_aux = get_textptr_for_textID(0xAC01); } - - - + + if (get_controller_buttons_held(0, Z_TRIG)) + { + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0xB9, textptr_aux, -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); + } + else + { + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0xB9, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); + } + if ((pPlayer->cur_player_control_type_0 == 4) || (pPlayer->cur_player_control_type_0 == 6)) { - txtptr = get_textptr_for_textID(0xac05); - } else { - txtptr = get_textptr_for_textID(0xac06); + textptr_aux = get_textptr_for_textID(0xAC05); } - - sub_GAME_7F0A9398(DL, 0x5a, 0xcb, txtptr, 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 0); - if (get_controller_buttons_held('\x01',A_BUTTON) != 0) + else { - sub_GAME_7F0A9398(DL, 0xe6, 0xa7, get_textptr_for_textID(0xac03), -1, 1, 0x7000a0, 0, 0, 0x3000b0, 1); - } else { - sub_GAME_7F0A9398(DL, 0xe6, 0xa7, get_textptr_for_textID(0xac03), 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 1); + textptr_aux = get_textptr_for_textID(0xAC06); } - - if (get_controller_buttons_held('\x01',B_BUTTON) != 0) + + param_1 = sub_GAME_7F0A9398(param_1, 0x5A, 0xCB, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); + + if (get_controller_buttons_held(1, A_BUTTON)) { - sub_GAME_7F0A9398(DL, 0xe6, 0x95, get_textptr_for_textID(0xac02), -1, 1, 0x7000a0, 0, 0, 0x3000b0, 1); - } else { - sub_GAME_7F0A9398(DL, 0xe6, 0x95, get_textptr_for_textID(0xac02), 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 1); + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0xA7, get_textptr_for_textID(0xAC03), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); } - - - + else + { + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0xA7, get_textptr_for_textID(0xAC03), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); + } + + if (get_controller_buttons_held(1, B_BUTTON)) + { + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0x95, get_textptr_for_textID(0xAC02), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); + } + else + { + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0x95, get_textptr_for_textID(0xAC02), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); + } + if ((pPlayer->cur_player_control_type_0 == 4) || (pPlayer->cur_player_control_type_0 == 5)) { - txtptr = get_textptr_for_textID(0xac01); - } else { - txtptr = get_textptr_for_textID(0xac00); + textptr_aux = get_textptr_for_textID(0xAC01); } - - if (get_controller_buttons_held('\x01',Z_TRIG) != 0) + else { - sub_GAME_7F0A9398(DL, 0xe6, 0xb9, txtptr, -1, 1, 0x7000a0, 0, 0, 0x3000b0, 1); - } else { - sub_GAME_7F0A9398(DL, 0xe6, 0xb9, txtptr, 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 1); + textptr_aux = get_textptr_for_textID(0xAC00); + } + + if (get_controller_buttons_held(1, Z_TRIG)) + { + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0xB9, textptr_aux, -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); + } + else + { + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0xB9, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); } - - if ((pPlayer->cur_player_control_type_0 == 4) || (pPlayer->cur_player_control_type_0 == 6)) { - txtptr = get_textptr_for_textID(0xac06); - } else { - txtptr = get_textptr_for_textID(0xac05); + textptr_aux = get_textptr_for_textID(0xAC06); } - - sub_GAME_7F0A9398(DL, 0xe6, 0xcb, txtptr, 0xaa00b0, 0, -1, 0, 0, 0x3000b0, 1); + else + { + textptr_aux = get_textptr_for_textID(0xAC05); + } + + param_1 = sub_GAME_7F0A9398(param_1, 0xE6, 0xCB, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); + return param_1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0AA7C8 -/* 0DF2F8 7F0AA7C8 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0DF2FC 7F0AA7CC AFBF003C */ sw $ra, 0x3c($sp) -/* 0DF300 7F0AA7D0 0FC2B366 */ jal microcode_constructor -/* 0DF304 7F0AA7D4 AFB00038 */ sw $s0, 0x38($sp) -/* 0DF308 7F0AA7D8 00408025 */ move $s0, $v0 -/* 0DF30C 7F0AA7DC 00002025 */ move $a0, $zero -/* 0DF310 7F0AA7E0 0C0030C3 */ jal get_controller_buttons_held -/* 0DF314 7F0AA7E4 34058000 */ li $a1, 32768 -/* 0DF318 7F0AA7E8 10400017 */ beqz $v0, .L7F0AA848 -/* 0DF31C 7F0AA7EC 00000000 */ nop -/* 0DF320 7F0AA7F0 0FC30776 */ jal get_textptr_for_textID -/* 0DF324 7F0AA7F4 3404AC03 */ li $a0, 44035 -/* 0DF328 7F0AA7F8 3C180070 */ lui $t8, (0x007000A0 >> 16) # lui $t8, 0x70 -/* 0DF32C 7F0AA7FC 3C190030 */ lui $t9, (0x003000B0 >> 16) # lui $t9, 0x30 -/* 0DF330 7F0AA800 373900B0 */ ori $t9, (0x003000B0 & 0xFFFF) # ori $t9, $t9, 0xb0 -/* 0DF334 7F0AA804 371800A0 */ ori $t8, (0x007000A0 & 0xFFFF) # ori $t8, $t8, 0xa0 -/* 0DF338 7F0AA808 240EFFFF */ li $t6, -1 -/* 0DF33C 7F0AA80C 240F0001 */ li $t7, 1 -/* 0DF340 7F0AA810 AFAF0014 */ sw $t7, 0x14($sp) -/* 0DF344 7F0AA814 AFAE0010 */ sw $t6, 0x10($sp) -/* 0DF348 7F0AA818 AFB80018 */ sw $t8, 0x18($sp) -/* 0DF34C 7F0AA81C AFB90024 */ sw $t9, 0x24($sp) -/* 0DF350 7F0AA820 02002025 */ move $a0, $s0 -/* 0DF354 7F0AA824 2405005A */ li $a1, 90 -/* 0DF358 7F0AA828 240600A7 */ li $a2, 167 -/* 0DF35C 7F0AA82C 00403825 */ move $a3, $v0 -/* 0DF360 7F0AA830 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF364 7F0AA834 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF368 7F0AA838 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF36C 7F0AA83C AFA00028 */ sw $zero, 0x28($sp) -/* 0DF370 7F0AA840 10000015 */ b .L7F0AA898 -/* 0DF374 7F0AA844 00408025 */ move $s0, $v0 -.L7F0AA848: -/* 0DF378 7F0AA848 0FC30776 */ jal get_textptr_for_textID -/* 0DF37C 7F0AA84C 3404AC03 */ li $a0, 44035 -/* 0DF380 7F0AA850 3C0800AA */ lui $t0, (0x00AA00B0 >> 16) # lui $t0, 0xaa -/* 0DF384 7F0AA854 3C0A0030 */ lui $t2, (0x003000B0 >> 16) # lui $t2, 0x30 -/* 0DF388 7F0AA858 354A00B0 */ ori $t2, (0x003000B0 & 0xFFFF) # ori $t2, $t2, 0xb0 -/* 0DF38C 7F0AA85C 350800B0 */ ori $t0, (0x00AA00B0 & 0xFFFF) # ori $t0, $t0, 0xb0 -/* 0DF390 7F0AA860 2409FFFF */ li $t1, -1 -/* 0DF394 7F0AA864 AFA90018 */ sw $t1, 0x18($sp) -/* 0DF398 7F0AA868 AFA80010 */ sw $t0, 0x10($sp) -/* 0DF39C 7F0AA86C AFAA0024 */ sw $t2, 0x24($sp) -/* 0DF3A0 7F0AA870 02002025 */ move $a0, $s0 -/* 0DF3A4 7F0AA874 2405005A */ li $a1, 90 -/* 0DF3A8 7F0AA878 240600A7 */ li $a2, 167 -/* 0DF3AC 7F0AA87C 00403825 */ move $a3, $v0 -/* 0DF3B0 7F0AA880 AFA00014 */ sw $zero, 0x14($sp) -/* 0DF3B4 7F0AA884 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF3B8 7F0AA888 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF3BC 7F0AA88C 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF3C0 7F0AA890 AFA00028 */ sw $zero, 0x28($sp) -/* 0DF3C4 7F0AA894 00408025 */ move $s0, $v0 -.L7F0AA898: -/* 0DF3C8 7F0AA898 00002025 */ move $a0, $zero -/* 0DF3CC 7F0AA89C 0C0030C3 */ jal get_controller_buttons_held -/* 0DF3D0 7F0AA8A0 24054000 */ li $a1, 16384 -/* 0DF3D4 7F0AA8A4 10400017 */ beqz $v0, .L7F0AA904 -/* 0DF3D8 7F0AA8A8 00000000 */ nop -/* 0DF3DC 7F0AA8AC 0FC30776 */ jal get_textptr_for_textID -/* 0DF3E0 7F0AA8B0 3404AC02 */ li $a0, 44034 -/* 0DF3E4 7F0AA8B4 3C0D0070 */ lui $t5, (0x007000A0 >> 16) # lui $t5, 0x70 -/* 0DF3E8 7F0AA8B8 3C0E0030 */ lui $t6, (0x003000B0 >> 16) # lui $t6, 0x30 -/* 0DF3EC 7F0AA8BC 35CE00B0 */ ori $t6, (0x003000B0 & 0xFFFF) # ori $t6, $t6, 0xb0 -/* 0DF3F0 7F0AA8C0 35AD00A0 */ ori $t5, (0x007000A0 & 0xFFFF) # ori $t5, $t5, 0xa0 -/* 0DF3F4 7F0AA8C4 240BFFFF */ li $t3, -1 -/* 0DF3F8 7F0AA8C8 240C0001 */ li $t4, 1 -/* 0DF3FC 7F0AA8CC AFAC0014 */ sw $t4, 0x14($sp) -/* 0DF400 7F0AA8D0 AFAB0010 */ sw $t3, 0x10($sp) -/* 0DF404 7F0AA8D4 AFAD0018 */ sw $t5, 0x18($sp) -/* 0DF408 7F0AA8D8 AFAE0024 */ sw $t6, 0x24($sp) -/* 0DF40C 7F0AA8DC 02002025 */ move $a0, $s0 -/* 0DF410 7F0AA8E0 2405005A */ li $a1, 90 -/* 0DF414 7F0AA8E4 24060095 */ li $a2, 149 -/* 0DF418 7F0AA8E8 00403825 */ move $a3, $v0 -/* 0DF41C 7F0AA8EC AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF420 7F0AA8F0 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF424 7F0AA8F4 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF428 7F0AA8F8 AFA00028 */ sw $zero, 0x28($sp) -/* 0DF42C 7F0AA8FC 10000015 */ b .L7F0AA954 -/* 0DF430 7F0AA900 00408025 */ move $s0, $v0 -.L7F0AA904: -/* 0DF434 7F0AA904 0FC30776 */ jal get_textptr_for_textID -/* 0DF438 7F0AA908 3404AC02 */ li $a0, 44034 -/* 0DF43C 7F0AA90C 3C0F00AA */ lui $t7, (0x00AA00B0 >> 16) # lui $t7, 0xaa -/* 0DF440 7F0AA910 3C190030 */ lui $t9, (0x003000B0 >> 16) # lui $t9, 0x30 -/* 0DF444 7F0AA914 373900B0 */ ori $t9, (0x003000B0 & 0xFFFF) # ori $t9, $t9, 0xb0 -/* 0DF448 7F0AA918 35EF00B0 */ ori $t7, (0x00AA00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 -/* 0DF44C 7F0AA91C 2418FFFF */ li $t8, -1 -/* 0DF450 7F0AA920 AFB80018 */ sw $t8, 0x18($sp) -/* 0DF454 7F0AA924 AFAF0010 */ sw $t7, 0x10($sp) -/* 0DF458 7F0AA928 AFB90024 */ sw $t9, 0x24($sp) -/* 0DF45C 7F0AA92C 02002025 */ move $a0, $s0 -/* 0DF460 7F0AA930 2405005A */ li $a1, 90 -/* 0DF464 7F0AA934 24060095 */ li $a2, 149 -/* 0DF468 7F0AA938 00403825 */ move $a3, $v0 -/* 0DF46C 7F0AA93C AFA00014 */ sw $zero, 0x14($sp) -/* 0DF470 7F0AA940 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF474 7F0AA944 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF478 7F0AA948 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF47C 7F0AA94C AFA00028 */ sw $zero, 0x28($sp) -/* 0DF480 7F0AA950 00408025 */ move $s0, $v0 -.L7F0AA954: -/* 0DF484 7F0AA954 3C088008 */ lui $t0, %hi(pPlayer) -/* 0DF488 7F0AA958 8D08A0B0 */ lw $t0, %lo(pPlayer)($t0) -/* 0DF48C 7F0AA95C 24010004 */ li $at, 4 -/* 0DF490 7F0AA960 8D022A58 */ lw $v0, 0x2a58($t0) -/* 0DF494 7F0AA964 10410003 */ beq $v0, $at, .L7F0AA974 -/* 0DF498 7F0AA968 24010005 */ li $at, 5 -/* 0DF49C 7F0AA96C 14410005 */ bne $v0, $at, .L7F0AA984 -/* 0DF4A0 7F0AA970 00000000 */ nop -.L7F0AA974: -/* 0DF4A4 7F0AA974 0FC30776 */ jal get_textptr_for_textID -/* 0DF4A8 7F0AA978 3404AC00 */ li $a0, 44032 -/* 0DF4AC 7F0AA97C 10000004 */ b .L7F0AA990 -/* 0DF4B0 7F0AA980 00403825 */ move $a3, $v0 -.L7F0AA984: -/* 0DF4B4 7F0AA984 0FC30776 */ jal get_textptr_for_textID -/* 0DF4B8 7F0AA988 3404AC01 */ li $a0, 44033 -/* 0DF4BC 7F0AA98C 00403825 */ move $a3, $v0 -.L7F0AA990: -/* 0DF4C0 7F0AA990 00002025 */ move $a0, $zero -/* 0DF4C4 7F0AA994 24052000 */ li $a1, 8192 -/* 0DF4C8 7F0AA998 0C0030C3 */ jal get_controller_buttons_held -/* 0DF4CC 7F0AA99C AFA70044 */ sw $a3, 0x44($sp) -/* 0DF4D0 7F0AA9A0 10400014 */ beqz $v0, .L7F0AA9F4 -/* 0DF4D4 7F0AA9A4 8FA70044 */ lw $a3, 0x44($sp) -/* 0DF4D8 7F0AA9A8 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 -/* 0DF4DC 7F0AA9AC 3C0C0030 */ lui $t4, (0x003000B0 >> 16) # lui $t4, 0x30 -/* 0DF4E0 7F0AA9B0 358C00B0 */ ori $t4, (0x003000B0 & 0xFFFF) # ori $t4, $t4, 0xb0 -/* 0DF4E4 7F0AA9B4 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 -/* 0DF4E8 7F0AA9B8 2409FFFF */ li $t1, -1 -/* 0DF4EC 7F0AA9BC 240A0001 */ li $t2, 1 -/* 0DF4F0 7F0AA9C0 AFAA0014 */ sw $t2, 0x14($sp) -/* 0DF4F4 7F0AA9C4 AFA90010 */ sw $t1, 0x10($sp) -/* 0DF4F8 7F0AA9C8 AFAB0018 */ sw $t3, 0x18($sp) -/* 0DF4FC 7F0AA9CC AFAC0024 */ sw $t4, 0x24($sp) -/* 0DF500 7F0AA9D0 02002025 */ move $a0, $s0 -/* 0DF504 7F0AA9D4 2405005A */ li $a1, 90 -/* 0DF508 7F0AA9D8 240600B9 */ li $a2, 185 -/* 0DF50C 7F0AA9DC AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF510 7F0AA9E0 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF514 7F0AA9E4 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF518 7F0AA9E8 AFA00028 */ sw $zero, 0x28($sp) -/* 0DF51C 7F0AA9EC 10000012 */ b .L7F0AAA38 -/* 0DF520 7F0AA9F0 00408025 */ move $s0, $v0 -.L7F0AA9F4: -/* 0DF524 7F0AA9F4 3C0D00AA */ lui $t5, (0x00AA00B0 >> 16) # lui $t5, 0xaa -/* 0DF528 7F0AA9F8 3C0F0030 */ lui $t7, (0x003000B0 >> 16) # lui $t7, 0x30 -/* 0DF52C 7F0AA9FC 35EF00B0 */ ori $t7, (0x003000B0 & 0xFFFF) # ori $t7, $t7, 0xb0 -/* 0DF530 7F0AAA00 35AD00B0 */ ori $t5, (0x00AA00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 -/* 0DF534 7F0AAA04 240EFFFF */ li $t6, -1 -/* 0DF538 7F0AAA08 AFAE0018 */ sw $t6, 0x18($sp) -/* 0DF53C 7F0AAA0C AFAD0010 */ sw $t5, 0x10($sp) -/* 0DF540 7F0AAA10 AFAF0024 */ sw $t7, 0x24($sp) -/* 0DF544 7F0AAA14 02002025 */ move $a0, $s0 -/* 0DF548 7F0AAA18 2405005A */ li $a1, 90 -/* 0DF54C 7F0AAA1C 240600B9 */ li $a2, 185 -/* 0DF550 7F0AAA20 AFA00014 */ sw $zero, 0x14($sp) -/* 0DF554 7F0AAA24 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF558 7F0AAA28 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF55C 7F0AAA2C 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF560 7F0AAA30 AFA00028 */ sw $zero, 0x28($sp) -/* 0DF564 7F0AAA34 00408025 */ move $s0, $v0 -.L7F0AAA38: -/* 0DF568 7F0AAA38 3C188008 */ lui $t8, %hi(pPlayer) -/* 0DF56C 7F0AAA3C 8F18A0B0 */ lw $t8, %lo(pPlayer)($t8) -/* 0DF570 7F0AAA40 24010004 */ li $at, 4 -/* 0DF574 7F0AAA44 8F022A58 */ lw $v0, 0x2a58($t8) -/* 0DF578 7F0AAA48 10410003 */ beq $v0, $at, .L7F0AAA58 -/* 0DF57C 7F0AAA4C 24010006 */ li $at, 6 -/* 0DF580 7F0AAA50 14410005 */ bne $v0, $at, .L7F0AAA68 -/* 0DF584 7F0AAA54 00000000 */ nop -.L7F0AAA58: -/* 0DF588 7F0AAA58 0FC30776 */ jal get_textptr_for_textID -/* 0DF58C 7F0AAA5C 3404AC05 */ li $a0, 44037 -/* 0DF590 7F0AAA60 10000004 */ b .L7F0AAA74 -/* 0DF594 7F0AAA64 00403825 */ move $a3, $v0 -.L7F0AAA68: -/* 0DF598 7F0AAA68 0FC30776 */ jal get_textptr_for_textID -/* 0DF59C 7F0AAA6C 3404AC06 */ li $a0, 44038 -/* 0DF5A0 7F0AAA70 00403825 */ move $a3, $v0 -.L7F0AAA74: -/* 0DF5A4 7F0AAA74 3C1900AA */ lui $t9, (0x00AA00B0 >> 16) # lui $t9, 0xaa -/* 0DF5A8 7F0AAA78 3C090030 */ lui $t1, (0x003000B0 >> 16) # lui $t1, 0x30 -/* 0DF5AC 7F0AAA7C 352900B0 */ ori $t1, (0x003000B0 & 0xFFFF) # ori $t1, $t1, 0xb0 -/* 0DF5B0 7F0AAA80 373900B0 */ ori $t9, (0x00AA00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 -/* 0DF5B4 7F0AAA84 2408FFFF */ li $t0, -1 -/* 0DF5B8 7F0AAA88 AFA80018 */ sw $t0, 0x18($sp) -/* 0DF5BC 7F0AAA8C AFB90010 */ sw $t9, 0x10($sp) -/* 0DF5C0 7F0AAA90 AFA90024 */ sw $t1, 0x24($sp) -/* 0DF5C4 7F0AAA94 02002025 */ move $a0, $s0 -/* 0DF5C8 7F0AAA98 2405005A */ li $a1, 90 -/* 0DF5CC 7F0AAA9C 240600CB */ li $a2, 203 -/* 0DF5D0 7F0AAAA0 AFA00014 */ sw $zero, 0x14($sp) -/* 0DF5D4 7F0AAAA4 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF5D8 7F0AAAA8 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF5DC 7F0AAAAC 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF5E0 7F0AAAB0 AFA00028 */ sw $zero, 0x28($sp) -/* 0DF5E4 7F0AAAB4 00408025 */ move $s0, $v0 -/* 0DF5E8 7F0AAAB8 24040001 */ li $a0, 1 -/* 0DF5EC 7F0AAABC 0C0030C3 */ jal get_controller_buttons_held -/* 0DF5F0 7F0AAAC0 34058000 */ li $a1, 32768 -/* 0DF5F4 7F0AAAC4 10400018 */ beqz $v0, .L7F0AAB28 -/* 0DF5F8 7F0AAAC8 00000000 */ nop -/* 0DF5FC 7F0AAACC 0FC30776 */ jal get_textptr_for_textID -/* 0DF600 7F0AAAD0 3404AC03 */ li $a0, 44035 -/* 0DF604 7F0AAAD4 3C0C0070 */ lui $t4, (0x007000A0 >> 16) # lui $t4, 0x70 -/* 0DF608 7F0AAAD8 3C0D0030 */ lui $t5, (0x003000B0 >> 16) # lui $t5, 0x30 -/* 0DF60C 7F0AAADC 35AD00B0 */ ori $t5, (0x003000B0 & 0xFFFF) # ori $t5, $t5, 0xb0 -/* 0DF610 7F0AAAE0 358C00A0 */ ori $t4, (0x007000A0 & 0xFFFF) # ori $t4, $t4, 0xa0 -/* 0DF614 7F0AAAE4 240AFFFF */ li $t2, -1 -/* 0DF618 7F0AAAE8 240B0001 */ li $t3, 1 -/* 0DF61C 7F0AAAEC 240E0001 */ li $t6, 1 -/* 0DF620 7F0AAAF0 AFAE0028 */ sw $t6, 0x28($sp) -/* 0DF624 7F0AAAF4 AFAB0014 */ sw $t3, 0x14($sp) -/* 0DF628 7F0AAAF8 AFAA0010 */ sw $t2, 0x10($sp) -/* 0DF62C 7F0AAAFC AFAC0018 */ sw $t4, 0x18($sp) -/* 0DF630 7F0AAB00 AFAD0024 */ sw $t5, 0x24($sp) -/* 0DF634 7F0AAB04 02002025 */ move $a0, $s0 -/* 0DF638 7F0AAB08 240500E6 */ li $a1, 230 -/* 0DF63C 7F0AAB0C 240600A7 */ li $a2, 167 -/* 0DF640 7F0AAB10 00403825 */ move $a3, $v0 -/* 0DF644 7F0AAB14 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF648 7F0AAB18 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF64C 7F0AAB1C AFA00020 */ sw $zero, 0x20($sp) -/* 0DF650 7F0AAB20 10000016 */ b .L7F0AAB7C -/* 0DF654 7F0AAB24 00408025 */ move $s0, $v0 -.L7F0AAB28: -/* 0DF658 7F0AAB28 0FC30776 */ jal get_textptr_for_textID -/* 0DF65C 7F0AAB2C 3404AC03 */ li $a0, 44035 -/* 0DF660 7F0AAB30 3C0F00AA */ lui $t7, (0x00AA00B0 >> 16) # lui $t7, 0xaa -/* 0DF664 7F0AAB34 3C190030 */ lui $t9, (0x003000B0 >> 16) # lui $t9, 0x30 -/* 0DF668 7F0AAB38 373900B0 */ ori $t9, (0x003000B0 & 0xFFFF) # ori $t9, $t9, 0xb0 -/* 0DF66C 7F0AAB3C 35EF00B0 */ ori $t7, (0x00AA00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 -/* 0DF670 7F0AAB40 2418FFFF */ li $t8, -1 -/* 0DF674 7F0AAB44 24080001 */ li $t0, 1 -/* 0DF678 7F0AAB48 AFA80028 */ sw $t0, 0x28($sp) -/* 0DF67C 7F0AAB4C AFB80018 */ sw $t8, 0x18($sp) -/* 0DF680 7F0AAB50 AFAF0010 */ sw $t7, 0x10($sp) -/* 0DF684 7F0AAB54 AFB90024 */ sw $t9, 0x24($sp) -/* 0DF688 7F0AAB58 02002025 */ move $a0, $s0 -/* 0DF68C 7F0AAB5C 240500E6 */ li $a1, 230 -/* 0DF690 7F0AAB60 240600A7 */ li $a2, 167 -/* 0DF694 7F0AAB64 00403825 */ move $a3, $v0 -/* 0DF698 7F0AAB68 AFA00014 */ sw $zero, 0x14($sp) -/* 0DF69C 7F0AAB6C AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF6A0 7F0AAB70 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF6A4 7F0AAB74 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF6A8 7F0AAB78 00408025 */ move $s0, $v0 -.L7F0AAB7C: -/* 0DF6AC 7F0AAB7C 24040001 */ li $a0, 1 -/* 0DF6B0 7F0AAB80 0C0030C3 */ jal get_controller_buttons_held -/* 0DF6B4 7F0AAB84 24054000 */ li $a1, 16384 -/* 0DF6B8 7F0AAB88 10400018 */ beqz $v0, .L7F0AABEC -/* 0DF6BC 7F0AAB8C 00000000 */ nop -/* 0DF6C0 7F0AAB90 0FC30776 */ jal get_textptr_for_textID -/* 0DF6C4 7F0AAB94 3404AC02 */ li $a0, 44034 -/* 0DF6C8 7F0AAB98 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 -/* 0DF6CC 7F0AAB9C 3C0C0030 */ lui $t4, (0x003000B0 >> 16) # lui $t4, 0x30 -/* 0DF6D0 7F0AABA0 358C00B0 */ ori $t4, (0x003000B0 & 0xFFFF) # ori $t4, $t4, 0xb0 -/* 0DF6D4 7F0AABA4 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 -/* 0DF6D8 7F0AABA8 2409FFFF */ li $t1, -1 -/* 0DF6DC 7F0AABAC 240A0001 */ li $t2, 1 -/* 0DF6E0 7F0AABB0 240D0001 */ li $t5, 1 -/* 0DF6E4 7F0AABB4 AFAD0028 */ sw $t5, 0x28($sp) -/* 0DF6E8 7F0AABB8 AFAA0014 */ sw $t2, 0x14($sp) -/* 0DF6EC 7F0AABBC AFA90010 */ sw $t1, 0x10($sp) -/* 0DF6F0 7F0AABC0 AFAB0018 */ sw $t3, 0x18($sp) -/* 0DF6F4 7F0AABC4 AFAC0024 */ sw $t4, 0x24($sp) -/* 0DF6F8 7F0AABC8 02002025 */ move $a0, $s0 -/* 0DF6FC 7F0AABCC 240500E6 */ li $a1, 230 -/* 0DF700 7F0AABD0 24060095 */ li $a2, 149 -/* 0DF704 7F0AABD4 00403825 */ move $a3, $v0 -/* 0DF708 7F0AABD8 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF70C 7F0AABDC 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF710 7F0AABE0 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF714 7F0AABE4 10000016 */ b .L7F0AAC40 -/* 0DF718 7F0AABE8 00408025 */ move $s0, $v0 -.L7F0AABEC: -/* 0DF71C 7F0AABEC 0FC30776 */ jal get_textptr_for_textID -/* 0DF720 7F0AABF0 3404AC02 */ li $a0, 44034 -/* 0DF724 7F0AABF4 3C0E00AA */ lui $t6, (0x00AA00B0 >> 16) # lui $t6, 0xaa -/* 0DF728 7F0AABF8 3C180030 */ lui $t8, (0x003000B0 >> 16) # lui $t8, 0x30 -/* 0DF72C 7F0AABFC 371800B0 */ ori $t8, (0x003000B0 & 0xFFFF) # ori $t8, $t8, 0xb0 -/* 0DF730 7F0AAC00 35CE00B0 */ ori $t6, (0x00AA00B0 & 0xFFFF) # ori $t6, $t6, 0xb0 -/* 0DF734 7F0AAC04 240FFFFF */ li $t7, -1 -/* 0DF738 7F0AAC08 24190001 */ li $t9, 1 -/* 0DF73C 7F0AAC0C AFB90028 */ sw $t9, 0x28($sp) -/* 0DF740 7F0AAC10 AFAF0018 */ sw $t7, 0x18($sp) -/* 0DF744 7F0AAC14 AFAE0010 */ sw $t6, 0x10($sp) -/* 0DF748 7F0AAC18 AFB80024 */ sw $t8, 0x24($sp) -/* 0DF74C 7F0AAC1C 02002025 */ move $a0, $s0 -/* 0DF750 7F0AAC20 240500E6 */ li $a1, 230 -/* 0DF754 7F0AAC24 24060095 */ li $a2, 149 -/* 0DF758 7F0AAC28 00403825 */ move $a3, $v0 -/* 0DF75C 7F0AAC2C AFA00014 */ sw $zero, 0x14($sp) -/* 0DF760 7F0AAC30 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF764 7F0AAC34 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF768 7F0AAC38 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF76C 7F0AAC3C 00408025 */ move $s0, $v0 -.L7F0AAC40: -/* 0DF770 7F0AAC40 3C088008 */ lui $t0, %hi(pPlayer) -/* 0DF774 7F0AAC44 8D08A0B0 */ lw $t0, %lo(pPlayer)($t0) -/* 0DF778 7F0AAC48 24010004 */ li $at, 4 -/* 0DF77C 7F0AAC4C 8D022A58 */ lw $v0, 0x2a58($t0) -/* 0DF780 7F0AAC50 10410003 */ beq $v0, $at, .L7F0AAC60 -/* 0DF784 7F0AAC54 24010005 */ li $at, 5 -/* 0DF788 7F0AAC58 14410005 */ bne $v0, $at, .L7F0AAC70 -/* 0DF78C 7F0AAC5C 00000000 */ nop -.L7F0AAC60: -/* 0DF790 7F0AAC60 0FC30776 */ jal get_textptr_for_textID -/* 0DF794 7F0AAC64 3404AC01 */ li $a0, 44033 -/* 0DF798 7F0AAC68 10000004 */ b .L7F0AAC7C -/* 0DF79C 7F0AAC6C 00403825 */ move $a3, $v0 -.L7F0AAC70: -/* 0DF7A0 7F0AAC70 0FC30776 */ jal get_textptr_for_textID -/* 0DF7A4 7F0AAC74 3404AC00 */ li $a0, 44032 -/* 0DF7A8 7F0AAC78 00403825 */ move $a3, $v0 -.L7F0AAC7C: -/* 0DF7AC 7F0AAC7C 24040001 */ li $a0, 1 -/* 0DF7B0 7F0AAC80 24052000 */ li $a1, 8192 -/* 0DF7B4 7F0AAC84 0C0030C3 */ jal get_controller_buttons_held -/* 0DF7B8 7F0AAC88 AFA70044 */ sw $a3, 0x44($sp) -/* 0DF7BC 7F0AAC8C 10400015 */ beqz $v0, .L7F0AACE4 -/* 0DF7C0 7F0AAC90 8FA70044 */ lw $a3, 0x44($sp) -/* 0DF7C4 7F0AAC94 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 -/* 0DF7C8 7F0AAC98 3C0C0030 */ lui $t4, (0x003000B0 >> 16) # lui $t4, 0x30 -/* 0DF7CC 7F0AAC9C 358C00B0 */ ori $t4, (0x003000B0 & 0xFFFF) # ori $t4, $t4, 0xb0 -/* 0DF7D0 7F0AACA0 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 -/* 0DF7D4 7F0AACA4 2409FFFF */ li $t1, -1 -/* 0DF7D8 7F0AACA8 240A0001 */ li $t2, 1 -/* 0DF7DC 7F0AACAC 240D0001 */ li $t5, 1 -/* 0DF7E0 7F0AACB0 AFAD0028 */ sw $t5, 0x28($sp) -/* 0DF7E4 7F0AACB4 AFAA0014 */ sw $t2, 0x14($sp) -/* 0DF7E8 7F0AACB8 AFA90010 */ sw $t1, 0x10($sp) -/* 0DF7EC 7F0AACBC AFAB0018 */ sw $t3, 0x18($sp) -/* 0DF7F0 7F0AACC0 AFAC0024 */ sw $t4, 0x24($sp) -/* 0DF7F4 7F0AACC4 02002025 */ move $a0, $s0 -/* 0DF7F8 7F0AACC8 240500E6 */ li $a1, 230 -/* 0DF7FC 7F0AACCC 240600B9 */ li $a2, 185 -/* 0DF800 7F0AACD0 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF804 7F0AACD4 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF808 7F0AACD8 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF80C 7F0AACDC 10000013 */ b .L7F0AAD2C -/* 0DF810 7F0AACE0 00408025 */ move $s0, $v0 -.L7F0AACE4: -/* 0DF814 7F0AACE4 3C0E00AA */ lui $t6, (0x00AA00B0 >> 16) # lui $t6, 0xaa -/* 0DF818 7F0AACE8 3C180030 */ lui $t8, (0x003000B0 >> 16) # lui $t8, 0x30 -/* 0DF81C 7F0AACEC 371800B0 */ ori $t8, (0x003000B0 & 0xFFFF) # ori $t8, $t8, 0xb0 -/* 0DF820 7F0AACF0 35CE00B0 */ ori $t6, (0x00AA00B0 & 0xFFFF) # ori $t6, $t6, 0xb0 -/* 0DF824 7F0AACF4 240FFFFF */ li $t7, -1 -/* 0DF828 7F0AACF8 24190001 */ li $t9, 1 -/* 0DF82C 7F0AACFC AFB90028 */ sw $t9, 0x28($sp) -/* 0DF830 7F0AAD00 AFAF0018 */ sw $t7, 0x18($sp) -/* 0DF834 7F0AAD04 AFAE0010 */ sw $t6, 0x10($sp) -/* 0DF838 7F0AAD08 AFB80024 */ sw $t8, 0x24($sp) -/* 0DF83C 7F0AAD0C 02002025 */ move $a0, $s0 -/* 0DF840 7F0AAD10 240500E6 */ li $a1, 230 -/* 0DF844 7F0AAD14 240600B9 */ li $a2, 185 -/* 0DF848 7F0AAD18 AFA00014 */ sw $zero, 0x14($sp) -/* 0DF84C 7F0AAD1C AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF850 7F0AAD20 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF854 7F0AAD24 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF858 7F0AAD28 00408025 */ move $s0, $v0 -.L7F0AAD2C: -/* 0DF85C 7F0AAD2C 3C088008 */ lui $t0, %hi(pPlayer) -/* 0DF860 7F0AAD30 8D08A0B0 */ lw $t0, %lo(pPlayer)($t0) -/* 0DF864 7F0AAD34 24010004 */ li $at, 4 -/* 0DF868 7F0AAD38 8D022A58 */ lw $v0, 0x2a58($t0) -/* 0DF86C 7F0AAD3C 10410003 */ beq $v0, $at, .L7F0AAD4C -/* 0DF870 7F0AAD40 24010006 */ li $at, 6 -/* 0DF874 7F0AAD44 14410005 */ bne $v0, $at, .L7F0AAD5C -/* 0DF878 7F0AAD48 00000000 */ nop -.L7F0AAD4C: -/* 0DF87C 7F0AAD4C 0FC30776 */ jal get_textptr_for_textID -/* 0DF880 7F0AAD50 3404AC06 */ li $a0, 44038 -/* 0DF884 7F0AAD54 10000004 */ b .L7F0AAD68 -/* 0DF888 7F0AAD58 00403825 */ move $a3, $v0 -.L7F0AAD5C: -/* 0DF88C 7F0AAD5C 0FC30776 */ jal get_textptr_for_textID -/* 0DF890 7F0AAD60 3404AC05 */ li $a0, 44037 -/* 0DF894 7F0AAD64 00403825 */ move $a3, $v0 -.L7F0AAD68: -/* 0DF898 7F0AAD68 3C0900AA */ lui $t1, (0x00AA00B0 >> 16) # lui $t1, 0xaa -/* 0DF89C 7F0AAD6C 3C0B0030 */ lui $t3, (0x003000B0 >> 16) # lui $t3, 0x30 -/* 0DF8A0 7F0AAD70 356B00B0 */ ori $t3, (0x003000B0 & 0xFFFF) # ori $t3, $t3, 0xb0 -/* 0DF8A4 7F0AAD74 352900B0 */ ori $t1, (0x00AA00B0 & 0xFFFF) # ori $t1, $t1, 0xb0 -/* 0DF8A8 7F0AAD78 240AFFFF */ li $t2, -1 -/* 0DF8AC 7F0AAD7C 240C0001 */ li $t4, 1 -/* 0DF8B0 7F0AAD80 AFAC0028 */ sw $t4, 0x28($sp) -/* 0DF8B4 7F0AAD84 AFAA0018 */ sw $t2, 0x18($sp) -/* 0DF8B8 7F0AAD88 AFA90010 */ sw $t1, 0x10($sp) -/* 0DF8BC 7F0AAD8C AFAB0024 */ sw $t3, 0x24($sp) -/* 0DF8C0 7F0AAD90 02002025 */ move $a0, $s0 -/* 0DF8C4 7F0AAD94 240500E6 */ li $a1, 230 -/* 0DF8C8 7F0AAD98 240600CB */ li $a2, 203 -/* 0DF8CC 7F0AAD9C AFA00014 */ sw $zero, 0x14($sp) -/* 0DF8D0 7F0AADA0 AFA0001C */ sw $zero, 0x1c($sp) -/* 0DF8D4 7F0AADA4 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0DF8D8 7F0AADA8 AFA00020 */ sw $zero, 0x20($sp) -/* 0DF8DC 7F0AADAC 8FBF003C */ lw $ra, 0x3c($sp) -/* 0DF8E0 7F0AADB0 8FB00038 */ lw $s0, 0x38($sp) -/* 0DF8E4 7F0AADB4 27BD0048 */ addiu $sp, $sp, 0x48 -/* 0DF8E8 7F0AADB8 03E00008 */ jr $ra -/* 0DF8EC 7F0AADBC 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -8874,8 +7553,8 @@ glabel sub_GAME_7F0AADC0 /* 0DFA70 7F0AAF40 3C0F8004 */ lui $t7, %hi(watch_soundrelated_maybe) /* 0DFA74 7F0AAF44 8DEF09A8 */ lw $t7, %lo(watch_soundrelated_maybe)($t7) /* 0DFA78 7F0AAF48 11E00016 */ beqz $t7, .L7F0AAFA4 -/* 0DFA7C 7F0AAF4C 3C098004 */ lui $t1, %hi(D_80040998) -/* 0DFA80 7F0AAF50 8D290998 */ lw $t1, %lo(D_80040998)($t1) +/* 0DFA7C 7F0AAF4C 3C098004 */ lui $t1, %hi(controller_options_index) +/* 0DFA80 7F0AAF50 8D290998 */ lw $t1, %lo(controller_options_index)($t1) /* 0DFA84 7F0AAF54 24010001 */ li $at, 1 /* 0DFA88 7F0AAF58 15210012 */ bne $t1, $at, .L7F0AAFA4 /* 0DFA8C 7F0AAF5C 00000000 */ nop @@ -8951,7 +7630,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFB9C 7F0AB06C E7A20014 */ swc1 $f2, 0x14($sp) /* 0DFBA0 7F0AB070 E7A2001C */ swc1 $f2, 0x1c($sp) /* 0DFBA4 7F0AB074 E7A20020 */ swc1 $f2, 0x20($sp) -/* 0DFBA8 7F0AB078 0FC165A5 */ jal sub_GAME_7F059694 +/* 0DFBA8 7F0AB078 0FC165A5 */ jal matrix_4x4_7F059694 /* 0DFBAC 7F0AB07C E7B00024 */ swc1 $f16, 0x24($sp) /* 0DFBB0 7F0AB080 10000017 */ b .L7F0AB0E0 /* 0DFBB4 7F0AB084 27A4032C */ addiu $a0, $sp, 0x32c @@ -8975,7 +7654,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFBF8 7F0AB0C8 E7A80024 */ swc1 $f8, 0x24($sp) /* 0DFBFC 7F0AB0CC E7A60014 */ swc1 $f6, 0x14($sp) /* 0DFC00 7F0AB0D0 E7B2001C */ swc1 $f18, 0x1c($sp) -/* 0DFC04 7F0AB0D4 0FC165A5 */ jal sub_GAME_7F059694 +/* 0DFC04 7F0AB0D4 0FC165A5 */ jal matrix_4x4_7F059694 /* 0DFC08 7F0AB0D8 E7A40020 */ swc1 $f4, 0x20($sp) /* 0DFC0C 7F0AB0DC 27A4032C */ addiu $a0, $sp, 0x32c .L7F0AB0E0: @@ -9074,8 +7753,8 @@ glabel sub_GAME_7F0AADC0 /* 0DFD78 7F0AB248 3C088004 */ lui $t0, %hi(watch_soundrelated_maybe) /* 0DFD7C 7F0AB24C 8D0809A8 */ lw $t0, %lo(watch_soundrelated_maybe)($t0) /* 0DFD80 7F0AB250 11000016 */ beqz $t0, .L7F0AB2AC -/* 0DFD84 7F0AB254 3C0F8004 */ lui $t7, %hi(D_80040998) -/* 0DFD88 7F0AB258 8DEF0998 */ lw $t7, %lo(D_80040998)($t7) +/* 0DFD84 7F0AB254 3C0F8004 */ lui $t7, %hi(controller_options_index) +/* 0DFD88 7F0AB258 8DEF0998 */ lw $t7, %lo(controller_options_index)($t7) /* 0DFD8C 7F0AB25C 24010001 */ li $at, 1 /* 0DFD90 7F0AB260 15E10012 */ bne $t7, $at, .L7F0AB2AC /* 0DFD94 7F0AB264 00000000 */ nop @@ -9145,7 +7824,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFE8C 7F0AB35C E7A2001C */ swc1 $f2, 0x1c($sp) /* 0DFE90 7F0AB360 E7A20020 */ swc1 $f2, 0x20($sp) /* 0DFE94 7F0AB364 E7B00018 */ swc1 $f16, 0x18($sp) -/* 0DFE98 7F0AB368 0FC165A5 */ jal sub_GAME_7F059694 +/* 0DFE98 7F0AB368 0FC165A5 */ jal matrix_4x4_7F059694 /* 0DFE9C 7F0AB36C E7A40024 */ swc1 $f4, 0x24($sp) /* 0DFEA0 7F0AB370 27A402EC */ addiu $a0, $sp, 0x2ec /* 0DFEA4 7F0AB374 27A503BC */ addiu $a1, $sp, 0x3bc @@ -9208,7 +7887,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFF80 7F0AB450 00000000 */ nop /* 0DFF84 7F0AB454 10400005 */ beqz $v0, .L7F0AB46C /* 0DFF88 7F0AB458 00000000 */ nop -/* 0DFF8C 7F0AB45C 0FC2A9F2 */ jal sub_GAME_7F0AA7C8 +/* 0DFF8C 7F0AB45C 0FC2A9F2 */ jal display_text_buttons_dual_control /* 0DFF90 7F0AB460 02002025 */ move $a0, $s0 /* 0DFF94 7F0AB464 10000004 */ b .L7F0AB478 /* 0DFF98 7F0AB468 00408025 */ move $s0, $v0 @@ -9345,8 +8024,8 @@ glabel sub_GAME_7F0AADC0 /* 0E0664 7F0ABAF4 3C088004 */ lui $t0, %hi(watch_soundrelated_maybe) # $t0, 0x8004 /* 0E0668 7F0ABAF8 8D0809D8 */ lw $t0, %lo(watch_soundrelated_maybe)($t0) /* 0E066C 7F0ABAFC 11000016 */ beqz $t0, .Ljp7F0ABB58 -/* 0E0670 7F0ABB00 3C0F8004 */ lui $t7, %hi(D_80040998) # $t7, 0x8004 -/* 0E0674 7F0ABB04 8DEF09C8 */ lw $t7, %lo(D_80040998)($t7) +/* 0E0670 7F0ABB00 3C0F8004 */ lui $t7, %hi(controller_options_index) # $t7, 0x8004 +/* 0E0674 7F0ABB04 8DEF09C8 */ lw $t7, %lo(controller_options_index)($t7) /* 0E0678 7F0ABB08 24010001 */ li $at, 1 /* 0E067C 7F0ABB0C 15E10012 */ bne $t7, $at, .Ljp7F0ABB58 /* 0E0680 7F0ABB10 00000000 */ nop @@ -9422,7 +8101,7 @@ glabel sub_GAME_7F0AADC0 /* 0E0790 7F0ABC20 E7A20014 */ swc1 $f2, 0x14($sp) /* 0E0794 7F0ABC24 E7A2001C */ swc1 $f2, 0x1c($sp) /* 0E0798 7F0ABC28 E7A20020 */ swc1 $f2, 0x20($sp) -/* 0E079C 7F0ABC2C 0FC166ED */ jal sub_GAME_7F059694 +/* 0E079C 7F0ABC2C 0FC166ED */ jal matrix_4x4_7F059694 /* 0E07A0 7F0ABC30 E7AA0024 */ swc1 $f10, 0x24($sp) /* 0E07A4 7F0ABC34 10000017 */ b .Ljp7F0ABC94 /* 0E07A8 7F0ABC38 27A4032C */ addiu $a0, $sp, 0x32c @@ -9446,7 +8125,7 @@ glabel sub_GAME_7F0AADC0 /* 0E07EC 7F0ABC7C E7A60024 */ swc1 $f6, 0x24($sp) /* 0E07F0 7F0ABC80 E7B20014 */ swc1 $f18, 0x14($sp) /* 0E07F4 7F0ABC84 E7B0001C */ swc1 $f16, 0x1c($sp) -/* 0E07F8 7F0ABC88 0FC166ED */ jal sub_GAME_7F059694 +/* 0E07F8 7F0ABC88 0FC166ED */ jal matrix_4x4_7F059694 /* 0E07FC 7F0ABC8C E7A40020 */ swc1 $f4, 0x20($sp) /* 0E0800 7F0ABC90 27A4032C */ addiu $a0, $sp, 0x32c .Ljp7F0ABC94: @@ -9542,8 +8221,8 @@ glabel sub_GAME_7F0AADC0 /* 0E0960 7F0ABDF0 3C0C8004 */ lui $t4, %hi(watch_soundrelated_maybe) # $t4, 0x8004 /* 0E0964 7F0ABDF4 8D8C09D8 */ lw $t4, %lo(watch_soundrelated_maybe)($t4) /* 0E0968 7F0ABDF8 11800016 */ beqz $t4, .Ljp7F0ABE54 -/* 0E096C 7F0ABDFC 3C0D8004 */ lui $t5, %hi(D_80040998) # $t5, 0x8004 -/* 0E0970 7F0ABE00 8DAD09C8 */ lw $t5, %lo(D_80040998)($t5) +/* 0E096C 7F0ABDFC 3C0D8004 */ lui $t5, %hi(controller_options_index) # $t5, 0x8004 +/* 0E0970 7F0ABE00 8DAD09C8 */ lw $t5, %lo(controller_options_index)($t5) /* 0E0974 7F0ABE04 24010001 */ li $at, 1 /* 0E0978 7F0ABE08 15A10012 */ bne $t5, $at, .Ljp7F0ABE54 /* 0E097C 7F0ABE0C 00000000 */ nop @@ -9613,7 +8292,7 @@ glabel sub_GAME_7F0AADC0 /* 0E0A74 7F0ABF04 E7A2001C */ swc1 $f2, 0x1c($sp) /* 0E0A78 7F0ABF08 E7A20020 */ swc1 $f2, 0x20($sp) /* 0E0A7C 7F0ABF0C E7A80018 */ swc1 $f8, 0x18($sp) -/* 0E0A80 7F0ABF10 0FC166ED */ jal sub_GAME_7F059694 +/* 0E0A80 7F0ABF10 0FC166ED */ jal matrix_4x4_7F059694 /* 0E0A84 7F0ABF14 E7B20024 */ swc1 $f18, 0x24($sp) /* 0E0A88 7F0ABF18 27A402EC */ addiu $a0, $sp, 0x2ec /* 0E0A8C 7F0ABF1C 27A503BC */ addiu $a1, $sp, 0x3bc @@ -9676,7 +8355,7 @@ glabel sub_GAME_7F0AADC0 /* 0E0B68 7F0ABFF8 00000000 */ nop /* 0E0B6C 7F0ABFFC 10400005 */ beqz $v0, .Ljp7F0AC014 /* 0E0B70 7F0AC000 00000000 */ nop -/* 0E0B74 7F0AC004 0FC2ACE2 */ jal sub_GAME_7F0AA7C8 +/* 0E0B74 7F0AC004 0FC2ACE2 */ jal display_text_buttons_dual_control /* 0E0B78 7F0AC008 02002025 */ move $a0, $s0 /* 0E0B7C 7F0AC00C 10000004 */ b .Ljp7F0AC020 /* 0E0B80 7F0AC010 00408025 */ move $s0, $v0 @@ -9699,12 +8378,12 @@ glabel sub_GAME_7F0AADC0 -void zero_D_80040998(void) { - D_80040998 = 0; +void reset_controller_options_index(void) { + controller_options_index = 0; } -void zero_D_8004099C(void) { - D_8004099C = 0; +void reset_game_options_index(void) { + game_options_index = 0; } void zero_D_800409A4(void) { @@ -9734,7 +8413,7 @@ void proc_7F0AB4B8(u32 param_1,u32 param_2) ?32 phi_s1_2; - DL = sub_GAME_7F0A714C(param_1, param_2, 0); + DL = draw_background_health_and_armor(param_1, param_2, 0); if (check_watch_page_transistion_running() != 1) { pFirstFontTableSmall = (s32) ptrFirstFontTableSmall; @@ -9744,7 +8423,7 @@ void proc_7F0AB4B8(u32 param_1,u32 param_2) sp5C = 0x40; sp58 = 0x1a; phi_s1 = 0xff00b0; - if (D_80040998 == 0) + if (controller_options_index == 0) { phi_s1 = 0xa0ffa0f0; if (watch_soundrelated_maybe != 0) @@ -9753,7 +8432,7 @@ void proc_7F0AB4B8(u32 param_1,u32 param_2) } } sub_GAME_7F0AE98C(&sp50, &sp54, txtptr, pSecondFontTableSmall, pFirstFontTableSmall, 0); - if ((watch_soundrelated_maybe != 0) && (D_80040998 == 0)) + if ((watch_soundrelated_maybe != 0) && (controller_options_index == 0)) { jp_text_write_stuff(DL, &sp5C, &sp58, txtptr, pSecondFontTableSmall, pFirstFontTableSmall, (?32) phi_s1, 0x7000a0, (s32) (sp54 + 1), sp50, 0, 0); } @@ -9769,7 +8448,7 @@ void proc_7F0AB4B8(u32 param_1,u32 param_2) } sp5C = 0x40; sp58 = 0x2b; - if (D_80040998 == 1) + if (controller_options_index == 1) { phi_s1_2 = 0xa0ffa0f0; if (watch_soundrelated_maybe != 0) @@ -9778,7 +8457,7 @@ void proc_7F0AB4B8(u32 param_1,u32 param_2) } } sub_GAME_7F0AE98C(&sp50, &sp54, txtptr, pSecondFontTableSmall, pFirstFontTableSmall, 0); - if ((watch_soundrelated_maybe != 0) && (D_80040998 == 1)) + if ((watch_soundrelated_maybe != 0) && (controller_options_index == 1)) { jp_text_write_stuff(DL, &sp5C, &sp58, txtptr, pSecondFontTableSmall, pFirstFontTableSmall, (?32) phi_s1_2, 0x7000a0, (s32) (sp54 + 1), sp50, 0, 0); } @@ -9798,7 +8477,7 @@ glabel sub_GAME_7F0AB4B8 /* 0DFFF0 7F0AB4C0 AFB20040 */ sw $s2, 0x40($sp) /* 0DFFF4 7F0AB4C4 AFB1003C */ sw $s1, 0x3c($sp) /* 0DFFF8 7F0AB4C8 AFB00038 */ sw $s0, 0x38($sp) -/* 0DFFFC 7F0AB4CC 0FC29C53 */ jal sub_GAME_7F0A714C +/* 0DFFFC 7F0AB4CC 0FC29C53 */ jal draw_background_health_and_armor /* 0E0000 7F0AB4D0 00003025 */ move $a2, $zero /* 0E0004 7F0AB4D4 0FC1F97F */ jal check_watch_page_transistion_running /* 0E0008 7F0AB4D8 00408025 */ move $s0, $v0 @@ -9818,8 +8497,8 @@ glabel sub_GAME_7F0AB4B8 /* 0E0040 7F0AB510 00408025 */ move $s0, $v0 /* 0E0044 7F0AB514 0FC30776 */ jal get_textptr_for_textID /* 0E0048 7F0AB518 3404AC32 */ li $a0, 44082 -/* 0E004C 7F0AB51C 3C088004 */ lui $t0, %hi(D_80040998) -/* 0E0050 7F0AB520 8D080998 */ lw $t0, %lo(D_80040998)($t0) +/* 0E004C 7F0AB51C 3C088004 */ lui $t0, %hi(controller_options_index) +/* 0E0050 7F0AB520 8D080998 */ lw $t0, %lo(controller_options_index)($t0) /* 0E0054 7F0AB524 24180040 */ li $t8, 64 /* 0E0058 7F0AB528 2419001A */ li $t9, 26 /* 0E005C 7F0AB52C 3C1100FF */ lui $s1, (0x00FF00B0 >> 16) # lui $s1, 0xff @@ -9847,11 +8526,11 @@ glabel sub_GAME_7F0AB4B8 /* 0E00AC 7F0AB57C AFAA0010 */ sw $t2, 0x10($sp) /* 0E00B0 7F0AB580 3C0B8004 */ lui $t3, %hi(watch_soundrelated_maybe) /* 0E00B4 7F0AB584 8D6B09A8 */ lw $t3, %lo(watch_soundrelated_maybe)($t3) -/* 0E00B8 7F0AB588 3C0C8004 */ lui $t4, %hi(D_80040998) +/* 0E00B8 7F0AB588 3C0C8004 */ lui $t4, %hi(controller_options_index) /* 0E00BC 7F0AB58C 02002025 */ move $a0, $s0 /* 0E00C0 7F0AB590 1160001B */ beqz $t3, .L7F0AB600 /* 0E00C4 7F0AB594 27A5005C */ addiu $a1, $sp, 0x5c -/* 0E00C8 7F0AB598 8D8C0998 */ lw $t4, %lo(D_80040998)($t4) +/* 0E00C8 7F0AB598 8D8C0998 */ lw $t4, %lo(controller_options_index)($t4) /* 0E00CC 7F0AB59C 27A60058 */ addiu $a2, $sp, 0x58 /* 0E00D0 7F0AB5A0 02403825 */ move $a3, $s2 /* 0E00D4 7F0AB5A4 15800016 */ bnez $t4, .L7F0AB600 @@ -9909,8 +8588,8 @@ glabel sub_GAME_7F0AB4B8 /* 0E019C 7F0AB66C 3404AC34 */ li $a0, 44084 /* 0E01A0 7F0AB670 00409025 */ move $s2, $v0 .L7F0AB674: -/* 0E01A4 7F0AB674 3C0F8004 */ lui $t7, %hi(D_80040998) -/* 0E01A8 7F0AB678 8DEF0998 */ lw $t7, %lo(D_80040998)($t7) +/* 0E01A4 7F0AB674 3C0F8004 */ lui $t7, %hi(controller_options_index) +/* 0E01A8 7F0AB678 8DEF0998 */ lw $t7, %lo(controller_options_index)($t7) /* 0E01AC 7F0AB67C 240D0040 */ li $t5, 64 /* 0E01B0 7F0AB680 240E002B */ li $t6, 43 /* 0E01B4 7F0AB684 24010001 */ li $at, 1 @@ -9936,11 +8615,11 @@ glabel sub_GAME_7F0AB4B8 /* 0E01FC 7F0AB6CC AFB90010 */ sw $t9, 0x10($sp) /* 0E0200 7F0AB6D0 3C088004 */ lui $t0, %hi(watch_soundrelated_maybe) /* 0E0204 7F0AB6D4 8D0809A8 */ lw $t0, %lo(watch_soundrelated_maybe)($t0) -/* 0E0208 7F0AB6D8 3C098004 */ lui $t1, %hi(D_80040998) +/* 0E0208 7F0AB6D8 3C098004 */ lui $t1, %hi(controller_options_index) /* 0E020C 7F0AB6DC 02002025 */ move $a0, $s0 /* 0E0210 7F0AB6E0 1100001A */ beqz $t0, .L7F0AB74C /* 0E0214 7F0AB6E4 27A5005C */ addiu $a1, $sp, 0x5c -/* 0E0218 7F0AB6E8 8D290998 */ lw $t1, %lo(D_80040998)($t1) +/* 0E0218 7F0AB6E8 8D290998 */ lw $t1, %lo(controller_options_index)($t1) /* 0E021C 7F0AB6EC 24010001 */ li $at, 1 /* 0E0220 7F0AB6F0 27A60058 */ addiu $a2, $sp, 0x58 /* 0E0224 7F0AB6F4 15210015 */ bne $t1, $at, .L7F0AB74C @@ -9994,122 +8673,196 @@ glabel sub_GAME_7F0AB4B8 #endif - - - - -void set_pparam1toparam2_disablejoylr_playsfx(u32 *param_1,u32 param_2) +void game_option_select_value(u32 *param_1, u32 param_2) { *param_1 = param_2; set_controlstick_lr_disabled(); - play_sfx_a1(ptr_sfx_buf,0x2b,NULL); + play_sfx_a1(ptr_sfx_buf, 0x2b, NULL); +} + + +void game_option_toggle_input(s32 option_index) +{ + if ( (get_controller_buttons_pressed(0, L_CBUTTONS|L_TRIG|L_JPAD) || sub_GAME_7F0A4FB0()) && watch_soundrelated_maybe ) + { + if (game_options_entries[option_index].current_value == 1) + { + game_option_select_value(&game_options_entries[option_index].current_value, 0); + } + else if (game_options_entries[option_index].current_value == 2) + { + game_option_select_value(&game_options_entries[option_index].current_value, 1); + } + } + else + { + if ( (get_controller_buttons_pressed(0, R_CBUTTONS|R_TRIG|R_JPAD) || sub_GAME_7F0A4FEC()) && watch_soundrelated_maybe ) + { + if (game_options_entries[option_index].current_value == 0) + { + game_option_select_value(&game_options_entries[option_index].current_value, 1); + } + else if ( (game_options_entries[option_index].current_value == 1) && game_options_entries[option_index].text[3] ) + { + game_option_select_value(&game_options_entries[option_index].current_value, 2); + } + } + } } - #ifdef NONMATCHING -void sub_GAME_7F0AB7D8(void) { +void sub_GAME_7F0AB908(s32 param_1, u32 param_2, int param_3, s32 param_4) +{ +// u32 uVar1; + u8 pbVar2; + u32 puVar3; + u32 uVar4; + + //s32 puVar5; + s32 puVar6; + s32 puVar7; + + u32 local_res0; + u32 local_14; + s32 local_c; + + puVar7 = 0x800080; + puVar6 = 0x800080; + local_c = 0x800080; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0AB7D8 -/* 0E0308 7F0AB7D8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E030C 7F0AB7DC AFBF0014 */ sw $ra, 0x14($sp) -/* 0E0310 7F0AB7E0 AFA40018 */ sw $a0, 0x18($sp) -/* 0E0314 7F0AB7E4 00002025 */ move $a0, $zero -/* 0E0318 7F0AB7E8 0C0030EB */ jal get_controller_buttons_pressed -/* 0E031C 7F0AB7EC 24050222 */ li $a1, 546 -/* 0E0320 7F0AB7F0 14400004 */ bnez $v0, .L7F0AB804 -/* 0E0324 7F0AB7F4 00000000 */ nop -/* 0E0328 7F0AB7F8 0FC293EC */ jal sub_GAME_7F0A4FB0 -/* 0E032C 7F0AB7FC 00000000 */ nop -/* 0E0330 7F0AB800 1040001A */ beqz $v0, .L7F0AB86C -.L7F0AB804: -/* 0E0334 7F0AB804 3C0E8004 */ lui $t6, %hi(watch_soundrelated_maybe) -/* 0E0338 7F0AB808 8DCE09A8 */ lw $t6, %lo(watch_soundrelated_maybe)($t6) -/* 0E033C 7F0AB80C 8FAF0018 */ lw $t7, 0x18($sp) -/* 0E0340 7F0AB810 3C198004 */ lui $t9, %hi(D_80040A7C) -/* 0E0344 7F0AB814 11C00015 */ beqz $t6, .L7F0AB86C -/* 0E0348 7F0AB818 000FC080 */ sll $t8, $t7, 2 -/* 0E034C 7F0AB81C 030FC023 */ subu $t8, $t8, $t7 -/* 0E0350 7F0AB820 0018C080 */ sll $t8, $t8, 2 -/* 0E0354 7F0AB824 27390A7C */ addiu $t9, %lo(D_80040A7C) # addiu $t9, $t9, 0xa7c -/* 0E0358 7F0AB828 03191021 */ addu $v0, $t8, $t9 -/* 0E035C 7F0AB82C 8C430008 */ lw $v1, 8($v0) -/* 0E0360 7F0AB830 24010001 */ li $at, 1 -/* 0E0364 7F0AB834 24440008 */ addiu $a0, $v0, 8 -/* 0E0368 7F0AB838 54610006 */ bnel $v1, $at, .L7F0AB854 -/* 0E036C 7F0AB83C 24010002 */ li $at, 2 -/* 0E0370 7F0AB840 0FC2ADE9 */ jal set_pparam1toparam2_disablejoylr_playsfx -/* 0E0374 7F0AB844 00002825 */ move $a1, $zero -/* 0E0378 7F0AB848 1000002C */ b .L7F0AB8FC -/* 0E037C 7F0AB84C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E0380 7F0AB850 24010002 */ li $at, 2 -.L7F0AB854: -/* 0E0384 7F0AB854 14610028 */ bne $v1, $at, .L7F0AB8F8 -/* 0E0388 7F0AB858 24440008 */ addiu $a0, $v0, 8 -/* 0E038C 7F0AB85C 0FC2ADE9 */ jal set_pparam1toparam2_disablejoylr_playsfx -/* 0E0390 7F0AB860 24050001 */ li $a1, 1 -/* 0E0394 7F0AB864 10000025 */ b .L7F0AB8FC -/* 0E0398 7F0AB868 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0AB86C: -/* 0E039C 7F0AB86C 00002025 */ move $a0, $zero -/* 0E03A0 7F0AB870 0C0030EB */ jal get_controller_buttons_pressed -/* 0E03A4 7F0AB874 24050111 */ li $a1, 273 -/* 0E03A8 7F0AB878 14400004 */ bnez $v0, .L7F0AB88C -/* 0E03AC 7F0AB87C 00000000 */ nop -/* 0E03B0 7F0AB880 0FC293FB */ jal sub_GAME_7F0A4FEC -/* 0E03B4 7F0AB884 00000000 */ nop -/* 0E03B8 7F0AB888 1040001B */ beqz $v0, .L7F0AB8F8 -.L7F0AB88C: -/* 0E03BC 7F0AB88C 3C088004 */ lui $t0, %hi(watch_soundrelated_maybe) -/* 0E03C0 7F0AB890 8D0809A8 */ lw $t0, %lo(watch_soundrelated_maybe)($t0) -/* 0E03C4 7F0AB894 8FA90018 */ lw $t1, 0x18($sp) -/* 0E03C8 7F0AB898 3C0B8004 */ lui $t3, %hi(D_80040A7C) -/* 0E03CC 7F0AB89C 11000016 */ beqz $t0, .L7F0AB8F8 -/* 0E03D0 7F0AB8A0 00095080 */ sll $t2, $t1, 2 -/* 0E03D4 7F0AB8A4 01495023 */ subu $t2, $t2, $t1 -/* 0E03D8 7F0AB8A8 000A5080 */ sll $t2, $t2, 2 -/* 0E03DC 7F0AB8AC 256B0A7C */ addiu $t3, %lo(D_80040A7C) # addiu $t3, $t3, 0xa7c -/* 0E03E0 7F0AB8B0 014B1021 */ addu $v0, $t2, $t3 -/* 0E03E4 7F0AB8B4 8C430008 */ lw $v1, 8($v0) -/* 0E03E8 7F0AB8B8 24440008 */ addiu $a0, $v0, 8 -/* 0E03EC 7F0AB8BC 24010001 */ li $at, 1 -/* 0E03F0 7F0AB8C0 14600005 */ bnez $v1, .L7F0AB8D8 -/* 0E03F4 7F0AB8C4 00000000 */ nop -/* 0E03F8 7F0AB8C8 0FC2ADE9 */ jal set_pparam1toparam2_disablejoylr_playsfx -/* 0E03FC 7F0AB8CC 24050001 */ li $a1, 1 -/* 0E0400 7F0AB8D0 1000000A */ b .L7F0AB8FC -/* 0E0404 7F0AB8D4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0AB8D8: -/* 0E0408 7F0AB8D8 54610008 */ bnel $v1, $at, .L7F0AB8FC -/* 0E040C 7F0AB8DC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E0410 7F0AB8E0 944C0006 */ lhu $t4, 6($v0) -/* 0E0414 7F0AB8E4 24440008 */ addiu $a0, $v0, 8 -/* 0E0418 7F0AB8E8 51800004 */ beql $t4, $zero, .L7F0AB8FC -/* 0E041C 7F0AB8EC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E0420 7F0AB8F0 0FC2ADE9 */ jal set_pparam1toparam2_disablejoylr_playsfx -/* 0E0424 7F0AB8F4 24050002 */ li $a1, 2 -.L7F0AB8F8: -/* 0E0428 7F0AB8F8 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0AB8FC: -/* 0E042C 7F0AB8FC 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E0430 7F0AB900 03E00008 */ jr $ra -/* 0E0434 7F0AB904 00000000 */ nop -) -#endif + if (j_text_trigger != 0) + { + uVar4 = 0xAA; + } + else + { + uVar4 = 0xB4; + } + + if (j_text_trigger != 0) + { + local_14 = 0xDC; + } + else + { + local_14 = 0xE1; + } + //L7F0AB958 - GOOD TEXT + if (param_4 != 0) { + + if (param_4 != 1) { + + if (param_4 != 2) { + + // puVar5 = game_options_entries[param_3]; + // puVar6 = puVar7; + + puVar6 = 0x800080; + puVar7 = 0x800080; + + } else { + + game_option_toggle_input(param_3); + + // puVar5 = game_options_entries[param_3]; + // uVar1 = game_options_entries[param_3].current_value; + + puVar6 = 0x800080; + puVar7 = 0x800080; + + if (game_options_entries[param_3].current_value == 0) { + puVar6 = 0xa0ffa0f0; + } + else { + if (game_options_entries[param_3].current_value == 1) { + puVar7 = 0xa0ffa0f0; + } + else { + if (game_options_entries[param_3].current_value == 2) { + local_c = 0xa0ffa0f0; + } + } + } + } + + } + else { + // puVar5 = game_options_entries[param_3].text; + // uVar1 = game_options_entries[param_3].current_value; + if (game_options_entries[param_3].current_value == 0) { + puVar6 = 0xff00b0; + } + else { + if (game_options_entries[param_3].current_value == 1) { + puVar7 = 0xff00b0; + } + else { + if (game_options_entries[param_3].current_value == 2) { + local_c = 0xff00b0; + } + } + } + } + + } else { + // puVar5 = game_options_entries[param_3].text; + // uVar1 = game_options_entries[param_3].current_value; + + if (game_options_entries[param_3].current_value == 0) { + puVar6 = 0xff00b0; + } + + else { + if (game_options_entries[param_3].current_value == 1) { + puVar7 = 0xff00b0; + } + else { + if (game_options_entries[param_3].current_value == 2) { + local_c = 0xff00b0; + } + } + } + } + if (game_options_entries[param_3].text[3] == 0) + { + uVar4 = 0xC8; + if (j_text_trigger != 0) + { + uVar4 = 0xBE; + } -#ifdef NONMATCHING -void sub_GAME_7F0AB908(void) { + if (j_text_trigger != 0) + { + local_14 = 0xFA; + } + else + { + local_14 = 0xFA; + } + } + + + pbVar2 = get_textptr_for_textID(game_options_entries[param_3].text[1]); + puVar3 = proc_7F0A9398(param_1, uVar4, param_2, pbVar2, puVar6, 0, 0xffffffff,1,0, 0x3000B0,0); + //arg0 = sub_GAME_7F0A9398(arg0, phi_a1_2, arg1, get_textptr_for_textID(game_options_entries[PLAYER_OPTION_AUTOAIM].text, phi_a1_2, arg2), phi_t1, 0, -1, 1, 0, 0x3000B0, 0); + + pbVar2 = get_textptr_for_textID(game_options_entries[param_3].text[2]); + local_res0 = proc_7F0A9398(puVar3, local_14, param_2, pbVar2, puVar7,0,0xffffffff,1,0, 0x3000B0, 0); + + if (game_options_entries[param_3].text[3] != 0) { + pbVar2 = get_textptr_for_textID(game_options_entries[param_3].text[3]); + local_res0 = proc_7F0A9398(local_res0, 0x10e, param_2, pbVar2, local_c,0,0xffffffff,1,0, 0x3000B0, 0); + } + + //return local_res0; } #else GLOBAL_ASM( @@ -10148,15 +8901,15 @@ glabel sub_GAME_7F0AB908 /* 0E04A0 7F0AB970 10E10032 */ beq $a3, $at, .L7F0ABA3C /* 0E04A4 7F0AB974 0006C080 */ sll $t8, $a2, 2 /* 0E04A8 7F0AB978 0306C023 */ subu $t8, $t8, $a2 -/* 0E04AC 7F0AB97C 3C198004 */ lui $t9, %hi(D_80040A7C) -/* 0E04B0 7F0AB980 27390A7C */ addiu $t9, %lo(D_80040A7C) # addiu $t9, $t9, 0xa7c +/* 0E04AC 7F0AB97C 3C198004 */ lui $t9, %hi(game_options_entries) +/* 0E04B0 7F0AB980 27390A7C */ addiu $t9, %lo(game_options_entries) # addiu $t9, $t9, 0xa7c /* 0E04B4 7F0AB984 0018C080 */ sll $t8, $t8, 2 /* 0E04B8 7F0AB988 1000004B */ b .L7F0ABAB8 /* 0E04BC 7F0AB98C 03194021 */ addu $t0, $t8, $t9 .L7F0AB990: /* 0E04C0 7F0AB990 01665823 */ subu $t3, $t3, $a2 -/* 0E04C4 7F0AB994 3C0C8004 */ lui $t4, %hi(D_80040A7C) -/* 0E04C8 7F0AB998 258C0A7C */ addiu $t4, %lo(D_80040A7C) # addiu $t4, $t4, 0xa7c +/* 0E04C4 7F0AB994 3C0C8004 */ lui $t4, %hi(game_options_entries) +/* 0E04C8 7F0AB998 258C0A7C */ addiu $t4, %lo(game_options_entries) # addiu $t4, $t4, 0xa7c /* 0E04CC 7F0AB99C 000B5880 */ sll $t3, $t3, 2 /* 0E04D0 7F0AB9A0 016C4021 */ addu $t0, $t3, $t4 /* 0E04D4 7F0AB9A4 8D020008 */ lw $v0, 8($t0) @@ -10180,8 +8933,8 @@ glabel sub_GAME_7F0AB908 /* 0E0514 7F0AB9E4 AFAD0054 */ sw $t5, 0x54($sp) .L7F0AB9E8: /* 0E0518 7F0AB9E8 01C67023 */ subu $t6, $t6, $a2 -/* 0E051C 7F0AB9EC 3C0F8004 */ lui $t7, %hi(D_80040A7C) -/* 0E0520 7F0AB9F0 25EF0A7C */ addiu $t7, %lo(D_80040A7C) # addiu $t7, $t7, 0xa7c +/* 0E051C 7F0AB9EC 3C0F8004 */ lui $t7, %hi(game_options_entries) +/* 0E0520 7F0AB9F0 25EF0A7C */ addiu $t7, %lo(game_options_entries) # addiu $t7, $t7, 0xa7c /* 0E0524 7F0AB9F4 000E7080 */ sll $t6, $t6, 2 /* 0E0528 7F0AB9F8 01CF4021 */ addu $t0, $t6, $t7 /* 0E052C 7F0AB9FC 8D020008 */ lw $v0, 8($t0) @@ -10207,11 +8960,11 @@ glabel sub_GAME_7F0AB908 /* 0E0570 7F0ABA40 AFA50050 */ sw $a1, 0x50($sp) /* 0E0574 7F0ABA44 AFA60068 */ sw $a2, 0x68($sp) /* 0E0578 7F0ABA48 AFA9005C */ sw $t1, 0x5c($sp) -/* 0E057C 7F0ABA4C 0FC2ADF6 */ jal sub_GAME_7F0AB7D8 +/* 0E057C 7F0ABA4C 0FC2ADF6 */ jal game_option_toggle_input /* 0E0580 7F0ABA50 AFAA0058 */ sw $t2, 0x58($sp) /* 0E0584 7F0ABA54 8FA60068 */ lw $a2, 0x68($sp) -/* 0E0588 7F0ABA58 3C0B8004 */ lui $t3, %hi(D_80040A7C) -/* 0E058C 7F0ABA5C 256B0A7C */ addiu $t3, %lo(D_80040A7C) # addiu $t3, $t3, 0xa7c +/* 0E0588 7F0ABA58 3C0B8004 */ lui $t3, %hi(game_options_entries) +/* 0E058C 7F0ABA5C 256B0A7C */ addiu $t3, %lo(game_options_entries) # addiu $t3, $t3, 0xa7c /* 0E0590 7F0ABA60 0006C880 */ sll $t9, $a2, 2 /* 0E0594 7F0ABA64 0326C823 */ subu $t9, $t9, $a2 /* 0E0598 7F0ABA68 0019C880 */ sll $t9, $t9, 2 @@ -10336,143 +9089,36 @@ glabel sub_GAME_7F0AB908 -#ifdef NONMATCHING -void sub_GAME_7F0ABC1C(void) { +s32 draw_toggle_options(s32 param_1) +{ + s32 y_offset; + s32 i; + + param_1 = microcode_constructor(param_1); + for (i = 0, y_offset = 80; i < 8; i = i + 1, y_offset = y_offset + 15) { + + if ( i == game_options_index - 2) + { + if (watch_soundrelated_maybe) + { + param_1 = sub_GAME_7F0AB908(sub_GAME_7F0A9398(param_1, 0x40, y_offset, get_textptr_for_textID(game_options_entries[i].text[0]), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0), y_offset, i, 2); + } + else + { + + param_1 = sub_GAME_7F0AB908(sub_GAME_7F0A9398(param_1, 0x40, y_offset, get_textptr_for_textID(game_options_entries[i].text[0]), 0xA0FFA0F0, 0, -1, 0, 0, 0x3000B0, 0), y_offset, i, 1); + } + } + else + { + param_1 = sub_GAME_7F0AB908(sub_GAME_7F0A9398(param_1, 0x40, y_offset, get_textptr_for_textID(game_options_entries[i].text[0]), 0xFF00B0, 0, -1, 0, 0, 0x3000B0, 0), y_offset, i, 0); + } + + } + + return param_1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0ABC1C -/* 0E074C 7F0ABC1C 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0E0750 7F0ABC20 AFBF005C */ sw $ra, 0x5c($sp) -/* 0E0754 7F0ABC24 AFBE0058 */ sw $fp, 0x58($sp) -/* 0E0758 7F0ABC28 AFB70054 */ sw $s7, 0x54($sp) -/* 0E075C 7F0ABC2C AFB60050 */ sw $s6, 0x50($sp) -/* 0E0760 7F0ABC30 AFB5004C */ sw $s5, 0x4c($sp) -/* 0E0764 7F0ABC34 AFB40048 */ sw $s4, 0x48($sp) -/* 0E0768 7F0ABC38 AFB30044 */ sw $s3, 0x44($sp) -/* 0E076C 7F0ABC3C AFB20040 */ sw $s2, 0x40($sp) -/* 0E0770 7F0ABC40 AFB1003C */ sw $s1, 0x3c($sp) -/* 0E0774 7F0ABC44 0FC2B366 */ jal microcode_constructor -/* 0E0778 7F0ABC48 AFB00038 */ sw $s0, 0x38($sp) -/* 0E077C 7F0ABC4C 3C138004 */ lui $s3, %hi(D_80040A7C) -/* 0E0780 7F0ABC50 3C170070 */ lui $s7, (0x007000A0 >> 16) # lui $s7, 0x70 -/* 0E0784 7F0ABC54 3C168004 */ lui $s6, %hi(watch_soundrelated_maybe) -/* 0E0788 7F0ABC58 3C158004 */ lui $s5, %hi(D_8004099C) -/* 0E078C 7F0ABC5C 3C140030 */ lui $s4, (0x003000B0 >> 16) # lui $s4, 0x30 -/* 0E0790 7F0ABC60 00409025 */ move $s2, $v0 -/* 0E0794 7F0ABC64 369400B0 */ ori $s4, (0x003000B0 & 0xFFFF) # ori $s4, $s4, 0xb0 -/* 0E0798 7F0ABC68 26B5099C */ addiu $s5, %lo(D_8004099C) # addiu $s5, $s5, 0x99c -/* 0E079C 7F0ABC6C 26D609A8 */ addiu $s6, %lo(watch_soundrelated_maybe) # addiu $s6, $s6, 0x9a8 -/* 0E07A0 7F0ABC70 36F700A0 */ ori $s7, (0x007000A0 & 0xFFFF) # ori $s7, $s7, 0xa0 -/* 0E07A4 7F0ABC74 26730A7C */ addiu $s3, %lo(D_80040A7C) # addiu $s3, $s3, 0xa7c -/* 0E07A8 7F0ABC78 00008825 */ move $s1, $zero -/* 0E07AC 7F0ABC7C 24100050 */ li $s0, 80 -/* 0E07B0 7F0ABC80 241E0008 */ li $fp, 8 -.L7F0ABC84: -/* 0E07B4 7F0ABC84 8EAF0000 */ lw $t7, ($s5) -/* 0E07B8 7F0ABC88 262E0002 */ addiu $t6, $s1, 2 -/* 0E07BC 7F0ABC8C 15CF0033 */ bne $t6, $t7, .L7F0ABD5C -/* 0E07C0 7F0ABC90 00000000 */ nop -/* 0E07C4 7F0ABC94 8ED80000 */ lw $t8, ($s6) -/* 0E07C8 7F0ABC98 13000018 */ beqz $t8, .L7F0ABCFC -/* 0E07CC 7F0ABC9C 00000000 */ nop -/* 0E07D0 7F0ABCA0 0FC30776 */ jal get_textptr_for_textID -/* 0E07D4 7F0ABCA4 96640000 */ lhu $a0, ($s3) -/* 0E07D8 7F0ABCA8 2419FFFF */ li $t9, -1 -/* 0E07DC 7F0ABCAC 24080001 */ li $t0, 1 -/* 0E07E0 7F0ABCB0 AFA80014 */ sw $t0, 0x14($sp) -/* 0E07E4 7F0ABCB4 AFB90010 */ sw $t9, 0x10($sp) -/* 0E07E8 7F0ABCB8 02402025 */ move $a0, $s2 -/* 0E07EC 7F0ABCBC 24050040 */ li $a1, 64 -/* 0E07F0 7F0ABCC0 02003025 */ move $a2, $s0 -/* 0E07F4 7F0ABCC4 00403825 */ move $a3, $v0 -/* 0E07F8 7F0ABCC8 AFB70018 */ sw $s7, 0x18($sp) -/* 0E07FC 7F0ABCCC AFA0001C */ sw $zero, 0x1c($sp) -/* 0E0800 7F0ABCD0 AFA00020 */ sw $zero, 0x20($sp) -/* 0E0804 7F0ABCD4 AFB40024 */ sw $s4, 0x24($sp) -/* 0E0808 7F0ABCD8 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0E080C 7F0ABCDC AFA00028 */ sw $zero, 0x28($sp) -/* 0E0810 7F0ABCE0 00402025 */ move $a0, $v0 -/* 0E0814 7F0ABCE4 02002825 */ move $a1, $s0 -/* 0E0818 7F0ABCE8 02203025 */ move $a2, $s1 -/* 0E081C 7F0ABCEC 0FC2AE42 */ jal sub_GAME_7F0AB908 -/* 0E0820 7F0ABCF0 24070002 */ li $a3, 2 -/* 0E0824 7F0ABCF4 10000030 */ b .L7F0ABDB8 -/* 0E0828 7F0ABCF8 00409025 */ move $s2, $v0 -.L7F0ABCFC: -/* 0E082C 7F0ABCFC 0FC30776 */ jal get_textptr_for_textID -/* 0E0830 7F0ABD00 96640000 */ lhu $a0, ($s3) -/* 0E0834 7F0ABD04 3C09A0FF */ lui $t1, (0xA0FFA0F0 >> 16) # lui $t1, 0xa0ff -/* 0E0838 7F0ABD08 3529A0F0 */ ori $t1, (0xA0FFA0F0 & 0xFFFF) # ori $t1, $t1, 0xa0f0 -/* 0E083C 7F0ABD0C 240AFFFF */ li $t2, -1 -/* 0E0840 7F0ABD10 AFAA0018 */ sw $t2, 0x18($sp) -/* 0E0844 7F0ABD14 AFA90010 */ sw $t1, 0x10($sp) -/* 0E0848 7F0ABD18 02402025 */ move $a0, $s2 -/* 0E084C 7F0ABD1C 24050040 */ li $a1, 64 -/* 0E0850 7F0ABD20 02003025 */ move $a2, $s0 -/* 0E0854 7F0ABD24 00403825 */ move $a3, $v0 -/* 0E0858 7F0ABD28 AFA00014 */ sw $zero, 0x14($sp) -/* 0E085C 7F0ABD2C AFA0001C */ sw $zero, 0x1c($sp) -/* 0E0860 7F0ABD30 AFA00020 */ sw $zero, 0x20($sp) -/* 0E0864 7F0ABD34 AFB40024 */ sw $s4, 0x24($sp) -/* 0E0868 7F0ABD38 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0E086C 7F0ABD3C AFA00028 */ sw $zero, 0x28($sp) -/* 0E0870 7F0ABD40 00402025 */ move $a0, $v0 -/* 0E0874 7F0ABD44 02002825 */ move $a1, $s0 -/* 0E0878 7F0ABD48 02203025 */ move $a2, $s1 -/* 0E087C 7F0ABD4C 0FC2AE42 */ jal sub_GAME_7F0AB908 -/* 0E0880 7F0ABD50 24070001 */ li $a3, 1 -/* 0E0884 7F0ABD54 10000018 */ b .L7F0ABDB8 -/* 0E0888 7F0ABD58 00409025 */ move $s2, $v0 -.L7F0ABD5C: -/* 0E088C 7F0ABD5C 0FC30776 */ jal get_textptr_for_textID -/* 0E0890 7F0ABD60 96640000 */ lhu $a0, ($s3) -/* 0E0894 7F0ABD64 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff -/* 0E0898 7F0ABD68 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 -/* 0E089C 7F0ABD6C 240CFFFF */ li $t4, -1 -/* 0E08A0 7F0ABD70 AFAC0018 */ sw $t4, 0x18($sp) -/* 0E08A4 7F0ABD74 AFAB0010 */ sw $t3, 0x10($sp) -/* 0E08A8 7F0ABD78 02402025 */ move $a0, $s2 -/* 0E08AC 7F0ABD7C 24050040 */ li $a1, 64 -/* 0E08B0 7F0ABD80 02003025 */ move $a2, $s0 -/* 0E08B4 7F0ABD84 00403825 */ move $a3, $v0 -/* 0E08B8 7F0ABD88 AFA00014 */ sw $zero, 0x14($sp) -/* 0E08BC 7F0ABD8C AFA0001C */ sw $zero, 0x1c($sp) -/* 0E08C0 7F0ABD90 AFA00020 */ sw $zero, 0x20($sp) -/* 0E08C4 7F0ABD94 AFB40024 */ sw $s4, 0x24($sp) -/* 0E08C8 7F0ABD98 0FC2A4E6 */ jal sub_GAME_7F0A9398 -/* 0E08CC 7F0ABD9C AFA00028 */ sw $zero, 0x28($sp) -/* 0E08D0 7F0ABDA0 00402025 */ move $a0, $v0 -/* 0E08D4 7F0ABDA4 02002825 */ move $a1, $s0 -/* 0E08D8 7F0ABDA8 02203025 */ move $a2, $s1 -/* 0E08DC 7F0ABDAC 0FC2AE42 */ jal sub_GAME_7F0AB908 -/* 0E08E0 7F0ABDB0 00003825 */ move $a3, $zero -/* 0E08E4 7F0ABDB4 00409025 */ move $s2, $v0 -.L7F0ABDB8: -/* 0E08E8 7F0ABDB8 26310001 */ addiu $s1, $s1, 1 -/* 0E08EC 7F0ABDBC 2673000C */ addiu $s3, $s3, 0xc -/* 0E08F0 7F0ABDC0 163EFFB0 */ bne $s1, $fp, .L7F0ABC84 -/* 0E08F4 7F0ABDC4 2610000F */ addiu $s0, $s0, 0xf -/* 0E08F8 7F0ABDC8 8FBF005C */ lw $ra, 0x5c($sp) -/* 0E08FC 7F0ABDCC 02401025 */ move $v0, $s2 -/* 0E0900 7F0ABDD0 8FB20040 */ lw $s2, 0x40($sp) -/* 0E0904 7F0ABDD4 8FB00038 */ lw $s0, 0x38($sp) -/* 0E0908 7F0ABDD8 8FB1003C */ lw $s1, 0x3c($sp) -/* 0E090C 7F0ABDDC 8FB30044 */ lw $s3, 0x44($sp) -/* 0E0910 7F0ABDE0 8FB40048 */ lw $s4, 0x48($sp) -/* 0E0914 7F0ABDE4 8FB5004C */ lw $s5, 0x4c($sp) -/* 0E0918 7F0ABDE8 8FB60050 */ lw $s6, 0x50($sp) -/* 0E091C 7F0ABDEC 8FB70054 */ lw $s7, 0x54($sp) -/* 0E0920 7F0ABDF0 8FBE0058 */ lw $fp, 0x58($sp) -/* 0E0924 7F0ABDF4 03E00008 */ jr $ra -/* 0E0928 7F0ABDF8 27BD0060 */ addiu $sp, $sp, 0x60 -) -#endif - - - #ifdef NONMATCHING @@ -10486,7 +9132,7 @@ glabel sub_GAME_7F0ABDFC /* 0E092C 7F0ABDFC 27BDFFA0 */ addiu $sp, $sp, -0x60 /* 0E0930 7F0ABE00 AFBF003C */ sw $ra, 0x3c($sp) /* 0E0934 7F0ABE04 AFB00038 */ sw $s0, 0x38($sp) -/* 0E0938 7F0ABE08 0FC29C53 */ jal sub_GAME_7F0A714C +/* 0E0938 7F0ABE08 0FC29C53 */ jal draw_background_health_and_armor /* 0E093C 7F0ABE0C 00003025 */ move $a2, $zero /* 0E0940 7F0ABE10 0FC1F97F */ jal check_watch_page_transistion_running /* 0E0944 7F0ABE14 00408025 */ move $s0, $v0 @@ -10508,8 +9154,8 @@ glabel sub_GAME_7F0ABDFC /* 0E0984 7F0ABE54 00408025 */ move $s0, $v0 /* 0E0988 7F0ABE58 0FC30776 */ jal get_textptr_for_textID /* 0E098C 7F0ABE5C 3404AC35 */ li $a0, 44085 -/* 0E0990 7F0ABE60 3C088004 */ lui $t0, %hi(D_8004099C) -/* 0E0994 7F0ABE64 8D08099C */ lw $t0, %lo(D_8004099C)($t0) +/* 0E0990 7F0ABE60 3C088004 */ lui $t0, %hi(game_options_index) +/* 0E0994 7F0ABE64 8D08099C */ lw $t0, %lo(game_options_index)($t0) /* 0E0998 7F0ABE68 24180040 */ li $t8, 64 /* 0E099C 7F0ABE6C 24190025 */ li $t9, 37 /* 0E09A0 7F0ABE70 3C0300FF */ lui $v1, (0x00FF00B0 >> 16) # lui $v1, 0xff @@ -10541,8 +9187,8 @@ glabel sub_GAME_7F0ABDFC /* 0E0A00 7F0ABED0 8FA3005C */ lw $v1, 0x5c($sp) /* 0E0A04 7F0ABED4 8FA70058 */ lw $a3, 0x58($sp) /* 0E0A08 7F0ABED8 1160001C */ beqz $t3, .L7F0ABF4C -/* 0E0A0C 7F0ABEDC 3C0C8004 */ lui $t4, %hi(D_8004099C) -/* 0E0A10 7F0ABEE0 8D8C099C */ lw $t4, %lo(D_8004099C)($t4) +/* 0E0A0C 7F0ABEDC 3C0C8004 */ lui $t4, %hi(game_options_index) +/* 0E0A10 7F0ABEE0 8D8C099C */ lw $t4, %lo(game_options_index)($t4) /* 0E0A14 7F0ABEE4 02002025 */ move $a0, $s0 /* 0E0A18 7F0ABEE8 27A50054 */ addiu $a1, $sp, 0x54 /* 0E0A1C 7F0ABEEC 15800017 */ bnez $t4, .L7F0ABF4C @@ -10594,8 +9240,8 @@ glabel sub_GAME_7F0ABDFC /* 0E0ACC 7F0ABF9C 3404AC36 */ li $a0, 44086 /* 0E0AD0 7F0ABFA0 0FC30776 */ jal get_textptr_for_textID /* 0E0AD4 7F0ABFA4 AFA3005C */ sw $v1, 0x5c($sp) -/* 0E0AD8 7F0ABFA8 3C0F8004 */ lui $t7, %hi(D_8004099C) -/* 0E0ADC 7F0ABFAC 8DEF099C */ lw $t7, %lo(D_8004099C)($t7) +/* 0E0AD8 7F0ABFA8 3C0F8004 */ lui $t7, %hi(game_options_index) +/* 0E0ADC 7F0ABFAC 8DEF099C */ lw $t7, %lo(game_options_index)($t7) /* 0E0AE0 7F0ABFB0 240D0040 */ li $t5, 64 /* 0E0AE4 7F0ABFB4 240E003B */ li $t6, 59 /* 0E0AE8 7F0ABFB8 24010001 */ li $at, 1 @@ -10627,8 +9273,8 @@ glabel sub_GAME_7F0ABDFC /* 0E0B48 7F0AC018 8FA3005C */ lw $v1, 0x5c($sp) /* 0E0B4C 7F0AC01C 8FA70058 */ lw $a3, 0x58($sp) /* 0E0B50 7F0AC020 11000019 */ beqz $t0, .L7F0AC088 -/* 0E0B54 7F0AC024 3C098004 */ lui $t1, %hi(D_8004099C) -/* 0E0B58 7F0AC028 8D29099C */ lw $t1, %lo(D_8004099C)($t1) +/* 0E0B54 7F0AC024 3C098004 */ lui $t1, %hi(game_options_index) +/* 0E0B58 7F0AC028 8D29099C */ lw $t1, %lo(game_options_index)($t1) /* 0E0B5C 7F0AC02C 24010001 */ li $at, 1 /* 0E0B60 7F0AC030 02002025 */ move $a0, $s0 /* 0E0B64 7F0AC034 15210014 */ bne $t1, $at, .L7F0AC088 @@ -10670,7 +9316,7 @@ glabel sub_GAME_7F0ABDFC /* 0E0BF0 7F0AC0C0 AFA90020 */ sw $t1, 0x20($sp) /* 0E0BF4 7F0AC0C4 00408025 */ move $s0, $v0 .L7F0AC0C8: -/* 0E0BF8 7F0AC0C8 0FC2AF07 */ jal sub_GAME_7F0ABC1C +/* 0E0BF8 7F0AC0C8 0FC2AF07 */ jal draw_toggle_options /* 0E0BFC 7F0AC0CC 02002025 */ move $a0, $s0 /* 0E0C00 7F0AC0D0 00408025 */ move $s0, $v0 /* 0E0C04 7F0AC0D4 8FBF003C */ lw $ra, 0x3c($sp) @@ -10759,6 +9405,32 @@ void sub_GAME_7F0AC168(void) { } #else +//D:80057FC0 +const u32 D_80057FC0[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +//D:80058440 +const char D_80058440[] = " \n"; +//D:80058444 +const char D_80058444[] = " \n\n"; +//D:80058448 +const char aC_2[] = "%c: "; +//D:80058450 +const char D_80058450[] = " \n"; +//D:80058454 +const char D_80058454[] = " \n\n"; GLOBAL_ASM( .late_rodata /*D:80058570*/ @@ -10782,7 +9454,7 @@ glabel sub_GAME_7F0AC168 /* 0E0CB8 7F0AC188 AFB20040 */ sw $s2, 0x40($sp) /* 0E0CBC 7F0AC18C AFB1003C */ sw $s1, 0x3c($sp) /* 0E0CC0 7F0AC190 AFB00038 */ sw $s0, 0x38($sp) -/* 0E0CC4 7F0AC194 0FC29C53 */ jal sub_GAME_7F0A714C +/* 0E0CC4 7F0AC194 0FC29C53 */ jal draw_background_health_and_armor /* 0E0CC8 7F0AC198 00003025 */ move $a2, $zero /* 0E0CCC 7F0AC19C 0FC1F97F */ jal check_watch_page_transistion_running /* 0E0CD0 7F0AC1A0 AFA20DE8 */ sw $v0, 0xde8($sp) @@ -10910,8 +9582,8 @@ glabel sub_GAME_7F0AC168 /* 0E0EA8 7F0AC378 AFAD001C */ sw $t5, 0x1c($sp) /* 0E0EAC 7F0AC37C 0FC2B6AF */ jal en_text_write_stuff /* 0E0EB0 7F0AC380 AFAC0020 */ sw $t4, 0x20($sp) -/* 0E0EB4 7F0AC384 3C0F8004 */ lui $t7, %hi(D_800409A0) -/* 0E0EB8 7F0AC388 8DEF09A0 */ lw $t7, %lo(D_800409A0)($t7) +/* 0E0EB4 7F0AC384 3C0F8004 */ lui $t7, %hi(mission_brief_index) +/* 0E0EB8 7F0AC388 8DEF09A0 */ lw $t7, %lo(mission_brief_index)($t7) /* 0E0EBC 7F0AC38C 24030041 */ li $v1, 65 /* 0E0EC0 7F0AC390 AFA20DE8 */ sw $v0, 0xde8($sp) /* 0E0EC4 7F0AC394 2DE10005 */ sltiu $at, $t7, 5 @@ -10938,7 +9610,7 @@ glabel sub_GAME_7F0AC168 /* 0E0F14 7F0AC3E4 8FA70D48 */ lw $a3, 0xd48($sp) /* 0E0F18 7F0AC3E8 0FC2BAD9 */ jal sub_GAME_7F0AEB64 /* 0E0F1C 7F0AC3EC AFAE0010 */ sw $t6, 0x10($sp) -/* 0E0F20 7F0AC3F0 0FC29986 */ jal sub_GAME_7F0A6618 +/* 0E0F20 7F0AC3F0 0FC29986 */ jal mission_brief_background_navigation /* 0E0F24 7F0AC3F4 00000000 */ nop /* 0E0F28 7F0AC3F8 1000013D */ b .L7F0AC8F0 /* 0E0F2C 7F0AC3FC 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -10957,7 +9629,7 @@ glabel sub_GAME_7F0AC168 /* 0E0F5C 7F0AC42C 8FA70D48 */ lw $a3, 0xd48($sp) /* 0E0F60 7F0AC430 0FC2BAD9 */ jal sub_GAME_7F0AEB64 /* 0E0F64 7F0AC434 AFAB0010 */ sw $t3, 0x10($sp) -/* 0E0F68 7F0AC438 0FC299A8 */ jal sub_GAME_7F0A66A0 +/* 0E0F68 7F0AC438 0FC299A8 */ jal mission_brief_m_briefing_navigation /* 0E0F6C 7F0AC43C 00000000 */ nop /* 0E0F70 7F0AC440 1000012B */ b .L7F0AC8F0 /* 0E0F74 7F0AC444 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -10976,7 +9648,7 @@ glabel sub_GAME_7F0AC168 /* 0E0FA4 7F0AC474 8FA70D48 */ lw $a3, 0xd48($sp) /* 0E0FA8 7F0AC478 0FC2BAD9 */ jal sub_GAME_7F0AEB64 /* 0E0FAC 7F0AC47C AFA90010 */ sw $t1, 0x10($sp) -/* 0E0FB0 7F0AC480 0FC299CB */ jal sub_GAME_7F0A672C +/* 0E0FB0 7F0AC480 0FC299CB */ jal mission_brief_q_branch_navigation /* 0E0FB4 7F0AC484 00000000 */ nop /* 0E0FB8 7F0AC488 10000119 */ b .L7F0AC8F0 /* 0E0FBC 7F0AC48C 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -10995,7 +9667,7 @@ glabel sub_GAME_7F0AC168 /* 0E0FEC 7F0AC4BC 8FA70D48 */ lw $a3, 0xd48($sp) /* 0E0FF0 7F0AC4C0 0FC2BAD9 */ jal sub_GAME_7F0AEB64 /* 0E0FF4 7F0AC4C4 AFB80010 */ sw $t8, 0x10($sp) -/* 0E0FF8 7F0AC4C8 0FC299EF */ jal sub_GAME_7F0A67BC +/* 0E0FF8 7F0AC4C8 0FC299EF */ jal mission_brief_moneypenny_navigation /* 0E0FFC 7F0AC4CC 00000000 */ nop /* 0E1000 7F0AC4D0 10000107 */ b .L7F0AC8F0 /* 0E1004 7F0AC4D4 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -11284,7 +9956,7 @@ glabel sub_GAME_7F0AC168 .L7F0AC8DC: /* 0E140C 7F0AC8DC 0FC2B2E8 */ jal setTextOverlapCorrection /* 0E1410 7F0AC8E0 2404FFFF */ li $a0, -1 -/* 0E1414 7F0AC8E4 0FC29A13 */ jal sub_GAME_7F0A684C +/* 0E1414 7F0AC8E4 0FC29A13 */ jal mission_brief_objectives_navigation /* 0E1418 7F0AC8E8 00000000 */ nop .L7F0AC8EC: /* 0E141C 7F0AC8EC 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -11376,8 +10048,48 @@ glabel sub_GAME_7F0AC168 #ifdef NONMATCHING -void sub_GAME_7F0ACA28(void) { +//TODO: Uses v0 instead of v1 +s32 sub_GAME_7F0ACA28(s32 arg0, s32 arg1, s32 arg2) +{ + sub_GAME_7F0A70AC(watch_screen_index, &pPlayer->buffer_for_watch_greenbackdrop_vertices); + + if (arg2 == 1) + { + set_BONDdata_paused_flag(0); + sub_GAME_7F0BD8FC(0); + if ((watch_screen_index != 1) && (get_controller_buttons_pressed(0, 0xA000) != 0)) + { + sub_GAME_7F0A4EF8(); + } + + switch (watch_screen_index) + { + case WATCH_INDEX_MISSION_STATUS: + arg0 = draw_watch_mission_status_page(arg0, arg1); + break; + case WATCH_INDEX_INVENTORY: + arg0 = debug_gun_watch_move_related2(arg0, arg1); + break; + case WATCH_INDEX_CONTROL_OPTIONS: + arg0 = sub_GAME_7F0AB4B8(arg0, arg1); + break; + case WATCH_INDEX_GAME_OPTIONS: + arg0 = sub_GAME_7F0ABDFC(arg0, arg1); + break; + case WATCH_INDEX_MISSION_BRIEFING: + arg0 = sub_GAME_7F0AC168(arg0, arg1); + } + } + else if (arg2 == 0) + { + + sub_GAME_7F0BD8FC(1); + set_BONDdata_paused_flag(1); + arg0 = sub_GAME_7F0A77A8(arg0, arg1); + + } + return arg0; } #else GLOBAL_ASM( @@ -11436,7 +10148,7 @@ glabel sub_GAME_7F0ACA28 /* 0E15FC 7F0ACACC 00000000 */ nop .L7F0ACAD0: /* 0E1600 7F0ACAD0 02002025 */ move $a0, $s0 -/* 0E1604 7F0ACAD4 0FC2A0C3 */ jal sub_GAME_7F0A830C +/* 0E1604 7F0ACAD4 0FC2A0C3 */ jal draw_watch_mission_status_page /* 0E1608 7F0ACAD8 8FA50024 */ lw $a1, 0x24($sp) /* 0E160C 7F0ACADC 1000001F */ b .L7F0ACB5C /* 0E1610 7F0ACAE0 00408025 */ move $s0, $v0 diff --git a/src/game/watch.h b/src/game/watch.h index 40254df8..18c011c3 100644 --- a/src/game/watch.h +++ b/src/game/watch.h @@ -2,12 +2,57 @@ #define _WATCH_H_ #include "ultra64.h" -void zero_D_80040998(); +typedef enum WATCH_INDEX { + WATCH_INDEX_MISSION_STATUS = 0, + WATCH_INDEX_INVENTORY, + WATCH_INDEX_CONTROL_OPTIONS, + WATCH_INDEX_GAME_OPTIONS, + WATCH_INDEX_MISSION_BRIEFING +} WATCH_INDEX; -void zero_D_8004099C(); +typedef enum WATCH_CONTROLLER_OPTIONS_INDEX { + CONTROLLER_OPTIONS_INDEX_STYLE = 0, + CONTROLLER_OPTIONS_INDEX_INPUTS +} WATCH_CONTROLLER_OPTIONS_INDEX; + +typedef enum WATCH_GAME_OPTIONS_INDEX { + GAME_OPTIONS_INDEX_MUSIC = 0, + GAME_OPTIONS_INDEX_FX, + GAME_OPTIONS_INDEX_LOOK_UPDOWN, + GAME_OPTIONS_INDEX_AUTO_AIM, + GAME_OPTIONS_INDEX_AIM_CONTROL, + GAME_OPTIONS_INDEX_SIGHT_ONSCREEN, + GAME_OPTIONS_INDEX_LOOK_AHEAD, + GAME_OPTIONS_INDEX_AMMO_ONSCREEN, + GAME_OPTIONS_INDEX_SCREEN_SIZE, + GAME_OPTIONS_INDEX_RATIO +} WATCH_GAME_OPTIONS_INDEX; + +typedef enum WATCH_BRIEF_INDEX { + BRIEF_INDEX_BACKGROUND = 0, + BRIEF_INDEX_M, + BRIEF_INDEX_Q, + BRIEF_INDEX_MONEYPENNY, + BRIEF_INDEX_OBJECTIVES +} WATCH_BRIEF_INDEX; + +struct game_options { + u16 text[4]; + u32 current_value; +}; + +extern struct game_options game_options_entries[]; + +void reset_controller_options_index(); + +void reset_game_options_index(); void zero_D_800409A4(); +f32 sub_GAME_7F0A6A2C(f32 arg0); + +f32 sub_GAME_7F0A95C4(f32 param_1, f32 param_2, f32 param_3); + #endif diff --git a/src/joy.c b/src/joy.c index 6f8661ad..f91974fd 100644 --- a/src/joy.c +++ b/src/joy.c @@ -1909,7 +1909,7 @@ glabel get_controller_buttons_held #ifdef NONMATCHING -s32 get_controller_buttons_pressed(s32 arg0, s32 arg1) { +s32 get_controller_buttons_pressed(s8 arg0, s32 arg1) { s32 temp_t7; void *temp_v1; diff --git a/src/joy.h b/src/joy.h index 69dfef83..09498a2d 100644 --- a/src/joy.h +++ b/src/joy.h @@ -4,6 +4,6 @@ #include "ultra64.h" void *joyInitDebugNoticeList(void); s32 get_attached_controller_count(void); -s32 get_controller_buttons_pressed(s32 arg0, s32 arg1); +s32 get_controller_buttons_pressed(s8 arg0, s32 arg1); #endif diff --git a/src/libultra/ai.c b/src/libultra/ai.c new file mode 100644 index 00000000..261fcbab --- /dev/null +++ b/src/libultra/ai.c @@ -0,0 +1,11 @@ +#include "libultra_internal.h" +#include "hardware.h" + +s32 __osAiDeviceBusy(void) { + register s32 status = HW_REG(AI_STATUS_REG, u32); + if ((status & AI_STATUS_AI_FULL) != 0) { + return 1; + } else { + return 0; + } +} diff --git a/src/libultra/ai.s b/src/libultra/ai.s deleted file mode 100644 index 792456e2..00000000 --- a/src/libultra/ai.s +++ /dev/null @@ -1,28 +0,0 @@ -# Goldeneye 007 (U) disassembly and split file -# generated by n64split v0.4a - N64 ROM splitter - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -.section .text -glabel __osAiDeviceBusy -/* 019CF0 700190F0 3C0EA450 */ lui $t6, %hi(AI_STATUS_REG) # $t6, 0xa450 -/* 019CF4 700190F4 8DC4000C */ lw $a0, %lo(AI_STATUS_REG)($t6) -/* 019CF8 700190F8 3C018000 */ lui $at, 0x8000 -/* 019CFC 700190FC 27BDFFF8 */ addiu $sp, $sp, -8 -/* 019D00 70019100 00817824 */ and $t7, $a0, $at -/* 019D04 70019104 11E00003 */ beqz $t7, .L70019114 -/* 019D08 70019108 00000000 */ nop -/* 019D0C 7001910C 10000002 */ b .L70019118 -/* 019D10 70019110 24020001 */ li $v0, 1 -.L70019114: -/* 019D14 70019114 00001025 */ move $v0, $zero -.L70019118: -/* 019D18 70019118 03E00008 */ jr $ra -/* 019D1C 7001911C 27BD0008 */ addiu $sp, $sp, 8 diff --git a/src/libultra/aigetlen.c b/src/libultra/aigetlen.c new file mode 100644 index 00000000..08458a7a --- /dev/null +++ b/src/libultra/aigetlen.c @@ -0,0 +1,7 @@ +#include "libultra_internal.h" +#include "osAi.h" +#include "hardware.h" + +u32 osAiGetLength() { + return HW_REG(AI_LEN_REG, u32); +} diff --git a/src/libultra/aigetlen.s b/src/libultra/aigetlen.s deleted file mode 100644 index f363dab5..00000000 --- a/src/libultra/aigetlen.s +++ /dev/null @@ -1,15 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osAiGetLength -/* 00FBB0 7000EFB0 3C0EA450 */ lui $t6, 0xa450 -/* 00FBB4 7000EFB4 03E00008 */ jr $ra -/* 00FBB8 7000EFB8 8DC20004 */ lw $v0, 4($t6) - diff --git a/src/libultra/aisetfreq.c b/src/libultra/aisetfreq.c new file mode 100644 index 00000000..373c1a10 --- /dev/null +++ b/src/libultra/aisetfreq.c @@ -0,0 +1,30 @@ +#include "libultra_internal.h" +#include "osAi.h" +#include "hardware.h" + +extern s32 osViClock; + +s32 osAiSetFrequency(u32 freq) { + register u32 a1; + register s32 a2; + register float ftmp; + ftmp = osViClock / (float) freq + .5f; + + a1 = ftmp; + + if (a1 < 0x84) { + return -1; + } + + a2 = (a1 / 66) & 0xff; + if (a2 > 16) { + a2 = 16; + } + + HW_REG(AI_DACRATE_REG, u32) = a1 - 1; + HW_REG(AI_BITRATE_REG, u32) = a2 - 1; + HW_REG(AI_CONTROL_REG, u32) = 1; // enable dma + return osViClock / (s32) a1; +} + + diff --git a/src/libultra/aisetfreq.s b/src/libultra/aisetfreq.s deleted file mode 100644 index bd786cc6..00000000 --- a/src/libultra/aisetfreq.s +++ /dev/null @@ -1,106 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osAiSetFrequency -/* 00F530 7000E930 3C0E8003 */ lui $t6, %hi(osViClock)#%hi(osViClock) -/* 00F534 7000E934 8DCE804C */ lw $t6, %lo(osViClock)($t6)#%lo(osViClock)($t6) -/* 00F538 7000E938 44844000 */ mtc1 $a0, $f8 -/* 00F53C 7000E93C 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 00F540 7000E940 448E2000 */ mtc1 $t6, $f4 -/* 00F544 7000E944 468042A0 */ cvt.s.w $f10, $f8 -/* 00F548 7000E948 04810005 */ bgez $a0, .L7000E960 -/* 00F54C 7000E94C 468021A0 */ cvt.s.w $f6, $f4 -/* 00F550 7000E950 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 00F554 7000E954 44818000 */ mtc1 $at, $f16 -/* 00F558 7000E958 00000000 */ nop -/* 00F55C 7000E95C 46105280 */ add.s $f10, $f10, $f16 -.L7000E960: -/* 00F560 7000E960 460A3483 */ div.s $f18, $f6, $f10 -/* 00F564 7000E964 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 00F568 7000E968 44812000 */ mtc1 $at, $f4 -/* 00F56C 7000E96C 24050001 */ li $a1, 1 -/* 00F570 7000E970 46049300 */ add.s $f12, $f18, $f4 -/* 00F574 7000E974 444FF800 */ cfc1 $t7, $31 -/* 00F578 7000E978 44C5F800 */ ctc1 $a1, $31 -/* 00F57C 7000E97C 00000000 */ nop -/* 00F580 7000E980 46006224 */ cvt.w.s $f8, $f12 -/* 00F584 7000E984 4445F800 */ cfc1 $a1, $31 -/* 00F588 7000E988 00000000 */ nop -/* 00F58C 7000E98C 30A10004 */ andi $at, $a1, 4 -/* 00F590 7000E990 30A50078 */ andi $a1, $a1, 0x78 -/* 00F594 7000E994 10A00013 */ beqz $a1, .L7000E9E4 -/* 00F598 7000E998 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 00F59C 7000E99C 44814000 */ mtc1 $at, $f8 -/* 00F5A0 7000E9A0 24050001 */ li $a1, 1 -/* 00F5A4 7000E9A4 46086201 */ sub.s $f8, $f12, $f8 -/* 00F5A8 7000E9A8 44C5F800 */ ctc1 $a1, $31 -/* 00F5AC 7000E9AC 00000000 */ nop -/* 00F5B0 7000E9B0 46004224 */ cvt.w.s $f8, $f8 -/* 00F5B4 7000E9B4 4445F800 */ cfc1 $a1, $31 -/* 00F5B8 7000E9B8 00000000 */ nop -/* 00F5BC 7000E9BC 30A10004 */ andi $at, $a1, 4 -/* 00F5C0 7000E9C0 30A50078 */ andi $a1, $a1, 0x78 -/* 00F5C4 7000E9C4 14A00005 */ bnez $a1, .L7000E9DC -/* 00F5C8 7000E9C8 00000000 */ nop -/* 00F5CC 7000E9CC 44054000 */ mfc1 $a1, $f8 -/* 00F5D0 7000E9D0 3C018000 */ lui $at, 0x8000 -/* 00F5D4 7000E9D4 10000007 */ b .L7000E9F4 -/* 00F5D8 7000E9D8 00A12825 */ or $a1, $a1, $at -.L7000E9DC: -/* 00F5DC 7000E9DC 10000005 */ b .L7000E9F4 -/* 00F5E0 7000E9E0 2405FFFF */ li $a1, -1 -.L7000E9E4: -/* 00F5E4 7000E9E4 44054000 */ mfc1 $a1, $f8 -/* 00F5E8 7000E9E8 00000000 */ nop -/* 00F5EC 7000E9EC 04A0FFFB */ bltz $a1, .L7000E9DC -/* 00F5F0 7000E9F0 00000000 */ nop -.L7000E9F4: -/* 00F5F4 7000E9F4 44CFF800 */ ctc1 $t7, $31 -/* 00F5F8 7000E9F8 2CA10084 */ sltiu $at, $a1, 0x84 -/* 00F5FC 7000E9FC 10200003 */ beqz $at, .L7000EA0C -/* 00F600 7000EA00 00000000 */ nop -/* 00F604 7000EA04 10000020 */ b .L7000EA88 -/* 00F608 7000EA08 2402FFFF */ li $v0, -1 -.L7000EA0C: -/* 00F60C 7000EA0C 24010042 */ li $at, 66 -/* 00F610 7000EA10 00A1001B */ divu $zero, $a1, $at -/* 00F614 7000EA14 00003012 */ mflo $a2 -/* 00F618 7000EA18 30D800FF */ andi $t8, $a2, 0xff -/* 00F61C 7000EA1C 03003025 */ move $a2, $t8 -/* 00F620 7000EA20 28C10011 */ slti $at, $a2, 0x11 -/* 00F624 7000EA24 14200002 */ bnez $at, .L7000EA30 -/* 00F628 7000EA28 00000000 */ nop -/* 00F62C 7000EA2C 24060010 */ li $a2, 16 -.L7000EA30: -/* 00F630 7000EA30 24B9FFFF */ addiu $t9, $a1, -1 -/* 00F634 7000EA34 3C08A450 */ lui $t0, %hi(AI_DACRATE_REG) # $t0, 0xa450 -/* 00F638 7000EA38 AD190010 */ sw $t9, %lo(AI_DACRATE_REG)($t0) -/* 00F63C 7000EA3C 24C9FFFF */ addiu $t1, $a2, -1 -/* 00F640 7000EA40 3C0AA450 */ lui $t2, %hi(AI_BITRATE_REG) # $t2, 0xa450 -/* 00F644 7000EA44 AD490014 */ sw $t1, %lo(AI_BITRATE_REG)($t2) -/* 00F648 7000EA48 240B0001 */ li $t3, 1 -/* 00F64C 7000EA4C 3C0CA450 */ lui $t4, %hi(AI_CONTROL_REG) # $t4, 0xa450 -/* 00F650 7000EA50 AD8B0008 */ sw $t3, %lo(AI_CONTROL_REG)($t4) -/* 00F654 7000EA54 3C0D8003 */ lui $t5, %hi(osViClock) #osViClock -/* 00F658 7000EA58 8DAD804C */ lw $t5, %lo(osViClock)($t5) #osViClock -/* 00F65C 7000EA5C 01A5001A */ div $zero, $t5, $a1 -/* 00F660 7000EA60 00001012 */ mflo $v0 -/* 00F664 7000EA64 14A00002 */ bnez $a1, .L7000EA70 -/* 00F668 7000EA68 00000000 */ nop -/* 00F66C 7000EA6C 0007000D */ break 7 -.L7000EA70: -/* 00F670 7000EA70 2401FFFF */ li $at, -1 -/* 00F674 7000EA74 14A10004 */ bne $a1, $at, .L7000EA88 -/* 00F678 7000EA78 3C018000 */ lui $at, 0x8000 -/* 00F67C 7000EA7C 15A10002 */ bne $t5, $at, .L7000EA88 -/* 00F680 7000EA80 00000000 */ nop -/* 00F684 7000EA84 0006000D */ break 6 -.L7000EA88: -/* 00F688 7000EA88 03E00008 */ jr $ra -/* 00F68C 7000EA8C 27BD0010 */ addiu $sp, $sp, 0x10 diff --git a/src/libultra/aisetnextbuf.c b/src/libultra/aisetnextbuf.c new file mode 100644 index 00000000..cc27ae4c --- /dev/null +++ b/src/libultra/aisetnextbuf.c @@ -0,0 +1,40 @@ +#include "libultra_internal.h" +#include "osAi.h" +#include "hardware.h" + +u8 D_80334820 = 0; + +/** + * It is worth noting that a previous hardware bug has been fixed by a software + * patch in osAiSetNextBuffer. This bug occurred when the address of the end of the + * buffer specified by osAiSetNextBuffer was at a specific value. This value + * occurred when the following was true: + * + * (vaddr + nbytes) & 0x00003FFF == 0x00002000 + * + * (when the buffer ends with address of lower 14 bits 0x2000) In this case, the + * DMA transfer does not complete successfully. This can cause clicks and pops in + * the audio output. This bug no longer requires special handling by the application + * because it is now patched by osAiSetNextBuffer. + */ + +s32 osAiSetNextBuffer(void *buff, u32 len) { + u8 *sp1c = buff; + if (D_80334820 != 0) { + sp1c -= 0x2000; + } + + if ((((uintptr_t) buff + len) & 0x3fff) == 0x2000) { + D_80334820 = 1; + } else { + D_80334820 = 0; + } + + if (__osAiDeviceBusy()) { + return -1; + } + + HW_REG(AI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(sp1c); + HW_REG(AI_LEN_REG, u32) = len; + return 0; +} diff --git a/src/libultra/aisetnextbuf.s b/src/libultra/aisetnextbuf.s deleted file mode 100644 index 53492e4f..00000000 --- a/src/libultra/aisetnextbuf.s +++ /dev/null @@ -1,63 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osAiSetNextBuffer -/* 00FB00 7000EF00 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 00FB04 7000EF04 3C0F8002 */ lui $t7, %hi(B_800276F0) -/* 00FB08 7000EF08 91EF76F0 */ lbu $t7, %lo(B_800276F0)($t7) -/* 00FB0C 7000EF0C AFA40020 */ sw $a0, 0x20($sp) -/* 00FB10 7000EF10 8FAE0020 */ lw $t6, 0x20($sp) -/* 00FB14 7000EF14 AFBF0014 */ sw $ra, 0x14($sp) -/* 00FB18 7000EF18 AFA50024 */ sw $a1, 0x24($sp) -/* 00FB1C 7000EF1C 11E00003 */ beqz $t7, .L7000EF2C -/* 00FB20 7000EF20 AFAE001C */ sw $t6, 0x1c($sp) -/* 00FB24 7000EF24 25D8E000 */ addiu $t8, $t6, -0x2000 -/* 00FB28 7000EF28 AFB8001C */ sw $t8, 0x1c($sp) -.L7000EF2C: -/* 00FB2C 7000EF2C 8FB90020 */ lw $t9, 0x20($sp) -/* 00FB30 7000EF30 8FA80024 */ lw $t0, 0x24($sp) -/* 00FB34 7000EF34 24012000 */ li $at, 8192 -/* 00FB38 7000EF38 03284821 */ addu $t1, $t9, $t0 -/* 00FB3C 7000EF3C 312A3FFF */ andi $t2, $t1, 0x3fff -/* 00FB40 7000EF40 15410005 */ bne $t2, $at, .L7000EF58 -/* 00FB44 7000EF44 00000000 */ nop -/* 00FB48 7000EF48 240B0001 */ li $t3, 1 -/* 00FB4C 7000EF4C 3C018002 */ lui $at, %hi(B_800276F0) -/* 00FB50 7000EF50 10000003 */ b .L7000EF60 -/* 00FB54 7000EF54 A02B76F0 */ sb $t3, %lo(B_800276F0)($at) -.L7000EF58: -/* 00FB58 7000EF58 3C018002 */ lui $at, %hi(B_800276F0) -/* 00FB5C 7000EF5C A02076F0 */ sb $zero, %lo(B_800276F0)($at) -.L7000EF60: -/* 00FB60 7000EF60 0C00643C */ jal __osAiDeviceBusy -/* 00FB64 7000EF64 00000000 */ nop -/* 00FB68 7000EF68 10400003 */ beqz $v0, .L7000EF78 -/* 00FB6C 7000EF6C 00000000 */ nop -/* 00FB70 7000EF70 10000009 */ b .L7000EF98 -/* 00FB74 7000EF74 2402FFFF */ li $v0, -1 -.L7000EF78: -/* 00FB78 7000EF78 0C003A2C */ jal osVirtualToPhysical -/* 00FB7C 7000EF7C 8FA4001C */ lw $a0, 0x1c($sp) -/* 00FB80 7000EF80 3C0CA450 */ lui $t4, 0xa450 -/* 00FB84 7000EF84 AD820000 */ sw $v0, ($t4) -/* 00FB88 7000EF88 8FAD0024 */ lw $t5, 0x24($sp) -/* 00FB8C 7000EF8C 3C0FA450 */ lui $t7, %hi(AI_LEN_REG) # $t7, 0xa450 -/* 00FB90 7000EF90 00001025 */ move $v0, $zero -/* 00FB94 7000EF94 ADED0004 */ sw $t5, %lo(AI_LEN_REG)($t7) -.L7000EF98: -/* 00FB98 7000EF98 8FBF0014 */ lw $ra, 0x14($sp) -/* 00FB9C 7000EF9C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 00FBA0 7000EFA0 03E00008 */ jr $ra -/* 00FBA4 7000EFA4 00000000 */ nop - -/* 00FBA8 7000EFA8 00000000 */ nop -/* 00FBAC 7000EFAC 00000000 */ nop -.section .data -glabel B_800276F0 -.byte 0 diff --git a/src/libultra/bstring.h b/src/libultra/bstring.h new file mode 100644 index 00000000..01486d99 --- /dev/null +++ b/src/libultra/bstring.h @@ -0,0 +1,36 @@ +#ifndef __BSTRING_H__ +#define __BSTRING_H__ +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bstring(3C) -- byte string operations + * + * Copyright 1990, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; + * the contents of this file may not be disclosed to third parties, copied or + * duplicated in any form, in whole or in part, without the prior written + * permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to restrictions + * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data + * and Computer Software clause at DFARS 252.227-7013, and/or in similar or + * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - + * rights reserved under the Copyright Laws of the United States. + */ + +#ident "$Revision: 1.4 $" + +extern void bcopy(const void *, void *, size_t); +extern int bcmp(const void *, const void *, int); +extern void bzero(void *, size_t); +extern void blkclr(void *, int); + +#ifdef __cplusplus +} +#endif +#endif /* !__BSTRING_H__ */ diff --git a/src/libultra/controller.h b/src/libultra/controller.h new file mode 100644 index 00000000..3956dff3 --- /dev/null +++ b/src/libultra/controller.h @@ -0,0 +1,208 @@ +#ifndef _CONTROLLER_H +#define _CONTROLLER_H +#include "PR/os_internal.h" +#include "os.h" +#include "PR/rcp.h" + +//should go somewhere else but +#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0]))) +#define CHNL_ERR(format) ((format.rxsize & CHNL_ERR_MASK) >> 4) + +typedef struct +{ + /* 0x0 */ u32 ramarray[15]; + /* 0x3C */ u32 pifstatus; +} OSPifRam; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u16 button; + /* 0x6 */ s8 stick_x; + /* 0x7 */ s8 stick_y; +} __OSContReadFormat; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u8 typeh; + /* 0x5 */ u8 typel; + /* 0x6 */ u8 status; + /* 0x7 */ u8 dummy1; +} __OSContRequesFormat; + +typedef struct +{ + /* 0x0 */ u8 txsize; + /* 0x1 */ u8 rxsize; + /* 0x2 */ u8 cmd; + /* 0x3 */ u8 typeh; + /* 0x4 */ u8 typel; + /* 0x5 */ u8 status; +} __OSContRequesFormatShort; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u16 address; + /* 0x6 */ u8 data[BLOCKSIZE]; + /* 0x26 */ u8 datacrc; +} __OSContRamReadFormat; + +typedef union { + /* 0x0 */ struct + { + /* 0x0 */ u8 bank; + /* 0x1 */ u8 page; + } inode_t; + /* 0x0 */ u16 ipage; +} __OSInodeUnit; + +typedef struct +{ + /* 0x0 */ u32 game_code; + /* 0x4 */ u16 company_code; + /* 0x6 */ __OSInodeUnit start_page; + /* 0x8 */ u8 status; + /* 0x9 */ s8 reserved; + /* 0xA */ u16 data_sum; + /* 0xC */ u8 ext_name[PFS_FILE_EXT_LEN]; + /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN]; +} __OSDir; + +typedef struct +{ + /* 0x0 */ __OSInodeUnit inode_page[128]; +} __OSInode; + +typedef struct +{ + /* 0x0 */ u32 repaired; + /* 0x4 */ u32 random; + /* 0x8 */ u64 serial_mid; + /* 0x10 */ u64 serial_low; + /* 0x18 */ u16 deviceid; + /* 0x1A */ u8 banks; + /* 0x1B */ u8 version; + /* 0x1C */ u16 checksum; + /* 0x1E */ u16 inverted_checksum; +} __OSPackId; + +typedef struct +{ + /* 0x0 */ u8 txsize; + /* 0x1 */ u8 rxsize; + /* 0x2 */ u8 cmd; + /* 0x3 */ u8 address; + /* 0x4 */ u8 data[EEPROM_BLOCK_SIZE]; +} __OSContEepromFormat; + +//from: http://en64.shoutwiki.com/wiki/SI_Registers_Detailed#CONT_CMD_Usage +#define CONT_CMD_REQUEST_STATUS 0 +#define CONT_CMD_READ_BUTTON 1 +#define CONT_CMD_READ_MEMPACK 2 +#define CONT_CMD_WRITE_MEMPACK 3 +#define CONT_CMD_READ_EEPROM 4 +#define CONT_CMD_WRITE_EEPROM 5 +#define CONT_CMD_RESET 0xff + +#define CONT_CMD_REQUEST_STATUS_TX 1 +#define CONT_CMD_READ_BUTTON_TX 1 +#define CONT_CMD_READ_MEMPACK_TX 3 +#define CONT_CMD_WRITE_MEMPACK_TX 35 +#define CONT_CMD_READ_EEPROM_TX 2 +#define CONT_CMD_WRITE_EEPROM_TX 10 +#define CONT_CMD_RESET_TX 1 + +#define CONT_CMD_REQUEST_STATUS_RX 3 +#define CONT_CMD_READ_BUTTON_RX 4 +#define CONT_CMD_READ_MEMPACK_RX 33 +#define CONT_CMD_WRITE_MEMPACK_RX 1 +#define CONT_CMD_READ_EEPROM_RX 8 +#define CONT_CMD_WRITE_EEPROM_RX 1 +#define CONT_CMD_RESET_RX 3 + +#define CONT_CMD_NOP 0xff +#define CONT_CMD_END 0xfe //indicates end of a command +#define CONT_CMD_EXE 1 //set pif ram status byte to this to do a command + +#define DIR_STATUS_EMPTY 0 +#define DIR_STATUS_UNKNOWN 1 +#define DIR_STATUS_OCCUPIED 2 + + +typedef struct +{ + /* 0x0 */ __OSInode inode; + /* 0x100 */ u8 bank; + /* 0x101 */ u8 map[256]; +} __OSInodeCache; + +extern s32 __osEepStatus(OSMesgQueue *, OSContStatus *); +u16 __osSumcalc(u8 *ptr, int length); +s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum); +s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid); +s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp); +s32 __osGetId(OSPfs *pfs); +s32 __osCheckId(OSPfs *pfs); +s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank); +s32 __osPfsSelectBank(OSPfs *pfs); +s32 __osPfsDeclearPage(OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page); +s32 __osPfsReleasePages(OSPfs *pfs, __OSInode *inode, u8 start_page, u16 *sum, u8 bank, __OSInodeUnit *last_page, int flag); +s32 __osBlockSum(OSPfs *pfs, u8 page_no, u16 *sum, u8 bank); +s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer); +s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force); +void __osContGetInitData(u8 *pattern, OSContStatus *data); +void __osPackRequestData(u8 cmd); +void __osPfsRequestData(u8 cmd); +void __osPfsGetInitData(u8* pattern, OSContStatus* data); +u8 __osContAddressCrc(u16 addr); +u8 __osContDataCrc(u8 *data); +s32 __osPfsGetStatus(OSMesgQueue *queue, int channel); + +extern u8 __osContLastCmd; +extern OSTimer __osEepromTimer; +extern OSMesg __osEepromTimerMsg; +extern OSMesgQueue __osEepromTimerQ; +extern OSPifRam __osEepPifRam; +extern OSPifRam __osContPifRam; +extern OSPifRam __osPfsPifRam; +extern u8 _osContNumControllers; + +//some version of this almost certainly existed since there's plenty of times where it's used right before a return 0 +#define ERRCK(fn) \ + ret = fn; \ + if (ret != 0) \ + return ret; + +#define SET_ACTIVEBANK_TO_ZERO \ + if (pfs->activebank != 0) \ + { \ + pfs->activebank = 0; \ + ERRCK(__osPfsSelectBank(pfs)) \ + } + +#define PFS_CHECK_ID \ + if (__osCheckId(pfs) == PFS_ERR_NEW_PACK) \ + return PFS_ERR_NEW_PACK; +#endif + +#define PFS_CHECK_STATUS \ + if ((pfs->status & PFS_INITIALIZED) == 0) \ + return PFS_ERR_INVALID; + +#define PFS_GET_STATUS \ + __osSiGetAccess(); \ + ret = __osPfsGetStatus(queue, channel); \ + __osSiRelAccess(); \ + if (ret != 0) \ + return ret; diff --git a/src/libultra/crc.c b/src/libultra/crc.c new file mode 100644 index 00000000..c90c5deb --- /dev/null +++ b/src/libultra/crc.c @@ -0,0 +1,47 @@ +#include "libultra_internal.h" + +u8 __osContAddressCrc(u16 addr) { + u8 temp; + u8 temp2; + int i; + temp = 0; + for (i = 0; i < 16; i++) { + if (temp & 0x10) { + temp2 = 21; + } else { + temp2 = 0; + } + + temp <<= 1; + temp |= (u8)((addr & 0x400) ? 1 : 0); + addr <<= 1; + temp ^= temp2; + } + return temp & 0x1f; +} + +u8 __osContDataCrc(u8 *data) { + u8 temp; + u8 temp2; + int i; + int j; + temp = 0; + for (i = 0; i <= 32; i++, data++) { + for (j = 7; j >= 0; j--) { + if (temp & 0x80) { + temp2 = 133; + } else { + temp2 = 0; + } + temp <<= 1; + if (i == 32) { + temp &= -1; + } else { + temp |= ((*data & (1 << j)) ? 1 : 0); + } + temp ^= temp2; + } + } + return temp; +} + diff --git a/src/libultra/crc.s b/src/libultra/crc.s deleted file mode 100644 index 0efbad2b..00000000 --- a/src/libultra/crc.s +++ /dev/null @@ -1,125 +0,0 @@ -# Goldeneye 007 (U) disassembly and split file -# generated by n64split v0.4a - N64 ROM splitter - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -.section .text -glabel __osContAddressCrc -/* 016B80 70015F80 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 016B84 70015F84 3084FFFF */ andi $a0, $a0, 0xffff -/* 016B88 70015F88 A3A0000F */ sb $zero, 0xf($sp) -/* 016B8C 70015F8C AFA00008 */ sw $zero, 8($sp) -.L70015F90: -/* 016B90 70015F90 93AE000F */ lbu $t6, 0xf($sp) -/* 016B94 70015F94 31CF0010 */ andi $t7, $t6, 0x10 -/* 016B98 70015F98 11E00004 */ beqz $t7, .L70015FAC -/* 016B9C 70015F9C 00000000 */ nop -/* 016BA0 70015FA0 24180015 */ li $t8, 21 -/* 016BA4 70015FA4 10000002 */ b .L70015FB0 -/* 016BA8 70015FA8 A3B8000E */ sb $t8, 0xe($sp) -.L70015FAC: -/* 016BAC 70015FAC A3A0000E */ sb $zero, 0xe($sp) -.L70015FB0: -/* 016BB0 70015FB0 93B9000F */ lbu $t9, 0xf($sp) -/* 016BB4 70015FB4 30890400 */ andi $t1, $a0, 0x400 -/* 016BB8 70015FB8 00194040 */ sll $t0, $t9, 1 -/* 016BBC 70015FBC 11200003 */ beqz $t1, .L70015FCC -/* 016BC0 70015FC0 A3A8000F */ sb $t0, 0xf($sp) -/* 016BC4 70015FC4 10000002 */ b .L70015FD0 -/* 016BC8 70015FC8 24050001 */ li $a1, 1 -.L70015FCC: -/* 016BCC 70015FCC 00002825 */ move $a1, $zero -.L70015FD0: -/* 016BD0 70015FD0 93AA000F */ lbu $t2, 0xf($sp) -/* 016BD4 70015FD4 8FA80008 */ lw $t0, 8($sp) -/* 016BD8 70015FD8 93AF000E */ lbu $t7, 0xe($sp) -/* 016BDC 70015FDC 30AB00FF */ andi $t3, $a1, 0xff -/* 016BE0 70015FE0 00046840 */ sll $t5, $a0, 1 -/* 016BE4 70015FE4 014B6025 */ or $t4, $t2, $t3 -/* 016BE8 70015FE8 01A02025 */ move $a0, $t5 -/* 016BEC 70015FEC 319800FF */ andi $t8, $t4, 0xff -/* 016BF0 70015FF0 25090001 */ addiu $t1, $t0, 1 -/* 016BF4 70015FF4 29210010 */ slti $at, $t1, 0x10 -/* 016BF8 70015FF8 A3AC000F */ sb $t4, 0xf($sp) -/* 016BFC 70015FFC 308EFFFF */ andi $t6, $a0, 0xffff -/* 016C00 70016000 030FC826 */ xor $t9, $t8, $t7 -/* 016C04 70016004 AFA90008 */ sw $t1, 8($sp) -/* 016C08 70016008 01C02025 */ move $a0, $t6 -/* 016C0C 7001600C 1420FFE0 */ bnez $at, .L70015F90 -/* 016C10 70016010 A3B9000F */ sb $t9, 0xf($sp) -/* 016C14 70016014 93A2000F */ lbu $v0, 0xf($sp) -/* 016C18 70016018 27BD0010 */ addiu $sp, $sp, 0x10 -/* 016C1C 7001601C 304A001F */ andi $t2, $v0, 0x1f -/* 016C20 70016020 01401025 */ move $v0, $t2 -/* 016C24 70016024 304B00FF */ andi $t3, $v0, 0xff -/* 016C28 70016028 03E00008 */ jr $ra -/* 016C2C 7001602C 01601025 */ move $v0, $t3 - -glabel __osContDataCrc -/* 016C30 70016030 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 016C34 70016034 A3A0000F */ sb $zero, 0xf($sp) -/* 016C38 70016038 AFA00008 */ sw $zero, 8($sp) -.L7001603C: -/* 016C3C 7001603C 240E0007 */ li $t6, 7 -/* 016C40 70016040 AFAE0004 */ sw $t6, 4($sp) -.L70016044: -/* 016C44 70016044 93AF000F */ lbu $t7, 0xf($sp) -/* 016C48 70016048 31F80080 */ andi $t8, $t7, 0x80 -/* 016C4C 7001604C 13000004 */ beqz $t8, .L70016060 -/* 016C50 70016050 00000000 */ nop -/* 016C54 70016054 24190085 */ li $t9, 133 -/* 016C58 70016058 10000002 */ b .L70016064 -/* 016C5C 7001605C A3B9000E */ sb $t9, 0xe($sp) -.L70016060: -/* 016C60 70016060 A3A0000E */ sb $zero, 0xe($sp) -.L70016064: -/* 016C64 70016064 93A8000F */ lbu $t0, 0xf($sp) -/* 016C68 70016068 8FAA0008 */ lw $t2, 8($sp) -/* 016C6C 7001606C 24010020 */ li $at, 32 -/* 016C70 70016070 00084840 */ sll $t1, $t0, 1 -/* 016C74 70016074 15410004 */ bne $t2, $at, .L70016088 -/* 016C78 70016078 A3A9000F */ sb $t1, 0xf($sp) -/* 016C7C 7001607C 312B00FF */ andi $t3, $t1, 0xff -/* 016C80 70016080 1000000E */ b .L700160BC -/* 016C84 70016084 A3AB000F */ sb $t3, 0xf($sp) -.L70016088: -/* 016C88 70016088 8FAD0004 */ lw $t5, 4($sp) -/* 016C8C 7001608C 908C0000 */ lbu $t4, ($a0) -/* 016C90 70016090 240E0001 */ li $t6, 1 -/* 016C94 70016094 01AE7804 */ sllv $t7, $t6, $t5 -/* 016C98 70016098 018FC024 */ and $t8, $t4, $t7 -/* 016C9C 7001609C 13000003 */ beqz $t8, .L700160AC -/* 016CA0 700160A0 00000000 */ nop -/* 016CA4 700160A4 10000002 */ b .L700160B0 -/* 016CA8 700160A8 24050001 */ li $a1, 1 -.L700160AC: -/* 016CAC 700160AC 00002825 */ move $a1, $zero -.L700160B0: -/* 016CB0 700160B0 93B9000F */ lbu $t9, 0xf($sp) -/* 016CB4 700160B4 03254025 */ or $t0, $t9, $a1 -/* 016CB8 700160B8 A3A8000F */ sb $t0, 0xf($sp) -.L700160BC: -/* 016CBC 700160BC 8FAE0004 */ lw $t6, 4($sp) -/* 016CC0 700160C0 93AA000F */ lbu $t2, 0xf($sp) -/* 016CC4 700160C4 93A9000E */ lbu $t1, 0xe($sp) -/* 016CC8 700160C8 25CDFFFF */ addiu $t5, $t6, -1 -/* 016CCC 700160CC AFAD0004 */ sw $t5, 4($sp) -/* 016CD0 700160D0 01495826 */ xor $t3, $t2, $t1 -/* 016CD4 700160D4 05A1FFDB */ bgez $t5, .L70016044 -/* 016CD8 700160D8 A3AB000F */ sb $t3, 0xf($sp) -/* 016CDC 700160DC 8FAC0008 */ lw $t4, 8($sp) -/* 016CE0 700160E0 24840001 */ addiu $a0, $a0, 1 -/* 016CE4 700160E4 258F0001 */ addiu $t7, $t4, 1 -/* 016CE8 700160E8 29E10021 */ slti $at, $t7, 0x21 -/* 016CEC 700160EC 1420FFD3 */ bnez $at, .L7001603C -/* 016CF0 700160F0 AFAF0008 */ sw $t7, 8($sp) -/* 016CF4 700160F4 93A2000F */ lbu $v0, 0xf($sp) -/* 016CF8 700160F8 03E00008 */ jr $ra -/* 016CFC 700160FC 27BD0010 */ addiu $sp, $sp, 0x10 diff --git a/src/libultra/getthreadpri.c b/src/libultra/getthreadpri.c new file mode 100644 index 00000000..43a0145b --- /dev/null +++ b/src/libultra/getthreadpri.c @@ -0,0 +1,8 @@ +#include "libultra_internal.h" + +OSPri osGetThreadPri(OSThread *thread) { + if (thread == NULL) { + thread = __osRunningThread; + } + return thread->priority; +} diff --git a/src/libultra/getthreadpri.s b/src/libultra/getthreadpri.s deleted file mode 100644 index bd8c5db3..00000000 --- a/src/libultra/getthreadpri.s +++ /dev/null @@ -1,24 +0,0 @@ -# Goldeneye 007 (U) disassembly and split file -# generated by n64split v0.4a - N64 ROM splitter - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -.section .text -glabel osGetThreadPri -/* 019630 70018A30 14800003 */ bnez $a0, .L70018A40 -/* 019634 70018A34 00000000 */ nop -/* 019638 70018A38 3C048002 */ lui $a0, %hi(__osRunningThread) -/* 01963C 70018A3C 8C847730 */ lw $a0, %lo(__osRunningThread)($a0) -.L70018A40: -/* 019640 70018A40 03E00008 */ jr $ra -/* 019644 70018A44 8C820004 */ lw $v0, 4($a0) - -/* 019648 70018A48 00000000 */ nop -/* 01964C 70018A4C 00000000 */ nop diff --git a/src/libultra/hardware.h b/src/libultra/hardware.h new file mode 100644 index 00000000..14848ca8 --- /dev/null +++ b/src/libultra/hardware.h @@ -0,0 +1,127 @@ +#ifndef _HARDWARE_H_ +#define _HARDWARE_H_ + +#define HW_REG(reg, type) *(volatile type *)(uintptr_t)(reg | 0xa0000000) + +#define AI_DRAM_ADDR_REG 0x04500000 +#define AI_LEN_REG 0x04500004 +#define AI_CONTROL_REG 0x04500008 +#define AI_STATUS_REG 0x0450000C +#define AI_STATUS_AI_FULL (1 << 31) +#define AI_STATUS_AI_BUSY (1 << 30) +#define AI_DACRATE_REG 0x04500010 +#define AI_BITRATE_REG 0x04500014 + +#define VI_STATUS_REG 0x04400000 +#define VI_CONTROL_REG 0x04400000 +#define VI_ORIGIN_REG 0x04400004 +#define VI_DRAM_ADDR_REG 0x04400004 +#define VI_WIDTH_REG 0x04400008 +#define VI_H_WIDTH_REG 0x04400008 +#define VI_INTR_REG 0x0440000C +#define VI_V_INTER_REG 0x0440000C +#define VI_CURRENT_REG 0x04400010 +#define VI_V_CURRENT_LINE_REG 0x04400010 +#define VI_BURST_REG 0x04400014 +#define VI_TIMING_REG 0x04400014 +#define VI_V_SYNC_REG 0x04400018 //VI vertical sync +#define VI_H_SYNC_REG 0x0440001C //VI horizontal sync +#define VI_LEAP_REG 0x04400020 //VI horizontal sync leap +#define VI_H_SYNC_LEAP_REG 0x04400020 +#define VI_H_START_REG 0x04400024 //VI horizontal video +#define VI_H_VIDEO_REG 0x04400024 +#define VI_V_START_REG 0x04400028 //VI vertical video +#define VI_V_VIDEO_REG 0x04400028 +#define VI_V_BURST_REG 0x0440002C //VI vertical burst +#define VI_X_SCALE_REG 0x04400030 //VI x-scale +#define VI_Y_SCALE_REG 0x04400034 //VI y-scale + +#define SP_IMEM_START 0x04001000 +#define SP_DMEM_START 0x04000000 + +#define SP_MEM_ADDR_REG 0x04040000 +#define SP_DRAM_ADDR_REG 0x04040004 +#define SP_RD_LEN_REG 0x04040008 +#define SP_WR_LEN_REG 0x0404000C +#define SP_STATUS_REG 0x04040010 +#define SP_PC_REG 0x04080000 + +#define PI_DRAM_ADDR_REG 0x04600000 //PI DRAM address +#define PI_CART_ADDR_REG 0x04600004 //PI pbus (cartridge) address +#define PI_RD_LEN_REG 0x04600008 //PI read length +#define PI_WR_LEN_REG 0x0460000C //PI write length +#define PI_STATUS_REG 0x04600010 //PI status +#define PI_BSD_DOM1_LAT_REG 0x04600014 //PI dom1 latency +#define PI_DOMAIN1_REG 0x04600014 +#define PI_BSD_DOM1_PWD_REG 0x04600018 //PI dom1 pulse width +#define PI_BSD_DOM1_PGS_REG 0x0460001C //PI dom1 page size +#define PI_BSD_DOM1_RLS_REG 0x04600020 //PI dom1 release +#define PI_BSD_DOM2_LAT_REG 0x04600024 //PI dom2 latency +#define PI_DOMAIN2_REG 0x04600024 +#define PI_BSD_DOM2_PWD_REG 0x04600028 //PI dom2 pulse width +#define PI_BSD_DOM2_PGS_REG 0x0460002C //PI dom2 page size +#define PI_BSD_DOM2_RLS_REG 0x04600030 //PI dom2 release + +#define PI_STATUS_BUSY 0x1 +#define PI_STATUS_IOBUSY 0x2 +#define PI_STATUS_ERROR 0x3 + +#define PI_STATUS_RESET_CONTROLLER 0x1 +#define PI_STATUS_CLEAR_INTR 0x2 + +#define SI_DRAM_ADDR_REG 0x04800000 +#define SI_PIF_ADDR_RD64B_REG 0x04800004 +#define SI_PIF_ADDR_WR64B_REG 0x04800010 +#define SI_STATUS_REG 0x04800018 + +#define SI_STATUS_DMA_BUSY 0x1 +#define SI_STATUS_IO_READ_BUSY 0x2 +#define SI_STATUS_DMA_ERROR 0x8 +#define SI_STATUS_INTERRUPT (1 << 12) + +#define MI_INIT_MODE_REG 0x04300000 +#define MI_MODE_REG MI_INIT_MODE_REG +#define MI_VERSION_REG 0x04300004 +#define MI_INTR_REG 0x04300008 +#define MI_INTR_MASK_REG 0x0430000C + +//https://github.com/LuigiBlood/64dd/wiki/Registers +#define ASIC_STATUS 0x05000508 + +#define DATA_REQUEST 0x40000000 +#define C2_TRANSFER 0x10000000 +#define BUFFER_MANAGER_ERROR 0x08000000 +#define BUFFER_MANAGER_INTERRUPT 0x04000000 +#define MECHANIC_INTERRUPT 0x02000000 +#define DISK_PRESENT 0x01000000 +#define BUSY_STATE 0x00800000 +#define RESET_STATE 0x00400000 +#define MOTOR_NOT_SPINNING 0x00100000 +#define HEAD_RETRACTED 0x00080000 +#define WRITE_PROTECT_ERROR 0x00040000 +#define MECHANIC_ERROR 0x00020000 +#define DISK_CHANGE 0x00010000 + +#define _64DD_PRESENT_MASK 0xFFFF + + +//ro +#define ASIC_BM_STATUS 0x05000510 + +#define MICRO_STATUS 0x02000000 +#define C1_DOUBLE 0x00400000 +#define C1_SINGLE 0x00200000 + +//wo +#define ASIC_BM_CTL 0x05000510 +#define BUFFER_MANAGER_RESET 0x10000000 +#define MECHANIC_INTERRUPT_RESET 0x01000000 +/*- Start Buffer Manager (0x80000000) +- Buffer Manager Mode (0x40000000) +- BM Interrupt Mask (0x20000000) +- Buffer Manager Reset (0x10000000) +- Disable OR Check? (0x08000000) +- Disable C1 Correction (0x04000000) +- Block Transfer (0x02000000) +- Mechanic Interrupt Reset (0x01000000)*/ +#endif diff --git a/src/libultra/libaudio_internal.h b/src/libultra/libaudio_internal.h new file mode 100644 index 00000000..ea63322c --- /dev/null +++ b/src/libultra/libaudio_internal.h @@ -0,0 +1,127 @@ +#ifndef _LIBAUDIO_INTERNAL_H_ +#define _LIBAUDIO_INTERNAL_H_ +#include +#define AL_BANK_VERSION 0x4231 /* 'B1' */ + +typedef u8 ALPan; +typedef s32 ALMicroTime; + +/* Possible wavetable types */ +enum +{ + AL_ADPCM_WAVE = 0, + AL_RAW16_WAVE +}; + +typedef struct +{ + u32 start; + u32 end; + u32 count; +} ALRawLoop; + +typedef struct +{ + u32 start; + u32 end; + u32 count; + ADPCM_STATE state; +} ALADPCMloop; + +typedef struct +{ + s32 order; + s32 npredictors; + s16 book[1]; // variable size, 8-byte aligned +} ALADPCMBook; + +typedef struct +{ + ALMicroTime attackTime; + ALMicroTime decayTime; + ALMicroTime releaseTime; + u8 attackVolume; + u8 decayVolume; +} ALEnvelope; + +typedef struct +{ + u8 velocityMin; + u8 velocityMax; + u8 keyMin; + u8 keyMax; + u8 keyBase; + s8 detune; +} ALKeyMap; + +typedef struct +{ + ALADPCMloop *loop; + ALADPCMBook *book; +} ALADPCMWaveInfo; + +typedef struct +{ + ALRawLoop *loop; +} ALRAWWaveInfo; + +typedef struct ALWaveTable_s +{ + u8 *base; /* ptr to start of wave data */ + s32 len; /* length of data in bytes */ + u8 type; /* compression type */ + u8 flags; /* offset/address flags */ + union { + ALADPCMWaveInfo adpcmWave; + ALRAWWaveInfo rawWave; + } waveInfo; +} ALWaveTable; + +typedef struct ALSound_s +{ + ALEnvelope *envelope; + ALKeyMap *keyMap; + ALWaveTable *wavetable; /* offset to wavetable struct */ + ALPan samplePan; + u8 sampleVolume; + u8 flags; +} ALSound; + +typedef struct +{ + u8 volume; /* overall volume for this instrument */ + ALPan pan; /* 0 = hard left, 127 = hard right */ + u8 priority; /* voice priority for this instrument */ + u8 flags; + u8 tremType; /* the type of tremelo osc. to use */ + u8 tremRate; /* the rate of the tremelo osc. */ + u8 tremDepth; /* the depth of the tremelo osc */ + u8 tremDelay; /* the delay for the tremelo osc */ + u8 vibType; /* the type of tremelo osc. to use */ + u8 vibRate; /* the rate of the tremelo osc. */ + u8 vibDepth; /* the depth of the tremelo osc */ + u8 vibDelay; /* the delay for the tremelo osc */ + s16 bendRange; /* pitch bend range in cents */ + s16 soundCount; /* number of sounds in this array */ + ALSound *soundArray[1]; +} ALInstrument; + +typedef struct ALBank_s +{ + s16 instCount; /* number of programs in this bank */ + u8 flags; + u8 pad; + s32 sampleRate; /* e.g. 44100, 22050, etc... */ + ALInstrument *percussion; /* default percussion for GM */ + ALInstrument *instArray[1]; /* ARRAY of instruments */ +} ALBank; + +typedef struct +{ /* Note: sizeof won't be correct */ + s16 revision; /* format revision of this file */ + s16 bankCount; /* number of banks */ + ALBank *bankArray[1]; /* ARRAY of bank offsets */ +} ALBankFile; + +void alBnkfNew(ALBankFile *f, u8 *table); +#endif diff --git a/src/libultra/libultra_internal.h b/src/libultra/libultra_internal.h new file mode 100644 index 00000000..5bb434db --- /dev/null +++ b/src/libultra/libultra_internal.h @@ -0,0 +1,99 @@ +#ifndef _LIBULTRA_INTERNAL_H_ +#define _LIBULTRA_INTERNAL_H_ +#include + +/* + * This define is needed because the original definitions in __osDequeueThread.c are declared + * seperately instead of part of a single struct, however some code alises over this memory + * assuming a unified structure. To fix this, we declare the full type here and then alias the + * symbol names to the correct members in AVOID_UB. + */ +#ifdef AVOID_UB +typedef struct OSThread_ListHead_s +{ + /*0x00*/ struct OSThread_s *next; + /*0x04*/ OSPri priority; + /*0x08*/ struct OSThread_s *queue; + /*0x0C*/ struct OSThread_s *tlnext; + /*0x10*/ struct OSThread_s *unk10; + /*0x14*/ u32 unk14; +} OSThread_ListHead; + +// Now fix the symbols to the new one. +extern OSThread_ListHead D_80334890_fix; + +#define D_80334890 D_80334890_fix.next +#define D_80334894 D_80334890_fix.priority +#define __osRunQueue D_80334890_fix.queue +#define D_8033489C D_80334890_fix.tlnext +#define D_803348A0 D_80334890_fix.unk10 + +// Fix for the EEPROM array. +extern u32 D_80365E00[16]; + +// alias the last array element correctly +#define D_80365E3C D_80365E00[15] +#else +// Original OSThread_ListHead definitions +extern OSThread *D_80334890; +extern u32 D_80334894; +extern OSThread *__osRunQueue; +extern OSThread *D_8033489C; +extern OSThread *__osRunningThread; + +// Original EEPROM definitions +extern u32 D_80365E00[15]; +extern u32 D_80365E3C; +#endif + +typedef struct { + u32 initialized; // probably something like initialized? + OSThread *mgrThread; + OSMesgQueue *cmdQueue; + OSMesgQueue *eventQueue; + OSMesgQueue *accessQueue; + s32 (*dma_func)(s32, u32, void *, size_t); +#if defined(VERSION_EU) || defined(VERSION_SH) + s32 (*edma_func)(OSPiHandle*, s32, u32, void *, size_t); +#else + u64 force_align; +#endif +} OSMgrArgs; + +s32 __osDisableInt(void); +void __osRestoreInt(s32); +void __osEnqueueAndYield(OSThread **); +void __osDequeueThread(OSThread **, OSThread *); +void __osEnqueueThread(OSThread **, OSThread *); +OSThread *__osPopThread(OSThread **); +s32 __osSiRawStartDma(s32, void *); +void __osSiCreateAccessQueue(void); +void __osSiGetAccess(void); +void __osSiRelAccess(void); +u32 __osProbeTLB(void *); +void __osPiCreateAccessQueue(void); +void __osPiGetAccess(void); +void __osSetSR(u32); +u32 __osGetSR(void); +void __osSetFpcCsr(u32); +s32 __osSiRawReadIo(void *, u32 *); +s32 __osSiRawWriteIo(void *, u32); +s32 osPiRawReadIo(u32 a0, u32 *a1); +void __osSpSetStatus(u32); +u32 __osSpGetStatus(void); +s32 __osSpSetPc(void *); +s32 __osSpDeviceBusy(void); +s32 __osSiDeviceBusy(void); +s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size); +void __osViInit(void); +OSViContext *__osViGetCurrentContext(void); +OSViContext *__osViGetCurrentContext2(void); +void __osViSwapContext(void); +void __osSetTimerIntr(u64); +u64 __osInsertTimer(OSTimer *); +void __osSetCompare(u32); +s32 __osAiDeviceBusy(void); +void __osDispatchThread(void); +u32 __osGetCause(void); +s32 __osAtomicDec(u32 *); +#endif diff --git a/src/libultra/new_func.h b/src/libultra/new_func.h new file mode 100644 index 00000000..f966f6d3 --- /dev/null +++ b/src/libultra/new_func.h @@ -0,0 +1,28 @@ +#ifndef NEW_FUNC_H +#define NEW_FUNC_H + +#include "libultra_internal.h" +#include "hardware.h" + +#define WAIT_ON_IOBUSY(var) \ + var = HW_REG(PI_STATUS_REG, u32); \ + while (var & PI_STATUS_IOBUSY) \ + var = HW_REG(PI_STATUS_REG, u32); + +extern u32 EU_D_80302090; + +extern OSPiHandle *__osDiskHandle; //possibly __osPiTable + +extern volatile u32 __OSGlobalIntMask; +s32 osEPiRawStartDma(OSPiHandle *arg0, s32 dir, u32 cart_addr, void *dram_addr, u32 size); +void func_802F4B08(void); +void func_802F4A20(void); +void __osResetGlobalIntMask(u32 mask); +void __osEPiRawWriteIo(OSPiHandle*, u32, u32); +void func_802F71F0(void); +#ifdef VERSION_SH +void __osSetGlobalIntMask(s32 arg0); +s32 __osEPiRawReadIo(OSPiHandle *arg0, u32 devAddr, u32 *arg2); +#endif + +#endif diff --git a/src/libultra/os.h b/src/libultra/os.h new file mode 100644 index 00000000..3126f481 --- /dev/null +++ b/src/libultra/os.h @@ -0,0 +1,800 @@ + +/*==================================================================== + * os.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * $Revision: 1.149 $ + * $Date: 1997/12/15 04:30:52 $ + * $Source: /disk6/Master/cvsmdev2/PR/include/os.h,v $ + * + **************************************************************************/ + + +#ifndef _OS_H_ +#define _OS_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "PR/os_message.h" + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for device manager block + */ +typedef struct { + s32 active; /* Status flag */ + OSThread *thread; /* Calling thread */ + OSMesgQueue *cmdQueue; /* Command queue */ + OSMesgQueue *evtQueue; /* Event queue */ + OSMesgQueue *acsQueue; /* Access queue */ + /* Raw DMA routine */ + s32 (*dma)(s32, u32, void *, u32); + s32 (*edma)(OSPiHandle *, s32, u32, void *, u32); +} OSDevMgr; + +/* + * Structure for file system + */ + + + +typedef struct { + int status; + OSMesgQueue *queue; + int channel; + u8 id[32]; + u8 label[32]; + int version; + int dir_size; + int inode_table; /* block location */ + int minode_table; /* mirrioring inode_table */ + int dir_table; /* block location */ + int inode_start_page; /* page # */ + u8 banks; + u8 activebank; +} OSPfs; + + +typedef struct { + u32 file_size; /* bytes */ + u32 game_code; + u16 company_code; + char ext_name[4]; + char game_name[16]; +} OSPfsState; + +/* + * Structure for Profiler + */ +typedef struct { + u16 *histo_base; /* histogram base */ + u32 histo_size; /* histogram size */ + u32 *text_start; /* start of text segment */ + u32 *text_end; /* end of text segment */ +} OSProf; + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Thread states */ + +#define OS_STATE_STOPPED 1 +#define OS_STATE_RUNNABLE 2 +#define OS_STATE_RUNNING 4 +#define OS_STATE_WAITING 8 + +/* Events */ +#ifdef _FINALROM +#define OS_NUM_EVENTS 15 +#else +#define OS_NUM_EVENTS 23 +#endif + +#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ +#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ +#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ +#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ +#define OS_EVENT_SP 4 /* SP task done interrupt */ +#define OS_EVENT_SI 5 /* SI (controller) interrupt */ +#define OS_EVENT_AI 6 /* AI interrupt */ +#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ +#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ +#define OS_EVENT_DP 9 /* DP full sync interrupt */ +#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ +#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ +#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ +#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ +#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ +#ifndef _FINALROM +#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */ +#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */ +#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */ +#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */ +#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */ +#define OS_EVENT_RDB_DBG_DONE 20 +#define OS_EVENT_RDB_FLUSH_PROF 21 +#define OS_EVENT_RDB_ACK_PROF 22 +#endif + +/* Flags for debugging purpose */ + +#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */ +#define OS_FLAG_FAULT 2 /* CPU fault has occurred */ + +/* Interrupt masks */ + +#define OS_IM_NONE 0x00000001 +#define OS_IM_SW1 0x00000501 +#define OS_IM_SW2 0x00000601 +#define OS_IM_CART 0x00000c01 +#define OS_IM_PRENMI 0x00001401 +#define OS_IM_RDBWRITE 0x00002401 +#define OS_IM_RDBREAD 0x00004401 +#define OS_IM_COUNTER 0x00008401 +#define OS_IM_CPU 0x0000ff01 +#define OS_IM_SP 0x00010401 +#define OS_IM_SI 0x00020401 +#define OS_IM_AI 0x00040401 +#define OS_IM_VI 0x00080401 +#define OS_IM_PI 0x00100401 +#define OS_IM_DP 0x00200401 +#define OS_IM_ALL 0x003fff01 +#define RCP_IMASK 0x003f0000 +#define RCP_IMASKSHIFT 16 + +/* Recommended thread priorities for the system threads */ + +#define OS_PRIORITY_MAX 255 +#define OS_PRIORITY_VIMGR 254 +#define OS_PRIORITY_RMON 250 +#define OS_PRIORITY_RMONSPIN 200 +#define OS_PRIORITY_PIMGR 150 +#define OS_PRIORITY_SIMGR 140 +#define OS_PRIORITY_APPMAX 127 +#define OS_PRIORITY_IDLE 0 /* Must be 0 */ + + +/* Flags to turn blocking on/off when sending/receiving message */ + +#define OS_MESG_NOBLOCK 0 +#define OS_MESG_BLOCK 1 + +/* Flags to indicate direction of data transfer */ + +#define OS_READ 0 /* device -> RDRAM */ +#define OS_WRITE 1 /* device <- RDRAM */ +#define OS_OTHERS 2 /* for Leo disk only */ + +/* + * I/O message types + */ +#define OS_MESG_TYPE_BASE (10) +#define OS_MESG_TYPE_LOOPBACK (OS_MESG_TYPE_BASE+0) +#define OS_MESG_TYPE_DMAREAD (OS_MESG_TYPE_BASE+1) +#define OS_MESG_TYPE_DMAWRITE (OS_MESG_TYPE_BASE+2) +#define OS_MESG_TYPE_VRETRACE (OS_MESG_TYPE_BASE+3) +#define OS_MESG_TYPE_COUNTER (OS_MESG_TYPE_BASE+4) +#define OS_MESG_TYPE_EDMAREAD (OS_MESG_TYPE_BASE+5) +#define OS_MESG_TYPE_EDMAWRITE (OS_MESG_TYPE_BASE+6) + +/* + * I/O message priority + */ +#define OS_MESG_PRI_NORMAL 0 +#define OS_MESG_PRI_HIGH 1 + +/* + * Page size argument for TLB routines + */ +#define OS_PM_4K 0x0000000 +#define OS_PM_16K 0x0006000 +#define OS_PM_64K 0x001e000 +#define OS_PM_256K 0x007e000 +#define OS_PM_1M 0x01fe000 +#define OS_PM_4M 0x07fe000 +#define OS_PM_16M 0x1ffe000 + +/* + * Stack size for I/O device managers: PIM (PI Manager), VIM (VI Manager), + * SIM (SI Manager) + * + */ +#define OS_PIM_STACKSIZE 4096 +#define OS_VIM_STACKSIZE 4096 +#define OS_SIM_STACKSIZE 4096 + +#define OS_MIN_STACKSIZE 72 + +/* + * Values for osTvType + */ +#define OS_TV_PAL 0 +#define OS_TV_NTSC 1 +#define OS_TV_MPAL 2 + +/* + * Video Interface (VI) mode type + */ +#define OS_VI_NTSC_LPN1 0 /* NTSC */ +#define OS_VI_NTSC_LPF1 1 +#define OS_VI_NTSC_LAN1 2 +#define OS_VI_NTSC_LAF1 3 +#define OS_VI_NTSC_LPN2 4 +#define OS_VI_NTSC_LPF2 5 +#define OS_VI_NTSC_LAN2 6 +#define OS_VI_NTSC_LAF2 7 +#define OS_VI_NTSC_HPN1 8 +#define OS_VI_NTSC_HPF1 9 +#define OS_VI_NTSC_HAN1 10 +#define OS_VI_NTSC_HAF1 11 +#define OS_VI_NTSC_HPN2 12 +#define OS_VI_NTSC_HPF2 13 + +#define OS_VI_PAL_LPN1 14 /* PAL */ +#define OS_VI_PAL_LPF1 15 +#define OS_VI_PAL_LAN1 16 +#define OS_VI_PAL_LAF1 17 +#define OS_VI_PAL_LPN2 18 +#define OS_VI_PAL_LPF2 19 +#define OS_VI_PAL_LAN2 20 +#define OS_VI_PAL_LAF2 21 +#define OS_VI_PAL_HPN1 22 +#define OS_VI_PAL_HPF1 23 +#define OS_VI_PAL_HAN1 24 +#define OS_VI_PAL_HAF1 25 +#define OS_VI_PAL_HPN2 26 +#define OS_VI_PAL_HPF2 27 + +#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */ +#define OS_VI_MPAL_LPF1 29 +#define OS_VI_MPAL_LAN1 30 +#define OS_VI_MPAL_LAF1 31 +#define OS_VI_MPAL_LPN2 32 +#define OS_VI_MPAL_LPF2 33 +#define OS_VI_MPAL_LAN2 34 +#define OS_VI_MPAL_LAF2 35 +#define OS_VI_MPAL_HPN1 36 +#define OS_VI_MPAL_HPF1 37 +#define OS_VI_MPAL_HAN1 38 +#define OS_VI_MPAL_HAF1 39 +#define OS_VI_MPAL_HPN2 40 +#define OS_VI_MPAL_HPF2 41 + +/* + * Video Interface (VI) special features + */ +#define OS_VI_GAMMA_ON 0x0001 +#define OS_VI_GAMMA_OFF 0x0002 +#define OS_VI_GAMMA_DITHER_ON 0x0004 +#define OS_VI_GAMMA_DITHER_OFF 0x0008 +#define OS_VI_DIVOT_ON 0x0010 +#define OS_VI_DIVOT_OFF 0x0020 +#define OS_VI_DITHER_FILTER_ON 0x0040 +#define OS_VI_DITHER_FILTER_OFF 0x0080 + +/* + * Video Interface (VI) mode attribute bit + */ +#define OS_VI_BIT_NONINTERLACE 0x0001 /* lo-res */ +#define OS_VI_BIT_INTERLACE 0x0002 /* lo-res */ +#define OS_VI_BIT_NORMALINTERLACE 0x0004 /* hi-res */ +#define OS_VI_BIT_DEFLICKINTERLACE 0x0008 /* hi-res */ +#define OS_VI_BIT_ANTIALIAS 0x0010 +#define OS_VI_BIT_POINTSAMPLE 0x0020 +#define OS_VI_BIT_16PIXEL 0x0040 +#define OS_VI_BIT_32PIXEL 0x0080 +#define OS_VI_BIT_LORES 0x0100 +#define OS_VI_BIT_HIRES 0x0200 +#define OS_VI_BIT_NTSC 0x0400 +#define OS_VI_BIT_PAL 0x0800 + +/* + * Leo Disk + */ + +/* transfer mode */ + +#define LEO_BLOCK_MODE 1 +#define LEO_TRACK_MODE 2 +#define LEO_SECTOR_MODE 3 + +/* + * Controllers number + */ + +#ifndef _HW_VERSION_1 +#define MAXCONTROLLERS 4 +#else +#define MAXCONTROLLERS 6 +#endif + +/* controller errors */ +#define CONT_NO_RESPONSE_ERROR 0x8 +#define CONT_OVERRUN_ERROR 0x4 +#ifdef _HW_VERSION_1 +#define CONT_FRAME_ERROR 0x2 +#define CONT_COLLISION_ERROR 0x1 +#endif + +/* Controller type */ + +#define CONT_ABSOLUTE 0x0001 +#define CONT_RELATIVE 0x0002 +#define CONT_JOYPORT 0x0004 +#define CONT_EEPROM 0x8000 +#define CONT_EEP16K 0x4000 +#define CONT_TYPE_MASK 0x1f07 +#define CONT_TYPE_NORMAL 0x0005 +#define CONT_TYPE_MOUSE 0x0002 + +/* Controller status */ + +#define CONT_CARD_ON 0x01 +#define CONT_CARD_PULL 0x02 +#define CONT_ADDR_CRC_ER 0x04 +#define CONT_EEPROM_BUSY 0x80 + +/* EEPROM TYPE */ + +#define EEPROM_TYPE_4K 0x01 +#define EEPROM_TYPE_16K 0x02 + +/* Buttons */ + +#define CONT_A 0x8000 +#define CONT_B 0x4000 +#define CONT_G 0x2000 +#define CONT_START 0x1000 +#define CONT_UP 0x0800 +#define CONT_DOWN 0x0400 +#define CONT_LEFT 0x0200 +#define CONT_RIGHT 0x0100 +#define CONT_L 0x0020 +#define CONT_R 0x0010 +#define CONT_E 0x0008 +#define CONT_D 0x0004 +#define CONT_C 0x0002 +#define CONT_F 0x0001 + +/* Nintendo's official button names */ + +#define A_BUTTON CONT_A +#define B_BUTTON CONT_B +#define L_TRIG CONT_L +#define R_TRIG CONT_R +#define Z_TRIG CONT_G +#define START_BUTTON CONT_START +#define U_JPAD CONT_UP +#define L_JPAD CONT_LEFT +#define R_JPAD CONT_RIGHT +#define D_JPAD CONT_DOWN +#define U_CBUTTONS CONT_E +#define L_CBUTTONS CONT_C +#define R_CBUTTONS CONT_F +#define D_CBUTTONS CONT_D + +/* File System size */ +#define OS_PFS_VERSION 0x0200 +#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8) +#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255) + +#define PFS_FILE_NAME_LEN 16 +#define PFS_FILE_EXT_LEN 4 +#define BLOCKSIZE 32 /* bytes */ +#define PFS_ONE_PAGE 8 /* blocks */ +#define PFS_MAX_BANKS 62 + +/* File System flag */ + +#define PFS_READ 0 +#define PFS_WRITE 1 +#define PFS_CREATE 2 + +/* File System status */ +#define PFS_INITIALIZED 0x1 +#define PFS_CORRUPTED 0x2 /* File system was corrupted */ + +/* File System error number */ + +#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */ +#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a */ + /* different one */ +#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker */ +#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR +#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/ +#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/ +#define PFS_DATA_FULL 7 /* no free pages on ram pack */ +#define PFS_DIR_FULL 8 /* no free directories on ram pack*/ +#define PFS_ERR_EXIST 9 /* file exists */ +#define PFS_ERR_ID_FATAL 10 /* dead ram pack */ +#define PFS_ERR_DEVICE 11 /* wrong device type*/ + +/* definition for EEPROM */ + +#define EEPROM_MAXBLOCKS 64 +#define EEP16K_MAXBLOCKS 256 +#define EEPROM_BLOCK_SIZE 8 + +/* + * PI/EPI + */ +#define PI_DOMAIN1 0 +#define PI_DOMAIN2 1 + +/* + * Profiler constants + */ +#define PROF_MIN_INTERVAL 50 /* microseconds */ + +/* + * Boot addresses + */ +#define BOOT_ADDRESS_ULTRA 0x80000400 +#define BOOT_ADDRESS_COSIM 0x80002000 +#define BOOT_ADDRESS_EMU 0x20010000 +#define BOOT_ADDRESS_INDY 0x88100000 + +/* + * Size of buffer the retains contents after NMI + */ +#define OS_APP_NMI_BUFSIZE 64 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +/* PARTNER-N64 */ +#ifdef PTN64 +#define osReadHost osReadHost_pt +#define osWriteHost osWriteHost_pt +#endif + +/* Get count of valid messages in queue */ +#define MQ_GET_COUNT(mq) ((mq)->validCount) + +/* Figure out if message queue is empty or full */ +#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0) +#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount) + +/* + * CPU counter increments at 3/4 of bus clock rate: + * + * Bus Clock Proc Clock Counter (1/2 Proc Clock) + * --------- ---------- ------------------------ + * 62.5 Mhz 93.75 Mhz 46.875 Mhz + */ +extern u64 osClockRate; + +#define OS_CLOCK_RATE 62500000LL +#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4) +#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL)) +#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL)) +#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL)) +#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL)) + +/************************************************************************** + * + * Extern variables + * + */ +extern OSViMode osViModeTable[]; /* Global VI mode table */ + +extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */ +extern OSViMode osViModeNtscLpf1; +extern OSViMode osViModeNtscLan1; +extern OSViMode osViModeNtscLaf1; +extern OSViMode osViModeNtscLpn2; +extern OSViMode osViModeNtscLpf2; +extern OSViMode osViModeNtscLan2; +extern OSViMode osViModeNtscLaf2; +extern OSViMode osViModeNtscHpn1; +extern OSViMode osViModeNtscHpf1; +extern OSViMode osViModeNtscHan1; +extern OSViMode osViModeNtscHaf1; +extern OSViMode osViModeNtscHpn2; +extern OSViMode osViModeNtscHpf2; + +extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */ +extern OSViMode osViModePalLpf1; +extern OSViMode osViModePalLan1; +extern OSViMode osViModePalLaf1; +extern OSViMode osViModePalLpn2; +extern OSViMode osViModePalLpf2; +extern OSViMode osViModePalLan2; +extern OSViMode osViModePalLaf2; +extern OSViMode osViModePalHpn1; +extern OSViMode osViModePalHpf1; +extern OSViMode osViModePalHan1; +extern OSViMode osViModePalHaf1; +extern OSViMode osViModePalHpn2; +extern OSViMode osViModePalHpf2; + +extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */ +extern OSViMode osViModeMpalLpf1; +extern OSViMode osViModeMpalLan1; +extern OSViMode osViModeMpalLaf1; +extern OSViMode osViModeMpalLpn2; +extern OSViMode osViModeMpalLpf2; +extern OSViMode osViModeMpalLan2; +extern OSViMode osViModeMpalLaf2; +extern OSViMode osViModeMpalHpn1; +extern OSViMode osViModeMpalHpf1; +extern OSViMode osViModeMpalHan1; +extern OSViMode osViModeMpalHaf1; +extern OSViMode osViModeMpalHpn2; +extern OSViMode osViModeMpalHpf2; + +extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */ +extern u32 osRomBase; /* Rom base address of the game image */ +extern u32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */ +extern u32 osResetType; /* 0 = cold reset, 1 = NMI */ +extern s32 osCicId; +extern s32 osVersion; +extern u32 osMemSize; /* Memory Size */ +extern s32 osAppNMIBuffer[]; + +extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */ +extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */ +extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/ + + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Thread operations */ + +extern void osCreateThread(OSThread *, OSId, void (*)(void *), + void *, void *, OSPri); +extern void osDestroyThread(OSThread *); +extern void osYieldThread(void); +extern void osStartThread(OSThread *); +extern void osStopThread(OSThread *); +extern OSId osGetThreadId(OSThread *); +extern void osSetThreadPri(OSThread *, OSPri); +extern OSPri osGetThreadPri(OSThread *); + +/* Message operations */ + +extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); +extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); + +/* Event operations */ + +extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); + +/* Interrupt operations */ + +extern OSIntMask osGetIntMask(void); +extern OSIntMask osSetIntMask(OSIntMask); + +/* RDB port operations */ + +extern void osInitRdb(u8 *sendBuf, u32 sendSize); + +/* Cache operations and macros */ + +extern void osInvalDCache(void *, size_t); +extern void osInvalICache(void *, size_t); +extern void osWritebackDCache(void *, size_t); +extern void osWritebackDCacheAll(void); + +#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10)) +#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10)) + +/* TLB management routines */ + +extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32); +extern void osMapTLBRdb(void); +extern void osUnmapTLB(s32); +extern void osUnmapTLBAll(void); +extern void osSetTLBASID(s32); + +/* Address translation routines and macros */ + +extern u32 osVirtualToPhysical(void *); +extern void * osPhysicalToVirtual(u32); + +#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000)) +#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000)) + +#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000)) +#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000)) + +/* I/O operations */ + +/* Audio interface (Ai) */ +extern u32 osAiGetStatus(void); +extern u32 osAiGetLength(void); +extern s32 osAiSetFrequency(u32); +extern s32 osAiSetNextBuffer(void *, u32); + +/* Display processor interface (Dp) */ +extern u32 osDpGetStatus(void); +extern void osDpSetStatus(u32); +extern void osDpGetCounters(u32 *); +extern s32 osDpSetNextBuffer(void *, u64); + +/* Peripheral interface (Pi) */ +extern u32 osPiGetStatus(void); +extern s32 osPiGetDeviceType(void); +extern s32 osPiRawWriteIo(u32, u32); +extern s32 osPiRawReadIo(u32, u32 *); +extern s32 osPiRawStartDma(s32, u32, void *, u32); +extern s32 osPiWriteIo(u32, u32); +extern s32 osPiReadIo(u32, u32 *); +extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32, + OSMesgQueue *); +extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32); + +/* Video interface (Vi) */ +extern u32 osViGetStatus(void); +extern u32 osViGetCurrentMode(void); +extern u32 osViGetCurrentLine(void); +extern u32 osViGetCurrentField(void); +extern void *osViGetCurrentFramebuffer(void); +extern void *osViGetNextFramebuffer(void); +extern void osViSetXScale(f32); +extern void osViSetYScale(f32); +extern void osViSetSpecialFeatures(u32); +extern void osViSetMode(OSViMode *); +extern void osViSetEvent(OSMesgQueue *, OSMesg, u32); +extern void osViSwapBuffer(void *); +extern void osViBlack(u8); +extern void osViFade(u8, u16); +extern void osViRepeatLine(u8); +extern void osCreateViManager(OSPri); + +/* Timer interface */ + +extern OSTime osGetTime(void); +extern void osSetTime(OSTime); +extern u32 osSetTimer(OSTimer *, OSTime, OSTime, + OSMesgQueue *, OSMesg); +extern int osStopTimer(OSTimer *); + +/* Controller interface */ + +extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *); +extern s32 osContReset(OSMesgQueue *, OSContStatus *); +extern s32 osContStartQuery(OSMesgQueue *); +extern s32 osContStartReadData(OSMesgQueue *); +#ifndef _HW_VERSION_1 +extern s32 osContSetCh(u8); +#endif +extern void osContGetQuery(OSContStatus *); +extern void osContGetReadData(OSContPad *); + +/* file system interface */ + +extern s32 osPfsInitPak(OSMesgQueue *, OSPfs *, int); +extern s32 osPfsRepairId(OSPfs *); +extern s32 osPfsInit(OSMesgQueue *, OSPfs *, int); +extern s32 osPfsReFormat(OSPfs *, OSMesgQueue *, int); +extern s32 osPfsChecker(OSPfs *); +extern s32 osPfsAllocateFile(OSPfs *, u16, u32, u8 *, u8 *, int, s32 *); +extern s32 osPfsFindFile(OSPfs *, u16, u32, u8 *, u8 *, s32 *); +extern s32 osPfsDeleteFile(OSPfs *, u16, u32, u8 *, u8 *); +extern s32 osPfsReadWriteFile(OSPfs *, s32, u8, int, int, u8 *); +extern s32 osPfsFileState(OSPfs *, s32, OSPfsState *); +extern s32 osPfsGetLabel(OSPfs *, u8 *, int *); +extern s32 osPfsSetLabel(OSPfs *, u8 *); +extern s32 osPfsIsPlug(OSMesgQueue *, u8 *); +extern s32 osPfsFreeBlocks(OSPfs *, s32 *); +extern s32 osPfsNumFiles(OSPfs *, s32 *, s32 *); + +/* EEPROM interface */ + +extern s32 osEepromProbe(OSMesgQueue *); +extern s32 osEepromRead(OSMesgQueue *, u8, u8 *); +extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *); +extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int); +extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int); + +/* MOTOR interface */ + +extern s32 osMotorInit(OSMesgQueue *, OSPfs *, int); +extern s32 osMotorStop(OSPfs *); +extern s32 osMotorStart(OSPfs *); + +/* Enhanced PI interface */ + +extern OSPiHandle *osCartRomInit(void); +extern OSPiHandle *osLeoDiskInit(void); +extern OSPiHandle *osDriveRomInit(void); + +extern s32 osEPiDeviceType(OSPiHandle *, OSPiInfo *); +extern s32 osEPiRawWriteIo(OSPiHandle *, u32 , u32); +extern s32 osEPiRawReadIo(OSPiHandle *, u32 , u32 *); +extern s32 osEPiRawStartDma(OSPiHandle *, s32 , u32 , void *, u32 ); +extern s32 osEPiWriteIo(OSPiHandle *, u32 , u32 ); +extern s32 osEPiReadIo(OSPiHandle *, u32 , u32 *); +extern s32 osEPiStartDma(OSPiHandle *, OSIoMesg *, s32); +extern s32 osEPiLinkHandle(OSPiHandle *); + +/* Profiler Interface */ + +extern void osProfileInit(OSProf *, u32 profcnt); +extern void osProfileStart(u32); +extern void osProfileFlush(void); +extern void osProfileStop(void); + +/* Game <> Host data transfer functions */ + +extern s32 osTestHost(void); +extern void osReadHost(void *, u32); +extern void osWriteHost(void *, u32); +extern void osAckRamromRead(void); +extern void osAckRamromWrite(void); + + +/* byte string operations */ + +extern void bcopy(const void *, void *, size_t); +extern int bcmp(const void *, const void *, int); +extern void bzero(void *, size_t); + +/* Miscellaneous operations */ + +extern void osInitialize(void); +extern u32 osGetCount(void); +extern void osExit(void); +extern u32 osGetMemSize(void); + +/* Printf */ + +extern int sprintf(char *s, const char *fmt, ...); +extern void osSyncPrintf(const char *fmt, ...); +extern void osAsyncPrintf(const char *fmt, ...); +extern int osSyncGetChars(char *buf); +extern int osAsyncGetChars(char *buf); + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_H */ diff --git a/include/ultra64/os_ai.h b/src/libultra/osAi.h similarity index 67% rename from include/ultra64/os_ai.h rename to src/libultra/osAi.h index 02e8ce8f..276fa071 100644 --- a/include/ultra64/os_ai.h +++ b/src/libultra/osAi.h @@ -1,8 +1,7 @@ -#ifndef _ULTRA64_AI_H_ -#define _ULTRA64_AI_H_ +#ifndef _OSAI_H_ +#define _OSAI_H_ -u32 osAiGetLength(void); -s32 osAiSetNextBuffer(void *, u32); s32 osAiSetFrequency(u32); - +s32 osAiSetNextBuffer(void *, u32); +u32 osAiGetLength(void); #endif diff --git a/src/libultra/osContInternal.h b/src/libultra/osContInternal.h new file mode 100644 index 00000000..0f628205 --- /dev/null +++ b/src/libultra/osContInternal.h @@ -0,0 +1,47 @@ +#ifndef _ULTRA64_CONTROLLER_INTERNAL_H_ +#define _ULTRA64_CONTROLLER_INTERNAL_H_ + +#include + +typedef struct +{ + u8 padOrEnd; + u8 txLen; + u8 rxLen; //includes errno + u8 command; + u16 button; + s8 rawStickX; + s8 rawStickY; +} OSContPackedRead; + +typedef struct +{ + u8 padOrEnd; + u8 txLen; + u8 rxLen; + u8 command; + u8 data1; + u8 data2; + u8 data3; + u8 data4; +} OSContPackedRequest; + +typedef union { + OSContPackedRead read; + OSContPackedRequest request; + u32 as_raw[2]; +} OSContPackedStruct; + +#ifdef AVOID_UB +// Fix the OSContPackedStruct array +extern OSContPackedStruct _osContCmdBuf[8]; + +// And fix the last element +#define _osContPifCtrl _osContCmdBuf[7].as_raw[1] +#else +// Original OSContPackedStruct definitions +extern OSContPackedStruct _osContCmdBuf[7]; +extern u32 _osContPifCtrl; +#endif + +#endif diff --git a/src/libultra/osint.h b/src/libultra/osint.h new file mode 100644 index 00000000..49234d72 --- /dev/null +++ b/src/libultra/osint.h @@ -0,0 +1,53 @@ +#ifndef _OSINT_H +#define _OSINT_H +#include "libultra_internal.h" + +typedef struct __OSEventState +{ + OSMesgQueue *messageQueue; + OSMesg message; +} __OSEventState; +extern struct __osThreadTail +{ + OSThread *next; + OSPri priority; +} __osThreadTail; + +//maybe should be in exceptasm.h? +extern void __osEnqueueAndYield(OSThread **); +extern void __osDequeueThread(OSThread **, OSThread *); +extern void __osEnqueueThread(OSThread **, OSThread *); +extern OSThread *__osPopThread(OSThread **); +extern void __osDispatchThread(void); + +extern void __osSetTimerIntr(OSTime); +extern OSTime __osInsertTimer(OSTimer *); +extern void __osTimerInterrupt(void); +extern u32 __osProbeTLB(void *); +extern int __osSpDeviceBusy(void); + +#ifdef AVOID_UB +extern OSThread_ListHead D_80334890_fix; +#else +extern OSThread *__osRunningThread; +extern OSThread *D_8033489C; +extern OSThread *__osFaultedThread; +extern OSThread *__osRunQueue; +#endif + +extern OSTimer *__osTimerList; +extern OSTimer __osBaseTimer; +extern OSTime __osCurrentTime; +extern u32 __osBaseCounter; +extern u32 __osViIntrCount; +extern u32 __osTimerCounter; + +extern __OSEventState __osEventStateTab[OS_NUM_EVENTS]; + + +//not sure if this should be here +extern s32 osViClock; +extern void __osTimerServicesInit(void); +extern s32 __osAiDeviceBusy(void); +extern int __osDpDeviceBusy(void); +#endif diff --git a/src/libultra/piint.h b/src/libultra/piint.h new file mode 100644 index 00000000..b3fee34e --- /dev/null +++ b/src/libultra/piint.h @@ -0,0 +1,147 @@ +#ifndef _PIINT_H +#define _PIINT_H +#include "PR/os_internal.h" +#include "PR/rcp.h" +#include "PR/os_pi.h" +#include "os.h" + +//https://github.com/LuigiBlood/64dd/wiki/Memory-Map + +#define LEO_BASE_REG 0x05000000 + +#define LEO_CMD (LEO_BASE_REG + 0x508) +#define LEO_STATUS (LEO_BASE_REG + 0x508) + +#define LEO_BM_CTL (LEO_BASE_REG + 0x510) +#define LEO_BM_STATUS (LEO_BASE_REG + 0x510) + +#define LEO_SEQ_CTL (LEO_BASE_REG + 0x518) +#define LEO_SEQ_STATUS (LEO_BASE_REG + 0x518) + +#define LEO_C2_BUFF (LEO_BASE_REG + 0x000) //C2 Sector Buffer +#define LEO_SECTOR_BUFF (LEO_BASE_REG + 0x400) //Data Sector Buffer +#define LEO_DATA (LEO_BASE_REG + 0x500) //Data +#define LEO_MISC_REG (LEO_BASE_REG + 0x504) //Misc Register +#define LEO_CUR_TK (LEO_BASE_REG + 0x50C) //Current Track +#define LEO_ERR_SECTOR (LEO_BASE_REG + 0x514) //Sector Error Status +#define LEO_CUR_SECTOR (LEO_BASE_REG + 0x51C) //Current Sector +#define LEO_HARD_RESET (LEO_BASE_REG + 0x520) //Hard Reset +#define LEO_C1_S0 (LEO_BASE_REG + 0x524) //C1 +#define LEO_HOST_SECBYTE (LEO_BASE_REG + 0x528) //Sector Size (in bytes) +#define LEO_C1_S2 (LEO_BASE_REG + 0x52C) //C1 +#define LEO_SEC_BYTE (LEO_BASE_REG + 0x530) //Sectors per Block, Full Size +#define LEO_C1_S4 (LEO_BASE_REG + 0x534) //C1 +#define LEO_C1_S6 (LEO_BASE_REG + 0x538) //C1 +#define LEO_CUR_ADDR (LEO_BASE_REG + 0x53C) //Current Address? +#define LEO_ID_REG (LEO_BASE_REG + 0x540) //ID +#define LEO_TEST_REG (LEO_BASE_REG + 0x544) //Test Read +#define LEO_TEST_PIN_SEL (LEO_BASE_REG + 0x548) //Test Write +#define LEO_RAM_ADDR (LEO_BASE_REG + 0x580) //Microsequencer RAM + +#define LEO_STATUS_PRESENCE_MASK 0xFFFF + +#define LEO_STATUS_DATA_REQUEST 0x40000000 +#define LEO_STATUS_C2_TRANSFER 0x10000000 +#define LEO_STATUS_BUFFER_MANAGER_ERROR 0x08000000 +#define LEO_STATUS_BUFFER_MANAGER_INTERRUPT 0x04000000 +#define LEO_STATUS_MECHANIC_INTERRUPT 0x02000000 +#define LEO_STATUS_DISK_PRESENT 0x01000000 +#define LEO_STATUS_BUSY_STATE 0x00800000 +#define LEO_STATUS_RESET_STATE 0x00400000 +#define LEO_STATUS_MOTOR_NOT_SPINNING 0x00100000 +#define LEO_STATUS_HEAD_RETRACTED 0x00080000 +#define LEO_STATUS_WRITE_PROTECT_ERROR 0x00040000 +#define LEO_STATUS_MECHANIC_ERROR 0x00020000 +#define LEO_STATUS_DISK_CHANGE 0x00010000 + +#define LEO_STATUS_MODE_MASK (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_SLEEP (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_STANDBY (LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_ACTIVE 0 + +#define LEO_CUR_TK_INDEX_LOCK 0x60000000 + +#define LEO_BM_STATUS_RUNNING 0x80000000 //Running +#define LEO_BM_STATUS_ERROR 0x04000000 //Error +#define LEO_BM_STATUS_MICRO 0x02000000 //Micro Status? +#define LEO_BM_STATUS_BLOCK 0x01000000 //Block Transfer +#define LEO_BM_STATUS_C1CORRECTION 0x00800000 //C1 Correction +#define LEO_BM_STATUS_C1DOUBLE 0x00400000 //C1 Double +#define LEO_BM_STATUS_C1SINGLE 0x00200000 //C1 Single +#define LEO_BM_STATUS_C1ERROR 0x00010000 //C1 Error + +#define LEO_BM_CTL_START 0x80000000 //Start Buffer Manager +#define LEO_BM_CTL_MODE 0x40000000 //Buffer Manager Mode +#define LEO_BM_CTL_IMASK 0x20000000 //BM Interrupt Mask +#define LEO_BM_CTL_RESET 0x10000000 //Buffer Manager Reset +#define LEO_BM_CTL_DISABLE_OR 0x08000000 //Disable OR Check? +#define LEO_BM_CTL_DISABLE_C1 0x04000000 //Disable C1 Correction +#define LEO_BM_CTL_BLOCK 0x02000000 //Block Transfer +#define LEO_BM_CTL_CLR_MECHANIC_INTR 0x01000000 //Mechanic Interrupt Reset + +#define LEO_BM_CTL_CONTROL_MASK 0xFF000000 +#define LEO_BM_CTL_SECTOR_MASK 0x00FF0000 +#define LEO_BM_CTL_SECTOR_SHIFT 16 + +#define LEO_CMD_TYPE_0 0 //TODO: name +#define LEO_CMD_TYPE_1 1 //TODO: name +#define LEO_CMD_TYPE_2 2 //TODO: name + +#define LEO_ERROR_GOOD 0 +#define LEO_ERROR_4 4 //maybe busy? +#define LEO_ERROR_22 22 // +#define LEO_ERROR_23 23 //unrecovered read error? +#define LEO_ERROR_24 24 //no reference position found? +#define LEO_ERROR_29 29 // + +extern OSDevMgr __osPiDevMgr; +extern OSPiHandle *__osCurrentHandle[2]; +extern OSPiHandle CartRomHandle; +extern OSPiHandle LeoDiskHandle; +extern OSMesgQueue __osPiAccessQueue; +extern u32 __osPiAccessQueueEnabled; + +int __osPiDeviceBusy(void); +void __osDevMgrMain(void *); +void __osPiCreateAccessQueue(void); +void __osPiRelAccess(void); +void __osPiGetAccess(void); +OSMesgQueue *osPiGetCmdQueue(void); + +#define OS_RAMROM_STACKSIZE 1024 + +#define WAIT_ON_IOBUSY(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); + +#define UPDATE_REG(reg, var) \ + if (cHandle->var != pihandle->var) \ + IO_WRITE(reg, pihandle->var); + +#define EPI_SYNC(pihandle, stat, domain) \ + \ + WAIT_ON_IOBUSY(stat) \ + \ + domain = pihandle->domain; \ + if (__osCurrentHandle[domain] != pihandle) \ + { \ + OSPiHandle *cHandle = __osCurrentHandle[domain]; \ + if (domain == PI_DOMAIN1) \ + { \ + UPDATE_REG(PI_BSD_DOM1_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM1_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM1_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM1_PWD_REG, pulse); \ + } \ + else \ + { \ + UPDATE_REG(PI_BSD_DOM2_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM2_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM2_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM2_PWD_REG, pulse); \ + } \ + __osCurrentHandle[domain] = pihandle; \ + } + +#endif diff --git a/src/libultra/printf.h b/src/libultra/printf.h new file mode 100644 index 00000000..5d798a19 --- /dev/null +++ b/src/libultra/printf.h @@ -0,0 +1,36 @@ +#ifndef _PRINTF_H_ +#define _PRINTF_H_ +#include + +typedef struct +{ + union { + /* 00 */ s64 s64; + u64 u64; + f64 f64; + u32 u32; + u16 u16; + } value; + /* 08 */ char *buff; + /* 0c */ s32 part1_len; + /* 10 */ s32 num_leading_zeros; + /* 14 */ s32 part2_len; + /* 18 */ s32 num_mid_zeros; + /* 1c */ s32 part3_len; + /* 20 */ s32 num_trailing_zeros; + /* 24 */ s32 precision; + /* 28 */ s32 width; + /* 2c */ u32 size; + /* 30 */ u32 flags; + /* 34 */ u8 length; +} printf_struct; + +#define FLAGS_SPACE 1 +#define FLAGS_PLUS 2 +#define FLAGS_MINUS 4 +#define FLAGS_HASH 8 +#define FLAGS_ZERO 16 +s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args); +void _Litob(printf_struct *args, u8 type); +void _Ldtob(printf_struct *args, u8 type); +#endif diff --git a/src/libultra/seteventmesg.c b/src/libultra/seteventmesg.c new file mode 100644 index 00000000..4610b4b1 --- /dev/null +++ b/src/libultra/seteventmesg.c @@ -0,0 +1,18 @@ +#include "libultra_internal.h" + +typedef struct OSEventMessageStruct_0_s { + OSMesgQueue *queue; + OSMesg msg; +} OSEventMessageStruct_0; + +OSEventMessageStruct_0 __osEventStateTab[16]; + +void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg) { + register u32 int_disabled; + OSEventMessageStruct_0 *msgs; + int_disabled = __osDisableInt(); + msgs = __osEventStateTab + e; + msgs->queue = mq; + msgs->msg = msg; + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/seteventmesg.s b/src/libultra/seteventmesg.s deleted file mode 100644 index ad7ad442..00000000 --- a/src/libultra/seteventmesg.s +++ /dev/null @@ -1,162 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osSetEventMesg -/* 00E850 7000DC50 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00E854 7000DC54 AFBF001C */ sw $ra, 0x1c($sp) -/* 00E858 7000DC58 AFA40028 */ sw $a0, 0x28($sp) -/* 00E85C 7000DC5C AFA5002C */ sw $a1, 0x2c($sp) -/* 00E860 7000DC60 AFA60030 */ sw $a2, 0x30($sp) -/* 00E864 7000DC64 0C00617C */ jal __osDisableInt -/* 00E868 7000DC68 AFB00018 */ sw $s0, 0x18($sp) -/* 00E86C 7000DC6C 8FAE0028 */ lw $t6, 0x28($sp) -/* 00E870 7000DC70 3C188006 */ lui $t8, %hi(__osEventStateTab) -/* 00E874 7000DC74 8FA8002C */ lw $t0, 0x2c($sp) -/* 00E878 7000DC78 27186A10 */ addiu $t8, %lo(__osEventStateTab) # addiu $t8, $t8, 0x6a10 -/* 00E87C 7000DC7C 000E78C0 */ sll $t7, $t6, 3 -/* 00E880 7000DC80 01F8C821 */ addu $t9, $t7, $t8 -/* 00E884 7000DC84 AFB90020 */ sw $t9, 0x20($sp) -/* 00E888 7000DC88 AF280000 */ sw $t0, ($t9) -/* 00E88C 7000DC8C 8FAA0020 */ lw $t2, 0x20($sp) -/* 00E890 7000DC90 8FA90030 */ lw $t1, 0x30($sp) -/* 00E894 7000DC94 00408025 */ move $s0, $v0 -/* 00E898 7000DC98 02002025 */ move $a0, $s0 -/* 00E89C 7000DC9C 0C006184 */ jal __osRestoreInt -/* 00E8A0 7000DCA0 AD490004 */ sw $t1, 4($t2) -/* 00E8A4 7000DCA4 8FBF001C */ lw $ra, 0x1c($sp) -/* 00E8A8 7000DCA8 8FB00018 */ lw $s0, 0x18($sp) -/* 00E8AC 7000DCAC 27BD0028 */ addiu $sp, $sp, 0x28 -/* 00E8B0 7000DCB0 03E00008 */ jr $ra -/* 00E8B4 7000DCB4 00000000 */ nop - -.section .bss -glabel __osEventStateTab -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 -.byte 0 - - - diff --git a/src/libultra/setthreadpri.c b/src/libultra/setthreadpri.c new file mode 100644 index 00000000..84a9a4c1 --- /dev/null +++ b/src/libultra/setthreadpri.c @@ -0,0 +1,24 @@ +#include "libultra_internal.h" + +void osSetThreadPri(OSThread *thread, OSPri pri) { + register u32 int_disabled = __osDisableInt(); + if (thread == NULL) { + thread = __osRunningThread; + } + + if (thread->priority != pri) { + thread->priority = pri; + if (thread != __osRunningThread) { + if (thread->state != OS_STATE_STOPPED) { + __osDequeueThread(thread->queue, thread); + __osEnqueueThread(thread->queue, thread); + } + } + if (__osRunningThread->priority < __osRunQueue->priority) { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/setthreadpri.s b/src/libultra/setthreadpri.s deleted file mode 100644 index e015c475..00000000 --- a/src/libultra/setthreadpri.s +++ /dev/null @@ -1,70 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osSetThreadPri -/* 00E400 7000D800 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00E404 7000D804 AFBF001C */ sw $ra, 0x1c($sp) -/* 00E408 7000D808 AFA40028 */ sw $a0, 0x28($sp) -/* 00E40C 7000D80C AFA5002C */ sw $a1, 0x2c($sp) -/* 00E410 7000D810 0C00617C */ jal __osDisableInt -/* 00E414 7000D814 AFB00018 */ sw $s0, 0x18($sp) -/* 00E418 7000D818 8FAE0028 */ lw $t6, 0x28($sp) -/* 00E41C 7000D81C 00408025 */ move $s0, $v0 -/* 00E420 7000D820 15C00004 */ bnez $t6, .L7000D834 -/* 00E424 7000D824 00000000 */ nop -/* 00E428 7000D828 3C0F8002 */ lui $t7, %hi(__osRunningThread) -/* 00E42C 7000D82C 8DEF7730 */ lw $t7, %lo(__osRunningThread)($t7) -/* 00E430 7000D830 AFAF0028 */ sw $t7, 0x28($sp) -.L7000D834: -/* 00E434 7000D834 8FB80028 */ lw $t8, 0x28($sp) -/* 00E438 7000D838 8FA8002C */ lw $t0, 0x2c($sp) -/* 00E43C 7000D83C 8F190004 */ lw $t9, 4($t8) -/* 00E440 7000D840 13280020 */ beq $t9, $t0, .L7000D8C4 -/* 00E444 7000D844 00000000 */ nop -/* 00E448 7000D848 AF080004 */ sw $t0, 4($t8) -/* 00E44C 7000D84C 3C0A8002 */ lui $t2, %hi(__osRunningThread) -/* 00E450 7000D850 8D4A7730 */ lw $t2, %lo(__osRunningThread)($t2) -/* 00E454 7000D854 8FA90028 */ lw $t1, 0x28($sp) -/* 00E458 7000D858 112A000C */ beq $t1, $t2, .L7000D88C -/* 00E45C 7000D85C 00000000 */ nop -/* 00E460 7000D860 952B0010 */ lhu $t3, 0x10($t1) -/* 00E464 7000D864 24010001 */ li $at, 1 -/* 00E468 7000D868 11610008 */ beq $t3, $at, .L7000D88C -/* 00E46C 7000D86C 00000000 */ nop -/* 00E470 7000D870 8D240008 */ lw $a0, 8($t1) -/* 00E474 7000D874 0C0042A4 */ jal __osDequeueThread -/* 00E478 7000D878 01202825 */ move $a1, $t1 -/* 00E47C 7000D87C 8FAC0028 */ lw $t4, 0x28($sp) -/* 00E480 7000D880 8D840008 */ lw $a0, 8($t4) -/* 00E484 7000D884 0C00422B */ jal __osEnqueueThread -/* 00E488 7000D888 01802825 */ move $a1, $t4 -.L7000D88C: -/* 00E48C 7000D88C 3C0D8002 */ lui $t5, %hi(__osRunningThread) -/* 00E490 7000D890 3C0F8002 */ lui $t7, %hi(__osRunQueue) -/* 00E494 7000D894 8DEF7728 */ lw $t7, %lo(__osRunQueue)($t7) -/* 00E498 7000D898 8DAD7730 */ lw $t5, %lo(__osRunningThread)($t5) -/* 00E49C 7000D89C 8DF90004 */ lw $t9, 4($t7) -/* 00E4A0 7000D8A0 8DAE0004 */ lw $t6, 4($t5) -/* 00E4A4 7000D8A4 01D9082A */ slt $at, $t6, $t9 -/* 00E4A8 7000D8A8 10200006 */ beqz $at, .L7000D8C4 -/* 00E4AC 7000D8AC 00000000 */ nop -/* 00E4B0 7000D8B0 24080002 */ li $t0, 2 -/* 00E4B4 7000D8B4 3C048002 */ lui $a0, %hi(__osRunQueue) -/* 00E4B8 7000D8B8 A5A80010 */ sh $t0, 0x10($t5) -/* 00E4BC 7000D8BC 0C0041EB */ jal __osEnqueueAndYield -/* 00E4C0 7000D8C0 24847728 */ addiu $a0, %lo(__osRunQueue) # addiu $a0, $a0, 0x7728 -.L7000D8C4: -/* 00E4C4 7000D8C4 0C006184 */ jal __osRestoreInt -/* 00E4C8 7000D8C8 02002025 */ move $a0, $s0 -/* 00E4CC 7000D8CC 8FBF001C */ lw $ra, 0x1c($sp) -/* 00E4D0 7000D8D0 8FB00018 */ lw $s0, 0x18($sp) -/* 00E4D4 7000D8D4 27BD0028 */ addiu $sp, $sp, 0x28 -/* 00E4D8 7000D8D8 03E00008 */ jr $ra -/* 00E4DC 7000D8DC 00000000 */ nop diff --git a/src/libultra/settimer.c b/src/libultra/settimer.c new file mode 100644 index 00000000..dda659f1 --- /dev/null +++ b/src/libultra/settimer.c @@ -0,0 +1,23 @@ +#include "libultra_internal.h" + +extern OSTimer *__osTimerList; +extern u64 __osInsertTimer(OSTimer *); + +u32 osSetTimer(OSTimer *a0, OSTime a1, u64 a2, OSMesgQueue *a3, OSMesg a4) { + u64 sp18; + a0->next = NULL; + a0->prev = NULL; + a0->interval = a2; + if (a1 != 0) { + a0->remaining = a1; + } else { + a0->remaining = a2; + } + a0->mq = a3; + a0->msg = a4; + sp18 = __osInsertTimer(a0); + if (__osTimerList->next == a0) { + __osSetTimerIntr(sp18); + } + return 0; +} diff --git a/src/libultra/settimer.s b/src/libultra/settimer.s deleted file mode 100644 index 5b04978c..00000000 --- a/src/libultra/settimer.s +++ /dev/null @@ -1,67 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osSetTimer -/* 011850 70010C50 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 011854 70010C54 AFA40020 */ sw $a0, 0x20($sp) -/* 011858 70010C58 8FAE0020 */ lw $t6, 0x20($sp) -/* 01185C 70010C5C AFBF0014 */ sw $ra, 0x14($sp) -/* 011860 70010C60 AFA60028 */ sw $a2, 0x28($sp) -/* 011864 70010C64 AFA7002C */ sw $a3, 0x2c($sp) -/* 011868 70010C68 ADC00000 */ sw $zero, ($t6) -/* 01186C 70010C6C 8FAF0020 */ lw $t7, 0x20($sp) -/* 011870 70010C70 ADE00004 */ sw $zero, 4($t7) -/* 011874 70010C74 8FA80020 */ lw $t0, 0x20($sp) -/* 011878 70010C78 8FB90034 */ lw $t9, 0x34($sp) -/* 01187C 70010C7C 8FB80030 */ lw $t8, 0x30($sp) -/* 011880 70010C80 AD19000C */ sw $t9, 0xc($t0) -/* 011884 70010C84 AD180008 */ sw $t8, 8($t0) -/* 011888 70010C88 8FAA0028 */ lw $t2, 0x28($sp) -/* 01188C 70010C8C 8FAB002C */ lw $t3, 0x2c($sp) -/* 011890 70010C90 15400003 */ bnez $t2, .L70010CA0 -/* 011894 70010C94 00000000 */ nop -/* 011898 70010C98 11600005 */ beqz $t3, .L70010CB0 -/* 01189C 70010C9C 00000000 */ nop -.L70010CA0: -/* 0118A0 70010CA0 8FA90020 */ lw $t1, 0x20($sp) -/* 0118A4 70010CA4 AD2A0010 */ sw $t2, 0x10($t1) -/* 0118A8 70010CA8 10000006 */ b .L70010CC4 -/* 0118AC 70010CAC AD2B0014 */ sw $t3, 0x14($t1) -.L70010CB0: -/* 0118B0 70010CB0 8FAE0020 */ lw $t6, 0x20($sp) -/* 0118B4 70010CB4 8FAC0030 */ lw $t4, 0x30($sp) -/* 0118B8 70010CB8 8FAD0034 */ lw $t5, 0x34($sp) -/* 0118BC 70010CBC ADCC0010 */ sw $t4, 0x10($t6) -/* 0118C0 70010CC0 ADCD0014 */ sw $t5, 0x14($t6) -.L70010CC4: -/* 0118C4 70010CC4 8FAF0038 */ lw $t7, 0x38($sp) -/* 0118C8 70010CC8 8FB80020 */ lw $t8, 0x20($sp) -/* 0118CC 70010CCC AF0F0018 */ sw $t7, 0x18($t8) -/* 0118D0 70010CD0 8FA80020 */ lw $t0, 0x20($sp) -/* 0118D4 70010CD4 8FB9003C */ lw $t9, 0x3c($sp) -/* 0118D8 70010CD8 AD19001C */ sw $t9, 0x1c($t0) -/* 0118DC 70010CDC 0C00622A */ jal __osInsertTimer -/* 0118E0 70010CE0 8FA40020 */ lw $a0, 0x20($sp) -/* 0118E4 70010CE4 3C0A8002 */ lui $t2, %hi(__osTimerList) -/* 0118E8 70010CE8 8D4A7FD0 */ lw $t2, %lo(__osTimerList)($t2) -/* 0118EC 70010CEC AFA20018 */ sw $v0, 0x18($sp) -/* 0118F0 70010CF0 AFA3001C */ sw $v1, 0x1c($sp) -/* 0118F4 70010CF4 8FA90020 */ lw $t1, 0x20($sp) -/* 0118F8 70010CF8 8D4B0000 */ lw $t3, ($t2) -/* 0118FC 70010CFC 15690004 */ bne $t3, $t1, .L70010D10 -/* 011900 70010D00 00000000 */ nop -/* 011904 70010D04 8FA40018 */ lw $a0, 0x18($sp) -/* 011908 70010D08 0C00620D */ jal __osSetTimerIntr -/* 01190C 70010D0C 8FA5001C */ lw $a1, 0x1c($sp) -.L70010D10: -/* 011910 70010D10 8FBF0014 */ lw $ra, 0x14($sp) -/* 011914 70010D14 27BD0020 */ addiu $sp, $sp, 0x20 -/* 011918 70010D18 00001025 */ move $v0, $zero -/* 01191C 70010D1C 03E00008 */ jr $ra -/* 011920 70010D20 00000000 */ nop diff --git a/src/libultra/sptaskyield.c b/src/libultra/sptaskyield.c new file mode 100644 index 00000000..92546a8f --- /dev/null +++ b/src/libultra/sptaskyield.c @@ -0,0 +1,5 @@ +#include "libultra_internal.h" + +void osSpTaskYield(void) { + __osSpSetStatus(SPSTATUS_SET_SIGNAL0); +} diff --git a/src/libultra/sptaskyield.s b/src/libultra/sptaskyield.s deleted file mode 100644 index 1721c3c9..00000000 --- a/src/libultra/sptaskyield.s +++ /dev/null @@ -1,18 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osSpTaskYield -/* 00F460 7000E860 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 00F464 7000E864 AFBF0014 */ sw $ra, 0x14($sp) -/* 00F468 7000E868 0C0063B8 */ jal __osSpSetStatus -/* 00F46C 7000E86C 24040400 */ li $a0, 1024 -/* 00F470 7000E870 8FBF0014 */ lw $ra, 0x14($sp) -/* 00F474 7000E874 27BD0018 */ addiu $sp, $sp, 0x18 -/* 00F478 7000E878 03E00008 */ jr $ra -/* 00F47C 7000E87C 00000000 */ nop diff --git a/src/libultra/sptaskyielded.c b/src/libultra/sptaskyielded.c new file mode 100644 index 00000000..fa0dcbc2 --- /dev/null +++ b/src/libultra/sptaskyielded.c @@ -0,0 +1,17 @@ +#include "libultra_internal.h" + +OSYieldResult osSpTaskYielded(OSTask *task) { + s32 status; + u32 int_disabledult; + status = __osSpGetStatus(); + if (status & SPSTATUS_SIGNAL1_SET) { + int_disabledult = 1; + } else { + int_disabledult = 0; + } + if (status & SPSTATUS_SIGNAL0_SET) { + task->t.flags |= int_disabledult; + task->t.flags &= ~(M_TASK_FLAG1); + } + return int_disabledult; +} diff --git a/src/libultra/sptaskyielded.s b/src/libultra/sptaskyielded.s deleted file mode 100644 index 7ba8d94c..00000000 --- a/src/libultra/sptaskyielded.s +++ /dev/null @@ -1,46 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osSpTaskYielded -/* 00EF40 7000E340 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 00EF44 7000E344 AFBF0014 */ sw $ra, 0x14($sp) -/* 00EF48 7000E348 0C0063B4 */ jal __osSpGetStatus -/* 00EF4C 7000E34C AFA40020 */ sw $a0, 0x20($sp) -/* 00EF50 7000E350 AFA2001C */ sw $v0, 0x1c($sp) -/* 00EF54 7000E354 8FAE001C */ lw $t6, 0x1c($sp) -/* 00EF58 7000E358 31CF0100 */ andi $t7, $t6, 0x100 -/* 00EF5C 7000E35C 11E00004 */ beqz $t7, .L7000E370 -/* 00EF60 7000E360 00000000 */ nop -/* 00EF64 7000E364 24180001 */ li $t8, 1 -/* 00EF68 7000E368 10000002 */ b .L7000E374 -/* 00EF6C 7000E36C AFB80018 */ sw $t8, 0x18($sp) -.L7000E370: -/* 00EF70 7000E370 AFA00018 */ sw $zero, 0x18($sp) -.L7000E374: -/* 00EF74 7000E374 8FB9001C */ lw $t9, 0x1c($sp) -/* 00EF78 7000E378 33280080 */ andi $t0, $t9, 0x80 -/* 00EF7C 7000E37C 1100000B */ beqz $t0, .L7000E3AC -/* 00EF80 7000E380 00000000 */ nop -/* 00EF84 7000E384 8FA90020 */ lw $t1, 0x20($sp) -/* 00EF88 7000E388 8FAB0018 */ lw $t3, 0x18($sp) -/* 00EF8C 7000E38C 2401FFFD */ li $at, -3 -/* 00EF90 7000E390 8D2A0004 */ lw $t2, 4($t1) -/* 00EF94 7000E394 014B6025 */ or $t4, $t2, $t3 -/* 00EF98 7000E398 AD2C0004 */ sw $t4, 4($t1) -/* 00EF9C 7000E39C 8FAD0020 */ lw $t5, 0x20($sp) -/* 00EFA0 7000E3A0 8DAE0004 */ lw $t6, 4($t5) -/* 00EFA4 7000E3A4 01C17824 */ and $t7, $t6, $at -/* 00EFA8 7000E3A8 ADAF0004 */ sw $t7, 4($t5) -.L7000E3AC: -/* 00EFAC 7000E3AC 8FBF0014 */ lw $ra, 0x14($sp) -/* 00EFB0 7000E3B0 8FA20018 */ lw $v0, 0x18($sp) -/* 00EFB4 7000E3B4 27BD0020 */ addiu $sp, $sp, 0x20 -/* 00EFB8 7000E3B8 03E00008 */ jr $ra -/* 00EFBC 7000E3BC 00000000 */ nop diff --git a/src/libultra/startthread.c b/src/libultra/startthread.c new file mode 100644 index 00000000..a9a8ce89 --- /dev/null +++ b/src/libultra/startthread.c @@ -0,0 +1,37 @@ +#include "libultra_internal.h" + +void osStartThread(OSThread *thread) { + register u32 int_disabled; + register uintptr_t state; + int_disabled = __osDisableInt(); + state = thread->state; + + if (state != OS_STATE_STOPPED) { + if (state == OS_STATE_WAITING) { + do { + } while (0); + thread->state = OS_STATE_RUNNABLE; + __osEnqueueThread(&__osRunQueue, thread); + } + } else { + if (thread->queue == NULL || thread->queue == &__osRunQueue) { + thread->state = OS_STATE_RUNNABLE; + + __osEnqueueThread(&__osRunQueue, thread); + } else { + thread->state = OS_STATE_WAITING; + __osEnqueueThread(thread->queue, thread); + state = (uintptr_t) __osPopThread(thread->queue); + __osEnqueueThread(&__osRunQueue, (OSThread *) state); + } + } + if (__osRunningThread == NULL) { + __osDispatchThread(); + } else { + if (__osRunningThread->priority < __osRunQueue->priority) { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/startthread.s b/src/libultra/startthread.s deleted file mode 100644 index 0cc8be4f..00000000 --- a/src/libultra/startthread.s +++ /dev/null @@ -1,100 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osStartThread -/* 00E180 7000D580 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00E184 7000D584 AFBF001C */ sw $ra, 0x1c($sp) -/* 00E188 7000D588 AFA40028 */ sw $a0, 0x28($sp) -/* 00E18C 7000D58C AFB10018 */ sw $s1, 0x18($sp) -/* 00E190 7000D590 0C00617C */ jal __osDisableInt -/* 00E194 7000D594 AFB00014 */ sw $s0, 0x14($sp) -/* 00E198 7000D598 8FAE0028 */ lw $t6, 0x28($sp) -/* 00E19C 7000D59C 24010001 */ li $at, 1 -/* 00E1A0 7000D5A0 00408025 */ move $s0, $v0 -/* 00E1A4 7000D5A4 95D10010 */ lhu $s1, 0x10($t6) -/* 00E1A8 7000D5A8 1221000C */ beq $s1, $at, .L7000D5DC -/* 00E1AC 7000D5AC 24010008 */ li $at, 8 -/* 00E1B0 7000D5B0 1621002A */ bne $s1, $at, .L7000D65C -/* 00E1B4 7000D5B4 00000000 */ nop -/* 00E1B8 7000D5B8 8FB80028 */ lw $t8, 0x28($sp) -/* 00E1BC 7000D5BC 240F0002 */ li $t7, 2 -/* 00E1C0 7000D5C0 3C048002 */ lui $a0, %hi(__osRunQueue) -/* 00E1C4 7000D5C4 A70F0010 */ sh $t7, 0x10($t8) -/* 00E1C8 7000D5C8 8FA50028 */ lw $a1, 0x28($sp) -/* 00E1CC 7000D5CC 0C00422B */ jal __osEnqueueThread -/* 00E1D0 7000D5D0 24847728 */ addiu $a0, %lo(__osRunQueue) # addiu $a0, $a0, 0x7728 -/* 00E1D4 7000D5D4 10000021 */ b .L7000D65C -/* 00E1D8 7000D5D8 00000000 */ nop -.L7000D5DC: -/* 00E1DC 7000D5DC 8FB90028 */ lw $t9, 0x28($sp) -/* 00E1E0 7000D5E0 8F280008 */ lw $t0, 8($t9) -/* 00E1E4 7000D5E4 11000005 */ beqz $t0, .L7000D5FC -/* 00E1E8 7000D5E8 00000000 */ nop -/* 00E1EC 7000D5EC 3C098002 */ lui $t1, %hi(__osRunQueue) -/* 00E1F0 7000D5F0 25297728 */ addiu $t1, %lo(__osRunQueue) # addiu $t1, $t1, 0x7728 -/* 00E1F4 7000D5F4 1509000A */ bne $t0, $t1, .L7000D620 -/* 00E1F8 7000D5F8 00000000 */ nop -.L7000D5FC: -/* 00E1FC 7000D5FC 8FAB0028 */ lw $t3, 0x28($sp) -/* 00E200 7000D600 240A0002 */ li $t2, 2 -/* 00E204 7000D604 3C048002 */ lui $a0, %hi(__osRunQueue) -/* 00E208 7000D608 A56A0010 */ sh $t2, 0x10($t3) -/* 00E20C 7000D60C 8FA50028 */ lw $a1, 0x28($sp) -/* 00E210 7000D610 0C00422B */ jal __osEnqueueThread -/* 00E214 7000D614 24847728 */ addiu $a0, %lo(__osRunQueue) # addiu $a0, $a0, 0x7728 -/* 00E218 7000D618 10000010 */ b .L7000D65C -/* 00E21C 7000D61C 00000000 */ nop -.L7000D620: -/* 00E220 7000D620 8FAD0028 */ lw $t5, 0x28($sp) -/* 00E224 7000D624 240C0008 */ li $t4, 8 -/* 00E228 7000D628 A5AC0010 */ sh $t4, 0x10($t5) -/* 00E22C 7000D62C 8FAE0028 */ lw $t6, 0x28($sp) -/* 00E230 7000D630 8DC40008 */ lw $a0, 8($t6) -/* 00E234 7000D634 0C00422B */ jal __osEnqueueThread -/* 00E238 7000D638 01C02825 */ move $a1, $t6 -/* 00E23C 7000D63C 8FAF0028 */ lw $t7, 0x28($sp) -/* 00E240 7000D640 0C00423D */ jal __osPopThread -/* 00E244 7000D644 8DE40008 */ lw $a0, 8($t7) -/* 00E248 7000D648 00408825 */ move $s1, $v0 -/* 00E24C 7000D64C 3C048002 */ lui $a0, %hi(__osRunQueue) -/* 00E250 7000D650 24847728 */ addiu $a0, %lo(__osRunQueue) # addiu $a0, $a0, 0x7728 -/* 00E254 7000D654 0C00422B */ jal __osEnqueueThread -/* 00E258 7000D658 02202825 */ move $a1, $s1 -.L7000D65C: -/* 00E25C 7000D65C 3C188002 */ lui $t8, %hi(__osRunningThread) -/* 00E260 7000D660 8F187730 */ lw $t8, %lo(__osRunningThread)($t8) -/* 00E264 7000D664 17000005 */ bnez $t8, .L7000D67C -/* 00E268 7000D668 00000000 */ nop -/* 00E26C 7000D66C 0C004241 */ jal __osDispatchThread -/* 00E270 7000D670 00000000 */ nop -/* 00E274 7000D674 1000000F */ b .L7000D6B4 -/* 00E278 7000D678 00000000 */ nop -.L7000D67C: -/* 00E27C 7000D67C 3C198002 */ lui $t9, %hi(__osRunningThread) -/* 00E280 7000D680 3C098002 */ lui $t1, %hi(__osRunQueue) -/* 00E284 7000D684 8D297728 */ lw $t1, %lo(__osRunQueue)($t1) -/* 00E288 7000D688 8F397730 */ lw $t9, %lo(__osRunningThread)($t9) -/* 00E28C 7000D68C 8D2A0004 */ lw $t2, 4($t1) -/* 00E290 7000D690 8F280004 */ lw $t0, 4($t9) -/* 00E294 7000D694 010A082A */ slt $at, $t0, $t2 -/* 00E298 7000D698 10200006 */ beqz $at, .L7000D6B4 -/* 00E29C 7000D69C 00000000 */ nop -/* 00E2A0 7000D6A0 240B0002 */ li $t3, 2 -/* 00E2A4 7000D6A4 3C048002 */ lui $a0, %hi(__osRunQueue) -/* 00E2A8 7000D6A8 A72B0010 */ sh $t3, 0x10($t9) -/* 00E2AC 7000D6AC 0C0041EB */ jal __osEnqueueAndYield -/* 00E2B0 7000D6B0 24847728 */ addiu $a0, %lo(__osRunQueue) # addiu $a0, $a0, 0x7728 -.L7000D6B4: -/* 00E2B4 7000D6B4 0C006184 */ jal __osRestoreInt -/* 00E2B8 7000D6B8 02002025 */ move $a0, $s0 -/* 00E2BC 7000D6BC 8FBF001C */ lw $ra, 0x1c($sp) -/* 00E2C0 7000D6C0 8FB00014 */ lw $s0, 0x14($sp) -/* 00E2C4 7000D6C4 8FB10018 */ lw $s1, 0x18($sp) -/* 00E2C8 7000D6C8 03E00008 */ jr $ra -/* 00E2CC 7000D6CC 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/src/libultra/viblack.c b/src/libultra/viblack.c new file mode 100644 index 00000000..277dfedb --- /dev/null +++ b/src/libultra/viblack.c @@ -0,0 +1,14 @@ +#include "libultra_internal.h" + +extern OSViContext *__osViNext; + +// TODO: name magic constants +void osViBlack(u8 active) { + register u32 int_disabled = __osDisableInt(); + if (active) { + __osViNext->unk00 |= 0x20; + } else { + __osViNext->unk00 &= ~0x20; + } + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/viblack.s b/src/libultra/viblack.s deleted file mode 100644 index c3c1a995..00000000 --- a/src/libultra/viblack.s +++ /dev/null @@ -1,40 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osViBlack -/* 00EED0 7000E2D0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00EED4 7000E2D4 AFBF001C */ sw $ra, 0x1c($sp) -/* 00EED8 7000E2D8 AFA40028 */ sw $a0, 0x28($sp) -/* 00EEDC 7000E2DC 0C00617C */ jal __osDisableInt -/* 00EEE0 7000E2E0 AFB00018 */ sw $s0, 0x18($sp) -/* 00EEE4 7000E2E4 93AE002B */ lbu $t6, 0x2b($sp) -/* 00EEE8 7000E2E8 00408025 */ move $s0, $v0 -/* 00EEEC 7000E2EC 11C00007 */ beqz $t6, .L7000E30C -/* 00EEF0 7000E2F0 00000000 */ nop -/* 00EEF4 7000E2F4 3C0F8003 */ lui $t7, %hi(__osViNext) -/* 00EEF8 7000E2F8 8DEF8044 */ lw $t7, %lo(__osViNext)($t7) -/* 00EEFC 7000E2FC 95F80000 */ lhu $t8, ($t7) -/* 00EF00 7000E300 37190020 */ ori $t9, $t8, 0x20 -/* 00EF04 7000E304 10000007 */ b .L7000E324 -/* 00EF08 7000E308 A5F90000 */ sh $t9, ($t7) -.L7000E30C: -/* 00EF0C 7000E30C 3C088003 */ lui $t0, %hi(__osViNext) -/* 00EF10 7000E310 8D088044 */ lw $t0, %lo(__osViNext)($t0) -/* 00EF14 7000E314 2401FFDF */ li $at, -33 -/* 00EF18 7000E318 95090000 */ lhu $t1, ($t0) -/* 00EF1C 7000E31C 01215024 */ and $t2, $t1, $at -/* 00EF20 7000E320 A50A0000 */ sh $t2, ($t0) -.L7000E324: -/* 00EF24 7000E324 0C006184 */ jal __osRestoreInt -/* 00EF28 7000E328 02002025 */ move $a0, $s0 -/* 00EF2C 7000E32C 8FBF001C */ lw $ra, 0x1c($sp) -/* 00EF30 7000E330 8FB00018 */ lw $s0, 0x18($sp) -/* 00EF34 7000E334 27BD0028 */ addiu $sp, $sp, 0x28 -/* 00EF38 7000E338 03E00008 */ jr $ra -/* 00EF3C 7000E33C 00000000 */ nop diff --git a/src/libultra/virtualtophysical.c b/src/libultra/virtualtophysical.c new file mode 100644 index 00000000..b1fb1a55 --- /dev/null +++ b/src/libultra/virtualtophysical.c @@ -0,0 +1,11 @@ +#include "libultra_internal.h" + +uintptr_t osVirtualToPhysical(void *addr) { + if ((uintptr_t) addr >= 0x80000000 && (uintptr_t) addr < 0xa0000000) { + return ((uintptr_t) addr & 0x1fffffff); + } else if ((uintptr_t) addr >= 0xa0000000 && (uintptr_t) addr < 0xc0000000) { + return ((uintptr_t) addr & 0x1fffffff); + } else { + return __osProbeTLB(addr); + } +} diff --git a/src/libultra/virtualtophysical.s b/src/libultra/virtualtophysical.s deleted file mode 100644 index f5586466..00000000 --- a/src/libultra/virtualtophysical.s +++ /dev/null @@ -1,44 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osVirtualToPhysical -/* 00F4B0 7000E8B0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 00F4B4 7000E8B4 AFA40018 */ sw $a0, 0x18($sp) -/* 00F4B8 7000E8B8 8FAE0018 */ lw $t6, 0x18($sp) -/* 00F4BC 7000E8BC 3C018000 */ lui $at, 0x8000 -/* 00F4C0 7000E8C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 00F4C4 7000E8C4 01C1082B */ sltu $at, $t6, $at -/* 00F4C8 7000E8C8 14200007 */ bnez $at, .L7000E8E8 -/* 00F4CC 7000E8CC 3C01A000 */ lui $at, 0xa000 -/* 00F4D0 7000E8D0 01C1082B */ sltu $at, $t6, $at -/* 00F4D4 7000E8D4 10200004 */ beqz $at, .L7000E8E8 -/* 00F4D8 7000E8D8 3C011FFF */ lui $at, (0x1FFFFFFF >> 16) # lui $at, 0x1fff -/* 00F4DC 7000E8DC 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 00F4E0 7000E8E0 1000000E */ b .L7000E91C -/* 00F4E4 7000E8E4 01C11024 */ and $v0, $t6, $at -.L7000E8E8: -/* 00F4E8 7000E8E8 8FAF0018 */ lw $t7, 0x18($sp) -/* 00F4EC 7000E8EC 3C01A000 */ lui $at, 0xa000 -/* 00F4F0 7000E8F0 01E1082B */ sltu $at, $t7, $at -/* 00F4F4 7000E8F4 14200007 */ bnez $at, .L7000E914 -/* 00F4F8 7000E8F8 3C01C000 */ lui $at, 0xc000 -/* 00F4FC 7000E8FC 01E1082B */ sltu $at, $t7, $at -/* 00F500 7000E900 10200004 */ beqz $at, .L7000E914 -/* 00F504 7000E904 3C011FFF */ lui $at, (0x1FFFFFFF >> 16) # lui $at, 0x1fff -/* 00F508 7000E908 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 00F50C 7000E90C 10000003 */ b .L7000E91C -/* 00F510 7000E910 01E11024 */ and $v0, $t7, $at -.L7000E914: -/* 00F514 7000E914 0C006408 */ jal __osProbeTLB -/* 00F518 7000E918 8FA40018 */ lw $a0, 0x18($sp) -.L7000E91C: -/* 00F51C 7000E91C 8FBF0014 */ lw $ra, 0x14($sp) -/* 00F520 7000E920 27BD0018 */ addiu $sp, $sp, 0x18 -/* 00F524 7000E924 03E00008 */ jr $ra -/* 00F528 7000E928 00000000 */ nop diff --git a/src/libultra/visetevent.c b/src/libultra/visetevent.c new file mode 100644 index 00000000..6969ec8f --- /dev/null +++ b/src/libultra/visetevent.c @@ -0,0 +1,11 @@ +#include "libultra_internal.h" + +extern OSViContext *__osViNext; + +void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount) { + register u32 int_disabled = __osDisableInt(); + (__osViNext)->mq = mq; + (__osViNext)->msg = msg; + (__osViNext)->retraceCount = retraceCount; + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/visetevent.s b/src/libultra/visetevent.s deleted file mode 100644 index e0ae7cdc..00000000 --- a/src/libultra/visetevent.s +++ /dev/null @@ -1,40 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osViSetEvent -/* 00E8C0 7000DCC0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00E8C4 7000DCC4 AFBF001C */ sw $ra, 0x1c($sp) -/* 00E8C8 7000DCC8 AFA40028 */ sw $a0, 0x28($sp) -/* 00E8CC 7000DCCC AFA5002C */ sw $a1, 0x2c($sp) -/* 00E8D0 7000DCD0 AFA60030 */ sw $a2, 0x30($sp) -/* 00E8D4 7000DCD4 0C00617C */ jal __osDisableInt -/* 00E8D8 7000DCD8 AFB00018 */ sw $s0, 0x18($sp) -/* 00E8DC 7000DCDC 3C0F8003 */ lui $t7, %hi(__osViNext) -/* 00E8E0 7000DCE0 8DEF8044 */ lw $t7, %lo(__osViNext)($t7) -/* 00E8E4 7000DCE4 8FAE0028 */ lw $t6, 0x28($sp) -/* 00E8E8 7000DCE8 3C198003 */ lui $t9, %hi(__osViNext) -/* 00E8EC 7000DCEC 3C098003 */ lui $t1, %hi(__osViNext) -/* 00E8F0 7000DCF0 ADEE0010 */ sw $t6, 0x10($t7) -/* 00E8F4 7000DCF4 8F398044 */ lw $t9, %lo(__osViNext)($t9) -/* 00E8F8 7000DCF8 8FB8002C */ lw $t8, 0x2c($sp) -/* 00E8FC 7000DCFC 00408025 */ move $s0, $v0 -/* 00E900 7000DD00 02002025 */ move $a0, $s0 -/* 00E904 7000DD04 AF380014 */ sw $t8, 0x14($t9) -/* 00E908 7000DD08 8D298044 */ lw $t1, %lo(__osViNext)($t1) -/* 00E90C 7000DD0C 8FA80030 */ lw $t0, 0x30($sp) -/* 00E910 7000DD10 0C006184 */ jal __osRestoreInt -/* 00E914 7000DD14 A5280002 */ sh $t0, 2($t1) -/* 00E918 7000DD18 8FBF001C */ lw $ra, 0x1c($sp) -/* 00E91C 7000DD1C 8FB00018 */ lw $s0, 0x18($sp) -/* 00E920 7000DD20 27BD0028 */ addiu $sp, $sp, 0x28 -/* 00E924 7000DD24 03E00008 */ jr $ra -/* 00E928 7000DD28 00000000 */ nop - - \ No newline at end of file diff --git a/src/libultra/visetmode.c b/src/libultra/visetmode.c new file mode 100644 index 00000000..716596fb --- /dev/null +++ b/src/libultra/visetmode.c @@ -0,0 +1,11 @@ +#include "libultra_internal.h" + +extern OSViContext *__osViNext; + +void osViSetMode(OSViMode *mode) { + register u32 int_disabled = __osDisableInt(); + __osViNext->modep = mode; + __osViNext->unk00 = 1; + __osViNext->features = __osViNext->modep->comRegs.ctrl; + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/visetmode.s b/src/libultra/visetmode.s deleted file mode 100644 index 86ab2bfb..00000000 --- a/src/libultra/visetmode.s +++ /dev/null @@ -1,36 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" -glabel osViSetMode -/* 00EC60 7000E060 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00EC64 7000E064 AFBF001C */ sw $ra, 0x1c($sp) -/* 00EC68 7000E068 AFA40028 */ sw $a0, 0x28($sp) -/* 00EC6C 7000E06C 0C00617C */ jal __osDisableInt -/* 00EC70 7000E070 AFB00018 */ sw $s0, 0x18($sp) -/* 00EC74 7000E074 3C0F8003 */ lui $t7, %hi(__osViNext) -/* 00EC78 7000E078 8DEF8044 */ lw $t7, %lo(__osViNext)($t7) -/* 00EC7C 7000E07C 8FAE0028 */ lw $t6, 0x28($sp) -/* 00EC80 7000E080 3C198003 */ lui $t9, %hi(__osViNext) -/* 00EC84 7000E084 24180001 */ li $t8, 1 -/* 00EC88 7000E088 ADEE0008 */ sw $t6, 8($t7) -/* 00EC8C 7000E08C 8F398044 */ lw $t9, %lo(__osViNext)($t9) -/* 00EC90 7000E090 3C088003 */ lui $t0, %hi(__osViNext) -/* 00EC94 7000E094 00408025 */ move $s0, $v0 -/* 00EC98 7000E098 A7380000 */ sh $t8, ($t9) -/* 00EC9C 7000E09C 8D088044 */ lw $t0, %lo(__osViNext)($t0) -/* 00ECA0 7000E0A0 02002025 */ move $a0, $s0 -/* 00ECA4 7000E0A4 8D090008 */ lw $t1, 8($t0) -/* 00ECA8 7000E0A8 8D2A0004 */ lw $t2, 4($t1) -/* 00ECAC 7000E0AC 0C006184 */ jal __osRestoreInt -/* 00ECB0 7000E0B0 AD0A000C */ sw $t2, 0xc($t0) -/* 00ECB4 7000E0B4 8FBF001C */ lw $ra, 0x1c($sp) -/* 00ECB8 7000E0B8 8FB00018 */ lw $s0, 0x18($sp) -/* 00ECBC 7000E0BC 27BD0028 */ addiu $sp, $sp, 0x28 -/* 00ECC0 7000E0C0 03E00008 */ jr $ra -/* 00ECC4 7000E0C4 00000000 */ nop diff --git a/src/libultra/viswapbuf.c b/src/libultra/viswapbuf.c new file mode 100644 index 00000000..c2cb1d50 --- /dev/null +++ b/src/libultra/viswapbuf.c @@ -0,0 +1,10 @@ +#include "libultra_internal.h" + +extern OSViContext *__osViNext; + +void osViSwapBuffer(void *vaddr) { + u32 int_disabled = __osDisableInt(); + __osViNext->buffer = vaddr; + __osViNext->unk00 |= 0x10; // TODO: figure out what this flag means + __osRestoreInt(int_disabled); +} diff --git a/src/libultra/viswapbuf.s b/src/libultra/viswapbuf.s deleted file mode 100644 index 46b439bd..00000000 --- a/src/libultra/viswapbuf.s +++ /dev/null @@ -1,31 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osViSwapBuffer -/* 00F090 7000E490 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 00F094 7000E494 AFBF0014 */ sw $ra, 0x14($sp) -/* 00F098 7000E498 0C00617C */ jal __osDisableInt -/* 00F09C 7000E49C AFA40020 */ sw $a0, 0x20($sp) -/* 00F0A0 7000E4A0 3C0F8003 */ lui $t7, %hi(__osViNext) -/* 00F0A4 7000E4A4 8DEF8044 */ lw $t7, %lo(__osViNext)($t7) -/* 00F0A8 7000E4A8 8FAE0020 */ lw $t6, 0x20($sp) -/* 00F0AC 7000E4AC AFA2001C */ sw $v0, 0x1c($sp) -/* 00F0B0 7000E4B0 3C188003 */ lui $t8, %hi(__osViNext) -/* 00F0B4 7000E4B4 ADEE0004 */ sw $t6, 4($t7) -/* 00F0B8 7000E4B8 8F188044 */ lw $t8, %lo(__osViNext)($t8) -/* 00F0BC 7000E4BC 97190000 */ lhu $t9, ($t8) -/* 00F0C0 7000E4C0 37280010 */ ori $t0, $t9, 0x10 -/* 00F0C4 7000E4C4 A7080000 */ sh $t0, ($t8) -/* 00F0C8 7000E4C8 0C006184 */ jal __osRestoreInt -/* 00F0CC 7000E4CC 8FA4001C */ lw $a0, 0x1c($sp) -/* 00F0D0 7000E4D0 8FBF0014 */ lw $ra, 0x14($sp) -/* 00F0D4 7000E4D4 27BD0020 */ addiu $sp, $sp, 0x20 -/* 00F0D8 7000E4D8 03E00008 */ jr $ra -/* 00F0DC 7000E4DC 00000000 */ nop diff --git a/src/motor.c b/src/motor.c index 436cd0b9..5c15b3ab 100644 --- a/src/motor.c +++ b/src/motor.c @@ -1,4 +1,5 @@ #include "ultra64.h" +#include "libultra/controller.h" //0x800655a0 char _MotorStopData[256]; //800656a0 diff --git a/src/sched.c b/src/sched.c index 357edeb8..0d868ca2 100644 --- a/src/sched.c +++ b/src/sched.c @@ -105,8 +105,8 @@ void CheckDisplayErrorBufferEvery16Frames(u32 framecount) { if (userCompareValue < (osGetCount() - currentcount)) { - write_stderr_to_buffer((u32*)cfb_16_a); - write_stderr_to_buffer((u32*)cfb_16_b); + write_stderr_to_buffer((u32*)cfb_16[0]); + write_stderr_to_buffer((u32*)cfb_16[1]); } } } diff --git a/src/structs.h b/src/structs.h new file mode 100644 index 00000000..2d8c1c58 --- /dev/null +++ b/src/structs.h @@ -0,0 +1,56 @@ +#ifndef _TED_H_ +#define _TED_H_ + +#include "ultra64.h" +#include "game/stan.h" + +// Staying here for the moment. + +enum EObjectClass { // u8 + Zero, + NormalObj1, + Door, + Guard, + NormalObject2, + Unknown, + OtherPlayer +}; + +struct float3 { + float x; + float y; + float z; +}; + +struct float2 { + float x; + float z; +}; + +struct prop { + u8 type; // enum EObjectClass + u8 flags; + s16 timetoregen; + union { + struct chrdata* chr; + // struct defaultobj *obj; + // struct doorobj *door; + // struct weaponobj *weapon; + // struct explosion *explosion; + // struct smoke *smoke; + }; + /* 0x08 */ + struct float3 position; + /* 0x14 */ + struct StandTile * standTile; + /* 0x18 */ + u32 unknown_0x18; + /* 0x1C */ + struct prop * host; + struct prop * child; + struct prop * nextSibling; + struct prop * prevSibling; + u8 rooms[4]; +}; + +#endif diff --git a/src/tlb_hardwire.c b/src/tlb_hardwire.c deleted file mode 100644 index c9c2b5e1..00000000 --- a/src/tlb_hardwire.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "ultra64.h" -#include "tlb_hardwire.h" - -/** - * @file tlb_hardwire.c - * This file contains code to set tlb entries to 2 - * -it should become an assembly file - */ - - -/** - * 29B0 70001BB0 - * sets #hardwired TLB entries to 2 - */ -#ifdef NONMATCHING -void set_hardwire_TLB_to_2(void) { - setCopReg(0,Wired,2,0); - setCopReg(0,Context,0,0); -} -#else -GLOBAL_ASM( -.text -glabel set_hardwire_TLB_to_2 -/* 0027B0 70001BB0 24080002 */ li $t0, 2 -/* 0027B4 70001BB4 40883000 */ mtc0 $t0, $6 -/* 0027B8 70001BB8 24080000 */ li $t0, 0 -/* 0027BC 70001BBC 40882000 */ mtc0 $t0, $4 -/* 0027C0 70001BC0 03E00008 */ jr $ra -/* 0027C4 70001BC4 00000000 */ nop -) -#endif \ No newline at end of file diff --git a/src/tlb_hardwire.s b/src/tlb_hardwire.s new file mode 100644 index 00000000..c77d5c2d --- /dev/null +++ b/src/tlb_hardwire.s @@ -0,0 +1,20 @@ +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 + +.include "macros.inc" + + +.section .text, "ax" +/** + * 29B0 70001BB0 + * sets hardwired TLB entries to 2 + */ +glabel set_hardwire_TLB_to_2 +/* 0027B0 70001BB0 24080002 */ li $t0, 2 +/* 0027B4 70001BB4 40883000 */ mtc0 $t0, $6 +/* 0027B8 70001BB8 24080000 */ li $t0, 0 +/* 0027BC 70001BBC 40882000 */ mtc0 $t0, $4 +/* 0027C0 70001BC0 03E00008 */ jr $ra +/* 0027C4 70001BC4 00000000 */ nop diff --git a/src/tlb_resolve.c b/src/tlb_resolve.s similarity index 59% rename from src/tlb_resolve.c rename to src/tlb_resolve.s index b00d91da..5454c030 100644 --- a/src/tlb_resolve.c +++ b/src/tlb_resolve.s @@ -1,29 +1,12 @@ -#include "ultra64.h" -#include "tlb_resolve.h" +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 -/** - * @file tlb_resolve.c - * This file contains code to load/resolve TLBaddress. - */ +.include "macros.inc" -/** - * 2760 70001B60 - * loads/resolves TLB address, writting random entry - */ -#ifdef NONMATCHING -//i should probably remain as assembly, maybe even moved to a .s -void resolve_TLBaddress_for_InvalidHit(void) -{ - setCopReg(0,PageMask,0,0); - setCopReg(0,EntryLo0,(longlong)*(int *)(Context + TLB_manager_mapping_table_end),0); - setCopReg(0,EntryLo1,(longlong)(*(int *)(Context + TLB_manager_mapping_table_end) + 0x40),0); - TLB_write_random_entry(Random,EntryHi,EntryLo0,EntryLo1,PageMask); - return; -} -#else -GLOBAL_ASM( -.text +.section .text, "ax" glabel resolve_TLBaddress_for_InvalidHit /* 002760 70001B60 40802800 */ mtc0 $zero, $5 /* 002764 70001B64 00000000 */ nop @@ -44,8 +27,7 @@ glabel resolve_TLBaddress_for_InvalidHit /* 0027A0 70001BA0 00000000 */ nop /* 0027A4 70001BA4 00000000 */ nop /* 0027A8 70001BA8 42000018 */ eret -) -#endif + diff --git a/src/vi.c b/src/vi.c index f660d1d4..09f65a11 100644 --- a/src/vi.c +++ b/src/vi.c @@ -1,5 +1,5 @@ #include "ultra64.h" -#include "gbi.h" +#include "PR/gbi.h" OSMesg vi_c_debug_MSG[0x8]; OSMesgQueue vi_c_debug_MQ; diff --git a/src/video.c b/src/video.c index 69266bc1..5e8fbed8 100644 --- a/src/video.c +++ b/src/video.c @@ -3,6 +3,7 @@ #include "vi.h" #include "video.h" #include "bondgame.h" +#include "unk_093880.h" // pPlayer /** * @file video.c @@ -12,12 +13,15 @@ //data u32 D_80023240 = 0; -struct video_settings video1_settings = {0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, 320, 240, 320, 240, 0, 0, 1, 0}; -struct video_settings video2_settings = {0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, 320, 240, 320, 240, 0, 0, 1, 0}; +struct video_settings video1_settings[] = +{ + {0, 0, 0, 0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, 320, 240, 320, 240, 0, 0, 1, 0}, + {0, 0, 0, 0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, 320, 240, 320, 240, 0, 0, 1, 0} +}; s32 D_8002329C = 0; s32 D_800232A0 = 0; -video_settings * ptr_video_settings1 = &video1_settings; -video_settings * ptr_video_settings2 = &video1_settings; +video_settings *ptr_video_settings1 = &video1_settings[0]; +video_settings *ptr_video_settings2 = &video1_settings[0]; s32 coloroutputmode = 1; s32 D_800232B0 = 1; s32 D_800232B4 = 0; @@ -31,21 +35,14 @@ s32 rgb_32bit_grabnum = 1; //rodata - - - - - - //bss -char dword_CODE_bss_800607E0[0x40]; -Mtx *m; -u16 word_CODE_bss_80060824; +f32 projectionMatrixF[4][4]; +Mtx *projectionMatrix; +u16 perspNorm; char dword_CODE_bss_80060828[0x50]; u8 off_CODE_bss_80060878; u8 off_CODE_bss_80060879; -//struct osViMode viMode; -s32 viMode; +OSViMode *viMode; s32 dword_CODE_bss_80060880; s32 dword_CODE_bss_80060884; s32 dword_CODE_bss_80060888; @@ -56,16 +53,21 @@ char dword_CODE_bss_80060890[0x400];//CC[0x3C4]; * 3C60 70003060 */ #ifdef NONMATCHING +// regalloc void init_video_settings(void) { - video1_settings.frameb = cfb_16_a; - D_8002329C = 0; - D_800232A0 = 0; - ptr_video_settings1 = &video1_settings; - ptr_video_settings2 = &video2_settings; + video_settings* v1; + video_settings* v2; off_CODE_bss_80060878 = 0; off_CODE_bss_80060879 = 1; - video2_settings.frameb = cfb_16_b; + v1 = &video1_settings[off_CODE_bss_80060878]; + ptr_video_settings1 = v1; + ptr_video_settings1->framebuf = cfb_16[off_CODE_bss_80060878]; + v2 = &video1_settings[off_CODE_bss_80060879]; + ptr_video_settings2 = v2; + ptr_video_settings2->framebuf = cfb_16[off_CODE_bss_80060879]; + D_8002329C = 0; + D_800232A0 = 0; } #else GLOBAL_ASM( @@ -85,9 +87,9 @@ glabel init_video_settings /* 003C8C 7000308C 3C058006 */ lui $a1, %hi(off_CODE_bss_80060879) /* 003C90 70003090 00007812 */ mflo $t7 /* 003C94 70003094 3C068002 */ lui $a2, %hi(ptr_video_settings1) -/* 003C98 70003098 3C09803B */ lui $t1, %hi(cfb_16_a) # $t1, 0x803b +/* 003C98 70003098 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b /* 003C9C 7000309C 0322C823 */ subu $t9, $t9, $v0 -/* 003CA0 700030A0 25295000 */ addiu $t1, %lo(cfb_16_a) # addiu $t1, $t1, 0x5000 +/* 003CA0 700030A0 25295000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, 0x5000 /* 003CA4 700030A4 24C632A4 */ addiu $a2, %lo(ptr_video_settings1) # addiu $a2, $a2, 0x32a4 /* 003CA8 700030A8 24A50879 */ addiu $a1, %lo(off_CODE_bss_80060879) # addiu $a1, $a1, 0x879 /* 003CAC 700030AC 24840878 */ addiu $a0, %lo(off_CODE_bss_80060878) # addiu $a0, $a0, 0x878 @@ -123,116 +125,49 @@ glabel init_video_settings ) #endif - - -/** - * 3D24 70003124 initialize both video buffers - */ -#ifdef NONMATCHING void init_both_video_buffers(void) { s32 i; - - remove_viewport_buffer(); - for (i = 0; i != 0x25800; i += 4) - { - cfb_16_a[i] = 0; - cfb_16_b[i] = 0; - cfb_16_a[i + 1] = 0; - cfb_16_b[i + 1] = 0; - cfb_16_a[i + 2] = 0; - cfb_16_b[i + 2] = 0; - cfb_16_a[i + 3] = 0; - cfb_16_b[i + 3] = 0; - }; + u8* p1 = cfb_16[0]; + u8* p2 = cfb_16[1]; + zbufDeallocate(); + for (i = 0; i < 320*240*2; i++) { + p1[i] = 0; + p2[i] = 0; + } } -#else -GLOBAL_ASM( -.text -glabel init_both_video_buffers -/* 003D24 70003124 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 003D28 70003128 AFBF0014 */ sw $ra, 0x14($sp) -/* 003D2C 7000312C 0FC348E0 */ jal remove_viewport_buffer -/* 003D30 70003130 00000000 */ nop -/* 003D34 70003134 3C070002 */ lui $a3, (0x00025800 >> 16) # lui $a3, 2 -/* 003D38 70003138 3C06803E */ lui $a2, %hi(cfb_16_b) # $a2, 0x803e -/* 003D3C 7000313C 3C05803B */ lui $a1, %hi(cfb_16_a) # $a1, 0x803b -/* 003D40 70003140 24A55000 */ addiu $a1, %lo(cfb_16_a) # addiu $a1, $a1, 0x5000 -/* 003D44 70003144 24C6A800 */ addiu $a2, %lo(cfb_16_b) # addiu $a2, $a2, -0x5800 -/* 003D48 70003148 34E75800 */ ori $a3, (0x00025800 & 0xFFFF) # ori $a3, $a3, 0x5800 -/* 003D4C 7000314C 00002025 */ move $a0, $zero -.L70003150: -/* 003D50 70003150 00A41021 */ addu $v0, $a1, $a0 -/* 003D54 70003154 A0400000 */ sb $zero, ($v0) -/* 003D58 70003158 00C41821 */ addu $v1, $a2, $a0 -/* 003D5C 7000315C A0600000 */ sb $zero, ($v1) -/* 003D60 70003160 A0400001 */ sb $zero, 1($v0) -/* 003D64 70003164 A0600001 */ sb $zero, 1($v1) -/* 003D68 70003168 A0400002 */ sb $zero, 2($v0) -/* 003D6C 7000316C A0600002 */ sb $zero, 2($v1) -/* 003D70 70003170 A0400003 */ sb $zero, 3($v0) -/* 003D74 70003174 24840004 */ addiu $a0, $a0, 4 -/* 003D78 70003178 1487FFF5 */ bne $a0, $a3, .L70003150 -/* 003D7C 7000317C A0600003 */ sb $zero, 3($v1) -/* 003D80 70003180 8FBF0014 */ lw $ra, 0x14($sp) -/* 003D84 70003184 27BD0018 */ addiu $sp, $sp, 0x18 -/* 003D88 70003188 03E00008 */ jr $ra -/* 003D8C 7000318C 00000000 */ nop -) -#endif -/** - * 3D90 70003190 ???; 2->800232BC - */ -#ifdef NONMATCHING void video_related_6(s32 arg0) { - D_800232BC = (s32) (arg0 + 2); + arg0 += 2; + D_800232BC = arg0; } -#else -GLOBAL_ASM( -.text -glabel video_related_6 -/* 003D90 70003190 24840002 */ addiu $a0, $a0, 2 -/* 003D94 70003194 3C018002 */ lui $at, %hi(D_800232BC) -/* 003D98 70003198 03E00008 */ jr $ra -/* 003D9C 7000319C AC2432BC */ sw $a0, %lo(D_800232BC)($at) -) -#endif /** * 3DA0 700031A0 */ #ifdef NONMATCHING -void *video_related_7(void) -{ +// regalloc +void video_related_7(void) { s32 temp_lo; - s32 temp_t6; - - if (D_800232B8 != 0) - { - temp_t6 = D_800232B8 + -1; - D_800232B8 = temp_t6; - if (temp_t6 == 0) - { + if (D_800232B8 != 0) { + D_800232B8--; + if (D_800232B8 == 0) { D_800232B4 = 0; } } temp_lo = D_800232B0 * D_800232B4; - viMode->OSViCommonRegs.hstart /*unk30*/ = (s32) (((((s32) viMode+0x8 >> 0x10) + temp_lo) << 0x10) | ((viMode+0x8 + temp_lo) & 0xffff)); - viMode->OSViFieldRegs[0].origin /*unk44*/ = (s32) (((((s32) viMode+0xC >> 0x10) + temp_lo) << 0x10) | ((viMode+0xC + temp_lo) & 0xffff)); - osViSetMode(viMode, &viMode); - osViBlack(*(D_800232BC + 3)); - if (D_800232BC != 0) - { - if (D_800232BC < 3) - { - D_800232BC = (s32) (D_800232BC + -1); + viMode->fldRegs[0].vStart = (((dword_CODE_bss_80060884 >> 16) + temp_lo) << 16) | ((dword_CODE_bss_80060884 + temp_lo) & 0xffff); + viMode->fldRegs[1].vStart = (((dword_CODE_bss_80060888 >> 16) + temp_lo) << 16) | ((dword_CODE_bss_80060888 + temp_lo) & 0xffff); + osViSetMode(viMode); + osViBlack(D_800232BC); + if (D_800232BC != 0) { + if (D_800232BC < 3) { + D_800232BC--; } } - osViSetSpecialFeatures(0x42); - D_800232B0 = (s32) -(s32) D_800232B0; - return &D_800232B0; + osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF); + D_800232B0 = -D_800232B0; } #else GLOBAL_ASM( @@ -501,7 +436,7 @@ block_19: phi_f0 = 1.0f; } temp_t1 = (D_800232C0 * 4); - (0x80020000 + temp_t1)->unk30B4 = (f32) ((f32) ptr_video_settings2->unk4 / (f32) ptr_video_settings2->unk18); + (0x80020000 + temp_t1)->unk30B4 = (f32) ((f32) ptr_video_settings1->unk4 / (f32) ptr_video_settings2->unk18); (0x80020000 + temp_t1)->unk30BC = (f32) phi_f0; if (*ptr_video_settings2 == 1) { @@ -634,11 +569,11 @@ block_43: D_800232C0 = (s32) phi_t9_4; if (coloroutputmode != 0) { - fast3d_related_array->unk58 = (void *) ptr_video_settings2->frameb; + fast3d_related_array->unk58 = (void *) ptr_video_settings2->framebuf; } else { - fast3d_related_array->unk58 = &cfb_16_a; + fast3d_related_array->unk58 = &cfb_16; } temp_t7_4 = (off_CODE_bss_80060878 + 1); temp_t8_6 = (off_CODE_bss_80060879 + 1); @@ -668,7 +603,7 @@ block_43: temp_a1 = (&video1_settings + (off_CODE_bss_80060879 * 0x2c)); *&ptr_video_settings2 = temp_a1; bcopy(*&ptr_video_settings2, temp_a1, 0x2c, &video1_settings); - ptr_video_settings2->frameb = (s32) ((off_CODE_bss_80060879 * 0x25800) + &cfb_16_a); + ptr_video_settings2->framebuf = (s32) ((off_CODE_bss_80060879 * 0x25800) + &cfb_16); } #else GLOBAL_ASM( @@ -1197,8 +1132,8 @@ glabel video_related_8 .L70003A0C: /* 00460C 70003A0C 3C198005 */ lui $t9, %hi(fast3d_related_array) /* 004610 70003A10 8F39EAB0 */ lw $t9, %lo(fast3d_related_array)($t9) -/* 004614 70003A14 3C0E803B */ lui $t6, %hi(cfb_16_a) # $t6, 0x803b -/* 004618 70003A18 25CE5000 */ addiu $t6, %lo(cfb_16_a) # addiu $t6, $t6, 0x5000 +/* 004614 70003A14 3C0E803B */ lui $t6, %hi(cfb_16) # $t6, 0x803b +/* 004618 70003A18 25CE5000 */ addiu $t6, %lo(cfb_16) # addiu $t6, $t6, 0x5000 /* 00461C 70003A1C AF2E0058 */ sw $t6, 0x58($t9) .L70003A20: /* 004620 70003A20 3C028006 */ lui $v0, %hi(off_CODE_bss_80060878) @@ -1243,8 +1178,8 @@ glabel video_related_8 /* 0046B4 70003AB4 3C038006 */ lui $v1, %hi(off_CODE_bss_80060879) /* 0046B8 70003AB8 24630879 */ addiu $v1, %lo(off_CODE_bss_80060879) # addiu $v1, $v1, 0x879 /* 0046BC 70003ABC 90780000 */ lbu $t8, ($v1) -/* 0046C0 70003AC0 3C0E803B */ lui $t6, %hi(cfb_16_a) # $t6, 0x803b -/* 0046C4 70003AC4 25CE5000 */ addiu $t6, %lo(cfb_16_a) # addiu $t6, $t6, 0x5000 +/* 0046C0 70003AC0 3C0E803B */ lui $t6, %hi(cfb_16) # $t6, 0x803b +/* 0046C4 70003AC4 25CE5000 */ addiu $t6, %lo(cfb_16) # addiu $t6, $t6, 0x5000 /* 0046C8 70003AC8 00187880 */ sll $t7, $t8, 2 /* 0046CC 70003ACC 01F87821 */ addu $t7, $t7, $t8 /* 0046D0 70003AD0 000F7880 */ sll $t7, $t7, 2 @@ -1263,124 +1198,33 @@ glabel video_related_8 ) #endif - -/** - * 4704 70003B04 ???; 800232B4=(word)F12, 800232B8=0xA - * accepts: F12= - */ -#ifdef NONMATCHING -void video_related_9(float param_1) +void video_related_9(f32 param_1) { - float fVar1; - - fVar1 = 14.00000000; - if (param_1 <= 14.00000000) { - fVar1 = param_1; + if (param_1 > 14.0f) { + param_1 = 14.0f; } - if (fVar1 < 0.00000000) { - D_800232B4 = 0; - } - else { - D_800232B4 = (int)fVar1; + if (param_1 < 0.0f) { + param_1 = 0.0f; } + D_800232B4 = param_1; D_800232B8 = 10; } -#else -GLOBAL_ASM( -.text -glabel video_related_9 -/* 004704 70003B04 3C014160 */ li $at, 0x41600000 # 14.000000 -/* 004708 70003B08 44810000 */ mtc1 $at, $f0 -/* 00470C 70003B0C 00000000 */ nop -/* 004710 70003B10 460C003C */ c.lt.s $f0, $f12 -/* 004714 70003B14 00000000 */ nop -/* 004718 70003B18 45020003 */ bc1fl .L70003B28 -/* 00471C 70003B1C 44800000 */ mtc1 $zero, $f0 -/* 004720 70003B20 46000306 */ mov.s $f12, $f0 -/* 004724 70003B24 44800000 */ mtc1 $zero, $f0 -.L70003B28: -/* 004728 70003B28 00000000 */ nop -/* 00472C 70003B2C 4600603C */ c.lt.s $f12, $f0 -/* 004730 70003B30 00000000 */ nop -/* 004734 70003B34 45020003 */ bc1fl .L70003B44 -/* 004738 70003B38 4600610D */ trunc.w.s $f4, $f12 -/* 00473C 70003B3C 46000306 */ mov.s $f12, $f0 -/* 004740 70003B40 4600610D */ trunc.w.s $f4, $f12 -.L70003B44: -/* 004744 70003B44 3C018002 */ lui $at, %hi(D_800232B4) -/* 004748 70003B48 2418000A */ li $t8, 10 -/* 00474C 70003B4C 440F2000 */ mfc1 $t7, $f4 -/* 004750 70003B50 00000000 */ nop -/* 004754 70003B54 AC2F32B4 */ sw $t7, %lo(D_800232B4)($at) -/* 004758 70003B58 3C018002 */ lui $at, %hi(D_800232B8) -/* 00475C 70003B5C 03E00008 */ jr $ra -/* 004760 70003B60 AC3832B8 */ sw $t8, %lo(D_800232B8)($at) -) -#endif - - - -/** - * 4764 70003B64 - */ -//Even though this is defined in vi.h, it also must be in this file to be seen?? -extern OSMesgQueue vi_c_debug_MQ; -void receive_vi_c_msgs(int msgcount){ - do { - osRecvMesg(&vi_c_debug_MQ,NULL,1); - msgcount += -1; - } while (0 < msgcount); +void receive_vi_c_msgs(int msgcount) { + do { + osRecvMesg(&vi_c_debug_MQ, NULL, 1); + msgcount--; + } while (msgcount > 0); } - -/** - * 47B0 70003BB0 - */ -#ifdef NONMATCHING +const s16 widths_80028480[] = {320, 320, 640}; +const s16 heights_80028488[] = {240, 240, 480}; void setVideoWidthHeightToMode(s32 videomode) { - u16 widths_80028480[] = {320, 320, 640}; - u16 heights_80028488[] = {240, 240, 480}; - ptr_video_settings2->mode = videomode; - - ptr_video_settings2->somethingW = widths_80028480[videomode]; - ptr_video_settings2->txtClipW = widths_80028480[videomode]; - - ptr_video_settings2->somethingH = heights_80028488[videomode]; - ptr_video_settings2->txtClipH = heights_80028488[videomode]; + ptr_video_settings2->x = ptr_video_settings2->bufx = widths_80028480[videomode]; + ptr_video_settings2->y = ptr_video_settings2->bufy = heights_80028488[videomode]; } -#else -const u16 widths_80028480[] = {320, 320, 640}; -const u16 heights_80028488[] = {240, 240, 480}; //is this not 16bit and a list of 320x240 and 640x480 - 3 widths, 3 heights -GLOBAL_ASM( -.text -glabel setVideoWidthHeightToMode -/* 0047B0 70003BB0 3C058002 */ lui $a1, %hi(ptr_video_settings2) -/* 0047B4 70003BB4 24A532A8 */ addiu $a1, %lo(ptr_video_settings2) # addiu $a1, $a1, 0x32a8 -/* 0047B8 70003BB8 8CAE0000 */ lw $t6, ($a1) -/* 0047BC 70003BBC 00041840 */ sll $v1, $a0, 1 -/* 0047C0 70003BC0 3C028003 */ lui $v0, %hi(widths_80028480) -/* 0047C4 70003BC4 A1C40000 */ sb $a0, ($t6) -/* 0047C8 70003BC8 00431021 */ addu $v0, $v0, $v1 -/* 0047CC 70003BCC 84428480 */ lh $v0, %lo(widths_80028480)($v0) -/* 0047D0 70003BD0 8CAF0000 */ lw $t7, ($a1) -/* 0047D4 70003BD4 A5E20018 */ sh $v0, 0x18($t7) -/* 0047D8 70003BD8 8CB80000 */ lw $t8, ($a1) -/* 0047DC 70003BDC A7020004 */ sh $v0, 4($t8) -/* 0047E0 70003BE0 3C028003 */ lui $v0, %hi(heights_80028488) -/* 0047E4 70003BE4 00431021 */ addu $v0, $v0, $v1 -/* 0047E8 70003BE8 84428488 */ lh $v0, %lo(heights_80028488)($v0) -/* 0047EC 70003BEC 8CB90000 */ lw $t9, ($a1) -/* 0047F0 70003BF0 A722001A */ sh $v0, 0x1a($t9) -/* 0047F4 70003BF4 8CA80000 */ lw $t0, ($a1) -/* 0047F8 70003BF8 03E00008 */ jr $ra -/* 0047FC 70003BFC A5020006 */ sh $v0, 6($t0) -) -#endif - - /** * 4800 70003C00 sets colour output mode to 16bit [800232AC=1] @@ -1403,7 +1247,7 @@ void set_coloroutputmode_32bit(void) */ u8 * get_video_settings2_frameb(void) { - return ptr_video_settings2->frameb; + return ptr_video_settings2->framebuf; } /** @@ -1411,7 +1255,7 @@ u8 * get_video_settings2_frameb(void) */ u8 * get_video_settings1_frameb(void) { - return ptr_video_settings1->frameb; + return ptr_video_settings1->framebuf; } /** @@ -1419,344 +1263,56 @@ u8 * get_video_settings1_frameb(void) */ void set_video2buf_frameb(u8 *arg0) { - ptr_video_settings2->frameb = arg0; + ptr_video_settings2->framebuf = arg0; } /** * 484C 70003C4C V0= halfword [80060824] */ u16 get_80060824(void) { - return word_CODE_bss_80060824; + return perspNorm; } -/** - * 4858 70003C58 - */ -#ifdef NONMATCHING -void *video_related_F(void *arg0) -{ - void *temp_s0; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v1; - void *phi_s0; - - if (pPlayer != 0) - { - (pPlayer + (off_CODE_bss_80060879 * 0x10))->unk7D0 = (s16) (ptr_video_settings2->unk1C * 2); - (pPlayer + (off_CODE_bss_80060879 * 0x10))->unk7D8 = (s16) ((ptr_video_settings2->unk1C * 2) + (ptr_video_settings2->unk20 * 4)); - (pPlayer + (off_CODE_bss_80060879 * 0x10))->unk7D2 = (s16) (ptr_video_settings2->unk1E * 2); - (pPlayer + (off_CODE_bss_80060879 * 0x10))->unk7DA = (s16) ((ptr_video_settings2->unk1E * 2) + (ptr_video_settings2->unk22 * 4)); +Gfx *video_related_F(Gfx *gdl) { + if (pPlayer != NULL) { + pPlayer->viewports[off_CODE_bss_80060879].vp.vscale[0] = (ptr_video_settings2->viewx * 2); + pPlayer->viewports[off_CODE_bss_80060879].vp.vtrans[0] = (ptr_video_settings2->viewx * 2) + (ptr_video_settings2->viewleft * 4); + pPlayer->viewports[off_CODE_bss_80060879].vp.vscale[1] = (ptr_video_settings2->viewy * 2); + pPlayer->viewports[off_CODE_bss_80060879].vp.vtrans[1] = (ptr_video_settings2->viewy * 2) + (ptr_video_settings2->viewtop * 4); } - arg0->unk0 = 0x3800010; - arg0->unk4 = (s32) ((pPlayer + (off_CODE_bss_80060879 * 0x10)) + 0x800007d0); - temp_s0 = arg0 + 8; - m = sub_GAME_7F0BD6E0(&off_CODE_bss_80060879, &pPlayer); - guPerspectiveF(&dword_CODE_bss_800607E0, &word_CODE_bss_80060824, ptr_video_settings2->far, ptr_video_settings2->scale, (f32) ptr_video_settings2->aspect, (f32) ptr_video_settings2->unk14, 1.0f); - guMtxF2L(&dword_CODE_bss_800607E0, m); - temp_v0 = temp_s0; - temp_v0->unk0 = 0x1030040; - temp_s0 = temp_s0 + 8; - temp_v0->unk4 = (s32) (m + 0x80000000); - temp_v1 = temp_s0; - temp_v1->unk0 = 0xbc00000e; - temp_s0 = temp_s0 + 8; - temp_v1->unk4 = (?32) word_CODE_bss_80060824; - set_BONDdata_field_10D8(m, &m); - set_BONDdata_field_10DC(&dword_CODE_bss_800607E0); - temp_v0_2 = temp_s0; - if (coloroutputmode != 0) - { - temp_v0_3 = temp_s0; - temp_v0_3->unk0 = (s32) (((ptr_video_settings2->unk18 + -1) & 0xfff) | 0xff100000); - temp_v0_3->unk4 = (s32) (ptr_video_settings2->frameb + 0x80000000); - phi_s0 = temp_s0 + 8; + gSPViewport(gdl++, ((s32)&pPlayer->viewports[off_CODE_bss_80060879] + 0x80000000)); + projectionMatrix = sub_GAME_7F0BD6E0(); + guPerspectiveF(projectionMatrixF, &perspNorm, ptr_video_settings2->fovy, ptr_video_settings2->aspect, ptr_video_settings2->near, ptr_video_settings2->far, 1.0f); + guMtxF2L(projectionMatrixF, projectionMatrix); + gSPMatrix(gdl++, ((s32)projectionMatrix + 0x80000000), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPPerspNormalize(gdl++, perspNorm); + currentPlayerSetProjectionMatrix(projectionMatrix); + currentPlayerSetProjectionMatrixF(projectionMatrixF); + if (coloroutputmode != MODE_32BIT) { + gDPSetColorImage(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ptr_video_settings2->bufx, (ptr_video_settings2->framebuf + 0x80000000)); } - else - { - temp_v0_2->unk4 = 0x3b5000; - temp_v0_2->unk0 = (s32) (((ptr_video_settings2->unk18 + -1) & 0xfff) | 0xff180000); - phi_s0 = temp_s0 + 8; + else { + gDPSetColorImage(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_32b, ptr_video_settings2->bufx, (cfb_16[0] + 0x80000000)); } - return phi_s0; -} -#else -GLOBAL_ASM( -.text -glabel video_related_F -/* 004858 70003C58 3C058008 */ lui $a1, %hi(pPlayer) -/* 00485C 70003C5C 24A5A0B0 */ addiu $a1, %lo(pPlayer) # addiu $a1, $a1, -0x5f50 -/* 004860 70003C60 8CA20000 */ lw $v0, ($a1) -/* 004864 70003C64 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 004868 70003C68 AFB00024 */ sw $s0, 0x24($sp) -/* 00486C 70003C6C 00808025 */ move $s0, $a0 -/* 004870 70003C70 AFBF002C */ sw $ra, 0x2c($sp) -/* 004874 70003C74 1040002A */ beqz $v0, .L70003D20 -/* 004878 70003C78 AFB10028 */ sw $s1, 0x28($sp) -/* 00487C 70003C7C 3C118002 */ lui $s1, %hi(ptr_video_settings2) -/* 004880 70003C80 263132A8 */ addiu $s1, %lo(ptr_video_settings2) # addiu $s1, $s1, 0x32a8 -/* 004884 70003C84 8E2E0000 */ lw $t6, ($s1) -/* 004888 70003C88 3C048006 */ lui $a0, %hi(off_CODE_bss_80060879) -/* 00488C 70003C8C 24840879 */ addiu $a0, %lo(off_CODE_bss_80060879) # addiu $a0, $a0, 0x879 -/* 004890 70003C90 90990000 */ lbu $t9, ($a0) -/* 004894 70003C94 85CF001C */ lh $t7, 0x1c($t6) -/* 004898 70003C98 00194100 */ sll $t0, $t9, 4 -/* 00489C 70003C9C 00484821 */ addu $t1, $v0, $t0 -/* 0048A0 70003CA0 000FC040 */ sll $t8, $t7, 1 -/* 0048A4 70003CA4 A53807D0 */ sh $t8, 0x7d0($t1) -/* 0048A8 70003CA8 8E230000 */ lw $v1, ($s1) -/* 0048AC 70003CAC 90990000 */ lbu $t9, ($a0) -/* 0048B0 70003CB0 8CAF0000 */ lw $t7, ($a1) -/* 0048B4 70003CB4 846A001C */ lh $t2, 0x1c($v1) -/* 0048B8 70003CB8 846C0020 */ lh $t4, 0x20($v1) -/* 0048BC 70003CBC 00194100 */ sll $t0, $t9, 4 -/* 0048C0 70003CC0 000A5840 */ sll $t3, $t2, 1 -/* 0048C4 70003CC4 000C6880 */ sll $t5, $t4, 2 -/* 0048C8 70003CC8 016D7021 */ addu $t6, $t3, $t5 -/* 0048CC 70003CCC 01E8C021 */ addu $t8, $t7, $t0 -/* 0048D0 70003CD0 A70E07D8 */ sh $t6, 0x7d8($t8) -/* 0048D4 70003CD4 8E290000 */ lw $t1, ($s1) -/* 0048D8 70003CD8 908D0000 */ lbu $t5, ($a0) -/* 0048DC 70003CDC 8CAB0000 */ lw $t3, ($a1) -/* 0048E0 70003CE0 852A001E */ lh $t2, 0x1e($t1) -/* 0048E4 70003CE4 000DC900 */ sll $t9, $t5, 4 -/* 0048E8 70003CE8 01797821 */ addu $t7, $t3, $t9 -/* 0048EC 70003CEC 000A6040 */ sll $t4, $t2, 1 -/* 0048F0 70003CF0 A5EC07D2 */ sh $t4, 0x7d2($t7) -/* 0048F4 70003CF4 8E230000 */ lw $v1, ($s1) -/* 0048F8 70003CF8 908B0000 */ lbu $t3, ($a0) -/* 0048FC 70003CFC 8CAD0000 */ lw $t5, ($a1) -/* 004900 70003D00 8468001E */ lh $t0, 0x1e($v1) -/* 004904 70003D04 84780022 */ lh $t8, 0x22($v1) -/* 004908 70003D08 000BC900 */ sll $t9, $t3, 4 -/* 00490C 70003D0C 00087040 */ sll $t6, $t0, 1 -/* 004910 70003D10 00184880 */ sll $t1, $t8, 2 -/* 004914 70003D14 01C95021 */ addu $t2, $t6, $t1 -/* 004918 70003D18 01B96021 */ addu $t4, $t5, $t9 -/* 00491C 70003D1C A58A07DA */ sh $t2, 0x7da($t4) -.L70003D20: -/* 004920 70003D20 3C0F0380 */ lui $t7, (0x03800010 >> 16) # lui $t7, 0x380 -/* 004924 70003D24 3C048006 */ lui $a0, %hi(off_CODE_bss_80060879) -/* 004928 70003D28 35EF0010 */ ori $t7, (0x03800010 & 0xFFFF) # ori $t7, $t7, 0x10 -/* 00492C 70003D2C 02001025 */ move $v0, $s0 -/* 004930 70003D30 24840879 */ addiu $a0, %lo(off_CODE_bss_80060879) # addiu $a0, $a0, 0x879 -/* 004934 70003D34 AC4F0000 */ sw $t7, ($v0) -/* 004938 70003D38 90980000 */ lbu $t8, ($a0) -/* 00493C 70003D3C 8CA80000 */ lw $t0, ($a1) -/* 004940 70003D40 3C018000 */ lui $at, (0x800007D0 >> 16) -/* 004944 70003D44 00187100 */ sll $t6, $t8, 4 -/* 004948 70003D48 342107D0 */ ori $at, (0x800007D0 & 0xFFFF) # ori $at, $at, 0x7d0 -/* 00494C 70003D4C 010E4821 */ addu $t1, $t0, $t6 -/* 004950 70003D50 3C118002 */ lui $s1, %hi(ptr_video_settings2) -/* 004954 70003D54 01215821 */ addu $t3, $t1, $at -/* 004958 70003D58 263132A8 */ addiu $s1, %lo(ptr_video_settings2) # addiu $s1, $s1, 0x32a8 -/* 00495C 70003D5C AC4B0004 */ sw $t3, 4($v0) -/* 004960 70003D60 0FC2F5B8 */ jal sub_GAME_7F0BD6E0 -/* 004964 70003D64 26100008 */ addiu $s0, $s0, 8 -/* 004968 70003D68 3C018006 */ lui $at, %hi(m) -/* 00496C 70003D6C AC220820 */ sw $v0, %lo(m)($at) -/* 004970 70003D70 8E230000 */ lw $v1, ($s1) -/* 004974 70003D74 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 004978 70003D78 44814000 */ mtc1 $at, $f8 -/* 00497C 70003D7C C4640010 */ lwc1 $f4, 0x10($v1) -/* 004980 70003D80 8C660008 */ lw $a2, 8($v1) -/* 004984 70003D84 8C67000C */ lw $a3, 0xc($v1) -/* 004988 70003D88 E7A40010 */ swc1 $f4, 0x10($sp) -/* 00498C 70003D8C C4660014 */ lwc1 $f6, 0x14($v1) -/* 004990 70003D90 3C048006 */ lui $a0, %hi(dword_CODE_bss_800607E0) -/* 004994 70003D94 3C058006 */ lui $a1, %hi(word_CODE_bss_80060824) -/* 004998 70003D98 24A50824 */ addiu $a1, %lo(word_CODE_bss_80060824) # addiu $a1, $a1, 0x824 -/* 00499C 70003D9C 248407E0 */ addiu $a0, %lo(dword_CODE_bss_800607E0) # addiu $a0, $a0, 0x7e0 -/* 0049A0 70003DA0 E7A80018 */ swc1 $f8, 0x18($sp) -/* 0049A4 70003DA4 0C003F20 */ jal guPerspectiveF -/* 0049A8 70003DA8 E7A60014 */ swc1 $f6, 0x14($sp) -/* 0049AC 70003DAC 3C048006 */ lui $a0, %hi(dword_CODE_bss_800607E0) -/* 0049B0 70003DB0 3C058006 */ lui $a1, %hi(m) -/* 0049B4 70003DB4 8CA50820 */ lw $a1, %lo(m)($a1) -/* 0049B8 70003DB8 0C003FC4 */ jal guMtxF2L -/* 0049BC 70003DBC 248407E0 */ addiu $a0, %lo(dword_CODE_bss_800607E0) # addiu $a0, $a0, 0x7e0 -/* 0049C0 70003DC0 3C0D0103 */ lui $t5, (0x01030040 >> 16) # lui $t5, 0x103 -/* 0049C4 70003DC4 3C058006 */ lui $a1, %hi(m) -/* 0049C8 70003DC8 35AD0040 */ ori $t5, (0x01030040 & 0xFFFF) # ori $t5, $t5, 0x40 -/* 0049CC 70003DCC 02001025 */ move $v0, $s0 -/* 0049D0 70003DD0 24A50820 */ addiu $a1, %lo(m) # addiu $a1, $a1, 0x820 -/* 0049D4 70003DD4 AC4D0000 */ sw $t5, ($v0) -/* 0049D8 70003DD8 8CB90000 */ lw $t9, ($a1) -/* 0049DC 70003DDC 3C018000 */ lui $at, 0x8000 -/* 0049E0 70003DE0 26100008 */ addiu $s0, $s0, 8 -/* 0049E4 70003DE4 3C0CBC00 */ lui $t4, (0xBC00000E >> 16) # lui $t4, 0xbc00 -/* 0049E8 70003DE8 03215021 */ addu $t2, $t9, $at -/* 0049EC 70003DEC AC4A0004 */ sw $t2, 4($v0) -/* 0049F0 70003DF0 358C000E */ ori $t4, (0xBC00000E & 0xFFFF) # ori $t4, $t4, 0xe -/* 0049F4 70003DF4 02001825 */ move $v1, $s0 -/* 0049F8 70003DF8 AC6C0000 */ sw $t4, ($v1) -/* 0049FC 70003DFC 3C0F8006 */ lui $t7, %hi(word_CODE_bss_80060824) -/* 004A00 70003E00 95EF0824 */ lhu $t7, %lo(word_CODE_bss_80060824)($t7) -/* 004A04 70003E04 26100008 */ addiu $s0, $s0, 8 -/* 004A08 70003E08 AC6F0004 */ sw $t7, 4($v1) -/* 004A0C 70003E0C 0FC1E0D9 */ jal set_BONDdata_field_10D8 -/* 004A10 70003E10 8CA40000 */ lw $a0, ($a1) -/* 004A14 70003E14 3C048006 */ lui $a0, %hi(dword_CODE_bss_800607E0) -/* 004A18 70003E18 0FC1E0F5 */ jal set_BONDdata_field_10DC -/* 004A1C 70003E1C 248407E0 */ addiu $a0, %lo(dword_CODE_bss_800607E0) # addiu $a0, $a0, 0x7e0 -/* 004A20 70003E20 3C188002 */ lui $t8, %hi(coloroutputmode) -/* 004A24 70003E24 8F1832AC */ lw $t8, %lo(coloroutputmode)($t8) -/* 004A28 70003E28 02001025 */ move $v0, $s0 -/* 004A2C 70003E2C 3C01FF18 */ lui $at, 0xff18 -/* 004A30 70003E30 53000011 */ beql $t8, $zero, .L70003E78 -/* 004A34 70003E34 8E2F0000 */ lw $t7, ($s1) -/* 004A38 70003E38 8E280000 */ lw $t0, ($s1) -/* 004A3C 70003E3C 3C01FF10 */ lui $at, 0xff10 -/* 004A40 70003E40 02001025 */ move $v0, $s0 -/* 004A44 70003E44 850E0018 */ lh $t6, 0x18($t0) -/* 004A48 70003E48 26100008 */ addiu $s0, $s0, 8 -/* 004A4C 70003E4C 25C9FFFF */ addiu $t1, $t6, -1 -/* 004A50 70003E50 312B0FFF */ andi $t3, $t1, 0xfff -/* 004A54 70003E54 01616825 */ or $t5, $t3, $at -/* 004A58 70003E58 AC4D0000 */ sw $t5, ($v0) -/* 004A5C 70003E5C 8E390000 */ lw $t9, ($s1) -/* 004A60 70003E60 3C018000 */ lui $at, 0x8000 -/* 004A64 70003E64 8F2A0028 */ lw $t2, 0x28($t9) -/* 004A68 70003E68 01416021 */ addu $t4, $t2, $at -/* 004A6C 70003E6C 1000000B */ b .L70003E9C -/* 004A70 70003E70 AC4C0004 */ sw $t4, 4($v0) -/* 004A74 70003E74 8E2F0000 */ lw $t7, ($s1) -.L70003E78: -/* 004A78 70003E78 3C0B003B */ lui $t3, %hi(0x003B5000) # $t3, 0x3b -/* 004A7C 70003E7C 256B5000 */ addiu $t3, %lo(0x003B5000) # addiu $t3, $t3, 0x5000 -/* 004A80 70003E80 85F80018 */ lh $t8, 0x18($t7) -/* 004A84 70003E84 AC4B0004 */ sw $t3, 4($v0) -/* 004A88 70003E88 26100008 */ addiu $s0, $s0, 8 -/* 004A8C 70003E8C 2708FFFF */ addiu $t0, $t8, -1 -/* 004A90 70003E90 310E0FFF */ andi $t6, $t0, 0xfff -/* 004A94 70003E94 01C14825 */ or $t1, $t6, $at -/* 004A98 70003E98 AC490000 */ sw $t1, ($v0) -.L70003E9C: -/* 004A9C 70003E9C 8FBF002C */ lw $ra, 0x2c($sp) -/* 004AA0 70003EA0 02001025 */ move $v0, $s0 -/* 004AA4 70003EA4 8FB00024 */ lw $s0, 0x24($sp) -/* 004AA8 70003EA8 8FB10028 */ lw $s1, 0x28($sp) -/* 004AAC 70003EAC 03E00008 */ jr $ra -/* 004AB0 70003EB0 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - - - -/** - * 4AB4 70003EB4 - */ -#ifdef NONMATCHING -s32 video_related_10(s32 arg0) -{ - s32 phi_a0; - - phi_a0 = arg0; - if (ptr_video_settings2->unk24 != 0) - { - phi_a0 = sub_GAME_7F0D2518(sub_GAME_7F0D2464()); - } - return phi_a0; -} -#else -GLOBAL_ASM( -.text -glabel video_related_10 -/* 004AB4 70003EB4 3C0E8002 */ lui $t6, %hi(ptr_video_settings2) -/* 004AB8 70003EB8 8DCE32A8 */ lw $t6, %lo(ptr_video_settings2)($t6) -/* 004ABC 70003EBC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 004AC0 70003EC0 AFBF0014 */ sw $ra, 0x14($sp) -/* 004AC4 70003EC4 8DCF0024 */ lw $t7, 0x24($t6) -/* 004AC8 70003EC8 51E00007 */ beql $t7, $zero, .L70003EE8 -/* 004ACC 70003ECC 8FBF0014 */ lw $ra, 0x14($sp) -/* 004AD0 70003ED0 0FC34919 */ jal sub_GAME_7F0D2464 -/* 004AD4 70003ED4 00000000 */ nop -/* 004AD8 70003ED8 0FC34946 */ jal sub_GAME_7F0D2518 -/* 004ADC 70003EDC 00402025 */ move $a0, $v0 -/* 004AE0 70003EE0 00402025 */ move $a0, $v0 -/* 004AE4 70003EE4 8FBF0014 */ lw $ra, 0x14($sp) -.L70003EE8: -/* 004AE8 70003EE8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 004AEC 70003EEC 00801025 */ move $v0, $a0 -/* 004AF0 70003EF0 03E00008 */ jr $ra -/* 004AF4 70003EF4 00000000 */ nop -) -#endif - - -/** - * 4AF8 70003EF8 generate a generic fillrect; fries: AT,A1,A2,A3,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 - * V0=new display list address - * accepts: A0=p->display list - */ -#ifdef NONMATCHING -s32 insert_generic_fillrect(void *arg0) //either of type Dynamic Struct or GFX Array, however Im betting Dynamic since Dynamic can contain a GFX plus other settings -{ - void *temp_a1; - void *temp_a3; - - // copied from a demo of what is probably going on here - /* - * pointers to build the display list. - / - dynamicp = &dynamic; //glist[0]); - */ - // so arg0 is probably pointer to dynamic struct containing glist. - // nothing is actually returned per say since its added to glist at a higher level. - - //arg0->unk4 = 0x300000; - //arg0->unk0 = 0xba001402; - gDPSetCycleType(glistp++, G_CYC_1CYCLE); - - //temp_a1 = arg0 + 8; - //temp_a3 = temp_a1 + 8; - //temp_a1->unk0 = (s32) (((((ptr_video_settings2->unk18 + -1) & 0x3ff) << 0xe) | 0xf6000000) | (((ptr_video_settings2->unk1A + -1) & 0x3ff) * 4)); - //temp_a1->unk4 = 0; - gDPFillRectangle(glistp++, 0, 0, SCREEN_WD-1, SCREEN_HT-1); - //temp_a3->unk0 = 0xe7000000; - //temp_a3->unk4 = 0; - gDPPipeSync(glistp++); - //return temp_a3 + 8; + return gdl; } -#else -GLOBAL_ASM( -.text -glabel insert_generic_fillrect -/* 004AF8 70003EF8 3C0EBA00 */ lui $t6, (0xBA001402 >> 16) # lui $t6, 0xba00 #gsDPSetCycleType -/* 004AFC 70003EFC 35CE1402 */ ori $t6, (0xBA001402 & 0xFFFF) # ori $t6, $t6, 0x1402 -/* 004B00 70003F00 3C0F0030 */ lui $t7, 0x30 #G_CYC_1CYCLE -/* 004B04 70003F04 AC8F0004 */ sw $t7, 4($a0) -/* 004B08 70003F08 AC8E0000 */ sw $t6, ($a0) -/* 004B0C 70003F0C 3C068002 */ lui $a2, %hi(ptr_video_settings2) -/* 004B10 70003F10 8CC632A8 */ lw $a2, %lo(ptr_video_settings2)($a2) -/* 004B14 70003F14 24850008 */ addiu $a1, $a0, 8 -/* 004B18 70003F18 3C01F600 */ lui $at, 0xf600 -/* 004B1C 70003F1C 84D80018 */ lh $t8, 0x18($a2) -/* 004B20 70003F20 84CB001A */ lh $t3, 0x1a($a2) -/* 004B24 70003F24 24A70008 */ addiu $a3, $a1, 8 -/* 004B28 70003F28 2719FFFF */ addiu $t9, $t8, -1 -/* 004B2C 70003F2C 332803FF */ andi $t0, $t9, 0x3ff -/* 004B30 70003F30 256CFFFF */ addiu $t4, $t3, -1 -/* 004B34 70003F34 318D03FF */ andi $t5, $t4, 0x3ff -/* 004B38 70003F38 00084B80 */ sll $t1, $t0, 0xe -/* 004B3C 70003F3C 01215025 */ or $t2, $t1, $at -/* 004B40 70003F40 000D7080 */ sll $t6, $t5, 2 -/* 004B44 70003F44 014E7825 */ or $t7, $t2, $t6 -/* 004B48 70003F48 ACAF0000 */ sw $t7, ($a1) -/* 004B4C 70003F4C ACA00004 */ sw $zero, 4($a1) -/* 004B50 70003F50 3C18E700 */ lui $t8, 0xe700 -/* 004B54 70003F54 ACF80000 */ sw $t8, ($a3) -/* 004B58 70003F58 ACE00004 */ sw $zero, 4($a3) -/* 004B5C 70003F5C 03E00008 */ jr $ra -/* 004B60 70003F60 24E20008 */ addiu $v0, $a3, 8 -) -#endif - +Gfx *zbufClearCurrentPlayer(Gfx *gdl); +Gfx *zbufInit(Gfx *gdl); +Gfx *video_related_10(Gfx *gdl) { + if (ptr_video_settings2->usezbuf != 0) { + gdl = zbufClearCurrentPlayer(zbufInit(gdl)); + } + return gdl; +} +Gfx *insert_generic_fillrect(Gfx *gdl) { + gDPSetCycleType(gdl++, G_CYC_FILL); + gDPFillRectangle(gdl++, 0, 0, ptr_video_settings2->bufx - 1, ptr_video_settings2->bufy - 1); + gDPPipeSync(gdl++); + return gdl; +} /** * 4B64 70003F64 @@ -1793,28 +1349,28 @@ void *setupscreensfornumplayers(void *arg0) temp_v1->unk4 = 0x10001; temp_v1->unk0 = 0xf7000000; phi_s0 = temp_s0; - if (get_video2_settings_uly() > 0) + if (viGetViewTop() > 0) { phi_s0 = temp_s0; if (sub_GAME_7F09B4D8(get_cur_playernum()) == 0) { temp_s0 = temp_s0 + 8; - sp58->unk0 = (s32) (((((get_video2_settings_uly() + -1) & 0x3ff) * 4) | 0xf6000000) | (((((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10) + -1) & 0x3ff) << 0xe)); + sp58->unk0 = (s32) (((((viGetViewTop() + -1) & 0x3ff) * 4) | 0xf6000000) | (((((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10) + -1) & 0x3ff) << 0xe)); sp58->unk4 = 0; temp_s0->unk0 = 0xe7000000; temp_s0->unk4 = 0; phi_s0 = temp_s0 + 8; } } - if (get_num_players() == 1) + if (getPlayerCount() == 1) { - sp22 = get_video2_settings_height(); + sp22 = viGetViewHeight(); phi_s0_4 = phi_s0; - if ((((s32) (get_video2_settings_uly() << 0x10) >> 0x10) + sp22) < get_video2_settings_txtClipH()) + if ((((s32) (viGetViewTop() << 0x10) >> 0x10) + sp22) < get_video2_settings_txtClipH()) { temp_s0_2 = phi_s0 + 8; sp50->unk0 = (s32) (((((get_video2_settings_txtClipH() + -1) & 0x3ff) * 4) | 0xf6000000) | (((((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10) + -1) & 0x3ff) << 0xe)); - sp50->unk4 = (s32) (((get_video2_settings_height() + ((s32) (get_video2_settings_uly() << 0x10) >> 0x10)) & 0x3ff) * 4); + sp50->unk4 = (s32) (((viGetViewHeight() + ((s32) (viGetViewTop() << 0x10) >> 0x10)) & 0x3ff) * 4); temp_s0_2->unk4 = 0; temp_s0_2->unk0 = 0xe7000000; phi_s0_4 = temp_s0_2 + 8; @@ -1825,15 +1381,15 @@ void *setupscreensfornumplayers(void *arg0) phi_s0_4 = phi_s0; if (sub_GAME_7F09B4D8(get_cur_playernum()) == 0) { - sp20 = get_video2_settings_height(); - sp22 = get_video2_settings_height(); + sp20 = viGetViewHeight(); + sp22 = viGetViewHeight(); phi_s0_2 = phi_s0; - if (((((s32) (get_video2_settings_uly() << 0x10) >> 0x10) + sp22) + sp20) < get_video2_settings_txtClipH()) + if (((((s32) (viGetViewTop() << 0x10) >> 0x10) + sp22) + sp20) < get_video2_settings_txtClipH()) { temp_s0_3 = phi_s0 + 8; sp48->unk0 = (s32) (((((get_video2_settings_txtClipH() + -1) & 0x3ff) * 4) | 0xf6000000) | (((((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10) + -1) & 0x3ff) << 0xe)); - sp22 = get_video2_settings_height(); - sp48->unk4 = (s32) ((((get_video2_settings_height() + ((s32) (get_video2_settings_uly() << 0x10) >> 0x10)) + sp22) & 0x3ff) * 4); + sp22 = viGetViewHeight(); + sp48->unk4 = (s32) ((((viGetViewHeight() + ((s32) (viGetViewTop() << 0x10) >> 0x10)) + sp22) & 0x3ff) * 4); temp_s0_3->unk0 = 0xe7000000; temp_s0_3->unk4 = 0; phi_s0_2 = temp_s0_3 + 8; @@ -1847,7 +1403,7 @@ void *setupscreensfornumplayers(void *arg0) temp_s0_4 = temp_s0_4 + 8; temp_s1_2 = temp_s0_4; phi_s0_3 = temp_s0_4; - if (get_num_players() >= 3) + if (getPlayerCount() >= 3) { temp_s0_4 = temp_s0_4 + 8; temp_s1_2->unk0 = (s32) ((((get_video2_settings_txtClipH() + -1) & 0x3ff) * 4) | 0xf6280000); @@ -1857,7 +1413,7 @@ void *setupscreensfornumplayers(void *arg0) phi_s0_3 = temp_s0_4 + 8; } phi_s0_4 = phi_s0_3; - if (get_num_players() == 3) + if (getPlayerCount() == 3) { temp_s0_5 = phi_s0_3 + 8; sp30->unk0 = (s32) (((((get_video2_settings_txtClipH() + -1) & 0x3ff) * 4) | 0xf6000000) | (((((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10) + -1) & 0x3ff) << 0xe)); @@ -1918,7 +1474,7 @@ glabel setupscreensfornumplayers /* 004C08 70004008 014E7825 */ or $t7, $t2, $t6 /* 004C0C 7000400C AF0F0004 */ sw $t7, 4($t8) /* 004C10 70004010 AC680004 */ sw $t0, 4($v1) -/* 004C14 70004014 0C001149 */ jal get_video2_settings_uly +/* 004C14 70004014 0C001149 */ jal viGetViewTop /* 004C18 70004018 AC790000 */ sw $t9, ($v1) /* 004C1C 7000401C 1840001F */ blez $v0, .L7000409C /* 004C20 70004020 00000000 */ nop @@ -1933,7 +1489,7 @@ glabel setupscreensfornumplayers /* 004C44 70004044 26100008 */ addiu $s0, $s0, 8 /* 004C48 70004048 00028C00 */ sll $s1, $v0, 0x10 /* 004C4C 7000404C 00114C03 */ sra $t1, $s1, 0x10 -/* 004C50 70004050 0C001149 */ jal get_video2_settings_uly +/* 004C50 70004050 0C001149 */ jal viGetViewTop /* 004C54 70004054 01208825 */ move $s1, $t1 /* 004C58 70004058 244BFFFF */ addiu $t3, $v0, -1 /* 004C5C 7000405C 8FA40058 */ lw $a0, 0x58($sp) @@ -1953,14 +1509,14 @@ glabel setupscreensfornumplayers /* 004C94 70004094 AC600004 */ sw $zero, 4($v1) /* 004C98 70004098 26100008 */ addiu $s0, $s0, 8 .L7000409C: -/* 004C9C 7000409C 0FC26919 */ jal get_num_players +/* 004C9C 7000409C 0FC26919 */ jal getPlayerCount /* 004CA0 700040A0 00000000 */ nop /* 004CA4 700040A4 24010001 */ li $at, 1 /* 004CA8 700040A8 14410030 */ bne $v0, $at, .L7000416C /* 004CAC 700040AC 00000000 */ nop -/* 004CB0 700040B0 0C00112B */ jal get_video2_settings_height +/* 004CB0 700040B0 0C00112B */ jal viGetViewHeight /* 004CB4 700040B4 00000000 */ nop -/* 004CB8 700040B8 0C001149 */ jal get_video2_settings_uly +/* 004CB8 700040B8 0C001149 */ jal viGetViewTop /* 004CBC 700040BC A7A20022 */ sh $v0, 0x22($sp) /* 004CC0 700040C0 00028C00 */ sll $s1, $v0, 0x10 /* 004CC4 700040C4 00114C03 */ sra $t1, $s1, 0x10 @@ -1988,11 +1544,11 @@ glabel setupscreensfornumplayers /* 004D1C 7000411C 0141C025 */ or $t8, $t2, $at /* 004D20 70004120 00084B80 */ sll $t1, $t0, 0xe /* 004D24 70004124 03095825 */ or $t3, $t8, $t1 -/* 004D28 70004128 0C001149 */ jal get_video2_settings_uly +/* 004D28 70004128 0C001149 */ jal viGetViewTop /* 004D2C 7000412C AD8B0000 */ sw $t3, ($t4) /* 004D30 70004130 00028C00 */ sll $s1, $v0, 0x10 /* 004D34 70004134 00116C03 */ sra $t5, $s1, 0x10 -/* 004D38 70004138 0C00112B */ jal get_video2_settings_height +/* 004D38 70004138 0C00112B */ jal viGetViewHeight /* 004D3C 7000413C 01A08825 */ move $s1, $t5 /* 004D40 70004140 8FB90050 */ lw $t9, 0x50($sp) /* 004D44 70004144 00517021 */ addu $t6, $v0, $s1 @@ -2012,11 +1568,11 @@ glabel setupscreensfornumplayers /* 004D78 70004178 00402025 */ move $a0, $v0 /* 004D7C 7000417C 5440007C */ bnezl $v0, .L70004370 /* 004D80 70004180 8FBF001C */ lw $ra, 0x1c($sp) -/* 004D84 70004184 0C00112B */ jal get_video2_settings_height +/* 004D84 70004184 0C00112B */ jal viGetViewHeight /* 004D88 70004188 00000000 */ nop -/* 004D8C 7000418C 0C00112B */ jal get_video2_settings_height +/* 004D8C 7000418C 0C00112B */ jal viGetViewHeight /* 004D90 70004190 A7A20020 */ sh $v0, 0x20($sp) -/* 004D94 70004194 0C001149 */ jal get_video2_settings_uly +/* 004D94 70004194 0C001149 */ jal viGetViewTop /* 004D98 70004198 A7A20022 */ sh $v0, 0x22($sp) /* 004D9C 7000419C 00028C00 */ sll $s1, $v0, 0x10 /* 004DA0 700041A0 0011C403 */ sra $t8, $s1, 0x10 @@ -2046,13 +1602,13 @@ glabel setupscreensfornumplayers /* 004E00 70004200 03214025 */ or $t0, $t9, $at /* 004E04 70004204 00095B80 */ sll $t3, $t1, 0xe /* 004E08 70004208 010B6025 */ or $t4, $t0, $t3 -/* 004E0C 7000420C 0C00112B */ jal get_video2_settings_height +/* 004E0C 7000420C 0C00112B */ jal viGetViewHeight /* 004E10 70004210 ADAC0000 */ sw $t4, ($t5) -/* 004E14 70004214 0C001149 */ jal get_video2_settings_uly +/* 004E14 70004214 0C001149 */ jal viGetViewTop /* 004E18 70004218 A7A20022 */ sh $v0, 0x22($sp) /* 004E1C 7000421C 00028C00 */ sll $s1, $v0, 0x10 /* 004E20 70004220 00117403 */ sra $t6, $s1, 0x10 -/* 004E24 70004224 0C00112B */ jal get_video2_settings_height +/* 004E24 70004224 0C00112B */ jal viGetViewHeight /* 004E28 70004228 01C08825 */ move $s1, $t6 /* 004E2C 7000422C 87AA0022 */ lh $t2, 0x22($sp) /* 004E30 70004230 00517821 */ addu $t7, $v0, $s1 @@ -2083,7 +1639,7 @@ glabel setupscreensfornumplayers /* 004E90 70004290 3C18E700 */ lui $t8, 0xe700 /* 004E94 70004294 AC780000 */ sw $t8, ($v1) /* 004E98 70004298 AC600004 */ sw $zero, 4($v1) -/* 004E9C 7000429C 0FC26919 */ jal get_num_players +/* 004E9C 7000429C 0FC26919 */ jal getPlayerCount /* 004EA0 700042A0 26100008 */ addiu $s0, $s0, 8 /* 004EA4 700042A4 28410003 */ slti $at, $v0, 3 /* 004EA8 700042A8 14200011 */ bnez $at, .L700042F0 @@ -2105,7 +1661,7 @@ glabel setupscreensfornumplayers /* 004EE8 700042E8 AC600004 */ sw $zero, 4($v1) /* 004EEC 700042EC 26100008 */ addiu $s0, $s0, 8 .L700042F0: -/* 004EF0 700042F0 0FC26919 */ jal get_num_players +/* 004EF0 700042F0 0FC26919 */ jal getPlayerCount /* 004EF4 700042F4 00000000 */ nop /* 004EF8 700042F8 24010003 */ li $at, 3 /* 004EFC 700042FC 5441001C */ bnel $v0, $at, .L70004370 @@ -2190,8 +1746,8 @@ s32 get_D_8002329C(void) */ void set_video2_settings_offset_18_1A(s16 arg0, s16 arg1) { - ptr_video_settings2->somethingW = arg0; - ptr_video_settings2->somethingH = arg1; + ptr_video_settings2->bufx = arg0; + ptr_video_settings2->bufy = arg1; } /** @@ -2200,7 +1756,7 @@ void set_video2_settings_offset_18_1A(s16 arg0, s16 arg1) */ s16 get_video2_settings_offset_18(void) { - return ptr_video_settings2->somethingW; + return ptr_video_settings2->bufx; } /** @@ -2209,7 +1765,7 @@ s16 get_video2_settings_offset_18(void) */ s16 get_video2_settings_offset_1A(void) { - return ptr_video_settings2->somethingH; + return ptr_video_settings2->bufy; } /** @@ -2218,9 +1774,9 @@ s16 get_video2_settings_offset_1A(void) * A0->[p@800232A8+4], SP+0 * A1->[p@800232A8+6], SP+4 */ -void set_video2_text_clip_size(s16 txtClipW, s16 txtClipH) { - ptr_video_settings2->txtClipW = txtClipW; - ptr_video_settings2->txtClipH = txtClipH; +void set_video2_text_clip_size(s16 x, s16 y) { + ptr_video_settings2->x = x; + ptr_video_settings2->y = y; } /** @@ -2228,7 +1784,7 @@ void set_video2_text_clip_size(s16 txtClipW, s16 txtClipH) { * V0= video2 text clip width [p@800232A8+4]; fry T6 */ s16 get_video2_settings_txtClipW(void) { - return ptr_video_settings2->txtClipW; + return ptr_video_settings2->x; } /** @@ -2236,7 +1792,7 @@ s16 get_video2_settings_txtClipW(void) { * V0= video2 text clip height [p@800232A8+6]; fry T6 */ s16 get_video2_settings_txtClipH(void) { - return ptr_video_settings2->txtClipH; + return ptr_video_settings2->y; } /** @@ -2244,11 +1800,11 @@ s16 get_video2_settings_txtClipH(void) { * set video2 width (A0) and height (A1) */ #ifdef NONMATCHING -void set_video2_width_height(short width,short height) { - ptr_video_settings2->width = width; - ptr_video_settings2->height = height; - set_BONDdata_screensize(ptr_video_settings2->width,ptr_video_settings2->height); - sub_GAME_7F077C5C(); +void set_video2_width_height(short viewx,short viewy) { + ptr_video_settings2->viewx = viewx; + ptr_video_settings2->viewy = viewy; + currentPlayerSetScreenSize(ptr_video_settings2->viewx,ptr_video_settings2->viewy); + currentPlayerSetCameraScale(); return; } #else @@ -2271,9 +1827,9 @@ glabel set_video2_width_height /* 005070 70004470 448A2000 */ mtc1 $t2, $f4 /* 005074 70004474 448B3000 */ mtc1 $t3, $f6 /* 005078 70004478 46802320 */ cvt.s.w $f12, $f4 -/* 00507C 7000447C 0FC1DEF6 */ jal set_BONDdata_screensize +/* 00507C 7000447C 0FC1DEF6 */ jal currentPlayerSetScreenSize /* 005080 70004480 468033A0 */ cvt.s.w $f14, $f6 -/* 005084 70004484 0FC1DF17 */ jal sub_GAME_7F077C5C +/* 005084 70004484 0FC1DF17 */ jal currentPlayerSetCameraScale /* 005088 70004488 00000000 */ nop /* 00508C 7000448C 8FBF0014 */ lw $ra, 0x14($sp) /* 005090 70004490 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2288,16 +1844,16 @@ glabel set_video2_width_height * 509C 7000449C * V0= video2 lrx [p@800232A8+1C]; fry T6 */ -s16 get_video2_settings_width(void) { - return ptr_video_settings2->width; +s16 viGetViewWidth(void) { + return ptr_video_settings2->viewx; } /** * 50AC 700044AC * V0= video2 lry [p@800232A8+1E]; fry T6 */ -s16 get_video2_settings_height(void) { - return ptr_video_settings2->height; +s16 viGetViewHeight(void) { + return ptr_video_settings2->viewy; } /** @@ -2305,11 +1861,11 @@ s16 get_video2_settings_height(void) { * set video2 ulx (A0) and uly (A1) */ #ifdef NONMATCHING -void set_video2_ulx_uly(s16 ulx, s16 uly) +void set_video2_ulx_uly(s16 viewleft, s16 viewtop) { - ptr_video_settings2->ulx = ulx; - ptr_video_settings2->ulx = uly; - set_ulx_uly((f32) ptr_video_settings2->ulx, (f32) ptr_video_settings2->uly); + ptr_video_settings2->viewleft = viewleft; + ptr_video_settings2->viewleft = viewtop; + currentPlayerSetScreenPosition((f32) ptr_video_settings2->viewleft, (f32) ptr_video_settings2->viewtop); } #else GLOBAL_ASM( @@ -2331,7 +1887,7 @@ glabel set_video2_ulx_uly /* 0050F0 700044F0 448A2000 */ mtc1 $t2, $f4 /* 0050F4 700044F4 448B3000 */ mtc1 $t3, $f6 /* 0050F8 700044F8 46802320 */ cvt.s.w $f12, $f4 -/* 0050FC 700044FC 0FC1DF05 */ jal set_ulx_uly +/* 0050FC 700044FC 0FC1DF05 */ jal currentPlayerSetScreenPosition /* 005100 70004500 468033A0 */ cvt.s.w $f14, $f6 /* 005104 70004504 8FBF0014 */ lw $ra, 0x14($sp) /* 005108 70004508 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2346,16 +1902,16 @@ glabel set_video2_ulx_uly * 5114 70004514 * V0= video2 ulx [p@800232A8+20]; fry T6 */ -s16 get_video2_settings_ulx(void) { - return ptr_video_settings2->ulx; +s16 viGetViewLeft(void) { + return ptr_video_settings2->viewleft; } /** * 5124 70004524 * V0= video2 uly [p@800232A8+22]; fry T6 */ -s16 get_video2_settings_uly(void) { - return ptr_video_settings2->uly; +s16 viGetViewTop(void) { + return ptr_video_settings2->viewtop; } /** @@ -2363,7 +1919,7 @@ s16 get_video2_settings_uly(void) { * A0->[p@800232A8+24]; fry T6 */ void set_video2_settings_offset_24(int param_1) { - ptr_video_settings2->anonymous_12 = param_1; + ptr_video_settings2->usezbuf = param_1; } /** @@ -2372,9 +1928,9 @@ void set_video2_settings_offset_24(int param_1) { #ifdef NONMATCHING void setvideo_far(f32 arg0) { - ptr_video_settings2->far = arg0; - sub_GAME_7F077C30(ptr_video_settings2->aspect, ptr_video_settings2->far, ptr_video_settings2->scale); - sub_GAME_7F077C5C(); + ptr_video_settings2->fovy = arg0; + currentPlayerSetPerspective(ptr_video_settings2->near, ptr_video_settings2->fovy, ptr_video_settings2->aspect); + currentPlayerSetCameraScale(); } #else GLOBAL_ASM( @@ -2391,9 +1947,9 @@ glabel setvideo_far /* 005164 70004564 8C620000 */ lw $v0, ($v1) /* 005168 70004568 C44C0010 */ lwc1 $f12, 0x10($v0) /* 00516C 7000456C C44E0008 */ lwc1 $f14, 8($v0) -/* 005170 70004570 0FC1DF0C */ jal sub_GAME_7F077C30 +/* 005170 70004570 0FC1DF0C */ jal currentPlayerSetPerspective /* 005174 70004574 8C46000C */ lw $a2, 0xc($v0) -/* 005178 70004578 0FC1DF17 */ jal sub_GAME_7F077C5C +/* 005178 70004578 0FC1DF17 */ jal currentPlayerSetCameraScale /* 00517C 7000457C 00000000 */ nop /* 005180 70004580 8FBF0014 */ lw $ra, 0x14($sp) /* 005184 70004584 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2408,16 +1964,16 @@ glabel setvideo_far * F12->video2 page width [p@800232A8+C] and something else... */ #ifdef NONMATCHING -void video_related_21(f32 arg0) +void set_page_aspect(f32 arg0) { - ptr_video_settings2->scale = arg0; - sub_GAME_7F077C30(ptr_video_settings2->aspect, ptr_video_settings2->far, ptr_video_settings2->scale); - sub_GAME_7F077C5C(); + ptr_video_settings2->aspect = arg0; + currentPlayerSetPerspective(ptr_video_settings2->near, ptr_video_settings2->fovy, ptr_video_settings2->aspect); + currentPlayerSetCameraScale(); } #else GLOBAL_ASM( .text -glabel video_related_21 +glabel set_page_aspect /* 005190 70004590 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 005194 70004594 3C038002 */ lui $v1, %hi(ptr_video_settings2) /* 005198 70004598 246332A8 */ addiu $v1, %lo(ptr_video_settings2) # addiu $v1, $v1, 0x32a8 @@ -2429,9 +1985,9 @@ glabel video_related_21 /* 0051B0 700045B0 8C620000 */ lw $v0, ($v1) /* 0051B4 700045B4 C44C0010 */ lwc1 $f12, 0x10($v0) /* 0051B8 700045B8 C44E0008 */ lwc1 $f14, 8($v0) -/* 0051BC 700045BC 0FC1DF0C */ jal sub_GAME_7F077C30 +/* 0051BC 700045BC 0FC1DF0C */ jal currentPlayerSetPerspective /* 0051C0 700045C0 8C46000C */ lw $a2, 0xc($v0) -/* 0051C4 700045C4 0FC1DF17 */ jal sub_GAME_7F077C5C +/* 0051C4 700045C4 0FC1DF17 */ jal currentPlayerSetCameraScale /* 0051C8 700045C8 00000000 */ nop /* 0051CC 700045CC 8FBF0014 */ lw $ra, 0x14($sp) /* 0051D0 700045D0 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2444,9 +2000,9 @@ glabel video_related_21 * 51DC 700045DC * F0= [p@800232A8+8]; fry T6 */ -f32 video_related_23(void) +f32 viGetFovY(void) { - return ptr_video_settings2->far; + return ptr_video_settings2->fovy; } /** @@ -2455,10 +2011,10 @@ f32 video_related_23(void) #ifdef NONMATCHING void video_related_24(f32 arg0, f32 arg1) { - ptr_video_settings2->far = arg1; - ptr_video_settings2->scale = (f32) (arg0 / arg1); - sub_GAME_7F077C30(ptr_video_settings2->aspect, ptr_video_settings2->far, ptr_video_settings2->scale); - sub_GAME_7F077C5C(); + ptr_video_settings2->fovy = arg1; + ptr_video_settings2->aspect = (f32) (arg0 / arg1); + currentPlayerSetPerspective(ptr_video_settings2->near, ptr_video_settings2->fovy, ptr_video_settings2->aspect); + currentPlayerSetCameraScale(); } #else GLOBAL_ASM( @@ -2481,9 +2037,9 @@ glabel video_related_24 /* 005224 70004624 8C620000 */ lw $v0, ($v1) /* 005228 70004628 C44C0010 */ lwc1 $f12, 0x10($v0) /* 00522C 7000462C C44E0008 */ lwc1 $f14, 8($v0) -/* 005230 70004630 0FC1DF0C */ jal sub_GAME_7F077C30 +/* 005230 70004630 0FC1DF0C */ jal currentPlayerSetPerspective /* 005234 70004634 8C46000C */ lw $a2, 0xc($v0) -/* 005238 70004638 0FC1DF17 */ jal sub_GAME_7F077C5C +/* 005238 70004638 0FC1DF17 */ jal currentPlayerSetCameraScale /* 00523C 7000463C 00000000 */ nop /* 005240 70004640 8FBF0014 */ lw $ra, 0x14($sp) /* 005244 70004644 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2498,10 +2054,10 @@ glabel video_related_24 #ifdef NONMATCHING void set_page_height(f32 arg0, f32 arg1) { - ptr_video_settings2->aspect = arg0; + ptr_video_settings2->near = arg0; ptr_video_settings2->unk14 = arg1; - sub_GAME_7F077C30(ptr_video_settings2->aspect, ptr_video_settings2->far, ptr_video_settings2->scale); - sub_GAME_7F077C5C(); + currentPlayerSetPerspective(ptr_video_settings2->near, ptr_video_settings2->fovy, ptr_video_settings2->aspect); + currentPlayerSetCameraScale(); } #else GLOBAL_ASM( @@ -2522,9 +2078,9 @@ glabel set_page_height /* 005280 70004680 8C620000 */ lw $v0, ($v1) /* 005284 70004684 C44C0010 */ lwc1 $f12, 0x10($v0) /* 005288 70004688 C44E0008 */ lwc1 $f14, 8($v0) -/* 00528C 7000468C 0FC1DF0C */ jal sub_GAME_7F077C30 +/* 00528C 7000468C 0FC1DF0C */ jal currentPlayerSetPerspective /* 005290 70004690 8C46000C */ lw $a2, 0xc($v0) -/* 005294 70004694 0FC1DF17 */ jal sub_GAME_7F077C5C +/* 005294 70004694 0FC1DF17 */ jal currentPlayerSetCameraScale /* 005298 70004698 00000000 */ nop /* 00529C 7000469C 8FBF0014 */ lw $ra, 0x14($sp) /* 0052A0 700046A0 27BD0018 */ addiu $sp, $sp, 0x18 @@ -2540,7 +2096,7 @@ glabel set_page_height #ifdef NONMATCHING void *video_related_27(void *arg0) { - arg0->unk0 = (f32) ptr_video_settings2->aspect; + arg0->unk0 = (f32) ptr_video_settings2->near; arg0->unk4 = (f32) ptr_video_settings2->unk14; return &ptr_video_settings2; } @@ -2643,7 +2199,7 @@ void indy_grab_jpg_16bit(void) jpg_16bit_grabnum++; } sprintf(&iFileName, "grab.%d.temp.uix", jpg_16bit_grabnum); - indy_send_capture_data(&iFileName, ptr_video_settings2->frameb, (get_video2_settings_txtClipH() * get_video2_settings_txtClipW() * 2)); + indy_send_capture_data(&iFileName, ptr_video_settings2->framebuf, (get_video2_settings_txtClipH() * get_video2_settings_txtClipW() * 2)); sprintf(&iFileName, "uix2pix grab.%d.temp.uix", jpg_16bit_grabnum); response_from_command_string(&iFileName); sprintf(&iFileName, "fromalias grab.%d.temp.pix grab.%d.temp.rgb", jpg_16bit_grabnum, jpg_16bit_grabnum); @@ -2784,7 +2340,7 @@ loop_1: goto loop_1; } sprintf(&iFileName, "grab.%d.temp.Uix", jpg_32bit_grabnum); - indy_send_capture_data(&iFileName, &cfb_16_a, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 4); + indy_send_capture_data(&iFileName, &cfb_16, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 4); sprintf(&iFileName, "Uix2pix -xs%d grab.%d.temp.Uix", get_video2_settings_txtClipW(), jpg_32bit_grabnum); response_from_command_string(&iFileName); sprintf(&iFileName, "fromalias grab.%d.temp.pix grab.%d.temp.rgb", jpg_32bit_grabnum, jpg_32bit_grabnum); @@ -2847,8 +2403,8 @@ glabel indy_grab_jpg_32bit /* 005560 70004960 0C00110B */ jal get_video2_settings_txtClipH /* 005564 70004964 01C08825 */ move $s1, $t6 /* 005568 70004968 00510019 */ multu $v0, $s1 -/* 00556C 7000496C 3C05803B */ lui $a1, %hi(cfb_16_a) # $a1, 0x803b -/* 005570 70004970 24A55000 */ addiu $a1, %lo(cfb_16_a) # addiu $a1, $a1, 0x5000 +/* 00556C 7000496C 3C05803B */ lui $a1, %hi(cfb_16) # $a1, 0x803b +/* 005570 70004970 24A55000 */ addiu $a1, %lo(cfb_16) # addiu $a1, $a1, 0x5000 /* 005574 70004974 02002025 */ move $a0, $s0 /* 005578 70004978 00003012 */ mflo $a2 /* 00557C 7000497C 00067880 */ sll $t7, $a2, 2 @@ -2929,7 +2485,7 @@ loop_1: goto loop_1; } sprintf(&sp30, "grab.%d.temp.uix", rgb_16bit_grabnum); - indy_send_capture_data(&sp30, ptr_video_settings2->frameb, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 2); + indy_send_capture_data(&sp30, ptr_video_settings2->framebuf, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 2); sprintf(&sp30, "uix2pix grab.%d.temp.uix", rgb_16bit_grabnum); response_from_command_string(&sp30); sprintf(&sp30, "fromalias grab.%d.temp.pix grab.%d.rgb", rgb_16bit_grabnum, rgb_16bit_grabnum); @@ -3057,7 +2613,7 @@ loop_1: goto loop_1; } sprintf(&sp30, "grab.%d.temp.Uix", rgb_32bit_grabnum); - indy_send_capture_data(&sp30, &cfb_16_a, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 4); + indy_send_capture_data(&sp30, &cfb_16, (get_video2_settings_txtClipH() * ((s32) (get_video2_settings_txtClipW() << 0x10) >> 0x10)) * 4); sprintf(&sp30, "Uix2pix -xs%d grab.%d.temp.Uix", get_video2_settings_txtClipW(), rgb_32bit_grabnum); response_from_command_string(&sp30); sprintf(&sp30, "fromalias grab.%d.temp.pix grab.%d.rgb", rgb_32bit_grabnum, rgb_32bit_grabnum); @@ -3117,8 +2673,8 @@ glabel indy_grab_rgb_32bit /* 005840 70004C40 0C00110B */ jal get_video2_settings_txtClipH /* 005844 70004C44 01C08825 */ move $s1, $t6 /* 005848 70004C48 00510019 */ multu $v0, $s1 -/* 00584C 70004C4C 3C05803B */ lui $a1, %hi(cfb_16_a) # $a1, 0x803b -/* 005850 70004C50 24A55000 */ addiu $a1, %lo(cfb_16_a) # addiu $a1, $a1, 0x5000 +/* 00584C 70004C4C 3C05803B */ lui $a1, %hi(cfb_16) # $a1, 0x803b +/* 005850 70004C50 24A55000 */ addiu $a1, %lo(cfb_16) # addiu $a1, $a1, 0x5000 /* 005854 70004C54 02002025 */ move $a0, $s0 /* 005858 70004C58 00003012 */ mflo $a2 /* 00585C 70004C5C 00067880 */ sll $t7, $a2, 2 diff --git a/src/video.h b/src/video.h index 1e652432..fdc757cc 100644 --- a/src/video.h +++ b/src/video.h @@ -5,23 +5,30 @@ typedef struct video_settings video_settings, *Pvideo_settings; struct video_settings { - int mode; - short txtClipW; - short txtClipH; - f32 far; - f32 scale; + s8 mode; + s8 test1; + s8 test2; + s8 test3; + s16 x; + s16 y; + f32 fovy; f32 aspect; - f32 anonymous_6; - short somethingW; - short somethingH; - short width; - short height; - short ulx; - short uly; - int anonymous_12; - u8* frameb; + f32 near; + f32 far; + s16 bufx; + s16 bufy; + s16 viewx; + s16 viewy; + s16 viewleft; + s16 viewtop; + s32 usezbuf; + u8* framebuf; }; +void setvideo_far(f32 arg0); +void set_page_aspect(f32 arg0); +void set_page_height(f32 arg0, f32 arg1); +void set_video2_settings_offset_24(int param_1); #endif diff --git a/tools/aaa_rip/main.c b/tools/aaa_rip/main.c new file mode 100644 index 00000000..4ddad3af --- /dev/null +++ b/tools/aaa_rip/main.c @@ -0,0 +1,157 @@ +#include +#include +#include + +#define LINE "__________________________________________________________________" + +int main(int argc, char **argv) +{ + /************************/ + FILE *input, *output; + long int filesize, offset, length, offset_output; + unsigned char *in_buf, *out_buf; + /************************/ + + if((argc != 5) && (argc != 6)) /* no file provided or too many arguments */ + { + printf("\n AAA RIP - Lite DD Clone\n%s\n\n About: Extract sub-binary from binary\n\n Syntax: %s \"in\" \"out\" \"offset\" \"length\" \"out offset\"\n\n Usage:\n Setting length argument to 0 will write until end of input file.\n Omitting output offset will overwrite output file.\n All arguments assume decimal values.", LINE, argv[0]); + goto exit; + } + printf("%s\n", LINE); + + /* load input from argument */ + input = fopen(argv[1], "rb"); + if(input == NULL) + { + printf("\n Error: Aborted, input cannot be opened"); + goto exit; + } + if(fseek(input, 0, SEEK_END) != 0) + { + printf("\n Error: Aborted, could not find end to input file"); + goto error_input; + } + + /* load length/offset arguments */ + offset = atol(argv[3]); + length = atol(argv[4]); + offset_output = (argc == 6) ? atol(argv[5]) : 0; + if(offset < 0) + { + printf("\n Error: Aborted, invalid offset argument"); + goto error_input; + } + + /* get input filesize */ + filesize = ftell(input); + if(filesize == -1) + { + printf("\n Error: Aborted, could not find length of input file"); + goto error_input; + } + if(fseek(input, offset, SEEK_SET) != 0) + { + printf("\n Error: Aborted, could not set offset position"); + goto error_input; + } + if(length <= 0) + { + length = filesize - offset; + } + if(offset >= filesize) + { + printf("\n Error: Aborted, offset goes beyond end of file"); + goto error_input; + } + if(offset + length > filesize) + { + printf("\n Error: Aborted, length goes beyond end of file"); + goto error_input; + } + printf("\n Input File: %s\n Output File: %s\n Offset: %ld\n Length: %ld", argv[1], argv[2], offset, length); + if(argc == 6) + { + printf("\n Output Offset: %ld", offset_output); + } + + /* read input to file buffer */ + in_buf = (unsigned char *)malloc((size_t)length); + if(in_buf == NULL) + { + printf("\n Error: Aborted, not enough memory to load input"); + goto error_input; + } + fread(in_buf, (size_t)length, 1, input); + + /* open output file */ + if(argc == 6) + { + output = fopen(argv[2], "rb"); + if(output == NULL) + { + printf("\n Error: Aborted, output file cannot be written"); + goto error_output; + } + if(fseek(output, 0, SEEK_END) != 0) + { + printf("\n Error: Aborted, could not find end to output file"); + goto error_offset_output; + } + filesize = ftell(output); + if(fseek(output, 0, SEEK_SET) != 0) + { + printf("\n Error: Aborted, could not set offset position"); + goto error_offset_output; + } + if(filesize == -1) + { + printf("\n Error: Aborted, could not find length of output file"); + goto error_offset_output; + } + if(filesize < offset_output + offset + length) + { + filesize = offset_output + offset + length; + } + + /* read output file to buffer */ + out_buf = (unsigned char *)calloc((size_t)filesize, 1); + if(out_buf == NULL) + { + printf("\n Error: Aborted, not enough memory to load output"); + goto error_offset_output; + } + fread(out_buf, (size_t)filesize, 1, output); + memcpy(&out_buf[offset_output], &in_buf[offset], (size_t)length); + fclose(output); + + output = fopen(argv[2], "wb"); + if(output == NULL) + { + printf("\n Error: Aborted, output file cannot be written"); + free(out_buf); + goto error_output; + } + fwrite(out_buf, (size_t)filesize, 1, output); + free(out_buf); + } + else + { + output = fopen(argv[2], "wb"); + if(output == NULL) + { + printf("\n Error: Aborted, output file cannot be written"); + goto error_output; + } + fwrite(in_buf, (size_t)length, 1, output); + } + +error_offset_output: + fclose(output); +error_output: + free(in_buf); +error_input: + fclose(input); +exit: + printf("\n%s\n", LINE); + return 0; +} diff --git a/tools/aaa_rip/makefile b/tools/aaa_rip/makefile new file mode 100644 index 00000000..34580fec --- /dev/null +++ b/tools/aaa_rip/makefile @@ -0,0 +1,35 @@ +#Compiler +CC = @gcc + +#Source directories +SRCDIR = ./ +OUTNAME = aaa_rip + +#Compiler flags +CFLAGS = -shared -ansi -Os -std=c89 +CFLAGSDBG = -shared -ansi -g -std=c89 +WFLAGS = -W -Wall -Wextra -pedantic -Wunreachable-code -Wno-unused-result + +#Linker flags +OBJS = $(SRCDIR)main.o +LFLAGS = $(OBJS) -o $(OUTNAME) -s +LFLAGSDBG = $(OBJS) -o $(OUTNAME) + +#Main recipes +all: aaa_rip + +debug: CC = gcc +debug: CFLAGS = $(CFLAGSDBG) +debug: LFLAGS = $(LFLAGSDBG) +debug: aaa_rip + +aaa_rip: $(OBJS) + $(CC) $(LFLAGS) + +clean: + @rm $(OUTNAME) + @rm $(SRCDIR)*.o + +#Individual recipes +$(OBJDIR)main.o: $(SRCDIR)main.c + $(CC) -c $(SRCDIR)main.c -o $(SRCDIR)main.o $(CFLAGS) $(WFLAGS) \ No newline at end of file diff --git a/tools/data_compress.sh b/tools/data_compress.sh index c0096c09..e1c7c279 100644 --- a/tools/data_compress.sh +++ b/tools/data_compress.sh @@ -5,11 +5,12 @@ MAPFILE="./build/ge007."$2".map" DATASEG_START=$(printf "%d\n" 0x$(grep ${MAPFILE} -e '__csegtempPos =' | cut -d "x" -f3)) DATASEG_LEN=$(printf "%d\n" 0x$(grep ${MAPFILE} -e 'load address 0x0000000000c00000' | cut -d "x" -f3 | cut -d " " -f1)) +#build/rebuild aaa_rip +[ ! -x tools/aaa_rip/aaa_rip ] && make -C tools/aaa_rip echo "patching $1" echo "extract data segment" -echo "one byte at a time is slow, sorry" -dd skip=${DATASEG_START} count=${DATASEG_LEN} if=$1 of=data_seg bs=1 +[ -x tools/aaa_rip/aaa_rip ] && tools/aaa_rip/aaa_rip $1 data_seg ${DATASEG_START} ${DATASEG_LEN} || dd skip=${DATASEG_START} count=${DATASEG_LEN} if=$1 of=data_seg bs=1 echo "truncate $1 to 0x$(printf "%x\n" ${DATASEG_START})" cat $1 | head --bytes=${DATASEG_START} > $1.tmp @@ -30,9 +31,7 @@ CDATA_MAX_SIZE=72704 echo "maxsize=${CDATA_MAX_SIZE}" -echo "one byte at a time is slow, sorry" -dd if=data_seg.rz of=$1.tmp obs=1 seek=${CDATA_POS} conv=notrunc -#rm data_seg data_seg.rz +[ -x tools/aaa_rip/aaa_rip ] && tools/aaa_rip/aaa_rip data_seg.rz $1.tmp 0 0 ${CDATA_POS} || dd if=data_seg.rz of=$1.tmp obs=1 seek=${CDATA_POS} conv=notrunc mv $1.tmp $1 diff --git a/tools/extractor/fread_csv_line.c b/tools/extractor/fread_csv_line.c new file mode 100644 index 00000000..a6a0c59e --- /dev/null +++ b/tools/extractor/fread_csv_line.c @@ -0,0 +1,102 @@ +#include +#include +#include +#include "fread_csv_line.h" + +#define READ_BLOCK_SIZE 65536 +#define QUICK_GETC( ch, fp )\ +do\ +{\ + if ( read_ptr == read_end ) {\ + fread_len = fread( read_buf, sizeof(char), READ_BLOCK_SIZE, fp );\ + if ( fread_len < READ_BLOCK_SIZE ) {\ + read_buf[fread_len] = '\0';\ + }\ + read_ptr = read_buf;\ + }\ + ch = *read_ptr++;\ +}\ +while(0) + +/* + * Given a file pointer, read a CSV line from that file. + * File may include newlines escaped with "double quotes". + * + * Warning: This function is optimized for the use case where + * you repeatedly call it until the file is exhausted. It is + * very suboptimal for the use case of just grabbing one single + * line of CSV and stopping. Also, this function advances the + * file position (in the fseek/ftell sense) unpredictably. You + * should not change the file position between calls to + * fread_csv_line (e.g., don't use "getc" on the file in between + * calls to fread_csv_line). + * + * Other arguments: + * int *done: Pointer to an int that will be set to 1 when file is exhausted. + * + * Warning: Calling this function on an exhausted file (as indicated by the + * 'done' flag) is undefined behavior. + */ + +char *buf = NULL; +int max_line_size = 0; + +int fread_csv_alloc(int size) { + max_line_size = size; + buf = malloc( max_line_size ); + return buf != NULL ? 1 : 0; +} + +void fread_csv_free(void) { + free( buf ); +} + +char *fread_csv_line(FILE *fp, int *done) { + static FILE *bookmark; + static char read_buf[READ_BLOCK_SIZE], *read_ptr, *read_end; + static int fread_len; + char *bptr, *limit; + char ch; + int fQuote; + + bptr = buf; + limit = buf + max_line_size; + + if ( bookmark != fp ) { + read_ptr = read_end = read_buf + READ_BLOCK_SIZE; + bookmark = fp; + } + + for ( fQuote = 0; ; ) { + QUICK_GETC(ch, fp); + + if ( !ch || (ch == '\n' && !fQuote)) { + break; + } + + if ( bptr >= limit ) { + return NULL; + } + *bptr++ = ch; + + if ( fQuote ) { + if ( ch == '\"' ) { + QUICK_GETC(ch, fp); + + if ( ch != '\"' ) { + if ( !ch || ch == '\n' ) { + break; + } + fQuote = 0; + } + *bptr++ = ch; + } + } else if ( ch == '\"' ) { + fQuote = 1; + } + } + + *done = !ch; + *bptr = '\0'; + return buf; +} diff --git a/tools/extractor/fread_csv_line.h b/tools/extractor/fread_csv_line.h new file mode 100644 index 00000000..8211bb71 --- /dev/null +++ b/tools/extractor/fread_csv_line.h @@ -0,0 +1,8 @@ +#ifndef CSV_DOT_H_INCLUDE_GUARD +#define CSV_DOT_H_INCLUDE_GUARD + +int fread_csv_alloc(int size); +void fread_csv_free(void); +char *fread_csv_line(FILE *fp, int *done); + +#endif diff --git a/tools/extractor/main.c b/tools/extractor/main.c new file mode 100644 index 00000000..2b242537 --- /dev/null +++ b/tools/extractor/main.c @@ -0,0 +1,332 @@ +#include +#include +#include +#include +#include "puff.h" +#include "fread_csv_line.h" + +#ifdef _WIN32 + #include + #define MAX_THREADS 32 +#elif __APPLE__ + #include + #include + #define MAX_THREADS 32 +#else + #include + #ifdef __linux__ + #define MAX_THREADS 32 + #else + #define MAX_THREADS 1 + #endif +#endif + +#define CLAMP_VAL(value, min, max) (((value) < (min)) ? (min) : (((value) > (max)) ? (max) : ((value) < (min)) ? (min) : (value))) +#define MBTOBYTES(megs) (megs*0x100000) +#define LINE "__________________________________________________________________" + +#define MIN_ROM_SIZE MBTOBYTES(12) /* minimum ROM filesize supported (12MB) */ +#define MAX_FILENAME 256 /* max filename supported */ +#define GE_1172_HEADER_LENGTH 2 /* header length of GE 1172 zip */ + +unsigned char *rom_buf; +unsigned char tmp_buf[MAX_THREADS][MBTOBYTES(2)] = {0}; /* holds our input/output for gzip inflate (max output file supported 2MB) */ +pthread_t puff_threads[MAX_THREADS]; +unsigned long int counted = 0, success_thread[MAX_THREADS] = {0}, failed_thread[MAX_THREADS] = {0}; + +struct pthread_arg +{ + unsigned long int offset, size; + char *name; + int compress, thread_id, ready; +}; + +typedef struct pthread_arg arg_thread; + +void *extract_thread(void *arg) +{ + /************************/ + arg_thread *thread_arg = (arg_thread *)arg; + int compress, thread_id, puff_return; + unsigned long offset, size, out_size; + char name[MAX_FILENAME]; + FILE *output; + /************************/ + + memcpy(name, thread_arg->name, MAX_FILENAME); + offset = thread_arg->offset; + compress = thread_arg->compress; + size = thread_arg->size; + thread_id = thread_arg->thread_id; + printf("\n Extracting %s %s, %lu bytes...", compress ? "compressed" : "uncompressed", name, size); + thread_arg->ready = 1; + + output = fopen(name, "wb"); + if(output == NULL) + { + printf("\n Error: Could not output file %s", name); + failed_thread[thread_id]++; + goto error_thread_output; + } + if(compress) /* unzip */ + { + puff_return = puff(tmp_buf[thread_id], (unsigned long)MBTOBYTES(2), &rom_buf[offset + GE_1172_HEADER_LENGTH], size, &out_size); + if(puff_return != 0) + { + switch(puff_return) + { + case 2: printf("\n\n Error: Could not uncompress file %s\n Available inflate data did not terminate\n", name); break; + case 1: printf("\n\n Error: Could not uncompress file %s\n Output space exhausted before completing inflate\n", name); break; + case -1: printf("\n\n Error: Could not uncompress file %s\n Invalid block type (type == 3)\n", name); break; + case -2: printf("\n\n Error: Could not uncompress file %s\n Stored block length did not match one's complement\n", name); break; + case -3: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: too many length or distance codes\n", name); break; + case -4: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: code lengths codes incomplete\n", name); break; + case -5: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: repeat lengths with no first length\n", name); break; + case -6: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: repeat more than specified lengths\n", name); break; + case -7: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: invalid literal/length code lengths\n", name); break; + case -8: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: invalid distance code lengths\n", name); break; + case -9: printf("\n\n Error: Could not uncompress file %s\n Dynamic block code description: missing end-of-block code\n", name); break; + case -10: printf("\n\n Error: Could not uncompress file %s\n Invalid literal/length or distance code in fixed or dynamic block\n", name); break; + case -11: printf("\n\n Error: Could not uncompress file %s\n Distance is too far back in fixed or dynamic block\n", name); break; + default: printf("\n\n Error: Could not uncompress file %s\n Unknown error\n", name); break; + } + failed_thread[thread_id]++; + goto error_thread_unzip; + } + fwrite(tmp_buf[thread_id], out_size, 1, output); + } + else /* uncompressed */ + { + fwrite(&rom_buf[offset], size, 1, output); + } + success_thread[thread_id]++; + +error_thread_unzip: + fclose(output); +error_thread_output: + return NULL; +} + +int detect_threads(void) +{ +#ifdef WIN32 + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + return sysinfo.dwNumberOfProcessors; +#elif __APPLE__ + int nm[2]; + size_t len = 4; + uint32_t count; + + nm[0] = CTL_HW; nm[1] = HW_AVAILCPU; + sysctl(nm, 2, &count, &len, NULL, 0); + + if(count < 1) + { + nm[1] = HW_NCPU; + sysctl(nm, 2, &count, &len, NULL, 0); + if(count < 1) + { + count = 1; + } + } + return count; +#elif __linux__ + #if defined (_SC_NPROCESSORS_ONLN) + return sysconf(_SC_NPROCESSORS_ONLN); + #elif defined (_SC_NPROC_ONLN) + return sysconf(_SC_NPROC_ONLN); + #else + return 1; + #endif +#else + return 1; +#endif +} + +void extract_files(FILE *csvfile, const int max_threads) +{ + /************************/ + int cur_line_entry = 0, max_line_entry = 0; + int eof = 0, index, cur_thread = 0, check_threads = 0; + char *csv_buf, cur_line; + unsigned long int offset, size; + int compress, extract; + char name[MAX_FILENAME] = {'\0'}; + volatile arg_thread thread_arg; + /************************/ + + /* get max line entry in csv file (required for allocation) */ + while(fread(&cur_line, 1, 1, csvfile)) + { + if(cur_line == '\n') + { + if(cur_line_entry > max_line_entry) + max_line_entry = cur_line_entry; + cur_line_entry = 0; + continue; + } + cur_line_entry++; + } + if(fseek(csvfile, 0, SEEK_SET) != 0) + { + printf("\n Error: Aborted, could not set to beginning of csv file"); + return; + } + + if(!fread_csv_alloc(max_line_entry)) + { + printf("\n Error: Aborted, could not allocate memory for csv file"); + return; + } + while(!eof) + { + csv_buf = fread_csv_line(csvfile, &eof); + if(csv_buf == NULL) + { + printf("\n Error: Aborted, could not read csv line"); + break; + } + + for(index = 0; index < max_line_entry; index++) /* replace commas with new line characters for sscanf */ + { + if(csv_buf[index] == ',') + csv_buf[index] = '\n'; + } + if(sscanf(csv_buf, "%lu\n%lu\n%s\n%d\n%d", &offset, &size, name, &compress, &extract) != 5) /* error or reached end of csv file, abort */ + break; + counted++; + if(extract != 1) + continue; + + if(check_threads) + { + if(pthread_join(puff_threads[cur_thread], NULL) != 0) + { + printf("\n Error: Aborted, could not create thread %d", cur_thread); + break; + } + } + thread_arg.ready = 0; + thread_arg.name = name; + thread_arg.size = size; + thread_arg.offset = offset; + thread_arg.compress = !(!compress); + thread_arg.thread_id = (short)cur_thread; + pthread_create(&puff_threads[cur_thread], NULL, extract_thread, (void *)&thread_arg); + for(;;) /* wait for thread to finish copy arguments */ + { + if(thread_arg.ready) + { + break; + } + } + + cur_thread++; + if(cur_thread >= max_threads) + { + cur_thread = 0; + check_threads = 1; + } + } + fread_csv_free(); + + cur_thread = 0; + while(cur_thread < max_threads) /* wait for thread to finish task */ + { + if(pthread_join(puff_threads[cur_thread], NULL) != 0) + { + continue; + } + cur_thread++; + } +} + +int main(int argc, char **argv) +{ + /************************/ + FILE *romfile, *csvfile; + long int filesize; + int threads_total, index; + unsigned long success_total = 0, failed_total = 0; + /************************/ + + /* set threads total */ + threads_total = CLAMP_VAL(detect_threads(), 1, MAX_THREADS); + + printf("\n GoldenEye 007 Extractor\n%s\n", LINE); + if(argc != 3) /* no file provided or too many arguments */ + { + printf("\n About: Extract GoldenEye 007 files\n\n Syntax: %s \"input ROM\" \"input csv file\"\n Multithread Mode: %sabled", argv[0], threads_total > 1 ? "En" : "Dis"); + goto exit; + } + + /* load ROM from argument */ + romfile = fopen(argv[1], "rb"); + if(romfile == NULL) + { + printf("\n Error: Aborted, ROM cannot be opened"); + goto exit; + } + if(fseek(romfile, 0, SEEK_END) != 0) + { + printf("\n Error: Aborted, could not find end to ROM file"); + goto error_rom; + } + + /* get ROM filesize */ + filesize = ftell(romfile); + if(filesize == -1) + { + printf("\n Error: Aborted, could not find length to ROM file"); + goto error_rom; + } + if(filesize < MIN_ROM_SIZE) /* if ROM filesize is under supported filesize, abort */ + { + printf("\n Error: Aborted, ROM is invalid"); + goto error_rom; + } + if(fseek(romfile, 0, SEEK_SET) != 0) + { + printf("\n Error: Aborted, could not find beginning of ROM file"); + goto error_rom; + } + printf("\n Input ROM: %s", argv[1]); + + /* load csv file from argument */ + csvfile = fopen(argv[2], "rb"); + if(csvfile == NULL) + { + printf("\n Error: Aborted, csv file cannot be opened"); + goto error_rom; + } + + /* read ROM to file buffer */ + rom_buf = (unsigned char *)malloc(filesize); + if(rom_buf == NULL) + { + printf("\n Error: Aborted, not enough memory to load ROM"); + goto error_csv; + } + fread(rom_buf, filesize, 1, romfile); + + extract_files(csvfile, threads_total); + + for(index = 0; index < threads_total; index++) + { + success_total += success_thread[index]; + failed_total += failed_thread[index]; + } + printf("\n\n Total Files: %lu\n\n Extracted: %lu\n Skipped: %lu", counted, success_total, counted - success_total); + if(failed_total) + printf("\n Failed: %lu", failed_total); + + free(rom_buf); +error_csv: + fclose(csvfile); +error_rom: + fclose(romfile); +exit: + printf("\n%s\n", LINE); + return 0; +} diff --git a/tools/extractor/makefile b/tools/extractor/makefile new file mode 100644 index 00000000..b53f814d --- /dev/null +++ b/tools/extractor/makefile @@ -0,0 +1,42 @@ +#Compiler +CC = @gcc + +#Source directories +SRCDIR = ./ +OUTNAME = extractor + +#Compiler flags +CFLAGS = -shared -ansi -Os -std=c89 +CFLAGSDBG = -shared -ansi -g -std=c89 +WFLAGS = -W -Wall -Wextra -pedantic -Wunreachable-code -Wno-unused-result + +#Linker flags +OBJS = $(SRCDIR)main.o $(SRCDIR)puff.o $(SRCDIR)fread_csv_line.o +LIBS = -lpthread +LFLAGS = $(OBJS) -o $(OUTNAME) $(LIBS) -s +LFLAGSDBG = $(OBJS) -o $(OUTNAME) $(LIBS) + +#Main recipes +all: extractor + +debug: CC = gcc +debug: CFLAGS = $(CFLAGSDBG) +debug: LFLAGS = $(LFLAGSDBG) +debug: extractor + +extractor: $(OBJS) + $(CC) $(LFLAGS) + +clean: + @rm $(OUTNAME) + @rm $(SRCDIR)*.o + +#Individual recipes +$(OBJDIR)main.o: $(SRCDIR)main.c $(SRCDIR)puff.h $(SRCDIR)fread_csv_line.h + $(CC) -c $(SRCDIR)main.c -o $(SRCDIR)main.o $(CFLAGS) $(WFLAGS) + +$(OBJDIR)puff.o: $(SRCDIR)puff.c $(SRCDIR)puff.h + $(CC) -c $(SRCDIR)puff.c -o $(SRCDIR)puff.o $(CFLAGS) $(WFLAGS) + +$(OBJDIR)fread_csv_line.o: $(SRCDIR)fread_csv_line.c $(SRCDIR)fread_csv_line.h + $(CC) -c $(SRCDIR)fread_csv_line.c -o $(SRCDIR)fread_csv_line.o $(CFLAGS) $(WFLAGS) diff --git a/tools/extractor/puff.c b/tools/extractor/puff.c new file mode 100644 index 00000000..33eea31b --- /dev/null +++ b/tools/extractor/puff.c @@ -0,0 +1,843 @@ +/* + THIS FILE HAS BEEN MODIFIED + puff has been modified to write length to argument pointer +*/ + +/* + * puff.c + * Copyright (C) 2002-2013 Mark Adler + * For conditions of distribution and use, see copyright notice in puff.h + * version 2.3, 21 Jan 2013 + * + * puff.c is a simple inflate written to be an unambiguous way to specify the + * deflate format. It is not written for speed but rather simplicity. As a + * side benefit, this code might actually be useful when small code is more + * important than speed, such as bootstrap applications. For typical deflate + * data, zlib's inflate() is about four times as fast as puff(). zlib's + * inflate compiles to around 20K on my machine, whereas puff.c compiles to + * around 4K on my machine (a PowerPC using GNU cc). If the faster decode() + * function here is used, then puff() is only twice as slow as zlib's + * inflate(). + * + * All dynamically allocated memory comes from the stack. The stack required + * is less than 2K bytes. This code is compatible with 16-bit int's and + * assumes that long's are at least 32 bits. puff.c uses the short data type, + * assumed to be 16 bits, for arrays in order to conserve memory. The code + * works whether integers are stored big endian or little endian. + * + * In the comments below are "Format notes" that describe the inflate process + * and document some of the less obvious aspects of the format. This source + * code is meant to supplement RFC 1951, which formally describes the deflate + * format: + * + * http://www.zlib.org/rfc-deflate.html + */ + +/* + * Change history: + * + * 1.0 10 Feb 2002 - First version + * 1.1 17 Feb 2002 - Clarifications of some comments and notes + * - Update puff() dest and source pointers on negative + * errors to facilitate debugging deflators + * - Remove longest from struct huffman -- not needed + * - Simplify offs[] index in construct() + * - Add input size and checking, using longjmp() to + * maintain easy readability + * - Use short data type for large arrays + * - Use pointers instead of long to specify source and + * destination sizes to avoid arbitrary 4 GB limits + * 1.2 17 Mar 2002 - Add faster version of decode(), doubles speed (!), + * but leave simple version for readabilty + * - Make sure invalid distances detected if pointers + * are 16 bits + * - Fix fixed codes table error + * - Provide a scanning mode for determining size of + * uncompressed data + * 1.3 20 Mar 2002 - Go back to lengths for puff() parameters [Gailly] + * - Add a puff.h file for the interface + * - Add braces in puff() for else do [Gailly] + * - Use indexes instead of pointers for readability + * 1.4 31 Mar 2002 - Simplify construct() code set check + * - Fix some comments + * - Add FIXLCODES #define + * 1.5 6 Apr 2002 - Minor comment fixes + * 1.6 7 Aug 2002 - Minor format changes + * 1.7 3 Mar 2003 - Added test code for distribution + * - Added zlib-like license + * 1.8 9 Jan 2004 - Added some comments on no distance codes case + * 1.9 21 Feb 2008 - Fix bug on 16-bit integer architectures [Pohland] + * - Catch missing end-of-block symbol error + * 2.0 25 Jul 2008 - Add #define to permit distance too far back + * - Add option in TEST code for puff to write the data + * - Add option in TEST code to skip input bytes + * - Allow TEST code to read from piped stdin + * 2.1 4 Apr 2010 - Avoid variable initialization for happier compilers + * - Avoid unsigned comparisons for even happier compilers + * 2.2 25 Apr 2010 - Fix bug in variable initializations [Oberhumer] + * - Add const where appropriate [Oberhumer] + * - Split if's and ?'s for coverage testing + * - Break out test code to separate file + * - Move NIL to puff.h + * - Allow incomplete code only if single code length is 1 + * - Add full code coverage test to Makefile + * 2.3 21 Jan 2013 - Check for invalid code length codes in dynamic blocks + */ + +#include /* for setjmp(), longjmp(), and jmp_buf */ +#include "puff.h" /* prototype for puff() */ + +#define local static /* for local function definitions */ + +/* + * Maximums for allocations and loops. It is not useful to change these -- + * they are fixed by the deflate format. + */ +#define MAXBITS 15 /* maximum bits in a code */ +#define MAXLCODES 286 /* maximum number of literal/length codes */ +#define MAXDCODES 30 /* maximum number of distance codes */ +#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */ +#define FIXLCODES 288 /* number of fixed literal/length codes */ + +/* input and output state */ +struct state { + /* output state */ + unsigned char *out; /* output buffer */ + unsigned long outlen; /* available space at out */ + unsigned long outcnt; /* bytes written to out so far */ + + /* input state */ + const unsigned char *in; /* input buffer */ + unsigned long inlen; /* available input at in */ + unsigned long incnt; /* bytes read so far */ + int bitbuf; /* bit buffer */ + int bitcnt; /* number of bits in bit buffer */ + + /* input limit error return state for bits() and decode() */ + jmp_buf env; +}; + +/* + * Return need bits from the input stream. This always leaves less than + * eight bits in the buffer. bits() works properly for need == 0. + * + * Format notes: + * + * - Bits are stored in bytes from the least significant bit to the most + * significant bit. Therefore bits are dropped from the bottom of the bit + * buffer, using shift right, and new bytes are appended to the top of the + * bit buffer, using shift left. + */ +local int bits(struct state *s, int need) +{ + long val; /* bit accumulator (can use up to 20 bits) */ + + /* load at least need bits into val */ + val = s->bitbuf; + while (s->bitcnt < need) { + if (s->incnt == s->inlen) + longjmp(s->env, 1); /* out of input */ + val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */ + s->bitcnt += 8; + } + + /* drop need bits and update buffer, always zero to seven bits left */ + s->bitbuf = (int)(val >> need); + s->bitcnt -= need; + + /* return need bits, zeroing the bits above that */ + return (int)(val & ((1L << need) - 1)); +} + +/* + * Process a stored block. + * + * Format notes: + * + * - After the two-bit stored block type (00), the stored block length and + * stored bytes are byte-aligned for fast copying. Therefore any leftover + * bits in the byte that has the last bit of the type, as many as seven, are + * discarded. The value of the discarded bits are not defined and should not + * be checked against any expectation. + * + * - The second inverted copy of the stored block length does not have to be + * checked, but it's probably a good idea to do so anyway. + * + * - A stored block can have zero length. This is sometimes used to byte-align + * subsets of the compressed data for random access or partial recovery. + */ +local int stored(struct state *s) +{ + unsigned len; /* length of stored block */ + + /* discard leftover bits from current byte (assumes s->bitcnt < 8) */ + s->bitbuf = 0; + s->bitcnt = 0; + + /* get length and check against its one's complement */ + if (s->incnt + 4 > s->inlen) + return 2; /* not enough input */ + len = s->in[s->incnt++]; + len |= s->in[s->incnt++] << 8; + if (s->in[s->incnt++] != (~len & 0xff) || + s->in[s->incnt++] != ((~len >> 8) & 0xff)) + return -2; /* didn't match complement! */ + + /* copy len bytes from in to out */ + if (s->incnt + len > s->inlen) + return 2; /* not enough input */ + if (s->out != NIL) { + if (s->outcnt + len > s->outlen) + return 1; /* not enough output space */ + while (len--) + s->out[s->outcnt++] = s->in[s->incnt++]; + } + else { /* just scanning */ + s->outcnt += len; + s->incnt += len; + } + + /* done with a valid stored block */ + return 0; +} + +/* + * Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of + * each length, which for a canonical code are stepped through in order. + * symbol[] are the symbol values in canonical order, where the number of + * entries is the sum of the counts in count[]. The decoding process can be + * seen in the function decode() below. + */ +struct huffman { + short *count; /* number of symbols of each length */ + short *symbol; /* canonically ordered symbols */ +}; + +/* + * Decode a code from the stream s using huffman table h. Return the symbol or + * a negative value if there is an error. If all of the lengths are zero, i.e. + * an empty code, or if the code is incomplete and an invalid code is received, + * then -10 is returned after reading MAXBITS bits. + * + * Format notes: + * + * - The codes as stored in the compressed data are bit-reversed relative to + * a simple integer ordering of codes of the same lengths. Hence below the + * bits are pulled from the compressed data one at a time and used to + * build the code value reversed from what is in the stream in order to + * permit simple integer comparisons for decoding. A table-based decoding + * scheme (as used in zlib) does not need to do this reversal. + * + * - The first code for the shortest length is all zeros. Subsequent codes of + * the same length are simply integer increments of the previous code. When + * moving up a length, a zero bit is appended to the code. For a complete + * code, the last code of the longest length will be all ones. + * + * - Incomplete codes are handled by this decoder, since they are permitted + * in the deflate format. See the format notes for fixed() and dynamic(). + */ +#ifdef SLOW +local int decode(struct state *s, const struct huffman *h) +{ + int len; /* current number of bits in code */ + int code; /* len bits being decoded */ + int first; /* first code of length len */ + int count; /* number of codes of length len */ + int index; /* index of first code of length len in symbol table */ + + code = first = index = 0; + for (len = 1; len <= MAXBITS; len++) { + code |= bits(s, 1); /* get next bit */ + count = h->count[len]; + if (code - count < first) /* if length len, return symbol */ + return h->symbol[index + (code - first)]; + index += count; /* else update for next length */ + first += count; + first <<= 1; + code <<= 1; + } + return -10; /* ran out of codes */ +} + +/* + * A faster version of decode() for real applications of this code. It's not + * as readable, but it makes puff() twice as fast. And it only makes the code + * a few percent larger. + */ +#else /* !SLOW */ +local int decode(struct state *s, const struct huffman *h) +{ + int len; /* current number of bits in code */ + int code; /* len bits being decoded */ + int first; /* first code of length len */ + int count; /* number of codes of length len */ + int index; /* index of first code of length len in symbol table */ + int bitbuf; /* bits from stream */ + int left; /* bits left in next or left to process */ + short *next; /* next number of codes */ + + bitbuf = s->bitbuf; + left = s->bitcnt; + code = first = index = 0; + len = 1; + next = h->count + 1; + while (1) { + while (left--) { + code |= bitbuf & 1; + bitbuf >>= 1; + count = *next++; + if (code - count < first) { /* if length len, return symbol */ + s->bitbuf = bitbuf; + s->bitcnt = (s->bitcnt - len) & 7; + return h->symbol[index + (code - first)]; + } + index += count; /* else update for next length */ + first += count; + first <<= 1; + code <<= 1; + len++; + } + left = (MAXBITS+1) - len; + if (left == 0) + break; + if (s->incnt == s->inlen) + longjmp(s->env, 1); /* out of input */ + bitbuf = s->in[s->incnt++]; + if (left > 8) + left = 8; + } + return -10; /* ran out of codes */ +} +#endif /* SLOW */ + +/* + * Given the list of code lengths length[0..n-1] representing a canonical + * Huffman code for n symbols, construct the tables required to decode those + * codes. Those tables are the number of codes of each length, and the symbols + * sorted by length, retaining their original order within each length. The + * return value is zero for a complete code set, negative for an over- + * subscribed code set, and positive for an incomplete code set. The tables + * can be used if the return value is zero or positive, but they cannot be used + * if the return value is negative. If the return value is zero, it is not + * possible for decode() using that table to return an error--any stream of + * enough bits will resolve to a symbol. If the return value is positive, then + * it is possible for decode() using that table to return an error for received + * codes past the end of the incomplete lengths. + * + * Not used by decode(), but used for error checking, h->count[0] is the number + * of the n symbols not in the code. So n - h->count[0] is the number of + * codes. This is useful for checking for incomplete codes that have more than + * one symbol, which is an error in a dynamic block. + * + * Assumption: for all i in 0..n-1, 0 <= length[i] <= MAXBITS + * This is assured by the construction of the length arrays in dynamic() and + * fixed() and is not verified by construct(). + * + * Format notes: + * + * - Permitted and expected examples of incomplete codes are one of the fixed + * codes and any code with a single symbol which in deflate is coded as one + * bit instead of zero bits. See the format notes for fixed() and dynamic(). + * + * - Within a given code length, the symbols are kept in ascending order for + * the code bits definition. + */ +local int construct(struct huffman *h, const short *length, int n) +{ + int symbol; /* current symbol when stepping through length[] */ + int len; /* current length when stepping through h->count[] */ + int left; /* number of possible codes left of current length */ + short offs[MAXBITS+1]; /* offsets in symbol table for each length */ + + /* count number of codes of each length */ + for (len = 0; len <= MAXBITS; len++) + h->count[len] = 0; + for (symbol = 0; symbol < n; symbol++) + (h->count[length[symbol]])++; /* assumes lengths are within bounds */ + if (h->count[0] == n) /* no codes! */ + return 0; /* complete, but decode() will fail */ + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; /* one possible code of zero length */ + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; /* one more bit, double codes left */ + left -= h->count[len]; /* deduct count from possible codes */ + if (left < 0) + return left; /* over-subscribed--return negative */ + } /* left > 0 means incomplete */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + h->count[len]; + + /* + * put symbols in table sorted by length, by symbol order within each + * length + */ + for (symbol = 0; symbol < n; symbol++) + if (length[symbol] != 0) + h->symbol[offs[length[symbol]]++] = symbol; + + /* return zero for complete set, positive for incomplete set */ + return left; +} + +/* + * Decode literal/length and distance codes until an end-of-block code. + * + * Format notes: + * + * - Compressed data that is after the block type if fixed or after the code + * description if dynamic is a combination of literals and length/distance + * pairs terminated by and end-of-block code. Literals are simply Huffman + * coded bytes. A length/distance pair is a coded length followed by a + * coded distance to represent a string that occurs earlier in the + * uncompressed data that occurs again at the current location. + * + * - Literals, lengths, and the end-of-block code are combined into a single + * code of up to 286 symbols. They are 256 literals (0..255), 29 length + * symbols (257..285), and the end-of-block symbol (256). + * + * - There are 256 possible lengths (3..258), and so 29 symbols are not enough + * to represent all of those. Lengths 3..10 and 258 are in fact represented + * by just a length symbol. Lengths 11..257 are represented as a symbol and + * some number of extra bits that are added as an integer to the base length + * of the length symbol. The number of extra bits is determined by the base + * length symbol. These are in the static arrays below, lens[] for the base + * lengths and lext[] for the corresponding number of extra bits. + * + * - The reason that 258 gets its own symbol is that the longest length is used + * often in highly redundant files. Note that 258 can also be coded as the + * base value 227 plus the maximum extra value of 31. While a good deflate + * should never do this, it is not an error, and should be decoded properly. + * + * - If a length is decoded, including its extra bits if any, then it is + * followed a distance code. There are up to 30 distance symbols. Again + * there are many more possible distances (1..32768), so extra bits are added + * to a base value represented by the symbol. The distances 1..4 get their + * own symbol, but the rest require extra bits. The base distances and + * corresponding number of extra bits are below in the static arrays dist[] + * and dext[]. + * + * - Literal bytes are simply written to the output. A length/distance pair is + * an instruction to copy previously uncompressed bytes to the output. The + * copy is from distance bytes back in the output stream, copying for length + * bytes. + * + * - Distances pointing before the beginning of the output data are not + * permitted. + * + * - Overlapped copies, where the length is greater than the distance, are + * allowed and common. For example, a distance of one and a length of 258 + * simply copies the last byte 258 times. A distance of four and a length of + * twelve copies the last four bytes three times. A simple forward copy + * ignoring whether the length is greater than the distance or not implements + * this correctly. You should not use memcpy() since its behavior is not + * defined for overlapped arrays. You should not use memmove() or bcopy() + * since though their behavior -is- defined for overlapping arrays, it is + * defined to do the wrong thing in this case. + */ +local int codes(struct state *s, + const struct huffman *lencode, + const struct huffman *distcode) +{ + int symbol; /* decoded symbol */ + int len; /* length for copy */ + unsigned dist; /* distance for copy */ + static const short lens[29] = { /* Size base for length codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; + static const short lext[29] = { /* Extra bits for length codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; + static const short dists[30] = { /* Offset base for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; + static const short dext[30] = { /* Extra bits for distance codes 0..29 */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + /* decode literals and length/distance pairs */ + do { + symbol = decode(s, lencode); + if (symbol < 0) + return symbol; /* invalid symbol */ + if (symbol < 256) { /* literal: symbol is the byte */ + /* write out the literal */ + if (s->out != NIL) { + if (s->outcnt == s->outlen) + return 1; + s->out[s->outcnt] = symbol; + } + s->outcnt++; + } + else if (symbol > 256) { /* length */ + /* get and compute length */ + symbol -= 257; + if (symbol >= 29) + return -10; /* invalid fixed code */ + len = lens[symbol] + bits(s, lext[symbol]); + + /* get and check distance */ + symbol = decode(s, distcode); + if (symbol < 0) + return symbol; /* invalid symbol */ + dist = dists[symbol] + bits(s, dext[symbol]); +#ifndef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + if (dist > s->outcnt) + return -11; /* distance too far back */ +#endif + + /* copy length bytes from distance bytes back */ + if (s->out != NIL) { + if (s->outcnt + len > s->outlen) + return 1; + while (len--) { + s->out[s->outcnt] = +#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + dist > s->outcnt ? + 0 : +#endif + s->out[s->outcnt - dist]; + s->outcnt++; + } + } + else + s->outcnt += len; + } + } while (symbol != 256); /* end of block symbol */ + + /* done with a valid fixed or dynamic block */ + return 0; +} + +/* + * Process a fixed codes block. + * + * Format notes: + * + * - This block type can be useful for compressing small amounts of data for + * which the size of the code descriptions in a dynamic block exceeds the + * benefit of custom codes for that block. For fixed codes, no bits are + * spent on code descriptions. Instead the code lengths for literal/length + * codes and distance codes are fixed. The specific lengths for each symbol + * can be seen in the "for" loops below. + * + * - The literal/length code is complete, but has two symbols that are invalid + * and should result in an error if received. This cannot be implemented + * simply as an incomplete code since those two symbols are in the "middle" + * of the code. They are eight bits long and the longest literal/length\ + * code is nine bits. Therefore the code must be constructed with those + * symbols, and the invalid symbols must be detected after decoding. + * + * - The fixed distance codes also have two invalid symbols that should result + * in an error if received. Since all of the distance codes are the same + * length, this can be implemented as an incomplete code. Then the invalid + * codes are detected while decoding. + */ +local int fixed(struct state *s) +{ + static int virgin = 1; + static short lencnt[MAXBITS+1], lensym[FIXLCODES]; + static short distcnt[MAXBITS+1], distsym[MAXDCODES]; + static struct huffman lencode, distcode; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + int symbol; + short lengths[FIXLCODES]; + + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + + /* literal/length table */ + for (symbol = 0; symbol < 144; symbol++) + lengths[symbol] = 8; + for (; symbol < 256; symbol++) + lengths[symbol] = 9; + for (; symbol < 280; symbol++) + lengths[symbol] = 7; + for (; symbol < FIXLCODES; symbol++) + lengths[symbol] = 8; + construct(&lencode, lengths, FIXLCODES); + + /* distance table */ + for (symbol = 0; symbol < MAXDCODES; symbol++) + lengths[symbol] = 5; + construct(&distcode, lengths, MAXDCODES); + + /* do this just once */ + virgin = 0; + } + + /* decode data until end-of-block code */ + return codes(s, &lencode, &distcode); +} + +/* + * Process a dynamic codes block. + * + * Format notes: + * + * - A dynamic block starts with a description of the literal/length and + * distance codes for that block. New dynamic blocks allow the compressor to + * rapidly adapt to changing data with new codes optimized for that data. + * + * - The codes used by the deflate format are "canonical", which means that + * the actual bits of the codes are generated in an unambiguous way simply + * from the number of bits in each code. Therefore the code descriptions + * are simply a list of code lengths for each symbol. + * + * - The code lengths are stored in order for the symbols, so lengths are + * provided for each of the literal/length symbols, and for each of the + * distance symbols. + * + * - If a symbol is not used in the block, this is represented by a zero as + * as the code length. This does not mean a zero-length code, but rather + * that no code should be created for this symbol. There is no way in the + * deflate format to represent a zero-length code. + * + * - The maximum number of bits in a code is 15, so the possible lengths for + * any code are 1..15. + * + * - The fact that a length of zero is not permitted for a code has an + * interesting consequence. Normally if only one symbol is used for a given + * code, then in fact that code could be represented with zero bits. However + * in deflate, that code has to be at least one bit. So for example, if + * only a single distance base symbol appears in a block, then it will be + * represented by a single code of length one, in particular one 0 bit. This + * is an incomplete code, since if a 1 bit is received, it has no meaning, + * and should result in an error. So incomplete distance codes of one symbol + * should be permitted, and the receipt of invalid codes should be handled. + * + * - It is also possible to have a single literal/length code, but that code + * must be the end-of-block code, since every dynamic block has one. This + * is not the most efficient way to create an empty block (an empty fixed + * block is fewer bits), but it is allowed by the format. So incomplete + * literal/length codes of one symbol should also be permitted. + * + * - If there are only literal codes and no lengths, then there are no distance + * codes. This is represented by one distance code with zero bits. + * + * - The list of up to 286 length/literal lengths and up to 30 distance lengths + * are themselves compressed using Huffman codes and run-length encoding. In + * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means + * that length, and the symbols 16, 17, and 18 are run-length instructions. + * Each of 16, 17, and 18 are follwed by extra bits to define the length of + * the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10 + * zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols + * are common, hence the special coding for zero lengths. + * + * - The symbols for 0..18 are Huffman coded, and so that code must be + * described first. This is simply a sequence of up to 19 three-bit values + * representing no code (0) or the code length for that symbol (1..7). + * + * - A dynamic block starts with three fixed-size counts from which is computed + * the number of literal/length code lengths, the number of distance code + * lengths, and the number of code length code lengths (ok, you come up with + * a better name!) in the code descriptions. For the literal/length and + * distance codes, lengths after those provided are considered zero, i.e. no + * code. The code length code lengths are received in a permuted order (see + * the order[] array below) to make a short code length code length list more + * likely. As it turns out, very short and very long codes are less likely + * to be seen in a dynamic code description, hence what may appear initially + * to be a peculiar ordering. + * + * - Given the number of literal/length code lengths (nlen) and distance code + * lengths (ndist), then they are treated as one long list of nlen + ndist + * code lengths. Therefore run-length coding can and often does cross the + * boundary between the two sets of lengths. + * + * - So to summarize, the code description at the start of a dynamic block is + * three counts for the number of code lengths for the literal/length codes, + * the distance codes, and the code length codes. This is followed by the + * code length code lengths, three bits each. This is used to construct the + * code length code which is used to read the remainder of the lengths. Then + * the literal/length code lengths and distance lengths are read as a single + * set of lengths using the code length codes. Codes are constructed from + * the resulting two sets of lengths, and then finally you can start + * decoding actual compressed data in the block. + * + * - For reference, a "typical" size for the code description in a dynamic + * block is around 80 bytes. + */ +local int dynamic(struct state *s) +{ + int nlen, ndist, ncode; /* number of lengths in descriptor */ + int index; /* index of lengths[] */ + int err; /* construct() return value */ + short lengths[MAXCODES]; /* descriptor code lengths */ + short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */ + short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */ + struct huffman lencode, distcode; /* length and distance codes */ + static const short order[19] = /* permutation of code length codes */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + + /* get number of lengths in each table, check lengths */ + nlen = bits(s, 5) + 257; + ndist = bits(s, 5) + 1; + ncode = bits(s, 4) + 4; + if (nlen > MAXLCODES || ndist > MAXDCODES) + return -3; /* bad counts */ + + /* read code length code lengths (really), missing lengths are zero */ + for (index = 0; index < ncode; index++) + lengths[order[index]] = bits(s, 3); + for (; index < 19; index++) + lengths[order[index]] = 0; + + /* build huffman table for code lengths codes (use lencode temporarily) */ + err = construct(&lencode, lengths, 19); + if (err != 0) /* require complete code set here */ + return -4; + + /* read length/literal and distance code length tables */ + index = 0; + while (index < nlen + ndist) { + int symbol; /* decoded value */ + int len; /* last length to repeat */ + + symbol = decode(s, &lencode); + if (symbol < 0) + return symbol; /* invalid symbol */ + if (symbol < 16) /* length in 0..15 */ + lengths[index++] = symbol; + else { /* repeat instruction */ + len = 0; /* assume repeating zeros */ + if (symbol == 16) { /* repeat last length 3..6 times */ + if (index == 0) + return -5; /* no last length! */ + len = lengths[index - 1]; /* last length */ + symbol = 3 + bits(s, 2); + } + else if (symbol == 17) /* repeat zero 3..10 times */ + symbol = 3 + bits(s, 3); + else /* == 18, repeat zero 11..138 times */ + symbol = 11 + bits(s, 7); + if (index + symbol > nlen + ndist) + return -6; /* too many lengths! */ + while (symbol--) /* repeat last or zero symbol times */ + lengths[index++] = len; + } + } + + /* check for end-of-block code -- there better be one! */ + if (lengths[256] == 0) + return -9; + + /* build huffman table for literal/length codes */ + err = construct(&lencode, lengths, nlen); + if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) + return -7; /* incomplete code ok only for single length 1 code */ + + /* build huffman table for distance codes */ + err = construct(&distcode, lengths + nlen, ndist); + if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) + return -8; /* incomplete code ok only for single length 1 code */ + + /* decode data until end-of-block code */ + return codes(s, &lencode, &distcode); +} + +/* + * Inflate source to dest. On return, destlen and sourcelen are updated to the + * size of the uncompressed data and the size of the deflate data respectively. + * On success, the return value of puff() is zero. If there is an error in the + * source data, i.e. it is not in the deflate format, then a negative value is + * returned. If there is not enough input available or there is not enough + * output space, then a positive error is returned. In that case, destlen and + * sourcelen are not updated to facilitate retrying from the beginning with the + * provision of more input data or more output space. In the case of invalid + * inflate data (a negative error), the dest and source pointers are updated to + * facilitate the debugging of deflators. + * + * puff() also has a mode to determine the size of the uncompressed output with + * no output written. For this dest must be (unsigned char *)0. In this case, + * the input value of *destlen is ignored, and on return *destlen is set to the + * size of the uncompressed output. + * + * The return codes are: + * + * 2: available inflate data did not terminate + * 1: output space exhausted before completing inflate + * 0: successful inflate + * -1: invalid block type (type == 3) + * -2: stored block length did not match one's complement + * -3: dynamic block code description: too many length or distance codes + * -4: dynamic block code description: code lengths codes incomplete + * -5: dynamic block code description: repeat lengths with no first length + * -6: dynamic block code description: repeat more than specified lengths + * -7: dynamic block code description: invalid literal/length code lengths + * -8: dynamic block code description: invalid distance code lengths + * -9: dynamic block code description: missing end-of-block code + * -10: invalid literal/length or distance code in fixed or dynamic block + * -11: distance is too far back in fixed or dynamic block + * + * Format notes: + * + * - Three bits are read for each block to determine the kind of block and + * whether or not it is the last block. Then the block is decoded and the + * process repeated if it was not the last block. + * + * - The leftover bits in the last byte of the deflate data after the last + * block (if it was a fixed or dynamic block) are undefined and have no + * expected values to check. + */ +int puff(unsigned char *dest, /* pointer to destination pointer */ + unsigned long destlen, /* amount of output space */ + const unsigned char *source, /* pointer to source data pointer */ + unsigned long sourcelen, /* amount of input available */ + unsigned long *outlen) /* output length */ +{ + struct state s; /* input/output state */ + int last, type; /* block information */ + int err; /* return value */ + + /* initialize output state */ + s.out = dest; + s.outlen = destlen; /* ignored if dest is NIL */ + s.outcnt = 0; + + /* initialize input state */ + s.in = source; + s.inlen = sourcelen; + s.incnt = 0; + s.bitbuf = 0; + s.bitcnt = 0; + + /* return if bits() or decode() tries to read past available input */ + if (setjmp(s.env) != 0) /* if came back here via longjmp() */ + err = 2; /* then skip do-loop, return error */ + else { + /* process blocks until last block or error */ + do { + last = bits(&s, 1); /* one if last block */ + type = bits(&s, 2); /* block type 0..3 */ + err = type == 0 ? + stored(&s) : + (type == 1 ? + fixed(&s) : + (type == 2 ? + dynamic(&s) : + -1)); /* type == 3, invalid */ + if (err != 0) + break; /* return with error */ + } while (!last); + } + + /* update the lengths and return */ + *outlen = s.outcnt; + return err; +} diff --git a/tools/extractor/puff.h b/tools/extractor/puff.h new file mode 100644 index 00000000..43455fca --- /dev/null +++ b/tools/extractor/puff.h @@ -0,0 +1,41 @@ +/* + THIS FILE HAS BEEN MODIFIED + puff has been modified to write length to argument pointer +*/ + +/* puff.h + Copyright (C) 2002-2013 Mark Adler, all rights reserved + version 2.3, 21 Jan 2013 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + + +/* + * See puff.c for purpose and usage. + */ +#ifndef NIL +# define NIL ((unsigned char *)0) /* for no output option */ +#endif + +int puff(unsigned char *dest, /* pointer to destination pointer */ + unsigned long destlen, /* amount of output space */ + const unsigned char *source, /* pointer to source data pointer */ + unsigned long sourcelen, /* amount of input available */ + unsigned long *outlen); /* output length */ diff --git a/tools/ge-stats.py b/tools/ge-stats.py new file mode 100644 index 00000000..6eec98ca --- /dev/null +++ b/tools/ge-stats.py @@ -0,0 +1,258 @@ +import re +import os +import sys +import subprocess +import shlex +import getopt + + +# -------------------------- +# Read Map File and return +# all function lenghts +# -------------------------- +def parse_map(version): + + if version not in ("us", "jp"): + print('fatal: version', version, 'not supported!') + sys.exit(2) + + version_code = version[0] + + infile = False + prevromaddr = 0 + lengths = {} + + p1 = re.compile(r"^ \.text\s+0x00000000([0-9a-f]{8})\s+0x([0-9a-f]+)\s+build\/" + re.escape(version_code) + r"\/(.*)\/\S+.\w$") + p2 = re.compile(r"\s+0x00000000([0-9a-f]{8})\s+(\S+)$") + + map_file = open('build/ge007.' + version_code + '.map', 'r') + lines = map_file.readlines() + + for line in lines: + + m1 = p1.findall(line) + m2 = p2.findall(line) + + if m1: + filestart = int(m1[0][0], 16) + filelen = int(m1[0][1], 16) + segment = m1[0][2] + infile = True + prevromaddr = 0 + prevfuncname = None + + if segment not in lengths.keys(): + lengths[segment] = {} + + elif infile and m2: + romaddr = int(m2[0][0], 16) + funcname = m2[0][1] + + if prevfuncname: + lengths[segment][prevfuncname] = romaddr - prevromaddr + + prevromaddr = romaddr + prevfuncname = funcname + + elif infile: + infile = False + + if prevfuncname: + lengths[segment][prevfuncname] = (filestart + filelen) - prevromaddr + + return lengths + +# -------------------------- +# Find and return all +# ASM Function names that still +# exists in Source Files +# -------------------------- +def find_asm_functions(): + + p = re.compile(r"^glabel (\S+)$") + asm_functions = [] + + for root, dirs, files in os.walk('src'): + for file in files: + with open(os.path.join(root, file)) as _file: + for i, line in enumerate(_file.readlines()): + m = p.findall(line) + if m: + asm_functions.append(m[0]) + + return asm_functions + +# -------------------------- +# Find and return the number of completed files +# Only scans for C and S files +# -------------------------- +def find_files_completed(): + + p = re.compile(r"^glabel (\S+)$") + files_complete = {} + + files_complete['completed'] = 0 + files_complete['total'] = 0 + + for root, dirs, files in os.walk('src'): + for file in files: + if file.endswith(".c") or file.endswith(".s"): + with open(os.path.join(root, file)) as _file: + + completed = True + files_complete['total'] += 1 + + for i, line in enumerate(_file.readlines()): + if p.findall(line): + completed = False + break + + if completed: + files_complete['completed'] += 1 + + return files_complete + +# -------------------------- +# Find and return the Name of most recent file +# Only scans for C and S files +# -------------------------- +def find_last_modified_file(): + lastdate = 0 + lastname = '' + timestamp = 0 + + for root, dirs, files in os.walk('src'): + for file in files: + if file.endswith(".c") or file.endswith(".s"): + _file = os.path.join(root, file) + + result = subprocess.run(['git', 'log', '-1', '--format=\"%ct\"', '--', _file], stdout=subprocess.PIPE, universal_newlines=True) + + timestamp = int(result.stdout.rstrip().replace('"', ''), 16) + + if timestamp > lastdate: + lastdate = timestamp + lastname = _file + + return lastname + +# -------------------------- +# Calculate the decomp stats +# on each folder +# -------------------------- +def do_stats(map_file, analyse_folders): + + asm_functions = find_asm_functions() + segments = {} + + for folder in analyse_folders: + + segments[folder] = {} + segments[folder]['done'] = 0 + segments[folder]['left'] = 0 + segments[folder]['total'] = 0 + + num_done = 0 + num_left = 0 + + for function in map_file[folder]: + if function in asm_functions: + num_left += map_file[folder][function] + else: + num_done += map_file[folder][function] + + segments[folder]['done'] = num_done / 4 + segments[folder]['left'] = num_left / 4 + segments[folder]['total'] = segments[folder]['done'] + segments[folder]['left'] + + return segments + +def generate_report(segments, files_completed, last_modified_file): + printstring = "./tools/report/report " + + totals = {} + totals['done'] = 0 + totals['total'] = 0 + + for key in segments.keys(): + printstring = printstring + str(segments[key]['done']) + ' ' + str(segments[key]['total']) + ' ' + totals['done'] += segments[key]['done'] + totals['total'] += segments[key]['total'] + + printstring = printstring + str(totals['done']) + ' ' + str(totals['total']) + ' ' + printstring = printstring + str(files_completed['completed']) + ' ' + str(files_completed['total']) + ' ' + printstring = printstring + './tools/report/index.html ' + last_modified_file + ' 0' + subprocess.Popen(printstring.split()) + +def print_stats(version, segments, files_completed, last_modified_file): + totals = {} + totals['done'] = 0 + totals['total'] = 0 + + print() + print('~> Decomp Statistics for ' + version.upper() +' version') + print('__________________________________________________________________') + print() + + print('FILES') + print('\tlast modified file\t' + last_modified_file ) + print('\ttotal files\t{:10,} / {:,} \t{:.2f}%'.format(int(files_completed['completed']), int(files_completed['total']), (files_completed['completed'] / files_completed['total'] * 100))) + + print('__________________________________________________________________') + print() + + print('WORDS') + for key in segments.keys(): + print('\t{:10}\t{:10,} / {:,} \t{:.2f}%'.format(key, int(segments[key]['done']), int(segments[key]['total']), (segments[key]['done'] / segments[key]['total'] * 100))) + totals['done'] += segments[key]['done'] + totals['total'] += segments[key]['total'] + + print('\t----------------------------------------------------------') + print('\tTOTAL\t\t{:10,} / {:,} \t{:.2f}%'.format(int(totals['done']), int(totals['total']), (totals['done'] / totals['total'] * 100))) + print('__________________________________________________________________') + print() + +def print_help(): + print('Usage: python3 ge-stats.py [OPTION]') + print('Generate Decompilation Stats for Goldeneye 007') + print('Example: python3 ge-stats.py --version us') + print(' ') + print('Options:') + print(' -v, --version=CODE generate decomp stats for version CODE (us or jp). Default is us') + print(' -r, --report generate html report using report tool') + print(' -h, --help display this help text and exit') + +def main(): + + version = 'us' + run_report = False + + if (len(sys.argv) > 1): + arguments, values = getopt.getopt(sys.argv[1:], "hv:r", ["help", "version=", "report"]) + + for current_argument, current_value in arguments: + if current_argument in ("-h", "--help"): + print_help() + sys.exit() + elif current_argument in ("-v", "--version"): + version = current_value + elif current_argument in ("-r", "--report"): + run_report = True + + files_completed = find_files_completed() + + last_modified_file = find_last_modified_file() + + map_file = parse_map(version) + + folders = ['src', 'src/game', 'src/inflate', 'src/libultra'] + + segments = do_stats(map_file, folders) + + print_stats(version, segments, files_completed, last_modified_file) + + if run_report: + generate_report(segments, files_completed, last_modified_file) + +if __name__ == '__main__': + main() diff --git a/tools/report/background.jpg b/tools/report/background.jpg new file mode 100644 index 00000000..cc7145cd Binary files /dev/null and b/tools/report/background.jpg differ diff --git a/tools/report/cursor.cur b/tools/report/cursor.cur new file mode 100644 index 00000000..48589c10 Binary files /dev/null and b/tools/report/cursor.cur differ diff --git a/tools/report/main.c b/tools/report/main.c new file mode 100644 index 00000000..429e2b5f --- /dev/null +++ b/tools/report/main.c @@ -0,0 +1,300 @@ +#include +#include +#include "objectives.h" + +#define LINE "__________________________________________________________________" + +#define PERCENTF(val, val_max) (((float)val / (float)val_max) * 100.f) +#define CLAMP_VAL(value, min, max) (((value) < (min)) ? (min) : (((value) > (max)) ? (max) : ((value) < (min)) ? (min) : (value))) + +enum PROGRAM_ARGUMENTS +{ + PROGRAM_NAME = 0, + SRC_DIR, + SRC_DIR_MAX, + GAME_DIR, + GAME_DIR_MAX, + INFLATE_DIR, + INFLATE_DIR_MAX, + LIBULTRA_DIR, + LIBULTRA_DIR_MAX, + DECOMPILED_WORDS, + DECOMPILED_WORDS_MAX, + DECOMPILED_FILES, + DECOMPILED_FILES_MAX, + HTML_OUTPUT, + LAST_MODIFIED_FILE, + LOG_LEVEL, + ARGS_MAX +}; + +enum VERBOSITY_LOGGING +{ + LOG_MIN = 0, + LOG_DEF, + LOG_MAX +}; + +int total_objectives(void) +{ + /************************/ + int tmp_mis = 0; + int tmp_obj = OBJ_A; + int max_objs = 0; + /************************/ + + for(;;) + { + if(missions[tmp_mis].obj[tmp_obj][LINE1] == NULL) /* reached end of mission's objectives, check next mission */ + { + if(missions[tmp_mis + 1].obj[OBJ_A][LINE1] == NULL) /* reached end of struct, stop counting */ + { + break; + } + tmp_mis++; + tmp_obj = OBJ_A; + } + tmp_obj++; + max_objs++; + } + return max_objs; +} + +void calc_mission_and_objective(int *cur_mis, int *cur_obj, int decomp_progress) +{ + /************************/ + int max_objs = 0; + /************************/ + + for(;;) + { + if(missions[*cur_mis].obj[*cur_obj][LINE1] == NULL) /* reached end of mission's objectives, check next mission */ + { + if(missions[*cur_mis + 1].obj[OBJ_A][LINE1] == NULL) /* reached end of struct, stop counting */ + { + break; + } + *cur_mis += 1; + *cur_obj = OBJ_A; + } + *cur_obj += 1; + max_objs += 1; + if(max_objs >= decomp_progress) + { + break; + } + } +} + +int max_objectives(const int cur_mis) +{ + /************************/ + int cur_obj = OBJ_A; + /************************/ + + for(;;) + { + if(missions[cur_mis].obj[cur_obj][LINE1] == NULL) /* reached end of mission's objectives, break */ + { + break; + } + cur_obj++; + } + return cur_obj; +} + +int main(int argc, char **argv) +{ + /************************/ + long int src_dir, src_dir_max; + long int game_dir, game_dir_max; + long int inflate_dir, inflate_dir_max; + long int libultra_dir, libultra_dir_max; + long int decompiled_words, decompiled_words_max; + long int decompiled_files, decompiled_files_max; + int cur_mis = 0, cur_obj = OBJ_A; + int cur_mis_objs_max = 0, max_objs = 0; + int tmp_obj, cur_line = 0; + int last_modified_file_arg_active = 0; + int verbosity_level = LOG_DEF; + float total_complete, obj_remaining; + FILE *html; + /************************/ + + /* read logging level */ + if(argc == ARGS_MAX) + { + verbosity_level = CLAMP_VAL(atoi(argv[LOG_LEVEL]), 0, 2); + } + if(verbosity_level != LOG_MIN) + { + printf("\n GoldenEye 007 Decompiled Statistics Generator\n%s\n", LINE); + } + if(argc != ARGS_MAX) /* incorrect number of arguments */ + { + printf("\n About: Generate decompiled statistics website\n\n Syntax: %s src max game max inflate max libultra max decompiled_words max_words decompiled_files all_files html_output last_modified_file verbosity_level (0-2)\n\n Note: Each dir's statistic must be followed with the total words for the dir.\n Example: 1481 15854 12641 232276 564 1312 556 20330 15242 269772 49 336 ./index.html \"src/game/bond.c\" 1", argv[PROGRAM_NAME]); + goto exit; + } + + /* read arguments */ + src_dir = atol(argv[SRC_DIR]), src_dir_max = atol(argv[SRC_DIR_MAX]); + game_dir = atol(argv[GAME_DIR]), game_dir_max = atol(argv[GAME_DIR_MAX]); + inflate_dir = atol(argv[INFLATE_DIR]), inflate_dir_max = atol(argv[INFLATE_DIR_MAX]); + libultra_dir = atol(argv[LIBULTRA_DIR]), libultra_dir_max = atol(argv[LIBULTRA_DIR_MAX]); + decompiled_words = atol(argv[DECOMPILED_WORDS]), decompiled_words_max = atol(argv[DECOMPILED_WORDS_MAX]); + decompiled_files = atol(argv[DECOMPILED_FILES]), decompiled_files_max = atol(argv[DECOMPILED_FILES_MAX]); + if(src_dir > src_dir_max) + { + printf("\n Error: Aborted, src larger than src max argument"); + goto exit; + } + if(game_dir > game_dir_max) + { + printf("\n Error: Aborted, game larger than game max argument"); + goto exit; + } + if(inflate_dir > inflate_dir_max) + { + printf("\n Error: Aborted, inflate larger than inflate max argument"); + goto exit; + } + if(libultra_dir > libultra_dir_max) + { + printf("\n Error: Aborted, libultra larger than libultra max argument"); + goto exit; + } + if(decompiled_words > decompiled_words_max) + { + printf("\n Error: Aborted, decompiled words larger than total words argument"); + goto exit; + } + if(decompiled_files > decompiled_files_max) + { + printf("\n Error: Aborted, decompiled files larger than total files argument"); + goto exit; + } + if(src_dir < 0 || src_dir_max < 0 || game_dir < 0 || game_dir_max < 0 || inflate_dir < 0 || inflate_dir_max < 0 || libultra_dir < 0 || libultra_dir_max < 0 || decompiled_words < 0 || decompiled_words_max < 0|| decompiled_files < 0 || decompiled_files_max < 0) + { + printf("\n Error: Aborted, detected negative arguments (invalid or overflow)"); + goto exit; + } + last_modified_file_arg_active = (argv[LAST_MODIFIED_FILE] != NULL); + + /* print all arguments */ + if(verbosity_level == LOG_MAX) + { + printf("\n src_dir:\t\t%ld / %ld", src_dir, src_dir_max); + printf("\n game_dir:\t\t%ld / %ld", game_dir, game_dir_max); + printf("\n inflate_dir:\t\t%ld / %ld", inflate_dir, inflate_dir_max); + printf("\n libultra_dir:\t\t%ld / %ld", libultra_dir, libultra_dir_max); + printf("\n decompiled_words:\t%ld / %ld", decompiled_words, decompiled_words_max); + printf("\n decompiled_files:\t%ld / %ld", decompiled_files, decompiled_files_max); + printf("\n last_modified_file:\t%s\n%s\n", last_modified_file_arg_active ? argv[LAST_MODIFIED_FILE] : "NULL", LINE); + } + + html = fopen(argv[HTML_OUTPUT], "ab"); + if(html == NULL) + { + printf("\n Error: Aborted, %s cannot be opened", argv[HTML_OUTPUT]); + goto exit; + } + + max_objs = total_objectives(); + total_complete = ((float)decompiled_words / (float)decompiled_words_max) * (float)max_objs; + obj_remaining = total_complete - (float)((int)total_complete); + calc_mission_and_objective(&cur_mis, &cur_obj, (int)total_complete); + cur_mis_objs_max = max_objectives(cur_mis); + + fprintf(html, "%s\n", missions[cur_mis].diff); + fprintf(html, "%s\n", missions[cur_mis].title); + fprintf(html, "%s\n", missions[cur_mis].part); + fprintf(html, "REPORT:\n"); + fprintf(html, "Mission status:\n"); + fprintf(html, "\n", cur_obj == cur_mis_objs_max ? ">Completed" : " class=\"failed\">FAILED"); + + for(tmp_obj = OBJ_A; tmp_obj < cur_mis_objs_max; tmp_obj++, cur_line++) + { + fprintf(html, "%s\n", line_rows[cur_line], diff_char[tmp_obj]); + fprintf(html, "%s\n", line_rows[cur_line], missions[cur_mis].obj[tmp_obj][LINE1]); + fprintf(html, "\n", line_rows[cur_line], tmp_obj < cur_obj ? ">Completed" : " class=\"failed\">FAILED"); + if(missions[cur_mis].obj[tmp_obj][LINE2] != NULL) /* if objective took up two lines, skip an extra line for next objective */ + { + fprintf(html, "%s\n", line_rows[cur_line+1], missions[cur_mis].obj[tmp_obj][LINE2]); + cur_line++; + } + } + + fprintf(html, "\n"); + fprintf(html, "\n"); + fprintf(html, "\n"); + fprintf(html, "%s\n", missions[cur_mis].diff); + fprintf(html, "%s\n", missions[cur_mis].title); + fprintf(html, "%s\n", missions[cur_mis].part); + fprintf(html, "STATISTICS:\n"); + fprintf(html, "Time:\n"); + fprintf(html, "00:02\n"); + fprintf(html, "Target:\n"); + fprintf(html, "04:00\n"); + fprintf(html, "(Best Time: 00:10)\n"); + fprintf(html, "Decomp:\n"); + fprintf(html, "%0.1f%%\n", PERCENTF(decompiled_words, decompiled_words_max)); + if(last_modified_file_arg_active) + { + fprintf(html, "Last modified file:\n"); + fprintf(html, "%s\n", argv[14]); + } + else + { + fprintf(html, "Weapon of choice:\n"); + fprintf(html, "PP7 (silenced)\n"); + } + fprintf(html, "Files done:\n"); + fprintf(html, "%ld\n", decompiled_files); + fprintf(html, "Files total:\n"); + fprintf(html, "%ld\n", decompiled_files_max); + fprintf(html, "src:\n"); + fprintf(html, "%ld (%0.1f%%)\n", src_dir, PERCENTF(src_dir, src_dir_max)); + fprintf(html, "src/game:\n"); + fprintf(html, "%ld (%0.1f%%)\n", game_dir, PERCENTF(game_dir, game_dir_max)); + fprintf(html, "src/inflate:\n"); + fprintf(html, "%ld (%0.1f%%)\n", inflate_dir, PERCENTF(inflate_dir, inflate_dir_max)); + fprintf(html, "src/libultra:\n"); + fprintf(html, "%ld (%0.1f%%)\n", libultra_dir, PERCENTF(libultra_dir, libultra_dir_max)); + fprintf(html, "\n"); + fprintf(html, "\n"); + fprintf(html, "\n"); + fprintf(html, "\n"); + fprintf(html, ""); + fclose(html); + + if(verbosity_level != LOG_MIN) + { + printf("\n Successfully written stats to %s\n\n", argv[13]); + } + printf(" %s\n", missions[cur_mis].out_name); + for(tmp_obj = OBJ_A; tmp_obj < cur_mis_objs_max; tmp_obj++) + { + printf("\n [%s] %s", tmp_obj < cur_obj ? "X" : " ", missions[cur_mis].obj[tmp_obj][LINE1]); + if(missions[cur_mis].obj[tmp_obj][LINE2] != NULL) + { + printf(" %s", missions[cur_mis].obj[tmp_obj][LINE2]); + } + if(tmp_obj == cur_obj) + { + printf(" - %0.1f%%", obj_remaining * 100.f); + } + } + + printf("\n\n Mission Status: %s", cur_obj == cur_mis_objs_max ? "Completed" : "FAILED"); + if(total_complete == max_objs) + { + printf("\n\n Baron has been defeated - decomp is complete!!"); + } + +exit: + if(verbosity_level != LOG_MIN) + { + printf("\n%s\n\n", LINE); + } + return 0; +} diff --git a/tools/report/makefile b/tools/report/makefile new file mode 100644 index 00000000..cfb371ce --- /dev/null +++ b/tools/report/makefile @@ -0,0 +1,42 @@ +#Compiler +CC = @gcc + +#Source directories +SRCDIR = ./ +OUTNAME = $(SRCDIR)report +TEMPLATE = $(SRCDIR)template.html +OUTHTML = $(SRCDIR)index.html + +#Compiler flags +CFLAGS = -shared -ansi -Os -std=c89 +CFLAGSDBG = -shared -ansi -g -std=c89 +WFLAGS = -W -Wall -Wextra -pedantic -Wunreachable-code + +#Linker flags +OBJS = $(SRCDIR)main.o +LFLAGS = $(OBJS) -o $(OUTNAME) -s +LFLAGSDBG = $(OBJS) -o $(OUTNAME) + +#Main recipes +all: copy_html report + +debug: CC = gcc +debug: CFLAGS = $(CFLAGSDBG) +debug: LFLAGS = $(LFLAGSDBG) +debug: copy_html +debug: report + +report: $(OBJS) + $(CC) $(LFLAGS) + +clean: + @rm $(OUTNAME) + @rm $(OUTHTML) + @rm $(SRCDIR)*.o + +copy_html: + @cp -f $(TEMPLATE) $(OUTHTML) + +#Individual recipes +$(OBJDIR)main.o: $(SRCDIR)main.c $(SRCDIR)objectives.h + $(CC) -c $(SRCDIR)main.c -o $(SRCDIR)main.o $(CFLAGS) $(WFLAGS) \ No newline at end of file diff --git a/tools/report/objectives.h b/tools/report/objectives.h new file mode 100644 index 00000000..770dec77 --- /dev/null +++ b/tools/report/objectives.h @@ -0,0 +1,753 @@ +#define MISSIONS_A_MAX 18 +#define MISSIONS_SA_MAX 19 +#define MISSIONS_00A_MAX 20 +#define MISSIONS_MAX (MISSIONS_A_MAX + MISSIONS_SA_MAX + MISSIONS_00A_MAX + 1) +#define OBJECTIVES_MAX (OBJ_MAX + 1) + +enum OBJECTIVES +{ + OBJ_A = 0, + OBJ_B, + OBJ_C, + OBJ_D, + OBJ_E, + OBJ_MAX +}; + +enum OBJECTIVE_LINES +{ + LINE1 = 0, + LINE2, + LINE_MAX +}; + +struct mission +{ + char *out_name; + char *diff; + char *title; + char *part; + char *obj[OBJECTIVES_MAX][LINE_MAX]; +}; + +char *diff_char[OBJECTIVES_MAX] = {"a.", "b.", "c.", "d.", "e.", NULL}; +int line_rows[] = {1330, 1428, 1527, 1625, 1724, 1822, 1921, 2020, 2119}; + +struct mission missions[MISSIONS_MAX] = +{ + { + "Dam (Agent)", + "Agent: James Bond", + "Mission 1: Arkangelsk", + "Part i: Dam", + { + {"Bungee jump from platform", NULL}, + {NULL, NULL} + } + }, + { + "Facility (Agent)", + "Agent: James Bond", + "Mission 1: Arkangelsk", + "Part ii: Facility", + { + {"Gain access to laboratory area", NULL}, + {"Rendezvous with 006", NULL}, + {"Destroy all tanks in bottling room", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Runway (Agent)", + "Agent: James Bond", + "Mission 1: Arkangelsk", + "Part iii: Runway", + { + {"Find plane ignition key", NULL}, + {"Escape in plane", NULL}, + {NULL, NULL} + } + }, + { + "Surface i (Agent)", + "Agent: James Bond", + "Mission 2: Severnaya", + "Part i: Surface", + { + {"Power down communications", "dish"}, + {"Enter base via ventilation tower", NULL}, + {NULL, NULL} + } + }, + { + "Bunker i (Agent)", + "Agent: James Bond", + "Mission 2: Severnaya", + "Part ii: Bunker", + { + {"Copy Goldeneye key and leave", "original"}, + {"Photograph main video screen", NULL}, + {NULL, NULL} + } + }, + { + "Silo (Agent)", + "Agent: James Bond", + "Mission 3: Kirghizstan", + "Part i: Launch Silo #4", + { + {"Photograph satellite", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Frigate (Agent)", + "Agent: James Bond", + "Mission 4: Monte Carlo", + "Part i: Frigate", + { + {"Rescue hostages", NULL}, + {"Plant tracking bug on helicopter", NULL}, + {NULL, NULL} + } + }, + { + "Surface ii (Agent)", + "Agent: James Bond", + "Mission 5: Severnaya", + "Part i: Surface", + { + {"Break communications link to", "bunker"}, + {"Gain entry to bunker", NULL}, + {NULL, NULL} + } + }, + { + "Bunker ii (Agent)", + "Agent: James Bond", + "Mission 5: Severnaya", + "Part ii: Bunker", + { + {"Recover CCTV tape", NULL}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Statue (Agent)", + "Agent: James Bond", + "Mission 6: St. Petersburg", + "Part i: Statue Park", + { + {"Contact Valentin", NULL}, + {"Confront and unmask Janus", NULL}, + {"Locate helicopter", NULL}, + {"Rescue Natalya", NULL}, + {"Find flight recorder", NULL}, + {NULL, NULL} + } + }, + { + "Archives (Agent)", + "Agent: James Bond", + "Mission 6: St. Petersburg", + "Part ii: Military Archives", + { + {"Escape from interrogation room", NULL}, + {"Find Natalya", NULL}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Streets (Agent)", + "Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iii: Streets", + { + {"Pursue Ourumov and Natalya", NULL}, + {"Minimize civilian casualties", NULL}, + {NULL, NULL} + } + }, + { + "Depot (Agent)", + "Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iv: Depot", + { + {"Locate Trevelyan's train", NULL}, + {NULL, NULL} + } + }, + { + "Train (Agent)", + "Agent: James Bond", + "Mission 6: St. Petersburg", + "Part v: Train", + { + {"Destroy brake units", NULL}, + {"Rescue Natalya", NULL}, + {"Escape to safety", NULL}, + {NULL, NULL} + } + }, + { + "Jungle (Agent)", + "Agent: James Bond", + "Mission 7: Cuba", + "Part i: Jungle", + { + {"Destroy drone guns", NULL}, + {"Eliminate Xenia", NULL}, + {"Escort Natalya to Janus base", NULL}, + {NULL, NULL} + } + }, + { + "Control (Agent)", + "Agent: James Bond", + "Mission 7: Cuba", + "Part ii: Control", + { + {"Protect Natalya", NULL}, + {"Disable Goldeneye satellite", NULL}, + {"Destroy armored mainframes", NULL}, + {NULL, NULL} + } + }, + { + "Caverns (Agent)", + "Agent: James Bond", + "Mission 7: Cuba", + "Part iii: Water Caverns", + { + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Cradle (Agent)", + "Agent: James Bond", + "Mission 7: Cuba", + "Part iv: Antenna Cradle", + { + {"Destroy control console", NULL}, + {"Settle the score with Trevelyan", NULL}, + {NULL, NULL} + } + }, + + { + "Dam (Secret Agent)", + "Secret Agent: James Bond", + "Mission 1: Arkangelsk", + "Part i: Dam", + { + {"Neutralize all alarms", NULL}, + {"Bungee jump from platform", NULL}, + {NULL, NULL} + } + }, + { + "Facility (Secret Agent)", + "Secret Agent: James Bond", + "Mission 1: Arkangelsk", + "Part ii: Facility", + { + {"Gain access to laboratory area", NULL}, + {"Contact double Agent: James Bond", NULL}, + {"Rendezvous with 006", NULL}, + {"Destroy all tanks in bottling room", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Runway (Secret Agent)", + "Secret Agent: James Bond", + "Mission 1: Arkangelsk", + "Part iii: Runway", + { + {"Find plane ignition key", NULL}, + {"Destroy missile battery", NULL}, + {"Escape in plane", NULL}, + {NULL, NULL} + } + }, + { + "Surface i (Secret Agent)", + "Secret Agent: James Bond", + "Mission 2: Severnaya", + "Part i: Surface", + { + {"Power down communications", "dish"}, + {"Obtain safe key", NULL}, + {"Steal building plans", NULL}, + {"Enter base via ventilation tower", NULL}, + {NULL, NULL} + } + }, + { + "Bunker i (Secret Agent)", + "Secret Agent: James Bond", + "Mission 2: Severnaya", + "Part ii: Bunker", + { + {"Disrupt all surveillance equipment", NULL}, + {"Copy Goldeneye key and leave", "original"}, + {"Photograph main video screen", NULL}, + {NULL, NULL} + } + }, + { + "Silo (Secret Agent)", + "Secret Agent: James Bond", + "Mission 3: Kirghizstan", + "Part i: Launch Silo #4", + { + {"Photograph satellite", NULL}, + {"Obtain telemetric data", NULL}, + {"Retrieve satellite circuitry", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Frigate (Secret Agent)", + "Secret Agent: James Bond", + "Mission 4: Monte Carlo", + "Part i: Frigate", + { + {"Rescue hostages", NULL}, + {"Disarm bridge bomb", NULL}, + {"Disarm engine room bomb", NULL}, + {"Plant tracking bug on helicopter", NULL}, + {NULL, NULL} + } + }, + { + "Surface ii (Secret Agent)", + "Secret Agent: James Bond", + "Mission 5: Severnaya", + "Part i: Surface", + { + {"Break communications link to", "bunker"}, + {"Disable Spetznaz support aircraft", NULL}, + {"Gain entry to bunker", NULL}, + {NULL, NULL} + } + }, + { + "Bunker ii (Secret Agent)", + "Secret Agent: James Bond", + "Mission 5: Severnaya", + "Part ii: Bunker", + { + {"Compare staff / casualty lists", NULL}, + {"Recover CCTV tape", NULL}, + {"Disable all security cameras", NULL}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Statue (Secret Agent)", + "Secret Agent: James Bond", + "Mission 6: St. Petersburg", + "Part i: Statue Park", + { + {"Contact Valentin", NULL}, + {"Confront and unmask Janus", NULL}, + {"Locate helicopter", NULL}, + {"Rescue Natalya", NULL}, + {"Find flight recorder", NULL}, + {NULL, NULL} + } + }, + { + "Archives (Secret Agent)", + "Secret Agent: James Bond", + "Mission 6: St. Petersburg", + "Part ii: Military Archives", + { + {"Escape from interrogation room", NULL}, + {"Find Natalya", NULL}, + {"Recover helicopter black box", NULL}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Streets (Secret Agent)", + "Secret Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iii: Streets", + { + {"Contact Valentin", NULL}, + {"Pursue Ourumov and Natalya", NULL}, + {"Minimize civilian casualties", NULL}, + {NULL, NULL} + } + }, + { + "Depot (Secret Agent)", + "Secret Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iv: Depot", + { + {"Destroy computer network", NULL}, + {"Obtain safe key", NULL}, + {"Recover helicopter blueprints", NULL}, + {"Locate Trevelyan's train", NULL}, + {NULL, NULL} + } + }, + { + "Train (Secret Agent)", + "Secret Agent: James Bond", + "Mission 6: St. Petersburg", + "Part v: Train", + { + {"Destroy brake units", NULL}, + {"Rescue Natalya", NULL}, + {"Locate Janus secret base", NULL}, + {"Escape to safety", NULL}, + {NULL, NULL} + } + }, + { + "Jungle (Secret Agent)", + "Secret Agent: James Bond", + "Mission 7: Cuba", + "Part i: Jungle", + { + {"Destroy drone guns", NULL}, + {"Eliminate Xenia", NULL}, + {"Blow up ammo dump", NULL}, + {"Escort Natalya to Janus base", NULL}, + {NULL, NULL} + } + }, + { + "Control (Secret Agent)", + "Secret Agent: James Bond", + "Mission 7: Cuba", + "Part ii: Control", + { + {"Protect Natalya", NULL}, + {"Disable Goldeneye satellite", NULL}, + {"Destroy armored mainframes", NULL}, + {NULL, NULL} + } + }, + { + "Caverns (Secret Agent)", + "Secret Agent: James Bond", + "Mission 7: Cuba", + "Part iii: Water Caverns", + { + {"Destroy inlet pump controls", NULL}, + {"Destroy outlet pump controls", NULL}, + {"Destroy master pump console", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Cradle (Secret Agent)", + "Secret Agent: James Bond", + "Mission 7: Cuba", + "Part iv: Antenna Cradle", + { + {"Destroy control console", NULL}, + {"Settle the score with Trevelyan", NULL}, + {NULL, NULL} + } + }, + { + "Aztec (Secret Agent)", + "Secret Agent: James Bond", + "Mission 8: Teotihuaca'n", + "Part i: Aztec Complex", + { + {"Reprogram shuttle guidance", NULL}, + {"Launch shuttle", NULL}, + {NULL, NULL} + } + }, + + { + "Dam (00 Agent)", + "00 Agent: James Bond", + "Mission 1: Arkangelsk", + "Part i: Dam", + { + {"Neutralize all alarms", NULL}, + {"Install covert modem", NULL}, + {"Intercept data backup", NULL}, + {"Bungee jump from platform", NULL}, + {NULL, NULL} + } + }, + { + "Facility (00 Agent)", + "00 Agent: James Bond", + "Mission 1: Arkangelsk", + "Part ii: Facility", + { + {"Gain access to laboratory area", NULL}, + {"Contact double Agent: James Bond", NULL}, + {"Rendezvous with 006", NULL}, + {"Destroy all tanks in bottling room", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Runway (00 Agent)", + "00 Agent: James Bond", + "Mission 1: Arkangelsk", + "Part iii: Runway", + { + {"Find plane ignition key", NULL}, + {"Destroy heavy gun emplacements", NULL}, + {"Destroy missile battery", NULL}, + {"Escape in plane", NULL}, + {NULL, NULL} + } + }, + { + "Surface i (00 Agent)", + "00 Agent: James Bond", + "Mission 2: Severnaya", + "Part i: Surface", + { + {"Power down communications", "dish"}, + {"Obtain safe key", NULL}, + {"Steal building plans", NULL}, + {"Enter base via ventilation tower", NULL}, + {NULL, NULL} + } + }, + { + "Bunker i (00 Agent)", + "00 Agent: James Bond", + "Mission 2: Severnaya", + "Part ii: Bunker", + { + {"Disrupt all surveillance equipment", NULL}, + {"Copy Goldeneye key and leave", "original"}, + {"Get personnel to activate", "computer"}, + {"Download data from computer", NULL}, + {"Photograph main video screen", NULL}, + {NULL, NULL} + } + }, + { + "Silo (00 Agent)", + "00 Agent: James Bond", + "Mission 3: Kirghizstan", + "Part i: Launch Silo #4", + { + {"Plant bombs in fuel rooms", NULL}, + {"Photograph satellite", NULL}, + {"Obtain telemetric data", NULL}, + {"Retrieve satellite circuitry", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Frigate (00 Agent)", + "00 Agent: James Bond", + "Mission 4: Monte Carlo", + "Part i: Frigate", + { + {"Rescue hostages", NULL}, + {"Disarm bridge bomb", NULL}, + {"Disarm engine room bomb", NULL}, + {"Plant tracking bug on helicopter", NULL}, + {NULL, NULL} + } + }, + { + "Surface ii (00 Agent)", + "00 Agent: James Bond", + "Mission 5: Severnaya", + "Part i: Surface", + { + {"Disrupt all surveillance equipment", NULL}, + {"Break communications link to", "bunker"}, + {"Disable Spetznaz support aircraft", NULL}, + {"Gain entry to bunker", NULL}, + {NULL, NULL} + } + }, + { + "Bunker ii (00 Agent)", + "00 Agent: James Bond", + "Mission 5: Severnaya", + "Part ii: Bunker", + { + {"Compare staff / casualty lists", NULL}, + {"Recover CCTV tape", NULL}, + {"Disable all security cameras", NULL}, + {"Recover Goldeneye operations", "manual"}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Statue (00 Agent)", + "00 Agent: James Bond", + "Mission 6: St. Petersburg", + "Part i: Statue Park", + { + {"Contact Valentin", NULL}, + {"Confront and unmask Janus", NULL}, + {"Locate helicopter", NULL}, + {"Rescue Natalya", NULL}, + {"Find flight recorder", NULL}, + {NULL, NULL} + } + }, + { + "Archives (00 Agent)", + "00 Agent: James Bond", + "Mission 6: St. Petersburg", + "Part ii: Military Archives", + { + {"Escape from interrogation room", NULL}, + {"Find Natalya", NULL}, + {"Recover helicopter black box", NULL}, + {"Escape with Natalya", NULL}, + {NULL, NULL} + } + }, + { + "Streets (00 Agent)", + "00 Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iii: Streets", + { + {"Contact Valentin", NULL}, + {"Pursue Ourumov and Natalya", NULL}, + {"Minimize civilian casualties", NULL}, + {NULL, NULL} + } + }, + { + "Depot (00 Agent)", + "00 Agent: James Bond", + "Mission 6: St. Petersburg", + "Part iv: Depot", + { + {"Destroy illegal arms cache", NULL}, + {"Destroy computer network", NULL}, + {"Obtain safe key", NULL}, + {"Recover helicopter blueprints", NULL}, + {"Locate Trevelyan's train", NULL}, + {NULL, NULL} + } + }, + { + "Train (00 Agent)", + "00 Agent: James Bond", + "Mission 6: St. Petersburg", + "Part v: Train", + { + {"Destroy brake units", NULL}, + {"Rescue Natalya", NULL}, + {"Locate Janus secret base", NULL}, + {"Crack Boris' password", NULL}, + {"Escape to safety", NULL}, + {NULL, NULL} + } + }, + { + "Jungle (00 Agent)", + "00 Agent: James Bond", + "Mission 7: Cuba", + "Part i: Jungle", + { + {"Destroy drone guns", NULL}, + {"Eliminate Xenia", NULL}, + {"Blow up ammo dump", NULL}, + {"Escort Natalya to Janus base", NULL}, + {NULL, NULL} + } + }, + { + "Control (00 Agent)", + "00 Agent: James Bond", + "Mission 7: Cuba", + "Part ii: Control", + { + {"Protect Natalya", NULL}, + {"Disable Goldeneye satellite", NULL}, + {"Destroy armored mainframes", NULL}, + {NULL, NULL} + } + }, + { + "Caverns (00 Agent)", + "00 Agent: James Bond", + "Mission 7: Cuba", + "Part iii: Water Caverns", + { + {"Destroy inlet pump controls", NULL}, + {"Destroy outlet pump controls", NULL}, + {"Destroy master pump console", NULL}, + {"Use radio to contact Jack Wade", NULL}, + {"Minimize scientist casualties", NULL}, + {NULL, NULL} + } + }, + { + "Cradle (00 Agent)", + "00 Agent: James Bond", + "Mission 7: Cuba", + "Part iv: Antenna Cradle", + { + {"Destroy control console", NULL}, + {"Settle the score with Trevelyan", NULL}, + {NULL, NULL} + } + }, + { + "Aztec (00 Agent)", + "00 Agent: James Bond", + "Mission 8: Teotihuaca'n", + "Part i: Aztec Complex", + { + {"Reprogram shuttle guidance", NULL}, + {"Launch shuttle", NULL}, + {NULL, NULL} + } + }, + { + "Egypt (00 Agent)", + "00 Agent: James Bond", + "Mission 9: el-Saghira", + "Part i: Egyptian Temple", + { + {"Recover the golden gun", NULL}, + {"Defeat Baron Samedi?", NULL}, + {NULL, NULL} + } + }, + + /* End of struct */ + { + NULL, + NULL, + NULL, + NULL, + { + {NULL, NULL} + } + } +}; diff --git a/tools/report/sfx.ogg b/tools/report/sfx.ogg new file mode 100644 index 00000000..ae8bf3cb Binary files /dev/null and b/tools/report/sfx.ogg differ diff --git a/tools/report/template.html b/tools/report/template.html new file mode 100644 index 00000000..b5973c18 --- /dev/null +++ b/tools/report/template.html @@ -0,0 +1,18 @@ + + + +GoldenEye 007 Decompilation Status + + + + + + +
+ +
+