mtx: include a 6x8 font and upload it into the VDP
authorAlan Cox <alan@linux.intel.com>
Tue, 16 Dec 2014 23:15:08 +0000 (23:15 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 16 Dec 2014 23:15:08 +0000 (23:15 +0000)
We can't it seems rely upon the firmware to have done this for us.

Kernel/platform-mtx/config.h
Kernel/platform-mtx/crt0.s
Kernel/platform-mtx/mtx.s
Kernel/platform-mtx/vdp.s

index a17889d..22956b8 100644 (file)
@@ -14,6 +14,8 @@
 #define CONFIG_VT
 /* Multiple VT support */
 #define CONFIG_VT_MULTI
+/* We need a 6x8 font to upload to the vdp */
+#define CONFIG_FONT6X8
 /* Fixed banking */
 #define CONFIG_BANK_FIXED
 /* 10 48K banks, 1 is kernel */
index 69f8a43..8896552 100644 (file)
@@ -19,6 +19,7 @@
         .area _GSINIT
         .area _GSFINAL
        .area _DISCARD
+       .area _FONT
         .area _COMMONMEM
 
         ; imported symbols
@@ -28,6 +29,8 @@
         .globl s__INITIALIZER
         .globl s__DATA
         .globl l__DATA
+        .globl s__FONT
+        .globl l__FONT
         .globl s__DISCARD
         .globl l__DISCARD
         .globl s__COMMONMEM
@@ -49,6 +52,10 @@ init:
        ld de, #s__COMMONMEM
        ld bc, #l__COMMONMEM
        ldir
+       ; font
+       ld de, #s__FONT
+       ld bc, #l__FONT
+       ldir
        ; and the discard
        ld de, #s__DISCARD
        ld bc, #l__DISCARD
index 789f53f..28c7188 100644 (file)
@@ -39,6 +39,7 @@
             .globl interrupt_handler
 
            .globl vdpinit
+           .globl vdpload
            .globl _vtinit
 
             .globl outcharhex
@@ -169,6 +170,7 @@ init_hardware:
 
            ; Program the video engine
            call vdpinit
+           call vdpload
 
            ; 08 is channel 0, which is input from VDP
             ; 09 is channel 1, output for DART ser 0 } fed 4MHz/13
index e9938de..7245d88 100644 (file)
@@ -13,8 +13,9 @@
            .globl _cursor_off
            .globl _cursor_on
            .globl _plot_char
+           .globl vdpload
 
-
+           .globl _fontdata_6x8
 ;
 ;      Don't provide the global vt hooks in vdp1.s, we want to wrap them
 ;      for our dual monitor setup
@@ -23,6 +24,36 @@ VDP_DIRECT   .equ    0
 
            .area _COMMONMEM
 
+;
+;      Font uploader
+;
+vdpload:
+            ld hl, #_fontdata_6x8
+            ; Remember the first 32 symbols (256 bytes) are unused
+            ld de, #0x4000 + 0x1900    ; write to 0x4000 + fontbase
+            ld bc, (_vdpport)          ; port
+            ld b, #0                   ; but we want 256 not the rows
+            ld a, #3
+vdploadl:
+            push af
+vdploadl2:
+            out (c), e         ; select target
+            out (c), d
+            dec c              ; write font byte
+            ld a, (hl)
+            rlca               ; font packed left
+            rlca
+            out (c), a
+            inc c
+            inc de
+            inc hl
+            djnz vdploadl2     ; 256 bytes done
+            pop af
+            dec a
+            jr nz, vdploadl    ; 768 bytes total
+            ret
+
+
 ;
 ;      Turn co-ordinates D,E into offset HL
 ;
@@ -49,7 +80,6 @@ videopos6:
             and #7                     ; wrap
             ld h, a
             ret
-
 ;
 ;      This is a bit different as we support both the vdp1 and the 6845
 ; port