mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 13:24:02 -05:00
asm/main_020504BC.s 28 functions cleared asm/main_0200D1F0.s 11 functions cleared asm/main_02052060.s 10 functions cleared asm/overlay_29_02320788.s 8 functions cleared asm/main_020559D8.s 1 function cleared asm/overlay_29_022E34A8.s 1 of 9 remainder -> overlay_29_022E2B68.s sub_02050CF8 and sub_02050D84 are in translation units of their own, src/main_02050CF8.c and src/main_02050D84.c, and that is load-bearing rather than tidiness. Both call BitstreamDebug, which is four bytes -- an empty body -- and is one of the other 26 functions of the same asm file. Compiled beside it at -O4,s, mwcc inlines the call away and each function comes out two instructions short; the ROM then shifts and 33 of 37 sbins stop matching. Retail emits a real bl there, so retail compiled these two apart from BitstreamDebug. Separate objects reproduce that, and the pool -- five words and the predicated ldrne/ldreq pair -- was never the problem. asm/main_bss_022AB0AC.s declares a second global at 0x022AB918. Two objects of different size share that address: the record TEAM_NAME (0x14 bytes, 0x10 under JAPAN) and _022AB918, its leading name buffer (0xC, 8 under JAPAN). Four functions load both, which needs two distinct (symbol, addend) pool keys; one symbol gives one word and leaves them four bytes short. No .space is added and no later symbol moves, so the bss layout and the ROM are untouched -- confirmed by building that one-line change alone against the previous commit. ov29_022E34A8_EU exists only in the EUROPE build, so its definition and its prototype both carry #ifdef EUROPE; its single call site was already inside one. Note that extracting it left an orphan #endif in the remainder file, because it was the first function in its .s and sat inside a region conditional -- the tool takes the opening directive with the function and leaves the closing one behind. struct bag_items loses fill2/fill3/fill4 for the members behind them, so struct bulk_item moves above it and two accessors return struct bulk_item *. struct unk_020517F4 splits u8[8] into u8[4] + s32, forced by a 32-bit load at offset 4. struct bitstream::ptr becomes u8 * -- CopyBitsTo and CopyBitsFrom read it with ldrb, and char * under -char signed emits ldrsb. sub_02051FF0 and LoadFileFromRom take a const char * path, not a u32 id; src/ground_bg.c already declared the latter correctly. Seventeen call-site-derived declarations are removed in favour of an include of the owning header. Authored by Claude (Opus 5) under human direction. Confirmed by matching builds in all three regions: build/pmdsky.us/pmdsky.us.nds: OK, build/pmdsky.eu/pmdsky.eu.nds: OK, build/pmdsky.jp/pmdsky.jp.nds: OK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 lines
153 B
C
9 lines
153 B
C
#ifndef PMDSKY_MAIN_02050CF8_H
|
|
#define PMDSKY_MAIN_02050CF8_H
|
|
|
|
#include "util.h"
|
|
|
|
s32 sub_02050CF8(void *buf, s32 len);
|
|
|
|
#endif //PMDSKY_MAIN_02050CF8_H
|