From: Alan Cox Date: Sun, 6 May 2018 23:17:08 +0000 (+0100) Subject: ubee: Fix detection of colour non premium machines X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0bac5ec56e4004d40df4a2c7ec5371b36b5d8d62;p=FUZIX.git ubee: Fix detection of colour non premium machines We now get the attributes right but something is up with the text --- diff --git a/Kernel/platform-ubee/README b/Kernel/platform-ubee/README index 4cce8719..a216c2e7 100644 --- a/Kernel/platform-ubee/README +++ b/Kernel/platform-ubee/README @@ -99,6 +99,7 @@ To Do: - Fix reboot/panic logic - Keyboard repeat - Graphics not just vt interfaces +- Premium models hang somewhere as if there's a memory banking bug Longer Term - RAM based fonts (load the ROM one into RAM diff --git a/Kernel/platform-ubee/crt0.s b/Kernel/platform-ubee/crt0.s index 49ed5ffd..69bb3f8f 100644 --- a/Kernel/platform-ubee/crt0.s +++ b/Kernel/platform-ubee/crt0.s @@ -85,20 +85,21 @@ not256tc: ; Are we a premium model out (0x1c),a ; Set in a,(0x1c) ; Read cp #0x10 ; If reads back we are premium - jr z, premium_model - ld a,#0x40 ; Colour control register - out (0x08),a ; Set - in a,(0x08) ; Read - cp #0x40 - jr nz, unsupported_model; not colour - xor a - jr colour_standard -; -; uBee Premium Board -; -premium_model: ld a,#1 -colour_standard: + jr z, set_model + dec a + ; Colour ? + ld hl,#0xFFFF ; Out of sight end of video + out (0x08),a ; Select text + ld (hl),a ; Clear it + ld a,#0x40 ; Select colour (no-op if absent) + out (0x08),a + ld (hl),a ; Set it + xor a + out (0x08),a ; Back to text + cp (hl) ; Was it affected ? + jr nz, unsupported_model ; Yes -> no colour support +set_model: ld (_ubee_model),a ; model - 1 premium 0 colour standard ld a,#0x0C ; ROMs off video off out (0x50),a diff --git a/Kernel/platform-ubee/ubee.h b/Kernel/platform-ubee/ubee.h index 13350872..a98ddce1 100644 --- a/Kernel/platform-ubee/ubee.h +++ b/Kernel/platform-ubee/ubee.h @@ -5,6 +5,7 @@ extern uint8_t ubee_model; #define UBEE_BASIC 0 #define UBEE_PREMIUM 1 #define UBEE_256TC 2 +#define UBEE_BASIC_MONO 3 extern uint8_t ubee_parallel; #define UBEE_PARALLEL_LPR 0 diff --git a/Kernel/platform-ubee/vt.c b/Kernel/platform-ubee/vt.c index da59cec4..868b25b9 100644 --- a/Kernel/platform-ubee/vt.c +++ b/Kernel/platform-ubee/vt.c @@ -53,7 +53,7 @@ void vtattr_notify(void) if (vtattr & VTA_INVERSE) vtattrib |= 0x40; /* 5 4 must be zero 3-0 are extended font select -> 0 for now */ - } else if (ubee_model == UBEE_PREMIUM) { + } else if (ubee_model == UBEE_PREMIUM || ubee_model == UBEE_BASIC) { if (vtattr & VTA_INVERSE) vtattrib = (((uint16_t)vtpaper) << 8) | (((uint16_t)vtink) << 12); else