From 94984f5db404392f2dd55f0e484a133996f75961 Mon Sep 17 00:00:00 2001 From: Colby Date: Thu, 21 Jul 2016 18:09:41 +1000 Subject: [PATCH] fix incorrect interrupt time and serving the correct interrupt --- lib/waterfoul/cpu.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/waterfoul/cpu.rb b/lib/waterfoul/cpu.rb index 82a4e94..06c32cf 100644 --- a/lib/waterfoul/cpu.rb +++ b/lib/waterfoul/cpu.rb @@ -131,13 +131,13 @@ module Waterfoul end def serve_interrupt - interrupt = Interrupt.serve_interrupt + interrupt = Interrupt.pending_interrupt # skip if there is no interrupt to serve return if interrupt == Interrupt::INTERRUPT_NONE # master disable interrupts @ime = false push_onto_stack @pc - @m = 10 + @m = 20 # point to instruction which handles appropiate interrupt case interrupt when Interrupt::INTERRUPT_VBLANK