mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-12-22 13:30:38 +00:00
22 lines
512 B
JavaScript
22 lines
512 B
JavaScript
const fs = require('fs');
|
|
const parseOptions = require("./parseOptions");
|
|
|
|
const options = parseOptions([
|
|
{ name: 'input', alias: 'i', type: String },
|
|
{ name: 'output', alias: 'o', type: String }
|
|
]);
|
|
|
|
if(options.input === undefined || options.output === undefined) {
|
|
console.log("usage: prg2bin -i inputfile.prg -o outputfile.bin");
|
|
process.exit(-1);
|
|
}
|
|
|
|
let prg = fs.readFileSync(options.input);
|
|
|
|
prg = prg.slice(2);
|
|
|
|
fs.writeFileSync(options.output,prg);
|
|
|
|
console.log(`${options.output} written`);
|
|
|