GSopen2: Fixed a bug in gsdx where it didn't properly handle changes to the GS base register memory pointer.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/GSopen2@1858 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-09-18 18:45:37 +00:00
parent 667cf3b5c2
commit 73a39b012c
35 changed files with 119 additions and 97 deletions

View File

@ -511,7 +511,7 @@ typedef char*(CALLBACK* _PS2EgetLibName)(void);
// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones // If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int multithread); typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int multithread);
typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 forceSoftware ); typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags );
typedef void (CALLBACK* _GSvsync)(int field); typedef void (CALLBACK* _GSvsync)(int field);
typedef void (CALLBACK* _GSgifTransfer1)(u32 *pMem, u32 addr); typedef void (CALLBACK* _GSgifTransfer1)(u32 *pMem, u32 addr);
typedef void (CALLBACK* _GSgifTransfer2)(u32 *pMem, u32 size); typedef void (CALLBACK* _GSgifTransfer2)(u32 *pMem, u32 size);

View File

@ -592,7 +592,7 @@ sptr mtgsThreadObject::ExecuteTask()
Console::WriteLn( "\t\tForced software switch enabled." ); Console::WriteLn( "\t\tForced software switch enabled." );
if( GSopen2 != NULL ) if( GSopen2 != NULL )
m_returncode = GSopen2( (void*)&pDsp, !!renderswitch ); m_returncode = GSopen2( (void*)&pDsp, 1 | (renderswitch ? 4 : 0) );
else else
m_returncode = GSopen( (void*)&pDsp, "PCSX2", renderswitch ? 2 : 1 ); m_returncode = GSopen( (void*)&pDsp, "PCSX2", renderswitch ? 2 : 1 );

View File

