x48ng emulator "engine" as a standalone library
Find a file
Gwenhael Le Moine 579d9fe0ae
Some checks failed
C/C++ CI / build (push) Has been cancelled
use a bool
2024-09-11 15:07:49 +02:00
.github/workflows remove dependency on SDL2_gfx 2024-09-09 20:54:47 +02:00
dist more tweaking setup script to avoid a symlink and allow more overriding 2024-09-08 15:52:56 +02:00
doc_0.6.4 clean doc_0.6.4 content; move installed files into dist/ in which binaries are compiled in too 2023-05-10 15:50:51 +02:00
romdump delete autotools files, use only simple Makefile 2023-04-26 16:51:11 +02:00
src use a bool 2024-09-11 15:07:49 +02:00
.clang-format update .clang-format and format all the code 2023-09-22 09:44:23 +02:00
.gitignore [sdl2] minimal UI ported to sdl2, only LCD area displayed for now 2024-09-04 15:19:16 +02:00
AUTHORS add myself to AUTHORS 2023-04-26 19:49:18 +02:00
LICENSE Makefile: allow user CFLAGS to override out warning flags 2024-08-12 23:37:11 +02:00
Makefile converted all 0b numbers to decimal; back to a less cutting-edge -std=c11 2024-09-09 21:17:33 +02:00
README.md Remove SDL1 GUI. WITH_SDL=yes and --sdl are kept around to not break habits 2024-09-08 17:03:14 +02:00
sdl-screenshot.png oops, redo sdl screenshot at --scale=1 2024-09-10 21:02:05 +02:00
tui-screenshot.png crop tui screenshot 2023-10-18 17:49:39 +02:00
tui-small-screenshot.png refresh screenshots 2023-10-18 17:48:38 +02:00
tui-tiny-screenshot.png updated --tui-tiny screenshot with a --mono one for readability 2023-12-14 17:06:49 +01:00
x11-screenshot.png refresh screenshots 2023-10-18 17:48:38 +02:00

x48ng -- HP 48 emulator

This is my fork of x48-0.6.4 where I deviate from the original code and do my own thing. (See ./README_0.6.4 for the original README)

Usage

x48ng --help

You can use the script setup-x48ng-home.sh or simply run x48ng --rom=<romfilename>

Screenshots

--tui-small version (ncurses, 4 pixels per character)

screenshot of x48ng --tui-small running in a terminal

--tui-tiny --mono version (ncurses, 8 pixels per character)

screenshot of x48ng --tui-tiny --mono running in a terminal

--tui version (ncurses)

screenshot of x48ng --tui running in a terminal

--x11 version

screenshot of x48ng --x11

--sdl/--sdl2 version

screenshot of x48ng --sdl

manual setup

  1. Create $XDG_CONFIG_HOME/x48ng (usually ~/.config/x48ng/)
  2. Copy /usr/share/x48ng/ROMs/gxrom-r (or any other rom) to $XDG_CONFIG_HOME/x48ng/rom
  3. Run x48ng --print-config > $XDG_CONFIG_HOME/x48ng/config.lua
  4. Run x48ng

Ncurses UI (--tui)

I had to be a bit 'creative' mapping keys there:

  • Enter: F1
  • Left Shift: F2 or PgUp or [
  • Right Shift: F3 or PgDn or ]
  • Alpha: F4 or Ins or ;
  • On: F5 or Esc or Home or \

_To quit x48ng use F7

What have I done:

  1. renamed it to x48ng to avoid confusion
  2. merged in a SDL1 version I found @ https://code.google.com/archive/p/x48-sdl/source/default/source
  3. removed the code supporting Solaris, HP-UX, etc.
  4. removed the autotools-based build system and wrote a simple Makefile instead
  5. added a x48ng.desktop file and an icon
  6. refactoring as a way to explore/understand the codebase
  7. drop Xresources
  8. link to lua to use it as a config file reader
  9. ported the SDL1 GUI to SDL2

Bugs to fix

See and report at https://github.com/gwenhael-le-moine/x48ng/issues

What more I would like to do:

long(er) term

  • GUI in gtk(4)?
  • support the HP49g ROM?

Compilation

The Makefile will try to autodetect if necessary dependencies for x11 and sdl front-ends are met and enable/disable x11 and sdl front-ends accordingly.

You can force disable x11 front-end by compiling with make WITH_X11=no.

You can force disable sdl front-end by compiling with make WITH_SDL2=no.

Ncurses front-end is always built-in.

Dependencies (see .github/workflows/c-cpp.yml for debian packages names)

  • Lua
  • readline

for SDL2 version:

  • SDL2
  • SDL2_gfx

for x11 version:

  • x11

for Ncurses:

  • ncursesw

Installation

  1. Run sudo make install PREFIX=/usr (see the Makefile to see what variables your can override.)
  2. once installed run /usr/share/x48ng/setup-x48ng-home.sh to setup your ~/.x48ng/. It sets up a HP 48GX with a 128KB card in port 1 and a 4MB card in port 2
  3. run x48ng and enjoy

Development

  • make FULL_WARNINGS=yes to compile with all warnings
  • make clean and make mrproper to clean between compilation runs
  • make pretty-code to format the code using clang-format and the provided .clang-format

Friends and inspiration