Skip to content

Commit

Permalink
Disable rendering when config dialog is open to prevent plugin crash if
Browse files Browse the repository at this point in the history
new settings are incompatible with the current ones.
  • Loading branch information
gonetz committed May 13, 2015
1 parent 831b341 commit 143cee1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/N64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ u8 *RDRAM;
u32 RDRAMSize;

N64Regs REG;

bool ConfigOpen = false;
1 change: 1 addition & 0 deletions src/N64.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern u8 *IMEM;
extern u8 *RDRAM;
extern u64 TMEM[TMEM_SIZE];
extern u32 RDRAMSize;
extern bool ConfigOpen;

#endif

5 changes: 5 additions & 0 deletions src/RSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ void RSP_CheckDLCounter()

void RSP_ProcessDList()
{
if (ConfigOpen) {
gDPFullSync();
return;
}

RSP.PC[0] = *(u32*)&DMEM[0x0FF0];
RSP.PCi = 0;
RSP.count = -1;
Expand Down
3 changes: 3 additions & 0 deletions src/VI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ void VI_UpdateScreen()
if (VI.lastOrigin == -1) // Workaround for Mupen64Plus issue with initialization
isGLError();

if (ConfigOpen)
return;

OGLVideo & ogl = video();
if (ogl.changeWindow())
return;
Expand Down
3 changes: 3 additions & 0 deletions src/windows/Config_windows.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "GLideN64_Windows.h"
#include "../N64.h"
#include "../Config.h"
#include "../RSP.h"
#include "../PluginAPI.h"
Expand All @@ -12,11 +13,13 @@ void Config_DoConfig(/*HWND hParent*/)
wchar_t strIniFolderPath[PLUGIN_PATH_SIZE];
api().FindPluginPath(strIniFolderPath);

ConfigOpen = true;
const bool bRestart = RunConfig(strIniFolderPath);
if (config.generalEmulation.enableCustomSettings != 0)
LoadCustomRomSettings(strIniFolderPath, RSP.romname);
if (bRestart)
video().restart();
ConfigOpen = false;
}

void Config_LoadConfig()
Expand Down

0 comments on commit 143cee1

Please sign in to comment.