@ -68,7 +68,11 @@ EXPORT_C_(uint32) PS2EgetCpuPlatform()
EXPORT_C GSsetBaseMem(uint8* mem) EXPORT_C GSsetBaseMem(uint8* mem)
{ {
s_basemem = mem - 0x12000000; s_basemem = mem;
if( s_gs )
{
s_gs->SetRegsMem( s_basemem );
}
} }
EXPORT_C_(INT32) GSinit() EXPORT_C_(INT32) GSinit()
@ -116,9 +120,6 @@ EXPORT_C GSclose()
s_gs->ResetDevice(); s_gs->ResetDevice();
if( s_gs->m_dev )
s_gs->m_dev->Reset(1, 1, GSDevice::Windowed);
delete s_gs->m_dev; delete s_gs->m_dev;
s_gs->m_dev = NULL; s_gs->m_dev = NULL;
@ -131,38 +132,51 @@ static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
GSDevice* dev = NULL; GSDevice* dev = NULL;
switch(renderer) try
{
default:
case 0: case 1: case 2: dev = new GSDevice9(); break;
case 3: case 4: case 5: dev = new GSDevice10(); break;
case 6: case 7: case 8: dev = new GSDevice11(); break;
#if 0
case 9: case 10: case 11: dev = new GSDeviceOGL(); break;
#endif
case 12: case 13: new GSDeviceNull(); break;
}
if( !dev ) return -1;
if( !s_gs )
{ {
switch(renderer) switch(renderer)
{ {
default: default:
case 0: s_gs = new GSRendererDX9(s_basemem, !!mt, s_irq); break; case 0: case 1: case 2: dev = new GSDevice9(); break;
case 3: s_gs = new GSRendererDX10(s_basemem, !!mt, s_irq); break; case 3: case 4: case 5: dev = new GSDevice10(); break;
case 6: s_gs = new GSRendererDX11(s_basemem, !!mt, s_irq); break; case 6: case 7: case 8: dev = new GSDevice11(); break;
#if 0 #if 0
case 9: s_gs = new GSRendererOGL(s_basemem, !!mt, s_irq); break; case 9: case 10: case 11: dev = new GSDeviceOGL(); break;
#endif #endif
case 2: case 5: case 8: case 11: case 13: case 12: case 13: new GSDeviceNull(); break;
s_gs = new GSRendererNull(s_basemem, !!mt, s_irq); break; }
case 1: case 4: case 7: case 10: case 12: if( !dev ) return -1;
s_gs = new GSRendererSW(s_basemem, !!mt, s_irq); break;
if( !s_gs )
{
switch(renderer)
{
default:
case 0: s_gs = new GSRendererDX9(!!mt, s_irq); break;
case 3: s_gs = new GSRendererDX10(!!mt, s_irq); break;
case 6: s_gs = new GSRendererDX11(!!mt, s_irq); break;
#if 0
case 9: s_gs = new GSRendererOGL(!!mt, s_irq); break;
#endif
case 2: case 5: case 8: case 11: case 13:
s_gs = new GSRendererNull(!!mt, s_irq); break;
case 1: case 4: case 7: case 10: case 12:
s_gs = new GSRendererSW(!!mt, s_irq); break;
}
} }
} }
catch( std::exception& ex )
{
// Allowing std exceptions to escape the scope of the plugin callstack could
// be problematic, because of differing typeids between DLL and EXE compilations.
printf( "GSdx error: Exception caught in GSopen: %s", ex.what() );
return -1;
}
s_gs->SetRegsMem( s_basemem );
if( *(HWND*)dsp == NULL ) if( *(HWND*)dsp == NULL )
{ {
@ -196,10 +210,13 @@ static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
return 0; return 0;
} }
EXPORT_C_(INT32) GSopen2(void* dsp, INT32 forceSoftware ) EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
{ {
theApp.SetConfig("windowed", flags & 1);
theApp.SetConfig("vsync", flags & 2);
int renderer = theApp.GetConfig("renderer", 0); int renderer = theApp.GetConfig("renderer", 0);
if( forceSoftware ) if( flags & 4 )
{ {
renderer = 1; renderer = 1;
} }

View File

@ -59,7 +59,7 @@ bool GSDevice::Create(GSWnd* wnd, bool vsync)
return true; return true;
} }
bool GSDevice::Reset(int w, int h, int mode) bool GSDevice::Reset(int w, int h)
{ {
for_each(m_pool.begin(), m_pool.end(), delete_object()); for_each(m_pool.begin(), m_pool.end(), delete_object());
@ -91,7 +91,7 @@ void GSDevice::Present(const GSVector4i& r, int shader, bool limit)
if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h) if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h)
{ {
if(!Reset(w, h, DontCare)) if(!Reset(w, h))
{ {
return; return;
} }

View File

@ -81,7 +81,7 @@ public:
enum {Windowed, Fullscreen, DontCare}; enum {Windowed, Fullscreen, DontCare};
virtual bool Create(GSWnd* wnd, bool vsync); virtual bool Create(GSWnd* wnd, bool vsync);
virtual bool Reset(int w, int h, int mode); virtual bool Reset(int w, int h);
virtual bool IsLost(bool update = false) {return false;} virtual bool IsLost(bool update = false) {return false;}
virtual void Present(const GSVector4i& r, int shader, bool limit); virtual void Present(const GSVector4i& r, int shader, bool limit);
virtual void Flip(bool limit) {} virtual void Flip(bool limit) {}

View File

@ -224,7 +224,7 @@ bool GSDevice10::Create(GSWnd* wnd, bool vsync)
// //
Reset(1, 1, Windowed); Reset(1, 1);
// //
@ -233,9 +233,9 @@ bool GSDevice10::Create(GSWnd* wnd, bool vsync)
return true; return true;
} }
bool GSDevice10::Reset(int w, int h, int mode) bool GSDevice10::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
if(m_swapchain) if(m_swapchain)

View File

@ -109,7 +109,7 @@ public:
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool CreateTextureFX(); bool CreateTextureFX();
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
void Flip(bool limit); void Flip(bool limit);
void DrawPrimitive(); void DrawPrimitive();

View File

