refactor asserts to use __LINE__ using #line

This commit is contained in:
SwareJonge 2023-06-02 15:10:16 +02:00
parent bbb037a8d2
commit 9e1d02ac9d
47 changed files with 459 additions and 344 deletions

View File

@ -41,7 +41,8 @@ class JAISoundHandle {
}
JAISound *getSound() {
JUT_ASSERT(41, sound_ != 0);
#line 41
JUT_ASSERT(sound_ != 0);
return sound_;
}

View File

@ -44,25 +44,26 @@ struct JFWSystem
// No idea how they formatted this lol
static void setMaxStdHeap(int stdHeaps) {
JUT_ASSERT(47, sInitCalled == 0);
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::maxStdHeaps = stdHeaps; }
static void setSysHeapSize(u32 heapSize) {
JUT_ASSERT(50, sInitCalled == 0);
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::sysHeapSize = heapSize; }
static void setFifoBufSize(u32 bufSize) {
JUT_ASSERT(53, sInitCalled == 0);
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::fifoBufSize = bufSize; }
// Inlines for Aram
static void setAramAudioBufSize(u32 bufSize) {
JUT_ASSERT(58, sInitCalled == 0);
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::aramAudioBufSize = bufSize; }
static void setAramGraphBufSize(u32 bufSize) {
JUT_ASSERT(61, sInitCalled == 0);
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::aramGraphBufSize = bufSize; }
// probably some more inlines for other variables, not used by MKDD
static void setRenderMode(const _GXRenderModeObj * rmode) {
JUT_ASSERT(80, sInitCalled == 0);
#line 80
JUT_ASSERT(sInitCalled == 0);
CSetUpParam::renderMode = rmode; }
};

View File

@ -94,6 +94,14 @@ public:
void aramSync(JKRAMCommand *, int);
u32 getAudioMemory() const {
return mAudioMemoryPtr;
}
u32 getAudioMemSize() const {
return mAudioMemorySize;
}
static u32 getSZSBufferSize() {
return sSZSBufferSize;
}
@ -102,6 +110,10 @@ public:
return sAramObject->mAramHeap;
}
static JKRAram *getManager() {
return sAramObject;
}
static u8 decideAramGroupId(int id)
{
if(id < 0)

View File

@ -11,8 +11,8 @@ protected:
JKRAssertHeap(void *, unsigned long, JKRHeap *, bool);
// Thank you Nintendo for ordering this differently than the base class
public: // _08
virtual ~JKRAssertHeap();
public:
virtual ~JKRAssertHeap(); // _08
virtual u32 getHeapType() { return 'ASTH'; } // _10
virtual bool check() { return true; }; // _14
virtual bool dump() { return true; } // _1C
@ -20,25 +20,30 @@ public: // _08
virtual void do_destroy(); // _20
virtual u8 do_changeGroupID(u8) // _4C
{
JUT_ASSERT_MSG(41, 0, "0&&\"illegal changeGroupID()\"");
#line 41
JUT_ASSERT_MSG(0, "0&&\"illegal changeGroupID()\"");
return 0;
}
virtual u8 do_getCurrentGroupId() { return 0; } // _50
virtual void *do_alloc(u32, int)
virtual void *do_alloc(u32, int) // _24
{
JUT_ASSERT_MSG(47, 0, "0&&\"illegal alloc\"");
JUT_ASSERT_MSG(0, "0&&\"illegal alloc\"");
return nullptr;
}; // _24
virtual void do_free(void *) { JUT_ASSERT_MSG(51, 0, "0&&\"illegal free\""); } // _28
virtual void do_freeAll() { JUT_ASSERT_MSG(53, 0, "0&&\"illegal freeAll()\""); } // _2C
virtual void do_freeTail() { JUT_ASSERT_MSG(55, 0, "0&&\"illegal freeTail()\""); }; // _30
virtual void do_fillFreeArea(){}; // _34
virtual int do_resize(void *, u32) { JUT_ASSERT_MSG(61, 0, "0&&\"illegal resize\"") return 0; }; // _38
virtual int do_getSize(void *) { return 0; }; // _3C
virtual u32 do_getFreeSize() { return 0; }; // _40
virtual void *do_getMaxFreeBlock() { return 0; }; // _44
virtual u32 do_getTotalFreeSize() { return 0; }; // _48
};
virtual void do_free(void *) { JUT_ASSERT_MSG(0, "0&&\"illegal free\""); } // _28
virtual void do_freeAll() { JUT_ASSERT_MSG(0, "0&&\"illegal freeAll()\""); } // _2C
virtual void do_freeTail() { JUT_ASSERT_MSG(0, "0&&\"illegal freeTail()\""); }; // _30
virtual void do_fillFreeArea(){}; // _34
#line 61
virtual int do_resize(void *, u32) { JUT_ASSERT_MSG(0, "0&&\"illegal resize\"") return 0; }; // _38
virtual int do_getSize(void *) { return 0; }; // _3C
virtual u32 do_getFreeSize() { return 0; }; // _40
virtual void *do_getMaxFreeBlock() { return 0; }; // _44
virtual u32 do_getTotalFreeSize() { return 0; }; // _48
public:
static JKRAssertHeap *create(JKRHeap *);

View File

