summaryrefslogtreecommitdiffstats
path: root/source/mappers.js
diff options
context:
space:
mode:
authorBen Firshman <ben@firshman.co.uk>2010-07-07 14:03:29 +0100
committerBen Firshman <ben@firshman.co.uk>2010-07-07 14:03:29 +0100
commit0c0acc3a516d299cbc006be76f9aa8a595a43e16 (patch)
treec86a00d2a12dc2c0f0a38cc858c83abc34756a59 /source/mappers.js
parent6759b121a627ebbf6afcb344b70c88afbe765a9f (diff)
downloadjsnes-0c0acc3a516d299cbc006be76f9aa8a595a43e16.zip
jsnes-0c0acc3a516d299cbc006be76f9aa8a595a43e16.tar.gz
jsnes-0c0acc3a516d299cbc006be76f9aa8a595a43e16.tar.bz2
Brought up to date with vNES 2.13. Just missing all the new mappers
Diffstat (limited to 'source/mappers.js')
-rw-r--r--source/mappers.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/mappers.js b/source/mappers.js
index 58d979a..bb6ccaf 100644
--- a/source/mappers.js
+++ b/source/mappers.js
@@ -55,6 +55,22 @@ JSNES.Mappers[0].prototype = {
this.regWrite(address, value);
}
},
+
+ writelow: function(address, value) {
+ if (address < 0x2000) {
+ // Mirroring of RAM:
+ this.nes.cpu.mem[address & 0x7FF] = value;
+ }
+ else if (address > 0x4017) {
+ this.nes.cpu.mem[address] = value;
+ }
+ else if (address > 0x2007 && address < 0x4000) {
+ this.regWrite(0x2000 + (address & 0x7), value);
+ }
+ else {
+ this.regWrite(address, value);
+ }
+ },
load: function(address) {
// Wrap around: