Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RndCam layout #83

Merged
merged 6 commits into from
Jan 19, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions config/SZBE69/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ rb3/unknown/800/unk_8000D980.cpp:
rb3/app.cpp:
.text start:0x8000F364 end:0x8000F804

sdk/MSL_C/sdata_1.c:
.sdata start:0x808E3270 end:0x808E3280

rb3/main.cpp:
.text start:0x8000F96C end:0x8000F9B0

Expand Down Expand Up @@ -531,6 +534,9 @@ rb3/unknown/805/unk_8057464C.cpp:
rb3/Rnd/rndbitmap.cpp:
.text start:0x805CA0FC end:0x805CAC4C

rb3/Rnd/rndcam.cpp:
.text start:0x805CCF80 end:0x805CD410

rb3/unknown/805/unk_805CE140.cpp:
.text start:0x805CE140 end:0x805D5E48

Expand All @@ -540,6 +546,7 @@ rb3/dofproc.cpp:

rb3/Rnd/rnddrawable.cpp:
.text start:0x805D6130 end:0x805D7408
.data start:0x808955A8 end:0x808955B0

rb3/unknown/806/unk_80660D18.cpp:
.text start:0x80660D18 end:0x8066B6B8
Expand Down Expand Up @@ -703,17 +710,14 @@ rb3/ogg_mem.cpp:
vorbis/window.c:
.text start:0x806D1BC4 end:0x806D1F30

MSL_C/text_1.c:
sdk/MSL_C/text_1.c:
.text start:0x806E7DDC end:0x806F55AC

Runtime/global_destructor_chain.c:
sdk/Runtime/global_destructor_chain.c:
.text start:0x806F5690 end:0x806F56F0
.sbss start:0x808E4F00 end:0x808E4F08

MSL_C/sdata_1.c:
.sdata start:0x808E3270 end:0x808E3280

