From 719326df65707519f7b1e041f87cefeb676e2842 Mon Sep 17 00:00:00 2001
From: Fiora <fioraaeterna@gmail.com>
Date: Wed, 15 Oct 2014 06:45:49 -0700
Subject: [PATCH 1/2] Make EnableBATs an option instead of disabling it
 entirely

---
 Source/Core/Core/BootManager.cpp        |  5 ++++-
 Source/Core/Core/CoreParameter.cpp      |  4 +++-
 Source/Core/Core/CoreParameter.h        |  1 +
 Source/Core/Core/HW/MemmapFunctions.cpp | 14 ++++++++------
 Source/Core/DolphinWX/ISOProperties.cpp |  5 +++++
 Source/Core/DolphinWX/ISOProperties.h   |  2 +-
 6 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp
index e6d14c28f7..76d174d79d 100644
--- a/Source/Core/Core/BootManager.cpp
+++ b/Source/Core/Core/BootManager.cpp
@@ -47,7 +47,7 @@ namespace BootManager
 // Apply fire liberally
 struct ConfigCache
 {
-	bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread,
+	bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bBAT, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread,
 	     bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bProgressive;
 	int iCPUCore, Volume;
 	int iWiimoteSource[MAX_BBMOTES];
@@ -114,6 +114,7 @@ bool BootCore(const std::string& _rFilename)
 		config_cache.bSkipIdle = StartUp.bSkipIdle;
 		config_cache.iCPUCore = StartUp.iCPUCore;
 		config_cache.bEnableFPRF = StartUp.bEnableFPRF;
+		config_cache.bBAT = StartUp.bBAT;
 		config_cache.bMMU = StartUp.bMMU;
 		config_cache.bDCBZOFF = StartUp.bDCBZOFF;
 		config_cache.bVBeamSpeedHack = StartUp.bVBeamSpeedHack;
@@ -156,6 +157,7 @@ bool BootCore(const std::string& _rFilename)
 		core_section->Get("CPUThread",        &StartUp.bCPUThread, StartUp.bCPUThread);
 		core_section->Get("SkipIdle",         &StartUp.bSkipIdle, StartUp.bSkipIdle);
 		core_section->Get("EnableFPRF",       &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
+		core_section->Get("BAT",              &StartUp.bEnableFPRF, StartUp.bBAT);
 		core_section->Get("MMU",              &StartUp.bMMU, StartUp.bMMU);
 		core_section->Get("DCBZ",             &StartUp.bDCBZOFF, StartUp.bDCBZOFF);
 		core_section->Get("VBeam",            &StartUp.bVBeamSpeedHack, StartUp.bVBeamSpeedHack);
@@ -282,6 +284,7 @@ void Stop()
 		StartUp.bSkipIdle = config_cache.bSkipIdle;
 		StartUp.iCPUCore = config_cache.iCPUCore;
 		StartUp.bEnableFPRF = config_cache.bEnableFPRF;
+		StartUp.bBAT = config_cache.bBAT;
 		StartUp.bMMU = config_cache.bMMU;
 		StartUp.bDCBZOFF = config_cache.bDCBZOFF;
 		StartUp.bVBeamSpeedHack = config_cache.bVBeamSpeedHack;
diff --git a/Source/Core/Core/CoreParameter.cpp b/Source/Core/Core/CoreParameter.cpp
index 299c26219d..d92277013e 100644
--- a/Source/Core/Core/CoreParameter.cpp
+++ b/Source/Core/Core/CoreParameter.cpp
@@ -39,7 +39,8 @@ SCoreStartupParameter::SCoreStartupParameter()
   bMergeBlocks(false), bEnableMemcardSaving(true),
   bDPL2Decoder(false), iLatency(14),
   bRunCompareServer(false), bRunCompareClient(false),
-  bMMU(false), bDCBZOFF(false), iBBDumpPort(0), bVBeamSpeedHack(false),
+  bMMU(false), bBAT(false), bDCBZOFF(false),
+  iBBDumpPort(0), bVBeamSpeedHack(false),
   bSyncGPU(false), bFastDiscSpeed(false),
   SelectedLanguage(0), bWii(false),
   bConfirmStop(false), bHideCursor(false),
@@ -73,6 +74,7 @@ void SCoreStartupParameter::LoadDefaults()
 	bDSPThread = true;
 	bFastmem = true;
 	bEnableFPRF = false;
+	bBAT = false;
 	bMMU = false;
 	bDCBZOFF = false;
 	iBBDumpPort = -1;
diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h
index 23376c9799..35250a9fad 100644
--- a/Source/Core/Core/CoreParameter.h
+++ b/Source/Core/Core/CoreParameter.h
@@ -160,6 +160,7 @@ struct SCoreStartupParameter
 	bool bRunCompareServer;
 	bool bRunCompareClient;
 
+	bool bBAT;
 	bool bMMU;
 	bool bDCBZOFF;
 	int iBBDumpPort;
diff --git a/Source/Core/Core/HW/MemmapFunctions.cpp b/Source/Core/Core/HW/MemmapFunctions.cpp
index e58a99ed4e..79755c213a 100644
--- a/Source/Core/Core/HW/MemmapFunctions.cpp
+++ b/Source/Core/Core/HW/MemmapFunctions.cpp
@@ -966,12 +966,14 @@ u32 TranslateAddress(const u32 _Address, const XCheckTLBFlag _Flag)
 	// Check MSR[DR] bit before translating data addresses
 	//if (((_Flag == FLAG_READ) || (_Flag == FLAG_WRITE)) && !(MSR & (1 << (31 - 27)))) return _Address;
 
-	// Technically we should do this, but no known games, even heavy MMU ones, use any custom BATs whatsoever,
-	// so it's a waste of time and should never succeed (given the default BATs are already handled in
-	// ReadFromHardware/WriteToHardware).
-	//u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
-	//if (!tlb_addr)
-	//	return tlb_addr;
+	// Technically we should do this, but almost no games, even heavy MMU ones, use any custom BATs whatsoever,
+	// so only do it where it's really needed.
+	if (SConfig::GetInstance().m_LocalCoreStartupParameter.bBAT)
+	{
+		u32 tlb_addr = TranslateBlockAddress(_Address, _Flag);
+		if (tlb_addr)
+			return tlb_addr;
+	}
 	return TranslatePageAddress(_Address, _Flag);
 }
 } // namespace
diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp
index 6e6ca80818..a43eada9b4 100644
--- a/Source/Core/DolphinWX/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/ISOProperties.cpp
@@ -389,6 +389,8 @@ void CISOProperties::CreateGUIControls(bool IsWad)
 	SkipIdle = new wxCheckBox(m_GameConfig, ID_IDLESKIP, _("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "SkipIdle"));
 	MMU = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable MMU"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "MMU"));
 	MMU->SetToolTip(_("Enables the Memory Management Unit, needed for some games. (ON = Compatible, OFF = Fast)"));
+	BAT = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable BAT"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "BAT"));
+	BAT->SetToolTip(_("Enables Block Address Translation, needed for a few games. Requires MMU. (ON = Compatible, OFF = Fast)"));
 	DCBZOFF = new wxCheckBox(m_GameConfig, ID_DCBZOFF, _("Skip DCBZ clearing"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "DCBZ"));
 	DCBZOFF->SetToolTip(_("Bypass the clearing of the data cache by the DCBZ instruction. Usually leave this option disabled."));
 	VBeam = new wxCheckBox(m_GameConfig, ID_VBEAM, _("VBeam Speed Hack"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "VBeam"));
@@ -419,6 +421,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
 		new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Core"));
 	sbCoreOverrides->Add(CPUThread, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(SkipIdle, 0, wxLEFT, 5);
+	sbCoreOverrides->Add(BAT, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(MMU, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(DCBZOFF, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(VBeam, 0, wxLEFT, 5);
@@ -1002,6 +1005,7 @@ void CISOProperties::LoadGameConfig()
 	SetCheckboxValueFromGameini("Core", "CPUThread", CPUThread);
 	SetCheckboxValueFromGameini("Core", "SkipIdle", SkipIdle);
 	SetCheckboxValueFromGameini("Core", "MMU", MMU);
+	SetCheckboxValueFromGameini("Core", "BAT", BAT);
 	SetCheckboxValueFromGameini("Core", "DCBZ", DCBZOFF);
 	SetCheckboxValueFromGameini("Core", "VBeam", VBeam);
 	SetCheckboxValueFromGameini("Core", "SyncGPU", SyncGPU);
@@ -1075,6 +1079,7 @@ bool CISOProperties::SaveGameConfig()
 	SaveGameIniValueFrom3StateCheckbox("Core", "CPUThread", CPUThread);
 	SaveGameIniValueFrom3StateCheckbox("Core", "SkipIdle", SkipIdle);
 	SaveGameIniValueFrom3StateCheckbox("Core", "MMU", MMU);
+	SaveGameIniValueFrom3StateCheckbox("Core", "BAT", BAT);
 	SaveGameIniValueFrom3StateCheckbox("Core", "DCBZ", DCBZOFF);
 	SaveGameIniValueFrom3StateCheckbox("Core", "VBeam", VBeam);
 	SaveGameIniValueFrom3StateCheckbox("Core", "SyncGPU", SyncGPU);
diff --git a/Source/Core/DolphinWX/ISOProperties.h b/Source/Core/DolphinWX/ISOProperties.h
index 506c2960fa..8112146136 100644
--- a/Source/Core/DolphinWX/ISOProperties.h
+++ b/Source/Core/DolphinWX/ISOProperties.h
@@ -67,7 +67,7 @@ private:
 	DECLARE_EVENT_TABLE();
 
 	// Core
-	wxCheckBox *CPUThread, *SkipIdle, *MMU, *DCBZOFF;
+	wxCheckBox *CPUThread, *SkipIdle, *MMU, *BAT, *DCBZOFF;
 	wxCheckBox *VBeam, *SyncGPU, *FastDiscSpeed, *BlockMerging, *DSPHLE;
 	// Wii
 	wxCheckBox *EnableWideScreen;

From c74b4df13ef6f95cebe0e0fb98322c9266c535f1 Mon Sep 17 00:00:00 2001
From: Fiora <fioraaeterna@gmail.com>
Date: Wed, 15 Oct 2014 08:22:17 -0700
Subject: [PATCH 2/2] Add FPRF interface option, change from EnableFPRF to just
 FPRF

---
 Data/Sys/GameSettings/GBSE8P.ini        | 2 +-
 Data/Sys/GameSettings/GBSP8P.ini        | 2 +-
 Data/Sys/GameSettings/GF7E01.ini        | 2 +-
 Data/Sys/GameSettings/GF7P01.ini        | 2 +-
 Data/Sys/GameSettings/GFZE01.ini        | 2 +-
 Data/Sys/GameSettings/GFZJ01.ini        | 2 +-
 Data/Sys/GameSettings/GFZP01.ini        | 2 +-
 Data/Sys/GameSettings/GM2E8P.ini        | 2 +-
 Data/Sys/GameSettings/GM2J8P.ini        | 2 +-
 Data/Sys/GameSettings/GM2P8P.ini        | 2 +-
 Data/Sys/GameSettings/GMBE8P.ini        | 2 +-
 Data/Sys/GameSettings/GMBJ8P.ini        | 2 +-
 Data/Sys/GameSettings/GMBP8P.ini        | 2 +-
 Data/Sys/GameSettings/GVSE8P.ini        | 2 +-
 Data/Sys/GameSettings/GVSP8P.ini        | 2 +-
 Data/Sys/GameSettings/JACP01.ini        | 2 +-
 Data/Sys/GameSettings/RSME8P.ini        | 2 +-
 Data/Sys/GameSettings/RSMJ8P.ini        | 2 +-
 Data/Sys/GameSettings/RSMP8P.ini        | 2 +-
 Data/Sys/GameSettings/SMBE8P.ini        | 2 +-
 Data/Sys/GameSettings/SMBP8P.ini        | 2 +-
 Source/Core/DolphinWX/ISOProperties.cpp | 5 +++++
 Source/Core/DolphinWX/ISOProperties.h   | 2 +-
 23 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/Data/Sys/GameSettings/GBSE8P.ini b/Data/Sys/GameSettings/GBSE8P.ini
index 340e6837af..1c7e346d8f 100644
--- a/Data/Sys/GameSettings/GBSE8P.ini
+++ b/Data/Sys/GameSettings/GBSE8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GBSP8P.ini b/Data/Sys/GameSettings/GBSP8P.ini
index 3200c4715d..6bbdbbfba3 100644
--- a/Data/Sys/GameSettings/GBSP8P.ini
+++ b/Data/Sys/GameSettings/GBSP8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GF7E01.ini b/Data/Sys/GameSettings/GF7E01.ini
index 6a4e1e7dcc..9cfb0b8ea7 100644
--- a/Data/Sys/GameSettings/GF7E01.ini
+++ b/Data/Sys/GameSettings/GF7E01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GF7P01.ini b/Data/Sys/GameSettings/GF7P01.ini
index 5da4d712e3..9f753be6a8 100644
--- a/Data/Sys/GameSettings/GF7P01.ini
+++ b/Data/Sys/GameSettings/GF7P01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GFZE01.ini b/Data/Sys/GameSettings/GFZE01.ini
index 008d1edea9..ef5ee26473 100644
--- a/Data/Sys/GameSettings/GFZE01.ini
+++ b/Data/Sys/GameSettings/GFZE01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GFZJ01.ini b/Data/Sys/GameSettings/GFZJ01.ini
index f4d4fa16e1..699aeb8efc 100644
--- a/Data/Sys/GameSettings/GFZJ01.ini
+++ b/Data/Sys/GameSettings/GFZJ01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GFZP01.ini b/Data/Sys/GameSettings/GFZP01.ini
index 274c7e1a74..89d9b7833a 100644
--- a/Data/Sys/GameSettings/GFZP01.ini
+++ b/Data/Sys/GameSettings/GFZP01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GM2E8P.ini b/Data/Sys/GameSettings/GM2E8P.ini
index aa76a5427f..f30e42467e 100644
--- a/Data/Sys/GameSettings/GM2E8P.ini
+++ b/Data/Sys/GameSettings/GM2E8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GM2J8P.ini b/Data/Sys/GameSettings/GM2J8P.ini
index 99432eaaee..c91f184801 100644
--- a/Data/Sys/GameSettings/GM2J8P.ini
+++ b/Data/Sys/GameSettings/GM2J8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GM2P8P.ini b/Data/Sys/GameSettings/GM2P8P.ini
index 7aeb75405f..20f56a849c 100644
--- a/Data/Sys/GameSettings/GM2P8P.ini
+++ b/Data/Sys/GameSettings/GM2P8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GMBE8P.ini b/Data/Sys/GameSettings/GMBE8P.ini
index c9c0ce1ea5..735c212231 100644
--- a/Data/Sys/GameSettings/GMBE8P.ini
+++ b/Data/Sys/GameSettings/GMBE8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 # Values set here will override the main dolphin settings.
 
 [EmuState]
diff --git a/Data/Sys/GameSettings/GMBJ8P.ini b/Data/Sys/GameSettings/GMBJ8P.ini
index 90c7c8eb00..73d5dcddcd 100644
--- a/Data/Sys/GameSettings/GMBJ8P.ini
+++ b/Data/Sys/GameSettings/GMBJ8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 # Values set here will override the main dolphin settings.
 
 [EmuState]
diff --git a/Data/Sys/GameSettings/GMBP8P.ini b/Data/Sys/GameSettings/GMBP8P.ini
index f528896d77..21c3140ade 100644
--- a/Data/Sys/GameSettings/GMBP8P.ini
+++ b/Data/Sys/GameSettings/GMBP8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 # Values set here will override the main dolphin settings.
 
 [EmuState]
diff --git a/Data/Sys/GameSettings/GVSE8P.ini b/Data/Sys/GameSettings/GVSE8P.ini
index d21cb22d02..2ba4f8c31f 100644
--- a/Data/Sys/GameSettings/GVSE8P.ini
+++ b/Data/Sys/GameSettings/GVSE8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/GVSP8P.ini b/Data/Sys/GameSettings/GVSP8P.ini
index 5830f4a2a0..7766be8fb9 100644
--- a/Data/Sys/GameSettings/GVSP8P.ini
+++ b/Data/Sys/GameSettings/GVSP8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/JACP01.ini b/Data/Sys/GameSettings/JACP01.ini
index a7b52cb5b7..4bded5dfc0 100644
--- a/Data/Sys/GameSettings/JACP01.ini
+++ b/Data/Sys/GameSettings/JACP01.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/RSME8P.ini b/Data/Sys/GameSettings/RSME8P.ini
index 9d09dbf381..9c4ecb6a12 100644
--- a/Data/Sys/GameSettings/RSME8P.ini
+++ b/Data/Sys/GameSettings/RSME8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/RSMJ8P.ini b/Data/Sys/GameSettings/RSMJ8P.ini
index 8b0a49e473..898dfe57d4 100644
--- a/Data/Sys/GameSettings/RSMJ8P.ini
+++ b/Data/Sys/GameSettings/RSMJ8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/RSMP8P.ini b/Data/Sys/GameSettings/RSMP8P.ini
index e9f29a4667..f8fadf4e87 100644
--- a/Data/Sys/GameSettings/RSMP8P.ini
+++ b/Data/Sys/GameSettings/RSMP8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF = True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/SMBE8P.ini b/Data/Sys/GameSettings/SMBE8P.ini
index 13701d64b5..ede0554051 100644
--- a/Data/Sys/GameSettings/SMBE8P.ini
+++ b/Data/Sys/GameSettings/SMBE8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Data/Sys/GameSettings/SMBP8P.ini b/Data/Sys/GameSettings/SMBP8P.ini
index 2ce0ed56f8..7069544b79 100644
--- a/Data/Sys/GameSettings/SMBP8P.ini
+++ b/Data/Sys/GameSettings/SMBP8P.ini
@@ -2,7 +2,7 @@
 
 [Core]
 # Values set here will override the main dolphin settings.
-EnableFPRF=True
+FPRF = True
 
 [EmuState]
 # The Emulation State. 1 is worst, 5 is best, 0 is not set.
diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp
index a43eada9b4..d610c29ccb 100644
--- a/Source/Core/DolphinWX/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/ISOProperties.cpp
@@ -393,6 +393,8 @@ void CISOProperties::CreateGUIControls(bool IsWad)
 	BAT->SetToolTip(_("Enables Block Address Translation, needed for a few games. Requires MMU. (ON = Compatible, OFF = Fast)"));
 	DCBZOFF = new wxCheckBox(m_GameConfig, ID_DCBZOFF, _("Skip DCBZ clearing"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "DCBZ"));
 	DCBZOFF->SetToolTip(_("Bypass the clearing of the data cache by the DCBZ instruction. Usually leave this option disabled."));
+	FPRF = new wxCheckBox(m_GameConfig, ID_MMU, _("Enable FPRF"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "FPRF"));
+	FPRF->SetToolTip(_("Enables Floating Point Result Flag calculation, needed for a few games. (ON = Compatible, OFF = Fast)"));
 	VBeam = new wxCheckBox(m_GameConfig, ID_VBEAM, _("VBeam Speed Hack"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "VBeam"));
 	VBeam->SetToolTip(_("Doubles the emulated GPU clock rate. May speed up some games (ON = Fast, OFF = Compatible)"));
 	SyncGPU = new wxCheckBox(m_GameConfig, ID_SYNCGPU, _("Synchronize GPU thread"), wxDefaultPosition, wxDefaultSize, GetElementStyle("Core", "SyncGPU"));
@@ -424,6 +426,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
 	sbCoreOverrides->Add(BAT, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(MMU, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(DCBZOFF, 0, wxLEFT, 5);
+	sbCoreOverrides->Add(FPRF, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(VBeam, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(SyncGPU, 0, wxLEFT, 5);
 	sbCoreOverrides->Add(FastDiscSpeed, 0, wxLEFT, 5);
@@ -1007,6 +1010,7 @@ void CISOProperties::LoadGameConfig()
 	SetCheckboxValueFromGameini("Core", "MMU", MMU);
 	SetCheckboxValueFromGameini("Core", "BAT", BAT);
 	SetCheckboxValueFromGameini("Core", "DCBZ", DCBZOFF);
+	SetCheckboxValueFromGameini("Core", "FPRF", FPRF);
 	SetCheckboxValueFromGameini("Core", "VBeam", VBeam);
 	SetCheckboxValueFromGameini("Core", "SyncGPU", SyncGPU);
 	SetCheckboxValueFromGameini("Core", "FastDiscSpeed", FastDiscSpeed);
@@ -1081,6 +1085,7 @@ bool CISOProperties::SaveGameConfig()
 	SaveGameIniValueFrom3StateCheckbox("Core", "MMU", MMU);
 	SaveGameIniValueFrom3StateCheckbox("Core", "BAT", BAT);
 	SaveGameIniValueFrom3StateCheckbox("Core", "DCBZ", DCBZOFF);
+	SaveGameIniValueFrom3StateCheckbox("Core", "FPRF", FPRF);
 	SaveGameIniValueFrom3StateCheckbox("Core", "VBeam", VBeam);
 	SaveGameIniValueFrom3StateCheckbox("Core", "SyncGPU", SyncGPU);
 	SaveGameIniValueFrom3StateCheckbox("Core", "FastDiscSpeed", FastDiscSpeed);
diff --git a/Source/Core/DolphinWX/ISOProperties.h b/Source/Core/DolphinWX/ISOProperties.h
index 8112146136..acc7692a68 100644
--- a/Source/Core/DolphinWX/ISOProperties.h
+++ b/Source/Core/DolphinWX/ISOProperties.h
@@ -67,7 +67,7 @@ private:
 	DECLARE_EVENT_TABLE();
 
 	// Core
-	wxCheckBox *CPUThread, *SkipIdle, *MMU, *BAT, *DCBZOFF;
+	wxCheckBox *CPUThread, *SkipIdle, *MMU, *BAT, *DCBZOFF, *FPRF;
 	wxCheckBox *VBeam, *SyncGPU, *FastDiscSpeed, *BlockMerging, *DSPHLE;
 	// Wii
 	wxCheckBox *EnableWideScreen;