forked from Miroirs/x49gp
Compare commits
No commits in common. "ef932999252455140093355efce15baf3da24cc3" and "a3b530ec17a5499f12c4a98999aa0a9f1e066b28" have entirely different histories.
ef93299925
...
a3b530ec17
3 changed files with 56 additions and 78 deletions
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ TARGET_ALLCAPS = X50NG
|
|||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 6
|
||||
PATCHLEVEL = 1
|
||||
PATCHLEVEL = 0
|
||||
|
||||
INSTALL_PREFIX = /usr/local
|
||||
INSTALL_BINARY_DIR = "$(INSTALL_PREFIX)"/bin
|
||||
|
|
|
@ -43,48 +43,31 @@ The third and final group contains two items: *Reset*, which resets the calculat
|
|||
|
||||
During the first launch, *x50ng* generates a new configuration with default values and empty memory. *x50ng* does not ship with a default firmware, only with the bootloaders for the supported calculators. Hence, the user is required to select a firmware to load into the flash. *x50ng* will show a file selection window for that task. For the stock firmware HP has always used the file extension “.bin”, any other files (including the update.scp files that typically come with them!) are generally not actual firmware files.
|
||||
|
||||
When the file selection dialog is cancelled or the file could not be read, *x50ng* creates a flash without firmware; the bootloader will complain and offer ways to correct the situation just like it would on a real device, which include receiving a firmware via USB (currently not available in *x50ng*, see _Caveats_ below) or loading one from the SD card. Apart from these options, it's also possible to recover from this by exiting *x50ng* and either deleting the flash file or using one of the options *-f* and *-F*, causing *x50ng* to rebuild the flash and ask for a firmware again.
|
||||
When the file selection dialog is cancelled or the file could not be read, *x50ng* creates a flash without firmware; the bootloader will complain and offer ways to correct the situation just like it would on a real device, which include receiving a firmware via USB (currently not available in *x50ng*, see _Caveats_ below) or loading one from the SD card. Apart from these options, it's also possible to recover from this by exiting *x50ng* and either delet‐ ing the flash file or using one of the options *-f* and *-F*, causing *x50ng* to rebuild the flash and ask for a firmware again.
|
||||
|
||||
Please consult HP's manual (for their official firmware) or the documentation of the custom firmware (if using one) for an explanation of using the calculator.
|
||||
|
||||
# OPTIONS
|
||||
|
||||
*-h* *--help* print this message and exit
|
||||
*-v* *--version* print out version
|
||||
*-V* *--verbose* print out more information
|
||||
*-d* *--datadir*[=_absolute path_] alternate datadir (default: $XDG_CONFIG_HOME/x50ng/)
|
||||
*-n* *--name*[=_name_] set alternate UI name
|
||||
*-s* *--style*[=_filename_] css filename in <datadir> (default: style-50g.css)
|
||||
*-S* *--display-scale*[=_X_] scale LCD by X (default: 2)
|
||||
*-r* *--reboot* reboot on startup instead of continuing from the saved state in the state file
|
||||
*--overwrite-config* force writing <datadir>/config.lua even if it exists
|
||||
|
||||
*--newrpl-keyboard* label keyboard for newRPL
|
||||
|
||||
*--enable-debug*[=_port_] enable the debugger interface (default port: 1234)
|
||||
*--debug* use along -D to also start the debugger immediately
|
||||
|
||||
*--reflash*[=_firmware_] rebuild the flash using the supplied firmware (default: select one interactively) (implies -r for safety reasons)
|
||||
*--reflash-full*[=_firmware_] rebuild the flash using the supplied firmware and drop the flash contents in the area beyond the firmware (default: select one interactively) (implies -r for safety reasons)
|
||||
*--50g* use an HP 50g bootloader when (re-)flashing (default)
|
||||
*--49gp* use an HP 49g+ bootloader when (re-)flashing
|
||||
- *-h* *--help* print this message and exit
|
||||
- *--verbose* print out more information
|
||||
- *--datadir*[=_absolute path_] alternate datadir (default: $XDG_CONFIG_HOME/x50ng/)
|
||||
- *--overwrite-config* force writing <datadir>/config.lua even if it exists
|
||||
- *--50g* emulate an HP 50g (default)
|
||||
- *--49gp* emulate an HP 49g+
|
||||
- *--newrpl-keyboard* label keyboard for newRPL
|
||||
- *-n* *--name*[=_name_] set alternate UI name
|
||||
- *-s* *--style-filename*[=_filename_] css filename in <datadir> (default: style-<model>.css)
|
||||
- *-S* *--display-scale*[=_X_] scale LCD by X (default: 2)
|
||||
- *--enable-debug*[=_port_] enable the debugger interface (default port: 1234)
|
||||
- *--debug* use along -D to also start the debugger immediately
|
||||
- *--reflash*[=_firmware_] rebuild the flash using the supplied firmware (default: select one interactively) (implies -r for safety reasons)
|
||||
- *--reflash-full*[=_firmware_] rebuild the flash using the supplied firmware and drop the flash contents in the area beyond the firmware (default: select one interactively) (implies -r for safety reasons)
|
||||
- *-r* *--reboot* reboot on startup instead of continuing from the saved state in the state file
|
||||
|
||||
# FILES
|
||||
|
||||
## System-wide
|
||||
|
||||
- *style-50g.css* and *style-49gp.css*
|
||||
|
||||
Default styles provided defining colors and fonts (mostly) for the GUI. The format is CSS as defined by gtk+-3.
|
||||
|
||||
- *firmware/*
|
||||
|
||||
This directory contains a _Makefile_ that will download and extract the following files:
|
||||
- the arm bootloaders [ from _https://www.hpcalc.org/hp49/pc/rom/hp-arm-models-bootloader.zip_ ]
|
||||
- the latest official HP ROM 2.15 [ from _https://www.hpcalc.org/hp49/pc/rom/hp4950v215.zip_ ]
|
||||
- the latest newRPL build [ from _https://hpgcc3.org/downloads/newrplfw.bin_ ]
|
||||
|
||||
## All further files are located under ~/.config/x50ng/
|
||||
All files are located under ~/.config/x50ng/
|
||||
|
||||
- *config.lua*
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ static char* config_to_string( void )
|
|||
"name = \"%s\" -- this customize the title of the window\n"
|
||||
"model = \"%s\" -- possible values: \"49gp\", \"50g\". Changes the bootloader looked for when (re-)flashing\n"
|
||||
"newrpl_keyboard = %s -- when true this makes the keyboard labels more suited to newRPL use\n"
|
||||
"style = \"%s\" -- CSS file (relative to this file)\n"
|
||||
"style_filename = \"%s\" -- CSS file (relative to this file)\n"
|
||||
"display_scale = %i -- integer only\n"
|
||||
"verbose = %s\n"
|
||||
"--- End of x50ng configuration -----------------------------------------------\n",
|
||||
|
@ -158,21 +158,20 @@ void config_init( char* progname, int argc, char* argv[] )
|
|||
int print_config_and_exit = false;
|
||||
int overwrite_config = false;
|
||||
|
||||
const char* optstring = "dhrf:n:s:S:vV";
|
||||
const char* optstring = "hrf:n:s:S:";
|
||||
struct option long_options[] = {
|
||||
{"help", no_argument, NULL, 'h' },
|
||||
{"version", no_argument, NULL, 'v' },
|
||||
{"verbose", no_argument, NULL, 'V' },
|
||||
|
||||
{"print-config", no_argument, &print_config_and_exit, true},
|
||||
{"verbose", no_argument, &clopt_verbose, true},
|
||||
|
||||
{"overwrite-config", no_argument, &overwrite_config, true},
|
||||
{"datadir", required_argument, NULL, 'd' },
|
||||
{"datadir", required_argument, NULL, 1 },
|
||||
|
||||
{"50g", no_argument, NULL, 506 },
|
||||
{"49gp", no_argument, NULL, 496 },
|
||||
{"newrpl-keyboard", no_argument, &clopt_newrpl, true},
|
||||
{"name", required_argument, NULL, 'n' },
|
||||
{"style", required_argument, NULL, 's' },
|
||||
{"style-filename", required_argument, NULL, 's' },
|
||||
{"display-scale", required_argument, NULL, 'S' },
|
||||
|
||||
{"enable-debug", required_argument, NULL, 10 },
|
||||
|
@ -190,34 +189,45 @@ void config_init( char* progname, int argc, char* argv[] )
|
|||
switch ( c ) {
|
||||
case 'h':
|
||||
fprintf( stderr,
|
||||
"%s %i.%i.%i\n"
|
||||
"Emulator for HP 49G+ / 50G calculators' hardware\n"
|
||||
"%s %i.%i.%i Emulator for HP 49G+ / 50G calculators\n"
|
||||
"Usage: %s [<options>]\n"
|
||||
"Valid options:\n"
|
||||
"-h --help print this message and exit\n"
|
||||
"-v --version print out version\n"
|
||||
"-V --verbose print out more information\n"
|
||||
"-d --datadir[=absolute path] alternate datadir (default: $XDGCONFIGHOME/%s/)\n"
|
||||
"-n --name[=name] set alternate UI name\n"
|
||||
"-s --style[=filename] css filename in <datadir> (default: style-50g.css)\n"
|
||||
"-S --display-scale[=X] scale LCD by X (default: 2)\n"
|
||||
"-r --reboot reboot on startup instead of continuing from the saved state in the state file\n"
|
||||
"--overwrite-config force writing <datadir>/config.lua even if it exists\n"
|
||||
" -h --help print this message and exit\n"
|
||||
" --verbose print out more information\n"
|
||||
"\n"
|
||||
"--newrpl-keyboard label keyboard for newRPL\n"
|
||||
" --datadir[=<absolute path>] alternate datadir (default: $XDG_CONFIG_HOME/%s/)\n"
|
||||
"\n"
|
||||
"--enable-debug[=port] enable the debugger interface (default port: %i)\n"
|
||||
"--debug use along -D to also start the debugger immediately\n"
|
||||
" --overwrite-config force writing <datadir>/config.lua even if it exists\n"
|
||||
"\n"
|
||||
"--reflash[=firmware] rebuild the flash using the supplied firmware (default: select one interactively) "
|
||||
"(implies -r for safety reasons)\n"
|
||||
"--reflash-full[=firmware] rebuild the flash using the supplied firmware and drop the flash contents in the "
|
||||
"area beyond the firmware (default: select one interactively) (implies -r for safety reasons)\n"
|
||||
"--50g use an HP 50g bootloader when (re-)flashing (default)\n"
|
||||
"--49gp use an HP 49g+ bootloader when (re-)flashing\n",
|
||||
" --50g emulate an HP 50g (default)\n"
|
||||
" --49gp emulate an HP 49g+\n"
|
||||
" --newrpl-keyboard label keyboard for newRPL\n"
|
||||
"\n"
|
||||
" -n --name[=<name>] set alternate UI name\n"
|
||||
" -s --style-filename[=<filename>] css filename in <datadir> (default: style-<model>.css)\n"
|
||||
" -S --display-scale[=<X>] scale LCD by X (default: 2)\n"
|
||||
"\n"
|
||||
" --enable-debug[=<port>] enable the debugger interface\n"
|
||||
" (default port: %u)\n"
|
||||
" --debug use along -D to also start the debugger immediately\n"
|
||||
"\n"
|
||||
" --reflash[=firmware] rebuild the flash using the supplied firmware\n"
|
||||
" (default: select one interactively)\n"
|
||||
" (implies -r for safety reasons)\n"
|
||||
" --reflash-full[=firmware] rebuild the flash using the supplied firmware and drop the flash contents\n"
|
||||
" in the area beyond the firmware\n"
|
||||
" -r --reboot reboot on startup instead of continuing from the\n"
|
||||
" saved state in the state file\n\n",
|
||||
progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, progname, progname, DEFAULT_GDBSTUB_PORT );
|
||||
exit( EXIT_SUCCESS );
|
||||
break;
|
||||
case 'r':
|
||||
if ( opt.reinit < X49GP_REINIT_REBOOT_ONLY )
|
||||
opt.reinit = X49GP_REINIT_REBOOT_ONLY;
|
||||
break;
|
||||
case 1:
|
||||
opt.datadir = strdup( optarg );
|
||||
break;
|
||||
case 10:
|
||||
do_enable_debugger = true;
|
||||
opt.debug_port = atoi( optarg );
|
||||
|
@ -248,30 +258,15 @@ void config_init( char* progname, int argc, char* argv[] )
|
|||
if ( clopt_style_filename == NULL )
|
||||
clopt_style_filename = "style-50g.css";
|
||||
break;
|
||||
case 'd':
|
||||
opt.datadir = strdup( optarg );
|
||||
break;
|
||||
case 'n':
|
||||
clopt_name = strdup( optarg );
|
||||
break;
|
||||
case 'r':
|
||||
if ( opt.reinit < X49GP_REINIT_REBOOT_ONLY )
|
||||
opt.reinit = X49GP_REINIT_REBOOT_ONLY;
|
||||
break;
|
||||
case 's':
|
||||
clopt_style_filename = strdup( optarg );
|
||||
break;
|
||||
case 'S':
|
||||
clopt_display_scale = atoi( optarg );
|
||||
break;
|
||||
case 'v':
|
||||
fprintf( stderr, "%i.%i.%i\n", VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
|
||||
exit( EXIT_SUCCESS );
|
||||
break;
|
||||
case 'V':
|
||||
clopt_verbose = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -314,7 +309,7 @@ void config_init( char* progname, int argc, char* argv[] )
|
|||
lua_getglobal( config_lua_values, "name" );
|
||||
opt.name = strdup( luaL_optstring( config_lua_values, -1, opt.name ) );
|
||||
|
||||
lua_getglobal( config_lua_values, "style" );
|
||||
lua_getglobal( config_lua_values, "style_filename" );
|
||||
opt.style_filename = strdup( luaL_optstring( config_lua_values, -1, opt.style_filename ) );
|
||||
|
||||
lua_getglobal( config_lua_values, "display_scale" );
|
||||
|
|
Loading…
Reference in a new issue