@ -4,87 +4,87 @@
#include <JSystem/JUtility/JUTAssert.h>
#include <JSystem/JUtility/JUTException.h>
// TODO: use #pragma line instead of hacky line argument
// the 1 == 1; inside the conditions was to match TP debug, likely fakematch
// Panic functions
#define JUT_PANIC(LINE, MSG) \
JUTException::panic(__FILE__, LINE, MSG);
#define JUT_PANIC_F(LINE, ...) \
JUTException::panic_f(__FILE__, LINE, __VA_ARGS__);
#define JUT_PANIC(MSG) \
JUTException::panic(__FILE__, __LINE__, MSG);
#define JUT_PANIC_F(...) \
JUTException::panic_f(__FILE__, __LINE__, __VA_ARGS__);
#if DEBUG
// Asserts
#define JUT_CONFIRM_MESSAGE(LINE, COND) \
JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, LINE, COND, #COND);
#define JUT_CONFIRM_MESSAGE(COND) \
JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, __LINE__, COND, #COND);
// not sure if it's conditional?
#define JUT_WARNING(LINE, COND) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::setWarningMessage(JUTAssertion::getSDevice(), __FILE__, LINE, #COND); \
#define JUT_WARNING(COND) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::setWarningMessage(JUTAssertion::getSDevice(), __FILE__, __LINE__, #COND); \
}
#define JUT_WARNING_F(LINE, COND, ...) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__); \
#define JUT_WARNING_F(COND, ...) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, __VA_ARGS__); \
}
#define JUT_WARNING_F2(LINE, ...) \
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__);
#define JUT_WARNING_F2(...) \
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, __VA_ARGS__);
// perhaps "%s" is already added here
#define JUT_CRITICAL_WARNING_F(...) \
JUTAssertion::setWarningMessage_f(2, __FILE__, __LINE__, __VA_ARGS__);
#define JUT_ASSERT(LINE, COND) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND); \
OSHalt(LINE, "Halt"); \
#define JUT_ASSERT(COND) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, __LINE__, #COND); \
OSHalt(__LINE__, "Halt"); \
}
#define JUT_ASSERT_F(LINE, COND, ...) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__); \
OSHalt(LINE, "Halt"); \
#define JUT_ASSERT_F(COND, ...) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, __VA_ARGS__); \
OSHalt(__LINE__, "Halt"); \
}
#define JUT_ASSERT_MSG(LINE, COND, MSG) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, MSG); \
OSHalt(LINE, "Halt"); \
#define JUT_ASSERT_MSG(COND, MSG) \
if ((COND)) \
{ \
1 == 1; \
} \
else \
{ \
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, __LINE__, MSG); \
OSHalt(__LINE__, "Halt"); \
}
#define JUT_MINMAX_ASSERT(LINE, min, cur, max) \
JUT_ASSERT_F(LINE, (((cur) >= (min)) && ((cur) < (max))) != false, "range over: %d <= " #cur "=%d < %d", (min), (cur), (max));
#define JUT_MINMAX_ASSERT(min, cur, max) \
JUT_ASSERT_F((((cur) >= (min)) && ((cur) < (max))) != false, "range over: %d <= " #cur "=%d < %d", (min), (cur), (max));
#define JUT_MAX_ASSERT(LINE, cur, max) \
JUT_ASSERT_F(LINE, ((cur) < (max)), "range over: %d <= " #cur "=%d < %d", 0, (cur), (max));
#define JUT_MAX_ASSERT(cur, max) \
JUT_ASSERT_F(((cur) < (max)), "range over: %d <= " #cur "=%d < %d", 0, (cur), (max));
#define JUT_LOG_F(LINE, ...) \
JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__);
#define JUT_LOG_F(...) \
JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, __VA_ARGS__);
#define JUT_REPORT_MSG(...) \
OSReport(__VA_ARGS__);

View File

@ -15,7 +15,8 @@ class SequenceInfo {
void rndDemo(u32);
void getDemoKart(int no, ECharID &charID1, ECharID &charID2, EKartID &kartID)
{
JUT_MINMAX_ASSERT(413, 0, no, 8);
#line 413
JUT_MINMAX_ASSERT(0, no, 8);
charID1 = mDemoKart[no].char1;
charID2 = mDemoKart[no].char2;

View File

@ -98,12 +98,13 @@ public:
Sector *getMainSector() { return mMainSector; }
Sector *getPrevSector(int no) {
JUT_MINMAX_ASSERT(100, 0, no, 4);
#line 100
JUT_MINMAX_ASSERT(0, no, 4);
return mPrevSectors[no];
}
Sector *getNextSector(int no) {
JUT_MINMAX_ASSERT(105, 0, no, 4);
JUT_MINMAX_ASSERT(0, no, 4);
return mNextSectors[no];
}
@ -167,13 +168,16 @@ public:
getCrsData()->getLightOffsetPosition(dst);
}*/
Sector *getSector(int no) const {
JUT_MINMAX_ASSERT(300, 0, no, mTotalSectors);
Sector *getSector(int no) const
{
#line 300
JUT_MINMAX_ASSERT(0, no, mTotalSectors);
return &mSectors[no];
}
Sector *getMainSector(int gen) const {
JUT_MINMAX_ASSERT(306, 0, gen, mTrackSectorNum);
Sector *getMainSector(int gen) const
{
JUT_MINMAX_ASSERT(0, gen, mTrackSectorNum);
return mMainSector[gen];
}

View File

@ -38,10 +38,11 @@ public:
bool isFinalLapRenewal() const;
bool isGoal() const { return mRaceEnd; }
bool isPass(int sectoridx) {
bool isPass(int sectoridx) {
#line 129
int index = sectoridx / 32;
int bitIndex = sectoridx % 32;
JUT_MINMAX_ASSERT(131, 0, index, mNumBitfields);
int bitIndex = sectoridx % 32;
JUT_MINMAX_ASSERT(0, index, mNumBitfields);
return (mPassedSectors[index] & (1 << bitIndex)) != false;
}
@ -59,12 +60,14 @@ public:
}
const RaceTime &getLapTime(int no) {
JUT_MINMAX_ASSERT(206, 0, no, mMaxLap);
#line 206
JUT_MINMAX_ASSERT(0, no, mMaxLap);
return mLapTimes[no];
}
KartGamePad * getDriverPad(int driverNo) const {
JUT_MINMAX_ASSERT(220, 0, driverNo, 2);
#line 220
JUT_MINMAX_ASSERT(0, driverNo, 2);
return mKartGamePads[driverNo];
}
@ -99,7 +102,7 @@ public:
void setDemoRank() { mRaceFlags |= 16; }
void setDead() { mBattleFlags |= 4; }
void setRank(int rank) { mRank = rank; }
bool setPass(int index);
inline bool setPass(int index); // ??? function is weak yet in cpp file itself
void clrRank() { mRank = 0; }
void resumeRabbitTimer() { mBattleFlags &= 0xfffe; }
bool tstLapChecking() const { return mRaceFlags & 1; }

View File

@ -57,7 +57,8 @@ public:
void hide(); // 0x801b9b88
void setLight(u32 viewNo, RaceKartLight * kartLight) {
JUT_MAX_ASSERT(107, viewNo, 4);
#line 107
JUT_MAX_ASSERT(viewNo, 4);
mKartLight[viewNo] = kartLight;
}

View File

@ -162,23 +162,26 @@ public:
KartGamePad * getYoungestPad();
// TODO: not important but move to "correct" location
bool isComDriver(int driverNo) const {
JUT_MINMAX_ASSERT(113, 0, driverNo, 2);
#line 113
JUT_MINMAX_ASSERT(0, driverNo, 2);
return mKartCharacters[driverNo].isComPlayer();
}
// Enum?
int getPlayerKind(int driverNo) const {
JUT_MINMAX_ASSERT(119, 0, driverNo, 2);
JUT_MINMAX_ASSERT(0, driverNo, 2);
return mKartCharacters[driverNo].getPlayerKind();
}
KartGamePad* getPad(int driverNo) {
JUT_MINMAX_ASSERT(126, 0, driverNo, 2);
#line 126
JUT_MINMAX_ASSERT(0, driverNo, 2);
return mKartCharacters[driverNo].getPad();
}
ECharID getDriverCharID(int driverNo) const {
JUT_MINMAX_ASSERT(142, 0, driverNo, 2);
ECharID getDriverCharID(int driverNo) const {
#line 142
JUT_MINMAX_ASSERT(0, driverNo, 2);
return mKartCharacters[driverNo].getCharID();
}

View File

@ -41,8 +41,15 @@ public:
void getMaskScreen(); // 0x801ca490
void isMaskActive() const; // 0x801ca4a0
DrawBuffer *getItemDrawBuffer(int kartNo) {
#line 163
JUT_MINMAX_ASSERT(-1, kartNo, 8)
return kartNo >= 0 ? mItmDrawBufs[kartNo] : mItmDrawBuf; // the day Kaneshige discovered ternaries
}
KartDrawer * getKartDrawer(int kartNo) {
JUT_MINMAX_ASSERT(172, 0, kartNo, mKartNum);
#line 172
JUT_MINMAX_ASSERT(0, kartNo, mKartNum);
return &mKartDrawer[kartNo];
}
@ -50,11 +57,6 @@ public:
DrawBuffer *getEffectDrawBuffer() {
return mEfctDrawBuf;
}
DrawBuffer *getItemDrawBuffer(int kartNo) {
JUT_MINMAX_ASSERT(163, -1, kartNo, 8)
return kartNo >= 0 ? mItmDrawBufs[kartNo] : mItmDrawBuf; // the day Kaneshige discovered ternaries
}
DrawBuffer *getFeelDrawBuffer() {
return mFeelDrawBuf;
}

View File

@ -92,23 +92,26 @@ public:
void setRandomSeed(u32 value) { mRandomSeed = value; }
void setRivalKartNo(int rivalNo, int kartNo) {
JUT_MINMAX_ASSERT(114, 0, rivalNo, 2);
JUT_MINMAX_ASSERT(115, 0, kartNo, 8)
#line 114
JUT_MINMAX_ASSERT(0, rivalNo, 2);
JUT_MINMAX_ASSERT(0, kartNo, 8)
mRivalKarts[rivalNo] = kartNo;
}
int getConsoleTarget(int cnsNo) const {
JUT_MINMAX_ASSERT(124, 0, cnsNo, 4);
#line 124
JUT_MINMAX_ASSERT(0, cnsNo, 4);
return _0x114[cnsNo];
}
bool isDemoConsole(int cnsNo) const {
JUT_MINMAX_ASSERT(129, 0, cnsNo, 4);
JUT_MINMAX_ASSERT(0, cnsNo, 4);
return _0x11c[cnsNo];
}
KartInfo *getKartInfo(int kartNo) {
JUT_MINMAX_ASSERT(173, 0, kartNo, 8);
#line 173
JUT_MINMAX_ASSERT(0, kartNo, 8);
return &mKartInfo[kartNo];
}

View File

@ -144,8 +144,9 @@ public:
int getTotalLapNumber() const { return mTotalLapNumber; }
KartInfo *getKartInfo(int index) {
JUT_MINMAX_ASSERT(170, 0, index, 8);
// TODO: in release it needs the other assert to prevent regswaps, if i do the same for debug, it creates 2 asserts
#line 170
JUT_MINMAX_ASSERT(0, index, 8);
// TODO: in release it needs the other inline to prevent regswaps, debug grabs stuff from raceInfo without getters in some cases so it had access to it?
#if DEBUG
return &mRaceInfo->mKartInfo[index];
#else
@ -177,22 +178,24 @@ public:
}
KartLoader *getKartLoader(int index) const {
JUT_MINMAX_ASSERT(257, 0, index, 8);
#line 257
JUT_MINMAX_ASSERT(0, index, 8);
return mKartLoader[index];
}
KartCam *getCamera(int cameraNo) const {
JUT_MINMAX_ASSERT(262, 0, cameraNo, 4);
JUT_MINMAX_ASSERT(0, cameraNo, 4);
return KartCtrl::getKartCtrl()->getKartCam(cameraNo);
}
KartChecker *getKartChecker(int index) const {
JUT_MINMAX_ASSERT(267, 0, index, 8);
JUT_MINMAX_ASSERT(0, index, 8);
return mKartChecker[index];
}
const RaceTime &getBestTotalTime(int recID) {
JUT_MINMAX_ASSERT(328, 0, recID, 5);
#line 328
JUT_MINMAX_ASSERT(0, recID, 5);
return mBestTotalTimes[recID];
}

View File

@ -50,8 +50,9 @@ public:
char searchPasswordTable(char c);
char getPassAtIndex(int n) {
JUT_ASSERT(48, mMake);
JUT_MINMAX_ASSERT(49, 0, n, 16);
#line 48
JUT_ASSERT(mMake);
JUT_MINMAX_ASSERT(0, n, 16);
return mPass[n];
}

View File

@ -151,9 +151,10 @@ namespace JASCalc
void bcopyfast(const void *src, void *dest, u32 size)
{
JUT_ASSERT(226, (reinterpret_cast<u32>(src) & 0x03) == 0);
JUT_ASSERT(227, (reinterpret_cast<u32>(dest) & 0x03) == 0);
JUT_ASSERT(228, (size & 0x0f) == 0);
#line 226
JUT_ASSERT((reinterpret_cast<u32>(src) & 0x03) == 0);
JUT_ASSERT((reinterpret_cast<u32>(dest) & 0x03) == 0);
JUT_ASSERT((size & 0x0f) == 0);
u32 copy1, copy2, copy3, copy4;
u32 *usrc = (u32 *)src;
@ -228,8 +229,9 @@ namespace JASCalc
void bzerofast(void *dest, u32 size)
{
JUT_ASSERT(336, (reinterpret_cast<u32>(dest) & 0x03) == 0);
JUT_ASSERT(337, (size & 0x0f) == 0);
#line 336
JUT_ASSERT((reinterpret_cast<u32>(dest) & 0x03) == 0);
JUT_ASSERT((size & 0x0f) == 0);
u32 *udest = (u32 *)dest;

View File

@ -19,9 +19,9 @@ namespace JASDvd
return false;
}
sThread = new (JASDram, 0) JASTaskThread(threadPriority, msgCount, stackSize);
JUT_ASSERT(36, sThread);
JUT_ASSERT(sThread);
JKRHeap *pCurrentHeap = JKRGetSystemHeap();
JUT_ASSERT(38, pCurrentHeap);
JUT_ASSERT(pCurrentHeap);
sThread->setCurrentHeap(pCurrentHeap);
sThread->resume();
return true;

View File

@ -27,7 +27,8 @@ void JASInstRand::effect(int, int, JASSoundParams *params) const
params->mDolby += val;
break;
default:
JUT_ASSERT(42, 0);
#line 42
JUT_ASSERT(0);
break;
}
}

View File

@ -60,7 +60,8 @@ JFWDisplay::~JFWDisplay() {
}
JFWDisplay *JFWDisplay::createManager(const _GXRenderModeObj *renderModeObj, JKRHeap *heap, JUTXfb::EXfbNumber bufferCount, bool p4) {
JUT_CONFIRM_MESSAGE(175, sManager == 0);
#line 175
JUT_CONFIRM_MESSAGE(sManager == 0);
if (renderModeObj != nullptr)
JUTVideo::sManager->setRenderMode(renderModeObj);
@ -72,7 +73,8 @@ JFWDisplay *JFWDisplay::createManager(const _GXRenderModeObj *renderModeObj, JKR
}
void JFWDisplay::destroyManager() {
JUT_CONFIRM_MESSAGE(533, sManager); // fabricated
#line 533
JUT_CONFIRM_MESSAGE(sManager); // fabricated
delete sManager;
sManager = nullptr;
}
@ -526,7 +528,8 @@ void JFWDisplay::calcCombinationRatio() {
}
s32 JFWDisplay::frameToTick(float mTemporarySingle) { // fabricated
JUT_CONFIRM_MESSAGE(999, mTemporarySingle);
#line 999
JUT_CONFIRM_MESSAGE(mTemporarySingle);
return OSMillisecondsToTicks(mFrameRate);
}

View File

@ -39,7 +39,8 @@ bool JFWSystem::sInitCalled;
void JFWSystem::firstInit()
{
JUT_ASSERT(80, rootHeap == 0);
#line 80
JUT_ASSERT(rootHeap == 0);
OSInit();
DVDInit();
rootHeap = JKRExpHeap::createRoot(CSetUpParam::maxStdHeaps, false);
@ -48,7 +49,8 @@ void JFWSystem::firstInit()
void JFWSystem::init()
{
JUT_ASSERT(101, sInitCalled == false);
#line 101
JUT_ASSERT(sInitCalled == false);
if (rootHeap == 0)
firstInit();

View File

@ -93,7 +93,8 @@ void* JKRAram::run() {
void JKRAram::checkOkAddress(u8* addr, u32 size, JKRAramBlock* block, u32 param_4) {
if (!IS_ALIGNED((u32)addr, 0x20) && !IS_ALIGNED(size, 0x20)) {
JUT_PANIC(219, ":::address not 32Byte aligned.");
#line 219
JUT_PANIC(":::address not 32Byte aligned.");
}
}
@ -310,13 +311,15 @@ int JKRDecompressFromAramToMainRam(u32 src, void *dst, u32 srcLength, u32 dstLen
u32 szsBufferSize = JKRAram::getSZSBufferSize();
szpBuf = (u8 *)JKRAllocFromSysHeap(szsBufferSize, 32);
JUT_ASSERT(1114, szpBuf != 0);
#line 1114
JUT_ASSERT(szpBuf != 0);
szpEnd = szpBuf + szsBufferSize;
if (offset != 0)
{
refBuf = (u8 *)JKRAllocFromSysHeap(0x1120, 0);
JUT_ASSERT(1123, refBuf != 0);
#line 1123
JUT_ASSERT(refBuf != 0);
refEnd = refBuf + 0x1120;
refCurrent = refBuf;
}
@ -524,7 +527,8 @@ u8 *nextSrcData(u8 *current)
u32 transSize = (u32)(szpEnd - (dest + left));
if (transSize > transLeft)
transSize = transLeft;
JUT_ASSERT(1403, transSize > 0);
#line 1403
JUT_ASSERT(transSize > 0);
JKRAramPcs(1, (u32)(srcAddress + srcOffset), ((u32)dest + left), ALIGN_NEXT(transSize, 0x20),
nullptr);

View File

@ -162,7 +162,8 @@ cleanup:
void *JKRAramArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize)
{
JUT_ASSERT(442, isMounted());
#line 442
JUT_ASSERT(isMounted());
u32 sizeRef;
u8 *data;
@ -195,7 +196,8 @@ void *JKRAramArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize)
}
void *JKRAramArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry *fileEntry, u32 *pSize) {
JUT_ASSERT(515, isMounted());
#line 515
JUT_ASSERT(isMounted());
u32 fileSize = fileEntry->mSize;
if (fileSize > compressedSize) {
fileSize = compressedSize;
@ -232,7 +234,8 @@ void *JKRAramArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
// UNUSED
u32 JKRAramArchive::getAramAddress_Entry(SDIFileEntry *fileEntry)
{
JUT_ASSERT(572, isMounted());
#line 572
JUT_ASSERT(isMounted());
if(fileEntry == nullptr) {
return 0;
@ -248,7 +251,8 @@ u32 JKRAramArchive::getAramAddress(const char *file) {
u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 size, u8 *data, u32 expandSize, int compression)
{
// do macros show in asserts? if not, use a macro here because if i ever reformat this then it'll screw this up
JUT_ASSERT(628, ( srcAram & 0x1f ) == 0);
#line 628
JUT_ASSERT(( srcAram & 0x1f ) == 0);
u32 sizeRef;
@ -268,7 +272,8 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 size, u8 *data, u3
JKRAramToMainRam(srcAram, data, alignedSize, Switch_1, prevAlignedSize, nullptr, -1, &sizeRef);
return sizeRef;
default:
JUT_PANIC(655, "??? bad sequence\n")
#line 655
JUT_PANIC("??? bad sequence\n")
return 0;
}
}
@ -282,7 +287,8 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 size, JKRHeap *hea
switch(compression) {
case JKRCOMPRESSION_NONE:
buffer = (u8 *)JKRAllocFromHeap(heap, alignedSize, 32);
JUT_ASSERT(677, buffer != 0);
#line 677
JUT_ASSERT(buffer != 0);
JKRAramToMainRam(srcAram, buffer, alignedSize, Switch_0, alignedSize, nullptr, -1, nullptr);
*pBuf = buffer;
@ -295,13 +301,15 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 size, JKRHeap *hea
u32 expandSize = ALIGN_NEXT(JKRDecompExpandSize(bufptr), 32);
buffer = (u8 *)JKRAllocFromHeap(heap, expandSize, 32);
JUT_ASSERT(703, buffer);
#line 703
JUT_ASSERT(buffer);
JKRAramToMainRam(srcAram, buffer, alignedSize, Switch_1, expandSize, heap, -1, &resSize);
*pBuf = buffer;
return resSize;
default:
JUT_PANIC(713, "??? bad sequence\n");
#line 713
JUT_PANIC("??? bad sequence\n");
return 0;
}
}

View File

@ -37,7 +37,8 @@ JKRAMCommand* JKRAramPiece::orderAsync(int direction, u32 source, u32 destinatio
OSReport("source = %x\n", source);
OSReport("destination = %x\n", destination);
OSReport("length = %x\n", length);
JUT_PANIC(108, "illegal address. abort.");
#line 108
JUT_PANIC("illegal address. abort.");
}
JKRAramCommand *message = new (JKRHeap::getSystemHeap(), -4) JKRAramCommand();

View File

@ -102,8 +102,8 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand *command)
{
heap->dump();
}
JUT_PANIC(172, ":::Cannot alloc memory\n");
#line 172
JUT_PANIC(":::Cannot alloc memory\n");
}
if (buffer)

View File

@ -142,7 +142,8 @@ void *JKRArchive::getGlbResource(u32 type, const char *name, JKRArchive *archive
void *JKRArchive::getResource(const char *path)
{
JUT_ASSERT(303, isMounted());
#line 303
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry;
if (*path == '/')
{
@ -157,7 +158,8 @@ void *JKRArchive::getResource(const char *path)
void *JKRArchive::getResource(u32 type, const char *name)
{
JUT_ASSERT(347, isMounted());
#line 347
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry;
if (type == 0 || type == '????')
{
@ -178,7 +180,8 @@ void *JKRArchive::getIdxResource(u32 index)
u32 JKRArchive::readResource(void *resourceBuffer, u32 bufferSize, u32 type, const char *name)
{
JUT_ASSERT(493, isMounted());
#line 493
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry;
if (type == 0 || type == '????')
{
@ -200,7 +203,8 @@ u32 JKRArchive::readResource(void *resourceBuffer, u32 bufferSize, u32 type, con
// Returns the size of the resource at the given path, or 0 if not found.
u32 JKRArchive::readResource(void *resourceBuffer, u32 bufferSize, const char *path)
{
JUT_ASSERT(539, isMounted());
#line 539
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry;
if (*path == '/')
{
@ -222,7 +226,8 @@ u32 JKRArchive::readResource(void *resourceBuffer, u32 bufferSize, const char *p
// Returns the size of the resource with the given ID, or 0 if not found.
u32 JKRArchive::readResource(void *resourceBuffer, u32 bufferSize, u16 id)
{
JUT_ASSERT(625, isMounted());
#line 625
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry = findIdResource(id);
if (fileEntry)
{
@ -252,7 +257,8 @@ void JKRArchive::removeResourceAll()
bool JKRArchive::removeResource(void *resource)
{
JUT_ASSERT(678, resource != 0);
#line 678
JUT_ASSERT(resource != 0);
SDIFileEntry *entry = findPtrResource(resource);
if (entry == nullptr)
{
@ -265,7 +271,8 @@ bool JKRArchive::removeResource(void *resource)
bool JKRArchive::detachResource(void *resource)
{
JUT_ASSERT(707, resource != 0);
#line 707
JUT_ASSERT(resource != 0);
SDIFileEntry *entry = findPtrResource(resource);
if (entry == nullptr)
{
@ -277,7 +284,8 @@ bool JKRArchive::detachResource(void *resource)
s32 JKRArchive::getResSize(const void *resource) const
{
JUT_ASSERT(732, resource != 0);
#line 732
JUT_ASSERT(resource != 0);
SDIFileEntry *entry = findPtrResource(resource);
return (entry == nullptr) ? -1 : entry->getSize();
}

View File

@ -25,8 +25,8 @@ JKRCompArchive::JKRCompArchive(long entryNum, EMountDirection mountDirection) :
#ifdef DEBUG
void stringGen() {
JUT_PANIC(1, "isMounted()");
JUT_PANIC(1, "mMountCount == 1");
JUT_PANIC("isMounted()");
JUT_PANIC("mMountCount == 1");
}
#endif
@ -88,8 +88,9 @@ bool JKRCompArchive::open(long entryNum) {
mSizeOfMemPart = arcHeader->_14;
mSizeOfAramPart = arcHeader->_18;
JUT_ASSERT(352, ( mSizeOfMemPart & 0x1f ) == 0);
JUT_ASSERT(353, ( mSizeOfAramPart & 0x1f ) == 0);
#line 352
JUT_ASSERT(( mSizeOfMemPart & 0x1f ) == 0);
JUT_ASSERT(( mSizeOfAramPart & 0x1f ) == 0);
switch (mCompression)
{
@ -216,7 +217,8 @@ bool JKRCompArchive::open(long entryNum) {
}
void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
JUT_ASSERT(597, isMounted());
#line 597
JUT_ASSERT(isMounted());
u32 ptrSize;
u32 size = fileEntry->mSize;
@ -263,7 +265,8 @@ void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry *fileEntry, u32 *pSize)
{
u32 size = 0;
JUT_ASSERT(708, isMounted());
#line 708
JUT_ASSERT(isMounted());
u32 fileSize = fileEntry->mSize;
u32 alignedSize = ALIGN_NEXT(fileSize, 32);
@ -305,7 +308,8 @@ void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
}
else
{
JUT_PANIC(776, "illegal archive.");
#line 776
JUT_PANIC("illegal archive.");
}
}
@ -385,7 +389,8 @@ u32 JKRCompArchive::getExpandedResSize(const void *resource) const
DCInvalidateRange(bufPtr, sizeof(buf) / 2);
}
else {
JUT_PANIC(943, "illegal resource.");
#line 943
JUT_PANIC("illegal resource.");
}
u32 expandSize = JKRDecompExpandSize(bufPtr);
const_cast<JKRCompArchive *>(this)->setExpandSize(fileEntry, expandSize);

View File

@ -65,7 +65,8 @@ JKRDecompCommand *JKRDecomp::prepareCommand(u8 *srcBuffer, u8 *dstBuffer, u32 sr
void JKRDecomp::sendCommand(JKRDecompCommand *decompCmd) {
BOOL msgret = OSSendMessage(&sMessageQueue, decompCmd, 0);
JUT_ASSERT_MSG(142, msgret, "Decomp MesgBuf FULL!");
#line 142
JUT_ASSERT_MSG(msgret, "Decomp MesgBuf FULL!");
}
JKRDecompCommand *JKRDecomp::orderAsync(u8 *srcBuffer, u8 *dstBuffer, u32 srcLength, u32 dstLength,

View File

@ -288,16 +288,19 @@ int JKRDecompressFromDVDToAram(JKRDvdFile *dvdFile, u32 p2, u32 fileSize, u32 de
u32 bufferSize = JKRDvdAramRipper::getSZSBufferSize();
szpBuf = (u8 *)JKRAllocFromSysHeap(bufferSize, 32);
JUT_ASSERT(755, szpBuf != 0);
#line 755
JUT_ASSERT(szpBuf != 0);
szpEnd = szpBuf + bufferSize;
refBuf = (u8 *)JKRAllocFromSysHeap(0x1120, 0);
JUT_ASSERT(763, refBuf != 0);
#line 763
JUT_ASSERT(refBuf != 0);
refEnd = refBuf + 0x1120;
refCurrent = refBuf;
dmaBuf = (u8 *)JKRAllocFromSysHeap(0x100, 32);
JUT_ASSERT(772, dmaBuf != 0);
#line 772
JUT_ASSERT(dmaBuf != 0);
dmaEnd = dmaBuf + 0x100;
dmaCurrent = dmaBuf;
@ -455,8 +458,8 @@ u8 *nextSrcData(u8 *src)
u32 transSize = (u32)(szpEnd - (buf + limit));
if (transSize > transLeft)
transSize = transLeft;
JUT_ASSERT(1036, transSize > 0);
#line 1036
JUT_ASSERT(transSize > 0);
while (true)
{
int result = DVDReadPrio(srcFile->getFileInfo(), (buf + limit), transSize, srcOffset, 2);

View File

@ -131,7 +131,8 @@ bool JKRDvdArchive::open(long entryNum)
}
if (mMountMode == 0)
{
JUT_REPORT_MSG(":::Cannot alloc memory [%s][%d]\n", __FILE__, 397); // TODO: macro
#line 397
JUT_REPORT_MSG(":::Cannot alloc memory [%s][%d]\n", __FILE__, __LINE__); // TODO: macro
if (mDvdFile != nullptr)
{
delete mDvdFile;
@ -142,7 +143,8 @@ bool JKRDvdArchive::open(long entryNum)
}
void *JKRDvdArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
JUT_ASSERT(428, isMounted());
#line 428
JUT_ASSERT(isMounted());
u32 sizeptr;
u32 size;
u8 *data;
@ -176,7 +178,8 @@ void *JKRDvdArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
void *JKRDvdArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry *fileEntry, u32 *pSize)
{
JUT_ASSERT(504, isMounted());
#line 504
JUT_ASSERT(isMounted());
u32 fileSize = fileEntry->mSize;
u32 alignedSize = ALIGN_NEXT(fileSize, 32);
@ -257,11 +260,15 @@ u32 JKRDvdArchive::fetchResource_subroutine(long entryNum, u32 offset, u32 size,
return size;
}
case JKRCOMPRESSION_YAY0:
JUT_PANIC(649, "Sorry, not applied for SZP archive.\n");
case JKRCOMPRESSION_YAY0: {
#line 649
JUT_PANIC("Sorry, not applied for SZP archive.\n");
}
default:
JUT_PANIC(653, "??? bad sequence\n");
default: {
JUT_PANIC("??? bad sequence\n");
}
}
return 0;
}
@ -278,7 +285,8 @@ u32 JKRDvdArchive::fetchResource_subroutine(long entryNum, u32 offset, u32 size,
{
case JKRCOMPRESSION_NONE:
buffer = (u8 *)JKRAllocFromHeap(heap, alignedSize, 32);
JUT_ASSERT(675, buffer != 0);
#line 675
JUT_ASSERT(buffer != 0);
JKRDvdToMainRam(entryNum, buffer, Switch_0, alignedSize, nullptr, JKRDvdRipper::ALLOC_DIR_TOP, offset, nullptr, nullptr);
DCInvalidateRange(buffer, alignedSize);
@ -295,7 +303,8 @@ u32 JKRDvdArchive::fetchResource_subroutine(long entryNum, u32 offset, u32 size,
alignedSize = JKRDecompExpandSize(bufptr);
buffer = (u8 *)JKRAllocFromHeap(heap, alignedSize, 32);
JUT_ASSERT(715, buffer);
#line 715
JUT_ASSERT(buffer);
JKRDvdToMainRam(entryNum, buffer, Switch_1, alignedSize, nullptr, JKRDvdRipper::ALLOC_DIR_TOP, offset, nullptr, nullptr);
DCInvalidateRange(buffer, alignedSize);
@ -306,18 +315,23 @@ u32 JKRDvdArchive::fetchResource_subroutine(long entryNum, u32 offset, u32 size,
case JKRCOMPRESSION_YAZ0:
{
buffer = (u8 *)JKRAllocFromHeap(heap, alignedSize, 32);
JUT_ASSERT(735, buffer);
#line 735
JUT_ASSERT(buffer);
JKRDvdToMainRam(entryNum, buffer, Switch_1, size, nullptr, JKRDvdRipper::ALLOC_DIR_TOP, offset, nullptr, nullptr);
DCInvalidateRange(buffer, size);
*pBuf = buffer;
return alignedSize;
}
case JKRCOMPRESSION_YAY0:
JUT_PANIC(754, "Sorry, not applied SZP archive.\n");
case JKRCOMPRESSION_YAY0: {
#line 754
JUT_PANIC("Sorry, not applied SZP archive.\n");
}
default:
JUT_PANIC(758, "??? bad sequence\n");
default: {
JUT_PANIC("??? bad sequence\n");
}
}
return 0;
}

View File

@ -59,13 +59,15 @@ void JKRDvdFile::close() {
sDvdList.remove(&mLink);
}
else {
JUT_PANIC(213, "cannot close DVD file\n");
#line 213
JUT_PANIC("cannot close DVD file\n");
}
}
}
s32 JKRDvdFile::readData(void * addr,s32 length, s32 offset) {
JUT_ASSERT(238, ( length & 0x1f ) == 0);
#line 238
JUT_ASSERT(( length & 0x1f ) == 0);
OSLockMutex(&mDvdMutex);
s32 retAddr;
if(mThread != nullptr) {
@ -86,7 +88,8 @@ s32 JKRDvdFile::readData(void * addr,s32 length, s32 offset) {
}
s32 JKRDvdFile::writeData(const void * addr,s32 length, s32 offset) {
JUT_ASSERT(344, ( length & 0x1f ) == 0);
#line 344
JUT_ASSERT(( length & 0x1f ) == 0);
return -1;
}

View File

@ -186,16 +186,18 @@ namespace JKRDvdRipper
}
else
{
JUT_PANIC(323, "Sorry, not applied for SZP archive.");
#line 323
JUT_PANIC("Sorry, not applied for SZP archive.");
}
return file;
}
else if (compression == TYPE_YAY0)
{
// SZP decompression
// s32 readoffset = startOffset;
if (startOffset != 0)
{
JUT_PANIC(333, "Not support SZP with offset read");
JUT_PANIC("Not support SZP with offset read");
}
while (true)
{
@ -253,12 +255,14 @@ int JKRDecompressFromDVD(JKRDvdFile *file, void *p2, u32 p3, u32 inMaxDest, u32
OSLockMutex(&decompMutex);
int bufSize = JKRDvdRipper::getSZSBufferSize();
szpBuf = (u8 *)JKRAllocFromSysHeap(bufSize, -0x20);
JUT_ASSERT(909, szpBuf != 0);
#line 909
JUT_ASSERT(szpBuf != 0);
szpEnd = szpBuf + bufSize;
if (inFileOffset != 0)
{
refBuf = (u8 *)JKRAllocFromSysHeap(0x1120, -4);
JUT_ASSERT(918, refBuf != 0);
#line 918
JUT_ASSERT(refBuf != 0);
refEnd = refBuf + 0x1120;
refCurrent = refBuf;
}
@ -477,8 +481,8 @@ u8 *nextSrcData(u8 *src)
u32 transSize = (u32)(szpEnd - (buf + limit));
if (transSize > transLeft)
transSize = transLeft;
JUT_ASSERT(1208, transSize > 0);
#line 1208
JUT_ASSERT(transSize > 0);
while (true)
{
s32 result = DVDReadPrio(srcFile->getFileInfo(), (buf + limit), transSize, srcOffset, 2);

View File

@ -400,7 +400,8 @@ void JKRExpHeap::do_free(void * memblock) {
}
}
else {
JUT_WARNING_F2(894, "free: memblock %x not in heap %x", memblock, this);
#line 894
JUT_WARNING_F2("free: memblock %x not in heap %x", memblock, this);
}
unlock();
}
@ -616,7 +617,8 @@ void JKRExpHeap::appendUsedList(JKRExpHeap::CMemBlock *blockToAppend)
{
if (!blockToAppend)
{
JUT_PANIC(1568, "bad appendUsedList\n");
#line 1568
JUT_PANIC("bad appendUsedList\n");
}
CMemBlock *block = mTailUsedList;
CMemBlock *tail = mTailUsedList;
@ -769,7 +771,8 @@ void JKRExpHeap::joinTwoBlocks(CMemBlock *block)
JUT_REPORT_MSG(":::: endAddr = %x\n", endAddr);
JUT_REPORT_MSG(":::: nextAddr = %x\n", nextAddr);
JKRGetCurrentHeap()->dump();
JUT_PANIC(1820, "Bad Block\n");
#line 1820
JUT_PANIC("Bad Block\n");
}
if (endAddr == nextAddr)
{
@ -1041,8 +1044,9 @@ JKRExpHeap::CMemBlock *JKRExpHeap::CMemBlock::getHeapBlock(void *mem)
void JKRExpHeap::state_register(JKRHeap::TState *p, u32 param_1) const
{
JUT_ASSERT(2406, p != 0);
JUT_ASSERT(2407, p->getHeap() == this);
#line 2406
JUT_ASSERT(p != 0);
JUT_ASSERT(p->getHeap() == this);
getState_(p); // not needed, however TP debug has it
setState_u32ID_(p, param_1);
if (param_1 <= 0xff)
@ -1074,7 +1078,8 @@ void JKRExpHeap::state_register(JKRHeap::TState *p, u32 param_1) const
bool JKRExpHeap::state_compare(const JKRHeap::TState &r1, const JKRHeap::TState &r2) const
{
JUT_ASSERT(2454, r1.getHeap() == r2.getHeap());
#line 2454
JUT_ASSERT(r1.getHeap() == r2.getHeap());
bool result = true;
if (r1.mCheckCode != r2.mCheckCode)
{

View File

@ -4,6 +4,7 @@
// not sure if this matches, doesn't exist in mkdd
void JKRFile::read(void* address, s32 length, s32 offset) {
#line 34
JUT_ASSERT(34, (length & 0x1f));
while (writeData(address, length, offset) != length) {
VIWaitForRetrace();

View File

@ -92,7 +92,8 @@ JKRHeap *JKRHeap::becomeCurrentHeap()
}
void JKRHeap::destroy(JKRHeap * heap) {
JUT_ASSERT(200, heap != 0);
#line 200
JUT_ASSERT(heap != 0);
heap->destroy();
}
@ -113,7 +114,8 @@ void *JKRHeap::alloc(u32 byteCount, int padding, JKRHeap *heap)
}
void *JKRHeap::alloc(u32 byteCount, int padding) {
JUT_WARNING_F(317, !mInitFlag, "alloc %x byte in heap %x", byteCount, this);
#line 317
JUT_WARNING_F(!mInitFlag, "alloc %x byte in heap %x", byteCount, this);
return do_alloc(byteCount, padding);
}
@ -126,7 +128,8 @@ void JKRHeap::free(void *memory, JKRHeap *heap)
}
void JKRHeap::free(void *memory) {
JUT_WARNING_F(365, !mInitFlag, "free %x in heap %x", memory, this);
#line 365
JUT_WARNING_F(!mInitFlag, "free %x in heap %x", memory, this);
do_free(memory);
}
@ -140,30 +143,35 @@ void JKRHeap::callAllDisposer()
}
void JKRHeap::freeAll() {
JUT_WARNING_F(417, !mInitFlag, "freeAll in heap %x", this);
#line 417
JUT_WARNING_F(!mInitFlag, "freeAll in heap %x", this);
do_freeAll();
}
void JKRHeap::freeTail() {
JUT_WARNING_F(431, !mInitFlag, "freeTail in heap %x", this);
#line 431
JUT_WARNING_F(!mInitFlag, "freeTail in heap %x", this);
do_freeTail();
}
// fabricated
void JKRHeap::fillFreeArea() {
JUT_WARNING_F(461, !mInitFlag, "fillFreeArea in heap %x", this);
#line 461
JUT_WARNING_F(!mInitFlag, "fillFreeArea in heap %x", this);
do_fillFreeArea();
}
int JKRHeap::resize(void *memoryBlock, u32 newSize) {
JUT_WARNING_F(491, !mInitFlag, "resize block %x into %x in heap %x", memoryBlock, newSize, this);
#line 491
JUT_WARNING_F(!mInitFlag, "resize block %x into %x in heap %x", memoryBlock, newSize, this);
return do_resize(memoryBlock, newSize);
}
s32 JKRHeap::getFreeSize() { return do_getFreeSize(); }
u32 JKRHeap::getTotalFreeSize() { return do_getTotalFreeSize(); }
u8 JKRHeap::changeGroupID(u8 newGroupID) {
JUT_WARNING_F(570, !mInitFlag, "change heap ID into %x in heap %x", newGroupID, this);
#line 570
JUT_WARNING_F(!mInitFlag, "change heap ID into %x in heap %x", newGroupID, this);
return do_changeGroupID(newGroupID);
}
@ -301,8 +309,9 @@ void JKRHeap::copyMemory(void *dst, void *src, u32 size)
}
void JKRDefaultMemoryErrorRoutine(void * heap, u32 size, int alignment) {
#line 830
JUT_REPORT_MSG("Error: Cannot allocate memory %d(0x%x)byte in %d byte alignment from %08x\n", size, size, alignment, heap);
JUT_PANIC(831, "abort\n");
JUT_PANIC("abort\n");
}
// attempt to reconstruct function but lazy
@ -393,11 +402,12 @@ JKRHeap::TState::TState(const JKRHeap::TState &other, const JKRHeap::TState::TLo
#if DEBUG
static void genData()
{
JUT_LOG_F(1000, "heap unchanged");
JUT_LOG_F(1001, "**** heap changed ****");
JUT_LOG_F(1002, "location : [%s:%d]");
JUT_LOG_F(1003, "**** heap changed : old ****");
JUT_LOG_F(1004, "**** heap changed : new ****");
#line 1000
JUT_LOG_F("heap unchanged");
JUT_LOG_F("**** heap changed ****");
JUT_LOG_F("location : [%s:%d]");
JUT_LOG_F("**** heap changed : old ****");
JUT_LOG_F("**** heap changed : new ****");
}
#endif
@ -407,8 +417,9 @@ JKRHeap::TState::~TState()
}
void JKRHeap::state_register(JKRHeap::TState * p, u32) const {
JUT_ASSERT(1132, p != 0);
JUT_ASSERT(1133, p->getHeap() == this);
#line 1132
JUT_ASSERT(p != 0);
JUT_ASSERT(p->getHeap() == this);
}
bool JKRHeap::state_compare(const JKRHeap::TState &r1, const JKRHeap::TState &r2) const {
@ -418,14 +429,16 @@ bool JKRHeap::state_compare(const JKRHeap::TState &r1, const JKRHeap::TState &r2
// fabricated, but probably matches(except for line numbers)
void JKRHeap::state_dumpDifference(const JKRHeap::TState & r1, const JKRHeap::TState & r2) {
JUT_LOG_F(1157, "heap : %p / %p", r1.getHeap(), r2.getHeap());
JUT_LOG_F(1158, "check-code : 0x%08x / 0x%08x", r1.getCheckCode(), r2.getCheckCode());
JUT_LOG_F(1159, "id : 0x%08x / 0x%08x", r1.getId(), r2.getId());
JUT_LOG_F(1160, "used size : %10u / %10u", r1.getUsedSize(), r2.getUsedSize());
#line 1157
JUT_LOG_F("heap : %p / %p", r1.getHeap(), r2.getHeap());
JUT_LOG_F("check-code : 0x%08x / 0x%08x", r1.getCheckCode(), r2.getCheckCode());
JUT_LOG_F("id : 0x%08x / 0x%08x", r1.getId(), r2.getId());
JUT_LOG_F("used size : %10u / %10u", r1.getUsedSize(), r2.getUsedSize());
}
void JKRHeap::state_dump(const TState & state) const {
JUT_LOG_F(1165, "check-code : 0x%08x", state.getCheckCode());
JUT_LOG_F(1166, "id : 0x%08x", state.getId());
JUT_LOG_F(1167, "used size : %u", state.getUsedSize());
#line 1165
JUT_LOG_F("check-code : 0x%08x", state.getCheckCode());
JUT_LOG_F("id : 0x%08x", state.getId());
JUT_LOG_F("used size : %u", state.getUsedSize());
}

View File

@ -52,9 +52,10 @@ JKRMemArchive::~JKRMemArchive()
#if DEBUG // function is needed to generate certain strings first, however this is not what the original function looks like
void JKRMemArchive::fixedInit(s32)
{
JUT_ASSERT(200, isMounted());
JUT_PANIC(200, "mMountCount == 1"); // some member is called mMountCount, if there's a game with this assert, fix
JUT_ASSERT(200, mArcHeader->signature == 'RARC');
#line 200
JUT_ASSERT(isMounted());
JUT_PANIC("mMountCount == 1"); // some member is called mMountCount, if there's a game with this assert, fix
JUT_ASSERT(mArcHeader->signature == 'RARC');
}
#endif
@ -98,7 +99,8 @@ bool JKRMemArchive::open(s32 entryNum, JKRArchive::EMountDirection mountDirectio
}
else
{
JUT_ASSERT(438, mArcHeader->signature == 'RARC');
#line 438
JUT_ASSERT(mArcHeader->signature == 'RARC');
mArcInfoBlock = (SArcDataInfo *)((u8 *)mArcHeader + mArcHeader->header_length);
mDirectories = (SDIDirEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->node_offset);
mFileEntries = (SDIFileEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->file_entry_offset);
@ -120,8 +122,9 @@ bool JKRMemArchive::open(s32 entryNum, JKRArchive::EMountDirection mountDirectio
bool JKRMemArchive::open(void *buffer, u32 bufferSize, JKRMemBreakFlag flag)
{
#line 490
mArcHeader = (SArcHeader *)buffer;
JUT_ASSERT(491, mArcHeader->signature == 'RARC');
JUT_ASSERT(mArcHeader->signature == 'RARC');
mArcInfoBlock = (SArcDataInfo *)((u8 *)mArcHeader + mArcHeader->header_length);
mDirectories = (SDIDirEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->node_offset);
mFileEntries = (SDIFileEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->file_entry_offset);
@ -135,7 +138,8 @@ bool JKRMemArchive::open(void *buffer, u32 bufferSize, JKRMemBreakFlag flag)
void *JKRMemArchive::fetchResource(SDIFileEntry *fileEntry, u32 *resourceSize)
{
JUT_ASSERT(555, isMounted())
#line 555
JUT_ASSERT(isMounted())
if (!fileEntry->mData)
fileEntry->mData = mArchiveData + fileEntry->mDataOffset;
@ -149,7 +153,8 @@ void *JKRMemArchive::fetchResource(SDIFileEntry *fileEntry, u32 *resourceSize)
void *JKRMemArchive::fetchResource(void *buffer, u32 bufferSize, SDIFileEntry *fileEntry,
u32 *resourceSize)
{
JUT_ASSERT(595, isMounted())
#line 595
JUT_ASSERT(isMounted())
u32 srcLength = fileEntry->mSize;
if (srcLength > bufferSize)
@ -179,7 +184,8 @@ void *JKRMemArchive::fetchResource(void *buffer, u32 bufferSize, SDIFileEntry *f
void JKRMemArchive::removeResourceAll(void)
{
JUT_ASSERT(642, isMounted());
#line 642
JUT_ASSERT(isMounted());
if (mArcInfoBlock == nullptr)
return;
@ -200,7 +206,8 @@ void JKRMemArchive::removeResourceAll(void)
bool JKRMemArchive::removeResource(void *resource)
{
JUT_ASSERT(673, isMounted());
#line 673
JUT_ASSERT(isMounted());
SDIFileEntry *fileEntry = findPtrResource(resource);
if (!fileEntry)
@ -233,7 +240,8 @@ u32 JKRMemArchive::fetchResource_subroutine(u8 *src, u32 srcLength, u8 *dst, u32
default:
{
JUT_PANIC(723, "??? bad sequence\n");
#line 723
JUT_PANIC("??? bad sequence\n");
return 0;
}
}

View File

@ -277,11 +277,12 @@ bool JKRSolidHeap::dump(void)
return result;
}
// same issue as pik2: instructions get scheduled incorrectly, #pragma scheduling off gets close but not correct
// only matches with 1.3.2 for release
void JKRSolidHeap::state_register(JKRHeap::TState *p, u32 id) const
{
JUT_ASSERT(603, p != 0);
JUT_ASSERT(604, p->getHeap() == this);
#line 603
JUT_ASSERT(p != 0);
JUT_ASSERT(p->getHeap() == this);
getState_(p);
setState_u32ID_(p, id);
@ -294,7 +295,8 @@ void JKRSolidHeap::state_register(JKRHeap::TState *p, u32 id) const
bool JKRSolidHeap::state_compare(JKRHeap::TState const &r1, JKRHeap::TState const &r2) const
{
JUT_ASSERT(631, r1.getHeap() == r2.getHeap());
#line 631
JUT_ASSERT(r1.getHeap() == r2.getHeap());
bool result = true;
if (r1.getCheckCode() != r2.getCheckCode())

View File

@ -23,7 +23,7 @@ u32 JKRThreadSwitch::sTotalCount;
JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadListLink(this) {
JKRHeap* heap = JKRHeap::findFromRoot(this);
if (heap == NULL) {
if (heap == nullptr) {
heap = JKRHeap::getSystemHeap();
}
@ -33,7 +33,7 @@ JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadLi
JKRThread::JKRThread(JKRHeap* heap, u32 stack_size, int message_count, int param_4)
: mThreadListLink(this) {
if (heap == NULL) {
if (heap == nullptr) {
heap = JKRHeap::getCurrentHeap();
}
@ -66,9 +66,10 @@ JKRThread::~JKRThread()
void JKRThread::setCommon_mesgQueue(JKRHeap* heap, int msgCount)
{
mMessageCount = msgCount;
#line 128
mMessageCount = msgCount;
mMesgBuffer = (OSMessage*)JKRHeap::alloc(mMessageCount << 2, 0, heap);
JUT_ASSERT(130, mMesgBuffer);
JUT_ASSERT(mMesgBuffer);
OSInitMessageQueue(&mMessageQueue, (void**)mMesgBuffer, mMessageCount);
JKRThread::sThreadList.append(&mThreadListLink);
@ -78,14 +79,15 @@ void JKRThread::setCommon_mesgQueue(JKRHeap* heap, int msgCount)
BOOL JKRThread::setCommon_heapSpecified(JKRHeap* heap, unsigned long stackSize, int threadPriority)
{
mHeap = heap;
#line 161
mHeap = heap;
mStackSize = stackSize & ~0x1F;
mStackMemory = JKRHeap::alloc(mStackSize, 0x20, mHeap);
JUT_ASSERT(164, mStackMemory);
JUT_ASSERT(mStackMemory);
// maybe a custom struct is used here, investigate someday
mThreadRecord = (OSThread*)JKRHeap::alloc(sizeof(OSThread) + 8, 0x20, mHeap);
JUT_ASSERT(168, mThreadRecord);
JUT_ASSERT(mThreadRecord);
return OSCreateThread(mThreadRecord, &JKRThread::start, this, (void*)((u32)mStackMemory + mStackSize), mStackSize, threadPriority, 1);
}
@ -132,7 +134,8 @@ JKRThreadSwitch::JKRThreadSwitch(JKRHeap *param_0)
}
JKRThreadSwitch* JKRThreadSwitch::createManager(JKRHeap* heap) {
JUT_ASSERT(0x157, sManager == 0);
#line 343
JUT_ASSERT(sManager == 0);
if (!heap) {
heap = JKRGetCurrentHeap();
@ -196,7 +199,8 @@ void JKRThreadSwitch::callback(OSThread* current, OSThread* next) {
} else {
switch (thread->getCurrentHeapError()) {
case 0:
JUT_PANIC(0x1fc, "JKRThreadSwitch: currentHeap destroyed.");
#line 508
JUT_PANIC("JKRThreadSwitch: currentHeap destroyed.");
break;
case 1:
JUTWarningConsole("JKRThreadSwitch: currentHeap destroyed.\n");

View File

@ -52,7 +52,8 @@ void JUTConsole::print_f(char const *text, ...)
void JUTConsole_print_f_va_(JUTConsole *console, const char *text, va_list args)
{
char buf[1024];
JUT_ASSERT(563, console!=0);
#line 563
JUT_ASSERT(console!=0);
vsnprintf(buf, sizeof(buf), text, args);
console->print(buf);
}
@ -117,6 +118,7 @@ JUTConsoleManager::JUTConsoleManager()
JUTConsoleManager *JUTConsoleManager::createManager(JKRHeap *pHeap)
{
#line 563
JUT_ASSERT(924, sManager == 0);
if (pHeap == nullptr)
{
@ -127,9 +129,11 @@ JUTConsoleManager *JUTConsoleManager::createManager(JKRHeap *pHeap)
void JUTConsoleManager::appendConsole(JUTConsole *console)
{
JUT_ASSERT(961, sManager != 0 && console != 0);
// maybe local soLink_
JUT_ASSERT(964, soLink_.Find( console ) == soLink_.end());
#line 961
JUT_ASSERT(sManager != 0 && console != 0);
// not sure why this asser was 3 lines later
JUT_ASSERT(soLink_.Find( console ) == soLink_.end());
soLink_.Push_back(console);
if (mActiveConsole == nullptr)
{

View File

@ -3,7 +3,8 @@
#include "Kameda/Scene.h"
Scene::Scene(JKRArchive * archive, JKRHeap* heap) {
JUT_ASSERT(27, heap);
#line 27
JUT_ASSERT(heap);
mArchive = archive;
mOrtho = System::getJ2DOrtho();
}

View File

@ -224,7 +224,8 @@ void KartChecker::setPlayerKartColor(KartInfo *kartInfo)
{
if (RaceMgr::getManager()->isLANMode())
{
JUT_MINMAX_ASSERT(1004, 0, mTargetKartNo, 8);
#line 1004
JUT_MINMAX_ASSERT(0, mTargetKartNo, 8);
mPlayerKartColor = sPlayerKartColorTable[mTargetKartNo];
}
else
@ -429,7 +430,8 @@ void KartChecker::checkKartLap()
break;
}
}
JUT_ASSERT_F(1293, inSector, "NOT INSIDE SCT%d", nextSector->getGeneration());
#line 1293
JUT_ASSERT_F(inSector, "NOT INSIDE SCT%d", nextSector->getGeneration());
if (!inSector)
nextSector = nullptr;
}
@ -460,7 +462,8 @@ void KartChecker::checkKartLap()
{
mSectorProgression = unitDist;
mLapProgression = (mSectorProgression * mSector2->getMainSector()->getSectorDist() + mSector2->getMainSector()->getTotalPriorDist()) / RCMGetCourse()->getTrackSectorDist();
JUT_ASSERT_F(1388, isUDValid(), "UD:%5.3f,P:%8.3f,%8.3f,%8.3f", mLapProgression, mPos.x, mPos.y, mPos.z);
#line 1388
JUT_ASSERT_F(isUDValid(), "UD:%5.3f,P:%8.3f,%8.3f,%8.3f", mLapProgression, mPos.x, mPos.y, mPos.z);
}
f32 lapProgDiff = mLapProgression - mPrevLapProgression;
@ -645,7 +648,8 @@ void KartChecker::setLapTime()
}
}
}
JUT_MINMAX_ASSERT(1687, 0, mLap, mMaxLap);
#line 1687
JUT_MINMAX_ASSERT(0, mLap, mMaxLap);
mBestLapTimes[mLap].set(computedTime);
if (!isMaxTotalTime())
@ -732,8 +736,8 @@ bool KartChecker::setPass(int sectorIdx)
pass = true;
int bitIndex = sectorIdx % 32;
valid = false;
JUT_MINMAX_ASSERT(1791, 0, index, mNumBitfields);
#line 1791
JUT_MINMAX_ASSERT(0, index, mNumBitfields);
mPassedSectors[index] |= (1 << bitIndex);
}
return pass;
@ -896,7 +900,8 @@ bool KartChecker::incMyBombPoint(int pnt, int increment)
{
for (int pntNo = mBombPoint; pntNo < bombPoint; pntNo++)
{
JUT_MINMAX_ASSERT(2071, 0, pntNo, 10);
#line 2071
JUT_MINMAX_ASSERT(0, pntNo, 10);
mBombPointTable[pntNo] = -1;
}
if (bombPoint == sBombPointFull - 1)
@ -906,7 +911,8 @@ bool KartChecker::incMyBombPoint(int pnt, int increment)
{
for (int pntNo = bombPoint; pntNo < mBombPoint; pntNo++)
{
JUT_MINMAX_ASSERT(2097, 0, pntNo, 10);
#line 2097
JUT_MINMAX_ASSERT(0, pntNo, 10);
mBombPointTable[pntNo] = pnt;
}
}
@ -1074,7 +1080,8 @@ void LapChecker::calc(const JGeometry::TVec3<f32> &pos)
{
mSectorDist = unitDist;
mLapUnitDist = (mSectorDist * mSector->getMainSector()->getSectorDist() + mSector->getMainSector()->getTotalPriorDist()) / RCMGetCourse()->getTrackSectorDist();
JUT_ASSERT_F(2430, isUDValid(), "LAP UD:%5.3f,P:%8.3f,%8.3f,%8.3f", mLapUnitDist, pos.x, pos.y, pos.z);
#line 2430
JUT_ASSERT_F(isUDValid(), "LAP UD:%5.3f,P:%8.3f,%8.3f,%8.3f", mLapUnitDist, pos.x, pos.y, pos.z);
}
}
}

View File

@ -352,7 +352,8 @@ KartInfo::~KartInfo() {
}
void KartInfo::setDriver(int driverNo, ECharID charID, KartGamePad * gamePad) {
JUT_MINMAX_ASSERT(632, 0, driverNo, 2);
#line 632
JUT_MINMAX_ASSERT(0, driverNo, 2);
mKartCharacters[driverNo].reset();
mKartCharacters[driverNo].setPad(gamePad);
mKartCharacters[driverNo].setCharDB(getCharDB(charID));

View File

@ -93,7 +93,8 @@ void RaceInfo::reset()
void RaceInfo::setConsoleTarget(int cnsNo, int target, bool p3)
{
JUT_MINMAX_ASSERT(453, 0, cnsNo, 4);
#line 453
JUT_MINMAX_ASSERT(0, cnsNo, 4);
_0x114[cnsNo] = target;
_0x11c[cnsNo] = p3;
}
@ -194,7 +195,8 @@ void RaceInfo::settingForAwardDemo()
for (int idx = 0; idx < getKartNumber(); idx++)
{
JUT_MINMAX_ASSERT(585, 0, idx, 3);
#line 585
JUT_MINMAX_ASSERT(0, idx, 3);
setKart(idx, sAwardDebugKartIDTable[idx], sAwardDebugDriver1IDTable[idx], 0, sAwardDebugDriver2IDTable[idx], 0);
}
}
@ -245,11 +247,13 @@ void RaceInfo::setRace(ERaceMode RaceMode, int kartCount, int playerCount, int c
void RaceInfo::setKart(int kartNo, EKartID kartID, ECharID charID1, KartGamePad *kartPad1, ECharID charID2, KartGamePad *kartPad2)
{
JUT_MINMAX_ASSERT(685, 0, kartNo, 8);
#line 685
JUT_MINMAX_ASSERT( 0, kartNo, 8);
KartInfo * kartInfo = &mKartInfo[kartNo];
kartInfo->setKartID(kartID);
JUT_ASSERT(694, charID1 != cCharIDNone);
JUT_ASSERT(695, charID2 != cCharIDNone);
#line 694
JUT_ASSERT(charID1 != cCharIDNone);
JUT_ASSERT(charID2 != cCharIDNone);
// this meme must stay alive
for (int idx = 0; 2 > idx; ++idx) // the most useful loop ever
@ -283,8 +287,10 @@ void RaceInfo::shuffleStartNo()
for (u32 i = 0; i < (u32)getKartNumber(); i++)
{
#line 750
u32 dst = i + (rndm.get() % (getKartNumber() - i));
JUT_MAX_ASSERT(751, dst, getKartNumber());
JUT_MAX_ASSERT(dst, getKartNumber());
int playerStartIdx = mStartPosIndex[i];
mStartPosIndex[i] = mStartPosIndex[dst];
mStartPosIndex[dst] = playerStartIdx;
@ -293,6 +299,7 @@ void RaceInfo::shuffleStartNo()
void RaceInfo::hideConsole(u32 viewNo)
{
JUT_MINMAX_ASSERT(772, 1, viewNo, 5);
#line 772
JUT_MINMAX_ASSERT(1, viewNo, 5);
mHideConsole = mHideConsole | (1 << viewNo);
}

View File

@ -271,8 +271,9 @@ RaceMgr::RaceMgr(RaceInfo *raceInfo) : mRaceInfo(nullptr),
mAwardArc = nullptr;
if (isAwardDemoMode())
{
#line 2184
mAwardArc = ResMgr::getArchive(ResMgr::mcArcAward);
JUT_ASSERT_MSG(2185, mAwardArc, "NOT LOAD AWARD ARC");
JUT_ASSERT_MSG(mAwardArc, "NOT LOAD AWARD ARC");
}
SYSDBG_SetHeapGroup("OBJECT MGR", nullptr);
CreateGeoObjMgr(mCourse->getCrsData());
@ -1331,7 +1332,8 @@ bool RaceMgr::isAbleStart() const
void RaceMgr::setJugemZClr(u32 viewNo, bool clear)
{
JUT_MINMAX_ASSERT(4353, 0, viewNo, mRaceInfo->getConsoleNumber());
#line 4353
JUT_MINMAX_ASSERT(0, viewNo, mRaceInfo->getConsoleNumber());
Console *console = &mConsole[viewNo];
if (clear)
console->setJugemZClr();
@ -1362,7 +1364,8 @@ bool RaceMgr::getStartPoint(JGeometry::TVec3f *position, JGeometry::TVec3f *dire
position->set(0.0f, 0.0f, 0.0f); // .zero exists
direction->set(0.0f, 0.0f, 1.0f);
JUT_MINMAX_ASSERT(4396, 0, kartNo, getKartNumber());
#line 4396
JUT_MINMAX_ASSERT(0, kartNo, getKartNumber());
int startPosIdx = mRaceInfo->mStartPosIndex[kartNo];
u8 startID = getStartID(startPosIdx);
int tindex = -1;
@ -1394,8 +1397,9 @@ bool RaceMgr::getStartPoint(JGeometry::TVec3f *position, JGeometry::TVec3f *dire
}
if (getCourse()->getCrsData())
{
#line 4437
CrsData::StartPoint *startPoint = getCourse()->getCrsData()->getStartPoint(startID);
JUT_ASSERT_F(4437, startPoint, "NOT FOUND START:%d", startID);
JUT_ASSERT_F(startPoint, "NOT FOUND START:%d", startID);
isRight = startPoint->isRight();
startPoint->getPosition(position);
startPoint->getFrDirection(direction);
@ -1421,7 +1425,8 @@ bool RaceMgr::getStartPoint(JGeometry::TVec3f *position, JGeometry::TVec3f *dire
{-167.0f, 0.0f, 250.0f},
{-500.0f, 0.0f, 250.0f}};
JGeometry::TVec3f startPos;
JUT_MINMAX_ASSERT(4480, 0, tindex, 18);
#line 4480
JUT_MINMAX_ASSERT(0, tindex, 18);
const f32 startPosX = startPosTable[tindex][0];
const f32 startPosZ = startPosTable[tindex][2];
startPos.set(startPosX, 0.0f, startPosZ);
@ -1448,7 +1453,7 @@ bool RaceMgr::getStartPoint(JGeometry::TVec3f *position, JGeometry::TVec3f *dire
f32 RaceMgr::getStartJugemOffsetY(int kartNo)
{
f32 y = 0.0f;
JUT_MINMAX_ASSERT(4507, 0, kartNo, getKartNumber())
JUT_MINMAX_ASSERT(0, kartNo, getKartNumber());
u8 startID = getStartID(mRaceInfo->mStartPosIndex[kartNo]);
if (getCourse()->getCrsData())
y = getCourse()->getCrsData()->getStartPoint(startID)->getJugemOffsetY();

View File

@ -35,7 +35,8 @@ bool GPRecord::less(const GPRecord &rRec) {
if ((_6 & 1) == 0)
ret = true;
else {
JUT_ASSERT(82, rRec.mLevel == mLevel);
#line 82
JUT_ASSERT(rRec.mLevel == mLevel);
if (rRec._4 < _4)
ret = true;
else { // can this be cleaned up somehow?

View File

@ -25,10 +25,10 @@ void SaveFile::makeCRCTable()
u32 SaveFile::getCRC(u8 *pBegin, u8 *pEndNext)
{
u32 crc = 0xffffffff;
JUT_ASSERT(59, pBegin);
JUT_ASSERT(60, pEndNext);
JUT_ASSERT(61, pBegin < pEndNext);
#line 59
JUT_ASSERT(pBegin);
JUT_ASSERT(pEndNext);
JUT_ASSERT(pBegin < pEndNext);
if (!msCRCTableComputed)
makeCRCTable();

View File

@ -419,46 +419,24 @@ namespace System {
f32 get3DVpW() { return SystemData::sc3DViewPort.W; }
f32 get3DVpH() { return SystemData::sc3DViewPort.H; }
// how the hell did they format this
f32 get3DVpDiv2X(u8 pos) {
JUT_ASSERT(788, pos < 2);
return SystemData::sca3DViewPortDiv2[(u32)pos].X;
}
f32 get3DVpDiv2Y(u8 pos) {
JUT_ASSERT(789, pos < 2);
return SystemData::sca3DViewPortDiv2[(u32)pos].Y;
}
f32 get3DVpDiv2W(u8 pos) {
JUT_ASSERT(790, pos < 2);
return SystemData::sca3DViewPortDiv2[(u32)pos].W;
}
f32 get3DVpDiv2H(u8 pos) {
JUT_ASSERT(791, pos < 2);
return SystemData::sca3DViewPortDiv2[(u32)pos].H;
}
// dumb formatting
#line 788
f32 get3DVpDiv2X(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DViewPortDiv2[(u32)pos].X; }
f32 get3DVpDiv2Y(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DViewPortDiv2[(u32)pos].Y; }
f32 get3DVpDiv2W(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DViewPortDiv2[(u32)pos].W; }
f32 get3DVpDiv2H(u8 pos) { JUT_ASSERT( pos < 2); return SystemData::sca3DViewPortDiv2[(u32)pos].H; }
f32 get3DVpDiv4X(u8 pos) {
JUT_ASSERT(793, pos < 4);
return SystemData::sca3DViewPortDiv4[(u32)pos].X;
}
f32 get3DVpDiv4Y(u8 pos) {
JUT_ASSERT(794, pos < 4);
return SystemData::sca3DViewPortDiv4[(u32)pos].Y;
}
f32 get3DVpDiv4W(u8 pos) {
JUT_ASSERT(795, pos < 4);
return SystemData::sca3DViewPortDiv4[(u32)pos].W;
}
f32 get3DVpDiv4H(u8 pos) {
JUT_ASSERT(796, pos < 4);
return SystemData::sca3DViewPortDiv4[(u32)pos].H;
}
f32 get3DVpDiv4X(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DViewPortDiv4[(u32)pos].X; }
f32 get3DVpDiv4Y(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DViewPortDiv4[(u32)pos].Y; }
f32 get3DVpDiv4W(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DViewPortDiv4[(u32)pos].W; }
f32 get3DVpDiv4H(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DViewPortDiv4[(u32)pos].H; }
f32 get3DVpSubX() { return SystemData::sc3DViewPortSub.X; }
f32 get3DVpSubY() { return SystemData::sc3DViewPortSub.Y; }
f32 get3DVpSubW() { return SystemData::sc3DViewPortSub.W; }
f32 get3DVpSubH() { return SystemData::sc3DViewPortSub.H; } // Unused
// Scissor data
u32 get2DScisX() { return SystemData::sc3DScissor.X; }
u32 get2DScisY() { return SystemData::sc3DScissor.Y; }
u32 get2DScisW() { return SystemData::sc3DScissor.W; }
@ -474,39 +452,15 @@ namespace System {
u32 get3DAwardScisW() { return SystemData::sc3DAwardScissor.W; }
u32 get3DAwardScisH() { return SystemData::sc3DAwardScissor.H; }
u32 get3DScisDiv2X(u8 pos) {
JUT_ASSERT(819, pos < 2);
return SystemData::sca3DScissorDiv2[(u32)pos].X;
}
u32 get3DScisDiv2Y(u8 pos) {
JUT_ASSERT(820, pos < 2);
return SystemData::sca3DScissorDiv2[(u32)pos].Y;
}
u32 get3DScisDiv2W(u8 pos) {
JUT_ASSERT(821, pos < 2);
return SystemData::sca3DScissorDiv2[(u32)pos].W;
}
u32 get3DScisDiv2H(u8 pos) {
JUT_ASSERT(822, pos < 2);
return SystemData::sca3DScissorDiv2[(u32)pos].H;
}
u32 get3DScisDiv2X(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DScissorDiv2[(u32)pos].X; }
u32 get3DScisDiv2Y(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DScissorDiv2[(u32)pos].Y; }
u32 get3DScisDiv2W(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DScissorDiv2[(u32)pos].W; }
u32 get3DScisDiv2H(u8 pos) { JUT_ASSERT(pos < 2); return SystemData::sca3DScissorDiv2[(u32)pos].H; }
u32 get3DScisDiv4X(u8 pos) {
JUT_ASSERT(824, pos < 4);
return SystemData::sca3DScissorDiv4[(u32)pos].X;
}
u32 get3DScisDiv4Y(u8 pos) {
JUT_ASSERT(825, pos < 4);
return SystemData::sca3DScissorDiv4[(u32)pos].Y;
}
u32 get3DScisDiv4W(u8 pos) {
JUT_ASSERT(826, pos < 4);
return SystemData::sca3DScissorDiv4[(u32)pos].W;
}
u32 get3DScisDiv4H(u8 pos) {
JUT_ASSERT(827, pos < 4);
return SystemData::sca3DScissorDiv4[(u32)pos].H;
}
u32 get3DScisDiv4X(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DScissorDiv4[(u32)pos].X; }
u32 get3DScisDiv4Y(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DScissorDiv4[(u32)pos].Y; }
u32 get3DScisDiv4W(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DScissorDiv4[(u32)pos].W; }
u32 get3DScisDiv4H(u8 pos) { JUT_ASSERT(pos < 4); return SystemData::sca3DScissorDiv4[(u32)pos].H; }
u32 get3DScisSubX() { return SystemData::sc3DScissorSub.X; }
u32 get3DScisSubY() { return SystemData::sc3DScissorSub.Y; }

View File

@ -49,7 +49,8 @@ int ItemShuffleMgr::calcRank(KartSlotRankDataSet rdata) {
}
}
// if ret == -1 hang, in the release version, just give the player a banana as failsafe
JUT_ASSERT(3995, ret != -1);
#line 3995
JUT_ASSERT(ret != -1);
if (ret == -1)
ret = 3;
@ -59,7 +60,8 @@ int ItemShuffleMgr::calcRank(KartSlotRankDataSet rdata) {
}
int ItemShuffleMgr::calcSlot(KartSlotRankDataSet &rdata, int p2, int p3, bool p4) {
JUT_MINMAX_ASSERT(4017, 0, rdata.kart_rank, rdata.data->kartCount);
#line 4017
JUT_MINMAX_ASSERT(0, rdata.kart_rank, rdata.data->kartCount);
u32 total = 0;
calcRaceUseNormalItem(&total, &rdata, p3);

View File

@ -548,7 +548,8 @@ stRandom *stGetRnd()
stRandom *stGetRnd(u32 idx)
{
JUT_ASSERT_F(924, stRandom::sRndMgr[idx]->permission, "Random can\'t get :%d", idx);
#line 924
JUT_ASSERT_F(stRandom::sRndMgr[idx]->permission, "Random can\'t get :%d", idx);
return stRandom::sRndMgr[idx];
}