From 543ed016426d4ae30a19c1d39dcbdf5f6daf4996 Mon Sep 17 00:00:00 2001 From: elisha464 Date: Sun, 26 Jan 2014 23:07:14 +0200 Subject: [PATCH 1/3] delete m_main_mem_addr --- rpcs3/Emu/GS/RSXThread.h | 3 +-- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rpcs3/Emu/GS/RSXThread.h b/rpcs3/Emu/GS/RSXThread.h index 7f43d589a0..649f9d4ec1 100644 --- a/rpcs3/Emu/GS/RSXThread.h +++ b/rpcs3/Emu/GS/RSXThread.h @@ -265,7 +265,6 @@ public: u32 m_report_main_addr; u32 m_local_mem_addr, m_main_mem_addr; - Array m_main_mem_info; public: uint m_draw_mode; @@ -637,7 +636,7 @@ protected: switch(location) { case CELL_GCM_LOCATION_LOCAL: return m_local_mem_addr + offset; - case CELL_GCM_LOCATION_MAIN: return m_main_mem_addr + offset; + case CELL_GCM_LOCATION_MAIN: return Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + offset); } ConLog.Error("GetAddress(offset=0x%x, location=0x%x)", location); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index c9db1fe8ab..e3942e2fa0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -107,7 +107,6 @@ int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress) render.m_tiles_addr = Memory.Alloc(sizeof(CellGcmTileInfo) * 15, sizeof(CellGcmTileInfo)); render.m_gcm_buffers_count = 0; render.m_gcm_current_buffer = 0; - render.m_main_mem_info.Clear(); render.m_main_mem_addr = 0; render.Init(ctx_begin, ctx_size, gcm_info.control_addr, local_addr); @@ -725,7 +724,6 @@ int32_t cellGcmMapMainMemory(u64 ea, u32 size, mem32_t offset) } Emu.GetGSManager().GetRender().m_main_mem_addr = Emu.GetGSManager().GetRender().m_ioAddress; - Emu.GetGSManager().GetRender().m_main_mem_info.AddCpy(MemInfo(ea, size)); return CELL_OK; } From 057efb48fa01f780149566a6ed76b9e6bc6fa7af Mon Sep 17 00:00:00 2001 From: elisha464 Date: Sun, 26 Jan 2014 23:08:09 +0200 Subject: [PATCH 2/3] fix problem where there was black quads instead of text in fw samples --- rpcs3/Emu/GS/GL/GLFragmentProgram.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp index d6585cb1b7..18e231a338 100644 --- a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp @@ -98,17 +98,16 @@ std::string GLFragmentDecompilerThread::GetMask() std::string GLFragmentDecompilerThread::AddReg(u32 index, int fp16) { - /* - if(HasReg(index, fp16)) - { - return wxString::Format((fp16 ? "h%u" : "r%u"), index); - } - */ + if(index >= 2 && index <= 4) + { + return m_parr.AddParam(PARAM_OUT, "vec4", std::string(fp16 ? "h" : "r") + std::to_string(index), + (fp16) ? -1 : (index - 1)); + } - //ConLog.Warning("%c%d: %d %d", (fp16 ? 'h' : 'r'), index, dst.tex_num, src2.use_index_reg); + return m_parr.AddParam(PARAM_NONE, "vec4", std::string(fp16 ? "h" : "r") + std::to_string(index), "vec4(0.0)"); - return m_parr.AddParam((index >= 2 && index <= 4) ? PARAM_OUT : PARAM_NONE, "vec4", - std::string(fp16 ? "h" : "r") + std::to_string(index), (fp16 || !index) ? -1 : ((index >= 2 && index <= 4) ? (index - 1) : -1)); + //return m_parr.AddParam((index >= 2 && index <= 4) ? PARAM_OUT : PARAM_NONE, "vec4", + // std::string(fp16 ? "h" : "r") + std::to_string(index), (fp16 || !index) ? -1 : ((index >= 2 && index <= 4) ? (index - 1) : -1)); } bool GLFragmentDecompilerThread::HasReg(u32 index, int fp16) @@ -219,6 +218,15 @@ std::string GLFragmentDecompilerThread::BuildCode() p += m_parr.params[i].Format(); } + //return "#version 330\n\ +\n\ +out vec3 color;\n\ +in vec4 tc1;\n\ +\n\ +void main()\n\ +{\n\ + color = tc1.rgb;\n\ +}"; return std::string("#version 330\n" "\n" + p + "\n" From 3209b2f5f34a4c8f187c578ebe07af8d9f0c3240 Mon Sep 17 00:00:00 2001 From: elisha464 Date: Tue, 28 Jan 2014 20:01:44 +0200 Subject: [PATCH 3/3] fixed VPREM and VSLDOI --- rpcs3/Emu/Cell/PPUInterpreter.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index ebc8193c96..0ca920f8fd 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -1210,11 +1210,15 @@ private: } void VPERM(u32 vd, u32 va, u32 vb, u32 vc) { + u8 tmpSRC[32]; + memcpy(tmpSRC, CPU.VPR[vb]._u8, 16); + memcpy(tmpSRC + 16, CPU.VPR[va]._u8, 16); + for (uint b = 0; b < 16; b++) { u8 index = CPU.VPR[vc]._u8[b] & 0x1f; - CPU.VPR[vd]._u8[b] = index < 0x10 ? CPU.VPR[va]._u8[0xf - index] : CPU.VPR[vb]._u8[0xf - (index - 0x10)]; + CPU.VPR[vd]._u8[b] = tmpSRC[0x1f - index]; } } void VPKPX(u32 vd, u32 va, u32 vb) @@ -1553,14 +1557,23 @@ private: } void VSLDOI(u32 vd, u32 va, u32 vb, u32 sh) { - for (uint b = 0; b < 16 - sh; b++) + u8 tmpSRC[32]; + memcpy(tmpSRC, CPU.VPR[vb]._u8, 16); + memcpy(tmpSRC + 16, CPU.VPR[va]._u8, 16); + + for(uint b=0; b<16; b++) + { + CPU.VPR[vd]._u8[15 - b] = tmpSRC[31 - (b + sh)]; + } + + /*for (uint b = 0; b < 16 - sh; b++) { CPU.VPR[vd]._u8[15 - b] = CPU.VPR[va]._u8[15 - (b + sh)]; } for (uint b = 16 - sh; b < 16; b++) { CPU.VPR[vd]._u8[15 - b] = CPU.VPR[vb]._u8[15 - (b - (16 - sh))]; - } + }*/ } void VSLH(u32 vd, u32 va, u32 vb) {