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

Ensures all 16 data lines reach the video.

This commit is contained in:
Thomas Harte 2019-10-10 23:29:46 -04:00
parent c5ebf75351
commit fda99d9c5f
3 changed files with 9 additions and 7 deletions

View File

@ -263,9 +263,9 @@ class ConcreteMachine:
}
} else {
if(cycle.operation & Microcycle::SelectByte) {
video_->write(int(address), cycle.value->halves.low);
video_->write(int(address), uint16_t(cycle.value->halves.low << cycle.byte_shift()));
} else {
video_->write(int(address), cycle.value->halves.high);
video_->write(int(address), cycle.value->full);
}
}
break;

View File

@ -233,7 +233,7 @@ uint8_t Video::read(int address) {
return 0xff;
}
void Video::write(int address, uint8_t value) {
void Video::write(int address, uint16_t value) {
LOG("[Video] write " << PADHEX(2) << int(value) << " to " << PADHEX(2) << (address & 0x3f));
address &= 0x3f;
switch(address) {
@ -247,8 +247,10 @@ void Video::write(int address, uint8_t value) {
case 0x20: case 0x21: case 0x22: case 0x23:
case 0x24: case 0x25: case 0x26: case 0x27:
case 0x28: case 0x29: case 0x2a: case 0x2b:
case 0x2c: case 0x2d: case 0x2e: case 0x2f:
palette_[address - 0x20] = uint16_t((value & 0x777) << 5);
break;
case 0x2c: case 0x2d: case 0x2e: case 0x2f: {
uint8_t *const entry = reinterpret_cast<uint8_t *>(&palette_[address - 0x20]);
entry[0] = uint8_t((value & 0x700) >> 7);
entry[1] = uint8_t((value & 0x77) << 1);
} break;
}
}

View File

@ -42,7 +42,7 @@ class Video {
void set_ram(uint16_t *);
uint8_t read(int address);
void write(int address, uint8_t value);
void write(int address, uint16_t value);
private:
Outputs::CRT::CRT crt_;