ubee: Fix detection of colour non premium machines
authorAlan Cox <alan@linux.intel.com>
Sun, 6 May 2018 23:17:08 +0000 (00:17 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 6 May 2018 23:17:08 +0000 (00:17 +0100)
We now get the attributes right but something is up with the text

Kernel/platform-ubee/README
Kernel/platform-ubee/crt0.s
Kernel/platform-ubee/ubee.h
Kernel/platform-ubee/vt.c

index 4cce871..a216c2e 100644 (file)
@@ -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
index 49ed5ff..69bb3f8 100644 (file)
@@ -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
index 1335087..a98ddce 100644 (file)
@@ -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
index da59cec..868b25b 100644 (file)
@@ -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