gsdx sw: always enable the gs memory wrapping emulation

This commit is contained in:
Gregory Hainaut 2017-04-19 20:11:53 +02:00
parent c115a4cf76
commit 688f05ff26
2 changed files with 21 additions and 2 deletions

View File

@ -84,10 +84,27 @@ GSLocalMemory::psm_t GSLocalMemory::m_psm[64];
GSLocalMemory::GSLocalMemory()
: m_clut(this)
{
if (theApp.GetConfigB("UserHacks") && theApp.GetConfigB("wrap_gs_mem"))
m_use_fifo_alloc = theApp.GetConfigB("UserHacks") && theApp.GetConfigB("wrap_gs_mem");
switch (theApp.GetCurrentRendererType()) {
case GSRendererType::OGL_SW:
case GSRendererType::DX9_SW:
case GSRendererType::DX1011_SW:
m_use_fifo_alloc = true;
break;
default: break;
}
if (m_use_fifo_alloc)
m_vm8 = (uint8*)fifo_alloc(m_vmsize, 4);
else
m_vm8 = nullptr;
// Either we don't use fifo alloc or we get an error.
if (m_vm8 == nullptr)
{
m_vm8 = (uint8*)vmalloc(m_vmsize * 4, false);
m_use_fifo_alloc = false;
}
m_vm16 = (uint16*)m_vm8;
m_vm32 = (uint32*)m_vm8;
@ -472,7 +489,7 @@ GSLocalMemory::GSLocalMemory()
GSLocalMemory::~GSLocalMemory()
{
if (theApp.GetConfigB("UserHacks") && theApp.GetConfigB("wrap_gs_mem"))
if (m_use_fifo_alloc)
fifo_free(m_vm8, m_vmsize, 4);
else
vmfree(m_vm8, m_vmsize * 4);

View File

@ -128,6 +128,8 @@ public:
GSClut m_clut;
protected:
bool m_use_fifo_alloc;
static uint32 pageOffset32[32][32][64];
static uint32 pageOffset32Z[32][32][64];
static uint32 pageOffset16[32][64][64];