2023-11-04 23:08:41 +01:00
# x48ng -- HP 48 emulator
2023-04-30 18:16:13 +02:00
2024-08-15 09:52:15 +02:00
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)
2023-04-30 18:16:13 +02:00
2023-10-18 17:48:38 +02:00
## Usage
`x48ng --help`
You can use the script `setup-x48ng-home.sh` or simply run `x48ng --rom=<romfilename>`
2023-09-24 22:30:07 +02:00
## Screenshots
2023-12-14 17:06:49 +01:00
### `--tui-small` version (ncurses, 4 pixels per character)
2023-10-18 17:48:38 +02:00
2023-11-04 23:08:41 +01:00
![screenshot of x48ng --tui-small running in a terminal ](./tui-small-screenshot.png?raw=true "screenshot of x48ng --tui-small running in a terminal" )
2023-10-18 17:48:38 +02:00
2023-12-14 17:06:49 +01:00
### `--tui-tiny --mono` version (ncurses, 8 pixels per character)
2023-10-19 11:11:34 +02:00
2023-12-14 17:06:49 +01:00
![screenshot of x48ng --tui-tiny --mono running in a terminal ](./tui-tiny-screenshot.png?raw=true "screenshot of x48ng --tui-tiny --mono running in a terminal" )
2023-10-19 11:11:34 +02:00
2023-09-24 22:30:07 +02:00
### `--tui` version (ncurses)
2023-10-18 17:48:38 +02:00
![screenshot of x48ng --tui running in a terminal ](./tui-screenshot.png?raw=true "screenshot of x48ng --tui running in a terminal" )
2023-09-24 22:30:07 +02:00
### `--x11` version
2023-10-18 17:48:38 +02:00
![screenshot of x48ng --x11 ](./x11-screenshot.png?raw=true "screenshot of x48ng --x11" )
2023-09-24 22:30:07 +02:00
### `--sdl` version
2023-10-18 17:48:38 +02:00
![screenshot of x48ng --sdl ](./sdl-screenshot.png?raw=true "screenshot of x48ng --sdl" )
2023-09-20 16:10:59 +02:00
2023-10-01 12:47:42 +02:00
### manual setup
2023-10-01 21:03:26 +02:00
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`
2023-10-01 12:47:42 +02:00
4. Run `x48ng`
2023-09-23 18:56:39 +02:00
### Ncurses UI (`--tui`)
I had to be a bit 'creative' mapping keys there:
2023-12-14 17:06:49 +01:00
- `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 `\`
2023-09-23 18:56:39 +02:00
2023-12-14 17:06:49 +01:00
_To quit `x48ng` use `F7`
2023-09-23 18:56:39 +02:00
2023-04-30 18:16:13 +02:00
## What have I done:
2023-04-30 19:16:49 +02:00
0. renamed it to x48ng to avoid confusion
2023-04-30 18:16:13 +02:00
1. merged in a SDL1 version I found @ https://code.google.com/archive/p/x48-sdl/source/default/source
2. removed the code supporting Solaris, HP-UX, etc.
3. removed the autotools-based build system and wrote a simple Makefile instead
2023-04-30 19:16:49 +02:00
4. added a x48ng.desktop file and an icon
2023-09-15 10:22:34 +02:00
5. refactoring as a way to explore/understand the codebase
2023-10-01 21:03:26 +02:00
6. drop Xresources
7. link to lua to use it as a config file reader
2023-04-30 18:16:13 +02:00
2023-05-10 14:44:38 +02:00
## Bugs to fix
2023-10-01 21:03:26 +02:00
See and report at https://github.com/gwenhael-le-moine/x48ng/issues
2023-05-10 14:44:38 +02:00
2023-04-30 18:16:13 +02:00
## What more I would like to do:
2023-09-13 21:57:55 +02:00
### short term
- port from sdl1.2 to sdl2
### long(er) term
- GUI in gtk(4)?
- support the HP49g ROM?
2023-04-30 18:16:13 +02:00
## Compilation
2023-09-27 16:26:27 +02:00
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_SDL=no` .
Ncurses front-end is always built-in.
2023-09-15 10:22:34 +02:00
### Dependencies (see .github/workflows/c-cpp.yml for debian packages names)
2023-05-18 23:11:40 +02:00
2024-08-16 03:03:37 +02:00
- Lua
2023-09-15 10:22:34 +02:00
- readline
2023-09-18 12:13:13 +02:00
for SDL version:
2023-09-15 10:22:34 +02:00
- SDL_gfx1
2023-09-23 19:38:00 +02:00
- SDL 1.2 or sdl12_compat
2023-04-30 18:16:13 +02:00
2023-09-18 12:13:13 +02:00
for x11 version:
- x11
2023-09-27 16:26:27 +02:00
for Ncurses:
- ncursesw
2023-04-30 18:16:13 +02:00
## Installation
2024-02-26 16:21:48 +01:00
1. Run `sudo make install PREFIX=/usr` (see the Makefile to see what variables your can override.)
2023-04-30 19:16:49 +02:00
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
2023-04-30 18:16:13 +02:00
3. run `x48ng` and enjoy
## Development
- `make FULL_WARNINGS=yes` to compile with all warnings
2023-09-13 21:57:55 +02:00
- `make clean` and `make mrproper` to clean between compilation runs
2023-04-30 18:16:13 +02:00
- `make pretty-code` to format the code using `clang-format` and the provided `.clang-format`
2023-09-16 13:43:00 +02:00
## Friends and inspiration
- https://github.com/gwenhael-le-moine/x48 (original x48 slightly touched but not too much)
- https://github.com/shagr4th/droid48 (x48 ported to Android)
- https://hp.giesselink.com/emu48.htm (The Emu48)
- https://github.com/dgis/emu48android (Emu48 ported to Android)
- https://github.com/gwenhael-le-moine/jsEmu48 (another HP 48 emulator)