From 4e80ba7ea882d5159fd76f777a0d87f8c69b6ba7 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 25 Sep 2024 10:37:14 +0200 Subject: [PATCH] sync back from ui4x --- Makefile | 14 +-- src/config.h | 2 +- src/ui48_ncurses.h | 6 - src/ui48_sdl2.h | 6 - ...aps_big_font.h => ui4x_bitmaps_big_font.h} | 6 +- ...i48_bitmaps_misc.h => ui4x_bitmaps_misc.h} | 6 +- ...small_font.h => ui4x_bitmaps_small_font.h} | 114 +++++++++--------- src/{ui48_common.c => ui4x_common.c} | 52 ++++---- src/{ui48_common.h => ui4x_common.h} | 8 +- src/{ui48_config.c => ui4x_config.c} | 4 +- src/{ui48_config.h => ui4x_config.h} | 6 +- src/{ui48_emulator.c => ui4x_emulator.c} | 4 +- src/{ui48_emulator.h => ui4x_emulator.h} | 8 +- src/{ui48_inner.h => ui4x_inner.h} | 22 ++-- src/{ui48_main.c => ui4x_main.c} | 14 +-- src/{ui48_ncurses.c => ui4x_ncurses.c} | 12 +- src/ui4x_ncurses.h | 6 + src/{ui48_sdl2.c => ui4x_sdl2.c} | 12 +- src/ui4x_sdl2.h | 6 + 19 files changed, 154 insertions(+), 154 deletions(-) delete mode 100644 src/ui48_ncurses.h delete mode 100644 src/ui48_sdl2.h rename src/{ui48_bitmaps_big_font.h => ui4x_bitmaps_big_font.h} (97%) rename src/{ui48_bitmaps_misc.h => ui4x_bitmaps_misc.h} (99%) rename src/{ui48_bitmaps_small_font.h => ui4x_bitmaps_small_font.h} (78%) rename src/{ui48_common.c => ui4x_common.c} (96%) rename src/{ui48_common.h => ui4x_common.h} (79%) rename src/{ui48_config.c => ui4x_config.c} (99%) rename src/{ui48_config.h => ui4x_config.h} (92%) rename src/{ui48_emulator.c => ui4x_emulator.c} (98%) rename src/{ui48_emulator.h => ui4x_emulator.h} (94%) rename src/{ui48_inner.h => ui4x_inner.h} (84%) rename src/{ui48_main.c => ui4x_main.c} (96%) rename src/{ui48_ncurses.c => ui4x_ncurses.c} (98%) create mode 100644 src/ui4x_ncurses.h rename src/{ui48_sdl2.c => ui4x_sdl2.c} (99%) create mode 100644 src/ui4x_sdl2.h diff --git a/Makefile b/Makefile index a84517f..39bcc2f 100644 --- a/Makefile +++ b/Makefile @@ -50,12 +50,12 @@ DOTOS = src/cpu.o \ src/serial.o \ src/x_func.o -DOTOS_UI48 = src/ui48_config.o \ - src/ui48_common.o \ - src/ui48_sdl2.o \ - src/ui48_ncurses.o \ - src/ui48_emulator.o \ - src/ui48_main.o +DOTOS_UI4x = src/ui4x_config.o \ + src/ui4x_common.o \ + src/ui4x_sdl2.o \ + src/ui4x_ncurses.o \ + src/ui4x_emulator.o \ + src/ui4x_main.o MSFS = src/MSFs/cpu.msf \ src/MSFs/debug.msf \ @@ -120,7 +120,7 @@ all: libChf/libChf.a dist/saturn dist/saturn.cat docs libChf/libChf.a: make -C libChf -dist/saturn: $(DOTOS) $(DOTOS_UI48) libChf/libChf.a +dist/saturn: $(DOTOS) $(DOTOS_UI4x) libChf/libChf.a $(CC) $^ -o $@ $(CFLAGS) $(LIBS) $(SDLLIBS) $(NCURSESLIBS) dist/pack: src/pack.o src/disk_io.o src/debug.o libChf/libChf.a diff --git a/src/config.h b/src/config.h index 8229ce8..ee1fc1f 100644 --- a/src/config.h +++ b/src/config.h @@ -126,7 +126,7 @@ #include -#include "ui48_config.h" +#include "ui4x_config.h" /* CHF_EXTENDED_INFO: Define this symbol if extended information is desired during condition diff --git a/src/ui48_ncurses.h b/src/ui48_ncurses.h deleted file mode 100644 index c914649..0000000 --- a/src/ui48_ncurses.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _UI48_NCURSES_H -#define _UI48_NCURSES_H 1 - -extern void setup_frontend_ncurses( void ); - -#endif /* _UI48_NCURSES_H */ diff --git a/src/ui48_sdl2.h b/src/ui48_sdl2.h deleted file mode 100644 index e2fefc2..0000000 --- a/src/ui48_sdl2.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _UI48_SDL2_H -#define _UI48_SDL2_H 1 - -extern void setup_frontend_sdl( void ); - -#endif /* _UI48_SDL2_H */ diff --git a/src/ui48_bitmaps_big_font.h b/src/ui4x_bitmaps_big_font.h similarity index 97% rename from src/ui48_bitmaps_big_font.h rename to src/ui4x_bitmaps_big_font.h index 88e8fc3..a70207e 100644 --- a/src/ui48_bitmaps_big_font.h +++ b/src/ui4x_bitmaps_big_font.h @@ -1,5 +1,5 @@ -#ifndef _UI48_BITMAPS_BIG_FONT_H -#define _UI48_BITMAPS_BIG_FONT_H 1 +#ifndef _UI4x_BITMAPS_BIG_FONT_H +#define _UI4x_BITMAPS_BIG_FONT_H 1 #define big_font_dot_width 8 #define big_font_dot_height 13 @@ -169,4 +169,4 @@ static unsigned char big_font_X_bits[] = { 51, 51, 30, 30, 12, 12, 30, 30, 51, 51, }; -#endif /* _UI48_BITMAPS_BIG_FONT_H 1 */ +#endif /* _UI4x_BITMAPS_BIG_FONT_H 1 */ diff --git a/src/ui48_bitmaps_misc.h b/src/ui4x_bitmaps_misc.h similarity index 99% rename from src/ui48_bitmaps_misc.h rename to src/ui4x_bitmaps_misc.h index b87be0a..43bc07a 100644 --- a/src/ui48_bitmaps_misc.h +++ b/src/ui4x_bitmaps_misc.h @@ -1,5 +1,5 @@ -#ifndef _UI48_BITMAPS_MISC_H -#define _UI48_BITMAPS_MISC_H 1 +#ifndef _UI4x_BITMAPS_MISC_H +#define _UI4x_BITMAPS_MISC_H 1 #define hp_width 96 #define hp_height 24 @@ -221,4 +221,4 @@ static unsigned char last_bitmap[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 }; -#endif /* _UI48_BITMAPS_MISC_H 1 */ +#endif /* _UI4x_BITMAPS_MISC_H 1 */ diff --git a/src/ui48_bitmaps_small_font.h b/src/ui4x_bitmaps_small_font.h similarity index 78% rename from src/ui48_bitmaps_small_font.h rename to src/ui4x_bitmaps_small_font.h index 4308510..1f8965a 100644 --- a/src/ui48_bitmaps_small_font.h +++ b/src/ui4x_bitmaps_small_font.h @@ -1,5 +1,5 @@ -#ifndef _UI48_BITMAPS_SMALL_FONT_H -#define _UI48_BITMAPS_SMALL_FONT_H 1 +#ifndef _UI4x_BITMAPS_SMALL_FONT_H +#define _UI4x_BITMAPS_SMALL_FONT_H 1 #define blank_width 4 #define blank_height 7 @@ -330,94 +330,94 @@ static unsigned char lcurly_bits[] = { 0x18, 0x04, 0x04, 0x02, 0x04, 0x04, 0x18 #define rcurly_height 7 static unsigned char rcurly_bits[] = { 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03 }; -#define sqr_gx_width 11 -#define sqr_gx_height 13 -static unsigned char sqr_gx_bits[] = { 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, 0x00, +#define sqr_48gx_width 11 +#define sqr_48gx_height 13 +static unsigned char sqr_48gx_bits[] = { 0x00, 0x03, 0x80, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x07, 0x00, 0x00, 0x66, 0x00, 0x14, 0x00, 0x08, 0x00, 0x14, 0x00, 0x53, 0x00, 0x21, 0x00 }; -#define root_gx_width 18 -#define root_gx_height 15 -static unsigned char root_gx_bits[] = { 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x53, 0xfe, 0x03, +#define root_48gx_width 18 +#define root_48gx_height 15 +static unsigned char root_48gx_bits[] = { 0x66, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x53, 0xfe, 0x03, 0x21, 0x02, 0x02, 0x00, 0x02, 0x00, 0x00, 0x99, 0x00, 0x00, 0x91, 0x00, 0x10, 0x91, 0x00, 0xa0, 0x50, 0x00, 0xc0, 0x60, 0x00, 0x80, 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x00 }; -#define pow10_gx_width 13 -#define pow10_gx_height 12 -static unsigned char pow10_gx_bits[] = { 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00, +#define pow10_48gx_width 13 +#define pow10_48gx_height 12 +static unsigned char pow10_48gx_bits[] = { 0x00, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x09, 0x32, 0x00, 0x4b, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x4a, 0x00, 0x32, 0x00 }; -#define exp_gx_width 13 -#define exp_gx_height 12 -static unsigned char exp_gx_bits[] = { 0x00, 0xfb, 0x00, 0xf6, 0x00, 0xe6, 0x00, 0xf6, 0x80, 0xed, 0x18, 0xe0, +#define exp_48gx_width 13 +#define exp_48gx_height 12 +static unsigned char exp_48gx_bits[] = { 0x00, 0xfb, 0x00, 0xf6, 0x00, 0xe6, 0x00, 0xf6, 0x80, 0xed, 0x18, 0xe0, 0x36, 0xe0, 0x36, 0xe0, 0x1f, 0xe0, 0x03, 0xe0, 0x13, 0xe0, 0x0e, 0xe0 }; -#define parens_gx_width 20 -#define parens_gx_height 12 -static unsigned char parens_gx_bits[] = { 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c, +#define parens_48gx_width 20 +#define parens_48gx_height 12 +static unsigned char parens_48gx_bits[] = { 0x0c, 0x00, 0x03, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x0c, 0x00, 0x03 }; -#define hash_gx_width 8 -#define hash_gx_height 12 -static unsigned char hash_gx_bits[] = { 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00 }; +#define hash_48gx_width 8 +#define hash_48gx_height 12 +static unsigned char hash_48gx_bits[] = { 0x00, 0x00, 0x48, 0x48, 0xfe, 0x24, 0x24, 0x7f, 0x12, 0x12, 0x00, 0x00 }; -#define bracket_gx_width 12 -#define bracket_gx_height 12 -static unsigned char bracket_gx_bits[] = { 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, +#define bracket_48gx_width 12 +#define bracket_48gx_height 12 +static unsigned char bracket_48gx_bits[] = { 0x0f, 0x0f, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x0f, 0x0f }; -#define under_gx_width 10 -#define under_gx_height 12 -static unsigned char under_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#define under_48gx_width 10 +#define under_48gx_height 12 +static unsigned char under_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03 }; -#define prog_gx_width 24 -#define prog_gx_height 12 -static unsigned char prog_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18, +#define prog_48gx_width 24 +#define prog_48gx_height 12 +static unsigned char prog_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x18, 0x8c, 0x81, 0x31, 0xc6, 0x00, 0x63, 0x63, 0x00, 0xc6, 0xc6, 0x00, 0x63, 0x8c, 0x81, 0x31, 0x18, 0xc3, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#define quote_gx_width 12 -#define quote_gx_height 12 -static unsigned char quote_gx_bits[] = { 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, +#define quote_48gx_width 12 +#define quote_48gx_height 12 +static unsigned char quote_48gx_bits[] = { 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#define curly_gx_width 14 -#define curly_gx_height 12 -static unsigned char curly_gx_bits[] = { 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30, +#define curly_48gx_width 14 +#define curly_48gx_height 12 +static unsigned char curly_48gx_bits[] = { 0x0c, 0x0c, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x03, 0x30, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x06, 0x18, 0x0c, 0x0c }; -#define colon_gx_width 8 -#define colon_gx_height 12 -static unsigned char colon_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00 }; +#define colon_48gx_width 8 +#define colon_48gx_height 12 +static unsigned char colon_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x00, 0x00, 0xc3, 0xc3, 0x00 }; -#define angle_gx_width 12 -#define angle_gx_height 12 -static unsigned char angle_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01, +#define angle_48gx_width 12 +#define angle_48gx_height 12 +static unsigned char angle_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x01, 0xb0, 0x03, 0x18, 0x03, 0x0c, 0x03, 0x06, 0x03, 0xff, 0x0f, 0xff, 0x0f }; -#define pi_gx_width 10 -#define pi_gx_height 12 -static unsigned char pi_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01, +#define pi_48gx_width 10 +#define pi_48gx_height 12 +static unsigned char pi_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x03, 0xff, 0x01, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0xcc, 0x00 }; -#define nl_gx_width 18 -#define nl_gx_height 12 -static unsigned char nl_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03, +#define nl_48gx_width 18 +#define nl_48gx_height 12 +static unsigned char nl_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x03, 0xf0, 0x00, 0x03, 0xfc, 0x00, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfc, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#define comma_gx_width 3 -#define comma_gx_height 12 -static unsigned char comma_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02 }; +#define comma_48gx_width 3 +#define comma_48gx_height 12 +static unsigned char comma_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x04, 0x04, 0x02 }; -#define arrow_gx_width 18 -#define arrow_gx_height 12 -static unsigned char arrow_gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00, +#define arrow_48gx_width 18 +#define arrow_48gx_height 12 +static unsigned char arrow_48gx_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xfc, 0x00, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#define equal_gx_width 8 -#define equal_gx_height 12 -static unsigned char equal_gx_bits[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00 }; +#define equal_48gx_width 8 +#define equal_48gx_height 12 +static unsigned char equal_48gx_bits[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00 }; -#endif /* _UI48_BITMAPS_SMALL_FONT_H 1 */ +#endif /* _UI4x_BITMAPS_SMALL_FONT_H 1 */ diff --git a/src/ui48_common.c b/src/ui4x_common.c similarity index 96% rename from src/ui48_common.c rename to src/ui4x_common.c index 82833e0..f0f64db 100644 --- a/src/ui48_common.c +++ b/src/ui4x_common.c @@ -1,17 +1,17 @@ #include -#include "ui48_common.h" -#include "ui48_inner.h" -#include "ui48_sdl2.h" -#include "ui48_ncurses.h" +#include "ui4x_common.h" +#include "ui4x_inner.h" +#include "ui4x_sdl2.h" +#include "ui4x_ncurses.h" letter_t small_font[ 128 ] = { {0, 0, 0 }, - {nl_gx_width, nl_gx_height, nl_gx_bits }, /* \x01 == \n gx */ - {comma_gx_width, comma_gx_height, comma_gx_bits }, /* \x02 == comma gx */ - {arrow_gx_width, arrow_gx_height, arrow_gx_bits }, /* \x03 == \-> gx */ - {equal_gx_width, equal_gx_height, equal_gx_bits }, /* \x04 == equal gx */ - {pi_gx_width, pi_gx_height, pi_gx_bits }, /* \x05 == pi gx */ + {nl_48gx_width, nl_48gx_height, nl_48gx_bits }, /* \x01 == \n gx */ + {comma_48gx_width, comma_48gx_height, comma_48gx_bits }, /* \x02 == comma gx */ + {arrow_48gx_width, arrow_48gx_height, arrow_48gx_bits }, /* \x03 == \-> gx */ + {equal_48gx_width, equal_48gx_height, equal_48gx_bits }, /* \x04 == equal gx */ + {pi_48gx_width, pi_48gx_height, pi_48gx_bits }, /* \x05 == pi gx */ {arrow_width, arrow_height, arrow_bits }, /* \x06 == left arrow */ {diff_width, diff_height, diff_bits }, /* \x07 == differential */ {integral_width, integral_height, integral_bits }, /* \x08 == integral */ @@ -25,19 +25,19 @@ letter_t small_font[ 128 ] = { {nl_width, nl_height, nl_bits }, /* \x10 == New Line # 16 */ {pi_width, pi_height, pi_bits }, /* \x11 == pi */ {angle_width, angle_height, angle_bits }, /* \x12 == angle */ - {sqr_gx_width, sqr_gx_height, sqr_gx_bits }, /* \x13 == sqr gx */ - {root_gx_width, root_gx_height, root_gx_bits }, /* \x14 == root gx */ - {pow10_gx_width, pow10_gx_height, pow10_gx_bits }, /* \x15 == pow10 gx */ - {exp_gx_width, exp_gx_height, exp_gx_bits }, /* \x16 == exp gx */ - {parens_gx_width, parens_gx_height, parens_gx_bits }, /* \x17 == ( ) gx */ - {hash_gx_width, hash_gx_height, hash_gx_bits }, /* \x18 == # gx */ - {bracket_gx_width, bracket_gx_height, bracket_gx_bits }, /* \x19 == [] gx */ - {under_gx_width, under_gx_height, under_gx_bits }, /* \x1a == _ gx */ - {prog_gx_width, prog_gx_height, prog_gx_bits }, /* \x1b == << >> gx */ - {quote_gx_width, quote_gx_height, quote_gx_bits }, /* \x1c == " " gx */ - {curly_gx_width, curly_gx_height, curly_gx_bits }, /* \x1d == {} gx */ - {colon_gx_width, colon_gx_height, colon_gx_bits }, /* \x1e == :: gx */ - {angle_gx_width, angle_gx_height, angle_gx_bits }, /* \x1f == angle gx */ + {sqr_48gx_width, sqr_48gx_height, sqr_48gx_bits }, /* \x13 == sqr gx */ + {root_48gx_width, root_48gx_height, root_48gx_bits }, /* \x14 == root gx */ + {pow10_48gx_width, pow10_48gx_height, pow10_48gx_bits }, /* \x15 == pow10 gx */ + {exp_48gx_width, exp_48gx_height, exp_48gx_bits }, /* \x16 == exp gx */ + {parens_48gx_width, parens_48gx_height, parens_48gx_bits }, /* \x17 == ( ) gx */ + {hash_48gx_width, hash_48gx_height, hash_48gx_bits }, /* \x18 == # gx */ + {bracket_48gx_width, bracket_48gx_height, bracket_48gx_bits }, /* \x19 == [] gx */ + {under_48gx_width, under_48gx_height, under_48gx_bits }, /* \x1a == _ gx */ + {prog_48gx_width, prog_48gx_height, prog_48gx_bits }, /* \x1b == << >> gx */ + {quote_48gx_width, quote_48gx_height, quote_48gx_bits }, /* \x1c == " " gx */ + {curly_48gx_width, curly_48gx_height, curly_48gx_bits }, /* \x1d == {} gx */ + {colon_48gx_width, colon_48gx_height, colon_48gx_bits }, /* \x1e == :: gx */ + {angle_48gx_width, angle_48gx_height, angle_48gx_bits }, /* \x1f == angle gx */ {blank_width, blank_height, blank_bits }, /* # 32 */ {0, 0, 0 }, {0, 0, 0 }, @@ -267,7 +267,7 @@ letter_t big_font[ 128 ] = { {0, 0, 0 } }; -color_t colors_sx[ NB_COLORS ] = { +color_t colors_48sx[ NB_COLORS ] = { { /* #ffffff */ .name = "white", @@ -470,7 +470,7 @@ color_t colors_sx[ NB_COLORS ] = { }, }; -color_t colors_gx[ NB_COLORS ] = { +color_t colors_48gx[ NB_COLORS ] = { { /* #FFFFFF */ .name = "white", @@ -673,7 +673,7 @@ color_t colors_gx[ NB_COLORS ] = { }, }; -button_t buttons_sx[ NB_KEYS ] = { +button_t buttons_48sx[ NB_KEYS ] = { {.name = "A", .x = 0, .y = 0, @@ -1468,7 +1468,7 @@ button_t buttons_sx[ NB_KEYS ] = { .sub = 0 }, }; -button_t buttons_gx[ NB_KEYS ] = { +button_t buttons_48gx[ NB_KEYS ] = { {.name = "A", .x = 0, .y = 0, diff --git a/src/ui48_common.h b/src/ui4x_common.h similarity index 79% rename from src/ui48_common.h rename to src/ui4x_common.h index 6cd00f8..84beb50 100644 --- a/src/ui48_common.h +++ b/src/ui4x_common.h @@ -1,7 +1,7 @@ -#ifndef _UI48_COMMON_H -#define _UI48_COMMON_H 1 +#ifndef _UI4x_COMMON_H +#define _UI4x_COMMON_H 1 -#include "ui48_config.h" +#include "ui4x_config.h" /*************************************************/ /* public API: if it's there it's used elsewhere */ @@ -15,4 +15,4 @@ extern void ( *ui_stop )( void ); extern void setup_ui( config_t* config ); extern void close_and_exit( void ); -#endif /* !_UI48_COMMON_H */ +#endif /* !_UI4x_COMMON_H */ diff --git a/src/ui48_config.c b/src/ui4x_config.c similarity index 99% rename from src/ui48_config.c rename to src/ui4x_config.c index ae1afdf..6397449 100644 --- a/src/ui48_config.c +++ b/src/ui4x_config.c @@ -10,10 +10,10 @@ #include -#include "ui48_config.h" +#include "ui4x_config.h" static config_t config = { - .progname = ( char* )"ui48", + .progname = ( char* )"ui4x", .model = MODEL_48GX, .verbose = false, diff --git a/src/ui48_config.h b/src/ui4x_config.h similarity index 92% rename from src/ui48_config.h rename to src/ui4x_config.h index 91ba659..3f7fd44 100644 --- a/src/ui48_config.h +++ b/src/ui4x_config.h @@ -1,5 +1,5 @@ -#ifndef _UI48_CONFIG_H -#define _UI48_CONFIG_H 1 +#ifndef _UI4x_CONFIG_H +#define _UI4x_CONFIG_H 1 #include @@ -52,4 +52,4 @@ typedef struct { /*************/ extern config_t* config_init( int argc, char* argv[] ); -#endif /* !_UI48_CONFIG_H */ +#endif /* !_UI4x_CONFIG_H */ diff --git a/src/ui48_emulator.c b/src/ui4x_emulator.c similarity index 98% rename from src/ui48_emulator.c rename to src/ui4x_emulator.c index e9ea20a..7093164 100644 --- a/src/ui48_emulator.c +++ b/src/ui4x_emulator.c @@ -2,8 +2,8 @@ #include #include -#include "ui48_config.h" -#include "ui48_emulator.h" +#include "ui4x_config.h" +#include "ui4x_emulator.h" #include "config.h" #include "keyb.h" diff --git a/src/ui48_emulator.h b/src/ui4x_emulator.h similarity index 94% rename from src/ui48_emulator.h rename to src/ui4x_emulator.h index 616b377..ea3711f 100644 --- a/src/ui48_emulator.h +++ b/src/ui4x_emulator.h @@ -1,9 +1,9 @@ -#ifndef _UI48_EMULATOR_H -#define _UI48_EMULATOR_H 1 +#ifndef _UI4x_EMULATOR_H +#define _UI4x_EMULATOR_H 1 #include -#include "ui48_config.h" +#include "ui4x_config.h" // Keys #define HPKEY_A 0 @@ -100,4 +100,4 @@ extern bool get_display_state( void ); extern void get_lcd_buffer( int* target ); extern int get_contrast( void ); -#endif /* !_UI48_EMULATOR_H */ +#endif /* !_UI4x_EMULATOR_H */ diff --git a/src/ui48_inner.h b/src/ui4x_inner.h similarity index 84% rename from src/ui48_inner.h rename to src/ui4x_inner.h index 2d0954e..593a536 100644 --- a/src/ui48_inner.h +++ b/src/ui4x_inner.h @@ -1,11 +1,11 @@ -#ifndef _UI48_INNER_H -#define _UI48_INNER_H 1 +#ifndef _UI4x_INNER_H +#define _UI4x_INNER_H 1 -#include "ui48_emulator.h" +#include "ui4x_emulator.h" -#include "ui48_bitmaps_misc.h" -#include "ui48_bitmaps_small_font.h" -#include "ui48_bitmaps_big_font.h" +#include "ui4x_bitmaps_misc.h" +#include "ui4x_bitmaps_small_font.h" +#include "ui4x_bitmaps_big_font.h" // Colors /* SX GX */ @@ -75,11 +75,11 @@ typedef struct button_t { extern letter_t small_font[ 128 ]; extern letter_t big_font[ 128 ]; -extern color_t colors_sx[ NB_COLORS ]; -extern color_t colors_gx[ NB_COLORS ]; +extern color_t colors_48sx[ NB_COLORS ]; +extern color_t colors_48gx[ NB_COLORS ]; -extern button_t buttons_sx[ NB_KEYS ]; -extern button_t buttons_gx[ NB_KEYS ]; +extern button_t buttons_48sx[ NB_KEYS ]; +extern button_t buttons_48gx[ NB_KEYS ]; #define small_ascent 8 #define small_descent 4 @@ -90,4 +90,4 @@ extern button_t buttons_gx[ NB_KEYS ]; extern int SmallTextWidth( const char* string, unsigned int length ); extern int BigTextWidth( const char* string, unsigned int length ); -#endif /* _UI48_INNER_H */ +#endif /* _UI4x_INNER_H */ diff --git a/src/ui48_main.c b/src/ui4x_main.c similarity index 96% rename from src/ui48_main.c rename to src/ui4x_main.c index 1830190..9614cdb 100644 --- a/src/ui48_main.c +++ b/src/ui4x_main.c @@ -6,15 +6,15 @@ #include #include -#include "ui48_config.h" -#include "ui48_emulator.h" -#include "ui48_common.h" +#include "ui4x_config.h" +#include "ui4x_emulator.h" +#include "ui4x_common.h" #include "config.h" #include "cpu.h" #include "monitor.h" -#define SPEED_HZ_UI 64 +#define UI_REFRESH_RATE_Hz 64 /* Chf condition codes (main program only) */ @@ -191,9 +191,9 @@ int main( int argc, char** argv ) */ struct itimerval it; it.it_interval.tv_sec = 0; - it.it_interval.tv_usec = 1000000 / SPEED_HZ_UI; - it.it_value.tv_sec = 0; - it.it_value.tv_usec = 1000000 / SPEED_HZ_UI; + it.it_interval.tv_usec = 1000000 / UI_REFRESH_RATE_Hz; + it.it_value.tv_sec = it.it_interval.tv_sec; + it.it_value.tv_usec = it.it_interval.tv_usec; setitimer( ITIMER_REAL, &it, ( struct itimerval* )0 ); if ( config.monitor ) diff --git a/src/ui48_ncurses.c b/src/ui4x_ncurses.c similarity index 98% rename from src/ui48_ncurses.c rename to src/ui4x_ncurses.c index 9465deb..6acddca 100644 --- a/src/ui48_ncurses.c +++ b/src/ui4x_ncurses.c @@ -14,13 +14,13 @@ #include -#include "ui48_config.h" -#include "ui48_emulator.h" -#include "ui48_common.h" -#include "ui48_inner.h" +#include "ui4x_config.h" +#include "ui4x_emulator.h" +#include "ui4x_common.h" +#include "ui4x_inner.h" -#define COLORS ( config.model == MODEL_48GX ? colors_gx : colors_sx ) -#define BUTTONS ( config.model == MODEL_48GX ? buttons_gx : buttons_sx ) +#define COLORS ( config.model == MODEL_48GX ? colors_48gx : colors_48sx ) +#define BUTTONS ( config.model == MODEL_48GX ? buttons_48gx : buttons_48sx ) #define LCD_OFFSET_X 1 #define LCD_OFFSET_Y 1 diff --git a/src/ui4x_ncurses.h b/src/ui4x_ncurses.h new file mode 100644 index 0000000..ba14a17 --- /dev/null +++ b/src/ui4x_ncurses.h @@ -0,0 +1,6 @@ +#ifndef _UI4x_NCURSES_H +#define _UI4x_NCURSES_H 1 + +extern void setup_frontend_ncurses( void ); + +#endif /* _UI4x_NCURSES_H */ diff --git a/src/ui48_sdl2.c b/src/ui4x_sdl2.c similarity index 99% rename from src/ui48_sdl2.c rename to src/ui4x_sdl2.c index cd30677..341703d 100644 --- a/src/ui48_sdl2.c +++ b/src/ui4x_sdl2.c @@ -2,13 +2,13 @@ #include -#include "ui48_config.h" -#include "ui48_emulator.h" -#include "ui48_common.h" -#include "ui48_inner.h" +#include "ui4x_config.h" +#include "ui4x_emulator.h" +#include "ui4x_common.h" +#include "ui4x_inner.h" -#define COLORS ( config.model == MODEL_48GX ? colors_gx : colors_sx ) -#define BUTTONS ( config.model == MODEL_48GX ? buttons_gx : buttons_sx ) +#define COLORS ( config.model == MODEL_48GX ? colors_48gx : colors_48sx ) +#define BUTTONS ( config.model == MODEL_48GX ? buttons_48gx : buttons_48sx ) #define KEYBOARD_HEIGHT ( BUTTONS[ LAST_HPKEY ].y + BUTTONS[ LAST_HPKEY ].h ) #define KEYBOARD_WIDTH ( BUTTONS[ LAST_HPKEY ].x + BUTTONS[ LAST_HPKEY ].w ) diff --git a/src/ui4x_sdl2.h b/src/ui4x_sdl2.h new file mode 100644 index 0000000..e8abc75 --- /dev/null +++ b/src/ui4x_sdl2.h @@ -0,0 +1,6 @@ +#ifndef _UI4x_SDL2_H +#define _UI4x_SDL2_H 1 + +extern void setup_frontend_sdl( void ); + +#endif /* _UI4x_SDL2_H */