Merge branch 'mac-support' into audio

This commit is contained in:
Ethan Roseman 2020-12-05 19:57:10 -05:00
commit 3762983408
25 changed files with 133 additions and 244 deletions

View File

@ -1,9 +1,11 @@
Checks: '-*,clang-analyzer-core.*,clang-analyzer-deadcode.*,readability-*,-readability-magic-numbers,-readability-else-after-return,-readability-named-parameter,-readability-braces-around-statements,-readability-isolate-declaration,-readability-uppercase-literal-suffix,-readability-function-size,-readability-non-const-parameter,readability-identifier-naming' Checks: '-*,clang-analyzer-core.*,clang-analyzer-deadcode.*,readability-*,-readability-magic-numbers,-readability-else-after-return,-readability-named-parameter,-readability-braces-around-statements,-readability-isolate-declaration,-readability-uppercase-literal-suffix,-readability-function-size,-readability-non-const-parameter,readability-identifier-naming'
CheckOptions: CheckOptions:
# TEMP: this only disabled because mips2c outputs snake_case
#- key: readability-identifier-naming.LocalVariableCase #- key: readability-identifier-naming.LocalVariableCase
# value: camelBack # value: camelBack
#- key: readability-identifier-naming.ParameterCase
# value: camelBack - key: readability-identifier-naming.ParameterCase
value: camelBack
#- key: readability-identifier-naming.TypedefCase #- key: readability-identifier-naming.TypedefCase
# value: CamelCase # value: CamelCase

4
.gitignore vendored
View File

@ -2,6 +2,7 @@
__pycache__/ __pycache__/
venv/ venv/
.lark_cache* .lark_cache*
.splat_cache
# Misc # Misc
.idea/ .idea/
@ -25,3 +26,6 @@ settings.mk
/img /img
/msg /msg
/sprite /sprite
tools/Yay0compress
cpp.mk

View File

