Merge branch 'master' into master

This commit is contained in:
Josh 2020-08-14 20:37:33 -07:00 committed by GitHub
commit 541f8058e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 3758 additions and 2003 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "n64splitter"]
path = tools/n64splitter
url = https://github.com/ethteck/sm64tools.git
[submodule "tools/star-rod"]
path = tools/star-rod
url = https://github.com/nanaian/star-rod.git

View File

@ -9,6 +9,7 @@ BUILD_DIR = build
SRC_DIRS := src src/os
ASM_DIRS := asm asm/os
INCLUDE_DIRS := include include/PR
DATA_DIRS := bin
COMPRESSED_DIRS := yay0
MAP_DIRS := Map_Assets.FS
@ -17,6 +18,9 @@ BGM_DIRS := bgm
# Source code files
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
ifdef PM_HEADER_REBUILD
H_FILES := $(foreach dir,$(INCLUDE_DIRS),$(wildcard $(dir)/*.h))
endif
DATA_FILES := $(foreach dir,$(DATA_DIRS),$(wildcard $(dir)/*.bin))
COMPRESSED_FILES := $(foreach dir,$(COMPRESSED_DIRS),$(wildcard $(dir)/*.yay0))
MAP_FILES := $(foreach dir,$(MAP_DIRS),$(wildcard $(dir)/*.FS))
@ -67,7 +71,7 @@ LD_SCRIPT = $(TARGET).ld
all: $(BUILD_DIR) $(TARGET).z64 verify
clean:
rm -rf build $(TARGET).z64
rm -rf $(BUILD_DIR) $(TARGET).z64
submodules:
git submodule update --init --recursive
@ -83,7 +87,7 @@ setup: clean submodules n64split split
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
$(BUILD_DIR):
mkdir $(BUILD_DIR)
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/$(TARGET).elf: $(O_FILES) $(LD_SCRIPT)
@$(LD) $(LDFLAGS) -o $@ $(O_FILES)
@ -91,7 +95,7 @@ $(BUILD_DIR)/$(TARGET).elf: $(O_FILES) $(LD_SCRIPT)
$(BUILD_DIR)/%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(BUILD_DIR)/%.o: %.c
$(BUILD_DIR)/%.o: %.c $(H_FILES)
cpp $(CPPFLAGS) $< | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) - -o $@
$(BUILD_DIR)/%.o: %.bin

View File

@ -30,6 +30,7 @@ run `make setup` to set up tools and extract the rom
### Make
run `make` to rebuild the rom. Get `OK`? If so, you're all set! Otherwise, please feel free to reach out to us in the discord.
Use `PM_HEADER_REBUILD=1 make` to rebuild C sources when any header files change.
## FAQ
* If you received the following error when running `make setup`:

View File

@ -1,23 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel battle_heap_create
/* 0060A0 8002ACA0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0060A4 8002ACA4 AFBF0010 */ sw $ra, 0x10($sp)
/* 0060A8 8002ACA8 3C050002 */ lui $a1, 2
/* 0060AC 8002ACAC 3C04803E */ lui $a0, 0x803e
/* 0060B0 8002ACB0 2484A800 */ addiu $a0, $a0, -0x5800
/* 0060B4 8002ACB4 0C00A40C */ jal _heap_create
/* 0060B8 8002ACB8 34A55800 */ ori $a1, $a1, 0x5800
/* 0060BC 8002ACBC 0040202D */ daddu $a0, $v0, $zero
/* 0060C0 8002ACC0 2402FFFF */ addiu $v0, $zero, -1
/* 0060C4 8002ACC4 0040182D */ daddu $v1, $v0, $zero
/* 0060C8 8002ACC8 54830001 */ bnel $a0, $v1, .L8002ACD0
/* 0060CC 8002ACCC 0000102D */ daddu $v0, $zero, $zero
.L8002ACD0:
/* 0060D0 8002ACD0 8FBF0010 */ lw $ra, 0x10($sp)
/* 0060D4 8002ACD4 03E00008 */ jr $ra
/* 0060D8 8002ACD8 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 load_map_bg
/* 0DC470 80145D70 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0DC474 80145D74 AFBF001C */ sw $ra, 0x1c($sp)
/* 0DC478 80145D78 1080001B */ beqz $a0, .L80145DE8
/* 0DC47C 80145D7C AFB00018 */ sw $s0, 0x18($sp)
/* 0DC480 80145D80 0080802D */ daddu $s0, $a0, $zero
/* 0DC484 80145D84 0000202D */ daddu $a0, $zero, $zero
/* 0DC488 80145D88 3C05F5DE */ lui $a1, 0xf5de
/* 0DC48C 80145D8C 0C0B1EAF */ jal get_variable
/* 0DC490 80145D90 34A50180 */ ori $a1, $a1, 0x180
/* 0DC494 80145D94 28420035 */ slti $v0, $v0, 0x35
/* 0DC498 80145D98 1440000A */ bnez $v0, .L80145DC4
/* 0DC49C 80145D9C 0200202D */ daddu $a0, $s0, $zero
/* 0DC4A0 80145DA0 3C058015 */ lui $a1, 0x8015
/* 0DC4A4 80145DA4 24A5F120 */ addiu $a1, $a1, -0xee0
/* 0DC4A8 80145DA8 0C01BB5C */ jal strcmp
/* 0DC4AC 80145DAC 0200202D */ daddu $a0, $s0, $zero
/* 0DC4B0 80145DB0 54400004 */ bnel $v0, $zero, .L80145DC4
/* 0DC4B4 80145DB4 0200202D */ daddu $a0, $s0, $zero
/* 0DC4B8 80145DB8 3C108015 */ lui $s0, 0x8015
/* 0DC4BC 80145DBC 2610F128 */ addiu $s0, $s0, -0xed8
/* 0DC4C0 80145DC0 0200202D */ daddu $a0, $s0, $zero
.L80145DC4:
/* 0DC4C4 80145DC4 0C016B3A */ jal load_asset_by_name
/* 0DC4C8 80145DC8 27A50010 */ addiu $a1, $sp, 0x10
/* 0DC4CC 80145DCC 0040802D */ daddu $s0, $v0, $zero
/* 0DC4D0 80145DD0 3C058020 */ lui $a1, 0x8020
/* 0DC4D4 80145DD4 24A50000 */ addiu $a1, $a1, 0
/* 0DC4D8 80145DD8 0C01BB7C */ jal decode_yay0
/* 0DC4DC 80145DDC 0200202D */ daddu $a0, $s0, $zero
/* 0DC4E0 80145DE0 0C00AB1E */ jal general_heap_free
/* 0DC4E4 80145DE4 0200202D */ daddu $a0, $s0, $zero
.L80145DE8:
/* 0DC4E8 80145DE8 8FBF001C */ lw $ra, 0x1c($sp)
/* 0DC4EC 80145DEC 8FB00018 */ lw $s0, 0x18($sp)
/* 0DC4F0 80145DF0 03E00008 */ jr $ra
/* 0DC4F4 80145DF4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel DeleteTrigger
/* 0EB1D4 802C6824 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB1D8 802C6828 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB1DC 802C682C 8C82000C */ lw $v0, 0xc($a0)
/* 0EB1E0 802C6830 0C0B1EAF */ jal get_variable
/* 0EB1E4 802C6834 8C450000 */ lw $a1, ($v0)
/* 0EB1E8 802C6838 0C0516FD */ jal delete_trigger
/* 0EB1EC 802C683C 0040202D */ daddu $a0, $v0, $zero
/* 0EB1F0 802C6840 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB1F4 802C6844 24020002 */ addiu $v0, $zero, 2
/* 0EB1F8 802C6848 03E00008 */ jr $ra
/* 0EB1FC 802C684C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetEntryID
/* 0EEE10 802CA460 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EEE14 802CA464 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EEE18 802CA468 8C82000C */ lw $v0, 0xc($a0)
/* 0EEE1C 802CA46C 3C038007 */ lui $v1, 0x8007
/* 0EEE20 802CA470 8C63419C */ lw $v1, 0x419c($v1)
/* 0EEE24 802CA474 8C450000 */ lw $a1, ($v0)
/* 0EEE28 802CA478 0C0B2026 */ jal set_variable
/* 0EEE2C 802CA47C 8466008E */ lh $a2, 0x8e($v1)
/* 0EEE30 802CA480 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EEE34 802CA484 24020002 */ addiu $v0, $zero, 2
/* 0EEE38 802CA488 03E00008 */ jr $ra
/* 0EEE3C 802CA48C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetLoadType
/* 0EEE70 802CA4C0 3C028007 */ lui $v0, 0x8007
/* 0EEE74 802CA4C4 8C42419C */ lw $v0, 0x419c($v0)
/* 0EEE78 802CA4C8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EEE7C 802CA4CC AFBF0010 */ sw $ra, 0x10($sp)
/* 0EEE80 802CA4D0 8C83000C */ lw $v1, 0xc($a0)
/* 0EEE84 802CA4D4 90460167 */ lbu $a2, 0x167($v0)
/* 0EEE88 802CA4D8 8C650000 */ lw $a1, ($v1)
/* 0EEE8C 802CA4DC 0C0B2026 */ jal set_variable
/* 0EEE90 802CA4E0 0006302B */ sltu $a2, $zero, $a2
/* 0EEE94 802CA4E4 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EEE98 802CA4E8 24020002 */ addiu $v0, $zero, 2
/* 0EEE9C 802CA4EC 03E00008 */ jr $ra
/* 0EEEA0 802CA4F0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C6E14
/* 0EB7C4 802C6E14 03E00008 */ jr $ra
/* 0EB7C8 802C6E18 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_802C739C
/* 0EBD4C 802C739C 8C82000C */ lw $v0, 0xc($a0)
/* 0EBD50 802C73A0 8C420000 */ lw $v0, ($v0)
/* 0EBD54 802C73A4 AC820160 */ sw $v0, 0x160($a0)
/* 0EBD58 802C73A8 03E00008 */ jr $ra
/* 0EBD5C 802C73AC 24020002 */ addiu $v0, $zero, 2

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C73B0
/* 0EBD60 802C73B0 03E00008 */ jr $ra
/* 0EBD64 802C73B4 24020002 */ addiu $v0, $zero, 2

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C73B8
/* 0EBD68 802C73B8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EBD6C 802C73BC AFB10014 */ sw $s1, 0x14($sp)
/* 0EBD70 802C73C0 0080882D */ daddu $s1, $a0, $zero
/* 0EBD74 802C73C4 AFB00010 */ sw $s0, 0x10($sp)
/* 0EBD78 802C73C8 0000802D */ daddu $s0, $zero, $zero
/* 0EBD7C 802C73CC AFBF0018 */ sw $ra, 0x18($sp)
.L802C73D0:
/* 0EBD80 802C73D0 0C0B11E4 */ jal get_script_by_index
/* 0EBD84 802C73D4 0200202D */ daddu $a0, $s0, $zero
/* 0EBD88 802C73D8 12220004 */ beq $s1, $v0, .L802C73EC
/* 0EBD8C 802C73DC 26100001 */ addiu $s0, $s0, 1
/* 0EBD90 802C73E0 2A020080 */ slti $v0, $s0, 0x80
/* 0EBD94 802C73E4 1440FFFA */ bnez $v0, .L802C73D0
/* 0EBD98 802C73E8 00000000 */ nop
.L802C73EC:
/* 0EBD9C 802C73EC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EBDA0 802C73F0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EBDA4 802C73F4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EBDA8 802C73F8 24020001 */ addiu $v0, $zero, 1
/* 0EBDAC 802C73FC 03E00008 */ jr $ra
/* 0EBDB0 802C7400 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_break_case
/* 0EA084 802C56D4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA088 802C56D8 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA08C 802C56DC 0080802D */ daddu $s0, $a0, $zero
/* 0EA090 802C56E0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA094 802C56E4 82020007 */ lb $v0, 7($s0)
/* 0EA098 802C56E8 04410003 */ bgez $v0, .L802C56F8
/* 0EA09C 802C56EC 00000000 */ nop
.L802C56F0:
/* 0EA0A0 802C56F0 080B15BC */ j .L802C56F0
/* 0EA0A4 802C56F4 00000000 */ nop
.L802C56F8:
/* 0EA0A8 802C56F8 0C0B2279 */ jal si_goto_end_case
/* 0EA0AC 802C56FC 0200202D */ daddu $a0, $s0, $zero
/* 0EA0B0 802C5700 AE020008 */ sw $v0, 8($s0)
/* 0EA0B4 802C5704 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA0B8 802C5708 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA0BC 802C570C 24020002 */ addiu $v0, $zero, 2
/* 0EA0C0 802C5710 03E00008 */ jr $ra
/* 0EA0C4 802C5714 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_break_loop
/* 0E94BC 802C4B0C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E94C0 802C4B10 AFB00010 */ sw $s0, 0x10($sp)
/* 0E94C4 802C4B14 0080802D */ daddu $s0, $a0, $zero
/* 0E94C8 802C4B18 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E94CC 802C4B1C 82020006 */ lb $v0, 6($s0)
/* 0E94D0 802C4B20 04410003 */ bgez $v0, .L802C4B30
/* 0E94D4 802C4B24 00000000 */ nop
.L802C4B28:
/* 0E94D8 802C4B28 080B12CA */ j .L802C4B28
/* 0E94DC 802C4B2C 00000000 */ nop
.L802C4B30:
/* 0E94E0 802C4B30 0C0B22B9 */ jal si_goto_end_loop
/* 0E94E4 802C4B34 0200202D */ daddu $a0, $s0, $zero
/* 0E94E8 802C4B38 92030006 */ lbu $v1, 6($s0)
/* 0E94EC 802C4B3C AE020008 */ sw $v0, 8($s0)
/* 0E94F0 802C4B40 2463FFFF */ addiu $v1, $v1, -1
/* 0E94F4 802C4B44 A2030006 */ sb $v1, 6($s0)
/* 0E94F8 802C4B48 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E94FC 802C4B4C 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9500 802C4B50 24020002 */ addiu $v0, $zero, 2
/* 0E9504 802C4B54 03E00008 */ jr $ra
/* 0E9508 802C4B58 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_else
/* 0E98F0 802C4F40 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E98F4 802C4F44 AFB00010 */ sw $s0, 0x10($sp)
/* 0E98F8 802C4F48 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E98FC 802C4F4C 0C0B225E */ jal si_skip_else
/* 0E9900 802C4F50 0080802D */ daddu $s0, $a0, $zero
/* 0E9904 802C4F54 AE020008 */ sw $v0, 8($s0)
/* 0E9908 802C4F58 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E990C 802C4F5C 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9910 802C4F60 24020002 */ addiu $v0, $zero, 2
/* 0E9914 802C4F64 03E00008 */ jr $ra
/* 0E9918 802C4F68 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_child_thread
/* 0EB7A4 802C6DF4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB7A8 802C6DF8 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB7AC 802C6DFC 0C0B0FCF */ jal kill_script
/* 0EB7B0 802C6E00 00000000 */ nop
/* 0EB7B4 802C6E04 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB7B8 802C6E08 0000102D */ daddu $v0, $zero, $zero
/* 0EB7BC 802C6E0C 03E00008 */ jr $ra
/* 0EB7C0 802C6E10 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_if
/* 0E991C 802C4F6C 03E00008 */ jr $ra
/* 0E9920 802C4F70 24020002 */ addiu $v0, $zero, 2

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_thread
/* 0EB6FC 802C6D4C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB700 802C6D50 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB704 802C6D54 0C0B0FCF */ jal kill_script
/* 0EB708 802C6D58 00000000 */ nop
/* 0EB70C 802C6D5C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB710 802C6D60 240200FF */ addiu $v0, $zero, 0xff
/* 0EB714 802C6D64 03E00008 */ jr $ra
/* 0EB718 802C6D68 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,23 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_exec_wait
/* 0EAFAC 802C65FC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAFB0 802C6600 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAFB4 802C6604 0080802D */ daddu $s0, $a0, $zero
/* 0EAFB8 802C6608 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EAFBC 802C660C 8E02000C */ lw $v0, 0xc($s0)
/* 0EAFC0 802C6610 0C0B1EAF */ jal get_variable
/* 0EAFC4 802C6614 8C450000 */ lw $a1, ($v0)
/* 0EAFC8 802C6618 0200202D */ daddu $a0, $s0, $zero
/* 0EAFCC 802C661C 0040282D */ daddu $a1, $v0, $zero
/* 0EAFD0 802C6620 0C0B0DF2 */ jal start_child_script
/* 0EAFD4 802C6624 0000302D */ daddu $a2, $zero, $zero
/* 0EAFD8 802C6628 A2000002 */ sb $zero, 2($s0)
/* 0EAFDC 802C662C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EAFE0 802C6630 8FB00010 */ lw $s0, 0x10($sp)
/* 0EAFE4 802C6634 240200FF */ addiu $v0, $zero, 0xff
/* 0EAFE8 802C6638 03E00008 */ jr $ra
/* 0EAFEC 802C663C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_get_1_word
/* 0EA640 802C5C90 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA644 802C5C94 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EA648 802C5C98 8C83000C */ lw $v1, 0xc($a0)
/* 0EA64C 802C5C9C 8C820138 */ lw $v0, 0x138($a0)
/* 0EA650 802C5CA0 8C650000 */ lw $a1, ($v1)
/* 0EA654 802C5CA4 8C460000 */ lw $a2, ($v0)
/* 0EA658 802C5CA8 24420004 */ addiu $v0, $v0, 4
/* 0EA65C 802C5CAC 0C0B2026 */ jal set_variable
/* 0EA660 802C5CB0 AC820138 */ sw $v0, 0x138($a0)
/* 0EA664 802C5CB4 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EA668 802C5CB8 24020002 */ addiu $v0, $zero, 2
/* 0EA66C 802C5CBC 03E00008 */ jr $ra
/* 0EA670 802C5CC0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,28 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_get_Nth_word
/* 0EA80C 802C5E5C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA810 802C5E60 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA814 802C5E64 0080802D */ daddu $s0, $a0, $zero
/* 0EA818 802C5E68 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA81C 802C5E6C AFB10014 */ sw $s1, 0x14($sp)
/* 0EA820 802C5E70 8E02000C */ lw $v0, 0xc($s0)
/* 0EA824 802C5E74 8C450004 */ lw $a1, 4($v0)
/* 0EA828 802C5E78 0C0B1EAF */ jal get_variable
/* 0EA82C 802C5E7C 8C510000 */ lw $s1, ($v0)
/* 0EA830 802C5E80 0200202D */ daddu $a0, $s0, $zero
/* 0EA834 802C5E84 8C830138 */ lw $v1, 0x138($a0)
/* 0EA838 802C5E88 00021080 */ sll $v0, $v0, 2
/* 0EA83C 802C5E8C 00431021 */ addu $v0, $v0, $v1
/* 0EA840 802C5E90 8C460000 */ lw $a2, ($v0)
/* 0EA844 802C5E94 0C0B2026 */ jal set_variable
/* 0EA848 802C5E98 0220282D */ daddu $a1, $s1, $zero
/* 0EA84C 802C5E9C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA850 802C5EA0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA854 802C5EA4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA858 802C5EA8 24020002 */ addiu $v0, $zero, 2
/* 0EA85C 802C5EAC 03E00008 */ jr $ra
/* 0EA860 802C5EB0 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_goto
/* 0E9370 802C49C0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E9374 802C49C4 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9378 802C49C8 0080802D */ daddu $s0, $a0, $zero
/* 0E937C 802C49CC AFBF0014 */ sw $ra, 0x14($sp)
/* 0E9380 802C49D0 8E02000C */ lw $v0, 0xc($s0)
/* 0E9384 802C49D4 0C0B1EAF */ jal get_variable
/* 0E9388 802C49D8 8C450000 */ lw $a1, ($v0)
/* 0E938C 802C49DC 0200202D */ daddu $a0, $s0, $zero
/* 0E9390 802C49E0 0C0B2224 */ jal si_goto_label
/* 0E9394 802C49E4 0040282D */ daddu $a1, $v0, $zero
/* 0E9398 802C49E8 AE020008 */ sw $v0, 8($s0)
/* 0E939C 802C49EC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E93A0 802C49F0 8FB00010 */ lw $s0, 0x10($sp)
/* 0E93A4 802C49F4 24020002 */ addiu $v0, $zero, 2
/* 0E93A8 802C49F8 03E00008 */ jr $ra
/* 0E93AC 802C49FC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_AND
/* 0E9840 802C4E90 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E9844 802C4E94 AFB10014 */ sw $s1, 0x14($sp)
/* 0E9848 802C4E98 0080882D */ daddu $s1, $a0, $zero
/* 0E984C 802C4E9C AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9850 802C4EA0 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9854 802C4EA4 8E30000C */ lw $s0, 0xc($s1)
/* 0E9858 802C4EA8 8E050000 */ lw $a1, ($s0)
/* 0E985C 802C4EAC 0C0B1EAF */ jal get_variable
/* 0E9860 802C4EB0 26100004 */ addiu $s0, $s0, 4
/* 0E9864 802C4EB4 8E030000 */ lw $v1, ($s0)
/* 0E9868 802C4EB8 00431024 */ and $v0, $v0, $v1
/* 0E986C 802C4EBC 14400005 */ bnez $v0, .L802C4ED4
/* 0E9870 802C4EC0 24020002 */ addiu $v0, $zero, 2
/* 0E9874 802C4EC4 0C0B223F */ jal si_skip_if
/* 0E9878 802C4EC8 0220202D */ daddu $a0, $s1, $zero
/* 0E987C 802C4ECC AE220008 */ sw $v0, 8($s1)
/* 0E9880 802C4ED0 24020002 */ addiu $v0, $zero, 2
.L802C4ED4:
/* 0E9884 802C4ED4 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9888 802C4ED8 8FB10014 */ lw $s1, 0x14($sp)
/* 0E988C 802C4EDC 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9890 802C4EE0 03E00008 */ jr $ra
/* 0E9894 802C4EE4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_jump
/* 0EAFF0 802C6640 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAFF4 802C6644 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAFF8 802C6648 0080802D */ daddu $s0, $a0, $zero
/* 0EAFFC 802C664C AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB000 802C6650 8E02000C */ lw $v0, 0xc($s0)
/* 0EB004 802C6654 0C0B1EAF */ jal get_variable
/* 0EB008 802C6658 8C450000 */ lw $a1, ($v0)
/* 0EB00C 802C665C 0200202D */ daddu $a0, $s0, $zero
/* 0EB010 802C6660 0C0B0F41 */ jal restart_script
/* 0EB014 802C6664 AC82015C */ sw $v0, 0x15c($a0)
/* 0EB018 802C6668 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB01C 802C666C 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB020 802C6670 24020002 */ addiu $v0, $zero, 2
/* 0EB024 802C6674 03E00008 */ jr $ra
/* 0EB028 802C6678 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_kill
/* 0EB220 802C6870 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB224 802C6874 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB228 802C6878 8C82000C */ lw $v0, 0xc($a0)
/* 0EB22C 802C687C 0C0B1EAF */ jal get_variable
/* 0EB230 802C6880 8C450000 */ lw $a1, ($v0)
/* 0EB234 802C6884 0C0B102B */ jal kill_script_by_ID
/* 0EB238 802C6888 0040202D */ daddu $a0, $v0, $zero
/* 0EB23C 802C688C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB240 802C6890 24020002 */ addiu $v0, $zero, 2
/* 0EB244 802C6894 03E00008 */ jr $ra
/* 0EB248 802C6898 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_label
/* 0E9368 802C49B8 03E00008 */ jr $ra
/* 0E936C 802C49BC 24020002 */ addiu $v0, $zero, 2

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_resume
/* 0EB3FC 802C6A4C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB400 802C6A50 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB404 802C6A54 8C82000C */ lw $v0, 0xc($a0)
/* 0EB408 802C6A58 0C0B1EAF */ jal get_variable
/* 0EB40C 802C6A5C 8C450000 */ lw $a1, ($v0)
/* 0EB410 802C6A60 0C0B1123 */ jal resume_all_script
/* 0EB414 802C6A64 0040202D */ daddu $a0, $v0, $zero
/* 0EB418 802C6A68 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB41C 802C6A6C 24020002 */ addiu $v0, $zero, 2
/* 0EB420 802C6A70 03E00008 */ jr $ra
/* 0EB424 802C6A74 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_resume_all
/* 0EB32C 802C697C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB330 802C6980 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB334 802C6984 8C82000C */ lw $v0, 0xc($a0)
/* 0EB338 802C6988 0C0B1EAF */ jal get_variable
/* 0EB33C 802C698C 8C450000 */ lw $a1, ($v0)
/* 0EB340 802C6990 0C0B1192 */ jal resume_all_group
/* 0EB344 802C6994 0040202D */ daddu $a0, $v0, $zero
/* 0EB348 802C6998 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB34C 802C699C 24020002 */ addiu $v0, $zero, 2
/* 0EB350 802C69A0 03E00008 */ jr $ra
/* 0EB354 802C69A4 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 si_handle_resume_others
/* 0EB394 802C69E4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB398 802C69E8 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB39C 802C69EC 0080802D */ daddu $s0, $a0, $zero
/* 0EB3A0 802C69F0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB3A4 802C69F4 8E02000C */ lw $v0, 0xc($s0)
/* 0EB3A8 802C69F8 0C0B1EAF */ jal get_variable
/* 0EB3AC 802C69FC 8C450000 */ lw $a1, ($v0)
/* 0EB3B0 802C6A00 0200202D */ daddu $a0, $s0, $zero
/* 0EB3B4 802C6A04 0C0B11C7 */ jal resume_group_others
/* 0EB3B8 802C6A08 0040282D */ daddu $a1, $v0, $zero
/* 0EB3BC 802C6A0C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB3C0 802C6A10 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB3C4 802C6A14 24020002 */ addiu $v0, $zero, 2
/* 0EB3C8 802C6A18 03E00008 */ jr $ra
/* 0EB3CC 802C6A1C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_return
/* 0E9348 802C4998 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E934C 802C499C AFBF0010 */ sw $ra, 0x10($sp)
/* 0E9350 802C49A0 0C0B0FCF */ jal kill_script
/* 0E9354 802C49A4 00000000 */ nop
/* 0E9358 802C49A8 8FBF0010 */ lw $ra, 0x10($sp)
/* 0E935C 802C49AC 240200FF */ addiu $v0, $zero, 0xff
/* 0E9360 802C49B0 03E00008 */ jr $ra
/* 0E9364 802C49B4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_array
/* 0EAB5C 802C61AC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAB60 802C61B0 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAB64 802C61B4 0080802D */ daddu $s0, $a0, $zero
/* 0EAB68 802C61B8 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EAB6C 802C61BC 8E02000C */ lw $v0, 0xc($s0)
/* 0EAB70 802C61C0 0C0B1EAF */ jal get_variable
/* 0EAB74 802C61C4 8C450000 */ lw $a1, ($v0)
/* 0EAB78 802C61C8 AE02013C */ sw $v0, 0x13c($s0)
/* 0EAB7C 802C61CC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EAB80 802C61D0 8FB00010 */ lw $s0, 0x10($sp)
/* 0EAB84 802C61D4 24020002 */ addiu $v0, $zero, 2
/* 0EAB88 802C61D8 03E00008 */ jr $ra
/* 0EAB8C 802C61DC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_const
/* 0EA140 802C5790 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA144 802C5794 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EA148 802C5798 8C82000C */ lw $v0, 0xc($a0)
/* 0EA14C 802C579C 8C450000 */ lw $a1, ($v0)
/* 0EA150 802C57A0 0C0B2026 */ jal set_variable
/* 0EA154 802C57A4 8C460004 */ lw $a2, 4($v0)
/* 0EA158 802C57A8 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EA15C 802C57AC 24020002 */ addiu $v0, $zero, 2
/* 0EA160 802C57B0 03E00008 */ jr $ra
/* 0EA164 802C57B4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_flag_array
/* 0EAB90 802C61E0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAB94 802C61E4 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAB98 802C61E8 0080802D */ daddu $s0, $a0, $zero
/* 0EAB9C 802C61EC AFBF0014 */ sw $ra, 0x14($sp)
/* 0EABA0 802C61F0 8E02000C */ lw $v0, 0xc($s0)
/* 0EABA4 802C61F4 0C0B1EAF */ jal get_variable
/* 0EABA8 802C61F8 8C450000 */ lw $a1, ($v0)
/* 0EABAC 802C61FC AE020140 */ sw $v0, 0x140($s0)
/* 0EABB0 802C6200 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EABB4 802C6204 8FB00010 */ lw $s0, 0x10($sp)
/* 0EABB8 802C6208 24020002 */ addiu $v0, $zero, 2
/* 0EABBC 802C620C 03E00008 */ jr $ra
/* 0EABC0 802C6210 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_float
/* 0EA168 802C57B8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA16C 802C57BC AFB00010 */ sw $s0, 0x10($sp)
/* 0EA170 802C57C0 0080802D */ daddu $s0, $a0, $zero
/* 0EA174 802C57C4 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA178 802C57C8 AFB10014 */ sw $s1, 0x14($sp)
/* 0EA17C 802C57CC 8E02000C */ lw $v0, 0xc($s0)
/* 0EA180 802C57D0 8C450004 */ lw $a1, 4($v0)
/* 0EA184 802C57D4 0C0B210B */ jal get_float_variable
/* 0EA188 802C57D8 8C510000 */ lw $s1, ($v0)
/* 0EA18C 802C57DC 0200202D */ daddu $a0, $s0, $zero
/* 0EA190 802C57E0 44060000 */ mfc1 $a2, $f0
/* 0EA194 802C57E4 0C0B2190 */ jal set_float_variable
/* 0EA198 802C57E8 0220282D */ daddu $a1, $s1, $zero
/* 0EA19C 802C57EC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA1A0 802C57F0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA1A4 802C57F4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA1A8 802C57F8 24020002 */ addiu $v0, $zero, 2
/* 0EA1AC 802C57FC 03E00008 */ jr $ra
/* 0EA1B0 802C5800 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_float_buffer_ptr
/* 0EA60C 802C5C5C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA610 802C5C60 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA614 802C5C64 0080802D */ daddu $s0, $a0, $zero
/* 0EA618 802C5C68 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA61C 802C5C6C 8E02000C */ lw $v0, 0xc($s0)
/* 0EA620 802C5C70 0C0B1EAF */ jal get_variable
/* 0EA624 802C5C74 8C450000 */ lw $a1, ($v0)
/* 0EA628 802C5C78 AE020138 */ sw $v0, 0x138($s0)
/* 0EA62C 802C5C7C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA630 802C5C80 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA634 802C5C84 24020002 */ addiu $v0, $zero, 2
/* 0EA638 802C5C88 03E00008 */ jr $ra
/* 0EA63C 802C5C8C 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 si_handle_set_group
/* 0EB2C4 802C6914 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB2C8 802C6918 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB2CC 802C691C 0080802D */ daddu $s0, $a0, $zero
/* 0EB2D0 802C6920 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB2D4 802C6924 8E02000C */ lw $v0, 0xc($s0)
/* 0EB2D8 802C6928 0C0B1EAF */ jal get_variable
/* 0EB2DC 802C692C 8C450000 */ lw $a1, ($v0)
/* 0EB2E0 802C6930 0200202D */ daddu $a0, $s0, $zero
/* 0EB2E4 802C6934 0C0B1086 */ jal set_script_group
/* 0EB2E8 802C6938 0040282D */ daddu $a1, $v0, $zero
/* 0EB2EC 802C693C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB2F0 802C6940 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB2F4 802C6944 24020002 */ addiu $v0, $zero, 2
/* 0EB2F8 802C6948 03E00008 */ jr $ra
/* 0EB2FC 802C694C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_int_buffer_ptr
/* 0EA5D8 802C5C28 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA5DC 802C5C2C AFB00010 */ sw $s0, 0x10($sp)
/* 0EA5E0 802C5C30 0080802D */ daddu $s0, $a0, $zero
/* 0EA5E4 802C5C34 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA5E8 802C5C38 8E02000C */ lw $v0, 0xc($s0)
/* 0EA5EC 802C5C3C 0C0B1EAF */ jal get_variable
/* 0EA5F0 802C5C40 8C450000 */ lw $a1, ($v0)
/* 0EA5F4 802C5C44 AE020138 */ sw $v0, 0x138($s0)
/* 0EA5F8 802C5C48 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA5FC 802C5C4C 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA600 802C5C50 24020002 */ addiu $v0, $zero, 2
/* 0EA604 802C5C54 03E00008 */ jr $ra
/* 0EA608 802C5C58 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 si_handle_set_priority
/* 0EB24C 802C689C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB250 802C68A0 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB254 802C68A4 0080802D */ daddu $s0, $a0, $zero
/* 0EB258 802C68A8 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB25C 802C68AC 8E02000C */ lw $v0, 0xc($s0)
/* 0EB260 802C68B0 0C0B1EAF */ jal get_variable
/* 0EB264 802C68B4 8C450000 */ lw $a1, ($v0)
/* 0EB268 802C68B8 0200202D */ daddu $a0, $s0, $zero
/* 0EB26C 802C68BC 0C0B1076 */ jal set_script_priority
/* 0EB270 802C68C0 0040282D */ daddu $a1, $v0, $zero
/* 0EB274 802C68C4 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB278 802C68C8 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB27C 802C68CC 24020002 */ addiu $v0, $zero, 2
/* 0EB280 802C68D0 03E00008 */ jr $ra
/* 0EB284 802C68D4 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 si_handle_set_timescale
/* 0EB288 802C68D8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB28C 802C68DC AFB00010 */ sw $s0, 0x10($sp)
/* 0EB290 802C68E0 0080802D */ daddu $s0, $a0, $zero
/* 0EB294 802C68E4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB298 802C68E8 8E02000C */ lw $v0, 0xc($s0)
/* 0EB29C 802C68EC 0C0B210B */ jal get_float_variable
/* 0EB2A0 802C68F0 8C450000 */ lw $a1, ($v0)
/* 0EB2A4 802C68F4 44050000 */ mfc1 $a1, $f0
/* 0EB2A8 802C68F8 0C0B1078 */ jal set_script_timescale
/* 0EB2AC 802C68FC 0200202D */ daddu $a0, $s0, $zero
/* 0EB2B0 802C6900 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB2B4 802C6904 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB2B8 802C6908 24020002 */ addiu $v0, $zero, 2
/* 0EB2BC 802C690C 03E00008 */ jr $ra
/* 0EB2C0 802C6910 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_var
/* 0EA0F4 802C5744 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA0F8 802C5748 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA0FC 802C574C 0080802D */ daddu $s0, $a0, $zero
/* 0EA100 802C5750 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA104 802C5754 AFB10014 */ sw $s1, 0x14($sp)
/* 0EA108 802C5758 8E02000C */ lw $v0, 0xc($s0)
/* 0EA10C 802C575C 8C450004 */ lw $a1, 4($v0)
/* 0EA110 802C5760 0C0B1EAF */ jal get_variable
/* 0EA114 802C5764 8C510000 */ lw $s1, ($v0)
/* 0EA118 802C5768 0200202D */ daddu $a0, $s0, $zero
/* 0EA11C 802C576C 0220282D */ daddu $a1, $s1, $zero
/* 0EA120 802C5770 0C0B2026 */ jal set_variable
/* 0EA124 802C5774 0040302D */ daddu $a2, $v0, $zero
/* 0EA128 802C5778 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA12C 802C577C 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA130 802C5780 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA134 802C5784 24020002 */ addiu $v0, $zero, 2
/* 0EA138 802C5788 03E00008 */ jr $ra
/* 0EA13C 802C578C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_suspend
/* 0EB3D0 802C6A20 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB3D4 802C6A24 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB3D8 802C6A28 8C82000C */ lw $v0, 0xc($a0)
/* 0EB3DC 802C6A2C 0C0B1EAF */ jal get_variable
/* 0EB3E0 802C6A30 8C450000 */ lw $a1, ($v0)
/* 0EB3E4 802C6A34 0C0B1108 */ jal suspend_all_script
/* 0EB3E8 802C6A38 0040202D */ daddu $a0, $v0, $zero
/* 0EB3EC 802C6A3C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB3F0 802C6A40 24020002 */ addiu $v0, $zero, 2
/* 0EB3F4 802C6A44 03E00008 */ jr $ra
/* 0EB3F8 802C6A48 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_suspend_all
/* 0EB300 802C6950 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB304 802C6954 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB308 802C6958 8C82000C */ lw $v0, 0xc($a0)
/* 0EB30C 802C695C 0C0B1EAF */ jal get_variable
/* 0EB310 802C6960 8C450000 */ lw $a1, ($v0)
/* 0EB314 802C6964 0C0B117A */ jal suspend_all_group
/* 0EB318 802C6968 0040202D */ daddu $a0, $v0, $zero
/* 0EB31C 802C696C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB320 802C6970 24020002 */ addiu $v0, $zero, 2
/* 0EB324 802C6974 03E00008 */ jr $ra
/* 0EB328 802C6978 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 si_handle_suspend_others
/* 0EB358 802C69A8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB35C 802C69AC AFB00010 */ sw $s0, 0x10($sp)
/* 0EB360 802C69B0 0080802D */ daddu $s0, $a0, $zero
/* 0EB364 802C69B4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB368 802C69B8 8E02000C */ lw $v0, 0xc($s0)
/* 0EB36C 802C69BC 0C0B1EAF */ jal get_variable
/* 0EB370 802C69C0 8C450000 */ lw $a1, ($v0)
/* 0EB374 802C69C4 0200202D */ daddu $a0, $s0, $zero
/* 0EB378 802C69C8 0C0B11AA */ jal suspend_group_others
/* 0EB37C 802C69CC 0040282D */ daddu $a1, $v0, $zero
/* 0EB380 802C69D0 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB384 802C69D4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB388 802C69D8 24020002 */ addiu $v0, $zero, 2
/* 0EB38C 802C69DC 03E00008 */ jr $ra
/* 0EB390 802C69E0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_unbind
/* 0EB200 802C6850 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB204 802C6854 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB208 802C6858 0C0516FD */ jal delete_trigger
/* 0EB20C 802C685C 8C84014C */ lw $a0, 0x14c($a0)
/* 0EB210 802C6860 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB214 802C6864 24020002 */ addiu $v0, $zero, 2
/* 0EB218 802C6868 03E00008 */ jr $ra
/* 0EB21C 802C686C 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 UpdateLerp
/* 0F8FDC 802D462C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0F8FE0 802D4630 AFB00018 */ sw $s0, 0x18($sp)
/* 0F8FE4 802D4634 0080802D */ daddu $s0, $a0, $zero
/* 0F8FE8 802D4638 AFBF001C */ sw $ra, 0x1c($sp)
/* 0F8FEC 802D463C C60200B4 */ lwc1 $f2, 0xb4($s0)
/* 0F8FF0 802D4640 468010A0 */ cvt.s.w $f2, $f2
/* 0F8FF4 802D4644 C60000B8 */ lwc1 $f0, 0xb8($s0)
/* 0F8FF8 802D4648 46800020 */ cvt.s.w $f0, $f0
/* 0F8FFC 802D464C 8E0200C0 */ lw $v0, 0xc0($s0)
/* 0F9000 802D4650 44051000 */ mfc1 $a1, $f2
/* 0F9004 802D4654 44060000 */ mfc1 $a2, $f0
/* 0F9008 802D4658 AFA20010 */ sw $v0, 0x10($sp)
/* 0F900C 802D465C 8E0400B0 */ lw $a0, 0xb0($s0)
/* 0F9010 802D4660 0C00A8ED */ jal update_lerp
/* 0F9014 802D4664 8E0700BC */ lw $a3, 0xbc($s0)
/* 0F9018 802D4668 8E0200BC */ lw $v0, 0xbc($s0)
/* 0F901C 802D466C 8E0300C0 */ lw $v1, 0xc0($s0)
/* 0F9020 802D4670 4600010D */ trunc.w.s $f4, $f0
/* 0F9024 802D4674 E6040084 */ swc1 $f4, 0x84($s0)
/* 0F9028 802D4678 0043102A */ slt $v0, $v0, $v1
/* 0F902C 802D467C 14400003 */ bnez $v0, .L802D468C
/* 0F9030 802D4680 24020001 */ addiu $v0, $zero, 1
/* 0F9034 802D4684 080B51A4 */ j .L802D4690
/* 0F9038 802D4688 AE000088 */ sw $zero, 0x88($s0)
.L802D468C:
/* 0F903C 802D468C AE020088 */ sw $v0, 0x88($s0)
.L802D4690:
/* 0F9040 802D4690 8E0200BC */ lw $v0, 0xbc($s0)
/* 0F9044 802D4694 24420001 */ addiu $v0, $v0, 1
/* 0F9048 802D4698 AE0200BC */ sw $v0, 0xbc($s0)
/* 0F904C 802D469C 8FBF001C */ lw $ra, 0x1c($sp)
/* 0F9050 802D46A0 8FB00018 */ lw $s0, 0x18($sp)
/* 0F9054 802D46A4 24020002 */ addiu $v0, $zero, 2
/* 0F9058 802D46A8 03E00008 */ jr $ra
/* 0F905C 802D46AC 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,24 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel CountFortessKeys
/* 0FB5FC 802D6C4C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0FB600 802D6C50 AFB00010 */ sw $s0, 0x10($sp)
/* 0FB604 802D6C54 0080802D */ daddu $s0, $a0, $zero
/* 0FB608 802D6C58 AFBF0018 */ sw $ra, 0x18($sp)
/* 0FB60C 802D6C5C AFB10014 */ sw $s1, 0x14($sp)
/* 0FB610 802D6C60 8E02000C */ lw $v0, 0xc($s0)
/* 0FB614 802D6C64 0C03A8F9 */ jal get_fortress_key_count
/* 0FB618 802D6C68 8C510000 */ lw $s1, ($v0)
/* 0FB61C 802D6C6C 0200202D */ daddu $a0, $s0, $zero
/* 0FB620 802D6C70 0040302D */ daddu $a2, $v0, $zero
/* 0FB624 802D6C74 0C0B2026 */ jal set_variable
/* 0FB628 802D6C78 0220282D */ daddu $a1, $s1, $zero
/* 0FB62C 802D6C7C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0FB630 802D6C80 8FB10014 */ lw $s1, 0x14($sp)
/* 0FB634 802D6C84 8FB00010 */ lw $s0, 0x10($sp)
/* 0FB638 802D6C88 24020002 */ addiu $v0, $zero, 2
/* 0FB63C 802D6C8C 03E00008 */ jr $ra
/* 0FB640 802D6C90 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,42 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel FindItem
/* 0FB4C8 802D6B18 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0FB4CC 802D6B1C AFB10014 */ sw $s1, 0x14($sp)
/* 0FB4D0 802D6B20 0080882D */ daddu $s1, $a0, $zero
/* 0FB4D4 802D6B24 AFBF0018 */ sw $ra, 0x18($sp)
/* 0FB4D8 802D6B28 AFB00010 */ sw $s0, 0x10($sp)
/* 0FB4DC 802D6B2C 8E30000C */ lw $s0, 0xc($s1)
/* 0FB4E0 802D6B30 8E050000 */ lw $a1, ($s0)
/* 0FB4E4 802D6B34 0C0B1EAF */ jal get_variable
/* 0FB4E8 802D6B38 26100004 */ addiu $s0, $s0, 4
/* 0FB4EC 802D6B3C 0040302D */ daddu $a2, $v0, $zero
/* 0FB4F0 802D6B40 0000182D */ daddu $v1, $zero, $zero
/* 0FB4F4 802D6B44 3C048011 */ lui $a0, 0x8011
/* 0FB4F8 802D6B48 2484F290 */ addiu $a0, $a0, -0xd70
/* 0FB4FC 802D6B4C 8E050000 */ lw $a1, ($s0)
.L802D6B50:
/* 0FB500 802D6B50 848201B4 */ lh $v0, 0x1b4($a0)
/* 0FB504 802D6B54 10460006 */ beq $v0, $a2, .L802D6B70
/* 0FB508 802D6B58 2402000A */ addiu $v0, $zero, 0xa
/* 0FB50C 802D6B5C 24630001 */ addiu $v1, $v1, 1
/* 0FB510 802D6B60 2862000A */ slti $v0, $v1, 0xa
/* 0FB514 802D6B64 1440FFFA */ bnez $v0, .L802D6B50
/* 0FB518 802D6B68 24840002 */ addiu $a0, $a0, 2
/* 0FB51C 802D6B6C 2402000A */ addiu $v0, $zero, 0xa
.L802D6B70:
/* 0FB520 802D6B70 10620002 */ beq $v1, $v0, .L802D6B7C
/* 0FB524 802D6B74 2406FFFF */ addiu $a2, $zero, -1
/* 0FB528 802D6B78 0060302D */ daddu $a2, $v1, $zero
.L802D6B7C:
/* 0FB52C 802D6B7C 0C0B2026 */ jal set_variable
/* 0FB530 802D6B80 0220202D */ daddu $a0, $s1, $zero
/* 0FB534 802D6B84 8FBF0018 */ lw $ra, 0x18($sp)
/* 0FB538 802D6B88 8FB10014 */ lw $s1, 0x14($sp)
/* 0FB53C 802D6B8C 8FB00010 */ lw $s0, 0x10($sp)
/* 0FB540 802D6B90 24020002 */ addiu $v0, $zero, 2
/* 0FB544 802D6B94 03E00008 */ jr $ra
/* 0FB548 802D6B98 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel RemoveFortressKeys
/* 0FB644 802D6C94 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0FB648 802D6C98 AFBF0010 */ sw $ra, 0x10($sp)
/* 0FB64C 802D6C9C 8C82000C */ lw $v0, 0xc($a0)
/* 0FB650 802D6CA0 0C0B1EAF */ jal get_variable
/* 0FB654 802D6CA4 8C450000 */ lw $a1, ($v0)
/* 0FB658 802D6CA8 0C03A8EE */ jal subtract_fortress_keys
/* 0FB65C 802D6CAC 0040202D */ daddu $a0, $v0, $zero
/* 0FB660 802D6CB0 8FBF0010 */ lw $ra, 0x10($sp)
/* 0FB664 802D6CB4 24020002 */ addiu $v0, $zero, 2
/* 0FB668 802D6CB8 03E00008 */ jr $ra
/* 0FB66C 802D6CBC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,54 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel RemoveItem
/* 0FB54C 802D6B9C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0FB550 802D6BA0 AFB10014 */ sw $s1, 0x14($sp)
/* 0FB554 802D6BA4 0080882D */ daddu $s1, $a0, $zero
/* 0FB558 802D6BA8 AFBF001C */ sw $ra, 0x1c($sp)
/* 0FB55C 802D6BAC AFB20018 */ sw $s2, 0x18($sp)
/* 0FB560 802D6BB0 AFB00010 */ sw $s0, 0x10($sp)
/* 0FB564 802D6BB4 8E30000C */ lw $s0, 0xc($s1)
/* 0FB568 802D6BB8 8E050000 */ lw $a1, ($s0)
/* 0FB56C 802D6BBC 0C0B1EAF */ jal get_variable
/* 0FB570 802D6BC0 26100004 */ addiu $s0, $s0, 4
/* 0FB574 802D6BC4 0040282D */ daddu $a1, $v0, $zero
/* 0FB578 802D6BC8 0000182D */ daddu $v1, $zero, $zero
/* 0FB57C 802D6BCC 3C068011 */ lui $a2, 0x8011
/* 0FB580 802D6BD0 24C6F290 */ addiu $a2, $a2, -0xd70
/* 0FB584 802D6BD4 00C0202D */ daddu $a0, $a2, $zero
/* 0FB588 802D6BD8 8E120000 */ lw $s2, ($s0)
.L802D6BDC:
/* 0FB58C 802D6BDC 848201B4 */ lh $v0, 0x1b4($a0)
/* 0FB590 802D6BE0 10450006 */ beq $v0, $a1, .L802D6BFC
/* 0FB594 802D6BE4 2402000A */ addiu $v0, $zero, 0xa
/* 0FB598 802D6BE8 24630001 */ addiu $v1, $v1, 1
/* 0FB59C 802D6BEC 2862000A */ slti $v0, $v1, 0xa
/* 0FB5A0 802D6BF0 1440FFFA */ bnez $v0, .L802D6BDC
/* 0FB5A4 802D6BF4 24840002 */ addiu $a0, $a0, 2
/* 0FB5A8 802D6BF8 2402000A */ addiu $v0, $zero, 0xa
.L802D6BFC:
/* 0FB5AC 802D6BFC 10620002 */ beq $v1, $v0, .L802D6C08
/* 0FB5B0 802D6C00 2410FFFF */ addiu $s0, $zero, -1
/* 0FB5B4 802D6C04 0060802D */ daddu $s0, $v1, $zero
.L802D6C08:
/* 0FB5B8 802D6C08 06000003 */ bltz $s0, .L802D6C18
/* 0FB5BC 802D6C0C 00031040 */ sll $v0, $v1, 1
/* 0FB5C0 802D6C10 00461021 */ addu $v0, $v0, $a2
/* 0FB5C4 802D6C14 A44001B4 */ sh $zero, 0x1b4($v0)
.L802D6C18:
/* 0FB5C8 802D6C18 0C039DB3 */ jal sort_items
/* 0FB5CC 802D6C1C 00000000 */ nop
/* 0FB5D0 802D6C20 0220202D */ daddu $a0, $s1, $zero
/* 0FB5D4 802D6C24 0240282D */ daddu $a1, $s2, $zero
/* 0FB5D8 802D6C28 0C0B2026 */ jal set_variable
/* 0FB5DC 802D6C2C 0200302D */ daddu $a2, $s0, $zero
/* 0FB5E0 802D6C30 8FBF001C */ lw $ra, 0x1c($sp)
/* 0FB5E4 802D6C34 8FB20018 */ lw $s2, 0x18($sp)
/* 0FB5E8 802D6C38 8FB10014 */ lw $s1, 0x14($sp)
/* 0FB5EC 802D6C3C 8FB00010 */ lw $s0, 0x10($sp)
/* 0FB5F0 802D6C40 24020002 */ addiu $v0, $zero, 2
/* 0FB5F4 802D6C44 03E00008 */ jr $ra
/* 0FB5F8 802D6C48 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -7,6 +7,6 @@
#include "functions.h"
#include "variables.h"
#include "macros.h"
#include "items.h"
#include "enums.h"
#endif

File diff suppressed because it is too large Load Diff

1431
include/enums.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
#include "ultra64.h"
#include "common_structs.h"
#include "enums.h"
void osCleanupThread(void);
@ -10,6 +11,8 @@ void clone_model(u16 srcModelID, u16 newModelID);
void update_collider_transform(s16 colliderID);
s32 get_variable(script_context* script, s32 pos);
f32 get_float_variable(script_context* script, s32 pos);
f32 set_float_variable(script_context* script, s32 dest, f32 value);
void set_script_timescale(script_context* script, f32 timescale);
f32 sin_deg(f32 x);
f32 cos_deg(f32 x);
s32 func_80055448(s32);
@ -19,6 +22,10 @@ s32 func_800554E8(s32, s32);
s32 func_800555E4(s32);
void func_80137D88(s32, f32);
void func_80137E10(s32, u8, u8, u8);
s32 rand_int(s32);
void sort_items(void);
s32 is_ability_active(s32 arg0);
f32 update_lerp(EASING easing, f32 start, f32 end, s32 elapsed, s32 duration);
s32 play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ);
s32 set_music_track(s32 musicPlayer, s32 songID, s32 variation, s32 unk, s32 volume);

View File

@ -1,367 +0,0 @@
#ifndef _ITEMS_H_
#define _ITEMS_H_
#include "ultra64.h"
#include "types.h"
typedef enum eItem {
JUMP = 0x0001,
SPIN_JUMP = 0x0002,
TORNADO_JUMP = 0x0003,
HAMMER = 0x0004,
SUPER_HAMMER = 0x0005,
ULTRA_HAMMER = 0x0006,
LUCKY_STAR = 0x0007,
MAP = 0x0008, // unused
BIG_MAP = 0x0009, // unused
FIRST_DEGREE_CARD = 0x000A,
SECOND_DEGREE_CARD = 0x000B,
THIRD_DEGREE_CARD = 0x000C,
FOURTH_DEGREE_CARD = 0x000D,
DIPLOMA = 0x000E,
ULTRA_STONE = 0x000F,
FORTRESS_KEY = 0x0010,
RUINS_KEY = 0x0011,
PULSE_STONE = 0x0012,
CASTLE_KEY1 = 0x0013,
PALACE_KEY = 0x0014,
LUNAR_STONE = 0x0015,
PYRAMID_STONE = 0x0016,
DIAMOND_STONE = 0x0017,
GOLDEN_VASE = 0x0018, // unused
KOOPERS_SHELL = 0x0019,
CASTLE_KEY2 = 0x001A,
FOREST_PASS = 0x001B, // unused
WEIGHT = 0x001C,
BOOS_PORTRAIT = 0x001D,
CRYSTAL_BERRY = 0x001E,
MYSTICAL_KEY = 0x001F,
STOREROOM_KEY = 0x0020,
TOY_TRAIN = 0x0021,
RECORD = 0x0022,
FRYING_PAN = 0x0023,
DICTIONARY = 0x0024,
MYSTERY_NOTE = 0x0025,
SUSPICIOUS_NOTE = 0x0026, // unused
CRYSTAL_BALL = 0x0027,
SCREWDRIVER = 0x0028, // unused
COOKBOOK = 0x0029,
JADE_RAVEN = 0x002A,
MAGICAL_SEED1 = 0x002B,
MAGICAL_SEED2 = 0x002C,
MAGICAL_SEED3 = 0x002D,
MAGICAL_SEED4 = 0x002E,
TOAD_DOLL = 0x002F, // unused
CALCULATOR = 0x0030,
BUCKET = 0x0031,
SCARF = 0x0032,
RED_KEY = 0x0033,
BLUE_KEY = 0x0034,
LETTER01 = 0x0036,
LETTER02 = 0x0037,
LETTER03 = 0x0038,
LETTER04 = 0x0039,
LETTER05 = 0x003A,
LETTER06 = 0x003B,
LETTER07 = 0x003C,
LETTER08 = 0x003D,
LETTER09 = 0x003E,
LETTER10 = 0x0040,
LETTER11 = 0x0041,
LETTER12 = 0x0045,
LETTER13 = 0x0046,
LETTER14 = 0x0047,
LETTER15 = 0x0048,
LETTER16 = 0x0049,
LETTER17 = 0x004A,
LETTER18 = 0x004B,
LETTER19 = 0x004C,
LETTER20 = 0x004E,
LETTER21 = 0x004F,
LETTER22 = 0x0050,
LETTER23 = 0x0051,
LETTER24 = 0x0052,
ARTIFACT = 0x0053,
LETTER25 = 0x0054,
DOLLY = 0x0056,
WATER_STONE = 0x0057,
MAGICAL_BEAN = 0x0058,
FERTILE_SOIL = 0x0059,
MIRACLE_WATER = 0x005A,
VOLCANO_VASE = 0x005B,
TAPE = 0x005C,
SUGAR = 0x005D,
SALT = 0x005E,
EGG1 = 0x005F,
CREAM = 0x0060,
STRAWBERRY = 0x0061,
BUTTER = 0x0062,
CLEANSER = 0x0063,
WATER = 0x0064,
FLOUR = 0x0065,
MILK = 0x0066,
LYRICS = 0x0067,
MELODY = 0x0068,
MAILBAG = 0x0069,
CASTLE_KEY3 = 0x006A,
ODD_KEY = 0x006B,
STAR_STONE = 0x006C,
SNEAKY_PARASOL = 0x006D,
KOOPA_LEGENDS = 0x006E,
AUTOGRAPH1 = 0x006F,
EMPTY_WALLET = 0x0070,
AUTOGRAPH2 = 0x0071,
KOOPA_SHELL = 0x0072, // unused
OLD_PHOTO = 0x0073,
GLASSES = 0x0074,
PHOTOGRAPH = 0x0075, // unused
PACKAGE = 0x0076,
RED_JAR = 0x0077,
CASTLE_KEY4 = 0x0078,
WAREHOUSE_KEY = 0x0079,
PRISON_KEY1 = 0x007A,
SILVER_CREDIT = 0x007B,
GOLD_CREDIT = 0x007C,
PRISON_KEY2 = 0x007D, // unused
PRISON_KEY3 = 0x007E, // unused
PRISON_KEY4 = 0x007F, // unused
FIRE_FLOWER = 0x0080,
SNOWMAN_DOLL = 0x0081,
THUNDER_RAGE = 0x0082,
SHOOTING_STAR = 0x0083,
THUNDER_BOLT = 0x0084,
PEBBLE = 0x0085,
DUSTY_HAMMER = 0x0086,
INSECTICIDE_HERB = 0x0087,
STONE_CAP = 0x0088,
TASTY_TONIC = 0x0089,
MUSHROOM = 0x008A,
VOLT_SHROOM = 0x008B,
SUPER_SHROOM = 0x008C,
DRIED_SHROOM = 0x008D,
ULTRA_SHROOM = 0x008E,
SLEEPY_SHEEP = 0x008F,
POW_BLOCK = 0x0090,
HUSTLE_DRINK = 0x0091,
STOP_WATCH = 0x0092,
WHACKAS_BUMP = 0x0093,
APPLE = 0x0094,
LIFE_SHROOM = 0x0095,
MYSTERY = 0x0096,
REPEL_GEL = 0x0097,
FRIGHT_JAR = 0x0098,
PLEASE_COME_BACK = 0x0099,
DIZZY_DIAL = 0x009A,
SUPER_SODA = 0x009B,
LEMON = 0x009C,
LIME = 0x009D,
BLUE_BERRY = 0x009E,
RED_BERRY = 0x009F,
YELLOW_BERRY = 0x00A0,
BUBBLE_BERRY = 0x00A1,
JAMMIN_JELLY = 0x00A2,
MAPLE_SYRUP = 0x00A3,
HONEY_SYRUP = 0x00A4,
GOOMNUT = 0x00A5,
KOOPA_LEAF = 0x00A6,
DRIED_PASTA = 0x00A7,
DRIED_FRUIT = 0x00A8,
STRANGE_LEAF = 0x00A9,
CAKE_MIX = 0x00AA,
EGG2 = 0x00AB,
COCONUT = 0x00AC,
MELON = 0x00AD,
STINKY_HERB = 0x00AE,
ICED_POTATO = 0x00AF,
SPICY_SOUP = 0x00B0,
APPLE_PIE = 0x00B1,
HONEY_ULTRA = 0x00B2,
MAPLE_ULTRA = 0x00B3,
JELLY_ULTRA = 0x00B4,
KOOPASTA = 0x00B5,
FRIED_SHROOM = 0x00B6,
SHROOM_CAKE = 0x00B7,
SHROOM_STEAK = 0x00B8,
HOT_SHROOM = 0x00B9,
SWEET_SHROOM = 0x00BA,
YUMMY_MEAL = 0x00BB,
HEALTHY_JUICE = 0x00BC,
BLAND_MEAL = 0x00BD,
DELUXE_FEAST = 0x00BE,
SPECIAL_SHAKE = 0x00BF,
BIG_COOKIE = 0x00C0,
CAKE = 0x00C1,
MISTAKE = 0x00C2,
KOOPA_TEA = 0x00C3,
HONEY_SUPER = 0x00C4,
MAPLE_SUPER = 0x00C5,
JELLY_SUPER = 0x00C6,
SPAGHETTI = 0x00C7,
EGG_MISSILE = 0x00C8,
FRIED_EGG = 0x00C9,
HONEY_SHROOM = 0x00CA,
HONEY_CANDY = 0x00CB,
ELECTRO_POP = 0x00CC,
FIRE_POP = 0x00CD,
LIME_CANDY = 0x00CE,
COCO_POP = 0x00CF,
LEMON_CANDY = 0x00D0,
JELLY_POP = 0x00D1,
STRANGE_CAKE = 0x00D2,
KOOKY_COOKIE = 0x00D3,
FROZEN_FRIES = 0x00D4,
POTATO_SALAD = 0x00D5,
NUTTY_CAKE = 0x00D6,
MAPLE_SHROOM = 0x00D7,
BOILED_EGG = 0x00D8,
YOSHI_COOKIE = 0x00D9,
JELLY_SHROOM1 = 0x00DA,
JELLY_SHROOM2 = 0x00DB,
JELLY_SHROOM3 = 0x00DC,
JELLY_SHROOM4 = 0x00DD,
JELLY_SHROOM5 = 0x00DE,
JELLY_SHROOM6 = 0x00DF,
SPIN_SMASH = 0x00E0,
MULTIBOUNCE = 0x00E1,
POWER_PLUS_A = 0x00E2,
DODGE_MASTER = 0x00E3,
POWER_BOUNCE = 0x00E4,
SPIKE_SHIELD = 0x00E5,
FIRST_ATTACK = 0x00E6,
HP_PLUS_A = 0x00E7,
QUAKE_HAMMER = 0x00E8,
DOUBLE_DIP = 0x00E9,
MYSTERY_SCROLL = 0x00EA, // unused
SLEEP_STOMP = 0x00EB,
FIRE_SHIELD = 0x00EC,
QUICK_CHANGE = 0x00ED,
D_DOWN_POUND = 0x00EE,
DIZZY_STOMP = 0x00EF,
SMASH_CHARGE0 = 0x00F0, // unused
PRETTY_LUCKY = 0x00F1,
FEELING_FINE = 0x00F2,
ATTACK_FX_A = 0x00F3,
ALLOR_NOTHING = 0x00F4,
HP_DRAIN = 0x00F5,
JUMP_CHARGE0 = 0x00F6, // unused
SLOW_GO = 0x00F7,
FP_PLUS_A = 0x00F8,
MEGA_RUSH = 0x00F9,
ICE_POWER = 0x00FA,
DEFEND_PLUS_A = 0x00FB,
PAY_OFF = 0x00FC,
MONEY_MONEY = 0x00FD,
CHILL_OUT = 0x00FE,
HAPPY_HEART_A = 0x00FF,
ZAP_TAP = 0x0100,
BERSERKER = 0x0101, // unused
RIGHT_ON = 0x0102, // unused
RUNAWAY_PAY = 0x0103,
REFUND = 0x0104,
FLOWER_SAVER_A = 0x0105,
TRIPLE_DIP = 0x0106,
HAMMER_THROW = 0x0107,
MEGA_QUAKE = 0x0108,
SMASH_CHARGE = 0x0109,
JUMP_CHARGE = 0x010A,
S_SMASH_CHG = 0x010B,
S_JUMP_CHG = 0x010C,
POWER_RUSH = 0x010D,
AUTO_JUMP = 0x010E, // unused
AUTO_SMASH = 0x010F, // unused
CRAZY_HEART = 0x0110, // unused
LAST_STAND = 0x0111,
CLOSE_CALL = 0x0112,
P_UP_D_DOWN = 0x0113,
LUCKY_DAY = 0x0114,
MEGA_HP_DRAIN = 0x0115, // unused
P_DOWN_D_UP = 0x0116,
POWER_QUAKE = 0x0117,
AUTO_MULTIBOUNCE = 0x0118, // unused
FLOWER_FANATIC = 0x0119, // unused
HEART_FINDER = 0x011A,
FLOWER_FINDER = 0x011B,
SPIN_ATTACK = 0x011C,
DIZZY_ATTACK = 0x011D,
I_SPY = 0x011E,
SPEEDY_SPIN = 0x011F,
BUMP_ATTACK = 0x0120,
POWER_JUMP = 0x0121,
SUPER_JUMP = 0x0122, // unused
MEGA_JUMP = 0x0123,
POWER_SMASH1 = 0x0124,
SUPER_SMASH = 0x0125, // unused
MEGA_SMASH = 0x0126,
POWER_SMASH2 = 0x0127,
POWER_SMASH3 = 0x0128,
DEEP_FOCUS1 = 0x0129,
SUPER_FOCUS = 0x012A, // unused
SHRINK_SMASH = 0x012B,
SHELL_CRACK = 0x012C, // unused
KAIDEN = 0x012D, // unused
D_DOWN_JUMP = 0x012E,
SHRINK_STOMP = 0x012F,
DAMAGE_DODGE_A = 0x0130,
EARTHQUAKE_JUMP = 0x0131,
DEEP_FOCUS2 = 0x0132,
DEEP_FOCUS3 = 0x0133,
HP_PLUS_B = 0x0134,
FP_PLUS_B = 0x0135,
HAPPY_HEART_B = 0x0136,
HAPPY_HEART_X = 0x0137,
FLOWER_SAVER_B = 0x0138,
FLOWER_SAVER_X = 0x0139,
DAMAGE_DODGE_B = 0x013A,
DAMAGE_DODGE_X = 0x013B,
POWER_PLUS_B = 0x013C,
POWER_PLUS_X = 0x013D,
DEFEND_PLUS_X = 0x013E,
DEFEND_PLUS_Y = 0x013F,
HAPPY_FLOWER_A = 0x0140,
HAPPY_FLOWER_B = 0x0141,
HAPPY_FLOWER_X = 0x0142,
GROUP_FOCUS = 0x0143,
PEEKABOO = 0x0144,
ATTACK_FX_D = 0x0145,
ATTACK_FX_B = 0x0146,
ATTACK_FX_E = 0x0147,
ATTACK_FX_C = 0x0148,
ATTACK_FX_F = 0x0149,
HP_PLUS_C = 0x014A,
HP_PLUS_X = 0x014B,
HP_PLUS_Y = 0x014C,
FP_PLUS_C = 0x014D,
FP_PLUS_X = 0x014E,
FP_PLUS_Y = 0x014F,
HEALTHY_HEALTHY = 0x0150,
ATTACK_FX_F2 = 0x0151,
ATTACK_FX_F3 = 0x0152,
ATTACK_FX_F4 = 0x0153,
ATTACK_FX_F5 = 0x0154,
PARTNER_ATTACK = 0x0155, // placeholder with partner attack icon
HEART = 0x0156,
COIN = 0x0157,
HEART_PIECE = 0x0158, // unused, NOT functional
STAR_POINT = 0x0159, // unused, functional, makes coin sound
FULL_HEAL = 0x015A, // unused, functional, item inside healing block
FLOWER = 0x015B,
STAR_PIECE = 0x015C,
PRESENT = 0x015D,
COMPLETE_CAKE = 0x015E,
BARE_CAKE = 0x015F,
EMPTY_CAKE_PAN = 0x0160,
FULL_CAKE_PAN = 0x0161,
EMPTY_MIXING_BOWL = 0x0162,
FULL_MIXING_BOWL = 0x0163,
CAKE_WITH_ICING = 0x0164,
CAKE_WITH_BERRIES = 0x0165,
HAMMER1_ICON = 0x0166,
HAMMER2_ICON = 0x0167,
HAMMER3_ICON = 0x0168,
BOOTS1_ICON = 0x0169,
BOOTS2_ICON = 0x016A,
BOOTS3_ICON = 0x016B,
ITEMS_ICON = 0x016C
} eItem;
#endif

View File

@ -8,4 +8,6 @@
#define UNK_FUN_PTR(name) void(*name)(void)
#define UNK_ARGS
typedef s32* bytecode;
#endif

View File

@ -22,6 +22,9 @@ extern s16* D_80151328;
extern s16 D_8010CD10;
extern s16 D_8010CD12;
extern s32 D_801595A0;
extern char gCloudyFlowerFieldsBg[]; // "fla_bg"
extern char gSunnyFlowerFieldsBg[]; // "flb_bg"
extern bg_header gBackgroundImage;
extern s8 D_8014F12F;
// Triggers

View File

@ -843,7 +843,7 @@ SECTIONS
}
/* 0x00000000 04E5A0-0759B0 [27410] */
.data0004E5A0 0x0004E5A0 : AT(0x04E5A0) {
.data0004E5A0 0x800731A0 : AT(0x04E5A0) {
build/bin/papermario.04E5A0.bin_4e5a0_len_27410.o(.data);
}
@ -893,10 +893,19 @@ SECTIONS
}
/* 0x00000000 090FE0-0A5DD0 [14DF0] */
.data00090FE0 0x00090FE0 : AT(0x090FE0) {
.data00090FE0 0x800F7B30 : AT(0x090FE0) {
build/bin/papermario.090FE0.bin_90fe0_len_14df0.o(.data);
}
/* uncomment once rodata for is_ability_active is needed. */
/*.rodata8010BF60 0x8010BF60 : AT(0xA5410) {
build/src/code_80850_len_3060.o(.rodata)
}
.data000A54F0 0x8010C040 : AT(0xA54F0) {
build/bin/papermario.0A54F0.bin_0a54f0_len_8e0.o(.data);
}*/
/* 0x8010F6D0 0A5DD0-0B72B0 [114E0] */
.text8010F6D0 0x8010F6D0 : AT(0x0A5DD0) {
build/src/code_a5dd0_len_114e0.o(.text);
@ -958,7 +967,7 @@ SECTIONS
}
/* 0x00000000 0E16B0-0E79B0 [6300] */
.data000E16B0 0x000E16B0 : AT(0x0E16B0) {
.data000E16B0 0x8014AFB0 : AT(0x0E16B0) {
build/bin/papermario.0E16B0.bin_e5dd0_len_6300.o(.data);
}
@ -1003,7 +1012,7 @@ SECTIONS
}
/* 0x00000000 0FE650-0FEE30 [7E0] */
.data000FE650 0x000FE650 : AT(0x0FE650) {
.data000FE650 0x802D9CA0 : AT(0x0FE650) {
build/bin/papermario.0FE650.bin_fee30_len_7e0.o(.data);
}
@ -1018,7 +1027,7 @@ SECTIONS
}
/* 0x00000000 102480-102610 [190] */
.data00102480 0x00102480 : AT(0x102480) {
.data00102480 0x802DF390 : AT(0x102480) {
build/bin/papermario.102480.bin_102610_len_190.o(.data);
}

View File

@ -16,7 +16,7 @@ INCLUDE_ASM(code_111f0_len_860, func_80035EEC);
void func_800360FC(void) {
game_status* gameStatus = *gGameStatusPtr;
if (gameStatus->unk_AC == 2) {
if (gameStatus->loadMenuState == 2) {
func_800E973C();
}
}
@ -28,11 +28,11 @@ void func_80036130(void) {
D_800A0942 = 0x14;
D_800A0944 = 0x00;
if (gameStatus->unk_88 != gameStatus->unk_86) {
gameStatus->unk_8A = 0x01;
gameStatus->unk_88 = gameStatus->unk_86;
if (gameStatus->prevArea != gameStatus->areaID) {
gameStatus->changedArea = 1;
gameStatus->prevArea = gameStatus->areaID;
} else {
gameStatus->unk_8A = 0;
gameStatus->changedArea = 0;
}
}

View File

@ -42,7 +42,7 @@ INCLUDE_ASM(code_42e0_len_1f60, func_80029934);
INCLUDE_ASM(code_42e0_len_1f60, func_80029994);
INCLUDE_ASM(code_42e0_len_1f60, rand_int);
s32 INCLUDE_ASM(code_42e0_len_1f60, rand_int, s32 arg0);
INCLUDE_ASM(code_42e0_len_1f60, signF);
@ -78,7 +78,7 @@ f32 INCLUDE_ASM(code_42e0_len_1f60, sin_deg, f32 x);
f32 INCLUDE_ASM(code_42e0_len_1f60, cos_deg, f32 x);
INCLUDE_ASM(code_42e0_len_1f60, update_lerp);
f32 INCLUDE_ASM(code_42e0_len_1f60, update_lerp, EASING easing, f32 start, f32 end, s32 elapsed, s32 duration);
INCLUDE_ASM(code_42e0_len_1f60, func_8002A904);

View File

@ -22,21 +22,20 @@ s32 general_heap_free(s32 size) {
return _heap_free(&D_802FB800, size);
}
INCLUDE_ASM(code_6000, battle_heap_create);
/*s32 battle_heap_create(void) {
if (_heap_create(&D_803DA800, 0x25800) != -1) {
s32 battle_heap_create(void) {
if (_heap_create(&D_803DA800, 0x25800) == -1) {
return -1;
} else {
return 0;
}
}*/
}
s32 func_8002ACDC(void) {
return 0;
}
s32 heap_malloc(s32 size) {
if ((*gGameStatusPtr)->unk_70 == 0) {
if ((*gGameStatusPtr)->isBattle == 0) {
return general_heap_malloc(size);
} else {
return _heap_malloc(&D_803DA800, size);
@ -44,7 +43,7 @@ s32 heap_malloc(s32 size) {
}
s32 heap_free(s32 size) {
if ((*gGameStatusPtr)->unk_70 != 0) {
if ((*gGameStatusPtr)->isBattle != 0) {
return _heap_free(&D_803DA800, size);
} else {
return general_heap_free(size);
@ -57,7 +56,7 @@ INCLUDE_ASM(code_6000, collision_heap_malloc);
INCLUDE_ASM(code_6000, collision_heap_free);
/*s32 collision_heap_free(s32 size) {
s32 unk_70 = (*gGameStatusPtr)->unk_70;
s32 isBattle = (*gGameStatusPtr)->isBattle;
return _heap_free((unk_70 == 0) ? (&D_80268000) : (&D_803DA800), size);
return _heap_free((isBattle == 0) ? (&D_80268000) : (&D_803DA800), size);
}*/

View File

@ -1,7 +1,5 @@
#include "common.h"
void sort_items(void);
void clear_player_data(void) {
player_data* playerData = &gPlayerData;
s32 i;
@ -31,15 +29,15 @@ void clear_player_data(void) {
playerData->merleeTurnCount = -1;
playerData->maxStarPower = 0;
playerData->specialBarsFilled = 0;
playerData->unk_292 = 0;
playerData->unk_292[0] = 0;
playerData->currentPartner = 0;
for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
playerData->partners[i].enabled = 0;
playerData->partners[i].level = 0;
playerData->partners[i].unk_2 = 0;
playerData->partners[i].unk_4 = 0;
playerData->partners[i].unk_6 = 0;
playerData->partners[i].unk_02[0] = 0;
playerData->partners[i].unk_02[1] = 0;
playerData->partners[i].unk_02[2] = 0;
}
for (i = ARRAY_COUNT(playerData->keyItems) - 1; i >= 0; i--) {
@ -70,10 +68,10 @@ void clear_player_data(void) {
playerData->enemyFirstStrikes = 0;
playerData->powerBounces = 0;
playerData->battlesCount = 0;
playerData->unk_2A4 = 0;
playerData->unk_2A6 = 0;
playerData->unk_2A8 = 0;
playerData->unk_2AA = 0;
playerData->unk_2A4[0] = 0;
playerData->unk_2A4[1] = 0;
playerData->unk_2A4[2] = 0;
playerData->unk_2A4[3] = 0;
playerData->unk_2AC = 0;
playerData->unk_2B0 = 0;
playerData->idleFrameCounter = 0;
@ -283,7 +281,7 @@ void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY) {
ui_status* uiStatus = &gUIStatus;
s32 iconIndex;
if ((gPlayerData.coins != uiStatus->displayCoins) && (((*gGameStatusPtr)->unk_134 % 3) == 0)) {
if ((gPlayerData.coins != uiStatus->displayCoins) && (((*gGameStatusPtr)->frameCounter % 3) == 0)) {
play_sound(0x211);
}
@ -304,9 +302,9 @@ void update_coin_counter(void) {
do {} while(0); // Needed to match
if (uiStatus->unk_6D != 0) {
uiStatus->unk_6D -= 1;
if (((uiStatus->unk_6D << 24) == 0) && (uiStatus->iconIndex12 >= 0)) {
if (uiStatus->unk_6C[1] != 0) {
uiStatus->unk_6C[1] -= 1;
if (((uiStatus->unk_6C[1] << 24) == 0) && (uiStatus->iconIndex12 >= 0)) {
free_icon(uiStatus->iconIndex12);
free_icon(uiStatus->iconIndex13);
uiStatus->iconIndex12 = -1;
@ -314,24 +312,24 @@ void update_coin_counter(void) {
D_8010CD12 = 0;
}
if (uiStatus->unk_6C != 0) {
if ((uiStatus->displayCoins == playerData->coins) && (uiStatus->unk_6C > 30)) {
uiStatus->unk_6C = 30;
if (uiStatus->unk_6C[0] != 0) {
if ((uiStatus->displayCoins == playerData->coins) && (uiStatus->unk_6C[0] > 30)) {
uiStatus->unk_6C[0] = 30;
}
if ((uiStatus->displayCoins == playerData->coins) || (uiStatus->unk_6C <= 30)) {
uiStatus->unk_6C -= 1;
if (uiStatus->unk_6C == 0) {
if ((uiStatus->displayCoins == playerData->coins) || (uiStatus->unk_6C[0] <= 30)) {
uiStatus->unk_6C[0] -= 1;
if (uiStatus->unk_6C[0] == 0) {
func_80147E7C(20, &D_80147574);
uiStatus->unk_6D = 15;
uiStatus->unk_6C[1] = 15;
D_8010CD10 = 0;
D_8010CD12 = 1;
uiStatus->iconIndex12 = uiStatus->iconIndex10;
uiStatus->iconIndex13 = uiStatus->iconIndex11;
uiStatus->displayCoins = playerData->coins;
if (uiStatus->unk_6E > -1) {
uiStatus->ignoreChanges = uiStatus->unk_6E;
uiStatus->unk_6E = -1;
if (uiStatus->unk_6C[2] > -1) {
uiStatus->ignoreChanges = uiStatus->unk_6C[2];
uiStatus->unk_6C[2] = -1;
}
}
}
@ -350,13 +348,13 @@ void show_coin_counter(void) {
free_icon(uiStatus->iconIndex11);
uiStatus->iconIndex12 = -1;
}
uiStatus->unk_6C = 0;
uiStatus->unk_6D = 0;
uiStatus->unk_6C[0] = 0;
uiStatus->unk_6C[1] = 0;
*coinCounterUnk = 0;
D_8010CD12 = 0;
}
if (uiStatus->unk_6C == 0) {
if (uiStatus->unk_6C[0]== 0) {
func_80147CC8(0x14, 0x20, 0xa4, 0x40, 0x14, 0x15, &D_800E92D8, 0, -1);
func_80147E7C(0x14, &D_80147474);
index = create_icon(&D_80109270);
@ -367,10 +365,10 @@ void show_coin_counter(void) {
uiStatus->iconIndex11 = index;
set_icon_flags(index, 0x80);
func_80144EFC(index, 0xff, 0xff, 0xff);
uiStatus->unk_6C = 0;
uiStatus->unk_6C[0] = 0;
if (uiStatus->unk_6E < 0) {
uiStatus->unk_6E = uiStatus->ignoreChanges;
if (uiStatus->unk_6C[2] < 0) {
uiStatus->unk_6C[2] = uiStatus->ignoreChanges;
}
uiStatus->ignoreChanges = 1;
@ -382,16 +380,16 @@ void show_coin_counter(void) {
void hide_coin_counter(void) {
ui_status* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C == 0)) {
uiStatus->unk_6C = 60;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
uiStatus->unk_6C[0] = 60;
}
}
void func_800E96C8(void) {
ui_status* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C == 0)) {
uiStatus->unk_6C = 1;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
uiStatus->unk_6C[0]= 1;
}
}
@ -415,7 +413,7 @@ void open_status_menu_long(void) {
if (uiStatus->hidden) {
uiStatus->showTimer = 210;
uiStatus->hidden = 0;
uiStatus->unk_3B = 1;
uiStatus->unk_3B[0] = 1;
}
}
@ -425,7 +423,7 @@ void open_status_menu_short(void) {
if (uiStatus->hidden) {
uiStatus->showTimer = 105;
uiStatus->hidden = 0;
uiStatus->unk_3B = 1;
uiStatus->unk_3B[0] = 1;
}
}
@ -435,7 +433,7 @@ void func_800E97B8(void) {
if (uiStatus->hidden != 1) {
uiStatus->hidden = 1;
uiStatus->showTimer = 0;
uiStatus->unk_3B = 1;
uiStatus->unk_3B[0] = 1;
}
}
@ -446,8 +444,8 @@ void func_800E97E4(void) {
uiStatus->ignoreChanges = 0;
uiStatus->showTimer = 0;
uiStatus->hidden = 1;
uiStatus->unk_3B = 0;
uiStatus->unk_3C = 0;
uiStatus->unk_3B[0] = 0;
uiStatus->unk_3B[1] = 0;
}
void func_800E9810(void) {
@ -457,24 +455,24 @@ void func_800E9810(void) {
uiStatus->drawPosY = 0;
uiStatus->ignoreChanges = 0;
uiStatus->hidden = 0;
uiStatus->unk_3B = 1;
uiStatus->unk_3C = 0;
uiStatus->unk_3B[0] = 1;
uiStatus->unk_3B[1] = 0;
}
void func_800E983C(void) {
gUIStatus.unk_45 = 0;
gUIStatus.unk_45[0] = 0;
}
void func_800E984C(void) {
gUIStatus.unk_45 = 1;
gUIStatus.unk_45[0] = 1;
}
s32 func_800E9860(void) {
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
s32 ret = 1 - uiStatus->unk_45;
s32 ret = 1 - uiStatus->unk_45[0];
if (uiStatus->unk_46 != 0) {
if (uiStatus->unk_45[1] != 0) {
ret = 0;
}
if (uiStatus2->ignoreChanges) {
@ -501,15 +499,15 @@ void status_menu_disable_ignore_changes(void) {
s32 func_800E98D4(void) {
ui_status* uiStatus = &gUIStatus;
return uiStatus->unk_46 + uiStatus->ignoreChanges;
return uiStatus->unk_45[1] + uiStatus->ignoreChanges;
}
void func_800E98EC(void) {
gUIStatus.unk_46 = 1;
gUIStatus.unk_45[1] = 1;
}
void func_800E9900(void) {
gUIStatus.unk_46 = 0;
gUIStatus.unk_45[1] = 0;
}
s32 is_status_menu_visible(void) {
@ -521,7 +519,7 @@ void status_menu_start_blinking_hp(void) {
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
if (gameStatus->unk_70 == 0) {
if (gameStatus->isBattle == 0) {
uiStatus->hpBlinkTimer = 120;
}
@ -546,7 +544,7 @@ void status_menu_start_blinking_fp(void) {
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
if (gameStatus->unk_70 == 0) {
if (gameStatus->isBattle == 0) {
uiStatus->fpBlinkTimer = 120;
}
@ -570,7 +568,7 @@ void status_menu_start_blinking_coins(void) {
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
if (gameStatus->unk_70 == 0) {
if (gameStatus->isBattle == 0) {
uiStatus->coinsBlinkTimer = 120;
}
@ -672,10 +670,10 @@ void reset_status_menu(void) {
uiStatus->drawPosY = -100;
uiStatus->hidden = 0;
uiStatus->showTimer = 210;
uiStatus->unk_3B = 0;
uiStatus->unk_3B[0] = 0;
uiStatus->ignoreChanges = 0;
uiStatus->unk_45 = 0;
uiStatus->unk_46 = 0;
uiStatus->unk_45[0] = 0;
uiStatus->unk_45[1] = 0;
uiStatus->hpBlinking = 0;
uiStatus->hpBlinkCounter = 0;
uiStatus->hpBlinkTimer = 0;
@ -690,13 +688,13 @@ void reset_status_menu(void) {
uiStatus->disabled = 0;
uiStatus->starpointsBlinking = 0;
uiStatus->starpointsBlinkCounter = 0;
uiStatus->unk_6E = -1;
uiStatus->unk_6C[2] = -1;
uiStatus->displayHP = playerData->curHP;
uiStatus->displayFP = playerData->curFP;
uiStatus->displayCoins = playerData->coins;
uiStatus->displayStarpoints = playerData->starPoints;
uiStatus->displaySP = playerData->specialBarsFilled;
uiStatus->unk_3C = 0;
uiStatus->unk_3B[1] = 0;
for (i = 0; i < 2; i++) {
func_801452B4(uiStatus->hpIconIndexes[i], uiStatus->hpIconIndexes[i]);
@ -705,7 +703,7 @@ void reset_status_menu(void) {
for (i = 0; i < 2; i++) {
func_801452B4(uiStatus->fpIconIndexes[i], uiStatus->fpIconIndexes[i]);
}
func_801452B4(uiStatus->coinIconIndex, uiStatus->coinIconIndex);
func_801452B4(uiStatus->coinIconIndex2, uiStatus->coinIconIndex2);
func_801452B4(uiStatus->starpointsIconIndex, uiStatus->starpointsIconIndex);
@ -718,7 +716,255 @@ void reset_status_menu(void) {
}
// uses a jumptable, which we need .rodata support for.
INCLUDE_ASM(code_80850_len_3060, is_ability_active);
s32 INCLUDE_ASM(code_80850_len_3060, is_ability_active, s32 arg0);
// Somewhat close. Needs work.
/*s32 is_ability_active(s32 arg0) {
s32 iVar2;
u32 uVar3;
s32 iVar5;
s32 piVar6;
s32 i;
s32 local_20[6];
s32 badge;
player_data* playerData = &gPlayerData;
s32 iVar7 = 0;
u32 uVar4;
iVar5 = 0;
//iVar7 = 0;
for(i = 5; i >= 0; i--) {
local_20[i] = 0;
}
if (((*gGameStatusPtr)->unk_7E & 1) == 0) {
iVar2 = 0;
iVar7 = 0;
piVar6 = 0;
for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
s32 index = i;
badge = playerData->equippedBadges[index];
if (playerData->equippedBadges[index] != 0) {
uVar4 = gItemTable[badge].moveID;
}
switch (arg0) {
case 0:
uVar3 = 0x4c;
break;
default:
continue;
case 2:
uVar3 = 0x40;
break;
case 3:
uVar3 = 0x4d;
break;
case 4:
uVar3 = 0x52;
break;
case 5:
uVar3 = 0x35;
break;
case 6:
if (uVar4 == 0x53) {
iVar7++;
}
if (playerData->hasActionCommands != 0) {
iVar7++;
}
continue;
case 7:
uVar3 = 0x41;
break;
case 8:
uVar3 = 0x42;
break;
case 9:
uVar3 = 0x5a;
break;
case 10:
uVar3 = 0x3c;
break;
case 0xb:
uVar3 = 0x4e;
break;
case 0xc:
uVar3 = 0x5b;
break;
case 0xd:
uVar3 = 0x3d;
break;
case 0xe:
uVar3 = 0x43;
break;
case 0xf:
if (uVar4 == 0x54) {
local_20[piVar6] = 1;
piVar6++;
iVar5++;
iVar7 = -1;
}
if (uVar4 == 0x55) {
local_20[piVar6] = 2;
piVar6++;
iVar5++;
iVar7 = -1;
}
if (uVar4 == 0x56) {
local_20[piVar6] = 3;
piVar6++;
iVar5++;
iVar7 = -1;
}
if (uVar4 == 0x57) {
local_20[piVar6] = 4;
piVar6++;
iVar5++;
iVar7 = -1;
}
if (uVar4 == 0x58) {
local_20[piVar6] = 5;
piVar6++;
iVar5++;
iVar7 = -1;
}
if (uVar4 == 0x59) {
local_20[piVar6] = 6;
piVar6++;
iVar5++;
iVar7 = -1;
}
continue;
case 0x10:
uVar3 = 0x5c;
break;
case 0x11:
uVar3 = 0x5d;
break;
case 0x12:
uVar3 = 0x5e;
break;
case 0x13:
uVar3 = 0x44;
break;
case 0x14:
uVar3 = 0x5f;
break;
case 0x15:
uVar3 = 0x60;
break;
case 0x16:
uVar3 = 0x4f;
break;
case 0x17:
uVar3 = 0x61;
break;
case 0x18:
uVar3 = 0x62;
break;
case 0x19:
uVar3 = 99;
break;
case 0x1b:
uVar3 = 0x45;
break;
case 0x1c:
uVar3 = 0x3b;
break;
case 0x1d:
uVar3 = 0x6e;
break;
case 0x1e:
uVar3 = 100;
break;
case 0x1f:
uVar3 = 0x65;
break;
case 0x20:
uVar3 = 0x46;
break;
case 0x21:
uVar3 = 0x47;
break;
case 0x22:
uVar3 = 0x3e;
break;
case 0x23:
uVar3 = 0x48;
break;
case 0x24:
uVar3 = 0x66;
break;
case 0x25:
uVar3 = 0x49;
break;
case 0x26:
uVar3 = 0x67;
break;
case 0x27:
uVar3 = 0x6d;
break;
case 0x28:
uVar3 = 0x6a;
break;
case 0x29:
uVar3 = 0x6c;
break;
case 0x2a:
uVar3 = 0x50;
break;
case 0x1a:
uVar3 = 0x38;
break;
case 0x2b:
uVar3 = 0x68;
break;
case 0x2c:
uVar3 = 0x69;
break;
case 0x2d:
uVar3 = 0x6b;
break;
case 0x2e:
uVar3 = 0x6f;
break;
case 0x2f:
uVar3 = 0x70;
break;
case 0x30:
uVar3 = 0x71;
break;
case 0x31:
uVar3 = 0x72;
break;
case 0x32:
uVar3 = 0x73;
break;
case 0x33:
uVar3 = 0x33;
break;
case 0x34:
uVar3 = 0x74;
break;
case 0x35:
uVar3 = 0x75;
break;
case 0x36:
uVar3 = 0x76;
break;
case 0x37:
uVar3 = 0x4a;
}
if (uVar4 == uVar3) {
iVar7++;
}
}
if (iVar7 < 0) {
iVar7 = local_20[rand_int(iVar5 - 1)];
}
return iVar7;
}
}*/
s32 is_partner_ability_active(void) {
return 0;
@ -807,14 +1053,14 @@ void add_SP(s32 amt) {
s32 phi_v1;
s32 blah;
uiStatus->unk_57 = 1;
uiStatus->unk_58 = 60;
uiStatus->unk_57[0] = 1;
uiStatus->unk_57[1] = 60;
phi_v1 = playerData->specialBarsFilled;
if (phi_v1 < 0) {
phi_v1 = playerData->specialBarsFilled + 31;
}
uiStatus->unk_59 = phi_v1 >> 5;
uiStatus->unk_57[2] = phi_v1 >> 5;
playerData->specialBarsFilled += amt;

View File

@ -9,7 +9,7 @@ INCLUDE_ASM(code_dbd70_len_700, clear_trigger_data);
//INCLUDE_ASM(code_dbd70_len_700, init_trigger_list);
void init_trigger_list(void) {
if ((*gGameStatusPtr)->unk_70 == 0) {
if ((*gGameStatusPtr)->isBattle == 0) {
*gCurrentTriggerListPtr = gTriggerList1;
} else {
*gCurrentTriggerListPtr = gTriggerList2;
@ -46,3 +46,22 @@ trigger* get_trigger_by_id(s32 triggerID) {
}
INCLUDE_ASM(code_dbd70_len_700, func_80145CE8);
/*s32 func_80145CE8(s32 arg0) {
s32 i;
s32 ret;
if (func_800E52F8() == 0) {
return 0;
}
for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) {
if (((*gCurrentTriggerListPtr)[i] == NULL) ||
((*gCurrentTriggerListPtr)[i]->unk_30 == 0) ||
((*gCurrentTriggerListPtr)[i]->colliderID != arg0) ||
((*gCurrentTriggerListPtr)[i]->genericFlagIndex & 0x100) == 0) {
ret = 1;
}
}
return ret;
}*/

View File

@ -1,25 +1,26 @@
#include "common.h"
INCLUDE_ASM(code_dc470_len_14c0, load_map_bg);
/* close match
void load_map_bg (s32 arg0) {
s32 tempvar0 = arg0;
s32 flowerfields_bg1 = 0x80140EE0;
s32 tempvar3 = get_variable(0, 0xF5DE0180);
if (tempvar0 == 0) {
return;
}else{
if (tempvar3 > 0x0034) {
if (strcmp(tempvar0, 0x8014F120) == 0) {
tempvar0 = flowerfields_bg1;
}
load_asset_by_name (tempvar0, 0);
void load_map_bg(char* optAssetName) {
UNK_PTR compressedData;
u32 assetSize;
char* assetName;
if (optAssetName == NULL) return;
assetName = optAssetName;
// StoryProgress check
if (get_variable(0, 0xF5DE0180) >= 0x35) {
// Use sunny Flower Fields bg rather than cloudy
// TODO: these globals should be string literals
if (!strcmp(assetName, gCloudyFlowerFieldsBg)) {
assetName = gSunnyFlowerFieldsBg;
}
}
decode_yay0(tempvar0, 0x80200000);
general_heap_free(tempvar0);
compressedData = load_asset_by_name(assetName, &assetSize);
decode_yay0(compressedData, &gBackgroundImage);
general_heap_free(compressedData);
}
*/
void func_80145DF8(void) {
game_status* gameStatus = *gGameStatusPtr;
@ -27,29 +28,29 @@ void func_80145DF8(void) {
D_8014F12F = 0;
gameStatus->unk_15C = 0xB4;
gameStatus->unk_148 &= 0xF0;
gameStatus->enableBackground &= 0xF0;
}
void read_background_size(bg_header *bg) {
game_status* gameStatus = *gGameStatusPtr;
gameStatus->unk_14E = bg->width;
gameStatus->unk_150 = bg->height;
gameStatus->unk_14A = bg->startX;
gameStatus->unk_14C = bg->startY;
gameStatus->unk_154 = bg->palette;
gameStatus->unk_158 = bg->raster;
gameStatus->unk_148 |= 1;
gameStatus->backgroundMaxW = bg->width;
gameStatus->backgroundMaxH = bg->height;
gameStatus->backgroundMinW = bg->startX;
gameStatus->backgroundMinH = bg->startY;
gameStatus->backgroundRaster = bg->raster;
gameStatus->backgroundPalette = bg->palette;
gameStatus->enableBackground |= 1;
}
void set_background_size(s16 startX, s16 startY, s16 sizeX, s16 sizeY) {
game_status* gameStatus = *gGameStatusPtr;
gameStatus->unk_148 &= ~1;
gameStatus->unk_14E = startX;
gameStatus->unk_150 = startY;
gameStatus->unk_14A = sizeX;
gameStatus->unk_14C = sizeY;
gameStatus->enableBackground &= ~1;
gameStatus->backgroundMaxW = startX;
gameStatus->backgroundMaxH = startY;
gameStatus->backgroundMinW = sizeX;
gameStatus->backgroundMinH = sizeY;
}
u16 func_80145E98(s32 arg0, s32 arg1, s32 arg2) {

View File

@ -1,20 +1,44 @@
#include "common.h"
INCLUDE_ASM(code_e92d0_len_5da0, fixed_var_to_float);
/*f32 fixed_var_to_float(s32 scriptVar) {
if (scriptVar <= -220000000) {
return (scriptVar + 230000000) * (1 / 1024.f);
}
return scriptVar;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, float_to_fixed_var);
/*s32 float_to_fixed_var(f32 arg0) {
return (s32)(arg0 * (f32)1024.0f) + -230000000;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_return);
s32 si_handle_return(script_context* script) {
kill_script(script);
return 255;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_label);
s32 si_handle_label(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_goto);
s32 si_handle_goto(script_context* script) {
script->ptrNextLine = si_goto_label(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_Loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_loop);
s32 si_handle_break_loop(script_context* script) {
if (script->loopDepth < 0) {
while (1) {}; // todo INF_LOOP
}
script->ptrNextLine = si_goto_end_loop(script);
script->loopDepth -= 1;
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_wait);
@ -32,17 +56,58 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_less_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_greater_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_AND);
s32 si_handle_if_AND(script_context* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
var1 = ptrReadPos[0];
ptrReadPos++;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_else);
if ((get_variable(script, var1) & *ptrReadPos) == 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
}
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_if);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
s32 si_handle_if_not_AND(script_context* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
var1 = ptrReadPos[0];
ptrReadPos++;
if ((get_variable(script, var1) & *ptrReadPos) != 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
}
return 2;
}
s32 si_handle_else(script_context* script) {
script->ptrNextLine = si_skip_else(script);
return 2;
}
s32 si_handle_end_if(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch_const);
/*s32 si_handle_switch_const(script_context* script) {
s32 ptrReadPos = *script->ptrReadPos;
s8 switchDepth = script->switchDepth + 1;
if (switchDepth >= 8) {
inf_loop: goto inf_loop; //todo
}
script->switchBlockValue[script->switchDepth + 1] = ptrReadPos;
script->switchBlockState[script->switchDepth + 1] = 1;
return 2;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal);
@ -68,15 +133,47 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_case_group);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_case);
s32 si_handle_break_case(script_context* script) {
if (script->switchDepth < 0) {
while (1) {}; //todo INF_LOOP
}
script->ptrNextLine = si_goto_end_case(script);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_switch);
s32 si_handle_end_switch(script_context* script) {
s32 switchDepth = script->switchDepth;
if (switchDepth < 0) {
inf_loop: goto inf_loop; // todo macro? how to do without label
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_var);
script->switchBlockState[script->switchDepth] = 0;
script->switchDepth -= 1;
return 2;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_const);
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float);
s32 si_handle_set_var(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, get_variable(script, ptrReadPos[1]));
return 2;
}
s32 si_handle_set_const(script_context* script) {
set_variable(script, *script->ptrReadPos, script->ptrReadPos[1]);
return 2;
}
s32 si_handle_set_float(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_float_variable(script, curPtrReadPos, get_float_variable(script, ptrReadPos[1]));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_add);
@ -96,11 +193,23 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_multiplyF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_divideF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_int_buffer_ptr);
s32 si_handle_set_int_buffer_ptr(script_context* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float_buffer_ptr);
s32 si_handle_set_float_buffer_ptr(script_context* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_word);
s32 si_handle_get_1_word(script_context* script) {
s32 ptrReadPos = *script->ptrReadPos;
s32 buffer = *script->buffer++;
set_variable(script, ptrReadPos, buffer);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_2_word);
@ -108,7 +217,13 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_3_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_word);
s32 si_handle_get_Nth_word(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, script->buffer[get_variable(script, ptrReadPos[1])]);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_float);
@ -120,19 +235,47 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_array);
s32 si_handle_set_array(script_context* script) {
script->array = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_flag_array);
s32 si_handle_set_flag_array(script_context* script) {
script->flagArray = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_allocate_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
s32 si_handle_AND_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 & get_variable(script, temp_s2));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
s32 si_handle_OR_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 | get_variable(script, temp_s2));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_call);
@ -140,37 +283,81 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec1);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec2);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec_wait);
s32 si_handle_exec_wait(script_context* script) {
start_child_script(script, get_variable(script, *script->ptrReadPos), 0);
script->currentOpcode = 0;
return 0xFF;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_jump);
s32 si_handle_jump(script_context* script) {
script->ptrFirstLine = get_variable(script, *script->ptrReadPos);
restart_script(script);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, _bound_script_trigger_handler);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind);
INCLUDE_ASM(code_e92d0_len_5da0, DeleteTrigger);
s32 DeleteTrigger(script_context* script) {
delete_trigger(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_unbind);
s32 si_handle_unbind(script_context* script) {
delete_trigger(script->ownerID);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_kill);
s32 si_handle_kill(script_context* script) {
kill_script_by_ID(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_priority);
s32 si_handle_set_priority(script_context* script) {
set_script_priority(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_timescale);
s32 si_handle_set_timescale(script_context* script) {
set_script_timescale(script, get_float_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_group);
s32 si_handle_set_group(script_context* script) {
set_script_group(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_all);
s32 si_handle_suspend_all(script_context* script) {
suspend_all_group(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_all);
s32 si_handle_resume_all(script_context* script) {
resume_all_group(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_others);
s32 si_handle_suspend_others(script_context* script) {
suspend_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_others);
s32 si_handle_resume_others(script_context* script) {
resume_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend);
s32 si_handle_suspend(script_context* script) {
suspend_all_script(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume);
s32 si_handle_resume(script_context* script) {
resume_all_script(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_does_script_exist);
@ -178,21 +365,43 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind_lock);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_thread);
s32 si_handle_end_thread(script_context* script) {
kill_script(script);
return 255;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_child_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_child_thread);
s32 si_handle_end_child_thread(script_context* script) {
kill_script(script);
return 0;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C6E14);
s32 func_802C6E14(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_print_debug_var);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C739C);
s32 func_802C739C(script_context* script) {
script->ptrSavedPosition = *script->ptrReadPos;
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B0);
s32 func_802C73B0(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B8);
s32 func_802C73B8(script_context* script) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
if (script == get_script_by_index(i)) {
break;
}
}
return 1;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_execute_next_command);
@ -208,7 +417,7 @@ INCLUDE_ASM(code_e92d0_len_5da0, set_variable);
f32 INCLUDE_ASM(code_e92d0_len_5da0, get_float_variable, script_context* script, s32 pos);
INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable);
f32 INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable, script_context* script, s32 dest, f32 value);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_label);
@ -299,16 +508,20 @@ s32 GotoMapByID(script_context* script) {
return 1;
}
INCLUDE_ASM(code_e92d0_len_5da0, GetEntryID);
s32 GetMapID(script_context* script) {
game_status* gameStatus = *gGameStatusPtr;
set_variable(script, *script->ptrReadPos, gameStatus->mapID);
s32 GetEntryID(script_context* script) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, GetLoadType);
s32 GetMapID(script_context* script, s32 initialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID);
return 2;
}
s32 GetLoadType(script_context* script, s32 initialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, SetRenderMode);

View File

@ -2,7 +2,7 @@
void func_80033540(void) {
D_8009A650[0] |= 8;
(*gGameStatusPtr)->unk_AC = 3;
(*gGameStatusPtr)->loadMenuState = 3;
}
INCLUDE_ASM(code_e940_len_290, func_80033568);

View File

@ -3,24 +3,24 @@
void func_800337D0(s16 new_alpha) {
game_status* gameStatus = *gGameStatusPtr;
gameStatus->boot_alpha = new_alpha;
gameStatus->bootAlpha = new_alpha;
}
void func_800337E0(s16 arg0) {
game_status* gameStatus = *gGameStatusPtr;
gameStatus->boot_red = arg0;
gameStatus->boot_green = arg0;
gameStatus->boot_blue = arg0;
gameStatus->bootRed = arg0;
gameStatus->bootGreen = arg0;
gameStatus->bootBlue = arg0;
}
s16 func_800337F8(subtract_val) {
game_status* gameStatus = *gGameStatusPtr;
if (gameStatus->boot_alpha != 0) {
gameStatus->boot_alpha -= subtract_val;
if (gameStatus->boot_alpha << 16 < 0) {
gameStatus->boot_alpha = 0;
if (gameStatus->bootAlpha != 0) {
gameStatus->bootAlpha -= subtract_val;
if (gameStatus->bootAlpha << 16 < 0) {
gameStatus->bootAlpha = 0;
}
} else {
return 1;
@ -31,10 +31,10 @@ s16 func_800337F8(subtract_val) {
s16 func_80033830(add_val) {
game_status* gameStatus = *gGameStatusPtr;
if (gameStatus->boot_alpha != 0xFF) {
gameStatus->boot_alpha += add_val;
if ((gameStatus->boot_alpha > 0xFF)) {
gameStatus->boot_alpha = 0xFF;
if (gameStatus->bootAlpha != 0xFF) {
gameStatus->bootAlpha += add_val;
if ((gameStatus->bootAlpha > 0xFF)) {
gameStatus->bootAlpha = 0xFF;
}
} else {
return 1;
@ -44,8 +44,8 @@ s16 func_80033830(add_val) {
void func_80033874(void) {
func_80137D88(0, (*gGameStatusPtr)->boot_alpha);
func_80137E10(0, (*gGameStatusPtr)->boot_blue, (*gGameStatusPtr)->boot_green, (*gGameStatusPtr)->boot_red);
func_80137D88(0, (*gGameStatusPtr)->bootAlpha);
func_80137E10(0, (*gGameStatusPtr)->bootBlue, (*gGameStatusPtr)->bootGreen, (*gGameStatusPtr)->bootRed);
}
void start_battle_countdown(void) {

View File

@ -2,23 +2,34 @@
s32 MakeLerp(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32* ptrNextPos = *ptrReadPos++;
s32* ptrNextPos2;
s32* ptrNextPos3;
s32* ptrNextPos4;
script->varTable[12] = get_variable(script, ptrNextPos);
ptrNextPos2 = *ptrReadPos++;
script->varTable[13] = get_variable(script, ptrNextPos2);
ptrNextPos3 = *ptrReadPos++;
script->varTable[15] = get_variable(script, ptrNextPos3);
ptrNextPos4 = *ptrReadPos++;
script->varTable[11] = get_variable(script, ptrNextPos4);
script->varTable[14] = 0;
script->varTable[0xC] = get_variable(script, *ptrReadPos++); // start
script->varTable[0xD] = get_variable(script, *ptrReadPos++); // end
script->varTable[0xF] = get_variable(script, *ptrReadPos++); // duration
script->varTable[0xB] = get_variable(script, *ptrReadPos++); // easing type
script->varTable[0xE] = 0; // elapsed
return 2;
}
INCLUDE_ASM(code_f8f60_len_1560, UpdateLerp);
s32 UpdateLerp(script_context* script, s32 initialCall) {
script->varTable[0x0] = (s32) update_lerp(
script->varTable[0xB],
script->varTable[0xC],
script->varTable[0xD],
script->varTable[0xE],
script->varTable[0xF]
);
if (script->varTable[0xE] >= script->varTable[0xF]) {
script->varTable[0x1] = 0; // finished
} else {
script->varTable[0x1] = 1; // lerping
}
script->varTable[0xE]++;
return 2;
}
INCLUDE_ASM(code_f8f60_len_1560, RandInt);

View File

@ -114,7 +114,7 @@ s32 AddKeyItem(script_context* script, s32 initialCall) {
s32 itemID = get_variable(script, value);
s32 i;
if (itemID == FORTRESS_KEY) {
if (itemID == ITEM_FORTRESS_KEY) {
playerData->fortressKeyCount++;
return 2;
}
@ -192,13 +192,72 @@ s32 func_802D6AF0(script_context* script, s32 initialCall) {
return 2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, FindItem);
s32 FindItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
s32 i;
s32 itemIndex;
INCLUDE_ASM(code_fa4c0_len_3bf0, RemoveItem);
for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
if (playerData->invItems[i] == itemID) {
break;
}
}
INCLUDE_ASM(code_fa4c0_len_3bf0, CountFortessKeys);
itemIndex = -1;
if (i != ARRAY_COUNT(playerData->invItems)) {
itemIndex = i;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, RemoveFortressKeys);
set_variable(script, value, itemIndex);
return 2;
}
s32 RemoveItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
s32 i;
s32 itemIndex;
for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
if (playerData->invItems[i] == itemID) {
break;
}
}
itemIndex = -1;
if (i != ARRAY_COUNT(playerData->invItems)) {
itemIndex = i;
}
if (itemIndex >= 0) {
// This is `playerData->invItems[i]`, but we have to do weird
// pointer math to get the output asm to exactly match :/
*(playerData->invItems + i) = 0;
}
sort_items();
set_variable(script, value, itemIndex);
return 2;
}
s32 CountFortressKeys(script_context* script, s32 initialCall) {
s32 outVar = *script->ptrReadPos;
set_variable(script, outVar, get_fortress_key_count());
return 2;
}
s32 RemoveFortressKeys(script_context* script, s32 initialCall) {
s32 num = get_variable(script, *script->ptrReadPos);
subtract_fortress_keys(num);
return 2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, MakeItemEntity);

Binary file not shown.

View File

@ -2215,7 +2215,7 @@ labels:
- [0x802D6A98, "AddItem"]
- [0x802D6B18, "FindItem"]
- [0x802D6B9C, "RemoveItem"]
- [0x802D6C4C, "CountFortessKeys"]
- [0x802D6C4C, "CountFortressKeys"]
- [0x802D6C94, "RemoveFortressKeys"]
- [0x802D6CC0, "MakeItemEntity"]
- [0x802D6DC0, "DropItemEntity"]

1
tools/star-rod Submodule

@ -0,0 +1 @@
Subproject commit 3a32d3d6dda7374e4f32ae86530444e45956d803

69
tools/starrod_enums_to_h.py Executable file
View File

@ -0,0 +1,69 @@
#!/usr/bin/env python3
import os
import re
from glob import glob
from stringcase import constcase # pip install stringcase
DIR = os.path.dirname(__file__)
SR_DATABASE = os.path.join(DIR, "star-rod/database")
FILES = (
glob(os.path.join(SR_DATABASE, "types/*.enum")) +
glob(os.path.join(SR_DATABASE, "types/**/*.enum")) +
glob(os.path.join(SR_DATABASE, "types/*.flags")) +
glob(os.path.join(SR_DATABASE, "types/**/*.flags"))
)
with open(os.path.join(DIR, "../include/enums.h"), "w") as h:
h.write("""#ifndef _ENUMS_H_
#define _ENUMS_H_
#include "ultra64.h"
#include "types.h"
""")
for filename in FILES:
with open(filename, "r") as file:
lines = file.readlines()
# Get enum attributes
namespace = constcase(re.match(r"[^ \t]*", lines[0]).group(0))
library_name = re.match(r"[^ \t]*", lines[1]).group(0)
reverse = True if re.match(r"[^ \t]*", lines[2]).group(0) == "true" else False
# Get a list of tuples containing (name, value)
items = []
name_max_len = 0
comment = False
for line in lines[4:]:
line = line.rstrip("\n")
if not comment and not line.startswith("%") and "=" in line:
m = re.match(r"[ \t]*?([^ \t]*)[ \t]*=[ \t]*([^ \t]*)", line)
if m:
if reverse:
name = m.group(1)
value = int(m.group(2), 16)
else:
name = m.group(2)
value = int(m.group(1), 16)
if value < 0:
str_value = f"{value}"
else:
str_value = "0x" + f"{value:08x}".upper()
name = constcase(name)
items.append((name, str_value))
name_max_len = max(len(name), name_max_len)
elif "/%" in line:
comment = True
elif "%/" in line:
comment = False
# Write a section to the header file for this enum
h.write(f"typedef UNK_TYPE {namespace};\n")
for (name, value) in items:
h.write(f"#define {namespace}_{name.ljust(name_max_len)} {value}\n")
h.write("\n")
h.write("#endif\n")

197
tools/starrod_structs_to_h.py Executable file
View File

@ -0,0 +1,197 @@
#!/usr/bin/env python3
from os import path
from glob import glob
import re
DIR = path.dirname(__file__)
SR_DATABASE = path.join(DIR, "star-rod/database")
# SR currently defines a struct with the "name" struct. This causes
# problems, so we'll call it the following instead.
STRUCT_STRUCT_ALIAS = "texture_header"
STRUCT_FILES = (
# structs which need to be forward declared (because they're used
# without indirection in other structs)
glob(path.join(SR_DATABASE, f"structs/**/matrix4f.struct")) +
glob(path.join(SR_DATABASE, f"structs/**/matrix4s.struct")) +
glob(path.join(SR_DATABASE, f"structs/**/cam_pos_settings.struct")) +
glob(path.join(SR_DATABASE, f"structs/**/partner_data.struct")) +
# other structs
glob(path.join(SR_DATABASE, f"structs/**/*.struct"))
)
def convert_type(type, structs):
size = 1
suffix = ""
# replace basic types
basic_types = [
("ubyte", "u8", 1),
("byte", "s8", 1),
("uchar", "u8", 1),
("char", "s8", 1),
("ushort", "u16", 2),
("short", "s16", 2),
("uint", "u32", 4),
("int", "s32", 4),
("ulong", "u64", 8),
("long", "s64", 8),
("float", "f32", 4),
("double", "f64", 8),
("ptr", "UNK_PTR", 4),
("struct", f"struct {STRUCT_STRUCT_ALIAS}", 0x30),
]
for name, size in structs:
basic_types.append((name, f"struct {name}", size))
for sr_name, decomp_name, basic_size in basic_types:
match = re.search(f"(\\b|^)({sr_name})(\\b|$)", type)
if match:
size = basic_size
start, end = match.span(2)
type = type[:start] + decomp_name + type[end:]
break
# array
while array_match := re.search(r"\[(([0-9]+)`|([a-fA-F0-9]+))\]", type):
bin_len_str = array_match.group(2)
hex_len_str = array_match.group(3)
array_len = int(bin_len_str) if bin_len_str else int(hex_len_str, 16)
size *= array_len
suffix += f"[{array_len}]"
# strip match from type
start, end = array_match.span()
type = type[:start] + type[end:]
# pointer
if "*" in type:
size = 4
return type, size, suffix
# read struct names and their sizes in advance
structs = []
for filename in STRUCT_FILES:
struct_name = path.splitext(path.basename(filename))[0]
if struct_name == "struct":
struct_name = STRUCT_STRUCT_ALIAS
with open(filename) as file:
for line in file.readlines():
if line.startswith("%"):
continue
parts = [x.strip() for x in line.split(":")]
if len(parts) == 0:
continue
if parts[0] == "size":
struct_size = int(parts[1], 16)
structs.append((struct_name, struct_size))
continue
with open(path.join(DIR, f"../include/common_structs.h"), "w") as h:
h.write(f"""#ifndef _COMMON_STRUCTS_H_
#define _COMMON_STRUCTS_H_
#include "ultra64.h"
#include "types.h"
""")
# write all structs out to common_structs.h
struct_names_seen = []
for filename in STRUCT_FILES:
struct_name = path.splitext(path.basename(filename))[0]
struct_size = None
offset_len = 2 # string length for hex offsets
if struct_name == "struct":
struct_name = STRUCT_STRUCT_ALIAS
# avoid repeat declarations
if struct_name.startswith("_") or struct_name.startswith("OS") or "." in struct_name or struct_name == "sprite":
continue
if struct_name in struct_names_seen:
continue
struct_names_seen.append(struct_name)
h.write(f"typedef struct {struct_name} {{\n")
with open(filename) as file:
in_fields = False
cur_offset = 0
def update_offset(offset):
global cur_offset
delta = offset - cur_offset
ofs_str = ("%X" % cur_offset).zfill(2)
ofs_str_z = ofs_str.zfill(offset_len)
# insert unknown char array
if delta == 1:
h.write(f" /* 0x{ofs_str_z} */ char unk_{ofs_str};\n")
elif delta > 0:
h.write(f" /* 0x{ofs_str_z} */ char unk_{ofs_str}[{delta}];\n")
cur_offset += delta
for line in file.readlines():
# read and strip line comment
comment = re.search(r"%(.*)$", line)
if comment:
pos = comment.span()[0]
line = line[0:pos]
comment = comment.group(1).strip()
parts = [x.strip() for x in line.split(":")]
if len(parts) == 0:
continue
if in_fields:
if parts[0] == "}":
in_fields = False
else:
offset, name, type = parts
# clean name
name = re.sub(r"[^a-zA-Z0-9_]", "", name)
offset = int(offset, 16)
ofs_str = ("%X" % offset).zfill(offset_len)
update_offset(offset)
if type == "code":
h.write(f" /* 0x{ofs_str} */ UNK_FUN_PTR({name});")
cur_offset += 4
else:
type, size, suffix = convert_type(type, structs)
h.write(f" /* 0x{ofs_str} */ {type} {name}{suffix};")
cur_offset += size
if comment:
h.write(f" /* {comment} */")
h.write("\n")
else:
if parts[0] == "size":
struct_size = int(parts[1], 16)
structs.append((struct_name, struct_size))
offset_len = max(2, len(parts[1]))
elif parts[0] == "{":
in_fields = True
update_offset(struct_size)
h.write(f"}} {struct_name}; // size = 0x{('%X' % struct_size).zfill(offset_len)}\n\n")
h.write("#endif\n")

View File

@ -1,60 +0,0 @@
#!/usr/bin/env python3
import os
import re
import stringcase
files = [filename for filename in os.listdir("./sr_enums") if filename.endswith(".enum")]
for filename in files:
with open(f"./sr_enums/{filename}", "r") as file:
lines = file.readlines()
# Get enum attributes
namespace = re.match(r"[^ \t]*", lines[0]).group(0)
library_name = re.match(r"[^ \t]*", lines[1]).group(0)
reverse = True if re.match(r"[^ \t]*", lines[2]).group(0) == "true" else False
# Get a list of tuples containing (name, value)
items = []
comment = False
for line in lines[4:]:
line = line.rstrip("\n")
if not comment and not line.startswith("%") and "=" in line:
m = re.match(r"[ \t]*?([^ \t]*)[ \t]*=[ \t]*([^ \t]*)", line)
if m:
if reverse:
name = m.group(1)
value = int(m.group(2), 16)
else:
name = m.group(2)
value = int(m.group(1), 16)
if value < 0:
str_value = "-0x" + f"{value*-1:08x}".upper()
else:
str_value = "0x" + f"{value:08x}".upper()
items.append((name, str_value))
elif "/%" in line:
comment = True
elif "%/" in line:
comment = False
# Create a header file for this enum
with open(f"./c_enums/{namespace}.h", "w") as file:
header = f"_{stringcase.constcase(namespace)}_"
file.write(f"#ifndef {header}\n#define {header}\n")
file.write("\n")
file.write("#include \"ultra64.h\"\n#include \"types.h\"\n")
file.write("\n")
file.write(f"typedef enum {namespace} {'{'}\n")
for i,(name,value) in enumerate(items):
name_const = stringcase.constcase(name)
if i < len(items) - 1:
file.write(f"\t{name_const} = {value},\n")
else:
file.write(f"\t{name_const} = {value}\n")
file.write(f"{'}'} {namespace};\n\n")
file.write("#endif")

View File

@ -40,6 +40,7 @@ D_8009A650 = 0x8009A650;
D_800A0900 = 0x800A0900;
D_800DC500 = 0x800DC500;
D_8010F6D0 = 0x8010F6D0;
gBackgroundImage = 0x80200000;
D_802C3000 = 0x802C3000;
D_802DBD40 = 0x802DBD40;
D_802E0D90 = 0x802E0D90;
@ -56,6 +57,8 @@ D_00316D90 = 0x00316D90;
D_00316F30 = 0x00316F30;
D_8010D000 = 0x8010D000;
gCloudyFlowerFieldsBg = 0x8014F120;
gSunnyFlowerFieldsBg = 0x8014F128;
D_8014F12F = 0x8014F12F;
D_8014F140 = 0x8014F140;
D_80151308 = 0x80151308;