bsnes/higan/msx/cpu/memory.cpp

66 lines
1.2 KiB
C++
Raw Normal View History

auto CPU::read(uint16 address) -> uint8 {
Update to v106r70 release. byuu says: Changelog: - Interface::displays() -> vector<Display> → Interface::display() -> Display - <Platform::videoRefresh(display>, ...) → <Platform::videoFrame>(...) - <Platform::audioSample>(...) → <Platform::audioFrame>(...) - higan, icarus: use AboutDialog class instead of ad-hoc implementations - about dialog is now modal, but now has a clickable website URL - icarus: reverted if constexpr for now - MSX: implemented basic CPU, VDP support I took out the multiple displays support thing because it was never really implemented fully (Emulator::Video and the GUIs both ignored it) or used anyway. If it ends up necessary in the future, I'll worry about it then. There's enough MSX emulation now to run Mr. Do! without sound or input. I'm shipping higan with C-BIOS 0.29a, although it likely won't be good enough in the future (eg it can't do BASIC, floppy disk, or cassette loading.) I have keyboard and (not working) AY-3-8910 support in a different branch, so that won't take too long to implement. Main problem is naming all the darned keyboard keys. I think I need to change settings.bml's input mapping lines so that the key names are values instead of node names, so that any characters can appear inside of them. It turns out my MSX set uses .rom for the file extensions ... gods. So, icarus can't really import them like this. I may have to re-design icarus' importer to stop caring about the file extension and instead ask you what kind of games you are importing. There's no way icarus can heuristically guess what systems the images belong to, because many systems don't have any standardized magic bytes. I'm struggling with where to put SG-1000, SC-3000, ColecoVision, Coleco Adam stuff. I think they need to be split to two separate higan subfolders (sg and cv, most likely ...) The MS/GG share a very customized and extended VDP that the other systems don't have. The Sega and Coleco older hardware share the same TMS9918 as the MSX, yet have very different memory maps and peripherals that I don't want to mix together. Especially if we start getting into the computer-variants more.
2019-01-03 10:05:20 +00:00
uint2 slot = io.slot[address.bits(14,15)];
if(slot == 0) {
if(!address.bit(15)) return system.bios.read(address);
return 0xff;
}
if(slot == 1) {
return cartridge.read(address);
}
if(slot == 2) {
return ram.read(address);
}
if(slot == 3) {
}
return 0xff;
}
auto CPU::write(uint16 address, uint8 data) -> void {
Update to v106r70 release. byuu says: Changelog: - Interface::displays() -> vector<Display> → Interface::display() -> Display - <Platform::videoRefresh(display>, ...) → <Platform::videoFrame>(...) - <Platform::audioSample>(...) → <Platform::audioFrame>(...) - higan, icarus: use AboutDialog class instead of ad-hoc implementations - about dialog is now modal, but now has a clickable website URL - icarus: reverted if constexpr for now - MSX: implemented basic CPU, VDP support I took out the multiple displays support thing because it was never really implemented fully (Emulator::Video and the GUIs both ignored it) or used anyway. If it ends up necessary in the future, I'll worry about it then. There's enough MSX emulation now to run Mr. Do! without sound or input. I'm shipping higan with C-BIOS 0.29a, although it likely won't be good enough in the future (eg it can't do BASIC, floppy disk, or cassette loading.) I have keyboard and (not working) AY-3-8910 support in a different branch, so that won't take too long to implement. Main problem is naming all the darned keyboard keys. I think I need to change settings.bml's input mapping lines so that the key names are values instead of node names, so that any characters can appear inside of them. It turns out my MSX set uses .rom for the file extensions ... gods. So, icarus can't really import them like this. I may have to re-design icarus' importer to stop caring about the file extension and instead ask you what kind of games you are importing. There's no way icarus can heuristically guess what systems the images belong to, because many systems don't have any standardized magic bytes. I'm struggling with where to put SG-1000, SC-3000, ColecoVision, Coleco Adam stuff. I think they need to be split to two separate higan subfolders (sg and cv, most likely ...) The MS/GG share a very customized and extended VDP that the other systems don't have. The Sega and Coleco older hardware share the same TMS9918 as the MSX, yet have very different memory maps and peripherals that I don't want to mix together. Especially if we start getting into the computer-variants more.
2019-01-03 10:05:20 +00:00
uint2 slot = io.slot[address.bits(14,15)];
if(slot == 0) {
return;
}
if(slot == 1) {
return cartridge.write(address, data);
}
if(slot == 2) {
return ram.write(address, data);
}
if(slot == 3) {
return;
}
}
auto CPU::in(uint8 address) -> uint8 {
Update to v106r70 release. byuu says: Changelog: - Interface::displays() -> vector<Display> → Interface::display() -> Display - <Platform::videoRefresh(display>, ...) → <Platform::videoFrame>(...) - <Platform::audioSample>(...) → <Platform::audioFrame>(...) - higan, icarus: use AboutDialog class instead of ad-hoc implementations - about dialog is now modal, but now has a clickable website URL - icarus: reverted if constexpr for now - MSX: implemented basic CPU, VDP support I took out the multiple displays support thing because it was never really implemented fully (Emulator::Video and the GUIs both ignored it) or used anyway. If it ends up necessary in the future, I'll worry about it then. There's enough MSX emulation now to run Mr. Do! without sound or input. I'm shipping higan with C-BIOS 0.29a, although it likely won't be good enough in the future (eg it can't do BASIC, floppy disk, or cassette loading.) I have keyboard and (not working) AY-3-8910 support in a different branch, so that won't take too long to implement. Main problem is naming all the darned keyboard keys. I think I need to change settings.bml's input mapping lines so that the key names are values instead of node names, so that any characters can appear inside of them. It turns out my MSX set uses .rom for the file extensions ... gods. So, icarus can't really import them like this. I may have to re-design icarus' importer to stop caring about the file extension and instead ask you what kind of games you are importing. There's no way icarus can heuristically guess what systems the images belong to, because many systems don't have any standardized magic bytes. I'm struggling with where to put SG-1000, SC-3000, ColecoVision, Coleco Adam stuff. I think they need to be split to two separate higan subfolders (sg and cv, most likely ...) The MS/GG share a very customized and extended VDP that the other systems don't have. The Sega and Coleco older hardware share the same TMS9918 as the MSX, yet have very different memory maps and peripherals that I don't want to mix together. Especially if we start getting into the computer-variants more.
2019-01-03 10:05:20 +00:00
switch(address) {
case 0x98: return vdp.data();
case 0x99: return vdp.status();
case 0xa8: return io.slot[0] << 0
| io.slot[1] << 2
| io.slot[2] << 4
| io.slot[3] << 6;
}
return 0xff;
}
auto CPU::out(uint8 address, uint8 data) -> void {
Update to v106r70 release. byuu says: Changelog: - Interface::displays() -> vector<Display> → Interface::display() -> Display - <Platform::videoRefresh(display>, ...) → <Platform::videoFrame>(...) - <Platform::audioSample>(...) → <Platform::audioFrame>(...) - higan, icarus: use AboutDialog class instead of ad-hoc implementations - about dialog is now modal, but now has a clickable website URL - icarus: reverted if constexpr for now - MSX: implemented basic CPU, VDP support I took out the multiple displays support thing because it was never really implemented fully (Emulator::Video and the GUIs both ignored it) or used anyway. If it ends up necessary in the future, I'll worry about it then. There's enough MSX emulation now to run Mr. Do! without sound or input. I'm shipping higan with C-BIOS 0.29a, although it likely won't be good enough in the future (eg it can't do BASIC, floppy disk, or cassette loading.) I have keyboard and (not working) AY-3-8910 support in a different branch, so that won't take too long to implement. Main problem is naming all the darned keyboard keys. I think I need to change settings.bml's input mapping lines so that the key names are values instead of node names, so that any characters can appear inside of them. It turns out my MSX set uses .rom for the file extensions ... gods. So, icarus can't really import them like this. I may have to re-design icarus' importer to stop caring about the file extension and instead ask you what kind of games you are importing. There's no way icarus can heuristically guess what systems the images belong to, because many systems don't have any standardized magic bytes. I'm struggling with where to put SG-1000, SC-3000, ColecoVision, Coleco Adam stuff. I think they need to be split to two separate higan subfolders (sg and cv, most likely ...) The MS/GG share a very customized and extended VDP that the other systems don't have. The Sega and Coleco older hardware share the same TMS9918 as the MSX, yet have very different memory maps and peripherals that I don't want to mix together. Especially if we start getting into the computer-variants more.
2019-01-03 10:05:20 +00:00
switch(address) {
case 0x98: return vdp.data(data);
case 0x99: return vdp.control(data);
case 0xa8: io.slot[0] = data.bits(0,1);
io.slot[1] = data.bits(2,3);
io.slot[2] = data.bits(4,5);
io.slot[3] = data.bits(6,7);
break;
}
}