@ -58,6 +58,21 @@ CPP := cpp
LD := $(CROSS)ld LD := $(CROSS)ld
OBJCOPY := $(CROSS)objcopy OBJCOPY := $(CROSS)objcopy
-include cpp.mk # Used to specify alternate CPP if `cpp` is the clang one on MacOS
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS=linux
ICONV := iconv --from UTF-8 --to SHIFT-JIS
endif
ifeq ($(UNAME_S),Darwin)
OS=mac
ICONV := tools/iconv.py UTF-8 SHIFT-JIS
endif
OLD_AS=tools/$(OS)/mips-nintendo-nu64-as
CC=tools/$(OS)/cc1
CPPFLAGS := -Iinclude -Isrc -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -Wundef -Wcomment CPPFLAGS := -Iinclude -Isrc -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -Wundef -Wcomment
ASFLAGS := -EB -Iinclude -march=vr4300 -mtune=vr4300 ASFLAGS := -EB -Iinclude -march=vr4300 -mtune=vr4300
OLDASFLAGS := -EB -Iinclude -G 0 OLDASFLAGS := -EB -Iinclude -G 0
@ -92,7 +107,7 @@ endif
### Targets ### ### Targets ###
clean: clean:
rm -rf $(BUILD_DIR) rm -rf $(BUILD_DIR) bin msg img sprite .splat_cache
clean-code: clean-code:
rm -rf $(BUILD_DIR)/src rm -rf $(BUILD_DIR)/src
@ -106,14 +121,12 @@ submodules:
git submodule update --init --recursive git submodule update --init --recursive
split: split:
rm -rf bin msg img sprite $(SPLAT) --modes ld bin Yay0 PaperMarioMapFS PaperMarioMessages img PaperMarioNpcSprites --new
$(SPLAT) --modes ld bin Yay0 PaperMarioMapFS PaperMarioMessages img PaperMarioNpcSprites
split-%: split-%:
$(SPLAT) --modes ld $* --verbose $(SPLAT) --modes ld $* --verbose --new
split-all: split-all:
rm -rf bin msg img sprite
$(SPLAT) --modes all $(SPLAT) --modes all
test: $(ROM) test: $(ROM)
@ -140,12 +153,12 @@ $(BUILD_DIR)/%.Yay0.o: $(BUILD_DIR)/%.bin.Yay0
# Compile C files # Compile C files
$(BUILD_DIR)/%.c.o: %.c $(MDEPS) | $(GENERATED_HEADERS) $(BUILD_DIR)/%.c.o: %.c $(MDEPS) | $(GENERATED_HEADERS)
@mkdir -p $(shell dirname $@) @mkdir -p $(shell dirname $@)
$(CPP) $(CPPFLAGS) -o - $(CPPMFLAGS) $< | iconv --from UTF-8 --to SHIFT-JIS | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) -o $@ - $(CPP) $(CPPFLAGS) -o - $(CPPMFLAGS) $< | $(ICONV) | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
# Compile C files (with DSL macros) # Compile C files (with DSL macros)
$(foreach cfile, $(DSL_C_FILES), $(BUILD_DIR)/$(cfile).o): $(BUILD_DIR)/%.c.o: %.c $(MDEPS) tools/compile_dsl_macros.py | $(GENERATED_HEADERS) $(foreach cfile, $(DSL_C_FILES), $(BUILD_DIR)/$(cfile).o): $(BUILD_DIR)/%.c.o: %.c $(MDEPS) tools/compile_dsl_macros.py | $(GENERATED_HEADERS)
@mkdir -p $(shell dirname $@) @mkdir -p $(shell dirname $@)
$(CPP) $(CPPFLAGS) -o - $< $(CPPMFLAGS) | $(PYTHON) tools/compile_dsl_macros.py | iconv --from UTF-8 --to SHIFT-JIS | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) -o $@ - $(CPP) $(CPPFLAGS) -o - $< $(CPPMFLAGS) | $(PYTHON) tools/compile_dsl_macros.py | $(ICONV) | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
# Assemble handwritten ASM # Assemble handwritten ASM
$(BUILD_DIR)/%.s.o: %.s $(BUILD_DIR)/%.s.o: %.s
@ -218,7 +231,7 @@ $(MSG_BIN:.bin=.o): $(MSG_BIN)
$(LD) -r -b binary -o $@ $< $(LD) -r -b binary -o $@ $<
# Sprites # Sprites
$(foreach npc, $(NPC_SPRITES), $(eval $(BUILD_DIR)/sprite/npc/$(npc):: $(shell find sprite/npc/$(npc) -type f))) # dependencies $(foreach npc, $(NPC_SPRITES), $(eval $(BUILD_DIR)/sprite/npc/$(npc):: $(shell find sprite/npc/$(npc) -type f 2> /dev/null))) # dependencies
NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc)) NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc))
NPC_YAY0 := $(foreach npc, $(NPC_SPRITES), $(BUILD_DIR)/sprite/npc/$(npc).Yay0) NPC_YAY0 := $(foreach npc, $(NPC_SPRITES), $(BUILD_DIR)/sprite/npc/$(npc).Yay0)
$(BUILD_DIR)/sprite/npc/%:: sprite/npc/% tools/compile_npc_sprite.py $(BUILD_DIR)/sprite/npc/%:: sprite/npc/% tools/compile_npc_sprite.py

View File