Runtime/__init_cpp_exceptions.cpp:
sdk/Runtime/__init_cpp_exceptions.cpp:
.text start:0x806F6A68 end:0x806F6AD8
.ctors start:0x807EFD20 end:0x807EFD24 rename:.ctors$10
.dtors start:0x807F0060 end:0x807F0064 rename:.dtors$10
Expand Down
38 changes: 19 additions & 19 deletions config/SZBE69/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6762,7 +6762,7 @@ fn_800BB370 = .text:0x800BB370; // type:function size:0x10
fn_800BB380 = .text:0x800BB380; // type:function size:0x58
fn_800BB3D8 = .text:0x800BB3D8; // type:function size:0x104
fn_800BB4DC = .text:0x800BB4DC; // type:function size:0x3C
Tell__9MemStreamFv = .text:0x800BB518; // type:function size:0x8
Tell__9MemStreamFv = .text:0x800BB518; // type:function size:0x8 scope:weak
fn_800BB520 = .text:0x800BB520; // type:function size:0x5C
fn_800BB57C = .text:0x800BB57C; // type:function size:0x17C
fn_800BB6F8 = .text:0x800BB6F8; // type:function size:0x3C
Expand Down Expand Up @@ -30518,7 +30518,7 @@ fn_803BFC28 = .text:0x803BFC28; // type:function size:0x68
fn_803BFC90 = .text:0x803BFC90; // type:function size:0x48
fn_803BFCD8 = .text:0x803BFCD8; // type:function size:0x8
fn_803BFCE0 = .text:0x803BFCE0; // type:function size:0x50
fn_803BFD30 = .text:0x803BFD30; // type:function size:0x68
__ct__26ObjPtr<6RndTex,9ObjectDir> = .text:0x803BFD30; // type:function size:0x68
fn_803BFD98 = .text:0x803BFD98; // type:function size:0xE0
fn_803BFE78 = .text:0x803BFE78; // type:function size:0x8
fn_803BFE80 = .text:0x803BFE80; // type:function size:0x70
Expand Down Expand Up @@ -32389,8 +32389,8 @@ fn_803F8E50 = .text:0x803F8E50; // type:function size:0x50
fn_803F8EA0 = .text:0x803F8EA0; // type:function size:0x34
fn_803F8ED4 = .text:0x803F8ED4; // type:function size:0x44
fn_803F8F18 = .text:0x803F8F18; // type:function size:0x4C
fn_803F8F64 = .text:0x803F8F64; // type:function size:0x48
fn_803F8FAC = .text:0x803F8FAC; // type:function size:0x4C
fn_803F8F64__6RndCamFv = .text:0x803F8F64; // type:function size:0x48
StaticClassName__6RndCamFv = .text:0x803F8FAC; // type:function size:0x4C
fn_803F8FF8 = .text:0x803F8FF8; // type:function size:0x104
fn_803F90FC = .text:0x803F90FC; // type:function size:0x58
fn_803F9154 = .text:0x803F9154; // type:function size:0x58
Expand Down Expand Up @@ -48308,10 +48308,10 @@ fn_805C9DE4 = .text:0x805C9DE4; // type:function size:0x1DC
fn_805C9FC0 = .text:0x805C9FC0; // type:function size:0x4
fn_805C9FC4 = .text:0x805C9FC4; // type:function size:0x138
Reset__9RndBitmapFv = .text:0x805CA0FC; // type:function size:0x84
Create__9RndBitmapFRC9RndBitmapUc14BitmapEncodingPv = .text:0x805CA180; // type:function size:0x160
Create__9RndBitmapFRC9RndBitmapUcQ29RndBitmap14BitmapEncodingPv = .text:0x805CA180; // type:function size:0x160
NumPaletteColors__9RndBitmapCFv = .text:0x805CA2E0; // type:function size:0x24
AllocateBuffer__9RndBitmapFv = .text:0x805CA304; // type:function size:0x84
Create__9RndBitmapFUsUsUsUc14BitmapEncodingPvPvPv = .text:0x805CA388; // type:function size:0x14C
Create__9RndBitmapFUsUsUsUcQ29RndBitmap14BitmapEncodingPvPvPv = .text:0x805CA388; // type:function size:0x14C
Create__9RndBitmapFPv = .text:0x805CA4D4; // type:function size:0x158
PixelOffset__9RndBitmapCFiiRb = .text:0x805CA62C; // type:function size:0x324
PixelIndex__9RndBitmapCFii = .text:0x805CA950; // type:function size:0x68
Expand Down Expand Up @@ -48373,23 +48373,23 @@ fn_805CCD60 = .text:0x805CCD60; // type:function size:0xD4
fn_805CCE34 = .text:0x805CCE34; // type:function size:0x2C
fn_805CCE60 = .text:0x805CCE60; // type:function size:0xA0
fn_805CCF00 = .text:0x805CCF00; // type:function size:0x80
fn_805CCF80 = .text:0x805CCF80; // type:function size:0x4
fn_805CCF84 = .text:0x805CCF84; // type:function size:0x194
fn_805CD118 = .text:0x805CD118; // type:function size:0xCC
fn_805CD1E4 = .text:0x805CD1E4; // type:function size:0x168
fn_805CD34C = .text:0x805CD34C; // type:function size:0xC4
Save__6RndCamFR9BinStream = .text:0x805CCF80; // type:function size:0x4
Load__6RndCamFR9BinStream = .text:0x805CCF84; // type:function size:0x194
Copy__6RndCamFPQ23Hmx6ObjectQ33Hmx6Object8CopyType = .text:0x805CD118; // type:function size:0xCC
__ct__6RndCamFv = .text:0x805CD1E4; // type:function size:0x168
__dt__6RndCamFv = .text:0x805CD34C; // type:function size:0xC4
fn_805CD410 = .text:0x805CD410; // type:function size:0xF0
fn_805CD500 = .text:0x805CD500; // type:function size:0x1D0
fn_805CD6D0 = .text:0x805CD6D0; // type:function size:0x70
fn_805CD740 = .text:0x805CD740; // type:function size:0x8C
fn_805CD7CC = .text:0x805CD7CC; // type:function size:0x2A4
Handle__6RndCamFP9DataArrayb = .text:0x805CD7CC; // type:function size:0x2A4
fn_805CDA70 = .text:0x805CDA70; // type:function size:0x104
fn_805CDB74 = .text:0x805CDB74; // type:function size:0x74
fn_805CDBE8 = .text:0x805CDBE8; // type:function size:0xB0
fn_805CDC98 = .text:0x805CDC98; // type:function size:0x8
fn_805CDCA0 = .text:0x805CDCA0; // type:function size:0x2D4
fn_805CDF74 = .text:0x805CDF74; // type:function size:0x144
fn_805CE0B8 = .text:0x805CE0B8; // type:function size:0x4
ClassName__6RndCamCFv = .text:0x805CE0B8; // type:function size:0x4
fn_805CE0BC = .text:0x805CE0BC; // type:function size:0x84
fn_805CE140 = .text:0x805CE140; // type:function size:0x14
fn_805CE154 = .text:0x805CE154; // type:function size:0x14
Expand Down Expand Up @@ -60040,7 +60040,7 @@ lbl_807F0394 = .rodata:0x807F0394; // type:object size:0x4 data:float
lbl_807F0398 = .rodata:0x807F0398; // type:object size:0x4 data:float
lbl_807F039C = .rodata:0x807F039C; // type:object size:0x4 data:float
lbl_807F03A0 = .rodata:0x807F03A0; // type:object size:0x4 data:float
lbl_807F03A4 = .rodata:0x807F03A4; // type:object size:0x4 data:float
@F_0000403f = .rodata:0x807F03A4; // type:object size:0x4 data:float
@F_00001643 = .rodata:0x807F03A8; // type:object size:0x4 data:float
@F_00002041 = .rodata:0x807F03AC; // type:object size:0x4 data:float
lbl_807F03B0 = .rodata:0x807F03B0; // type:object size:0x8 data:float
Expand Down Expand Up @@ -69226,7 +69226,7 @@ __RTTI__6RndCam = .data:0x8087BF78; // type:object size:0x8
lbl_8087BF80 = .data:0x8087BF80; // type:object size:0xC
lbl_8087BF8C = .data:0x8087BF8C; // type:object size:0xC
lbl_8087BF98 = .data:0x8087BF98; // type:object size:0x8 data:string
lbl_8087BFA0 = .data:0x8087BFA0; // type:object size:0x4 data:string
@STRING@StaticClassName__6RndCamFv = .data:0x8087BFA0; // type:object size:0x4 scope:local data:string
lbl_8087BFA4 = .data:0x8087BFA4; // type:object size:0x5C
lbl_8087C000 = .data:0x8087C000; // type:object size:0x4 data:float
__vt__8NoteTube = .data:0x8087C004; // type:object size:0x5C
Expand Down Expand Up @@ -71109,7 +71109,7 @@ lbl_808954C0 = .data:0x808954C0; // type:object size:0x8
lbl_808954C8 = .data:0x808954C8; // type:object size:0x8 data:string
lbl_808954D0 = .data:0x808954D0; // type:object size:0x8 data:float
__vt__11RndDrawable = .data:0x808954D8; // type:object size:0xD0
lbl_808955A8 = .data:0x808955A8; // type:object size:0x8
@stringBase0 = .data:0x808955A8; // type:object size:0x8 data:string_table
lbl_808955B0 = .data:0x808955B0; // type:object size:0x8
lbl_808955B8 = .data:0x808955B8; // type:object size:0x8 data:string
lbl_808955C0 = .data:0x808955C0; // type:object size:0x8 data:string
Expand Down Expand Up @@ -74250,7 +74250,7 @@ lbl_808E3C95 = .sbss:0x808E3C95; // type:object size:0x1 data:byte
lbl_808E3C96 = .sbss:0x808E3C96; // type:object size:0x1 data:byte
lbl_808E3C97 = .sbss:0x808E3C97; // type:object size:0x1 data:byte
lbl_808E3C98 = .sbss:0x808E3C98; // type:object size:0x1 data:byte
lbl_808E3C99 = .sbss:0x808E3C99; // type:object size:0x1 data:byte
@GUARD@StaticClassName__6RndCamFv@name = .sbss:0x808E3C99; // type:object size:0x1 data:byte
lbl_808E3C9A = .sbss:0x808E3C9A; // type:object size:0x1 data:byte
lbl_808E3C9B = .sbss:0x808E3C9B; // type:object size:0x1 data:byte
lbl_808E3C9C = .sbss:0x808E3C9C; // type:object size:0x1 data:byte
Expand Down Expand Up @@ -77385,7 +77385,7 @@ lbl_808F059C = .bss:0x808F059C; // type:object size:0x4 data:4byte
lbl_808F05A0 = .bss:0x808F05A0; // type:object size:0x4 data:4byte
lbl_808F05A4 = .bss:0x808F05A4; // type:object size:0x4 data:4byte
lbl_808F05A8 = .bss:0x808F05A8; // type:object size:0x4 data:4byte
lbl_808F05AC = .bss:0x808F05AC; // type:object size:0x4 data:4byte
@LOCAL@StaticClassName__6RndCamFv@name = .bss:0x808F05AC; // type:object size:0x4 data:4byte
lbl_808F05B0 = .bss:0x808F05B0; // type:object size:0x4 data:4byte
lbl_808F05B4 = .bss:0x808F05B4; // type:object size:0x4 data:4byte
lbl_808F05B8 = .bss:0x808F05B8; // type:object size:0x4 data:4byte
Expand Down Expand Up @@ -85437,7 +85437,7 @@ lbl_809890F8 = .bss:0x809890F8; // type:object size:0x8 data:4byte
lbl_80989100 = .bss:0x80989100; // type:object size:0x8 data:4byte
lbl_80989108 = .bss:0x80989108; // type:object size:0x18
lbl_80989120 = .bss:0x80989120; // type:object size:0x48
lbl_80989168 = .bss:0x80989168; // type:object size:0x8 data:4byte
sCurrent__6RndCam = .bss:0x80989168; // type:object size:0x8 data:4byte
lbl_80989170 = .bss:0x80989170; // type:object size:0x30
lbl_809891A0 = .bss:0x809891A0; // type:object size:0x4 data:4byte
lbl_809891A4 = .bss:0x809891A4; // type:object size:0x4 data:4byte
Expand Down
9 changes: 7 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@

