1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-04 01:57:54 +00:00

Found documentation that makes more sense, and in practice seems to be more correct: the test after vertical sync is for greater than 32, not less. Also I decided to chance my arm on counter reset also resetting interrupt request. The raster effects of Ghouls 'n' Ghosts is now pretty much correct but one line off. I think probably either something is off in my wait-two logic on the post-vsync timer event, or possibly the vsync bit exposed via the PPI doesn't mean exactly what I think it means.

This commit is contained in:
Thomas Harte 2017-08-04 08:56:09 -04:00
parent b927500487
commit d9097facf1

View File

@ -30,9 +30,9 @@ class InterruptTimer {
InterruptTimer() : timer_(0), interrupt_request_(false) {}
/*!
Indicates that a new hsync pulse has been recognised. Per documentation
difficulties, it is not presently clear to me whether this should be
the leading or trailing edge of horizontal sync.
Indicates that a new hsync pulse has been recognised. This should be
supplied on the falling edge of the CRTC HSYNC signal, which is the
trailing edge because it is active high.
*/
inline void signal_hsync() {
// Increment the timer and if it has hit 52 then reset it and
@ -49,7 +49,7 @@ class InterruptTimer {
if(reset_counter_) {
reset_counter_--;
if(!reset_counter_) {
if(timer_ < 32) {
if(timer_ & 32) {
interrupt_request_ = true;
}
timer_ = 0;
@ -76,6 +76,7 @@ class InterruptTimer {
/// Resets the timer.
inline void reset_count() {
timer_ = 0;
interrupt_request_ = false;
}
private: