Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 authored Mar 31, 2024
1 parent 893c5a5 commit 82e6781
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/papu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -59,7 +60,7 @@ var PAPU = function (nes) {
this.dcValue = 0;

// Master volume:
this.masterVolume = 0;
this.masterVolume = 256;

// Stereo positioning:
this.stereoPosLSquare1 = null;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 82e6781

Please sign in to comment.