Пример #1
0
static void flyball_quarter_callback(int scanline)
{
	int potsense[64], i;

	memset(potsense, 0, sizeof potsense);

	potsense[readinputport(1)] |= 1;
	potsense[readinputport(2)] |= 2;
	potsense[readinputport(3)] |= 4;
	potsense[readinputport(4)] |= 8;

	for (i = 0; i < 64; i++)
	{
		if (potsense[i] != 0)
		{
			timer_set(cpu_getscanlinetime(scanline + i), potsense[i], flyball_joystick_callback);
		}
	}

	scanline += 0x40;
	scanline &= 0xff;

	timer_set(cpu_getscanlinetime(scanline), scanline, flyball_quarter_callback);

	flyball_potsense = 0;
	flyball_potmask = 0;
}
Пример #2
0
INLINE void TMS34061_register_w(int offset, int data)
{
	int status = 0;		

	/* Calculate which register and which half we're accessing */
	int reg = offset >> 2;

	/* Set register */
	if (offset & 0x02)
	{
		
		regs[reg] = ((regs[reg] & 0xff) | (data << 8));
	}
	else
	{
		
		regs[reg] = ((regs[reg] & 0xff00) | data);
	}

	switch (reg)
	{
	case REG_VERINT:
		
		timer_reset(timer, cpu_getscanlinetime(regs[reg]));

		

	case REG_CONTROL1:
	case REG_CONTROL2:
	case REG_XYADDRESS:
		status = 1;		
		break;
	}
}
Пример #3
0
static void capbowl_update(int scan)
{
	video_screen_update_partial(0, scan - 1);
	scan += 32;
	if (scan > 240) scan = 32;
	timer_set(cpu_getscanlinetime(scan), scan, capbowl_update);
}
Пример #4
0
static void capbowl_update(int scan)
{
	force_partial_update(scan - 1);
	scan += 32;
	if (scan > 240) scan = 32;
	timer_set(cpu_getscanlinetime(scan), scan, capbowl_update);
}
Пример #5
0
void polepos_init_machine(void)
{
	/* reset all the interrupt states */
	z80_irq_enabled = z8002_1_nvi_enabled = z8002_2_nvi_enabled = 0;

	/* reset the ADC state */
	adc_input = 0;

	/* reset the protection state */
	ic25_last_result = 0;
	ic25_last_signed = 0;
	ic25_last_unsigned = 0;

	/* Initialize the MCU */
	polepos_mcu.enabled = 0; /* disabled */
	polepos_mcu.status = 0x10; /* ready to transfer */
	polepos_mcu.transfer_id = 0; /* clear out the transfer id */
	polepos_mcu.timer = 0;
	polepos_mcu.start = 0;

	/* halt the two Z8002 cpus */
	cpu_set_reset_line(1, ASSERT_LINE);
	cpu_set_reset_line(2, ASSERT_LINE);

	/* start a timer for the Z80's interrupt */
	timer_set(cpu_getscanlinetime(0), 0, z80_interrupt);
}
Пример #6
0
static void z80_interrupt(int scanline)
{
	cpu_set_irq_line(0, 0, ((scanline & 64) == 0) ? ASSERT_LINE : CLEAR_LINE);
	scanline += 64;
	if (scanline >= 256) scanline = 0;
	timer_set(cpu_getscanlinetime(scanline), scanline, z80_interrupt);
}
Пример #7
0
static void update_callback(int scanline)
{
	/* update the previous chunk of scanlines */
	starfire_video_update(scanline, SCANLINE_UPDATE_CHUNK);
	scanline += SCANLINE_UPDATE_CHUNK;
	if (scanline >= Machine->drv->screen_height)
		scanline = 32;
	timer_set(cpu_getscanlinetime(scanline + SCANLINE_UPDATE_CHUNK - 1), scanline, update_callback);
}
Пример #8
0
static void destroyr_frame_callback(int dummy)
{
	destroyr_potsense[0] = 0;
	destroyr_potsense[1] = 0;

	/* PCB supports two dials, but cab has only got one */

	timer_set(cpu_getscanlinetime(readinputport(3)), 0, destroyr_dial_callback);
}
Пример #9
0
static MACHINE_INIT( videopin )
{
	timer_set(cpu_getscanlinetime(32), 32, interrupt_callback);

	/* both output latches are cleared on reset */

	videopin_out1_w(0, 0);
	videopin_out2_w(0, 0);
}
Пример #10
0
static void scanline_callback(int scanline)
{
	/* copy the spriteram */
	memcpy(spriteram_buffer + SPRITERAM_SIZE * (scanline / CHUNK_SIZE), spriteram, SPRITERAM_SIZE);

	/* fire after the next 8 scanlines */
	scanline += CHUNK_SIZE;
	if (scanline >= MAX_SCANLINE)
		scanline = 0;
	timer_set(cpu_getscanlinetime(scanline), scanline, scanline_callback);
}
Пример #11
0
void qix_scanline_callback(int scanline)
{
	/* force a partial update */
	force_partial_update(scanline - 1);

	/* set a timer for the next increment */
	scanline += SCANLINE_INCREMENT;
	if (scanline > 256)
		scanline = SCANLINE_INCREMENT;
	timer_set(cpu_getscanlinetime(scanline), scanline, qix_scanline_callback);
}
Пример #12
0
static void TMS34061_intcallback(int param)
{
	
	timer_reset(timer, cpu_getscanlinetime(regs[REG_VERINT]));

	
    if (!(regs[REG_CONTROL1] & 0x400)) return;

	regs[REG_STATUS] |= 0x0001;

	cpu_cause_interrupt (param, intf->vertical_interrupt());
}
Пример #13
0
static void scanline_callback(int scanline)
{
	/* bit 0 goes hi whenever line V6 from video part goes lo->hi */
	/* that is when scanline is 64 and 192 accordingly */
	if (LS74_clr != 0)
		LS74_q = 1;

	scanline += 128;
	scanline &= 255;

	timer_adjust(interrupt_timer, cpu_getscanlinetime( scanline ), scanline, 0);
}
Пример #14
0
static MACHINE_RESET( magmax )
{
	timer_adjust(interrupt_timer, cpu_getscanlinetime(64), 64, 0);

#if 0
	{
		int i;
		for (i=0; i<9; i++)
			logerror("SOUND Chan#%i name=%s\n", i, mixer_get_name(i) );
	}
#endif
}
Пример #15
0
static void dma_timer( int n_channel, UINT32 n_scanline )
{
    if( n_scanline != 0xffffffff )
    {
        timer_adjust( m_p_timer_dma[ n_channel ], cpu_getscanlinetime( n_scanline ), n_channel, 0 );
    }
    else
    {
        timer_adjust( m_p_timer_dma[ n_channel ], TIME_NEVER, 0, 0 );
    }
    m_p_n_dma_lastscanline[ n_channel ] = n_scanline;
}
Пример #16
0
static void scanline_callback(int scanline)
{
	/* interrupt is generated whenever line V6 from video part goes lo->hi */
	/* that is when scanline is 64 and 192 accordingly */

	cpu_set_irq_line(2,0,ASSERT_LINE);	/* sound cpu interrupt (music tempo) */

	scanline += 128;
	scanline &= 255;

	timer_set( cpu_getscanlinetime( scanline ), scanline, scanline_callback );
}
Пример #17
0
/* timer callback to handle reloading the H counter and generate IRQ4 */
void vdp_reload_counter(int scanline)
{
	/* generate an int if they're enabled */
	if (genesis_vdp_regs[0] & 0x10)/* && !(misc_io_data[7] & 0x10))*/
		if (scanline != 0 || genesis_vdp_regs[10] == 0)
		{
			scanline_int = 1;
			update_interrupts();
			timer_set(cpu_getscanlinetime(scanline + 1), 0, vdp_int4_off);
		}

	/* advance to the next scanline */
	/* behavior 2: 0 count means interrupt after one scanline */
	/* (this behavior matches the Sega C2 emulator) */
	scanline += genesis_vdp_regs[10] + 1;
	if (scanline >= 224)
		scanline = 0;

	/* set a timer */
	timer_adjust(scan_timer, cpu_getscanlinetime(scanline) + cpu_getscanlineperiod() * (320. / 342.), scanline, 0);
}
Пример #18
0
static MACHINE_RESET( flyball )
{
	int i;

	/* address bits 0 through 8 are inverted */

	UINT8* ROM = memory_region(REGION_CPU1) + 0x2000;

	for (i = 0; i < 0x1000; i++)
		rombase[i] = ROM[i ^ 0x1ff];

	timer_set(cpu_getscanlinetime(0), 0, flyball_quarter_callback);
}
Пример #19
0
static void periodic_callback(int scanline)
{
	cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);

	scanline += 64;

	if (scanline >= 262)
	{
		scanline = 0;
	}

	timer_set(cpu_getscanlinetime(scanline), scanline, periodic_callback);
}
Пример #20
0
static void interrupt_callback(int scanline)
{
	cpunum_set_input_line(0, 0, PULSE_LINE);

	scanline = scanline + 32;

	if (scanline >= 262)
	{
		scanline = 16;
	}

	timer_set(cpu_getscanlinetime(scanline), scanline, interrupt_callback);
}
Пример #21
0
static void interrupt_timer(int param)
{
	/* 128V, 64V and 32V go to D */
	TTL7474_d_w(0, (param & 0xe0) != 0xe0);

	/* 16V clocks the flip-flop */
	TTL7474_clock_w(0, param & 0x10);

	param = (param + 0x10) & 0xff;

	timer_adjust(int_timer, cpu_getscanlinetime(param), param, 0);

	TTL7474_update(0);
}
Пример #22
0
ADDRESS_MAP_END