@ -223,7 +223,7 @@ bool GSDevice11::Create(GSWnd* wnd, bool vsync)
// //
Reset(1, 1, Windowed); Reset(1, 1);
// //
@ -231,9 +231,9 @@ bool GSDevice11::Create(GSWnd* wnd, bool vsync)
return true; return true;
} }
bool GSDevice11::Reset(int w, int h, int mode) bool GSDevice11::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
if(m_swapchain) if(m_swapchain)

View File

@ -111,7 +111,7 @@ public:
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool CreateTextureFX(); bool CreateTextureFX();
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
void Flip(bool limit); void Flip(bool limit);
void DrawPrimitive(); void DrawPrimitive();

View File

@ -76,14 +76,14 @@ bool GSDevice7::Create(GSWnd* wnd, bool vsync)
return false; return false;
} }
Reset(1, 1, Windowed); Reset(1, 1);
return true; return true;
} }
bool GSDevice7::Reset(int w, int h, int mode) bool GSDevice7::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
DDSURFACEDESC2 desc; DDSURFACEDESC2 desc;
@ -147,7 +147,7 @@ void GSDevice7::Present(const GSVector4i& r, int shader, bool limit)
if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h) if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h)
{ {
if(!Reset(w, h, DontCare)) if(!Reset(w, h))
{ {
return; return;
} }

View File

@ -41,7 +41,7 @@ public:
virtual ~GSDevice7(); virtual ~GSDevice7();
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
bool IsLost(bool update) {return m_lost;} bool IsLost(bool update) {return m_lost;}
void Present(const GSVector4i& r, int shader, bool limit); void Present(const GSVector4i& r, int shader, bool limit);
}; };

View File

@ -144,7 +144,7 @@ bool GSDevice9::Create(GSWnd* wnd, bool vsync)
// //
if(!Reset(1, 1, theApp.GetConfig("windowed", 1) ? Windowed : Fullscreen)) if(!Reset(1, 1))
{ {
return false; return false;
} }
@ -220,13 +220,14 @@ bool GSDevice9::Create(GSWnd* wnd, bool vsync)
return true; return true;
} }
bool GSDevice9::Reset(int w, int h, int mode) bool GSDevice9::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
HRESULT hr; HRESULT hr;
int mode = theApp.GetConfig("windowed", 1) ? Windowed : Fullscreen;
if(mode == DontCare) if(mode == DontCare)
{ {
mode = m_pp.Windowed ? Windowed : Fullscreen; mode = m_pp.Windowed ? Windowed : Fullscreen;

View File

@ -142,7 +142,7 @@ public:
virtual ~GSDevice9(); virtual ~GSDevice9();
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
bool IsLost(bool update); bool IsLost(bool update);
void Flip(bool limit); void Flip(bool limit);

View File

@ -267,9 +267,9 @@ public:
return __super::Create( wnd, vsync ); return __super::Create( wnd, vsync );
} }
virtual bool Reset(int w, int h, int mode) virtual bool Reset(int w, int h)
{ {
return __super::Reset( w, h, mode ); return __super::Reset( w, h );
} }
//virtual void Present(const GSVector4i& r, int shader, bool limit); //virtual void Present(const GSVector4i& r, int shader, bool limit);

View File

@ -29,14 +29,14 @@ bool GSDeviceNull::Create(GSWnd* wnd, bool vsync)
return false; return false;
} }
Reset(1, 1, Windowed); Reset(1, 1);
return true; return true;
} }
bool GSDeviceNull::Reset(int w, int h, int mode) bool GSDeviceNull::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
return true; return true;

View File

@ -36,5 +36,5 @@ public:
GSDeviceNull() {} GSDeviceNull() {}
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
}; };

View File

