Skip to content

Commit

Permalink
label common menu bins and identify the rest of the late asset ranges…
Browse files Browse the repository at this point in the history
… of the ROM
  • Loading branch information
RevoSucks committed Sep 24, 2024
1 parent 4eeaab4 commit b8181f5
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 28 deletions.
12 changes: 6 additions & 6 deletions include/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/10/fragment10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/11/fragment11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/35/fragment35.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/36/fragment36.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/fragments/37/fragment37.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/6/fragment6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/7/fragment7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/8/fragment8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/fragments/9/fragment9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions tools/yay0_split.py
Original file line number Diff line number Diff line change
@@ -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)), "]")
119 changes: 110 additions & 9 deletions yamls/us/rom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]

0 comments on commit b8181f5

Please sign in to comment.