Exemple #1
0
void pv1000_state::machine_reset()
{
	m_io_regs[5] = 0;
	m_fd_data = 0;
	m_irq_on_timer->adjust(m_screen->time_until_pos(195, 0));
	m_irq_off_timer->adjust(attotime::never);
}
Exemple #2
0
void gamate_state::machine_start()
{
	m_cart_ptr = memregion("maincpu")->base() + 0x6000;
	if (m_cart->exists())
	{
//		m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r));
		m_cart_ptr = m_cart->get_rom_base();
		membank("bankmulti")->set_base(m_cart->get_rom_base()+1);
		membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset
	}
//	m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback
	card_protection.set=false;
	bank_multi=0;
	card_protection.unprotected=false;
	timer2->enable(TRUE);
	timer2->reset(m_maincpu->cycles_to_attotime(1000));
#if 0
	save_item(NAME(m_video.data));
	save_item(NAME(m_video.index));
	save_item(NAME(m_video.x));
	save_item(NAME(m_video.y));
	save_item(NAME(m_video.mode));
	save_item(NAME(m_video.delayed));
	save_item(NAME(m_video.pixels));
	save_item(NAME(m_ports));
	save_item(NAME(m_ram));
#endif
}
Exemple #3
0
void gamate_state::machine_start()
{
	timer2->enable(true);
	timer2->reset(m_maincpu->cycles_to_attotime(1000));

	save_item(NAME(m_card_available));
}
Exemple #4
0
void noki3310_state::machine_reset()
{
	// according to the boot rom disassembly here http://www.nokix.pasjagsm.pl/help/blacksphere/sub_100hardware/sub_arm/sub_bootrom.htm
	// flash entry point is at 0x200040, we can probably reassemble the above code, but for now this should be enough.
	m_maincpu->set_state_int(ARM7_R15, 0x200040);

	memset(m_mad2_regs, 0, 0x100);
	m_mad2_regs[0x01] = 0x01;	// power-on flag
	m_mad2_regs[0x0c] = 0x0a;	// disable FIQ and IRQ
	m_mad2_regs[0x03] = 0xff;	// disable MAD2 watchdog
	m_ccont.watchdog  = 0;		// disable CCONT watchdog
	m_ccont.dc  = false;

	m_fiq_status = 0;
	m_irq_status = 0;
	m_timer1_counter = 0;
	m_timer0_counter = 0;

	m_timer0->adjust(attotime::from_hz(33055 / (255 + 1)), 0, attotime::from_hz(33055 / (255 + 1)));	// programmable through port 0x0f
	m_timer1->adjust(attotime::from_hz(1057), 0, attotime::from_hz(1057));
	m_timer_watchdog->adjust(attotime::from_hz(1), 0, attotime::from_hz(1));
	m_timer_fiq8->adjust(attotime::from_hz(1000), 0, attotime::from_hz(1000));

	// simulate power-on input
	if (machine().system().name && (machine().system().name[4] == '8' || machine().system().name[4] == '5'))
		m_power_on = ~0x10;
	else
		m_power_on = ~0x02;
}
Exemple #5
0
void goupil_g1_state::machine_reset()
{
	goupil_base_state::machine_reset();
	m_scanline_timer->adjust(m_screen->time_until_pos(m_screen->vpos() + 10));
	m_old_state_ca2 = 0;
	m_via_video_pbb_data = 0;
}
Exemple #6
0
void pcjr_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch(id)
	{
		case TIMER_IRQ_DELAY:
			m_maincpu->set_input_line(0, param ? ASSERT_LINE : CLEAR_LINE);
			break;

		case TIMER_WATCHDOG:
			if(m_pcjr_dor & 0x20)
				m_pic8259->ir6_w(1);
			else
				m_pic8259->ir6_w(0);
			break;

		case TIMER_KB_SIGNAL:
			m_raw_keyb_data = m_raw_keyb_data >> 1;
			m_signal_count--;

			if ( m_signal_count <= 0 )
			{
				m_keyb_signal_timer->adjust( attotime::never, 0, attotime::never );
				m_transferring = 0;
			}
			break;
	}
}
Exemple #7
0
INPUT_PORTS_END

