@@ -2,7 +2,8 @@ var utils = require("./utils");
2
2
3
3
var CPU_FREQ_NTSC = 1789772.5 ; //1789772.72727272d;
4
4
// var CPU_FREQ_PAL = 1773447.4;
5
- var APU_TO_CPU_CYCLE = 14915 ;
5
+ var APU_TO_CPU_CYCLE_NTSC = 14915 ;
6
+ // var APU_TO_CPU_CYCLE_PAL = 16627;
6
7
7
8
var PAPU = function ( nes ) {
8
9
this . nes = nes ;
@@ -59,7 +60,7 @@ var PAPU = function (nes) {
59
60
this . dcValue = 0 ;
60
61
61
62
// Master volume:
62
- this . masterVolume = 0 ;
63
+ this . masterVolume = 256 ;
63
64
64
65
// Stereo positioning:
65
66
this . stereoPosLSquare1 = null ;
@@ -107,7 +108,7 @@ PAPU.prototype = {
107
108
( 1024.0 * CPU_FREQ_NTSC ) / this . sampleRate
108
109
) ;
109
110
110
- this . frameTime = APU_TO_CPU_CYCLE ;
111
+ this . frameTime = APU_TO_CPU_CYCLE_NTSC ;
111
112
112
113
this . sampleTimer = 0 ;
113
114
@@ -381,7 +382,7 @@ PAPU.prototype = {
381
382
// Clock frame counter at double CPU speed:
382
383
this . masterFrameCounter += nCycles << 1 ;
383
384
if ( this . masterFrameCounter >= this . frameTime ) {
384
- // 240Hz tick:
385
+ // 240Hz (NTSC) tick:
385
386
this . masterFrameCounter -= this . frameTime ;
386
387
this . frameCounterTick ( ) ;
387
388
}
@@ -466,7 +467,7 @@ PAPU.prototype = {
466
467
this . frameIrqActive = true ;
467
468
}
468
469
469
- // End of 240Hz tick
470
+ // End of 240Hz (NSTC) tick
470
471
} ,
471
472
472
473
// Samples the channels, mixes the output together, then writes to buffer.
0 commit comments