0.0.1 ā€¢ Published 3 years ago

batari-basic v0.0.1

Weekly downloads
5
License
GPL-3.0
Repository
github
Last release
3 years ago

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

0.0.1

3 years ago