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

Function CmdCursorLineUp

source/Debugger/Debug.cpp:3382–3603  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

3380
3381//===========================================================================
3382Update_t CmdCursorLineUp (int nArgs)
3383{
3384 int nBytes = 1;
3385
3386 if (g_iWindowThis == WINDOW_DATA)
3387 {
3388 _CursorMoveUpAligned( WINDOW_DATA_BYTES_PER_LINE );
3389 }
3390 else
3391 if (nArgs)
3392 {
3393 nBytes = nArgs; // HACK: g_aArgs[1].nValue
3394
3395 g_nDisasmTopAddress--;
3396 DisasmCalcCurFromTopAddress();
3397 DisasmCalcBotFromTopAddress();
3398 }
3399 else
3400 {
3401// if (! g_nDisasmCurLine)
3402// {
3403// g_nDisasmCurLine = 1;
3404// DisasmCalcTopFromCurAddress( false );
3405
3406// g_nDisasmCurLine = 0;
3407// DisasmCalcCurFromTopAddress();
3408// DisasmCalcBotFromTopAddress();
3409// return UPDATE_DISASM;
3410// }
3411
3412 // SmartLineUp()
3413 // Figure out if we should move up 1, 2, or 3 bytes since we have 2 possible cases:
3414 //
3415 // a) Scroll up by 2 bytes
3416 // xx-2: A9 yy LDA #xx
3417 // xxxx: top
3418 //
3419 // b) Scroll up by 3 bytes
3420 // xx-3: 20 A9 xx JSR $00A9
3421 // xxxx: top of window
3422 //
3423#define DEBUG_SCROLL 3
3424
3425#if DEBUG_SCROLL == 1
3426 WORD nCur = g_nDisasmCurAddress - nBytes;
3427
3428 // Adjust Top until nNewCur is at > Cur
3429 do
3430 {
3431 g_nDisasmTopAddress--;
3432 DisasmCalcCurFromTopAddress();
3433 } while (g_nDisasmCurAddress > nCur);
3434#endif
3435
3436#if DEBUG_SCROLL == 2
3437 WORD nCur = g_nDisasmCurAddress - nBytes;
3438
3439 int iOpcode;

Callers 2

CmdCursorPageUpFunction · 0.85
DebuggerProcessKeyFunction · 0.85

Calls 7

_CursorMoveUpAlignedFunction · 0.85
_6502_GetOpmodeOpbyteFunction · 0.85
_6502_IsOpcodeValidFunction · 0.85
DisasmCalcTopBotAddressFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected