From: Alan Cox Date: Fri, 16 Nov 2018 22:50:05 +0000 (+0000) Subject: sam: add a cursor X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0d377ff304cf1d33a2d83ed263b13fa3f83ccced;p=FUZIX.git sam: add a cursor --- diff --git a/Kernel/platform-sam/sam_vt.s b/Kernel/platform-sam/sam_vt.s index 9b8ae609..d6811952 100644 --- a/Kernel/platform-sam/sam_vt.s +++ b/Kernel/platform-sam/sam_vt.s @@ -222,10 +222,50 @@ _vtwipe: ; TODO ; _cursor_on: -_cursor_off: + pop hl + pop de + push de + push hl + call base_addr + ex de,hl + inc h ; Move on 6 scan lines + inc h ; So the cursor is bottom 2 + inc h + ld (cursorpos),hl + jr xor_cursor +; +; Remove our cursor +; _cursor_disable: +_cursor_off: + ld hl,(cursorpos) + ld a,h + inc a + ret z + ld a,#255 + ld (cursorpos),a +xor_cursor: + call map_video + call xorhl + ld de,#127 + add hl,de + call xorhl + jp unmap_video + +xorhl: + ld a,(hl) + cpl + ld (hl),a + inc hl + ld a,(hl) + cpl + ld (hl),a + ret + _vtattr_notify: ret colours: .word 0 +cursorpos: + .word 0xFFFF