diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 514a3c6b9c..062cdfbbbf 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -14,6 +14,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ + #include #ifdef _WIN32 diff --git a/Source/Core/Common/Src/ChunkFile.h b/Source/Core/Common/Src/ChunkFile.h index 7d3aa35b93..985504571f 100644 --- a/Source/Core/Common/Src/ChunkFile.h +++ b/Source/Core/Common/Src/ChunkFile.h @@ -92,7 +92,7 @@ public: // Store strings. void Do(std::string &x) { - int stringLen = x.length() + 1; + int stringLen = (int)x.length() + 1; Do(stringLen); switch (mode) diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index 3be984d9ab..c186a55e4d 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -104,7 +104,7 @@ void PatchFunctions() if (symbol > 0) { u32 HLEPatchValue = (1 & 0x3f) << 26; - for (size_t addr = symbol->address; addr < symbol->address + symbol->size; addr += 4) + for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4) Memory::Write_U32(HLEPatchValue | i, addr); LOG(HLE,"Patching %s %08x", OSPatches[i].m_szPatchName, symbol->address); } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 8e6003e253..532f229b89 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -149,7 +149,7 @@ CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress) if (m_pFileHandle != NULL) { size_t readItems = fread(Memory::GetPointer(Address), 1, Size, m_pFileHandle); - ReturnValue = readItems; + ReturnValue = (u32)readItems; LOG(WII_IPC_FILEIO, "FileIO reads from %s (Addr=0x%08x Size=0x%x)", GetDeviceName().c_str(), Address, Size); } else diff --git a/Source/Core/DiscIO/Src/CompressedBlob.cpp b/Source/Core/DiscIO/Src/CompressedBlob.cpp index c0863a82bc..370c8b8ede 100644 --- a/Source/Core/DiscIO/Src/CompressedBlob.cpp +++ b/Source/Core/DiscIO/Src/CompressedBlob.cpp @@ -181,7 +181,7 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type, callback("Files opened, ready to compress.", 0, arg); fseek(inf, 0, SEEK_END); - int insize = ftell(inf); + s64 insize = ftell(inf); fseek(inf, 0, SEEK_SET); CompressedBlobHeader header; header.magic_cookie = kBlobCookie; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index abe0328930..b82bc60abe 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -442,7 +442,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize) } // end of the _iSize loop // ============ - if(gVolume) // allow us to turn this off in the debugger + if (gVolume) // allow us to turn this off in the debugger { pb.mixer.volume_left = ADPCM_Vol(pb.mixer.volume_left, pb.mixer.unknown, pb.mixer_control); pb.mixer.volume_right = ADPCM_Vol(pb.mixer.volume_right, pb.mixer.unknown2, pb.mixer_control); @@ -457,21 +457,21 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize) for (int i = 0; i < _iSize; i++) { // Clamp into 16-bit. Maybe we should add a volume compressor here. - int left = templbuffer[i]; - int right = temprbuffer[i]; + int left = templbuffer[i] + _pBuffer[0]; + int right = temprbuffer[i] + _pBuffer[1]; if (left < -32767) left = -32767; if (left > 32767) left = 32767; if (right < -32767) right = -32767; if (right > 32767) right = 32767; - *_pBuffer++ += left; - *_pBuffer++ += right; + *_pBuffer++ = left; + *_pBuffer++ = right; } // write back out pbs WriteBackPBs(PBs, numberOfPBs); // write logging data to debugger again after the update - if(m_frame) + if (m_frame) { CUCode_AX::Logging(_pBuffer, _iSize, 1); } diff --git a/Source/Plugins/Plugin_DSP_NULL/Plugin_DSP_NULL.vcproj b/Source/Plugins/Plugin_DSP_NULL/Plugin_DSP_NULL.vcproj index 8cd19e133c..a5c421ca2c 100644 --- a/Source/Plugins/Plugin_DSP_NULL/Plugin_DSP_NULL.vcproj +++ b/Source/Plugins/Plugin_DSP_NULL/Plugin_DSP_NULL.vcproj @@ -317,7 +317,6 @@ AssemblerListingLocation="$(IntDir)\" WarningLevel="3" WarnAsError="false" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" ForcedIncludeFiles="stdafx.h" /> diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 52a54070ed..4f1ae2f1dc 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -664,8 +664,8 @@ void OpenGL_Update() { MValueX = 1.0f / Max; MValueY = 1.0f / Max; - nXoff = (nBackbufferWidth - (640 * MValueX)) / 2; - nYoff = (nBackbufferHeight - (480 * MValueY)) / 2; + nXoff = (int)((nBackbufferWidth - (640 * MValueX)) / 2); + nYoff = (int)((nBackbufferHeight - (480 * MValueY)) / 2); } // tell the debugger diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp index f5b77818c8..863eb68637 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp @@ -68,13 +68,8 @@ NativeVertexFormat::~NativeVertexFormat() inline GLuint VarToGL(VarType t) { - switch (t) { - case VAR_BYTE: return GL_BYTE; - case VAR_UNSIGNED_BYTE: return GL_UNSIGNED_BYTE; - case VAR_SHORT: return GL_SHORT; - case VAR_UNSIGNED_SHORT: return GL_UNSIGNED_SHORT; - case VAR_FLOAT: return GL_FLOAT; - } + static const GLuint lookup[5] = {GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT}; + return lookup[t]; return 0; } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 8f5d11e4a3..8ce4700833 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -232,7 +232,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width /*if (width == entry.w && height==entry.h && format==entry.fmt) { LPDIRECT3DTEXTURE9 tex = entry.texture; - int bs = TexDecoder_GetBlockWidthInTexels(format)-1; //TexelSizeInNibbles(format)*width*height/16; + int bs = TexDecoder_GetBlockWidthInTexels(format)-1; int expandedWidth = (width+bs) & (~bs); D3DFORMAT dfmt = TexDecoder_Decode(temp,ptr,expandedWidth,height,format, tlutaddr, tlutfmt); ReplaceTexture2D(tex,temp,width,height,expandedWidth,dfmt); @@ -247,7 +247,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width } } - int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; //TexelSizeInNibbles(format)*width*height/16; + int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; int expandedWidth = (width + bs) & (~bs); PC_TexFormat dfmt = TexDecoder_Decode(temp, ptr, expandedWidth, height, format, tlutaddr, tlutfmt); @@ -261,9 +261,9 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width ((u32 *)ptr)[entry.hashoffset] = entry.hash; entry.addr = address; - entry.isRenderTarget=false; - - entry.isNonPow2 = ((width&(width-1)) || (height&(height-1))); + entry.isRenderTarget = false; + + entry.isNonPow2 = ((width & (width - 1)) || (height & (height - 1))); glGenTextures(1, (GLuint *)&entry.texture); GLenum target = entry.isNonPow2 ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D; @@ -307,7 +307,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width } INCSTAT(stats.numTexturesCreated); - SETSTAT(stats.numTexturesAlive,textures.size()); + SETSTAT(stats.numTexturesAlive, textures.size()); //glEnable(entry.isNonPow2?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp index 4c658a8aaa..4ff74ae6cf 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp @@ -367,7 +367,7 @@ void VertexLoader::CompileVertexTranslator() break; } } - if (j == 8 && !((m_NativeFmt->m_components&VB_HAS_TEXMTXIDXALL) & (VB_HAS_TEXMTXIDXALL<<(i+1)))) // no more tex coords and tex matrices, so exit loop + if (j == 8 && !((m_NativeFmt->m_components & VB_HAS_TEXMTXIDXALL) & (VB_HAS_TEXMTXIDXALL << (i + 1)))) // no more tex coords and tex matrices, so exit loop break; } } @@ -379,7 +379,8 @@ void VertexLoader::CompileVertexTranslator() PortableVertexDeclaration vtx_decl; - + // TODO - merge all the below into the ifs and stuff above. + // Also merge ComputeVertexSize into the result. int m_components = m_NativeFmt->m_components; const TVtxAttr &vtx_attr = m_VtxAttr; @@ -445,7 +446,6 @@ void VertexLoader::CompileVertexTranslator() // TextureCoord for (int i = 0; i < 8; i++) { if (tc[i] != NOT_PRESENT || (m_components & (VB_HAS_TEXMTXIDX0 << i))) { - // TODO : More potential disalignment! if (m_components & (VB_HAS_TEXMTXIDX0 << i)) { if (tc[i] != NOT_PRESENT) { vtx_decl.texcoord_offset[i] = offset;