diff --git a/src/papu.js b/src/papu.js index c1a196f..59ca413 100644 --- a/src/papu.js +++ b/src/papu.js @@ -2,7 +2,8 @@ var utils = require("./utils"); var CPU_FREQ_NTSC = 1789772.5; //1789772.72727272d; // var CPU_FREQ_PAL = 1773447.4; -var APU_TO_CPU_CYCLE = 14915; +var APU_TO_CPU_CYCLE_NTSC = 14915; +// var APU_TO_CPU_CYCLE_PAL = 16627; var PAPU = function (nes) { this.nes = nes; @@ -59,7 +60,7 @@ var PAPU = function (nes) { this.dcValue = 0; // Master volume: - this.masterVolume = 0; + this.masterVolume = 256; // Stereo positioning: this.stereoPosLSquare1 = null; @@ -107,7 +108,7 @@ PAPU.prototype = { (1024.0 * CPU_FREQ_NTSC) / this.sampleRate ); - this.frameTime = APU_TO_CPU_CYCLE; + this.frameTime = APU_TO_CPU_CYCLE_NTSC; this.sampleTimer = 0; @@ -381,7 +382,7 @@ PAPU.prototype = { // Clock frame counter at double CPU speed: this.masterFrameCounter += nCycles << 1; if (this.masterFrameCounter >= this.frameTime) { - // 240Hz tick: + // 240Hz (NTSC) tick: this.masterFrameCounter -= this.frameTime; this.frameCounterTick(); } @@ -466,7 +467,7 @@ PAPU.prototype = { this.frameIrqActive = true; } - // End of 240Hz tick + // End of 240Hz (NSTC) tick }, // Samples the channels, mixes the output together, then writes to buffer.