@ -150,14 +150,14 @@ bool GSDeviceOGL::Create(GSWnd* wnd, bool vsync)
*/ */
GSVector4i r = wnd->GetClientRect(); GSVector4i r = wnd->GetClientRect();
Reset(r.width(), r.height(), Windowed); Reset(r.width(), r.height());
return true; return true;
} }
bool GSDeviceOGL::Reset(int w, int h, int mode) bool GSDeviceOGL::Reset(int w, int h)
{ {
if(!__super::Reset(w, h, mode)) if(!__super::Reset(w, h))
return false; return false;
glCullFace(GL_FRONT_AND_BACK); CheckError(); glCullFace(GL_FRONT_AND_BACK); CheckError();

View File

@ -110,7 +110,7 @@ public:
virtual ~GSDeviceOGL(); virtual ~GSDeviceOGL();
bool Create(GSWnd* wnd, bool vsync); bool Create(GSWnd* wnd, bool vsync);
bool Reset(int w, int h, int mode); bool Reset(int w, int h);
void Present(const GSVector4i& r, int shader, bool limit); void Present(const GSVector4i& r, int shader, bool limit);
void Flip(bool limit); void Flip(bool limit);

View File

@ -22,8 +22,8 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "GSRenderer.h" #include "GSRenderer.h"
GSRenderer::GSRenderer(uint8* base, bool mt, void (*irq)()) GSRenderer::GSRenderer(bool mt, void (*irq)())
: GSState(base, mt, irq) : GSState(mt, irq)
, m_dev(NULL) , m_dev(NULL)
, m_shader(0) , m_shader(0)
, m_vt(this) , m_vt(this)
@ -47,10 +47,10 @@ GSRenderer::GSRenderer(uint8* base, bool mt, void (*irq)())
GSRenderer::~GSRenderer() GSRenderer::~GSRenderer()
{ {
if(m_dev) /*if(m_dev)
{ {
m_dev->Reset(1, 1, GSDevice::Windowed); m_dev->Reset(1, 1, GSDevice::Windowed);
} }*/
delete m_dev; delete m_dev;
} }

View File

@ -69,7 +69,7 @@ public:
int s_saven; int s_saven;
public: public:
GSRenderer(uint8* base, bool mt, void (*irq)()); GSRenderer(bool mt, void (*irq)());
virtual ~GSRenderer(); virtual ~GSRenderer();
virtual bool CreateWnd(const string& title, int w, int h); virtual bool CreateWnd(const string& title, int w, int h);
@ -217,8 +217,8 @@ protected:
virtual void Draw() = 0; virtual void Draw() = 0;
public: public:
GSRendererT(uint8* base, bool mt, void (*irq)()) GSRendererT(bool mt, void (*irq)())
: GSRenderer(base, mt, irq) : GSRenderer(mt, irq)
, m_vertices(NULL) , m_vertices(NULL)
, m_count(0) , m_count(0)
, m_maxcount(0) , m_maxcount(0)

View File

@ -40,8 +40,8 @@ protected:
virtual void UpdateFBA(GSTexture* rt) {} virtual void UpdateFBA(GSTexture* rt) {}
public: public:
GSRendererDX(uint8* base, bool mt, void (*irq)(), GSTextureCache* tc, const GSVector2& pixelcenter = GSVector2(0, 0)) GSRendererDX(bool mt, void (*irq)(), GSTextureCache* tc, const GSVector2& pixelcenter = GSVector2(0, 0))
: GSRendererHW<Vertex>(base, mt, irq, tc) : GSRendererHW<Vertex>(mt, irq, tc)
, m_pixelcenter(pixelcenter) , m_pixelcenter(pixelcenter)
, m_topology(-1) , m_topology(-1)
{ {

View File

@ -24,8 +24,8 @@
#include "GSCrc.h" #include "GSCrc.h"
#include "resource.h" #include "resource.h"
GSRendererDX10::GSRendererDX10(uint8* base, bool mt, void (*irq)()) GSRendererDX10::GSRendererDX10(bool mt, void (*irq)())
: GSRendererDX<GSVertexHW10>(base, mt, irq, new GSTextureCache10(this), GSVector2(-0.5f, -0.5f)) : GSRendererDX<GSVertexHW10>(mt, irq, new GSTextureCache10(this), GSVector2(-0.5f, -0.5f))
{ {
InitVertexKick<GSRendererDX10>(); InitVertexKick<GSRendererDX10>();
} }

View File

@ -38,7 +38,7 @@ protected:
void SetupDATE(GSTexture* rt, GSTexture* ds); void SetupDATE(GSTexture* rt, GSTexture* ds);
public: public:
GSRendererDX10(uint8* base, bool mt, void (*irq)()); GSRendererDX10(bool mt, void (*irq)());
bool CreateDevice(GSDevice* dev); bool CreateDevice(GSDevice* dev);

View File

@ -24,8 +24,8 @@
#include "GSCrc.h" #include "GSCrc.h"
#include "resource.h" #include "resource.h"
GSRendererDX11::GSRendererDX11(uint8* base, bool mt, void (*irq)()) GSRendererDX11::GSRendererDX11(bool mt, void (*irq)())
: GSRendererDX<GSVertexHW11>(base, mt, irq, new GSTextureCache11(this), GSVector2(-0.5f, -0.5f)) : GSRendererDX<GSVertexHW11>(mt, irq, new GSTextureCache11(this), GSVector2(-0.5f, -0.5f))
{ {
InitVertexKick<GSRendererDX11>(); InitVertexKick<GSRendererDX11>();
} }

View File

@ -39,7 +39,7 @@ protected:
void SetupDATE(GSTexture* rt, GSTexture* ds); void SetupDATE(GSTexture* rt, GSTexture* ds);
public: public:
GSRendererDX11(uint8* base, bool mt, void (*irq)()); GSRendererDX11(bool mt, void (*irq)());
bool CreateDevice(GSDevice* dev); bool CreateDevice(GSDevice* dev);

View File

@ -24,8 +24,8 @@
#include "GSCrc.h" #include "GSCrc.h"
#include "resource.h" #include "resource.h"
GSRendererDX9::GSRendererDX9(uint8* base, bool mt, void (*irq)()) GSRendererDX9::GSRendererDX9(bool mt, void (*irq)())
: GSRendererDX<GSVertexHW9>(base, mt, irq, new GSTextureCache9(this)) : GSRendererDX<GSVertexHW9>(mt, irq, new GSTextureCache9(this))
{ {
InitVertexKick<GSRendererDX9>(); InitVertexKick<GSRendererDX9>();
} }

View File

@ -45,7 +45,7 @@ protected:
void UpdateFBA(GSTexture* rt); void UpdateFBA(GSTexture* rt);
public: public:
GSRendererDX9(uint8* base, bool mt, void (*irq)()); GSRendererDX9(bool mt, void (*irq)());
bool CreateDevice(GSDevice* dev); bool CreateDevice(GSDevice* dev);

View File

@ -704,8 +704,8 @@ protected:
} }
public: public:
GSRendererHW(uint8* base, bool mt, void (*irq)(), GSTextureCache* tc) GSRendererHW(bool mt, void (*irq)(), GSTextureCache* tc)
: GSRendererT<Vertex>(base, mt, irq) : GSRendererT<Vertex>(mt, irq)
, m_tc(tc) , m_tc(tc)
, m_width(1024) , m_width(1024)
, m_height(1024) , m_height(1024)

View File

@ -37,8 +37,8 @@ protected:
} }
public: public:
GSRendererNull(uint8* base, bool mt, void (*irq)()) GSRendererNull(bool mt, void (*irq)())
: GSRendererT<GSVertexNull>(base, mt, irq) : GSRendererT<GSVertexNull>(mt, irq)
{ {
InitVertexKick<GSRendererNull>(); InitVertexKick<GSRendererNull>();
} }