void cops_state::machine_start()
{
	m_ld_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cops_state::ld_timer_callback),this));
	m_ld_timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5));
}
Exemple #8
0
void mgolf_state::machine_reset()
{
	m_interrupt_timer->adjust(m_screen->time_until_pos(16), 16);

	m_mask = 0;
	m_prev = 0;
}
Exemple #9
0
void pb1000_state::machine_start()
{
	membank("bank1")->set_base(memregion("rom")->base());

	m_kb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pb1000_state::keyboard_timer),this));
	m_kb_timer->adjust(attotime::from_hz(192), 0, attotime::from_hz(192));
}
Exemple #10
0
void scv_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
		case TIMER_VB:
			{
				int vpos = machine().primary_screen->vpos();

				switch( vpos )
				{
				case 240:
					m_maincpu->set_input_line(UPD7810_INTF2, ASSERT_LINE);
					break;
				case 0:
					m_maincpu->set_input_line(UPD7810_INTF2, CLEAR_LINE);
					break;
				}

				m_vb_timer->adjust(machine().primary_screen->time_until_pos((vpos + 1) % 262, 0));
			}
			break;

		default:
			assert_always(FALSE, "Unknown id in scv_state::device_timer");
	}
}
Exemple #11
0
void ngp_state::machine_start()
{
	UINT8 *cart = memregion("cart")->base();

	m_flash_chip[0].data = cart;
	m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0];
	m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1];
	m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2];
	m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3];
	m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000];
	m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001];
	m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002];
	m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003];
	m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000];
	m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001];
	m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002];
	m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003];
	m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000];
	m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001];
	m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002];
	m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003];

	m_flash_chip[1].data = cart + 0x200000;
	m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0];
	m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1];
	m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2];
	m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3];
	m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000];
	m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001];
	m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002];
	m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003];
	m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000];
	m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001];
	m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002];
	m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003];
	m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000];
	m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001];
	m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002];
	m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003];

	m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this));
	m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) );

	save_item(NAME(m_io_reg));
	save_item(NAME(m_old_to3));
	// TODO: check if these are handled correctly...
	save_item(NAME(m_flash_chip[0].present));
	save_item(NAME(m_flash_chip[0].manufacturer_id));
	save_item(NAME(m_flash_chip[0].device_id));
	save_item(NAME(m_flash_chip[0].org_data));
	save_item(NAME(m_flash_chip[0].state));
	save_item(NAME(m_flash_chip[0].command));
	save_item(NAME(m_flash_chip[1].present));
	save_item(NAME(m_flash_chip[1].manufacturer_id));
	save_item(NAME(m_flash_chip[1].device_id));
	save_item(NAME(m_flash_chip[1].org_data));
	save_item(NAME(m_flash_chip[1].state));
	save_item(NAME(m_flash_chip[1].command));
}
Exemple #12
0
void maple_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	if(id != TIMER_ID)
		return;

	timer.adjust(attotime::never);
	reply_ready();
}
Exemple #13
0
void naomi_g1_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	timer.adjust(attotime::never);
	if(!gdst)
		return;
	gdst = 0;
	irq_cb(DMA_GDROM_IRQ);
}
Exemple #14
0
void alphatro_state::machine_reset()
{
	// do what the IPL does
	//  UINT8* RAM = machine().device<ram_device>("ram")->pointer();
	UINT8* ROM = memregion("maincpu")->base();
	cpu_set_reg(m_maincpu, STATE_GENPC, 0xe000);
	memcpy(m_p_ram, ROM, 0xf000); // copy BASIC to RAM, which the undumped IPL is supposed to do.
	memcpy(m_p_videoram, ROM+0x1000, 0x1000);
	//  membank("bank1")->set_base(RAM);

	// probably not correct, exact meaning of port is unknown, vblank/vsync is too slow.
	m_sys_timer->adjust(attotime::from_usec(10),0,attotime::from_usec(10));
	m_serial_timer->adjust(attotime::from_hz(500),0,attotime::from_hz(500));  // USART clock - this is a guesstimate
	m_timer_bit = 0;
	beep_set_state(m_beep, 0);
	beep_set_frequency(m_beep, 950);	/* piezo-device needs to be measured */
}
Exemple #15
0
void techno_state::machine_reset()
{
	m_vector = 0x88;
	m_digit = 0;

	attotime freq = attotime::from_hz(XTAL_8MHz / 256); // 31250Hz
	m_irq_set_timer->adjust(freq, 0, freq);
	m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE);
}
Exemple #16
0
void naomi_g1_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	timer.adjust(attotime::never);
	if(!gdst)
		return;
	gdst = 0;
	if(irq_cb)
		irq_cb(machine());
}
Exemple #17
0
void rastersp_state::machine_reset()
{
	m_irq_status = 0;
	m_dpyaddr = 0;

	// Halt the 486 on reset - the DSP will release it from reset
	m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);

	// Set IRQ1 line to cause DSP to boot from 0x400000
	m_dsp->set_input_line(TMS3203X_IRQ1, ASSERT_LINE);
	m_dsp->set_input_line(TMS3203X_IRQ1, CLEAR_LINE);

	// Reset DSP internal registers
	m_tms_io_regs[SPORT_GLOBAL_CTL] = 0;

	m_tms_timer1->adjust(attotime::never);
	m_tms_tx_timer->adjust(attotime::never);
}
Exemple #18
0
void beezer_state::machine_reset()
{
	m_pbus = 0xff;

	// initialize memory banks
	bankswitch_w(machine().dummy_space(), 0, 0);

	// start timer
	m_timer_count->adjust(attotime::zero, 0, attotime::from_hz((XTAL_12MHz / 12) / 16));
}
Exemple #19
0
void osbexec_state::machine_reset()
{
	m_pia0_porta = 0xC0;        /* Enable ROM and VRAM on reset */

	set_banks();

	m_video_timer->adjust( machine().first_screen()->time_until_pos( 0, 0 ) );

	m_rtc = 0;
}
Exemple #20
0
void pb1000_state::kb_matrix_w(running_machine &machine, UINT8 matrix)
{
	if (matrix & 0x80)
	{
		if ((m_kb_matrix & 0x80) != (matrix & 0x80))
			m_kb_timer->adjust(attotime::never, 0, attotime::never);
	}
	else
	{
		if ((m_kb_matrix & 0x40) != (matrix & 0x40))
		{
			if (matrix & 0x40)
				m_kb_timer->adjust(attotime::from_hz(32), 0, attotime::from_hz(32));
			else
				m_kb_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
		}
	}

	m_kb_matrix = matrix;
}
Exemple #21
0
void alphatro_state::machine_reset()
{
	// do what the IPL does
	UINT8* ROM = memregion("maincpu")->base();
	m_maincpu->set_pc(0xe000);
	memcpy(m_p_ram, ROM, 0xf000); // copy BASIC to RAM, which the undumped IPL is supposed to do.
	memcpy(m_p_videoram, ROM+0x1000, 0x1000);

	// probably not correct, exact meaning of port is unknown, vblank/vsync is too slow.
	m_sys_timer->adjust(attotime::from_usec(10),0,attotime::from_usec(10));
	m_serial_timer->adjust(attotime::from_hz(19225),0,attotime::from_hz(19225));  // USART clock - this value loads a real tape
	m_timer_bit = 0;
	m_cass_state = 1;
	m_cass_data[0] = 0;
	m_cass_data[1] = 0;
	m_cass_data[2] = 0;
	m_cass_data[3] = 0;
	m_beep->set_state(0);
	m_beep->set_frequency(950);    /* piezo-device needs to be measured */
}
Exemple #22
0
void tm990189_state::segment_set(int offset, bool state)
{
	if (state)
		m_segment |= 1 << offset;
	else
	{
		m_segment &= ~ (1 << offset);
		if ((m_displayena_timer->remaining() > attotime::zero)  && (m_digitsel < 10))
			draw_digit();
	}
}
Exemple #23
0
void flyball_state::machine_reset()
{
	m_quarter_timer->adjust(m_screen->time_until_pos(0));

	m_pitcher_vert = 0;
	m_pitcher_horz = 0;
	m_pitcher_pic = 0;
	m_ball_vert = 0;
	m_ball_horz = 0;
	m_potmask = 0;
	m_potsense = 0;
}
Exemple #24
0
void goupil_g1_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch (id)
	{
	case TIMER_SCANLINE:
		m_ef9364->update_scanline((uint16_t)m_screen->vpos());
		m_scanline_timer->adjust(m_screen->time_until_pos(m_screen->vpos() + 10));
		break;
	default:
		throw emu_fatalerror("Unknown id in goupil_g1_state::device_timer");
	}
}
Exemple #25
0
void a7000_state::machine_reset()
{
	m_IOMD_IO_ctrl = 0x0b | 0x34; //bit 0,1 and 3 set high on reset plus 2,4,5 always high
//  m_IRQ_status_A = 0x10; // set POR bit ON
	m_IRQ_mask_A = 0x00;

	m_IOMD_keyb_ctrl = 0x00;

	m_IOMD_timer[0]->adjust( attotime::never);
	m_IOMD_timer[1]->adjust( attotime::never);
	m_flyback_timer->adjust( attotime::never);
}
Exemple #26
0
void s6_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	switch(id)
	{
	case TIMER_IRQ:
		if(param == 1)
		{
			m_maincpu->set_input_line(M6808_IRQ_LINE, ASSERT_LINE);
			m_irq_timer->adjust(attotime::from_ticks(32,3580000/4),0);
			m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2));  // Advance
			m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3));  // Up/Down
		}
		else
		{
			m_maincpu->set_input_line(M6808_IRQ_LINE, CLEAR_LINE);
			m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
			m_pia28->ca1_w(1);
			m_pia28->cb1_w(1);
		}
		break;
	}
}
Exemple #27
0
void scc8530_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
    Chan *pChan = &channel[id];
    int brconst = pChan->reg_val[13]<<8 | pChan->reg_val[14];
    int rate;

    if (brconst)
    {
        rate = clock() / brconst;
    }
    else
    {
        rate = 0;
    }

    // is baud counter IRQ enabled on this channel?
    // always flag pending in case it's enabled after this
    pChan->baudIRQPending = 1;
    if (pChan->baudIRQEnable)
    {
        if (pChan->extIRQEnable)
        {
            pChan->extIRQPending = 1;
            pChan->baudIRQPending = 0;
            updateirqs();
        }
    }

    // reset timer according to current register values
    if (rate)
    {
        attotime attorate = attotime::from_hz(rate);
        timer.adjust(attorate, 0, attorate);
    }
    else
    {
        timer.adjust(attotime::never, 0, attotime::never);
    }
}
Exemple #28
0
void pb1000_state::machine_start()
{
	std::string region_tag;
	m_rom_reg = memregion("rom");
	if (m_card1)
		m_card1_reg = memregion(region_tag.assign(m_card1->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
	if (m_card2)
		m_card2_reg = memregion(region_tag.assign(m_card2->tag()).append(GENERIC_ROM_REGION_TAG).c_str());

	membank("bank1")->set_base(m_rom_reg->base());

	m_kb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pb1000_state::keyboard_timer),this));
	m_kb_timer->adjust(attotime::from_hz(192), 0, attotime::from_hz(192));
}
Exemple #29
0
INPUT_PORTS_END


void cms_state::machine_start()
{
	m_bank1->configure_entries(0, 16, m_rom->base(), 0x4000);

	memset(&m_rtc_data, 0, sizeof(m_rtc_data));
	m_rtc_reg = 0;
	m_rtc_state = 0;
	m_rtc_data[0xf] = 1;

	m_rtc_timer = timer_alloc();
	m_rtc_timer->adjust(attotime::zero, 0, attotime(1, 0));
}
Exemple #30
0
MACHINE_CONFIG_END

/* Driver Init */

void alto2_state::init_alto2()
{
	// Make the diablo drives known to the CPU core
	alto2_cpu_device* cpu = downcast<alto2_cpu_device *>(m_maincpu.target());
	cpu->set_diablo(0, downcast<diablo_hd_device *>(machine().device(DIABLO_HD_0)));
	cpu->set_diablo(1, downcast<diablo_hd_device *>(machine().device(DIABLO_HD_1)));
	cpu->set_speaker(m_speaker);
	// Create a timer which fires twice per frame, once for each field
	m_vblank_timer = timer_alloc(TIMER_VBLANK);
	m_vblank_timer->adjust(attotime::from_hz(2*30),0,attotime::from_hz(30*2));
}