Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions config/arm9/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ src/func_020071e0.c:
complete
.text start:0x020071e0 end:0x020072c0

src/func_020072c0.c:
src/_ZN7Vector3D1Ev.cpp:
complete
.text start:0x020072c0 end:0x020072c4

Expand Down Expand Up @@ -1201,7 +1201,7 @@ src/_ZN5ActorC1Ev.cpp:
complete
.text start:0x020113c0 end:0x02011508

src/func_02011508.c:
src/_ZN8Vector3sD1Ev.cpp:
complete
.text start:0x02011508 end:0x0201150c

Expand Down
7 changes: 4 additions & 3 deletions config/arm9/overlays/ov002/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ src/_ZN5EnemyD2Ev.c:
complete
.text start:0x020aed18 end:0x020aed3c

src/_ZN5EnemyD0Ev.c:
src/_ZN5EnemyD0Ev.cpp:
complete
.text start:0x020aed3c end:0x020aed74

src/_ZN5EnemyD1Ev.c:
src/_ZN5EnemyD1Ev.cpp:
complete
.text start:0x020aed74 end:0x020aed98

Expand Down Expand Up @@ -3248,6 +3248,7 @@ src/func_ov002_020d6998.cpp:
.text start:0x020d6998 end:0x020d6c60

src/func_ov002_020d6c60.cpp:
complete
.text start:0x020d6c60 end:0x020d6dac

src/func_ov002_020d6dac.c:
Expand Down Expand Up @@ -4651,7 +4652,7 @@ src/_ZN8PlatformD1Ev.cpp:
complete
.text start:0x020ee42c end:0x020ee464

src/_ZN8PlatformD0Ev.c:
src/_ZN8PlatformD0Ev.cpp:
complete
.text start:0x020ee464 end:0x020ee4b0

Expand Down
2 changes: 2 additions & 0 deletions config/arm9/overlays/ov002/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@ data_ov002_021081b8 kind:data(any) addr:0x021081b8
_ZTI12dEnemyBase_c kind:data(any) addr:0x021081c0
_ZTS12dEnemyBase_c kind:data(any) addr:0x021081cc
data_ov002_021081e4 kind:data(any) addr:0x021081e4
_ZTV5Enemy kind:data(any) addr:0x021081e4
_ZTI11dCapEnemy_c kind:data(any) addr:0x02108260
_ZTS11dCapEnemy_c kind:data(any) addr:0x0210826c
data_ov002_02108284 kind:data(any) addr:0x02108284
Expand Down Expand Up @@ -2237,6 +2238,7 @@ _ZTI16dPathLiftActor_c kind:data(any) addr:0x0210af0c
_ZTS16dPathLiftActor_c kind:data(any) addr:0x0210af18
data_ov002_0210af2c kind:data(any) addr:0x0210af2c
data_ov002_0210af70 kind:data(any) addr:0x0210af70
_ZTV8PathLift kind:data(any) addr:0x0210af70
_ZTS9daSCoin_c kind:data(any) addr:0x0210aff4
_ZTI9daSCoin_c kind:data(any) addr:0x0210b000
InvisibleSecret_SpawnInfo kind:data(any) addr:0x0210b00c
Expand Down
2 changes: 1 addition & 1 deletion config/arm9/overlays/ov014/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ src/ShutterBob_Spawn.c:
complete
.text start:0x021112cc end:0x02111308

src/_ZN10ChainChompD1Ev.c:
src/_ZN10ChainChompD1Ev.cpp:
complete
.text start:0x02111308 end:0x021113bc

Expand Down
2 changes: 1 addition & 1 deletion config/arm9/overlays/ov016/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.ctor start:0x02113abc end:0x02113ad0 kind:rodata align:4
.data start:0x02113ae0 end:0x02114d20 kind:data align:32
.bss start:0x02114d20 end:0x02114ea0 kind:bss align:32
src/_ZN5UnagiD1Ev.c:
src/_ZN5UnagiD1Ev.cpp:
complete
.text start:0x021111a0 end:0x02111208

Expand Down
4 changes: 2 additions & 2 deletions config/arm9/overlays/ov034/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
.ctor start:0x02114078 end:0x0211407c kind:rodata align:4
.data start:0x02114080 end:0x02114620 kind:data align:32
.bss start:0x02114620 end:0x021148e0 kind:bss align:32
src/_ZN7WigglerD1Ev.c:
src/_ZN7WigglerD1Ev.cpp:
complete
.text start:0x021111a0 end:0x021112b0

