[Project64] Fix up some changes to debugger commit

This commit is contained in:
zilmar 2017-08-21 08:48:31 +10:00
parent a91d336846
commit a61a466776
7 changed files with 743 additions and 746 deletions

View File

@ -23,8 +23,8 @@ static bool TranslateFromMemProtect(MEM_PROTECTION memProtection, int & OsMemPro
{ {
case MEM_NOACCESS: OsMemProtection = PROT_NONE; break; case MEM_NOACCESS: OsMemProtection = PROT_NONE; break;
case MEM_READONLY: OsMemProtection = PROT_READ; break; case MEM_READONLY: OsMemProtection = PROT_READ; break;
case MEM_READWRITE: OsMemProtection = PROT_READ|PROT_WRITE; break; case MEM_READWRITE: OsMemProtection = PROT_READ | PROT_WRITE; break;
case MEM_EXECUTE_READWRITE: OsMemProtection = PROT_READ|PROT_WRITE|PROT_EXEC; break; case MEM_EXECUTE_READWRITE: OsMemProtection = PROT_READ | PROT_WRITE | PROT_EXEC; break;
default: default:
return false; return false;
} }
@ -48,12 +48,12 @@ static bool TranslateToMemProtect(int OsMemProtection, MEM_PROTECTION & memProte
} }
#endif #endif
void* AllocateAddressSpace(size_t size, LPVOID lpAddress) void* AllocateAddressSpace(size_t size)
{ {
#ifdef _WIN32 #ifdef _WIN32
return VirtualAlloc(lpAddress, size, MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS); return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS);
#else #else
void * ptr = mmap((void*)0, size, PROT_NONE, MAP_PRIVATE|MAP_ANON, -1, 0); void * ptr = mmap((void*)0, size, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (ptr == MAP_FAILED) if (ptr == MAP_FAILED)
{ {
return NULL; return NULL;

View File

@ -8,7 +8,7 @@ enum MEM_PROTECTION
MEM_EXECUTE_READWRITE, MEM_EXECUTE_READWRITE,
}; };
void* AllocateAddressSpace(size_t size, LPVOID lpAddress = NULL); void* AllocateAddressSpace(size_t size);
bool FreeAddressSpace(void* addr, size_t size); bool FreeAddressSpace(void* addr, size_t size);
void* CommitMemory(void* addr, size_t size, MEM_PROTECTION memProtection); void* CommitMemory(void* addr, size_t size, MEM_PROTECTION memProtection);
bool DecommitMemory(void* addr, size_t size); bool DecommitMemory(void* addr, size_t size);

View File

@ -11,7 +11,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "InterpreterCPU.h" #include "InterpreterCPU.h"
#include "Debugger.h"
#include <Project64-core/N64System/SystemGlobals.h> #include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h> #include <Project64-core/N64System/N64Class.h>
@ -21,6 +20,7 @@
#include <Project64-core/Plugins/PluginClass.h> #include <Project64-core/Plugins/PluginClass.h>
#include <Project64-core/Plugins/GFXPlugin.h> #include <Project64-core/Plugins/GFXPlugin.h>
#include <Project64-core/ExceptionHandler.h> #include <Project64-core/ExceptionHandler.h>
#include <Project64-core/Debugger.h>
R4300iOp::Func * CInterpreterCPU::m_R4300i_Opcode = NULL; R4300iOp::Func * CInterpreterCPU::m_R4300i_Opcode = NULL;
@ -314,7 +314,6 @@ void CInterpreterCPU::ExecuteCPU()
// WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType()); // WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType());
} */ } */
m_R4300i_Opcode[Opcode.op](); m_R4300i_Opcode[Opcode.op]();
NextTimer -= CountPerOp; NextTimer -= CountPerOp;
@ -368,8 +367,6 @@ void CInterpreterCPU::ExecuteCPU()
WriteTrace(TraceN64System, TraceDebug, "Done"); WriteTrace(TraceN64System, TraceDebug, "Done");
} }
void CInterpreterCPU::ExecuteOps(int32_t Cycles) void CInterpreterCPU::ExecuteOps(int32_t Cycles)
{ {
bool & Done = g_System->m_EndEmulation; bool & Done = g_System->m_EndEmulation;

View File

@ -10,6 +10,7 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "OpCode.h" #include "OpCode.h"
#include <Project64-core/N64System/Mips/RegisterClass.h> #include <Project64-core/N64System/Mips/RegisterClass.h>
@ -570,7 +571,7 @@ const char * R4300iOpcodeName(uint32_t OpCode, uint32_t PC)
if (command.rt == 29) if (command.rt == 29)
{ {
short imm = (short)command.immediate; short imm = (short)command.immediate;
sprintf(CommandName, "ADDIU\t%s, %s, %s0x%02X", CRegName::GPR[command.rt], CRegName::GPR[command.rs], imm < 0 ? "-":"", abs(imm)); sprintf(CommandName, "ADDIU\t%s, %s, %s0x%02X", CRegName::GPR[command.rt], CRegName::GPR[command.rs], imm < 0 ? "-" : "", abs(imm));
} }
else else
{ {

View File

@ -49,9 +49,6 @@ extern "C" {
//#define CATCH_EXCEPTIONS // catch exceptions so it doesn't freeze and will report //#define CATCH_EXCEPTIONS // catch exceptions so it doesn't freeze and will report
// "The gfx plugin has caused an exception" instead. // "The gfx plugin has caused an exception" instead.
//#define SHOW_FULL_TEXVIEWER // shows the entire contents of the texture in the cache viewer,
// usually used to debug clamping issues.
// Usually enabled // Usually enabled
#define LARGE_TEXTURE_HANDLING // allow large-textured objects to be split? #define LARGE_TEXTURE_HANDLING // allow large-textured objects to be split?

View File

@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#include "../../Project64-core/Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -1800,13 +1801,13 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "FileDescription", "Project64" VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileVersion", "2.3.0.9999" VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "InternalName", "Project64" VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "OriginalFilename", "Project64.exe" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "ProductName", "Project64" VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", "2.3.0.9999" VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -7,3 +7,4 @@ Windows 2.4
- Build with v2015 - Build with v2015
- fixed fpu issue - Indiana Jones (#76) - fixed fpu issue - Indiana Jones (#76)
- Fix bug in key assignment (#1309) - Fix bug in key assignment (#1309)
- Add Shygoo's debugger code