From e6022acf26e3a4a0aae5e3a8d740713052e7b2f1 Mon Sep 17 00:00:00 2001 From: nakeee Date: Mon, 1 Dec 2008 08:34:51 +0000 Subject: [PATCH] small fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1364 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/FileUtil.cpp | 5 ----- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 12 +++++------ .../Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp | 2 -- Source/Core/Core/Src/PowerPC/SymbolDB.cpp | 20 +++++++++---------- .../Plugin_VideoOGL/Src/VertexLoader.cpp | 4 ++-- .../Plugin_VideoOGL/Src/VertexLoader_Normal.h | 2 +- 6 files changed, 18 insertions(+), 27 deletions(-) diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 5c43d22567..625fe4a9ff 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -481,14 +481,9 @@ error_jmp: void GetCurrentDirectory(std::string& _rDirectory) { -#ifdef _WIN32 - char tmpBuffer[MAX_PATH+1]; getcwd(tmpBuffer, MAX_PATH); _rDirectory = tmpBuffer; -#else - PanicAlert("Missing Linux support of GetCurrentDirectory"); -#endif } } // namespace diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index d769569c47..3f8bdd123d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -314,12 +314,13 @@ void ExecuteCommand(u32 _Address) // F|RES: prolly the re-open is just a mode change + LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)", + pDevice->GetDeviceName().c_str(), DeviceID, Mode); + if(DeviceName.find("/dev/") == std::string::npos) { - LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)", - pDevice->GetDeviceName().c_str(), DeviceID, Mode); - u32 Mode = Memory::Read_U32(_Address + 0x10); + u32 newMode = Memory::Read_U32(_Address + 0x10); // We may not have a file handle at this point, in Mario Kart I got a // Open > Failed > ... other stuff > ReOpen call sequence, in that case @@ -328,13 +329,10 @@ void ExecuteCommand(u32 _Address) if(pDevice->ReturnFileHandle()) Memory::Write_U32(DeviceID, _Address + 4); else - GenerateReply = pDevice->Open(_Address, Mode); + GenerateReply = pDevice->Open(_Address, newMode); } else { - LOG(WII_IPC_HLE, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)", - pDevice->GetDeviceName().c_str(), pDevice->GetDeviceID(), Mode); - // We have already opened this device, return -6 Memory::Write_U32(u32(-6), _Address + 4); } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp index a6c0f4d2f6..9edccfbf14 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp @@ -245,8 +245,6 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B LOG(WII_IPC_FILEIO, " InBufferSize: %i OutBufferSize: %i", _BufferInSize, _BufferOutSize); - u32 Addr = _BufferOut; - /* Memory::Write_U32(Addr, a); Addr += 4; Memory::Write_U32(Addr, b); Addr += 4; Memory::Write_U32(Addr, c); Addr += 4; diff --git a/Source/Core/Core/Src/PowerPC/SymbolDB.cpp b/Source/Core/Core/Src/PowerPC/SymbolDB.cpp index e7cbb33b25..b3541d2a62 100644 --- a/Source/Core/Core/Src/PowerPC/SymbolDB.cpp +++ b/Source/Core/Core/Src/PowerPC/SymbolDB.cpp @@ -306,11 +306,11 @@ bool SymbolDB::LoadMap(const char *filename) bool SymbolDB::SaveMap(const char *filename, bool WithCodes) const { // Format the name for the codes version - std::string Temp = filename; - if(WithCodes) Temp = Temp.substr(0, Temp.find_last_of(".")) + "_code.map"; + std::string mapFile = filename; + if(WithCodes) mapFile = mapFile.substr(0, mapFile.find_last_of(".")) + "_code.map"; // Make a file - FILE *f = fopen(Temp.c_str(), "w"); + FILE *f = fopen(mapFile.c_str(), "w"); if (!f) return false; @@ -342,13 +342,13 @@ bool SymbolDB::SaveMap(const char *filename, bool WithCodes) const /* To make nice straight lines we fill out the name with spaces, we also cut off all names longer than 25 letters */ - std::string Temp; - for(int i = 0; i < 25; i++) + std::string TempSym; + for(u32 i = 0; i < 25; i++) { if(i < LastSymbolName.size()) - Temp += LastSymbolName[i]; + TempSym += LastSymbolName[i]; else - Temp += " "; + TempSym += " "; } // We currently skip the last block because we don't know how long it goes @@ -362,7 +362,7 @@ bool SymbolDB::SaveMap(const char *filename, bool WithCodes) const { int Address = LastAddress + i; fprintf(f,"%08x %i %20s %s\n", Address, - 0, Temp.c_str(), debugger->disasm(Address)); + 0, TempSym.c_str(), debugger->disasm(Address)); } fprintf(f, "\n"); // Write a blank line after each block } @@ -370,10 +370,10 @@ bool SymbolDB::SaveMap(const char *filename, bool WithCodes) const // --------------- // Show success message - wxMessageBox(wxString::Format("Saved %s", Temp.c_str())); + wxMessageBox(wxString::Format(wxT("Saved %s"), mapFile.c_str())); // Close the file and return fclose(f); return true; } -// =========== \ No newline at end of file +// =========== diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp index c949ec9c96..9806ba225a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp @@ -143,7 +143,7 @@ void VertexLoader::CompileVertexTranslator() { m_VertexSize = 0; const TVtxAttr &vtx_attr = m_VtxAttr; - const TVtxDesc &vtx_desc = m_VtxDesc; + //const TVtxDesc &vtx_desc = m_VtxDesc; #ifdef USE_JIT u8 *old_code_ptr = GetWritableCodePtr(); @@ -688,4 +688,4 @@ void VertexLoader::AppendToString(std::string *dest) { dest->append(StringFromFormat("sz: %i skin: %i Pos: %i %s %s Nrm: %i %s %s - %i vtx\n", m_VertexSize, m_VtxDesc.PosMatIdx, m_VtxAttr.PosElements ? 3 : 2, posMode[m_VtxDesc.Position], posFormats[m_VtxAttr.PosFormat], m_VtxAttr.NormalElements, posMode[m_VtxDesc.Normal], posFormats[m_VtxAttr.NormalFormat], m_numLoadedVertices)); -} \ No newline at end of file +} diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h index 75e8854b75..37a72a180c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h @@ -70,8 +70,8 @@ private: struct Set { Set() {} Set(int gc_size_, TPipelineFunction function_) : gc_size(gc_size_), function(function_) {} - TPipelineFunction function; int gc_size; + TPipelineFunction function; // int pc_size; };