From: Alan Cox Date: Tue, 16 Dec 2014 23:15:08 +0000 (+0000) Subject: mtx: include a 6x8 font and upload it into the VDP X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=42111bfedebc50b5dbb3c23be78a9dd55b7b929d;p=FUZIX.git mtx: include a 6x8 font and upload it into the VDP We can't it seems rely upon the firmware to have done this for us. --- diff --git a/Kernel/platform-mtx/config.h b/Kernel/platform-mtx/config.h index a17889d3..22956b80 100644 --- a/Kernel/platform-mtx/config.h +++ b/Kernel/platform-mtx/config.h @@ -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 */ diff --git a/Kernel/platform-mtx/crt0.s b/Kernel/platform-mtx/crt0.s index 69f8a43d..8896552d 100644 --- a/Kernel/platform-mtx/crt0.s +++ b/Kernel/platform-mtx/crt0.s @@ -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 diff --git a/Kernel/platform-mtx/mtx.s b/Kernel/platform-mtx/mtx.s index 789f53fa..28c71886 100644 --- a/Kernel/platform-mtx/mtx.s +++ b/Kernel/platform-mtx/mtx.s @@ -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 diff --git a/Kernel/platform-mtx/vdp.s b/Kernel/platform-mtx/vdp.s index e9938de0..7245d886 100644 --- a/Kernel/platform-mtx/vdp.s +++ b/Kernel/platform-mtx/vdp.s @@ -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