1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Make a basic attempt at RAM.

This commit is contained in:
Thomas Harte 2023-01-14 14:58:12 -05:00
parent 1e17fc71ab
commit ced002125e

View File

@ -100,6 +100,15 @@ void RP5C01::write(int address, uint8_t value) {
return;
}
switch(mode_) {
case 3:
address += 13;
[[fallthrough]];
case 2:
ram_[size_t(address)] = value & 0xf;
return;
}
// TODO.
printf("RP-5C01 write of %d to %d in mode %d\n", value, address & 0xf, mode_);
}
@ -107,6 +116,16 @@ void RP5C01::write(int address, uint8_t value) {
uint8_t RP5C01::read(int address) {
address &= 0xf;
if(address < 0xd) {
switch(mode_) {
case 3:
address += 13;
[[fallthrough]];
case 2:
return 0xf0 | ram_[size_t(address)];
}
}
// TODO.
printf("RP-5C01 read from %d in mode %d\n", address & 0xf, mode_);
return 0xff;