diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 056861c122..3bc464fcb8 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -206,8 +206,6 @@ namespace fmt { throw "Invalid formatting (u8): " + std::string(fmt, len); } - - return{}; } }; @@ -228,8 +226,6 @@ namespace fmt { throw "Invalid formatting (u16): " + std::string(fmt, len); } - - return{}; } }; @@ -250,8 +246,6 @@ namespace fmt { throw "Invalid formatting (u32): " + std::string(fmt, len); } - - return{}; } }; @@ -272,8 +266,6 @@ namespace fmt { throw "Invalid formatting (u64): " + std::string(fmt, len); } - - return{}; } }; @@ -294,8 +286,6 @@ namespace fmt { throw "Invalid formatting (s8): " + std::string(fmt, len); } - - return{}; } }; @@ -316,8 +306,6 @@ namespace fmt { throw "Invalid formatting (s16): " + std::string(fmt, len); } - - return{}; } }; @@ -378,8 +366,6 @@ namespace fmt { throw "Invalid formatting (float): " + std::string(fmt, len); } - - return{}; } }; @@ -400,8 +386,6 @@ namespace fmt { throw "Invalid formatting (double): " + std::string(fmt, len); } - - return{}; } }; @@ -426,8 +410,6 @@ namespace fmt { throw "Invalid formatting (bool): " + std::string(fmt, len); } - - return{}; } }; diff --git a/rpcs3/Emu/FS/vfsDirBase.h b/rpcs3/Emu/FS/vfsDirBase.h index 84e4b0c342..c4d515899c 100644 --- a/rpcs3/Emu/FS/vfsDirBase.h +++ b/rpcs3/Emu/FS/vfsDirBase.h @@ -62,7 +62,8 @@ public: public: iterator(vfsDirBase* parent) - : data(parent->First()) + : parent(parent) + , data(parent->First()) { } diff --git a/rpcs3/Emu/RSX/RSXTexture.cpp b/rpcs3/Emu/RSX/RSXTexture.cpp index ce56142468..ba07dfd5a3 100644 --- a/rpcs3/Emu/RSX/RSXTexture.cpp +++ b/rpcs3/Emu/RSX/RSXTexture.cpp @@ -289,7 +289,7 @@ u16 RSXVertexTexture::GetMipmap() const u8 RSXVertexTexture::GetWrapS() const { return 1; - return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)]) & 0xf); + //return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)]) & 0xf); } u8 RSXVertexTexture::GetWrapT() const @@ -301,7 +301,7 @@ u8 RSXVertexTexture::GetWrapT() const u8 RSXVertexTexture::GetWrapR() const { return 1; - return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)] >> 16) & 0xf); + //return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)] >> 16) & 0xf); } u8 RSXVertexTexture::GetUnsignedRemap() const diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 17bc0b1460..9250ac1f20 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -542,16 +542,15 @@ int cellGcmSetSecondVFrequency(u32 freq) switch (freq) { case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ: - cellGcmSys->Todo("Unimplemented display frequency: 59.94Hz"); break; + Emu.GetGSManager().GetRender().m_frequency_mode = freq; cellGcmSys->Todo("Unimplemented display frequency: 59.94Hz"); break; case CELL_GCM_DISPLAY_FREQUENCY_SCANOUT: - cellGcmSys->Todo("Unimplemented display frequency: Scanout"); break; + Emu.GetGSManager().GetRender().m_frequency_mode = freq; cellGcmSys->Todo("Unimplemented display frequency: Scanout"); break; case CELL_GCM_DISPLAY_FREQUENCY_DISABLE: - Emu.GetGSManager().GetRender().m_frequency_mode = freq; break; - - default: return CELL_EINVAL; + Emu.GetGSManager().GetRender().m_frequency_mode = freq; cellGcmSys->Todo("Unimplemented display frequency: Disabled"); break; + default: cellGcmSys->Error("Improper display frequency specified!"); return; } - return CELL_OK; + return; } int cellGcmSetTileInfo(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 comp, u16 base, u8 bank) diff --git a/rpcs3/Emu/SysCalls/Modules/cellKb.cpp b/rpcs3/Emu/SysCalls/Modules/cellKb.cpp index e8976c0de2..f580155138 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellKb.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellKb.cpp @@ -11,17 +11,24 @@ extern Module *sys_io; int cellKbInit(u32 max_connect) { sys_io->Warning("cellKbInit(max_connect=%d)", max_connect); - if(Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_ALREADY_INITIALIZED; - if(max_connect > 7) return CELL_KB_ERROR_INVALID_PARAMETER; + + if (Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_ALREADY_INITIALIZED; + if (max_connect > 7) + return CELL_KB_ERROR_INVALID_PARAMETER; Emu.GetKeyboardManager().Init(max_connect); + return CELL_OK; } int cellKbEnd() { sys_io->Log("cellKbEnd()"); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; + Emu.GetKeyboardManager().Close(); return CELL_OK; } @@ -29,8 +36,12 @@ int cellKbEnd() int cellKbClearBuf(u32 port_no) { sys_io->Log("cellKbClearBuf(port_no=%d)", port_no); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; - if(port_no >= Emu.GetKeyboardManager().GetKeyboards().size()) return CELL_KB_ERROR_INVALID_PARAMETER; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; + + if (port_no >= Emu.GetKeyboardManager().GetKeyboards().size()) + return CELL_KB_ERROR_INVALID_PARAMETER; //? @@ -42,12 +53,10 @@ u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode) sys_io->Log("cellKbCnvRawCode(arrange=%d,mkey=%d,led=%d,rawcode=%d)", arrange, mkey, led, rawcode); // CELL_KB_RAWDAT - if ((rawcode >= 0x00 && rawcode <= 0x03) || rawcode == 0x29 || rawcode == 0x35 || - (rawcode >= 0x39 && rawcode <= 0x53) || rawcode == 0x65 || rawcode == 0x88 || - rawcode == 0x8A || rawcode == 0x8B) - { - return rawcode | 0x8000; - } + if (rawcode <= 0x03 || rawcode == 0x29 || rawcode == 0x35 || (rawcode >= 0x39 && rawcode <= 0x53) || rawcode == 0x65 || rawcode == 0x88 || rawcode == 0x8A || rawcode == 0x8B) + { + return rawcode | 0x8000; + } // CELL_KB_NUMPAD if (rawcode >= 0x59 && rawcode <= 0x61) return (rawcode - 0x28) | 0x4000; // '1' - '9' @@ -88,13 +97,16 @@ u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode) int cellKbGetInfo(vm::ptr info) { sys_io->Log("cellKbGetInfo(info_addr=0x%x)", info.addr()); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; const KbInfo& current_info = Emu.GetKeyboardManager().GetInfo(); info->max_connect = current_info.max_connect; info->now_connect = current_info.now_connect; info->info = current_info.info; - for(u32 i=0; istatus[i] = current_info.status[i]; } @@ -107,14 +119,18 @@ int cellKbRead(u32 port_no, vm::ptr data) sys_io->Log("cellKbRead(port_no=%d,info_addr=0x%x)", port_no, data.addr()); const std::vector& keyboards = Emu.GetKeyboardManager().GetKeyboards(); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; - if(port_no >= keyboards.size()) return CELL_KB_ERROR_INVALID_PARAMETER; + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; + + if (port_no >= keyboards.size()) + return CELL_KB_ERROR_INVALID_PARAMETER; KbData& current_data = Emu.GetKeyboardManager().GetData(port_no); data->led = current_data.led; data->mkey = current_data.mkey; data->len = std::min((u32)current_data.len, CELL_KB_MAX_KEYCODES); - for(s32 i=0; ikeycode[i] = current_data.keycode[i]; } @@ -127,7 +143,9 @@ int cellKbRead(u32 port_no, vm::ptr data) int cellKbSetCodeType(u32 port_no, u32 type) { sys_io->Log("cellKbSetCodeType(port_no=%d,type=%d)", port_no, type); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; KbConfig& current_config = Emu.GetKeyboardManager().GetConfig(port_no); current_config.code_type = type; @@ -143,7 +161,9 @@ int cellKbSetLEDStatus(u32 port_no, u8 led) int cellKbSetReadMode(u32 port_no, u32 rmode) { sys_io->Log("cellKbSetReadMode(port_no=%d,rmode=%d)", port_no, rmode); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; KbConfig& current_config = Emu.GetKeyboardManager().GetConfig(port_no); current_config.read_mode = rmode; @@ -154,7 +174,9 @@ int cellKbSetReadMode(u32 port_no, u32 rmode) int cellKbGetConfiguration(u32 port_no, vm::ptr config) { sys_io->Log("cellKbGetConfiguration(port_no=%d,config_addr=0x%x)", port_no, config.addr()); - if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; + + if (!Emu.GetKeyboardManager().IsInited()) + return CELL_KB_ERROR_UNINITIALIZED; const KbConfig& current_config = Emu.GetKeyboardManager().GetConfig(port_no); config->arrange = current_config.arrange; diff --git a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp index a26cf637e1..31e3114a3b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp @@ -127,8 +127,8 @@ s32 cellMsgDialogOpen2(u32 type, vm::ptr msgString, vm::ptr cal } char errorCodeHex[12]; +#if __STDC_WANT_SECURE_LIB__ && !_WIN32_WCE sprintf_s(errorCodeHex, "\n(%08x)", errorCode); +#else + sprintf(errorCodeHex, "\n(%08x)", errorCode); +#endif errorMessage.append(errorCodeHex); u64 status; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 17d8d18eef..a652921035 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -1060,8 +1060,11 @@ s32 syncLFQueueGetPushPointer(vm::ptr queue, s32& pointer, u32 res = CELL_SYNC_ERROR_AGAIN; if (!push.m_h7.data() || res) { + // TODO: This condition is always true - wrong implementation? return res; } + + break; } else if (!useEventQueue) { @@ -1436,8 +1439,11 @@ s32 syncLFQueueGetPopPointer(vm::ptr queue, s32& pointer, u32 i res = CELL_SYNC_ERROR_AGAIN; if (!pop.m_h3.data() || res) { + // TODO: This condition is always true - wrong implementation? return res; } + + break; } else if (!useEventQueue) { diff --git a/rpcs3/Gui/CompilerELF.cpp b/rpcs3/Gui/CompilerELF.cpp index d9979dbd70..3fc419f2f1 100644 --- a/rpcs3/Gui/CompilerELF.cpp +++ b/rpcs3/Gui/CompilerELF.cpp @@ -210,91 +210,91 @@ void CompilerELF::OnUpdate(wxCommandEvent& event) DoAnalyzeCode(false); return; - /*asm_list->Freeze(); - asm_list->SetStyle(0, asm_list->GetValue().Len(), wxTextAttr("Black")); + //asm_list->Freeze(); + //asm_list->SetStyle(0, asm_list->GetValue().Len(), wxTextAttr("Black")); - /* - for(u32 i=0; iGetValue().find('#', p)) >= 0;) - { - const int from = p++; - p = asm_list->GetValue().find('\n', p); + //for(int p=0; (p = asm_list->GetValue().find('#', p)) >= 0;) + //{ + // const int from = p++; + // p = asm_list->GetValue().find('\n', p); - if(p < 0) p = asm_list->GetValue().Len(); + // if(p < 0) p = asm_list->GetValue().Len(); - asm_list->SetStyle(from, p, wxTextAttr(0x009900)); - } - - for(int p=0; (p = asm_list->GetValue().find('"', p)) >= 0;) - { - const int from = p++; - const int p1 = asm_list->GetValue().find('\n', p); + // asm_list->SetStyle(from, p, wxTextAttr(0x009900)); + //} + // + //for(int p=0; (p = asm_list->GetValue().find('"', p)) >= 0;) + //{ + // const int from = p++; + // const int p1 = asm_list->GetValue().find('\n', p); - int p2 = p; - for(;;) - { - p2 = asm_list->GetValue().find('"', p2); - if(p2 == -1) break; + // int p2 = p; + // for(;;) + // { + // p2 = asm_list->GetValue().find('"', p2); + // if(p2 == -1) break; - if(asm_list->GetValue()[p2 - 1] == '\\') - { - if(p2 > 2 && asm_list->GetValue()[p2 - 2] == '\\') break; + // if(asm_list->GetValue()[p2 - 1] == '\\') + // { + // if(p2 > 2 && asm_list->GetValue()[p2 - 2] == '\\') break; - p2++; - continue; - } - break; - } + // p2++; + // continue; + // } + // break; + // } - if(p1 < 0 && p2 < 0) - { - p = asm_list->GetValue().Len(); - } - else if(p1 >= 0 && p2 < 0) - { - p = p1; - } - else if(p2 >= 0 && p1 < 0) - { - p = p2 + 1; - } - else - { - p = p1 > p2 ? p2 + 1 : p1; - } + // if(p1 < 0 && p2 < 0) + // { + // p = asm_list->GetValue().Len(); + // } + // else if(p1 >= 0 && p2 < 0) + // { + // p = p1; + // } + // else if(p2 >= 0 && p1 < 0) + // { + // p = p2 + 1; + // } + // else + // { + // p = p1 > p2 ? p2 + 1 : p1; + // } - asm_list->SetStyle(from, p, wxTextAttr(0x000099)); - } + // asm_list->SetStyle(from, p, wxTextAttr(0x000099)); + //} - asm_list->Thaw(); + //asm_list->Thaw(); - UpdateScroll(true, wxVERTICAL);*/ + //UpdateScroll(true, wxVERTICAL); } void CompilerELF::OnScroll(wxScrollWinEvent& event)