batari-basic
v0.2.0
Published
Compiles Batari Basic source files from a JS environment.
Downloads
6
Readme
Compiles Batari Basic source files from a JS environment.
🏠 Homepage
Install
npm install batari-basic
Usage
const bBasic = require('batari-basic');
const fs = require('fs');
const HELLO_WORLD = `
rem Hello World
playfield:
................................
......X.X.XXX.X...X...XXX.......
......X.X.X...X...X...X.X.......
......XXX.XX..X...X...X.X.......
......X.X.X...X...X...X.X.......
......X.X.XXX.XXX.XXX.XXX.......
................................
.....X...X.XXX.XX..X...XX.......
.....X...X.X.X.X.X.X...X.X......
.....X.X.X.X.X.XX..X...X.X......
.....XX.XX.XXX.X.X.XXX.XX.......
end
COLUPF = 22
COLUBK = 2
mainloop
drawscreen
score = score + 1
goto mainloop
`;
const binaries = bBasic(HELLO_WORLD);
fs.writeFileSync('example.bin', Buffer.from(binaries.output));
The bBasic(code)
function receives, as a parameter, a string containing the source code to compile, and returns an object three keys:
output
is the compiled Atari 2600 ROM, as aUint8Array
containing its bytes.listings
is an string containing the generated ASM listings;symbolmap
is an string mapping addresses to symbols, often used by debugging emulators.
Run tests
npm run test
Author
👤 Haroldo O. Pinheiro
- Website: http://www.haroldo-ok.com/
- Twitter: @Haroldo0k
- Github: @haroldo-ok
- LinkedIn: @haroldo-ok
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2021 Haroldo O. Pinheiro. This project is GPL--3.0 licensed.
This README was generated with ❤️ by readme-md-generator