src/_ZN7WigglerD0Ev.c:
src/_ZN7WigglerD0Ev.cpp:
complete
.text start:0x021112b0 end:0x021113d4

Expand Down
4 changes: 2 additions & 2 deletions config/arm9/overlays/ov073/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
.ctor start:0x02122f34 end:0x02122f3c kind:rodata align:4
.data start:0x02122f40 end:0x02123280 kind:data align:32
.bss start:0x02123280 end:0x021234e0 kind:bss align:32
src/_ZN11ChiefChillyD1Ev.c:
src/_ZN11ChiefChillyD1Ev.cpp:
complete
.text start:0x0211f000 end:0x0211f098

src/_ZN11ChiefChillyD0Ev.c:
src/_ZN11ChiefChillyD0Ev.cpp:
complete
.text start:0x0211f098 end:0x0211f144

Expand Down
2 changes: 1 addition & 1 deletion config/arm9/overlays/ov074/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.ctor start:0x02122d70 end:0x02122d74 kind:rodata align:4
.data start:0x02122d80 end:0x02122fe0 kind:data align:32
.bss start:0x02122fe0 end:0x021231a0 kind:bss align:32
src/_ZN8GoombossD1Ev.c:
src/_ZN8GoombossD1Ev.cpp:
complete
.text start:0x0211f000 end:0x0211f0a0

Expand Down
3 changes: 0 additions & 3 deletions config/arm9/overlays/ov091/delinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ src/_ZN5StumpD0Ev.c:
complete
.text start:0x021339a8 end:0x021339fc

src/func_ov091_021339fc.c:
.text start:0x021339fc end:0x02133c6c

