mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-20 14:29:11 +00:00
Make a basic attempt at RAM.
This commit is contained in:
parent
1e17fc71ab
commit
ced002125e
@ -100,6 +100,15 @@ void RP5C01::write(int address, uint8_t value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch(mode_) {
|
||||||
|
case 3:
|
||||||
|
address += 13;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 2:
|
||||||
|
ram_[size_t(address)] = value & 0xf;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO.
|
// TODO.
|
||||||
printf("RP-5C01 write of %d to %d in mode %d\n", value, address & 0xf, mode_);
|
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) {
|
uint8_t RP5C01::read(int address) {
|
||||||
address &= 0xf;
|
address &= 0xf;
|
||||||
|
|
||||||
|
if(address < 0xd) {
|
||||||
|
switch(mode_) {
|
||||||
|
case 3:
|
||||||
|
address += 13;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 2:
|
||||||
|
return 0xf0 | ram_[size_t(address)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO.
|
// TODO.
|
||||||
printf("RP-5C01 read from %d in mode %d\n", address & 0xf, mode_);
|
printf("RP-5C01 read from %d in mode %d\n", address & 0xf, mode_);
|
||||||
return 0xff;
|
return 0xff;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user