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

Split hack_noDepthFrameBuffers on two options:

hack_noDepthFrameBuffers and hack_blurPauseScreen.

hack_blurPauseScreen is for games, which copy color buffer into depth buffer area,
blur it and use as background image. Examples: Conker BFD, Mickey USA

hack_noDepthFrameBuffers is for games, which never use depth buffer area as texture
Example: F-1 Pole Position, Mario Golf.
This commit is contained in:
Sergey Lipskiy 2015-03-09 20:24:23 +06:00
parent e9b406d134
commit f4e1afa30c
4 changed files with 13 additions and 7 deletions

View File

@ -93,6 +93,7 @@ struct Config
#define hack_Ogre64 (1<<0) //Ogre Battle 64 background copy
#define hack_noDepthFrameBuffers (1<<1) //Do not use depth buffers as texture
#define hack_blurPauseScreen (2<<1) //Game copies frame buffer to depth buffer area, CPU blurs it. That image is used as background for pause screen.
extern Config config;

View File

@ -956,10 +956,8 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
pDepthBuffer->m_cleared = false;
pBuffer = frameBufferList().findBuffer(pDepthBuffer->m_address);
if (pBuffer != NULL) {
pBuffer->m_RdramCrc = CRC_Calculate(0xFFFFFFFF, RDRAM + pDepthBuffer->m_address, (VI.width*VI.height) << pBuffer->m_size >> 1);
if (pBuffer != NULL)
pBuffer->m_cleared = false;
}
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);

View File

@ -325,10 +325,13 @@ void RSP_Init()
if (strstr(RSP.romname, (const char *)"OgreBattle64") != NULL)
config.generalEmulation.hacks |= hack_Ogre64;
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
strstr(RSP.romname, (const char *)"F1 POLE POSITION 64") != NULL
)
config.generalEmulation.hacks |= hack_noDepthFrameBuffers;
else if (strstr(RSP.romname, (const char *)"CONKER BFD") != NULL ||
strstr(RSP.romname, (const char *)"MICKEY USA") != NULL
)
config.generalEmulation.hacks |= hack_blurPauseScreen;
api().FindPluginPath(RSP.pluginpath);

View File

@ -514,13 +514,12 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
return false;
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
const bool noDepthBuffers = (config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0;
bool bRes = pBuffer != NULL;
if ((bRes)
//&& ((*(u32*)&RDRAM[pBuffer->startAddress] & 0xFFFEFFFE) == (pBuffer->startAddress & 0xFFFEFFFE)) // Does not work for Jet Force Gemini
)
{
if (noDepthBuffers) {
if ((config.generalEmulation.hacks & hack_blurPauseScreen) != 0) {
if (gDP.colorImage.address == gDP.depthImageAddress && 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;
@ -530,6 +529,11 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
bRes = false;
}
if ((config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0 && pBuffer->m_isDepthBuffer) {
frameBufferList().removeBuffer(pBuffer->m_startAddress);
bRes = false;
}
const u32 texEndAddress = _address + _bytes - 1;
if (_address > pBuffer->m_startAddress && texEndAddress > (pBuffer->m_endAddress + (pBuffer->m_width << pBuffer->m_size >> 1))) {
//frameBufferList().removeBuffer(pBuffer->m_startAddress);