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

Function _CursorMoveDownAligned

source/Debugger/Debug.cpp:3662–3683  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3660// nDelta must be a power of 2
3661//===========================================================================
3662void _CursorMoveDownAligned ( int nDelta )
3663{
3664 if (g_iWindowThis == WINDOW_DATA)
3665 {
3666 if (g_aMemDump[0].eDevice == DEV_MEMORY)
3667 {
3668 g_aMemDump[0].nAddress += nDelta;
3669 g_aMemDump[0].nAddress &= _6502_MEM_END;
3670 }
3671 }
3672 else
3673 {
3674 int nNewAddress = g_nDisasmTopAddress; // BUGFIX: g_nDisasmCurAddress;
3675
3676 if ((nNewAddress & (nDelta-1)) == 0)
3677 nNewAddress += nDelta;
3678 else
3679 nNewAddress += (nDelta - (nNewAddress & (nDelta-1))); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned()
3680
3681 g_nDisasmTopAddress = nNewAddress & _6502_MEM_END; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00
3682 }
3683}
3684
3685// nDelta must be a power of 2
3686//===========================================================================

Callers 4

CmdCursorLineDownFunction · 0.85
CmdCursorPageDownFunction · 0.85
CmdCursorPageDown256Function · 0.85
CmdCursorPageDown4KFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected