From 8ab81aa3792f4c8037866e5eb1ca6b793a3162e9 Mon Sep 17 00:00:00 2001 From: David Kuder Date: Tue, 18 Apr 2023 15:45:24 -0400 Subject: [PATCH] Use Videx Font ROM format for 80 column card --- common/flash.h | 6 +++++- vga/render.c | 2 +- vga/render_80col.c | 2 +- vga/render_test.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/flash.h b/common/flash.h index 774fbbe..691e740 100644 --- a/common/flash.h +++ b/common/flash.h @@ -63,8 +63,12 @@ #define FLASH_FONT_EXTRA26 FLASH_FONT(0x26) #define FLASH_FONT_EXTRA27 FLASH_FONT(0x27) +// Videx Font +#define FLASH_VIDEX_SIZE (4*1024) +#define FLASH_VIDEX_BASE (FLASH_FONT_BASE - FLASH_VIDEX_SIZE) + // Firmware for $C000-$CFFF #define FLASH_6502_SIZE (4*1024) -#define FLASH_6502_BASE (FLASH_FONT_BASE - FLASH_6502_SIZE) +#define FLASH_6502_BASE (FLASH_VIDEX_BASE - FLASH_6502_SIZE) extern void flash_reboot() __attribute__ ((noreturn)); diff --git a/vga/render.c b/vga/render.c index 010c9a5..ca59e9f 100644 --- a/vga/render.c +++ b/vga/render.c @@ -112,7 +112,7 @@ void DELAYED_COPY_CODE(render_init)() { terminal_tbcolor = 0xf0; terminal_border = 0x00; - memcpy(terminal_character_rom, (void*)FLASH_FONT_APPLE_IIE, 4096); + memcpy(terminal_character_rom, (void*)FLASH_VIDEX_BASE, 4096); memset(status_line, 0, sizeof(status_line)); terminal_clear_screen(); diff --git a/vga/render_80col.c b/vga/render_80col.c index c289f52..15a95a0 100644 --- a/vga/render_80col.c +++ b/vga/render_80col.c @@ -17,7 +17,7 @@ uint8_t terminal_width = 80; uint8_t terminal_height = 24; static inline uint_fast8_t char_terminal_bits(uint_fast8_t ch, uint_fast8_t glyph_line) { - uint_fast8_t bits = terminal_character_rom[terminal_charset | (((uint_fast16_t)ch & 0x7f) << 3) | glyph_line]; + uint_fast8_t bits = terminal_character_rom[terminal_charset | (((uint_fast16_t)ch & 0x7f) << 4) | glyph_line]; if(ch & 0x80) { return (bits & 0x7f) ^ 0x7f; diff --git a/vga/render_test.c b/vga/render_test.c index 649cf17..9316de0 100644 --- a/vga/render_test.c +++ b/vga/render_test.c @@ -46,7 +46,7 @@ void DELAYED_COPY_CODE(render_about_init)() { } static inline uint_fast8_t char_test_bits(uint_fast8_t ch, uint_fast8_t glyph_line) { - uint_fast8_t bits = terminal_character_rom[((uint_fast16_t)(ch & 0x7f) << 3) | glyph_line | 0x400]; + uint_fast8_t bits = terminal_character_rom[((uint_fast16_t)(ch & 0x7f) << 4) | glyph_line]; return bits & 0x7f; }