https://github.com/mobluse/x16-petscii2utf8
A filter for Commander X16 & Commodore 64 that converts PETSCII to Unicode & VT100
https://github.com/mobluse/x16-petscii2utf8
c64 commander-x16 commanderx16 cx16 filter petscii vic20 vt100 xterm
Last synced: about 2 months ago
JSON representation
A filter for Commander X16 & Commodore 64 that converts PETSCII to Unicode & VT100
- Host: GitHub
- URL: https://github.com/mobluse/x16-petscii2utf8
- Owner: mobluse
- License: bsd-2-clause
- Created: 2019-09-27T02:01:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-17T15:04:32.000Z (almost 3 years ago)
- Last Synced: 2025-12-27T03:41:06.039Z (6 months ago)
- Topics: c64, commander-x16, commanderx16, cx16, filter, petscii, vic20, vt100, xterm
- Language: C
- Homepage: http://commanderx16.com
- Size: 1.05 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# x16-petscii2utf8
This filter program for Linux (including WSL) converts output of the
[Commander X16 Emulator](http://commanderx16.com) R33+ to UTF-8
looking like PETSCII-UC, PETSCII-LC, or ISO8859-15 depending on what is used.
It also converts the control codes to ANSI/VT100/xterm Escape sequences. It can print some debug information
e.g. Ⓓ & Ⓐ for CR & LF, if you use option -d. In the future also the keypresses will be shown, and there is some
buggy support for that already.

## Usage
x16emu -echo raw | petscii2utf8 -d
or if these are not installed:
./x16emu -echo raw | ~/x16-petscii2utf8/petscii2utf8 -d
`READY.` is changed to `READY!` as a confirmation that it works.
Keys might work in the Commander X16 Emulator R33+ using:
./x16emu -echo raw -log k | ~/x16-petscii2utf8/petscii2utf8
Keys in the terminal sending to the emulator does not work, unless you patch the emulator.



Try [petsciiiso.bas](https://github.com/mobluse/chargen-maker/blob/master/petsciiiso.bas)!
This system can also be used in Windows 10+ using WSL, and I have tested it in Ubuntu 18.04 LTS with Windows-terminal 1.17;
both from Microsoft Store, but it probably works with later versions.
I used the font [Unscii-16-full](http://viznut.fi/unscii/unscii-16-full.ttf) in Windows-terminal since the built-in fonts
from Microsoft currently don't support symbols for legacy computing.
/mnt/c/Users/pi/Downloads/x16emu_win64-r43/x16emu.exe -echo raw -run -bas ~/chargen-maker/petsciiiso.bas | ~/x16-petscii2utf8/petscii2utf8

## Building PETSCII2UTF8
Unfortunately I don't yet know `make` or `CMake` so I made a script `build.sh` that compiles the code to executables.
This has been tested on Raspbian Buster and Bullseye Linux. I would like it to build on macOS, but I have no Mac to test it on.
git clone https://github.com/mobluse/x16-petscii2utf8
cd x16-petscii2utf8
./clean.sh
./build.sh
## References
https://en.wikipedia.org/wiki/PETSCII
https://en.wikipedia.org/wiki/Symbols_for_Legacy_Computing
https://style64.org/petscii/
https://dflund.se/~triad/krad/recode/petscii_c64en_uc.txt
https://dflund.se/~triad/krad/recode/petscii_c64en_lc.txt ─ These were used to generate some code using enter-unicode.
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
https://github.com/X16Community/x16-docs/blob/master/X16%20Reference%20-%2002%20-%20Editor.md#new-control-characters
http://viznut.fi/unscii/
## Acknowledgements
See also: https://github.com/commanderx16/x16-emulator/pull/112
I would like to thank [@mist64](https://github.com/mist64) for reviews.