Skip to content

Instantly share code, notes, and snippets.

@mattgodbolt
Created September 4, 2019 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattgodbolt/d83c771cf1775258b46c81ed78ac057f to your computer and use it in GitHub Desktop.
Save mattgodbolt/d83c771cf1775258b46c81ed78ac057f to your computer and use it in GitHub Desktop.
utils = require('utils');
hw = utils.hexword;
hb = utils.hexbyte;
every = 0;
function spew(pc) {
console.log(`${processor.currentCycles} $${hw(pc)} A=${hb(processor.a)} X=${hb(processor.x)} Y=${hb(processor.y)}`);
// breakpoint every 100 instructions lest things go awry.
return ((++every % 100) === 0);
}
processor.debugInstruction.add(spew);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment