This commit is contained in:
robojumper
2025-03-15 23:20:09 +01:00
parent 8759f710e5
commit 03e3fc5cfa
8 changed files with 108 additions and 21 deletions
+3 -2
View File
@@ -2178,8 +2178,8 @@ egg/gfx/eggUnk1.cpp:
.text start:0x8049CFF0 end:0x8049D7C0
egg/gfx/eggCapTexture.cpp:
.text start:0x8049D7C0 end:0x8049D9D0
.rodata start:0x804FBA30 end:0x804FBA60
.text start:0x8049D7C0 end:0x8049D9C4
.rodata start:0x804FBA30 end:0x804FBA48
.data start:0x8056ED70 end:0x8056ED80
.sdata2 start:0x8057F410 end:0x8057F418
.sbss2 start:0x8057FFC0 end:0x8057FFC8
@@ -2201,6 +2201,7 @@ egg/gfx/eggDrawPathUnk1.cpp:
egg/gfx/eggDrawPathDOF.cpp:
.text start:0x804A29C0 end:0x804A4BE8
.data start:0x8056EF28 end:0x8056EFA0
egg/gfx/eggDrawPathUnk2.cpp:
.text start:0x804A4BF0 end:0x804A54E8
+6 -6
View File
@@ -26779,11 +26779,11 @@ resetPE__Q23EGG7StateGXFv = .text:0x804B4EF0; // type:function size:0xB0
resetGXCache__Q23EGG7StateGXFv = .text:0x804B4FA0; // type:function size:0x40
EGG__StateGX__GXSetPixelFmt_ = .text:0x804B4FE0; // type:function size:0xAC
invalidateTexAllGX__Q23EGG7StateGXFv = .text:0x804B5090; // type:function size:0x4
GXSetColorUpdate___Q23EGG7StateGXFUc = .text:0x804B50A0; // type:function size:0x4C
GXSetAlphaUpdate___Q23EGG7StateGXFUc = .text:0x804B50F0; // type:function size:0x4C
GXSetDither___Q23EGG7StateGXFUc = .text:0x804B5140; // type:function size:0x4C
GXSetColorUpdate___Q23EGG7StateGXFb = .text:0x804B50A0; // type:function size:0x4C
GXSetAlphaUpdate___Q23EGG7StateGXFb = .text:0x804B50F0; // type:function size:0x4C
GXSetDither___Q23EGG7StateGXFb = .text:0x804B5140; // type:function size:0x4C
GXCopyTex__Q23EGG7StateGXFPvb = .text:0x804B5190; // type:function size:0x8
GXSetDstAlpha___Q23EGG7StateGXFUcUc = .text:0x804B51A0; // type:function size:0x4C
GXSetDstAlpha___Q23EGG7StateGXFbUc = .text:0x804B51A0; // type:function size:0x4C
FUN_804b51f0 = .text:0x804B51F0; // type:function size:0x108
FUN_804b5300 = .text:0x804B5300; // type:function size:0x2C
GXSetProjectionv___Q23EGG7StateGXFPCf = .text:0x804B5330; // type:function size:0x2C
@@ -29159,7 +29159,7 @@ gRMO_Ntsc_640x456Prog_4x3__22@unnamed@eggVideo_cpp@ = .rodata:0x804FB980; // typ
gRMO_Ntsc_640x456IntDf_4x3__22@unnamed@eggVideo_cpp@ = .rodata:0x804FB9BC; // type:object size:0x3C scope:local
renderModes__3EGG = .rodata:0x804FB9F8; // type:object size:0x28 scope:local
@4804 = .rodata:0x804FBA20; // type:object size:0x10 scope:local data:4byte
copyArg2__3EGG = .rodata:0x804FBA30; // type:object size:0x30
copyArg2__3EGG = .rodata:0x804FBA30; // type:object size:0x18
lbl_804FBA60 = .rodata:0x804FBA60; // type:object size:0xD8
lbl_804FBB38 = .rodata:0x804FBB38; // type:object size:0x30
lbl_804FBB68 = .rodata:0x804FBB68; // type:object size:0xF0
@@ -37362,7 +37362,7 @@ jumptable_8056EDE0 = .data:0x8056EDE0; // type:object size:0x38 scope:local
jumptable_8056EE18 = .data:0x8056EE18; // type:object size:0x48 scope:local
__vt__Q23EGG12DrawPathBase = .data:0x8056EE60; // type:object size:0x50
lbl_8056EEB0 = .data:0x8056EEB0; // type:object size:0x78
lbl_8056EF28 = .data:0x8056EF28; // type:object size:0x78
__vt__Q23EGG11DrawPathDOF = .data:0x8056EF28; // type:object size:0x78
lbl_8056EFA0 = .data:0x8056EFA0; // type:object size:0x50
__vt__Q23EGG3Fog = .data:0x8056EFF0; // type:object size:0x20
__vt__Q23EGG10FogManager = .data:0x8056F010; // type:object size:0x20
+1 -1
View File
@@ -869,7 +869,7 @@ config.libs = [
Object(NonMatching, "egg/gfx/eggPalette.cpp"),
Object(NonMatching, "egg/gfx/eggTexture.cpp"),
Object(NonMatching, "egg/gfx/eggUnk1.cpp"), # Unknown
Object(NonMatching, "egg/gfx/eggCapTexture.cpp"),
Object(Matching, "egg/gfx/eggCapTexture.cpp"),
Object(NonMatching, "egg/gfx/eggCpuTexture.cpp"),
Object(NonMatching, "egg/gfx/eggDrawGX.cpp"),
Object(Matching, "egg/gfx/eggDrawPathBase.cpp"),
+27 -1
View File
@@ -1,6 +1,32 @@
#ifndef EGG_DRAW_PATH_DOF_H
#define EGG_DRAW_PATH_DOF_H
namespace EGG {} // namespace EGG
#include "egg/prim/eggBinary.h"
#include "egg/gfx/eggDrawPathBase.h"
namespace EGG {
class DrawPathDOF : public DrawPathBase, public IBinary<DrawPathDOF> {
public:
class BinData {
// TODO
};
DrawPathDOF();
virtual ~DrawPathDOF();
virtual u16 getNumStep() {
return 3;
}
virtual void internalResetForDraw() override;
virtual void internalDraw() override;
virtual void SetBinaryInner(const Bin &) override;
virtual void GetBinaryInner(Bin *) const override;
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
private:
void *IHaveMembers;
};
} // namespace EGG
#endif
+50 -4
View File
@@ -8,6 +8,52 @@ namespace EGG {
class StateGX {
public:
struct ScopedColor
{
ScopedColor(bool x)
{
old = GXSetColorUpdate_(x);
}
~ScopedColor()
{
GXSetColorUpdate_(old);
}
bool old;
};
struct ScopedAlpha
{
ScopedAlpha(bool x)
{
old = GXSetAlphaUpdate_(x);
}
~ScopedAlpha()
{
GXSetAlphaUpdate_(old);
}
bool old;
};
struct ScopedDither
{
ScopedDither(bool x)
{
old = GXSetDither_(x);
}
~ScopedDither()
{
GXSetDither_(old);
}
bool old;
};
static void initialize(u16, u16, GXColor, GXPixelFmt);
static void frameInit();
static void textureInit(); // Guess for 804b4810
@@ -27,10 +73,10 @@ public:
static void invalidateTexAllGX();
static GXBool GXSetColorUpdate_(GXBool);
static GXBool GXSetAlphaUpdate_(GXBool);
static GXBool GXSetDither_(GXBool);
static GXBool GXSetDstAlpha_(GXBool, u8);
static bool GXSetColorUpdate_(bool);
static bool GXSetAlphaUpdate_(bool);
static bool GXSetDither_(bool);
static bool GXSetDstAlpha_(bool, u8);
static bool GXSetColorUpdate(bool);
static bool GXSetAlphaUpdate(bool);
+2
View File
@@ -42,6 +42,8 @@ protected:
/** Load the object from binary, interpolating between values */
virtual void SetBinaryInner(const Bin &, const Bin &, f32) = 0;
virtual ~IBinary() {}
/** Get a 4-bytes long ID string corresponding to this type */
static const char *GetBinaryType();
/** Get the current version of this type */
+2 -6
View File
@@ -35,9 +35,8 @@ void CapTexture::capture(u16 x, u16 y, bool upscale, int format) {
0, copyArg2, (mCapFlags & 8) ? true : false, (mCapFlags & 8) ? mCopyFilterArg.values : defaultFilter.values
);
// Regswap, grr
GXBool prevColorUpdate = StateGX::GXSetColorUpdate_((mCapFlags & 1) != 0);
GXBool prevAlphaUpdate = StateGX::GXSetAlphaUpdate_((mCapFlags & 2) != 0);
StateGX::ScopedColor colorUpdate((mCapFlags & 1) != 0);
StateGX::ScopedAlpha alphaUpdate((mCapFlags & 2) != 0);
GXSetZMode(true, GX_ALWAYS, (mCapFlags & 4) != 0);
GXSetCopyClear(mClearColor, field_0x20);
GXSetCopyClamp(3);
@@ -51,9 +50,6 @@ void CapTexture::capture(u16 x, u16 y, bool upscale, int format) {
if ((mCapFlags & 0x20) != 0) {
StateGX::invalidateTexAllGX();
}
StateGX::GXSetAlphaUpdate_(prevAlphaUpdate);
StateGX::GXSetColorUpdate_(prevColorUpdate);
}
} // namespace EGG
+17 -1
View File
@@ -1,3 +1,19 @@
#include "egg/gfx/eggDrawPathDOF.h"
namespace EGG {} // namespace EGG
namespace EGG {
DrawPathDOF::DrawPathDOF() {}
DrawPathDOF::~DrawPathDOF() {}
void DrawPathDOF::internalDraw() {}
void DrawPathDOF::internalResetForDraw() {}
void DrawPathDOF::SetBinaryInner(const Bin &bin) {}
void DrawPathDOF::GetBinaryInner(Bin *pBin) const {}
void DrawPathDOF::SetBinaryInner(const Bin &, const Bin &, f32) {}
} // namespace EGG