m_Do demo work (#1189)

* m_Do_controller_pad and m_Do_Reset OK for demo, m_Do_machine 100% with weak func order

* Add machine.pch, m_Do_machine OK for demo

* m_Do_gba_com and m_Do_MemCardRWmng OK for demo

* m_Do_graphic work

* m_Do_graphic JPN/PAL version diffs
This commit is contained in:
LagoLunatic
2026-08-31 15:52:01 -04:00
committed by GitHub
parent 18e0b77903
commit e7e0e8e581
61 changed files with 694 additions and 411 deletions
+4 -4
View File
@@ -15,12 +15,12 @@ public:
virtual s32 getGrafType() const { return 1; }
virtual void setLookat();
f32 getWidthPower() const { return mBounds.getWidth() / mOrtho.getWidth(); }
f32 getHeightPower() const { return mBounds.getHeight() / mOrtho.getHeight(); }
f32 getWidthPower() { return mBounds.getWidth() / mOrtho.getWidth(); }
f32 getHeightPower() { return mBounds.getHeight() / mOrtho.getHeight(); }
const JGeometry::TBox2<f32>* getOrtho() const { return &mOrtho; }
void setOrtho(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near) {
JGeometry::TBox2<f32> ortho(x, y, x + width, y + height);
setOrtho(ortho, far, near);
setOrtho(JGeometry::TBox2<f32>(x, y, x + width, y + height), far, near);
}
private:
+1 -1
View File
@@ -49,7 +49,7 @@ public:
};
MtxP getViewMtx() { return mViewMtx; }
void setViewMtx(Mtx m) { MTXCopy(m, mViewMtx); }
void setViewMtx(const Mtx m) { MTXCopy(m, mViewMtx); }
void setDrawModeOpaTexEdge() { mDrawMode = OPA_TEX_EDGE; }
+2 -2
View File
@@ -23,7 +23,7 @@ struct JFWSystem {
static s32 decompPriority;
static s32 aPiecePriority;
static ResFONT* systemFontRes;
static GXRenderModeObj* renderMode;
static const GXRenderModeObj* renderMode;
static u32 exConsoleBufferSize;
};
@@ -53,7 +53,7 @@ struct JFWSystem {
JUT_ASSERT(61, sInitCalled == FALSE);
CSetUpParam::aramGraphBufSize = size;
}
static void setRenderMode(GXRenderModeObj* p_modeObj) {
static void setRenderMode(const GXRenderModeObj* p_modeObj) {
JUT_ASSERT(80, sInitCalled == FALSE);
CSetUpParam::renderMode = p_modeObj;
}
+1 -3
View File
@@ -43,7 +43,7 @@ public:
static void dump(void);
static JKRAram* getManager() { return sAramObject; }
static JKRAramHeap* getAramHeap() { return getManager()->mAramHeap; }
static JKRAramHeap* getAramHeap() { return sAramObject->mAramHeap; }
static JSUList<JKRAMCommand>& getCommandList() { return sAramCommandList; }
static u8 decideAramGroupId(int groupId) {
@@ -94,6 +94,4 @@ inline JKRAramBlock* JKRMainRamToAram(u8* buf, JKRAramBlock* block, u32 size, JK
return JKRAram::mainRamToAram(buf, block, size, expandSwitch, fileSize, heap, id);
}
// void JKRDecompressFromAramToMainRam(u32, void*, u32, u32, u32, u32*);
#endif /* JKRARAM_H */
+8
View File
@@ -68,4 +68,12 @@ inline JKRAramStreamCommand* JKRStreamToAram_Async(JSUFileInputStream *stream, u
return JKRAramStream::write_StreamToAram_Async(stream, addr, size, offset);
}
inline void JKRSetAramTransferBuffer(u8* buffer, u32 bufferSize, JKRHeap* heap) {
JKRAramStream::setTransBuffer(buffer, bufferSize, heap);
}
inline void JKRResetAramTransferBuffer() {
JKRAramStream::setTransBuffer(NULL, 0, NULL);
}
#endif /* JKRARAMSTREAM_H */
+8
View File
@@ -240,4 +240,12 @@ inline u32 JKRReadTypeResource(void* buffer, u32 bufferSize, u32 tag, const char
return JKRArchive::readTypeResource(buffer, bufferSize, tag, name, arc);
}
inline JKRArchive* JKRMountArchive(const char* path, JKRArchive::EMountMode mountMode, JKRHeap* heap, JKRArchive::EMountDirection mountDirection) {
return JKRArchive::mount(path, mountMode, heap, mountDirection);
}
inline void JKRUnmountArchive(JKRArchive* arc) {
arc->unmount();
}
#endif
+11 -19
View File
@@ -3,31 +3,25 @@
#include "dolphin/dvd/dvd.h"
struct JKRFileFinder_UnknownBase {
/* 0x00 */ const char* mEntryName;
/* 0x04 */ s32 mEntryFileIndex;
/* 0x08 */ u16 mEntryId;
/* 0x0A */ u16 mEntryTypeFlags;
}; // Size: 0x0C
class JKRFileFinder : public JKRFileFinder_UnknownBase {
class JKRFileFinder {
public:
JKRFileFinder() {
mIsAvailable = false;
mIsFileOrDirectory = false;
}
virtual ~JKRFileFinder() {}
bool isAvailable() const { return mIsAvailable; }
bool isFile() const { return mIsFileOrDirectory; }
bool isDirectory() const { return mIsFileOrDirectory; }
public:
/* 0x00 */ const char* mEntryName;
/* 0x04 */ s32 mEntryFileIndex;
/* 0x08 */ u16 mEntryId;
/* 0x0A */ u16 mEntryTypeFlags;
virtual ~JKRFileFinder() {}
/* vt[3] */ virtual bool findNextFile() = 0;
protected:
/* 0x00 */ // JKRFileFinder_UnknownBase
/* 0x0C */ // vtable
/* 0x10 */ bool mIsAvailable;
/* 0x11 */ bool mIsFileOrDirectory;
/* 0x12 */ u8 field_0x12[2];
@@ -43,9 +37,6 @@ public:
/* vt[3] */ virtual bool findNextFile(void); /* override */
private:
/* 0x00 */ // JKRFileFinder_UnknownBase
/* 0x0C */ // vtable
/* 0x10 */ // JKRFileFinder
/* 0x14 */ JKRArchive* mArchive;
/* 0x18 */ s32 mStartIndex;
/* 0x1C */ s32 mEndIndex;
@@ -61,12 +52,13 @@ public:
/* vt[3] */ virtual bool findNextFile(void); /* override */
private:
/* 0x00 */ // JKRFileFinder_UnknownBase
/* 0x0C */ // vtable
/* 0x10 */ // JKRFileFinder
/* 0x14 */ DVDDirectory mDvdDirectory;
/* 0x20 */ bool mDvdIsOpen;
/* 0x21 */ u8 field_0x21[3];
};
inline bool JKRIsFileFinderAvailable(JKRFileFinder* fileFinder) {
return fileFinder->isAvailable();
}
#endif /* JKRFILEFINDER_H */
+4
View File
@@ -65,4 +65,8 @@ inline void* JKRGetResource(const char* name) {
return JKRFileLoader::getGlbResource(name);
}
inline bool JKRRemoveResource(void* resource, JKRFileLoader* fileLoader) {
return JKRFileLoader::removeResource(resource, fileLoader);
}
#endif /* JKRFILELOADER_H */
+12
View File
@@ -241,4 +241,16 @@ inline JKRHeap* JKRGetRootHeap() {
return JKRHeap::getRootHeap();
}
inline JKRErrorHandler JKRSetErrorHandler(JKRErrorHandler errorHandler) {
return JKRHeap::setErrorHandler(errorHandler);
}
inline bool JKRSetErrorFlag(JKRHeap* heap, bool flag) {
return heap->setErrorFlag(flag);
}
inline void JKRSetDebugFillDelete(u8) {}
inline void JKRSetDebugFillNew(u8) {}
inline void JKRSetDebugFillNotuse(u8) {}
#endif /* JKRHEAP_H */
+21 -12
View File
@@ -11,6 +11,7 @@ class JSUList;
//
class JSUPtrList;
class JSUPtrLink {
public:
JSUPtrLink(void* object);
@@ -36,13 +37,13 @@ class JSULink : public JSUPtrLink {
public:
JSULink(T* object) : JSUPtrLink((void*)object) {}
T* getObject() const { return (T*)mObject; }
T* getObject() const { return static_cast<T*>(mObject); }
JSUList<T>* getSupervisor() const { return (JSUList<T>*)mList; }
JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(mList); }
JSULink<T>* getNext() const { return (JSULink<T>*)mNext; }
JSULink<T>* getNext() const { return static_cast<JSULink*>(mNext); }
JSULink<T>* getPrev() const { return (JSULink<T>*)mPrev; }
JSULink<T>* getPrev() const { return static_cast<JSULink*>(mPrev); }
};
//
@@ -83,6 +84,8 @@ public:
~JSUList() {}
void initiate() { JSUPtrList::initiate(); }
bool append(JSULink<T>* link) { return this->JSUPtrList::append((JSUPtrLink*)link); }
bool prepend(JSULink<T>* link) { return this->JSUPtrList::prepend((JSUPtrLink*)link); }
@@ -97,6 +100,8 @@ public:
JSULink<T>* getLast() const { return (JSULink<T>*)getLastLink(); }
JSULink<T>* getNth(u32 index) const { return (JSULink<T>*)getNthLink(index); }
JSULink<T>* getEnd() const { return NULL; }
u32 getNumLinks() const { return mLength; }
@@ -114,7 +119,7 @@ public:
return *this;
}
T* getObject() { return this->mLink->getObject(); }
T* getObject() const { return this->mLink->getObject(); }
bool operator==(JSULink<T> const* other) const { return this->mLink == other; }
bool operator!=(JSULink<T> const* other) const { return this->mLink != other; }
@@ -145,7 +150,7 @@ public:
T& operator*() { return *this->getObject(); }
T* operator->() { return this->getObject(); }
T* operator->() const { return mLink->getObject(); }
// private:
JSULink<T>* mLink;
@@ -163,15 +168,17 @@ public:
bool appendChild(JSUTree<T>* child) { return this->append(child); }
bool prependChild(JSUTree<T>* child) { return this->prepend(child); }
bool removeChild(JSUTree<T>* child) { return this->remove(child); }
bool insertChild(JSUTree<T>* before, JSUTree<T>* child) { return this->insert(before, child); }
JSUTree<T>* getEndChild() const { return NULL; }
JSUTree<T>* getFirstChild() const { return (JSUTree<T>*)this->getFirst(); }
JSUTree<T>* getFirstChild() const { return (JSUTree<T>*)this->getFirstLink(); }
JSUTree<T>* getLastChild() const { return (JSUTree<T>*)this->getLast(); }
JSUTree<T>* getLastChild() const { return (JSUTree<T>*)this->getLastLink(); }
JSUTree<T>* getNextChild() const { return (JSUTree<T>*)this->mNext; }
@@ -179,7 +186,7 @@ public:
u32 getNumChildren() const { return this->getNumLinks(); }
T* getObject() const { return (T*)this->getObjectPtr(); }
T* getObject() const { return (T*)this->mObject; }
JSUTree<T>* getParent() const { return (JSUTree<T>*)this->mList; }
};
@@ -195,9 +202,11 @@ public:
return *this;
}
operator int() { return (int)mTree; }
T* getObject() const { return this->mTree->getObject(); }
bool operator==(JSUTree<T>* other) { return this->mTree == other; }
bool operator==(const JSUTree<T>* other) const { return this->mTree == other; }
bool operator!=(const JSUTree<T>* other) const { return this->mTree != other; }
@@ -212,9 +221,9 @@ public:
return *this;
}
T* operator*() { return this->getObject(); }
T* operator*() const { return mTree->getObject(); }
T* operator->() const { return this->getObject(); }
T* operator->() const { return mTree->getObject(); }
private:
JSUTree<T>* mTree;
+19 -15
View File
@@ -6,6 +6,20 @@
#include "JSystem/JUtility/JUTFont.h"
#include "stdarg.h"
class JUTConsole;
extern "C" void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
extern "C" void JUTSetReportConsole(JUTConsole*);
extern "C" JUTConsole* JUTGetReportConsole();
extern "C" void JUTSetWarningConsole(JUTConsole*);
extern "C" JUTConsole* JUTGetWarningConsole();
extern "C" void JUTReportConsole_f_va(const char*, va_list);
extern "C" void JUTReportConsole_f(const char*, ...);
extern "C" void JUTWarningConsole(const char* message);
extern "C" void JUTWarningConsole_f_va(const char*, va_list);
extern "C" void JUTWarningConsole_f(const char* message, ...);
extern "C" void JUTReportConsole(const char* message);
class JUTConsole : public JKRDisposer {
public:
enum EConsoleType {
@@ -46,7 +60,7 @@ public:
mFontSizeX = x;
mFontSizeY = y;
}
void setHeight(u32 height) {
void setHeight(unsigned int height) {
mHeight = height;
if (mHeight > mMaxLines) {
mHeight = mMaxLines;
@@ -67,7 +81,7 @@ public:
bool isVisible() const { return mVisible; }
void setVisible(bool visible) { mVisible = visible; }
u8 getLineAttr(int param_0) { return mBuf[(field_0x20 + 2) * param_0]; }
u8 getLineAttr(int param_0) const { return mBuf[(field_0x20 + 2) * param_0]; }
void setLineAttr(int param_0, u8 param_1) { mBuf[(field_0x20 + 2) * param_0] = param_1; }
u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0] + 1; }
int diffIndex(int param_0, int param_1) const {
@@ -89,6 +103,8 @@ public:
void scrollToLastLine() { scroll(mMaxLines); }
void scrollToFirstLine() { scroll(-mMaxLines); }
void print_f_va(const char* fmt, std::__tag_va_List* args) { JUTConsole_print_f_va_(this, fmt, args->list); }
public:
/* 0x18 */ JGadget::TLinkListNode mLinkNode;
@@ -126,7 +142,7 @@ public:
void drawDirect(bool) const;
void setDirectConsole(JUTConsole*);
JUTConsole* getDirectConsole() const { return mDirectConsole; }
JUTConsole* getDirectConsoel() const { return mDirectConsole; }
static JUTConsoleManager* getManager() { return sManager; }
@@ -145,16 +161,4 @@ private:
/* 0x10 */ JUTConsole* mDirectConsole;
}; // Size: 0x14
extern "C" void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
extern "C" void JUTSetReportConsole(JUTConsole*);
extern "C" JUTConsole* JUTGetReportConsole();
extern "C" void JUTSetWarningConsole(JUTConsole*);
extern "C" JUTConsole* JUTGetWarningConsole();
extern "C" void JUTReportConsole_f_va(const char*, va_list);
extern "C" void JUTReportConsole_f(const char*, ...);
extern "C" void JUTWarningConsole(const char* message);
extern "C" void JUTWarningConsole_f_va(const char*, va_list);
extern "C" void JUTWarningConsole_f(const char* message, ...);
extern "C" void JUTReportConsole(const char* message);
#endif /* JUTCONSOLE_H */
@@ -4,13 +4,6 @@
#include "JSystem/JUtility/TColor.h"
#include "stdarg.h"
namespace std {
// no idea what this is or why it is used instead of va_list
struct __tag_va_List {
va_list list;
};
}
class JUTDirectPrint {
private:
JUTDirectPrint();
+3 -3
View File
@@ -48,7 +48,7 @@ public:
class JUTExMapFile {
public:
JUTExMapFile(char* path) : mLink(this) { mPath = path; }
JUTExMapFile(const char* path) : mLink(this) { mPath = const_cast<char*>(path); }
public:
/* 0x00 */ char* mPath;
@@ -96,9 +96,9 @@ public:
JUTExternalFB* getFrameMemory() const { return mFrameMemory; }
void setTraceSuppress(u32 param_0) { mTraceSuppress = param_0; }
void setGamePad(JUTGamePad* gamePad) {
void enterPad(JUTGamePad* gamePad) {
mGamePad = gamePad;
mGamePadPort = JUTGamePad::Port_Unknown;
mGamePadPort = JUTGamePad::EPortInvalid;
}
static void setMapFile(const char* map) {
+25 -19
View File
@@ -38,18 +38,24 @@ struct JUTGamePadRecordBase {
struct JUTGamePad : public JKRDisposer {
public:
enum EStickMode {
STICK_MODE_1 = 1,
EStickMode1 = 1,
};
enum EWhichStick {
WS_MAIN_STICK,
WS_SUB_STICK,
EMainStick,
ESubStick,
};
enum EPadPort {
Port_Unknown = -1,
Port_1,
Port_2,
Port_3,
Port_4,
EPortInvalid = -1,
EPort1,
EPort2,
EPort3,
EPort4,
};
enum EClampMode {
EClampStick = 1,
};
JUTGamePad(JUTGamePad::EPadPort port);
@@ -73,6 +79,8 @@ public:
PADSetAnalogMode(mode);
}
// TODO: debug maps suggest isResetOccurred should do more than this, maybe the int* param is used for something?
static bool isResetOccurred(int*) { return C3ButtonReset::sResetOccurred; }
static void clearResetOccurred() { C3ButtonReset::sResetOccurred = false; }
static void setResetCallback(callbackFn callback, void* param_0) {
@@ -128,6 +136,8 @@ public:
static PADStatus & getPortStatus(EPadPort port) { return mPadStatus[port]; }
static void suppressPadReset(u32 val) { mSuppressPadReset = val; }
struct CButton {
CButton() { clear(); }
void clear();
@@ -144,11 +154,11 @@ public:
/* 0x10 */ f32 mAnalogLf;
/* 0x14 */ f32 mAnalogRf;
/* 0x18 */ u32 mRepeat;
/* 0x1C */ u32 field_0x1c;
/* 0x20 */ u32 field_0x20;
/* 0x24 */ u32 field_0x24;
/* 0x28 */ u32 field_0x28;
/* 0x2C */ u32 field_0x2c;
/* 0x1C */ u32 mRepeatCount;
/* 0x20 */ u32 mRepeatStart;
/* 0x24 */ u32 mRepeatMask;
/* 0x28 */ u32 mRepeatDelay;
/* 0x2C */ u32 mRepeatRate;
}; // Size: 0x30
struct C3ButtonReset {
@@ -223,10 +233,6 @@ public:
mRumble.startPatternedRumble(param_2, rumble, param_4);
}
// TODO:
void isResetOccurred(int*) {}
void suppressPadReset(u32) {}
/* 0x18 */ CButton mButton;
/* 0x48 */ CStick mMainStick;
/* 0x58 */ CStick mSubStick;
@@ -246,8 +252,8 @@ public:
static CButton mPadButton[4];
static CStick mPadMStick[4];
static CStick mPadSStick[4];
static EStickMode sStickMode;
static u32 sClampMode;
static EStickMode mStickMode;
static u32 mClampMode;
static u8 mPadAssign[4];
static u32 mSuppressPadReset;
static s32 sAnalogMode;
+4
View File
@@ -71,4 +71,8 @@ inline JUTVideo* JUTGetVideoManager() {
return JUTVideo::getManager();
}
inline void JUTDestroyVideoManager() {
JUTVideo::destroyManager();
}
#endif /* JUTVIDEO_H */
+2 -7
View File
@@ -273,7 +273,6 @@ public:
dDetect_c& getDetect() { return mDetect; }
dDemo_manager_c* getDemo() { return mDemo; }
camera_class* getCamera(int idx) { return mCameraInfo[idx].mpCamera; }
f32 getCamZoomForcus(int idx) { return mCameraInfo[idx].mCameraZoomForcus; }
dMagma_packet_c* getMagma() { return mpMagmaPacket; }
dGrass_packet_c* getGrass() { return mpGrassPacket; }
@@ -635,7 +634,7 @@ public:
JKRAramBlock* getPictureBoxData(int i) { return mPictureBoxData[i]; }
void setPictureBoxData(JKRAramBlock* aramBlock, int i) { mPictureBoxData[i] = aramBlock; }
bool isPictureFlag(u8 i) { return mPictureFlag & (u8)(1 << i); }
BOOL isPictureFlag(u8 i) { return (mPictureFlag & (u8)(1 << i)) ? TRUE : FALSE; }
void onPictureFlag(u8 i) { mPictureFlag |= (u8)(1 << i); }
void offPictureFlag(u8 i) { mPictureFlag &= ~(u8)(1 << i); }
u8 getPictureFormat() { return mPictureFormat; }
@@ -2242,10 +2241,6 @@ inline camera_process_class* dComIfGp_getCamera(int idx) {
return (camera_process_class*)g_dComIfG_gameInfo.play.getCamera(idx);
}
inline f32 dComIfGp_getCamZoomForcus(int idx) {
return g_dComIfG_gameInfo.play.getCamZoomForcus(idx);
}
inline const char* dComIfGp_getStartStageName() {
return g_dComIfG_gameInfo.play.getStartStageName();
}
@@ -3263,7 +3258,7 @@ inline void dComIfGp_setPictureBoxData(JKRAramBlock* aramBlock, int i) {
g_dComIfG_gameInfo.play.setPictureBoxData(aramBlock, i);
}
inline bool dComIfGp_isPictureFlag(u8 i) {
inline BOOL dComIfGp_isPictureFlag(u8 i) {
return g_dComIfG_gameInfo.play.isPictureFlag(i);
}
+2 -2
View File
@@ -15,8 +15,8 @@
#include "JSystem/J3DGraphAnimator/J3DJoint.h" // IWYU pragma: export
// Fixes weak .bss
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_bss_3569.h" // IWYU pragma: keep
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_bss_3569.h" // IWYU pragma: keep
// Fixes weak function ordering
#include "d/d_com_inf_game.h" // IWYU pragma: export
+1
View File
@@ -134,6 +134,7 @@ VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback);
VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback);
void VIInit();
void VIConfigure(GXRenderModeObj*);
void VIConfigurePan(u16 xOrg, u16 yOrg, u16 width, u16 height);
void VIFlush();
void* VIGetNextFrameBuffer();
void* VIGetCurrentFrameBuffer();
+2 -2
View File
@@ -59,7 +59,7 @@ public:
s32 checkspace();
void setCardState(s32);
bool isCardCommNone() { return mCommand != CARD_NO_COMMAND; }
BOOL isCardCommNone() { return mCommand == CARD_NO_COMMAND; }
u8 getNowSlot() { return mCardSlot; }
u8* getPictDataPtr() { return mPictDataPtr; }
u8* getPictWriteDataPtr() { return mPictDataWritePtr; }
@@ -98,7 +98,7 @@ static int mDoMemCd_main(void*);
extern mDoMemCd_Ctrl_c g_mDoMemCd_control;
inline bool mDoMemCd_isCardCommNone() {
inline BOOL mDoMemCd_isCardCommNone() {
return g_mDoMemCd_control.isCardCommNone();
}
+4
View File
@@ -20,6 +20,8 @@ public:
#if VERSION > VERSION_JPN
static void set3ButtonResetPort(int port) { mResetData->m3ButtonResetPort = port; }
static void off3ButtonReset() { mResetData->m3ButtonReset = 0; }
static int isResetPrepare() { return mResetData->mResetPrepare; }
static void onResetPrepare() { mResetData->mResetPrepare = 1; }
static void offResetPrepare() { mResetData->mResetPrepare = 0; }
static void offReset() {
mResetData->mReset = 0;
@@ -38,6 +40,8 @@ public:
#else
static void set3ButtonResetPort(int port) { m3ButtonResetPort = port; }
static void off3ButtonReset() { m3ButtonResetFlag = 0; }
static int isResetPrepare() { return mResetPrepare; }
static void onResetPrepare() { mResetPrepare = 1;}
static void offResetPrepare() { mResetPrepare = 0; }
static void offReset() {
mResetFlag = 0;
+45 -29
View File
@@ -1,12 +1,12 @@
#ifndef M_DO_GBA_COM_H
#define M_DO_GBA_COM_H
#include "dolphin/types.h"
#include "global.h"
class mDoGaC_DataManag_c {
public:
/* 0x0 */ u32 field_0x0;
/* 0x4 */ u8 field_0x4;
/* 0x0 */ void* mpData;
/* 0x4 */ u8 mStatus;
/* 0x5 */ u8 field_0x5;
};
@@ -54,19 +54,20 @@ public:
void mDoGaC_GbaRead();
void mDoGaC_ReadResult();
mDoGaC_agbCom_c() {}
~mDoGaC_agbCom_c() {}
u8 getEnable() { return field_0x0; }
void onEnable() { field_0x0 = 1; }
u8 getEnable() { return mEnable; }
void onEnable() { mEnable = 1; }
u8 getReConnect() { return mReConnect; }
u8 getPortNo() { return mPortNo; }
void setPortNo(u8 port) { mPortNo = port; }
u8 getDataStatus(u8 param_0) { return field_0x110[param_0].field_0x4; }
void getReConnect() {} // TODO
u8 getDataStatus(u8 param_0) { return mpDataManager[param_0].mStatus; }
/* 0x000 */ u8 field_0x0;
/* 0x000 */ u8 mEnable;
/* 0x001 */ u8 field_0x1;
/* 0x002 */ u8 field_0x2;
/* 0x003 */ u8 field_0x3;
/* 0x003 */ u8 mReConnect;
/* 0x004 */ u8 field_0x4;
/* 0x005 */ u8 field_0x5;
/* 0x006 */ u8 field_0x6;
@@ -76,34 +77,37 @@ public:
/* 0x00A */ u8 field_0xa;
/* 0x00B */ u8 field_0xb;
/* 0x00C */ mDoGaC_unk_data field_0xc[16];
/* 0x10C */ u8 field_0x10c;
/* 0x10C */ u8 mDataManagerCount;
/* 0x10D */ u8 mPortNo;
/* 0x10E */ u8 field_0x10e;
/* 0x10F */ u8 field_0x10F[0x110 - 0x10F];
/* 0x110 */ mDoGaC_DataManag_c* field_0x110;
/* 0x110 */ mDoGaC_DataManag_c* mpDataManager;
/* 0x114 */ u32 field_0x114;
/* 0x118 */ u32 field_0x118;
/* 0x11C */ u32 field_0x11C;
#if VERSION > VERSION_DEMO
/* 0x120 */ u32 field_0x120;
/* 0x124 */ u8 field_0x124[0x128 - 0x124];
/* 0x128 */ u8 field_0x128;
/* 0x129 */ u8 field_0x129[0x12C - 0x129];
union {
/* 0x12C */ u32 U32;
struct {
/* 0x12C */ u32 _12c_0 : 2;
/* 0x12C */ u32 _12c_2 : 15;
} U32bits;
struct {
/* 0x12C */ u16 _12c_0 : 2;
/* 0x12C */ u16 _12c_2 : 6;
} U8;
struct {
/* 0x12C */ u16 _12c;
/* 0x12E */ u16 _12e_0 : 1;
/* 0x12E */ u16 _12e_1 : 15;
} U16;
} field_0x12c;
#endif
struct {
u8 field_0x0;
union {
u32 U32;
struct {
u32 _12c_0 : 2;
u32 _12c_2 : 15;
} U32bits;
struct {
u8 _12c_0 : 2;
u8 _12c_2 : 6;
} U8;
struct {
u16 _12c;
u16 _12e_0 : 1;
u16 _12e_1 : 15;
} U16;
} field_0x4;
} field_0x128[1];
};
extern mDoGaC_agbCom_c g_mDoGaC_gbaCom;
@@ -111,6 +115,10 @@ extern mDoGaC_DataManag_c TestDataManager[16];
u32 BigLittleChange(u32);
inline void mDoGaC_Initial(mDoGaC_DataManag_c* i_dataMngP, u8 i_dataMngCount) {
g_mDoGaC_gbaCom.mDoGaC_Initial(i_dataMngP, i_dataMngCount);
}
inline int mDoGaC_GbaLink() {
return g_mDoGaC_gbaCom.mDoGaC_GbaLink();
}
@@ -167,6 +175,10 @@ inline u8 mDoGaC_getDataStatus(u8 param_0) {
return g_mDoGaC_gbaCom.getDataStatus(param_0);
}
inline void mDoGaC_Connect() {
g_mDoGaC_gbaCom.mDoGaC_Connect();
}
inline void mDoGaC_ConnectWake() {
g_mDoGaC_gbaCom.mDoGaC_ConnectWake();
}
@@ -175,4 +187,8 @@ inline void mDoGaC_ConnectSleep() {
g_mDoGaC_gbaCom.mDoGaC_ConnectSleep();
}
inline u8 mDoGaC_getReConnect() {
return g_mDoGaC_gbaCom.getReConnect();
}
#endif /* M_DO_GBA_COM_H */
+4 -4
View File
@@ -14,10 +14,10 @@ class mDoMch_render_c {
public:
static void setRenderModeObj(GXRenderModeObj* obj) { mRenderModeObj = obj; }
static void setProgressiveMode() { setRenderModeObj(&g_ntscZeldaProg); }
static u16 getEfbHeight() { return getRenderModeObj()->efbHeight; }
static u16 getFbWidth() { return getRenderModeObj()->fbWidth; }
static void setFbWidth(s16 v) { getRenderModeObj()->fbWidth = v; }
static void setEfbHeight(s16 v) { getRenderModeObj()->efbHeight = v; }
static u16 getEfbHeight() { return mRenderModeObj->efbHeight; }
static u16 getFbWidth() { return mRenderModeObj->fbWidth; }
static void setFbWidth(u16 v) { mRenderModeObj->fbWidth = v; }
static void setEfbHeight(u16 v) { mRenderModeObj->efbHeight = v; }
static GXRenderModeObj* getRenderModeObj() { return mRenderModeObj; }
+10
View File
@@ -0,0 +1,10 @@
#ifndef MACHINE_H
#define MACHINE_H
#if defined(__MWERKS__) && !defined(DECOMPCTX)
#include "m_Do/machine.mch"
#else
#include "m_Do/machine.pch"
#endif
#endif /* MACHINE_H */
+30
View File
@@ -0,0 +1,30 @@
#ifndef MACHINE_PCH
#define MACHINE_PCH
#ifdef DECOMPCTX
// Hack to mitigate fake mismatches when building from decompctx output
// (which doesn't support precompiled headers).
// When built without a PCH, these constants would end up .rodata instead of .data
// which causes a variety of knock-on effects in individual functions' assembly.
#include "weak_data.h" // IWYU pragma: export
#endif
// Fixes weak .data
#include "math.h" // IWYU pragma: export
#include "JSystem/J3DGraphBase/J3DMatBlock.h" // IWYU pragma: export
#include "JSystem/J3DGraphAnimator/J3DJoint.h" // IWYU pragma: export
// Fixes weak .bss
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_bss_3569.h" // IWYU pragma: keep
#include "SSystem/SComponent/c_lib.h" // IWYU pragma: export
#include "JSystem/JKernel/JKRHeap.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DOrthoGraph.h" // IWYU pragma: export
#include "m_Do/m_Do_audio.h" // IWYU pragma: export
#include "m_Do/m_Do_ext.h" // IWYU pragma: export
#include "m_Do/m_Do_mtx.h" // IWYU pragma: export
#include "m_Do/m_Do_hostIO.h" // IWYU pragma: export
#include "d/d_stage.h" // IWYU pragma: export
#endif /* MACHINE_PCH */