From ae6ff4449ee02827ccfffba21b70bf8d49118c77 Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Sat, 19 Dec 2015 18:04:18 +0100 Subject: [PATCH] Debug DX12 --- Utilities/File.cpp | 3 -- Utilities/Thread.cpp | 2 +- rpcs3/Emu/Cell/PPUInterpreter.cpp | 8 +++-- rpcs3/Emu/Cell/PPUInterpreter.h | 11 +++---- rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp | 2 +- rpcs3/Emu/Memory/vm.cpp | 2 +- rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp | 13 ++++---- rpcs3/Emu/RSX/D3D12/D3D12MemoryHelpers.h | 2 +- rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h | 4 +-- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 12 +++++-- rpcs3/Emu/SysCalls/Modules/cellDmux.cpp | 32 +++++++++---------- rpcs3/Emu/SysCalls/Modules/cellFont.cpp | 28 +++++++++------- rpcs3/Emu/SysCalls/Modules/cellFs.cpp | 11 ++++--- rpcs3/Emu/SysCalls/Modules/cellGame.cpp | 9 ++++-- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 9 ++++-- rpcs3/Emu/SysCalls/Modules/cellMusic.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp | 9 ++++-- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 4 +-- rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 5 +++ rpcs3/Emu/SysCalls/Modules/sceNp.cpp | 29 +++++++++++------ rpcs3/Emu/SysCalls/Modules/sceNp2.cpp | 15 ++++++--- rpcs3/Emu/SysCalls/Modules/sys_libc.cpp | 3 +- .../Emu/SysCalls/Modules/sys_ppu_thread_.cpp | 6 ++-- rpcs3/Emu/SysCalls/lv2/sys_fs.cpp | 13 +++++++- 24 files changed, 142 insertions(+), 92 deletions(-) diff --git a/Utilities/File.cpp b/Utilities/File.cpp index e9cbc3a8af..259c351453 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -249,7 +249,6 @@ bool fs::is_dir(const std::string& path) { case ERROR_FILE_NOT_FOUND: errno = ENOENT; break; case ERROR_PATH_NOT_FOUND: errno = ENOENT; break; - default: throw EXCEPTION("Unknown Win32 error: 0x%x (%s).", error, path); } return false; @@ -687,10 +686,8 @@ u64 fs::file::read(void* buffer, u64 count) const switch (DWORD error = GetLastError()) { case ERROR_INVALID_HANDLE: errno = EBADF; break; - default: throw EXCEPTION("Unknown Win32 error: 0x%x.", error); } - return -1; } return nread; diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 86a6701b3a..8374228fa2 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1131,7 +1131,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) // Throw virtual memory access violation exception [[noreturn]] void throw_access_violation(const char* cause, u32 address) // Don't change function definition { - throw EXCEPTION("Access violation %s location 0x%08x", cause, address); + //throw EXCEPTION("Access violation %s location 0x%08x", cause, address); } // Modify context in order to convert hardware exception to C++ exception diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index ec051c8ab1..64b96f60dd 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -73,12 +73,14 @@ void ppu_interpreter::TWI(PPUThread& CPU, ppu_opcode_t op) void ppu_interpreter::MFVSCR(PPUThread& CPU, ppu_opcode_t op) { - throw EXCEPTION(""); + CPU.VPR[op.vd]._u32[0] = CPU.VSCR.VSCR; + CPU.VPR[op.vd].clear(); } void ppu_interpreter::MTVSCR(PPUThread& CPU, ppu_opcode_t op) { - // ignored (MFVSCR disabled) + CPU.VSCR.VSCR = CPU.VPR[op.vb]._u32[0]; + CPU.VSCR.X = CPU.VSCR.Y = 0; } void ppu_interpreter::VADDCUW(PPUThread& CPU, ppu_opcode_t op) @@ -1696,7 +1698,7 @@ void ppu_interpreter::TW(PPUThread& CPU, ppu_opcode_t op) ((u32)a < (u32)b && (op.bo & 0x2)) || ((u32)a >(u32)b && (op.bo & 0x1))) { - throw EXCEPTION(""); + //throw EXCEPTION(""); } } diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 9e550bea4d..766a686ce5 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -2571,14 +2571,11 @@ private: s32 a = (s32)CPU.GPR[ra]; s32 b = (s32)CPU.GPR[rb]; - if( (a < b && (to & 0x10)) || - (a > b && (to & 0x8)) || - (a == b && (to & 0x4)) || + if ((a < b && (to & 0x10)) || + (a > b && (to & 0x8)) || + (a == b && (to & 0x4)) || ((u32)a < (u32)b && (to & 0x2)) || - ((u32)a > (u32)b && (to & 0x1)) ) - { - throw EXCEPTION("Trap! (tw 0x%x, r%d, r%d)", to, ra, rb); - } + ((u32)a >(u32)b && (to & 0x1))); } void LVSL(u32 vd, u32 ra, u32 rb) override { diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 1f5f43f9c4..9a8fbb38b1 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -916,7 +916,7 @@ void spu_recompiler::BISL(spu_opcode_t op) void spu_recompiler::IRET(spu_opcode_t op) { - throw EXCEPTION("Unimplemented instruction"); + //throw EXCEPTION("Unimplemented instruction"); } void spu_recompiler::BISLED(spu_opcode_t op) diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index e5bd00b22d..fcee6ca70b 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -807,7 +807,7 @@ namespace vm { if (used > this->size) { - throw EXCEPTION("Unexpected memory amount used (0x%x)", used); + //throw EXCEPTION("Unexpected memory amount used (0x%x)", used); } if (used + size > this->size) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp index d02c941089..914a938a8f 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp @@ -40,11 +40,10 @@ D3D12_BLEND get_blend_factor(u16 factor) case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_SRC_ALPHA_SAT; case CELL_GCM_CONSTANT_COLOR: return D3D12_BLEND_DEST_COLOR; case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: return D3D12_BLEND_INV_DEST_COLOR; - case CELL_GCM_CONSTANT_ALPHA: - case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: - break; + case CELL_GCM_CONSTANT_ALPHA: return D3D12_BLEND_DEST_ALPHA; + case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: return D3D12_BLEND_INV_DEST_ALPHA; } - throw EXCEPTION("Invalid or unsupported blend factor (0x%x)", factor); + throw EXCEPTION("Invalid blend factor (0x%x)", factor); } D3D12_BLEND get_blend_factor_alpha(u16 factor) @@ -62,10 +61,10 @@ D3D12_BLEND get_blend_factor_alpha(u16 factor) case CELL_GCM_DST_COLOR: return D3D12_BLEND_DEST_ALPHA; case CELL_GCM_ONE_MINUS_DST_COLOR: return D3D12_BLEND_INV_DEST_ALPHA; case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_SRC_ALPHA_SAT; + case CELL_GCM_CONSTANT_ALPHA: return D3D12_BLEND_DEST_ALPHA; + case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: return D3D12_BLEND_INV_DEST_ALPHA; case CELL_GCM_CONSTANT_COLOR: case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: - case CELL_GCM_CONSTANT_ALPHA: - case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: break; } throw EXCEPTION("Invalid or unsupported blend alpha factor (0x%x)", factor); @@ -162,7 +161,7 @@ DXGI_FORMAT get_texture_format(u8 format) case CELL_GCM_TEXTURE_D8R8G8B8: return DXGI_FORMAT_R8G8B8A8_UNORM; case CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return DXGI_FORMAT_G8R8_G8B8_UNORM; case CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return DXGI_FORMAT_R8G8_B8G8_UNORM; - case CELL_GCM_TEXTURE_Y16_X16_FLOAT: + case CELL_GCM_TEXTURE_Y16_X16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT; case CELL_GCM_TEXTURE_COMPRESSED_HILO8: case CELL_GCM_TEXTURE_COMPRESSED_HILO_S8: case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: diff --git a/rpcs3/Emu/RSX/D3D12/D3D12MemoryHelpers.h b/rpcs3/Emu/RSX/D3D12/D3D12MemoryHelpers.h index 55ec86f75e..c83fdd4c32 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12MemoryHelpers.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12MemoryHelpers.h @@ -70,7 +70,7 @@ public: template size_t alloc(size_t size) { - if (!can_alloc(size)) throw EXCEPTION("Working buffer not big enough"); + if (!can_alloc(size)) LOG_ERROR (RSX, "Working buffer not big enough"); size_t alloc_size = align(size, Alignement); size_t aligned_put_pos = align(m_put_pos, Alignement); if (aligned_put_pos + alloc_size < m_size) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h index bdd282b814..ecdd0fd5f3 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h @@ -130,7 +130,7 @@ struct D3D12Traits } } - fs::file(fs::get_config_dir() + "FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shader); + fs::file(fs::get_config_dir() + "/hlsl/FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shader); fragmentProgramData.id = (u32)ID; } @@ -141,7 +141,7 @@ struct D3D12Traits std::string shaderCode = VS.Decompile(); vertexProgramData.Compile(shaderCode, Shader::SHADER_TYPE::SHADER_TYPE_VERTEX); vertexProgramData.vertex_shader_input_count = RSXVP.rsx_vertex_inputs.size(); - fs::file(fs::get_config_dir() + "VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shaderCode); + fs::file(fs::get_config_dir() + "/hlsl/VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shaderCode); vertexProgramData.id = (u32)ID; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 3a1234f6ae..e01b4d9c3b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -39,6 +39,8 @@ AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr switch (type) { + case CELL_ADEC_TYPE_LPCM_PAMF: + case CELL_ADEC_TYPE_AC3: case CELL_ADEC_TYPE_ATRACX: case CELL_ADEC_TYPE_ATRACX_2CH: case CELL_ADEC_TYPE_ATRACX_6CH: @@ -49,6 +51,7 @@ AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr break; } case CELL_ADEC_TYPE_MP3: + case CELL_ADEC_TYPE_MPEG_L2: { codec = avcodec_find_decoder(AV_CODEC_ID_MP3); input_format = av_find_input_format("mp3"); @@ -475,16 +478,16 @@ bool adecCheckType(s32 type) { switch (type) { + case CELL_ADEC_TYPE_LPCM_PAMF: cellAdec.notice("adecCheckType(): LPCM pamf"); break; + case CELL_ADEC_TYPE_AC3: cellAdec.notice("adecCheckType(): AC3"); break; case CELL_ADEC_TYPE_ATRACX: cellAdec.notice("adecCheckType(): ATRAC3plus"); break; case CELL_ADEC_TYPE_ATRACX_2CH: cellAdec.notice("adecCheckType(): ATRAC3plus 2ch"); break; case CELL_ADEC_TYPE_ATRACX_6CH: cellAdec.notice("adecCheckType(): ATRAC3plus 6ch"); break; case CELL_ADEC_TYPE_ATRACX_8CH: cellAdec.notice("adecCheckType(): ATRAC3plus 8ch"); break; case CELL_ADEC_TYPE_MP3: cellAdec.notice("adecCheckType(): MP3"); break; + case CELL_ADEC_TYPE_MPEG_L2: cellAdec.notice("adecCheckType(): Mpeg L2"); break; - case CELL_ADEC_TYPE_LPCM_PAMF: - case CELL_ADEC_TYPE_AC3: case CELL_ADEC_TYPE_ATRAC3: - case CELL_ADEC_TYPE_MPEG_L2: case CELL_ADEC_TYPE_CELP: case CELL_ADEC_TYPE_M4AAC: case CELL_ADEC_TYPE_CELP8: @@ -592,6 +595,8 @@ s32 cellAdecStartSeq(u32 handle, u32 param) switch (adec->type) { + case CELL_ADEC_TYPE_LPCM_PAMF: + case CELL_ADEC_TYPE_AC3: case CELL_ADEC_TYPE_ATRACX: case CELL_ADEC_TYPE_ATRACX_2CH: case CELL_ADEC_TYPE_ATRACX_6CH: @@ -612,6 +617,7 @@ s32 cellAdecStartSeq(u32 handle, u32 param) break; } case CELL_ADEC_TYPE_MP3: + case CELL_ADEC_TYPE_MPEG_L2: { const auto mp3 = vm::cptr::make(param); diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index 5a2cbf2135..5f1c6fcf33 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -656,26 +656,26 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor { esAVC[es.fidMajor % 16] = task.es.es_ptr; } - //else if ((es.fidMajor & -0x10) == 0xe0 && es.fidMinor == 0 && !es.sup1 && !es.sup2) - //{ - // esM2V[es.fidMajor % 16] = task.es.es_ptr; - //} + else if ((es.fidMajor & -0x10) == 0xe0 && es.fidMinor == 0 && !es.sup1 && !es.sup2) + { + esM2V[es.fidMajor % 16] = task.es.es_ptr; + } else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0 && !es.sup1 && !es.sup2) { esATX[es.fidMinor % 16] = task.es.es_ptr; } - //else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x20 && !es.sup1 && !es.sup2) - //{ - // esDATA[es.fidMinor % 16] = task.es.es_ptr; - //} - //else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x30 && !es.sup1 && !es.sup2) - //{ - // esAC3[es.fidMinor % 16] = task.es.es_ptr; - //} - //else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x40 && !es.sup1 && !es.sup2) - //{ - // esPCM[es.fidMinor % 16] = task.es.es_ptr; - //} + else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x20 && !es.sup1 && !es.sup2) + { + esDATA[es.fidMinor % 16] = task.es.es_ptr; + } + else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x30 && !es.sup1 && !es.sup2) + { + esAC3[es.fidMinor % 16] = task.es.es_ptr; + } + else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x40 && !es.sup1 && !es.sup2) + { + esPCM[es.fidMinor % 16] = task.es.es_ptr; + } else { throw EXCEPTION("dmuxEnableEs: unknown filter (0x%x, 0x%x, 0x%x, 0x%x)", es.fidMajor, es.fidMinor, es.sup1, es.sup2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp index dff5cbb589..9f079186ca 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp @@ -453,7 +453,7 @@ s32 cellFontSetEffectWeight() s32 cellFontGlyphSetupVertexesGlyph() { - UNIMPLEMENTED_FUNC(cellFont); + //UNIMPLEMENTED_FUNC(cellFont); return CELL_OK; } @@ -478,7 +478,7 @@ s32 cellFontSetScalePoint() s32 cellFontSetupRenderEffectSlant() { UNIMPLEMENTED_FUNC(cellFont); - return CELL_OK; + return -1; } s32 cellFontGraphicsSetLineRGBA() @@ -508,30 +508,30 @@ s32 cellFontGraphicsSetupDrawContext() s32 cellFontSetupRenderEffectWeight() { UNIMPLEMENTED_FUNC(cellFont); - return CELL_OK; + return -1; } s32 cellFontGlyphGetOutlineControlDistance() { - UNIMPLEMENTED_FUNC(cellFont); + //UNIMPLEMENTED_FUNC(cellFont); return CELL_OK; } s32 cellFontGlyphGetVertexesGlyphSize() { - UNIMPLEMENTED_FUNC(cellFont); + //UNIMPLEMENTED_FUNC(cellFont); return CELL_OK; } s32 cellFontGenerateCharGlyph() { - UNIMPLEMENTED_FUNC(cellFont); + //UNIMPLEMENTED_FUNC(cellFont); return CELL_OK; } s32 cellFontDeleteGlyph() { - UNIMPLEMENTED_FUNC(cellFont); + //UNIMPLEMENTED_FUNC(cellFont); return CELL_OK; } @@ -552,7 +552,7 @@ s32 cellFontExtend(u32 a1, u32 a2, u32 a3) //Something happens } //Something happens? - return CELL_OK; + return -1; } s32 cellFontRenderCharGlyphImageVertical() @@ -585,12 +585,14 @@ s32 cellFontGraphicsGetDrawType() s32 cellFontGetKerning() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFont); + return -1;//throw EXCEPTION(""); } s32 cellFontGetRenderScaledKerning() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFont); + return -1;//throw EXCEPTION(""); } s32 cellFontGetRenderScalePixel() @@ -620,7 +622,8 @@ s32 cellFontGetEffectWeight() s32 cellFontGetScalePixel() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFont); + return -1;//throw EXCEPTION(""); } s32 cellFontClearFileCache() @@ -635,7 +638,8 @@ s32 cellFontAdjustFontScaling() s32 cellFontSetupRenderScalePoint() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFont); + return CELL_OK; //throw EXCEPTION(""); } s32 cellFontGlyphGetVerticalShift() diff --git a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp index 37154ae03b..71a7a87003 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp @@ -144,7 +144,7 @@ s32 cellFsFsync(u32 fd) { cellFs.todo("cellFsFsync(fd=0x%x)", fd); - return CELL_OK; + return -1; //CELL_OK; } s32 cellFsFGetBlockSize(u32 fd, vm::ptr sector_size, vm::ptr block_size) @@ -987,7 +987,8 @@ s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type s32 cellFsUtime() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFs); + return CELL_OK; } s32 cellFsArcadeHddSerialNumber() @@ -1027,7 +1028,8 @@ s32 cellFsChangeFileSizeWithoutAllocation() s32 cellFsAllocateFileAreaWithoutZeroFill() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFs); + return CELL_OK; } s32 cellFsChangeFileSizeByFdWithoutAllocation() @@ -1037,7 +1039,8 @@ s32 cellFsChangeFileSizeByFdWithoutAllocation() s32 cellFsSetDiscReadRetrySetting() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellFs); + return CELL_OK; } s32 cellFsRegisterConversionCallback() diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index a5c646a99e..0dc398a4b2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -139,7 +139,8 @@ s32 cellHddGameExitBroken() s32 cellGameDataGetSizeKB() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGame); + return CELL_OK; } s32 cellGameDataSetSystemVer() @@ -670,12 +671,14 @@ s32 cellGameThemeInstallFromBuffer() s32 cellDiscGameGetBootDiscInfo() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGame); + return CELL_OK; } s32 cellDiscGameRegisterDiscChangeCallback() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGame); + return CELL_OK; } s32 cellDiscGameUnregisterDiscChangeCallback() diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 3f14986a60..4b0b36e89b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -1189,12 +1189,14 @@ s32 cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 co s32 _cellGcmFunc2() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGcmSys); + return CELL_OK; } s32 _cellGcmFunc3() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGcmSys); + return -1; } s32 _cellGcmFunc4() @@ -1204,7 +1206,8 @@ s32 _cellGcmFunc4() s32 _cellGcmFunc13() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellGcmSys); + return -1; } s32 _cellGcmFunc38() diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp index 38525e4f7d..7fb01899ec 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp @@ -27,7 +27,7 @@ s32 cellMusicSetSelectionContext2() s32 cellMusicSetVolume2() { - throw EXCEPTION(""); + return CELL_OK; //throw EXCEPTION(""); } s32 cellMusicGetContentsId() diff --git a/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp index 6a83bd544e..eb8f2918d9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp @@ -6,7 +6,8 @@ extern Module<> cellOskDialog; s32 cellOskDialogLoadAsync() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellOskDialog); + return -1; //CELL_OK; } s32 cellOskDialogUnloadAsync() @@ -51,7 +52,8 @@ s32 cellOskDialogDisableDimmer() s32 cellOskDialogSetKeyLayoutOption() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellOskDialog); + return -1; //CELL_OK; } s32 cellOskDialogAddSupportLanguage() @@ -61,7 +63,8 @@ s32 cellOskDialogAddSupportLanguage() s32 cellOskDialogSetLayoutMode() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(cellOskDialog); + return -1; //CELL_OK; } s32 cellOskDialogGetInputText() diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 048dd4625c..26d0296c21 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -302,12 +302,12 @@ s32 cellSysutilGetBgmPlaybackStatus2(vm::ptr stat s32 cellSysutilSetBgmPlaybackExtraParam() { - throw EXCEPTION(""); + return CELL_OK; //throw EXCEPTION(""); } s32 cellSysutilRegisterCallbackDispatcher() { - throw EXCEPTION(""); + return CELL_OK; //throw EXCEPTION(""); } s32 cellSysutilPacketWrite() diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 34e06c726f..2b75c1b018 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -640,6 +640,11 @@ s32 cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr event, vm::ptr from, vm::ptr< // TODO: Check for other error and pass other events *event = SCE_NP_BASIC_EVENT_OFFLINE; - return CELL_OK; + return -1; } s32 sceNpCommerceCreateCtx() @@ -1482,47 +1482,56 @@ s32 _sceNpSysutilClientFree() s32 _Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z27_sce_np_sysutil_send_packetiRN4cxml8DocumentE() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z31_sce_np_sysutil_send_packet_subiRN4cxml8DocumentE() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z37sce_np_matching_set_matching2_runningb() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp index 0c6cf5260b..422e28b149 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp @@ -235,7 +235,8 @@ s32 sceNpMatching2SetSignalingOptParam() s32 sceNpMatching2RegisterContextCallback() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp2); + return CELL_OK; } s32 sceNpMatching2SendRoomChatMessage() @@ -275,7 +276,8 @@ s32 sceNpMatching2GrantRoomOwner() s32 sceNpMatching2CreateContext() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp2); + return CELL_OK; } s32 sceNpMatching2GetSignalingOptParamLocal() @@ -325,12 +327,14 @@ s32 sceNpMatching2DeleteServerContext() s32 sceNpMatching2SetDefaultRequestOptParam() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp2); + return CELL_OK; } s32 sceNpMatching2RegisterRoomEventCallback() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp2); + return CELL_OK; } s32 sceNpMatching2GetRoomPasswordLocal() @@ -380,7 +384,8 @@ s32 sceNpMatching2SetLobbyMemberDataInternal() s32 sceNpMatching2RegisterRoomMessageCallback() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sceNp2); + return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp b/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp index a7ec31eb24..0a2742bba6 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp @@ -193,7 +193,8 @@ s32 _sys_memchr() s32 _sys_memmove() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sys_libc); + return CELL_OK; } s64 _sys_strlen(vm::cptr str) diff --git a/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp index a22edcc521..8796807541 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp @@ -70,12 +70,14 @@ void sys_ppu_thread_once(PPUThread& ppu, vm::ptr> once_ctrl, vm s32 sys_ppu_thread_register_atexit() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sysPrxForUser); + return CELL_OK; } s32 sys_ppu_thread_unregister_atexit() { - throw EXCEPTION(""); + UNIMPLEMENTED_FUNC(sysPrxForUser); + return CELL_OK; } void sysPrxForUser_sys_ppu_thread_init() diff --git a/rpcs3/Emu/SysCalls/lv2/sys_fs.cpp b/rpcs3/Emu/SysCalls/lv2/sys_fs.cpp index 9b2fef1ae0..1a75dd85df 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_fs.cpp @@ -100,7 +100,18 @@ s32 sys_fs_open(vm::cptr path, s32 flags, vm::ptr fd, s32 mode, vm::c throw EXCEPTION("Invalid or unimplemented flags (%#o): '%s'", flags, path.get_ptr()); } - std::shared_ptr file(Emu.GetVFS().OpenFile(path.get_ptr(), open_mode)); + const char *path_ptr = path.get_ptr(); + + if (strstr(path.get_ptr(), "/dev_hdd0") && + strncmp(path.get_ptr(), "/dev_hdd0", 9)) + { + path_ptr = strstr(path_ptr, "/dev_hdd0"); + + LOG_ERROR(HLE, "Path contains device root path but not at the start!"); + LOG_ERROR(HLE, "Path given is (%s), modified to (%s)", path.get_ptr(), path_ptr); + } + + std::shared_ptr file(Emu.GetVFS().OpenFile(path_ptr, open_mode)); if (!file || !file->IsOpened()) {