示例#1
0
static WRITE32_HANDLER( control_w )
{
	UINT32 old = control_data;

	// bit $80000000 = BSMT access/ROM read
	// bit $20000000 = toggled every 64 IRQ4's
	// bit $10000000 = ????
	// bit $00800000 = EEPROM data
	// bit $00400000 = EEPROM clock
	// bit $00200000 = EEPROM enable (on 1)

	COMBINE_DATA(&control_data);

	/* handle EEPROM I/O */
	if (ACCESSING_BITS_16_23)
	{
		eeprom_write_bit(data & 0x00800000);
		eeprom_set_cs_line((data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE);
		eeprom_set_clock_line((data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE);
	}

	/* toggling BSMT off then on causes a reset */
	if (!(old & 0x80000000) && (control_data & 0x80000000))
	{
		const device_config *device = devtag_get_device(space->machine, "bsmt");
		bsmt2000_data_w(device, bsmt_data_bank, 0, 0xffff);
		device_reset(device);
	}

	/* log any unknown bits */
	if (data & 0x4f1fffff)
		logerror("%08X: control_w = %08X & %08X\n", cpu_get_previouspc(space->cpu), data, mem_mask);
}
示例#2
0
文件: policetr.c 项目: cdenix/psmame
static WRITE32_HANDLER( control_w )
{
	policetr_state *state = space->machine().driver_data<policetr_state>();
	UINT32 old = state->m_control_data;

	// bit $80000000 = BSMT access/ROM read
	// bit $20000000 = toggled every 64 IRQ4's
	// bit $10000000 = ????
	// bit $00800000 = EEPROM data
	// bit $00400000 = EEPROM clock
	// bit $00200000 = EEPROM enable (on 1)

	COMBINE_DATA(&state->m_control_data);

	/* handle EEPROM I/O */
	if (ACCESSING_BITS_16_23)
	{
		device_t *device = space->machine().device("eeprom");
		eeprom_write_bit(device, data & 0x00800000);
		eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE);
		eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE);
	}

	/* toggling BSMT off then on causes a reset */
	if (!(old & 0x80000000) && (state->m_control_data & 0x80000000))
	{
		bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
		bsmt->reset();
	}

	/* log any unknown bits */
	if (data & 0x4f1fffff)
		logerror("%08X: control_w = %08X & %08X\n", cpu_get_previouspc(&space->device()), data, mem_mask);
}
示例#3
0
static WRITE16_DEVICE_HANDLER( eeprom_w )
{
	if( ACCESSING_BITS_0_7 )
	{
		eeprom_write_bit(device, data & 0x01);
		eeprom_set_cs_line(device, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE );
		eeprom_set_clock_line(device, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE );
	}
}
示例#4
0
static WRITE32_HANDLER( avengrs_eprom_w )
{
	if (ACCESSING_BITS_8_15) {
		UINT8 ebyte=(data>>8)&0xff;
//      if (ebyte&0x80) {
			eeprom_set_clock_line((ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE);
			eeprom_write_bit(ebyte & 0x1);
			eeprom_set_cs_line((ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE);
//      }
	}
	else if (ACCESSING_BITS_0_7) {
示例#5
0
文件: inufuku.c 项目: nitrologic/emu
static WRITE16_HANDLER( inufuku_eeprom_w )
{
	// latch the bit
	eeprom_write_bit(data & 0x0800);

	// reset line asserted: reset.
	eeprom_set_cs_line((data & 0x2000) ? CLEAR_LINE : ASSERT_LINE);

	// clock line asserted: write latch or select next bit to read
	eeprom_set_clock_line((data & 0x1000) ? ASSERT_LINE : CLEAR_LINE);
}
示例#6
0
static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w )
{
	pntnpuzl_eeprom = data;

	/* bit 12 is data */
	/* bit 13 is clock (active high) */
	/* bit 14 is cs (active high) */

	eeprom_write_bit(device, data & 0x1000);
	eeprom_set_cs_line(device, (data & 0x4000) ? CLEAR_LINE : ASSERT_LINE);
	eeprom_set_clock_line(device, (data & 0x2000) ? ASSERT_LINE : CLEAR_LINE);
}
示例#7
0
static WRITE32_HANDLER( simpl156_eeprom_w )
{
	simpl156_state *state = space->machine->driver_data<simpl156_state>();
	//int okibank;

	//okibank = data & 0x07;

	state->okimusic->set_bank_base(0x40000 * (data & 0x7));

	eeprom_set_clock_line(state->eeprom, BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE);
	eeprom_write_bit(state->eeprom, BIT(data, 4));
	eeprom_set_cs_line(state->eeprom, BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE);
}
示例#8
0
static WRITE16_DEVICE_HANDLER(galpani2_eeprom_w)
{
	COMBINE_DATA( &eeprom_word );
	if ( ACCESSING_BITS_0_7 )
	{
		// latch the bit
		eeprom_write_bit(device, data & 0x02);

		// reset line asserted: reset.
		eeprom_set_cs_line(device, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE );

		// clock line asserted: write latch or select next bit to read
		eeprom_set_clock_line(device, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE );
	}
}
示例#9
0
文件: othunder.c 项目: cdenix/psmame
static WRITE16_HANDLER( othunder_tc0220ioc_w )
{
	othunder_state *state = space->machine().driver_data<othunder_state>();

	if (ACCESSING_BITS_0_7)
	{
		switch (offset)
		{
			case 0x03:

/*              0000000x    SOL-1 (gun solenoid)
                000000x0    SOL-2 (gun solenoid)
                00000x00    OBPRI (sprite priority)
                0000x000    (unused)
                000x0000    eeprom reset (active low)
                00x00000    eeprom clock
                0x000000    eeprom in data
                x0000000    eeprom out data  */

				/* Recoil Piston Motor Status */
				output_set_value("Player1_Recoil_Piston", data & 0x1 );
				output_set_value("Player2_Recoil_Piston", (data & 0x2) >>1 );

				if (data & 4)
					popmessage("OBPRI SET!");

				eeprom_write_bit(state->m_eeprom, data & 0x40);
				eeprom_set_clock_line(state->m_eeprom, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
				eeprom_set_cs_line(state->m_eeprom, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
				break;

			default:
				tc0220ioc_w(state->m_tc0220ioc, offset, data & 0xff);
		}
	}
}
示例#10
0
文件: spool99.c 项目: nitrologic/emu
static WRITE8_HANDLER( eeprom_resetline_w )
{
	// reset line asserted: reset.
	eeprom_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
}
示例#11
0
static WRITE16_DEVICE_HANDLER( eeprom_chip_select_w )
{
	/* bit 0 is CS (active low) */
	eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}