summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Firshman <ben@firshman.co.uk>2009-01-10 15:34:37 +0000
committerBen Firshman <ben@firshman.co.uk>2009-01-10 15:34:37 +0000
commit0d61e95ad7dbc1bbdc307a9b54d850c335819ae5 (patch)
tree6ec3bfbff7a997816dfaa377c2d823e7a79c898f
parent2cb0a49ae9fa8acca38670b14d326898da7de9e4 (diff)
downloadjsnes-0d61e95ad7dbc1bbdc307a9b54d850c335819ae5.zip
jsnes-0d61e95ad7dbc1bbdc307a9b54d850c335819ae5.tar.gz
jsnes-0d61e95ad7dbc1bbdc307a9b54d850c335819ae5.tar.bz2
Removed junk
-rw-r--r--nes.js34
-rw-r--r--ppu.js3
2 files changed, 1 insertions, 36 deletions
diff --git a/nes.js b/nes.js
index 34db014..27aee61 100644
--- a/nes.js
+++ b/nes.js
@@ -88,45 +88,11 @@ function NES() {
}
}
- //this.fillImage();
this.ctx.putImageData(this.imageData, 0, 0);
setTimeout(function(o) {o.frame()}, 0, this);
- /*$("#cpu_acc").text(this.cpu.REG_ACC.toString(16));
- $("#cpu_x").text(this.cpu.REG_X.toString(16));
- $("#cpu_y").text(this.cpu.REG_Y.toString(16));
- $("#cpu_pc").text(this.cpu.REG_PC.toString(16));
- $("#cpu_sp").text(this.cpu.REG_SP.toString(16));
- $("#cpu_f_carry").text(this.cpu.F_CARRY.toString(16));
- $("#cpu_f_zero").text(this.cpu.F_ZERO.toString(16));
- $("#cpu_f_interrupt").text(this.cpu.F_INTERRUPT.toString(16));
- $("#cpu_f_decimal").text(this.cpu.F_DECIMAL.toString(16));
- $("#cpu_f_brk").text(this.cpu.F_BRK.toString(16));
- $("#cpu_f_overflow").text(this.cpu.F_OVERFLOW.toString(16));
- $("#cpu_f_sign").text(this.cpu.F_SIGN.toString(16));
-
-
- $("#ppu_curX").text(this.ppu.curX);
- $("#ppu_scanline").text(this.ppu.scanline);*/
}
}
- this.fillImage = function() {
- var i = 0;
- for (var j = 0; j < this.ppu.buffer.length; j++) {
- this.imageData.data[i++] = this.ppu.buffer[j]&0xFF;
- this.imageData.data[i++] = (this.ppu.buffer[j]>>8)&0xFF;
- this.imageData.data[i++] = (this.ppu.buffer[j]>>16)&0xFF;
- i++;
- }
- }
-
- this.testFrame = function() {
- for (var i = 0; i < this.imageData.data.length; i+=4) {
- this.imageData.data[i] = 0xFF;
- }
- this.ctx.putImageData(this.imageData, 0, 0);
- }
-
this.stop = function() {
$("#status").text("Stopped.");
this.isRunning = false;
diff --git a/ppu.js b/ppu.js
index cb6b629..3615f8c 100644
--- a/ppu.js
+++ b/ppu.js
@@ -119,7 +119,6 @@ function PPU(nes) {
this.spr0dummybuffer = new Array(256*240);
this.dummyPixPriTable = new Array(256*240);
this.oldFrame = new Array(256*240);
- this.buffer = new Array(256*240);
this.tpix = null;
this.scanlineChanged = Array(240);
@@ -480,7 +479,7 @@ function PPU(nes) {
}
- for(var i=0;i<this.buffer.length;i++) {
+ for(var i=0;i<256*240;i++) {
this.writePixel(i, bgColor);
}
for(var i=0;i<this.pixrendered.length;i++) {