batari-basic

0.0.1 • Public • Published

Welcome to batari-basic 👋

Version Documentation Maintenance License: GPL--3.0 Twitter: Haroldo0k

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 a Uint8Array 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

🤝 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

Readme

Keywords

Package Sidebar

Install

npm i batari-basic

Weekly Downloads

0

Version

0.0.1

License

GPL-3.0

Unpacked Size

1.08 MB

Total Files

11

Last publish

Collaborators

  • haroldo-ok-ats