Skip to content

Commit b8181f5

Browse files
committed
label common menu bins and identify the rest of the late asset ranges of the ROM
1 parent 4eeaab4 commit b8181f5

File tree

13 files changed

+146
-28
lines changed

13 files changed

+146
-28
lines changed

include/sections.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,12 @@ extern u8 backgrounds_ROM_START[]; // 3CB130
458458
extern u8 backgrounds_ROM_END[]; // 3CB130
459459
extern u8 battle_headers_ROM_START[]; // 45B580
460460
extern u8 battle_headers_ROM_END[]; // 45B580
461-
extern u8 _4A21C0_ROM_START[];
462-
extern u8 _4A21C0_ROM_END[];
463-
extern u8 _4BD6B0_ROM_START[];
464-
extern u8 _4BD6B0_ROM_END[];
465-
extern u8 _4BE810_ROM_START[];
466-
extern u8 _4BE810_ROM_END[];
461+
extern u8 common_menu0_ui_ROM_START[];
462+
extern u8 common_menu0_ui_ROM_END[];
463+
extern u8 common_menu1_ui_ROM_START[];
464+
extern u8 common_menu1_ui_ROM_END[];
465+
extern u8 common_menu2_ui_ROM_START[];
466+
extern u8 common_menu2_ui_ROM_END[];
467467
extern u8 area_select_ui_ROM_START[]; // 4D1330
468468
extern u8 area_select_ui_ROM_END[]; // 4D1330
469469
extern u8 menu_select_ui_ROM_START[]; // 4EB0C0

linker_scripts/us/symbol_addrs.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ n64_logo_texture_ROM_START = 0x3B96B0; // defined:true
186186
fonts_ROM_START = 0x3BA190; // defined:true
187187
backgrounds_ROM_START = 0x3CB130; // defined:true
188188
battle_headers_ROM_START = 0x45B580; // defined:true
189-
_4A21C0_ROM_START = 0x4A21C0; // defined:true
190-
_4BD6B0_ROM_START = 0x4BD6B0; // defined:true
191-
_4BE810_ROM_START = 0x4BE810; // defined:true
189+
common_menu0_ui_ROM_START = 0x4A21C0; // defined:true
190+
common_menu1_ui_ROM_START = 0x4BD6B0; // defined:true
191+
common_menu2_ui_ROM_START = 0x4BE810; // defined:true
192192
area_select_ui_ROM_START = 0x4D1330; // defined:true
193193
menu_select_ui_ROM_START = 0x4EB0C0; // defined:true
194194
stadium_select_ui_ROM_START = 0x5046B0; // defined:true

