Merge remote-tracking branch 'pmret/master' into moremapassets

This commit is contained in:
Alex Bates 2021-02-06 16:14:21 +00:00
commit 93acfc1918
67 changed files with 834 additions and 794 deletions

7
.gitignore vendored
View File

@ -24,16 +24,15 @@ build.ninja
/include/message_ids.h
/include/sprite/
/include/map
/tools/permuter_settings.toml
# Assets
/bin
/img
/msg
/sprite
/assets
# Star Rod
/sprite/SpriteTable.xml
/mod.cfg
/tools/star-rod
/tools/Yay0compress
/tools/n64crc

View File

@ -29,10 +29,6 @@
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?", // no $, for scripts
},
"files.associations": {
"*.tcc": "c",
"ratio": "c",
"vector": "c",
"cmath": "c",
"common.h": "c"
"*.h": "c",
},
}

File diff suppressed because one or more lines are too long

View File

@ -401,14 +401,64 @@ glabel D_80293AC4
glabel D_80293B80
.word 0xFFFFFFFF, 0x0000008A, 0x00000080, 0x00000086, 0x00000090, 0x00000085, 0x0000008B, 0x00000082, 0x00000081, 0x0000008D, 0x00000083, 0x0000008F, 0x00000088, 0x00000089, 0x00000084, 0x0000008C, 0x0000008E, 0x0000009B, 0x00000091, 0x00000092, 0x0000009A, 0x00000099, 0x000000C8, 0x00000087, 0x00000098, 0x00000096, 0x00000097, 0x00000095, 0x000000AC, 0x000000CC, 0x000000D2, 0x000000D3, 0x00000000
glabel D_80293C04
.word 0x007330D0, 0x007345A0, func_802A1000_752450, 0x802A20FC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00716C60, 0x007179D0, func_802A1000_752450, 0x802A19BC, 0x007179D0, 0x00718850, func_802A1000_752450, 0x802A1B6C, 0x00718850, 0x00719970, func_802A1000_752450, 0x802A195C, 0x00719970, 0x0071A7F0, func_802A1000_752450, 0x802A1B6C, 0x0071A7F0, 0x0071B1A0, func_802A1000_752450, 0x802A183C, 0x0071B1A0, 0x0071BE30, func_802A1000_752450, 0x802A1A5C, 0x0071BE30, 0x0071CCE0, func_802A1000_752450, 0x802A19FC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x0071D770, 0x0071E650, func_802A1000_752450, 0x802A1B0C, 0x0071E650, 0x007215A0, func_802A1000_752450, 0x802A3320, 0x007215A0, 0x00722000, func_802A1000_752450, 0x802A198C, 0x00722000, 0x00722B40, func_802A1000_752450, 0x802A189C, 0x00722B40, 0x00723780, func_802A1000_752450, 0x802A1A5C, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00724CE0, 0x00725F60, func_802A1000_752450, 0x802A1FFC, 0x00725F60, 0x00726DD0, func_802A1000_752450, 0x802A189C, 0x00726DD0, 0x00727910, func_802A1000_752450, 0x802A191C, 0x00727910, 0x007285E0, func_802A1000_752450, 0x802A198C, 0x007285E0, 0x00728EC0, func_802A1000_752450, 0x802A17FC, 0x00728EC0, 0x0072A750, func_802A1000_752450, 0x802A25A0, 0x0072A750, 0x0072B910, func_802A1000_752450, 0x802A1D4C, 0x0072B910, 0x0072C5B0, func_802A1000_752450, 0x802A191C, 0x0072C5B0, 0x0072DB70, func_802A1000_752450, 0x802A22BC, 0x0072DB70, 0x0072E530, func_802A1000_752450, 0x802A185C, 0x0072E530, 0x0072F720, func_802A1000_752450, 0x802A1FCC, 0x0072F720, 0x007305A0, func_802A1000_752450, 0x802A1B6C, 0x007305A0, 0x00731300, func_802A1000_752450, 0x802A1AFC, 0x00731300, 0x007330D0, func_802A1000_752450, 0x802A2870, 0x00731300, 0x007330D0, func_802A1000_752450, 0x802A2870, 0x0001001F, 0x00010005, 0x00010002, 0x00090003, 0x00090003, 0x00090001, 0x000A0006, 0x000A0006, 0x000A0004, 0x000B0008, 0x000B0008, 0x000B0004, 0x000C0003, 0x000C0003, 0x000C0001
glabel gBattleItemTable
# dma start, dma end, dma vaddr, Script*
.word 0x007330D0, 0x007345A0, func_802A1000_752450, 0x802A20FC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00716C60, 0x007179D0, func_802A1000_752450, 0x802A19BC, 0x007179D0, 0x00718850, func_802A1000_752450, 0x802A1B6C, 0x00718850, 0x00719970, func_802A1000_752450, 0x802A195C, 0x00719970, 0x0071A7F0, func_802A1000_752450, 0x802A1B6C, 0x0071A7F0, 0x0071B1A0, func_802A1000_752450, 0x802A183C, 0x0071B1A0, 0x0071BE30, func_802A1000_752450, 0x802A1A5C, 0x0071BE30, 0x0071CCE0, func_802A1000_752450, 0x802A19FC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x0071D770, 0x0071E650, func_802A1000_752450, 0x802A1B0C, 0x0071E650, 0x007215A0, func_802A1000_752450, 0x802A3320, 0x007215A0, 0x00722000, func_802A1000_752450, 0x802A198C, 0x00722000, 0x00722B40, func_802A1000_752450, 0x802A189C, 0x00722B40, 0x00723780, func_802A1000_752450, 0x802A1A5C, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00715850, 0x00716C60, func_802A1000_752450, 0x802A20CC, 0x00724CE0, 0x00725F60, func_802A1000_752450, 0x802A1FFC, 0x00725F60, 0x00726DD0, func_802A1000_752450, 0x802A189C, 0x00726DD0, 0x00727910, func_802A1000_752450, 0x802A191C, 0x00727910, 0x007285E0, func_802A1000_752450, 0x802A198C, 0x007285E0, 0x00728EC0, func_802A1000_752450, 0x802A17FC, 0x00728EC0, 0x0072A750, func_802A1000_752450, 0x802A25A0, 0x0072A750, 0x0072B910, func_802A1000_752450, 0x802A1D4C, 0x0072B910, 0x0072C5B0, func_802A1000_752450, 0x802A191C, 0x0072C5B0, 0x0072DB70, func_802A1000_752450, 0x802A22BC, 0x0072DB70, 0x0072E530, func_802A1000_752450, 0x802A185C, 0x0072E530, 0x0072F720, func_802A1000_752450, 0x802A1FCC, battle_item_coconut_ROM_START, battle_item_coconut_ROM_END, battle_item_coconut_VRAM, battle_item_coconut_main, 0x007305A0, 0x00731300, func_802A1000_752450, 0x802A1AFC, 0x00731300, 0x007330D0, func_802A1000_752450, 0x802A2870, 0x00731300, 0x007330D0, func_802A1000_752450, 0x802A2870, 0x0001001F, 0x00010005, 0x00010002, 0x00090003, 0x00090003, 0x00090001, 0x000A0006, 0x000A0006, 0x000A0004, 0x000B0008, 0x000B0008, 0x000B0004, 0x000C0003, 0x000C0003, 0x000C0001
glabel UseMystery
.word 0x00000008, 0x00000001, 0x00000002, 0x00000043, 0x00000001, LoadFreeItemScript, 0x00000046, 0x00000001, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel gMoveScriptTable
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x007345A0, 0x00737890, func_802A1000_752450, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000_752450, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000_752450, 0x802A3044, 0x007345A0, 0x00737890, func_802A1000_752450, 0x802A369C, 0x007345A0, 0x00737890, func_802A1000_752450, 0x802A3B28, 0x00737890, 0x0073AED0, func_802A1000_752450, 0x802A3124, 0x0073AED0, 0x0073D860, func_802A1000_752450, 0x802A3044, 0x0074AD90, 0x0074D570, func_802A1000_752450, 0x802A3144, 0x0074F130, 0x00752450, func_802A1000_752450, 0x802A38C4, 0x0074F130, 0x00752450, func_802A1000_752450, 0x802A3234, 0x00752450, 0x00756780, func_802A1000_752450, 0x802A3D38, 0x00756780, 0x007595B0, func_802A1000_752450, 0x802A3114, 0x007595B0, 0x0075C980, func_802A1000_752450, 0x802A3944, 0x007595B0, 0x0075C980, func_802A1000_752450, 0x802A32B4, 0x0075E5D0, 0x00761920, func_802A1000_752450, 0x802A3944, 0x0075E5D0, 0x00761920, func_802A1000_752450, 0x802A32B4, 0x00763540, 0x00765C20, func_802A1000_752450, 0x802A3044, 0x00767C90, 0x0076A830, func_802A1000_752450, 0x802A3044, 0x00772BA0, 0x00775100, func_802A1000_752450, 0x802A3044, 0x00775100, 0x00777690, func_802A1000_752450, 0x802A3044, 0x00777690, 0x00779C90, func_802A1000_752450, 0x802A3044, 0x0077CB80, 0x0077F240, func_802A1000_752450, 0x802A3044, 0x0077F240, 0x00781920, func_802A1000_752450, 0x802A3124, 0x0073D860, 0x00740CC0, func_802A1000_752450, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000_752450, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000_752450, 0x802A2650, 0x0073D860, 0x00740CC0, func_802A1000_752450, 0x802A30F4, 0x0073D860, 0x00740CC0, func_802A1000_752450, 0x802A3644, 0x00740CC0, 0x00743DF0, func_802A1000_752450, 0x802A2620, 0x00743DF0, 0x00746E10, func_802A1000_752450, 0x802A2734, 0x00746E10, 0x00748DD0, func_802A1000_752450, 0x802A2600, 0x00748DD0, 0x0074AD90, func_802A1000_752450, 0x802A2600, 0x0074D570, 0x0074F130, func_802A1000_752450, 0x802A2800, 0x0074D570, 0x0074F130, func_802A1000_752450, 0x802A27F0, 0x0075C980, 0x0075E5D0, func_802A1000_752450, 0x802A2880, 0x0075C980, 0x0075E5D0, func_802A1000_752450, 0x802A2870, 0x00761920, 0x00763540, func_802A1000_752450, 0x802A2880, 0x00761920, 0x00763540, func_802A1000_752450, 0x802A2870, 0x00765C20, 0x00767C90, func_802A1000_752450, 0x802A2600, 0x0076A830, 0x0076D760, func_802A1000_752450, 0x802A2600, 0x0076D760, 0x0076F330, func_802A1000_752450, 0x802A2600, 0x0076F330, 0x00770F30, func_802A1000_752450, 0x802A2600, 0x00770F30, 0x00772BA0, func_802A1000_752450, 0x802A2600, 0x00781920, 0x00783BA0, func_802A1000_752450, 0x802A26E0, 0x00783BA0, 0x00785B20, func_802A1000_752450, 0x802A2600, 0x00785B20, 0x00789E60, func_802A1000_752450, 0x802A2630
# dma start, dma end, dma vaddr, Script*
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x007345A0, 0x00737890, 0x802A1000, 0x802A3044
.word 0x007345A0, 0x00737890, 0x802A1000, 0x802A3044
.word 0x007345A0, 0x00737890, 0x802A1000, 0x802A3044
.word 0x007345A0, 0x00737890, 0x802A1000, 0x802A369C
.word 0x007345A0, 0x00737890, 0x802A1000, 0x802A3B28
.word 0x00737890, 0x0073AED0, 0x802A1000, 0x802A3124
.word 0x0073AED0, 0x0073D860, 0x802A1000, 0x802A3044
.word 0x0074AD90, 0x0074D570, 0x802A1000, 0x802A3144
.word 0x0074F130, 0x00752450, 0x802A1000, 0x802A38C4
.word 0x0074F130, 0x00752450, 0x802A1000, 0x802A3234
.word 0x00752450, 0x00756780, 0x802A1000, 0x802A3D38
.word 0x00756780, 0x007595B0, 0x802A1000, 0x802A3114
.word 0x007595B0, 0x0075C980, 0x802A1000, 0x802A3944
.word 0x007595B0, 0x0075C980, 0x802A1000, 0x802A32B4
.word 0x0075E5D0, 0x00761920, 0x802A1000, 0x802A3944
.word 0x0075E5D0, 0x00761920, 0x802A1000, 0x802A32B4
.word 0x00763540, 0x00765C20, 0x802A1000, 0x802A3044
.word 0x00767C90, 0x0076A830, 0x802A1000, 0x802A3044
.word 0x00772BA0, 0x00775100, 0x802A1000, 0x802A3044
.word 0x00775100, 0x00777690, 0x802A1000, 0x802A3044
.word 0x00777690, 0x00779C90, 0x802A1000, 0x802A3044
.word 0x0077CB80, 0x0077F240, 0x802A1000, 0x802A3044
.word 0x0077F240, 0x00781920, 0x802A1000, 0x802A3124
.word 0x0073D860, 0x00740CC0, 0x802A1000, 0x802A2650
.word 0x0073D860, 0x00740CC0, 0x802A1000, 0x802A2650
.word 0x0073D860, 0x00740CC0, 0x802A1000, 0x802A2650
.word 0x0073D860, 0x00740CC0, 0x802A1000, 0x802A30F4
.word 0x0073D860, 0x00740CC0, 0x802A1000, 0x802A3644
.word 0x00740CC0, 0x00743DF0, 0x802A1000, 0x802A2620
.word 0x00743DF0, 0x00746E10, 0x802A1000, 0x802A2734
.word 0x00746E10, 0x00748DD0, 0x802A1000, 0x802A2600
.word 0x00748DD0, 0x0074AD90, 0x802A1000, 0x802A2600
.word 0x0074D570, 0x0074F130, 0x802A1000, 0x802A2800
.word 0x0074D570, 0x0074F130, 0x802A1000, 0x802A27F0
.word 0x0075C980, 0x0075E5D0, 0x802A1000, 0x802A2880
.word 0x0075C980, 0x0075E5D0, 0x802A1000, 0x802A2870
.word 0x00761920, 0x00763540, 0x802A1000, 0x802A2880
.word 0x00761920, 0x00763540, 0x802A1000, 0x802A2870
.word 0x00765C20, 0x00767C90, 0x802A1000, 0x802A2600
.word 0x0076A830, 0x0076D760, 0x802A1000, 0x802A2600
.word 0x0076D760, 0x0076F330, 0x802A1000, 0x802A2600
.word 0x0076F330, 0x00770F30, 0x802A1000, 0x802A2600
.word 0x00770F30, 0x00772BA0, 0x802A1000, 0x802A2600
.word 0x00781920, 0x00783BA0, 0x802A1000, 0x802A26E0
.word 0x00783BA0, 0x00785B20, 0x802A1000, 0x802A2600
.word 0x00785B20, 0x00789E60, 0x802A1000, 0x802A2630
glabel D_80294190
.word 0x2121751D, 0x23A3460C, 0xB46B0078, 0x730D1300

View File

