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

Function _CursorMoveUpAligned

source/Debugger/Debug.cpp:3687–3708  ·  view source on GitHub ↗

nDelta must be a power of 2 ===========================================================================

Source from the content-addressed store, hash-verified

3685// nDelta must be a power of 2
3686//===========================================================================
3687void _CursorMoveUpAligned ( int nDelta )
3688{
3689 if (g_iWindowThis == WINDOW_DATA)
3690 {
3691 if (g_aMemDump[0].eDevice == DEV_MEMORY)
3692 {
3693 g_aMemDump[0].nAddress -= nDelta;
3694 g_aMemDump[0].nAddress &= _6502_MEM_END;
3695 }
3696 }
3697 else
3698 {
3699 int nNewAddress = g_nDisasmTopAddress; // BUGFIX: g_nDisasmCurAddress;
3700
3701 if ((nNewAddress & (nDelta-1)) == 0)
3702 nNewAddress -= nDelta;
3703 else
3704 nNewAddress -= (nNewAddress & (nDelta-1)); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned()
3705
3706 g_nDisasmTopAddress = nNewAddress & _6502_MEM_END; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00
3707 }
3708}
3709
3710
3711//===========================================================================

Callers 4

CmdCursorLineUpFunction · 0.85
CmdCursorPageUpFunction · 0.85
CmdCursorPageUp256Function · 0.85
CmdCursorPageUp4KFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected