mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2025-01-11 06:29:49 +00:00
25 lines
468 B
JavaScript
25 lines
468 B
JavaScript
const fs = require("fs");
|
|
|
|
const PACKETSIZE = 64;
|
|
|
|
let data = [];
|
|
for(let t=0;t<PACKETSIZE;t++) data.push(t);
|
|
|
|
let packet = [
|
|
0xff, 0xff, 0xff, 0xff, 0xfe, // header plus start bit
|
|
...data, // the actual data block
|
|
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, // filler
|
|
]
|
|
|
|
let packets = [];
|
|
|
|
for(let t=0;t<1000;t++) {
|
|
packets = [...packets, ...packet];
|
|
}
|
|
|
|
let file = new Uint8Array(packets);
|
|
|
|
fs.writeFileSync("packets.bin", file);
|
|
|
|
|