@ -1,125 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1000_72F720
/* 72F720 802A1000 27BDFF98 */ addiu $sp, $sp, -0x68
/* 72F724 802A1004 AFB50044 */ sw $s5, 0x44($sp)
/* 72F728 802A1008 0080A82D */ daddu $s5, $a0, $zero
/* 72F72C 802A100C AFB10034 */ sw $s1, 0x34($sp)
/* 72F730 802A1010 0000882D */ daddu $s1, $zero, $zero
/* 72F734 802A1014 2405001D */ addiu $a1, $zero, 0x1d
/* 72F738 802A1018 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 72F73C 802A101C 4480A000 */ mtc1 $zero, $f20
/* 72F740 802A1020 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 72F744 802A1024 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 72F748 802A1028 AFBF0048 */ sw $ra, 0x48($sp)
/* 72F74C 802A102C AFB40040 */ sw $s4, 0x40($sp)
/* 72F750 802A1030 AFB3003C */ sw $s3, 0x3c($sp)
/* 72F754 802A1034 AFB20038 */ sw $s2, 0x38($sp)
/* 72F758 802A1038 AFB00030 */ sw $s0, 0x30($sp)
/* 72F75C 802A103C F7B80060 */ sdc1 $f24, 0x60($sp)
/* 72F760 802A1040 F7B60058 */ sdc1 $f22, 0x58($sp)
/* 72F764 802A1044 8C5300D8 */ lw $s3, 0xd8($v0)
/* 72F768 802A1048 8442017A */ lh $v0, 0x17a($v0)
/* 72F76C 802A104C 0260202D */ daddu $a0, $s3, $zero
/* 72F770 802A1050 00021140 */ sll $v0, $v0, 5
/* 72F774 802A1054 3C128008 */ lui $s2, %hi(gItemTable+0xC)
/* 72F778 802A1058 02429021 */ addu $s2, $s2, $v0
/* 72F77C 802A105C 865278EC */ lh $s2, %lo(gItemTable+0xC)($s2)
/* 72F780 802A1060 92620191 */ lbu $v0, 0x191($s3)
/* 72F784 802A1064 C6620148 */ lwc1 $f2, 0x148($s3)
/* 72F788 802A1068 44820000 */ mtc1 $v0, $f0
/* 72F78C 802A106C 00000000 */ nop
/* 72F790 802A1070 46800020 */ cvt.s.w $f0, $f0
/* 72F794 802A1074 0C099CAB */ jal heroes_is_ability_active
/* 72F798 802A1078 46001580 */ add.s $f22, $f2, $f0
/* 72F79C 802A107C 50400048 */ beql $v0, $zero, .L802A11A0
/* 72F7A0 802A1080 AEB10084 */ sw $s1, 0x84($s5)
/* 72F7A4 802A1084 1A400045 */ blez $s2, .L802A119C
/* 72F7A8 802A1088 3C0451EB */ lui $a0, 0x51eb
/* 72F7AC 802A108C 3484851F */ ori $a0, $a0, 0x851f
/* 72F7B0 802A1090 00121880 */ sll $v1, $s2, 2
/* 72F7B4 802A1094 00721821 */ addu $v1, $v1, $s2
/* 72F7B8 802A1098 00031100 */ sll $v0, $v1, 4
/* 72F7BC 802A109C 00431023 */ subu $v0, $v0, $v1
/* 72F7C0 802A10A0 24420063 */ addiu $v0, $v0, 0x63
/* 72F7C4 802A10A4 00440018 */ mult $v0, $a0
/* 72F7C8 802A10A8 000217C3 */ sra $v0, $v0, 0x1f
/* 72F7CC 802A10AC 00004010 */ mfhi $t0
/* 72F7D0 802A10B0 00081943 */ sra $v1, $t0, 5
/* 72F7D4 802A10B4 00629023 */ subu $s2, $v1, $v0
/* 72F7D8 802A10B8 0232102A */ slt $v0, $s1, $s2
/* 72F7DC 802A10BC 10400019 */ beqz $v0, .L802A1124
/* 72F7E0 802A10C0 0220802D */ daddu $s0, $s1, $zero
/* 72F7E4 802A10C4 24140017 */ addiu $s4, $zero, 0x17
/* 72F7E8 802A10C8 3C0141F0 */ lui $at, 0x41f0
/* 72F7EC 802A10CC 4481C000 */ mtc1 $at, $f24
/* 72F7F0 802A10D0 24110001 */ addiu $s1, $zero, 1
.L802A10D4:
/* 72F7F4 802A10D4 C6600144 */ lwc1 $f0, 0x144($s3)
/* 72F7F8 802A10D8 C662014C */ lwc1 $f2, 0x14c($s3)
/* 72F7FC 802A10DC 4600A10D */ trunc.w.s $f4, $f20
/* 72F800 802A10E0 E7A40018 */ swc1 $f4, 0x18($sp)
/* 72F804 802A10E4 24040157 */ addiu $a0, $zero, 0x157
/* 72F808 802A10E8 AFB10014 */ sw $s1, 0x14($sp)
/* 72F80C 802A10EC 26310003 */ addiu $s1, $s1, 3
/* 72F810 802A10F0 26100001 */ addiu $s0, $s0, 1
/* 72F814 802A10F4 4406B000 */ mfc1 $a2, $f22
/* 72F818 802A10F8 44050000 */ mfc1 $a1, $f0
/* 72F81C 802A10FC 44071000 */ mfc1 $a3, $f2
/* 72F820 802A1100 4618A500 */ add.s $f20, $f20, $f24
/* 72F824 802A1104 AFB40010 */ sw $s4, 0x10($sp)
/* 72F828 802A1108 0C04C4FD */ jal make_item_entity
/* 72F82C 802A110C AFA0001C */ sw $zero, 0x1c($sp)
/* 72F830 802A1110 0C03A830 */ jal add_coins
/* 72F834 802A1114 24040001 */ addiu $a0, $zero, 1
/* 72F838 802A1118 0212102A */ slt $v0, $s0, $s2
/* 72F83C 802A111C 1440FFED */ bnez $v0, .L802A10D4
/* 72F840 802A1120 00000000 */ nop
.L802A1124:
/* 72F844 802A1124 00101040 */ sll $v0, $s0, 1
/* 72F848 802A1128 00501021 */ addu $v0, $v0, $s0
/* 72F84C 802A112C 2451001E */ addiu $s1, $v0, 0x1e
/* 72F850 802A1130 C6600144 */ lwc1 $f0, 0x144($s3)
/* 72F854 802A1134 C6760148 */ lwc1 $f22, 0x148($s3)
/* 72F858 802A1138 C662014C */ lwc1 $f2, 0x14c($s3)
/* 72F85C 802A113C 3C048007 */ lui $a0, %hi(gCurrentCameraID)
/* 72F860 802A1140 8C847410 */ lw $a0, %lo(gCurrentCameraID)($a0)
/* 72F864 802A1144 27A20020 */ addiu $v0, $sp, 0x20
/* 72F868 802A1148 AFA20010 */ sw $v0, 0x10($sp)
/* 72F86C 802A114C 27A20024 */ addiu $v0, $sp, 0x24
/* 72F870 802A1150 AFA20014 */ sw $v0, 0x14($sp)
/* 72F874 802A1154 44050000 */ mfc1 $a1, $f0
/* 72F878 802A1158 4406B000 */ mfc1 $a2, $f22
/* 72F87C 802A115C 44071000 */ mfc1 $a3, $f2
/* 72F880 802A1160 27A20028 */ addiu $v0, $sp, 0x28
/* 72F884 802A1164 0C00B94E */ jal get_screen_coords
/* 72F888 802A1168 AFA20018 */ sw $v0, 0x18($sp)
/* 72F88C 802A116C 3C048011 */ lui $a0, %hi(D_80108A64)
/* 72F890 802A1170 24848A64 */ addiu $a0, $a0, %lo(D_80108A64)
/* 72F894 802A1174 0C050529 */ jal create_icon
/* 72F898 802A1178 00000000 */ nop
/* 72F89C 802A117C 8FA50020 */ lw $a1, 0x20($sp)
/* 72F8A0 802A1180 8FA60024 */ lw $a2, 0x24($sp)
/* 72F8A4 802A1184 0040202D */ daddu $a0, $v0, $zero
/* 72F8A8 802A1188 3C01802A */ lui $at, %hi(D_802A1E80)
/* 72F8AC 802A118C AC241E80 */ sw $a0, %lo(D_802A1E80)($at)
/* 72F8B0 802A1190 24A50024 */ addiu $a1, $a1, 0x24
/* 72F8B4 802A1194 0C051261 */ jal set_icon_render_pos
/* 72F8B8 802A1198 24C6FFC1 */ addiu $a2, $a2, -0x3f
.L802A119C:
/* 72F8BC 802A119C AEB10084 */ sw $s1, 0x84($s5)
.L802A11A0:
/* 72F8C0 802A11A0 8FBF0048 */ lw $ra, 0x48($sp)
/* 72F8C4 802A11A4 8FB50044 */ lw $s5, 0x44($sp)
/* 72F8C8 802A11A8 8FB40040 */ lw $s4, 0x40($sp)
/* 72F8CC 802A11AC 8FB3003C */ lw $s3, 0x3c($sp)
/* 72F8D0 802A11B0 8FB20038 */ lw $s2, 0x38($sp)
/* 72F8D4 802A11B4 8FB10034 */ lw $s1, 0x34($sp)
/* 72F8D8 802A11B8 8FB00030 */ lw $s0, 0x30($sp)
/* 72F8DC 802A11BC D7B80060 */ ldc1 $f24, 0x60($sp)
/* 72F8E0 802A11C0 D7B60058 */ ldc1 $f22, 0x58($sp)
/* 72F8E4 802A11C4 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 72F8E8 802A11C8 24020002 */ addiu $v0, $zero, 2
/* 72F8EC 802A11CC 03E00008 */ jr $ra
/* 72F8F0 802A11D0 27BD0068 */ addiu $sp, $sp, 0x68

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A11D4_72F8F4
/* 72F8F4 802A11D4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 72F8F8 802A11D8 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 72F8FC 802A11DC 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 72F900 802A11E0 AFBF0014 */ sw $ra, 0x14($sp)
/* 72F904 802A11E4 AFB00010 */ sw $s0, 0x10($sp)
/* 72F908 802A11E8 8462017A */ lh $v0, 0x17a($v1)
/* 72F90C 802A11EC 8C6400D8 */ lw $a0, 0xd8($v1)
/* 72F910 802A11F0 00021140 */ sll $v0, $v0, 5
/* 72F914 802A11F4 3C108008 */ lui $s0, %hi(gItemTable+0xC)
/* 72F918 802A11F8 02028021 */ addu $s0, $s0, $v0
/* 72F91C 802A11FC 861078EC */ lh $s0, %lo(gItemTable+0xC)($s0)
/* 72F920 802A1200 0C099CAB */ jal heroes_is_ability_active
/* 72F924 802A1204 2405001D */ addiu $a1, $zero, 0x1d
/* 72F928 802A1208 10400007 */ beqz $v0, .L802A1228
/* 72F92C 802A120C 00000000 */ nop
/* 72F930 802A1210 1A000005 */ blez $s0, .L802A1228
/* 72F934 802A1214 00000000 */ nop
/* 72F938 802A1218 3C04802A */ lui $a0, %hi(D_802A1E80)
/* 72F93C 802A121C 8C841E80 */ lw $a0, %lo(D_802A1E80)($a0)
/* 72F940 802A1220 0C05123D */ jal free_icon
/* 72F944 802A1224 00000000 */ nop
.L802A1228:
/* 72F948 802A1228 8FBF0014 */ lw $ra, 0x14($sp)
/* 72F94C 802A122C 8FB00010 */ lw $s0, 0x10($sp)
/* 72F950 802A1230 24020002 */ addiu $v0, $zero, 2
/* 72F954 802A1234 03E00008 */ jr $ra
/* 72F958 802A1238 27BD0018 */ addiu $sp, $sp, 0x18
/* 72F95C 802A123C 00000000 */ nop

View File

@ -55,8 +55,8 @@ glabel LoadFreeItemScript
/* 1969B8 802680D8 30420080 */ andi $v0, $v0, 0x80
/* 1969BC 802680DC 2C500001 */ sltiu $s0, $v0, 1
.L802680E0:
/* 1969C0 802680E0 3C028029 */ lui $v0, %hi(D_80293C04)
/* 1969C4 802680E4 24423C04 */ addiu $v0, $v0, %lo(D_80293C04)
/* 1969C0 802680E0 3C028029 */ lui $v0, %hi(gBattleItemTable)
/* 1969C4 802680E4 24423C04 */ addiu $v0, $v0, %lo(gBattleItemTable)
/* 1969C8 802680E8 00108100 */ sll $s0, $s0, 4
/* 1969CC 802680EC 02028021 */ addu $s0, $s0, $v0
/* 1969D0 802680F0 8E040000 */ lw $a0, ($s0)

View File

@ -75,8 +75,8 @@ glabel LoadItemScript
/* 1968A8 80267FC8 30420080 */ andi $v0, $v0, 0x80
/* 1968AC 80267FCC 2C500001 */ sltiu $s0, $v0, 1
.L80267FD0:
/* 1968B0 80267FD0 3C028029 */ lui $v0, %hi(D_80293C04)
/* 1968B4 80267FD4 24423C04 */ addiu $v0, $v0, %lo(D_80293C04)
/* 1968B0 80267FD0 3C028029 */ lui $v0, %hi(gBattleItemTable)
/* 1968B4 80267FD4 24423C04 */ addiu $v0, $v0, %lo(gBattleItemTable)
/* 1968B8 80267FD8 00108100 */ sll $s0, $s0, 4
/* 1968BC 80267FDC 02028021 */ addu $s0, $s0, $v0
/* 1968C0 80267FE0 8E040000 */ lw $a0, ($s0)

View File

