3
4
Fork
You've already forked x48ng
1
a reboot of the x48 HP 48 emulator
  • C 94.4%
  • Roff 2%
  • Assembly 1.9%
  • Makefile 1.7%
Gwenhael Le Moine 892b8f4764
1.3.0
2026年07月07日 16:34:54 +02:00
.github/workflows CI 2025年11月20日 14:32:44 +01:00
dist Have x48ng-launcher check config.lua (if it exists) for model, for #35 2026年04月20日 14:30:05 +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 1.3.0 2026年07月07日 16:34:54 +02:00
.clang-format sort headers 2025年08月21日 12:30:03 +02:00
.gitignore gitignore 2026年01月24日 21:25:53 +01:00
.gitmodules ui4x is now a submodule 2026年01月21日 12:37:07 +01: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 1.3.0 2026年07月07日 16:34:54 +02:00
README.md add note about git submodules to readme 2026年04月13日 15:43:08 +10: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

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)

x48ng is part of my little collection of HP calculators' emulators' that I took over maintenance :

[ The reference public source repository is https://codeberg.org/gwh/x48ng ]

Usage

x48ng-launcher --help

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

--sdl 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:

┌─[ Help ]─────────────────────────────────────────────────────────┐
│Special keys: │
│ F1: Help, F7: Quit │
│Calculator keys: │
│ all alpha-numerical keys │
│ F2: Left-Shift, F3: Right-Shift, F4: Alpha, F5: On, F6: Enter │
└──────────────────────────────────────────────────────────────────┘

There's also additional hidden shortcuts that might work and/or come handy:

  • Left-Shift: [ or PgUp
  • Right-Shift: ] or PgDn
  • Alpha: ; or Ins
  • On: Esc or Home
  • Enter: ,
  • quit: | or Shift + End or F10

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 to SDL3

Bugs to fix

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

What more I would like to do:

long(er) term

  • GUI in gtk(4)?

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 sdl front-end by compiling with make WITH_SDL=no.

Ncurses front-end is always built-in.

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

  • Lua
  • readline

for Ncurses:

  • ncursesw

for SDL version:

  • SDL3
  • SDL3_gfx

Installation

First clone the source code, ensuring you get all submodules: git clone --recursive https://codeberg.org/gwh/x48ng.git

  1. Run make get-roms unless you have a good reason not to. (ROMs licenses are unclear so they're not bundled by default.)
  2. Run sudo make install PREFIX=/usr (see the Makefile to see what variables your can override.)
  3. Run x48ng-launcher. On first launch or if no ~/.config/x48ng/ exists it will be created and populated. By default it sets up a HP 48GX with ROM R with a 128KB card in port 1 and a 4MB card in port 2. You can change the ROM by setting the ROM environment variable (ROM=sxrom-j x48ng-launcher for example.)

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