Skip to content

Commit 766ead1

Browse files
ZhaoTonggangbfirsh
authored andcommitted
Update mappers.js
add mapper241
1 parent 76f58d6 commit 766ead1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/mappers.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,4 +1515,26 @@ Mappers[180].prototype.loadROM = function () {
15151515
this.nes.cpu.requestIrq(this.nes.cpu.IRQ_RESET);
15161516
};
15171517

1518+
/**
1519+
* Mapper 241 (BNROM, NINA-01)
1520+
*
1521+
* @description http://wiki.nesdev.com/w/index.php/INES_Mapper_241
1522+
* @example
1523+
* @constructor https://blog.heheda.top
1524+
*/
1525+
Mappers[241] = function(nes) {
1526+
this.nes = nes;
1527+
};
1528+
1529+
Mappers[241].prototype = new Mappers[0]();
1530+
1531+
Mappers[241].prototype.write = function(address, value) {
1532+
if (address < 0x8000) {
1533+
Mappers[0].prototype.write.apply(this, arguments);
1534+
return;
1535+
} else {
1536+
this.load32kRomBank(value, 0x8000);
1537+
}
1538+
};
1539+
15181540
module.exports = Mappers;

0 commit comments

Comments
 (0)