Skip to content

Commit

Permalink
Fix bugs causing the disc spinning noise to never stop. (#285)
Browse files Browse the repository at this point in the history
- Hard reset would lose track of state.
- The 1770 driver would often cause bad state upon an error.
  • Loading branch information
scarybeasts committed Oct 21, 2019
1 parent ba9f03c commit 816f636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions 6502.js
Expand Up @@ -936,6 +936,7 @@ define(['./utils', './6502.opcodes', './via', './acia', './serial', './tube', '.
this.touchScreen = new TouchScreen(this.scheduler);
this.acia = new Acia(this, this.soundChip.toneGenerator, this.scheduler, this.touchScreen);
this.serial = new Serial(this.acia);
this.ddNoise.spinDown();
this.fdc = new model.Fdc(this, this.ddNoise, this.scheduler);
this.crtc = this.video.crtc;
this.ula = this.video.ula;
Expand Down
5 changes: 5 additions & 0 deletions ddnoise.js
Expand Up @@ -88,6 +88,11 @@ define(['./utils', 'underscore', 'promise'], function (utils, _) {
this.state = SPIN_UP;
var self = this;
this.play(this.sounds.motorOn).then(function () {
// Handle race: we may have had spinDown() called on us before the
// spinUp() initial sound finished playing.
if (self.state === IDLE) {
return;
}
self.play(self.sounds.motor, true).then(function (source) {
self.motor = source;
self.state = SPINNING;
Expand Down

0 comments on commit 816f636

Please sign in to comment.