mirror of
https://github.com/zeldaret/ss
synced 2026-05-23 15:01:38 -04:00
d_gfx mostly OK
This commit is contained in:
@@ -217,8 +217,15 @@ d/d_font_manager.cpp:
|
||||
.bss start:0x80597608 end:0x80597740
|
||||
|
||||
d/d_gfx.cpp:
|
||||
.text start:0x800541F0 end:0x80054B00 align:16
|
||||
.sbss start:0x80575110 end:0x805751A8
|
||||
.text start:0x800541F0 end:0x8005486C align:16
|
||||
.sbss start:0x80575110 end:0x80575118
|
||||
.sdata2 start:0x80576F38 end:0x80576F50
|
||||
|
||||
d/d_gfx_measures.cpp:
|
||||
.text start:0x80054870 end:0x80054B00 align:16
|
||||
.sdata start:0x80571C50 end:0x80571C58
|
||||
.sbss start:0x80575118 end:0x805751A8
|
||||
.sdata2 start:0x80576F50 end:0x80576F60
|
||||
|
||||
d/d_heap.cpp:
|
||||
.text start:0x80054B00 end:0x80054F30 align:16
|
||||
@@ -507,6 +514,7 @@ toBeSorted/nand_request_thread.cpp:
|
||||
toBeSorted/nand_result_tracker.cpp:
|
||||
.text start:0x800BD610 end:0x800BD8C0 align:16
|
||||
.rodata start:0x804E4C50 end:0x804E4C90
|
||||
.data start:0x80510B70 end:0x80510B88
|
||||
.sbss start:0x805753D8 end:0x805753E0
|
||||
|
||||
d/flag/flag_managers.cpp:
|
||||
|
||||
+29
-29
@@ -544,14 +544,14 @@ fn_800161B0 = .text:0x800161B0; // type:function size:0x10
|
||||
fn_800161C0 = .text:0x800161C0; // type:function size:0x34
|
||||
defaultSet__3d2dFv = .text:0x80016200; // type:function size:0xF4
|
||||
draw__3d2dFv = .text:0x80016300; // type:function size:0x28
|
||||
fn_80016330 = .text:0x80016330; // type:function size:0x28
|
||||
drawBefore__3d2dFv = .text:0x80016330; // type:function size:0x28
|
||||
fn_80016360 = .text:0x80016360; // type:function size:0x54
|
||||
fn_800163C0 = .text:0x800163C0; // type:function size:0x248
|
||||
fn_80016610 = .text:0x80016610; // type:function size:0x14
|
||||
fn_80016630 = .text:0x80016630; // type:function size:0x58
|
||||
create__3d2dFPQ23EGG4Heap = .text:0x80016630; // type:function size:0x58
|
||||
fn_80016690 = .text:0x80016690; // type:function size:0xC
|
||||
fn_800166A0 = .text:0x800166A0; // type:function size:0x58
|
||||
fn_80016700 = .text:0x80016700; // type:function size:0x160
|
||||
create__3d3dFPQ23EGG4Heap = .text:0x80016700; // type:function size:0x160
|
||||
fn_80016860 = .text:0x80016860; // type:function size:0x28
|
||||
createLightTextures__3d3dFv = .text:0x80016890; // type:function size:0x98
|
||||
fn_80016930 = .text:0x80016930; // type:function size:0x2C
|
||||
@@ -2202,16 +2202,16 @@ getFontPath__10dFontMng_cFUc = .text:0x80053FF0; // type:function size:0xB4
|
||||
create__10dFontMng_cFv = .text:0x800540B0; // type:function size:0xB4
|
||||
__sinit_\d_font_manager_cpp = .text:0x80054170; // type:function size:0x58 scope:local
|
||||
__arraydtor$3926 = .text:0x800541D0; // type:function size:0x1C scope:local
|
||||
fn_800541F0 = .text:0x800541F0; // type:function size:0xD4
|
||||
fn_800542D0 = .text:0x800542D0; // type:function size:0x70
|
||||
fn_80054340 = .text:0x80054340; // type:function size:0x54
|
||||
fn_800543A0 = .text:0x800543A0; // type:function size:0x3C
|
||||
fn_800543E0 = .text:0x800543E0; // type:function size:0x124
|
||||
InitModelHeapMaybe = .text:0x80054510; // type:function size:0x38
|
||||
ThisCopiesScreenForTransparency = .text:0x80054550; // type:function size:0x31C
|
||||
fn_80054870 = .text:0x80054870; // type:function size:0x25C
|
||||
fn_80054AD0 = .text:0x80054AD0; // type:function size:0x10
|
||||
NeedsScreenAdjustment = .text:0x80054AE0; // type:function size:0x14
|
||||
__ct__6dGfx_cFv = .text:0x800541F0; // type:function size:0xD4
|
||||
getTextureBuffer__6dGfx_cFv = .text:0x800542D0; // type:function size:0x70
|
||||
releaseTextureBuffer__6dGfx_cFv = .text:0x80054340; // type:function size:0x54
|
||||
drawBefore__6dGfx_cFv = .text:0x800543A0; // type:function size:0x3C
|
||||
drawLetterbox__6dGfx_cFv = .text:0x800543E0; // type:function size:0x124
|
||||
create__6dGfx_cFPQ23EGG4Heap = .text:0x80054510; // type:function size:0x38
|
||||
drawCapTexture__6dGfx_cFPQ23EGG13TextureBufferPQ34nw4r2ut5Color = .text:0x80054550; // type:function size:0x31C
|
||||
initGfxConstants__6dGfx_cFv = .text:0x80054870; // type:function size:0x25C
|
||||
isTvMode4To3__6dGfx_cFv = .text:0x80054AD0; // type:function size:0x10
|
||||
isTvModeWidescreen__6dGfx_cFv = .text:0x80054AE0; // type:function size:0x14
|
||||
__dt__14dHeapAllocatorFv = .text:0x80054B00; // type:function size:0x40 scope:weak
|
||||
onAlloc__14dHeapAllocatorFPQ23EGG12HeapAllocArg = .text:0x80054B40; // type:function size:0x20
|
||||
init__5dHeapFPCcUlPQ23EGG4Heap = .text:0x80054B60; // type:function size:0x64
|
||||
@@ -2830,9 +2830,9 @@ EGG__ConfigurationData__onBeginFrame = .text:0x800643D0; // type:function size:0
|
||||
dSys_c__endFrame = .text:0x800643E0; // type:function size:0x48
|
||||
EGG__ConfigurationData__onEndFrame = .text:0x80064430; // type:function size:0x4
|
||||
dSys_c__setBlack = .text:0x80064440; // type:function size:0x80
|
||||
setFrameRate__4dSysFUl = .text:0x800644C0; // type:function size:0x10
|
||||
getFrameRate__4dSysFv = .text:0x800644D0; // type:function size:0x10
|
||||
setClearColor__4dSysF6mColor = .text:0x800644E0; // type:function size:0x60
|
||||
setFrameRate__6dSys_cFUc = .text:0x800644C0; // type:function size:0x10
|
||||
getFrameRate__6dSys_cFv = .text:0x800644D0; // type:function size:0x10
|
||||
setClearColor__6dSys_cFQ34nw4r2ut5Color = .text:0x800644E0; // type:function size:0x60
|
||||
dSys_c__getClearColor = .text:0x80064540; // type:function size:0x14
|
||||
dSys_c__create = .text:0x80064560; // type:function size:0x3BC
|
||||
setPosParam__Q23EGG14CoreControllerFff = .text:0x80064920; // type:function size:0x8
|
||||
@@ -28242,7 +28242,7 @@ sMsgWindowFlags = .rodata:0x804E3C30; // type:object size:0x1004 scope:local
|
||||
lbl_804E4C50 = .rodata:0x804E4C50; // type:object size:0x18
|
||||
lbl_804E4C68 = .rodata:0x804E4C68; // type:object size:0xC data:string
|
||||
lbl_804E4C74 = .rodata:0x804E4C74; // type:object size:0xC data:string
|
||||
lbl_804E4C80 = .rodata:0x804E4C80; // type:object size:0x10
|
||||
lbl_804E4C80 = .rodata:0x804E4C80; // type:object size:0xC data:string
|
||||
lbl_804E4C90 = .rodata:0x804E4C90; // type:object size:0x18
|
||||
lbl_804E4CA8 = .rodata:0x804E4CA8; // type:object size:0x10 align:4 data:float
|
||||
lbl_804E4CB8 = .rodata:0x804E4CB8; // type:object size:0x10 align:4 data:float
|
||||
@@ -39233,7 +39233,7 @@ lbl_80571C38 = .sdata:0x80571C38; // type:object size:0x8 data:string
|
||||
status_1__4dDyl = .sdata:0x80571C40; // type:object size:0x4 data:4byte
|
||||
status_2__4dDyl = .sdata:0x80571C44; // type:object size:0x4 data:4byte
|
||||
lbl_80571C48 = .sdata:0x80571C48; // type:object size:0x8
|
||||
lbl_80571C50 = .sdata:0x80571C50; // type:object size:0x4 align:4 data:float
|
||||
g_CurrentScreenTo4x3WidthScale__6dGfx_c = .sdata:0x80571C50; // type:object size:0x4 align:4 data:float
|
||||
lbl_80571C58 = .sdata:0x80571C58; // type:object size:0x8 data:byte
|
||||
m_current_ex__Q24dPad4ex_c = .sdata:0x80571C60; // type:object size:0x4 data:4byte
|
||||
lbl_80571C68 = .sdata:0x80571C68; // type:object size:0x8
|
||||
@@ -41353,7 +41353,7 @@ Initialized__4dDyl = .sbss:0x805750F4; // type:object size:0x1 data:byte
|
||||
DVD__4dDyl = .sbss:0x805750F8; // type:object size:0x4 data:4byte
|
||||
mFaderColor = .sbss:0x80575100; // type:object size:0x4 scope:local data:byte
|
||||
@GUARD@getFontPath__10dFontMng_cFUc@TEMP_FONT_NAME = .sbss:0x80575108; // type:object size:0x1 scope:local data:byte
|
||||
sInstance__6dGfx_c = .sbss:0x80575110; // type:object size:0x8 data:4byte
|
||||
sInstance__6dGfx_c = .sbss:0x80575110; // type:object size:0x4 data:4byte
|
||||
g_CurrentScreenWidth_s32__6dGfx_c = .sbss:0x80575118; // type:object size:0x4 data:4byte
|
||||
g_CurrentScreenHeight_s32__6dGfx_c = .sbss:0x8057511C; // type:object size:0x4 data:4byte
|
||||
g_CurrentScreenWidthLimit_s32__6dGfx_c = .sbss:0x80575120; // type:object size:0x4 data:4byte
|
||||
@@ -41417,12 +41417,12 @@ sGuideColor2__19daPlayerModelBase_c = .sbss:0x80575214; // type:object size:0x4
|
||||
sGuideColor3__19daPlayerModelBase_c = .sbss:0x80575218; // type:object size:0x4 data:4byte
|
||||
RootActorParams = .sbss:0x80575220; // type:object size:0x4 scope:local data:4byte
|
||||
ms_configuration_p__6dSys_c = .sbss:0x80575228; // type:object size:0x4 data:4byte
|
||||
dSys_c__ms_RootHeapMem1 = .sbss:0x8057522C; // type:object size:0x4 data:4byte
|
||||
dSys_c__ms_RootHeapMem2 = .sbss:0x80575230; // type:object size:0x4 data:4byte
|
||||
dSystem__s_OrgMEM1ArenaLo = .sbss:0x80575234; // type:object size:0x4 data:4byte
|
||||
dSystem__s_NewMEM1ArenaLo = .sbss:0x80575238; // type:object size:0x4 data:4byte
|
||||
dSystem__s_OrgMEM1ArenaHi = .sbss:0x8057523C; // type:object size:0x4 data:4byte
|
||||
dSystem__s_NewMEM1ArenaHi = .sbss:0x80575240; // type:object size:0x8 data:4byte
|
||||
ms_RootHeapMem1__6dSys_c = .sbss:0x8057522C; // type:object size:0x4 data:4byte
|
||||
ms_RootHeapMem2__6dSys_c = .sbss:0x80575230; // type:object size:0x4 data:4byte
|
||||
s_OrgMEM1ArenaLo__7dSystem = .sbss:0x80575234; // type:object size:0x4 data:4byte
|
||||
s_NewMEM1ArenaLo__7dSystem = .sbss:0x80575238; // type:object size:0x4 data:4byte
|
||||
s_OrgMEM1ArenaHi__7dSystem = .sbss:0x8057523C; // type:object size:0x4 data:4byte
|
||||
s_NewMEM1ArenaHi__7dSystem = .sbss:0x80575240; // type:object size:0x8 data:4byte
|
||||
dSystem__myDylinkInitPhase = .sbss:0x80575248; // type:object size:0x8
|
||||
sInstance__18ArcCallbackHandler = .sbss:0x80575250; // type:object size:0x8 data:4byte
|
||||
aspectRatio = .sbss:0x80575258; // type:object size:0x4 align:4 data:float
|
||||
@@ -42962,10 +42962,10 @@ lbl_80576F1C = .sdata2:0x80576F1C; // type:object size:0x4 align:4 data:float
|
||||
@6125 = .sdata2:0x80576F28; // type:object size:0x4 scope:local align:4 data:float
|
||||
@6126 = .sdata2:0x80576F2C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@6129 = .sdata2:0x80576F30; // type:object size:0x8 scope:local align:8 data:double
|
||||
lbl_80576F38 = .sdata2:0x80576F38; // type:object size:0x4 align:4 data:float
|
||||
lbl_80576F3C = .sdata2:0x80576F3C; // type:object size:0x4 align:4 data:float
|
||||
lbl_80576F40 = .sdata2:0x80576F40; // type:object size:0x4 align:4 data:float
|
||||
lbl_80576F48 = .sdata2:0x80576F48; // type:object size:0x8 align:8 data:double
|
||||
@16332 = .sdata2:0x80576F38; // type:object size:0x4 scope:local align:4 data:float
|
||||
@16333 = .sdata2:0x80576F3C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@16334 = .sdata2:0x80576F40; // type:object size:0x4 scope:local align:4 data:float
|
||||
@16368 = .sdata2:0x80576F48; // type:object size:0x8 scope:local align:8 data:double
|
||||
lbl_80576F50 = .sdata2:0x80576F50; // type:object size:0x4 align:4 data:float
|
||||
lbl_80576F58 = .sdata2:0x80576F58; // type:object size:0x8 align:8 data:double
|
||||
lbl_80576F60 = .sdata2:0x80576F60; // type:object size:0x4 align:4 data:float
|
||||
|
||||
+2
-1
@@ -407,7 +407,8 @@ config.libs = [
|
||||
Object(NonMatching, "d/d_dylink.cpp"),
|
||||
Object(Matching, "d/d_fader.cpp"),
|
||||
Object(Matching, "d/d_font_manager.cpp"),
|
||||
Object(NonMatching, "d/d_gfx.cpp"),
|
||||
Object(Matching, "d/d_gfx.cpp"),
|
||||
Object(NonMatching, "d/d_gfx_measures.cpp"),
|
||||
Object(Matching, "d/d_heap.cpp"),
|
||||
Object(NonMatching, "d/d_main.cpp"),
|
||||
Object(NonMatching, "d/d_pad.cpp"),
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#ifndef D_D2D_H
|
||||
#define D_D2D_H
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
|
||||
namespace d2d {
|
||||
|
||||
void create(EGG::Heap *);
|
||||
void defaultSet();
|
||||
void drawBefore();
|
||||
void draw();
|
||||
|
||||
} // namespace d2d
|
||||
|
||||
+22
-1
@@ -2,12 +2,28 @@
|
||||
#define D_GFX_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "egg/gfx/eggTextureBuffer.h"
|
||||
#include "nw4r/ut/ut_Color.h"
|
||||
|
||||
// Made up name
|
||||
class dGfx_c {
|
||||
public:
|
||||
typedef void (*DrawCallback)(void);
|
||||
|
||||
dGfx_c();
|
||||
|
||||
EGG::TextureBuffer *getTextureBuffer();
|
||||
void releaseTextureBuffer();
|
||||
void drawBefore();
|
||||
void drawLetterbox();
|
||||
|
||||
static void create(EGG::Heap *heap);
|
||||
static void drawCapTexture(EGG::TextureBuffer *, nw4r::ut::Color *clr);
|
||||
|
||||
static bool isTvMode4To3();
|
||||
static bool isTvModeWidescreen();
|
||||
|
||||
void setDrawCallback(DrawCallback cb) {
|
||||
mDrawCallback = cb;
|
||||
}
|
||||
@@ -65,6 +81,7 @@ public:
|
||||
static f32 getWidth4x3RightF() { return g_Width4x3Right_f32; }
|
||||
|
||||
static f32 get16x9to4x3WidthScaleF() { return g_16x9to4x3WidthScale; }
|
||||
static f32 getCurrentScreenTo4x3WidthScaleF() { return g_CurrentScreenTo4x3WidthScale; }
|
||||
// clang-format on
|
||||
|
||||
public:
|
||||
@@ -113,8 +130,12 @@ public:
|
||||
static f32 g_Width4x3Right_f32;
|
||||
|
||||
static f32 g_16x9to4x3WidthScale;
|
||||
static f32 g_CurrentScreenTo4x3WidthScale;
|
||||
|
||||
/* 0x00 */ u8 _0x00[0x04 - 0x00];
|
||||
private:
|
||||
static void initGfxConstants();
|
||||
|
||||
/* 0x00 */ EGG::TextureBuffer *mpTextureBuffer;
|
||||
/* 0x04 */ DrawCallback mDrawCallback;
|
||||
/* 0x08 */ u8 field_0x08;
|
||||
/* 0x09 */ u8 field_0x09;
|
||||
|
||||
+10
-6
@@ -2,14 +2,18 @@
|
||||
#define D_SYS_H
|
||||
|
||||
#include "common.h"
|
||||
#include "m/m_color.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "nw4r/ut/ut_Color.h"
|
||||
|
||||
namespace dSys {
|
||||
class dSys_c {
|
||||
public:
|
||||
static void setFrameRate(u8);
|
||||
static u8 getFrameRate();
|
||||
|
||||
void setFrameRate(u32);
|
||||
u8 getFrameRate();
|
||||
void setClearColor(mColor clr);
|
||||
static void setClearColor(nw4r::ut::Color clr);
|
||||
|
||||
} // namespace dSys_c
|
||||
static EGG::Heap *ms_RootHeapMem1;
|
||||
static EGG::Heap *ms_RootHeapMem2;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
static bool draw();
|
||||
static bool drawDirectly();
|
||||
|
||||
bool setPriority(u8 priority);
|
||||
void setPriority(u8 priority);
|
||||
void setTargetPane(nw4r::lyt::Pane *pane);
|
||||
|
||||
private:
|
||||
|
||||
@@ -156,6 +156,9 @@ public:
|
||||
static void DrawDL16(const nw4r::math::MTX34 &mtx, GXColor clr) {
|
||||
DrawDL(DL_16, mtx, clr);
|
||||
}
|
||||
static void DrawDL17(const nw4r::math::MTX34 &mtx, GXColor clr) {
|
||||
DrawDL(DL_17, mtx, clr);
|
||||
}
|
||||
// TODO MORE
|
||||
|
||||
static void SetTevColor(GXTevRegID regId, GXColor tevClr, GXTevKColorID colorId, GXColor tevkClr) {
|
||||
|
||||
@@ -94,6 +94,9 @@ public:
|
||||
const Screen *GetParent() const {
|
||||
return mParent;
|
||||
}
|
||||
static Screen *GetRoot() {
|
||||
return spRoot;
|
||||
}
|
||||
void SetParent(const Screen *parent);
|
||||
void SetUnkFlag8();
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ public:
|
||||
void alloc(u32 size);
|
||||
static TextureBuffer *alloc(u16 w, u16 h, GXTexFmt fmt);
|
||||
void free();
|
||||
static void setIncludesHeader(bool);
|
||||
|
||||
private:
|
||||
static bool includesHeader();
|
||||
static void setIncludesHeader(bool);
|
||||
|
||||
u32 mSize; // at 0x2C
|
||||
EBufferState mState; // at 0x30
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace m2d {
|
||||
extern nw4r::ut::List l_list;
|
||||
extern mAllocator_c *l_allocator;
|
||||
|
||||
void create(EGG::Heap *heap, u32 size);
|
||||
void reset();
|
||||
|
||||
class Layout_c : public nw4r::lyt::Layout {
|
||||
public:
|
||||
virtual ~Layout_c() {}
|
||||
|
||||
@@ -12,6 +12,10 @@ void C_MTXFrustum(Mtx44, f32, f32, f32, f32, f32, f32);
|
||||
void C_MTXPerspective(Mtx44, f32, f32, f32, f32);
|
||||
void C_MTXOrtho(Mtx44, f32, f32, f32, f32, f32, f32);
|
||||
|
||||
#define MTXFrustum C_MTXFrustum
|
||||
#define MTXPerspective C_MTXPerspective
|
||||
#define MTXOrtho C_MTXOrtho
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
namespace d3d {
|
||||
|
||||
bool create(EGG::Heap *);
|
||||
|
||||
f32 fn_80016960(mVec3_c &, const mVec3_c &pos);
|
||||
bool fn_80016A90(const mVec3_c &pos);
|
||||
void fn_80016B60(mVec3_c &, const mVec3_c &pos);
|
||||
|
||||
@@ -421,7 +421,7 @@ int dScBoot_c::create() {
|
||||
mFader.create();
|
||||
mFader.setFadeInFrame(1);
|
||||
dGfx_c::GetInstance()->setDrawCallback(&drawCallback);
|
||||
dSys::setFrameRate(1);
|
||||
dSys_c::setFrameRate(1);
|
||||
mStateMgr.changeState(StateID_Init);
|
||||
SaveRelated::create();
|
||||
return SUCCEEDED;
|
||||
@@ -549,7 +549,7 @@ void dScBoot_c::finalizeState_Strap() {
|
||||
|
||||
void dScBoot_c::initializeState_Connect() {
|
||||
mProgressStage = 0;
|
||||
dSys::setFrameRate(2);
|
||||
dSys_c::setFrameRate(2);
|
||||
}
|
||||
|
||||
void dScBoot_c::executeState_Connect() {
|
||||
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
#include "d/d_gfx.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_d2d.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/d_sys.h"
|
||||
#include "egg/gfx/eggDrawGX.h"
|
||||
#include "egg/gfx/eggGfxEngine.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
#include "egg/gfx/eggTextureBuffer.h"
|
||||
#include "m/m2d.h"
|
||||
#include "m/m3d/m3d.h"
|
||||
#include "m/m_heap.h"
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_video.h"
|
||||
#include "rvl/GX/GXTexture.h"
|
||||
#include "rvl/GX/GXTransform.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
#include "rvl/GX/GXVert.h"
|
||||
#include "rvl/MTX/mtx.h"
|
||||
#include "rvl/MTX/mtx44.h"
|
||||
#include "toBeSorted/d_d3d.h"
|
||||
|
||||
dGfx_c *dGfx_c::sInstance;
|
||||
|
||||
dGfx_c::dGfx_c() : mpTextureBuffer(nullptr), field_0x08(0), field_0x09(0) {
|
||||
mDrawCallback = nullptr;
|
||||
|
||||
d3d::create(mHeap::g_gameHeaps[0]);
|
||||
initGfxConstants();
|
||||
EGG::GfxEngine::Configuration cfg;
|
||||
u32 texBufSize = cfg.bufferSize;
|
||||
texBufSize += GXGetTexBufferSize(
|
||||
mVideo::m_video->pRenderMode->fbWidth, mVideo::m_video->pRenderMode->efbHeight, GX_TF_RGB5A3, GX_FALSE, 1
|
||||
);
|
||||
EGG::TextureBuffer::setIncludesHeader(true);
|
||||
{
|
||||
mHeap guard(mHeap::g_gameHeaps[0]);
|
||||
EGG::TextureBuffer::initialize(texBufSize, dSys_c::ms_RootHeapMem2);
|
||||
}
|
||||
m2d::create(dHeap::layoutHeap.heap, 0);
|
||||
d2d::create(dHeap::layoutExHeap.heap);
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
EGG::TextureBuffer *dGfx_c::getTextureBuffer() {
|
||||
EGG::TextureBuffer *ret = nullptr;
|
||||
if (mpTextureBuffer == nullptr) {
|
||||
mpTextureBuffer = EGG::TextureBuffer::alloc(
|
||||
mVideo::m_video->pRenderMode->fbWidth, mVideo::m_video->pRenderMode->efbHeight, GX_TF_RGBA8
|
||||
);
|
||||
mpTextureBuffer->onCapFlag(0x20); // TODO
|
||||
ret = mpTextureBuffer;
|
||||
}
|
||||
field_0x08++;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dGfx_c::releaseTextureBuffer() {
|
||||
field_0x08--;
|
||||
if (field_0x08 == 0 && mpTextureBuffer != nullptr) {
|
||||
mpTextureBuffer->free();
|
||||
mpTextureBuffer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void dGfx_c::drawBefore() {
|
||||
if (mDrawCallback != nullptr) {
|
||||
(mDrawCallback)();
|
||||
}
|
||||
d2d::drawBefore();
|
||||
m3d::clear();
|
||||
m2d::reset();
|
||||
}
|
||||
|
||||
void dGfx_c::drawLetterbox() {
|
||||
if (field_0x09 != 0 && isTvMode4To3()) {
|
||||
EGG::Screen screen(*EGG::Screen::GetRoot());
|
||||
screen.SetNearFar(-1.0f, 1.0f);
|
||||
screen.SetProjectionGX();
|
||||
EGG::DrawGX::BeginDrawScreen(true, false, true);
|
||||
|
||||
mMtx_c mtx1;
|
||||
mMtx_c mtx2;
|
||||
mMtx_c mtx3;
|
||||
|
||||
mtx1.transS(0.0f, 0.0f, 0.0f);
|
||||
MTXScale(mtx2, getCurrentScreenWidthF(), getEFBHeightDifferenceF(), 0.0f);
|
||||
MTXConcat(mtx1, mtx2, mtx1);
|
||||
EGG::DrawGX::DrawDL17(mtx1, EGG::DrawGX::BLACK);
|
||||
|
||||
mtx1.transS(0.0f, getCurrentScreenHeightF() - getEFBHeightDifferenceF() - 1.0f, 0.0f);
|
||||
MTXScale(mtx3, getCurrentScreenWidthF(), getEFBHeightDifferenceF() + 1.0f, 0.0f);
|
||||
MTXConcat(mtx1, mtx3, mtx1);
|
||||
EGG::DrawGX::DrawDL17(mtx1, EGG::DrawGX::BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
void dGfx_c::create(EGG::Heap *heap) {
|
||||
new (heap) dGfx_c();
|
||||
}
|
||||
|
||||
void dGfx_c::drawCapTexture(EGG::TextureBuffer *buf, nw4r::ut::Color *clr) {
|
||||
if (buf == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
s32 width = mVideo::m_video->pRenderMode->fbWidth;
|
||||
s32 height = mVideo::m_video->pRenderMode->efbHeight;
|
||||
s32 offsetY = 0;
|
||||
|
||||
if (buf->getHeight() == getEFBHeightLimit()) {
|
||||
height = getEFBHeight();
|
||||
offsetY = getLetterboxAmount();
|
||||
}
|
||||
GXSetViewport(0.0f, offsetY, width, height, 0.0f, 1.0f);
|
||||
GXSetScissor(0, offsetY, width, height);
|
||||
GXSetScissorBoxOffset(0, 0);
|
||||
|
||||
Mtx44 mtx;
|
||||
MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);
|
||||
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
|
||||
buf->load(GX_TEXMAP0);
|
||||
GXSetNumChans(0);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c, 0, 0x7d);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetZCompLoc(1);
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_ONE, GX_BL_ONE, GX_LO_SET);
|
||||
GXSetZMode(GX_FALSE, GX_ALWAYS, GX_FALSE);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0);
|
||||
|
||||
GXSetFog(GX_FOG_NONE, (GXColor){0}, 0.0, 0.0, 0.0, 0.0);
|
||||
GXSetFogRangeAdj(GX_FALSE, 0, 0);
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXSetTevColor(GX_TEVREG0, *clr);
|
||||
GXLoadPosMtxImm(mMtx_c::Identity, 0);
|
||||
GXSetCurrentMtx(0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_U8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_U8, 0);
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
GXPosition2u8(0, 0);
|
||||
GXPosition2u8(0, 0);
|
||||
GXPosition2u8(1, 0);
|
||||
GXPosition2u8(1, 0);
|
||||
GXPosition2u8(1, 1);
|
||||
GXPosition2u8(1, 1);
|
||||
GXPosition2u8(0, 1);
|
||||
GXPosition2u8(0, 1);
|
||||
|
||||
GXEnd();
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
#include "d/d_gfx.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
|
||||
s32 dGfx_c::g_CurrentScreenWidth_s32;
|
||||
s32 dGfx_c::g_CurrentScreenHeight_s32;
|
||||
s32 dGfx_c::g_CurrentScreenWidthLimit_s32;
|
||||
s32 dGfx_c::g_CurrentScreenHeightLimit_s32;
|
||||
s32 dGfx_c::g_CurrentScreenLeft_s32;
|
||||
s32 dGfx_c::g_CurrentScreenRight_s32;
|
||||
s32 dGfx_c::g_CurrentScreenTop_s32;
|
||||
s32 dGfx_c::g_CurrentScreenBottom_s32;
|
||||
|
||||
s32 dGfx_c::g_CurrentEFBHeight_s32;
|
||||
s32 dGfx_c::g_CurrentEFBHeightLimit_s32;
|
||||
s32 dGfx_c::g_CurrentLetterBoxAmount_s32;
|
||||
|
||||
f32 dGfx_c::g_CurrentScreenWidth_f32;
|
||||
f32 dGfx_c::g_CurrentScreenHeight_f32;
|
||||
f32 dGfx_c::g_CurrentScreenWidthLimit_f32;
|
||||
f32 dGfx_c::g_CurrentScreenHeightLimit_f32;
|
||||
f32 dGfx_c::g_CurrentScreenLeft_f32;
|
||||
f32 dGfx_c::g_CurrentScreenRight_f32;
|
||||
f32 dGfx_c::g_CurrentScreenTop_f32;
|
||||
f32 dGfx_c::g_CurrentScreenBottom_f32;
|
||||
|
||||
f32 dGfx_c::g_CurrentScreenAspect;
|
||||
|
||||
f32 dGfx_c::g_CurrentEFBHeight_f32;
|
||||
f32 dGfx_c::g_CurrentEFBHeightLimit_f32;
|
||||
f32 dGfx_c::g_CurrentEFBHeightDifference_f32;
|
||||
f32 dGfx_c::g_CurrentHeightScaled_f32;
|
||||
f32 dGfx_c::g_CurrentEFBHeightDifference2_f32;
|
||||
|
||||
s32 dGfx_c::g_Width4x3_s32;
|
||||
s32 dGfx_c::g_Width4x3Limit_s32;
|
||||
s32 dGfx_c::g_Width16x9_s32;
|
||||
s32 dGfx_c::g_Width4x3Left_s32;
|
||||
s32 dGfx_c::g_Width4x3Right_s32;
|
||||
|
||||
f32 dGfx_c::g_Width4x3_f32;
|
||||
f32 dGfx_c::g_Width4x3Limit_f32;
|
||||
f32 dGfx_c::g_Width16x9_f32;
|
||||
f32 dGfx_c::g_Width4x3Left_f32;
|
||||
f32 dGfx_c::g_Width4x3Right_f32;
|
||||
|
||||
f32 dGfx_c::g_16x9to4x3WidthScale;
|
||||
f32 dGfx_c::g_CurrentScreenTo4x3WidthScale = 1.0f;
|
||||
|
||||
void dGfx_c::initGfxConstants() {
|
||||
// TODO - awful function
|
||||
}
|
||||
|
||||
bool dGfx_c::isTvMode4To3() {
|
||||
return EGG::Screen::GetTVMode() == EGG::Screen::TV_MODE_4_3;
|
||||
}
|
||||
|
||||
bool dGfx_c::isTvModeWidescreen() {
|
||||
return EGG::Screen::GetTVMode() != EGG::Screen::TV_MODE_4_3;
|
||||
}
|
||||
@@ -87,8 +87,8 @@ int dScTitle_c::create() {
|
||||
}
|
||||
|
||||
if (ret == SUCCEEDED) {
|
||||
dSys::setFrameRate(2);
|
||||
dSys::setClearColor(mColor(0x00000000));
|
||||
dSys_c::setFrameRate(2);
|
||||
dSys_c::setClearColor(mColor(0x00000000));
|
||||
dPad::ex_c::setAutoSleepTime();
|
||||
dPad::ex_c::fn_80058C90(0);
|
||||
SaveRelated::create();
|
||||
|
||||
@@ -240,7 +240,7 @@ void dStageMgr_c::initializeState_SceneChangeSave() {
|
||||
fn_80285600(LYT_SAVE_MGR, 3, 0);
|
||||
}
|
||||
dBase_c::s_NextExecuteControlFlags |= 1;
|
||||
dSys::setFrameRate(2);
|
||||
dSys_c::setFrameRate(2);
|
||||
}
|
||||
|
||||
void dStageMgr_c::executeState_SceneChangeSave() {
|
||||
@@ -260,7 +260,7 @@ void dStageMgr_c::finalizeState_SceneChangeSave() {
|
||||
}
|
||||
|
||||
void dStageMgr_c::initializeState_RestartSceneWait() {
|
||||
dSys::setFrameRate(2);
|
||||
dSys_c::setFrameRate(2);
|
||||
}
|
||||
|
||||
void dStageMgr_c::executeState_RestartSceneWait() {
|
||||
@@ -291,5 +291,5 @@ void dStageMgr_c::executeState_RestartScene() {
|
||||
|
||||
void dStageMgr_c::finalizeState_RestartScene() {
|
||||
commitAllFlagManagers();
|
||||
dSys::setFrameRate(1);
|
||||
dSys_c::setFrameRate(1);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,7 @@
|
||||
#include "d/lyt/d2d.h"
|
||||
|
||||
#include "d/d_font_manager.h"
|
||||
#include "d/d_gfx.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/d_lyt_hio.h"
|
||||
#include "d/lyt/d_textbox.h"
|
||||
@@ -199,15 +200,13 @@ void Multi_c::calcAfter() {
|
||||
mLayout.CalculateMtx(mDrawInfo);
|
||||
}
|
||||
|
||||
extern "C" bool NeedsScreenAdjustment();
|
||||
|
||||
// Largely copied from m2d::Simple_c::draw
|
||||
void Multi_c::draw() {
|
||||
nw4r::ut::Rect r = mLayout.GetLayoutRect();
|
||||
f32 near = 0.0f;
|
||||
f32 far = 500.0f;
|
||||
EGG::Screen s;
|
||||
bool needsAdjust = NeedsScreenAdjustment();
|
||||
bool needsAdjust = dGfx_c::isTvModeWidescreen();
|
||||
f32 f1 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_16_9);
|
||||
f32 f2 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_4_3);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ void dLytCommonABtn_c::gotoStateInvisible() {
|
||||
inAnim.bind(false);
|
||||
inAnim.setAnimEnable(true);
|
||||
inAnim.setFrame(0.0f);
|
||||
if (dSys::getFrameRate() == 1) {
|
||||
if (dSys_c::getFrameRate() == 1) {
|
||||
inAnim.setRate(0.5f);
|
||||
} else {
|
||||
inAnim.setRate(1.0f);
|
||||
@@ -144,7 +144,7 @@ void dLytCommonABtn_c::goToStateVisible() {
|
||||
d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_LOOP];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
if (dSys::getFrameRate() == 1) {
|
||||
if (dSys_c::getFrameRate() == 1) {
|
||||
anm.setRate(0.5f);
|
||||
} else {
|
||||
anm.setRate(1.0f);
|
||||
@@ -169,7 +169,7 @@ void dLytCommonABtn_c::goToStateDecideOut() {
|
||||
d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_OUT];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
if (dSys::getFrameRate() == 1) {
|
||||
if (dSys_c::getFrameRate() == 1) {
|
||||
anm.setRate(0.5f);
|
||||
} else {
|
||||
anm.setRate(1.0f);
|
||||
@@ -180,7 +180,7 @@ void dLytCommonABtn_c::goToStateDecideOut() {
|
||||
anm.bind(false);
|
||||
anm.setAnimEnable(true);
|
||||
anm.setFrame(0.0f);
|
||||
if (dSys::getFrameRate() == 1) {
|
||||
if (dSys_c::getFrameRate() == 1) {
|
||||
anm.setRate(0.5f);
|
||||
} else {
|
||||
anm.setRate(1.0f);
|
||||
@@ -214,7 +214,7 @@ void dLytCommonABtn_c::executeStateDecideOut() {
|
||||
anmOut.bind(false);
|
||||
anmOut.setAnimEnable(true);
|
||||
anmOut.setFrame(0.0f);
|
||||
if (dSys::getFrameRate() == 1) {
|
||||
if (dSys_c::getFrameRate() == 1) {
|
||||
anmOut.setRate(0.5f);
|
||||
} else {
|
||||
anmOut.setRate(1.0f);
|
||||
|
||||
@@ -120,7 +120,7 @@ bool dLytCursorStick_c::drawDirectly_() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytCursorStick_c::setPriority(u8 priority) {
|
||||
void dLytCursorStick_c::setPriority(u8 priority) {
|
||||
mLyt.setPriority(priority);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,8 +152,6 @@ static void CalcStringRectImpl(
|
||||
} while (remain > 0);
|
||||
}
|
||||
|
||||
extern "C" bool NeedsScreenAdjustment();
|
||||
|
||||
static int CalcLineRectImpl(
|
||||
nw4r::ut::Rect *pRect, nw4r::ut::TextWriterBase<wchar_t> *pTextWriter, const wchar_t *str, int length, f32 maxWidth,
|
||||
bool *pbOver, bool *pbWideScreenUnk
|
||||
@@ -187,7 +185,7 @@ static int CalcLineRectImpl(
|
||||
|
||||
pTextWriter->SetCursorX(x);
|
||||
// ??????????
|
||||
if (pbWideScreenUnk != nullptr && ((u32 *)context.str)[0] == 0 && NeedsScreenAdjustment()) {
|
||||
if (pbWideScreenUnk != nullptr && ((u32 *)context.str)[0] == 0 && dGfx_c::isTvModeWidescreen()) {
|
||||
*pbWideScreenUnk = true;
|
||||
}
|
||||
operation = pTextWriter->GetTagProcessor()->CalcRect(&rect, code, &context);
|
||||
|
||||
@@ -244,12 +244,8 @@ void dEmitterBase_c::setPosRotScale(const mVec3_c &position, const mAng3_c *rot,
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" f32 lbl_80571C50;
|
||||
inline f32 getlbl_80571C50() {
|
||||
return lbl_80571C50;
|
||||
}
|
||||
void dEmitterBase_c::setPosRotScaleWithScreenScale(const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale) {
|
||||
mVec3_c adjustedPosition(position.x * getlbl_80571C50(), position.y, position.z);
|
||||
mVec3_c adjustedPosition(position.x * dGfx_c::getCurrentScreenTo4x3WidthScaleF(), position.y, position.z);
|
||||
setPosRotScale(adjustedPosition, rot, scale);
|
||||
}
|
||||
|
||||
@@ -965,7 +961,7 @@ dEmitterBase_c *dJEffManager_c::spawnUIEffect(
|
||||
u16 effectResourceId, const mVec3_c &position, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1,
|
||||
const GXColor *c2
|
||||
) {
|
||||
mVec3_c adjustedPosition(position.x * getlbl_80571C50(), position.y, position.z);
|
||||
mVec3_c adjustedPosition(position.x * dGfx_c::getCurrentScreenTo4x3WidthScaleF(), position.y, position.z);
|
||||
return spawnEffectInternal(effectResourceId, adjustedPosition, rot, scale, c1, c2, 0, 0);
|
||||
}
|
||||
|
||||
@@ -984,7 +980,7 @@ bool EffectsStruct::createEffect(
|
||||
bool EffectsStruct::createUIEffect(
|
||||
u16 resourceId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1, const GXColor *c2
|
||||
) {
|
||||
mVec3_c adjustedPosition(pos.x * getlbl_80571C50(), pos.y, pos.z);
|
||||
mVec3_c adjustedPosition(pos.x * dGfx_c::getCurrentScreenTo4x3WidthScaleF(), pos.y, pos.z);
|
||||
return createEffect(true, resourceId, adjustedPosition, rot, scale, c1, c2);
|
||||
}
|
||||
|
||||
@@ -1001,7 +997,7 @@ bool EffectsStruct::createContinuousEffect(
|
||||
bool EffectsStruct::createContinuousUIEffect(
|
||||
u16 resourceId, const mVec3_c &pos, const mAng3_c *rot, const mVec3_c *scale, const GXColor *c1, const GXColor *c2
|
||||
) {
|
||||
mVec3_c adjustedPosition(pos.x * getlbl_80571C50(), pos.y, pos.z);
|
||||
mVec3_c adjustedPosition(pos.x * dGfx_c::getCurrentScreenTo4x3WidthScaleF(), pos.y, pos.z);
|
||||
return createEffect(false, resourceId, adjustedPosition, rot, scale, c1, c2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1531,7 +1531,7 @@ void SaveMgr::endState() {
|
||||
}
|
||||
|
||||
s32 SaveMgr::getFrameRate() {
|
||||
return 60 / dSys::getFrameRate();
|
||||
return 60 / dSys_c::getFrameRate();
|
||||
}
|
||||
|
||||
NandRequestCheckIsFile::NandRequestCheckIsFile(const char *path) : mIsFile(0) {
|
||||
|
||||
Reference in New Issue
Block a user