md-modules
md-modules copied to clipboard
MD Debugger: Console's base VRAM address can only be multiple of $4000
It appears that Console subsystem (used by MD Debugger and MD Shell) is implemented in such a way that it only properly works with base VRAM addresses that are multiples of 4 (e.g. $0000, $4000, $8000, $C000).
Attempts to use other valid base VRAM addresses (e.g. $E000) will break as soon as "%Console.BreakLine, Console.WriteLine are used), because of "plane boundary" protection implemented here:
https://github.com/vladikcomper/md-modules/blob/84a9a3d50a53f628d2aab91fc851ba00b6a48337/modules/core/Console.asm#L362-L366
(Also see Console_StartNewLine)
This effectively subtracts $2000 (1<<13) from the base address if it's not multiple of $4000.