1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Correct code for 'noDepthBuffers' situation.

Enable 'noDepthBuffers' for "MICKEY USA".

Fixed pause screen in "MICKEY USA"
This commit is contained in:
Sergey Lipskiy 2015-03-09 17:52:11 +06:00
parent f41bd934ef
commit 2f83ab8963
4 changed files with 15 additions and 5 deletions

View File

@ -390,6 +390,7 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt
m_pCurrent->m_cleared = false; m_pCurrent->m_cleared = false;
m_pCurrent->m_isDepthBuffer = _address == gDP.depthImageAddress; m_pCurrent->m_isDepthBuffer = _address == gDP.depthImageAddress;
m_pCurrent->m_isPauseScreen = false;
gSP.changed |= CHANGED_TEXTURE; gSP.changed |= CHANGED_TEXTURE;
} }

View File

@ -24,6 +24,7 @@ struct FrameBuffer
bool m_changed; bool m_changed;
bool m_cfb; bool m_cfb;
bool m_isDepthBuffer; bool m_isDepthBuffer;
bool m_isPauseScreen;
bool m_needHeightCorrection; bool m_needHeightCorrection;
GLuint m_FBO; GLuint m_FBO;

View File

@ -324,7 +324,10 @@ void RSP_Init()
setDepthClearColor(); setDepthClearColor();
if (strstr(RSP.romname, (const char *)"OgreBattle64") != NULL) if (strstr(RSP.romname, (const char *)"OgreBattle64") != NULL)
config.generalEmulation.hacks |= hack_Ogre64; config.generalEmulation.hacks |= hack_Ogre64;
else if (strstr(RSP.romname, (const char *)"MarioGolf64") != NULL || strstr(RSP.romname, (const char *)"CONKER BFD") != NULL) else if (strstr(RSP.romname, (const char *)"MarioGolf64") != NULL ||
strstr(RSP.romname, (const char *)"CONKER BFD") != NULL ||
strstr(RSP.romname, (const char *)"MICKEY USA") != NULL
)
config.generalEmulation.hacks |= hack_noDepthFrameBuffers; config.generalEmulation.hacks |= hack_noDepthFrameBuffers;
api().FindPluginPath(RSP.pluginpath); api().FindPluginPath(RSP.pluginpath);

13
gDP.cpp
View File

@ -515,14 +515,19 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address); FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
const bool noDepthBuffers = (config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0; const bool noDepthBuffers = (config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0;
bool bRes = pBuffer != NULL && (!noDepthBuffers || !pBuffer->m_isDepthBuffer); bool bRes = pBuffer != NULL;
if ((bRes) if ((bRes)
//&& ((*(u32*)&RDRAM[pBuffer->startAddress] & 0xFFFEFFFE) == (pBuffer->startAddress & 0xFFFEFFFE)) // Does not work for Jet Force Gemini //&& ((*(u32*)&RDRAM[pBuffer->startAddress] & 0xFFFEFFFE) == (pBuffer->startAddress & 0xFFFEFFFE)) // Does not work for Jet Force Gemini
) )
{ {
if (noDepthBuffers && gDP.colorImage.address == gDP.depthImageAddress && pBuffer->m_RdramCrc != 0) { if (noDepthBuffers) {
memcpy(RDRAM + gDP.depthImageAddress, RDRAM + pBuffer->m_startAddress, (pBuffer->m_width*pBuffer->m_height) << pBuffer->m_size >> 1); if (gDP.colorImage.address == gDP.depthImageAddress && pBuffer->m_RdramCrc != 0) {
pBuffer->m_RdramCrc = 0; memcpy(RDRAM + gDP.depthImageAddress, RDRAM + pBuffer->m_startAddress, (pBuffer->m_width*pBuffer->m_height) << pBuffer->m_size >> 1);
pBuffer->m_RdramCrc = 0;
frameBufferList().getCurrent()->m_isPauseScreen = true;
}
if (pBuffer->m_isPauseScreen)
bRes = false;
} }
const u32 texEndAddress = _address + _bytes - 1; const u32 texEndAddress = _address + _bytes - 1;