From 3468c2d5631884aaabffe9ba36390de60d120c0d Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Oct 2015 13:43:30 +0100 Subject: [PATCH] nc100: draw in the right location --- Kernel/platform-nc100/nc100.s | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Kernel/platform-nc100/nc100.s b/Kernel/platform-nc100/nc100.s index b3c19660..82b31d8d 100644 --- a/Kernel/platform-nc100/nc100.s +++ b/Kernel/platform-nc100/nc100.s @@ -560,6 +560,27 @@ _cursor_off: jr cursor_do +; +; Turn a co-ordinate pair in DE into an address in DE +; and map the video. Unlike the font version we work in bytes across +; (for NC100, NC200 needs doing) +; +addr_de_pix: + ld a, #0x43 + out (0x11), a + + ld b, d ; save X + ld a, e ; turn Y into a pixel row + sla d ; X is in 0-63, rotate it left twice + sla d + srl a ; multiple by 64 A into DE + rr d ; roll two bits into D pushing the X bits + srl a ; back where they came from + rr d + add #VIDEO_BASEH ; screen start (0x7000 or 0x6000 for NC200) + ld e, d + ld d, a + ret ; ; For NC100 (NC200 needs doing) ; @@ -578,7 +599,7 @@ _video_cmd: ld d,(hl) inc hl inc hl - call addr_de ; turn DE into screen address (HL is kept) + call addr_de_pix ; turn DE into screen address (HL is kept) nextline: push de nextop: -- 2.34.1