diff --git a/include/sections.h b/include/sections.h index c5bdd664..30ebbf0b 100644 --- a/include/sections.h +++ b/include/sections.h @@ -458,12 +458,12 @@ extern u8 backgrounds_ROM_START[]; // 3CB130 extern u8 backgrounds_ROM_END[]; // 3CB130 extern u8 battle_headers_ROM_START[]; // 45B580 extern u8 battle_headers_ROM_END[]; // 45B580 -extern u8 _4A21C0_ROM_START[]; -extern u8 _4A21C0_ROM_END[]; -extern u8 _4BD6B0_ROM_START[]; -extern u8 _4BD6B0_ROM_END[]; -extern u8 _4BE810_ROM_START[]; -extern u8 _4BE810_ROM_END[]; +extern u8 common_menu0_ui_ROM_START[]; +extern u8 common_menu0_ui_ROM_END[]; +extern u8 common_menu1_ui_ROM_START[]; +extern u8 common_menu1_ui_ROM_END[]; +extern u8 common_menu2_ui_ROM_START[]; +extern u8 common_menu2_ui_ROM_END[]; extern u8 area_select_ui_ROM_START[]; // 4D1330 extern u8 area_select_ui_ROM_END[]; // 4D1330 extern u8 menu_select_ui_ROM_START[]; // 4EB0C0 diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 2268d126..b51b589a 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -186,9 +186,9 @@ n64_logo_texture_ROM_START = 0x3B96B0; // defined:true fonts_ROM_START = 0x3BA190; // defined:true backgrounds_ROM_START = 0x3CB130; // defined:true battle_headers_ROM_START = 0x45B580; // defined:true -_4A21C0_ROM_START = 0x4A21C0; // defined:true -_4BD6B0_ROM_START = 0x4BD6B0; // defined:true -_4BE810_ROM_START = 0x4BE810; // defined:true +common_menu0_ui_ROM_START = 0x4A21C0; // defined:true +common_menu1_ui_ROM_START = 0x4BD6B0; // defined:true +common_menu2_ui_ROM_START = 0x4BE810; // defined:true area_select_ui_ROM_START = 0x4D1330; // defined:true menu_select_ui_ROM_START = 0x4EB0C0; // defined:true stadium_select_ui_ROM_START = 0x5046B0; // defined:true diff --git a/src/fragments/10/fragment10.c b/src/fragments/10/fragment10.c index 57a4d776..4a9a78b8 100644 --- a/src/fragments/10/fragment10.c +++ b/src/fragments/10/fragment10.c @@ -951,7 +951,7 @@ void func_864025A0(UNUSED s32 arg0, UNUSED s32 arg1) { func_80005E40(0x18000, 0); sp24 = func_80007444(0, 1, 3, 1, 2, 1); D_87B000E0 = func_8001E94C(0x16, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); FRAGMENT_LOAD(fragment31); func_86402130(); func_80007678(sp24); diff --git a/src/fragments/11/fragment11.c b/src/fragments/11/fragment11.c index 45e25cdc..0c5b0041 100644 --- a/src/fragments/11/fragment11.c +++ b/src/fragments/11/fragment11.c @@ -829,7 +829,7 @@ void func_86501E9C(UNUSED s32 arg0, UNUSED s32 arg1) { sp24 = func_80007444(0, 1, 3, 1, 2, 1); D_87B000E0 = func_8001E94C(0x16, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); FRAGMENT_LOAD(fragment31); func_86501AAC(); diff --git a/src/fragments/35/fragment35.c b/src/fragments/35/fragment35.c index 49380e38..f9586cc1 100644 --- a/src/fragments/35/fragment35.c +++ b/src/fragments/35/fragment35.c @@ -70,7 +70,7 @@ s32 func_820003A4(UNUSED s32 arg0, UNUSED s32 arg1) { func_80005E40(0x10000, 0); sp2C = func_80007444(0, 1, 2, 0, 2, 1); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); ASSET_LOAD(D_2000000, n64_logo_texture, 0); func_80028AFC(2); diff --git a/src/fragments/36/fragment36.c b/src/fragments/36/fragment36.c index 2179f736..c29fff1b 100644 --- a/src/fragments/36/fragment36.c +++ b/src/fragments/36/fragment36.c @@ -342,7 +342,7 @@ void func_82100B1C(s32 arg0) { } void func_82100B98(void) { - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); ASSET_LOAD(D_2000000, title_ui, 0); // bin contains a JP logo and press start, but this bin is loaded for the "Press Start" gfx D_82100EB8 = main_pool_alloc(0x4510, 0); diff --git a/src/fragments/37/fragment37.c b/src/fragments/37/fragment37.c index d1fce01e..92d4ee74 100644 --- a/src/fragments/37/fragment37.c +++ b/src/fragments/37/fragment37.c @@ -818,9 +818,9 @@ s32 func_82202DC4(UNUSED s32 arg0, UNUSED s32 arg1) { sp24 = func_80007444(1, 0, 2, 0, 2, 1); func_8001E94C(0x1C, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); ASSET_LOAD(D_3000000, area_select_ui, 0); - ASSET_LOAD(D_2000000, _4BE810, 0); + ASSET_LOAD(D_2000000, common_menu2_ui, 0); func_8002D510(); D_822030F0 = func_8002D5AC(0x17); diff --git a/src/fragments/6/fragment6.c b/src/fragments/6/fragment6.c index c2f3f73e..790c3c2d 100644 --- a/src/fragments/6/fragment6.c +++ b/src/fragments/6/fragment6.c @@ -1203,7 +1203,7 @@ void func_86002778(UNUSED s32 arg0, UNUSED s32 arg1) { sp24 = (unk_func_80007444*)func_80007444(0, 1, 3, 1, 2, 1); D_86003B7C = func_8001E94C(0x36, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); FRAGMENT_LOAD(fragment31); func_80004454((((u32)D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END); diff --git a/src/fragments/7/fragment7.c b/src/fragments/7/fragment7.c index e7ff4c8e..b8709b8f 100644 --- a/src/fragments/7/fragment7.c +++ b/src/fragments/7/fragment7.c @@ -1889,7 +1889,7 @@ void func_86104474(UNUSED s32 arg0, UNUSED s32 arg1) { sp24 = func_80007444(0, 1, 3, 1, 2, 1); D_861054B4 = func_8001E94C(0x36, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); FRAGMENT_LOAD(fragment31); func_80004454((((u32)D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END); diff --git a/src/fragments/8/fragment8.c b/src/fragments/8/fragment8.c index 791e7ae0..42dd475a 100644 --- a/src/fragments/8/fragment8.c +++ b/src/fragments/8/fragment8.c @@ -1402,7 +1402,7 @@ void func_8620369C(s32 arg0, UNUSED s32 arg1) { sp24 = func_80007444(0, 0, 3, 1, 2, 1); D_86204714 = func_8001E94C(0x16, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); ASSET_LOAD(D_4000000, run_rattata_run_flag_gfx, 0); FRAGMENT_LOAD(fragment31); diff --git a/src/fragments/9/fragment9.c b/src/fragments/9/fragment9.c index ff3f806f..5c875064 100644 --- a/src/fragments/9/fragment9.c +++ b/src/fragments/9/fragment9.c @@ -585,7 +585,7 @@ void func_86301474(UNUSED s32 arg0, UNUSED s32 arg1) { sp24 = func_80007444(0, 1, 3, 1, 2, 1); D_86301728 = func_8001E94C(0x26, 0); - ASSET_LOAD(D_1000000, _4BD6B0, 0); + ASSET_LOAD(D_1000000, common_menu1_ui, 0); FRAGMENT_LOAD(fragment31); func_80004454((((u32)&D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END); diff --git a/tools/yay0_split.py b/tools/yay0_split.py new file mode 100755 index 00000000..a654baae --- /dev/null +++ b/tools/yay0_split.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import sys +import os + +# Yay0_split_script + +# this was used to scan/generate splits for certain small portions of asset tables. Please do not use this. + +bin_file = open("scan.bin", 'r+b') +size = os.path.getsize("scan.bin") +ba = bytearray(bin_file.read(size)) + +i = 0 +for i in range(i, size, 4): + if ba[i + 0] == 0x59 and ba[i + 1] == 0x61 and ba[i + 2] == 0x79 and ba[i + 3] == 0x30: + print("Yay0 found at: -[", hex(0x7C0000 + (i)), "]") diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index c6a63a29..30103de1 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -2437,9 +2437,9 @@ - [0x3BA190, bin, fonts] - [0x3CB130, bin, backgrounds] - [0x45B580, bin, battle_headers] - - [0x4A21C0, bin] - - [0x4BD6B0, bin] # like a common assets bin? - - [0x4BE810, bin] + - [0x4A21C0, bin, common_menu0_ui] + - [0x4BD6B0, bin, common_menu1_ui] + - [0x4BE810, bin, common_menu2_ui] - [0x4D1330, bin, area_select_ui] - [0x4EB0C0, bin, menu_select_ui] - [0x5046B0, bin, stadium_select_ui] @@ -2483,16 +2483,117 @@ - [0x79AFB0, bin, copyright] - [0x79B8F0] - - # rest of ROM.. part 2. This area and beyond NEEDS to be hard-aligned to this address. - # for the ROM to be shiftable, we need a way to fix this area beyond here to this address and for the prior area - # to be filled with FFs instead of being binned. TODO: Make it shift - - name: late_assets + # ------------------------------------------------ + # sections hard aligned to an address start here + # ------------------------------------------------ + + - name: late_assets_1 type: code bss_size: 0x0 start: 0x7C0000 vram: 0x8FC00000 # unknown vram. Another unused one? Might be 8FC00000? ld_align_segment_start: 0x7C0000 - subsegments: + subalign: 4 + subsegments: # unaligned starts - [0x7C0000, bin] + - [0x7C18F8, bin] + - [0x7C3398, bin] + - [0x7C4E14, bin] + - [0x7C6854, bin] + - [0x7C8154, bin] + - [0x7C9BA8, bin] + - [0x7CB654, bin] + - [0x7CD0D0, bin] + - [0x7CD3D4, bin] + - [0x7CD938, bin] + - [0x7CFFCC, bin] + - [0x7D1EF4, bin] + - [0x7D3CAC, bin] + - [0x7D56D8, bin] + - [0x7D79AC, bin] + - [0x7D9718, bin] + - [0x7DB5C0, bin] + - [0x7DD2F8, bin] + - [0x7DEF80, bin] + - [0x7E0894, bin] + - [0x7E2424, bin] + - [0x7E495C, bin] + - [0x7E6D4C, bin] + - [0x7E8FD0, bin] + - [0x7EAB78, bin] + - [0x7ED0E8, bin] + - [0x7EED64, bin] + - [0x7F118C, bin] + - [0x7F2A78, bin] + - [0x7F4774, bin] + - [0x7F6ABC, bin] + - [0x7F8E44, bin] + - [0x7FB188, bin] + - [0x7FD23C, bin] + - [0x7FF56C, bin] + - [0x8018C0, bin] + - [0x803BD0, bin] + - [0x805AE0, bin] + - [0x807C74, bin] + - [0x808378, bin] + - [0x809118, bin] + - [0x80B0DC, bin] + - [0x80C444, bin] + - [0x80E1DC, bin] + - [0x80F368, bin] + - [0x810FBC, bin] + - [0x812BA8, bin] + - [0x81491C, bin] + - [0x816B90, bin] + - [0x818C64, bin] + - [0x81AA20, bin] + - [0x81CB8C, bin] # end of Yay0 files + - [0x81EC28] + + - name: late_assets_2 + type: code + bss_size: 0x0 + start: 0x820000 + vram: 0x8FD00000 # unknown vram. Another unused one? Might be 8FD00000? + ld_align_segment_start: 0x820000 + subsegments: + - [0x820000, bin] + + - name: late_assets_3 + type: code + bss_size: 0x0 + start: 0x898000 + vram: 0x8FE00000 # unknown vram. Another unused one? Might be 8FE00000? + ld_align_segment_start: 0x898000 + subsegments: + - [0x898000, bin] + + - name: late_assets_4 + type: code + bss_size: 0x0 + start: 0x8CC000 + vram: 0x8FF00000 + ld_align_segment_start: 0x8CC000 + subsegments: + - [0x8CC000, bin] + + - name: late_assets_5 + type: code + bss_size: 0x0 + start: 0x920000 + vram: 0x90000000 + ld_align_segment_start: 0x920000 + subsegments: + - [0x920000, bin] + + - name: late_assets_6 + type: code + bss_size: 0x0 + start: 0x15C0000 + vram: 0x91000000 + ld_align_segment_start: 0x15C0000 + subsegments: + - [0x15C0000, bin] + + - [0x1FEC050, bin] # end of the ROM data, padding until 32MB - [0x2000000]