1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-09 01:29:44 +00:00

Factor vsync state into IO reads.

This commit is contained in:
Thomas Harte 2024-04-09 21:49:00 -04:00
parent 6123350895
commit a5a653d684
2 changed files with 7 additions and 2 deletions

View File

@ -180,8 +180,9 @@ struct InputOutputController {
case 0x00: {
uint8_t value = control_ | 0xc0;
value &= ~(i2c_.clock() ? 2 : 0);
value &= ~(i2c_.data() ? 1 : 0);
value &= ~(i2c_.clock() ? 0x02 : 0x00);
value &= ~(i2c_.data() ? 0x01 : 0x00);
value &= ~(video_.vsync_active() ? 0x80 : 0x00);
set_byte(value);
// logger.error().append("IOC control read: C:%d D:%d", !(value & 2), !(value & 1));
} break;

View File

@ -327,6 +327,10 @@ struct Video {
return interrupt;
}
bool vsync_active() const {
return vertical_state_.phase() == Phase::Sync;
}
void set_frame_start(uint32_t address) { frame_start_ = address; }
void set_buffer_start(uint32_t address) { buffer_start_ = address; }
void set_buffer_end(uint32_t address) { buffer_end_ = address; }