c64-hilbert-memory-view
I want to see how my favorite 8-bit computer walks into its address space, represented as a Hilbert curve.
Something similar to https://xkcd.com/195/ (Map of the Internet), but for the Commodore 64's 64K of memory. And animated. In the future it will work in realtime alongside an emulator.
The C64 memory map, showed as a Hilbert curve. The white spots are the data reads, writes, and instructions executed during typing and running a simple CBM BASIC program.
What you'll find in this repository:
- some Python scripts to record the activity of the VICE emulator;
- a P5.js sketch that will show the memory activiy of the 6510.
How to build an animation
On Mac OS X (should work the same on Linux too):
- Run VICE and enable remote monitor (or start from command line with
x64 -remotemonitor -remotemonitoraddress 127.0.0.1:6510
) - Load your favorite game, start recording some history in VICE (wait ~5s before starting playing), then stop recording. Take note of the recording length.
- Type on a terminal (without pressing Enter)
./tracer.py -f 25 -e 35 > traces/output.trace
(replace 35 with the record duration, in seconds). - Re-run the recorded history, then quickly press Enter in the terminal.
- Wait for the trace to be completed. It may take a while, 3-4 minutes for every second of recorded history. The resulting file will be around 21MB for every second of history. The tool will also create PNG screenshots in
/tmp
. - Once it's done, run
./compressor.py < traces/output.trace > traces/output.ctrace
. You can deleteoutput.ctrace
. - Open
imageGenerator/sketch.js
, edit thetraceFileName
variable tooutput.ctrace
. - In the terminal, run
cd imageGenerator; python -m SimpleHTTPServer 8000
- In a browser, go to
http://localhost:8000
, wait the data to be loaded, then enjoy!
If you want to save the animation's screenshots:
- ensure your browser can download files automatically, without opening the save dialog
- in
sketch.js
set the variablesaveAllFrames
totrue
- Reload.