From 2daeebcb01d61e72630d03acb4f5033391259de5 Mon Sep 17 00:00:00 2001 From: wsxyz Date: Tue, 1 Mar 2011 08:00:55 +0000 Subject: [PATCH] Merge in CPU/Debugger changed files --- source/CPU/cpu6502.h | 10 ++++++++++ source/CPU/cpu65C02.h | 11 ++++++++++- source/Debugger/Debug.cpp | 38 +++++++++++++------------------------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/source/CPU/cpu6502.h b/source/CPU/cpu6502.h index 4c21f3d1..41388cc8 100644 --- a/source/CPU/cpu6502.h +++ b/source/CPU/cpu6502.h @@ -44,6 +44,11 @@ static DWORD Cpu6502 (DWORD uTotalCycles) UINT uExtraCycles = 0; BYTE iOpcode; +#ifdef WS_VIDEO + ULONG uElapsedCycles; + ULONG uPreviousCycles = uExecutedCycles; +#endif + #ifdef SUPPORT_CPM if (g_ActiveCPU == CPU_Z80) { @@ -317,6 +322,11 @@ static DWORD Cpu6502 (DWORD uTotalCycles) } } +#ifdef WS_VIDEO + uElapsedCycles = uExecutedCycles - uPreviousCycles; + wsVideoUpdate(uElapsedCycles); +#endif + CheckInterruptSources(uExecutedCycles); NMI(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz); IRQ(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz); diff --git a/source/CPU/cpu65C02.h b/source/CPU/cpu65C02.h index aaa63c0c..bd4593f3 100644 --- a/source/CPU/cpu65C02.h +++ b/source/CPU/cpu65C02.h @@ -47,6 +47,11 @@ static DWORD Cpu65C02 (DWORD uTotalCycles) UINT uExtraCycles = 0; BYTE iOpcode; +#ifdef WS_VIDEO + ULONG uElapsedCycles; + ULONG uPreviousCycles = uExecutedCycles; +#endif + #ifdef SUPPORT_CPM if (g_ActiveCPU == CPU_Z80) { @@ -320,7 +325,11 @@ static DWORD Cpu65C02 (DWORD uTotalCycles) } #undef $ } - + +#ifdef WS_VIDEO + uElapsedCycles = uExecutedCycles - uPreviousCycles; + wsVideoUpdate(uElapsedCycles); +#endif CheckInterruptSources(uExecutedCycles); NMI(uExecutedCycles, uExtraCycles, flagc, flagn, flagv, flagz); diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 93f84cf5..b629c8fa 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ALLOW_INPUT_LOWERCASE 1 // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,7,0,8); + const int DEBUGGER_VERSION = MAKE_VERSION(2,7,0,7); // Public _________________________________________________________________________________________ @@ -111,8 +111,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA vector g_vSortedCommands; // static const char g_aFlagNames[_6502_NUM_FLAGS+1] = TEXT("CZIDBRVN");// Reversed since arrays are from left-to-right - - +#ifdef WS_VIDEO + Command_t g_aCommands[NUM_COMMANDS]; + Command_t g_aParameters[NUM_COMMANDS]; + const int NUM_COMMANDS_WITH_ALIASES = sizeof(g_aCommands) / sizeof (Command_t); // Determined at compile-time ;-) + void VerifyDebuggerCommandTable () {} +#endif // Cursor (Console Input) _____________________________________________________ // char g_aInputCursor[] = "\|/-"; @@ -1940,7 +1944,7 @@ Update_t CmdTraceFile (int nArgs) char sFilePath[ MAX_PATH ]; - strcpy(sFilePath, g_sCurrentDir); // TODO: g_sDebugDir + strcpy(sFilePath, g_sCurrentDir); // g_sProgramDir strcat(sFilePath, sFileName ); g_hTraceFile = fopen( sFilePath, "wt" ); @@ -2304,7 +2308,7 @@ void ConfigSave_PrepareHeader ( const Parameters_e eCategory, const Commands_e e Update_t CmdConfigSave (int nArgs) { TCHAR sFilename[ MAX_PATH ]; - _tcscpy( sFilename, g_sProgramDir ); // TODO: g_sDebugDir + _tcscpy( sFilename, g_sProgramDir ); // g_sCurrentDir _tcscat( sFilename, g_sFileNameConfig ); /* @@ -3977,22 +3981,6 @@ Update_t CmdMemoryFill (int nArgs) static TCHAR g_sMemoryLoadSaveFileName[ MAX_PATH ] = TEXT(""); -//=========================================================================== -Update_t CmdConfigGetDebugDir (int nArgs) -{ - TCHAR sPath[ MAX_PATH + 8 ] = "Path: "; - _tcscat( sPath, g_sCurrentDir ); // TODO: debugger dir has no ` CONSOLE_COLOR_ESCAPE_CHAR ?!?! - ConsoleBufferPush( sPath ); - - return ConsoleUpdate(); -} - -//=========================================================================== -Update_t CmdConfigSetDebugDir (int nArgs) -{ - return ConsoleUpdate(); -} - //=========================================================================== Update_t CmdMemoryLoad (int nArgs) { @@ -4036,7 +4024,7 @@ Update_t CmdMemoryLoad (int nArgs) return Help_Arg_1( CMD_MEMORY_SAVE ); TCHAR sLoadSaveFilePath[ MAX_PATH ]; - _tcscpy( sLoadSaveFilePath, g_sCurrentDir ); // TODO: g_sDebugDir + _tcscpy( sLoadSaveFilePath, g_sCurrentDir ); // g_sProgramDir WORD nAddressStart; WORD nAddress2 = 0; @@ -4100,9 +4088,9 @@ Update_t CmdMemoryLoad (int nArgs) else { ConsoleBufferPush( TEXT( "ERROR: Bad filename" ) ); - - CmdConfigGetDebugDir( 0 ); - + TCHAR sPath[ MAX_PATH + 8 ] = "Path: "; + _tcscat( sPath, g_sCurrentDir ); + ConsoleBufferPush( sPath ); TCHAR sFile[ MAX_PATH + 8 ] = "File: "; _tcscat( sFile, g_sMemoryLoadSaveFileName ); ConsoleBufferPush( sFile );