From 4b2b59c2db70647147930754409ecf90b116424c Mon Sep 17 00:00:00 2001 From: boxerbomb Date: Thu, 20 Apr 2017 12:45:02 +0200 Subject: [PATCH] Add files via upload Adds a select menu to choose from all the ROM's and a Load button to reset the machine with the selected ROM --- index.html | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index be121da..ea8b299 100644 --- a/index.html +++ b/index.html @@ -39,9 +39,42 @@
-
+ + +
+ +

+ + +
@@ -78,12 +111,28 @@

Registers

var display = new Display($("canvas")[0]) var vm = new VM(display) var vmDebugger = new Debugger(vm) + var e = document.getElementById("romSelect") + var romChoice = e.options[e.selectedIndex].value + + loadROM(romChoice, function(program) { + vm.loadProgram(program) + vmDebugger.debug() + }) - loadROM("MAZE", function(program) { + $("#load").click(function() { + //Creates a reset by updating these varaibles. I tried adding a vm.reset() function and updating the debugger and display but this seems to be a quicker fix. + display = new Display($("canvas")[0]) + vm= new VM(display) + vmDebugger = new Debugger(vm) + + e = document.getElementById("romSelect") + romChoice = e.options[e.selectedIndex].value + loadROM(romChoice, function(program) { vm.loadProgram(program) vmDebugger.debug() }) + }) $("#run").click(function() { vm.run() })