diff --git a/asm/data/code_90FE0.data.s b/asm/data/code_90FE0.data.s deleted file mode 100644 index c085d61ffb..0000000000 --- a/asm/data/code_90FE0.data.s +++ /dev/null @@ -1,114 +0,0 @@ -.include "macro.inc" - -.section .data - -glabel gPlayerStatusPtr -.word gPlayerStatus, 0x00000000, 0x00000000, 0x00000000 - -glabel D_800F7B40 -.float 0.0 - -glabel D_800F7B44 -.word 0x00000000 - -glabel D_800F7B48 -.float 0.0 - -glabel D_800F7B4C -.word 0x00000000 - -glabel D_800F7B50 -.word 0x417C1B33, 0xC0EC5C14, 0x405C9AAA, 0xBF400000 - -glabel D_800F7B60 -.word 0x3E1E0C17, 0xBEB33DB0, 0xBE3AA2E4, 0x3C3CBE62 - -glabel D_800F7B70 -.word 0x40000000, 0x40800000, 0x42000000, 0xC2000000 - -glabel D_800F7B80 -.word 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -glabel D_800F7B90 -.word 0x00000000, 0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390008, 0x00390007, 0x00390013, 0x00390014, 0xFFFFFFFF, 0x005A0000, 0x005A0002, 0x005A0003, 0x005A0004, 0x005A0006, 0x005A0007, 0x005A0009, 0x005A000A, 0x005A000B, 0x005A001A, 0xFFFFFFFF, 0x00580000, 0x00580001, 0x00580002, 0x00580004, 0x00580005, 0x00580006, 0x00580007, 0x00580008, 0x00580009, 0x00580012, 0x00580014, 0x0058001B, 0xFFFFFFFF - -glabel D_800F7C1C -.word 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000 - -glabel D_800F7C30 -.word 0x0058001B, 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000, 0x0058001B, 0x005A0003, 0x005A0006, 0x005A0009, 0x005A000B, 0x005A0000, 0x005A001A, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390000, 0x00390014 - -glabel D_800F7C7C -.word 0x800F7BE8, 0x800F7BE8, 0x800F7BBC, 0x800F7B94 - -glabel D_800F7C8C -.word func_802B6000_E24920, 0x00E23260, 0x00E236E0, 0x01000000, func_802B6000_E24920, 0x00E236E0, 0x00E24040, 0x01000000, func_802B6288_E23968, 0x00E236E0, 0x00E24040, 0x01000000, func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000, func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000, func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000, func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000, func_802B6198_E241D8, 0x00E24040, 0x00E245D0, 0x00000000, func_802B6294_E242D4, 0x00E24040, 0x00E245D0, 0x01000000, func_802B6348_E24388, 0x00E24040, 0x00E245D0, 0x01000000, func_802B6000_E24920, 0x00E24920, 0x00E24ED0, 0x01000000, func_802B61C0_E24AE0, 0x00E24920, 0x00E24ED0, 0x01000000, func_802B6638_E29068, 0x00E28A30, 0x00E291A0, 0x01000000, func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000, func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000, func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000, func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000, func_802B6060_E27570, 0x00E27510, 0x00E27C90, 0x00000000, func_802B66A8_E25578, 0x00E24ED0, 0x00E25D60, 0x00000000, func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, func_802B6508_E28F38, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B6000_E24920, 0x00E27C90, 0x00E27F40, 0x00000000, func_802B6000_E24920, 0x00E287F0, 0x00E28A30, 0x00000000, func_802B6000_E24920, 0x00E27F40, 0x00E287F0, 0x00000000, func_802B6230_E24800, 0x00E245D0, 0x00E24920, 0x01000000, func_802B6120_E2A7D0, 0x00E2A6B0, 0x00E2B530, 0x01000000, func_802B6000_E24920, 0x00E25D60, 0x00E26710, 0x00000000, func_802B63D4_E28E04, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B6478_E28EA8, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B60A4_E29514, 0x00E29470, 0x00E2A340, 0x00000000, func_802B6000_E24920, 0x00E291A0, 0x00E29470, 0x00000000, func_802B6000_E24920, 0x00E2A340, 0x00E2A6B0, 0x00000000, func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, func_802B6000_E24920, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B6000_E24920, 0x00E245D0, 0x00E24920, 0x01000000, func_802B609C_E28ACC, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x00000000, func_802B6350_E28D80, 0x00E236E0, 0x00E24040, 0x00000000, func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, 0x00000000 - -glabel D_800F7F00 -.word 0x80107CA8, 0x80107CF8, 0x80107D48, 0x80107D98, 0x80107DE8, 0x80107CA8, 0x80107E88, 0x80107ED8, 0x80107F28, 0x80107E38, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8 - -glabel D_800F7F40 -.word 0x80107CD0, 0x80107D20, 0x80107D70, 0x80107DC0, 0x80107E10, 0x80107CD0, 0x80107EB0, 0x80107F00, 0x80107F50, 0x80107E60, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0 - -glabel D_800F7F80 -.word 0x801080B8, 0x801080E0, 0x80108108, 0x80108130, 0x80108158, 0x80108180, 0x801081A8, 0x801081D0, 0x801081F8, 0x80108220 - -glabel D_800F7FA8 -.word D_80108068 - -glabel D_800F7FAC -.word 0x80108090 - -glabel D_800F7FB0 -.word 0x80108298, 0x801082E8, 0x801082C0, 0x80108310, 0x80108338, 0x80108360, 0x80108388 - -glabel D_800F7FCC -.word D_801083D8, 0x80108428, 0x80108400, 0x80108450, 0x80108478, 0x801084A0, 0x801084C8 - -glabel D_800F7FE8 -.word 0xFFFFFFFF - -glabel D_800F7FEC -.word 0x00000001 - -glabel D_800F7FF0 -.word 0x00000002 - -glabel D_800F7FF4 -.word 0x00000004 - -glabel D_800F7FF8 -.word 0x00000005 - -glabel D_800F7FFC -.word 0x00000007 - -glabel D_800F8000 -.word 0x00000008, 0x00000000, 0x00000000, 0x00000000 - -glabel D_800F8010 -.word 0x003251D0, 0x00325AD0, 0x802C05CC, 0x00000000 - -glabel D_800F8020 -.word 0x00000000 - -glabel D_800F8024 -.float 0.0 - -glabel D_800F8028 -.float 0.0 - -glabel D_800F802C -.word 0x00000000 - -glabel D_800F8030 -.float 0.0 - -glabel D_800F8034 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -glabel D_800F803A -.short 0x0000 - -glabel D_800F803C -.word 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/asm/nonmatchings/code_13870_len_6980/create_partner_npc.s b/asm/nonmatchings/code_13870_len_6980/create_partner_npc.s deleted file mode 100644 index 5644418f6e..0000000000 --- a/asm/nonmatchings/code_13870_len_6980/create_partner_npc.s +++ /dev/null @@ -1,12 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel create_partner_npc -/* 13C80 80038880 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 13C84 80038884 0000282D */ daddu $a1, $zero, $zero -/* 13C88 80038888 AFBF0010 */ sw $ra, 0x10($sp) -/* 13C8C 8003888C 0C00E166 */ jal _create_npc -/* 13C90 80038890 24060001 */ addiu $a2, $zero, 1 -/* 13C94 80038894 8FBF0010 */ lw $ra, 0x10($sp) -/* 13C98 80038898 03E00008 */ jr $ra -/* 13C9C 8003889C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_838b0_len_5900/load_partner_npc.s b/asm/nonmatchings/code_838b0_len_5900/load_partner_npc.s deleted file mode 100644 index 425c7c313d..0000000000 --- a/asm/nonmatchings/code_838b0_len_5900/load_partner_npc.s +++ /dev/null @@ -1,58 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel load_partner_npc -/* 83A80 800EA5D0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 83A84 800EA5D4 3C028011 */ lui $v0, %hi(D_8010CFD8) -/* 83A88 800EA5D8 8C42CFD8 */ lw $v0, %lo(D_8010CFD8)($v0) -/* 83A8C 800EA5DC 3C038010 */ lui $v1, %hi(D_800F803C) -/* 83A90 800EA5E0 2463803C */ addiu $v1, $v1, %lo(D_800F803C) -/* 83A94 800EA5E4 AFBF0024 */ sw $ra, 0x24($sp) -/* 83A98 800EA5E8 AFB00020 */ sw $s0, 0x20($sp) -/* 83A9C 800EA5EC 00021180 */ sll $v0, $v0, 6 -/* 83AA0 800EA5F0 00431021 */ addu $v0, $v0, $v1 -/* 83AA4 800EA5F4 8C440000 */ lw $a0, ($v0) -/* 83AA8 800EA5F8 8C450004 */ lw $a1, 4($v0) -/* 83AAC 800EA5FC 8C460008 */ lw $a2, 8($v0) -/* 83AB0 800EA600 3C108011 */ lui $s0, %hi(D_8010CFEC) -/* 83AB4 800EA604 2610CFEC */ addiu $s0, $s0, %lo(D_8010CFEC) -/* 83AB8 800EA608 0C00A5CF */ jal dma_copy -/* 83ABC 800EA60C AE020000 */ sw $v0, ($s0) -/* 83AC0 800EA610 3C020400 */ lui $v0, 0x400 -/* 83AC4 800EA614 34420100 */ ori $v0, $v0, 0x100 -/* 83AC8 800EA618 AFA20010 */ sw $v0, 0x10($sp) -/* 83ACC 800EA61C 8E020000 */ lw $v0, ($s0) -/* 83AD0 800EA620 8C420024 */ lw $v0, 0x24($v0) -/* 83AD4 800EA624 27A40010 */ addiu $a0, $sp, 0x10 -/* 83AD8 800EA628 AFA00018 */ sw $zero, 0x18($sp) -/* 83ADC 800EA62C AFA0001C */ sw $zero, 0x1c($sp) -/* 83AE0 800EA630 0C00E211 */ jal create_basic_npc -/* 83AE4 800EA634 AFA20014 */ sw $v0, 0x14($sp) -/* 83AE8 800EA638 0040202D */ daddu $a0, $v0, $zero -/* 83AEC 800EA63C 3C018011 */ lui $at, %hi(D_8010CFD0) -/* 83AF0 800EA640 AC24CFD0 */ sw $a0, %lo(D_8010CFD0)($at) -/* 83AF4 800EA644 0C00E2B7 */ jal get_npc_by_index -/* 83AF8 800EA648 00000000 */ nop -/* 83AFC 800EA64C 3C048011 */ lui $a0, %hi(D_8010C930) -/* 83B00 800EA650 2484C930 */ addiu $a0, $a0, %lo(D_8010C930) -/* 83B04 800EA654 2403FFFC */ addiu $v1, $zero, -4 -/* 83B08 800EA658 AC820000 */ sw $v0, ($a0) -/* 83B0C 800EA65C A04300A4 */ sb $v1, 0xa4($v0) -/* 83B10 800EA660 8C840000 */ lw $a0, ($a0) -/* 83B14 800EA664 3C01C47A */ lui $at, 0xc47a -/* 83B18 800EA668 44810000 */ mtc1 $at, $f0 -/* 83B1C 800EA66C 2403000A */ addiu $v1, $zero, 0xa -/* 83B20 800EA670 A44300A6 */ sh $v1, 0xa6($v0) -/* 83B24 800EA674 A44300A8 */ sh $v1, 0xa8($v0) -/* 83B28 800EA678 AC800038 */ sw $zero, 0x38($a0) -/* 83B2C 800EA67C E480003C */ swc1 $f0, 0x3c($a0) -/* 83B30 800EA680 AC800040 */ sw $zero, 0x40($a0) -/* 83B34 800EA684 AC800054 */ sw $zero, 0x54($a0) -/* 83B38 800EA688 AC800058 */ sw $zero, 0x58($a0) -/* 83B3C 800EA68C AC80005C */ sw $zero, 0x5c($a0) -/* 83B40 800EA690 8FBF0024 */ lw $ra, 0x24($sp) -/* 83B44 800EA694 8FB00020 */ lw $s0, 0x20($sp) -/* 83B48 800EA698 3C018011 */ lui $at, %hi(D_8010C954) -/* 83B4C 800EA69C AC20C954 */ sw $zero, %lo(D_8010C954)($at) -/* 83B50 800EA6A0 03E00008 */ jr $ra -/* 83B54 800EA6A4 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_838b0_len_5900/_use_partner_ability.s b/asm/nonmatchings/world/partners/_use_partner_ability.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/_use_partner_ability.s rename to asm/nonmatchings/world/partners/_use_partner_ability.s diff --git a/asm/nonmatchings/code_838b0_len_5900/clear_partner_move_history.s b/asm/nonmatchings/world/partners/clear_partner_move_history.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/clear_partner_move_history.s rename to asm/nonmatchings/world/partners/clear_partner_move_history.s diff --git a/asm/nonmatchings/code_838b0_len_5900/enable_partner_ai.s b/asm/nonmatchings/world/partners/enable_partner_ai.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/enable_partner_ai.s rename to asm/nonmatchings/world/partners/enable_partner_ai.s diff --git a/asm/nonmatchings/code_838b0_len_5900/enable_partner_flying.s b/asm/nonmatchings/world/partners/enable_partner_flying.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/enable_partner_flying.s rename to asm/nonmatchings/world/partners/enable_partner_flying.s diff --git a/asm/nonmatchings/code_838b0_len_5900/enable_partner_walking.s b/asm/nonmatchings/world/partners/enable_partner_walking.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/enable_partner_walking.s rename to asm/nonmatchings/world/partners/enable_partner_walking.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EA4B0.s b/asm/nonmatchings/world/partners/func_800EA4B0.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EA4B0.s rename to asm/nonmatchings/world/partners/func_800EA4B0.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EA52C.s b/asm/nonmatchings/world/partners/func_800EA52C.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EA52C.s rename to asm/nonmatchings/world/partners/func_800EA52C.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EA5B8.s b/asm/nonmatchings/world/partners/func_800EA5B8.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EA5B8.s rename to asm/nonmatchings/world/partners/func_800EA5B8.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EA6A8.s b/asm/nonmatchings/world/partners/func_800EA6A8.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EA6A8.s rename to asm/nonmatchings/world/partners/func_800EA6A8.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EB168.s b/asm/nonmatchings/world/partners/func_800EB168.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EB168.s rename to asm/nonmatchings/world/partners/func_800EB168.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EB200.s b/asm/nonmatchings/world/partners/func_800EB200.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EB200.s rename to asm/nonmatchings/world/partners/func_800EB200.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EB2A4.s b/asm/nonmatchings/world/partners/func_800EB2A4.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EB2A4.s rename to asm/nonmatchings/world/partners/func_800EB2A4.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EBA3C.s b/asm/nonmatchings/world/partners/func_800EBA3C.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EBA3C.s rename to asm/nonmatchings/world/partners/func_800EBA3C.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EBB40.s b/asm/nonmatchings/world/partners/func_800EBB40.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EBB40.s rename to asm/nonmatchings/world/partners/func_800EBB40.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EBC74.s b/asm/nonmatchings/world/partners/func_800EBC74.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EBC74.s rename to asm/nonmatchings/world/partners/func_800EBC74.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800ED5D0.s b/asm/nonmatchings/world/partners/func_800ED5D0.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800ED5D0.s rename to asm/nonmatchings/world/partners/func_800ED5D0.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800ED9F8.s b/asm/nonmatchings/world/partners/func_800ED9F8.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800ED9F8.s rename to asm/nonmatchings/world/partners/func_800ED9F8.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EE994.s b/asm/nonmatchings/world/partners/func_800EE994.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EE994.s rename to asm/nonmatchings/world/partners/func_800EE994.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EE9B8.s b/asm/nonmatchings/world/partners/func_800EE9B8.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EE9B8.s rename to asm/nonmatchings/world/partners/func_800EE9B8.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EECC4.s b/asm/nonmatchings/world/partners/func_800EECC4.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EECC4.s rename to asm/nonmatchings/world/partners/func_800EECC4.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EECE8.s b/asm/nonmatchings/world/partners/func_800EECE8.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EECE8.s rename to asm/nonmatchings/world/partners/func_800EECE8.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF300.s b/asm/nonmatchings/world/partners/func_800EF300.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF300.s rename to asm/nonmatchings/world/partners/func_800EF300.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF314.s b/asm/nonmatchings/world/partners/func_800EF314.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF314.s rename to asm/nonmatchings/world/partners/func_800EF314.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF3C0.s b/asm/nonmatchings/world/partners/func_800EF3C0.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF3C0.s rename to asm/nonmatchings/world/partners/func_800EF3C0.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF3D4.s b/asm/nonmatchings/world/partners/func_800EF3D4.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF3D4.s rename to asm/nonmatchings/world/partners/func_800EF3D4.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF3E4.s b/asm/nonmatchings/world/partners/func_800EF3E4.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF3E4.s rename to asm/nonmatchings/world/partners/func_800EF3E4.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF414.s b/asm/nonmatchings/world/partners/func_800EF414.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF414.s rename to asm/nonmatchings/world/partners/func_800EF414.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF43C.s b/asm/nonmatchings/world/partners/func_800EF43C.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF43C.s rename to asm/nonmatchings/world/partners/func_800EF43C.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF4E0.s b/asm/nonmatchings/world/partners/func_800EF4E0.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF4E0.s rename to asm/nonmatchings/world/partners/func_800EF4E0.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF600.s b/asm/nonmatchings/world/partners/func_800EF600.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF600.s rename to asm/nonmatchings/world/partners/func_800EF600.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF628.s b/asm/nonmatchings/world/partners/func_800EF628.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF628.s rename to asm/nonmatchings/world/partners/func_800EF628.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF640.s b/asm/nonmatchings/world/partners/func_800EF640.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF640.s rename to asm/nonmatchings/world/partners/func_800EF640.s diff --git a/asm/nonmatchings/code_838b0_len_5900/func_800EF82C.s b/asm/nonmatchings/world/partners/func_800EF82C.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/func_800EF82C.s rename to asm/nonmatchings/world/partners/func_800EF82C.s diff --git a/asm/nonmatchings/code_838b0_len_5900/is_current_partner_flying.s b/asm/nonmatchings/world/partners/is_current_partner_flying.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/is_current_partner_flying.s rename to asm/nonmatchings/world/partners/is_current_partner_flying.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_can_use_ability.s b/asm/nonmatchings/world/partners/partner_can_use_ability.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_can_use_ability.s rename to asm/nonmatchings/world/partners/partner_can_use_ability.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_get_ride_script.s b/asm/nonmatchings/world/partners/partner_get_ride_script.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_get_ride_script.s rename to asm/nonmatchings/world/partners/partner_get_ride_script.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_handle_after_battle.s b/asm/nonmatchings/world/partners/partner_handle_after_battle.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_handle_after_battle.s rename to asm/nonmatchings/world/partners/partner_handle_after_battle.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_handle_before_battle.s b/asm/nonmatchings/world/partners/partner_handle_before_battle.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_handle_before_battle.s rename to asm/nonmatchings/world/partners/partner_handle_before_battle.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_initialize_data.s b/asm/nonmatchings/world/partners/partner_initialize_data.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_initialize_data.s rename to asm/nonmatchings/world/partners/partner_initialize_data.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_kill_ability_script.s b/asm/nonmatchings/world/partners/partner_kill_ability_script.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_kill_ability_script.s rename to asm/nonmatchings/world/partners/partner_kill_ability_script.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_player_can_pause.s b/asm/nonmatchings/world/partners/partner_player_can_pause.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_player_can_pause.s rename to asm/nonmatchings/world/partners/partner_player_can_pause.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_reset_data.s b/asm/nonmatchings/world/partners/partner_reset_data.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_reset_data.s rename to asm/nonmatchings/world/partners/partner_reset_data.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_resume_ability_script.s b/asm/nonmatchings/world/partners/partner_resume_ability_script.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_resume_ability_script.s rename to asm/nonmatchings/world/partners/partner_resume_ability_script.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_suspend_ability_script.s b/asm/nonmatchings/world/partners/partner_suspend_ability_script.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_suspend_ability_script.s rename to asm/nonmatchings/world/partners/partner_suspend_ability_script.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_test_enemy_collision.s b/asm/nonmatchings/world/partners/partner_test_enemy_collision.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_test_enemy_collision.s rename to asm/nonmatchings/world/partners/partner_test_enemy_collision.s diff --git a/asm/nonmatchings/code_838b0_len_5900/partner_use_ability.s b/asm/nonmatchings/world/partners/partner_use_ability.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/partner_use_ability.s rename to asm/nonmatchings/world/partners/partner_use_ability.s diff --git a/asm/nonmatchings/code_838b0_len_5900/reset_parter_tether_distance.s b/asm/nonmatchings/world/partners/reset_parter_tether_distance.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/reset_parter_tether_distance.s rename to asm/nonmatchings/world/partners/reset_parter_tether_distance.s diff --git a/asm/nonmatchings/code_838b0_len_5900/set_parter_tether_distance.s b/asm/nonmatchings/world/partners/set_parter_tether_distance.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/set_parter_tether_distance.s rename to asm/nonmatchings/world/partners/set_parter_tether_distance.s diff --git a/asm/nonmatchings/code_838b0_len_5900/update_player_move_history.s b/asm/nonmatchings/world/partners/update_player_move_history.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/update_player_move_history.s rename to asm/nonmatchings/world/partners/update_player_move_history.s diff --git a/asm/nonmatchings/code_838b0_len_5900/use_consumable.s b/asm/nonmatchings/world/partners/use_consumable.s similarity index 100% rename from asm/nonmatchings/code_838b0_len_5900/use_consumable.s rename to asm/nonmatchings/world/partners/use_consumable.s diff --git a/first_diff.py b/first_diff.py new file mode 100755 index 0000000000..f0d0ac9746 --- /dev/null +++ b/first_diff.py @@ -0,0 +1,255 @@ +#!/usr/bin/env python3 + +import os.path +import argparse +from subprocess import check_call + +parser = argparse.ArgumentParser( + description="Find the first difference(s) between the built ROM and the base ROM." +) +parser.add_argument( + "-c", + "--count", + type=int, + default=5, + help="find up to this many instruction difference(s)", +) +parser.add_argument( + "-d", + "--diff", + dest="diff_args", + nargs="?", + action="store", + default=False, + const="prompt", + help="run diff.py on the result with the provided arguments" +) +parser.add_argument( + "-m", "--make", help="run ninja before finding difference(s)", action="store_true" +) +args = parser.parse_args() + +diff_count = args.count + +if args.make: + check_call(["ninja", "papermario.z64"]) + +baseimg = f"baserom.z64" +basemap = f"expected/build/papermario.map" + +myimg = f"papermario.z64" +mymap = f"build/papermario.map" + +if not os.path.isfile(baseimg): + print(f"{baseimg} must exist.") + exit(1) +if not os.path.isfile(myimg) or not os.path.isfile(mymap): + print(f"{myimg} and {mymap} must exist.") + exit(1) + +mybin = open(myimg, "rb").read() +basebin = open(baseimg, "rb").read() + +if len(mybin) != len(basebin): + print("Modified ROM has different size...") + exit(1) + +if mybin == basebin: + print("No differences!") + exit(0) + + +def search_rom_address(target_addr): + ram_offset = None + prev_ram = 0 + prev_rom = 0 + prev_sym = "" + cur_file = "" + prev_file = cur_file + prev_line = "" + with open(mymap) as f: + for line in f: + if "load address" in line: + # Ignore .bss sections since we're looking for a ROM address + if ".bss" in line or ".bss" in prev_line: + ram_offset = None + continue + ram = int(line[16 : 16 + 18], 0) + rom = int(line[59 : 59 + 18], 0) + ram_offset = ram - rom + continue + + prev_line = line + + if ( + ram_offset is None + or "=" in line + or "*fill*" in line + or " 0x" not in line + ): + continue + + ram = int(line[16 : 16 + 18], 0) + rom = ram - ram_offset + sym = line.split()[-1] + + if "0x" in sym: + ram_offset = None + continue + if "/" in sym: + cur_file = sym + continue + + if rom > target_addr: + return f"{prev_sym} (RAM 0x{prev_ram:X}, ROM 0x{prev_rom:X}, {prev_file})" + + prev_ram = ram + prev_rom = rom + prev_sym = sym + prev_file = cur_file + + return "at end of rom?" + + +def parse_map(map_fname): + ram_offset = None + cur_file = "" + syms = {} + prev_sym = None + prev_line = "" + with open(map_fname) as f: + for line in f: + if "load address" in line: + ram = int(line[16 : 16 + 18], 0) + rom = int(line[59 : 59 + 18], 0) + ram_offset = ram - rom + continue + + prev_line = line + + if ( + ram_offset is None + or "=" in line + or "*fill*" in line + or " 0x" not in line + ): + continue + + ram = int(line[16 : 16 + 18], 0) + rom = ram - ram_offset + sym = line.split()[-1] + + if "0x" in sym: + ram_offset = None + continue + elif "/" in sym: + cur_file = sym + continue + + syms[sym] = (rom, cur_file, prev_sym, ram) + prev_sym = sym + + return syms + + +def map_diff(): + map1 = parse_map(mymap) + map2 = parse_map(basemap) + min_ram = None + found = None + for sym, addr in map1.items(): + if sym not in map2: + continue + if addr[0] != map2[sym][0]: + if min_ram is None or addr[0] < min_ram: + min_ram = addr[0] + found = (sym, addr[1], addr[2]) + if min_ram is None: + return False + else: + print( + f"Map appears to have shifted just before {found[0]} ({found[1]}) -- in {found[2]}?" + ) + if found[2] is not None and found[2] not in map2: + print( + f"(Base map file {basemap} out of date due to new or renamed symbols, so result may be imprecise.)" + ) + return True + + +def hexbytes(bs): + return ":".join("{:02X}".format(c) for c in bs) + + +found_instr_diff = [] +map_search_diff = [] +diffs = 0 +shift_cap = 1000 +for i in range(24, len(mybin), 4): + # (mybin[i:i+4] != basebin[i:i+4], but that's slightly slower in CPython...) + if diffs <= shift_cap and ( + mybin[i] != basebin[i] + or mybin[i + 1] != basebin[i + 1] + or mybin[i + 2] != basebin[i + 2] + or mybin[i + 3] != basebin[i + 3] + ): + if diffs == 0: + print(f"First difference at ROM addr 0x{i:X}, {search_rom_address(i)}") + print( + f"Bytes: {hexbytes(mybin[i : i + 4])} vs {hexbytes(basebin[i : i + 4])}" + ) + diffs += 1 + if ( + len(found_instr_diff) < diff_count + and mybin[i] >> 2 != basebin[i] >> 2 + and not search_rom_address(i) in map_search_diff + ): + found_instr_diff.append(i) + map_search_diff.append(search_rom_address(i)) + +if diffs == 0: + print("No differences but ROMs differ?") + exit() + +if len(found_instr_diff) > 0: + for i in found_instr_diff: + print(f"Instruction difference at ROM addr 0x{i:X}, {search_rom_address(i)}") + print( + f"Bytes: {hexbytes(mybin[i : i + 4])} vs {hexbytes(basebin[i : i + 4])}" + ) +print() + +definite_shift = diffs > shift_cap +if definite_shift: + print(f"Over {shift_cap} differing words, must be a shifted ROM.") +else: + print(f"{diffs} differing word(s).") + +if diffs > 100: + if not os.path.isfile(basemap): + print( + f"To find ROM shifts, copy a clean .map file to {basemap} and rerun this script." + ) + elif not map_diff(): + print(f"No ROM shift{' (!?)' if definite_shift else ''}") + +if args.diff_args: + if len(found_instr_diff) < 1: + print(f"No instruction difference to run diff.py on") + exit() + + diff_sym = search_rom_address(found_instr_diff[0]).split()[0] + if args.diff_args == "prompt": + diff_args = input("Call diff.py with which arguments? ") or "--" + else: + diff_args = args.diff_args + if diff_args[0] != "-": + diff_args = "-" + diff_args + check_call( + [ + "python3", + "diff.py", + diff_args, + diff_sym, + ] + ) diff --git a/include/common_structs.h b/include/common_structs.h index 2b0fb9c55f..8f712bd2bd 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -61,9 +61,7 @@ typedef struct Vec4f { /* 0x0C */ f32 yaw; } Vec4f; // size = 0x10 -typedef struct Matrix4f { - /* 0x00 */ f32 mtx[4][4]; -} Matrix4f; // size = 0x40 +typedef f32 Matrix4f[4][4]; // size = 0x40 typedef struct Matrix4s { /* 0x00 */ s16 whole[4][4]; @@ -318,7 +316,7 @@ typedef struct Entity { /* 0x54 */ Vec3f scale; /* 0x60 */ Vec3f rotation; /* 0x6C */ char unk_6C[4]; - /* 0x70 */ struct Matrix4f* inverseTransformMatrix; /* world-to-local */ + /* 0x70 */ Matrix4f* inverseTransformMatrix; /* world-to-local */ /* 0x74 */ char unk_74[60]; /* 0xB0 */ float effectiveSize; /* 0xB4 */ char unk_B4[4]; @@ -487,10 +485,10 @@ typedef struct Camera { /* 0x098 */ char unk_98[8]; /* 0x0A0 */ Vp viewport; /* 0x0B0 */ char unk_B0[0x24]; - /* 0x0D4 */ struct Matrix4f perspectiveMatrix; - /* 0x114 */ struct Matrix4f viewMtxPlayer; /* centers on player */ - /* 0x154 */ struct Matrix4f viewMtxLeading; /* leads player slightly */ - /* 0x194 */ struct Matrix4f viewMtxShaking; /* used while ShakeCam is active */ + /* 0x0D4 */ Matrix4f perspectiveMatrix; + /* 0x114 */ Matrix4f viewMtxPlayer; /* centers on player */ + /* 0x154 */ Matrix4f viewMtxLeading; /* leads player slightly */ + /* 0x194 */ Matrix4f viewMtxShaking; /* used while ShakeCam is active */ /* 0x1D4 */ char unk_1D4[48]; /* 0x204 */ struct Matrix4s* unkMatrix; /* 0x208 */ char unk_208[572]; @@ -715,7 +713,7 @@ typedef struct Model { /* 0x10 */ s32* currentSpecialMatrix; /* 0x14 */ char unk_14[4]; /* 0x18 */ struct Matrix4s specialMatrix; - /* 0x58 */ struct Matrix4f transformMatrix; + /* 0x58 */ Matrix4f transformMatrix; /* 0x98 */ f32 center[3]; /* Created by retype action */ /* 0xA4 */ u8 texPannerID; /* 0xA5 */ u8 specialDisplayListID; diff --git a/include/enums.h b/include/enums.h index 94804ea2f7..b458973d81 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1010,9 +1010,9 @@ typedef s8 ActionState; #define ActionState_USE_SPRING 0x00000026 typedef s32 NpcId; -#define NpcId_SELF 0xFFFFFFFF -#define NpcId_PLAYER 0xFFFFFFFE -#define NpcId_PARTNER 0xFFFFFFFC +#define NpcId_SELF -1 +#define NpcId_PLAYER -2 +#define NpcId_PARTNER -4 typedef UNK_TYPE TriggerFlag; #define TriggerFlag_FLOOR_TOUCH 0x00000080 diff --git a/include/map.h b/include/map.h index 44d64610d5..df27b20267 100644 --- a/include/map.h +++ b/include/map.h @@ -54,6 +54,13 @@ typedef struct Area { /* 0x0C */ char* name; ///< JP debug name. } Area; // size = 0x10 +typedef struct NpcBlueprint { + /* 0x00 */ s32 flags; + /* 0x04 */ NpcAnimID initialAnim; + /* 0x08 */ UNK_FUN_PTR(onUpdate); + /* 0x0C */ UNK_FUN_PTR(onRender); +} NpcBlueprint; // size = 0x10 + typedef struct NpcAISettings { /* 0x00 */ f32 moveSpeed; /* 0x04 */ s32 moveTime; diff --git a/include/variables.h b/include/variables.h index 62428efe76..bf9cae194e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -313,4 +313,10 @@ extern s32 D_802920E8[]; extern s32 D_80292110[]; extern s32 D_8028358C[]; +extern UNK_PTR D_800F7BE8; +extern UNK_PTR D_800F7BBC; +extern UNK_PTR D_800F7B94; + +extern s32 D_802C05CC; + #endif diff --git a/src/code_13870_len_6980.c b/src/code_13870_len_6980.c index a2ce84576a..306f3d8d97 100644 --- a/src/code_13870_len_6980.c +++ b/src/code_13870_len_6980.c @@ -5,11 +5,11 @@ void NOP_npc_callback(void) { } void mtx_ident_mirror_y(Matrix4f* mtx) { - guMtxIdentF(mtx); - mtx->mtx[0][0] = 1.0f; - mtx->mtx[1][1] = -1.0f; - mtx->mtx[2][2] = 1.0f; - mtx->mtx[3][3] = 1.0f; + guMtxIdentF(*mtx); + (*mtx)[0][0] = 1.0f; + (*mtx)[1][1] = -1.0f; + (*mtx)[2][2] = 1.0f; + (*mtx)[3][3] = 1.0f; } INCLUDE_ASM(s32, "code_13870_len_6980", clear_npcs); @@ -18,13 +18,15 @@ INCLUDE_ASM(s32, "code_13870_len_6980", init_npc_list); INCLUDE_ASM(s32, "code_13870_len_6980", func_8003857C); -INCLUDE_ASM(s32, "code_13870_len_6980", _create_npc); +INCLUDE_ASM(s32, "code_13870_len_6980", _create_npc, NpcBlueprint* blueprint, s32 animList[], s32 skipLoadingAnims); INCLUDE_ASM(s32, "code_13870_len_6980", create_basic_npc); INCLUDE_ASM(s32, "code_13870_len_6980", create_standard_npc); -INCLUDE_ASM(s32, "code_13870_len_6980", create_partner_npc); +void create_partner_npc(NpcBlueprint* blueprint) { + _create_npc(blueprint, NULL, TRUE); +} INCLUDE_ASM(s32, "code_13870_len_6980", free_npc_by_index); diff --git a/src/code_316f30.c b/src/code_316f30.c index 278781e7c3..feb778fe2a 100644 --- a/src/code_316f30.c +++ b/src/code_316f30.c @@ -4,28 +4,22 @@ void func_80200000(void); void func_80200080(void); void func_802AE000(void); -extern s32 D_003169F0; -extern s32 D_00316A70; -extern s32 D_00316C00; -extern s32 D_00316D90; -extern s32 D_00316F30; - void func_802B2000(void) { - dma_copy(&D_003169F0, &D_00316A70, func_80200000); + dma_copy(&code_code_3169F0_ROM_START, &code_code_3169F0_ROM_END, &code_code_3169F0_VRAM); func_80200000(); } void func_802B203C(void) { - dma_copy(&D_00316A70, &D_00316C00, func_80200080); + dma_copy(&code_code_316A70_ROM_START, &code_code_316A70_ROM_END, &code_code_316A70_VRAM); func_80200080(); } void func_802B2078(void) { - dma_copy(&D_00316C00, &D_00316D90, func_802AE000); + dma_copy(&code_code_316C00_ROM_START, &code_code_316C00_ROM_END, &code_code_316C00_VRAM); func_802AE000(); } void func_802B20B4(void) { - dma_copy(&D_00316D90, &D_00316F30, func_802AE000); + dma_copy(&code_code_316D90_ROM_START, &code_code_316D90_ROM_END, &code_code_316D90_VRAM); func_802AE000(); } diff --git a/src/code_759b0_len_61b0.c b/src/code_759b0_len_61b0.c index 67bb7a0469..92a04f4719 100644 --- a/src/code_759b0_len_61b0.c +++ b/src/code_759b0_len_61b0.c @@ -1,5 +1,7 @@ #include "common.h" +PlayerStatus* gPlayerStatusPtr = &gPlayerStatus; // maybe wPlayerStatus + INCLUDE_ASM(s32, "code_759b0_len_61b0", func_800DC500); INCLUDE_ASM(s32, "code_759b0_len_61b0", func_800DC778); diff --git a/src/code_7bb60_len_41b0.c b/src/code_7bb60_len_41b0.c index 15e19396bf..c782d58865 100644 --- a/src/code_7bb60_len_41b0.c +++ b/src/code_7bb60_len_41b0.c @@ -289,3 +289,4 @@ INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E6500); INCLUDE_ASM(s32, "code_7bb60_len_41b0", make_disguise_npc); INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E66C4); + diff --git a/src/code_838b0_len_5900.c b/src/code_838b0_len_5900.c deleted file mode 100644 index fe7108e664..0000000000 --- a/src/code_838b0_len_5900.c +++ /dev/null @@ -1,116 +0,0 @@ -#include "common.h" - -INCLUDE_ASM(s32, "code_838b0_len_5900", use_consumable); - -void remove_consumable(void) { - gPlayerData.invItems[D_8010CD20] = 0; - sort_items(); -} - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EA4B0); - -s32 world_partner_can_use_ability_default(Npc* partner) { - return D_8010EBB0[0] == 0; -} - -s32 world_partner_can_player_pause_default(Npc* partner) { - return TRUE; -} - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EA52C); - -INCLUDE_ASM(s32, "code_838b0_len_5900", is_current_partner_flying, void); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EA5B8); - -INCLUDE_ASM(s32, "code_838b0_len_5900", load_partner_npc); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EA6A8); - -INCLUDE_ASM(s32, "code_838b0_len_5900", _use_partner_ability); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EB168, s32 arg0); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EB200); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EB2A4); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_use_ability); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_player_can_pause); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_can_use_ability); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_reset_data); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_initialize_data); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_test_enemy_collision); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_get_ride_script); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_handle_before_battle); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_handle_after_battle); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_kill_ability_script); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_suspend_ability_script); - -INCLUDE_ASM(s32, "code_838b0_len_5900", partner_resume_ability_script); - -INCLUDE_ASM(void, "code_838b0_len_5900", enable_partner_walking, Npc* partner, s32 val); - -INCLUDE_ASM(void, "code_838b0_len_5900", func_800EBA3C, Npc* partner); - -INCLUDE_ASM(void, "code_838b0_len_5900", func_800EBB40, Npc* partner); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EBC74); - -INCLUDE_ASM(void, "code_838b0_len_5900", enable_partner_flying, Npc* partner, s32 val); - -INCLUDE_ASM(void, "code_838b0_len_5900", update_player_move_history, Npc* partner); - -INCLUDE_ASM(void, "code_838b0_len_5900", func_800ED5D0, Npc* partner); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800ED9F8); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EE994); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EE9B8); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EECC4); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EECE8); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF300); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF314); - -INCLUDE_ASM(void, "code_838b0_len_5900", enable_partner_ai, void); - -INCLUDE_ASM(s32, "code_838b0_len_5900", set_parter_tether_distance, f32 arg0); - -INCLUDE_ASM(s32, "code_838b0_len_5900", reset_parter_tether_distance); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF3C0); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF3D4); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF3E4); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF414); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF43C); - -INCLUDE_ASM(void, "code_838b0_len_5900", clear_partner_move_history, Npc* partner); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF4E0); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF600); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF628); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF640); - -INCLUDE_ASM(s32, "code_838b0_len_5900", func_800EF82C); diff --git a/src/code_b72b0_len_15ed0.c b/src/code_b72b0_len_15ed0.c index 2e629c5899..f3ab8bdc70 100644 --- a/src/code_b72b0_len_15ed0.c +++ b/src/code_b72b0_len_15ed0.c @@ -21,12 +21,12 @@ INCLUDE_ASM(s32, "code_b72b0_len_15ed0", update_entity_rendercmd); INCLUDE_ASM(s32, "code_b72b0_len_15ed0", step_entity_rendercmd); -void make_mtx_flipZ(Matrix4f* arg0) { - guMtxIdentF(arg0->mtx); - arg0->mtx[0][0] = 1.0f; - arg0->mtx[1][1] = 1.0f; - arg0->mtx[2][2] = -1.0f; - arg0->mtx[3][3] = 1.0f; +void make_mtx_flipZ(Matrix4f* mtx) { + guMtxIdentF(*mtx); + (*mtx)[0][0] = 1.0f; + (*mtx)[1][1] = 1.0f; + (*mtx)[2][2] = -1.0f; + (*mtx)[3][3] = 1.0f; } INCLUDE_ASM(s32, "code_b72b0_len_15ed0", appendGfx_entity_model); diff --git a/src/world/actions.c b/src/world/actions.c new file mode 100644 index 0000000000..2194184f6b --- /dev/null +++ b/src/world/actions.c @@ -0,0 +1,77 @@ +#include "common.h" + +s32 func_802B6000_E24920(); +s32 func_802B6288_E23968(); +s32 func_802B60B4_E240F4(); +s32 func_802B6198_E241D8(); +s32 func_802B6294_E242D4(); +s32 func_802B6060_E27570(); +s32 func_802B6348_E24388(); +s32 func_802B61C0_E24AE0(); +s32 func_802B6638_E29068(); +s32 func_802B66A8_E25578(); +s32 func_802B6350_E28D80(); +s32 func_802B6508_E28F38(); +s32 func_802B6230_E24800(); +s32 func_802B6120_E2A7D0(); +s32 func_802B63D4_E28E04(); +s32 func_802B6478_E28EA8(); +s32 func_802B60A4_E29514(); +s32 func_802B609C_E28ACC(); + +f32 D_800F7B40 = 0.0f; +s32 D_800F7B44 = 0; +f32 D_800F7B48 = 0.0f; +s32 D_800F7B4C = 0; + +s32 D_800F7B50[] = { 0x417C1B33, 0xC0EC5C14, 0x405C9AAA, 0xBF400000 }; +s32 D_800F7B60[] = { 0x3E1E0C17, 0xBEB33DB0, 0xBE3AA2E4, 0x3C3CBE62 }; +f32 D_800F7B70[] = { 2.0, 4.0, 32.0, -32.0 }; +s32 D_800F7B80[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; // possibly s16 +s32 D_800F7B90[] = { 0x00000000, 0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390008, 0x00390007, 0x00390013, 0x00390014, 0xFFFFFFFF, 0x005A0000, 0x005A0002, 0x005A0003, 0x005A0004, 0x005A0006, 0x005A0007, 0x005A0009, 0x005A000A, 0x005A000B, 0x005A001A, 0xFFFFFFFF, 0x00580000, 0x00580001, 0x00580002, 0x00580004, 0x00580005, 0x00580006, 0x00580007, 0x00580008, 0x00580009, 0x00580012, 0x00580014, 0x0058001B, 0xFFFFFFFF }; +s32 D_800F7C1C[] = { 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000 }; +s32 D_800F7C30[] = { 0x0058001B, 0x00580001, 0x00580004, 0x00580006, 0x00580008, 0x00580000, 0x0058001B, 0x005A0003, 0x005A0006, 0x005A0009, 0x005A000B, 0x005A0000, 0x005A001A, 0x00390002, 0x00390003, 0x00390004, 0x00390005, 0x00390000, 0x00390014 }; +void* D_800F7C7C[] = { &D_800F7BE8, &D_800F7BE8, &D_800F7BBC, &D_800F7B94 }; +s32 D_800F7C8C[] = { + // TODO: struct for dma table + // TODO: ld addrs + (s32)&func_802B6000_E24920, &code_code_E23260_ROM_START, &code_code_E23260_ROM_END, 0x01000000, + (s32)&func_802B6000_E24920, 0x00E236E0, 0x00E24040, 0x01000000, + (s32)&func_802B6288_E23968, 0x00E236E0, 0x00E24040, 0x01000000, + (s32)&func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000, + (s32)&func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x01000000, + (s32)&func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000, + (s32)&func_802B60B4_E240F4, 0x00E24040, 0x00E245D0, 0x00000000, + (s32)&func_802B6198_E241D8, 0x00E24040, 0x00E245D0, 0x00000000, + (s32)&func_802B6294_E242D4, 0x00E24040, 0x00E245D0, 0x01000000, + (s32)&func_802B6348_E24388, 0x00E24040, 0x00E245D0, 0x01000000, + (s32)&func_802B6000_E24920, 0x00E24920, 0x00E24ED0, 0x01000000, + (s32)&func_802B61C0_E24AE0, 0x00E24920, 0x00E24ED0, 0x01000000, + (s32)&func_802B6638_E29068, 0x00E28A30, 0x00E291A0, 0x01000000, + (s32)&func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E26DE0, 0x00E27510, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E26710, 0x00E26DE0, 0x00000000, + (s32)&func_802B6060_E27570, 0x00E27510, 0x00E27C90, 0x00000000, + (s32)&func_802B66A8_E25578, 0x00E24ED0, 0x00E25D60, 0x00000000, + (s32)&func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, + (s32)&func_802B6508_E28F38, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E27C90, 0x00E27F40, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E287F0, 0x00E28A30, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E27F40, 0x00E287F0, 0x00000000, + (s32)&func_802B6230_E24800, 0x00E245D0, 0x00E24920, 0x01000000, + (s32)&func_802B6120_E2A7D0, 0x00E2A6B0, 0x00E2B530, 0x01000000, + (s32)&func_802B6000_E24920, 0x00E25D60, 0x00E26710, 0x00000000, + (s32)&func_802B63D4_E28E04, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B6478_E28EA8, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B60A4_E29514, 0x00E29470, 0x00E2A340, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E291A0, 0x00E29470, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E2A340, 0x00E2A6B0, 0x00000000, + (s32)&func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, + (s32)&func_802B6000_E24920, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B6000_E24920, 0x00E245D0, 0x00E24920, 0x01000000, + (s32)&func_802B609C_E28ACC, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x00000000, + (s32)&func_802B6350_E28D80, 0x00E236E0, 0x00E24040, 0x00000000, + (s32)&func_802B6350_E28D80, 0x00E28A30, 0x00E291A0, 0x01000000, +}; diff --git a/src/world/common/Bandit_DropCoin.inc.c b/src/world/common/Bandit_DropCoin.inc.c index 42191bc099..063a5965f9 100644 --- a/src/world/common/Bandit_DropCoin.inc.c +++ b/src/world/common/Bandit_DropCoin.inc.c @@ -18,15 +18,15 @@ ApiStatus N(Bandit_DropCoin)(ScriptInstance* script, s32 isInitialCall) { } else if (npcID >= -270000000) { npc = get_npc_unsafe(npcID); } else { - npc = npcID; + npc = (Npc*)npcID; } - script->functionTemp[0].s = npc; + script->functionTemp[0].s = (s32)npc; script->functionTemp[1].s = itemEntityIndex; script->functionTemp[2].s = areaFlag; } - npc = script->functionTemp[0].s; + npc = (Npc*)script->functionTemp[0].s; itemEntityIndex = script->functionTemp[1].s; areaFlag = script->functionTemp[2].s; diff --git a/src/world/common/GetNpcUnsafeOwner2.inc.c b/src/world/common/GetNpcUnsafeOwner2.inc.c index d33a83ccf3..dddf005631 100644 --- a/src/world/common/GetNpcUnsafeOwner2.inc.c +++ b/src/world/common/GetNpcUnsafeOwner2.inc.c @@ -2,6 +2,6 @@ #include "map.h" ApiStatus N(GetNpcUnsafeOwner2)(ScriptInstance* script, s32 isInitialCall) { - get_npc_unsafe(script->owner2.npc); + get_npc_unsafe(script->owner2.npcID); return ApiStatus_BLOCK; } diff --git a/src/world/common/SomeMatrixOperations.inc.c b/src/world/common/SomeMatrixOperations.inc.c index f5ca58a517..9caf36f6f6 100644 --- a/src/world/common/SomeMatrixOperations.inc.c +++ b/src/world/common/SomeMatrixOperations.inc.c @@ -2,10 +2,10 @@ #include "map.h" void N(SomeMatrixOperation)(Matrix4f* mtx, f32 arg1, f32 arg2, f32 arg3) { - guMtxIdentF(mtx); - mtx->mtx[1][0] = arg1 * arg2; - mtx->mtx[1][1] = 1.0f; - mtx->mtx[1][2] = arg1 * arg3; + guMtxIdentF(*mtx); + (*mtx)[1][0] = arg1 * arg2; + (*mtx)[1][1] = 1.0f; + (*mtx)[1][2] = arg1 * arg3; } ApiStatus N(SomeMatrixOperation2)(ScriptInstance* script, s32 isInitialCall) { @@ -19,19 +19,19 @@ ApiStatus N(SomeMatrixOperation2)(ScriptInstance* script, s32 isInitialCall) { Matrix4f mtx; if (!(model->flags & 0x400)) { - guTranslateF(&model->transformMatrix, 0.0f, temp_f22, 0.0f); + guTranslateF(model->transformMatrix, 0.0f, temp_f22, 0.0f); N(SomeMatrixOperation)(&mtx, temp_f28, temp_f26, temp_f24); - guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix); + guMtxCatF(mtx, model->transformMatrix, model->transformMatrix); guTranslateF(&mtx, 0.0f, -temp_f22, 0.0f); - guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix); + guMtxCatF(mtx, model->transformMatrix, model->transformMatrix); model->flags |= 0x1400; } else { - guTranslateF(&mtx, 0.0f, temp_f22, 0.0f); - guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix); + guTranslateF(mtx, 0.0f, temp_f22, 0.0f); + guMtxCatF(mtx, model->transformMatrix, model->transformMatrix); N(SomeMatrixOperation)(&mtx, temp_f28, temp_f26, temp_f24); - guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix); - guTranslateF(&mtx, 0.0f, -temp_f22, 0.0f); - guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix); + guMtxCatF(mtx, model->transformMatrix, model->transformMatrix); + guTranslateF(mtx, 0.0f, -temp_f22, 0.0f); + guMtxCatF(mtx, model->transformMatrix, model->transformMatrix); } return ApiStatus_DONE2; diff --git a/src/world/partner/goombario.c b/src/world/partner/goombario.c index 5f5cf5a2c9..e1d45b20b3 100644 --- a/src/world/partner/goombario.c +++ b/src/world/partner/goombario.c @@ -61,20 +61,20 @@ ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall) { // Something is up with D_8010EBB0 I think. It might be a struct or something #ifdef NON_MATCHING -void world_goombario_pre_battle(s32 arg0) { +void world_goombario_pre_battle(Npc* partner) { if (D_8010EBB0[0] != 0) { func_80027088(0); enable_player_input(); CancelMessageAndBlock(); - clear_partner_move_history(arg0); + clear_partner_move_history(partner); D_8010EBB0[0] = 0; D_8010EBB0[3] = 0; - disable_npc_blur(arg0); + disable_npc_blur(partner); } D_8010EBB0[3] = 1; } #else -INCLUDE_ASM(void, "world/partner/goombario", world_goombario_pre_battle, s32 arg0); +INCLUDE_ASM(void, "world/partner/goombario", world_goombario_pre_battle, Npc* partner); #endif s32 D_802BDC40_317B60[] = { diff --git a/src/world/partner/goombario.h b/src/world/partner/goombario.h index 73b99651be..da8b6be25d 100644 --- a/src/world/partner/goombario.h +++ b/src/world/partner/goombario.h @@ -7,7 +7,7 @@ void world_goombario_init(Npc* partner); s32 world_goombario_can_pause(Npc* partner); ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall); -void world_goombario_pre_battle(s32 arg0); +void world_goombario_pre_battle(Npc* partner); Script world_goombario_take_out; Script world_goombario_update; diff --git a/src/world/partners.c b/src/world/partners.c index 456316acfa..7527767518 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -1,6 +1,7 @@ #include "common.h" #include "ld_addrs.h" #include "partners.h" +#include "map.h" #include "partner/goombario.h" #include "sprite/npc/world_goombario.h" @@ -32,10 +33,39 @@ s32 world_partner_can_use_ability_default(Npc* partner); s32 world_partner_can_player_pause_default(Npc* partner); -static s32 _pad[] = { 0x00, 0x00, 0x00 }; +// Partner icons +s32 D_800F7F00[] = { + 0x80107CA8, 0x80107CF8, 0x80107D48, 0x80107D98, 0x80107DE8, 0x80107CA8, 0x80107E88, 0x80107ED8, 0x80107F28, 0x80107E38, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8, 0x80107FC8, +}; +s32 D_800F7F40[] = { + 0x80107CD0, 0x80107D20, 0x80107D70, 0x80107DC0, 0x80107E10, 0x80107CD0, 0x80107EB0, 0x80107F00, 0x80107F50, 0x80107E60, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0, 0x80107FF0, +}; +s32 D_800F7F80[] = { + 0x801080B8, 0x801080E0, 0x80108108, 0x80108130, 0x80108158, 0x80108180, 0x801081A8, 0x801081D0, 0x801081F8, 0x80108220, +}; +s32* D_800F7FA8 = &D_80108068; +s32 D_800F7FAC = 0x80108090; +s32 D_800F7FB0[] = { 0x80108298, 0x801082E8, 0x801082C0, 0x80108310, 0x80108338, 0x80108360, 0x80108388 }; +s32 D_800F7FCC[] = { (s32)&D_801083D8, 0x80108428, 0x80108400, 0x80108450, 0x80108478, 0x801084A0, 0x801084C8 }; -WorldPartner gWorldPartners[] = { - // XXX: it's possible that's there's a "none" entry here to match up with enum PartnerID +s32 D_800F7FE8 = -1; +s32 D_800F7FEC = 1; +s32 D_800F7FF0 = 2; +s32 D_800F7FF4 = 4; +s32 D_800F7FF8 = 5; +s32 D_800F7FFC = 7; +s32 D_800F8000[] = { 8, 0, 0, 0 }; +s32 D_800F8010[] = { 0x003251D0, 0x00325AD0, (s32)&D_802C05CC, 0x00000000 }; +s32 D_800F8020 = 0; +f32 D_800F8024 = 0.0f; +f32 D_800F8028 = 0.0f; +s32 D_800F802C = 0; +f32 D_800F8030 = 0.0f; +s8 D_800F8034[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +s16 D_800F803A = 0; + +WorldPartner wPartners[12] = { + {}, // None { // Goombario .dmaStart = &world_partner_goombario_ROM_START, @@ -214,3 +244,159 @@ WorldPartner gWorldPartners[] = { .canPlayerPause = world_partner_can_use_ability_default, }, }; + + +NpcId create_basic_npc(NpcBlueprint* blueprint); + +INCLUDE_ASM(s32, "world/partners", use_consumable); + +void remove_consumable(void) { + gPlayerData.invItems[D_8010CD20] = 0; + sort_items(); +} + +INCLUDE_ASM(s32, "world/partners", func_800EA4B0); + +s32 world_partner_can_use_ability_default(Npc* partner) { + return D_8010EBB0[0] == 0; +} + +s32 world_partner_can_player_pause_default(Npc* partner) { + return TRUE; +} + +INCLUDE_ASM(s32, "world/partners", func_800EA52C); + +INCLUDE_ASM(s32, "world/partners", is_current_partner_flying, void); + +INCLUDE_ASM(s32, "world/partners", func_800EA5B8); + +void load_partner_npc(void) { + WorldPartner* partnerEntry = &wPartners[D_8010CFD8]; + Npc** partnerNpcPtr = &D_8010C930; + WorldPartner** partner = &D_8010CFEC; + NpcId npcIndex; + NpcBlueprint blueprint; + NpcBlueprint* blueprintPtr; + + *partner = partnerEntry; + blueprintPtr = &blueprint; + dma_copy(partnerEntry->dmaStart, partnerEntry->dmaEnd, partnerEntry->dmaDest); + + blueprint.flags = 0x4000100; + blueprint.initialAnim = (*partner)->idle; + blueprint.onUpdate = NULL; + blueprint.onRender = NULL; + D_8010CFD0 = npcIndex = create_basic_npc(blueprintPtr); + + *partnerNpcPtr = get_npc_by_index(npcIndex); + + { + Npc* npc = *partnerNpcPtr; + npc->npcID = NpcId_PARTNER; + npc->collisionRadius = 10; + npc->collisionHeight = 10; + } + + { + Npc* npc = *partnerNpcPtr; + npc->pos.x = 0.0f; + npc->pos.y = -1000.0f; + npc->pos.z = 0.0f; + npc->scale.x = 0.0f; + npc->scale.y = 0.0f; + npc->scale.z = 0.0f; + } + + D_8010C954 = 0; +} + +INCLUDE_ASM(s32, "world/partners", func_800EA6A8); + +INCLUDE_ASM(s32, "world/partners", _use_partner_ability); + +INCLUDE_ASM(s32, "world/partners", func_800EB168, s32 arg0); + +INCLUDE_ASM(s32, "world/partners", func_800EB200); + +INCLUDE_ASM(s32, "world/partners", func_800EB2A4); + +INCLUDE_ASM(s32, "world/partners", partner_use_ability); + +INCLUDE_ASM(s32, "world/partners", partner_player_can_pause); + +INCLUDE_ASM(s32, "world/partners", partner_can_use_ability); + +INCLUDE_ASM(s32, "world/partners", partner_reset_data); + +INCLUDE_ASM(s32, "world/partners", partner_initialize_data); + +INCLUDE_ASM(s32, "world/partners", partner_test_enemy_collision); + +INCLUDE_ASM(s32, "world/partners", partner_get_ride_script); + +INCLUDE_ASM(s32, "world/partners", partner_handle_before_battle); + +INCLUDE_ASM(s32, "world/partners", partner_handle_after_battle); + +INCLUDE_ASM(s32, "world/partners", partner_kill_ability_script); + +INCLUDE_ASM(s32, "world/partners", partner_suspend_ability_script); + +INCLUDE_ASM(s32, "world/partners", partner_resume_ability_script); + +INCLUDE_ASM(void, "world/partners", enable_partner_walking, Npc* partner, s32 val); + +INCLUDE_ASM(void, "world/partners", func_800EBA3C, Npc* partner); + +INCLUDE_ASM(void, "world/partners", func_800EBB40, Npc* partner); + +INCLUDE_ASM(s32, "world/partners", func_800EBC74); + +INCLUDE_ASM(void, "world/partners", enable_partner_flying, Npc* partner, s32 val); + +INCLUDE_ASM(void, "world/partners", update_player_move_history, Npc* partner); + +INCLUDE_ASM(void, "world/partners", func_800ED5D0, Npc* partner); + +INCLUDE_ASM(s32, "world/partners", func_800ED9F8); + +INCLUDE_ASM(s32, "world/partners", func_800EE994); + +INCLUDE_ASM(s32, "world/partners", func_800EE9B8); + +INCLUDE_ASM(s32, "world/partners", func_800EECC4); + +INCLUDE_ASM(s32, "world/partners", func_800EECE8); + +INCLUDE_ASM(s32, "world/partners", func_800EF300); + +INCLUDE_ASM(s32, "world/partners", func_800EF314); + +INCLUDE_ASM(void, "world/partners", enable_partner_ai, void); + +INCLUDE_ASM(s32, "world/partners", set_parter_tether_distance, f32 arg0); + +INCLUDE_ASM(s32, "world/partners", reset_parter_tether_distance); + +INCLUDE_ASM(s32, "world/partners", func_800EF3C0); + +INCLUDE_ASM(s32, "world/partners", func_800EF3D4); + +INCLUDE_ASM(s32, "world/partners", func_800EF3E4); + +INCLUDE_ASM(s32, "world/partners", func_800EF414); + +INCLUDE_ASM(s32, "world/partners", func_800EF43C); + +INCLUDE_ASM(void, "world/partners", clear_partner_move_history, Npc* partner); + +INCLUDE_ASM(s32, "world/partners", func_800EF4E0); + +INCLUDE_ASM(s32, "world/partners", func_800EF600); + +INCLUDE_ASM(s32, "world/partners", func_800EF628); + +INCLUDE_ASM(s32, "world/partners", func_800EF640); + +INCLUDE_ASM(s32, "world/partners", func_800EF82C); diff --git a/src/world/partners.h b/src/world/partners.h index 77b0982a61..13c7dc0187 100644 --- a/src/world/partners.h +++ b/src/world/partners.h @@ -22,6 +22,12 @@ typedef struct WorldPartner { /* 0x40 */ Bytecode* whileRiding; } WorldPartner; // size = 0x40 -WorldPartner gWorldPartners[11]; +/// Set to 0 when partner NPC loaded +extern s32 D_8010C954; +extern s32 D_8010CFD8; +extern WorldPartner wPartners[12]; // wPartners +extern WorldPartner* D_8010CFEC; // wPartner +extern NpcId D_8010CFD0; // wPartnerNpcIndex +extern Npc* D_8010C930; // wPartnerNpc #endif diff --git a/tools/splat.yaml b/tools/splat.yaml index 56e26250ce..2cdc15ab42 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -265,17 +265,14 @@ segments: - [0x7bb60, c, code_7bb60_len_41b0] - [0x7fd10, c, code_7fd10_len_b40] - [0x80850, c, code_80850_len_3060] - - [0x838b0, c, code_838b0_len_5900] + - [0x838b0, c, world/partners] - [0x891b0, c, code_891b0_len_fb0] - [0x8a160, c, code_8a160_len_700] - [0x8a860, c, code_8a860_len_3f30] - [0x8e790, c, code_8e790_len_2850] - - [0x90fe0, data] - - type: code - start: 0x91520 # section may start earlier - vram: 0 # TODO - subsections: - - [0x91520, .data, world/partners] + - [0x90FE0, .data, code_759b0_len_61b0] + - [0x913B0, .data, world/actions] + - [0x914E0, .data, world/partners] - [0x917EC, bin] - [0x93CD0, ci4, ui/hammer, 32, 32] - [0x93ED0, palette, ui/hammer] @@ -465,6 +462,10 @@ segments: vram: 0x80200000 subsections: - [0x3169f0, c, code_3169f0] + - type: code + start: 0x316a70 + vram: 0x80200080 + subsections: - [0x316a70, c, code_316a70] - type: code start: 0x316C00 diff --git a/tools/symbol_addrs.txt b/tools/symbol_addrs.txt index b4b0e61ffb..c51cede151 100644 --- a/tools/symbol_addrs.txt +++ b/tools/symbol_addrs.txt @@ -10413,6 +10413,7 @@ func_8004D428 = 0x8004D428; // type:func gBattleItemTable = 0x80293C04; // type:data func_8006A9F0 = 0x8006A9F0; // type:func rom:0x45B74 rdpstateinit_dl = 0x80093BB8; // type:data +wPartners = 0x800F803C; // type: data func_8005DECC = 0x8005DECC; // type:func func_8005E12C = 0x8005E12C; // type:func func_8005DFD4 = 0x8005DFD4; // type:func diff --git a/undefined_syms.txt b/undefined_syms.txt index 76618b63c8..ade23f4568 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1,14 +1,8 @@ -D_003169F0 = 0x003169F0; -D_00316A70 = 0x00316A70; -D_00316C00 = 0x00316C00; -D_00316D90 = 0x00316D90; -D_00316F30 = 0x00316F30; D_00000094 = 0x00000094; D_00000094_2 = 0x00000094; D_0A000808 = 0x0A000808; D_0A000328 = 0x0A000328; D_0A000380 = 0x0A000380; -D_0A000380 = 0x0A000380; D_0A000740 = 0x0A000740; D_0A000750 = 0x0A000750; D_0A000800 = 0x0A000800; @@ -71,3 +65,39 @@ D_802920C0 = 0x802920C0; D_802920E8 = 0x802920E8; D_80292110 = 0x80292110; D_8028358C = 0x8028358C; +D_800F7BE8 = 0x800F7BE8; +D_800F7BBC = 0x800F7BBC; +D_800F7B94 = 0x800F7B94; +D_802C05CC = 0x802C05CC; +D_80107CA8 = 0x80107CA8; +D_80107CF8 = 0x80107CF8; +D_80107D48 = 0x80107D48; +D_80107D98 = 0x80107D98; +D_80107DE8 = 0x80107DE8; +D_80107CA8 = 0x80107CA8; +D_80107E88 = 0x80107E88; +D_80107ED8 = 0x80107ED8; +D_80107F28 = 0x80107F28; +D_80107E38 = 0x80107E38; +D_80107FC8 = 0x80107FC8; +D_80107CD0 = 0x80107CD0; +D_80107D20 = 0x80107D20; +D_80107D70 = 0x80107D70; +D_80107DC0 = 0x80107DC0; +D_80107E10 = 0x80107E10; +D_80107CD0 = 0x80107CD0; +D_80107EB0 = 0x80107EB0; +D_80107F00 = 0x80107F00; +D_80107F50 = 0x80107F50; +D_80107E60 = 0x80107E60; +D_80107FF0 = 0x80107FF0; +D_801080B8 = 0x801080B8; +D_801080E0 = 0x801080E0; +D_80108108 = 0x80108108; +D_80108130 = 0x80108130; +D_80108158 = 0x80108158; +D_80108180 = 0x80108180; +D_801081A8 = 0x801081A8; +D_801081D0 = 0x801081D0; +D_801081F8 = 0x801081F8; +D_80108220 = 0x80108220;