From 2c8af3abdf173598e68c812788b36e7e3e56f7a7 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 18 Dec 2014 11:55:47 +0000 Subject: [PATCH] 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 --- Kernel/vt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.34.1