static TIMER_DEVICE_CALLBACK( vball_scanline ) { vball_state *state = timer.machine().driver_data<vball_state>(); int scanline = param; int screen_height = timer.machine().primary_screen->height(); int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1); int vcount = scanline_to_vcount(scanline); /* Update to the current point */ if (scanline > 0) { timer.machine().primary_screen->update_partial(scanline - 1); } /* IRQ fires every on every 8th scanline */ if (!(vcount_old & 8) && (vcount & 8)) { cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE); } /* NMI fires on scanline 248 (VBL) and is latched */ if (vcount == 0xf8) { cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE); } /* Save the scroll x register value */ if (scanline < 256) { state->m_vb_scrollx[255 - scanline] = (state->m_vb_scrollx_hi + state->m_vb_scrollx_lo + 4); } }
static TIMER_DEVICE_CALLBACK( xain_scanline ) { xain_state *state = timer.machine().driver_data<xain_state>(); int scanline = param; int screen_height = timer.machine().primary_screen->height(); int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1); int vcount = scanline_to_vcount(scanline); /* update to the current point */ if (scanline > 0) { timer.machine().primary_screen->update_partial(scanline - 1); } /* FIRQ (IMS) fires every on every 8th scanline (except 0) */ if (!(vcount_old & 8) && (vcount & 8)) { cputag_set_input_line(timer.machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); } /* NMI fires on scanline 248 (VBL) and is latched */ if (vcount == 0xf8) { cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE); } /* VBLANK input bit is held high from scanlines 248-255 */ if (vcount >= 248-1) // -1 is a hack - see notes above { state->m_vblank = 1; } else { state->m_vblank = 0; } }