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

Corrects TMS' get_time_until_interrupt when the next interrupt is exactly a frame away.

This commit is contained in:
Thomas Harte 2017-12-14 21:12:51 -05:00
parent 3da323c657
commit ad50b6b1fb

View File

@ -654,7 +654,7 @@ uint8_t TMS9918::get_register(int address) {
const int half_cycles_per_frame = frame_lines_ * 228 * 2; const int half_cycles_per_frame = frame_lines_ * 228 * 2;
int half_cycles_remaining = (192 * 228 * 2 + half_cycles_per_frame - half_cycles_into_frame_.as_int()) % half_cycles_per_frame; int half_cycles_remaining = (192 * 228 * 2 + half_cycles_per_frame - half_cycles_into_frame_.as_int()) % half_cycles_per_frame;
return HalfCycles(half_cycles_remaining); return HalfCycles(half_cycles_remaining ? half_cycles_remaining : half_cycles_per_frame);
} }
bool TMS9918::get_interrupt_line() { bool TMS9918::get_interrupt_line() {