diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f42f235 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.lst +*.prg diff --git a/README.md b/README.md new file mode 100644 index 0000000..7883eb7 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# apple1-videocard-lib + +Library and demos for the Apple-1 TMS9918 video card by P-LAB. + +# USAGE (Windows) + +- `env.bat` sets CC65 path variable (run it once) +- `c.bat` compiles `test.c` for both VIC-20 and Apple-1 +- `test_vic20.prg` runs on the "hybrid" VIC-20 emulator +- `node hexdump` gives the output in WOZMON format for the Apple-1 + +Note: Apple-1 start address is $4000, with TMS address range $C000-$C001 + + diff --git a/c.bat b/c.bat new file mode 100644 index 0000000..1819642 --- /dev/null +++ b/c.bat @@ -0,0 +1,4 @@ +cl65 -D APPLE1 --target none --start-addr $4000 -O test.c -o test_apple1.prg +cl65 --listing test.lst -D VIC20 --target vic20 -O test.c -o test_vic20.prg + + diff --git a/env.bat b/env.bat new file mode 100644 index 0000000..76e393d --- /dev/null +++ b/env.bat @@ -0,0 +1 @@ +PATH %PATH%;C:\Programmi\cc65-snapshot-win32\bin \ No newline at end of file diff --git a/hexdump.js b/hexdump.js new file mode 100644 index 0000000..5f4b67c --- /dev/null +++ b/hexdump.js @@ -0,0 +1,32 @@ +const fs = require('fs'); + +let prg = fs.readFileSync("test_apple1.prg"); + +//prg = prg.slice(2); // skip header + +let s = appledump(prg, 0x4000); + +console.log(s); + +function appledump(bytes, start) { + let rows=16; + let s="\r\n"; + for(let r=0;r