static void scanline_callback(int scanline)
{
	/* interrupt is generated whenever line V6 from video part goes lo->hi */
	/* that is when scanline is 64 and 192 accordingly */

	cpunum_set_input_line(2,0,ASSERT_LINE);	/* sound cpu interrupt (music tempo) */

	scanline += 128;
	scanline &= 255;

	timer_adjust(interrupt_timer, cpu_getscanlinetime(scanline), scanline, 0);
}
Пример #23
0
INLINE double get_verint_scanline_time(void)
{
	int scanline = tms34061.regs[TMS34061_VERINT] - tms34061.regs[TMS34061_VERENDBLNK];
	double result;

	if (scanline < 0)
		scanline += tms34061.regs[TMS34061_VERTOTAL];

	/* we fire at the HBLANK signal */
	result = cpu_getscanlinetime(scanline) + cpu_getscanlineperiod() * 0.9;
	if (result < cpu_getscanlineperiod() * 10)
		result += TIME_IN_HZ(Machine->screen[0].refresh);

	return result;
}
Пример #24
0
static void periodic_callback(int scanline)
{
	cpunum_set_input_line(0, 0, PULSE_LINE);

	/* IRQs are generated by inverse 16V signal */

	scanline += 32;

	if (scanline > 256)
	{
		scanline = 0;
	}

	timer_set(cpu_getscanlinetime(scanline), scanline, periodic_callback);
}
Пример #25
0
static void interrupt_callback(int scanline)
{
    /* assume Centipede-style interrupt timing */

    cpunum_set_input_line(0, 0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE);

    scanline += 32;

    if (scanline >= 263)
    {
        scanline = 16;
    }

    timer_set(cpu_getscanlinetime(scanline), scanline, interrupt_callback);
}
Пример #26
0
static void interrupt_callback(int scanline)
{
	update_plunger();

	cpunum_set_input_line(0, 0, ASSERT_LINE);

	scanline = scanline + 32;

	if (scanline >= 263)
	{
		scanline = 32;
	}

	timer_set(cpu_getscanlinetime(scanline), scanline, interrupt_callback);
}
Пример #27
0
static void machine_reset_common( int line )
{
	irq_line = line;

	/* initalize main CPU interrupt generator flip-flops */
	TTL7474_config(0, &galaxian_7474_9M_2_intf);
	TTL7474_preset_w(0, 1);
	TTL7474_clear_w (0, 1);

	TTL7474_config(1, &galaxian_7474_9M_1_intf);
	TTL7474_clear_w (1, 1);
	TTL7474_d_w     (1, 0);
	TTL7474_preset_w(1, 0);

	/* start a timer to generate interrupts */
	int_timer = timer_alloc(interrupt_timer);
	timer_adjust(int_timer, cpu_getscanlinetime(0), 0, 0);
}
Пример #28
0
static void nmi_callback(int scanline)
{
	scanline += 64;

	if (scanline >= 262)
	{
		scanline = 32;
	}

	/* NMI is disabled during service mode */

	if (readinputport(2) & 0x40)
	{
		cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
	}

	timer_set(cpu_getscanlinetime(scanline), scanline, nmi_callback);
}
Пример #29
0
static MACHINE_INIT( beathead )
{
    /* reset the common subsystems */
    atarigen_eeprom_reset();
    atarigen_interrupt_reset(update_interrupts);
    atarijsa_reset();

    /* the code is temporarily mapped at 0 at startup */
    /* just copying the first 0x40 bytes is sufficient */
    memcpy(ram_base, rom_base, 0x40);

    /* compute the timing of the HBLANK interrupt and set the first timer */
    hblank_offset = cpu_getscanlineperiod() * ((455. - 336. - 25.) / 455.);
    timer_set(cpu_getscanlinetime(0) - hblank_offset, 0, scanline_callback);

    /* reset IRQs */
    irq_line_state = CLEAR_LINE;
    irq_state[0] = irq_state[1] = irq_state[2] = 0;
    irq_enable[0] = irq_enable[1] = irq_enable[2] = 0;
}
Пример #30
0
static void scanline_callback(int scanline)
{
    /* update the video */
    beathead_scanline_update(scanline);

    /* on scanline zero, clear any halt condition */
    if (scanline == 0)
        cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE);

    /* wrap around at 262 */
    scanline++;
    if (scanline >= MAX_SCANLINES)
        scanline = 0;

    /* set the scanline IRQ */
    irq_state[2] = 1;
    update_interrupts();

    /* set the timer for the next one */
    timer_set(cpu_getscanlinetime(scanline) - hblank_offset, scanline, scanline_callback);
}