From 6c4a980d36f727340ca599b662178da250476173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Fri, 14 Mar 2014 18:12:12 +0100 Subject: [PATCH] Minor changes * Fixed identation * Make some parts of the code more readable. --- rpcs3/Emu/GS/GL/GLGSRender.cpp | 17 ++++-------- rpcs3/Emu/GS/RSXTexture.cpp | 4 +-- rpcs3/Emu/GS/RSXThread.cpp | 28 +++++--------------- rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/sys_net.cpp | 2 +- 5 files changed, 15 insertions(+), 38 deletions(-) diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index 699e23da97..cabcd745d7 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -375,33 +375,24 @@ bool GLGSRender::LoadProgram() if(!m_cur_shader_prog) { ConLog.Warning("LoadProgram: m_cur_shader_prog == NULL"); - return false; } - m_fp_buf_num = m_prog_buffer.SearchFp(*m_cur_shader_prog, m_shader_prog); - - if(m_fp_buf_num == -1) m_shader_prog.Decompile(*m_cur_shader_prog); - if(!m_cur_vertex_prog) { ConLog.Warning("LoadProgram: m_cur_vertex_prog == NULL"); - return false; } - //ConLog.Write("Create program"); + m_fp_buf_num = m_prog_buffer.SearchFp(*m_cur_shader_prog, m_shader_prog); m_vp_buf_num = m_prog_buffer.SearchVp(*m_cur_vertex_prog, m_vertex_prog); - if(m_vp_buf_num == -1) - { - ConLog.Warning("VP not found in buffer!"); - m_vertex_prog.Decompile(*m_cur_vertex_prog); - } + //ConLog.Write("Create program"); if(m_fp_buf_num == -1) { ConLog.Warning("FP not found in buffer!"); + m_shader_prog.Decompile(*m_cur_shader_prog); m_shader_prog.Wait(); m_shader_prog.Compile(); checkForGlError("m_shader_prog.Compile"); @@ -412,6 +403,8 @@ bool GLGSRender::LoadProgram() if(m_vp_buf_num == -1) { + ConLog.Warning("VP not found in buffer!"); + m_vertex_prog.Decompile(*m_cur_vertex_prog); m_vertex_prog.Wait(); m_vertex_prog.Compile(); checkForGlError("m_vertex_prog.Compile"); diff --git a/rpcs3/Emu/GS/RSXTexture.cpp b/rpcs3/Emu/GS/RSXTexture.cpp index 966e97a0af..1b150a95ac 100644 --- a/rpcs3/Emu/GS/RSXTexture.cpp +++ b/rpcs3/Emu/GS/RSXTexture.cpp @@ -3,12 +3,12 @@ RSXTexture::RSXTexture() { - m_index = 0; + m_index = 0; } RSXTexture::RSXTexture(u8 index) { - m_index = index; + m_index = index; } void RSXTexture::Init() diff --git a/rpcs3/Emu/GS/RSXThread.cpp b/rpcs3/Emu/GS/RSXThread.cpp index c16bc64cef..4868845eb0 100644 --- a/rpcs3/Emu/GS/RSXThread.cpp +++ b/rpcs3/Emu/GS/RSXThread.cpp @@ -333,29 +333,13 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 m_surface_width = (a0 >> 16) & 0xff; m_surface_height = (a0 >> 24) & 0xff; - if(count >= 2) + switch (min((u32)6, count)) { - m_surface_pitch_a = ARGS(1); - - if(count >= 3) - { - m_surface_offset_a = ARGS(2); - - if(count >= 4) - { - m_surface_offset_z = ARGS(3); - - if(count >= 5) - { - m_surface_offset_b = ARGS(4); - - if(count >= 6) - { - m_surface_pitch_b = ARGS(5); - } - } - } - } + case 6: m_surface_pitch_b = ARGS(5); + case 5: m_surface_offset_b = ARGS(4); + case 4: m_surface_offset_z = ARGS(3); + case 3: m_surface_offset_a = ARGS(2); + case 2: m_surface_pitch_a = ARGS(1); } gcmBuffer* buffers = (gcmBuffer*)Memory.GetMemFromAddr(m_gcm_buffers_addr); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp index 991ffab7cf..38b4ad53db 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp @@ -166,7 +166,7 @@ int cellSysmoduleLoadModule(u16 id) return CELL_SYSMODULE_ERROR_UNKNOWN; } - if(m->IsLoaded()) + if(m->IsLoaded() && id != 0x10) // CELL_SYSMODULE_GCM_SYS and CELL_SYSMODULE_GCM share the same ID { return CELL_SYSMODULE_ERROR_DUPLICATED; } diff --git a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp index a171925f52..aaeb73cf19 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp @@ -287,7 +287,7 @@ int sys_net_shutdown(s32 s, s32 how) int sys_net_socket(s32 family, s32 type, s32 protocol) { - sys_net.Warning("socket(family=%d, type=%d, protocol=%d", family, type, protocol); + sys_net.Warning("socket(family=%d, type=%d, protocol=%d)", family, type, protocol); int ret = socket(family, type, protocol); g_lastError = getLastError(); return ret;