From 862578f4f5bde51eb9c770d3731a5d70b8a79840 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 5 Nov 2014 22:37:17 +0000 Subject: [PATCH] msx2: Make the cursor work I was clearly not awake pasting the initial cursor code together. This gives us a correct text rendering, except for the mysterious double copy which presumably is a VDP set up error of some kind. --- Kernel/platform-msx2/vdp.s | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Kernel/platform-msx2/vdp.s b/Kernel/platform-msx2/vdp.s index f17645d7..7bb0c5b7 100644 --- a/Kernel/platform-msx2/vdp.s +++ b/Kernel/platform-msx2/vdp.s @@ -123,6 +123,7 @@ plotit: ld b, #0x40 ; writing call _videopos ld a, c +plotit2: ld bc, (_vdpport) out (c), l ; address out (c), h ; address | 0x40 @@ -256,12 +257,23 @@ _cursor_on: push de push hl ld (cursorpos), de - ld c, #'_' - call plotit - ret + ld b, #0x00 ; reading + call _videopos + ld a, c + ld bc, (_vdpport) + out (c), l ; address + out (c), h ; address + dec c + in a, (c) ; character + ld (cursorpeek), a ; save it away + set 6, h ; make it a write command + ld a, #'_' ; write the cursor + jp plotit2 + _cursor_off: ld de, (cursorpos) - ld c, #' ' + ld a, (cursorpeek) + ld c, a call plotit ret ; @@ -269,3 +281,4 @@ _cursor_off: ; .area _DATA cursorpos: .dw 0 +cursorpeek: .db 0 -- 2.34.1