From d6fe398f79cc6e4097cd2f316abe6a04d92869bd Mon Sep 17 00:00:00 2001 From: DH Date: Thu, 20 Feb 2014 01:39:47 +0200 Subject: [PATCH] Implemented RSXThread OutOfArgsCount notification. --- rpcs3/Emu/GS/RSXThread.cpp | 94 +++++++++++++++++++++++++++-- rpcs3/Emu/GS/RSXThread.h | 1 + rpcs3/Emu/SysCalls/lv2/SC_Event.cpp | 2 +- 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/GS/RSXThread.cpp b/rpcs3/Emu/GS/RSXThread.cpp index d88e4d3fb8..b2c85a7920 100644 --- a/rpcs3/Emu/GS/RSXThread.cpp +++ b/rpcs3/Emu/GS/RSXThread.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "RSXThread.h" -#define ARGS(x) (Memory.Read32(Memory.RSXIOMem.GetStartAddr() + re(m_ctrl->get) + (4*(x+1)))) +#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count) : Memory.Read32(Memory.RSXIOMem.GetStartAddr() + re(m_ctrl->get) + (4*(x+1)))) u32 methodRegisters[0xffff]; @@ -102,6 +102,18 @@ u32 RSXVertexData::GetTypeSize() #define CMD_LOG(...) #endif +u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count) +{ + wxString debug = GetMethodName(cmd); + debug += "("; + for(u32 i=0; i> 12) & 0xf; m_surface_width = (a0 >> 16) & 0xff; m_surface_height = (a0 >> 24) & 0xff; - m_surface_pitch_a = ARGS(1); - m_surface_offset_a = ARGS(2); - m_surface_offset_z = ARGS(3); - m_surface_offset_b = ARGS(4); - m_surface_pitch_b = ARGS(5); + + if(count >= 2) + { + 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); + } + } + } + } + } gcmBuffer* buffers = (gcmBuffer*)Memory.GetMemFromAddr(m_gcm_buffers_addr); m_width = re(buffers[m_gcm_current_buffer].width); @@ -1329,6 +1361,56 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 } break; + case NV4097_SET_ZMIN_MAX_CONTROL: + break; + + case NV4097_SET_WINDOW_CLIP_HORIZONTAL: + break; + + case 0x000002c8: + case 0x000002d0: + case 0x000002d8: + case 0x000002e0: + case 0x000002e8: + case 0x000002f0: + case 0x000002f8: + break; + + case NV4097_SET_SURFACE_COLOR_AOFFSET: + m_surface_offset_a = ARGS(0); + break; + + case NV4097_SET_SURFACE_COLOR_BOFFSET: + m_surface_offset_b = ARGS(0); + break; + + case NV4097_SET_SURFACE_COLOR_COFFSET: + m_surface_offset_c = ARGS(0); + break; + + case NV4097_SET_SURFACE_COLOR_DOFFSET: + m_surface_offset_d = ARGS(0); + break; + + case NV4097_SET_SURFACE_ZETA_OFFSET: + m_surface_offset_z = ARGS(0); + break; + + case NV4097_SET_SURFACE_PITCH_A: + m_surface_pitch_a = ARGS(0); + break; + + case NV4097_SET_SURFACE_PITCH_B: + m_surface_pitch_b = ARGS(0); + break; + + case NV4097_SET_TRANSFORM_PROGRAM_START: + { + int a0 = ARGS(0); + if(a0) ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM_START: 0x%x", a0); + } + break; + default: { wxString log = GetMethodName(cmd); diff --git a/rpcs3/Emu/GS/RSXThread.h b/rpcs3/Emu/GS/RSXThread.h index bfe5256ddb..1a7a14c469 100644 --- a/rpcs3/Emu/GS/RSXThread.h +++ b/rpcs3/Emu/GS/RSXThread.h @@ -559,6 +559,7 @@ protected: void Begin(u32 draw_mode); void End(); + u32 OutOfArgsCount(const uint x, const u32 cmd, const u32 count); void DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u32 count); virtual void OnInit() = 0; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp index ce84dc197d..b900be9046 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp @@ -153,7 +153,7 @@ int sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t event_ar int sys_event_queue_receive(u32 equeue_id, mem_ptr_t event, u64 timeout) { - sys_event.Warning("sys_event_queue_receive(equeue_id=%d, event_addr=0x%x, timeout=%lld)", + sys_event.Log("sys_event_queue_receive(equeue_id=%d, event_addr=0x%x, timeout=%lld)", equeue_id, event.GetAddr(), timeout); if (!event.IsGood())