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

Adds hsync and vsync interrupts.

This commit is contained in:
Thomas Harte 2019-10-25 22:42:13 -04:00
parent 872897029e
commit 2207638287

View File

@ -563,8 +563,8 @@ class ConcreteMachine:
video_ += cycles_until_video_event_; video_ += cycles_until_video_event_;
cycles_until_video_event_ = video_->get_next_sequence_point(); cycles_until_video_event_ = video_->get_next_sequence_point();
// TODO: push v/hsync/display_enable elsewhere.
mfp_->set_timer_event_input(1, video_->display_enabled()); mfp_->set_timer_event_input(1, video_->display_enabled());
update_interrupt_input();
} }
cycles_until_video_event_ -= length; cycles_until_video_event_ -= length;
video_ += length; video_ += length;
@ -641,6 +641,10 @@ class ConcreteMachine:
void update_interrupt_input() { void update_interrupt_input() {
if(mfp_->get_interrupt_line()) { if(mfp_->get_interrupt_line()) {
mc68000_.set_interrupt_level(6); mc68000_.set_interrupt_level(6);
} else if(video_->vsync()) {
mc68000_.set_interrupt_level(4);
} else if(video_->hsync()) {
mc68000_.set_interrupt_level(2);
} else { } else {
mc68000_.set_interrupt_level(0); mc68000_.set_interrupt_level(0);
} }