diff options
Diffstat (limited to 'source/mappers.js')
-rw-r--r-- | source/mappers.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/mappers.js b/source/mappers.js index f3d600d..fbe9aa2 100644 --- a/source/mappers.js +++ b/source/mappers.js @@ -1090,6 +1090,18 @@ JSNES.Mappers[4].prototype.loadROM = function(rom) { this.nes.cpu.requestIrq(this.nes.cpu.IRQ_RESET); }; +JSNES.Mappers[4].prototype.clockIrqCounter = function() { + if (this.irqEnable == 1) { + this.irqCounter--; + if (this.irqCounter < 0) { + // Trigger IRQ: + //nes.getCpu().doIrq(); + this.nes.cpu.requestIrq(this.nes.cpu.IRQ_NORMAL); + this.irqCounter = this.irqLatchValue; + } + } +}; + JSNES.Mappers[4].prototype.toJSON = function() { var s = JSNES.Mappers[0].prototype.toJSON.apply(this); s.command = this.command; |