From 50329fff2d1d6e4376bc8ab974530cad6ab2fb70 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 12 Sep 2024 15:15:10 +0200 Subject: [PATCH] binary and project now named `ui48` --- .gitignore | 2 +- Makefile | 7 +++++-- README.md | 8 ++++++-- src/config.c | 34 ++++++++++++++++++++++++++-------- src/ui_ncurses.c | 2 +- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 168df4e..c771c3e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,4 @@ Module.symvers Mkfile.old dkms.conf -/hp48-sdl2 +/ui48 diff --git a/Makefile b/Makefile index 07056b9..495c971 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ # Makefile -TARGETS = hp48-sdl2 +TARGETS = ui48 +VERSION_MAJOR = 0 +VERSION_MINOR = 0 +PATCHLEVEL = 0 PKG_CONFIG ?= pkg-config @@ -71,7 +74,7 @@ LIBS = -lm \ all: $(TARGETS) -hp48-sdl2: $(DOTOS) +ui48: $(DOTOS) # Binaries $(TARGETS): diff --git a/README.md b/README.md index 2ef6fb1..b22019c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# hp48-sdl2 +# ui48 -HP48 UI in sdl2 (standalone) \ No newline at end of file +Standalone HP 48(SX/GX) front-end ready to be plugged into emulators. + +Provide both GUI implemented in SDL2 and TUI in ncurses. + +Extracted from x48ng. diff --git a/src/config.c b/src/config.c index 5d625bd..da59261 100644 --- a/src/config.c +++ b/src/config.c @@ -13,7 +13,7 @@ #include "config.h" static config_t config = { - .progname = ( char* )"ui48ng", + .progname = ( char* )"ui48", .gx = true, .verbose = false, @@ -74,13 +74,31 @@ config_t* config_init( int argc, char* argv[] ) {0, 0, 0, 0 } }; - const char* help_text = "usage: %s [options]\n options:\n -h --help what you " - "are reading\n -V --verbose be verbose (default: false)\n " - " --no-chrome only display the LCD (default: false)\n --fullscreen make the " - "UI fullscreen (default: false)\n --scale= make the UI scale times " - "(default: 1.0)\n --mono make the UI monochrome (default: false)\n " - " --gray make the UI grayscale (default: false)\n " - "--leave-shift-keys _not_ mapping the shift keys to let them free for numbers (default: false)\n"; + const char* help_text = "usage: %s [options]\n" + "options:\n" + " -h --help what you are reading\n" + " --gui use graphical (SDL2) front-end (default: true)\n" + " --tui use text front-end (default: false)\n" + " --tui-small use text small front-end (2×2 pixels per character) (default: " + "false)\n" + " --tui-tiny use text tiny front-end (2×4 pixels per character) (default: " + "false)\n" + " --no-chrome only display the LCD (default: " + "false)\n" + " --fullscreen make the UI fullscreen " + "(default: false)\n" + " --scale= make the UI scale times " + "(default: 1.0)\n" + " --mono make the UI monochrome (default: " + "false)\n" + " --gray make the UI grayscale (default: " + "false)\n" + " --gx make the GUI looks like a HP 48GX (default: " + "auto)\n" + " --sx make the GUI looks like a HP 48SX (default: " + "auto)\n" + " --leave-shift-keys _not_ mapping the shift keys to let them free for numbers (default: " + "false)\n"; while ( c != EOF ) { c = getopt_long( argc, argv, optstring, long_options, &option_index ); diff --git a/src/ui_ncurses.c b/src/ui_ncurses.c index 903756a..9e9d45e 100644 --- a/src/ui_ncurses.c +++ b/src/ui_ncurses.c @@ -488,7 +488,7 @@ void ui_start_ncurses( config_t* conf ) mvvline( 1, LCD_RIGHT, ACS_VLINE, LCD_BOTTOM - 1 ); mvprintw( 0, 2, "[ | | | | | ]" ); /* annunciators */ - mvprintw( 0, LCD_RIGHT - 18, "< %s >", config.progname ); + mvprintw( 0, LCD_RIGHT - 18, "< %s v%i.%i.%i >", config.progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL ); mvprintw( LCD_BOTTOM, 2, "[ wire: %s ]-[ IR: %s ]-[ contrast: %i ]", config.wire_name, config.ir_name, get_contrast() );