@ -1,125 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A1000_72F720
/* 72F720 802A1000 27BDFF98 */ addiu $sp, $sp, -0x68
/* 72F724 802A1004 AFB50044 */ sw $s5, 0x44($sp)
/* 72F728 802A1008 0080A82D */ daddu $s5, $a0, $zero
/* 72F72C 802A100C AFB10034 */ sw $s1, 0x34($sp)
/* 72F730 802A1010 0000882D */ daddu $s1, $zero, $zero
/* 72F734 802A1014 2405001D */ addiu $a1, $zero, 0x1d
/* 72F738 802A1018 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 72F73C 802A101C 4480A000 */ mtc1 $zero, $f20
/* 72F740 802A1020 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 72F744 802A1024 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 72F748 802A1028 AFBF0048 */ sw $ra, 0x48($sp)
/* 72F74C 802A102C AFB40040 */ sw $s4, 0x40($sp)
/* 72F750 802A1030 AFB3003C */ sw $s3, 0x3c($sp)
/* 72F754 802A1034 AFB20038 */ sw $s2, 0x38($sp)
/* 72F758 802A1038 AFB00030 */ sw $s0, 0x30($sp)
/* 72F75C 802A103C F7B80060 */ sdc1 $f24, 0x60($sp)
/* 72F760 802A1040 F7B60058 */ sdc1 $f22, 0x58($sp)
/* 72F764 802A1044 8C5300D8 */ lw $s3, 0xd8($v0)
/* 72F768 802A1048 8442017A */ lh $v0, 0x17a($v0)
/* 72F76C 802A104C 0260202D */ daddu $a0, $s3, $zero
/* 72F770 802A1050 00021140 */ sll $v0, $v0, 5
/* 72F774 802A1054 3C128008 */ lui $s2, %hi(gItemTable+0xC)
/* 72F778 802A1058 02429021 */ addu $s2, $s2, $v0
/* 72F77C 802A105C 865278EC */ lh $s2, %lo(gItemTable+0xC)($s2)
/* 72F780 802A1060 92620191 */ lbu $v0, 0x191($s3)
/* 72F784 802A1064 C6620148 */ lwc1 $f2, 0x148($s3)
/* 72F788 802A1068 44820000 */ mtc1 $v0, $f0
/* 72F78C 802A106C 00000000 */ nop
/* 72F790 802A1070 46800020 */ cvt.s.w $f0, $f0
/* 72F794 802A1074 0C099CAB */ jal heroes_is_ability_active
/* 72F798 802A1078 46001580 */ add.s $f22, $f2, $f0
/* 72F79C 802A107C 50400048 */ beql $v0, $zero, .L802A11A0
/* 72F7A0 802A1080 AEB10084 */ sw $s1, 0x84($s5)
/* 72F7A4 802A1084 1A400045 */ blez $s2, .L802A119C
/* 72F7A8 802A1088 3C0451EB */ lui $a0, 0x51eb
/* 72F7AC 802A108C 3484851F */ ori $a0, $a0, 0x851f
/* 72F7B0 802A1090 00121880 */ sll $v1, $s2, 2
/* 72F7B4 802A1094 00721821 */ addu $v1, $v1, $s2
/* 72F7B8 802A1098 00031100 */ sll $v0, $v1, 4
/* 72F7BC 802A109C 00431023 */ subu $v0, $v0, $v1
/* 72F7C0 802A10A0 24420063 */ addiu $v0, $v0, 0x63
/* 72F7C4 802A10A4 00440018 */ mult $v0, $a0
/* 72F7C8 802A10A8 000217C3 */ sra $v0, $v0, 0x1f
/* 72F7CC 802A10AC 00004010 */ mfhi $t0
/* 72F7D0 802A10B0 00081943 */ sra $v1, $t0, 5
/* 72F7D4 802A10B4 00629023 */ subu $s2, $v1, $v0
/* 72F7D8 802A10B8 0232102A */ slt $v0, $s1, $s2
/* 72F7DC 802A10BC 10400019 */ beqz $v0, .L802A1124
/* 72F7E0 802A10C0 0220802D */ daddu $s0, $s1, $zero
/* 72F7E4 802A10C4 24140017 */ addiu $s4, $zero, 0x17
/* 72F7E8 802A10C8 3C0141F0 */ lui $at, 0x41f0
/* 72F7EC 802A10CC 4481C000 */ mtc1 $at, $f24
/* 72F7F0 802A10D0 24110001 */ addiu $s1, $zero, 1
.L802A10D4:
/* 72F7F4 802A10D4 C6600144 */ lwc1 $f0, 0x144($s3)
/* 72F7F8 802A10D8 C662014C */ lwc1 $f2, 0x14c($s3)
/* 72F7FC 802A10DC 4600A10D */ trunc.w.s $f4, $f20
/* 72F800 802A10E0 E7A40018 */ swc1 $f4, 0x18($sp)
/* 72F804 802A10E4 24040157 */ addiu $a0, $zero, 0x157
/* 72F808 802A10E8 AFB10014 */ sw $s1, 0x14($sp)
/* 72F80C 802A10EC 26310003 */ addiu $s1, $s1, 3
/* 72F810 802A10F0 26100001 */ addiu $s0, $s0, 1
/* 72F814 802A10F4 4406B000 */ mfc1 $a2, $f22
/* 72F818 802A10F8 44050000 */ mfc1 $a1, $f0
/* 72F81C 802A10FC 44071000 */ mfc1 $a3, $f2
/* 72F820 802A1100 4618A500 */ add.s $f20, $f20, $f24
/* 72F824 802A1104 AFB40010 */ sw $s4, 0x10($sp)
/* 72F828 802A1108 0C04C4FD */ jal make_item_entity
/* 72F82C 802A110C AFA0001C */ sw $zero, 0x1c($sp)
/* 72F830 802A1110 0C03A830 */ jal add_coins
/* 72F834 802A1114 24040001 */ addiu $a0, $zero, 1
/* 72F838 802A1118 0212102A */ slt $v0, $s0, $s2
/* 72F83C 802A111C 1440FFED */ bnez $v0, .L802A10D4
/* 72F840 802A1120 00000000 */ nop
.L802A1124:
/* 72F844 802A1124 00101040 */ sll $v0, $s0, 1
/* 72F848 802A1128 00501021 */ addu $v0, $v0, $s0
/* 72F84C 802A112C 2451001E */ addiu $s1, $v0, 0x1e
/* 72F850 802A1130 C6600144 */ lwc1 $f0, 0x144($s3)
/* 72F854 802A1134 C6760148 */ lwc1 $f22, 0x148($s3)
/* 72F858 802A1138 C662014C */ lwc1 $f2, 0x14c($s3)
/* 72F85C 802A113C 3C048007 */ lui $a0, %hi(gCurrentCameraID)
/* 72F860 802A1140 8C847410 */ lw $a0, %lo(gCurrentCameraID)($a0)
/* 72F864 802A1144 27A20020 */ addiu $v0, $sp, 0x20
/* 72F868 802A1148 AFA20010 */ sw $v0, 0x10($sp)
/* 72F86C 802A114C 27A20024 */ addiu $v0, $sp, 0x24
/* 72F870 802A1150 AFA20014 */ sw $v0, 0x14($sp)
/* 72F874 802A1154 44050000 */ mfc1 $a1, $f0
/* 72F878 802A1158 4406B000 */ mfc1 $a2, $f22
/* 72F87C 802A115C 44071000 */ mfc1 $a3, $f2
/* 72F880 802A1160 27A20028 */ addiu $v0, $sp, 0x28
/* 72F884 802A1164 0C00B94E */ jal get_screen_coords
/* 72F888 802A1168 AFA20018 */ sw $v0, 0x18($sp)
/* 72F88C 802A116C 3C048011 */ lui $a0, %hi(D_80108A64)
/* 72F890 802A1170 24848A64 */ addiu $a0, $a0, %lo(D_80108A64)
/* 72F894 802A1174 0C050529 */ jal create_icon
/* 72F898 802A1178 00000000 */ nop
/* 72F89C 802A117C 8FA50020 */ lw $a1, 0x20($sp)
/* 72F8A0 802A1180 8FA60024 */ lw $a2, 0x24($sp)
/* 72F8A4 802A1184 0040202D */ daddu $a0, $v0, $zero
/* 72F8A8 802A1188 3C01802A */ lui $at, %hi(D_802A1E80)
/* 72F8AC 802A118C AC241E80 */ sw $a0, %lo(D_802A1E80)($at)
/* 72F8B0 802A1190 24A50024 */ addiu $a1, $a1, 0x24
/* 72F8B4 802A1194 0C051261 */ jal set_icon_render_pos
/* 72F8B8 802A1198 24C6FFC1 */ addiu $a2, $a2, -0x3f
.L802A119C:
/* 72F8BC 802A119C AEB10084 */ sw $s1, 0x84($s5)
.L802A11A0:
/* 72F8C0 802A11A0 8FBF0048 */ lw $ra, 0x48($sp)
/* 72F8C4 802A11A4 8FB50044 */ lw $s5, 0x44($sp)
/* 72F8C8 802A11A8 8FB40040 */ lw $s4, 0x40($sp)
/* 72F8CC 802A11AC 8FB3003C */ lw $s3, 0x3c($sp)
/* 72F8D0 802A11B0 8FB20038 */ lw $s2, 0x38($sp)
/* 72F8D4 802A11B4 8FB10034 */ lw $s1, 0x34($sp)
/* 72F8D8 802A11B8 8FB00030 */ lw $s0, 0x30($sp)
/* 72F8DC 802A11BC D7B80060 */ ldc1 $f24, 0x60($sp)
/* 72F8E0 802A11C0 D7B60058 */ ldc1 $f22, 0x58($sp)
/* 72F8E4 802A11C4 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 72F8E8 802A11C8 24020002 */ addiu $v0, $zero, 2
/* 72F8EC 802A11CC 03E00008 */ jr $ra
/* 72F8F0 802A11D0 27BD0068 */ addiu $sp, $sp, 0x68

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A11D4_72F8F4
/* 72F8F4 802A11D4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 72F8F8 802A11D8 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 72F8FC 802A11DC 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 72F900 802A11E0 AFBF0014 */ sw $ra, 0x14($sp)
/* 72F904 802A11E4 AFB00010 */ sw $s0, 0x10($sp)
/* 72F908 802A11E8 8462017A */ lh $v0, 0x17a($v1)
/* 72F90C 802A11EC 8C6400D8 */ lw $a0, 0xd8($v1)
/* 72F910 802A11F0 00021140 */ sll $v0, $v0, 5
/* 72F914 802A11F4 3C108008 */ lui $s0, %hi(gItemTable+0xC)
/* 72F918 802A11F8 02028021 */ addu $s0, $s0, $v0
/* 72F91C 802A11FC 861078EC */ lh $s0, %lo(gItemTable+0xC)($s0)
/* 72F920 802A1200 0C099CAB */ jal heroes_is_ability_active
/* 72F924 802A1204 2405001D */ addiu $a1, $zero, 0x1d
/* 72F928 802A1208 10400007 */ beqz $v0, .L802A1228
/* 72F92C 802A120C 00000000 */ nop
/* 72F930 802A1210 1A000005 */ blez $s0, .L802A1228
/* 72F934 802A1214 00000000 */ nop
/* 72F938 802A1218 3C04802A */ lui $a0, %hi(D_802A1E80)
/* 72F93C 802A121C 8C841E80 */ lw $a0, %lo(D_802A1E80)($a0)
/* 72F940 802A1220 0C05123D */ jal free_icon
/* 72F944 802A1224 00000000 */ nop
.L802A1228:
/* 72F948 802A1228 8FBF0014 */ lw $ra, 0x14($sp)
/* 72F94C 802A122C 8FB00010 */ lw $s0, 0x10($sp)
/* 72F950 802A1230 24020002 */ addiu $v0, $zero, 2
/* 72F954 802A1234 03E00008 */ jr $ra
/* 72F958 802A1238 27BD0018 */ addiu $sp, $sp, 0x18
/* 72F95C 802A123C 00000000 */ nop

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2148
/* F6AF8 802D2148 3C04FBFF */ lui $a0, 0xfbff
/* F6AFC 802D214C 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* F6B00 802D2150 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* F6B04 802D2154 8C620000 */ lw $v0, ($v1)
/* F6B08 802D2158 3484FFFF */ ori $a0, $a0, 0xffff
/* F6B0C 802D215C 00441024 */ and $v0, $v0, $a0
/* F6B10 802D2160 AC620000 */ sw $v0, ($v1)
/* F6B14 802D2164 03E00008 */ jr $ra
/* F6B18 802D2168 24020002 */ addiu $v0, $zero, 2

View File

