From: Lawrence S. <ljs...@us...> - 2020-06-11 03:23:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via d1543f541ff355cec9ad59bb3aebcc3a3acebb76 (commit) from e52380c54ffca72358d622f7b852c75a527178b1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d1543f541ff355cec9ad59bb3aebcc3a3acebb76 Author: Lawrence Sebald <ljs...@us...> Date: Wed Jun 10 23:23:09 2020 -0400 Add fb_console_naomi, which uses minifont to draw dbgio to the framebuffer. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/init.c | 3 ++- kernel/arch/dreamcast/util/Makefile | 2 ++ .../util/{fb_console.c => fb_console_naomi.c} | 26 ++++++++++++---------- 3 files changed, 18 insertions(+), 13 deletions(-) copy kernel/arch/dreamcast/util/{fb_console.c => fb_console_naomi.c} (81%) diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index f878f7a..e52c3ae 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -47,7 +47,8 @@ dbgio_handler_t * dbgio_handlers[] = { &dbgio_null, &dbgio_fb #else - &dbgio_null + &dbgio_null, + &dbgio_fb #endif }; int dbgio_handler_cnt = sizeof(dbgio_handlers) / sizeof(dbgio_handler_t *); diff --git a/kernel/arch/dreamcast/util/Makefile b/kernel/arch/dreamcast/util/Makefile index 5628834..e09d8bd 100644 --- a/kernel/arch/dreamcast/util/Makefile +++ b/kernel/arch/dreamcast/util/Makefile @@ -9,6 +9,8 @@ SUBDIRS = ifneq ($(KOS_SUBARCH), naomi) OBJS += fb_console.o +else + OBJS += fb_console_naomi.o endif include $(KOS_BASE)/Makefile.prefab diff --git a/kernel/arch/dreamcast/util/fb_console.c b/kernel/arch/dreamcast/util/fb_console_naomi.c similarity index 81% copy from kernel/arch/dreamcast/util/fb_console.c copy to kernel/arch/dreamcast/util/fb_console_naomi.c index 745ddf2..75b33b8 100644 --- a/kernel/arch/dreamcast/util/fb_console.c +++ b/kernel/arch/dreamcast/util/fb_console_naomi.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## - util/fb_console.c - Copyright (C) 2009 Lawrence Sebald + util/fb_console_naomi.c + Copyright (C) 2009, 2020 Lawrence Sebald */ @@ -10,29 +10,31 @@ #include <kos/dbgio.h> #include <kos/string.h> #include <dc/fb_console.h> -#include <dc/biosfont.h> #include <dc/video.h> +#include <dc/minifont.h> -/* This is a very simple dbgio interface for doing debug to the framebuffer with - the biosfont functionality. Basically, this was written to aid in debugging - the network stack, and I figured other people would probably get some use out - of it as well. */ +/* This is a modified version of fb_console to use a built-in font, rather + than trying to use the romfont. I haven't yet figured out if the NAOMI has + an accessible romfont or where it is, so this is the substitute. */ static uint16 *fb; static int fb_w, fb_h; static int cur_x, cur_y; static int min_x, min_y, max_x, max_y; -#define FONT_CHAR_WIDTH 12 -#define FONT_CHAR_HEIGHT 24 +#define FONT_CHAR_WIDTH 8 +#define FONT_CHAR_HEIGHT 16 + +#define FONT_CHARS_PER_LINE 32 +#define FONT_LINES 3 +#define FONT_WIDTH 256 +#define FONT_HEIGHT 48 static int fb_detected() { return 1; } static int fb_init() { - bfont_set_encoding(BFONT_CODE_ISO8859_1); - /* Assume we're using 640x480x16bpp */ fb = NULL; fb_w = 640; @@ -68,7 +70,7 @@ static int fb_write(int c) { t = vram_s; if(c != '\n') { - bfont_draw(t + cur_y * fb_w + cur_x, fb_w, 1, c); + minifont_draw(t + cur_y * fb_w + cur_x, fb_w, c); cur_x += FONT_CHAR_WIDTH; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |