diff --git a/src/mappers.js b/src/mappers.js index 866f87a..a2ce34c 100644 --- a/src/mappers.js +++ b/src/mappers.js @@ -1515,4 +1515,26 @@ Mappers[180].prototype.loadROM = function () { this.nes.cpu.requestIrq(this.nes.cpu.IRQ_RESET); }; +/** +* Mapper 241 (BNROM, NINA-01) +* +* @description http://wiki.nesdev.com/w/index.php/INES_Mapper_241 +* @example +* @constructor https://blog.heheda.top +*/ +Mappers[241] = function(nes) { + this.nes = nes; + }; + +Mappers[241].prototype = new Mappers[0](); + +Mappers[241].prototype.write = function(address, value) { + if (address < 0x8000) { + Mappers[0].prototype.write.apply(this, arguments); + return; + } else { + this.load32kRomBank(value, 0x8000); + } +}; + module.exports = Mappers;