.module Cursor ;------------------------------------------------------------------------------- ;@doc:routine ; ; === Vdu.Text.Cursor.Left === ; ; Moves the cursor backwards (VDU 8). ; ;@doc:end ;------------------------------------------------------------------------------- Left.Routine push bc ld a,(Text.Bounds.MinX) ld b,a dec b ld a,(Text.Cursor.X) dec a cp b pop bc jr nz,+ ld a,(Text.Bounds.MaxX) + ld (Text.Cursor.X),a ret nz jp Up ;------------------------------------------------------------------------------- ;@doc:routine ; ; === Vdu.Text.Cursor.Right === ; ; Moves the cursor forwards (VDU 9). ; ; DESTROYED: ; * AF. ; ;@doc:end ;------------------------------------------------------------------------------- Right.Routine push bc ld a,(Text.Bounds.MaxX) ld b,a inc b ld a,(Text.Cursor.X) inc a cp b pop bc jr nz,+ ld a,(Text.Bounds.MinX) + ld (Text.Cursor.X),a ret nz jp Down ;------------------------------------------------------------------------------- ;@doc:routine ; ; === Vdu.Text.Cursor.Down === ; ; Moves the cursor down (VDU 10). ; ; DESTROYED: ; * AF. ; ;@doc:end ;------------------------------------------------------------------------------- Down.Routine call Text.Scroll.DisplayPending ; + to pause listing. - .fcall "Keypad.GetCurrentKey" cp %11000000 jr z,- push bc ld a,(Text.PageMode) or a jr z,NoPageMode ld a,(Text.Bounds.MinY) ld b,a ld a,(Text.Bounds.MaxY) sub b ld b,a ld a,(Text.Page.LinesOutput) cp b jr c,NoPagePause ; Auto-paging mode. push hl ld hl,%1000000000000000 call Text.Cursor.ResetBlink call Text.BeforeCursorDraw - call Text.Cursor.PutBlinking halt .fcall "Keypad.GetEscapeState" jr z,+ jr c,PageModeEscaped + .fcall "Keypad.GetCurrentKey" cp l jr nz,- ld l,h or a jr z,- PageModeEscaped call Text.AfterCursorDraw pop hl xor a NoPagePause inc a ld (Text.Page.LinesOutput),a NoPageMode ld a,(Text.Bounds.MaxY) ld b,a inc b ld a,(Text.Cursor.Y) inc a cp b pop bc jr nz,+ ld a,(Text.Bounds.MaxY) + ld (Text.Cursor.Y),a ret nz ld a,(StateFlags) or 1<