1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-02-16 17:30:27 +00:00

fixed SMS memory map

This commit is contained in:
Steven Hugg 2019-08-25 15:21:57 -04:00
parent 5323862172
commit 3b4d2b5f82

View File

@ -145,9 +145,7 @@ export class SMS extends SG1000 {
return this.rom[a + ((this.pagingRegisters[reg] & this.romPageMask) << 14)]; // * $4000
}
newMembus() {
return {
read: newAddressDecoder([
read = newAddressDecoder([
[0xc000, 0xffff, 0x1fff, (a) => { return this.ram[a]; }],
[0x0000, 0x03ff, 0x3ff, (a) => { return this.rom[a]; }],
[0x0400, 0x3fff, 0x3fff, (a) => { return this.getPagedROM(a,1); }],
@ -160,8 +158,9 @@ export class SMS extends SG1000 {
return this.getPagedROM(a,3);
}
}],
]),
write: newAddressDecoder([
]);
write = newAddressDecoder([
[0xc000, 0xfffb, 0x1fff, (a,v) => {
this.ram[a] = v;
}],
@ -177,10 +176,7 @@ export class SMS extends SG1000 {
this.cartram[(reg0 & 0x4) ? a+0x4000 : a] = v;
}
}],
]),
isContended: () => { return false; },
};
}
]);
loadROM(data:Uint8Array) {
if (data.length <= 0xc000) {