diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 557a51ec4a..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{}; } }; @@ -338,8 +326,6 @@ namespace fmt { throw "Invalid formatting (s32): " + std::string(fmt, len); } - - return{}; } }; @@ -360,8 +346,6 @@ namespace fmt { throw "Invalid formatting (s64): " + std::string(fmt, len); } - - return{}; } }; @@ -382,8 +366,6 @@ namespace fmt { throw "Invalid formatting (float): " + std::string(fmt, len); } - - return{}; } }; @@ -404,8 +386,6 @@ namespace fmt { throw "Invalid formatting (double): " + std::string(fmt, len); } - - return{}; } }; @@ -430,8 +410,6 @@ namespace fmt { throw "Invalid formatting (bool): " + std::string(fmt, len); } - - return{}; } }; @@ -448,8 +426,6 @@ namespace fmt { throw "Invalid formatting (const char*): " + std::string(fmt, len); } - - return{}; } }; diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index 2c5c13246d..fa7d6803f0 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -363,6 +363,7 @@ struct PPCdouble case _FPCLASS_PD: return FPR_PD; case _FPCLASS_PN: return FPR_PN; case _FPCLASS_PINF: return FPR_PINF; + default: throw fmt::Format("PPCdouble::UpdateType() -> unknown fpclass (0x%04x).", fpc); } #else switch (fpc) @@ -374,8 +375,6 @@ struct PPCdouble default: return std::signbit(_double) ? FPR_NN : FPR_PN; } #endif - - throw fmt::Format("PPCdouble::UpdateType() -> unknown fpclass (0x%04x).", fpc); } FPRType GetType() const diff --git a/rpcs3/Emu/FS/vfsDirBase.h b/rpcs3/Emu/FS/vfsDirBase.h index 0d05dcbaf5..c4d515899c 100644 --- a/rpcs3/Emu/FS/vfsDirBase.h +++ b/rpcs3/Emu/FS/vfsDirBase.h @@ -68,8 +68,7 @@ public: } iterator(const DirEntryInfo* data) - : parent(parent) - , data(data) + : data(data) { } diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index ea6bb1a0bb..d537bdf92d 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -495,9 +495,9 @@ void GLFragmentDecompilerThread::Task() case RSX_FP_OPCODE_NRM: SetDst("normalize($0)"); break; case RSX_FP_OPCODE_BEM: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: BEM"); break; case RSX_FP_OPCODE_TEX: SetDst("texture($t, $0.xy)"); break; - case RSX_FP_OPCODE_TEXBEM: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TEXBEM"); break; - case RSX_FP_OPCODE_TXP: SetDst("textureProj($t, $0.xy, $1)"); break; //TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478) and The Simpsons Arcade Game (NPUB30563)) - case RSX_FP_OPCODE_TXPBEM: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXPBEM"); break; + case RSX_FP_OPCODE_TEXBEM: SetDst("texture($t, $0.xy, $1.x)"); break; + case RSX_FP_OPCODE_TXP: SetDst("textureProj($t, $0.xy, $1.x)"); break; //TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478) and The Simpsons Arcade Game (NPUB30563)) + case RSX_FP_OPCODE_TXPBEM: SetDst("textureProj($t, $0.xy, $1.x)"); break; case RSX_FP_OPCODE_TXD: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXD"); break; case RSX_FP_OPCODE_TXB: SetDst("texture($t, $0.xy, $1.x)"); break; case RSX_FP_OPCODE_TXL: SetDst("textureLod($t, $0.xy, $1.x)"); break; diff --git a/rpcs3/Emu/RSX/RSXTexture.cpp b/rpcs3/Emu/RSX/RSXTexture.cpp index 7a21e076d3..ba07dfd5a3 100644 --- a/rpcs3/Emu/RSX/RSXTexture.cpp +++ b/rpcs3/Emu/RSX/RSXTexture.cpp @@ -289,19 +289,19 @@ 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 { return 1; - return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)] >> 8) & 0xf); + //return ((methodRegisters[NV4097_SET_VERTEX_TEXTURE_ADDRESS + (m_index * 32)] >> 8) & 0xf); } 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 f91f4cb1c6..9250ac1f20 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -542,17 +542,15 @@ int cellGcmSetSecondVFrequency(u32 freq) switch (freq) { case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ: - cellGcmSys->Todo("Unimplemented display frequency: 59.94Hz"); + 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"); + 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 64107c9461..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 0c372e82e8..a652921035 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -1060,8 +1060,10 @@ 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) @@ -1437,8 +1439,10 @@ 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 0dcd836eca..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)