src/func_ov091_02133c6c.cpp:
complete
.text start:0x02133c6c end:0x02133d1c
Expand Down
6 changes: 4 additions & 2 deletions config/arm9/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ _ZN6CameraD0Ev kind:function(arm,size=0x50) addr:0x02007098
func_020070e8 kind:function(arm,size=0xc0) addr:0x020070e8
func_020071a8 kind:function(arm,size=0x38) addr:0x020071a8
func_020071e0 kind:function(arm,size=0xe0) addr:0x020071e0
func_020072c0 kind:function(arm,size=0x4) addr:0x020072c0
_ZN7Vector3D1Ev kind:function(arm,size=0x4) addr:0x020072c0
func_020072c0 kind:function(arm,size=0x0) addr:0x020072c0
func_020072c4 kind:function(arm,size=0xdc) addr:0x020072c4
func_020073a0 kind:function(arm,size=0x74) addr:0x020073a0
func_02007414 kind:function(arm,size=0x3c) addr:0x02007414
Expand Down Expand Up @@ -319,7 +320,8 @@ _ZN5ActorD2Ev kind:function(arm,size=0x4c) addr:0x020112c8
_ZN5ActorD0Ev kind:function(arm,size=0x60) addr:0x02011314
_ZN5ActorD1Ev kind:function(arm,size=0x4c) addr:0x02011374
_ZN5ActorC1Ev kind:function(arm,size=0x148) addr:0x020113c0
func_02011508 kind:function(arm,size=0x4) addr:0x02011508
_ZN8Vector3sD1Ev kind:function(arm,size=0x4) addr:0x02011508
func_02011508 kind:function(arm,size=0x0) addr:0x02011508
_ZN5ActorC2Ev kind:function(arm,size=0x148) addr:0x0201150c
func_02011654 kind:function(arm,size=0x44) addr:0x02011654
func_02011698 kind:function(arm,size=0x2c) addr:0x02011698
Expand Down
9 changes: 7 additions & 2 deletions include/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ struct Actor : ActorDerived {
s32 mHorzSpeed; /* 0x098 */
s32 mVertAccel; /* 0x09c -- fix12, negative (gravity) */
s32 mTerminalVelocity; /* 0x0a0 -- fix12, negative */
u8 pad_0a4[0x4]; /* likely the same physics block; unproven */
/* 0x0a4 and 0x0ac were padding "likely the same physics block; unproven".
They are real, and Enemy is the evidence: its generated header declared
both as s32 and its sources read them, so once `Enemy : Actor` they have
to exist here. Still unnamed -- what they mean is not evidenced, only
that they are Actor's and four bytes wide. */
s32 unk_0a4; /* 0x0a4 */
s32 mVertSpeed; /* 0x0a8 */
u8 pad_0ac[0x4]; /* likely the same physics block; unproven */
s32 unk_0ac; /* 0x0ac */
u32 mFlags; /* 0x0b0 -- bit 0x10000 suppresses behaviour */
s32 unk_0b4; /* 0x0b4 */
s32 unk_0b8; /* 0x0b8 -- clip radius; 0 skips the camera transform */
Expand Down
19 changes: 19 additions & 0 deletions include/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
struct BCA_File;
struct SharedFilePtr;

extern "C" void _ZN6Memory16operator_delete2EPv(void *);

struct Animation {
/* 0x00 is the vptr, placed implicitly by the first virtual declaration. */
u32 numFramesAndFlags; /* 0x04 - count in bits 0..29, loop flags in 30..31 */
Expand All @@ -66,6 +68,23 @@ struct Animation {
/* --- static --- */
static char *LoadFile(SharedFilePtr &ptr);
static void UpdateFileOffsets(BCA_File &file);

/* WHAT LETS A REAL `~Class()` REPRODUCE THE ROM'S DELETING DESTRUCTOR.
The compiler generates D0 as "run the destructor body, then call operator
delete on the class". Without this it emits the global `_ZdlPv`, which
exists nowhere in this image, and the D0 comes out one relocated word
different from the ROM -- a difference build_pin.verify CANNOT SEE,
because it wildcards relocated words. Only the link catches it.

This family deallocates through Memory::operator_delete2, not the actor
heap: every D0 below ends with a call to 0x0203cbcc. Actor's copy of this
member calls Memory::Deallocate instead, which is why each needs its own.

Inline, and in the IMMEDIATE base -- mwcc inlines it only when it finds it
in the class or one level up, as include/Actor.h records. No layout
effect: a non-virtual inline member adds no field and no vtable slot. */
void operator delete(void *ptr) { _ZN6Memory16operator_delete2EPv(ptr); }

};

typedef char Animation_size_must_be_0x10[sizeof(Animation) == 0x10 ? 1 : -1];
Expand Down
52 changes: 40 additions & 12 deletions include/ArrowSignRight.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
/* AUTO-GENERATED from matched-function evidence by tools/gen_header.py
* class ArrowSignRight: 6 matched functions, 7 evidenced fields.
* Offsets/widths are observed, not guessed. Gaps are explicit padding.
* Field NAMES are placeholders - renaming cannot change codegen. */
#ifndef ARROWSIGNRIGHT_H
#define ARROWSIGNRIGHT_H

#include "types.h"
#include "Model.h"

/* Derives from Platform: the destructor stores this class's vtable, then
* Platform's -- inlined -- then destroys the MovingMeshCollider at 0x124 and
* the Model at 0xd4 before chaining to Actor. All three belong to Platform.
* Everything this header used to restate below 0x31e was Actor's and
* Platform's, and is inherited now.
*
* SIZE IS THE OBSERVED FIELD SPAN, rounded up. It guards this declaration; it
* is not independent evidence about the ROM.
*/

#ifdef __cplusplus

#include "Platform.h"
#include "ShadowModel.h"

struct ArrowSignRight : Platform {
u8 pad_31e[0x2];
ShadowModel mShadowModel; /* 0x320 */
u8 unk_348; /* 0x348 */
u8 pad_349[0x33];
u8 unk_37c; /* 0x37c */

/* --- vtable --- */
virtual ~ArrowSignRight();

int Behavior();
int CleanupResources();
int Render();
};

typedef char ArrowSignRight_size_must_be_0x380[sizeof(ArrowSignRight) == 0x380 ? 1 : -1];

#else

/* The C spelling of the same object, flat. Kept because the D0 file is a C
translation unit that reads these fields, and D0 is compiler-generated so it
can never be migrated. Same arrangement as include/ShadowModel.h. */
struct ArrowSignRight {
u8 pad_000[0xc];
u16 unk_00c; /* 0x00c */
Expand All @@ -26,12 +58,8 @@ struct ArrowSignRight {
u8 unk_348; /* 0x348 */
u8 pad_349[0x33];
u8 unk_37c; /* 0x37c */
#ifdef __cplusplus
/* methods */
int Behavior();
int CleanupResources();
int Render();
#endif
};

#endif
#endif /* __cplusplus */

#endif /* ARROWSIGNRIGHT_H */
44 changes: 33 additions & 11 deletions include/BigBrickBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@
#define BIGBRICKBLOCK_H

#include "types.h"
#include "Platform.h"

/* Derives from Platform: the destructor stores this class's vtable, then
* Platform's -- inlined -- then destroys the MovingMeshCollider at 0x124 and
* the Model at 0xd4 before chaining to Actor. All three are Platform's.
* the Model at 0xd4 before chaining to Actor. All three belong to Platform.
* Everything this header used to restate below 0x31e was Actor's and
* Platform's.
*
* THE FIELDS AT 0x31e/0x31f ARE IN PLATFORM'S TAIL PADDING. Platform's last
* field ends at 0x31e and its size rounds to 0x320; the Itanium ABI lets a
* derived class use a non-POD base's tail padding, and the ROM does. The bytes
* settle it -- code here reads this+0x31e and reproduces.
* Platform's, and is inherited now.
*
* SIZE IS THE OBSERVED FIELD SPAN, rounded up. It guards this declaration; it
* is not independent evidence about the ROM.
*/

#ifdef __cplusplus

#include "Platform.h"

struct BigBrickBlock : Platform {
u8 unk_31e; /* 0x31e - in Platform's tail padding */
u8 unk_31f; /* 0x31f */
u8 mEventID; /* 0x320 */
u8 unk_31e; /* 0x31e */
u8 unk_31f; /* 0x31f */
u8 mEventID; /* 0x320 */
u8 pad_321[0x3];
Actor *mSwitch; /* 0x324 */

Expand All @@ -39,6 +35,32 @@ struct BigBrickBlock : Platform {

typedef char BigBrickBlock_size_must_be_0x328[sizeof(BigBrickBlock) == 0x328 ? 1 : -1];

#else

/* The C spelling of the same object, flat. Kept because the D0 file is a C
translation unit that reads these fields, and D0 is compiler-generated so it
can never be migrated. Same arrangement as include/ShadowModel.h. */
struct BigBrickBlock {
u8 pad_000[0xc];
u16 mActorId; /* 0x00c */
u8 pad_00e[0xc6];
/* Model member, named by the class's own destructor calling
Model's D1 at +0x0d4 -- a relocation the ROM build
checks. Was a u8 marker. [_ZN13BigBrickBlockD1Ev.c] */
Model mModel; /* 0x0d4 */
u8 mMeshCollider; /* 0x124 */
u8 pad_125[0x1f9];
u8 unk_31e; /* 0x31e */
u8 unk_31f; /* 0x31f */
u8 mEventID; /* 0x320 */
u8 pad_321[0x3];
/* Actor * -- the ROM loads this WORD and passes it to _ZN5Actor15FindWithActorIDEjPS_
as that function's `this`, which is an object address, so the word is a Actor *. It
says nothing about the rest of the marker's span, which stays explicit padding. Was
a u8 marker. */
Actor *mSwitch; /* 0x324 */
};

#endif /* __cplusplus */

#endif /* BIGBRICKBLOCK_H */
12 changes: 12 additions & 0 deletions include/BlendModelAnim.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#ifdef __cplusplus

extern "C" void _ZN6Memory16operator_delete2EPv(void *);

struct BlendModelAnim : ModelAnim {
Fix12i blendWeight; /* 0x64 - 0x1000 is 1.0 */
Fix12i blendStep; /* 0x68 - per-frame increment */
Expand All @@ -41,6 +43,16 @@ struct BlendModelAnim : ModelAnim {
void Advance();
void SetAnim(BCA_File &animFile, int numBlendFrames, int flags,
Fix12<int> speed, u16 startFrame); /* free function, wall 6az */

/* ITS OWN, TO RESOLVE AN AMBIGUITY MULTIPLE INHERITANCE CREATES. ModelAnim
derives from Model (so ModelBase) and from Animation, and both bases
declare operator delete, so an inherited one is "ambiguous access to
name found: ModelBase::operator delete and Animation::operator delete".
Declaring it here picks the same deallocator both bases name, and also
satisfies the rule in include/Actor.h that mwcc only inlines the member
when it is in the class or its immediate base. */
void operator delete(void *ptr) { _ZN6Memory16operator_delete2EPv(ptr); }

};

typedef char BlendModelAnim_size_must_be_0x70[sizeof(BlendModelAnim) == 0x70 ? 1 : -1];
Expand Down
Loading
Loading