void blstroid_scanline_update(screen_device &screen, int scanline) { blstroid_state *state = screen.machine->driver_data<blstroid_state>(); int offset = (scanline / 8) * 64 + 40; /* check for interrupts */ if (offset < 0x1000) if (state->playfield[offset] & 0x8000) { int width, vpos; attotime period_on; attotime period_off; /* FIXME: - the only thing this IRQ does it tweak the starting MO link */ /* unfortunately, it does it too early for the given MOs! */ /* perhaps it is not actually hooked up on the real PCB... */ return; /* set a timer to turn the interrupt on at HBLANK of the 7th scanline */ /* and another to turn it off one scanline later */ width = screen.width(); vpos = screen.vpos(); period_on = screen.time_until_pos(vpos + 7, width * 0.9); period_off = screen.time_until_pos(vpos + 8, width * 0.9); timer_set(screen.machine, period_on, NULL, 0, irq_on); timer_set(screen.machine, period_off, NULL, 0, irq_off); } }
void laserdisc_device::vblank_state_changed(screen_device &screen, bool vblank_state) { // update current track based on slider speed update_slider_pos(); // on rising edge, process previously-read frame and inform the player if (vblank_state) { // call the player's VSYNC callback player_vsync(m_metadata[m_fieldnum], m_fieldnum, machine().time()); // set a timer to begin fetching the next frame just before the VBI data would be fetched timer_set(screen.time_until_pos(16*2), TID_VBI_FETCH); } }
void skullxbo_state::scanline_update(screen_device &screen, int scanline) { /* check for interrupts in the alpha ram */ /* the interrupt occurs on the HBLANK of the 6th scanline following */ int offset = (scanline / 8) * 64 + 42; if (offset < 0x7c0 && (m_alpha_tilemap->basemem_read(offset) & 0x8000)) { int width = screen.width(); attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); m_scanline_timer->adjust(period); } /* update the playfield and motion objects */ skullxbo_scanline_update(scanline); }
static void alpha_row_update(screen_device &screen, int scanline) { skullxbo_state *state = screen.machine().driver_data<skullxbo_state>(); UINT16 *check = &state->m_alpha[(scanline / 8) * 64 + 42]; /* check for interrupts in the alpha ram */ /* the interrupt occurs on the HBLANK of the 6th scanline following */ if (check < &state->m_alpha[0x7c0] && (*check & 0x8000)) { int width = screen.width(); attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); screen.machine().scheduler().timer_set(period, FUNC(irq_gen)); } /* update the playfield and motion objects */ skullxbo_scanline_update(screen.machine(), scanline); }
void tank8_state::screen_eof_tank8(screen_device &screen, bool state) { // on falling edge if (!state) { int x; int y; const rectangle &visarea = m_screen->visible_area(); m_tilemap->draw(screen, m_helper1, visarea, 0, 0); m_helper2.fill(8, visarea); m_helper3.fill(8, visarea); draw_sprites(m_helper2, visarea); draw_bullets(m_helper3, visarea); for (y = visarea.min_y; y <= visarea.max_y; y++) { int _state = 0; const UINT16* p1 = &m_helper1.pix16(y); const UINT16* p2 = &m_helper2.pix16(y); const UINT16* p3 = &m_helper3.pix16(y); if ((m_screen->frame_number() ^ y) & 1) continue; /* video display is interlaced */ for (x = visarea.min_x; x <= visarea.max_x; x++) { UINT8 index; /* neither wall nor mine */ if ((p1[x] != 0x11) && (p1[x] != 0x13)) { _state = 0; continue; } /* neither tank nor bullet */ if ((p2[x] == 8) && (p3[x] == 8)) { _state = 0; continue; } /* bullets cannot hit mines */ if ((p3[x] != 8) && (p1[x] == 0x13)) { _state = 0; continue; } if (_state) continue; if (p3[x] != 8) { index = ((p3[x] & ~0x01) >> 1) | 0x18; if (1) index |= 0x20; if (0) index |= 0x40; if (1) index |= 0x80; } else { int sprite_num = (p2[x] & ~0x01) >> 1; index = sprite_num | 0x10; if (p1[x] == 0x11) index |= 0x20; if (y - get_y_pos(sprite_num) >= 8) index |= 0x40; /* collision on bottom side */ if (x - get_x_pos(sprite_num) >= 8) index |= 0x80; /* collision on right side */ } timer_set(screen.time_until_pos(y, x), TIMER_COLLISION, index); _state = 1; }