Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a single-step button.

  • Loading branch information...
commit e59c9e991f2a271268344fc1e32121264be2dffe 1 parent fa7b174
@nelhage authored
Showing with 9 additions and 0 deletions.
  1. +1 −0  beta.html
  2. +8 −0 betaweb.js
View
1  beta.html
@@ -23,6 +23,7 @@
<div id='cpucontrol'>
<input id='resetbutton' type="button" value="reset" onclick='resetBeta();'/>
<input id='playpausebutton' type="button" value="run" onclick='playPauseBeta();'/>
+ <input id='stepbutton' type="button" value="step" onclick='stepBeta();'/>
</div>
<div id='romcontrol'>
Load ROM:
View
8 betaweb.js
@@ -146,11 +146,19 @@ function playPauseBeta() {
refreshDisplay();
}
+function stepBeta() {
+ CPU.step();
+ refreshDisplay();
+}
+
function refreshDisplay() {
var div = document.getElementById('pcval');
var button = document.getElementById('playpausebutton');
+ var step = document.getElementById('stepbutton');
var i;
+ step.disabled = (CPU.halt || CPU.running());
+
if (CPU.halt) {
div.textContent = "<stopped>";
button.disabled = true;
Please sign in to comment.
Something went wrong with that request. Please try again.