src/main.c

changeset 97
240e195e4bed
parent 95
6e01339b218d
child 107
566cfc70ef33
     1.1 --- a/src/main.c	Tue Mar 01 21:33:32 2011 +0000
     1.2 +++ b/src/main.c	Wed Mar 02 07:16:32 2011 +0000
     1.3 @@ -358,14 +358,19 @@
     1.4  			m68k_set_irq(3);
     1.5  		} else {
     1.6  			lastirq_fdc = wd2797_get_irq(&state.fdc_ctx);
     1.7 -			m68k_set_irq(0);
     1.8 +			if (!state.timer_asserted){
     1.9 +				m68k_set_irq(0);
    1.10 +			}
    1.11  		}
    1.12  
    1.13  		// Is it time to run the 60Hz periodic interrupt yet?
    1.14  		if (clock_cycles > CLOCKS_PER_60HZ) {
    1.15  			// Refresh the screen
    1.16  			refreshScreen(screen);
    1.17 -			// TODO: trigger periodic interrupt (if enabled)
    1.18 +			if (state.timer_enabled){
    1.19 +				m68k_set_irq(6);
    1.20 +				state.timer_asserted = true;
    1.21 +			}
    1.22  			// scan the keyboard
    1.23  			keyboard_scan(&state.kbd);
    1.24  			// decrement clock cycle counter, we've handled the intr.