From debc0016fd5db4580a0b7c1a782039d74d3761e7 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Fri, 30 Oct 2020 15:51:17 +0000 Subject: [PATCH] use ld_addrs.h in load_world_script_api Renamed from load_map_script_lib --- .../code_341d0_len_20d0/load_map_by_IDs.s | 98 +++++++++---------- .../code_ebd0_len_6a0/func_80033BC0.s | 54 +++++----- .../code_f270_len_1190/func_80034C3C.s | 90 ++++++++--------- include/functions.h | 1 + include/variables.h | 4 - src/code_341d0_len_20d0.c | 5 +- .../script_api/7E0E80.c} | 0 .../script_api/7E2AA0.c} | 0 .../script_api/7E3700.c} | 0 tools/n64splat | 2 +- tools/splat.yaml | 6 +- undefined_syms.txt | 4 - 12 files changed, 130 insertions(+), 134 deletions(-) rename src/{code_7e0e80.c => world/script_api/7E0E80.c} (100%) rename src/{code_7E2AA0.c => world/script_api/7E2AA0.c} (100%) rename src/{code_7E3700.c => world/script_api/7E3700.c} (100%) diff --git a/asm/nonmatchings/code_341d0_len_20d0/load_map_by_IDs.s b/asm/nonmatchings/code_341d0_len_20d0/load_map_by_IDs.s index 0268832392..34eb98d497 100644 --- a/asm/nonmatchings/code_341d0_len_20d0/load_map_by_IDs.s +++ b/asm/nonmatchings/code_341d0_len_20d0/load_map_by_IDs.s @@ -32,24 +32,24 @@ glabel load_map_by_IDs /* 35B60 8005A760 0C047624 */ jal func_8011D890 /* 35B64 8005A764 00108403 */ sra $s0, $s0, 0x10 /* 35B68 8005A768 0C048C2E */ jal clear_dynamic_entity_list -/* 35B6C 8005A76C 00000000 */ nop +/* 35B6C 8005A76C 00000000 */ nop /* 35B70 8005A770 0C0B0C77 */ jal clear_script_list -/* 35B74 8005A774 00000000 */ nop +/* 35B74 8005A774 00000000 */ nop /* 35B78 8005A778 12000005 */ beqz $s0, .L8005A790 /* 35B7C 8005A77C 24020001 */ addiu $v0, $zero, 1 /* 35B80 8005A780 12020008 */ beq $s0, $v0, .L8005A7A4 -/* 35B84 8005A784 00000000 */ nop +/* 35B84 8005A784 00000000 */ nop /* 35B88 8005A788 080169F0 */ j .L8005A7C0 -/* 35B8C 8005A78C 00000000 */ nop +/* 35B8C 8005A78C 00000000 */ nop .L8005A790: /* 35B90 8005A790 0C0514E4 */ jal clear_area_flags -/* 35B94 8005A794 00000000 */ nop +/* 35B94 8005A794 00000000 */ nop /* 35B98 8005A798 8E420000 */ lw $v0, ($s2) /* 35B9C 8005A79C 080169F0 */ j .L8005A7C0 /* 35BA0 8005A7A0 A0400167 */ sb $zero, 0x167($v0) .L8005A7A4: /* 35BA4 8005A7A4 0C00AD24 */ jal fio_deserialize_state -/* 35BA8 8005A7A8 00000000 */ nop +/* 35BA8 8005A7A8 00000000 */ nop /* 35BAC 8005A7AC 8E420000 */ lw $v0, ($s2) /* 35BB0 8005A7B0 94510086 */ lhu $s1, 0x86($v0) /* 35BB4 8005A7B4 9453008C */ lhu $s3, 0x8c($v0) @@ -93,17 +93,17 @@ glabel load_map_by_IDs /* 35C48 8005A848 3C01800A */ lui $at, 0x800a /* 35C4C 8005A84C AC3241E0 */ sw $s2, 0x41e0($at) /* 35C50 8005A850 10A00005 */ beqz $a1, .L8005A868 -/* 35C54 8005A854 00000000 */ nop +/* 35C54 8005A854 00000000 */ nop /* 35C58 8005A858 3C04800E */ lui $a0, 0x800e /* 35C5C 8005A85C 24849668 */ addiu $a0, $a0, -0x6998 /* 35C60 8005A860 0C01BB50 */ jal strcpy -/* 35C64 8005A864 00000000 */ nop +/* 35C64 8005A864 00000000 */ nop .L8005A868: -/* 35C68 8005A868 0C0169B0 */ jal load_map_script_lib -/* 35C6C 8005A86C 00000000 */ nop +/* 35C68 8005A868 0C0169B0 */ jal load_world_script_api +/* 35C6C 8005A86C 00000000 */ nop /* 35C70 8005A870 8E440008 */ lw $a0, 8($s2) /* 35C74 8005A874 10800004 */ beqz $a0, .L8005A888 -/* 35C78 8005A878 00000000 */ nop +/* 35C78 8005A878 00000000 */ nop /* 35C7C 8005A87C 8E45000C */ lw $a1, 0xc($s2) /* 35C80 8005A880 0C00A5CF */ jal dma_copy /* 35C84 8005A884 8E460010 */ lw $a2, 0x10($s2) @@ -128,13 +128,13 @@ glabel load_map_by_IDs /* 35CC8 8005A8C8 3C13800A */ lui $s3, 0x800a /* 35CCC 8005A8CC 267341E8 */ addiu $s3, $s3, 0x41e8 /* 35CD0 8005A8D0 10400004 */ beqz $v0, .L8005A8E4 -/* 35CD4 8005A8D4 00000000 */ nop +/* 35CD4 8005A8D4 00000000 */ nop /* 35CD8 8005A8D8 0040F809 */ jalr $v0 -/* 35CDC 8005A8DC 00000000 */ nop +/* 35CDC 8005A8DC 00000000 */ nop /* 35CE0 8005A8E0 0040A02D */ daddu $s4, $v0, $zero .L8005A8E4: /* 35CE4 8005A8E4 16800015 */ bnez $s4, .L8005A93C -/* 35CE8 8005A8E8 00000000 */ nop +/* 35CE8 8005A8E8 00000000 */ nop /* 35CEC 8005A8EC 3C04800E */ lui $a0, 0x800e /* 35CF0 8005A8F0 24849230 */ addiu $a0, $a0, -0x6dd0 /* 35CF4 8005A8F4 0C016B3A */ jal load_asset_by_name @@ -158,78 +158,78 @@ glabel load_map_by_IDs .L8005A93C: /* 35D3C 8005A93C 8E420014 */ lw $v0, 0x14($s2) /* 35D40 8005A940 10400005 */ beqz $v0, .L8005A958 -/* 35D44 8005A944 00000000 */ nop +/* 35D44 8005A944 00000000 */ nop /* 35D48 8005A948 3C04800E */ lui $a0, 0x800e /* 35D4C 8005A94C 24849668 */ addiu $a0, $a0, -0x6998 /* 35D50 8005A950 0C05175C */ jal load_map_bg -/* 35D54 8005A954 00000000 */ nop +/* 35D54 8005A954 00000000 */ nop .L8005A958: /* 35D58 8005A958 0C00B458 */ jal func_8002D160 -/* 35D5C 8005A95C 00000000 */ nop +/* 35D5C 8005A95C 00000000 */ nop /* 35D60 8005A960 0C0AC81E */ jal func_802B2078 -/* 35D64 8005A964 00000000 */ nop +/* 35D64 8005A964 00000000 */ nop /* 35D68 8005A968 0C05259C */ jal func_80149670 /* 35D6C 8005A96C 0000202D */ daddu $a0, $zero, $zero /* 35D70 8005A970 0C048C2E */ jal clear_dynamic_entity_list -/* 35D74 8005A974 00000000 */ nop +/* 35D74 8005A974 00000000 */ nop /* 35D78 8005A978 0C0B0C77 */ jal clear_script_list -/* 35D7C 8005A97C 00000000 */ nop +/* 35D7C 8005A97C 00000000 */ nop /* 35D80 8005A980 0C00B7BD */ jal create_cameras_a -/* 35D84 8005A984 00000000 */ nop +/* 35D84 8005A984 00000000 */ nop /* 35D88 8005A988 3C108007 */ lui $s0, %hi(gGameStatusPtr) /* 35D8C 8005A98C 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) /* 35D90 8005A990 8E020000 */ lw $v0, ($s0) /* 35D94 8005A994 0C0B763E */ jal func_802DD8F8 /* 35D98 8005A998 80440084 */ lb $a0, 0x84($v0) /* 35D9C 8005A99C 0C047889 */ jal func_8011E224 -/* 35DA0 8005A9A0 00000000 */ nop +/* 35DA0 8005A9A0 00000000 */ nop /* 35DA4 8005A9A4 0C0482EC */ jal clear_virtual_models -/* 35DA8 8005A9A8 00000000 */ nop +/* 35DA8 8005A9A8 00000000 */ nop /* 35DAC 8005A9AC 0C00E12F */ jal clear_npcs -/* 35DB0 8005A9B0 00000000 */ nop +/* 35DB0 8005A9B0 00000000 */ nop /* 35DB4 8005A9B4 0C050440 */ jal func_80141100 -/* 35DB8 8005A9B8 00000000 */ nop +/* 35DB8 8005A9B8 00000000 */ nop /* 35DBC 8005A9BC 0C0515A0 */ jal clear_trigger_data -/* 35DC0 8005A9C0 00000000 */ nop +/* 35DC0 8005A9C0 00000000 */ nop /* 35DC4 8005A9C4 0C045751 */ jal clear_model_data -/* 35DC8 8005A9C8 00000000 */ nop +/* 35DC8 8005A9C8 00000000 */ nop /* 35DCC 8005A9CC 0C052010 */ jal func_80148040 -/* 35DD0 8005A9D0 00000000 */ nop +/* 35DD0 8005A9D0 00000000 */ nop /* 35DD4 8005A9D4 0C05177E */ jal func_80145DF8 -/* 35DD8 8005A9D8 00000000 */ nop +/* 35DD8 8005A9D8 00000000 */ nop /* 35DDC 8005A9DC 8E020000 */ lw $v0, ($s0) /* 35DE0 8005A9E0 804300A8 */ lb $v1, 0xa8($v0) /* 35DE4 8005A9E4 2402FFFF */ addiu $v0, $zero, -1 /* 35DE8 8005A9E8 14620003 */ bne $v1, $v0, .L8005A9F8 -/* 35DEC 8005A9EC 00000000 */ nop +/* 35DEC 8005A9EC 00000000 */ nop /* 35DF0 8005A9F0 0C04E062 */ jal func_80138188 -/* 35DF4 8005A9F4 00000000 */ nop +/* 35DF4 8005A9F4 00000000 */ nop .L8005A9F8: /* 35DF8 8005A9F8 16800005 */ bnez $s4, .L8005AA10 -/* 35DFC 8005A9FC 00000000 */ nop +/* 35DFC 8005A9FC 00000000 */ nop /* 35E00 8005AA00 0C016BE5 */ jal initialize_collision -/* 35E04 8005AA04 00000000 */ nop +/* 35E04 8005AA04 00000000 */ nop /* 35E08 8005AA08 0C016BF0 */ jal load_hit_asset -/* 35E0C 8005AA0C 00000000 */ nop +/* 35E0C 8005AA0C 00000000 */ nop .L8005AA10: /* 35E10 8005AA10 0C01CACC */ jal func_80072B30 -/* 35E14 8005AA14 00000000 */ nop +/* 35E14 8005AA14 00000000 */ nop /* 35E18 8005AA18 0C00F900 */ jal clear_encounter_status -/* 35E1C 8005AA1C 00000000 */ nop +/* 35E1C 8005AA1C 00000000 */ nop /* 35E20 8005AA20 0C04432E */ jal clear_entity_data /* 35E24 8005AA24 24040001 */ addiu $a0, $zero, 1 /* 35E28 8005AA28 0C016727 */ jal func_80059C9C -/* 35E2C 8005AA2C 00000000 */ nop +/* 35E2C 8005AA2C 00000000 */ nop /* 35E30 8005AA30 0C037F14 */ jal clear_player_status -/* 35E34 8005AA34 00000000 */ nop +/* 35E34 8005AA34 00000000 */ nop /* 35E38 8005AA38 0C037F1D */ jal func_800DFC74 -/* 35E3C 8005AA3C 00000000 */ nop +/* 35E3C 8005AA3C 00000000 */ nop /* 35E40 8005AA40 0C03AD1D */ jal partner_reset_data -/* 35E44 8005AA44 00000000 */ nop +/* 35E44 8005AA44 00000000 */ nop /* 35E48 8005AA48 0C048D9D */ jal clear_printers -/* 35E4C 8005AA4C 00000000 */ nop +/* 35E4C 8005AA4C 00000000 */ nop /* 35E50 8005AA50 0C04C3FC */ jal clear_item_entity_data -/* 35E54 8005AA54 00000000 */ nop +/* 35E54 8005AA54 00000000 */ nop /* 35E58 8005AA58 3C028011 */ lui $v0, %hi(gPlayerStatus) /* 35E5C 8005AA5C 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) /* 35E60 8005AA60 C4400084 */ lwc1 $f0, 0x84($v0) @@ -242,16 +242,16 @@ glabel load_map_by_IDs /* 35E7C 8005AA7C 0C0525FF */ jal func_801497FC /* 35E80 8005AA80 8C84FF60 */ lw $a0, -0xa0($a0) /* 35E84 8005AA84 0C052580 */ jal func_80149600 -/* 35E88 8005AA88 00000000 */ nop +/* 35E88 8005AA88 00000000 */ nop /* 35E8C 8005AA8C 1680000B */ bnez $s4, .L8005AABC -/* 35E90 8005AA90 00000000 */ nop +/* 35E90 8005AA90 00000000 */ nop /* 35E94 8005AA94 3C04800B */ lui $a0, 0x800b /* 35E98 8005AA98 24840CF0 */ addiu $a0, $a0, 0xcf0 /* 35E9C 8005AA9C 0C016B74 */ jal get_asset_offset /* 35EA0 8005AAA0 27A50030 */ addiu $a1, $sp, 0x30 /* 35EA4 8005AAA4 8E640000 */ lw $a0, ($s3) /* 35EA8 8005AAA8 10800004 */ beqz $a0, .L8005AABC -/* 35EAC 8005AAAC 00000000 */ nop +/* 35EAC 8005AAAC 00000000 */ nop /* 35EB0 8005AAB0 8FA60030 */ lw $a2, 0x30($sp) /* 35EB4 8005AAB4 0C046B52 */ jal load_data_for_models /* 35EB8 8005AAB8 0040282D */ daddu $a1, $v0, $zero @@ -260,9 +260,9 @@ glabel load_map_by_IDs /* 35EC0 8005AAC0 50800005 */ beql $a0, $zero, .L8005AAD8 /* 35EC4 8005AAC4 24040128 */ addiu $a0, $zero, 0x128 /* 35EC8 8005AAC8 0C05178A */ jal read_background_size -/* 35ECC 8005AACC 00000000 */ nop +/* 35ECC 8005AACC 00000000 */ nop /* 35ED0 8005AAD0 08016ABA */ j .L8005AAE8 -/* 35ED4 8005AAD4 00000000 */ nop +/* 35ED4 8005AAD4 00000000 */ nop .L8005AAD8: /* 35ED8 8005AAD8 240500C8 */ addiu $a1, $zero, 0xc8 /* 35EDC 8005AADC 2406000C */ addiu $a2, $zero, 0xc @@ -306,9 +306,9 @@ glabel load_map_by_IDs /* 35F6C 8005AB6C 24070106 */ addiu $a3, $zero, 0x106 .L8005AB70: /* 35F70 8005AB70 0C00B8C5 */ jal set_cam_viewport -/* 35F74 8005AB74 00000000 */ nop +/* 35F74 8005AB74 00000000 */ nop /* 35F78 8005AB78 0C039E4D */ jal initialize_status_menu -/* 35F7C 8005AB7C 00000000 */ nop +/* 35F7C 8005AB7C 00000000 */ nop /* 35F80 8005AB80 0000282D */ daddu $a1, $zero, $zero /* 35F84 8005AB84 00A0302D */ daddu $a2, $a1, $zero /* 35F88 8005AB88 3C108007 */ lui $s0, %hi(gGameStatusPtr) diff --git a/asm/nonmatchings/code_ebd0_len_6a0/func_80033BC0.s b/asm/nonmatchings/code_ebd0_len_6a0/func_80033BC0.s index 9b1cfbade8..d7331898fe 100644 --- a/asm/nonmatchings/code_ebd0_len_6a0/func_80033BC0.s +++ b/asm/nonmatchings/code_ebd0_len_6a0/func_80033BC0.s @@ -33,9 +33,9 @@ glabel func_80033BC0 /* F030 80033C30 0C018030 */ jal nuContRmbForceStopEnd /* F034 80033C34 AC820000 */ sw $v0, ($a0) /* F038 80033C38 0C05260E */ jal func_80149838 -/* F03C 80033C3C 00000000 */ nop +/* F03C 80033C3C 00000000 */ nop /* F040 80033C40 0C016AFA */ jal get_current_map_header -/* F044 80033C44 00000000 */ nop +/* F044 80033C44 00000000 */ nop /* F048 80033C48 3C108007 */ lui $s0, %hi(gGameStatusPtr) /* F04C 80033C4C 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) /* F050 80033C50 8E040000 */ lw $a0, ($s0) @@ -53,7 +53,7 @@ glabel func_80033BC0 /* F080 80033C80 0C016BE1 */ jal func_8005AF84 /* F084 80033C84 A0400070 */ sb $zero, 0x70($v0) /* F088 80033C88 0C00AB37 */ jal func_8002ACDC -/* F08C 80033C8C 00000000 */ nop +/* F08C 80033C8C 00000000 */ nop /* F090 80033C90 0C05259C */ jal func_80149670 /* F094 80033C94 24040001 */ addiu $a0, $zero, 1 /* F098 80033C98 8E030000 */ lw $v1, ($s0) @@ -65,37 +65,37 @@ glabel func_80033BC0 /* F0B0 80033CB0 0C0B763E */ jal func_802DD8F8 /* F0B4 80033CB4 80440084 */ lb $a0, 0x84($v0) /* F0B8 80033CB8 0C0457FA */ jal init_model_data -/* F0BC 80033CBC 00000000 */ nop +/* F0BC 80033CBC 00000000 */ nop /* F0C0 80033CC0 0C05203C */ jal func_801480F0 -/* F0C4 80033CC4 00000000 */ nop +/* F0C4 80033CC4 00000000 */ nop /* F0C8 80033CC8 0C048316 */ jal init_virtual_models -/* F0CC 80033CCC 00000000 */ nop +/* F0CC 80033CCC 00000000 */ nop /* F0D0 80033CD0 0C0478C4 */ jal func_8011E310 -/* F0D4 80033CD4 00000000 */ nop +/* F0D4 80033CD4 00000000 */ nop /* F0D8 80033CD8 0C048C45 */ jal init_dynamic_entity_list -/* F0DC 80033CDC 00000000 */ nop +/* F0DC 80033CDC 00000000 */ nop /* F0E0 80033CE0 0000202D */ daddu $a0, $zero, $zero /* F0E4 80033CE4 0C0514BA */ jal func_801452E8 /* F0E8 80033CE8 0080282D */ daddu $a1, $a0, $zero /* F0EC 80033CEC 0C0504C0 */ jal init_menu_icon_list -/* F0F0 80033CF0 00000000 */ nop +/* F0F0 80033CF0 00000000 */ nop /* F0F4 80033CF4 0C04C433 */ jal init_item_entity_list -/* F0F8 80033CF8 00000000 */ nop +/* F0F8 80033CF8 00000000 */ nop /* F0FC 80033CFC 0C0B0CBB */ jal init_script_list -/* F100 80033D00 00000000 */ nop +/* F100 80033D00 00000000 */ nop /* F104 80033D04 0C00E14B */ jal init_npc_list -/* F108 80033D08 00000000 */ nop +/* F108 80033D08 00000000 */ nop /* F10C 80033D0C 0C044396 */ jal func_80110E58 -/* F110 80033D10 00000000 */ nop +/* F110 80033D10 00000000 */ nop /* F114 80033D14 0C0515CA */ jal init_trigger_list -/* F118 80033D18 00000000 */ nop +/* F118 80033D18 00000000 */ nop /* F11C 80033D1C 8E020000 */ lw $v0, ($s0) /* F120 80033D20 904200AA */ lbu $v0, 0xaa($v0) /* F124 80033D24 30420001 */ andi $v0, $v0, 1 /* F128 80033D28 10400008 */ beqz $v0, .L80033D4C -/* F12C 80033D2C 00000000 */ nop +/* F12C 80033D2C 00000000 */ nop /* F130 80033D30 0C00EC6C */ jal func_8003B1B0 -/* F134 80033D34 00000000 */ nop +/* F134 80033D34 00000000 */ nop /* F138 80033D38 3C02800A */ lui $v0, 0x800a /* F13C 80033D3C 8C420904 */ lw $v0, 0x904($v0) /* F140 80033D40 24040011 */ addiu $a0, $zero, 0x11 @@ -106,8 +106,8 @@ glabel func_80033BC0 /* F150 80033D50 2442F290 */ addiu $v0, $v0, %lo(gPlayerData) /* F154 80033D54 0C03AC80 */ jal func_800EB200 /* F158 80033D58 80440012 */ lb $a0, 0x12($v0) -/* F15C 80033D5C 0C0169B0 */ jal load_map_script_lib -/* F160 80033D60 00000000 */ nop +/* F15C 80033D5C 0C0169B0 */ jal load_world_script_api +/* F160 80033D60 00000000 */ nop /* F164 80033D64 3C04800E */ lui $a0, 0x800e /* F168 80033D68 24849230 */ addiu $a0, $a0, -0x6dd0 /* F16C 80033D6C 0C016B3A */ jal load_asset_by_name @@ -120,12 +120,12 @@ glabel func_80033BC0 /* F188 80033D88 0C00AB1E */ jal general_heap_free /* F18C 80033D8C 0200202D */ daddu $a0, $s0, $zero /* F190 80033D90 0C016BE5 */ jal initialize_collision -/* F194 80033D94 00000000 */ nop +/* F194 80033D94 00000000 */ nop /* F198 80033D98 0C016C16 */ jal load_collision -/* F19C 80033D9C 00000000 */ nop +/* F19C 80033D9C 00000000 */ nop /* F1A0 80033DA0 8E240008 */ lw $a0, 8($s1) /* F1A4 80033DA4 10800004 */ beqz $a0, .L80033DB8 -/* F1A8 80033DA8 00000000 */ nop +/* F1A8 80033DA8 00000000 */ nop /* F1AC 80033DAC 8E25000C */ lw $a1, 0xc($s1) /* F1B0 80033DB0 0C00A5CF */ jal dma_copy /* F1B4 80033DB4 8E260010 */ lw $a2, 0x10($s1) @@ -136,9 +136,9 @@ glabel func_80033BC0 /* F1C4 80033DC4 50800005 */ beql $a0, $zero, .L80033DDC /* F1C8 80033DC8 24040128 */ addiu $a0, $zero, 0x128 /* F1CC 80033DCC 0C05178A */ jal read_background_size -/* F1D0 80033DD0 00000000 */ nop +/* F1D0 80033DD0 00000000 */ nop /* F1D4 80033DD4 0800CF7B */ j .L80033DEC -/* F1D8 80033DD8 00000000 */ nop +/* F1D8 80033DD8 00000000 */ nop .L80033DDC: /* F1DC 80033DDC 240500C8 */ addiu $a1, $zero, 0xc8 /* F1E0 80033DE0 2406000C */ addiu $a2, $zero, 0xc @@ -154,9 +154,9 @@ glabel func_80033BC0 /* F204 80033E04 0C045709 */ jal load_model_textures /* F208 80033E08 0040282D */ daddu $a1, $v0, $zero /* F20C 80033E0C 0C04584B */ jal calculate_model_sizes -/* F210 80033E10 00000000 */ nop +/* F210 80033E10 00000000 */ nop /* F214 80033E14 0C00EC6C */ jal func_8003B1B0 -/* F218 80033E18 00000000 */ nop +/* F218 80033E18 00000000 */ nop /* F21C 80033E1C 3C02800A */ lui $v0, 0x800a /* F220 80033E20 8C420904 */ lw $v0, 0x904($v0) /* F224 80033E24 3C04800A */ lui $a0, 0x800a @@ -164,12 +164,12 @@ glabel func_80033BC0 /* F22C 80033E2C 10800003 */ beqz $a0, .L80033E3C /* F230 80033E30 AE620004 */ sw $v0, 4($s3) /* F234 80033E34 0C009C22 */ jal func_80027088 -/* F238 80033E38 00000000 */ nop +/* F238 80033E38 00000000 */ nop .L80033E3C: /* F23C 80033E3C 24040004 */ addiu $a0, $zero, 4 .L80033E40: /* F240 80033E40 0C00CD3C */ jal set_game_mode -/* F244 80033E44 00000000 */ nop +/* F244 80033E44 00000000 */ nop .L80033E48: /* F248 80033E48 8FBF0028 */ lw $ra, 0x28($sp) /* F24C 80033E4C 8FB30024 */ lw $s3, 0x24($sp) diff --git a/asm/nonmatchings/code_f270_len_1190/func_80034C3C.s b/asm/nonmatchings/code_f270_len_1190/func_80034C3C.s index dedf270b12..75b1db7e46 100644 --- a/asm/nonmatchings/code_f270_len_1190/func_80034C3C.s +++ b/asm/nonmatchings/code_f270_len_1190/func_80034C3C.s @@ -17,19 +17,19 @@ glabel func_80034C3C /* 1006C 80034C6C 28620002 */ slti $v0, $v1, 2 /* 10070 80034C70 24020004 */ addiu $v0, $zero, 4 /* 10074 80034C74 106200CA */ beq $v1, $v0, .L80034FA0 -/* 10078 80034C78 00000000 */ nop +/* 10078 80034C78 00000000 */ nop /* 1007C 80034C7C 0800D3F6 */ j .L80034FD8 -/* 10080 80034C80 00000000 */ nop +/* 10080 80034C80 00000000 */ nop .L80034C84: /* 10084 80034C84 104000D4 */ beqz $v0, .L80034FD8 -/* 10088 80034C88 00000000 */ nop +/* 10088 80034C88 00000000 */ nop /* 1008C 80034C8C 046000D2 */ bltz $v1, .L80034FD8 /* 10090 80034C90 24020004 */ addiu $v0, $zero, 4 /* 10094 80034C94 3C06800A */ lui $a2, 0x800a /* 10098 80034C98 24C60920 */ addiu $a2, $a2, 0x920 /* 1009C 80034C9C 80C30000 */ lb $v1, ($a2) /* 100A0 80034CA0 14620007 */ bne $v1, $v0, .L80034CC0 -/* 100A4 80034CA4 00000000 */ nop +/* 100A4 80034CA4 00000000 */ nop /* 100A8 80034CA8 3C03800A */ lui $v1, %hi(D_8009A650) /* 100AC 80034CAC 2463A650 */ addiu $v1, $v1, %lo(D_8009A650) /* 100B0 80034CB0 8C620000 */ lw $v0, ($v1) @@ -44,7 +44,7 @@ glabel func_80034C3C /* 100D0 80034CD0 A0C20000 */ sb $v0, ($a2) /* 100D4 80034CD4 00021600 */ sll $v0, $v0, 0x18 /* 100D8 80034CD8 144000BF */ bnez $v0, .L80034FD8 -/* 100DC 80034CDC 00000000 */ nop +/* 100DC 80034CDC 00000000 */ nop .L80034CE0: /* 100E0 80034CE0 3C048007 */ lui $a0, 0x8007 /* 100E4 80034CE4 24847950 */ addiu $a0, $a0, 0x7950 @@ -53,7 +53,7 @@ glabel func_80034C3C /* 100F0 80034CF0 0C017CBC */ jal nuGfxSetCfb /* 100F4 80034CF4 A0C20000 */ sb $v0, ($a2) /* 100F8 80034CF8 0C0911C2 */ jal pause_cleanup -/* 100FC 80034CFC 00000000 */ nop +/* 100FC 80034CFC 00000000 */ nop /* 10100 80034D00 3C04800A */ lui $a0, %hi(D_8009A650) /* 10104 80034D04 2484A650 */ addiu $a0, $a0, %lo(D_8009A650) /* 10108 80034D08 8C820000 */ lw $v0, ($a0) @@ -80,47 +80,47 @@ glabel func_80034C3C /* 1015C 80034D5C 0C016BE1 */ jal func_8005AF84 /* 10160 80034D60 A4A30148 */ sh $v1, 0x148($a1) /* 10164 80034D64 0C00AB37 */ jal func_8002ACDC -/* 10168 80034D68 00000000 */ nop +/* 10168 80034D68 00000000 */ nop /* 1016C 80034D6C 0C018030 */ jal nuContRmbForceStopEnd -/* 10170 80034D70 00000000 */ nop +/* 10170 80034D70 00000000 */ nop /* 10174 80034D74 0C05259C */ jal func_80149670 /* 10178 80034D78 24040001 */ addiu $a0, $zero, 1 /* 1017C 80034D7C 8E020000 */ lw $v0, ($s0) /* 10180 80034D80 0C0B763E */ jal func_802DD8F8 /* 10184 80034D84 80440084 */ lb $a0, 0x84($v0) /* 10188 80034D88 0C0457FA */ jal init_model_data -/* 1018C 80034D8C 00000000 */ nop +/* 1018C 80034D8C 00000000 */ nop /* 10190 80034D90 0C05203C */ jal func_801480F0 -/* 10194 80034D94 00000000 */ nop +/* 10194 80034D94 00000000 */ nop /* 10198 80034D98 0C048316 */ jal init_virtual_models -/* 1019C 80034D9C 00000000 */ nop +/* 1019C 80034D9C 00000000 */ nop /* 101A0 80034DA0 0C0478C4 */ jal func_8011E310 -/* 101A4 80034DA4 00000000 */ nop +/* 101A4 80034DA4 00000000 */ nop /* 101A8 80034DA8 0C048C45 */ jal init_dynamic_entity_list -/* 101AC 80034DAC 00000000 */ nop +/* 101AC 80034DAC 00000000 */ nop /* 101B0 80034DB0 0000202D */ daddu $a0, $zero, $zero /* 101B4 80034DB4 0C0514BA */ jal func_801452E8 /* 101B8 80034DB8 0080282D */ daddu $a1, $a0, $zero /* 101BC 80034DBC 0C0504C0 */ jal init_menu_icon_list -/* 101C0 80034DC0 00000000 */ nop +/* 101C0 80034DC0 00000000 */ nop /* 101C4 80034DC4 0C04C433 */ jal init_item_entity_list -/* 101C8 80034DC8 00000000 */ nop +/* 101C8 80034DC8 00000000 */ nop /* 101CC 80034DCC 0C0B0CBB */ jal init_script_list -/* 101D0 80034DD0 00000000 */ nop +/* 101D0 80034DD0 00000000 */ nop /* 101D4 80034DD4 0C00E14B */ jal init_npc_list -/* 101D8 80034DD8 00000000 */ nop +/* 101D8 80034DD8 00000000 */ nop /* 101DC 80034DDC 0C044396 */ jal func_80110E58 -/* 101E0 80034DE0 00000000 */ nop +/* 101E0 80034DE0 00000000 */ nop /* 101E4 80034DE4 0C0515CA */ jal init_trigger_list -/* 101E8 80034DE8 00000000 */ nop +/* 101E8 80034DE8 00000000 */ nop /* 101EC 80034DEC 3C04800A */ lui $a0, 0x800a /* 101F0 80034DF0 8C840924 */ lw $a0, 0x924($a0) /* 101F4 80034DF4 0C0525FF */ jal func_801497FC -/* 101F8 80034DF8 00000000 */ nop +/* 101F8 80034DF8 00000000 */ nop /* 101FC 80034DFC 0C052B1C */ jal func_8014AC70 -/* 10200 80034E00 00000000 */ nop -/* 10204 80034E04 0C0169B0 */ jal load_map_script_lib -/* 10208 80034E08 00000000 */ nop +/* 10200 80034E00 00000000 */ nop +/* 10204 80034E04 0C0169B0 */ jal load_world_script_api +/* 10208 80034E08 00000000 */ nop /* 1020C 80034E0C 3C04800E */ lui $a0, 0x800e /* 10210 80034E10 24849230 */ addiu $a0, $a0, -0x6dd0 /* 10214 80034E14 0C016B3A */ jal load_asset_by_name @@ -133,12 +133,12 @@ glabel func_80034C3C /* 10230 80034E30 0C00AB1E */ jal general_heap_free /* 10234 80034E34 0200202D */ daddu $a0, $s0, $zero /* 10238 80034E38 0C016BE5 */ jal initialize_collision -/* 1023C 80034E3C 00000000 */ nop +/* 1023C 80034E3C 00000000 */ nop /* 10240 80034E40 0C016C16 */ jal load_collision -/* 10244 80034E44 00000000 */ nop +/* 10244 80034E44 00000000 */ nop /* 10248 80034E48 8E240008 */ lw $a0, 8($s1) /* 1024C 80034E4C 10800004 */ beqz $a0, .L80034E60 -/* 10250 80034E50 00000000 */ nop +/* 10250 80034E50 00000000 */ nop /* 10254 80034E54 8E25000C */ lw $a1, 0xc($s1) /* 10258 80034E58 0C00A5CF */ jal dma_copy /* 1025C 80034E5C 8E260010 */ lw $a2, 0x10($s1) @@ -149,9 +149,9 @@ glabel func_80034C3C /* 1026C 80034E6C 50800005 */ beql $a0, $zero, .L80034E84 /* 10270 80034E70 24040128 */ addiu $a0, $zero, 0x128 /* 10274 80034E74 0C05178A */ jal read_background_size -/* 10278 80034E78 00000000 */ nop +/* 10278 80034E78 00000000 */ nop /* 1027C 80034E7C 0800D3A5 */ j .L80034E94 -/* 10280 80034E80 00000000 */ nop +/* 10280 80034E80 00000000 */ nop .L80034E84: /* 10284 80034E84 240500C8 */ addiu $a1, $zero, 0xc8 /* 10288 80034E88 2406000C */ addiu $a2, $zero, 0xc @@ -164,11 +164,11 @@ glabel func_80034C3C /* 102A0 80034EA0 0C04584B */ jal calculate_model_sizes /* 102A4 80034EA4 A462015C */ sh $v0, 0x15c($v1) /* 102A8 80034EA8 0C00EC6C */ jal func_8003B1B0 -/* 102AC 80034EAC 00000000 */ nop +/* 102AC 80034EAC 00000000 */ nop /* 102B0 80034EB0 0C051FB1 */ jal func_80147EC4 /* 102B4 80034EB4 0000202D */ daddu $a0, $zero, $zero /* 102B8 80034EB8 0C03A631 */ jal func_800E98C4 -/* 102BC 80034EBC 00000000 */ nop +/* 102BC 80034EBC 00000000 */ nop /* 102C0 80034EC0 0C009C22 */ jal func_80027088 /* 102C4 80034EC4 24040001 */ addiu $a0, $zero, 1 /* 102C8 80034EC8 24020003 */ addiu $v0, $zero, 3 @@ -185,13 +185,13 @@ glabel func_80034C3C /* 102F4 80034EF4 3C01802E */ lui $at, 0x802e /* 102F8 80034EF8 A0239D71 */ sb $v1, -0x628f($at) /* 102FC 80034EFC 0C00F949 */ jal func_8003E524 -/* 10300 80034F00 00000000 */ nop +/* 10300 80034F00 00000000 */ nop /* 10304 80034F04 0C00E64C */ jal update_npcs -/* 10308 80034F08 00000000 */ nop +/* 10308 80034F08 00000000 */ nop /* 1030C 80034F0C 0C037DD0 */ jal update_player -/* 10310 80034F10 00000000 */ nop +/* 10310 80034F10 00000000 */ nop /* 10314 80034F14 0C016754 */ jal func_80059D50 -/* 10318 80034F18 00000000 */ nop +/* 10318 80034F18 00000000 */ nop /* 1031C 80034F1C 3C03800A */ lui $v1, 0x800a /* 10320 80034F20 24630922 */ addiu $v1, $v1, 0x922 /* 10324 80034F24 94620000 */ lhu $v0, ($v1) @@ -201,16 +201,16 @@ glabel func_80034C3C /* 10334 80034F34 04420028 */ bltzl $v0, .L80034FD8 /* 10338 80034F38 A4600000 */ sh $zero, ($v1) /* 1033C 80034F3C 0800D3F6 */ j .L80034FD8 -/* 10340 80034F40 00000000 */ nop +/* 10340 80034F40 00000000 */ nop .L80034F44: /* 10344 80034F44 0C00F949 */ jal func_8003E524 -/* 10348 80034F48 00000000 */ nop +/* 10348 80034F48 00000000 */ nop /* 1034C 80034F4C 0C00E64C */ jal update_npcs -/* 10350 80034F50 00000000 */ nop +/* 10350 80034F50 00000000 */ nop /* 10354 80034F54 0C037DD0 */ jal update_player -/* 10358 80034F58 00000000 */ nop +/* 10358 80034F58 00000000 */ nop /* 1035C 80034F5C 0C016754 */ jal func_80059D50 -/* 10360 80034F60 00000000 */ nop +/* 10360 80034F60 00000000 */ nop /* 10364 80034F64 3C04800A */ lui $a0, 0x800a /* 10368 80034F68 24840922 */ addiu $a0, $a0, 0x922 /* 1036C 80034F6C 84820000 */ lh $v0, ($a0) @@ -226,20 +226,20 @@ glabel func_80034C3C /* 10390 80034F90 04420011 */ bltzl $v0, .L80034FD8 /* 10394 80034F94 A4800000 */ sh $zero, ($a0) /* 10398 80034F98 0800D3F6 */ j .L80034FD8 -/* 1039C 80034F9C 00000000 */ nop +/* 1039C 80034F9C 00000000 */ nop .L80034FA0: /* 103A0 80034FA0 0C009C22 */ jal func_80027088 /* 103A4 80034FA4 0000202D */ daddu $a0, $zero, $zero /* 103A8 80034FA8 0C00F949 */ jal func_8003E524 -/* 103AC 80034FAC 00000000 */ nop +/* 103AC 80034FAC 00000000 */ nop /* 103B0 80034FB0 0C00E64C */ jal update_npcs -/* 103B4 80034FB4 00000000 */ nop +/* 103B4 80034FB4 00000000 */ nop /* 103B8 80034FB8 0C037DD0 */ jal update_player -/* 103BC 80034FBC 00000000 */ nop +/* 103BC 80034FBC 00000000 */ nop /* 103C0 80034FC0 0C016754 */ jal func_80059D50 -/* 103C4 80034FC4 00000000 */ nop +/* 103C4 80034FC4 00000000 */ nop /* 103C8 80034FC8 0C038069 */ jal enable_player_input -/* 103CC 80034FCC 00000000 */ nop +/* 103CC 80034FCC 00000000 */ nop /* 103D0 80034FD0 0C00CD3C */ jal set_game_mode /* 103D4 80034FD4 24040004 */ addiu $a0, $zero, 4 .L80034FD8: diff --git a/include/functions.h b/include/functions.h index 2e2fcd7851..28c40261f8 100644 --- a/include/functions.h +++ b/include/functions.h @@ -9,6 +9,7 @@ void osCleanupThread(void); s32 heap_malloc(s32 size); HeapNode* _heap_create(void* addr, s32 size); +void dma_copy(void* romStart, void* romEnd, void* vramDest); s32 get_global_byte(s32 index); s32 get_global_flag(s32 index); diff --git a/include/variables.h b/include/variables.h index d892d99244..3d8e7e7347 100644 --- a/include/variables.h +++ b/include/variables.h @@ -154,10 +154,6 @@ extern s32 D_8009A5D8; extern u8 D_800779B0; extern u8 D_800A0963; -extern s32 mapScriptLibStart; -extern s32 mapScriptLibEnd; -extern s32 mapScriptLibVram; - // Scripts extern Bytecode* SCRIPT_NpcDefeat; extern Bytecode* ShakeCam1; diff --git a/src/code_341d0_len_20d0.c b/src/code_341d0_len_20d0.c index 2cf1492877..fffc1b3c18 100644 --- a/src/code_341d0_len_20d0.c +++ b/src/code_341d0_len_20d0.c @@ -1,4 +1,5 @@ #include "common.h" +#include "ld_addrs.h" INCLUDE_ASM(s32, "code_341d0_len_20d0", func_80058DD0); @@ -42,8 +43,8 @@ INCLUDE_ASM(s32, "code_341d0_len_20d0", remove_all_effects); INCLUDE_ASM(s32, "code_341d0_len_20d0", play_effect); -void load_map_script_lib(void) { - dma_copy(&mapScriptLibStart, &mapScriptLibEnd, &mapScriptLibVram); +void load_world_script_api(void) { + dma_copy(&world_script_api_ROM_START, &world_script_api_ROM_END, &world_script_api_VRAM); } INCLUDE_ASM(s32, "code_341d0_len_20d0", load_map_by_IDs); diff --git a/src/code_7e0e80.c b/src/world/script_api/7E0E80.c similarity index 100% rename from src/code_7e0e80.c rename to src/world/script_api/7E0E80.c diff --git a/src/code_7E2AA0.c b/src/world/script_api/7E2AA0.c similarity index 100% rename from src/code_7E2AA0.c rename to src/world/script_api/7E2AA0.c diff --git a/src/code_7E3700.c b/src/world/script_api/7E3700.c similarity index 100% rename from src/code_7E3700.c rename to src/world/script_api/7E3700.c diff --git a/tools/n64splat b/tools/n64splat index 037d80e00c..fdb44704e6 160000 --- a/tools/n64splat +++ b/tools/n64splat @@ -1 +1 @@ -Subproject commit 037d80e00cb3aeae37bdad77bfac871036982456 +Subproject commit fdb44704e6da70d5d2bab3bfc2e307745600fe0d diff --git a/tools/splat.yaml b/tools/splat.yaml index 68395935ff..4650d48de1 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -820,11 +820,13 @@ segments: files: - [0x415D90, "c"] - [0x4200C0, "bin"] # todo split this further - - type: code + - name: world/script_api/ + ld_name: world_script_api + type: code start: 0x7E0E80 vram: 0x80280000 files: - - [0x7e0e80, "c", "code_7e0e80"] + - [0x7e0e80, "c"] - [0x7E2AA0, "c"] - [0x7E3700, "c"] - [0x7e4d00, "bin"] diff --git a/undefined_syms.txt b/undefined_syms.txt index cf1496998c..b5fe5e04f0 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -68,10 +68,6 @@ gBattleState = 0x800DC068; gBattleStatus = 0x800DC070; gPauseMenuStrings = 0x8026F778; -mapScriptLibStart = 0x7E0E80; -mapScriptLibEnd = 0x7E73A0; -mapScriptLibVram = 0x80280000; - D_000759B0 = 0x000759B0; D_000759B0_end = 0x000A5DD0; D_000A5DD0 = 0x000A5DD0;