more debugging cleanups

[[Split portion of a mixed commit.]]
This commit is contained in:
zeromus 2006-07-24 04:58:44 +00:00
parent 16a27a1162
commit 26ba7e79e1
8 changed files with 24 additions and 11 deletions

View File

@ -79,9 +79,8 @@ char *cdlogfilename;
//char loadedcdfile[MAX_PATH]; //char loadedcdfile[MAX_PATH];
static int indirectnext; static int indirectnext;
//records whether loggingCD is enabled
int debug_loggingCD; int debug_loggingCD;
//void FCEUI_SetLoggingCD(int val) { debug_loggingCD = val; }
//int FCEUI_GetLoggingCD(int val) { return debug_loggingCD = val; }
//called by the cpu to perform logging if CDLogging is enabled //called by the cpu to perform logging if CDLogging is enabled
void LogCDVectors(int which){ void LogCDVectors(int which){
@ -412,6 +411,7 @@ void breakpoint() {
} }
//bbit edited: this is the end of the inserted code //bbit edited: this is the end of the inserted code
int debug_tracing;
void DebugCycle() { void DebugCycle() {
if (numWPs | step | stepout | watchpoint[64].flags | badopbreak) if (numWPs | step | stepout | watchpoint[64].flags | badopbreak)
@ -419,5 +419,5 @@ void DebugCycle() {
if(debug_loggingCD) LogCDData(); if(debug_loggingCD) LogCDData();
//mbg 6/30/06 - this was commented out when i got here. i dont understand it anyway //mbg 6/30/06 - this was commented out when i got here. i dont understand it anyway
//if(logging || (hMemView && (EditingMode == 2))) LogInstruction(); //if(logging || (hMemView && (EditingMode == 2))) LogInstruction();
//if(logging) LogInstruction(); FCEUD_TraceInstruction();
} }

10
debug.h
View File

@ -65,7 +65,6 @@ uint8 GetPPUMem(uint8 A);
void LogCDVectors(int which); void LogCDVectors(int which);
void LogCDData(); void LogCDData();
extern volatile int codecount, datacount, undefinedcount; extern volatile int codecount, datacount, undefinedcount;
extern volatile int loggingcodedata;
extern unsigned char *cdloggerdata; extern unsigned char *cdloggerdata;
extern int debug_loggingCD; extern int debug_loggingCD;
@ -73,6 +72,13 @@ static INLINE void FCEUI_SetLoggingCD(int val) { debug_loggingCD = val; }
static INLINE int FCEUI_GetLoggingCD() { return debug_loggingCD; } static INLINE int FCEUI_GetLoggingCD() { return debug_loggingCD; }
//------- //-------
//-------tracing
//we're letting the win32 driver handle this ittself for now
//extern int debug_tracing;
//static INLINE void FCEUI_SetTracing(int val) { debug_tracing = val; }
//static INLINE int FCEUI_GetTracing() { return debug_tracing; }
//---------
//--------debugger //--------debugger
extern int iaPC; extern int iaPC;
extern uint32 iapoffset; //mbg merge 7/18/06 changed from int extern uint32 iapoffset; //mbg merge 7/18/06 changed from int
@ -84,4 +90,4 @@ extern uint8 *vnapage[4],*VPage[8];
extern uint8 PPU[4],PALRAM[0x20],SPRAM[0x100],VRAMBuffer,PPUGenLatch,XOffset; extern uint8 PPU[4],PALRAM[0x20],SPRAM[0x100],VRAMBuffer,PPUGenLatch,XOffset;
extern uint32 RefreshAddr; extern uint32 RefreshAddr;
#endif #endif

View File

@ -311,10 +311,15 @@ int FCEUD_ShowStatusIcon(void);
void FCEUD_ToggleStatusIcon(void); void FCEUD_ToggleStatusIcon(void);
void FCEUD_HideMenuToggle(void); void FCEUD_HideMenuToggle(void);
//new merge-era driver routines here //new merge-era driver routines here:
//signals that the cpu core hit a breakpoint //signals that the cpu core hit a breakpoint
//this function should not return until the core is ready for the next cycle //this function should not return until the core is ready for the next cycle
void FCEUD_DebugBreakpoint(); void FCEUD_DebugBreakpoint();
//the driver should log the current instruction, if it wants
//(we should move the code in the win driver that does this to the shared area)
void FCEUD_TraceInstruction();
#endif /* __DRIVER_H_ */ #endif /* __DRIVER_H_ */

View File

@ -24,7 +24,7 @@
#include "..\..\x6502.h" #include "..\..\x6502.h"
#include "..\..\debug.h" #include "..\..\debug.h"
#include "debugger.h" #include "debugger.h"
#include "..\..\tracer.h" #include "tracer.h"
#include "cdlogger.h" #include "cdlogger.h"
#define INESPRIV #define INESPRIV

View File

@ -26,7 +26,7 @@
#include "..\..\nsf.h" #include "..\..\nsf.h"
#include "..\..\cart.h" #include "..\..\cart.h"
#include "..\..\ines.h" #include "..\..\ines.h"
#include "..\..\tracer.h" #include "tracer.h"
#include "..\..\memview.h" #include "..\..\memview.h"
#include "cheat.h" #include "cheat.h"
#include <assert.h> #include <assert.h>

View File

@ -49,7 +49,7 @@
#include "..\..\ppuview.h" #include "..\..\ppuview.h"
#include "..\..\ntview.h" #include "..\..\ntview.h"
#include "..\..\memview.h" #include "..\..\memview.h"
#include "..\..\tracer.h" #include "tracer.h"
#include "cdlogger.h" #include "cdlogger.h"
//----- //-----

View File

@ -25,7 +25,7 @@
#include "..\..\cart.h" //mbg merge 7/19/06 moved after fceu.h #include "..\..\cart.h" //mbg merge 7/19/06 moved after fceu.h
#include "cdlogger.h" #include "cdlogger.h"
#include "..\..\file.h" #include "..\..\file.h"
#include "..\..\tracer.h" #include "tracer.h"
#include "..\..\memview.h" #include "..\..\memview.h"
//#define LOG_SKIP_UNMAPPED 4 //#define LOG_SKIP_UNMAPPED 4
@ -277,7 +277,9 @@ done:
}*/ }*/
//todo: really speed this up //todo: really speed this up
void LogInstruction(){ void FCEUD_TraceInstruction(){
if(!logging) return;
char address[7], data[11], disassembly[28], axystate[16], procstatus[12]; char address[7], data[11], disassembly[28], axystate[16], procstatus[12];
char str[96]; char str[96];
int addr=X.PC; int addr=X.PC;