Enabled debugger BSAVE with bank support:

. BSAVE [file,][bank:]<range>
This commit is contained in:
tomch 2013-08-30 21:43:37 +00:00
parent 2683b83bdb
commit d5ae003e56
3 changed files with 28 additions and 18 deletions

View File

@ -4178,7 +4178,7 @@ Update_t CmdMemoryMove (int nArgs)
//===========================================================================
#if 1 // Original
#if 0 // Original
Update_t CmdMemorySave (int nArgs)
{
// BSAVE ["Filename"] , addr , len

View File

@ -1169,21 +1169,22 @@ Update_t CmdHelpSpecific (int nArgs)
case CMD_MEMORY_SAVE:
if (iCommand == CMD_MEMORY_LOAD)
{
sprintf( sTemp, " Usage: [\"Filename\"],address[,length]" );
sprintf( sTemp, " Usage: [\"Filename\",]address[,length]" );
Colorize( sText, sTemp );
ConsolePrint( sText );
sprintf( sTemp, " Usage: [\"Filename\"],range" );
sprintf( sTemp, " Usage: [\"Filename\",]range" );
Colorize( sText, sTemp );
ConsolePrint( sText );
Help_Range();
ConsoleBufferPush( " Notes: If no filename specified, defaults to the last filename (if possible)" );
ConsoleBufferPush( " Optional bank not supported for BLOAD" );
}
if (iCommand == CMD_MEMORY_SAVE)
{
sprintf( sTemp, " Usage: [\"Filename\"],address,length" );
sprintf( sTemp, " Usage: [\"Filename\",][bank:]address,length" );
Colorize( sText, sTemp );
ConsolePrint( sText );
sprintf( sTemp, " Usage: [\"Filename\"],range" );
sprintf( sTemp, " Usage: [\"Filename\",][bank:]range" );
Colorize( sText, sTemp );
ConsolePrint( sText );
Help_Range();
@ -1197,6 +1198,8 @@ Update_t CmdHelpSpecific (int nArgs)
sprintf( sText, "%s BLOAD \"test\",2000:2010" , CHC_EXAMPLE ); ConsolePrint( sText );
sprintf( sText, "%s BSAVE \"test\",F000:FFFF" , CHC_EXAMPLE ); ConsolePrint( sText );
sprintf( sText, "%s BLOAD \"test\",4000" , CHC_EXAMPLE ); ConsolePrint( sText );
sprintf( sText, "%s BSAVE \"test\",0:2000,2000" , CHC_EXAMPLE ); ConsolePrint( sText );
sprintf( sText, "%s BSAVE \"test\",1:2000:3FFF" , CHC_EXAMPLE ); ConsolePrint( sText );
break;
case CMD_MEMORY_SEARCH:
Colorize( sText, " Usage: range <\"ASCII text\" | 'apple text' | hex>" );

View File

@ -751,17 +751,16 @@ static bool IsCardInSlot(const UINT uSlot)
//===========================================================================
//// Only called by MemSetFastPaging()
//static void BackMainImage ()
//{
// for (UINT loop = 0; loop < 256; loop++)
// {
// if (memshadow[loop] && ((*(memdirty+loop) & 1) || (loop <= 1)))
// CopyMemory(memshadow[loop],memimage+(loop << 8),256);
//
// *(memdirty+loop) &= ~1;
// }
//}
static void BackMainImage(void)
{
for (UINT loop = 0; loop < 256; loop++)
{
if (memshadow[loop] && ((*(memdirty+loop) & 1) || (loop <= 1)))
CopyMemory(memshadow[loop], memimage+(loop << 8), 256);
*(memdirty+loop) &= ~1;
}
}
//===========================================================================
@ -1117,13 +1116,21 @@ LPBYTE MemGetMainPtr(const WORD offset)
LPBYTE MemGetBankPtr(const UINT nBank)
{
if (nBank == 0)
return mem;
BackMainImage(); // Flush any dirty pages to back-buffer
#ifdef RAMWORKS
if (nBank > g_uMaxExPages)
return NULL;
if (nBank == 0)
return memmain;
return RWpages[nBank-1];
#else
return (nBank == 0) ? memmain :
(nBank == 1) ? memaux :
NULL;
#endif
}
//===========================================================================