Example #1
0
static void zaccaria_init_machine(void)
{
	pia_unconfig();
	pia_config(0, PIA_STANDARD_ORDERING | PIA_8BIT, &pia_0_intf);
	pia_config(1, PIA_STANDARD_ORDERING | PIA_8BIT, &pia_1_intf);
	pia_reset();
}
Example #2
0
void spiders_init_machine(void)
{
	pia_unconfig();
	pia_config(0, PIA_STANDARD_ORDERING, &pia_0_intf);
	pia_config(1, PIA_ALTERNATE_ORDERING, &pia_1_intf);
	pia_config(2, PIA_STANDARD_ORDERING, &pia_2_intf);
	pia_config(3, PIA_STANDARD_ORDERING, &pia_3_intf);
	pia_reset();
}
Example #3
0
static void *common_start(void)
{
	int sample_rate = SH8253_CLOCK;
	int i;

	/* determine which sound hardware is installed */
	has_hc55516 = FALSE;
	has_tms5220 = FALSE;
	for (i = 0; i < MAX_SOUND; i++)
	{
		if (Machine->drv->sound[i].sound_type == SOUND_TMS5220)
			has_tms5220 = TRUE;
		if (Machine->drv->sound[i].sound_type == SOUND_HC55516)
			has_hc55516 = TRUE;
	}

	/* allocate the stream */
	exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update);

	/* Init PIA */
	pia_reset();

	/* Init LFSR */
	sh6840_LFSR_oldxor = 0;
	sh6840_LFSR_0 = 0xffffffff;
	sh6840_LFSR_1 = 0xffffffff;
	sh6840_LFSR_2 = 0xffffffff;
	sh6840_LFSR_3 = 0xffffffff;

	/* Init 6532 */
    riot_timer = timer_alloc(riot_interrupt);
    riot_irq_flag = 0;
    riot_timer_irq_enable = 0;
	riot_porta_data = 0xff;
	riot_portb_data = 0xff;
    riot_interval = SH6532_PERIOD;
    riot_state = RIOT_IDLE;

	/* Init 6840 */
	memset(sh6840_timer, 0, sizeof(sh6840_timer));
	sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24));
	sh6840_MSB = 0;
	exidy_sfxctrl = 0;

	/* Init 8253 */
	memset(sh8253_timer, 0, sizeof(sh8253_timer));
	freq_to_step = (double)(1 << 24) / (double)sample_rate;

	return auto_malloc(1);
}
Example #4
0
static void venture_sh_reset(void *token)
{
	exidy_sh6840_sh_reset(token);

	/* PIA */
	pia_reset();

	/* 6532 */
	riot_irq_flag = 0;
	riot_timer_irq_enable = 0;
	riot_porta_data = 0xff;
	riot_portb_data = 0xff;
	riot_clock_divisor = 1;
	riot_state = RIOT_IDLE;

	/* 8253 */
	memset(sh8253_timer, 0, sizeof(sh8253_timer));
}
Example #5
0
static int petdww_deactivate(void)
{
    if (petdww_ram == NULL) {
        return 0;
    }

    if (!util_check_null_string(petdww_filename)) {
        if (util_file_save(petdww_filename, petdww_ram, PET_DWW_RAM_SIZE) < 0) {
            log_message(petdww_log, "Writing PET DWW image %s failed.",
                        petdww_filename);
            return -1;
        }
        log_message(petdww_log, "Writing PET DWW image %s.", petdww_filename);
    }

    pia_reset();
    lib_free(petdww_ram);
    petdww_ram = NULL;

    return 0;
}
Example #6
0
void mypia_reset(void)
{
    /* clear _all_ internal registers */

    mypia.ctrl_a = 0;    /* PIA 1 Port A Control */
    mypia.ctrl_b = 0;    /* PIA 1 Port B Control */
    mypia.ddr_a = 0;     /* PIA 1 Port A DDR */
    mypia.ddr_b = 0;     /* PIA 1 Port B DDR */
    mypia.port_a = 255;  /* PIA 1 Port A input; nothing to read from keyboard */
    mypia.port_b = 255;  /* PIA 1 Port B input; nothing to read from keyboard */

    pia_reset();

    pia_set_ca2(1);
    mypia.ca_state = 1;
    pia_set_cb2(1);
    mypia.cb_state = 1;

    is_peek_access = 0;

    my_set_int(pia_int_num, 0);
}
Example #7
0
File: mcr.c Project: cdrr/MAME_hack
void mcr_sound_init(void)
{
	int sound_cpu = 1;
	int dac_index = 0;

	/* SSIO */
	if (mcr_sound_config & MCR_SSIO)
	{
		ssio_sound_cpu = sound_cpu++;
		ssio_reset_w(1);
		ssio_reset_w(0);
	}

	/* Turbo Chip Squeak */
	if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
	{
		pia_config(0, PIA_ALTERNATE_ORDERING, &turbocs_pia_intf);
		turbocs_dac_index = dac_index++;
		turbocs_sound_cpu = sound_cpu++;
		turbocs_reset_w(1);
		turbocs_reset_w(0);
	}

	/* Chip Squeak Deluxe */
	if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
	{
		pia_config(0, PIA_ALTERNATE_ORDERING | PIA_16BIT_AUTO, &csdeluxe_pia_intf);
		csdeluxe_dac_index = dac_index++;
		csdeluxe_sound_cpu = sound_cpu++;
		csdeluxe_reset_w(1);
		csdeluxe_reset_w(0);
	}

	/* Sounds Good */
	if (mcr_sound_config & MCR_SOUNDS_GOOD)
	{
		/* special case: Spy Hunter 2 has both Turbo CS and Sounds Good, so we use PIA slot 1 */
		pia_config(1, PIA_ALTERNATE_ORDERING | PIA_16BIT_UPPER, &soundsgood_pia_intf);
		soundsgood_dac_index = dac_index++;
		soundsgood_sound_cpu = sound_cpu++;
		soundsgood_reset_w(1);
		soundsgood_reset_w(0);
	}

	/* Squawk n Talk */
	if (mcr_sound_config & MCR_SQUAWK_N_TALK)
	{
		pia_config(0, PIA_STANDARD_ORDERING | PIA_8BIT, &squawkntalk_pia0_intf);
		pia_config(1, PIA_STANDARD_ORDERING | PIA_8BIT, &squawkntalk_pia1_intf);
		squawkntalk_sound_cpu = sound_cpu++;
		squawkntalk_reset_w(1);
		squawkntalk_reset_w(0);
	}

	/* Advanced Audio */
	if (mcr_sound_config & MCR_WILLIAMS_SOUND)
	{
		williams_cvsd_init(sound_cpu++, 0);
		dac_index++;
		williams_cvsd_reset_w(1);
		williams_cvsd_reset_w(0);
	}

	/* reset any PIAs */
	pia_reset();
}
Example #8
0
/*****************************************************************************
**	apple1_kbd_poll
**
**	Keyboard polling handles both ordinary keys and the special RESET
**	and CLEAR SCREEN switches.
**
**	For ordinary keys, this implements 2-key rollover to reduce the
**	chance of missed keypresses.  If we press a key and then press a
**	second key while the first hasn't been completely released, as
**	might happen during rapid typing, only the second key is
**	registered; the first key is ignored.
**
**	If multiple newly-pressed keys are found, the one closest to the
**	end of the input ports list is counted; the others are ignored.
*****************************************************************************/
static void apple1_kbd_poll(int dummy)
{
	int port, bit;
	int key_pressed;
	UINT32 shiftkeys, ctrlkeys;

	/* This holds the values of all the input ports for ordinary keys
	   seen during the last scan. */
	static UINT32 kbd_last_scan[] = { 0, 0, 0, 0 };

	static int reset_flag = 0;

	/* First we check the RESET and CLEAR SCREEN pushbutton switches. */

	/* The RESET switch resets the CPU and the 6820 PIA. */
	if (readinputport(5) & 0x0001)
	{
		if (!reset_flag) {
			reset_flag = 1;
			/* using PULSE_LINE does not allow us to press and hold key */
			cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE);
			pia_reset();
		}
	}
	else if (reset_flag) {
		/* RESET released--allow the processor to continue. */
		reset_flag = 0;
		cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE);
	}

	/* The CLEAR SCREEN switch clears the video hardware. */
	if (readinputport(5) & 0x0002)
	{
		if (!apple1_vh_clrscrn_pressed)
		{
			/* Ignore further video writes, and clear the screen. */
			apple1_vh_clrscrn_pressed = 1;
			apple1_vh_dsp_clr();
		}
	}
	else if (apple1_vh_clrscrn_pressed)
	{
		/* CLEAR SCREEN released--pay attention to video writes again. */
		apple1_vh_clrscrn_pressed = 0;
	}

	/* Now we scan all the input ports for ordinary keys, recording
	   new keypresses while ignoring keys that were already pressed in
	   the last scan. */

	apple1_kbd_data = 0;
	key_pressed = 0;

	/* The keyboard strobe line should always be low when a scan starts. */
	pia_set_input_ca1(0, 0);

	shiftkeys = readinputport(4) & 0x0003;
	ctrlkeys = readinputport(4) & 0x000c;

	for (port = 0; port < 4; port++)
	{
		UINT32 portval = readinputport(port);
		UINT32 newkeys = portval & ~(kbd_last_scan[port]);

		if (newkeys)
		{
			key_pressed = 1;
			for (bit = 0; bit < 16; bit++) {
				if (newkeys & 1)
				{
					apple1_kbd_data = (ctrlkeys)
					  ? apple1_control_keymap[port*16 + bit]
					  : (shiftkeys)
					  ? apple1_shifted_keymap[port*16 + bit]
					  : apple1_unshifted_keymap[port*16 + bit];
				}
				newkeys >>= 1;
			}
		}
		kbd_last_scan[port] = portval;
	}

	if (key_pressed)
	{
		/* The keyboard will pulse its strobe line when a key is
		   pressed.  A 10-usec pulse is typical. */
		pia_set_input_ca1(0, 1);
		timer_set(TIME_IN_USEC(10), 0, apple1_kbd_strobe_end);
	}
}
Example #9
0
static MACHINE_RESET( trailblz )
{
	pia_reset();
}
Example #10
0
static MACHINE_RESET( quizmstr )
{
	pia_reset();
}
Example #11
0
static MACHINE_RESET( nyny )
{
	pia_reset();
	TTL74123_reset(0);
}
Example #12
0
static void _pia_reset(running_machine *machine)
{
	pia_reset();
}
Example #13
0
static MACHINE_RESET( fnvision )
{
	pia_reset();
}