diff --git a/doc/notes.txt b/doc/notes.txt
index 56cd4611..10ff4113 100644
--- a/doc/notes.txt
+++ b/doc/notes.txt
@@ -122,6 +122,7 @@ TODO:
- toolbar overlaps scope
- CPU debugging
- use $readmem for inline asm programs?
+ - can't add control instructions b/c of split
- single-stepping vector games makes screen fade
- break on stack overflow, bad op, bad access, etc
- PPU/TIA register write visualization
diff --git a/embed.html b/embed.html
index 92431fbf..2b0a4fd7 100644
--- a/embed.html
+++ b/embed.html
@@ -35,6 +35,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
+
+
+
diff --git a/index.html b/index.html
index 4057963d..eaca1fb7 100644
--- a/index.html
+++ b/index.html
@@ -225,6 +225,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
+
+
+
←↑↓→ Joystick
diff --git a/presets/nes/attributes.c b/presets/nes/attributes.c
index 3a225cb3..c185a303 100644
--- a/presets/nes/attributes.c
+++ b/presets/nes/attributes.c
@@ -34,8 +34,8 @@ void main(void) {
pal_bg(PALETTE);
// fill nametable with diamonds
- vram_adr(NAMETABLE_A);
- vram_fill(0x16, 32*30);
+ vram_adr(NAMETABLE_A); // start address ($2000)
+ vram_fill(0x16, 32*30); // fill nametable (960 bytes)
// copy attribute table from PRG ROM to VRAM
vram_write(ATTRIBUTE_TABLE, sizeof(ATTRIBUTE_TABLE));
diff --git a/src/embedui.ts b/src/embedui.ts
index 306ed26b..ffb8ceca 100644
--- a/src/embedui.ts
+++ b/src/embedui.ts
@@ -133,7 +133,7 @@ function recordVideo(intervalMsec, maxFrames, callback) {
function startPlatform(qs) {
if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'.");
- platform = new PLATFORMS[platform_id]($("#emulator")[0]);
+ platform = new PLATFORMS[platform_id]($("#emuscreen")[0]);
platform.start();
// start recorder when click on canvas (TODO?)
if (qs['rec']) {
diff --git a/src/profileview.js b/src/profileview.js
deleted file mode 100644
index 43b0588d..00000000
--- a/src/profileview.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* profiler window: currently unused */
-
-var profilelist;
-
-var pcdata = {};
-var prof_reads, prof_writes;
-
-function scrollProfileView(_ed) {
- _ed.on('scroll', function(ed, changeobj) {
- if (profilelist) {
- profilelist.container.scrollTop = ed.getScrollInfo().top;
- }
- });
-}
-
-function updateProfileWindow() {
- if (profilelist && sourcefile) {
- $("#profileview").find('[data-index]').each(function(i,e) {
- var div = $(e);
- var lineno = div.attr('data-index') | 0;
- var newtext = getProfileLine(lineno+1);
- if (newtext) {
- var oldtext = div.text();
- if (oldtext != newtext)
- div.text(newtext);
- }
- });
- }
-}
-
-function createProfileWindow() {
- profilelist = new VirtualList({
- w:$("#emulator").width(),
- h:$("#emulator").height(),
- itemHeight: getVisibleEditorLineHeight(),
- totalRows: getVisibleSourceFile().lineCount(),
- generatorFn: function(row) {
- var div = document.createElement("div");
- div.appendChild(document.createTextNode("."));
- return div;
- }
- });
- $("#profileview").empty().append(profilelist.container);
- updateProfileWindow();
-}
-
-function resetProfiler() {
- prof_reads = [];
- prof_writes = [];
- pcdata = [];
- dumplines = null;
-}
-
-function profileWindowCallback(a,v) {
- if (platform.getPC) {
- var pc = platform.getPC();
- var pcd = pcdata[pc];
- if (!pcd) {
- pcd = pcdata[pc] = {nv:1};
- }
- if (a != pc) {
- if (v >= 0) {
- pcd.lastwa = a;
- pcd.lastwv = v;
- } else {
- pcd.lastra = a;
- pcd.lastrv = platform.readAddress(a);
- }
- } else {
- pcd.nv++;
- }
- }
-}
-
-function getProfileLine(line) {
- var srcfile = getVisibleSourceFile();
- var offset = srcfile.line2offset[line];
- var offset2 = srcfile.line2offset[line+1];
- if (!(offset2 > offset)) offset2 = offset+1;
- var s = '';
- var nv = 0;
- while (offset < offset2) {
- var pcd = pcdata[offset];
- if (pcd) {
- nv += pcd.nv;
- if (pcd.lastra >= 0) {
- s += " rd [" + hex(pcd.lastra,4) + "] == " + hex(pcd.lastrv,2);
- }
- if (pcd.lastwa >= 0) {
- s += " wr " + hex(pcd.lastwv,2) + " -> [" + hex(pcd.lastwa,4) + "]";
- }
- }
- offset++;
- }
- return nv ? (lpad(nv+"",8) + s) : '.';
-}
-
-function toggleProfileWindow() {
- if ($("#memoryview").is(':visible')) toggleMemoryWindow();
- if ($("#profileview").is(':visible')) {
- profilelist = null;
- platform.getProbe().deactivate();
- $("#emulator").show();
- $("#profileview").hide();
- } else {
- createProfileWindow();
- platform.getProbe().activate(profileWindowCallback);
- $("#emulator").hide();
- $("#profileview").show();
- }
-}
-
diff --git a/src/ui.ts b/src/ui.ts
index 746e0613..c6d91084 100644
--- a/src/ui.ts
+++ b/src/ui.ts
@@ -1661,7 +1661,6 @@ function addPageFocusHandlers() {
function showInstructions() {
var div = $(document).find(".emucontrols-" + getRootBasePlatform(platform_id));
- $("#emulator").append(div);
var vcanvas = $("#emulator").find("canvas");
if (vcanvas) {
vcanvas.on('focus', () => {
@@ -1685,7 +1684,7 @@ function installGAHooks() {
function startPlatform() {
if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'.");
- platform = new PLATFORMS[platform_id]($("#emulator")[0]);
+ platform = new PLATFORMS[platform_id]($("#emuscreen")[0]);
stateRecorder = new StateRecorderImpl(platform);
PRESETS = platform.getPresets();
if (!qs['file']) {