Object(NonMatching, "rb3/dofproc.cpp"),
Object(NonMatching, "rb3/Rnd/rndbitmap.cpp"),
Object(NonMatching, "rb3/Rnd/rndcam.cpp"),
Object(NonMatching, "rb3/Rnd/rnddrawable.cpp"),

Object(NonMatching, "rb3/hmx/object.cpp"),
Expand All @@ -260,6 +261,7 @@
Object(NonMatching, "rb3/asyncfilewii.cpp"),
Object(Matching, "rb3/binstream.cpp"),
Object(NonMatching, "rb3/bink.cpp"),
Object(NonMatching, "rb3/debug.cpp"),
Object(NonMatching, "rb3/formatstring.cpp"),
Object(NonMatching, "rb3/interpolators.cpp"),
Object(NonMatching, "rb3/joypad.cpp"),
Expand Down Expand Up @@ -351,6 +353,7 @@

Object(NonMatching, "rb3/unknown/802/unk_8022BE84.cpp"),
Object(NonMatching, "rb3/unknown/802/unk_80252B98.cpp"),
Object(NonMatching, "rb3/unknown/802/unk_802960B0.cpp"),
Object(NonMatching, "rb3/unknown/802/unk_802D4B74.cpp"),
Object(NonMatching, "rb3/unknown/802/unk_802DDEA0.cpp"),
Object(NonMatching, "rb3/unknown/802/unk_802E0CA0.cpp"),
Expand Down Expand Up @@ -381,9 +384,11 @@
Object(NonMatching, "rb3/unknown/805/unk_8050FA30.cpp"),
Object(NonMatching, "rb3/unknown/805/unk_805CE140.cpp"),
Object(NonMatching, "rb3/unknown/805/unk_80567E84.cpp"),
Object(NonMatching, "rb3/unknown/805/unk_8057464C.cpp"),
Object(NonMatching, "rb3/unknown/805/unk_805CE140.cpp"),
Object(NonMatching, "rb3/unknown/805/unk_8052A44C.cpp"),

