jsbeeb 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,7 +178,7 @@ export class TestMachine {
178
178
  return true;
179
179
  }
180
180
  });
181
- await this.runFor(secs * 1 * 1000 * 1000); // Atom is 1 MHz
181
+ await this.runFor(secs * this.model.cyclesPerSecond);
182
182
  hook.remove();
183
183
  assert(hit, "Atom did not reach keyboard input in time");
184
184
  return this.runFor(10 * 1000);
@@ -191,7 +191,7 @@ export class TestMachine {
191
191
  return true;
192
192
  }
193
193
  });
194
- await this.runFor(secs * 2 * 1000 * 1000);
194
+ await this.runFor(secs * this.model.cyclesPerSecond);
195
195
  hook.remove();
196
196
  assert(hit, "did not hit appropriate breakpoint in time");
197
197
  return this.runFor(10 * 1000);
@@ -206,7 +206,7 @@ export class TestMachine {
206
206
  return true;
207
207
  }
208
208
  });
209
- await this.runFor(secs * 2 * 1000 * 1000);
209
+ await this.runFor(secs * this.model.cyclesPerSecond);
210
210
  hook.remove();
211
211
  assert(hit, "did not hit appropriate breakpoint in time");
212
212
  }
@@ -370,7 +370,8 @@ export class TestMachine {
370
370
  let nextEventCycle = 0;
371
371
  let done = false;
372
372
 
373
- const currentCycle = () => this.processor.cycleSeconds * 2000000 + this.processor.currentCycles;
373
+ const currentCycle = () =>
374
+ this.processor.cycleSeconds * this.model.cyclesPerSecond + this.processor.currentCycles;
374
375
 
375
376
  const hook = this.processor.debugInstruction.add(() => {
376
377
  if (currentCycle() < nextEventCycle) return;
@@ -425,7 +426,8 @@ export class TestMachine {
425
426
  let done = false;
426
427
  let shiftHeld = false;
427
428
 
428
- const currentCycle = () => this.processor.cycleSeconds * 1000000 + this.processor.currentCycles;
429
+ const currentCycle = () =>
430
+ this.processor.cycleSeconds * this.model.cyclesPerSecond + this.processor.currentCycles;
429
431
 
430
432
  const isShift = (entry) => entry[0] === SHIFT[0] && entry[1] === SHIFT[1];
431
433