Exemplo n.º 1
0
static INTERRUPT_GEN( assert_irq )
{
	cpu_set_input_line(device, 0, ASSERT_LINE);
	timer_set(device->machine, cpu_clocks_to_attotime(device, 14288), NULL, 0, clear_irq_cb);
       /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq
          fires no less than TWICE per frame, else game doesn't work right.
      6000000 / 56.747 = 105732.4616 cycles per frame, we'll call it A
      screen size is 256x256, though less is visible.
          lets assume we have 256 lines L and 40 'lines' (really line-times)
          of vblank V:
      So (A/(L+V))*V = the number of cycles spent in vblank.
      (105732.4616 / (256+40)) * 40 = 14288.17049 z80 clocks in vblank
       */
}
Exemplo n.º 2
0
static WRITE8_HANDLER( thunderx_1f98_w )
{
// logerror("%04x: 1f98_w %02x\n",cpu_get_pc(space->cpu),data);

	/* bit 0 = enable char ROM reading through the video RAM */
	K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);

	/* bit 1 = PMC-BK */
	pmcbank = (data & 0x02) >> 1;

	/* bit 2 = do collision detection when 0->1 */
	if ((data & 4) && !(thunderx_1f98_data & 4))
	{
		calculate_collisions();

		/* 100 cycle delay is arbitrary */
		timer_set(space->machine, cpu_clocks_to_attotime(space->cpu,100), NULL, 0, thunderx_firq_callback);
	}

	thunderx_1f98_data = data;
}