Object(NonMatching, "rb3/unknown/806/unk_8066E3FC.cpp"),
Object(NonMatching, "rb3/unknown/806/unk_80660D18.cpp"),
Object(NonMatching, "rb3/unknown/806/unk_80671DCC.cpp")
],
Expand Down Expand Up @@ -547,8 +552,8 @@
"cflags": cflags_runtime,
"host": False,
"objects": [
Object(Matching, "MSL_C/text_1.c"),
Object(Matching, "MSL_C/sdata_1.c"),
Object(Matching, "sdk/MSL_C/text_1.c"),
Object(Matching, "sdk/MSL_C/sdata_1.c"),
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/rb3/Rnd/rndbitmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RndBitmap {
u16 Height() const;

/** Getter for `paletteData`. \note This function was code-merged with MemStream::Tell() */
void* Palette() const;
void* Palette() const {return paletteData;}

/** Getter for `nextMipmap`. */
RndBitmap* nextMip() const;
Expand Down
74 changes: 74 additions & 0 deletions src/rb3/Rnd/rndcam.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#include "rndcam.hpp"
#include "rnddrawable.hpp"
extern "C" void fn_805D66F8(BinStream&);
extern "C" float fn_806598A0(float, float);

void RndCam::Save(BinStream& file) {
return;
}

void RndCam::Load(BinStream& file) {
uint ver;
file >> ver;
if (ver > 10) {
Hmx::Object::Load(file);
}
RndTransformable::Load(file);
if (ver < 10) {
fn_805D66F8(file);
}
if (ver == 8) {
//objptrlist stuff
uint why;
file >> why;
}
file >> a >> b >> c;
if (ver < 12) {
d = fn_806598A0(c, 0.75);
}
if (ver < 2) {
uint empty;
file >> empty;
}

if (ver < 3) {
uint garbage;
file >> garbage;
}
if (ver > 3) {

}
if (ver > 4) {

}
if (ver == 6) {
uint asdf;
file >> asdf;
}
fn_805CD500();
}

void RndCam::Copy(Hmx::Object* obj, CopyType type) {
RndCam* from = dynamic_cast<RndCam*>(obj);
if (from != nullptr && type != r) {
screen_space_render = from->screen_space_render;
huh = from->huh;
}
return;
}

RndCam::RndCam() /*: huh(0.0f, 1.0f)*/ {
screen_space_render.Set(0.0f, 0.0f, 1.0f, 1.0f);

}

RndCam::~RndCam() {
if (sCurrent == this) sCurrent = nullptr;
delete target_tex;
}
/* TODO find the tu this comes from
RndCam* RndCam::fn_803F8F64() {
Hmx::Object* obj = Hmx::Object::NewObject(StaticClassName());
return dynamic_cast<RndCam*>(obj);
}
*/
53 changes: 53 additions & 0 deletions src/rb3/Rnd/rndcam.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef RND_RNDCAM_HPP
#define RND_RNDCAM_HPP
#include <rb3/hmx/object.hpp>
#include <rb3/hmx/quat.hpp>
#include <rb3/vector2.hpp>
#include <rb3/binstream.hpp>
#include "rndtransformable.hpp"


/** A camera.
* Can define a target texture, what part of the screen to render to, etc. */
class RndCam : public RndTransformable { // 0x2A4
public:
char too_much_padding[0x238]; // i swear there's stuff here but the ctors got stubbed
float a; // TODO figure out
float b;
float c;
float d;
Vector2 huh;

/** What part of the screen to render to.
* This is in screen-space coordinates, i.e. top left is 0,0
* and bottom right is 1,1. This is a Quaternion cause it works fine.
*/
Hmx::Quat screen_space_render;
// ObjPtr<RndTex> target_tex;
void* target_tex;

Symbol StaticClassName();

RndCam();
virtual Symbol ClassName() {return StaticClassName();}
virtual DataNode Handle(DataArray*, bool);
virtual bool SyncProperty();
virtual void Save(BinStream&);
virtual void Copy(Hmx::Object*, CopyType);
virtual void Load(BinStream&);
virtual ~RndCam();
// RndTransformable::Replace();
// RndTransformable::Highlight();
// RndTransformable::Print();
virtual void UpdatedWorldXfm();
virtual void Select();
virtual void ProjectZ();

RndCam* NewObject();
RndCam* fn_803F8F64();
void fn_805CD500();
void Init();

static RndCam* sCurrent;
};
#endif
2 changes: 2 additions & 0 deletions src/rb3/Rnd/rnddrawable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class RndDrawable : public RndHighlightable {
virtual Symbol ClassName() const;
virtual void SetType(Symbol *);

virtual void Save(BinStream&);

static Symbol StaticClassName();

bool mShowing;
Expand Down
3 changes: 2 additions & 1 deletion src/rb3/Rnd/rndtransformable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "rb3/hmx/object.hpp"
#include "rb3/data.hpp"

class RndTransformable : RndHighlightable {
class RndTransformable : public RndHighlightable {
public:
RndTransformable();
virtual ~RndTransformable();

Expand Down