mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
coreinit+nn_save: Cleanup some legacy code
This commit is contained in:
@@ -55,19 +55,18 @@ namespace coreinit
|
||||
{
|
||||
// return full size of foreground bucket area
|
||||
if (offset)
|
||||
*offset = MEMPTR<void>{ (uint32)MEMORY_FGBUCKET_AREA_ADDR };
|
||||
*offset = { (MPTR)MEMORY_FGBUCKET_AREA_ADDR };
|
||||
if (size)
|
||||
*size = MEMORY_FGBUCKET_AREA_SIZE;
|
||||
// return true if in foreground
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OSGetForegroundBucketFreeArea(MPTR* offset, MPTR* size)
|
||||
bool OSGetForegroundBucketFreeArea(MEMPTR<void>* offset, uint32be* size)
|
||||
{
|
||||
uint8* freeAreaAddr = GetFGMemByArea(FG_BUCKET_AREA_FREE).GetPtr();
|
||||
|
||||
*offset = _swapEndianU32(memory_getVirtualOffsetFromPointer(freeAreaAddr));
|
||||
*size = _swapEndianU32(FG_BUCKET_AREA_FREE_SIZE);
|
||||
*offset = freeAreaAddr;
|
||||
*size = FG_BUCKET_AREA_FREE_SIZE;
|
||||
// return true if in foreground
|
||||
return (fgAddr != nullptr);
|
||||
}
|
||||
@@ -82,15 +81,6 @@ namespace coreinit
|
||||
osLib_returnFromFunction(hCPU, r ? 1 : 0);
|
||||
}
|
||||
|
||||
void coreinitExport_OSGetForegroundBucketFreeArea(PPCInterpreter_t* hCPU)
|
||||
{
|
||||
debug_printf("OSGetForegroundBucketFreeArea(0x%x,0x%x)\n", hCPU->gpr[3], hCPU->gpr[4]);
|
||||
ppcDefineParamMPTR(areaOutput, 0);
|
||||
ppcDefineParamMPTR(areaSize, 1);
|
||||
bool r = OSGetForegroundBucketFreeArea((MPTR*)memory_getPointerFromVirtualOffsetAllowNull(areaOutput), (MPTR*)memory_getPointerFromVirtualOffsetAllowNull(areaSize));
|
||||
osLib_returnFromFunction(hCPU, r ? 1 : 0);
|
||||
}
|
||||
|
||||
void InitForegroundBucket()
|
||||
{
|
||||
uint32be fgSize;
|
||||
@@ -194,7 +184,7 @@ namespace coreinit
|
||||
void InitializeFG()
|
||||
{
|
||||
osLib_addFunction("coreinit", "OSGetForegroundBucket", coreinitExport_OSGetForegroundBucket);
|
||||
osLib_addFunction("coreinit", "OSGetForegroundBucketFreeArea", coreinitExport_OSGetForegroundBucketFreeArea);
|
||||
cafeExportRegister("coreinit", OSGetForegroundBucket, LogType::CoreinitMem);
|
||||
osLib_addFunction("coreinit", "OSCopyFromClipboard", coreinitExport_OSCopyFromClipboard);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace coreinit
|
||||
bool __OSResizeCopyData(sint32 length);
|
||||
|
||||
bool OSGetForegroundBucket(MEMPTR<void>* offset, uint32be* size);
|
||||
bool OSGetForegroundBucketFreeArea(MPTR* offset, MPTR* size);
|
||||
bool OSGetForegroundBucketFreeArea(MEMPTR<void>* offset, uint32be* size);
|
||||
|
||||
void InitForegroundBucket();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,33 +5,23 @@
|
||||
#include "Cafe/IOSU/fsa/iosu_fsa.h"
|
||||
#include "coreinit_MessageQueue.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32be fileHandle;
|
||||
} FSFileHandleDepr_t;
|
||||
|
||||
typedef MEMPTR<betype<FSFileHandle2>> FSFileHandlePtr;
|
||||
typedef MEMPTR<betype<FSDirHandle2>> FSDirHandlePtr;
|
||||
|
||||
typedef uint32 FSAClientHandle;
|
||||
|
||||
typedef struct
|
||||
struct FSAsyncParams
|
||||
{
|
||||
MEMPTR<void> userCallback;
|
||||
MEMPTR<void> userContext;
|
||||
MEMPTR<coreinit::OSMessageQueue> ioMsgQueue;
|
||||
} FSAsyncParamsNew_t;
|
||||
|
||||
static_assert(sizeof(FSAsyncParamsNew_t) == 0xC);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MPTR userCallback; // 0x96C
|
||||
MPTR userContext;
|
||||
MPTR ioMsgQueue;
|
||||
} FSAsyncParams_t; // legacy struct. Replace with FSAsyncParamsNew_t
|
||||
};
|
||||
static_assert(sizeof(FSAsyncParams) == 0xC);
|
||||
|
||||
namespace coreinit
|
||||
{
|
||||
struct FSCmdBlockBody;
|
||||
|
||||
struct FSCmdQueue
|
||||
{
|
||||
enum class QUEUE_FLAG : uint32
|
||||
@@ -40,8 +30,8 @@ namespace coreinit
|
||||
CANCEL_ALL = (1 << 4),
|
||||
};
|
||||
|
||||
/* +0x00 */ MPTR firstMPTR;
|
||||
/* +0x04 */ MPTR lastMPTR;
|
||||
/* +0x00 */ MEMPTR<FSCmdBlockBody> first;
|
||||
/* +0x04 */ MEMPTR<FSCmdBlockBody> last;
|
||||
/* +0x08 */ OSFastMutex fastMutex;
|
||||
/* +0x34 */ MPTR dequeueHandlerFuncMPTR;
|
||||
/* +0x38 */ uint32be numCommandsInFlight;
|
||||
@@ -108,7 +98,7 @@ namespace coreinit
|
||||
uint8 ukn1460[0x10];
|
||||
uint8 ukn1470[0x10];
|
||||
FSCmdQueue fsCmdQueue;
|
||||
/* +0x14C4 */ MEMPTR<struct FSCmdBlockBody_t> currentCmdBlockBody; // set to currently active cmd
|
||||
/* +0x14C4 */ MEMPTR<struct FSCmdBlockBody> currentCmdBlockBody; // set to currently active cmd
|
||||
uint32 ukn14C8;
|
||||
uint32 ukn14CC;
|
||||
uint8 ukn14D0[0x10];
|
||||
@@ -128,7 +118,7 @@ namespace coreinit
|
||||
|
||||
struct FSAsyncResult
|
||||
{
|
||||
/* +0x00 */ FSAsyncParamsNew_t fsAsyncParamsNew;
|
||||
/* +0x00 */ FSAsyncParams fsAsyncParamsNew;
|
||||
|
||||
// fs message storage
|
||||
struct FSMessage
|
||||
@@ -159,7 +149,7 @@ namespace coreinit
|
||||
uint8 ukn0[0x14];
|
||||
struct
|
||||
{
|
||||
MEMPTR<uint32be> handlePtr;
|
||||
MEMPTR<betype<FSResHandle>> handlePtr;
|
||||
} cmdOpenFile;
|
||||
struct
|
||||
{
|
||||
@@ -205,7 +195,7 @@ namespace coreinit
|
||||
|
||||
static_assert(sizeof(FSCmdBlockReturnValues_t) == 0x14);
|
||||
|
||||
struct FSCmdBlockBody_t
|
||||
struct FSCmdBlockBody
|
||||
{
|
||||
iosu::fsa::FSAShimBuffer fsaShimBuffer;
|
||||
/* +0x0938 */ MEMPTR<FSClientBody_t> fsClientBody;
|
||||
@@ -213,9 +203,8 @@ namespace coreinit
|
||||
/* +0x0940 */ uint32be cancelState; // bitmask. Bit 0 -> If set command has been canceled
|
||||
FSCmdBlockReturnValues_t returnValues;
|
||||
// link for cmd queue
|
||||
MPTR nextMPTR; // points towards FSCmdQueue->first
|
||||
MPTR previousMPTR; // points towards FSCmdQueue->last
|
||||
|
||||
MEMPTR<FSCmdBlockBody> next;
|
||||
MEMPTR<FSCmdBlockBody> previous;
|
||||
/* +0x960 */ betype<FSA_RESULT> lastFSAStatus;
|
||||
uint32 ukn0964;
|
||||
/* +0x0968 */ uint8 errHandling; // return error flag mask
|
||||
@@ -235,7 +224,6 @@ namespace coreinit
|
||||
uint32 ukn9FC;
|
||||
};
|
||||
|
||||
static_assert(sizeof(FSAsyncParams_t) == 0xC);
|
||||
static_assert(sizeof(FSCmdBlock_t) == 0xA80);
|
||||
|
||||
#define FSA_CMD_FLAG_SET_POS (1 << 0)
|
||||
@@ -251,7 +239,7 @@ namespace coreinit
|
||||
};
|
||||
|
||||
// internal interface
|
||||
sint32 __FSQueryInfoAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint8* queryString, uint32 queryType, void* queryResult, uint32 errHandling, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 __FSQueryInfoAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint8* queryString, uint32 queryType, void* queryResult, uint32 errHandling, FSAsyncParams* fsAsyncParams);
|
||||
|
||||
// coreinit exports
|
||||
FS_RESULT FSAddClientEx(FSClient_t* fsClient, uint32 uknR4, uint32 errHandling);
|
||||
@@ -260,52 +248,52 @@ namespace coreinit
|
||||
|
||||
void FSInitCmdBlock(FSCmdBlock_t* fsCmdBlock);
|
||||
|
||||
sint32 FSOpenFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, char* mode, FSFileHandleDepr_t* fileHandle, uint32 errHandling, FSAsyncParamsNew_t* asyncParams);
|
||||
sint32 FSOpenFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, char* mode, FSFileHandleDepr_t* fileHandle, uint32 errHandling);
|
||||
sint32 FSOpenFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, char* mode, FSFileHandlePtr outFileHandle, uint32 errHandling, FSAsyncParams* asyncParams);
|
||||
sint32 FSOpenFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, char* mode, FSFileHandlePtr outFileHandle, uint32 errHandling);
|
||||
|
||||
sint32 FSReadFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSReadFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSReadFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask);
|
||||
sint32 FSReadFileWithPosAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSReadFileWithPosAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSReadFileWithPos(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* dst, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask);
|
||||
|
||||
sint32 FSWriteFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSWriteFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSWriteFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 fileHandle, uint32 flag, uint32 errorMask);
|
||||
sint32 FSWriteFileWithPosAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSWriteFileWithPosAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSWriteFileWithPos(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, void* src, uint32 size, uint32 count, uint32 filePos, uint32 fileHandle, uint32 flag, uint32 errorMask);
|
||||
|
||||
sint32 FSSetPosFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 filePos, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSSetPosFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 filePos, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSSetPosFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 filePos, uint32 errorMask);
|
||||
sint32 FSGetPosFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32be* returnedFilePos, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSGetPosFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32be* returnedFilePos, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSGetPosFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32be* returnedFilePos, uint32 errorMask);
|
||||
|
||||
sint32 FSAppendFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 size, uint32 count, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSAppendFileAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 size, uint32 count, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSAppendFile(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 size, uint32 count, uint32 errorMask);
|
||||
|
||||
sint32 FSIsEofAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSIsEofAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSIsEof(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint32 fileHandle, uint32 errorMask);
|
||||
|
||||
sint32 FSRenameAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* srcPath, char* dstPath, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSRenameAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* srcPath, char* dstPath, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSRename(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* srcPath, char* dstPath, uint32 errorMask);
|
||||
sint32 FSRemoveAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint8* filePath, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSRemoveAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint8* filePath, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSRemove(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, uint8* filePath, uint32 errorMask);
|
||||
sint32 FSMakeDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* dirPath, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSMakeDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* dirPath, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSMakeDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* path, uint32 errorMask);
|
||||
sint32 FSChangeDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSChangeDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSChangeDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask);
|
||||
sint32 FSGetCwdAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* dirPathOut, sint32 dirPathMaxLen, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSGetCwdAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* dirPathOut, sint32 dirPathMaxLen, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSGetCwd(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* dirPathOut, sint32 dirPathMaxLen, uint32 errorMask);
|
||||
|
||||
sint32 FSGetFreeSpaceSizeAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* path, FSLargeSize* returnedFreeSize, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSGetFreeSpaceSizeAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* path, FSLargeSize* returnedFreeSize, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSGetFreeSpaceSize(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, const char* path, FSLargeSize* returnedFreeSize, uint32 errorMask);
|
||||
|
||||
sint32 FSOpenDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, FSDirHandlePtr dirHandleOut, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSOpenDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, FSDirHandlePtr dirHandleOut, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSOpenDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, FSDirHandlePtr dirHandleOut, uint32 errorMask);
|
||||
sint32 FSReadDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, FSDirEntry_t* dirEntryOut, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSReadDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, FSDirEntry_t* dirEntryOut, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSCloseDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSReadDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, FSDirEntry_t* dirEntryOut, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSReadDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, FSDirEntry_t* dirEntryOut, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSCloseDirAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSCloseDir(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, FSDirHandle2 dirHandle, uint32 errorMask);
|
||||
|
||||
sint32 FSFlushQuotaAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask, FSAsyncParamsNew_t* fsAsyncParams);
|
||||
sint32 FSFlushQuotaAsync(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask, FSAsyncParams* fsAsyncParams);
|
||||
sint32 FSFlushQuota(FSClient_t* fsClient, FSCmdBlock_t* fsCmdBlock, char* path, uint32 errorMask);
|
||||
|
||||
FS_VOLSTATE FSGetVolumeState(FSClient_t* fsClient);
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace coreinit
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
|
||||
MEMPTR<void> bucket;
|
||||
uint32be bucketSize;
|
||||
@@ -257,7 +257,7 @@ namespace coreinit
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
|
||||
MEMPTR<void> bucket;
|
||||
uint32be bucketSize;
|
||||
@@ -593,16 +593,16 @@ namespace coreinit
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
mem1Heap = MEMCreateFrmHeapEx(memBound.GetPtr(), (uint32)memBoundSize, 0);
|
||||
|
||||
OSGetForegroundBucketFreeArea((MPTR*)memBound.GetBEPtr(), (MPTR*)&memBoundSize);
|
||||
OSGetForegroundBucketFreeArea(&memBound, &memBoundSize);
|
||||
memFGHeap = MEMCreateFrmHeapEx(memBound.GetPtr(), (uint32)memBoundSize, 0);
|
||||
}
|
||||
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(2, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(2, &memBound, &memBoundSize);
|
||||
mem2Heap = MEMDefaultHeap_Init(memBound.GetPtr(), (uint32)memBoundSize);
|
||||
|
||||
// set DynLoad allocators
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace coreinit
|
||||
// no-op
|
||||
}
|
||||
|
||||
void OSGetMemBound(sint32 memType, MPTR* offsetOutput, uint32* sizeOutput)
|
||||
void OSGetMemBound(sint32 memType, MEMPTR<void>* offsetOutput, uint32be* sizeOutput)
|
||||
{
|
||||
MPTR memAddr = MPTR_NULL;
|
||||
uint32 memSize = 0;
|
||||
@@ -195,9 +195,9 @@ namespace coreinit
|
||||
cemu_assert_debug(false);
|
||||
}
|
||||
if (offsetOutput)
|
||||
*offsetOutput = _swapEndianU32(memAddr);
|
||||
*offsetOutput = memAddr;
|
||||
if (sizeOutput)
|
||||
*sizeOutput = _swapEndianU32(memSize);
|
||||
*sizeOutput = memSize;
|
||||
}
|
||||
|
||||
void InitializeMemory()
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace coreinit
|
||||
{
|
||||
void InitializeMemory();
|
||||
|
||||
void OSGetMemBound(sint32 memType, MPTR* offsetOutput, uint32* sizeOutput);
|
||||
void OSGetMemBound(sint32 memType, MEMPTR<void>* offsetOutput, uint32be* sizeOutput);
|
||||
|
||||
void* OSBlockMove(MEMPTR<void> dst, MEMPTR<void> src, uint32 size, bool flushDC);
|
||||
void* OSBlockSet(MEMPTR<void> dst, uint32 value, uint32 size);
|
||||
|
||||
@@ -1401,12 +1401,10 @@ void export_curl_easy_getinfo(PPCInterpreter_t* hCPU)
|
||||
}
|
||||
case CURLINFO_CONTENT_TYPE:
|
||||
{
|
||||
//cemuLog_logDebug(LogType::Force, "CURLINFO_CONTENT_TYPE not supported");
|
||||
//*(uint32*)parameter.GetPtr() = MPTR_NULL;
|
||||
char* contentType = nullptr;
|
||||
result = curl_easy_getinfo(curlObj, CURLINFO_REDIRECT_URL, &contentType);
|
||||
_updateGuestString(curl.GetPtr(), curl->info_contentType, contentType);
|
||||
*(uint32*)parameter.GetPtr() = curl->info_contentType.GetMPTRBE();
|
||||
*(MEMPTR<char>*)parameter.GetPtr() = curl->info_contentType;
|
||||
break;
|
||||
}
|
||||
case CURLINFO_REDIRECT_URL:
|
||||
@@ -1414,7 +1412,7 @@ void export_curl_easy_getinfo(PPCInterpreter_t* hCPU)
|
||||
char* redirectUrl = nullptr;
|
||||
result = curl_easy_getinfo(curlObj, CURLINFO_REDIRECT_URL, &redirectUrl);
|
||||
_updateGuestString(curl.GetPtr(), curl->info_redirectUrl, redirectUrl);
|
||||
*(uint32*)parameter.GetPtr() = curl->info_redirectUrl.GetMPTRBE();
|
||||
*(MEMPTR<char>*)parameter.GetPtr() = curl->info_redirectUrl;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -511,7 +511,7 @@ namespace proc_ui
|
||||
{
|
||||
MEMPTR<void> fgBase;
|
||||
uint32be fgFreeSize;
|
||||
OSGetForegroundBucketFreeArea((MPTR*)&fgBase, (MPTR*)&fgFreeSize);
|
||||
OSGetForegroundBucketFreeArea(&fgBase, &fgFreeSize);
|
||||
if(fgFreeSize < size)
|
||||
cemuLog_log(LogType::Force, "ProcUISetBucketStorage: Buffer size too small");
|
||||
s_bucketStorageBasePtr = memBase;
|
||||
@@ -521,7 +521,7 @@ namespace proc_ui
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
if(memBoundSize < size)
|
||||
cemuLog_log(LogType::Force, "ProcUISetMEM1Storage: Buffer size too small");
|
||||
s_mem1StorageBasePtr = memBase;
|
||||
@@ -751,14 +751,14 @@ namespace proc_ui
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
OSBlockMove(s_mem1StorageBasePtr.GetPtr(), memBound.GetPtr(), memBoundSize, true);
|
||||
}
|
||||
if (s_bucketStorageBasePtr)
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetForegroundBucketFreeArea((MPTR*)memBound.GetBEPtr(), (MPTR*)&memBoundSize);
|
||||
OSGetForegroundBucketFreeArea(&memBound, &memBoundSize);
|
||||
OSBlockMove(s_bucketStorageBasePtr.GetPtr(), memBound.GetPtr(), memBoundSize, true);
|
||||
}
|
||||
}
|
||||
@@ -769,7 +769,7 @@ namespace proc_ui
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetMemBound(1, (MPTR*)memBound.GetBEPtr(), (uint32*)&memBoundSize);
|
||||
OSGetMemBound(1, &memBound, &memBoundSize);
|
||||
OSBlockMove(memBound.GetPtr(), s_mem1StorageBasePtr, memBoundSize, true);
|
||||
GX2::GX2Invalidate(0x40, s_mem1StorageBasePtr.GetMPTR(), memBoundSize);
|
||||
}
|
||||
@@ -777,7 +777,7 @@ namespace proc_ui
|
||||
{
|
||||
MEMPTR<void> memBound;
|
||||
uint32be memBoundSize;
|
||||
OSGetForegroundBucketFreeArea((MPTR*)memBound.GetBEPtr(), (MPTR*)&memBoundSize);
|
||||
OSGetForegroundBucketFreeArea(&memBound, &memBoundSize);
|
||||
OSBlockMove(memBound.GetPtr(), s_bucketStorageBasePtr, memBoundSize, true);
|
||||
GX2::GX2Invalidate(0x40, memBound.GetMPTR(), memBoundSize);
|
||||
}
|
||||
|
||||
@@ -136,16 +136,10 @@ public:
|
||||
C* GetPtr() const { return (C*)(GetPtr()); }
|
||||
|
||||
constexpr uint32 GetMPTR() const { return m_value.value(); }
|
||||
constexpr uint32 GetRawValue() const { return m_value.bevalue(); } // accesses value using host-endianness
|
||||
|
||||
constexpr const uint32be& GetBEValue() const { return m_value; }
|
||||
|
||||
constexpr bool IsNull() const { return m_value == 0; }
|
||||
|
||||
constexpr uint32 GetMPTRBE() const { return m_value.bevalue(); }
|
||||
|
||||
uint32be* GetBEPtr() { return &m_value; }
|
||||
|
||||
private:
|
||||
uint32be m_value;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
|
||||
T* GetPointer() const { return m_ptr; }
|
||||
uint32 GetMPTR() const { return MEMPTR<T>(m_ptr).GetMPTR(); }
|
||||
uint32 GetMPTRBE() const { return MEMPTR<T>(m_ptr).GetMPTRBE(); }
|
||||
|
||||
T* operator&() { return GetPointer(); }
|
||||
explicit operator T*() const { return GetPointer(); }
|
||||
|
||||
Reference in New Issue
Block a user