diff --git a/apu/SNES_SPC.h b/apu/SNES_SPC.h index 4b4bd47e..baf90063 100644 --- a/apu/SNES_SPC.h +++ b/apu/SNES_SPC.h @@ -124,6 +124,7 @@ public: #ifdef DEBUGGER void debug_toggle_trace( void ); + bool debug_is_enabled( void ); void debug_do_trace( int, int, int, uint8_t const *, uint8_t *, int, int, int, int ); void debug_op_print( char *, int, int, int, uint8_t const *, uint8_t *, int, int, int, int ); void debug_io_print( char * ); diff --git a/apu/SNES_SPC_misc.cpp b/apu/SNES_SPC_misc.cpp index 50b61a8f..078120d2 100644 --- a/apu/SNES_SPC_misc.cpp +++ b/apu/SNES_SPC_misc.cpp @@ -443,6 +443,8 @@ void SNES_SPC::debug_toggle_trace( void ) } } +bool SNES_SPC::debug_is_enabled( void ) { return debug_trace; } + void SNES_SPC::debug_do_trace( int a, int x, int y, uint8_t const *pc, uint8_t *sp, int psw, int c, int nz, int dp ) { char msg[512]; diff --git a/port.h b/port.h index 07c2bf2a..0e8192e5 100644 --- a/port.h +++ b/port.h @@ -249,6 +249,7 @@ typedef signed int int32; typedef unsigned int uint32; #endif typedef unsigned char uint8_t; +typedef signed char int8_t; typedef signed __int64 int64; typedef unsigned __int64 uint64; typedef int socklen_t; diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index 6f62d8ec..ca767abd 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -484,13 +484,14 @@ #define ID_WINDOW_SIZE_2X 40170 #define ID_WINDOW_SIZE_3X 40171 #define ID_WINDOW_SIZE_4X 40172 +#define ID_DEBUG_APU_TRACE 40173 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 151 -#define _APS_NEXT_COMMAND_VALUE 40173 +#define _APS_NEXT_COMMAND_VALUE 40174 #define _APS_NEXT_CONTROL_VALUE 3018 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 25e372a8..34463255 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -2232,6 +2232,9 @@ LRESULT CALLBACK WinProc( ICPU.FrameAdvanceCount = 1; Settings.Paused = FALSE; break; + case ID_DEBUG_APU_TRACE: + spc_core->debug_toggle_trace(); + break; #endif case IDM_ROM_INFO: RestoreGUIDisplay (); @@ -2579,6 +2582,7 @@ BOOL WinInit( HINSTANCE hInstance) if(GUI.hMenu) { InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_FRAME_ADVANCE,TEXT("&Debug Frame Advance")); InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_TRACE,TEXT("&Trace")); + InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_APU_TRACE,TEXT("&APU Trace")); InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_SEPARATOR | MF_ENABLED,NULL,NULL); } #endif @@ -3756,6 +3760,8 @@ static void CheckMenuStates () #ifdef DEBUGGER mii.fState = (CPU.Flags & TRACE_FLAG) ? MFS_CHECKED : MFS_UNCHECKED; SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE, FALSE, &mii); + mii.fState = (spc_core->debug_is_enabled()) ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_APU_TRACE, FALSE, &mii); #endif mii.fState = (!Settings.StopEmulation) ? MFS_ENABLED : MFS_DISABLED;