mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +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:
parent
e9b406d134
commit
f4e1afa30c
1
Config.h
1
Config.h
|
@ -93,6 +93,7 @@ struct Config
|
||||||
|
|
||||||
#define hack_Ogre64 (1<<0) //Ogre Battle 64 background copy
|
#define hack_Ogre64 (1<<0) //Ogre Battle 64 background copy
|
||||||
#define hack_noDepthFrameBuffers (1<<1) //Do not use depth buffers as texture
|
#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;
|
extern Config config;
|
||||||
|
|
||||||
|
|
|
@ -956,10 +956,8 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
|
||||||
|
|
||||||
pDepthBuffer->m_cleared = false;
|
pDepthBuffer->m_cleared = false;
|
||||||
pBuffer = frameBufferList().findBuffer(pDepthBuffer->m_address);
|
pBuffer = frameBufferList().findBuffer(pDepthBuffer->m_address);
|
||||||
if (pBuffer != NULL) {
|
if (pBuffer != NULL)
|
||||||
pBuffer->m_RdramCrc = CRC_Calculate(0xFFFFFFFF, RDRAM + pDepthBuffer->m_address, (VI.width*VI.height) << pBuffer->m_size >> 1);
|
|
||||||
pBuffer->m_cleared = false;
|
pBuffer->m_cleared = false;
|
||||||
}
|
|
||||||
|
|
||||||
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
|
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
|
||||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||||
|
|
7
RSP.cpp
7
RSP.cpp
|
@ -325,10 +325,13 @@ void RSP_Init()
|
||||||
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 ||
|
else if (strstr(RSP.romname, (const char *)"MarioGolf64") != NULL ||
|
||||||
strstr(RSP.romname, (const char *)"CONKER BFD") != NULL ||
|
strstr(RSP.romname, (const char *)"F1 POLE POSITION 64") != NULL
|
||||||
strstr(RSP.romname, (const char *)"MICKEY USA") != NULL
|
|
||||||
)
|
)
|
||||||
config.generalEmulation.hacks |= hack_noDepthFrameBuffers;
|
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);
|
api().FindPluginPath(RSP.pluginpath);
|
||||||
|
|
||||||
|
|
8
gDP.cpp
8
gDP.cpp
|
@ -514,13 +514,12 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
|
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
|
||||||
const bool noDepthBuffers = (config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0;
|
|
||||||
bool bRes = pBuffer != NULL;
|
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) {
|
if ((config.generalEmulation.hacks & hack_blurPauseScreen) != 0) {
|
||||||
if (gDP.colorImage.address == gDP.depthImageAddress && pBuffer->m_RdramCrc != 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);
|
memcpy(RDRAM + gDP.depthImageAddress, RDRAM + pBuffer->m_startAddress, (pBuffer->m_width*pBuffer->m_height) << pBuffer->m_size >> 1);
|
||||||
pBuffer->m_RdramCrc = 0;
|
pBuffer->m_RdramCrc = 0;
|
||||||
|
@ -530,6 +529,11 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
|
||||||
bRes = false;
|
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;
|
const u32 texEndAddress = _address + _bytes - 1;
|
||||||
if (_address > pBuffer->m_startAddress && texEndAddress > (pBuffer->m_endAddress + (pBuffer->m_width << pBuffer->m_size >> 1))) {
|
if (_address > pBuffer->m_startAddress && texEndAddress > (pBuffer->m_endAddress + (pBuffer->m_width << pBuffer->m_size >> 1))) {
|
||||||
//frameBufferList().removeBuffer(pBuffer->m_startAddress);
|
//frameBufferList().removeBuffer(pBuffer->m_startAddress);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user