remy / txt2bas

ZX Spectrum BASIC conversion tooling (specific support for NextBASIC)
19 stars 0 forks source link
nextbasic spectrum-next

txt2bas and bas2txt - tooling for ZX Spectrum NextBASIC

This code is inspired by the .txt2bas dot command on the ZX Spectrum Next (not that I could read the asm code!).

This project provides:

Installation

Node and npm (included with node) are required to install and run the code.

For the command line tooling - this installs both tools:

npm install --global txt2bas

Command line usage

Command line arguments are the same for both txt2bas and bas2txt:

txt2bas -i source.txt -o result.bas # generate a 3dos basic file
bas2txt -i source.bas -o result.txt # generates plain text

Omitting -o will print to stdout.

By default the generated file is a +3DOS format unless the output or input filename ends in .tap or using the format option -f tap:

txt2bas -i source.txt -o result.tap # generates a tap file

The command line can also read from stdin though this works best on txt2bas and not recommended for bas2txt.

Note that #autostart directive is also supported.

Command line options

Library API

Problematically using the library exposes a number of paired functions:

Development

Licence