@ -1,52 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel BindIdle
/* 1A7374 80278A94 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1A7378 80278A98 AFB10014 */ sw $s1, 0x14($sp)
/* 1A737C 80278A9C 0080882D */ daddu $s1, $a0, $zero
/* 1A7380 80278AA0 AFBF001C */ sw $ra, 0x1c($sp)
/* 1A7384 80278AA4 AFB20018 */ sw $s2, 0x18($sp)
/* 1A7388 80278AA8 AFB00010 */ sw $s0, 0x10($sp)
/* 1A738C 80278AAC 8E30000C */ lw $s0, 0xc($s1)
/* 1A7390 80278AB0 8E050000 */ lw $a1, ($s0)
/* 1A7394 80278AB4 0C0B1EAF */ jal get_variable
/* 1A7398 80278AB8 26100004 */ addiu $s0, $s0, 4
/* 1A739C 80278ABC 0040902D */ daddu $s2, $v0, $zero
/* 1A73A0 80278AC0 2402FF81 */ addiu $v0, $zero, -0x7f
/* 1A73A4 80278AC4 16420002 */ bne $s2, $v0, .L80278AD0
/* 1A73A8 80278AC8 00000000 */ nop
/* 1A73AC 80278ACC 8E320148 */ lw $s2, 0x148($s1)
.L80278AD0:
/* 1A73B0 80278AD0 8E050000 */ lw $a1, ($s0)
/* 1A73B4 80278AD4 0C0B1EAF */ jal get_variable
/* 1A73B8 80278AD8 0220202D */ daddu $a0, $s1, $zero
/* 1A73BC 80278ADC 0240202D */ daddu $a0, $s2, $zero
/* 1A73C0 80278AE0 0C09A75B */ jal get_actor
/* 1A73C4 80278AE4 0040882D */ daddu $s1, $v0, $zero
/* 1A73C8 80278AE8 0040802D */ daddu $s0, $v0, $zero
/* 1A73CC 80278AEC 8E0201D0 */ lw $v0, 0x1d0($s0)
/* 1A73D0 80278AF0 10400006 */ beqz $v0, .L80278B0C
/* 1A73D4 80278AF4 0220202D */ daddu $a0, $s1, $zero
/* 1A73D8 80278AF8 8E0401E0 */ lw $a0, 0x1e0($s0)
/* 1A73DC 80278AFC 0C0B102B */ jal kill_script_by_ID
/* 1A73E0 80278B00 00000000 */ nop
/* 1A73E4 80278B04 AE0001D0 */ sw $zero, 0x1d0($s0)
/* 1A73E8 80278B08 0220202D */ daddu $a0, $s1, $zero
.L80278B0C:
/* 1A73EC 80278B0C 2405000A */ addiu $a1, $zero, 0xa
/* 1A73F0 80278B10 0000302D */ daddu $a2, $zero, $zero
/* 1A73F4 80278B14 0C0B0CF8 */ jal start_script
/* 1A73F8 80278B18 AE0401C0 */ sw $a0, 0x1c0($s0)
/* 1A73FC 80278B1C 0040182D */ daddu $v1, $v0, $zero
/* 1A7400 80278B20 AE0301D0 */ sw $v1, 0x1d0($s0)
/* 1A7404 80278B24 8C640144 */ lw $a0, 0x144($v1)
/* 1A7408 80278B28 AE0401E0 */ sw $a0, 0x1e0($s0)
/* 1A740C 80278B2C AC720148 */ sw $s2, 0x148($v1)
/* 1A7410 80278B30 8FBF001C */ lw $ra, 0x1c($sp)
/* 1A7414 80278B34 8FB20018 */ lw $s2, 0x18($sp)
/* 1A7418 80278B38 8FB10014 */ lw $s1, 0x14($sp)
/* 1A741C 80278B3C 8FB00010 */ lw $s0, 0x10($sp)
/* 1A7420 80278B40 24020002 */ addiu $v0, $zero, 2
/* 1A7424 80278B44 03E00008 */ jr $ra
/* 1A7428 80278B48 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,43 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel FadeBackgroundToBlack
/* 1A300 8003EF00 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1A304 8003EF04 AFB00010 */ sw $s0, 0x10($sp)
/* 1A308 8003EF08 0080802D */ daddu $s0, $a0, $zero
/* 1A30C 8003EF0C 10A0000E */ beqz $a1, .L8003EF48
/* 1A310 8003EF10 AFBF0014 */ sw $ra, 0x14($sp)
/* 1A314 8003EF14 0C04760B */ jal func_8011D82C
/* 1A318 8003EF18 24040001 */ addiu $a0, $zero, 1
/* 1A31C 8003EF1C 0000202D */ daddu $a0, $zero, $zero
/* 1A320 8003EF20 0080282D */ daddu $a1, $a0, $zero
/* 1A324 8003EF24 0080302D */ daddu $a2, $a0, $zero
/* 1A328 8003EF28 0080382D */ daddu $a3, $a0, $zero
/* 1A32C 8003EF2C 3C028015 */ lui $v0, %hi(D_801512F0)
/* 1A330 8003EF30 8C4212F0 */ lw $v0, %lo(D_801512F0)($v0)
/* 1A334 8003EF34 24030001 */ addiu $v1, $zero, 1
/* 1A338 8003EF38 0C046F97 */ jal set_background_color_blend
/* 1A33C 8003EF3C A0430000 */ sb $v1, ($v0)
/* 1A340 8003EF40 24020019 */ addiu $v0, $zero, 0x19
/* 1A344 8003EF44 AE020070 */ sw $v0, 0x70($s0)
.L8003EF48:
/* 1A348 8003EF48 0000202D */ daddu $a0, $zero, $zero
/* 1A34C 8003EF4C 0080282D */ daddu $a1, $a0, $zero
/* 1A350 8003EF50 0080302D */ daddu $a2, $a0, $zero
/* 1A354 8003EF54 8E030070 */ lw $v1, 0x70($s0)
/* 1A358 8003EF58 24020019 */ addiu $v0, $zero, 0x19
/* 1A35C 8003EF5C 00431023 */ subu $v0, $v0, $v1
/* 1A360 8003EF60 00023880 */ sll $a3, $v0, 2
/* 1A364 8003EF64 00E23821 */ addu $a3, $a3, $v0
/* 1A368 8003EF68 00073840 */ sll $a3, $a3, 1
/* 1A36C 8003EF6C 0C046F97 */ jal set_background_color_blend
/* 1A370 8003EF70 30E700FE */ andi $a3, $a3, 0xfe
/* 1A374 8003EF74 8E020070 */ lw $v0, 0x70($s0)
/* 1A378 8003EF78 2442FFFF */ addiu $v0, $v0, -1
/* 1A37C 8003EF7C AE020070 */ sw $v0, 0x70($s0)
/* 1A380 8003EF80 2C420001 */ sltiu $v0, $v0, 1
/* 1A384 8003EF84 8FBF0014 */ lw $ra, 0x14($sp)
/* 1A388 8003EF88 8FB00010 */ lw $s0, 0x10($sp)
/* 1A38C 8003EF8C 00021040 */ sll $v0, $v0, 1
/* 1A390 8003EF90 03E00008 */ jr $ra
/* 1A394 8003EF94 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003F084
/* 1A484 8003F084 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1A488 8003F088 AFBF0010 */ sw $ra, 0x10($sp)
/* 1A48C 8003F08C 0C00EABB */ jal get_npc_unsafe
/* 1A490 8003F090 2404FFF6 */ addiu $a0, $zero, -0xa
/* 1A494 8003F094 0040182D */ daddu $v1, $v0, $zero
/* 1A498 8003F098 906200AC */ lbu $v0, 0xac($v1)
/* 1A49C 8003F09C 2442FFEF */ addiu $v0, $v0, -0x11
/* 1A4A0 8003F0A0 A06200AC */ sb $v0, 0xac($v1)
/* 1A4A4 8003F0A4 304200FF */ andi $v0, $v0, 0xff
/* 1A4A8 8003F0A8 14400003 */ bnez $v0, .L8003F0B8
/* 1A4AC 8003F0AC 0000102D */ daddu $v0, $zero, $zero
/* 1A4B0 8003F0B0 A06000AC */ sb $zero, 0xac($v1)
/* 1A4B4 8003F0B4 24020001 */ addiu $v0, $zero, 1
.L8003F0B8:
/* 1A4B8 8003F0B8 8FBF0010 */ lw $ra, 0x10($sp)
/* 1A4BC 8003F0BC 03E00008 */ jr $ra
/* 1A4C0 8003F0C0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,9 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003F384
/* 1A784 8003F384 24020001 */ addiu $v0, $zero, 1
/* 1A788 8003F388 3C01800A */ lui $at, %hi(D_800A0BB8)
/* 1A78C 8003F38C A4220BB8 */ sh $v0, %lo(D_800A0BB8)($at)
/* 1A790 8003F390 03E00008 */ jr $ra
/* 1A794 8003F394 24020002 */ addiu $v0, $zero, 2

