Skip to content

Commit

Permalink
Add hack hack_VIUpdateOnCIChange for Quake II.
Browse files Browse the repository at this point in the history
Quake II uses single buffer mode when underwater, so additional check
gDP.colorImage.changed != 0 is necessary to detect frame change.
This check may cause dummy buffers swaps, so now it is used for Quake II only.

Fixed #592
  • Loading branch information
gonetz committed Jul 3, 2015
1 parent d881701 commit 16e3af6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ struct Config
#define hack_legoRacers (1<<7) //LEGO racers course map
#define hack_blastCorps (1<<8) //Blast Corps black polygons
#define hack_ignoreVIHeightChange (1<<9) //Do not reset FBO when VI height is changed. Space Invaders need it.
#define hack_VIUpdateOnCIChange (1<<10) //Update frame if color buffer changed. Needed for Quake II underwater.

extern Config config;

Expand Down
2 changes: 2 additions & 0 deletions src/RSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ void RSP_Init()
config.generalEmulation.hacks |= hack_blastCorps;
else if (strstr(RSP.romname, (const char *)"SPACE INVADERS") != NULL)
config.generalEmulation.hacks |= hack_ignoreVIHeightChange;
else if (strstr(RSP.romname, (const char *)"QUAKE II") != NULL)
config.generalEmulation.hacks |= hack_VIUpdateOnCIChange;

api().FindPluginPath(RSP.pluginpath);

Expand Down
2 changes: 1 addition & 1 deletion src/VI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void VI_UpdateScreen()

if (config.frameBufferEmulation.enable) {
const bool bCFB = (gDP.changed&CHANGED_CPU_FB_WRITE) == CHANGED_CPU_FB_WRITE;
const bool bNeedUpdate = gDP.colorImage.changed != 0 || (bCFB ? true : (*REG.VI_ORIGIN != VI.lastOrigin));
const bool bNeedUpdate = (bCFB ? true : (*REG.VI_ORIGIN != VI.lastOrigin)) || ((config.generalEmulation.hacks & hack_VIUpdateOnCIChange) != 0 && gDP.colorImage.changed != 0);

if (bNeedUpdate) {
if (bCFB) {
Expand Down

0 comments on commit 16e3af6

Please sign in to comment.