JIT: add option to enable/disable jit of memory instructions. for crash safety.

This commit is contained in:
Henrik Rydgard 2012-12-21 16:49:02 +01:00
parent df12802a5a
commit f5efd6f2b1
9 changed files with 23 additions and 6 deletions

View File

@ -49,8 +49,10 @@ void CConfig::Load(const char *iniFileName)
general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
general->Get("CurrentDirectory", &currentDirectory, "");
general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);
IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
cpu->Get("Core", &iCpuCore, 0);
cpu->Get("FastMemory", &bFastMemory, false);
IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
graphics->Get("ShowFPSCounter", &bShowFPSCounter, false);
@ -88,6 +90,7 @@ void CConfig::Save()
general->Set("ShowDebuggerOnLoad", bShowDebuggerOnLoad);
IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
cpu->Set("Core", iCpuCore);
cpu->Set("FastMemory", bFastMemory);
IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
graphics->Set("ShowFPSCounter", bShowFPSCounter);

View File

@ -41,6 +41,7 @@ public:
bool bSpeedLimit;
bool bConfirmOnQuit;
bool bIgnoreBadMemAccess;
bool bFastMemory;
// GFX
bool bDisplayFramebuffer;

View File

@ -17,6 +17,7 @@
#include "../MIPS.h"
#include "../../Config.h"
#include "Common/Common.h"
#include "Jit.h"
#include "RegCache.h"
@ -86,6 +87,10 @@ void Jit::Comp_FPU3op(u32 op)
void Jit::Comp_FPULS(u32 op)
{
CONDITIONAL_DISABLE;
if (!g_Config.bFastMemory) {
DISABLE;
}
s32 offset = (s16)(op&0xFFFF);
int ft = ((op>>16)&0x1f);

View File

@ -17,6 +17,7 @@
#include "../../MemMap.h"
#include "../MIPSAnalyst.h"
#include "../../Config.h"
#include "Jit.h"
#include "RegCache.h"
@ -42,7 +43,11 @@ namespace MIPSComp
{
void Jit::Comp_ITypeMem(u32 op)
{
// OLDD
if (!g_Config.bFastMemory)
{
DISABLE;
}
int offset = (signed short)(op&0xFFFF);
int rt = _RT;
int rs = _RS;

View File

@ -112,8 +112,9 @@ namespace MainWindow
AdjustWindowRect(&rcOuter, WS_OVERLAPPEDWINDOW, TRUE);
}
void SetZoom(int zoom) {
g_Config.iWindowZoom = zoom;
void SetZoom(float zoom) {
if (zoom < 5)
g_Config.iWindowZoom = zoom;
RECT rc, rcOuter;
GetWindowRectAtZoom(zoom, rc, rcOuter);
MoveWindow(hwndMain, rcOuter.left, rcOuter.top, rcOuter.right - rcOuter.left, rcOuter.bottom - rcOuter.top, TRUE);
@ -638,6 +639,7 @@ namespace MainWindow
CHECKITEM(ID_OPTIONS_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats);
CHECKITEM(ID_OPTIONS_WIREFRAME, g_Config.bDrawWireframe);
CHECKITEM(ID_OPTIONS_HARDWARETRANSFORM, g_Config.bHardwareTransform);
CHECKITEM(ID_OPTIONS_FASTMEMORY, g_Config.bFastMemory);
BOOL enable = !Core_IsStepping();
EnableMenuItem(menu,ID_EMULATION_RUN,enable);

View File

@ -215,6 +215,7 @@ BEGIN
MENUITEM "&Display Raw Framebuffer", ID_OPTIONS_DISPLAYRAWFRAMEBUFFER
MENUITEM "&Buffered Rendering\tF5", ID_OPTIONS_BUFFEREDRENDERING
MENUITEM "&Hardware Transform", ID_OPTIONS_HARDWARETRANSFORM
MENUITEM "&Fast Memory (dynarec, unstable)", ID_OPTIONS_FASTMEMORY
MENUITEM "&Wireframe (experimental)", ID_OPTIONS_WIREFRAME
MENUITEM "&Show Debug Statistics", ID_OPTIONS_SHOWDEBUGSTATISTICS
MENUITEM SEPARATOR

View File

@ -245,13 +245,14 @@
#define ID_OPTIONS_SHOWDEBUGSTATISTICS 40122
#define ID_OPTIONS_WIREFRAME 40123
#define ID_OPTIONS_HARDWARETRANSFORM 40124
#define ID_OPTIONS_FASTMEMORY 40125
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 232
#define _APS_NEXT_COMMAND_VALUE 40125
#define _APS_NEXT_COMMAND_VALUE 40126
#define _APS_NEXT_CONTROL_VALUE 1162
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -179,7 +179,6 @@ void EmuScreen::render()
ui_draw2d.Begin(DBMODE_NORMAL);
// Make this configurable.
if (g_Config.bShowTouchControls)
DrawGamepad(ui_draw2d);

View File

@ -239,7 +239,7 @@ void SettingsScreen::render() {
// VLinear vlinear(10, 80, 10);
int x = 30;
int y = 50;
UICheckBox(GEN_ID, x, y += 50, "Enable Sound Emulation", ALIGN_TOPLEFT, &g_Config.bEnableSound);
UICheckBox(GEN_ID, x, y += 50, "Sound Emulation", ALIGN_TOPLEFT, &g_Config.bEnableSound);
UICheckBox(GEN_ID, x, y += 50, "Buffered Rendering (may fix flicker)", ALIGN_TOPLEFT, &g_Config.bBufferedRendering);
UICheckBox(GEN_ID, x, y += 50, "Hardware Transform (experimental)", ALIGN_TOPLEFT, &g_Config.bHardwareTransform);