@ -1,20 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D244C
/* F6DFC 802D244C 3C028016 */ lui $v0, %hi(gCollisionStatus+0x2)
/* F6E00 802D2450 8442A552 */ lh $v0, %lo(gCollisionStatus+0x2)($v0)
/* F6E04 802D2454 27BDFFE8 */ addiu $sp, $sp, -0x18
/* F6E08 802D2458 04400006 */ bltz $v0, .L802D2474
/* F6E0C 802D245C AFBF0010 */ sw $ra, 0x10($sp)
/* F6E10 802D2460 0C0B48FE */ jal func_802D23F8
/* F6E14 802D2464 00000000 */ nop
/* F6E18 802D2468 0040182D */ daddu $v1, $v0, $zero
/* F6E1C 802D246C 14600002 */ bnez $v1, .L802D2478
/* F6E20 802D2470 24020002 */ addiu $v0, $zero, 2
.L802D2474:
/* F6E24 802D2474 0000102D */ daddu $v0, $zero, $zero
.L802D2478:
/* F6E28 802D2478 8FBF0010 */ lw $ra, 0x10($sp)
/* F6E2C 802D247C 03E00008 */ jr $ra
/* F6E30 802D2480 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2484
/* F6E34 802D2484 3C028016 */ lui $v0, %hi(gCollisionStatus+0x2)
/* F6E38 802D2488 8442A552 */ lh $v0, %lo(gCollisionStatus+0x2)($v0)
/* F6E3C 802D248C 00021027 */ nor $v0, $zero, $v0
/* F6E40 802D2490 000217C3 */ sra $v0, $v0, 0x1f
/* F6E44 802D2494 03E00008 */ jr $ra
/* F6E48 802D2498 30420002 */ andi $v0, $v0, 2

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2508
/* F6EB8 802D2508 3C028011 */ lui $v0, %hi(gPlayerStatus)
/* F6EBC 802D250C 8C42EFC8 */ lw $v0, %lo(gPlayerStatus)($v0)
/* F6EC0 802D2510 30422000 */ andi $v0, $v0, 0x2000
/* F6EC4 802D2514 2C420001 */ sltiu $v0, $v0, 1
/* F6EC8 802D2518 03E00008 */ jr $ra
/* F6ECC 802D251C 00021040 */ sll $v0, $v0, 1

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D286C
/* F721C 802D286C 8C82000C */ lw $v0, 0xc($a0)
/* F7220 802D2870 8C420000 */ lw $v0, ($v0)
/* F7224 802D2874 3C01802E */ lui $at, %hi(D_802DB5B0)
/* F7228 802D2878 A422B5B0 */ sh $v0, %lo(D_802DB5B0)($at)
/* F722C 802D287C 03E00008 */ jr $ra
/* F7230 802D2880 24020002 */ addiu $v0, $zero, 2

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2B50
/* F7500 802D2B50 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* F7504 802D2B54 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* F7508 802D2B58 8C620004 */ lw $v0, 4($v1)
/* F750C 802D2B5C 34420008 */ ori $v0, $v0, 8
/* F7510 802D2B60 AC620004 */ sw $v0, 4($v1)
/* F7514 802D2B64 03E00008 */ jr $ra
/* F7518 802D2B68 24020002 */ addiu $v0, $zero, 2

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2B6C
/* F751C 802D2B6C 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* F7520 802D2B70 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* F7524 802D2B74 8C620004 */ lw $v0, 4($v1)
/* F7528 802D2B78 34420004 */ ori $v0, $v0, 4
/* F752C 802D2B7C AC620004 */ sw $v0, 4($v1)
/* F7530 802D2B80 03E00008 */ jr $ra
/* F7534 802D2B84 24020002 */ addiu $v0, $zero, 2

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2C14
/* F75C4 802D2C14 27BDFFE8 */ addiu $sp, $sp, -0x18
/* F75C8 802D2C18 AFBF0010 */ sw $ra, 0x10($sp)
/* F75CC 802D2C1C 8C82000C */ lw $v0, 0xc($a0)
/* F75D0 802D2C20 0C0B1EAF */ jal get_variable
/* F75D4 802D2C24 8C450000 */ lw $a1, ($v0)
/* F75D8 802D2C28 0C03BCF5 */ jal func_800EF3D4
/* F75DC 802D2C2C 0040202D */ daddu $a0, $v0, $zero
/* F75E0 802D2C30 8FBF0010 */ lw $ra, 0x10($sp)
/* F75E4 802D2C34 24020002 */ addiu $v0, $zero, 2
/* F75E8 802D2C38 03E00008 */ jr $ra
/* F75EC 802D2C3C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,42 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D2C40
/* F75F0 802D2C40 27BDFFE0 */ addiu $sp, $sp, -0x20
/* F75F4 802D2C44 AFB20018 */ sw $s2, 0x18($sp)
/* F75F8 802D2C48 0080902D */ daddu $s2, $a0, $zero
/* F75FC 802D2C4C AFBF001C */ sw $ra, 0x1c($sp)
/* F7600 802D2C50 AFB10014 */ sw $s1, 0x14($sp)
/* F7604 802D2C54 AFB00010 */ sw $s0, 0x10($sp)
/* F7608 802D2C58 8E50000C */ lw $s0, 0xc($s2)
/* F760C 802D2C5C 8E050000 */ lw $a1, ($s0)
/* F7610 802D2C60 0C0B1EAF */ jal get_variable
/* F7614 802D2C64 26100004 */ addiu $s0, $s0, 4
/* F7618 802D2C68 44820000 */ mtc1 $v0, $f0
/* F761C 802D2C6C 00000000 */ nop
/* F7620 802D2C70 46800020 */ cvt.s.w $f0, $f0
/* F7624 802D2C74 3C118011 */ lui $s1, %hi(gPlayerStatus)
/* F7628 802D2C78 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus)
/* F762C 802D2C7C E620001C */ swc1 $f0, 0x1c($s1)
/* F7630 802D2C80 8E050000 */ lw $a1, ($s0)
/* F7634 802D2C84 26100004 */ addiu $s0, $s0, 4
/* F7638 802D2C88 0C0B1EAF */ jal get_variable
/* F763C 802D2C8C 0240202D */ daddu $a0, $s2, $zero
/* F7640 802D2C90 44820000 */ mtc1 $v0, $f0
/* F7644 802D2C94 00000000 */ nop
/* F7648 802D2C98 46800020 */ cvt.s.w $f0, $f0
/* F764C 802D2C9C E6200020 */ swc1 $f0, 0x20($s1)
/* F7650 802D2CA0 8E050000 */ lw $a1, ($s0)
/* F7654 802D2CA4 0C0B1EAF */ jal get_variable
/* F7658 802D2CA8 0240202D */ daddu $a0, $s2, $zero
/* F765C 802D2CAC 44820000 */ mtc1 $v0, $f0
/* F7660 802D2CB0 00000000 */ nop
/* F7664 802D2CB4 46800020 */ cvt.s.w $f0, $f0
/* F7668 802D2CB8 E6200024 */ swc1 $f0, 0x24($s1)
/* F766C 802D2CBC 8FBF001C */ lw $ra, 0x1c($sp)
/* F7670 802D2CC0 8FB20018 */ lw $s2, 0x18($sp)
/* F7674 802D2CC4 8FB10014 */ lw $s1, 0x14($sp)
/* F7678 802D2CC8 8FB00010 */ lw $s0, 0x10($sp)
/* F767C 802D2CCC 24020002 */ addiu $v0, $zero, 2
/* F7680 802D2CD0 03E00008 */ jr $ra
/* F7684 802D2CD4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,61 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D3474
/* F7E24 802D3474 27BDFFD8 */ addiu $sp, $sp, -0x28
/* F7E28 802D3478 AFB20018 */ sw $s2, 0x18($sp)
/* F7E2C 802D347C 0080902D */ daddu $s2, $a0, $zero
/* F7E30 802D3480 AFBF0020 */ sw $ra, 0x20($sp)
/* F7E34 802D3484 AFB3001C */ sw $s3, 0x1c($sp)
/* F7E38 802D3488 AFB10014 */ sw $s1, 0x14($sp)
/* F7E3C 802D348C AFB00010 */ sw $s0, 0x10($sp)
/* F7E40 802D3490 8E42000C */ lw $v0, 0xc($s2)
/* F7E44 802D3494 8C450004 */ lw $a1, 4($v0)
/* F7E48 802D3498 8C530000 */ lw $s3, ($v0)
/* F7E4C 802D349C 0C0B1EAF */ jal get_variable
/* F7E50 802D34A0 0000882D */ daddu $s1, $zero, $zero
/* F7E54 802D34A4 0040202D */ daddu $a0, $v0, $zero
/* F7E58 802D34A8 3C03802E */ lui $v1, %hi(D_802DB7C0)
/* F7E5C 802D34AC 8C63B7C0 */ lw $v1, %lo(D_802DB7C0)($v1)
.L802D34B0:
/* F7E60 802D34B0 8C700000 */ lw $s0, ($v1)
/* F7E64 802D34B4 8E020000 */ lw $v0, ($s0)
/* F7E68 802D34B8 04400006 */ bltz $v0, .L802D34D4
/* F7E6C 802D34BC 2A220040 */ slti $v0, $s1, 0x40
/* F7E70 802D34C0 26310001 */ addiu $s1, $s1, 1
/* F7E74 802D34C4 2A220040 */ slti $v0, $s1, 0x40
/* F7E78 802D34C8 1440FFF9 */ bnez $v0, .L802D34B0
/* F7E7C 802D34CC 24630004 */ addiu $v1, $v1, 4
/* F7E80 802D34D0 2A220040 */ slti $v0, $s1, 0x40
.L802D34D4:
/* F7E84 802D34D4 10400016 */ beqz $v0, .L802D3530
/* F7E88 802D34D8 24020002 */ addiu $v0, $zero, 2
/* F7E8C 802D34DC 0C048338 */ jal load_entity_model
/* F7E90 802D34E0 00000000 */ nop
/* F7E94 802D34E4 3C013F80 */ lui $at, 0x3f80
/* F7E98 802D34E8 44810000 */ mtc1 $at, $f0
/* F7E9C 802D34EC AE020000 */ sw $v0, ($s0)
/* F7EA0 802D34F0 0040202D */ daddu $a0, $v0, $zero
/* F7EA4 802D34F4 AE000004 */ sw $zero, 4($s0)
/* F7EA8 802D34F8 AE000008 */ sw $zero, 8($s0)
/* F7EAC 802D34FC AE00000C */ sw $zero, 0xc($s0)
/* F7EB0 802D3500 AE000010 */ sw $zero, 0x10($s0)
/* F7EB4 802D3504 AE000014 */ sw $zero, 0x14($s0)
/* F7EB8 802D3508 AE000018 */ sw $zero, 0x18($s0)
/* F7EBC 802D350C E600001C */ swc1 $f0, 0x1c($s0)
/* F7EC0 802D3510 E6000020 */ swc1 $f0, 0x20($s0)
/* F7EC4 802D3514 0C0483C1 */ jal update_entity_rendercmd
/* F7EC8 802D3518 E6000024 */ swc1 $f0, 0x24($s0)
/* F7ECC 802D351C 0240202D */ daddu $a0, $s2, $zero
/* F7ED0 802D3520 0260282D */ daddu $a1, $s3, $zero
/* F7ED4 802D3524 0C0B2026 */ jal set_variable
/* F7ED8 802D3528 0220302D */ daddu $a2, $s1, $zero
/* F7EDC 802D352C 24020002 */ addiu $v0, $zero, 2
.L802D3530:
/* F7EE0 802D3530 8FBF0020 */ lw $ra, 0x20($sp)
/* F7EE4 802D3534 8FB3001C */ lw $s3, 0x1c($sp)
/* F7EE8 802D3538 8FB20018 */ lw $s2, 0x18($sp)
/* F7EEC 802D353C 8FB10014 */ lw $s1, 0x14($sp)
/* F7EF0 802D3540 8FB00010 */ lw $s0, 0x10($sp)
/* F7EF4 802D3544 03E00008 */ jr $ra
/* F7EF8 802D3548 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,61 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D354C
/* F7EFC 802D354C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* F7F00 802D3550 AFB20018 */ sw $s2, 0x18($sp)
/* F7F04 802D3554 0080902D */ daddu $s2, $a0, $zero
/* F7F08 802D3558 AFBF0020 */ sw $ra, 0x20($sp)
/* F7F0C 802D355C AFB3001C */ sw $s3, 0x1c($sp)
/* F7F10 802D3560 AFB10014 */ sw $s1, 0x14($sp)
/* F7F14 802D3564 AFB00010 */ sw $s0, 0x10($sp)
/* F7F18 802D3568 8E42000C */ lw $v0, 0xc($s2)
/* F7F1C 802D356C 8C450004 */ lw $a1, 4($v0)
/* F7F20 802D3570 8C530000 */ lw $s3, ($v0)
/* F7F24 802D3574 0C0B1EAF */ jal get_variable
/* F7F28 802D3578 0000882D */ daddu $s1, $zero, $zero
/* F7F2C 802D357C 0040202D */ daddu $a0, $v0, $zero
/* F7F30 802D3580 3C03802E */ lui $v1, %hi(D_802DB7C0)
/* F7F34 802D3584 8C63B7C0 */ lw $v1, %lo(D_802DB7C0)($v1)
.L802D3588:
/* F7F38 802D3588 8C700000 */ lw $s0, ($v1)
/* F7F3C 802D358C 8E020000 */ lw $v0, ($s0)
/* F7F40 802D3590 04400006 */ bltz $v0, .L802D35AC
/* F7F44 802D3594 2A220040 */ slti $v0, $s1, 0x40
/* F7F48 802D3598 26310001 */ addiu $s1, $s1, 1
/* F7F4C 802D359C 2A220040 */ slti $v0, $s1, 0x40
/* F7F50 802D35A0 1440FFF9 */ bnez $v0, .L802D3588
/* F7F54 802D35A4 24630004 */ addiu $v1, $v1, 4
/* F7F58 802D35A8 2A220040 */ slti $v0, $s1, 0x40
.L802D35AC:
/* F7F5C 802D35AC 10400016 */ beqz $v0, .L802D3608
/* F7F60 802D35B0 24020002 */ addiu $v0, $zero, 2
/* F7F64 802D35B4 0C048379 */ jal ALT_load_entity_model
/* F7F68 802D35B8 00000000 */ nop
/* F7F6C 802D35BC 3C013F80 */ lui $at, 0x3f80
/* F7F70 802D35C0 44810000 */ mtc1 $at, $f0
/* F7F74 802D35C4 AE020000 */ sw $v0, ($s0)
/* F7F78 802D35C8 0040202D */ daddu $a0, $v0, $zero
/* F7F7C 802D35CC AE000004 */ sw $zero, 4($s0)
/* F7F80 802D35D0 AE000008 */ sw $zero, 8($s0)
/* F7F84 802D35D4 AE00000C */ sw $zero, 0xc($s0)
/* F7F88 802D35D8 AE000010 */ sw $zero, 0x10($s0)
/* F7F8C 802D35DC AE000014 */ sw $zero, 0x14($s0)
/* F7F90 802D35E0 AE000018 */ sw $zero, 0x18($s0)
/* F7F94 802D35E4 E600001C */ swc1 $f0, 0x1c($s0)
/* F7F98 802D35E8 E6000020 */ swc1 $f0, 0x20($s0)
/* F7F9C 802D35EC 0C0483C1 */ jal update_entity_rendercmd
/* F7FA0 802D35F0 E6000024 */ swc1 $f0, 0x24($s0)
/* F7FA4 802D35F4 0240202D */ daddu $a0, $s2, $zero
/* F7FA8 802D35F8 0260282D */ daddu $a1, $s3, $zero
/* F7FAC 802D35FC 0C0B2026 */ jal set_variable
/* F7FB0 802D3600 0220302D */ daddu $a2, $s1, $zero
/* F7FB4 802D3604 24020002 */ addiu $v0, $zero, 2
.L802D3608:
/* F7FB8 802D3608 8FBF0020 */ lw $ra, 0x20($sp)
/* F7FBC 802D360C 8FB3001C */ lw $s3, 0x1c($sp)
/* F7FC0 802D3610 8FB20018 */ lw $s2, 0x18($sp)
/* F7FC4 802D3614 8FB10014 */ lw $s1, 0x14($sp)
/* F7FC8 802D3618 8FB00010 */ lw $s0, 0x10($sp)
/* F7FCC 802D361C 03E00008 */ jr $ra
/* F7FD0 802D3620 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D4164
/* F8B14 802D4164 3C02802E */ lui $v0, %hi(D_802DB7C0)
/* F8B18 802D4168 8C42B7C0 */ lw $v0, %lo(D_802DB7C0)($v0)
/* F8B1C 802D416C 00042080 */ sll $a0, $a0, 2
/* F8B20 802D4170 00822021 */ addu $a0, $a0, $v0
/* F8B24 802D4174 03E00008 */ jr $ra
/* F8B28 802D4178 8C820000 */ lw $v0, ($a0)

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D43AC
/* F8D5C 802D43AC 3C02802E */ lui $v0, %hi(D_802DB7C0)
/* F8D60 802D43B0 8C42B7C0 */ lw $v0, %lo(D_802DB7C0)($v0)
/* F8D64 802D43B4 00042080 */ sll $a0, $a0, 2
/* F8D68 802D43B8 00822021 */ addu $a0, $a0, $v0
/* F8D6C 802D43BC 8C820000 */ lw $v0, ($a0)
/* F8D70 802D43C0 AC45001C */ sw $a1, 0x1c($v0)
/* F8D74 802D43C4 AC460020 */ sw $a2, 0x20($v0)
/* F8D78 802D43C8 03E00008 */ jr $ra
/* F8D7C 802D43CC AC470024 */ sw $a3, 0x24($v0)

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D43D0
/* F8D80 802D43D0 3C02802E */ lui $v0, %hi(D_802DB7C0)
/* F8D84 802D43D4 8C42B7C0 */ lw $v0, %lo(D_802DB7C0)($v0)
/* F8D88 802D43D8 00042080 */ sll $a0, $a0, 2
/* F8D8C 802D43DC 00822021 */ addu $a0, $a0, $v0
/* F8D90 802D43E0 8C820000 */ lw $v0, ($a0)
/* F8D94 802D43E4 AC450010 */ sw $a1, 0x10($v0)
/* F8D98 802D43E8 AC460014 */ sw $a2, 0x14($v0)
/* F8D9C 802D43EC 03E00008 */ jr $ra
/* F8DA0 802D43F0 AC470018 */ sw $a3, 0x18($v0)

View File

