1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00
LQX Hack removed, Critical Section for m_status removed.
This commit is contained in:
Nekotekina 2013-12-27 15:35:08 +04:00
parent 1ab5ef9dd7
commit ca13d4f2ef
4 changed files with 17 additions and 30 deletions

View File

@ -393,12 +393,6 @@ private:
{ {
u32 a = CPU.GPR[ra]._u32[3], b = CPU.GPR[rb]._u32[3]; u32 a = CPU.GPR[ra]._u32[3], b = CPU.GPR[rb]._u32[3];
if(b & 0xf)
{
ConLog.Warning("LQX HACK (a[0x%x] + b[0x%x(0x%x)])", a, b << 3, b);
b <<= 3;
}
u32 lsa = (a + b) & 0x3fff0; u32 lsa = (a + b) & 0x3fff0;
if(!CPU.IsGoodLSA(lsa)) if(!CPU.IsGoodLSA(lsa))

View File

@ -288,12 +288,12 @@ public:
private: private:
union _CRT_ALIGN(8) { union _CRT_ALIGN(8) {
struct { struct {
u32 m_index; volatile u32 m_index;
u32 m_value[max_count]; u32 m_value[max_count];
}; };
u64 m_indval; volatile u64 m_indval;
}; };
long m_lock; volatile long m_lock;
public: public:
@ -577,12 +577,12 @@ public:
{ {
case SPU_WrOutIntrMbox: case SPU_WrOutIntrMbox:
ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v); ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v);
if (!SPU.OutIntr_Mbox.Push(v)) do _mm_pause(); while (!SPU.OutIntr_Mbox.Push(v) && !Emu.IsStopped()); while (!SPU.OutIntr_Mbox.Push(v) && !Emu.IsStopped()) Sleep(1);
break; break;
case SPU_WrOutMbox: case SPU_WrOutMbox:
ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v); ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v);
if (!SPU.Out_MBox.Push(v)) do _mm_pause(); while (!SPU.Out_MBox.Push(v) && !Emu.IsStopped()); while (!SPU.Out_MBox.Push(v) && !Emu.IsStopped()) Sleep(1);
break; break;
case MFC_WrTagMask: case MFC_WrTagMask:
@ -634,22 +634,22 @@ public:
switch(ch) switch(ch)
{ {
case SPU_RdInMbox: case SPU_RdInMbox:
if (!SPU.In_MBox.Pop(v)) do _mm_pause(); while (!SPU.In_MBox.Pop(v) && !Emu.IsStopped()); while (!SPU.In_MBox.Pop(v) && !Emu.IsStopped()) Sleep(1);
ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
case MFC_RdTagStat: case MFC_RdTagStat:
if (!Prxy.TagStatus.Pop(v)) do _mm_pause(); while (!Prxy.TagStatus.Pop(v) && !Emu.IsStopped()); while (!Prxy.TagStatus.Pop(v) && !Emu.IsStopped()) Sleep(1);
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
case SPU_RdSigNotify1: case SPU_RdSigNotify1:
if (!SPU.SNR[0].Pop(v)) do _mm_pause(); while (!SPU.SNR[0].Pop(v) && !Emu.IsStopped()); while (!SPU.SNR[0].Pop(v) && !Emu.IsStopped()) Sleep(1);
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
case SPU_RdSigNotify2: case SPU_RdSigNotify2:
if (!SPU.SNR[1].Pop(v)) do _mm_pause(); while (!SPU.SNR[1].Pop(v) && !Emu.IsStopped()); while (!SPU.SNR[1].Pop(v) && !Emu.IsStopped()) Sleep(1);
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;

View File

@ -354,7 +354,6 @@ void Emulator::Load()
thread.Run(); thread.Run();
wxCriticalSectionLocker lock(m_cs_status);
m_status = Ready; m_status = Ready;
#ifndef QT_UI #ifndef QT_UI
wxGetApp().SendDbgCommand(DID_READY_EMU); wxGetApp().SendDbgCommand(DID_READY_EMU);
@ -379,7 +378,6 @@ void Emulator::Run()
wxGetApp().SendDbgCommand(DID_START_EMU); wxGetApp().SendDbgCommand(DID_START_EMU);
#endif #endif
wxCriticalSectionLocker lock(m_cs_status);
//ConLog.Write("run..."); //ConLog.Write("run...");
m_status = Running; m_status = Running;
@ -403,7 +401,6 @@ void Emulator::Pause()
wxGetApp().SendDbgCommand(DID_PAUSE_EMU); wxGetApp().SendDbgCommand(DID_PAUSE_EMU);
#endif #endif
wxCriticalSectionLocker lock(m_cs_status);
m_status = Paused; m_status = Paused;
#ifndef QT_UI #ifndef QT_UI
wxGetApp().SendDbgCommand(DID_PAUSED_EMU); wxGetApp().SendDbgCommand(DID_PAUSED_EMU);
@ -418,7 +415,6 @@ void Emulator::Resume()
wxGetApp().SendDbgCommand(DID_RESUME_EMU); wxGetApp().SendDbgCommand(DID_RESUME_EMU);
#endif #endif
wxCriticalSectionLocker lock(m_cs_status);
m_status = Running; m_status = Running;
CheckStatus(); CheckStatus();
@ -436,10 +432,7 @@ void Emulator::Stop()
#ifndef QT_UI #ifndef QT_UI
wxGetApp().SendDbgCommand(DID_STOP_EMU); wxGetApp().SendDbgCommand(DID_STOP_EMU);
#endif #endif
{
wxCriticalSectionLocker lock(m_cs_status);
m_status = Stopped; m_status = Stopped;
}
m_rsx_callback = 0; m_rsx_callback = 0;

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <atomic>
#include "Gui/MemoryViewer.h" #include "Gui/MemoryViewer.h"
#include "Emu/CPU/CPUThreadManager.h" #include "Emu/CPU/CPUThreadManager.h"
#include "Emu/Io/Pad.h" #include "Emu/Io/Pad.h"
@ -65,8 +66,7 @@ class Emulator
Interpreter, Interpreter,
}; };
mutable wxCriticalSection m_cs_status; volatile uint m_status;
Status m_status;
uint m_mode; uint m_mode;
u32 m_rsx_callback; u32 m_rsx_callback;
@ -159,10 +159,10 @@ public:
void SavePoints(const std::string& path); void SavePoints(const std::string& path);
void LoadPoints(const std::string& path); void LoadPoints(const std::string& path);
__forceinline bool IsRunning() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Running; } __forceinline bool IsRunning() const { return m_status == Running; }
__forceinline bool IsPaused() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Paused; } __forceinline bool IsPaused() const { return m_status == Paused; }
__forceinline bool IsStopped() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Stopped; } __forceinline bool IsStopped() const { return m_status == Stopped; }
__forceinline bool IsReady() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Ready; } __forceinline bool IsReady() const { return m_status == Ready; }
}; };
extern Emulator Emu; extern Emulator Emu;