Giter Site home page Giter Site logo

mobluse / x16-petscii2utf8 Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 1.07 MB

A filter for Commander X16 & Commodore 64 that converts PETSCII to Unicode & VT100

Home Page: http://commanderx16.com

License: BSD 2-Clause "Simplified" License

Shell 1.04% C 98.96%
commanderx16 c64 vic20 filter petscii vt100 xterm commander-x16 cx16

x16-petscii2utf8's Introduction

x16-petscii2utf8

This filter program for Linux (including WSL) converts output of the Commander X16 Emulator 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.

Startup with OLD in native Linux using -log k

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.

PETSCIIISO.BAS PETSCII-UC PETSCIIISO.BAS PETSCII-LC PETSCIIISO.BAS ISO8859-15 Try 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 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

Startup with OLD in WSL in Windows w/o using -log k

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: commanderx16/x16-emulator#112

I would like to thank @mist64 for reviews.

x16-petscii2utf8's People

Contributors

mobluse avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ertclee

x16-petscii2utf8's Issues

Entering a line in a BASIC program causes scan codes to be displayed

If you run using ./x16emu -echo raw -log k | ../x16-petscii2utf8/petscii2utf8.
When you write 10 PRINT and press Enter you get:

10 PRINT
UP   0♣28

In the x16emu emulator you only move to the next line. Also, it prints scan codes until you get READY! by typing RUN and Enter.

I have studied my code, but cannot find the bug. Maybe something unusual is sent when pressing Enter after a program line. Pressing Enter after commands works.

This can be studied by using: ./x16emu -echo raw -log k | xxd.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.