From: Alan Cox Date: Thu, 18 Dec 2014 11:55:47 +0000 (+0000) Subject: vt: Fixes for the simple vt code X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2c8af3abdf173598e68c812788b36e7e3e56f7a7;p=FUZIX.git vt: Fixes for the simple vt code Work around what appears to be an sdcc bug Allow cursor_off to be called first without writing over address 0 --- diff --git a/Kernel/vt.c b/Kernel/vt.c index bd2e7997..71353f96 100644 --- a/Kernel/vt.c +++ b/Kernel/vt.c @@ -216,12 +216,14 @@ static unsigned char csave; static uint8_t *char_addr(unsigned int y1, unsigned char x1) { - return VT_BASE + VT_WIDTH * y1 + x1; + /* See SDCC bug #2332 */ + return VT_BASE + VT_WIDTH * y1 + (uint16_t)x1; } void cursor_off(void) { - *cpos = csave; + if (cpos) + *cpos = csave; } void cursor_on(int8_t y, int8_t x)