@ -16,21 +16,28 @@ import split
INCLUDE_ASM_RE = re.compile(r"___INCLUDE_ASM\([^,]+, ([^,]+), ([^,)]+)") # note _ prefix
TARGET = "papermario"
BUILD_DIR = "build"
ASSET_DIRS = ["assets"]
NPC_SPRITES = "world_goombario world_kooper world_bombette world_parakarry world_bow world_watt world_sushie world_lakilester battle_goombario battle_kooper battle_bombette battle_parakarry battle_bow battle_watt battle_sushie battle_lakilester kooper_without_shell world_eldstar world_mamar world_skolar world_muskular world_misstar world_klevar world_kalmar battle_eldstar battle_mamar battle_skolar battle_muskular battle_misstar battle_klevar battle_kalmar twink jr_troopa spiked_jr_troopa spiked_para_jr_troopa mage_jr_troopa para_jr_troopa goomba spiked_goomba paragoomba koopa_troopa para_troopa fuzzy bob_omb bullet_bill bill_blaster monty_mole cleft pokey battle_bandit buzzy_beetle swooper stone_chomp putrid_piranha piranha_plant sentinel world_clubba battle_clubba shy_guy groove_guy sky_guy pyro_guy spy_guy medi_guy fuzzipede jungle_guy heart_plant hurt_plant m_bush bubble kent_c_koopa dayzee lakitu spiny bzzap ruff_puff spike_top duplighost albino_dino blooper baby_blooper gulpit dry_bones thrown_bone bony_beetle magikoopa flying_magikoopa world_koopatrol koopatrol hammer_bros bush_basic bush_blocky bush_dry bush_leafy bush_matted world_kammy battle_kammy goomba_bros goomba_king spiky_goomnut dark_toad koopa_bros buzzar tutankoopa chain_chomp world_tubba battle_tubba tubbas_heart big_lantern_ghost shy_squad_guy marshal_guy stilt_guy stilt_guy_unfold shy_stack_guy shy_stack_unfold shy_stack_damage shy_stack_rock general_guy general_guy_bomb tank_guy lava_piranha_head petit_piranha lava_bud huff_n_puff tuff_puff monstar crystal_king world_bowser battle_bowser luigi toad three_sisters vanna_t toad_kid toad_guard harry_t toad_minister postmaster conductor_toad train_station_toad fishmael artist_toad koopa koopa_without_shell world_bob_omb whacka dryite mouser boo yoshi yoshi_kid raven bubulb penguin shiver_toad world_bandit goompa goombaria gooma goompapa goomama the_master chan lee merlon chet_rippo rowf minh_t russ_t tayce_t fice_t bartender chanterelle rip_cheato chuck_quizmo merluvlee merlar merlow star_kid kolorado_wife koopa_koot kolorado battle_kolorado archeologist nomadimouse world_merlee battle_merlee disguised_moustafa moustafa oaklie bootler yakkey gourmet_guy village_leader leaders_friend rafael_raven tolielup gate_flower petunia posie lily rosie sun lakilulu ninji mayor_penguin mayor_penguin_wife penguin_patrol herringway merle star_rod fire coin parade_peach parade_koopas parade_burnt_bowser parade_luigi parade_partners parade_yoshis parade_kolorados parade_chicks parade_ice_show parade_toads parade_batons parade_drums parade_flags parade_horns parade_tubba_balloon parade_wizards parade_mario parade_shy_guys parade_twink leaf".split(" ")
MAPS = "dro_01 dro_02 hos_00 hos_01 hos_02 hos_03 hos_04 hos_05 hos_06 hos_10 hos_20 isk_01 isk_02 isk_03 isk_04 isk_05 isk_06 isk_07 isk_08 isk_09 isk_10 isk_11 isk_12 isk_13 isk_14 isk_16 isk_18 isk_19 iwa_00 iwa_01 iwa_02 iwa_03 iwa_04 iwa_10 iwa_11 osr_00 osr_01 osr_02 osr_03 kkj_00 kkj_01 kkj_02 kkj_03 kkj_10 kkj_11 kkj_12 kkj_13 kkj_14 kkj_15 kkj_16 kkj_17 kkj_18 kkj_19 kkj_20 kkj_21 kkj_22 kkj_23 kkj_24 kkj_25 kkj_26 kkj_27 kkj_28 kkj_29 kmr_00 kmr_02 kmr_03 kmr_04 kmr_05 kmr_06 kmr_07 kmr_09 kmr_10 kmr_11 kmr_12 kmr_20 kmr_30 kpa_01 kpa_03 kpa_04 kpa_08 kpa_09 kpa_10 kpa_11 kpa_12 kpa_13 kpa_14 kpa_15 kpa_16 kpa_17 kpa_32 kpa_33 kpa_40 kpa_41 kpa_50 kpa_52 kpa_60 kpa_61 kpa_62 kpa_63 kpa_70 kpa_80 kpa_90 kpa_91 kpa_94 kpa_95 kpa_96 kpa_102 kpa_111 kpa_112 kpa_113 kpa_115 kpa_116 kpa_117 kpa_118 kpa_119 kpa_121 kpa_130 kpa_133 kpa_134 machi mac_00 mac_01 mac_02 mac_03 mac_04 mac_05 mac_06 tik_01 tik_02 tik_03 tik_04 tik_05 tik_06 tik_07 tik_08 tik_09 tik_10 tik_12 tik_14 tik_15 tik_17 tik_18 tik_19 tik_20 tik_21 tik_22 tik_23 tik_25 kgr_01 kgr_02 nok_01 nok_02 nok_03 nok_04 nok_11 nok_12 nok_13 nok_14 nok_15 sbk_00 sbk_01 sbk_02 sbk_03 sbk_04 sbk_05 sbk_06 sbk_10 sbk_11 sbk_12 sbk_13 sbk_14 sbk_15 sbk_16 sbk_20 sbk_21 sbk_22 sbk_23 sbk_24 sbk_25 sbk_26 sbk_30 sbk_31 sbk_32 sbk_33 sbk_34 sbk_35 sbk_36 sbk_40 sbk_41 sbk_42 sbk_43 sbk_44 sbk_45 sbk_46 sbk_50 sbk_51 sbk_52 sbk_53 sbk_54 sbk_55 sbk_56 sbk_60 sbk_61 sbk_62 sbk_63 sbk_64 sbk_65 sbk_66 sbk_99 trd_00 trd_01 trd_02 trd_03 trd_04 trd_05 trd_06 trd_07 trd_08 trd_09 trd_10 tst_01 tst_02 tst_03 tst_04 tst_10 tst_11 tst_12 tst_13 tst_20 jan_00 jan_01 jan_02 jan_03 jan_04 jan_05 jan_06 jan_07 jan_08 jan_09 jan_10 jan_11 jan_12 jan_13 jan_14 jan_15 jan_16 jan_17 jan_18 jan_19 jan_22 jan_23 mim_01 mim_02 mim_03 mim_04 mim_05 mim_06 mim_07 mim_08 mim_09 mim_10 mim_11 mim_12 obk_01 obk_02 obk_03 obk_04 obk_05 obk_06 obk_07 obk_08 obk_09 arn_02 arn_03 arn_04 arn_05 arn_07 arn_08 arn_09 arn_10 arn_11 arn_12 arn_13 arn_20 dgb_01 dgb_02 dgb_03 dgb_04 dgb_05 dgb_06 dgb_07 dgb_08 dgb_09 dgb_10 dgb_11 dgb_12 dgb_13 dgb_14 dgb_15 dgb_16 dgb_17 dgb_18 kzn_01 kzn_02 kzn_03 kzn_04 kzn_05 kzn_06 kzn_07 kzn_08 kzn_09 kzn_10 kzn_11 kzn_17 kzn_18 kzn_19 kzn_20 kzn_22 kzn_23 flo_00 flo_03 flo_07 flo_08 flo_09 flo_10 flo_11 flo_12 flo_13 flo_14 flo_15 flo_16 flo_17 flo_18 flo_19 flo_21 flo_22 flo_23 flo_24 flo_25 sam_01 sam_02 sam_03 sam_04 sam_05 sam_06 sam_07 sam_08 sam_09 sam_10 sam_11 sam_12 pra_01 pra_02 pra_03 pra_04 pra_05 pra_09 pra_10 pra_11 pra_13 pra_14 pra_15 pra_16 pra_18 pra_19 pra_20 pra_21 pra_22 pra_29 pra_31 pra_32 pra_33 pra_34 pra_35 pra_40 omo_01 omo_02 omo_03 omo_04 omo_05 omo_06 omo_07 omo_08 omo_09 omo_10 omo_11 omo_12 omo_13 omo_14 omo_15 omo_16 omo_17 end_00 end_01 mgm_00 mgm_01 mgm_02 mgm_03 gv_01 kmr_bt03 kmr_bt04 kmr_bt05 kmr_bt06 nok_bt01 nok_bt02 nok_bt03 nok_bt04 trd_bt00 trd_bt01 trd_bt02 trd_bt03 trd_bt04 trd_bt05 iwa_bt01 iwa_bt02 sbk_bt02 isk_bt01 isk_bt02 isk_bt03 isk_bt04 isk_bt05 isk_bt06 isk_bt07 isk_bt08 arn_bt01 arn_bt02 arn_bt03 arn_bt04 arn_bt05 arn_bt06 dgb_bt01 dgb_bt02 dgb_bt03 dgb_bt04 dgb_bt05 mim_bt01 omo_bt01 omo_bt02 omo_bt03 omo_bt04 omo_bt05 omo_bt06 omo_bt07 kgr_bt01 flo_bt01 flo_bt02 flo_bt03 flo_bt04 flo_bt05 flo_bt06 jan_bt00 jan_bt01 jan_bt02 jan_bt03 jan_bt04 kzn_bt01 kzn_bt02 kzn_bt04 kzn_bt05 sam_bt01 sam_bt02 sam_bt03 sam_bt04 tik_bt01 tik_bt02 tik_bt03 tik_bt04 tik_bt05 pra_bt01 pra_bt02 pra_bt03 pra_bt04 mac_bt01 mac_bt02 kpa_bt01 kpa_bt02 kpa_bt03 kpa_bt04 kpa_bt05 kpa_bt07 kpa_bt08 kpa_bt09 kpa_bt11 kpa_bt13 kpa_bt14 hos_bt01 hos_bt02 kkj_bt01 kkj_bt02".split(" ")
ASSETS = sum([[f"{map_name}_shape", f"{map_name}_hit"] for map_name in MAPS], []) + "mac_tex tik_tex kgr_tex kmr_tex iwa_tex sbk_tex dro_tex isk_tex trd_tex nok_tex hos_tex kpa_tex osr_tex kkj_tex tst_tex jan_tex mim_tex obk_tex arn_tex dgb_tex kzn_tex flo_tex sam_tex pra_tex omo_tex end_tex mgm_tex gv__tex kmr_bg nok_bg sbk_bg sbk3_bg iwa_bg hos_bg arn_bg obk_bg omo_bg yos_bg jan_bg fla_bg flb_bg sra_bg yki_bg sam_bg kpa_bg title_bg title_data party_kurio party_kameki party_pinki party_pareta party_resa party_akari party_opuku party_pokopi".split(" ")
def area_of_map(map_name: str) -> str:
return "area_" + map_name.split("_")[0][0:3]
ASSETS = sum([[f"map/{area_of_map(map_name)}/{map_name}_shape", f"map/{area_of_map(map_name)}/{map_name}_hit"] for map_name in MAPS], []) + "mac_tex tik_tex kgr_tex kmr_tex iwa_tex sbk_tex dro_tex isk_tex trd_tex nok_tex hos_tex kpa_tex osr_tex kkj_tex tst_tex jan_tex mim_tex obk_tex arn_tex dgb_tex kzn_tex flo_tex sam_tex pra_tex omo_tex end_tex mgm_tex gv__tex kmr_bg nok_bg sbk_bg sbk3_bg iwa_bg hos_bg arn_bg obk_bg omo_bg yos_bg jan_bg fla_bg flb_bg sra_bg yki_bg sam_bg kpa_bg title_bg title_data party_kurio party_kameki party_pinki party_pareta party_resa party_akari party_opuku party_pokopi".split(" ")
def obj(path: str):
if not path.startswith("$builddir/"):
path = "$builddir/" + path
path = re.sub(r"/assets/", "/", path)
return path + ".o"
def read_splat(splat_config: str):
import argparse
import yaml
from segtypes.n64.code import N64SegCode
# Load config
with open(splat_config) as f:
@ -47,11 +54,25 @@ def read_splat(splat_config: str):
for segment in all_segments:
for subdir, path, obj_type, start in segment.get_ld_files():
path = subdir + "/" + path
if path.endswith(".c") or path.endswith(".s") or path.endswith(".data") or path.endswith(".rodata"):
path = subdir + "/" + path
else:
assert subdir == "assets", subdir + " " + path
objects.add(path)
segments[path] = segment
if isinstance(segment, N64SegCode):
for split_file in segment.files:
if split_file["subtype"] in ["i4", "i8", "ia4", "ia8", "ia16", "rgba16", "rgba32", "ci4", "ci8", "palette"]:
path = os.path.join(
#segment.get_subdir(split_file["subtype"]),
split_file["name"] + "." + segment.get_ext(split_file["subtype"])
)
if path in segments:
segments[path] = split_file
# note: `objects` lacks .o extensions
return objects, segments
@ -91,7 +112,7 @@ async def build_c_file(c_file: str, generated_headers, ccache, cppflags):
def build_yay0_file(bin_file: str):
yay0_file = f"$builddir/{os.path.splitext(bin_file)[0]}.Yay0"
n.build(yay0_file, "yay0compress", bin_file, implicit="tools/Yay0compress")
n.build(yay0_file, "yay0compress", find_asset(bin_file), implicit="tools/Yay0compress")
build_bin_object(yay0_file)
def build_bin_object(bin_file: str):
@ -108,7 +129,7 @@ def build_image(f: str, segment):
if segment.flip_vertical:
flags += "--flip-y"
n.build(out, "img", path + ".png", implicit="tools/convert_image.py", variables={
n.build(out, "img", find_asset(path + ".png"), implicit="tools/img/build.py", variables={
"img_type": img_type,
"img_flags": flags,
})
@ -118,6 +139,17 @@ def cmd_exists(cmd):
return subprocess.call("type " + cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
def find_asset_dir(path):
for d in ASSET_DIRS:
if os.path.exists(d + "/" + path):
return d
print("unable to find asset: " + path)
exit(1)
def find_asset(path):
return find_asset_dir(path) + "/" + path
async def main():
global n, cpp, task_sem, num_tasks, num_tasks_done
@ -182,11 +214,14 @@ async def main():
# generate build.ninja
n = ninja_syntax.Writer(open("build.ninja", "w"), width=120)
cppflags = "-Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 " + args.cflags
cppflags = f"-I{BUILD_DIR}/include -Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 " + args.cflags
cflags = "-O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow " + args.cflags
iconv = "tools/iconv.py UTF-8 SHIFT-JIS" if sys.platform == "darwin" else "iconv --from UTF-8 --to SHIFT-JIS"
cross = "mips-linux-gnu-"
n.variable("builddir", "build")
n.variable("builddir", BUILD_DIR)
n.variable("target", TARGET)
n.variable("cross", "mips-linux-gnu-")
n.variable("cross", cross)
n.variable("python", sys.executable)
if sys.platform == "darwin":
@ -201,9 +236,9 @@ async def main():
sys.exit(1)
n.variable("os", os_dir)
n.variable("iconv", "tools/iconv.py UTF-8 SHIFT-JIS" if sys.platform == "darwin" else "iconv --from UTF-8 --to SHIFT-JIS")
n.variable("iconv", iconv)
n.variable("cppflags", f"{cppflags} -Wcomment")
n.variable("cflags", "-O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow " + args.cflags)
n.variable("cflags", cflags)
n.newline()
n.rule("cc",
@ -218,6 +253,10 @@ async def main():
deps="gcc")
n.newline()
with open("tools/permuter_settings.toml", "w") as f:
f.write(f"compiler_command = \"{cpp} {cppflags} -D SCRIPT(...)={{}} | {iconv} | tools/{os_dir}/cc1 {cflags} -o - | tools/{os_dir}/mips-nintendo-nu64-as -EB -G 0 -\"\n")
f.write(f"assembler_command = \"{cross}as -march=vr4300 -mabi=32\"\n")
n.rule("cpp",
command=f"{cpp} -P -DBUILD_DIR=$builddir $in -o $out",
description="cc (with dsl) $in",
@ -242,8 +281,11 @@ async def main():
# $img_type, $img_flags
n.rule("img",
command="$python tools/convert_image.py $img_type $in $out $img_flags",
command="$python tools/img/build.py $img_type $in $out $img_flags",
description="image $in")
n.rule("img_header",
command="$python tools/img/header.py $in $out",
description="image_header $in")
n.newline()
# $sprite_id, $sprite_dir, $sprite_name
@ -317,22 +359,26 @@ async def main():
def add_generated_header(h: str):
generated_headers.append(h)
if not os.path.exists(h):
he = re.sub(r"\$builddir", BUILD_DIR, h)
if not os.path.exists(he):
# mkdir -p
os.makedirs(os.path.dirname(h), exist_ok=True)
os.makedirs(os.path.dirname(he), exist_ok=True)
# touch it so cpp doesn't complain if its #included
open(h, "w").close()
open(he, "w").close()
# mark it as really old so ninja builds it
os.utime(h, (0, 0))
os.utime(he, (0, 0))
return h
n.build(add_generated_header("include/ld_addrs.h"), "ld_addrs_h", "$builddir/$target.ld")
n.build(add_generated_header("$builddir/include/ld_addrs.h"), "ld_addrs_h", "$builddir/$target.ld")
# messages
msg_files = glob("src/**/*.msg", recursive=True) + glob("msg/**/*.msg", recursive=True)
msg_files = []
for d in ASSET_DIRS:
msg_files.extend(glob(d + "/**/*.msg", recursive=True))
for msg_file in msg_files:
n.build(
f"$builddir/{msg_file}.bin",
@ -345,7 +391,7 @@ async def main():
"msg_combine",
[f"$builddir/{msg_file}.bin" for msg_file in msg_files],
implicit="tools/msg/combine.py",
implicit_outputs=[add_generated_header(f"{msg_file}.h") for msg_file in msg_files],
implicit_outputs=[add_generated_header(f"$builddir/include/{msg_file.split('/', 1)[1]}.h") for msg_file in msg_files],
variables={ "msg_combine_headers": [f"{msg_file}.h" for msg_file in msg_files] }
)
n.build("$builddir/msg.o", "bin", "$builddir/msg.bin")
@ -353,16 +399,17 @@ async def main():
# sprites
npc_sprite_yay0s = []
for sprite_id, sprite_name in enumerate(NPC_SPRITES, 1):
sources = glob(f"sprite/npc/{sprite_name}/**/*.*", recursive=True)
asset_dir = find_asset_dir(f"sprite/npc/{sprite_name}")
sources = glob(f"{asset_dir}/npc/{sprite_name}/**/*.*", recursive=True)
variables = {
"sprite_name": sprite_name,
"sprite_dir": f"sprite/npc/{sprite_name}",
"sprite_dir": f"{asset_dir}/sprite/npc/{sprite_name}",
"sprite_id": sprite_id,
}
# generated header
n.build(
add_generated_header(f"include/sprite/npc/{sprite_name}.h"),
add_generated_header(f"$builddir/include/sprite/npc/{sprite_name}.h"),
"sprite_animations_h",
implicit=sources + ["tools/gen_sprite_animations_h.py"],
variables=variables,
@ -396,7 +443,7 @@ async def main():
elif f.endswith(".Yay0"):
build_yay0_file(os.path.splitext(f)[0] + ".bin")
elif f.endswith(".bin"):
build_bin_object(f)
build_bin_object(find_asset(f))
elif f.endswith(".data"):
n.build(obj(f), "as", "asm/" + f + ".s")
elif f.endswith(".rodata"):
@ -404,25 +451,40 @@ async def main():
elif f.endswith(".s"):
n.build(obj(f), "as", f)
elif f.endswith(".png"):
build_image(f, segment)
if isinstance(segment, dict):
# image within a code section
out = "$builddir/" + f + ".bin"
infile = find_asset(re.sub(r"\.pal\.png", ".png", f))
n.build(out, "img", infile, implicit="tools/img/build.py", variables={
"img_type": segment["subtype"],
"img_flags": "",
})
if ".pal.png" not in f:
n.build(add_generated_header("$builddir/include/" + f + ".h"), "img_header", infile, implicit="tools/img/header.py")
n.build("$builddir/" + f + ".o", "bin", out)
else:
build_image(f, segment)
elif f == "sprite/npc":
# combine sprites
n.build(f"$builddir/{f}.bin", "npc_sprites", npc_sprite_yay0s, implicit="tools/compile_npc_sprites.py")
n.build(obj(f), "bin", f"$builddir/{f}.bin")
elif f == "/msg": # XXX: why does this have a leading '/'??
elif segment.type == "PaperMarioMessages":
continue # done already above
elif f == "bin/assets/assets":
elif segment.type == "PaperMarioMapFS":
asset_files = [] # even indexes: uncompressed; odd indexes: compressed
for asset_name in ASSETS:
if asset_name.endswith("_tex"): # uncompressed
asset_files.append(f"bin/assets/{asset_name}.bin")
asset_files.append(f"bin/assets/{asset_name}.bin")
asset_files.append(find_asset(f"map/texture/{asset_name}.bin"))
asset_files.append(find_asset(f"map/texture/{asset_name}.bin"))
elif asset_name.startswith("party_"):
source_file = f"$builddir/bin/assets/{asset_name}.bin"
asset_file = f"$builddir/bin/assets/{asset_name}.Yay0"
source_file = f"$builddir/{asset_name}.bin"
asset_file = f"$builddir/{asset_name}.Yay0"
n.build(source_file, "img", f"img/party/{asset_name}.png", implicit="tools/convert_image.py", variables={
n.build(source_file, "img", find_asset(f"party/{asset_name}.png"), implicit="tools/img/build.py", variables={
"img_type": "party",
"img_flags": "",
})
@ -431,7 +493,7 @@ async def main():
asset_files.append(asset_file)
n.build(asset_file, "yay0compress", source_file, implicit="tools/Yay0compress")
else: # uncompressed
source_file = f"bin/assets/{asset_name}.bin"
source_file = find_asset(f"{asset_name}.bin")
asset_file = f"$builddir/assets/{asset_name}.Yay0"
asset_files.append(source_file)
@ -440,7 +502,6 @@ async def main():
n.build("$builddir/assets.bin", "assets", asset_files)
n.build(obj(f), "bin", "$builddir/assets.bin")
else:
print("warning: dont know what to do with object " + f)
n.newline()

View File

@ -37,6 +37,12 @@ typedef struct Vec3f {
/* 0x08 */ f32 z;
} Vec3f; // size = 0x0C
typedef struct Vec3i {
/* 0x00 */ s32 x;
/* 0x04 */ s32 y;
/* 0x08 */ s32 z;
} Vec3i; // size = 0x0C
typedef struct Vec2s {
/* 0x00 */ s16 x;
/* 0x02 */ s16 y;

View File

@ -286,6 +286,7 @@ typedef UNK_TYPE SoundId;
#define SoundId_MOLE_THROW 0x000003E8
#define SoundId_CLOSE_SHELL 0x000002FF
#define SoundId_OPEN_SHELL 0x000003D4
#define SoundId_THROW 0x3FA
#define SoundId_BOW_VANISH 0x0000200E
#define SoundId_BOW_APPEAR 0x0000200F
#define SoundId_CANNON1 0x00002016
@ -1093,19 +1094,17 @@ typedef UNK_TYPE DamageType;
#define DamageType_THROW 0x00040000
typedef s8 PartnerID;
enum PartnerID {
PartnerID_NONE,
PartnerID_GOOMBARIO,
PartnerID_KOOPER,
PartnerID_BOMBETTE,
PartnerID_PARAKARRY,
PartnerID_GOOMPA,
PartnerID_WATT,
PartnerID_SUSHIE,
PartnerID_LAKILESTER,
PartnerID_BOW,
PartnerID_GOOMBARIA,
PartnerID_TWINK,
};
#define PartnerID_NONE 0
#define PartnerID_GOOMBARIO 1
#define PartnerID_KOOPER 2
#define PartnerID_BOMBETTE 3
#define PartnerID_PARAKARRY 4
#define PartnerID_GOOMPA 5
#define PartnerID_WATT 6
#define PartnerID_SUSHIE 7
#define PartnerID_LAKILESTER 8
#define PartnerID_BOW 9
#define PartnerID_GOOMBARIA 10
#define PartnerID_TWINK 11
#endif

View File

@ -100,6 +100,7 @@ Trigger* get_trigger_by_id(s32 triggerID);
Actor* get_actor(ActorID actorID);
ActorPart* get_actor_part(Actor* actor, s32 partIndex);
s32 add_coins(s32 amt);
s32 func_800494C0(Npc* npc, s32 arg1, s32 arg2);
@ -121,6 +122,9 @@ s32 func_80055464(s32, s32);
void func_800561A4(s32);
s32 osGetId();
s32* create_icon(s32 iconIndex);
void set_icon_render_pos(s32 iconIndex, s32 posX, s32 posY);
void set_curtain_scale_goal(f32 scale);
void set_curtain_fade(f32 scale);

View File

@ -24,6 +24,7 @@
#define STATIC_ASSERT(condition) enum { static_assert_fail = 1/(!!(condition)) } // Causes division by zero ("not integer constant") if false
#define BATTLE_STATUS (&gBattleStatus)
#define PLAYER_ACTOR (gBattleStatus.playerActor)
#define GAME_STATUS (*gGameStatusPtr)
#define PLAYER_STATUS (&gPlayerStatus)
#define UI_STATUS (&gUIStatus)

View File

@ -266,6 +266,15 @@ ApiStatus func_802CFE2C(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802CFD30(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_800441F0(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D5830(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D3474(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D3474(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D3624(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D36E0(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D38EC(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D3840(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D39FC(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D3C58(ScriptInstance* script, s32 isInitialCall);
extern Script EnemyNpcHit;
extern Script EnemyNpcDefeat;

View File

@ -1,9 +1,9 @@
#include "common.h"
#include "battle/battle.h"
#include "battle/actor/goomba.h"
#include "battle/actor/paragoomba.h"
#include "battle/actor/spiked_goomba.h"
#include "goomba.h"
#include "paragoomba.h"
#include "spiked_goomba.h"
#define NAMESPACE b_area_kmr_part_1

View File

@ -0,0 +1,152 @@
#include "coconut.h"
MenuIcon* D_802A1E80;
void* D_80108A64; // an image
// Returns time to sleep for on SI_VAR(0).
ApiStatus N(GiveRefund)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = BATTLE_STATUS;
Actor* player = PLAYER_ACTOR;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
f32 posX;
f32 posY = player->currentPos.y + player->size.y;
f32 posZ;
f32 facingAngleSign = 0.0f;
s32 sleepTime = 0;
if (heroes_is_ability_active(player, Ability_REFUND) && sellValue > 0) {
s32 iconX;
s32 iconY;
s32 iconZ;
s32 i;
// 75% of the item's sell value, rounded up
sellValue = (sellValue * 75 + 99) / 100;
for (i = 0; i < sellValue; i++) {
posX = player->currentPos.x;
posZ = player->currentPos.z;
make_item_entity(ItemId_COIN, posX, posY, posZ, 0x17, 1 + 3 * i, facingAngleSign, 0);
add_coins(1);
facingAngleSign += 30.0f;
}
sleepTime = (i * 3) + 30;
posX = player->currentPos.x;
posY = player->currentPos.y;
posZ = player->currentPos.z;
get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconX, &iconY, &iconZ);
D_802A1E80 = create_icon(&D_80108A64);
set_icon_render_pos(D_802A1E80, iconX + 36, iconY - 63);
}
script->varTable[0] = sleepTime;
return ApiStatus_DONE2;
}
ApiStatus N(GiveRefundCleanup)(ScriptInstance* script, s32 isInitialCall) {
BattleStatus* battleStatus = BATTLE_STATUS;
s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue;
if (heroes_is_ability_active(battleStatus->playerActor, Ability_REFUND) && sellValue > 0) {
free_icon(D_802A1E80);
}
return ApiStatus_DONE2;
}
Script D_802A1240_72F960 = SCRIPT({
if (SI_VAR(1) == 0) {
UseCamPreset(69);
sleep 10;
PlaySoundAtActor(0, 8333);
SetAnimation(0, 0, 0x1001F);
GetActorPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(0) += 18;
SetActorSpeed(0, 4.0);
SetGoalPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
PlayerRunToGoal(0);
SI_VAR(1) += 45;
SI_VAR(3) = SI_VAR(1);
SI_VAR(3) += 10;
SI_VAR(3) += 2;
PlayEffect(51, 1, SI_VAR(0), SI_VAR(3), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 1, 0);
SI_VAR(10) = SI_VAR(0);
N(GiveRefund)();
sleep SI_VAR(0);
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(10));
} else {
GetActorPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
PlaySoundAtActor(0, 8333);
SetAnimation(0, 0, 0x1001F);
sleep 4;
SI_VAR(1) += 45;
SI_VAR(3) = SI_VAR(1);
SI_VAR(3) += 10;
SI_VAR(3) += 2;
PlayEffect(51, 1, SI_VAR(0), SI_VAR(3), SI_VAR(2), 1.0, 30, 0, 0, 0, 0, 0, 0, 0);
MakeItemEntity(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 1, 0);
SI_VAR(10) = SI_VAR(0);
sleep 15;
RemoveItemEntity(SI_VAR(10));
}
});
Script D_802A1544_72FC64 = SCRIPT({
UseCamPreset(19);
SetBattleCamTarget(0xFFFFFFAB, 1, 0);
SetBattleCamOffsetZ(41);
SetBattleCamZoom(248);
MoveBattleCamOver(30);
sleep 10;
SetAnimation(0, 0, 0x1001F);
GetActorPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
SI_VAR(1) += 45;
MakeItemEntity(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 1, 0);
SI_VAR(14) = SI_VAR(0);
N(GiveRefund)();
sleep SI_VAR(0);
sleep 15;
N(GiveRefundCleanup)();
RemoveItemEntity(SI_VAR(14));
});
Script D_802A1670_72FFD0 = SCRIPT({
UseIdleAnimation(0, 0);
SetGoalToHome(0);
SetActorSpeed(0, 8.0);
SetAnimation(0, 0, PlayerAnim_RUNNING);
PlayerRunToGoal(0);
SetAnimation(0, 0, 0x10002);
UseIdleAnimation(0, 1);
});
Script Script_802A170C = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(0, 0x2095);
sleep 10;
}
}
SetAnimation(0, 0, 0x1001C);
sleep 45;
});
Script D_802A1784_7300E4 = SCRIPT({
spawn {
loop 4 {
PlaySoundAtActor(0, 0x2095);
sleep 10;
}
}
SetAnimation(0, 0, 0x10025);
sleep 45;
});

View File

@ -0,0 +1,95 @@
#include "coconut.h"
#include "battle/item/coconut/coconut.png.h"
/// 32x32 square.
Vtx N(coconutModel)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
};
Gfx N(coconutDL)[] = {
gsDPPipeSync(),
gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, &battle_item_coconut_coconut_pal_png),
gsDPLoadTextureTile_4b(&battle_item_coconut_coconut_png, G_IM_FMT_CI, battle_item_coconut_coconut_png_width, battle_item_coconut_coconut_png_height, 0, 0, battle_item_coconut_coconut_png_width - 1, battle_item_coconut_coconut_png_height - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(&N(coconutModel), ARRAY_COUNT(N(coconutModel)), 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
s32 D_802A1B50_7304B0[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(coconutDL)) / sizeof(s32), &N(coconutDL), 0x00000002, 0x00000000,
};
Script N(main) = SCRIPT({
SI_VAR(10) =c ItemId_COCONUT;
await D_802A1240_72F960;
UseCamPreset(3);
MoveBattleCamOver(15);
SetAnimation(ActorID_PLAYER, 0, PlayerAnim_THROW);
PlaySound(SoundId_THROW);
sleep 3;
func_802D3474(SI_VAR(10), D_802A1B50_7304B0);
$x = 1.0;
MultiplyByActorScale($x);
func_802D38EC(SI_VAR(10), $x, $x, $x);
GetActorPos(ActorID_PLAYER, $x, $y, $z);
SI_VAR(3) = 20;
SI_VAR(4) = 42;
SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
$x += SI_VAR(3);
$y += SI_VAR(4);
$z += SI_VAR(5);
func_802D36E0(SI_VAR(10), $x, $y, $z);
InitTargetIterator();
SetGoalToTarget(ActorID_SELF);
GetGoalPos(ActorID_SELF, $x, $y, $z);
spawn {
$x = 0;
loop 18 {
$x += -60;
func_802D3840(SI_VAR(10), 0, 0, $x);
sleep 1;
}
}
func_802D39FC(SI_VAR(10), 0.8);
$z += 5;
func_802D3C58(SI_VAR(10), $x, $y, $z, 18);
GetItemPower(ItemId_COCONUT, $damage, SI_VAR(4));
ApplyShrinkFromOwner($damage);
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, $damage, 32);
// Bounce off
$x += 60;
$y += 0;
func_802D3C58(SI_VAR(10), $x, $y, $z, 16);
func_802D3624(SI_VAR(10));
await D_802A1670_72FFD0; // back to home pos
});

View File

@ -0,0 +1,16 @@
#ifndef BATTLE_ITEM_COCONUT
#define BATTLE_ITEM_COCONUT
#include "common.h"
#include "script_api/battle.h"
#undef NAMESPACE
#define NAMESPACE battle_item_coconut
Script D_802A1240_72F960;
Script D_802A1670_72FFD0;
ApiStatus func_802A1000_72F720(ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802A11D4_72F8F4(ScriptInstance* script, s32 isInitialCall);
#endif

View File

@ -1,5 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "battle/item/coconut_72F720", func_802A1000_72F720);
INCLUDE_ASM(s32, "battle/item/coconut_72F720", func_802A11D4_72F8F4);

View File

@ -159,15 +159,16 @@ void set_action_state(s32 actionState) {
}
if (actionState == ActionState_HIT_HAZARD || actionState == ActionState_HIT_LAVA) {
u8 partner;
PartnerID partner;
if (playerStatus->unk_BF == 3) {
actionState = ActionState_HIT_HAZARD;
}
// Whilst Lakilester, Bow, or Parakarry's ability is active, hazards have no effect.
// Whilst Sushie, Lakilester, Parakarry's ability is active, hazards have no effect.
partner = playerData->currentPartner;
if (((u8)(partner - 7) < 2) || (playerData->currentPartner == PartnerID_PARAKARRY)) {
if (partner == PartnerID_SUSHIE || partner == PartnerID_LAKILESTER || partner == PartnerID_PARAKARRY) {
if (D_8010EBB0[0]) {
playerStatus->animFlags |= 0x4;
playerStatus->flags |= 0x800;

View File

@ -1088,7 +1088,7 @@ s32 is_partner_ability_active(void) {
return 0;
}
s16 add_coins(s32 amt) {
s32 add_coins(s32 amt) {
PlayerData* playerData = &gPlayerData;
s16 newCoins = playerData->coins + amt;

View File

@ -21,8 +21,7 @@ void get_cam_viewport(s32 camID, u16* x, u16* y, u16* width, u16* height) {
*y = CAM(camID)->viewportStartY;
}
INCLUDE_ASM(void, "code_8560", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY,
f32* outZ);
INCLUDE_ASM(void, "code_8560", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, f32* outZ);
s32 func_8002E754(s32 camID, s32 x, s32 y) {
s32 startX = CAM(camID)->viewportStartX;

View File

@ -1,5 +1,23 @@
#include "common.h"
typedef struct UnkF5750 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ s32 unk_04;
/* 0x08 */ s32 unk_08;
/* 0x0C */ s32 unk_0C;
/* 0x10 */ s32 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
} UnkF5750;
typedef UnkF5750* UnkF5750List[0x40];
extern s16 D_802DB5B0;
extern UnkF5750List* D_802DB7C0;
ApiStatus HidePlayerShadow(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 hideShadow = get_variable(script, *args++);
@ -293,19 +311,31 @@ ApiStatus DisablePartner(ScriptInstance* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "code_F5750", UseEntryHeading);
INCLUDE_ASM(s32, "code_F5750", func_802D2148);
ApiStatus func_802D2148(ScriptInstance* script, s32 isInitialCall) {
gPlayerStatus.flags &= ~0x4000000;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", UseExitHeading);
INCLUDE_ASM(s32, "code_F5750", func_802D23F8);
INCLUDE_ASM(s32, "code_F5750", func_802D244C);
ApiStatus func_802D244C(ScriptInstance* script, s32 isInitialCall) {
if ((gCollisionStatus.currentFloor >= 0) && (func_802D23F8() != 0)) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2484);
return ApiStatus_BLOCK;
}
ApiStatus func_802D2484(ScriptInstance* script, s32 isInitialCall) {
return (gCollisionStatus.currentFloor >= 0) * ApiStatus_DONE2;
}
ApiStatus func_802D249C(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 val = 0;
if (gCollisionStatus.currentFloor >= 0) {
val = func_802D23F8() != 0;
}
@ -318,11 +348,18 @@ ApiStatus func_802D24F4(ScriptInstance* script, s32 isInitialCall) {
return (gPlayerStatus.moveFrames == 0) * ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2508);
ApiStatus func_802D2508(ScriptInstance* script, s32 isInitialCall) {
return !(gPlayerStatus.flags & 0x2000) * ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2520);
INCLUDE_ASM(s32, "code_F5750", func_802D286C);
ApiStatus func_802D286C(ScriptInstance* script, s32 isInitialCall) {
s32 temp = *script->ptrReadPos;
D_802DB5B0 = temp;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2884);
@ -353,9 +390,19 @@ ApiStatus GetCurrentPartner(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2B50);
ApiStatus func_802D2B50(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
INCLUDE_ASM(s32, "code_F5750", func_802D2B6C);
playerStatus->animFlags |= 8;
return ApiStatus_DONE2;
}
ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
playerStatus->animFlags |= 4;
return ApiStatus_DONE2;
}
ApiStatus Disable8bitMario(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
@ -375,9 +422,24 @@ ApiStatus Disable8bitMario(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2C14);
ApiStatus func_802D2C14(ScriptInstance* script, s32 isInitialCall) {
func_800EF3D4(get_variable(script, *script->ptrReadPos));
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D2C40);
ApiStatus func_802D2C40(ScriptInstance *script) {
Bytecode* args = script->ptrReadPos;
f32 x = get_variable(script, *args++);
PlayerStatus* playerStatus = &gPlayerStatus;
f32 y;
f32 z;
playerStatus->extraVelocity.x = x;
playerStatus->extraVelocity.y = get_variable(script, *args++);
playerStatus->extraVelocity.z = get_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus PlaySoundAtPlayer(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
@ -404,9 +466,75 @@ INCLUDE_ASM(s32, "code_F5750", func_802D3398);
INCLUDE_ASM(s32, "code_F5750", func_802D33D4);
INCLUDE_ASM(s32, "code_F5750", func_802D3474);
ApiStatus func_802D3474(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 outVar = *args++;
s32* unkStructPtr = get_variable(script, *args++);
UnkF5750* temp;
s32 i;
INCLUDE_ASM(s32, "code_F5750", func_802D354C);
for (i = 0; i < ARRAY_COUNT(*D_802DB7C0); i++) {
temp = (*D_802DB7C0)[i];
if (temp->unk_00 < 0) {
break;
}
}
if (i >= ARRAY_COUNT(*D_802DB7C0)) {
return ApiStatus_DONE2;
}
temp->unk_00 = load_entity_model(unkStructPtr);
temp->unk_04 = 0;
temp->unk_08 = 0;
temp->unk_0C = 0;
temp->unk_10 = 0;
temp->unk_14 = 0;
temp->unk_18 = 0;
temp->unk_1C = 1.0f;
temp->unk_20 = 1.0f;
temp->unk_24 = 1.0f;
update_entity_rendercmd(temp->unk_00);
set_variable(script, outVar, i);
return ApiStatus_DONE2;
}
ApiStatus func_802D354C(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 outVar = *args++;
s32* unkStructPtr = get_variable(script, *args++);
UnkF5750* temp;
s32 i;
for (i = 0; i < ARRAY_COUNT(*D_802DB7C0); i++) {
temp = (*D_802DB7C0)[i];
if (temp->unk_00 < 0) {
break;
}
}
if (i >= ARRAY_COUNT(*D_802DB7C0)) {
return ApiStatus_DONE2;
}
temp->unk_00 = ALT_load_entity_model(unkStructPtr);
temp->unk_04 = 0;
temp->unk_08 = 0;
temp->unk_0C = 0;
temp->unk_10 = 0;
temp->unk_14 = 0;
temp->unk_18 = 0;
temp->unk_1C = 1.0f;
temp->unk_20 = 1.0f;
temp->unk_24 = 1.0f;
update_entity_rendercmd(temp->unk_00);
set_variable(script, outVar, i);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", func_802D3624);
@ -436,7 +564,9 @@ INCLUDE_ASM(s32, "code_F5750", func_802D3FC8);
INCLUDE_ASM(s32, "code_F5750", func_802D4050);
INCLUDE_ASM(s32, "code_F5750", func_802D4164);
UnkF5750* func_802D4164(s32 index) {
return (*D_802DB7C0)[index];
}
INCLUDE_ASM(s32, "code_F5750", func_802D417C);
@ -446,9 +576,21 @@ INCLUDE_ASM(s32, "code_F5750", func_802D42AC);
INCLUDE_ASM(s32, "code_F5750", func_802D4364);
INCLUDE_ASM(s32, "code_F5750", func_802D43AC);
void func_802D43AC(s32 index, f32 arg1, f32 arg2, f32 arg3) {
UnkF5750* temp = (*D_802DB7C0)[index];
INCLUDE_ASM(s32, "code_F5750", func_802D43D0);
temp->unk_1C = arg1;
temp->unk_20 = arg2;
temp->unk_24 = arg3;
}
void func_802D43D0(s32 index, s32 arg1, s32 arg2, s32 arg3) {
UnkF5750* temp = (*D_802DB7C0)[index];
temp->unk_10 = arg1;
temp->unk_14 = arg2;
temp->unk_18 = arg3;
}
INCLUDE_ASM(s32, "code_F5750", func_802D43F4);

View File

@ -29,7 +29,7 @@ INCLUDE_ASM(s32, "code_d5a50_len_5fd0", init_menu_icon_list);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", func_801413F8);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", create_icon);
INCLUDE_ASM(s32*, "code_d5a50_len_5fd0", create_icon, s32 iconIndex);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", update_menu_icons);
@ -69,7 +69,7 @@ INCLUDE_ASM(s32, "code_d5a50_len_5fd0", get_menu_icon);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", free_icon);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", set_icon_render_pos);
INCLUDE_ASM(void, "code_d5a50_len_5fd0", set_icon_render_pos, s32 iconIndex, s32 posX, s32 posY);
INCLUDE_ASM(s32, "code_d5a50_len_5fd0", get_icon_render_pos);

View File

@ -5,7 +5,7 @@ from pathlib import Path
import os
path.append(os.path.join(os.path.dirname(__file__), "splat"))
from splat_ext.PaperMarioNpcSprites import Sprite
from convert_image import pack_color, iter_in_groups
from img.build import pack_color, iter_in_groups
if __name__ == "__main__":
if len(argv) != 3:

View File

@ -42,7 +42,7 @@ def script_lib():
s = [s.strip() for s in line.split("=", 1)]
name = s[0]
addr = s[1]
addr = s[1].split(";")[0].split(" ")[0]
_script_lib[int(addr, 16)] = name
return _script_lib
@ -67,7 +67,7 @@ class ScriptDisassembler:
argc = self.read_word()
if opcode > 0xFF or argc > 0xFF:
raise Exception(f"script '{script_name}' is malformed")
raise Exception(f"script '{self.script_name}' is malformed")
argv = []
for i in range(0, argc):
@ -600,8 +600,15 @@ class ScriptDSLDisassembler(ScriptDisassembler):
elif opcode == 0x41: self.write_line(f"{self.var(argv[0])} &=c {argv[1]:X};")
elif opcode == 0x42: self.write_line(f"{self.var(argv[0])} |=c {argv[1]:X};")
elif opcode == 0x43:
argv_str = ", ".join(self.var(arg) for arg in argv[1:])
self.write_line(f"{self.addr_ref(argv[0])}({argv_str});")
addr = argv[0]
if addr in self.symbol_map:
func_name = self.symbol_map[addr]
argv_str = ", ".join(self.var(arg) for arg in argv[1:])
self.write_line(f"{func_name}({argv_str});")
else:
print(f"script API function {addr:X} is not present in symbol_addrs.txt, please add it")
exit(1)
elif opcode == 0x44: self.write_line(f"spawn {self.addr_ref(argv[0])};")
elif opcode == 0x45: self.write_line(f"{self.var(argv[1])} = spawn {self.addr_ref(argv[0])};")
elif opcode == 0x46: self.write_line(f"await {self.addr_ref(argv[0])};")

View File

@ -83,6 +83,7 @@ class Converter():
for row in reversed_if(img.read()[2], self.flip_y):
for a, b in iter_in_groups(row, 2):
byte = (a << 4) | b
byte = byte & 0xFF
f.write(byte.to_bytes(1, byteorder="big"))
elif self.mode == "palette":
img.preamble(True)
@ -208,7 +209,7 @@ class Converter():
if __name__ == "__main__":
if len(argv) < 4:
print("usage: convert_image.py MODE INFILE OUTFILE [--flip-y]")
print("usage: build.py MODE INFILE OUTFILE [--flip-y]")
exit(1)
Converter(*argv[1:]).convert()

28
tools/img/header.py Executable file
View File

@ -0,0 +1,28 @@
#! /usr/bin/python3
from sys import argv
import re
import png
if __name__ == "__main__":
infile, outfile = argv[1:]
img = png.Reader(infile)
width, height, rows, info = img.read()
cname = re.sub(r"[^0-9a-zA-Z_]", "_", infile)
if cname.startswith("src_"):
cname = cname[4:]
elif cname.startswith("assets_"):
cname = cname[7:]
with open(outfile, "w") as f:
f.write("// Generated file, do not edit.\n")
f.write(f"#ifndef _{cname.upper()}_\n")
f.write(f"#define _{cname.upper()}_\n")
f.write(f"\n")
f.write(f"#define {cname}_width {width}\n")
f.write(f"#define {cname}_height {height}\n")
f.write(f"\n")
f.write(f"#endif\n")

0
tools/msg/parse_compile.py Normal file → Executable file
View File

View File

@ -1 +0,0 @@
build_system = "ninja"

View File

@ -9,6 +9,7 @@ options:
extensions: splat_ext
symbol_addrs_path: tools/symbol_addrs.txt
platform: n64
assets_dir: assets
segments:
- name: header
type: header
@ -1550,10 +1551,10 @@ segments:
- [0x4313F0, c]
- [0x431660, c]
- [0x4318D0, c]
- [0x431B80, .data, battle/area_kmr_part_1/battles]
- [0x431FB0, .data, battle/actor/goomba]
- [0x431B80, .data, battles]
- [0x431FB0, .data, goomba]
- [0x433970, bin]
- [0x4398A0, .rodata, battle/area_kmr_part_1/battles]
- [0x4398A0, .rodata, battles]
- [0x439984, bin]
- name: battle/area_kmr_part_2/
type: code
@ -2338,14 +2339,18 @@ segments:
files:
- [0x72E530, c]
- [0x72EA20, data]
- name: battle/item/coconut
- name: battle/item/coconut/
ld_name: battle_item_coconut
type: code
start: 0x72F720
vram: 0x802A1000
overlay: True
files:
- [0x72F720, c]
- [0x72F960, data]
- [0x72F720, c, aux]
- [0x72F960, .data, aux]
- [0x72FF20, ci4, coconut, 32, 32]
- [0x730120, palette, coconut]
- [0x730140, .data, coconut]
- name: battle/item/electro_pop
type: code
start: 0x7305A0
@ -2742,7 +2747,7 @@ segments:
- [0x7E3700, c]
- [0x7E4690, c]
- [0x7E4D00, data]
- [0x7E7380, .rodata, world/script_api/7E2AA0]
- [0x7E7380, .rodata, 7E2AA0]
- name: world/area_mac/machi/
type: code
overlay: True
@ -3279,13 +3284,13 @@ segments:
- [0x8C82B0, c]
- [0x8C83A0, c]
- [0x8C85E0, c]
- [0x8C85E0, .data, world/area_kmr/kmr_03/8C7F90]
- [0x8C8680, .data, world/area_kmr/kmr_03/8C8140]
- [0x8C88E0, .data, world/area_kmr/kmr_03/8C82B0]
- [0x8C85E0, .data, 8C7F90]
- [0x8C8680, .data, 8C8140]
- [0x8C88E0, .data, 8C82B0]
# - [0x8C9400, bin]
- [0x8C9780, .data, world/area_kmr/kmr_03/8C83A0]
- [0x8CA2D0, .data, world/area_kmr/kmr_03/8C85E0]
- [0x8CA8F0, .rodata, world/area_kmr/kmr_03/8C8140]
- [0x8C9780, .data, 8C83A0]
- [0x8CA2D0, .data, 8C85E0]
- [0x8CA8F0, .rodata, 8C8140]
- name: world/area_kmr/kmr_04/
type: code
overlay: True
@ -3391,10 +3396,10 @@ segments:
start: 0x8EB360
vram: 0x80240000
files:
- [0x8EB360, c, world/area_kmr/kmr_12/header]
- [0x8EB390, .data, world/area_kmr/kmr_12/header]
- [0x8EB420, .data, world/area_kmr/kmr_12/events]
- [0x8EBE10, .rodata, world/area_kmr/kmr_12/events]
- [0x8EB360, c, header]
- [0x8EB390, .data, header]
- [0x8EB420, .data, events]
- [0x8EBE10, .rodata, events]
- name: world/area_kmr/kmr_20/
type: code
overlay: True
@ -3589,9 +3594,9 @@ segments:
files:
- [0x929270, c]
- [0x9292B0, c]
- [0x9292D0, .data, world/area_sbk/sbk_00/929270]
- [0x929A00, .data, world/area_sbk/sbk_00/9292B0]
- [0x929A80, .rodata, world/area_sbk/sbk_00/929270]
- [0x9292D0, .data, "929270"]
- [0x929A00, .data, 9292B0]
- [0x929A80, .rodata, "929270"]
- name: world/area_sbk/sbk_01/
type: code
overlay: True
@ -3600,9 +3605,9 @@ segments:
files:
- [0x929A90, c]
- [0x929AD0, c]
- [0x929AF0, .data, world/area_sbk/sbk_01/929A90]
- [0x929E00, .data, world/area_sbk/sbk_01/929AD0]
- [0x92A290, .rodata, world/area_sbk/sbk_01/929A90]
- [0x929AF0, .data, 929A90]
- [0x929E00, .data, 929AD0]
- [0x92A290, .rodata, 929A90]
- name: world/area_sbk/sbk_02/
type: code
overlay: True

View File

@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/ethteck/splat.git
branch = master
commit = 6898b0a98bc8f64e3076b97f789c63ca1058ea2d
commit = 733546feac9b29b100553aca1bc9916e1c211f5b
parent = f8a344e713fbe1244ae4f28cf9329179c46123b1
method = merge
cmdver = 0.4.3

View File

@ -23,4 +23,11 @@ Internally, there's a new Symbol class which stores information about a symbol a
**data example**: `gSomeDataVar = 0x80024233; // type:data size:0x100`
As always, feel free to reach out to me with any questions, suggestions, or feedback.
As always, feel free to reach out to me with any questions, suggestions, or feedback.
## 0.6.1: `assets_dir` option
This release adds a new `assets_dir` option in `splat.yaml`s that allows you to override the default `img`, `bin`, and other directories that segments output to.
Want to interdisperse split assets with your sourcecode? `assets_dir: src`!
Want to have all assets live in a single directory? `assets_dir: assets`!

View File

@ -3,7 +3,7 @@
import argparse
from util.n64 import rominfo
from util.n64 import find_code_length
from segtypes.code import N64SegCode
from segtypes.n64.code import N64SegCode
parser = argparse.ArgumentParser(description="Create a splat config from a rom (currently only n64 .z64 roms supported)")
parser.add_argument("rom", help="path to a .z64 rom")
@ -23,7 +23,7 @@ options:
with open(rom_path, "rb") as f:
fbytes = f.read()
first_section_end = find_code_length.run(fbytes, 0x1000, rom.entry_point)
segments = \

View File

@ -1,4 +1,5 @@
PyYAML>=5.3.1,<6
pypng==0.0.20
colorama>=0.4.4,<0.5
capstone>=4.0.2,<5
python-ranges>=0.1.3,<0.2
capstone>=4.0.2,<5

View File

@ -4,7 +4,7 @@ from util.n64 import Yay0decompress
class N64SegYay0(N64Segment):
def split(self, rom_bytes, base_path):
out_dir = self.create_parent_dir(base_path + "/bin", self.name)
out_dir = self.create_parent_dir(base_path + "/" + self.options.get("assets_dir", "bin"), self.name)
path = os.path.join(out_dir, os.path.basename(self.name) + ".bin")
with open(path, "wb") as f:
@ -16,7 +16,7 @@ class N64SegYay0(N64Segment):
def get_ld_files(self):
return [("bin", f"{self.name}.Yay0", ".data", self.rom_start)]
return [(self.options.get("assets_dir", "bin"), f"{self.name}.Yay0", ".data", self.rom_start)]
@staticmethod

View File

@ -5,7 +5,7 @@ from pathlib import Path
class N64SegBin(N64Segment):
def split(self, rom_bytes, base_path):
out_dir = self.create_split_dir(base_path, "bin")
out_dir = self.create_split_dir(base_path, self.options.get("assets_dir", "bin"))
bin_path = os.path.join(out_dir, self.name + ".bin")
Path(bin_path).parent.mkdir(parents=True, exist_ok=True)
@ -14,7 +14,7 @@ class N64SegBin(N64Segment):
self.log(f"Wrote {self.name} to {bin_path}")
def get_ld_files(self):
return [("bin", f"{self.name}.bin", ".data", self.rom_start)]
return [(self.options.get("assets_dir", "bin"), f"{self.name}.bin", ".data", self.rom_start)]
@staticmethod
def get_default_name(addr):

View File

@ -1,10 +1,11 @@
from segtypes.n64.ci8 import N64SegCi8
class N64SegCi4(N64SegCi8):
def parse_image(self, data):
@staticmethod
def parse_image(data, width, height):
img_data = bytearray()
for i in range(self.width * self.height // 2):
for i in range(width * height // 2):
img_data.append(data[i] >> 4)
img_data.append(data[i] & 0xF)

View File

@ -11,14 +11,14 @@ class N64SegCi8(N64SegRgba16):
self.path = None
def split(self, rom_bytes, base_path):
out_dir = self.create_parent_dir(base_path + "/img", self.name)
out_dir = self.create_parent_dir(base_path + "/" + self.options.get("assets_dir", "img"), self.name)
self.path = os.path.join(out_dir, os.path.basename(self.name) + ".png")
data = rom_bytes[self.rom_start: self.rom_end]
if self.compressed:
data = Yay0decompress.decompress_yay0(data)
self.image = self.parse_image(data)
self.image = self.parse_image(data, self.width, self.height)
def postsplit(self, segments):
palettes = [seg for seg in segments if seg.type ==
@ -52,7 +52,8 @@ class N64SegCi8(N64SegRgba16):
self.log(
f"No unnamed palette for {self.name}; wrote image data to {self.path}")
def parse_image(self, data):
@staticmethod
def parse_image(data, width, height):
return data
def max_length(self):

View File

@ -58,11 +58,13 @@ class N64SegCode(N64Segment):
end = split_file["end"]
name = None if "name" not in split_file else split_file["name"]
subtype = split_file["type"]
args = []
else:
start = split_file[0]
end = seg_end if i == len(segment["files"]) - 1 else segment["files"][i + 1][0]
name = None if len(split_file) < 3 else split_file[2]
subtype = split_file[1]
args = split_file[3:]
if start < prev_start:
print(f"Error: Code segment {seg_name} has files out of ascending rom order (0x{prev_start:X} followed by 0x{start:X})")
@ -70,10 +72,12 @@ class N64SegCode(N64Segment):
if not name:
name = self.get_default_name(start) if seg_name == self.get_default_name(seg_start) else f"{prefix}{start:X}"
elif seg_name.endswith("/"):
name = seg_name + name
vram = seg_vram + (start - seg_start)
fl = {"start": start, "end": end, "name": name, "vram": vram, "subtype": subtype}
fl = {"start": start, "end": end, "name": name, "vram": vram, "subtype": subtype, "args": args}
ret.append(fl)
prev_start = start
@ -486,10 +490,8 @@ class N64SegCode(N64Segment):
return ret
def should_run(self):
possible_subtypes = ["c", "asm", "hasm", "bin", "data", "rodata"]
subtypes = set(f["subtype"] for f in self.files)
return super().should_run() or (st in self.options["modes"] and st in subtypes for st in possible_subtypes)
# we have lots of subtypes
return True
@staticmethod
def is_valid_ascii(bytes):
@ -705,6 +707,8 @@ class N64SegCode(N64Segment):
md.detail = True
md.skipdata = True
palettes = {}
for split_file in self.files:
file_type = split_file["subtype"]
@ -733,7 +737,10 @@ class N64SegCode(N64Segment):
if file_type == "c":
c_path = os.path.join(
base_path, "src", split_file["name"] + "." + self.get_ext(split_file["subtype"]))
base_path,
self.get_subdir(split_file["subtype"]),
split_file["name"] + "." + self.get_ext(split_file["subtype"])
)
if os.path.exists(c_path):
defined_funcs = get_funcs_defined_in_c(c_path)
@ -806,20 +813,70 @@ class N64SegCode(N64Segment):
f.write(file_text)
elif file_type == "bin" and ("bin" in self.options["modes"] or "all" in self.options["modes"]):
out_dir = self.create_split_dir(base_path, "bin")
bin_path = os.path.join(
out_dir, split_file["name"] + "." + self.get_ext(split_file["subtype"]))
base_path,
self.get_subdir(split_file["subtype"]),
split_file["name"] + "." + self.get_ext(split_file["subtype"])
)
Path(bin_path).parent.mkdir(parents=True, exist_ok=True)
with open(bin_path, "wb") as f:
f.write(rom_bytes[split_file["start"]: split_file["end"]])
@staticmethod
def get_subdir(subtype):
elif file_type in ["i4", "i8", "ia4", "ia8", "ia16", "rgba16", "rgba32", "ci4", "ci8"]:
pass
elif file_type == "palette":
from segtypes.n64.palette import N64SegPalette
out_path = os.path.join(
base_path,
self.get_subdir(split_file["subtype"]),
split_file["name"] + "." + self.get_ext(split_file["subtype"])
)
img_bytes = rom_bytes[split_file["start"]:split_file["end"]]
palette = N64SegPalette.parse_palette(img_bytes)
palettes[split_file["name"]] = palette
import png
for split_file in self.files:
file_type = split_file["subtype"]
img_bytes = rom_bytes[split_file["start"]:split_file["end"]]
out_path = os.path.join(
base_path,
self.get_subdir(split_file["subtype"]),
split_file["name"] + "." + self.get_ext(split_file["subtype"])
)
if file_type == "ci4" and (file_type in self.options["modes"] or "all" in self.options["modes"] or "img" in self.options["modes"]):
from segtypes.n64.ci4 import N64SegCi4
width, height = split_file["args"]
palette = palettes[split_file["name"]]
image = N64SegCi4.parse_image(img_bytes, width, height)
w = png.Writer(width, height, palette=palette)
Path(out_path).parent.mkdir(parents=True, exist_ok=True)
with open(out_path, "wb") as f:
w.write_array(f, image)
# TODO other image types
# TODO write orphaned palettes
def get_subdir(self, subtype):
if subtype in ["c", ".data", ".rodata", ".bss"]:
return "src"
elif subtype in ["asm", "hasm", "header"]:
return "asm"
elif subtype == "bin":
return self.options.get("assets_dir", "bin")
elif subtype in ["i4", "i8", "ia4", "ia8", "ia16", "rgba16", "rgba32", "ci4", "ci8", "palette"]:
return self.options.get("assets_dir", "img")
return subtype
@staticmethod
@ -830,13 +887,17 @@ class N64SegCode(N64Segment):
return "s"
elif subtype == "bin":
return "bin"
elif subtype in ["i4", "i8", "ia4", "ia8", "ia16", "rgba16", "rgba32", "ci4", "ci8"]:
return "png"
elif subtype == "palette":
return "pal.png"
return subtype
@staticmethod
def get_ld_obj_type(subtype, section_name):
if subtype in "c":
return ".text"
elif subtype in ["bin", ".data", "data"]:
elif subtype in ["bin", ".data", "data", "i4", "i8", "ia4", "ia8", "ia16", "rgba16", "rgba32", "ci4", "ci8", "palette"]:
return ".data"
elif subtype in [".rodata", "rodata"]:
return ".rodata"

View File

@ -33,7 +33,7 @@ class N64SegPalette(N64Segment):
)
def split(self, rom_bytes, base_path):
out_dir = self.create_parent_dir(base_path + "/img", self.name)
out_dir = self.create_parent_dir(base_path + "/" + self.options.get("assets_dir", "img"), self.name)
self.path = os.path.join(
out_dir, os.path.basename(self.name) + ".png")
@ -41,9 +41,10 @@ class N64SegPalette(N64Segment):
if self.compressed:
data = Yay0decompress.decompress_yay0(data)
self.palette = self.parse_palette(data)
self.palette = N64SegPalette.parse_palette(data)
def parse_palette(self, data):
@staticmethod
def parse_palette(data):
palette = []
for a, b in iter_in_groups(data, 2):
@ -61,4 +62,4 @@ class N64SegPalette(N64Segment):
if self.compressed:
ext += ".Yay0"
return [("img", f"{self.name}{ext}", ".data", self.rom_start)]
return [(self.options.get("assets_dir", "img"), f"{self.name}{ext}", ".data", self.rom_start)]

View File

@ -48,7 +48,7 @@ class N64SegRgba16(N64Segment):
return super().should_run() or "img" in self.options["modes"]
def split(self, rom_bytes, base_path):
out_dir = self.create_parent_dir(base_path + "/img", self.name)
out_dir = self.create_parent_dir(base_path + "/" + self.options.get("assets_dir", "img"), self.name)
path = os.path.join(out_dir, os.path.basename(self.name) + ".png")
data = rom_bytes[self.rom_start: self.rom_end]
@ -82,4 +82,4 @@ class N64SegRgba16(N64Segment):
if self.compressed:
ext += ".Yay0"
return [("img", f"{self.name}{ext}", ".data", self.rom_start)]
return [(self.options.get("assets_dir", "img"), f"{self.name}{ext}", ".data", self.rom_start)]

View File

@ -1,5 +1,7 @@
from pathlib import Path, PurePath
from util import log
import os
import re
default_subalign = 16
@ -137,7 +139,14 @@ class Segment:
f"SPLAT_BEGIN_SEG({tmp_sect_name}, 0x{start:X}, 0x{tmp_vram:X}, {subalign_str})\n"
)
path = PurePath(subdir) / PurePath(path)
path_cname = re.sub(r"[^0-9a-zA-Z_]", "_", path)
s += f" {path_cname} = .;\n"
if subdir == self.options.get("assets_dir"):
path = PurePath(path)
else:
path = PurePath(subdir) / PurePath(path)
path = path.with_suffix(".o" if replace_ext else path.suffix + ".o")
s += f" BUILD_DIR/{path}({obj_type});\n"

View File

@ -31,8 +31,8 @@ class N64SegPaperMarioMapFS(N64Segment):
super().__init__(segment, next_segment, options)
def split(self, rom_bytes, base_path):
bin_dir = self.create_split_dir(base_path, "bin/assets")
img_party_dir = self.create_split_dir(base_path, "img/party")
bin_dir = self.create_split_dir(base_path, self.options.get("assets_dir", "bin"))
img_party_dir = self.create_split_dir(base_path, self.options.get("assets_dir", "img") + "/party")
data = rom_bytes[self.rom_start: self.rom_end]
@ -51,11 +51,17 @@ class N64SegPaperMarioMapFS(N64Segment):
if offset == 0:
path = None
elif name.startswith("party_"):
path = "{}.png".format(name)
self.create_parent_dir(img_party_dir, path)
path = os.path.join(img_party_dir, "{}.png".format(name))
elif name.endswith("_hit") or name.endswith("_shape"):
area = "area_" + name.split("_")[0][0:3]
map_dir = self.create_split_dir(base_path, self.options.get("assets_dir", "bin") + f"/map/{area}")
path = os.path.join(map_dir, "{}.bin".format(name))
elif name.endswith("_tex"):
map_dir = self.create_split_dir(base_path, self.options.get("assets_dir", "bin") + f"/map/texture")
path = os.path.join(map_dir, "{}.bin".format(name))
else:
path = "{}.bin".format(name)
self.create_parent_dir(bin_dir, path)
path = os.path.join(bin_dir, "{}.bin".format(name))
if name == "end_data":
break
@ -63,19 +69,20 @@ class N64SegPaperMarioMapFS(N64Segment):
bytes = rom_bytes[self.rom_start + 0x20 +
offset: self.rom_start + 0x20 + offset + size]
Path(path).parent.mkdir(parents=True, exist_ok=True)
if is_compressed:
self.log(f"Decompressing {name}...")
bytes = Yay0decompress.decompress_yay0(bytes)
if name.startswith("party_"):
with open(os.path.join(img_party_dir, path), "wb") as f:
# CI-8
w = png.Writer(150, 105, palette=parse_palette(bytes[:0x200]))
w.write_array(f, bytes[0x200:])
else:
with open(os.path.join(bin_dir, path), "wb") as f:
f.write(bytes)
if name.startswith("party_"):
with open(path, "wb") as f:
# CI-8
w = png.Writer(150, 105, palette=parse_palette(bytes[:0x200]))
w.write_array(f, bytes[0x200:])
else:
with open(path, "wb") as f:
f.write(bytes)
self.log(f"Wrote {name} to {Path(bin_dir, path)}")
@ -83,7 +90,7 @@ class N64SegPaperMarioMapFS(N64Segment):
def get_ld_files(self):
return [("bin/assets", self.name, ".data", self.rom_start)]
return [(self.options.get("assets_dir", "bin"), self.name, ".data", self.rom_start)]
@staticmethod

View File

@ -367,7 +367,7 @@ class N64SegPaperMarioMessages(N64Segment):
self.log(f"Reading {len(msg_offsets)} messages in section {name} (0x{i:02X})")
path = Path(base_path, self.name, name + ".msg")
path = Path(base_path, self.options["assets_dir"], self.name, name + ".msg")
path.parent.mkdir(parents=True, exist_ok=True)
with open(path, "w") as self.f:
for j, msg_offset in enumerate(msg_offsets):
@ -378,7 +378,7 @@ class N64SegPaperMarioMessages(N64Segment):
self.f.write("\n[/message]\n")
def get_ld_files(self):
return [("", self.name, ".data", self.rom_start)]
return [(self.options["assets_dir"], self.name, ".data", self.rom_start)]
@staticmethod
def get_default_name(addr):

View File

@ -259,7 +259,7 @@ class N64SegPaperMarioNpcSprites(N64Segment):
self.files = DEFAULT_SPRITE_NAMES
def split(self, rom_bytes, base_path):
out_dir = self.create_split_dir(base_path, "sprite/" + self.name)
out_dir = self.create_split_dir(base_path, self.options["assets_dir"] + "/sprite/" + self.name)
data = rom_bytes[self.rom_start:self.rom_end]
pos = 0
@ -294,7 +294,7 @@ class N64SegPaperMarioNpcSprites(N64Segment):
sprite.write_to_dir(sprite_dir)
def get_ld_files(self):
return [("sprite", self.name, ".data", self.rom_start)]
return [(self.options["assets_dir"], "sprite/" + self.name, ".data", self.rom_start)]
@staticmethod
def get_default_name(addr):

View File

@ -8870,3 +8870,10 @@ battle_item_snowman_doll_FadeBackgroundToBlack = 0x802A1320; // type:func rom:0x
battle_item_thunder_bolt_FadeBackgroundToBlack = 0x802A1388; // type:func rom:0x722EC8
battle_item_stop_watch_FadeBackgroundToBlack = 0x802A123C; // type:func rom:0x72700C
battle_item_fright_jar_FadeBackgroundToBlack = 0x802A123C; // type:func rom:0x72BB4C
func_802D3474 = 0x802D3474; // type:func rom:0xF7E24
func_802D3624 = 0x802D3624; // type:func rom:0xF7FD4
func_802D36E0 = 0x802D36E0; // type:func rom:0xF8090
func_802D38EC = 0x802D38EC; // type:func rom:0xF829C
func_802D3840 = 0x802D3840; // type:func rom:0xF81F0
func_802D39FC = 0x802D39FC; // type:func rom:0xF83AC
func_802D3C58 = 0x802D3C58; // type:func rom:0xF8608