diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index 095831678..034448351 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -625,7 +625,7 @@ public: u8 *uncomp_buffer = new u8[header.UncompressedSize]; size_t uncomp_size = header.UncompressedSize; snappy_uncompress((const char *)buffer, sz, (char *)uncomp_buffer, &uncomp_size); - if (uncomp_size != header.UncompressedSize) { + if ((int)uncomp_size != header.UncompressedSize) { ERROR_LOG(COMMON,"Size mismatch: file: %i calc: %i", (int)header.UncompressedSize, (int)uncomp_size); } ptr = uncomp_buffer; diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 22762fbaa..ce3b97089 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -1080,7 +1080,7 @@ bool SavedataParam::CreatePNGIcon(u8* pngData, int pngSize, SaveFileInfo& info) u32 atlasPtr; if (success) atlasPtr = kernelMemory.Alloc(texSize, true, "SaveData Icon"); - if (success && atlasPtr != -1) + if (success && atlasPtr != (u32)-1) { info.textureData = atlasPtr; Memory::Memcpy(atlasPtr, textureData, texSize); diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index 77ff90de4..9054e68d6 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -217,7 +217,7 @@ bool ElfReader::LoadInto(u32 loadAddress) vaddr = userMemory.Alloc(totalSize, false, "ELF"); } - if (vaddr == -1) { + if (vaddr == (u32)-1) { ERROR_LOG(LOADER, "Failed to allocate memory for ELF!"); return false; } diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index 6e7087c04..48c0f8768 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -297,7 +297,7 @@ bool hleExecuteDebugBreak(const HLEFunction &func) // Never break on these, they're noise. u32 blacklistedNIDs[] = {NID_SUSPEND_INTR, NID_RESUME_INTR, NID_IDLE}; - for (int i = 0; i < ARRAY_SIZE(blacklistedNIDs); ++i) + for (size_t i = 0; i < ARRAY_SIZE(blacklistedNIDs); ++i) { if (func.ID == blacklistedNIDs[i]) return false; diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 4e6604add..5ea398ca0 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -187,7 +187,7 @@ u32 sceAtracDecodeData(int atracID, u32 outAddr, u32 numSamplesAddr, u32 finishF ret = ATRAC_ERROR_ALL_DATA_DECODED; } else { // TODO: This isn't at all right, but at least it makes the music "last" some time. - int numSamples = (atrac->decodeEnd - atrac->decodePos) / (sizeof(s16) * 2); + u32 numSamples = (atrac->decodeEnd - atrac->decodePos) / (sizeof(s16) * 2); if (atrac->decodePos >= atrac->decodeEnd) { numSamples = 0; } else if (numSamples > ATRAC_MAX_SAMPLES) { @@ -554,7 +554,7 @@ int sceAtracLowLevelInitDecoder(int atracID, u32 paramsAddr) int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesConsumedAddr, u32 samplesAddr, u32 sampleBytesAddr) { - ERROR_LOG(HLE, "UNIMPL sceAtracLowLevelDecode(%i, %i, %08x, %08x, %08x, %08x)", atracID, sourceAddr, sourceBytesConsumedAddr, samplesAddr, sampleBytesAddr); + ERROR_LOG(HLE, "UNIMPL sceAtracLowLevelDecode(%i, %08x, %08x, %08x, %08x)", atracID, sourceAddr, sourceBytesConsumedAddr, samplesAddr, sampleBytesAddr); return 0; } diff --git a/Core/HLE/sceCtrl.cpp b/Core/HLE/sceCtrl.cpp index 819b88481..348bdce8d 100644 --- a/Core/HLE/sceCtrl.cpp +++ b/Core/HLE/sceCtrl.cpp @@ -35,7 +35,7 @@ const int PSP_CTRL_ERROR_INVALID_MODE = 0x80000107; const int PSP_CTRL_ERROR_INVALID_IDLE_PTR = 0x80000023; -const int NUM_CTRL_BUFFERS = 64; +const u32 NUM_CTRL_BUFFERS = 64; enum { @@ -68,8 +68,8 @@ static u32 ctrlOldButtons = 0; static _ctrl_data ctrlBufs[NUM_CTRL_BUFFERS]; static _ctrl_data ctrlCurrent; -static int ctrlBuf = 0; -static int ctrlBufRead = 0; +static u32 ctrlBuf = 0; +static u32 ctrlBufRead = 0; static CtrlLatch latch; static int ctrlIdleReset = -1; @@ -189,7 +189,7 @@ int __CtrlReadBuffer(u32 ctrlDataPtr, u32 nBufs, bool negative, bool peek) if (nBufs > NUM_CTRL_BUFFERS) return SCE_KERNEL_ERROR_INVALID_SIZE; - int resetRead = ctrlBufRead; + u32 resetRead = ctrlBufRead; u32 availBufs; // Peeks always work, they just go go from now X buffers. diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 16e790d34..11ea18c71 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -237,10 +237,10 @@ u32 sceGeSetCallback(u32 structAddr) DEBUG_LOG(HLE, "sceGeSetCallback(struct=%08x)", structAddr); int cbID = -1; - for (int i = 0; i < ARRAY_SIZE(ge_used_callbacks); ++i) + for (size_t i = 0; i < ARRAY_SIZE(ge_used_callbacks); ++i) if (!ge_used_callbacks[i]) { - cbID = i; + cbID = (int) i; break; } diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index 5241b1d93..a4791308e 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -213,7 +213,7 @@ void __InterruptsInit() { interruptsEnabled = 1; inInterrupt = false; - for(int i = 0; i < ARRAY_SIZE(intrHandlers); ++i) + for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i) intrHandlers[i] = new IntrHandler(i); intState.clear(); } @@ -246,11 +246,11 @@ void __InterruptsDoStateLate(PointerWrap &p) void __InterruptsShutdown() { - for (int i = 0; i < ARRAY_SIZE(intrHandlers); ++i) + for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i) intrHandlers[i]->clear(); - for(int i = 0; i < ARRAY_SIZE(intrHandlers); ++i) + for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i) { - if(intrHandlers[i]) + if (intrHandlers[i]) { delete intrHandlers[i]; intrHandlers[i] = 0; diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index 26ad93e6a..16f3fec15 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -430,7 +430,7 @@ u32 __sceSasSetVoiceATRAC3(u32 core, int voice, int atrac3Context) { } u32 __sceSasConcatenateATRAC3(u32 core, int voice, u32 atrac3DataAddr, int atrac3DataLength) { - ERROR_LOG(HLE,"UNIMPL __sceSasConcatenateATRAC3(%08x, %i, %i)", core, voice, atrac3DataAddr, atrac3DataLength); + ERROR_LOG(HLE,"UNIMPL __sceSasConcatenateATRAC3(%08x, %i, %08x, %i)", core, voice, atrac3DataAddr, atrac3DataLength); return 0; } diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index 97f1b8837..aa22d3b87 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -548,8 +548,8 @@ static int getExpCurveAt(int index, int duration) { } ADSREnvelope::ADSREnvelope() - : steps_(0), - state_(STATE_OFF), + : state_(STATE_OFF), + steps_(0), height_(0) { memset(this, 0, sizeof(*this)); } diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 82e771927..c9c548a73 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -98,7 +98,7 @@ namespace MIPSAnalyst "slt", "sltu", }; const char *opName = MIPSGetName(op); - for (int i = 0; i < ARRAY_SIZE(safeOps); ++i) + for (size_t i = 0; i < ARRAY_SIZE(safeOps); ++i) { if (!strcmp(safeOps[i], opName)) return true; diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 6487e9ce3..96ccc7768 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -684,6 +684,8 @@ void TextureCache::SetTexture() { clutformat = gstate.clutformat & 3; clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); cachekey |= (u64)clutaddr << 32; + } else { + clutaddr = 0; } int maxLevel = ((gstate.texmode >> 16) & 0x7); @@ -725,7 +727,7 @@ void TextureCache::SetTexture() { entry->hash != texhash || entry->format != format || entry->maxLevel != maxLevel || - ((format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && + (hasClut && (entry->clutformat != clutformat || entry->clutaddr != clutaddr || entry->cluthash != Memory::Read_U32(entry->clutaddr)))) @@ -810,9 +812,9 @@ void TextureCache::SetTexture() { entry->lodBias = 0.0f; - if (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) { + if (hasClut) { entry->clutformat = clutformat; - entry->clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); + entry->clutaddr = clutaddr; entry->cluthash = Memory::Read_U32(entry->clutaddr); } else { entry->clutaddr = 0; @@ -1173,8 +1175,6 @@ bool TextureCache::DecodeTexture(u8* output, GPUgstate state) // TODO: Look into using BGRA for 32-bit textures when the GL_EXT_texture_format_BGRA8888 extension is available, as it's faster than RGBA on some chips. - // TODO: Actually decode the mipmaps. - switch (format) { case GE_TFMT_CLUT4: diff --git a/GPU/GLES/TextureCache.h b/GPU/GLES/TextureCache.h index 764ad6373..65c64b4eb 100644 --- a/GPU/GLES/TextureCache.h +++ b/GPU/GLES/TextureCache.h @@ -66,8 +66,8 @@ private: int numFrames; u32 framesUntilNextFullHash; u8 format; - u8 clutformat; u16 dim; + u8 clutformat; u32 clutaddr; u32 cluthash; u32 texture; //GLuint @@ -102,7 +102,7 @@ private: u32 *clutBuf32; u16 *clutBuf16; - int lastBoundTexture; + u32 lastBoundTexture; float maxAnisotropyLevel; }; diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 85fa40b63..72b2066c5 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -53,12 +53,14 @@ enum { }; TransformDrawEngine::TransformDrawEngine() - : numDrawCalls(0), - collectedVerts(0), + : collectedVerts(0), prevPrim_(-1), lastVType_(-1), curVbo_(0), - shaderManager_(0) { + shaderManager_(0), + textureCache_(0), + framebufferManager_(0), + numDrawCalls(0) { // Allocate nicely aligned memory. Maybe graphics drivers will // appreciate it. // All this is a LOT of memory, need to see if we can cut down somehow.