View File

@ -1,50 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003F414
/* 1A814 8003F414 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1A818 8003F418 AFB1001C */ sw $s1, 0x1c($sp)
/* 1A81C 8003F41C 0080882D */ daddu $s1, $a0, $zero
/* 1A820 8003F420 AFBF0024 */ sw $ra, 0x24($sp)
/* 1A824 8003F424 AFB20020 */ sw $s2, 0x20($sp)
/* 1A828 8003F428 AFB00018 */ sw $s0, 0x18($sp)
/* 1A82C 8003F42C 8E30000C */ lw $s0, 0xc($s1)
/* 1A830 8003F430 8E050000 */ lw $a1, ($s0)
/* 1A834 8003F434 0C0B1EAF */ jal get_variable
/* 1A838 8003F438 26100004 */ addiu $s0, $s0, 4
/* 1A83C 8003F43C 8E050000 */ lw $a1, ($s0)
/* 1A840 8003F440 26100004 */ addiu $s0, $s0, 4
/* 1A844 8003F444 0220202D */ daddu $a0, $s1, $zero
/* 1A848 8003F448 0C0B1EAF */ jal get_variable
/* 1A84C 8003F44C 0040902D */ daddu $s2, $v0, $zero
/* 1A850 8003F450 0220202D */ daddu $a0, $s1, $zero
/* 1A854 8003F454 8E050000 */ lw $a1, ($s0)
/* 1A858 8003F458 0C0B1EAF */ jal get_variable
/* 1A85C 8003F45C 0040802D */ daddu $s0, $v0, $zero
/* 1A860 8003F460 24040006 */ addiu $a0, $zero, 6
/* 1A864 8003F464 44921000 */ mtc1 $s2, $f2
/* 1A868 8003F468 00000000 */ nop
/* 1A86C 8003F46C 468010A0 */ cvt.s.w $f2, $f2
/* 1A870 8003F470 44051000 */ mfc1 $a1, $f2
/* 1A874 8003F474 44901000 */ mtc1 $s0, $f2
/* 1A878 8003F478 00000000 */ nop
/* 1A87C 8003F47C 468010A0 */ cvt.s.w $f2, $f2
/* 1A880 8003F480 44061000 */ mfc1 $a2, $f2
/* 1A884 8003F484 44821000 */ mtc1 $v0, $f2
/* 1A888 8003F488 00000000 */ nop
/* 1A88C 8003F48C 468010A0 */ cvt.s.w $f2, $f2
/* 1A890 8003F490 3C013F99 */ lui $at, 0x3f99
/* 1A894 8003F494 3421999A */ ori $at, $at, 0x999a
/* 1A898 8003F498 44810000 */ mtc1 $at, $f0
/* 1A89C 8003F49C 44071000 */ mfc1 $a3, $f2
/* 1A8A0 8003F4A0 2403001E */ addiu $v1, $zero, 0x1e
/* 1A8A4 8003F4A4 AFA30014 */ sw $v1, 0x14($sp)
/* 1A8A8 8003F4A8 0C01C82C */ jal func_800720B0
/* 1A8AC 8003F4AC E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A8B0 8003F4B0 8FBF0024 */ lw $ra, 0x24($sp)
/* 1A8B4 8003F4B4 8FB20020 */ lw $s2, 0x20($sp)
/* 1A8B8 8003F4B8 8FB1001C */ lw $s1, 0x1c($sp)
/* 1A8BC 8003F4BC 8FB00018 */ lw $s0, 0x18($sp)
/* 1A8C0 8003F4C0 24020002 */ addiu $v0, $zero, 2
/* 1A8C4 8003F4C4 03E00008 */ jr $ra
/* 1A8C8 8003F4C8 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,49 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003F4CC
/* 1A8CC 8003F4CC 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1A8D0 8003F4D0 AFB1001C */ sw $s1, 0x1c($sp)
/* 1A8D4 8003F4D4 0080882D */ daddu $s1, $a0, $zero
/* 1A8D8 8003F4D8 AFBF0024 */ sw $ra, 0x24($sp)
/* 1A8DC 8003F4DC AFB20020 */ sw $s2, 0x20($sp)
/* 1A8E0 8003F4E0 AFB00018 */ sw $s0, 0x18($sp)
/* 1A8E4 8003F4E4 8E30000C */ lw $s0, 0xc($s1)
/* 1A8E8 8003F4E8 8E050000 */ lw $a1, ($s0)
/* 1A8EC 8003F4EC 0C0B1EAF */ jal get_variable
/* 1A8F0 8003F4F0 26100004 */ addiu $s0, $s0, 4
/* 1A8F4 8003F4F4 8E050000 */ lw $a1, ($s0)
/* 1A8F8 8003F4F8 26100004 */ addiu $s0, $s0, 4
/* 1A8FC 8003F4FC 0220202D */ daddu $a0, $s1, $zero
/* 1A900 8003F500 0C0B1EAF */ jal get_variable
/* 1A904 8003F504 0040902D */ daddu $s2, $v0, $zero
/* 1A908 8003F508 0220202D */ daddu $a0, $s1, $zero
/* 1A90C 8003F50C 8E050000 */ lw $a1, ($s0)
/* 1A910 8003F510 0C0B1EAF */ jal get_variable
/* 1A914 8003F514 0040802D */ daddu $s0, $v0, $zero
/* 1A918 8003F518 24040009 */ addiu $a0, $zero, 9
/* 1A91C 8003F51C 44921000 */ mtc1 $s2, $f2
/* 1A920 8003F520 00000000 */ nop
/* 1A924 8003F524 468010A0 */ cvt.s.w $f2, $f2
/* 1A928 8003F528 44051000 */ mfc1 $a1, $f2
/* 1A92C 8003F52C 44901000 */ mtc1 $s0, $f2
/* 1A930 8003F530 00000000 */ nop
/* 1A934 8003F534 468010A0 */ cvt.s.w $f2, $f2
/* 1A938 8003F538 44061000 */ mfc1 $a2, $f2
/* 1A93C 8003F53C 44821000 */ mtc1 $v0, $f2
/* 1A940 8003F540 00000000 */ nop
/* 1A944 8003F544 468010A0 */ cvt.s.w $f2, $f2
/* 1A948 8003F548 3C0140A0 */ lui $at, 0x40a0
/* 1A94C 8003F54C 44810000 */ mtc1 $at, $f0
/* 1A950 8003F550 44071000 */ mfc1 $a3, $f2
/* 1A954 8003F554 2403000F */ addiu $v1, $zero, 0xf
/* 1A958 8003F558 AFA30014 */ sw $v1, 0x14($sp)
/* 1A95C 8003F55C 0C01C5D4 */ jal func_80071750
/* 1A960 8003F560 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A964 8003F564 8FBF0024 */ lw $ra, 0x24($sp)
/* 1A968 8003F568 8FB20020 */ lw $s2, 0x20($sp)
/* 1A96C 8003F56C 8FB1001C */ lw $s1, 0x1c($sp)
/* 1A970 8003F570 8FB00018 */ lw $s0, 0x18($sp)
/* 1A974 8003F574 24020002 */ addiu $v0, $zero, 2
/* 1A978 8003F578 03E00008 */ jr $ra
/* 1A97C 8003F57C 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -38,6 +38,7 @@ void func_80027088(s32);
void func_8006FEF0(s32, f32, f32, f32, f32); void func_8006FEF0(s32, f32, f32, f32, f32);
void func_80071090(s32, f32, f32, f32, s32); void func_80071090(s32, f32, f32, f32, s32);
void func_80071750(s32, f32, f32, f32, f32, s32); void func_80071750(s32, f32, f32, f32, f32, s32);
void func_800720B0(s32, f32, f32, f32, f32, s32);
void func_80072950(s32, f32, f32, f32, f32, s32 time); void func_80072950(s32, f32, f32, f32, f32, s32 time);
void update_collider_transform(s16 colliderID); void update_collider_transform(s16 colliderID);

View File

@ -71,9 +71,11 @@ extern Npc* gPlayerNpcPtr;
extern s8 D_800A0900; extern s8 D_800A0900;
extern EncounterStatus gCurrentEncounter; extern EncounterStatus gCurrentEncounter;
extern s8* D_801512F0;
extern s16 D_80151308; extern s16 D_80151308;
extern s32 D_80151310; extern s32 D_80151310;
extern s16* D_80151328; extern s16* D_80151328;
extern s16 D_8010CD10; extern s16 D_8010CD10;
extern s16 D_8010CD12; extern s16 D_8010CD12;
extern s32 D_8010CD20; extern s32 D_8010CD20;
@ -118,6 +120,7 @@ extern s16 D_800A095E;
extern u8 D_800A095F; extern u8 D_800A095F;
extern s32 D_800A0960; extern s32 D_800A0960;
extern s32 D_800A0964; extern s32 D_800A0964;
extern s16 D_800A0BB8;
extern UIPanel gUIPanels[64]; extern UIPanel gUIPanels[64];

View File

@ -3,3 +3,4 @@ PyYAML
lark-parser lark-parser
python-ranges python-ranges
pypng pypng
colorama

View File

@ -1,5 +1,4 @@
ansiwrap ansiwrap
colorama
cxxfilt cxxfilt
python-Levenshtein python-Levenshtein
stringcase stringcase

View File

@ -56,7 +56,7 @@ ASSETS := \
title_data \ title_data \
party_kurio party_kameki party_pinki party_pareta party_resa party_akari party_opuku party_pokopi party_kurio party_kameki party_pinki party_pareta party_resa party_akari party_opuku party_pokopi
MESSAGES := $(shell find msg -type f -name "*.msg") MESSAGES := $(shell find msg -type f -name "*.msg" 2> /dev/null)
NPC_SPRITES := world_goombario world_kooper world_bombette world_parakarry world_bow world_watt world_sushi world_lakilester battle_goombario battle_kooper battle_bombette battle_parakarry battle_bow battle_watt battle_sushi 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 goompapa goombaria goomama goompa goomma 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 parada_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 NPC_SPRITES := world_goombario world_kooper world_bombette world_parakarry world_bow world_watt world_sushi world_lakilester battle_goombario battle_kooper battle_bombette battle_parakarry battle_bow battle_watt battle_sushi 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 goompapa goombaria goomama goompa goomma 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 parada_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

View File

@ -98,7 +98,32 @@ ApiStatus ResumeTakeTurn(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
INCLUDE_ASM(s32, "code_1A5830", BindIdle); ApiStatus BindIdle(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
ActorID actorID = get_variable(script, *args++);
Bytecode* idleCode;
Actor* actor;
ScriptInstance* newScriptContext;
if (actorID == ActorID_SELF) {
actorID = script->owner1.actorID;
}
idleCode = get_variable(script, *args++);
actor = get_actor(actorID);
if (actor->idleScript != 0) {
kill_script_by_ID(actor->idleScriptID);
actor->idleScript = 0;
}
actor->idleCode = idleCode;
newScriptContext = start_script(idleCode, 10, 0);
actor->idleScript = newScriptContext;
actor->idleScriptID = newScriptContext->id;
newScriptContext->owner1.actorID = actorID;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1A5830", EnableIdleScript); INCLUDE_ASM(s32, "code_1A5830", EnableIdleScript);

View File

@ -41,7 +41,19 @@ ApiStatus func_8003EECC(ScriptInstance* script, s32 isInitialCall) {
return (func_80045FA4() == 0) * ApiStatus_DONE2; return (func_80045FA4() == 0) * ApiStatus_DONE2;
} }
INCLUDE_ASM(s32, "code_1a1f0_len_5390", FadeBackgroundToBlack); ApiStatus FadeBackgroundToBlack(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall) {
func_8011D82C(1);
*D_801512F0 = 1;
set_background_color_blend(0, 0, 0, 0);
script->functionTemp[0].s = 25;
}
set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0].s) * 10) & 254);
script->functionTemp[0].s--;
do {} while (0);
return (script->functionTemp[0].s == 0) * ApiStatus_DONE2;
}
ApiStatus UnfadeBackgroundFromBlack(ScriptInstance* script, s32 isInitialCall) { ApiStatus UnfadeBackgroundFromBlack(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall) { if (isInitialCall) {
@ -76,11 +88,24 @@ ApiStatus func_8003F018(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F084); ApiStatus func_8003F084(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(-0xA);
npc->unk_AC -= 17;
if (npc->unk_AC == 0) {
npc->unk_AC = 0;
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F0C4); INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F0C4);
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F384); ApiStatus func_8003F384(ScriptInstance* script, s32 isInitialCall) {
D_800A0BB8 = 1;
return ApiStatus_DONE2;
}
ApiStatus GetCamLookAtObjVector(ScriptInstance* script, s32 isInitialCall) { ApiStatus GetCamLookAtObjVector(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = CURRENT_CAM->lookAt_obj.x; script->varTable[0] = CURRENT_CAM->lookAt_obj.x;
@ -99,9 +124,25 @@ ApiStatus HasMerleeCasts(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F414); ApiStatus func_8003F414(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var0 = get_variable(script, *args++);
s32 var1 = get_variable(script, *args++);
s32 var2 = get_variable(script, *args++);
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F4CC); func_800720B0(6, var0, var1, var2, 1.2f, 30);
return ApiStatus_DONE2;
}
ApiStatus func_8003F4CC(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var0 = get_variable(script, *args++);
s32 var1 = get_variable(script, *args++);
s32 var2 = get_variable(script, *args++);
func_80071750(9, var0, var1, var2, 5.0f, 15);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_1a1f0_len_5390", OnDefeatEnemy, ScriptInstance* script, s32 isInitialCall); INCLUDE_ASM(s32, "code_1a1f0_len_5390", OnDefeatEnemy, ScriptInstance* script, s32 isInitialCall);

View File

@ -215,7 +215,7 @@ INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80071FF0);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072050); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072050);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_800720B0); INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_800720B0, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072110); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072110);

Binary file not shown.

23
tools/iconv.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/python3
import argparse
import sys
parser = argparse.ArgumentParser(description='Convert a file from one encoding to another')
parser.add_argument("f")
parser.add_argument("t")
parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), default=sys.stdin)
parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'), default=sys.stdout)
args = parser.parse_args()
def main(args):
sys.stdin.reconfigure(encoding=args.f)
in_data = args.infile.read()
sys.stdout.reconfigure(encoding=args.t)
args.outfile.write(in_data)
if __name__ == "__main__":
main(parser.parse_args())

BIN
tools/mac/cc1 Executable file

Binary file not shown.

BIN
tools/mac/mips-nintendo-nu64-as Executable file

Binary file not shown.

@ -1 +1 @@
Subproject commit 33c1f8eb4ac4da83262eadb62fe9104470242ddd Subproject commit e0262202ef931e0a0d09a144fcded281d0dc1656

View File

@ -26,6 +26,7 @@ segments:
- type: code - type: code
start: 0x1000 start: 0x1000
vram: 0x80025C00 vram: 0x80025C00
subalign: 8
files: files:
- [0x1000, c, code_1000_len_60] - [0x1000, c, code_1000_len_60]
- [0x1060, c, code_1060_len_310] - [0x1060, c, code_1060_len_310]