mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-23 14:41:33 -04:00
Merge branch 'main' into 26-02-25-more-endian-fixes
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
set(CMAKE_BUILD_RPATH "$ORIGIN")
|
||||
elseif (APPLE)
|
||||
add_compile_options(-Wno-declaration-after-statement)
|
||||
add_compile_options(-Wno-declaration-after-statement)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
set(CMAKE_BUILD_RPATH "$ORIGIN")
|
||||
elseif (MSVC)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace JGadget {
|
||||
namespace search {
|
||||
template <typename T>
|
||||
struct TExpandStride_ {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef TARGET_PC
|
||||
static T get(T n) { return n << 3; }
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#ifdef _MSVC_LANG
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
|
||||
@@ -55,7 +55,7 @@ struct data {
|
||||
char* get() const { return (char*)getRaw(); }
|
||||
u8 get_formSupplement() const { return *(u8*)(get() + 0xB); }
|
||||
int get_number() const { return *(u16*)(get() + 0x8); }
|
||||
u32* getContent() const { return (u32*)((u32)getRaw() + 0x10); }
|
||||
u32* getContent() const { return (u32*)((uintptr_t)getRaw() + 0x10); }
|
||||
u32 get_form() const { return *(u8*)(get() + 0xA) & 0xF; }
|
||||
bool get_isOrdered() const { return *(u8*)(get() + 0xA) & 0xF0; }
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ private:
|
||||
class TFunctionValue_composite : public TFunctionValue, public TFunctionValueAttribute_refer {
|
||||
public:
|
||||
struct TData {
|
||||
TData(void* data) : u32data((u32)data) {}
|
||||
TData(void* data) : u32data((uintptr_t)data) {}
|
||||
TData(const void* data) : rawData(data) {}
|
||||
TData(u32 data) : u32data(data) {}
|
||||
TData(f32 data) : f32data(data) {}
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
const void* getSequence() const { return pSequence; }
|
||||
void setSequence_(const void* arg1) { pSequence = arg1; }
|
||||
const void* getSequence_offset(s32 i_no) const {
|
||||
int s32Val = (s32)getSequence();
|
||||
int s32Val = (intptr_t)getSequence();
|
||||
return (const void*)(s32Val + i_no);
|
||||
}
|
||||
const void* getSequence_next() const { return pSequence_next; }
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
s32 write(const void*, s32);
|
||||
void write(const char*);
|
||||
|
||||
#if defined(_MSVC_LANG) && defined(_WIN64)
|
||||
#ifdef TARGET_PC
|
||||
JSUOutputStream& operator<<(uintptr_t param_0) {
|
||||
write(¶m_0, sizeof(uintptr_t));
|
||||
return *this;
|
||||
|
||||
@@ -241,8 +241,8 @@ extern u8 __OSReport_Warning_disable;
|
||||
extern u8 __OSReport_System_disable;
|
||||
extern u8 __OSReport_enable;
|
||||
|
||||
#define OSRoundUp32B(x) (((u32)(x) + 32 - 1) & ~(32 - 1))
|
||||
#define OSRoundDown32B(x) (((u32)(x)) & ~(32 - 1))
|
||||
#define OSRoundUp32B(x) (((uintptr_t)(x) + 32 - 1) & ~(32 - 1))
|
||||
#define OSRoundDown32B(x) (((uintptr_t)(x)) & ~(32 - 1))
|
||||
|
||||
#ifdef TARGET_PC
|
||||
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ static const float INF = 2000000000.0f;
|
||||
#define UNSET_FLAG(var, flag, type) (var) &= ~(flag)
|
||||
#endif
|
||||
|
||||
#ifdef _MSVC_LANG
|
||||
#ifdef TARGET_PC
|
||||
template <int N>
|
||||
inline constexpr auto MultiCharLiteral(const char (&buf)[N]) {
|
||||
// static_assert(buf[0] == '\'' && buf[N - 2] == '\''); // can't constexpr strings, just pray
|
||||
|
||||
+2
-2
@@ -337,7 +337,7 @@ BOOL DynamicModuleControl::do_link() {
|
||||
u32 fixSizePtr;
|
||||
u32 fixSize = mModule->fixSize;
|
||||
u32 fixSize2 = (fixSize + 0x1f) & ~0x1f;
|
||||
fixSizePtr = (u32)mModule + fixSize2;
|
||||
fixSizePtr = (uintptr_t)mModule + fixSize2;
|
||||
s32 size = JKRGetMemBlockSize(NULL, mModule);
|
||||
if (size < 0) {
|
||||
void* bss = JKRAlloc(mModule->bssSize, 0x20);
|
||||
@@ -462,7 +462,7 @@ extern "C" void ModuleUnresolved() {
|
||||
OSReport_Error("Address: Back Chain LR Save\n");
|
||||
u32 i = 0;
|
||||
u32* stackPtr = (u32*)OSGetStackPointer();
|
||||
while ((stackPtr != NULL) && ((u32)stackPtr != 0xFFFFFFFF) && (i++ < 0x10)) {
|
||||
while ((stackPtr != NULL) && ((uintptr_t) stackPtr != 0xFFFFFFFF) && (i++ < 0x10)) {
|
||||
OSReport_Error("0x%08x: 0x%08x 0x%08x\n", stackPtr, *stackPtr, *(stackPtr + 1));
|
||||
stackPtr = (u32*)*stackPtr;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ bool JAIStream::prepare_prepareStream_() {
|
||||
|
||||
streamAramAddr_ = streamAramMgr->newStreamAram(&local_28);
|
||||
if (streamAramAddr_ != NULL) {
|
||||
inner_.aramStream_.init((u32)streamAramAddr_, local_28, &JAIStream_JASAramStreamCallback_, this);
|
||||
inner_.aramStream_.init((uintptr_t)streamAramAddr_, local_28, &JAIStream_JASAramStreamCallback_, this);
|
||||
field_0x290 = 1;
|
||||
prepareCount_ = 0;
|
||||
} else {
|
||||
|
||||
@@ -59,7 +59,7 @@ void JAIStreamMgr::freeDeadStream_() {
|
||||
mStreamList.remove(i);
|
||||
void* aramAddr = stream->JAIStreamMgr_getAramAddr_();
|
||||
if (aramAddr != NULL) {
|
||||
bool result = mStreamAramMgr->deleteStreamAram((u32)aramAddr);
|
||||
bool result = mStreamAramMgr->deleteStreamAram((uintptr_t)aramAddr);
|
||||
JUT_ASSERT(105, result);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ void JASDriver::finishDSPFrame() {
|
||||
JASAudioThread::setDSPSyncCount(getSubFrames());
|
||||
JASProbe::start(7, "DSP-MAIN");
|
||||
u32 r27 = getFrameSamples();
|
||||
JASDsp::syncFrame(getSubFrames(), u32(sDspDacBuffer[sDspDacWriteBuffer]), u32(sDspDacBuffer[sDspDacWriteBuffer] + r27));
|
||||
JASDsp::syncFrame(getSubFrames(), uintptr_t(sDspDacBuffer[sDspDacWriteBuffer]), uintptr_t(sDspDacBuffer[sDspDacWriteBuffer] + r27));
|
||||
sDspStatus = 1;
|
||||
updateDSP();
|
||||
if (sDspDacCallback) {
|
||||
|
||||
@@ -583,7 +583,7 @@ void JASAramStream::updateChannel(u32 i_callbackType, JASChannel* i_channel,
|
||||
s32 JASAramStream::channelProc() {
|
||||
OSMessage msg;
|
||||
while (OSReceiveMessage(&field_0x020, &msg, OS_MESSAGE_NOBLOCK)) {
|
||||
switch ((u32)msg) {
|
||||
switch ((uintptr_t)msg) {
|
||||
case 4:
|
||||
field_0x0ac = true;
|
||||
break;
|
||||
@@ -598,12 +598,12 @@ s32 JASAramStream::channelProc() {
|
||||
}
|
||||
|
||||
while (OSReceiveMessage(&field_0x000, &msg, OS_MESSAGE_NOBLOCK)) {
|
||||
switch ((u32)msg & 0xff) {
|
||||
switch ((uintptr_t)msg & 0xff) {
|
||||
case 0:
|
||||
channelStart();
|
||||
break;
|
||||
case 1:
|
||||
channelStop(JSUHiHalf((u32)msg));
|
||||
channelStop(JSUHiHalf((uintptr_t)msg));
|
||||
break;
|
||||
case 2:
|
||||
field_0x0ae |= 1;
|
||||
|
||||
@@ -12,8 +12,8 @@ void JASCalc::imixcopy(const s16* s1, const s16* s2, s16* dst, u32 n) {
|
||||
}
|
||||
|
||||
void JASCalc::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(226, (reinterpret_cast<uintptr_t>(src) & 0x03) == 0);
|
||||
JUT_ASSERT(227, (reinterpret_cast<uintptr_t>(dest) & 0x03) == 0);
|
||||
JUT_ASSERT(228, (size & 0x0f) == 0);
|
||||
|
||||
u32 copy1, copy2, copy3, copy4;
|
||||
@@ -40,8 +40,8 @@ void JASCalc::bcopy(const void* src, void* dest, u32 size) {
|
||||
u8* bsrc = (u8*)src;
|
||||
u8* bdest = (u8*)dest;
|
||||
|
||||
u8 endbitsSrc = (reinterpret_cast<u32>(bsrc) & 0x03);
|
||||
u8 enbitsDst = (reinterpret_cast<u32>(bdest) & 0x03);
|
||||
u8 endbitsSrc = (reinterpret_cast<uintptr_t>(bsrc) & 0x03);
|
||||
u8 enbitsDst = (reinterpret_cast<uintptr_t>(bdest) & 0x03);
|
||||
if ((endbitsSrc) == (enbitsDst) && (size & 0x0f) == 0) {
|
||||
bcopyfast(src, dest, size);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ void JASCalc::bcopy(const void* src, void* dest, u32 size) {
|
||||
}
|
||||
|
||||
void JASCalc::bzerofast(void* dest, u32 size) {
|
||||
JUT_ASSERT(336, (reinterpret_cast<u32>(dest) & 0x03) == 0);
|
||||
JUT_ASSERT(336, (reinterpret_cast<uintptr_t>(dest) & 0x03) == 0);
|
||||
JUT_ASSERT(337, (size & 0x0f) == 0);
|
||||
|
||||
u32* udest = (u32*)dest;
|
||||
@@ -93,12 +93,12 @@ void JASCalc::bzerofast(void* dest, u32 size) {
|
||||
void JASCalc::bzero(void* dest, u32 size) {
|
||||
u32* udest;
|
||||
u8* bdest = (u8*)dest;
|
||||
if ((size & 0x1f) == 0 && (reinterpret_cast<u32>(dest) & 0x1f) == 0) {
|
||||
if ((size & 0x1f) == 0 && (reinterpret_cast<uintptr_t>(dest) & 0x1f) == 0) {
|
||||
DCZeroRange(dest, size);
|
||||
return;
|
||||
}
|
||||
|
||||
u8 alignedbitsDst = reinterpret_cast<u32>(bdest) & 0x3;
|
||||
u8 alignedbitsDst = reinterpret_cast<uintptr_t>(bdest) & 0x3;
|
||||
|
||||
if ((size & 0xf) == 0 && alignedbitsDst == 0) {
|
||||
bzerofast(dest, size);
|
||||
|
||||
@@ -435,7 +435,8 @@ void JASDsp::initBuffer() {
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
setFXLine(i, NULL, NULL);
|
||||
}
|
||||
DsetupTable(0x40, u32(CH_BUF), u32(&DSPRES_FILTER), u32(&DSPADPCM_FILTER), u32(FX_BUF));
|
||||
DsetupTable(0x40, uintptr_t(CH_BUF), uintptr_t(&DSPRES_FILTER), uintptr_t(&DSPADPCM_FILTER), uintptr_t(FX_BUF));
|
||||
|
||||
flushBuffer();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include <dolphin/ar.h>
|
||||
|
||||
#if !TARGET_PC
|
||||
JASHeap::JASHeap(JASDisposer* disposer) : mTree(this) {
|
||||
mDisposer = disposer;
|
||||
mBase = NULL;
|
||||
@@ -15,13 +16,14 @@ JASHeap::JASHeap(JASDisposer* disposer) : mTree(this) {
|
||||
field_0x40 = 0;
|
||||
OSInitMutex(&mMutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
void JASHeap::initRootHeap(void* param_0, u32 param_1) {
|
||||
JUT_ASSERT(97, ! isAllocated());
|
||||
JASMutexLock lock(&mMutex);
|
||||
mBase = (u8*)OSRoundUp32B(param_0);
|
||||
mBase = (u8*)OSRoundUp32B((uintptr_t)param_0);
|
||||
field_0x40 = NULL;
|
||||
mSize = param_1 - (u32(mBase) - u32(param_0));
|
||||
mSize = param_1 - (uintptr_t(mBase) - uintptr_t(param_0));
|
||||
}
|
||||
|
||||
bool JASHeap::alloc(JASHeap* mother, u32 param_1) {
|
||||
@@ -51,7 +53,8 @@ bool JASHeap::alloc(JASHeap* mother, u32 param_1) {
|
||||
if (r29 >= mother->mBase + local_2c) {
|
||||
break;
|
||||
}
|
||||
u32 local_3c = u32(it->mBase) - u32(r29);
|
||||
u32 local_3c = uintptr_t(it->mBase) - uintptr_t(r29);
|
||||
|
||||
if (local_3c >= param_1 && local_3c < r27) {
|
||||
local_30 = *it;
|
||||
local_34 = r29;
|
||||
|
||||
@@ -868,7 +868,7 @@ s32 JASSeqParser::cmdPrintf(JASTrack* param_0, u32* param_1) {
|
||||
stack_10[i] = (u8)seqCtrl->readByte();
|
||||
switch (stack_c[i]) {
|
||||
case 2:
|
||||
stack_10[i] = (u32)seqCtrl->getAddr(stack_10[i]);
|
||||
stack_10[i] = (uintptr_t)seqCtrl->getAddr(stack_10[i]);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
|
||||
@@ -153,7 +153,7 @@ bool JAUDynamicSeqDataBlocks::loadDynamicSeq(JAISoundID param_0, bool param_1,
|
||||
JASResArcLoader::loadResourceAsync(
|
||||
seqDataArchive_, resourceId,
|
||||
link->getObject()->region.addr, link->getObject()->region.size,
|
||||
JAUDynamicSeqDataBlocks_receiveLoaded_, (u32)link);
|
||||
JAUDynamicSeqDataBlocks_receiveLoaded_, (uintptr_t)link);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 entryNum, u32 length, JKRHeap*
|
||||
case COMPRESSION_YAZ0:
|
||||
{
|
||||
u8 headerBuf[0x40];
|
||||
u8* alignHeader = (u8*)ALIGN_NEXT((s32)&headerBuf[0], sizeof(SArcHeader));
|
||||
u8* alignHeader = (u8*)ALIGN_NEXT((intptr_t)&headerBuf[0], sizeof(SArcHeader));
|
||||
JKRAramToMainRam(entryNum, alignHeader, sizeof(SArcHeader), EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1, NULL);
|
||||
u32 decompressedLen = ALIGN_NEXT(JKRDecompExpandSize(alignHeader), sizeof(SArcHeader));
|
||||
buffer = (u8*)(JKRAllocFromHeap(pHeap, decompressedLen, sizeof(SArcHeader)));
|
||||
@@ -352,7 +352,7 @@ u32 JKRAramArchive::getExpandedResSize(const void* ptr) const {
|
||||
}
|
||||
|
||||
u8 tmpBuf[0x40];
|
||||
u8* buf = (u8*)ALIGN_PREV((s32)&tmpBuf[0x1F], 0x20);
|
||||
u8* buf = (u8*)ALIGN_PREV((intptr_t)&tmpBuf[0x1F], 0x20);
|
||||
JKRAramToMainRam(entry->data_offset + mBlock->getAddress(), buf, 0x20, EXPAND_SWITCH_UNKNOWN0,
|
||||
0, NULL, -1, NULL);
|
||||
u32 expandSize2 = JKRDecompExpandSize(buf);
|
||||
|
||||
@@ -38,7 +38,7 @@ JKRArchive* JKRArchive::mount(const char* path, EMountMode mountMode, JKRHeap* h
|
||||
|
||||
JKRArchive* JKRArchive::mount(void* ptr, JKRHeap* heap,
|
||||
EMountDirection mountDirection) {
|
||||
JKRArchive* archive = check_mount_already((s32)ptr, heap);
|
||||
JKRArchive* archive = check_mount_already((intptr_t)ptr, heap);
|
||||
if (archive) {
|
||||
return archive;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void* JKRDecomp::run() {
|
||||
}
|
||||
|
||||
if (command->mCallback) {
|
||||
(*command->mCallback)((u32)command);
|
||||
(*command->mCallback)((uintptr_t)command);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
if (!command->mCallback) {
|
||||
(*((JSUList<JKRADCommand>*)&sDvdAramAsyncList)).append(&command->mLink);
|
||||
} else {
|
||||
command->mCallback((u32)command);
|
||||
command->mCallback((uintptr_t)command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -523,11 +523,19 @@ void* operator new(size_t size, int alignment) {
|
||||
#else
|
||||
void* operator new(size_t size, int alignment) {
|
||||
if (sCurrentHeap == nullptr)
|
||||
#if TARGET_PC
|
||||
return aligned_alloc(alignment, size);
|
||||
#else
|
||||
return _aligned_malloc(size, alignment);
|
||||
#endif
|
||||
void* mem = JKRHeap::alloc(size, alignment, nullptr);
|
||||
if (mem == nullptr) {
|
||||
OSReport("[NEW] JKRHeap FULL! Fallback to aligned_malloc size %u\n", (unsigned)size);
|
||||
#if TARGET_PC
|
||||
return aligned_alloc(alignment, size);
|
||||
#else
|
||||
return _aligned_malloc(size, alignment);
|
||||
#endif
|
||||
}
|
||||
return mem;
|
||||
}
|
||||
@@ -560,10 +568,18 @@ void* operator new[](size_t size, int alignment) {
|
||||
#else
|
||||
void* operator new[](size_t size, int alignment) {
|
||||
if (sCurrentHeap == nullptr)
|
||||
#if TARGET_PC
|
||||
return aligned_alloc(alignment, size);
|
||||
#else
|
||||
return _aligned_malloc(size, alignment);
|
||||
#endif
|
||||
void* mem = JKRHeap::alloc(size, alignment, nullptr);
|
||||
if (mem == nullptr)
|
||||
#if TARGET_PC
|
||||
return aligned_alloc(alignment, size);
|
||||
#else
|
||||
return _aligned_malloc(size, alignment);
|
||||
#endif
|
||||
return mem;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@ JKRMemArchive::JKRMemArchive(s32 entryNum, JKRArchive::EMountDirection mountDire
|
||||
}
|
||||
|
||||
JKRMemArchive::JKRMemArchive(void* buffer, u32 bufferSize, JKRMemBreakFlag param_3)
|
||||
: JKRArchive((s32)buffer, MOUNT_MEM) {
|
||||
: JKRArchive((intptr_t)buffer, MOUNT_MEM) {
|
||||
mIsMounted = false;
|
||||
if (!open(buffer, bufferSize, param_3)) {
|
||||
return;
|
||||
|
||||
@@ -317,8 +317,7 @@ void JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(
|
||||
f32 param_1, JStudio::TAdaptor* adaptor) const {
|
||||
JStage::TActor* actor = static_cast<TAdaptor_actor*>(adaptor)->get_pJSG_();
|
||||
// not sure what this bit is
|
||||
u32 idx = *(u32*)(((u32)adaptor - 1) + field_0x8);
|
||||
|
||||
u32 idx = *(u32*)(((uintptr_t)adaptor - 1) + field_0x8);
|
||||
u8 idx_lowBytes = idx;
|
||||
u8 idx_highBytes = idx >> 8;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ u32 JSUMemoryInputStream::readData(void* pData, s32 length) {
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
memcpy(pData, (void*)((s32)mBuffer + mPosition), length);
|
||||
memcpy(pData, (void*)((intptr_t)mBuffer + mPosition), length);
|
||||
mPosition += length;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ s32 JSUMemoryOutputStream::writeData(const void* pData, s32 length) {
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
memcpy((void*)((s32)mBuffer + mPosition), pData, length);
|
||||
memcpy((void*)((intptr_t)mBuffer + mPosition), pData, length);
|
||||
mPosition += length;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
|
||||
}
|
||||
|
||||
if (cacheBuffer != NULL) {
|
||||
JUT_ASSERT(352, ( (u32)cacheBuffer & 0x1f ) == 0);
|
||||
JUT_ASSERT(352, ( (uintptr_t)cacheBuffer & 0x1f ) == 0);
|
||||
mCacheBuffer = cacheBuffer;
|
||||
field_0xb0 = 0;
|
||||
} else {
|
||||
@@ -356,8 +356,7 @@ void JUTCacheFont::getGlyphFromAram(JUTCacheFont::TGlyphCacheInfo* param_0,
|
||||
*param_3 = iVar2;
|
||||
*r30 -= iVar2 * iVar3;
|
||||
u8* result =
|
||||
JKRAramToMainRam((u32)param_0->mPrev + pGylphCacheInfo->field_0x10 * iVar2, pCachePage->mImage,
|
||||
pGylphCacheInfo->field_0x10, EXPAND_SWITCH_UNKNOWN0, 0, NULL, 0xffffffff, NULL);
|
||||
JKRAramToMainRam((uintptr_t) param_0->mPrev + pGylphCacheInfo->field_0x10 * iVar2, pCachePage->mImage, pGylphCacheInfo->field_0x10, EXPAND_SWITCH_UNKNOWN0, 0, NULL, 0xffffffff, NULL);
|
||||
JUT_ASSERT(624, result);
|
||||
GXInitTexObj(&pCachePage->mTexObj, pCachePage->mImage, pGylphCacheInfo->mWidth, pGylphCacheInfo->mHeight,
|
||||
(GXTexFmt)pGylphCacheInfo->mTexFormat, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
|
||||
@@ -30,7 +30,7 @@ JUTConsole* JUTConsole::create(unsigned int param_0, void* buffer, u32 bufferSiz
|
||||
JUTConsoleManager* pManager = JUTConsoleManager::getManager();
|
||||
JUT_ASSERT(59, pManager != NULL);
|
||||
|
||||
JUT_ASSERT(62, ( (u32)buffer & 0x3 ) == 0);
|
||||
JUT_ASSERT(62, ( (uintptr_t)buffer & 0x3 ) == 0);
|
||||
u32 maxLines = getLineFromObjectSize(bufferSize, param_0);
|
||||
|
||||
JUTConsole* console = new (buffer) JUTConsole(param_0, maxLines, false);
|
||||
|
||||
@@ -765,7 +765,7 @@ void JUTException::createFB() {
|
||||
u32 size = (u16(ALIGN_NEXT(u16(renderMode->fbWidth), 16)) * renderMode->xfbHeight) * 2;
|
||||
|
||||
void* begin = (void*)ALIGN_PREV((uintptr_t)end - size, 32);
|
||||
void* object = (void*)ALIGN_PREV((s32)begin - sizeof(JUTExternalFB), 32);
|
||||
void* object = (void*)ALIGN_PREV((intptr_t)begin - sizeof(JUTExternalFB), 32);
|
||||
new (object) JUTExternalFB(renderMode, GX_GM_1_7, begin, size);
|
||||
|
||||
mDirectPrint->changeFrameBuffer(begin, renderMode->fbWidth, renderMode->efbHeight);
|
||||
|
||||
@@ -487,7 +487,7 @@ void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3<f32>& pos, f32 para
|
||||
JUT_ASSERT(747, curSoundIndex_ < animation_->getNumSounds());
|
||||
|
||||
const JAUSoundAnimationSound* animationSound = animation_->getSound(curSoundIndex_);
|
||||
u32 user_data = (u32)animationSound;
|
||||
u32 user_data = (uintptr_t)animationSound;
|
||||
if (reverse_) {
|
||||
curSoundIndex_--;
|
||||
} else {
|
||||
|
||||
@@ -62,4 +62,6 @@ BOOL cDmrNowMidnaTalk() {
|
||||
|
||||
u8 data_80450CA0;
|
||||
|
||||
#if !TARGET_PC
|
||||
JPTraceParticleCallBack4 JPTracePCB4;
|
||||
#endif
|
||||
|
||||
@@ -160,7 +160,7 @@ static void pl_check(bd_class* i_this) {
|
||||
}
|
||||
|
||||
if ((i_this->field_0x618 & 0xF) == 0) {
|
||||
var_r28 = (u32)fpcM_Search(s_a_sub, a_this);
|
||||
var_r28 = (u32)(uintptr_t)fpcM_Search(s_a_sub, a_this);
|
||||
}
|
||||
|
||||
if (daPy_getPlayerActorClass()->checkHorseRide()) {
|
||||
|
||||
@@ -1562,7 +1562,7 @@ int daE_HM_c::Create() {
|
||||
mAtInfo.mpSound = &mSound;
|
||||
|
||||
J3DModel* model = mAnm_p->getModel();
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) {
|
||||
if (i != 0) {
|
||||
|
||||
@@ -1958,7 +1958,7 @@ int daE_HZ_c::CreateHeap() {
|
||||
}
|
||||
|
||||
J3DModel* morfModel = mpMorfSO->getModel();
|
||||
morfModel->setUserArea((u32)this);
|
||||
morfModel->setUserArea((uintptr_t)this);
|
||||
for (u16 i = 0; i < morfModel->getModelData()->getJointNum(); i++) {
|
||||
if (i != 0) {
|
||||
morfModel->getModelData()->getJointNodePointer(i)->setCallBack(JointCallBack);
|
||||
|
||||
@@ -2157,7 +2157,7 @@ int daE_WW_c::CreateHeap() {
|
||||
}
|
||||
|
||||
J3DModel* model = mpModelMorf->getModel();
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
for (u16 i = JNT_BODY01; i < model->getModelData()->getJointNum(); i++) {
|
||||
if (i == JNT_NECK || i == JNT_HEAD) {
|
||||
model->getModelData()->getJointNodePointer(i)->setCallBack(JointCallBack);
|
||||
|
||||
@@ -3649,7 +3649,7 @@ static int useHeapInit2(fopAc_ac_c* i_actor) {
|
||||
if (i_this->mpModel[0] == 0) {
|
||||
return 0;
|
||||
}
|
||||
i_this->mpModel[0]->setUserArea((s32)i_this);
|
||||
i_this->mpModel[0]->setUserArea((uintptr_t)i_this);
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
i_this->mpModel[0]->mModelData->getJointNodePointer(i)->setCallBack(nodeCallBackLH);
|
||||
}
|
||||
@@ -3674,7 +3674,7 @@ static int useHeapInit2(fopAc_ac_c* i_actor) {
|
||||
if (i_this->mpModel[0] == 0) {
|
||||
return 0;
|
||||
}
|
||||
i_this->mpModel[0]->setUserArea((s32)i_this);
|
||||
i_this->mpModel[0]->setUserArea((uintptr_t)i_this);
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
i_this->mpModel[0]->mModelData->getJointNodePointer(i)->setCallBack(nodeCallBackBB);
|
||||
}
|
||||
@@ -3732,7 +3732,7 @@ static int useHeapImg_fisht(fopAc_ac_c* i_actor) {
|
||||
}
|
||||
|
||||
J3DModel* model = i_this->mpMorf->getModel();
|
||||
model->setUserArea((s32)i_this);
|
||||
model->setUserArea((uintptr_t)i_this);
|
||||
i_this->mNumJoints = fish_joint[i_this->mGedouKind];
|
||||
for (u16 i = 1; i < model->getModelData()->getJointNum(); i++) {
|
||||
model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack);
|
||||
|
||||
@@ -520,7 +520,7 @@ static u8 __THPReadHuffmanTableSpecification() {
|
||||
u16 length, num_Vij;
|
||||
|
||||
__THPHuffmanSizeTab = __THPWorkArea;
|
||||
__THPHuffmanCodeTab = (u16*)((u32)__THPWorkArea + 256 + 1);
|
||||
__THPHuffmanCodeTab = (u16*)((uintptr_t)__THPWorkArea + 256 + 1);
|
||||
length = (u16)((__THPInfo->c)[0] << 8 | (__THPInfo->c)[1]);
|
||||
__THPInfo->c += 2;
|
||||
length -= 2;
|
||||
@@ -618,8 +618,8 @@ static void __THPPrepBitStream() {
|
||||
u32* ptr;
|
||||
u32 offset, i, j, k;
|
||||
|
||||
ptr = (u32*)((u32)__THPInfo->c & 0xFFFFFFFC);
|
||||
offset = (u32)__THPInfo->c & 3;
|
||||
ptr = (u32*)((uintptr_t)__THPInfo->c & 0xFFFFFFFC);
|
||||
offset = (uintptr_t)__THPInfo->c & 3;
|
||||
ASSERTLINE(3799, __THPInfo->cnt <= 33);
|
||||
|
||||
if (__THPInfo->cnt != 33) {
|
||||
@@ -1685,7 +1685,7 @@ static void __THPHuffDecodeDCTCompY(__REGISTER THPFileInfo* info, THPCoeff* bloc
|
||||
|
||||
_FailedCheckEnoughBits:
|
||||
cnt += 5;
|
||||
maxcodebase = (u32) & (h->maxCode);
|
||||
maxcodebase = (uintptr_t) & (h->maxCode);
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
@@ -1826,7 +1826,7 @@ static void __THPHuffDecodeDCTCompY(__REGISTER THPFileInfo* info, THPCoeff* bloc
|
||||
goto _DoneDecodeTab;
|
||||
|
||||
_Read4 : {
|
||||
__REGISTER u32 maxcodebase = (u32) & (h->maxCode);
|
||||
__REGISTER u32 maxcodebase = (uintptr_t) & (h->maxCode);
|
||||
__REGISTER u32 tmp2;
|
||||
|
||||
// clang-format off
|
||||
@@ -1862,8 +1862,8 @@ static void __THPHuffDecodeDCTCompY(__REGISTER THPFileInfo* info, THPCoeff* bloc
|
||||
__REGISTER u32 mask = 0xFFFFFFFF << (33 - cnt);
|
||||
__REGISTER u32 tmp2;
|
||||
__REGISTER u32 tmp3;
|
||||
code = (s32)(cb & (~mask));
|
||||
mask = (u32) & (h->maxCode);
|
||||
code = (uintptr_t)(cb & (~mask));
|
||||
mask = (uintptr_t) & (h->maxCode);
|
||||
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
@@ -2027,7 +2027,7 @@ _done:
|
||||
__REGISTER u32 tmp2;
|
||||
|
||||
_FailedCheckEnoughBits:
|
||||
maxcodebase = (u32) & (h->maxCode);
|
||||
maxcodebase = (uintptr_t) & (h->maxCode);
|
||||
cnt += 5;
|
||||
|
||||
// clang-format off
|
||||
@@ -2133,7 +2133,7 @@ _FCEB_Done:
|
||||
return tmp;
|
||||
|
||||
_Read4 : {
|
||||
__REGISTER u32 maxcodebase = (u32) & (h->maxCode);
|
||||
__REGISTER u32 maxcodebase = (uintptr_t) & (h->maxCode);
|
||||
__REGISTER u32 tmp2;
|
||||
|
||||
// clang-format off
|
||||
@@ -2218,7 +2218,7 @@ _FailedCheckNoBits1:
|
||||
__REGISTER u32 tmp2;
|
||||
|
||||
code = (s32)(cb & (~mask));
|
||||
mask = (u32) & (h->maxCode);
|
||||
mask = (uintptr_t) & (h->maxCode);
|
||||
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
|
||||
@@ -474,7 +474,7 @@ int daNpc_Aru_c::CreateHeap() {
|
||||
for (u16 i = 0; i < mdlData_p->getJointNum(); i++) {
|
||||
mdlData_p->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm[0] = new daNpcT_MatAnm_c();
|
||||
if (mpMatAnm[0] == NULL) {
|
||||
|
||||
@@ -2615,7 +2615,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
|
||||
}
|
||||
|
||||
J3DModel* morfModel = a_this->mpMorf->getModel();
|
||||
morfModel->setUserArea((s32)i_this);
|
||||
morfModel->setUserArea((uintptr_t)i_this);
|
||||
|
||||
for (u16 i = 0; i < morfModel->getModelData()->getJointNum(); i++) {
|
||||
morfModel->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack);
|
||||
|
||||
@@ -498,7 +498,7 @@ int daNpc_Hoz_c::isDelete() {
|
||||
|
||||
void daNpc_Hoz_c::reset() {
|
||||
initialize();
|
||||
memset(&field_0xfac, 0, (u32)&field_0xfc4 - (u32)&field_0xfac);
|
||||
memset(&field_0xfac, 0, (uintptr_t)&field_0xfc4 - (uintptr_t)&field_0xfac);
|
||||
|
||||
if (mpMatAnm[0] != NULL) {
|
||||
mpMatAnm[0]->initialize();
|
||||
|
||||
@@ -618,7 +618,7 @@ int daNpc_Pachi_Besu_c::CreateHeap() {
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm[0] = new daNpcT_MatAnm_c();
|
||||
if (mpMatAnm[0] == NULL) {
|
||||
|
||||
@@ -635,7 +635,7 @@ int daNpc_Pachi_Maro_c::CreateHeap() {
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm[0] = new daNpcT_MatAnm_c();
|
||||
if (mpMatAnm[0] == NULL) {
|
||||
|
||||
@@ -859,7 +859,7 @@ int daNpc_Pachi_Taro_c::CreateHeap() {
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm[0] = new daNpcT_MatAnm_c();
|
||||
if (mpMatAnm[0] == NULL) {
|
||||
|
||||
@@ -308,7 +308,7 @@ int daNpc_Raca_c::CreateHeap() {
|
||||
for (u16 i = 0; i < modelData->getJointNum(); i++) {
|
||||
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm[0] = new daNpcT_MatAnm_c();
|
||||
if (mpMatAnm[0] == NULL) {
|
||||
|
||||
@@ -384,7 +384,7 @@ int daNpcTks_c::CreateHeap() {
|
||||
for (u16 i = 0; i < mdlData_p->getJointNum(); i++) {
|
||||
mdlData_p->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
mpMatAnm = new daNpcF_MatAnm_c();
|
||||
if (mpMatAnm == NULL) {
|
||||
@@ -488,7 +488,7 @@ void daNpcTks_c::setMtx() {
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
||||
mDoMtx_stack_c::scaleM(scale);
|
||||
model->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
if (mTksTsubo.field_0x586 != 0) {
|
||||
if (field_0x138a) {
|
||||
|
||||
@@ -241,7 +241,7 @@ int daNpc_ZelRo_c::CreateHeap() {
|
||||
for (u16 i = 0; i < mdlData_p->getJointNum(); i++) {
|
||||
mdlData_p->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((u32)this);
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mpMatAnm[i] = new daNpcT_MatAnm_c();
|
||||
|
||||
@@ -232,7 +232,7 @@ int daObjOnCloth_c::createHeap() {
|
||||
J3DJoint* jointNode_p = mpModel->getModelData()->getJointNodePointer(i);
|
||||
if (jointNode_p != NULL) {
|
||||
jointNode_p->setCallBack(nodeCallBack);
|
||||
mpModel->setUserArea((u32)this);
|
||||
mpModel->setUserArea((uintptr_t)this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ void dBgWKCol::ShdwDraw(cBgS_ShdwDraw* param_0) {
|
||||
|
||||
int x_sp44 = minX_spA0;
|
||||
do {
|
||||
u32 block_sp40 = (u32)m_pkc_head->m_block_data;
|
||||
u32 block_sp40 = (uintptr_t) m_pkc_head->m_block_data;
|
||||
u32 shift_sp3C = m_pkc_head->m_block_width_shift;
|
||||
int offset_sp38 =
|
||||
4 * (((u32)z_sp4C >> shift_sp3C) << m_pkc_head->m_area_xy_blocks_shift |
|
||||
@@ -2007,7 +2007,7 @@ bool dBgWKCol::SplGrpChk(dBgS_SplGrpChk* param_0) {
|
||||
|
||||
bool sp09 = false;
|
||||
do {
|
||||
u32 sp28 = (u32)m_pkc_head->m_block_data;
|
||||
u32 sp28 = (uintptr_t) m_pkc_head->m_block_data;
|
||||
u32 sp24 = m_pkc_head->m_block_width_shift;
|
||||
int sp20 = 4 * (((u32)sp34 >> sp24) << m_pkc_head->m_area_xy_blocks_shift |
|
||||
((u32)sp2C >> sp24) << m_pkc_head->m_area_x_blocks_shift |
|
||||
|
||||
+1
-1
@@ -449,7 +449,7 @@ int dRes_info_c::loadResource() {
|
||||
void* bas;
|
||||
|
||||
if (chunk->some_data_offset != 0xFFFFFFFF) {
|
||||
bas = (void*)(chunk->some_data_offset + (u32)result);
|
||||
bas = (void*)(chunk->some_data_offset + (uintptr_t) result);
|
||||
} else {
|
||||
bas = NULL;
|
||||
}
|
||||
|
||||
@@ -11,16 +11,17 @@
|
||||
#pragma mark JAUSection
|
||||
#include "JSystem/JAudio2/JAUSectionHeap.h"
|
||||
|
||||
#if 0
|
||||
|
||||
JAUSoundTable* JAUSection::newSoundTable(void const* data, u32 size, bool flag) {
|
||||
puts("JAUSection::newSoundTable is a stub");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JAUSoundNameTable* JAUSection::newSoundNameTable(void const* data, u32 size, bool flag) {
|
||||
puts("JAUSection::newSoundNameTable is a stub");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma mark JASHeap
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
|
||||
@@ -32,10 +33,11 @@ JASHeap::JASHeap(JASDisposer* disposer)
|
||||
#pragma mark JASVoiceBank
|
||||
#include "JSystem/JAudio2/JASVoiceBank.h"
|
||||
|
||||
/*
|
||||
bool JASVoiceBank::getInstParam(int a, int b, int c, JASInstParam* param) const {
|
||||
puts("JASVoiceBank::getInstParam is a stub");
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
// JASSeqParser::sCallBackFunc is compiled from JASSeqParser.obj
|
||||
/*
|
||||
@@ -130,7 +132,9 @@ int JOREventCallbackListNode::JORAct(u32 eventID, const char* eventName) {
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
#if !TARGET_PC
|
||||
#pragma mark J3DPSMtxArrayConcat
|
||||
void J3DPSMtxArrayConcat(float (*a)[4], float (*b)[4], float (*out)[4], u32 count) {
|
||||
puts("J3DPSMtxArrayConcat is a stub");
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-9
@@ -1865,13 +1865,5 @@ u32 JHICommBufReader::Header::getReadableSize() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma mark dMeter2Info
|
||||
#include <d/d_meter2_info.h>
|
||||
void dMeter2Info_c::getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) {
|
||||
puts("dMeter2Info_c::getString is a stub");
|
||||
}
|
||||
void dMeter2Info_c::getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) {
|
||||
puts("dMeter2Info_c::getStringKanji is a stub");
|
||||
}
|
||||
|
||||
dPa_particleTracePcallBack_c JPTracePCB4;
|
||||
dPa_particleTracePcallBack_c JPTracePCB4;
|
||||
|
||||
@@ -2683,9 +2683,9 @@ void mDoExt_3DlineMat1_c::draw() {
|
||||
mDoExt_3Dline_c* lines = mpLines;
|
||||
u16 vert_num = field_0x34 << 1;
|
||||
for (s32 i = 0; i < mNumLines; i++) {
|
||||
GXSetArray(GX_VA_POS, ((mDoExt_3Dline_c*)((s32)lines + (mIsDrawn << 2)))->field_0x8, 0xC);
|
||||
GXSetArray(GX_VA_NRM, ((mDoExt_3Dline_c*)((s32)lines + (mIsDrawn << 2)))->field_0x10, 0x3);
|
||||
GXSetArray(GX_VA_TEX0, ((mDoExt_3Dline_c*)((s32)lines + (mIsDrawn << 2)))->field_0x18, 0x8);
|
||||
GXSetArray(GX_VA_POS, ((mDoExt_3Dline_c*)((intptr_t)lines + (mIsDrawn << 2)))->field_0x8, 0xC);
|
||||
GXSetArray(GX_VA_NRM, ((mDoExt_3Dline_c*)((intptr_t) lines + (mIsDrawn << 2)))->field_0x10, 0x3);
|
||||
GXSetArray(GX_VA_TEX0, ((mDoExt_3Dline_c*)((intptr_t)lines + (mIsDrawn << 2)))->field_0x18, 0x8);
|
||||
GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, vert_num);
|
||||
|
||||
u16 j = 0;
|
||||
|
||||
Reference in New Issue
Block a user