mirror of https://github.com/snes9xgit/snes9x.git
Expose debug command to ports
This commit is contained in:
parent
456f90369e
commit
d7ff305c96
|
@ -343,7 +343,6 @@ static uint8 debug_sa1_op_print (char *, uint8, uint16);
|
||||||
static void debug_line_print (const char *);
|
static void debug_line_print (const char *);
|
||||||
static int debug_get_number (char *, uint16 *);
|
static int debug_get_number (char *, uint16 *);
|
||||||
static short debug_get_start_address (char *, uint8 *, uint32 *);
|
static short debug_get_start_address (char *, uint8 *, uint32 *);
|
||||||
static void debug_process_command (char *);
|
|
||||||
static void debug_print_window (uint8 *);
|
static void debug_print_window (uint8 *);
|
||||||
static const char * debug_clip_fn (int);
|
static const char * debug_clip_fn (int);
|
||||||
static void debug_whats_used (void);
|
static void debug_whats_used (void);
|
||||||
|
@ -1373,7 +1372,7 @@ static short debug_get_start_address (char *Line, uint8 *Bank, uint32 *Address)
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void debug_process_command (char *Line)
|
void S9xDebugProcessCommand(char *Line)
|
||||||
{
|
{
|
||||||
uint8 Bank = Registers.PB;
|
uint8 Bank = Registers.PB;
|
||||||
uint32 Address = Registers.PCw;
|
uint32 Address = Registers.PCw;
|
||||||
|
@ -2558,7 +2557,7 @@ void S9xDoDebug (void)
|
||||||
S9xTextMode();
|
S9xTextMode();
|
||||||
|
|
||||||
strcpy(Line, "r");
|
strcpy(Line, "r");
|
||||||
debug_process_command(Line);
|
S9xDebugProcessCommand(Line);
|
||||||
|
|
||||||
while (CPU.Flags & DEBUG_MODE_FLAG)
|
while (CPU.Flags & DEBUG_MODE_FLAG)
|
||||||
{
|
{
|
||||||
|
@ -2572,7 +2571,7 @@ void S9xDoDebug (void)
|
||||||
Line[strlen(Line) - 1] = 0;
|
Line[strlen(Line) - 1] = 0;
|
||||||
|
|
||||||
Cycles = CPU.Cycles;
|
Cycles = CPU.Cycles;
|
||||||
debug_process_command(Line);
|
S9xDebugProcessCommand(Line);
|
||||||
CPU.Cycles = Cycles;
|
CPU.Cycles = Cycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
debug.h
1
debug.h
|
@ -220,6 +220,7 @@ void S9xSA1Trace (void);
|
||||||
void S9xTraceMessage (const char *);
|
void S9xTraceMessage (const char *);
|
||||||
void S9xTraceFormattedMessage (const char *, ...);
|
void S9xTraceFormattedMessage (const char *, ...);
|
||||||
void S9xPrintHVPosition (char *);
|
void S9xPrintHVPosition (char *);
|
||||||
|
void S9xDebugProcessCommand(char *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -235,6 +235,10 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#ifdef DEBUGGER
|
||||||
|
#include "../debug.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__))
|
#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__))
|
||||||
// both MINGW and VS.NET use fstream instead of fstream.h which is deprecated
|
// both MINGW and VS.NET use fstream instead of fstream.h which is deprecated
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -2405,7 +2409,7 @@ LRESULT CALLBACK WinProc(
|
||||||
break;
|
break;
|
||||||
#ifdef DEBUGGER
|
#ifdef DEBUGGER
|
||||||
case ID_DEBUG_TRACE:
|
case ID_DEBUG_TRACE:
|
||||||
CPU.Flags ^= TRACE_FLAG;
|
S9xDebugProcessCommand("T");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_DEBUG_FRAME_ADVANCE:
|
case ID_DEBUG_FRAME_ADVANCE:
|
||||||
|
|
Loading…
Reference in New Issue