mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-04 00:38:59 -04:00
26 02 27 pjb dev 2 (#41)
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
820e2e3df6
commit
b289dece80
@@ -146,8 +146,8 @@ struct daFmtMng_c : public fopAc_ac_c {
|
||||
for (int i = 0; i < mFormationLine * mFormationRow; i++, member++) {
|
||||
fopAcM_delete(member->mNpcId);
|
||||
}
|
||||
delete [] mPos;
|
||||
delete [] mMember;
|
||||
JKR_DELETE_ARRAY(mPos);
|
||||
JKR_DELETE_ARRAY(mMember);
|
||||
}
|
||||
|
||||
int getTimeHour() {
|
||||
|
||||
@@ -815,7 +815,7 @@ STATIC_ASSERT(sizeof(daNpcT_c) == 0xE40);
|
||||
|
||||
#define daNpcT_ct(ptr, ClassName, faceMotionAnmData, motionAnmData, faceMotionSequenceData, faceMotionStepNum, motionSequenceData, motionStepNum, evtData, arcNames) \
|
||||
if (!fopAcM_CheckCondition(ptr, fopAcCnd_INIT_e)) { \
|
||||
new (ptr) ClassName(faceMotionAnmData, motionAnmData, faceMotionSequenceData, faceMotionStepNum, motionSequenceData, motionStepNum, evtData, arcNames); \
|
||||
JKR_NEW_ARGS (ptr) ClassName(faceMotionAnmData, motionAnmData, faceMotionSequenceData, faceMotionStepNum, motionSequenceData, motionStepNum, evtData, arcNames); \
|
||||
fopAcM_OnCondition(ptr, fopAcCnd_INIT_e); \
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
}
|
||||
~_Fairy_Feather_c() {
|
||||
if (mpMorf != NULL) {
|
||||
delete mpMorf;
|
||||
JKR_DELETE(mpMorf);
|
||||
mpMorf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
int getLuggageParamHigh(u32);
|
||||
int create();
|
||||
void create_init();
|
||||
~daPasserMng_c() { delete [] childProcIds; }
|
||||
~daPasserMng_c() { JKR_DELETE_ARRAY(childProcIds); }
|
||||
|
||||
u8 getDetailLevel() { return argument; }
|
||||
u8 getPathID() { return fopAcM_GetParam(this); }
|
||||
|
||||
@@ -92,15 +92,15 @@ public:
|
||||
|
||||
struct dCamStyleData {
|
||||
struct StyleData {
|
||||
/* 0x0 */ s32 field_0x0;
|
||||
/* 0x4 */ u16 field_0x4;
|
||||
/* 0x6 */ u16 mFlags;
|
||||
/* 0x8 */ f32 mParams[28];
|
||||
/* 0x0 */ BE(s32) field_0x0;
|
||||
/* 0x4 */ BE(u16) field_0x4;
|
||||
/* 0x6 */ BE(u16) mFlags;
|
||||
/* 0x8 */ BE(f32) mParams[28];
|
||||
}; // Size: 0x78
|
||||
|
||||
/* 0x0 */ u8 field_0x0[4];
|
||||
/* 0x4 */ int mStyleNum;
|
||||
/* 0x8 */ StyleData* mStyleData;
|
||||
/* 0x4 */ BE(int) mStyleNum;
|
||||
/* 0x8 */ StyleData mStyleData[1];
|
||||
};
|
||||
|
||||
class dCamParam_c
|
||||
|
||||
@@ -87,7 +87,7 @@ struct dCamera_event_param {
|
||||
|
||||
struct dCamera_type_data {
|
||||
/* 0x00 */ char name[24];
|
||||
/* 0x18 */ s16 field_0x18[2][11];
|
||||
/* 0x18 */ BE(s16) field_0x18[2][11];
|
||||
}; // Size: 0x44
|
||||
|
||||
struct camSphChkdata {
|
||||
@@ -1086,7 +1086,11 @@ public:
|
||||
|
||||
bool CheckFlag(u32 i_flag) { return (mEventFlags & i_flag) != 0 ? true : false; }
|
||||
|
||||
#if TARGET_PC
|
||||
void ResetView();
|
||||
#else
|
||||
void ResetView() { setView(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT); }
|
||||
#endif
|
||||
|
||||
void clearInfo(dCamInfo_c* i_info, s16 param_1) {
|
||||
i_info->field_0x1e = param_1;
|
||||
|
||||
@@ -59,7 +59,7 @@ class dCsr_mng_c {
|
||||
};
|
||||
|
||||
bloObj_c() {
|
||||
m_panes = new paneObj_c[1];
|
||||
m_panes = JKR_NEW paneObj_c[1];
|
||||
m_screen = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
int getIsAddvance(int staffId);
|
||||
int getMyActIdx(int staffId, const char* const* action, int n_action, BOOL param_3, BOOL param_4);
|
||||
char* getMyNowCutName(int staffId);
|
||||
char* getMyNowCutNameStr(int staffId);
|
||||
dEvDtData_c* getMyDataP(int staffId, const char* dataname, BOOL isSeekStart);
|
||||
void* getMySubstanceP(int staffId, const char* dataname, int datatype);
|
||||
int getMySubstanceNum(int staffId, const char* dataname);
|
||||
|
||||
@@ -15,8 +15,8 @@ class dDlst_FileSel_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSel_c() {
|
||||
delete Scr;
|
||||
delete mMessageString;
|
||||
JKR_DELETE(Scr);
|
||||
JKR_DELETE(mMessageString);
|
||||
}
|
||||
|
||||
dDlst_FileSel_c() {
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
font[1] = mDoExt_getSubFont();
|
||||
JUT_ASSERT(107, font[1] != NULL);
|
||||
|
||||
mMessageString = new dMsgString_c();
|
||||
mMessageString = JKR_NEW dMsgString_c();
|
||||
JUT_ASSERT(110, mMessageString != NULL);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
class dDlst_FileSelYn_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSelYn_c() { delete ScrYn; }
|
||||
virtual ~dDlst_FileSelYn_c() { JKR_DELETE(ScrYn); }
|
||||
|
||||
/* 0x04 */ J2DScreen* ScrYn;
|
||||
/* 0x08 */ u8 field_0x08[4];
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
class dDlst_FileSelDt_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSelDt_c() { delete ScrDt; }
|
||||
virtual ~dDlst_FileSelDt_c() { JKR_DELETE(ScrDt); }
|
||||
|
||||
/* 0x04 */ J2DScreen* ScrDt;
|
||||
/* 0x08 */ J2DPane* mpPane;
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
class dDlst_FileSelCp_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSelCp_c() { delete Scr; }
|
||||
virtual ~dDlst_FileSelCp_c() { JKR_DELETE(Scr); }
|
||||
|
||||
/* 0x04 */ J2DScreen* Scr;
|
||||
/* 0x08 */ bool isShow;
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
class dDlst_FileSel3m_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSel3m_c() { delete Scr3m; }
|
||||
virtual ~dDlst_FileSel3m_c() { JKR_DELETE(Scr3m); }
|
||||
|
||||
/* 0x04 */ J2DScreen* Scr3m;
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
~fmpTresTypeGroupData_c() {
|
||||
if (mpNext != NULL) {
|
||||
delete mpNext;
|
||||
JKR_DELETE(mpNext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void addTypeGroupData(u8, dTres_c::data_s const*);
|
||||
~fmpTresTypeGroupDataList_c() {
|
||||
if (mpTypeGroupDataHead != NULL) {
|
||||
delete mpTypeGroupDataHead;
|
||||
JKR_DELETE(mpTypeGroupDataHead);
|
||||
}
|
||||
}
|
||||
fmpTresTypeGroupDataList_c() {
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
|
||||
~dMenu_Fmap_room_data_c() {
|
||||
if (mp_fmpTresTypeGroupDataListAll != NULL) {
|
||||
delete mp_fmpTresTypeGroupDataListAll;
|
||||
JKR_DELETE(mp_fmpTresTypeGroupDataListAll);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,6 +209,23 @@ struct BE<Mtx44> {
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct BE<Mtx> {
|
||||
BE<f32> contents[3][4];
|
||||
|
||||
auto& operator[](int x) const {
|
||||
return contents[x];
|
||||
}
|
||||
|
||||
void to_host(Mtx& mtx) const {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
mtx[i][j] = contents[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
void be_swap(T& val) {
|
||||
val = BE<T>::swap(val);
|
||||
@@ -222,6 +239,13 @@ void be_swap(T (& val)[N]) {
|
||||
val = BE<T>::swap(val);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void be_swap(T array[], const u32 size) {
|
||||
for (u32 i = 0; i < size; i++) {
|
||||
be_swap(array[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void be_swap(Mtx44& val) {
|
||||
for (auto & x : val) {
|
||||
@@ -231,6 +255,15 @@ inline void be_swap(Mtx44& val) {
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void be_swap(Mtx& val) {
|
||||
for (auto & x : val) {
|
||||
for (float & y : x) {
|
||||
be_swap(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define BE(T) BE<T>
|
||||
#define BE_HOST(T) (T.host())
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef DUSK_LOGGING_H
|
||||
#define DUSK_LOGGING_H
|
||||
|
||||
#include <aurora/aurora.h>
|
||||
#include <aurora/lib/logging.hpp>
|
||||
|
||||
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message, unsigned int len);
|
||||
|
||||
extern aurora::Module DuskLog;
|
||||
|
||||
#define STUB_LOG() DuskLog.debug("{} is a stub", __FUNCTION__)
|
||||
|
||||
#endif
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "CaptureScreen.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
void fapGm_After();
|
||||
void fapGm_Create();
|
||||
void fapGm_Execute();
|
||||
@@ -28,7 +30,7 @@ public:
|
||||
static void executeCaptureScreen() {}
|
||||
|
||||
static void createCaptureScreen() {
|
||||
mCaptureScreen = new CaptureScreen(JFWDisplay::getManager());
|
||||
mCaptureScreen = JKR_NEW CaptureScreen(JFWDisplay::getManager());
|
||||
JUT_ASSERT(46, mCaptureScreen != NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,9 @@
|
||||
#include "dusk/endian_ssystem.h"
|
||||
|
||||
#if !__MWERKS__
|
||||
// Modern compilers will zero the parent struct in default constructors.
|
||||
// So instead of adding default constructors to everything,
|
||||
// we'll just save & restore that data.
|
||||
#define fopAcM_ct_placement_copy_length offsetof(fopAc_ac_c, actor_last_base_field) - offsetof(fopAc_ac_c, type)
|
||||
|
||||
#define fopAcM_ct_placement(ptr, ClassName) \
|
||||
fopAc_ac_c copy; \
|
||||
memcpy(©.type, &(ptr)->type, fopAcM_ct_placement_copy_length); \
|
||||
new (ptr) ClassName() ; \
|
||||
memcpy(&(ptr)->type, ©.type, fopAcM_ct_placement_copy_length);
|
||||
// mwerks compiler makes value initialization act like default initialization so we need
|
||||
// to be explicit about default initialization in modern compilers
|
||||
#define fopAcM_ct_placement(ptr, ClassName) JKR_NEW_ARGS (ptr) ClassName
|
||||
#else
|
||||
#define fopAcM_ct_placement(ptr, ClassName) new (ptr) ClassName()
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include <os.h>
|
||||
#include <os.h>
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "f_pc/f_pc_node.h"
|
||||
|
||||
#define mDoDvd_MOUNT_DIRECTION_HEAD 0
|
||||
@@ -23,7 +24,7 @@ public:
|
||||
virtual ~mDoDvdThd_command_c();
|
||||
mDoDvdThd_command_c();
|
||||
inline s32 sync() { return mIsDone; }
|
||||
inline void destroy() { delete this; }
|
||||
inline void destroy() { JKR_DELETE(this); }
|
||||
virtual s32 execute() = 0;
|
||||
}; // Size = 0x14
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "JSystem/JFramework/JFWDisplay.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include "global.h"
|
||||
#include "dusk/logging.h"
|
||||
#if TARGET_PC
|
||||
#include <aurora/aurora.h>
|
||||
#endif
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
#define FB_WIDTH (640)
|
||||
@@ -97,8 +101,7 @@ public:
|
||||
|
||||
static int startFadeOut(int param_0) { return JFWDisplay::getManager()->startFadeOut(param_0); }
|
||||
static int startFadeIn(int param_0) {
|
||||
printf("[DIAG] mDoGph_gInf_c::startFadeIn START\n");
|
||||
fflush(stdout);
|
||||
DuskLog.debug("mDoGph_gInf_c::startFadeIn START");
|
||||
return JFWDisplay::getManager()->startFadeIn(param_0); }
|
||||
static void setFadeColor(JUtility::TColor& color) { mFader->setColor(color); }
|
||||
static void setClearColor(JUtility::TColor color) { JFWDisplay::getManager()->setClearColor(color); }
|
||||
@@ -137,8 +140,20 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
static f32 getWidth() { return FB_WIDTH; }
|
||||
static f32 getHeight() { return FB_HEIGHT; }
|
||||
static f32 getWidth() {
|
||||
#if TARGET_PC
|
||||
return JUTVideo::getManager()->getFbWidth();
|
||||
#else
|
||||
return FB_WIDTH;
|
||||
#endif
|
||||
}
|
||||
static f32 getHeight() {
|
||||
#if TARGET_PC
|
||||
return JUTVideo::getManager()->getEfbHeight();
|
||||
#else
|
||||
return FB_HEIGHT;
|
||||
#endif
|
||||
}
|
||||
|
||||
static f32 getMinYF() {
|
||||
#if WIDESCREEN_SUPPORT
|
||||
@@ -266,6 +281,10 @@ public:
|
||||
static void setWideZoomLightProjection(Mtx& m);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
static void setWindowSize(AuroraWindowSize const& size);
|
||||
#endif
|
||||
|
||||
static GXTexObj mFrameBufferTexObj;
|
||||
static GXTexObj mZbufferTexObj;
|
||||
static bloom_c m_bloom;
|
||||
|
||||
Reference in New Issue
Block a user