Permalink
Browse files

Prevent lockups

  • Loading branch information...
1 parent 0d776c9 commit e308b2508fc54ebcda59d67fa057108bca47d8df @asterick committed Oct 7, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −0 README.md
  2. +3 −3 src/chips/audio/noise.js
View
2 README.md
@@ -35,3 +35,5 @@ so you may need to run a lightweight http server to run locally.
Bugs
----
Predicitions are off
+Noise playback frequency is wrong (a guess at best)
+
View
6 src/chips/audio/noise.js
@@ -25,18 +25,18 @@ define([], function () {
// Determine our current sample
this.frequencyCounter += ticks;
- var shifts = Math.floor(this.frequencyCounter / this.overflow);
+ var shifts = this.frequencyCounter / this.overflow;
this.frequencyCounter %= this.overflow;
if (shifts) {
if (this.polyform) {
- while (shifts--) {
+ while (shifts-- > 0) {
shifted = this.lsfr >>> 1,
bit = (this.lsfr ^ shifted) & 1;
this.lsfr = (shifted & 0x3FBF) | (bit << 6);
}
} else {
- while (shifts--) {
+ while (shifts-- > 0) {
shifted = this.lsfr >>> 1;
bit = (this.lsfr ^ shifted) & 1;
this.lsfr = shifted | (bit << 14);

0 comments on commit e308b25

Please sign in to comment.