MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdMemoryLoad

Function CmdMemoryLoad

source/Debugger/Debug.cpp:4526–4639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4524//===========================================================================
4525#if 0 // Original - TODO: delete this old "original" code
4526Update_t CmdMemoryLoad (int nArgs)
4527{
4528 // BLOAD ["Filename"] , addr[, len]
4529 // BLOAD ["Filename"] , addr[: end]
4530 // 1 2 3 4 5
4531 if (nArgs > 5)
4532 return Help_Arg_1( CMD_MEMORY_LOAD );
4533
4534 bool bHaveFileName = false;
4535 int iArgAddress = 3;
4536
4537 if (g_aArgs[1].bType & TYPE_QUOTED_2)
4538 bHaveFileName = true;
4539
4540// if (g_aArgs[2].bType & TOKEN_QUOTE_DOUBLE)
4541// bHaveFileName = true;
4542
4543 if (nArgs > 1)
4544 {
4545 if (g_aArgs[1].bType & TYPE_QUOTED_2)
4546 bHaveFileName = true;
4547
4548 int iArgComma1 = 2;
4549 int iArgAddress = 3;
4550 int iArgComma2 = 4;
4551 int iArgLength = 5;
4552
4553 if (! bHaveFileName)
4554 {
4555 iArgComma1 = 1;
4556 iArgAddress = 2;
4557 iArgComma2 = 3;
4558 iArgLength = 4;
4559
4560 if (nArgs > 4)
4561 return Help_Arg_1( CMD_MEMORY_LOAD );
4562 }
4563
4564 if (g_aArgs[ iArgComma1 ].eToken != TOKEN_COMMA)
4565 return Help_Arg_1( CMD_MEMORY_SAVE );
4566
4567 std::string sLoadSaveFilePath = g_sCurrentDir; // TODO: g_sDebugDir
4568
4569 WORD nAddressStart;
4570 WORD nAddress2 = 0;
4571 WORD nAddressEnd = 0;
4572 int nAddressLen = 0;
4573
4574 RangeType_t eRange;
4575 eRange = Range_Get( nAddressStart, nAddress2, iArgAddress );
4576 if (nArgs > 4)
4577 {
4578 if (eRange == RANGE_MISSING_ARG_2)
4579 {
4580 return Help_Arg_1( CMD_MEMORY_LOAD );
4581 }
4582
4583// if (eRange == RANGE_MISSING_ARG_2)

Callers

nothing calls this directly

Calls 11

Help_Arg_1Function · 0.85
Range_GetFunction · 0.85
Range_CalcEndLenFunction · 0.85
_GetFileSizeFunction · 0.85
WriteByteToMemoryFunction · 0.85
CmdConfigGetDebugDirFunction · 0.85
ConsoleBufferPushFormatFunction · 0.85
MemGetBankPtrFunction · 0.85
MemUpdatePagingFunction · 0.85
ConsoleBufferPushFunction · 0.70
ConsoleUpdateFunction · 0.70

Tested by

no test coverage detected