1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Fix relative offset.

This commit is contained in:
Thomas Harte 2023-03-06 22:49:21 -05:00
parent a13905acf9
commit f8eb2199c2

View File

@ -269,7 +269,7 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
if constexpr (is_yamaha_vdp(personality)) {
if(
this->vertical_active_ &&
this->fetch_pointer_.row == ((this->line_interrupt_target_ + Storage<personality>::vertical_offset_) & 0xff)
this->fetch_pointer_.row == ((this->line_interrupt_target_ - Storage<personality>::vertical_offset_) & 0xff)
) {
this->line_interrupt_pending_ = true;
}
@ -1241,7 +1241,7 @@ HalfCycles TMS9918<personality>::get_next_sequence_point() const {
}
if constexpr (is_yamaha_vdp(personality)) {
next_line_interrupt_row = (this->line_interrupt_target_ + Storage<personality>::vertical_offset_) & 0xff;
next_line_interrupt_row = (this->line_interrupt_target_ - Storage<personality>::vertical_offset_) & 0xff;
}
// If there's actually no interrupt upcoming, despite being enabled, either return