md-modules icon indicating copy to clipboard operation
md-modules copied to clipboard

MD Debugger: Console's base VRAM address can only be multiple of $4000

Open vladikcomper opened this issue 1 year ago • 0 comments

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 "%" token is encountered (or 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.

vladikcomper avatar Dec 28 '24 18:12 vladikcomper