mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-05 18:28:11 -04:00
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:
+10
-5
@@ -391,6 +391,11 @@ config.precompiled_headers = [
|
||||
"mw_version": "GC/1.3.2",
|
||||
"cflags": ["-lang=c++", *cflags_rel],
|
||||
},
|
||||
{
|
||||
"source": "m_Do/machine.pch",
|
||||
"mw_version": "GC/1.3.2",
|
||||
"cflags": ["-lang=c++", *cflags_dolzel],
|
||||
},
|
||||
{
|
||||
"source": "JSystem/JSystem.pch",
|
||||
"mw_version": "GC/1.3.2",
|
||||
@@ -408,19 +413,19 @@ config.libs = [
|
||||
Object(Matching, "m_Do/m_Do_main.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_printf.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_audio.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_controller_pad.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_controller_pad.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_graphic.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_machine.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_machine.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_mtx.cpp"),
|
||||
Object(MatchingFor("D44J01"), "m_Do/m_Do_ext.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_lib.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_hostIO.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_Reset.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_Reset.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_dvd_thread.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_DVDError.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_MemCard.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_MemCardRWmng.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "m_Do/m_Do_gba_com.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_MemCardRWmng.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_gba_com.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_machine_exception.cpp"),
|
||||
],
|
||||
},
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -71,4 +71,8 @@ inline JUTVideo* JUTGetVideoManager() {
|
||||
return JUTVideo::getManager();
|
||||
}
|
||||
|
||||
inline void JUTDestroyVideoManager() {
|
||||
JUTVideo::destroyManager();
|
||||
}
|
||||
|
||||
#endif /* JUTVIDEO_H */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
+3
-4
@@ -182,8 +182,7 @@ static const char* unusedString3 = "\n";
|
||||
JKRArchive* DynamicModuleControl::mountCallback(void* param_0) {
|
||||
JKRExpHeap* heap = mDoExt_getArchiveHeap();
|
||||
sFileCache = JKRFileCache::mount("/rels", heap, NULL);
|
||||
sArchive = JKRArchive::mount("RELS.arc", JKRArchive::MOUNT_COMP, heap,
|
||||
JKRArchive::MOUNT_DIRECTION_HEAD);
|
||||
sArchive = JKRMountArchive("RELS.arc", JKRArchive::MOUNT_COMP, heap, JKRArchive::MOUNT_DIRECTION_HEAD);
|
||||
if (sArchive == NULL) {
|
||||
// "Mount failure, but if the archive isn't created, it was too slow %s\n"
|
||||
OSReport_Error("マウント失敗ですが単にアーカイブを作ってないだけなら遅いだけです %s\n",
|
||||
@@ -380,7 +379,7 @@ BOOL DynamicModuleControl::do_load_async() {
|
||||
bool DynamicModuleControl::do_unload() {
|
||||
if (mModule != NULL) {
|
||||
#if VERSION == VERSION_DEMO
|
||||
JKRFileLoader::removeResource(mModule, NULL);
|
||||
JKRRemoveResource(mModule, NULL);
|
||||
#else
|
||||
JKRFree(mModule);
|
||||
#endif
|
||||
@@ -497,7 +496,7 @@ error:
|
||||
}
|
||||
if (mModule != NULL) {
|
||||
#if VERSION == VERSION_DEMO
|
||||
JKRFileLoader::removeResource(mModule, NULL);
|
||||
JKRRemoveResource(mModule, NULL);
|
||||
#else
|
||||
JKRHeap::free(mModule, NULL);
|
||||
#endif
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
|
||||
#include "math.h"
|
||||
|
||||
#include "weak_bss_3569.h" // IWYU pragma: keep
|
||||
#include "weak_bss_3569.h" // IWYU pragma: keep
|
||||
|
||||
static const f32 Deg2Rad = (M_PI / 180.0f); // 0.017453292f
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ void JAIBasic::initArchive() {
|
||||
char buffer[0x60];
|
||||
if (!JAISequenceMgr::arcPointer) {
|
||||
JAISequenceMgr::getArchiveName(buffer);
|
||||
JAISequenceMgr::arcPointer = JKRArchive::mount(buffer, JKRArchive::MOUNT_DVD, msCurrentHeap, JKRArchive::MOUNT_DIRECTION_HEAD);
|
||||
JAISequenceMgr::arcPointer = JKRMountArchive(buffer, JKRArchive::MOUNT_DVD, msCurrentHeap, JKRArchive::MOUNT_DIRECTION_HEAD);
|
||||
JUT_ASSERT_MSG(206, JAISequenceMgr::arcPointer, "JAIBasic::initArchive シーケンスアーカイブのマウントに失敗しました。\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ s32 JFWSystem::CSetUpParam::streamPriority = 8;
|
||||
s32 JFWSystem::CSetUpParam::decompPriority = 7;
|
||||
s32 JFWSystem::CSetUpParam::aPiecePriority = 6;
|
||||
ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)JUTResFONT_Ascfont_fix12;
|
||||
GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf;
|
||||
const GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf;
|
||||
u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24F8;
|
||||
|
||||
JKRExpHeap* JFWSystem::rootHeap = NULL;
|
||||
|
||||
@@ -17,7 +17,7 @@ JKRAramStream* JKRAramStream::sAramStreamObject;
|
||||
JKRAramStream* JKRAramStream::create(s32 priority) {
|
||||
if (!sAramStreamObject) {
|
||||
sAramStreamObject = new (JKRGetSystemHeap(), 0) JKRAramStream(priority);
|
||||
setTransBuffer(NULL, 0, NULL);
|
||||
JKRResetAramTransferBuffer();
|
||||
}
|
||||
|
||||
return sAramStreamObject;
|
||||
|
||||
@@ -67,7 +67,8 @@ JUTException::JUTException(JUTDirectPrint* directPrint) : JKRThread(0x4000, 0x10
|
||||
sPreUserCallback = NULL;
|
||||
sPostUserCallback = NULL;
|
||||
|
||||
setGamePad(NULL);
|
||||
mGamePad = NULL;
|
||||
mGamePadPort = JUTGamePad::EPortInvalid;
|
||||
|
||||
this->mPrintWaitTime0 = 10;
|
||||
this->mPrintWaitTime1 = 10;
|
||||
@@ -553,10 +554,10 @@ bool JUTException::readPad(u32* out_trigger, u32* out_button) {
|
||||
} while (ms < 0x32);
|
||||
|
||||
if (mGamePad == (JUTGamePad*)0xffffffff) {
|
||||
JUTGamePad gamePad0(JUTGamePad::Port_1);
|
||||
JUTGamePad gamePad1(JUTGamePad::Port_2);
|
||||
JUTGamePad gamePad2(JUTGamePad::Port_3);
|
||||
JUTGamePad gamePad3(JUTGamePad::Port_4);
|
||||
JUTGamePad gamePad0(JUTGamePad::EPort1);
|
||||
JUTGamePad gamePad1(JUTGamePad::EPort2);
|
||||
JUTGamePad gamePad2(JUTGamePad::EPort3);
|
||||
JUTGamePad gamePad3(JUTGamePad::EPort4);
|
||||
JUTGamePad::read();
|
||||
|
||||
c3bcnt[0] =
|
||||
|
||||
@@ -58,8 +58,8 @@ PADStatus JUTGamePad::mPadStatus[4];
|
||||
JUTGamePad::CButton JUTGamePad::mPadButton[4];
|
||||
JUTGamePad::CStick JUTGamePad::mPadMStick[4];
|
||||
JUTGamePad::CStick JUTGamePad::mPadSStick[4];
|
||||
JUTGamePad::EStickMode JUTGamePad::sStickMode = STICK_MODE_1;
|
||||
u32 JUTGamePad::sClampMode = 0x00000001;
|
||||
JUTGamePad::EStickMode JUTGamePad::mStickMode = EStickMode1;
|
||||
u32 JUTGamePad::mClampMode = EClampStick;
|
||||
u32 JUTGamePad::sRumbleSupported;
|
||||
|
||||
/* 802C3980-802C3C14 .text read__10JUTGamePadFv */
|
||||
@@ -72,12 +72,12 @@ u32 JUTGamePad::read() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
u32 mask_tmp = 0x80000000 >> i;
|
||||
if (mPadStatus[i].err == 0) {
|
||||
u32 local_2c = mPadMStick[i].update(mPadStatus[i].stickX, mPadStatus[i].stickY, sStickMode, WS_MAIN_STICK) << 0x18;
|
||||
local_2c |= (mPadSStick[i].update(mPadStatus[i].substickX, mPadStatus[i].substickY, sStickMode, WS_SUB_STICK) << 0x10);
|
||||
u32 local_2c = mPadMStick[i].update(mPadStatus[i].stickX, mPadStatus[i].stickY, mStickMode, EMainStick) << 0x18;
|
||||
local_2c |= (mPadSStick[i].update(mPadStatus[i].substickX, mPadStatus[i].substickY, mStickMode, ESubStick) << 0x10);
|
||||
mPadButton[i].update(&mPadStatus[i], local_2c);
|
||||
} else if (mPadStatus[i].err == -1) {
|
||||
mPadMStick[i].update(0, 0, sStickMode, WS_MAIN_STICK);
|
||||
mPadSStick[i].update(0, 0, sStickMode, WS_SUB_STICK);
|
||||
mPadMStick[i].update(0, 0, mStickMode, EMainStick);
|
||||
mPadSStick[i].update(0, 0, mStickMode, ESubStick);
|
||||
mPadButton[i].update(NULL, 0);
|
||||
|
||||
if (!(mSuppressPadReset & mask_tmp)) {
|
||||
@@ -97,11 +97,11 @@ u32 JUTGamePad::read() {
|
||||
if (pad->getPadReplay()) {
|
||||
PADStatus status;
|
||||
pad->getPadReplay()->unk1(&status);
|
||||
u32 m_stick = pad->mMainStick.update(status.stickX, status.stickY, sStickMode,
|
||||
WS_MAIN_STICK)
|
||||
u32 m_stick = pad->mMainStick.update(status.stickX, status.stickY, mStickMode,
|
||||
EMainStick)
|
||||
<< 0x18;
|
||||
u32 s_stick = pad->mSubStick.update(status.substickX, status.substickY, sStickMode,
|
||||
WS_SUB_STICK)
|
||||
u32 s_stick = pad->mSubStick.update(status.substickX, status.substickY, mStickMode,
|
||||
ESubStick)
|
||||
<< 0x10;
|
||||
m_stick |= s_stick;
|
||||
pad->mButton.update(&status, m_stick);
|
||||
@@ -134,7 +134,7 @@ void JUTGamePad::assign() {
|
||||
if (mPadStatus[i].err == 0 && mPadAssign[i] == 0) {
|
||||
mPortNum = i;
|
||||
mPadAssign[i] = 1;
|
||||
mPadButton[i].setRepeat(mButton.field_0x24, mButton.field_0x28, mButton.field_0x2c);
|
||||
mPadButton[i].setRepeat(mButton.mRepeatMask, mButton.mRepeatDelay, mButton.mRepeatRate);
|
||||
mRumble.clear(this);
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ u8 JUTGamePad::CRumble::mStatus[4];
|
||||
u32 JUTGamePad::CRumble::mEnabled;
|
||||
callbackFn JUTGamePad::C3ButtonReset::sCallback;
|
||||
void* JUTGamePad::C3ButtonReset::sCallbackArg;
|
||||
OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)((OS_BUS_CLOCK / 4) / 60) * 30;
|
||||
OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)(OS_TIMER_CLOCK / 60) * 30;
|
||||
bool JUTGamePad::C3ButtonReset::sResetSwitchPushing;
|
||||
bool JUTGamePad::C3ButtonReset::sResetOccurred;
|
||||
s32 JUTGamePad::C3ButtonReset::sResetOccurredPort;
|
||||
@@ -229,11 +229,11 @@ void JUTGamePad::CButton::clear() {
|
||||
mAnalogB = 0;
|
||||
mAnalogL = 0;
|
||||
mAnalogR = 0;
|
||||
field_0x1c = 0;
|
||||
field_0x20 = 0;
|
||||
field_0x24 = 0;
|
||||
field_0x28 = 0;
|
||||
field_0x2c = 0;
|
||||
mRepeatCount = 0;
|
||||
mRepeatStart = 0;
|
||||
mRepeatMask = 0;
|
||||
mRepeatDelay = 0;
|
||||
mRepeatRate = 0;
|
||||
}
|
||||
|
||||
/* 802C3FF8-802C4188 .text update__Q210JUTGamePad7CButtonFPC9PADStatusUl */
|
||||
@@ -248,32 +248,32 @@ void JUTGamePad::CButton::update(const PADStatus* padStatus, u32 stickStatus) {
|
||||
buttons = stickStatus | buttons;
|
||||
mRepeat = 0;
|
||||
|
||||
if (field_0x28 != 0 && field_0x24 != 0) {
|
||||
u32 repeatButton = buttons & field_0x24;
|
||||
if (mRepeatDelay != 0 && mRepeatMask != 0) {
|
||||
u32 repeatButton = buttons & mRepeatMask;
|
||||
mRepeat = 0;
|
||||
|
||||
if (repeatButton == 0) {
|
||||
field_0x20 = 0;
|
||||
field_0x1c = 0;
|
||||
} else if (field_0x20 == repeatButton) {
|
||||
field_0x1c++;
|
||||
mRepeatStart = 0;
|
||||
mRepeatCount = 0;
|
||||
} else if (mRepeatStart == repeatButton) {
|
||||
mRepeatCount++;
|
||||
|
||||
if (field_0x1c == field_0x28 ||
|
||||
(field_0x1c > field_0x28 && (field_0x1c - field_0x28) % field_0x2c == 0))
|
||||
if (mRepeatCount == mRepeatDelay ||
|
||||
(mRepeatCount > mRepeatDelay && (mRepeatCount - mRepeatDelay) % mRepeatRate == 0))
|
||||
{
|
||||
mRepeat = repeatButton;
|
||||
}
|
||||
} else {
|
||||
mRepeat = repeatButton & (field_0x20 ^ 0xFFFFFFFF);
|
||||
field_0x20 = repeatButton;
|
||||
field_0x1c = 0;
|
||||
mRepeat = repeatButton & (mRepeatStart ^ 0xFFFFFFFF);
|
||||
mRepeatStart = repeatButton;
|
||||
mRepeatCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mTrigger = buttons & (buttons ^ mButton);
|
||||
mRelease = mButton & (buttons ^ mButton);
|
||||
mButton = buttons;
|
||||
mRepeat |= (field_0x24 ^ 0xFFFFFFFF) & mTrigger;
|
||||
mRepeat |= (mRepeatMask ^ 0xFFFFFFFF) & mTrigger;
|
||||
|
||||
if (padStatus != NULL) {
|
||||
mAnalogA = padStatus->analogA;
|
||||
@@ -301,7 +301,7 @@ void JUTGamePad::CStick::clear() {
|
||||
|
||||
/* 802C41A4-802C4378 .text update__Q210JUTGamePad6CStickFScScQ210JUTGamePad10EStickModeQ210JUTGamePad11EWhichStick */
|
||||
u32 JUTGamePad::CStick::update(s8 x_val, s8 y_val, EStickMode mode, EWhichStick stick) {
|
||||
s32 clamp = stick == WS_MAIN_STICK ? 54 : 42;
|
||||
s32 clamp = stick == EMainStick ? 54 : 42;
|
||||
|
||||
field_0xe = x_val;
|
||||
field_0xf = y_val;
|
||||
@@ -310,7 +310,7 @@ u32 JUTGamePad::CStick::update(s8 x_val, s8 y_val, EStickMode mode, EWhichStick
|
||||
mValue = std::sqrtf((mPosX * mPosX) + (mPosY * mPosY));
|
||||
|
||||
if (mValue > 1.0f) {
|
||||
if (mode == STICK_MODE_1) {
|
||||
if (mode == EStickMode1) {
|
||||
mPosX /= mValue;
|
||||
mPosY /= mValue;
|
||||
}
|
||||
@@ -329,7 +329,7 @@ u32 JUTGamePad::CStick::update(s8 x_val, s8 y_val, EStickMode mode, EWhichStick
|
||||
}
|
||||
}
|
||||
|
||||
u32 buttonType = stick == WS_MAIN_STICK ? 0x18 : 0x10;
|
||||
u32 buttonType = stick == EMainStick ? 0x18 : 0x10;
|
||||
return getButton();
|
||||
}
|
||||
|
||||
@@ -499,12 +499,12 @@ void JUTGamePad::CRumble::setEnabled(u32 mask) {
|
||||
}
|
||||
|
||||
/* 802C489C-802C48B8 .text setRepeat__Q210JUTGamePad7CButtonFUlUlUl */
|
||||
void JUTGamePad::CButton::setRepeat(u32 param_0, u32 param_1, u32 param_2) {
|
||||
field_0x20 = 0;
|
||||
field_0x1c = 0;
|
||||
field_0x24 = param_0;
|
||||
field_0x28 = param_1;
|
||||
field_0x2c = param_2;
|
||||
void JUTGamePad::CButton::setRepeat(u32 mask, u32 delay, u32 rate) {
|
||||
mRepeatStart = 0;
|
||||
mRepeatCount = 0;
|
||||
mRepeatMask = mask;
|
||||
mRepeatDelay = delay;
|
||||
mRepeatRate = rate;
|
||||
}
|
||||
|
||||
/* 802C48B8-802C4940 .text recalibrate__10JUTGamePadFUl */
|
||||
|
||||
@@ -3,4 +3,16 @@
|
||||
|
||||
#include "__va_arg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace std {
|
||||
#endif
|
||||
|
||||
struct __tag_va_List {
|
||||
va_list list;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MSL_COMMON_STDARG_H */
|
||||
|
||||
@@ -1822,10 +1822,10 @@ static cPhs_State daAgb_Create(fopAc_ac_c* i_this) {
|
||||
a_this->mAcch.SetGrndNone();
|
||||
a_this->mAcchCir.SetWall(171.0f, 40.0f);
|
||||
|
||||
TestDataManager[4].field_0x0 = (u32)&a_this->mGbaFlg;
|
||||
TestDataManager[8].field_0x0 = (u32)&a_this->mSwitch;
|
||||
TestDataManager[6].field_0x0 = (u32)&a_this->mItem;
|
||||
TestDataManager[12].field_0x0 = (u32)&a_this->mShop;
|
||||
TestDataManager[4].mpData = &a_this->mGbaFlg;
|
||||
TestDataManager[8].mpData = &a_this->mSwitch;
|
||||
TestDataManager[6].mpData = &a_this->mItem;
|
||||
TestDataManager[12].mpData = &a_this->mShop;
|
||||
|
||||
a_this->field_0x670 = false;
|
||||
a_this->field_0x65c = 0;
|
||||
|
||||
+1
-1
@@ -1508,7 +1508,7 @@ void dMap_c::mapAGBSendMapMain(f32 param_1, f32 param_2) {
|
||||
if (mAGBMapSendStatus > 2 && mAGBMapSendStopFlg) {
|
||||
mAGBMapSendStatus = 0;
|
||||
}
|
||||
if (mAGBMapSendStatus == 0 && g_mDoGaC_gbaCom.field_0x3) {
|
||||
if (mAGBMapSendStatus == 0 && mDoGaC_getReConnect()) {
|
||||
agbMapNoSetCall();
|
||||
mAGBMapSendStatus = 0;
|
||||
mapAGBSendStatInit();
|
||||
|
||||
+2
-2
@@ -2183,9 +2183,9 @@ static BOOL dMsg_Delete(sub_mesg_class* i_Msg) {
|
||||
|
||||
dMesg_finalize();
|
||||
if (header) {
|
||||
JKRFileLoader::removeResource(header, NULL);
|
||||
JKRRemoveResource(header, NULL);
|
||||
} if (header2) {
|
||||
JKRFileLoader::removeResource(header2, NULL);
|
||||
JKRRemoveResource(header2, NULL);
|
||||
}
|
||||
if (oParse) {
|
||||
delete oParse;
|
||||
|
||||
+1
-1
@@ -770,7 +770,7 @@ int dMsg2_closeProc(sub_msg2_class* i_Msg) {
|
||||
dMsg2_outFontHide(i_Msg, i);
|
||||
}
|
||||
|
||||
JKRFileLoader::removeResource(i_Msg->head_p, NULL);
|
||||
JKRRemoveResource(i_Msg->head_p, NULL);
|
||||
i_Msg->msg.mStatus = fopMsgStts_BOX_CLOSED_e;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1083,7 +1083,7 @@ void dMsg_frame_close(sub_msg_class* i_Msg) {
|
||||
i_Msg->m1100++;
|
||||
if (i_Msg->m1100 == 10) {
|
||||
fopMsgM_setNowAlphaZero(&i_Msg->m049C);
|
||||
JKRFileLoader::removeResource(i_Msg->head_p, NULL);
|
||||
JKRRemoveResource(i_Msg->head_p, NULL);
|
||||
i_Msg->mStatus = fopMsgStts_BOX_CLOSED_e;
|
||||
i_Msg->m049C.pane->hide();
|
||||
} else {
|
||||
@@ -2258,7 +2258,7 @@ s32 dMsg_continueProc(sub_msg_class* i_Msg) {
|
||||
) {
|
||||
i_Msg->mMsgDataProc.setSelectFlagOff();
|
||||
i_Msg->m1100 = 0;
|
||||
JKRFileLoader::removeResource(i_Msg->head_p, NULL);
|
||||
JKRRemoveResource(i_Msg->head_p, NULL);
|
||||
if (i_Msg->mMesgEntry.mTextboxType != 5 && i_Msg->mMesgEntry.mTextboxType != 0xe) {
|
||||
dMsg_arrowInit(i_Msg);
|
||||
}
|
||||
|
||||
@@ -1649,7 +1649,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) {
|
||||
mMsgIconDrawState = -1;
|
||||
|
||||
if (head_p != NULL) {
|
||||
JKRFileLoader::removeResource(head_p, NULL);
|
||||
JKRRemoveResource(head_p, NULL);
|
||||
head_p = NULL;
|
||||
}
|
||||
|
||||
@@ -2267,7 +2267,7 @@ void dJle_Pb_c::draw() {
|
||||
/* 8022B9E8-8022BB3C .text _delete__9dJle_Pb_cFP10JKRExpHeap */
|
||||
void dJle_Pb_c::_delete(JKRExpHeap* i_heap) {
|
||||
if (head_p != NULL) {
|
||||
JKRFileLoader::removeResource(head_p, NULL);
|
||||
JKRRemoveResource(head_p, NULL);
|
||||
}
|
||||
|
||||
if (mDoGph_getCaptureStep()) {
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ int dRes_info_c::loadResource() {
|
||||
for (i = 0; i < ARRAY_SIZE(l_readResType); i++, pResType++) {
|
||||
JKRFileFinder * pArcFinder = mpArchive->getFirstResource(*pResType);
|
||||
|
||||
for (; pArcFinder->isAvailable(); pArcFinder->findNextFile()) {
|
||||
for (; JKRIsFileFinderAvailable(pArcFinder); pArcFinder->findNextFile()) {
|
||||
u32 resType;
|
||||
void * pRes = JKRArchive::getGlbResource(*pResType, pArcFinder->mEntryName, mpArchive);
|
||||
if (pRes == NULL) {
|
||||
|
||||
+4
-4
@@ -929,7 +929,7 @@ BOOL dScp_outnowProc(sub_scp_class* i_Scp) {
|
||||
BOOL dScp_continueProc(sub_scp_class* i_Scp) {
|
||||
if (CPad_CHECK_TRIG_A(0) || CPad_CHECK_TRIG_B(0) || i_Scp->mMesgDataProc.getSelectFlag() != fopMsgM_msgDataProc_c::Select_OFF) {
|
||||
i_Scp->mMesgDataProc.setSelectFlagOff();
|
||||
JKRFileLoader::removeResource(i_Scp->head_p, NULL);
|
||||
JKRRemoveResource(i_Scp->head_p, NULL);
|
||||
dScp_talkBeforeProc(i_Scp);
|
||||
mDoAud_seStart(JA_SE_TALK_NEXT, NULL);
|
||||
} else {
|
||||
@@ -941,7 +941,7 @@ BOOL dScp_continueProc(sub_scp_class* i_Scp) {
|
||||
|
||||
/* 8023A354-8023A3C0 .text dScp_forceContinueProc__FP13sub_scp_class */
|
||||
BOOL dScp_forceContinueProc(sub_scp_class* i_Scp) {
|
||||
JKRFileLoader::removeResource(i_Scp->head_p, NULL);
|
||||
JKRRemoveResource(i_Scp->head_p, NULL);
|
||||
dScp_talkBeforeProc(i_Scp);
|
||||
mDoAud_seStart(JA_SE_TALK_NEXT, NULL);
|
||||
return TRUE;
|
||||
@@ -1189,7 +1189,7 @@ void dScp_closeProc(sub_scp_class* i_Scp) {
|
||||
} else {
|
||||
dScp_wipeMove(i_Scp, 3.f);
|
||||
dScp_scopeAlphaZero(i_Scp);
|
||||
JKRFileLoader::removeResource(i_Scp->head_p, NULL);
|
||||
JKRRemoveResource(i_Scp->head_p, NULL);
|
||||
i_Scp->mStatus = fopMsgStts_BOX_CLOSED_e;
|
||||
dComIfGp_setMesgStatus(fopMsgStts_BOX_CLOSED_e);
|
||||
}
|
||||
@@ -1206,7 +1206,7 @@ void dScp_closeDemoProc(sub_scp_class* i_Scp) {
|
||||
dScp_wipeMoveDemo(i_Scp, wipe_value, true);
|
||||
} else {
|
||||
dScp_wipeMoveDemo(i_Scp, 3.0f, true);
|
||||
JKRFileLoader::removeResource(i_Scp->head_p, NULL);
|
||||
JKRRemoveResource(i_Scp->head_p, NULL);
|
||||
i_Scp->mStatus = fopMsgStts_BOX_CLOSED_e;
|
||||
i_Scp->mStatus = fopMsgStts_BOX_CLOSED_e; // intentionally duplicated store (matches original)
|
||||
dComIfGp_setMesgStatus(fopMsgStts_BOX_CLOSED_e);
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
#include "weak_bss_3569.h" // IWYU pragma: keep
|
||||
#include "weak_bss_3569.h" // IWYU pragma: keep
|
||||
|
||||
int (dSnap_packet::*dSnap_packet::m_judge_tbl[])() = {
|
||||
NULL,
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "dolphin/dvd/dvdlow.h"
|
||||
#include "dolphin/dvd/dvdqueue.h"
|
||||
#include "dolphin/dvd/dvdFatal.h"
|
||||
#include "dolphin/dvd/fstload.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include <string.h>
|
||||
|
||||
const char* __DVDVersion = "<< Dolphin SDK - DVD\trelease build: Sep 5 2002 05:34:06 (0x2301) >>";
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ fpc_ProcID fopMsgM_messageTypeSelect(fopAc_ac_c* i_actor, cXyz* i_pos, u32* i_ms
|
||||
pcId = fopMsgM_create(fpcNm_MSG_e, i_actor, i_pos, i_msgNo, param_4, NULL);
|
||||
}
|
||||
|
||||
JKRFileLoader::removeResource(header, NULL);
|
||||
JKRRemoveResource(header, NULL);
|
||||
}
|
||||
|
||||
return pcId;
|
||||
@@ -503,7 +503,7 @@ u32 fopMsgM_searchMessageNumber(u32 i_msgNo) {
|
||||
return i;
|
||||
}
|
||||
|
||||
JKRFileLoader::removeResource(header, NULL);
|
||||
JKRRemoveResource(header, NULL);
|
||||
}
|
||||
|
||||
return i_msgNo;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Translation Unit: m_Do_DVDError.cpp
|
||||
//
|
||||
|
||||
// PCH not used here? Messes up .bss
|
||||
// #include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_DVDError.h"
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_MemCard.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_MemCard.h"
|
||||
#include "m_Do/m_Do_MemCardRWmng.h"
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_MemCardRWmng.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_MemCardRWmng.h"
|
||||
#include "m_Do/m_Do_MemCard.h"
|
||||
#include "m_Do/m_Do_dvd_thread.h"
|
||||
@@ -84,7 +85,7 @@ s32 mDoMemCdRWm_Store(CARDFileInfo* card, void* data, u32 size) {
|
||||
} else {
|
||||
slot = dComIfGs_getDataNum() * 3 + 3;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (dComIfGp_isPictureFlag(i)) {
|
||||
if (dComIfGp_isPictureFlag(i) != FALSE) {
|
||||
memset(sTmpBuf, 0, sizeof(card_pictdata));
|
||||
JKRAramToMainRam(dComIfGp_getPictureBoxData(i), sTmpBuf, sizeof(card_pictdata));
|
||||
ret = CARDWrite(card, sTmpBuf, sizeof(card_pictdata), (slot + i) * sizeof(card_pictdata));
|
||||
@@ -237,7 +238,7 @@ void mDoMemCdRWm_BuildHeader(mDoMemCdRWm_HeaderData* header) {
|
||||
ResTIMG* icon = (ResTIMG*)arc->getResource("ipl_icon1.bti");
|
||||
memcpy(header->banner, ((char*)banner) + banner->imageOffset, 0xc00 + banner->numColors * 2);
|
||||
memcpy(header->icon, ((char*)icon) + icon->imageOffset, 0x400 + icon->numColors * 2);
|
||||
arc->unmount();
|
||||
JKRUnmountArchive(arc);
|
||||
delete cmd;
|
||||
}
|
||||
|
||||
|
||||
+40
-23
@@ -3,12 +3,14 @@
|
||||
* Game Reset Management
|
||||
*/
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "JSystem/JUtility/JUTXfb.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "m_Do/m_Do_DVDError.h"
|
||||
#include "m_Do/m_Do_MemCard.h"
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
|
||||
/* 80017D40-80017D44 .text my_OSCancelAlarmAll__Fv */
|
||||
@@ -16,7 +18,7 @@ static void my_OSCancelAlarmAll() {}
|
||||
|
||||
/* 80017D44-80017D7C .text destroyVideo__Fv */
|
||||
void destroyVideo() {
|
||||
JUTVideo::destroyManager();
|
||||
JUTDestroyVideoManager();
|
||||
GXSetDrawDoneCallback(NULL);
|
||||
VISetBlack(1);
|
||||
VIFlush();
|
||||
@@ -42,6 +44,10 @@ void mDoRst_reset(int param_0, u32 param_1, int param_2) {
|
||||
JUTXfb::getManager()->clearIndex();
|
||||
mDoDvdErr_ThdCleanup();
|
||||
JUTGamePad::clearForReset();
|
||||
#if VERSION == VERSION_DEMO
|
||||
while (!mDoMemCd_isCardCommNone()) {
|
||||
}
|
||||
#endif
|
||||
mDoAud_zelAudio_c::offInitFlag();
|
||||
|
||||
#if VERSION > VERSION_JPN
|
||||
@@ -69,34 +75,45 @@ void mDoRst_reset(int param_0, u32 param_1, int param_2) {
|
||||
#endif
|
||||
OSResetSystem(param_0, param_1, param_2);
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
do {
|
||||
VIWaitForRetrace();
|
||||
} while (true);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 80017E40-80017EF0 .text mDoRst_resetCallBack__FiPv */
|
||||
void mDoRst_resetCallBack(int port, void*) {
|
||||
if (!mDoRst::isReset()) {
|
||||
if (port == -1) {
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
} else {
|
||||
if (mDoRst::is3ButtonReset()) {
|
||||
JUTGamePad::C3ButtonReset::sResetOccurred = false;
|
||||
JUTGamePad::C3ButtonReset::sCallback = mDoRst_resetCallBack;
|
||||
JUTGamePad::C3ButtonReset::sCallbackArg = NULL;
|
||||
return;
|
||||
}
|
||||
mDoRst::on3ButtonReset();
|
||||
mDoRst::set3ButtonResetPort(port);
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
}
|
||||
#if VERSION > VERSION_JPN
|
||||
if (DVDCheckDisk() == 0) {
|
||||
mDoRst_reset(1, 0x80000000, 0);
|
||||
}
|
||||
#endif
|
||||
mDoRst::onReset();
|
||||
if (mDoRst::isReset()) {
|
||||
return;
|
||||
}
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (mDoRst::isResetPrepare()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (port == -1) {
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
} else {
|
||||
if (mDoRst::is3ButtonReset()) {
|
||||
JUTGamePad::clearResetOccurred();
|
||||
JUTGamePad::setResetCallback(mDoRst_resetCallBack, NULL);
|
||||
return;
|
||||
}
|
||||
mDoRst::on3ButtonReset();
|
||||
mDoRst::set3ButtonResetPort(port);
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
}
|
||||
#if VERSION > VERSION_JPN
|
||||
if (DVDCheckDisk() == 0) {
|
||||
mDoRst_reset(1, 0x80000000, 0);
|
||||
}
|
||||
#endif
|
||||
#if VERSION == VERSION_DEMO
|
||||
mDoRst::onResetPrepare();
|
||||
#else
|
||||
mDoRst::onReset();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Translation Unit: m_Do_audio.cpp
|
||||
//
|
||||
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
#include "JSystem/JAudio/JAIGlobalParameter.h"
|
||||
#include "JSystem/JAudio/JAISequenceMgr.h"
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
// Translation Unit: m_Do_controller_pad.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "JSystem/JUtility/JUTGba.h"
|
||||
#include "SSystem/SComponent/c_lib.h"
|
||||
#include "f_ap/f_ap_game.h"
|
||||
#include "m_Do/m_Do_MemCard.h"
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "m_Do/m_Do_gba_com.h"
|
||||
#include "m_Do/m_Do_main.h"
|
||||
@@ -64,13 +66,27 @@ static s32 mDoCPd_Convert(interface_of_controller_pad* pInterface, JUTGamePad* p
|
||||
int mDoCPd_Read() {
|
||||
JUTGamePad::read();
|
||||
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (!mDoRst::isReset()) {
|
||||
if (mDoRst::isResetPrepare()) {
|
||||
if (mDoMemCd_isCardCommNone()) {
|
||||
mDoRst::onReset();
|
||||
}
|
||||
} else if (mDoRst::is3ButtonReset()) {
|
||||
JUTGamePad* pad = JUTGamePad::getGamePad(mDoRst::get3ButtonResetPort());
|
||||
if (!pad->isPushing3ButtonReset()) {
|
||||
mDoRst::off3ButtonReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (!mDoRst::isReset() && mDoRst::is3ButtonReset()) {
|
||||
JUTGamePad* pad = JUTGamePad::getGamePad(mDoRst::get3ButtonResetPort());
|
||||
|
||||
if (!pad->isPushing3ButtonReset()) {
|
||||
mDoRst::off3ButtonReset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
JUTGamePad** pad = g_mDoCPd_gamePad;
|
||||
interface_of_controller_pad* interface = g_mDoCPd_cpadInfo;
|
||||
@@ -115,25 +131,30 @@ int mDoCPd_Read() {
|
||||
}
|
||||
}
|
||||
|
||||
g_mDoGaC_gbaCom.mDoGaC_Connect();
|
||||
mDoGaC_Connect();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 80007A70-80007BBC .text mDoCPd_Create__Fv */
|
||||
int mDoCPd_Create() {
|
||||
JUTGamePad::mSuppressPadReset = 1;
|
||||
JUTGamePad::suppressPadReset(1);
|
||||
|
||||
JUTGamePad* pad = new JUTGamePad(JUTGamePad::Port_1);
|
||||
JUTGamePad* pad = new JUTGamePad(JUTGamePad::EPort1);
|
||||
g_mDoCPd_gamePad[0] = pad;
|
||||
g_mDoCPd_gamePad[1] = NULL;
|
||||
|
||||
#if VERSION == VERSION_DEMO
|
||||
g_mDoCPd_gamePad[2] = new JUTGamePad(JUTGamePad::EPort3);
|
||||
g_mDoCPd_gamePad[3] = new JUTGamePad(JUTGamePad::EPort4);
|
||||
#else
|
||||
if (mDoMain::developmentMode) {
|
||||
g_mDoCPd_gamePad[2] = new JUTGamePad(JUTGamePad::Port_3);
|
||||
g_mDoCPd_gamePad[3] = new JUTGamePad(JUTGamePad::Port_4);
|
||||
g_mDoCPd_gamePad[2] = new JUTGamePad(JUTGamePad::EPort3);
|
||||
g_mDoCPd_gamePad[3] = new JUTGamePad(JUTGamePad::EPort4);
|
||||
} else {
|
||||
g_mDoCPd_gamePad[2] = NULL;
|
||||
g_mDoCPd_gamePad[3] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
JUTGamePad::setAnalogMode(3);
|
||||
|
||||
@@ -148,7 +169,7 @@ int mDoCPd_Create() {
|
||||
#endif
|
||||
|
||||
JUTGba::create();
|
||||
g_mDoGaC_gbaCom.mDoGaC_Initial(TestDataManager, 16);
|
||||
mDoGaC_Initial(TestDataManager, ARRAY_SIZE(TestDataManager));
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
g_mDoCPd_cpadInfo[i].mHoldLockL = g_mDoCPd_cpadInfo[i].mTrigLockL = false;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_dvd_thread.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_dvd_thread.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_printf.h"
|
||||
@@ -13,7 +14,6 @@
|
||||
#include "SSystem/SComponent/c_list.h"
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
|
||||
static u8 dummy[0x0c];
|
||||
OSThread mDoDvdThd::l_thread;
|
||||
mDoDvdThdStack mDoDvdThd::l_threadStack;
|
||||
mDoDvdThd_param_c mDoDvdThd::l_param;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Translation Unit: m_Do_ext.cpp
|
||||
//
|
||||
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
@@ -3103,7 +3103,7 @@ void mDoExt_initFontCommon(JUTFont** p_font, ResFONT** p_resfont, JKRHeap* p_hea
|
||||
if (cacheFont->isValid()) {
|
||||
*p_font = cacheFont;
|
||||
}
|
||||
JKRFileLoader::removeResource(*p_resfont, NULL);
|
||||
JKRRemoveResource(*p_resfont, NULL);
|
||||
*p_resfont = NULL;
|
||||
} else {
|
||||
JUTResFont* resFont = new JUTResFont(*p_resfont, p_heap);
|
||||
@@ -3194,7 +3194,7 @@ void mDoExt_removeMesgFont() {
|
||||
if (mDoExt_resfont0) {
|
||||
#if VERSION <= VERSION_JPN
|
||||
if (g_msgDHIO.field_0x08 == 0) {
|
||||
JKRFileLoader::removeResource(mDoExt_resfont0, NULL);
|
||||
JKRRemoveResource(mDoExt_resfont0, NULL);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
+85
-60
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_gba_com.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_gba_com.h"
|
||||
#include "JSystem/JUtility/JUTGba.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
@@ -78,11 +79,13 @@ void GbaReset(JUTGbaParam*, void*) {
|
||||
}
|
||||
|
||||
/* 8001A6A0-8001A7B8 .text mDoGaC_Initial__15mDoGaC_agbCom_cFP18mDoGaC_DataManag_cUc */
|
||||
void mDoGaC_agbCom_c::mDoGaC_Initial(mDoGaC_DataManag_c* param_0, u8 param_1) {
|
||||
field_0x0 = 0;
|
||||
void mDoGaC_agbCom_c::mDoGaC_Initial(mDoGaC_DataManag_c* i_dataMngP, u8 i_dataMngCount) {
|
||||
int i;
|
||||
|
||||
mEnable = 0;
|
||||
field_0x1 = 0;
|
||||
field_0x2 = 0;
|
||||
field_0x3 = 0;
|
||||
mReConnect = 0;
|
||||
field_0x4 = 1;
|
||||
field_0x5 = 0;
|
||||
mPortNo = 1;
|
||||
@@ -91,32 +94,35 @@ void mDoGaC_agbCom_c::mDoGaC_Initial(mDoGaC_DataManag_c* param_0, u8 param_1) {
|
||||
#endif
|
||||
field_0x7 = 0;
|
||||
field_0x8 = 0;
|
||||
field_0x10c = param_1;
|
||||
mDataManagerCount = i_dataMngCount;
|
||||
field_0x9 = 0;
|
||||
field_0xa = 0;
|
||||
field_0xb = 0;
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (i = 0; i < 16; i++) {
|
||||
field_0xc[i].field_0x0 = 0;
|
||||
field_0xc[i].field_0x4 = 0;
|
||||
field_0xc[i].field_0x8 = 0;
|
||||
field_0xc[i].field_0xc = 0;
|
||||
}
|
||||
|
||||
field_0x110 = param_0;
|
||||
for (int i = 0; i < param_1; i++) {
|
||||
param_0[i].field_0x0 = 0;
|
||||
param_0[i].field_0x4 = 0;
|
||||
param_0[i].field_0x5 = 0;
|
||||
mpDataManager = i_dataMngP;
|
||||
for (i = 0; i < i_dataMngCount; i++) {
|
||||
i_dataMngP[i].mpData = NULL;
|
||||
i_dataMngP[i].mStatus = 0;
|
||||
i_dataMngP[i].field_0x5 = 0;
|
||||
}
|
||||
|
||||
field_0x114 = 0xFFFFFFFF;
|
||||
field_0x118 = 0;
|
||||
|
||||
field_0x12c.U16._12e_1 = (u32)cM_rndF(0x7FFF);
|
||||
field_0x12c.U32bits._12c_2 = cM_rndF(0x7FFF);
|
||||
field_0x12c.U8._12c_0 = 1;
|
||||
field_0x128 = 0;
|
||||
// !@bug This array is length 1, but the demo version accesses past the end of the array.
|
||||
for (i = 0; i < DEMO_SELECT(3, 1); i++) {
|
||||
field_0x128[i].field_0x4.U16._12e_1 = (u32)cM_rndF(0x7FFF);
|
||||
field_0x128[i].field_0x4.U32bits._12c_2 = cM_rndF(0x7FFF);
|
||||
field_0x128[i].field_0x4.U8._12c_0 = i + 1;
|
||||
field_0x128[i].field_0x0 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8001A7B8-8001A7C4 .text mDoGaC_ComOpen__15mDoGaC_agbCom_cFv */
|
||||
@@ -128,11 +134,13 @@ void mDoGaC_agbCom_c::mDoGaC_ComOpen() {
|
||||
void mDoGaC_agbCom_c::mDoGaC_ComClose() {
|
||||
field_0x4 = 1;
|
||||
field_0x2 = 0;
|
||||
#if VERSION > VERSION_DEMO
|
||||
field_0x10e = 0;
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < field_0x10c; i++) {
|
||||
field_0x110[i].field_0x4 = 9;
|
||||
field_0x110[i].field_0x5 = 1;
|
||||
for (int i = 0; i < mDataManagerCount; i++) {
|
||||
mpDataManager[i].mStatus = 9;
|
||||
mpDataManager[i].field_0x5 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,10 +159,14 @@ void mDoGaC_agbCom_c::mDoGaC_ComStop() {
|
||||
/* 8001A858-8001A8B4 .text mDoGaC_GbaReboot__15mDoGaC_agbCom_cFv */
|
||||
void mDoGaC_agbCom_c::mDoGaC_GbaReboot() {
|
||||
mDoGaC_ComStop();
|
||||
u8 temp = field_0x0 = 0; // fakematch?
|
||||
field_0x3 = 0;
|
||||
field_0x12c.U32bits._12c_2 = cM_rndF(0x7FFF);
|
||||
field_0x128 = temp;
|
||||
mEnable = 0;
|
||||
mReConnect = 0;
|
||||
|
||||
// !@bug This array is length 1, but the demo version accesses past the end of the array.
|
||||
for (int i = 0; i < DEMO_SELECT(3, 1); i++) {
|
||||
field_0x128[i].field_0x4.U32bits._12c_2 = cM_rndF(0x7FFF);
|
||||
field_0x128[i].field_0x0 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8001A8B4-8001A94C .text mDoGaC_GbaReset__15mDoGaC_agbCom_cFv */
|
||||
@@ -182,15 +194,15 @@ void mDoGaC_agbCom_c::mDoGaC_ComRestart() {
|
||||
field_0xa = 0;
|
||||
field_0xb = 0;
|
||||
|
||||
for (int i = 0; i < field_0x10c; i++) {
|
||||
field_0x110[i].field_0x4 = 0;
|
||||
field_0x110[i].field_0x5 = 0;
|
||||
for (int i = 0; i < mDataManagerCount; i++) {
|
||||
mpDataManager[i].mStatus = 0;
|
||||
mpDataManager[i].field_0x5 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8001A9A4-8001AAD4 .text mDoGaC_Connect__15mDoGaC_agbCom_cFv */
|
||||
void mDoGaC_agbCom_c::mDoGaC_Connect() {
|
||||
if (field_0x0 != 0) {
|
||||
if (mEnable != 0) {
|
||||
if (mDoRst::isReset()) {
|
||||
mDoGaC_ComStop();
|
||||
field_0x6 = 0;
|
||||
@@ -245,12 +257,12 @@ void mDoGaC_agbCom_c::mDoGaC_ConnectWake() {
|
||||
|
||||
/* 8001AAF8-8001AB4C .text mDoGaC_GbaLink__15mDoGaC_agbCom_cFv */
|
||||
int mDoGaC_agbCom_c::mDoGaC_GbaLink() {
|
||||
if (field_0x0 == 1 && field_0x2 == 3 && field_0x4 == 0) {
|
||||
if (mEnable == 1 && field_0x2 == 3 && field_0x4 == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
if (field_0x128 == 1 && field_0x10e < 3) {
|
||||
if (field_0x128[0].field_0x0 == 1 && field_0x10e < 3) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@@ -277,7 +289,7 @@ int mDoGaC_agbCom_c::mDoGaC_SendDataSet(u32* param_0, int param_1, u8 param_2, u
|
||||
field_0xc[field_0x9].field_0x4 = param_1;
|
||||
field_0xc[field_0x9].field_0x8 = param_2;
|
||||
field_0xc[field_0x9].field_0xc = param_3;
|
||||
field_0x110[param_2].field_0x4 = 2;
|
||||
mpDataManager[param_2].mStatus = 2;
|
||||
|
||||
field_0x9++;
|
||||
if (field_0x9 >= 16) {
|
||||
@@ -292,8 +304,13 @@ int mDoGaC_agbCom_c::mDoGaC_SendDataSet(u32* param_0, int param_1, u8 param_2, u
|
||||
/* 8001AC14-8001AD48 .text mDoGaC_SendDataWrite__15mDoGaC_agbCom_cFv */
|
||||
void mDoGaC_agbCom_c::mDoGaC_SendDataWrite() {
|
||||
u8 var_r5 = 0;
|
||||
while (field_0x10c > var_r5) {
|
||||
if (field_0x110[var_r5].field_0x5 != 0) {
|
||||
while (mDataManagerCount > var_r5) {
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (mpDataManager[var_r5].field_0x5 == 1)
|
||||
#else
|
||||
if (mpDataManager[var_r5].field_0x5 != 0)
|
||||
#endif
|
||||
{
|
||||
u8 temp_r0 = field_0x9 + 1;
|
||||
if (temp_r0 >= 16) {
|
||||
temp_r0 = 0;
|
||||
@@ -303,18 +320,23 @@ void mDoGaC_agbCom_c::mDoGaC_SendDataWrite() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (field_0x110[var_r5].field_0x4 == 0 || field_0x110[var_r5].field_0x4 == 1) {
|
||||
if (field_0x110[var_r5].field_0x5 == 1) {
|
||||
if (mpDataManager[var_r5].mStatus == 0 || mpDataManager[var_r5].mStatus == 1) {
|
||||
#if VERSION == VERSION_DEMO
|
||||
field_0xc[field_0x9].field_0x0 = &field_0x11C;
|
||||
field_0xc[field_0x9].field_0x4 = 4;
|
||||
#else
|
||||
if (mpDataManager[var_r5].field_0x5 == 1) {
|
||||
field_0xc[field_0x9].field_0x0 = &field_0x11C;
|
||||
field_0xc[field_0x9].field_0x4 = 4;
|
||||
} else {
|
||||
field_0xc[field_0x9].field_0x0 = &field_0x120;
|
||||
field_0xc[field_0x9].field_0x4 = 8;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0xc[field_0x9].field_0x8 = var_r5;
|
||||
field_0xc[field_0x9].field_0xc = 0;
|
||||
field_0x110[var_r5].field_0x4 = 2;
|
||||
mpDataManager[var_r5].mStatus = 2;
|
||||
|
||||
field_0x9++;
|
||||
if (field_0x9 >= 16) {
|
||||
@@ -322,7 +344,7 @@ void mDoGaC_agbCom_c::mDoGaC_SendDataWrite() {
|
||||
}
|
||||
|
||||
field_0xb++;
|
||||
field_0x110[var_r5].field_0x5 = 0;
|
||||
mpDataManager[var_r5].field_0x5 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,9 +354,9 @@ void mDoGaC_agbCom_c::mDoGaC_SendDataWrite() {
|
||||
|
||||
/* 8001AD48-8001AD84 .text mDoGaC_SendEntry__15mDoGaC_agbCom_cFUcUl */
|
||||
int mDoGaC_agbCom_c::mDoGaC_SendEntry(u8 param_0, u32 param_1) {
|
||||
if (field_0x110[param_0].field_0x5 == 0) {
|
||||
if (mpDataManager[param_0].field_0x5 == 0) {
|
||||
field_0x11C = param_1;
|
||||
field_0x110[param_0].field_0x5 = 1;
|
||||
mpDataManager[param_0].field_0x5 = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -343,7 +365,7 @@ int mDoGaC_agbCom_c::mDoGaC_SendEntry(u8 param_0, u32 param_1) {
|
||||
|
||||
/* 8001AD84-8001ADB4 .text mDoGaC_SendStatusCheck__15mDoGaC_agbCom_cFUc */
|
||||
int mDoGaC_agbCom_c::mDoGaC_SendStatusCheck(u8 param_0) {
|
||||
if (field_0x110[param_0].field_0x4 == 0 || field_0x110[param_0].field_0x4 == 1) {
|
||||
if (mpDataManager[param_0].mStatus == 0 || mpDataManager[param_0].mStatus == 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -352,7 +374,7 @@ int mDoGaC_agbCom_c::mDoGaC_SendStatusCheck(u8 param_0) {
|
||||
|
||||
/* 8001ADB4-8001ADE4 .text mDoGaC_SendEndCheck__15mDoGaC_agbCom_cFUc */
|
||||
int mDoGaC_agbCom_c::mDoGaC_SendEndCheck(u8 param_0) {
|
||||
if (field_0x110[param_0].field_0x4 == 4 || field_0x110[param_0].field_0x4 == 0) {
|
||||
if (mpDataManager[param_0].mStatus == 4 || mpDataManager[param_0].mStatus == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -361,13 +383,13 @@ int mDoGaC_agbCom_c::mDoGaC_SendEndCheck(u8 param_0) {
|
||||
|
||||
/* 8001ADE4-8001AE04 .text mDoGaC_RecvStatusCheck__15mDoGaC_agbCom_cFUc */
|
||||
BOOL mDoGaC_agbCom_c::mDoGaC_RecvStatusCheck(u8 param_0) {
|
||||
return field_0x110[param_0].field_0x4 == 8 ? TRUE : FALSE;
|
||||
return mpDataManager[param_0].mStatus == 8 ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/* 8001AE04-8001AE44 .text mDoGaC_DataStatusReset__15mDoGaC_agbCom_cFUc */
|
||||
void mDoGaC_agbCom_c::mDoGaC_DataStatusReset(u8 param_0) {
|
||||
if (field_0x110[param_0].field_0x4 == 8) {
|
||||
field_0x110[param_0].field_0x4 = 0;
|
||||
if (mpDataManager[param_0].mStatus == 8) {
|
||||
mpDataManager[param_0].mStatus = 0;
|
||||
mDoGaC_StatusSendSet(param_0);
|
||||
}
|
||||
}
|
||||
@@ -476,8 +498,8 @@ void mDoGaC_agbCom_c::mDoGaC_CodeExchange4() {
|
||||
#else
|
||||
if (!JUTGba::getManager()->resultGetStatus(mDoGaC_getPortNo(), sp8) && sp8[0] == (0x10 | 0x20)) {
|
||||
#endif
|
||||
field_0x12c.U8._12c_0 = mDoGaC_getPortNo();
|
||||
field_0x114 = BigLittleChange(field_0x12c.U32);
|
||||
field_0x128[0].field_0x4.U8._12c_0 = mDoGaC_getPortNo();
|
||||
field_0x114 = BigLittleChange(field_0x128[0].field_0x4.U32);
|
||||
JUTGba::getManager()->doWrite(mDoGaC_getPortNo(), (u8*)&field_0x114, ContextSend, NULL);
|
||||
} else {
|
||||
field_0x2 = 0;
|
||||
@@ -489,11 +511,11 @@ void mDoGaC_agbCom_c::mDoGaC_ContextCheck() {
|
||||
u8 sp8[16];
|
||||
if (!JUTGba::getManager()->resultRead(mDoGaC_getPortNo(), sp8)) {
|
||||
u32 var_r0 = BigLittleChange(field_0x118);
|
||||
if (var_r0 == field_0x12c.U32) {
|
||||
if (field_0x128 == 1) {
|
||||
field_0x3 = 1;
|
||||
if (var_r0 == field_0x128[0].field_0x4.U32) {
|
||||
if (field_0x128[0].field_0x0 == 1) {
|
||||
mReConnect = 1;
|
||||
} else {
|
||||
field_0x128 = 1;
|
||||
field_0x128[0].field_0x0 = 1;
|
||||
}
|
||||
|
||||
mDoGaC_ComOpen();
|
||||
@@ -553,15 +575,15 @@ void mDoGaC_agbCom_c::mDoGaC_GbaWrite() {
|
||||
field_0x8 = 2;
|
||||
break;
|
||||
case 2: {
|
||||
u8 temp_r3_2 = field_0x110[temp_r31->field_0x8].field_0x4;
|
||||
u8 temp_r3_2 = mpDataManager[temp_r31->field_0x8].mStatus;
|
||||
if (temp_r3_2 == 2) {
|
||||
field_0x110[temp_r31->field_0x8].field_0x4 = 3;
|
||||
mpDataManager[temp_r31->field_0x8].mStatus = 3;
|
||||
field_0x114 = BigLittleChange(3);
|
||||
field_0x8 = 3;
|
||||
} else {
|
||||
field_0x114 = BigLittleChange(temp_r3_2);
|
||||
if (field_0x110[temp_r31->field_0x8].field_0x4 == 5) {
|
||||
field_0x110[temp_r31->field_0x8].field_0x4 = 6;
|
||||
if (mpDataManager[temp_r31->field_0x8].mStatus == 5) {
|
||||
mpDataManager[temp_r31->field_0x8].mStatus = 6;
|
||||
}
|
||||
|
||||
field_0xb--;
|
||||
@@ -581,7 +603,7 @@ void mDoGaC_agbCom_c::mDoGaC_GbaWrite() {
|
||||
break;
|
||||
case 4:
|
||||
field_0x114 = BigLittleChange(temp_r31->field_0xc);
|
||||
field_0x110[temp_r31->field_0x8].field_0x4 = 4;
|
||||
mpDataManager[temp_r31->field_0x8].mStatus = 4;
|
||||
|
||||
field_0xb--;
|
||||
field_0xa++;
|
||||
@@ -643,20 +665,23 @@ void mDoGaC_agbCom_c::mDoGaC_ReadResult() {
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
u32 temp_r0_2 = BigLittleChange(field_0x118);
|
||||
u8 temp_r0_2 = BigLittleChange(field_0x118);
|
||||
data_type = temp_r0_2;
|
||||
if ((temp_r0_2 & 0xFF) < 0x10) {
|
||||
u8 temp = temp_r0_2 & 0xFF;
|
||||
recv_p = (u32*)field_0x110[temp].field_0x0;
|
||||
#if VERSION == VERSION_DEMO
|
||||
recv_p = (u32*)mpDataManager[temp_r0_2].mpData;
|
||||
#else
|
||||
if (temp_r0_2 < 0x10) {
|
||||
recv_p = (u32*)mpDataManager[temp_r0_2].mpData;
|
||||
} else {
|
||||
recv_p = NULL;
|
||||
}
|
||||
#endif
|
||||
field_0x7 = 2;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
u32 temp_r0_3 = BigLittleChange(field_0x118);
|
||||
field_0x110[data_type].field_0x4 = temp_r0_3;
|
||||
mpDataManager[data_type].mStatus = temp_r0_3;
|
||||
if (temp_r0_3 == 7) {
|
||||
field_0x7 = 3;
|
||||
} else {
|
||||
@@ -669,7 +694,7 @@ void mDoGaC_agbCom_c::mDoGaC_ReadResult() {
|
||||
}
|
||||
case 3: {
|
||||
u32 temp_r0_4 = (BigLittleChange(field_0x118) + 3) & ~3;
|
||||
end_p = (u32*)((u8*)field_0x110[data_type].field_0x0 + temp_r0_4);
|
||||
end_p = (u32*)((u8*)mpDataManager[data_type].mpData + temp_r0_4);
|
||||
data_sum = 0;
|
||||
if (recv_p == NULL) {
|
||||
field_0x7 = 6;
|
||||
@@ -681,9 +706,9 @@ void mDoGaC_agbCom_c::mDoGaC_ReadResult() {
|
||||
case 4:
|
||||
check_sum = BigLittleChange(field_0x118);
|
||||
if (data_sum == check_sum) {
|
||||
field_0x110[data_type].field_0x4 = 8;
|
||||
mpDataManager[data_type].mStatus = 8;
|
||||
} else {
|
||||
field_0x110[data_type].field_0x4 = 9;
|
||||
mpDataManager[data_type].mStatus = 9;
|
||||
mDoGaC_StatusSendSet(data_type);
|
||||
field_0x4 = 1;
|
||||
}
|
||||
|
||||
+89
-43
@@ -3,7 +3,7 @@
|
||||
// Translation Unit: m_Do_graphic.cpp
|
||||
//
|
||||
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include "SSystem/SComponent/c_lib.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
@@ -54,7 +54,7 @@ s16 mDoGph_gInf_c::mMonotoneRateSpeed;
|
||||
mDoGph_gInf_c g_mDoGph_graphicInfo;
|
||||
|
||||
OSThread mCaptureThread;
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
OSAlarm mCaptureTimeOutAlarm;
|
||||
#endif
|
||||
s16 mCaptureStep;
|
||||
@@ -69,7 +69,9 @@ u32 mCaptureTextureSize;
|
||||
u32 mCaptureCaptureSize;
|
||||
GXDrawSyncCallback mCaptureOldCB;
|
||||
OSThreadQueue mCaptureThreadQueue;
|
||||
#if VERSION > VERSION_JPN
|
||||
u64 mCaptureTimeOutTicks = OS_TIMER_CLOCK;
|
||||
#endif
|
||||
|
||||
JKRHeap * mDoGph_gInf_c::mHeap[2] = {};
|
||||
GXColor mDoGph_gInf_c::mBackColor = {};
|
||||
@@ -84,7 +86,11 @@ void mDoGph_gInf_c::create() {
|
||||
#endif
|
||||
JFWDisplay::createManager(heap, JUTXfb::Double, true);
|
||||
JFWDisplay::getManager()->setDrawDoneMethod(JFWDisplay::Async);
|
||||
JUTFader* faderPtr = new JUTFader(0, 0, JUTVideo::getManager()->getRenderMode()->fbWidth, JUTVideo::getManager()->getRenderMode()->efbHeight, JUtility::TColor(0, 0, 0, 0));
|
||||
JUTFader* faderPtr = new JUTFader(
|
||||
0, 0,
|
||||
JUTGetVideoManager()->getRenderMode()->fbWidth, JUTGetVideoManager()->getRenderMode()->efbHeight,
|
||||
JUtility::TColor(0, 0, 0, 0)
|
||||
);
|
||||
JUT_ASSERT(DEMO_SELECT(414, 416), faderPtr != NULL);
|
||||
setFader(faderPtr);
|
||||
JFWDisplay::getManager()->setFader(faderPtr);
|
||||
@@ -193,7 +199,7 @@ void mDoGph_gInf_c::calcFade() {
|
||||
}
|
||||
}
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
if (mFadeColor.a != 0) {
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0A0, false, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
@@ -278,18 +284,18 @@ bool mDoGph_AfterOfDraw() {
|
||||
JUTProcBar::getManager()->setVisibleHeapBar(false);
|
||||
JUTDbPrint::getManager()->setVisible(true);
|
||||
} else {
|
||||
#if VERSION == VERSION_DEMO
|
||||
BOOL procVisible = false;
|
||||
BOOL printVisible = false;
|
||||
#else
|
||||
#if DEBUG || VERSION > VERSION_DEMO
|
||||
BOOL consoleVisible = JFWSystem::getSystemConsole()->isVisible();
|
||||
BOOL pad3Connected = JUTGamePad::getPortStatus(JUTGamePad::Port_3).err == 0;
|
||||
BOOL pad3Connected = JUTGamePad::getPortStatus(JUTGamePad::EPort3).err == 0;
|
||||
BOOL procVisible = pad3Connected && fapGmHIO_getMeter() && !consoleVisible;
|
||||
BOOL printVisible = pad3Connected && fapGmHIO_isPrint();
|
||||
if (mDoMain::developmentMode == 0) {
|
||||
procVisible = FALSE;
|
||||
printVisible = FALSE;
|
||||
}
|
||||
#else
|
||||
BOOL procVisible = false;
|
||||
BOOL printVisible = false;
|
||||
#endif
|
||||
JUTProcBar::getManager()->setVisible(procVisible);
|
||||
JUTProcBar::getManager()->setVisibleHeapBar(procVisible);
|
||||
@@ -304,16 +310,24 @@ bool mDoGph_AfterOfDraw() {
|
||||
GXSetFogRangeAdj(GX_FALSE, 0, NULL);
|
||||
GXSetCoPlanar(GX_FALSE);
|
||||
GXSetZTexture(GX_ZT_DISABLE, GX_TF_Z8, 0);
|
||||
#if VERSION == VERSION_DEMO
|
||||
#if VERSION <= VERSION_JPN
|
||||
GXSetDither(GX_FALSE);
|
||||
#else
|
||||
GXSetDither(GX_TRUE);
|
||||
#endif
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
#if VERSION < VERSION_PAL
|
||||
mDoMch_render_c::setFbWidth(fapGmHIO_getFbWidth());
|
||||
mDoMch_render_c::setEfbHeight(fapGmHIO_getEfbHeight());
|
||||
JUTVideo::getManager()->setRenderMode(mDoMch_render_c::getRenderModeObj());
|
||||
#endif
|
||||
JUTGetVideoManager()->setRenderMode(mDoMch_render_c::getRenderModeObj());
|
||||
#if VERSION == VERSION_PAL
|
||||
if (mDoMch_render_c::getRenderModeObj()->viTVmode == VI_TVMODE_PAL_INT) {
|
||||
VIConfigurePan(0, 0, 640, 532);
|
||||
VIFlush();
|
||||
}
|
||||
#endif
|
||||
dComIfGd_peekZdata();
|
||||
mDoGph_gInf_c::endFrame();
|
||||
return true;
|
||||
@@ -372,7 +386,9 @@ void clearAlphaBuffer(view_class* view, u8 alpha) {
|
||||
GXSetDither(GX_TRUE);
|
||||
GXSetColorUpdate(GX_FALSE);
|
||||
GXSetAlphaUpdate(GX_TRUE);
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
GXColor color = { 0x00, 0x00, 0x00, 0x00 };
|
||||
color.a = alpha;
|
||||
GXSetTevColor(GX_TEVREG0, color);
|
||||
@@ -473,7 +489,9 @@ void drawAlphaBuffer(view_class* view, GXColor color) {
|
||||
GXSetDither(GX_TRUE);
|
||||
GXSetColorUpdate(GX_TRUE);
|
||||
GXSetAlphaUpdate(GX_TRUE);
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
Mtx44 mtx;
|
||||
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
|
||||
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
|
||||
@@ -576,7 +594,9 @@ void drawSpot(view_class* view) {
|
||||
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);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_DST_ALPHA, GX_BL_DST_ALPHA, GX_LO_OR);
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
GXSetColorUpdate(GX_TRUE);
|
||||
GXSetAlphaUpdate(GX_FALSE);
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
@@ -591,7 +611,6 @@ void drawSpot(view_class* view) {
|
||||
|
||||
/* 80008F34-8000990C .text drawDepth__FP10view_classP15view_port_classi */
|
||||
void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
/* Nonmatching */
|
||||
if (mDoGph_gInf_c::isAutoForcus()) {
|
||||
f32 projv[7];
|
||||
f32 viewv[6];
|
||||
@@ -612,7 +631,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
l_tevColor0.a = mDoGph_gInf_c::getMonotoneRate();
|
||||
} else {
|
||||
dStage_FileList_dt_c * fili_p = NULL;
|
||||
s32 roomNo = dComIfGp_roomControl_getStayNo();
|
||||
int roomNo = dComIfGp_roomControl_getStayNo();
|
||||
if (roomNo >= 0)
|
||||
fili_p = dComIfGp_roomControl_getStatusRoomDt(roomNo)->getFileListInfo();
|
||||
|
||||
@@ -651,7 +670,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
|
||||
u16 hw = w >> 1;
|
||||
u16 hh = h >> 1;
|
||||
GXSetCopyFilter(GX_FALSE, NULL, GX_TRUE, JUTVideo::getManager()->getRenderMode()->vfilter);
|
||||
GXSetCopyFilter(GX_FALSE, NULL, GX_TRUE, JUTGetVideoManager()->getRenderMode()->vfilter);
|
||||
|
||||
GXSetTexCopySrc(x, y, w, h);
|
||||
GXSetTexCopyDst(hw, hh, GX_TF_Z16, GX_TRUE);
|
||||
@@ -661,15 +680,18 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
GXSetTexCopyDst(hw, hh, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_TRUE);
|
||||
GXCopyTex(fbbuf, GX_FALSE);
|
||||
|
||||
GXInitTexObj(mDoGph_gInf_c::getZbufferTexObj(), zbuf, w, h, GX_TF_IA8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObj(mDoGph_gInf_c::getZbufferTexObj(), zbuf, hw, hh, GX_TF_IA8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(mDoGph_gInf_c::getZbufferTexObj(), GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
|
||||
GXInitTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), fbbuf, w, h, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), fbbuf, hw, hh, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(mDoGph_gInf_c::getFrameBufferTexObj(), GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
GXPixModeSync();
|
||||
#if VERSION == VERSION_PAL
|
||||
GXInvalidateTexAll();
|
||||
#endif
|
||||
GXLoadTexObj(mDoGph_gInf_c::getFrameBufferTexObj(), GX_TEXMAP1);
|
||||
GXLoadTexObj(mDoGph_gInf_c::getZbufferTexObj(), GX_TEXMAP0);
|
||||
#if VERSION == VERSION_DEMO
|
||||
#if VERSION <= VERSION_JPN
|
||||
mDoGph_gInf_c::calcFade();
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
@@ -678,7 +700,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
GXSetTexCoordGen(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
GXSetNumTevStages(3);
|
||||
GXSetTevColorS10(GX_TEVREG0, l_tevColor0);
|
||||
#if VERSION == VERSION_DEMO
|
||||
#if VERSION <= VERSION_JPN
|
||||
GXSetTevColor(GX_TEVREG2, mDoGph_gInf_c::getFadeColor());
|
||||
#endif
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_ALPHA, GX_CH_GREEN, GX_CH_BLUE, GX_CH_RED);
|
||||
@@ -696,13 +718,13 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_APREV, GX_CA_TEXA, GX_CA_A0);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_4, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR_NULL);
|
||||
#if VERSION == VERSION_DEMO
|
||||
#if VERSION <= VERSION_JPN
|
||||
GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_TEXC, GX_CC_C2, GX_CC_A2, GX_CC_ZERO);
|
||||
#else
|
||||
GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC);
|
||||
#endif
|
||||
GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
#if VERSION == VERSION_DEMO
|
||||
#if VERSION <= VERSION_JPN
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_APREV, GX_CA_KONST, GX_CA_A2, GX_CA_ZERO);
|
||||
#else
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
|
||||
@@ -752,7 +774,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
if (y == 0) {
|
||||
s16 h = (s16)viewport->mScissor.mYOrig;
|
||||
if (h != 0) {
|
||||
h += (f32)viewport->mScissor.mHeight;
|
||||
s16 h2 = h + (f32)viewport->mScissor.mHeight;
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_ALPHA0, false, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetNumTexGens(0);
|
||||
@@ -769,11 +791,11 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 8);
|
||||
GXPosition3s16(0, 0, -5);
|
||||
GXPosition3s16(640, 0, -5);
|
||||
GXPosition3s16(640, y, -5);
|
||||
GXPosition3s16(0, y, -5);
|
||||
|
||||
GXPosition3s16(0, h, -5);
|
||||
GXPosition3s16(640, h, -5);
|
||||
GXPosition3s16(0, h, -5);
|
||||
|
||||
GXPosition3s16(0, h2, -5);
|
||||
GXPosition3s16(640, h2, -5);
|
||||
GXPosition3s16(640, 480, -5);
|
||||
GXPosition3s16(0, 480, -5);
|
||||
GXEnd();
|
||||
@@ -1395,7 +1417,9 @@ u8* mDoGph_allocFromAny(u32 size, int align) {
|
||||
mem = JKRAllocFromSysHeap(size, align);
|
||||
if (mem == NULL)
|
||||
mem = mDoGph_gInf_c::getZbufferTex();
|
||||
#if VERSION > VERSION_JPN
|
||||
memset(mem, 0, size);
|
||||
#endif
|
||||
return (u8*)mem;
|
||||
}
|
||||
#endif
|
||||
@@ -1455,7 +1479,9 @@ out:
|
||||
/* 8000AAC4-8000AB1C .text mCaptureProc__FPv */
|
||||
u32 mCaptureProc(void* dummy) {
|
||||
u32 bytesCopied = encode_s3tc(mCaptureCaptureBuffer, mCaptureTextureBuffer, mCaptureSizeWidth, mCaptureSizeHeight, (GXTexFmt)mCaptureCaptureFormat);
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION == VERSION_JPN
|
||||
DCFlushRange(mCaptureTextureBuffer, mCaptureTextureSize);
|
||||
#elif VERSION > VERSION_JPN
|
||||
DCStoreRange(mCaptureTextureBuffer, mCaptureTextureSize);
|
||||
#endif
|
||||
OSExitThread((void*)bytesCopied);
|
||||
@@ -1464,22 +1490,23 @@ u32 mCaptureProc(void* dummy) {
|
||||
|
||||
/* 8000AB1C-8000ABC4 .text mCaptureGXDrawSyncCallback__FUs */
|
||||
void mCaptureGXDrawSyncCallback(u16) {
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
OSCancelAlarm(&mCaptureTimeOutAlarm);
|
||||
BOOL interrupt = OSDisableInterrupts();
|
||||
if (mCaptureStep == 2) {
|
||||
if (mCaptureStep == 2)
|
||||
#endif
|
||||
{
|
||||
void* oldcb = (void*)GXSetDrawSyncCallback(mCaptureOldCB);
|
||||
JUT_ASSERT(DEMO_SELECT(2580, 2655), oldcb == mCaptureGXDrawSyncCallback);
|
||||
JUT_ASSERT(VERSION_SELECT(2580, 2863, 2655, 2662), oldcb == mCaptureGXDrawSyncCallback);
|
||||
mCaptureOldCB = NULL;
|
||||
mCaptureStep++;
|
||||
#if VERSION > VERSION_DEMO
|
||||
}
|
||||
#if VERSION > VERSION_JPN
|
||||
OSRestoreInterrupts(interrupt);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
/* 8000ABC4-8000AC3C .text mCaptureGXDrawSyncTimeOut__FP7OSAlarmP9OSContext */
|
||||
void mCaptureGXDrawSyncTimeOut(OSAlarm*, OSContext*) {
|
||||
OSReport_Error("キャプチャタイムアウト\n");
|
||||
@@ -1555,9 +1582,9 @@ bool mDoGph_screenCapture() {
|
||||
GXCopyTex(mCaptureCaptureBuffer, GX_FALSE);
|
||||
GXPixModeSync();
|
||||
|
||||
JUT_ASSERT(DEMO_SELECT(2657, 2753), mCaptureOldCB == NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(2657, 2942, 2753, 2760), mCaptureOldCB == NULL);
|
||||
mCaptureOldCB = GXSetDrawSyncCallback(mCaptureGXDrawSyncCallback);
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
OSCreateAlarm(&mCaptureTimeOutAlarm);
|
||||
OSSetAlarm(&mCaptureTimeOutAlarm, mCaptureTimeOutTicks, mCaptureGXDrawSyncTimeOut);
|
||||
#endif
|
||||
@@ -1599,12 +1626,12 @@ bool mDoGph_Painter() {
|
||||
GXSetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL);
|
||||
|
||||
j3dSys.drawInit();
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetDither(GX_TRUE);
|
||||
#endif
|
||||
|
||||
J2DOrthoGraph graf(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
|
||||
graf.setOrtho(JGeometry::TBox2<f32>(-9.0f, -21.0f, 650.0f, 503.0f), -1.0f, 1.0f);
|
||||
graf.setOrtho(-9.0f, -21.0f, 659.0f, 524.0f, -1.0f, 1.0f);
|
||||
graf.setPort();
|
||||
|
||||
dComIfGp_setCurrentGrafPort(&graf);
|
||||
@@ -1657,6 +1684,9 @@ bool mDoGph_Painter() {
|
||||
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
dComIfGd_drawOpaListBG();
|
||||
#if VERSION == VERSION_JPN
|
||||
j3dSys.reinitGX();
|
||||
#endif
|
||||
dComIfGd_drawShadow(camera->view.mViewMtx);
|
||||
dComIfGd_drawAlphaModel(camera->view.mViewMtx);
|
||||
drawAlphaBuffer(&camera->view, dComIfGd_getAlphaModelColor());
|
||||
@@ -1714,7 +1744,9 @@ bool mDoGph_Painter() {
|
||||
|
||||
dComIfGd_drawOpaListFilter();
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION == VERSION_JPN
|
||||
j3dSys.reinitGX();
|
||||
#elif VERSION > VERSION_JPN
|
||||
j3dSys.reinitGX();
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
@@ -1735,7 +1767,10 @@ bool mDoGph_Painter() {
|
||||
|
||||
if (!dMenu_flag()) {
|
||||
motionBlure(&camera->view);
|
||||
drawDepth(&camera->view, viewport_p, dComIfGp_getCamZoomForcus(cameraID));
|
||||
drawDepth(&camera->view, viewport_p, dComIfGp_getCameraZoomForcus(cameraID));
|
||||
#if VERSION == VERSION_PAL
|
||||
GXInvalidateTexAll();
|
||||
#endif
|
||||
dComIfGp_particle_drawProjection(&jpaDrawInfo);
|
||||
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
@@ -1744,7 +1779,9 @@ bool mDoGph_Painter() {
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
j3dSys.reinitGX();
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
if (isTower9)
|
||||
dComIfGp_particle_draw(&jpaDrawInfo);
|
||||
#endif
|
||||
@@ -1768,8 +1805,11 @@ bool mDoGph_Painter() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
mDoGph_gInf_c::calcFade();
|
||||
#endif
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
if (mCaptureStep == 1) {
|
||||
if (!mCaptureCansel)
|
||||
mDoGph_screenCapture();
|
||||
@@ -1858,7 +1898,11 @@ bool mDoGph_Painter() {
|
||||
OSCreateAlarm(&alarm);
|
||||
OSInitThreadQueue(&mCaptureThreadQueue);
|
||||
OSSetAlarm(&alarm, OSMillisecondsToTicks(3), mCaptureAlarmHandler);
|
||||
#else
|
||||
#elif VERSION == VERSION_JPN
|
||||
OSCreateAlarm(&alarm);
|
||||
OSInitThreadQueue(&mCaptureThreadQueue);
|
||||
OSSetAlarm(&alarm, OSMillisecondsToTicks(10), mCaptureAlarmHandler);
|
||||
#else // VERSION_USA and VERSION_PAL
|
||||
u64 tickNum = OSMillisecondsToTicks(10);
|
||||
OSCreateAlarm(&alarm);
|
||||
OSInitThreadQueue(&mCaptureThreadQueue);
|
||||
@@ -1900,14 +1944,14 @@ bool mDoGph_Painter() {
|
||||
|
||||
dDlst_list_c::calcWipe();
|
||||
j3dSys.reinitGX();
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
|
||||
graf.setOrtho(JGeometry::TBox2<f32>(-9.0f, -21.0f, 650.0f, 503.0f), 100000.0f, -100000.0f);
|
||||
graf.setOrtho(-9.0f, -21.0f, 659.0f, 524.0f, 100000.0f, -100000.0f);
|
||||
graf.setPort();
|
||||
Mtx viewMtx;
|
||||
mDoMtx_trans(viewMtx, 320.0f, 240.0f, 0.0f);
|
||||
cMtx_trans(viewMtx, 320.0f, 240.0f, 0.0f);
|
||||
JPADrawInfo jpaDrawInfo2D(viewMtx, 45.0f, 1.218f);
|
||||
jpaDrawInfo2D.setFovy(0.0f);
|
||||
jpaDrawInfo2D.setAspect(4.0f/3.0f);
|
||||
@@ -1924,7 +1968,7 @@ bool mDoGph_Painter() {
|
||||
j3dSys.setViewMtx(mDoMtx_stack_c::get());
|
||||
dComIfGd_drawOpaList2D();
|
||||
j3dSys.reinitGX();
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION > VERSION_JPN
|
||||
GXSetNumIndStages(0);
|
||||
#endif
|
||||
j3dSys.setViewMtx(viewMtx);
|
||||
@@ -1953,7 +1997,9 @@ bool mDoGph_Create() {
|
||||
#if VERSION > VERSION_DEMO
|
||||
mDoExt_adjustSolidHeap(solidHeap);
|
||||
mDoExt_restoreCurrentHeap();
|
||||
#if VERSION > VERSION_JPN
|
||||
JFWAutoAbortGfx = mDoMain::developmentMode ? 0x02 : 0x01;
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_hostIO.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
#include "string.h"
|
||||
#include "m_Do/m_Do_printf.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_lib.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
+115
-62
@@ -3,12 +3,12 @@
|
||||
// Translation Unit: m_Do_machine.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_machine.h"
|
||||
#include "JSystem/JFramework/JFWSystem.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramStream.h"
|
||||
#include "JSystem/JKernel/JKRDvdAramRipper.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
@@ -40,27 +40,6 @@ static int archiveHeapErrors;
|
||||
static int unknownHeapErrors;
|
||||
static u32 heapErrors;
|
||||
|
||||
#if VERSION <= VERSION_JPN
|
||||
const int FifoBufSize = 0x80000; // 512 KB
|
||||
const int CommandHeapSize = 0x1000; // 4 KB
|
||||
const int ArchiveHeapSize = 0xA3F000; // 10492 KB
|
||||
const int GameHeapSize = 0x2CE000; // 2872 KB
|
||||
const int SysHeapNonZeldaSize = 0x10000; // 64 KB
|
||||
#else
|
||||
const int FifoBufSize = 0xA0000; // 640 KB
|
||||
const int CommandHeapSize = 0x1000; // 4 KB
|
||||
const int ArchiveHeapSize = 0xA51400; // 10565 KB
|
||||
const int GameHeapSize = 0x2CE800; // 2874 KB
|
||||
const int SysHeapNonZeldaSize = 0x10000; // 64 KB
|
||||
#endif
|
||||
|
||||
const int AramAudioBufSize = 0xA00000; // 10240 KB
|
||||
const int AramGraphBufSize = 0x5CE000; // 5944 KB
|
||||
const int TransBufferSize = 0x2000; // 8 KB
|
||||
const int SzpBufferSize = 0x2000; // 8 KB
|
||||
|
||||
const int JMASinTableBitSize = 0xC; // 20 KB (5*(2^N) bytes)
|
||||
|
||||
/* 8000BD24-8000BEEC .text myGetHeapTypeByString__FP7JKRHeap */
|
||||
const char* myGetHeapTypeByString(JKRHeap* p_heap) {
|
||||
static char tmpString[5];
|
||||
@@ -174,6 +153,7 @@ void mDoMch_HeapCheckAll() {
|
||||
myHeapCheckRecursive(JKRHeap::sRootHeap);
|
||||
}
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
/* 8000C18C-8000C23C .text developKeyCheck__FUlUl */
|
||||
int developKeyCheck(u32 btnTrig, u32 btnHold) {
|
||||
static u8 key_link;
|
||||
@@ -205,15 +185,43 @@ int developKeyCheck(u32 btnTrig, u32 btnHold) {
|
||||
|
||||
return mDoMain::developmentMode;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if VERSION == VERSION_DEMO
|
||||
void myExceptionCallback(OSError, OSContext*, u32, u32) {
|
||||
mDoMain::sHungUpTime = OSGetTime();
|
||||
JUTException* manager = JUTException::getManager();
|
||||
JUTException::waitTime(3000);
|
||||
OSReportEnable();
|
||||
|
||||
if (mDoMain::developmentMode == 0) {
|
||||
JUTGamePad pad(JUTGamePad::EPort1);
|
||||
manager->enterPad(&pad);
|
||||
|
||||
if (manager != NULL) {
|
||||
OSEnableInterrupts();
|
||||
|
||||
while (true) {
|
||||
u32 btnHold;
|
||||
u32 btnTrig;
|
||||
manager->readPad(&btnTrig, &btnHold);
|
||||
JUTException::waitTime(30);
|
||||
|
||||
if (JUTGamePad::isResetOccurred(NULL)) {
|
||||
OSResetSystem(1, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
PPCHalt();
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* 8000C23C-8000C3C0 .text myExceptionCallback__FUsP9OSContextUlUl */
|
||||
void myExceptionCallback(OSError, OSContext*, u32, u32) {
|
||||
u32 btnHold;
|
||||
u32 btnTrig;
|
||||
|
||||
mDoMain::sHungUpTime = OSGetTime();
|
||||
OSReportEnable();
|
||||
JUTGamePad::clearForReset();
|
||||
|
||||
// "Vibration stopping & resetting to default\n"
|
||||
OSReport("振動停止&原点復帰\n");
|
||||
|
||||
@@ -224,29 +232,34 @@ void myExceptionCallback(OSError, OSContext*, u32, u32) {
|
||||
OSReport("例外マネージャがありません\n");
|
||||
PPCHalt();
|
||||
}
|
||||
|
||||
if (mDoMain::developmentMode == 0) {
|
||||
JUTGamePad pad(JUTGamePad::Port_1);
|
||||
manager->setGamePad(&pad);
|
||||
JUTGamePad pad(JUTGamePad::EPort1);
|
||||
manager->enterPad(&pad);
|
||||
|
||||
if (manager != NULL) {
|
||||
OSEnableInterrupts();
|
||||
|
||||
// "Accepting Key input\n"
|
||||
OSReport("キー入力を受け付けています\n");
|
||||
|
||||
while (mDoMain::developmentMode == 0) {
|
||||
u32 btnHold;
|
||||
u32 btnTrig;
|
||||
manager->readPad(&btnTrig, &btnHold);
|
||||
developKeyCheck(btnTrig, btnHold);
|
||||
JUTException::waitTime(30);
|
||||
if (JUTGamePad::C3ButtonReset::sResetOccurred) {
|
||||
if (JUTGamePad::isResetOccurred(NULL)) {
|
||||
OSReport("リセット受け付けています\n");
|
||||
OSResetSystem(1,0,0);
|
||||
OSResetSystem(1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// "JUTAssertion is visible\n"
|
||||
OSReport("JUTAssertionを可視化しました\n");
|
||||
JUTAssertion::setVisible(true);
|
||||
JUTDbPrint::getManager()->setVisible(true);
|
||||
JFWSystem::getSystemConsole()->setOutput(JUTConsole::OUTPUT_OSREPORT |
|
||||
JUTConsole::OUTPUT_CONSOLE);
|
||||
JFWSystem::getSystemConsole()->setOutput(JUTConsole::OUTPUT_OSREPORT | JUTConsole::OUTPUT_CONSOLE);
|
||||
} else {
|
||||
PPCHalt();
|
||||
}
|
||||
@@ -256,14 +269,21 @@ void myExceptionCallback(OSError, OSContext*, u32, u32) {
|
||||
JUTException::waitTime(3000);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if VERSION == VERSION_DEMO
|
||||
static void dummy() {
|
||||
OSReport("myAllocCallback: 条件一致しました\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 8000C3C0-8000C70C .text fault_callback_scroll__FUsP9OSContextUlUl */
|
||||
void fault_callback_scroll(OSError, OSContext* p_context, u32, u32) {
|
||||
JUTException* manager = JUTException::getManager();
|
||||
JUTConsole* exConsole = manager->getConsole();
|
||||
|
||||
JUTGamePad pad(JUTGamePad::Port_1);
|
||||
manager->setGamePad(&pad);
|
||||
JUTGamePad pad(JUTGamePad::EPort1);
|
||||
manager->enterPad(&pad);
|
||||
|
||||
BOOL padDisabled = manager->isEnablePad() == false;
|
||||
if (!padDisabled) {
|
||||
@@ -278,7 +298,7 @@ void fault_callback_scroll(OSError, OSContext* p_context, u32, u32) {
|
||||
u32 btnHold, btnTrig;
|
||||
manager->readPad(&btnTrig, &btnHold);
|
||||
|
||||
if (JUTGamePad::C3ButtonReset::sResetOccurred) {
|
||||
if (JUTGamePad::isResetOccurred(NULL)) {
|
||||
OSResetSystem(1, 0, 0);
|
||||
}
|
||||
|
||||
@@ -290,13 +310,13 @@ void fault_callback_scroll(OSError, OSContext* p_context, u32, u32) {
|
||||
|
||||
if (btnTrig == CButton::Z) {
|
||||
JUTConsole* sysConsole = JFWSystem::getSystemConsole();
|
||||
if (JUTConsoleManager::getManager()->getDirectConsole() != sysConsole) {
|
||||
if (JUTConsoleManager::getManager()->getDirectConsoel() != sysConsole) {
|
||||
exConsole = sysConsole;
|
||||
exConsole->setFontSize(8.0f, 6.0f);
|
||||
exConsole->setPosition(8, 32);
|
||||
exConsole->setHeight(23);
|
||||
exConsole->setVisible(true);
|
||||
exConsole->setOutput(JUTConsole::OUTPUT_CONSOLE | JUTConsole::OUTPUT_OSREPORT);
|
||||
sysConsole->setFontSize(8.0f, 6.0f);
|
||||
sysConsole->setPosition(8, DEMO_SELECT(26, 32));
|
||||
sysConsole->setHeight(23);
|
||||
sysConsole->setVisible(true);
|
||||
sysConsole->setOutput(JUTConsole::OUTPUT_CONSOLE | JUTConsole::OUTPUT_OSREPORT);
|
||||
} else {
|
||||
exConsole = JUTException::getConsole();
|
||||
}
|
||||
@@ -479,9 +499,15 @@ GXRenderModeObj g_ntscZeldaProg = {
|
||||
|
||||
/* 8000C70C-8000CB48 .text mDoMch_Create__Fv */
|
||||
bool mDoMch_Create() {
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (mDoMain::developmentMode == 0) {
|
||||
OSReportDisable();
|
||||
}
|
||||
#else
|
||||
if (mDoMain::developmentMode == 0 || !(OSGetConsoleType() & 0x10000000)) {
|
||||
OSReportDisable();
|
||||
}
|
||||
#endif
|
||||
|
||||
JKRHeap::setDefaultDebugFill(mDoMch::mDebugFill);
|
||||
JFWSystem::setMaxStdHeap(1);
|
||||
@@ -495,7 +521,7 @@ bool mDoMch_Create() {
|
||||
u32 arenaSize = ((u32)OSGetArenaHi() - (u32)OSGetArenaLo()) - 0xF0;
|
||||
#if VERSION != VERSION_PAL
|
||||
if (OSGetConsoleSimulatedMemSize() >= 0x3000000) {
|
||||
arenaSize -= 0x1000000;
|
||||
arenaSize -= DEMO_SELECT(0x800000, 0x1000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -503,10 +529,33 @@ bool mDoMch_Create() {
|
||||
arenaSize += mDoMain::memMargin;
|
||||
}
|
||||
|
||||
JFWSystem::setSysHeapSize(arenaSize - CommandHeapSize - ArchiveHeapSize - GameHeapSize);
|
||||
JFWSystem::setFifoBufSize(FifoBufSize);
|
||||
JFWSystem::setAramAudioBufSize(AramAudioBufSize);
|
||||
JFWSystem::setAramGraphBufSize(AramGraphBufSize);
|
||||
u32 archiveHeapSize;
|
||||
u32 gameHeapSize;
|
||||
u32 commandHeapSize;
|
||||
#if VERSION == VERSION_DEMO
|
||||
gameHeapSize = 0x300000; // 3072 KiB
|
||||
archiveHeapSize = 0x880000;
|
||||
archiveHeapSize += 0xED000;
|
||||
archiveHeapSize += 0xA0000;
|
||||
// archiveHeapSize total: 0xA0D000 // 10292 KiB
|
||||
#elif VERSION == VERSION_JPN
|
||||
gameHeapSize = 0x2CE000; // 2872 KiB
|
||||
archiveHeapSize = 0xA3F000; // 10492 KiB
|
||||
#else // VERSION_USA and VERSION_PAL
|
||||
gameHeapSize = 0x2CE800; // 2874 KiB
|
||||
archiveHeapSize = 0xA51400; // 10565 KiB
|
||||
#endif
|
||||
commandHeapSize = 0x1000; // 4 KiB
|
||||
arenaSize -= archiveHeapSize + gameHeapSize + commandHeapSize;
|
||||
|
||||
JFWSystem::setSysHeapSize(arenaSize);
|
||||
#if VERSION <= VERSION_JPN
|
||||
JFWSystem::setFifoBufSize(0x80000); // 512 KiB
|
||||
#else
|
||||
JFWSystem::setFifoBufSize(0xA0000); // 640 KiB
|
||||
#endif
|
||||
JFWSystem::setAramAudioBufSize(0xA00000); // 10240 KiB
|
||||
JFWSystem::setAramGraphBufSize(0x5CE000); // 5944 KiB
|
||||
#if VERSION == VERSION_PAL
|
||||
if (OSGetResetCode() - 0x80000000 == 0 && OSGetEuRgb60Mode() == 1) {
|
||||
mDoMch_render_c::setProgressiveMode();
|
||||
@@ -515,39 +564,43 @@ bool mDoMch_Create() {
|
||||
JFWSystem::setRenderMode(mDoMch_render_c::getRenderModeObj());
|
||||
JFWSystem::init();
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
if (mDoMain::developmentMode == 0) {
|
||||
JUTAssertion::setVisible(false);
|
||||
JUTDbPrint::getManager()->setVisible(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
JKRHeap::setErrorHandler(myMemoryErrorRoutine);
|
||||
JKRHeap::getRootHeap()->setErrorFlag(true);
|
||||
JFWSystem::getSystemHeap()->setErrorFlag(true);
|
||||
JKRSetErrorHandler(myMemoryErrorRoutine);
|
||||
JKRSetErrorFlag(JKRHeap::getRootHeap(), true);
|
||||
JKRSetErrorFlag(JFWSystem::getSystemHeap(), true);
|
||||
|
||||
JKRHeap* rootHeap = JKRHeap::getRootHeap();
|
||||
#if VERSION <= VERSION_JPN
|
||||
#if VERSION == VERSION_JPN
|
||||
rootHeap->dump_sort();
|
||||
#endif
|
||||
mDoExt_createCommandHeap(CommandHeapSize, rootHeap);
|
||||
#if VERSION <= VERSION_JPN
|
||||
mDoExt_createCommandHeap(commandHeapSize, rootHeap);
|
||||
#if VERSION == VERSION_JPN
|
||||
rootHeap->dump_sort();
|
||||
#endif
|
||||
|
||||
mDoExt_createArchiveHeap(ArchiveHeapSize, rootHeap);
|
||||
mDoExt_createArchiveHeap(archiveHeapSize, rootHeap);
|
||||
|
||||
mDoExt_createGameHeap(GameHeapSize, rootHeap);
|
||||
mDoExt_createGameHeap(gameHeapSize, rootHeap);
|
||||
|
||||
|
||||
JKRHeap* sysHeap = JKRGetSystemHeap();
|
||||
s32 size = sysHeap->getFreeSize() - SysHeapNonZeldaSize;
|
||||
JUT_ASSERT(VERSION_SELECT(996, 996, 1104, 1143), size > 0);
|
||||
s32 size = sysHeap->getFreeSize() - 0x10000; // 64 KiB
|
||||
JUT_ASSERT(VERSION_SELECT(871, 996, 1104, 1143), size > 0);
|
||||
JKRHeap* zeldaHeap = mDoExt_createZeldaHeap(size, sysHeap);
|
||||
zeldaHeap->becomeCurrentHeap();
|
||||
JKRSetCurrentHeap(zeldaHeap);
|
||||
|
||||
JKRAramStream::setTransBuffer(NULL, TransBufferSize, JKRGetSystemHeap());
|
||||
JKRAram::setSzpBufferSize(SzpBufferSize);
|
||||
JKRDvdAramRipper::setSzpBufferSize(SzpBufferSize);
|
||||
JKRDvdRipper::setSzpBufferSize(SzpBufferSize);
|
||||
u32 transBufferSize = 0x2000; // 8 KiB
|
||||
JKRSetAramTransferBuffer(NULL, transBufferSize, JKRGetSystemHeap());
|
||||
u32 szpBufferSize = 0x2000; // 8 KiB
|
||||
JKRAram::setSzpBufferSize(szpBufferSize);
|
||||
JKRDvdAramRipper::setSzpBufferSize(szpBufferSize);
|
||||
JKRDvdRipper::setSzpBufferSize(szpBufferSize);
|
||||
JKRThreadSwitch::createManager(NULL);
|
||||
JKRThread* thread = new JKRThread(OSGetCurrentThread(), 0);
|
||||
|
||||
@@ -555,10 +608,10 @@ bool mDoMch_Create() {
|
||||
sysConsole->setOutput(JUTConsole::OUTPUT_CONSOLE | JUTConsole::OUTPUT_OSREPORT);
|
||||
sysConsole->setPosition(16, 42);
|
||||
|
||||
JUTException::appendMapFile("/maps/framework.map");
|
||||
JUTException::setMapFile("/maps/framework.map");
|
||||
JUTException::setPreUserCallback(myExceptionCallback);
|
||||
JUTException::setPostUserCallback(fault_callback_scroll);
|
||||
JMANewSinTable(JMASinTableBitSize);
|
||||
JMANewSinTable(12); // 20 KiB (5*(2^N) bytes)
|
||||
|
||||
cMl::init(mDoExt_getZeldaHeap());
|
||||
cM_initRnd(100, 100, 100);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Exception Print Functions
|
||||
*/
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_machine_exception.h"
|
||||
#include "DynamicLink.h"
|
||||
#include "JSystem/JFramework/JFWSystem.h"
|
||||
@@ -16,9 +17,9 @@ static JUTConsole* sConsole;
|
||||
|
||||
/* 8001BADC-8001BB68 .text print_f__FPCce */
|
||||
void print_f(const char* fmt, ...) {
|
||||
va_list args;
|
||||
std::__tag_va_List args;
|
||||
va_start(args, fmt);
|
||||
JUTConsole_print_f_va_(sConsole, fmt, args);
|
||||
sConsole->print_f_va(fmt, &args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Main Initialization
|
||||
*/
|
||||
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_main.h"
|
||||
#include "DynamicLink.h"
|
||||
#include "JSystem/JFramework/JFWSystem.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Translation Unit: m_Do_mtx.cpp
|
||||
//
|
||||
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// Translation Unit: m_Do_printf.cpp
|
||||
//
|
||||
|
||||
#include "m_Do/machine.h" // IWYU pragma: keep
|
||||
#include "m_Do/m_Do_printf.h"
|
||||
#include "stdio.h"
|
||||
#include "dolphin/base/PPCArch.h"
|
||||
|
||||
Reference in New Issue
Block a user