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()
})