zx128: use the ROM font
authorAlan Cox <alan@linux.intel.com>
Fri, 13 Feb 2015 15:40:28 +0000 (15:40 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 13 Feb 2015 15:40:28 +0000 (15:40 +0000)
Saves us more memory

Kernel/platform-zx128/config.h
Kernel/platform-zx128/zxvideo.s

index caec8a4..4d352cd 100644 (file)
@@ -27,9 +27,9 @@
 
 /* Video terminal, not a serial tty */
 #define CONFIG_VT
-/* We want the 8x8 font */
-#define CONFIG_FONT8X8
-#define CONFIG_FONT8X8SMALL
+/* We don't need a font: We will use the ROM font */
+#undef CONFIG_FONT8X8
+#undef CONFIG_FONT8X8SMALL
 
 /* We have 1 bank at C000 with 6 possible pages to map.
    Our choice should be CONFIG_BANK_FIXED, but we are.
@@ -37,9 +37,9 @@
 
 #undef CONFIG_BANK_FIXED
 
-/* 6 16K banks, 1 is for kernel needs */
-#define MAX_MAPS       5
-#define MAP_SIZE       0x4000U
+/* We have two mappings from our 128K of memory */
+#define MAX_MAPS       2
+#define MAP_SIZE       0x8000U
 
 /* Banks as reported to user space */
 #define CONFIG_BANKS   1
index 6baaf9f..f411735 100644 (file)
@@ -2,7 +2,7 @@
 ;        zx128 vt primitives
 ;
 
-        .module zx128
+        .module zxvideo
 
         ; exported symbols
         .globl _plot_char
@@ -14,8 +14,6 @@
         .globl _clear_across
         .globl _do_beep
 
-        .globl _fontdata_8x8
-
         .area _VIDEO
 
         ; colors are ignored everywhere for now
@@ -47,8 +45,18 @@ _plot_char:
 
         call videopos
 
+       ;
+       ;       TODO: Map char 0x60 to a grave accent bitmap rather
+       ;       than fudging with a quote
+       ;
+
         ld b, #0            ; calculating offset in font table
         ld a, c
+       cp #0x60
+       jr nz, nofiddle
+       ld a, #0x27
+nofiddle:
+       or a                ; clear carry
         rla
         rl b
         rla
@@ -57,9 +65,10 @@ _plot_char:
         rl b
         ld c, a
 
-        ld hl, #_fontdata_8x8 - 256
+        ld hl, #0x3C00     ; ROM font
         add hl, bc          ; hl points to first byte of char data
 
+
         ; printing
         ld c, #8
 plot_char_loop: