From 5198317e24ff9195912b8f7633234f7cda320ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 11 Aug 2026 22:27:44 +0200 Subject: [PATCH] Back out some excessive checking in the latest changes. Change TOOD: to TODO: . --- Core/Dialog/PSPNetconfDialog.cpp | 24 ++++++++++-------------- Core/HLE/sceDisplay.cpp | 2 +- Core/HLE/sceKernelMbx.cpp | 23 +++-------------------- Core/HLE/sceKernelMemory.cpp | 12 ++---------- Core/HLE/sceKernelModule.cpp | 4 ++-- Core/HLE/sceKernelMsgPipe.cpp | 10 +--------- Core/HLE/sceKernelMutex.cpp | 28 ---------------------------- Core/HLE/sceKernelSemaphore.cpp | 12 +----------- Core/HLE/sceKernelVTimer.cpp | 4 ++-- Core/HLE/sceNet_lib.cpp | 2 ++ Core/HLE/scePower.cpp | 16 ++++------------ Core/Loaders.h | 2 +- GPU/Common/ShaderUniforms.cpp | 2 +- 13 files changed, 30 insertions(+), 111 deletions(-) diff --git a/Core/Dialog/PSPNetconfDialog.cpp b/Core/Dialog/PSPNetconfDialog.cpp index 848daf3f3d..fecb99e5de 100644 --- a/Core/Dialog/PSPNetconfDialog.cpp +++ b/Core/Dialog/PSPNetconfDialog.cpp @@ -245,33 +245,29 @@ int PSPNetconfDialog::Update(int animSpeed) { if (Memory::IsValidAddress(scanInfosAddr)) userMemory.Free(scanInfosAddr); scanInfosAddr = userMemory.Alloc(structsz, false, "NetconfScanInfo"); - // TOOD: What if scanInfosAddr is not valid? - if (Memory::IsValid4AlignedAddress(scanInfosAddr)) { - Memory::WriteUnchecked_U32(sizeof(SceNetAdhocctlScanInfoEmu), scanInfosAddr); - } + // TODO: What if scanInfosAddr is not valid? + Memory::WriteOrException_U32(sizeof(SceNetAdhocctlScanInfoEmu), scanInfosAddr); scanStep = 1; } } else if (scanStep == 1) { - s32 sz = Memory::ReadUnchecked_U32(scanInfosAddr); + s32 sz = Memory::ReadOrException_U32(scanInfosAddr); // Get required buffer size if (hleCall(sceNetAdhocctl, int, sceNetAdhocctlGetScanInfo, scanInfosAddr, 0) >= 0) { - s32 reqsz = Memory::ReadUnchecked_U32(scanInfosAddr); + s32 reqsz = Memory::ReadOrException_U32(scanInfosAddr); if (reqsz > sz) { sz = reqsz; userMemory.Free(scanInfosAddr); u32 structsz = sz + sizeof(s32); scanInfosAddr = userMemory.Alloc(structsz, false, "NetconfScanInfo"); - // TOOD: What if scanInfosAddr is not valid? - if (Memory::IsValid4AlignedAddress(scanInfosAddr)) { - Memory::WriteUnchecked_U32(sz, scanInfosAddr); - } + // TODO: What if scanInfosAddr is not valid? + Memory::WriteOrException_U32(sz, scanInfosAddr); } if (reqsz > 0) { if (hleCall(sceNetAdhocctl, int, sceNetAdhocctlGetScanInfo, scanInfosAddr, scanInfosAddr + (u32)sizeof(s32)) >= 0) { ScanInfos* scanInfos = (ScanInfos*)Memory::GetPointer(scanInfosAddr); int n = scanInfos->sz / sizeof(SceNetAdhocctlScanInfoEmu); - // Assuming returned SceNetAdhocctlScanInfoEmu(s) are contagious where next is pointing to current addr + sizeof(SceNetAdhocctlScanInfoEmu) + // Assuming returned SceNetAdhocctlScanInfoEmu(s) are contiguous where next is pointing to current addr + sizeof(SceNetAdhocctlScanInfoEmu) while (n > 0) { SceNetAdhocctlScanInfoEmu* si = (SceNetAdhocctlScanInfoEmu*)Memory::GetPointer(scanInfosAddr + sizeof(s32) + sizeof(SceNetAdhocctlScanInfoEmu) * (n - 1LL)); if (memcmp(si->group_name.data, request.NetconfData->groupName, ADHOCCTL_GROUPNAME_LEN) == 0) { @@ -299,7 +295,7 @@ int PSPNetconfDialog::Update(int animSpeed) { connResult = hleCall(sceNetAdhocctl, int, sceNetAdhocctlJoin, scanInfosAddr + (u32)sizeof(s32)); if (connResult >= 0) { // We are done! - if (Memory::IsValid4AlignedAddress(scanInfosAddr)) + if (Memory::IsValidAddress(scanInfosAddr)) userMemory.Free(scanInfosAddr); scanInfosAddr = 0; } @@ -325,7 +321,7 @@ int PSPNetconfDialog::Update(int animSpeed) { } // Let's not leaks any memory - if (Memory::IsValid4AlignedAddress(scanInfosAddr)) + if (Memory::IsValidAddress(scanInfosAddr)) userMemory.Free(scanInfosAddr); scanInfosAddr = 0; } @@ -335,7 +331,7 @@ int PSPNetconfDialog::Update(int animSpeed) { ChangeStatus(SCE_UTILITY_STATUS_FINISHED, NET_SHUTDOWN_DELAY_US); request.common.result = SCE_UTILITY_DIALOG_RESULT_ABORT; // Let's not leaks any memory - if (Memory::IsValid4AlignedAddress(scanInfosAddr)) + if (Memory::IsValidAddress(scanInfosAddr)) userMemory.Free(scanInfosAddr); scanInfosAddr = 0; } diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 96bf288c27..0eed80e98a 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -357,7 +357,7 @@ void __DisplaySetWasPaused() { wasPaused = true; } -// TOOD: Should return 59.997? +// TODO: Should return 59.997? static int FrameTimingLimit() { if (!NetworkAllowSpeedControl()) { return 60; diff --git a/Core/HLE/sceKernelMbx.cpp b/Core/HLE/sceKernelMbx.cpp index 22e29873b9..b8da518a3f 100644 --- a/Core/HLE/sceKernelMbx.cpp +++ b/Core/HLE/sceKernelMbx.cpp @@ -36,14 +36,12 @@ const int PSP_MBX_ERROR_DUPLICATE_MSG = 0x800201C9; -struct MbxWaitingThread -{ +struct MbxWaitingThread { SceUID threadID; u32 packetAddr; u64 pausedTimeout; - bool operator ==(const SceUID &otherThreadID) const - { + bool operator ==(const SceUID &otherThreadID) const { return threadID == otherThreadID; } }; @@ -51,8 +49,7 @@ void __KernelMbxTimeout(u64 userdata, int cyclesLate); static int mbxWaitTimer = -1; -struct NativeMbx -{ +struct NativeMbx { SceSize_le size; char name[KERNELOBJECT_MAX_NAME_LENGTH + 1]; SceUInt_le attr; @@ -432,13 +429,6 @@ int sceKernelSendMbx(SceUID id, u32 packetAddr) } int sceKernelReceiveMbx(SceUID id, u32 packetAddrPtr, u32 timeoutPtr) { - if (!Memory::IsValid4AlignedAddress(packetAddrPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR); - } - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR); - } - u32 error; Mbx *m = kernelObjects.Get(id, error); if (!m) { @@ -457,13 +447,6 @@ int sceKernelReceiveMbx(SceUID id, u32 packetAddrPtr, u32 timeoutPtr) { } int sceKernelReceiveMbxCB(SceUID id, u32 packetAddrPtr, u32 timeoutPtr) { - if (!Memory::IsValid4AlignedAddress(packetAddrPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR); - } - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR); - } - u32 error; Mbx *m = kernelObjects.Get(id, error); if (!m) { diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index a89bce775b..79948fc32a 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -630,10 +630,6 @@ static void __KernelSetFplTimeout(u32 timeoutPtr) } int sceKernelAllocateFpl(SceUID uid, u32 blockPtrAddr, u32 timeoutPtr) { - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogWarning(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "invalid timeout ptr"); - } - u32 error; FPL *fpl = kernelObjects.Get(uid, error); if (!fpl) { @@ -643,7 +639,7 @@ int sceKernelAllocateFpl(SceUID uid, u32 blockPtrAddr, u32 timeoutPtr) { int blockNum = fpl->AllocateBlock(); if (blockNum >= 0) { u32 blockPtr = fpl->address + fpl->alignedSize * blockNum; - Memory::WriteUnchecked_U32(blockPtr, blockPtrAddr); + Memory::WriteOrException_U32(blockPtr, blockPtrAddr); NotifyMemInfo(MemBlockFlags::SUB_ALLOC, blockPtr, fpl->alignedSize, "FplAllocate"); } else { SceUID threadID = __KernelGetCurThread(); @@ -659,10 +655,6 @@ int sceKernelAllocateFpl(SceUID uid, u32 blockPtrAddr, u32 timeoutPtr) { } int sceKernelAllocateFplCB(SceUID uid, u32 blockPtrAddr, u32 timeoutPtr) { - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogWarning(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "invalid timeout ptr"); - } - u32 error; FPL *fpl = kernelObjects.Get(uid, error); if (!fpl) { @@ -672,7 +664,7 @@ int sceKernelAllocateFplCB(SceUID uid, u32 blockPtrAddr, u32 timeoutPtr) { int blockNum = fpl->AllocateBlock(); if (blockNum >= 0) { u32 blockPtr = fpl->address + fpl->alignedSize * blockNum; - Memory::WriteUnchecked_U32(blockPtr, blockPtrAddr); + Memory::WriteOrException_U32(blockPtr, blockPtrAddr); NotifyMemInfo(MemBlockFlags::SUB_ALLOC, blockPtr, fpl->alignedSize, "FplAllocate"); } else { SceUID threadID = __KernelGetCurThread(); diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index e349f9012b..90897e9a40 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -2209,7 +2209,7 @@ static u32 sceKernelStopModule(u32 moduleId, u32 argSize, u32 argAddr, u32 retur if (Memory::IsValid4AlignedAddress(stopFunc)) { SceUID threadID = __KernelCreateThread(module->nm.name, moduleId, stopFunc, priority, stacksize, attr, 0, (module->nm.attribute & 0x1000) != 0); _dbg_assert_(threadID > 0); - // TOOD: Check the return value and bail? + // TODO: Check the return value and bail? __KernelStartThreadValidate(threadID, argSize, argAddr); __KernelSetThreadRA(threadID, NID_MODULERETURN); __KernelWaitCurThread(WAITTYPE_MODULE, moduleId, 1, 0, false, "stopped module"); @@ -2289,7 +2289,7 @@ u32 __KernelStopUnloadSelfModuleWithOrWithoutStatus(u32 exitCode, u32 argSize, u if (Memory::IsValidAddress(stopFunc)) { SceUID threadID = __KernelCreateThread(module->nm.name, moduleID, stopFunc, priority, stacksize, attr, 0, (module->nm.attribute & 0x1000) != 0); _dbg_assert_(threadID > 0); - // TOOD: Check the return value and bail? + // TODO: Check the return value and bail? __KernelStartThreadValidate(threadID, argSize, argp); __KernelSetThreadRA(threadID, NID_MODULERETURN); __KernelWaitCurThread(WAITTYPE_MODULE, moduleID, 1, 0, false, "unloadstopped module"); diff --git a/Core/HLE/sceKernelMsgPipe.cpp b/Core/HLE/sceKernelMsgPipe.cpp index 44572dcf64..c78f4fa341 100644 --- a/Core/HLE/sceKernelMsgPipe.cpp +++ b/Core/HLE/sceKernelMsgPipe.cpp @@ -315,12 +315,11 @@ static void __KernelMsgPipeTimeout(u64 userdata, int cyclesLate) HLEKernel::WaitExecTimeout(threadID); } -// Assumes timeout is valid or 0. static bool __KernelSetMsgPipeTimeout(u32 timeoutPtr) { if (timeoutPtr == 0 || waitTimer == -1) return true; - int micro = (int)Memory::ReadUnchecked_U32(timeoutPtr); + int micro = (int)Memory::ReadOrException_U32(timeoutPtr); if (micro <= 2) { // Don't wait or reschedule, just timeout immediately. return false; @@ -779,7 +778,6 @@ static int __KernelValidateSendMsgPipe(SceUID uid, u32 sendBufAddr, u32 sendSize return 0; } -// Assumes timeoutPtr is valid or 0. static int __KernelSendMsgPipe(MsgPipe *m, u32 sendBufAddr, u32 sendSize, int waitMode, u32 resultAddr, u32 timeoutPtr, bool cbEnabled, bool poll) { hleEatCycles(2400); @@ -809,9 +807,6 @@ int sceKernelSendMsgPipe(SceUID uid, u32 sendBufAddr, u32 sendSize, u32 waitMode if (!m) { return hleLogError(Log::sceKernel, error, "bad msgpipe id"); } - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "bad timeout address"); - } int result = __KernelSendMsgPipe(m, sendBufAddr, sendSize, waitMode, resultAddr, timeoutPtr, false, false); return hleLogDebug(Log::sceKernel, result); @@ -826,9 +821,6 @@ int sceKernelSendMsgPipeCB(SceUID uid, u32 sendBufAddr, u32 sendSize, u32 waitMo if (!m) { return hleLogError(Log::sceKernel, error, "bad msgpipe id"); } - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "bad timeout address"); - } // TODO: Verify callback behavior. hleCheckCurrentCallbacks(); diff --git a/Core/HLE/sceKernelMutex.cpp b/Core/HLE/sceKernelMutex.cpp index a2e3883fbe..b61306e454 100644 --- a/Core/HLE/sceKernelMutex.cpp +++ b/Core/HLE/sceKernelMutex.cpp @@ -531,13 +531,6 @@ int sceKernelLockMutex(SceUID id, int count, u32 timeoutPtr) { return hleNoLog(0); } - if (timeoutPtr != 0) { - if (!Memory::IsValid4AlignedAddress(timeoutPtr)) { - Core_MemoryExceptionHLE(currentMIPS, timeoutPtr, 4, MemoryExceptionType::HLE_READ); - return hleNoLog(0); - } - } - u32 error; PSPMutex *mutex = kernelObjects.Get(id, error); @@ -564,13 +557,6 @@ int sceKernelLockMutex(SceUID id, int count, u32 timeoutPtr) { } int sceKernelLockMutexCB(SceUID id, int count, u32 timeoutPtr) { - if (timeoutPtr != 0) { - if (!Memory::IsValid4AlignedAddress(timeoutPtr)) { - Core_MemoryExceptionHLE(currentMIPS, timeoutPtr, 4, MemoryExceptionType::HLE_READ); - return hleNoLog(0); - } - } - u32 error; PSPMutex *mutex = kernelObjects.Get(id, error); @@ -937,13 +923,6 @@ int sceKernelLockLwMutex(u32 workareaPtr, int count, u32 timeoutPtr) { return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ACCESS_ERROR, "Bad workarea pointer for LwMutex"); } - if (timeoutPtr) { - if (!Memory::IsValid4AlignedAddress(timeoutPtr)) { - Core_MemoryExceptionHLE(currentMIPS, timeoutPtr, 4, MemoryExceptionType::HLE_READ); - return hleNoLog(0); - } - } - auto workarea = PSPPointer::Create(workareaPtr); hleEatCycles(48); @@ -975,13 +954,6 @@ int sceKernelLockLwMutexCB(u32 workareaPtr, int count, u32 timeoutPtr) { return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ACCESS_ERROR, "Bad workarea pointer for LwMutex"); } - if (timeoutPtr) { - if (!Memory::IsValid4AlignedAddress(timeoutPtr)) { - Core_MemoryExceptionHLE(currentMIPS, timeoutPtr, 4, MemoryExceptionType::HLE_READ); - return hleNoLog(0); - } - } - auto workarea = PSPPointer::Create(workareaPtr); hleEatCycles(48); diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index 4c4aa30401..a04740f11d 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -329,12 +329,11 @@ void __KernelSemaTimeout(u64 userdata, int cycleslate) { } } -// Assumes timeoutPtr is zero or valid. static void __KernelSetSemaTimeout(PSPSemaphore *s, u32 timeoutPtr) { if (timeoutPtr == 0 || semaWaitTimer == -1) return; - int micro = (int) Memory::ReadUnchecked_U32(timeoutPtr); + int micro = (int)Memory::ReadOrException_U32(timeoutPtr); // This happens to be how the hardware seems to time things. if (micro <= 3) @@ -346,7 +345,6 @@ static void __KernelSetSemaTimeout(PSPSemaphore *s, u32 timeoutPtr) { CoreTiming::ScheduleEvent(usToCycles(micro), semaWaitTimer, __KernelGetCurThread()); } -// Assumes timeoutPtr is zero or valid. static int __KernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr, bool processCallbacks) { hleEatCycles(900); @@ -381,10 +379,6 @@ static int __KernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr, bool pro } int sceKernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr) { - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_BAD_ARGUMENT, "invalid timeout pointer"); // untested - } - int result = __KernelWaitSema(id, wantedCount, timeoutPtr, false); if (id == 0 && result == SCE_KERNEL_ERROR_UNKNOWN_SEMID) { @@ -396,10 +390,6 @@ int sceKernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr) { } int sceKernelWaitSemaCB(SceUID id, int wantedCount, u32 timeoutPtr) { - if (timeoutPtr && !Memory::IsValid4AlignedAddress(timeoutPtr)) { - return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_BAD_ARGUMENT, "invalid timeout pointer"); // untested - } - int result = __KernelWaitSema(id, wantedCount, timeoutPtr, true); if (id == 0 && result == SCE_KERNEL_ERROR_UNKNOWN_SEMID) { diff --git a/Core/HLE/sceKernelVTimer.cpp b/Core/HLE/sceKernelVTimer.cpp index 0f810936cf..1651182bd0 100644 --- a/Core/HLE/sceKernelVTimer.cpp +++ b/Core/HLE/sceKernelVTimer.cpp @@ -229,8 +229,8 @@ u32 sceKernelCreateVTimer(const char *name, u32 optParamAddr) { strncpy(vtimer->nvt.name, name, KERNELOBJECT_MAX_NAME_LENGTH); vtimer->nvt.name[KERNELOBJECT_MAX_NAME_LENGTH] = '\0'; - if (optParamAddr != 0 && Memory::IsValid4AlignedAddress(optParamAddr)) { - u32 size = Memory::ReadUnchecked_U32(optParamAddr); + if (optParamAddr != 0) { + u32 size = Memory::ReadOrException_U32(optParamAddr); if (size > 4) WARN_LOG_REPORT_ONCE(vtimeropt, Log::sceKernel, "sceKernelCreateVTimer(%s) unsupported options parameter, size = %d", name, size); } diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index 7ca6209001..80de698a9d 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -26,6 +26,8 @@ // This is one of the firmware modules (pspnet.prx), the official PSP games can't call these funcs +// Fortunately, because this is badly implemented currently. Need to go through all this and make +// it safe. // Ugh, this is ugly. u32 sceNetStrtoul(const char *str, u32 strEndAddrPtr, int base) { diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index a00194a093..d2c263ea14 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -409,24 +409,16 @@ static int sceKernelVolatileMemLock(int type, u32 paddr, u32 psize) { case SCE_KERNEL_ERROR_CAN_NOT_WAIT: { WARN_LOG(Log::HLE, "sceKernelVolatileMemLock(%i, %08x, %08x): dispatch disabled", type, paddr, psize); - if (Memory::IsValid4AlignedAddress(paddr)) { - Memory::WriteUnchecked_U32(0x08400000, paddr); - } - if (Memory::IsValid4AlignedAddress(psize)) { - Memory::WriteUnchecked_U32(0x00400000, psize); - } + Memory::WriteOrException_U32(0x08400000, paddr); + Memory::WriteOrException_U32(0x00400000, psize); } break; case SCE_KERNEL_ERROR_ILLEGAL_CONTEXT: { WARN_LOG(Log::HLE, "sceKernelVolatileMemLock(%i, %08x, %08x): in interrupt", type, paddr, psize); - if (Memory::IsValid4AlignedAddress(paddr)) { - Memory::WriteUnchecked_U32(0x08400000, paddr); - } - if (Memory::IsValid4AlignedAddress(psize)) { - Memory::WriteUnchecked_U32(0x00400000, psize); - } + Memory::WriteOrException_U32(0x08400000, paddr); + Memory::WriteOrException_U32(0x00400000, psize); } break; diff --git a/Core/Loaders.h b/Core/Loaders.h index a0e84e02bc..6804abbdf2 100644 --- a/Core/Loaders.h +++ b/Core/Loaders.h @@ -63,7 +63,7 @@ enum class IdentifiedFileType { const char *IdentifiedFileTypeToString(IdentifiedFileType type); // NB: It is a REQUIREMENT that implementations of this class are entirely thread safe! -// TOOD: actually, is it really? +// TODO: actually, is it really? class FileLoader { public: enum class Flags { diff --git a/GPU/Common/ShaderUniforms.cpp b/GPU/Common/ShaderUniforms.cpp index 6b0d0ed57b..4b55d21ba3 100644 --- a/GPU/Common/ShaderUniforms.cpp +++ b/GPU/Common/ShaderUniforms.cpp @@ -159,7 +159,7 @@ uint32_t PackDepalBits(bool pixelMapped) { uint32_t val = BytesToUint32(indexMask, indexShift, indexOffset, format); // NOTE: This must follow similar logic to TextureCacheCommon::GetSamplingParams - // maybe we can share it somehow. - // TOOD: Handle replaced textures. + // TODO: Handle replaced textures. bool bilinear = gstate.isMagnifyFilteringEnabled() && !pixelMapped; switch (g_Config.iTexFiltering) { case TEX_FILTER_FORCE_NEAREST: