Skip to content

Commit

Permalink
More jslintsimpli
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Nov 2, 2024
1 parent a337fb9 commit 10219d7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/emulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,15 @@ export class Emulator {
frameFunc(now) {
requestAnimationFrame(this.onAnimFrame);
// Take snapshot
if (this.loop === true && this.state === null && this.cpu.currentCycles >= this.loopStart) {
if (this.loop && !this.state && this.cpu.currentCycles >= this.loopStart) {
this.pause();
this.state = this.snapshot.save(this.cpu).state;
this.start();
console.log("snapshot taken at " + this.cpu.currentCycles + " cycles");
}

// Loop back
if (
this.loop === true &&
this.state !== null &&
this.cpu.currentCycles >= this.loopStart + this.loopLength
) {
if (this.loop && this.state && this.cpu.currentCycles >= this.loopStart + this.loopLength) {
this.pause();
this.snapshot.load(this.state, this.cpu);
this.cpu.currentCycles = this.loopStart;
Expand Down

0 comments on commit 10219d7

Please sign in to comment.