From 02e21687408f056fa4e21a36a1ad6b2a3ca8c25b Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 3 Jan 2017 16:38:44 +1100 Subject: [PATCH] [Project64] Flush Logs on exception and another exception case handled --- .../Project64-core/MemoryExceptionFilter.cpp | 85 ++++++++++++------- .../N64System/Mips/MemoryVirtualMem.cpp | 5 +- .../N64System/Recompiler/FunctionMapClass.cpp | 4 +- .../Recompiler/RecompilerCodeLog.cpp | 8 ++ .../N64System/Recompiler/RecompilerCodeLog.h | 3 +- 5 files changed, 68 insertions(+), 37 deletions(-) diff --git a/Source/Project64-core/MemoryExceptionFilter.cpp b/Source/Project64-core/MemoryExceptionFilter.cpp index 742e6b034..badbf252e 100644 --- a/Source/Project64-core/MemoryExceptionFilter.cpp +++ b/Source/Project64-core/MemoryExceptionFilter.cpp @@ -11,6 +11,7 @@ #include "stdafx.h" #include #include +#include #include #include #ifndef _WIN32 @@ -195,7 +196,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xB6: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -205,7 +206,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xB7: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -215,7 +216,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xBE: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, true)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -225,7 +226,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xBF: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, true)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -246,7 +247,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8B: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -256,7 +257,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x89: if (!g_MMU->SH_NonMemory(MemAddress, *(uint16_t *)Reg)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); @@ -275,7 +276,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SH_NonMemory(MemAddress, *(uint16_t *)ReadPos)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -293,7 +294,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x88: if (!g_MMU->SB_NonMemory(MemAddress, *(uint8_t *)Reg)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -303,7 +304,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8A: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -313,7 +314,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8B: if (!g_MMU->LW_NonMemory(MemAddress, (uint32_t *)Reg)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -323,7 +324,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x89: if (!g_MMU->SW_NonMemory(MemAddress, *(uint32_t *)Reg)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -341,7 +342,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SB_NonMemory(MemAddress, *(uint8_t *)ReadPos)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -359,7 +360,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SW_NonMemory(MemAddress, *(uint32_t *)ReadPos)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -427,6 +428,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rt: %X",OpCode32->uint32.rt); WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.opcode2: %X",OpCode32->uint32.opcode2); WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rm: %X",OpCode32->uint32.rm); + Flush_Recompiler_Log(); TraceFlushLog(); g_Notify->BreakPoint(__FILE__, __LINE__); return false; @@ -446,7 +448,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -458,7 +460,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -472,7 +474,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //42 f8 03 c0 str.w ip, [r2, r3] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -486,7 +488,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //c9 f8 00 b0 str.w r11, [r9] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -500,7 +502,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //dc f8 70 70 ldr.w r7, [ip, #112] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->imm12.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -515,7 +517,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e789300c str r3, [r9, ip] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -528,7 +530,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -542,7 +544,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //17c32001 strbne r2, [r3, r1] if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -556,7 +558,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //11c020b0 strhne r2, [r0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm8.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -570,7 +572,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context // 00 80 strh r0, [r0, #0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -584,7 +586,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context // 14 52 strh r4, [r2, r0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -598,7 +600,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //2e 60 str r6, [r5, #0] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -612,7 +614,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //3F 68 ldr r7, [r7, #0] if (!g_MMU->LW_NonMemory(MemAddress,ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -621,12 +623,26 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context return true; } + if (OpCode->Imm5.opcode == 0xE) + { + //b8 70 strb r0, [r7, #2] + if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) + { + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + { + g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); + } + } + context.arm_pc = context.arm_pc + 2; + return true; + } + if (OpCode32->reg_cond.opcode == 0 && OpCode32->reg_cond.opcode1 == 0 && OpCode32->reg_cond.opcode2 == 0 && OpCode32->reg_cond.opcode3 == 0xB) { //118320b1 strhne r2, [r3, r1] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -640,7 +656,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e48a1004 str r1, [sl], #4 if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm12.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -654,7 +670,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //f833 c001 ldrh.w ip, [r3, r1] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->uint16.rt], false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -668,7 +684,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e19a20b2 ldrh r2, [sl, r2] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->uint32.rt], false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -682,7 +698,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //119330b1 ldrhne r3, [r3, r1] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->reg_cond.rt], false)) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -696,7 +712,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //1790a001 ldrne sl, [r0, r1] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -710,7 +726,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //52 f8 21 30 ldr.w r3, [r2, r1, lsl #2] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -763,6 +779,9 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rt: %X",OpCode32->uint32.rt); WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.opcode2: %X",OpCode32->uint32.opcode2); WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rm: %X",OpCode32->uint32.rm); + + Flush_Recompiler_Log(); + TraceFlushLog(); return false; } #endif diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp index 8bcc18f13..32f8bef7e 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp @@ -48,7 +48,10 @@ CMipsMemoryVM::CMipsMemoryVM(bool SavesReadOnly) : m_TLB_WriteMap(NULL), m_RDRAM(NULL), m_DMEM(NULL), - m_IMEM(NULL) + m_IMEM(NULL), + m_DDRomMapped(false), + m_DDRom(NULL), + m_DDRomSize(0) { g_Settings->RegisterChangeCB(Game_RDRamSize, this, (CSettings::SettingChangedFunc)RdramChanged); } diff --git a/Source/Project64-core/N64System/Recompiler/FunctionMapClass.cpp b/Source/Project64-core/N64System/Recompiler/FunctionMapClass.cpp index 229dbfce1..ebd0d268f 100644 --- a/Source/Project64-core/N64System/Recompiler/FunctionMapClass.cpp +++ b/Source/Project64-core/N64System/Recompiler/FunctionMapClass.cpp @@ -29,7 +29,7 @@ bool CFunctionMap::AllocateMemory() WriteTrace(TraceRecompiler, TraceDebug, "start"); if (LookUpMode() == FuncFind_VirtualLookup && m_FunctionTable == NULL) { - m_FunctionTable = new (std::nothrow) PCCompiledFunc_TABLE[0x100000]; + m_FunctionTable = new PCCompiledFunc_TABLE[0x100000]; if (m_FunctionTable == NULL) { WriteTrace(TraceRecompiler, TraceError, "failed to allocate function table"); @@ -40,7 +40,7 @@ bool CFunctionMap::AllocateMemory() } if (LookUpMode() == FuncFind_PhysicalLookup && m_JumpTable == NULL) { - m_JumpTable = new (std::nothrow) PCCompiledFunc[RdramSize() >> 2]; + m_JumpTable = new PCCompiledFunc[RdramSize() >> 2]; if (m_JumpTable == NULL) { WriteTrace(TraceRecompiler, TraceError, "failed to allocate jump table"); diff --git a/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.cpp b/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.cpp index b8a46890d..4e78b92d8 100644 --- a/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.cpp +++ b/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.cpp @@ -61,3 +61,11 @@ void Stop_Recompiler_Log (void) g_CPULogFile = NULL; } } + +void Flush_Recompiler_Log(void) +{ + if (g_CPULogFile != NULL) + { + g_CPULogFile->Flush(); + } +} diff --git a/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.h b/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.h index ccdaf070f..db45335ff 100644 --- a/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.h +++ b/Source/Project64-core/N64System/Recompiler/RecompilerCodeLog.h @@ -15,4 +15,5 @@ void Recompiler_Log_Message (const char * Message, ...); void Start_Recompiler_Log (void); -void Stop_Recompiler_Log (void); +void Stop_Recompiler_Log(void); +void Flush_Recompiler_Log(void);