View File

@ -24,8 +24,8 @@
#include "GSCrc.h" #include "GSCrc.h"
#include "resource.h" #include "resource.h"
GSRendererOGL::GSRendererOGL(uint8* base, bool mt, void (*irq)()) GSRendererOGL::GSRendererOGL(bool mt, void (*irq)())
: GSRendererHW<GSVertexOGL>(base, mt, irq, new GSTextureCacheOGL(this)) : GSRendererHW<GSVertexOGL>(mt, irq, new GSTextureCacheOGL(this))
{ {
InitVertexKick<GSRendererOGL>(); InitVertexKick<GSRendererOGL>();
} }

View File

@ -31,7 +31,7 @@ protected:
void Draw(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex); void Draw(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex);
public: public:
GSRendererOGL(uint8* base, bool mt, void (*irq)()); GSRendererOGL(bool mt, void (*irq)());
bool CreateDevice(GSDevice* dev); bool CreateDevice(GSDevice* dev);

View File

@ -24,8 +24,8 @@
const GSVector4 g_pos_scale(1.0f / 16, 1.0f / 16, 1.0f, 128.0f); const GSVector4 g_pos_scale(1.0f / 16, 1.0f / 16, 1.0f, 128.0f);
GSRendererSW::GSRendererSW(uint8* base, bool mt, void (*irq)()) GSRendererSW::GSRendererSW(bool mt, void (*irq)())
: GSRendererT(base, mt, irq) : GSRendererT(mt, irq)
{ {
m_tc = new GSTextureCacheSW(this); m_tc = new GSTextureCacheSW(this);

View File

@ -44,7 +44,7 @@ protected:
void GetScanlineParam(GSScanlineParam& p, GS_PRIM_CLASS primclass); void GetScanlineParam(GSScanlineParam& p, GS_PRIM_CLASS primclass);
public: public:
GSRendererSW(uint8* base, bool mt, void (*irq)()); GSRendererSW(bool mt, void (*irq)());
virtual ~GSRendererSW(); virtual ~GSRendererSW();
template<uint32 prim, uint32 tme, uint32 fst> template<uint32 prim, uint32 tme, uint32 fst>

View File

@ -22,7 +22,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "GSState.h" #include "GSState.h"
GSState::GSState(uint8* base, bool mt, void (*irq)()) GSState::GSState(bool mt, void (*irq)())
: m_mt(mt) : m_mt(mt)
, m_irq(irq) , m_irq(irq)
, m_crc(0) , m_crc(0)
@ -84,10 +84,6 @@ GSState::GSState(uint8* base, bool mt, void (*irq)())
m_sssize += (sizeof(m_path[0].tag) + sizeof(m_path[0].reg)) * 3; m_sssize += (sizeof(m_path[0].tag) + sizeof(m_path[0].reg)) * 3;
m_sssize += sizeof(m_q); m_sssize += sizeof(m_q);
ASSERT(base);
m_regs = (GSPrivRegSet*)(base + 0x12000000);
PRIM = &m_env.PRIM; PRIM = &m_env.PRIM;
// CSR->rREV = 0x20; // CSR->rREV = 0x20;
m_env.PRMODECONT.AC = 1; m_env.PRMODECONT.AC = 1;
@ -101,6 +97,13 @@ GSState::~GSState()
{ {
} }
void GSState::SetRegsMem( uint8* basemem )
{
ASSERT(basemem);
m_regs = (GSPrivRegSet*)basemem;
}
void GSState::Reset() void GSState::Reset()
{ {
memset(&m_path[0], 0, sizeof(m_path[0]) * 3); memset(&m_path[0], 0, sizeof(m_path[0]) * 3);

View File

@ -215,7 +215,7 @@ public:
GSDump m_dump; GSDump m_dump;
public: public:
GSState(uint8* base, bool mt, void (*irq)()); GSState(bool mt, void (*irq)());
virtual ~GSState(); virtual ~GSState();
void ResetHandlers(); void ResetHandlers();
@ -250,5 +250,6 @@ public:
virtual void SetGameCRC(uint32 crc, int options); virtual void SetGameCRC(uint32 crc, int options);
void SetFrameSkip(int skip); void SetFrameSkip(int skip);
void SetFrameLimit(bool limit); void SetFrameLimit(bool limit);
void SetRegsMem( uint8* basemem );
}; };