src/fragments/10/fragment10.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ void func_864025A0(UNUSED s32 arg0, UNUSED s32 arg1) {
951951
func_80005E40(0x18000, 0);
952952
sp24 = func_80007444(0, 1, 3, 1, 2, 1);
953953
D_87B000E0 = func_8001E94C(0x16, 0);
954-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
954+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
955955
FRAGMENT_LOAD(fragment31);
956956
func_86402130();
957957
func_80007678(sp24);

src/fragments/11/fragment11.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ void func_86501E9C(UNUSED s32 arg0, UNUSED s32 arg1) {
829829
sp24 = func_80007444(0, 1, 3, 1, 2, 1);
830830
D_87B000E0 = func_8001E94C(0x16, 0);
831831

832-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
832+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
833833
FRAGMENT_LOAD(fragment31);
834834

835835
func_86501AAC();

src/fragments/35/fragment35.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ s32 func_820003A4(UNUSED s32 arg0, UNUSED s32 arg1) {
7070
func_80005E40(0x10000, 0);
7171
sp2C = func_80007444(0, 1, 2, 0, 2, 1);
7272

73-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
73+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
7474
ASSET_LOAD(D_2000000, n64_logo_texture, 0);
7575

7676
func_80028AFC(2);

src/fragments/36/fragment36.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void func_82100B1C(s32 arg0) {
342342
}
343343

344344
void func_82100B98(void) {
345-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
345+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
346346
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
347347

348348
D_82100EB8 = main_pool_alloc(0x4510, 0);

src/fragments/37/fragment37.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,9 @@ s32 func_82202DC4(UNUSED s32 arg0, UNUSED s32 arg1) {
818818
sp24 = func_80007444(1, 0, 2, 0, 2, 1);
819819
func_8001E94C(0x1C, 0);
820820

821-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
821+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
822822
ASSET_LOAD(D_3000000, area_select_ui, 0);
823-
ASSET_LOAD(D_2000000, _4BE810, 0);
823+
ASSET_LOAD(D_2000000, common_menu2_ui, 0);
824824

825825
func_8002D510();
826826
D_822030F0 = func_8002D5AC(0x17);

src/fragments/6/fragment6.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ void func_86002778(UNUSED s32 arg0, UNUSED s32 arg1) {
12031203
sp24 = (unk_func_80007444*)func_80007444(0, 1, 3, 1, 2, 1);
12041204
D_86003B7C = func_8001E94C(0x36, 0);
12051205

1206-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
1206+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
12071207
FRAGMENT_LOAD(fragment31);
12081208

12091209
func_80004454((((u32)D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END);

src/fragments/7/fragment7.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ void func_86104474(UNUSED s32 arg0, UNUSED s32 arg1) {
18891889
sp24 = func_80007444(0, 1, 3, 1, 2, 1);
18901890
D_861054B4 = func_8001E94C(0x36, 0);
18911891

1892-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
1892+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
18931893
FRAGMENT_LOAD(fragment31);
18941894

18951895
func_80004454((((u32)D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END);

src/fragments/8/fragment8.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ void func_8620369C(s32 arg0, UNUSED s32 arg1) {
14021402
sp24 = func_80007444(0, 0, 3, 1, 2, 1);
14031403
D_86204714 = func_8001E94C(0x16, 0);
14041404

1405-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
1405+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
14061406
ASSET_LOAD(D_4000000, run_rattata_run_flag_gfx, 0);
14071407
FRAGMENT_LOAD(fragment31);
14081408

src/fragments/9/fragment9.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ void func_86301474(UNUSED s32 arg0, UNUSED s32 arg1) {
585585
sp24 = func_80007444(0, 1, 3, 1, 2, 1);
586586
D_86301728 = func_8001E94C(0x26, 0);
587587

588-
ASSET_LOAD(D_1000000, _4BD6B0, 0);
588+
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
589589
FRAGMENT_LOAD(fragment31);
590590

591591
func_80004454((((u32)&D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, _5C7A70_ROM_START, _5C7A70_ROM_END);

tools/yay0_split.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
import os
5+
6+
# Yay0_split_script
7+
8+
# this was used to scan/generate splits for certain small portions of asset tables. Please do not use this.
9+
10+
bin_file = open("scan.bin", 'r+b')
11+
size = os.path.getsize("scan.bin")
12+
ba = bytearray(bin_file.read(size))
13+
14+
i = 0
15+
for i in range(i, size, 4):
16+
if ba[i + 0] == 0x59 and ba[i + 1] == 0x61 and ba[i + 2] == 0x79 and ba[i + 3] == 0x30:
17+
print("Yay0 found at: -[", hex(0x7C0000 + (i)), "]")

yamls/us/rom.yaml

+110-9
Original file line numberDiff line numberDiff line change
@@ -2437,9 +2437,9 @@
24372437
- [0x3BA190, bin, fonts]
24382438
- [0x3CB130, bin, backgrounds]
24392439
- [0x45B580, bin, battle_headers]
2440-
- [0x4A21C0, bin]
2441-
- [0x4BD6B0, bin] # like a common assets bin?
2442-
- [0x4BE810, bin]
2440+
- [0x4A21C0, bin, common_menu0_ui]
2441+
- [0x4BD6B0, bin, common_menu1_ui]
2442+
- [0x4BE810, bin, common_menu2_ui]
24432443
- [0x4D1330, bin, area_select_ui]
24442444
- [0x4EB0C0, bin, menu_select_ui]
24452445
- [0x5046B0, bin, stadium_select_ui]
@@ -2483,16 +2483,117 @@
24832483
- [0x79AFB0, bin, copyright]
24842484
- [0x79B8F0]
24852485

2486-
2487-
# rest of ROM.. part 2. This area and beyond NEEDS to be hard-aligned to this address.
2488-
# for the ROM to be shiftable, we need a way to fix this area beyond here to this address and for the prior area
2489-
# to be filled with FFs instead of being binned. TODO: Make it shift
2490-
- name: late_assets
2486+
# ------------------------------------------------
2487+
# sections hard aligned to an address start here
2488+
# ------------------------------------------------
2489+
2490+
- name: late_assets_1
24912491
type: code
24922492
bss_size: 0x0
24932493
start: 0x7C0000
24942494
vram: 0x8FC00000 # unknown vram. Another unused one? Might be 8FC00000?
24952495
ld_align_segment_start: 0x7C0000
2496-
subsegments:
2496+
subalign: 4
2497+
subsegments: # unaligned starts
24972498
- [0x7C0000, bin]
2499+
- [0x7C18F8, bin]
2500+
- [0x7C3398, bin]
2501+
- [0x7C4E14, bin]
2502+
- [0x7C6854, bin]
2503+
- [0x7C8154, bin]
2504+
- [0x7C9BA8, bin]
2505+
- [0x7CB654, bin]
2506+
- [0x7CD0D0, bin]
2507+
- [0x7CD3D4, bin]
2508+
- [0x7CD938, bin]
2509+
- [0x7CFFCC, bin]
2510+
- [0x7D1EF4, bin]
2511+
- [0x7D3CAC, bin]
2512+
- [0x7D56D8, bin]
2513+
- [0x7D79AC, bin]
2514+
- [0x7D9718, bin]
2515+
- [0x7DB5C0, bin]
2516+
- [0x7DD2F8, bin]
2517+
- [0x7DEF80, bin]
2518+
- [0x7E0894, bin]
2519+
- [0x7E2424, bin]
2520+
- [0x7E495C, bin]
2521+
- [0x7E6D4C, bin]
2522+
- [0x7E8FD0, bin]
2523+
- [0x7EAB78, bin]
2524+
- [0x7ED0E8, bin]
2525+
- [0x7EED64, bin]
2526+
- [0x7F118C, bin]
2527+
- [0x7F2A78, bin]
2528+
- [0x7F4774, bin]
2529+
- [0x7F6ABC, bin]
2530+
- [0x7F8E44, bin]
2531+
- [0x7FB188, bin]
2532+
- [0x7FD23C, bin]
2533+
- [0x7FF56C, bin]
2534+
- [0x8018C0, bin]
2535+
- [0x803BD0, bin]
2536+
- [0x805AE0, bin]
2537+
- [0x807C74, bin]
2538+
- [0x808378, bin]
2539+
- [0x809118, bin]
2540+
- [0x80B0DC, bin]
2541+
- [0x80C444, bin]
2542+
- [0x80E1DC, bin]
2543+
- [0x80F368, bin]
2544+
- [0x810FBC, bin]
2545+
- [0x812BA8, bin]
2546+
- [0x81491C, bin]
2547+
- [0x816B90, bin]
2548+
- [0x818C64, bin]
2549+
- [0x81AA20, bin]
2550+
- [0x81CB8C, bin] # end of Yay0 files
2551+
- [0x81EC28]
2552+
2553+
- name: late_assets_2
2554+
type: code
2555+
bss_size: 0x0
2556+
start: 0x820000
2557+
vram: 0x8FD00000 # unknown vram. Another unused one? Might be 8FD00000?
2558+
ld_align_segment_start: 0x820000
2559+
subsegments:
2560+
- [0x820000, bin]
2561+
2562+
- name: late_assets_3
2563+
type: code
2564+
bss_size: 0x0
2565+
start: 0x898000
2566+
vram: 0x8FE00000 # unknown vram. Another unused one? Might be 8FE00000?
2567+
ld_align_segment_start: 0x898000
2568+
subsegments:
2569+
- [0x898000, bin]
2570+
2571+
- name: late_assets_4
2572+
type: code
2573+
bss_size: 0x0
2574+
start: 0x8CC000
2575+
vram: 0x8FF00000
2576+
ld_align_segment_start: 0x8CC000
2577+
subsegments:
2578+
- [0x8CC000, bin]
2579+
2580+
- name: late_assets_5
2581+
type: code
2582+
bss_size: 0x0
2583+
start: 0x920000
2584+
vram: 0x90000000
2585+
ld_align_segment_start: 0x920000
2586+
subsegments:
2587+
- [0x920000, bin]
2588+
2589+
- name: late_assets_6
2590+
type: code
2591+
bss_size: 0x0
2592+
start: 0x15C0000
2593+
vram: 0x91000000
2594+
ld_align_segment_start: 0x15C0000
2595+
subsegments:
2596+
- [0x15C0000, bin]
2597+
2598+
- [0x1FEC050, bin] # end of the ROM data, padding until 32MB
24982599
- [0x2000000]

0 commit comments

Comments
 (0)