mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-28 06:29:37 +00:00
Adds just enough of the MSX memory map for the Z80 to appear to try to do useful things.
This commit is contained in:
parent
0eb5dd9688
commit
7a8a43a96a
@ -98,6 +98,7 @@ class ConcreteMachine:
|
|||||||
case CPU::Z80::PartialMachineCycle::Output:
|
case CPU::Z80::PartialMachineCycle::Output:
|
||||||
switch(address & 0xff) {
|
switch(address & 0xff) {
|
||||||
case 0x98: case 0x99:
|
case 0x98: case 0x99:
|
||||||
|
printf("VDP %d %02x\n", address&1, *cycle.value);
|
||||||
vdp_->set_register(address, *cycle.value);
|
vdp_->set_register(address, *cycle.value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -113,6 +114,7 @@ class ConcreteMachine:
|
|||||||
|
|
||||||
case 0xa8: case 0xa9:
|
case 0xa8: case 0xa9:
|
||||||
case 0xaa: case 0xab:
|
case 0xaa: case 0xab:
|
||||||
|
printf("8255 %d %02x\n", address&3, *cycle.value);
|
||||||
i8255_.set_register(address, *cycle.value);
|
i8255_.set_register(address, *cycle.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -131,7 +133,8 @@ class ConcreteMachine:
|
|||||||
auto roms = roms_with_names(
|
auto roms = roms_with_names(
|
||||||
"MSX",
|
"MSX",
|
||||||
{
|
{
|
||||||
"basic.rom", "main_msx1.rom"
|
"basic.rom",
|
||||||
|
"main_msx1.rom"
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!roms[0] || !roms[1]) return false;
|
if(!roms[0] || !roms[1]) return false;
|
||||||
@ -142,6 +145,15 @@ class ConcreteMachine:
|
|||||||
main_ = std::move(*roms[1]);
|
main_ = std::move(*roms[1]);
|
||||||
main_.resize(16384);
|
main_.resize(16384);
|
||||||
|
|
||||||
|
for(size_t c = 0; c < 4; ++c) {
|
||||||
|
write_pointers_[c] = &ram_[c * 16384];
|
||||||
|
read_pointers_[c] = &ram_[c * 16384];
|
||||||
|
}
|
||||||
|
read_pointers_[0] = main_.data();
|
||||||
|
write_pointers_[0] = scratch_;
|
||||||
|
read_pointers_[1] = basic_.data();
|
||||||
|
write_pointers_[1] = scratch_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,6 +169,7 @@ class ConcreteMachine:
|
|||||||
uint8_t *read_pointers_[4];
|
uint8_t *read_pointers_[4];
|
||||||
uint8_t *write_pointers_[4];
|
uint8_t *write_pointers_[4];
|
||||||
uint8_t ram_[65536];
|
uint8_t ram_[65536];
|
||||||
|
uint8_t scratch_[16384];
|
||||||
std::vector<uint8_t> basic_, main_;
|
std::vector<uint8_t> basic_, main_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user