mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-26 20:27:50 -05:00
asm/main_0200F884.s 38 functions
asm/main_0202F190.s 26 functions
asm/overlay_29_022E5650.s 39 functions
asm/overlay_29_023047DC.s 16 functions
All four objects leave main.lsf and no new object is created.
Four shared types change, each forced by a load the current declaration cannot
produce, and each proven layout-preserving with the real compiler rather than
asserted.
struct monster's 0x19C..0x20F becomes `struct unk_02304D20 field_0x19c[4]` plus
two s16, replacing 112 lines: a `struct position pos`, 110 u8 placeholders and
`u16 walk_anim_frames_left`. Two functions index monster+0x19C with a stride of
0x1C (smulbb/smlabb against #0x1c) and a bound of 4, and element 0 aliases the
old pos at 0x19C and walk_anim_frames_left at 0x1B4 (= element 0 + 0x18).
Nothing in src/ reads either absorbed name through a struct monster *.
struct entity's field_0xac and field_0xad become one s16: ov29_02304830 reads
entity+0xAC with ldrsh, which no pair of u8 members can produce and no cast at
the read site can fix. Neither name is used anywhere else.
struct bag_items replaces fill2/fill3/fill4 with the members behind them --
two 1000-element arrays, four scalars and two 2-D struct bulk_item arrays -- so
struct bulk_item moves above it as a member type. Offsets are read off the asm:
the 0x300+0x8a and 0xb00+0x5a splits are forced by ARM addressing mode 3's
8-bit immediate, ldrsh vs ldrh fixes the signedness, cmp #0x3e8 fixes 1000, and
lsl #5 / lsl #4 fix the two strides. sizeof stays 0x13B4 and every following
member keeps its offset. GetCurrentKecleonShop1ItemByIndex and
GetCurrentKecleonShop2ItemByIndex return struct bulk_item * as a consequence.
window.h's portrait_params gains a `Point offset` in place of two u32 members,
and Point moves above it. UpdatePortraitBox loads the pair with
`add r1, r4, #0xc; ldm r1, {r1,r2}`, and mwcc emits ldm only when the base
points exactly at the object; two separate member reads scored 860. Every
object in the 25 translation units that reach window.h is byte-identical
before and after.
PlayEffectAnimationPixelPos was declared taking a struct entity * and returning
void; it takes a struct pixel_position * and returns s32, so ov29_022E563C's own
signature changes with it. Two declarations packed onto one physical line in
src/overlay_11_02307334.c are removed, and two in src/overlay_29_0230558C.c are
replaced by an include -- those four would have been hard errors the moment the
new headers landed.
SetAndPlayAnimationForAnimationControl's prototype here was derived from the
call site and had three parameters wrong. Its prologue reads the first three
stacked arguments as ldrb [sp,#0x18], ldr [sp,#0x1c], ldrb [sp,#0x20] and
ldrb [sp,#0x24], so parameters 5, 7 and 8 are u8, not u32.
That is what entity::field_0xaa turned on. Upstream made the member s8 in
8c39cbea and it stays s8 -- ov29_022DEA10 returns a slot index or -1, so the
member is signed. Passing it through a u32 parameter forced a widening of a
signed byte, i.e. ldrsb, where retail has ldrb; with the parameter declared u8
the conversion is s8 to u8 and mwcc folds it into the ldrb retail has. No cast
anywhere, and overlay_30_init.c is untouched.
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
152 B
C
9 lines
152 B
C
#ifndef PMDSKY_MAIN_02010BA4_H
|
|
#define PMDSKY_MAIN_02010BA4_H
|
|
|
|
#include "item.h"
|
|
|
|
struct bulk_item* GetCurrentKecleonShop2ItemByIndex(s32 idx);
|
|
|
|
#endif
|