From 9e15c51f9eff8fc2ca7a29530dc831639577bace Mon Sep 17 00:00:00 2001 From: hrydgard Date: Thu, 14 Aug 2008 22:01:07 +0000 Subject: [PATCH] Silly build fix, a slightly improved error message. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@212 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp | 9 ++++++--- Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp index 2a22a4f29e..8b99da3fa2 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp @@ -70,7 +70,12 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress) if (!DisassembleMov(codePtr, info, accessType)) { BackPatchError("BackPatch - failed to disassemble MOV instruction", codePtr, emAddress); } + if (info.isMemoryWrite) { + if (!Memory::IsRAMAddress(emAddress, true)) { + PanicAlert("Write to invalid address %08x", emAddress); + return; + } BackPatchError("BackPatch - determined that MOV is write, not yet supported and should have been caught before", codePtr, emAddress); } @@ -86,8 +91,7 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress) if (accessType == OP_ACCESS_WRITE) PanicAlert("BackPatch : Currently only supporting reads." "\n\nAttempted to write to %08x.", emAddress); - //if (info.instructionSize < 5) - // PanicAlert("Instruction at %08x Too Small : %i", (u32)codePtr, info.instructionSize); + // OK, let's write a trampoline, and a jump to it. // Later, let's share trampolines. @@ -109,7 +113,6 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress) // CALL((void *)&Memory::Read_U8); // break; case 4: - // THIS FUNCTION CANNOT TOUCH FLOATING POINT REGISTERS. CALL(ProtectFunction((void *)&Memory::Read_U32, 1)); break; default: diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index de05a114ca..862def47cc 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -22,7 +22,6 @@ #include "EmuWindow.h" #include "Utils.h" -#include "XFB.h" HINSTANCE g_hInstance = NULL; SVideoInitialize g_VideoInitialize;