Mercurial > repos > simple16
diff src/main.c @ 26:083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 01 Apr 2016 21:34:38 -0700 |
parents | fb14515266f4 |
children | c677507682e3 |
line wrap: on
line diff
--- a/src/main.c Thu Mar 31 23:25:52 2016 -0700 +++ b/src/main.c Fri Apr 01 21:34:38 2016 -0700 @@ -134,7 +134,10 @@ } if (mask & 2) { vdp_run(&system->video, context->cycles); - //TODO: VBlank interrupt + uint32_t vnext = vdp_next_interrupt(&system->video); + if (vnext < next) { + next = vnext; + } } return next; } @@ -148,7 +151,9 @@ bits |= 1; } vdp_run(&system->video, context->cycles); - //TODO: VBlank interrupt + if (vdp_interrupt_pending(&system->video)) { + bits |= 2; + } return bits; } @@ -158,8 +163,9 @@ if (which == 0) { timer_run(&system->timer, context->cycles); system->timer.pending = 0; + } else { + vdp_ack_interrupt(&system->video); } - //TODO: VBlank interrupt } memory_region regions[] = {