mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-18 12:52:51 -04:00
builds on mac again
revert some useless ifdefs rm TARGET_PC in the wrong place remove stubbed version of functions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user