1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Corrects counter scales, adds a read for $c032.

Albeit that I have no idea what that's supposed to read as.
This commit is contained in:
Thomas Harte 2020-11-29 20:08:59 -05:00
parent a9ce43d244
commit 11fe8ab6db
2 changed files with 6 additions and 2 deletions

View File

@ -232,6 +232,10 @@ class ConcreteMachine:
case Write(0xc032):
video_->clear_interrupts(*value);
break;
case Read(0xc032):
// TODO: this seems to be undocumented, but used. What value is likely?
*value = 0xff;
break;
// Shadow register.
case Read(0xc035):

View File

@ -440,8 +440,8 @@ Video::Counters Video::get_counters(Cycles offset) {
cycles_into_frame = (cycles_into_frame + 25 - start_of_pixels)%(Lines * CyclesPerLine);
// Break it down.
const auto cycles_into_line = cycles_into_frame / CyclesPerLine;
const auto lines_into_frame = (cycles_into_frame % CyclesPerLine) + 0x100;
const auto cycles_into_line = cycles_into_frame / (CyclesPerLine * CyclesPerTick);
const auto lines_into_frame = (cycles_into_frame % (CyclesPerLine * CyclesPerTick)) + 0x100;
return Counters(
lines_into_frame - ((lines_into_frame / 0x200) * 0x106), // TODO: this assumes NTSC.