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];
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;
if(!CPU.IsGoodLSA(lsa))

View File

@ -288,12 +288,12 @@ public:
private:
union _CRT_ALIGN(8) {
struct {
u32 m_index;
volatile u32 m_index;
u32 m_value[max_count];
};
u64 m_indval;
volatile u64 m_indval;
};
long m_lock;
volatile long m_lock;
public:
@ -577,12 +577,12 @@ public:
{
case SPU_WrOutIntrMbox:
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;
case SPU_WrOutMbox:
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;
case MFC_WrTagMask:
@ -634,22 +634,22 @@ public:
switch(ch)
{
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]);
break;
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]);
break;
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]);
break;
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]);
break;

View File

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

View File

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