mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Implement fake copy color buffer to RDRAM for Zelda OOT.
Fixed Ocarina of Time pause delay #327
This commit is contained in:
parent
7c91526edc
commit
ebc5d5bef3
1
Config.h
1
Config.h
|
@ -98,6 +98,7 @@ struct Config
|
|||
#define hack_blurPauseScreen (1<<2) //Game copies frame buffer to depth buffer area, CPU blurs it. That image is used as background for pause screen.
|
||||
#define hack_scoreboard (1<<3) //Copy data from RDRAM to auxilary frame buffer. Scoreboard in Mario Tennis.
|
||||
#define hack_pilotWings (1<<4) //Special blend mode for PilotWings.
|
||||
#define hack_subscreen (1<<5) //Fix subscreen delay in Zelda OOT
|
||||
|
||||
extern Config config;
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
void CopyToRDRAM(u32 _address);
|
||||
|
||||
private:
|
||||
void _copyWhite(FrameBuffer * _pBuffer);
|
||||
|
||||
struct RGBA {
|
||||
u8 r, g, b, a;
|
||||
};
|
||||
|
@ -787,13 +789,42 @@ void FrameBufferToRDRAM::Destroy() {
|
|||
}
|
||||
}
|
||||
|
||||
void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) {
|
||||
void FrameBufferToRDRAM::_copyWhite(FrameBuffer * _pBuffer)
|
||||
{
|
||||
if (_pBuffer->m_size == G_IM_SIZ_32b) {
|
||||
u32 *ptr_dst = (u32*)(RDRAM + _pBuffer->m_startAddress);
|
||||
|
||||
for (u32 y = 0; y < VI.height; ++y) {
|
||||
for (u32 x = 0; x < VI.width; ++x)
|
||||
ptr_dst[x + y*VI.width] = 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
else {
|
||||
u16 *ptr_dst = (u16*)(RDRAM + _pBuffer->m_startAddress);
|
||||
|
||||
for (u32 y = 0; y < VI.height; ++y) {
|
||||
for (u32 x = 0; x < VI.width; ++x) {
|
||||
ptr_dst[(x + y*VI.width) ^ 1] = 0xFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
_pBuffer->m_RdramCrc = Adler32(0, RDRAM + _pBuffer->m_startAddress, (VI.width*VI.height) << _pBuffer->m_size >> 1);
|
||||
_pBuffer->m_cleared = false;
|
||||
}
|
||||
|
||||
void FrameBufferToRDRAM::CopyToRDRAM(u32 _address)
|
||||
{
|
||||
if (VI.width == 0) // H width is zero. Don't copy
|
||||
return;
|
||||
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
|
||||
if (pBuffer == NULL || pBuffer->m_width < VI.width || pBuffer->m_isOBScreen)
|
||||
return;
|
||||
|
||||
if ((config.generalEmulation.hacks & hack_subscreen) != 0) {
|
||||
_copyWhite(pBuffer);
|
||||
return;
|
||||
}
|
||||
|
||||
_address = pBuffer->m_startAddress;
|
||||
if (config.video.multisampling != 0) {
|
||||
pBuffer->resolveMultisampledTexture();
|
||||
|
|
4
RSP.cpp
4
RSP.cpp
|
@ -323,6 +323,10 @@ void RSP_Init()
|
|||
config.generalEmulation.hacks |= hack_scoreboard;
|
||||
else if (strstr(RSP.romname, (const char *)"Pilot Wings64") != NULL)
|
||||
config.generalEmulation.hacks |= hack_pilotWings;
|
||||
else if (strstr(RSP.romname, (const char *)"THE LEGEND OF ZELDA") != NULL ||
|
||||
strstr(RSP.romname, (const char *)"ZELDA MASTER QUEST") != NULL
|
||||
)
|
||||
config.generalEmulation.hacks |= hack_subscreen;
|
||||
|
||||
|
||||
api().FindPluginPath(RSP.pluginpath);
|
||||
|
|
Loading…
Reference in New Issue
Block a user