示例#1
0
/*************************************************
 * memory mapped I/O write
 * bit  function
 * 7-6  not assigned
 * 5    speaker B ???
 * 4    ???
 * 3    mode: 1 graphics, 0 text
 * 2    cassette out (MSB)
 * 1    cassette out (LSB)
 * 0    speaker A
 ************************************************/
static void mwa_bank(int bank, int offs, int data)
{
	offs += 0x4000 * laser_bank[bank];
    switch (laser_bank[bank])
    {
    case  0:    /* ROM lower 16K */
    case  1:    /* ROM upper 16K */
		logerror("bank #%d write to ROM [$%05X] $%02X\n", bank+1, offs, data);
        break;
    case  2:    /* memory mapped output */
        if (data != laser_latch)
        {
            logerror("bank #%d write to I/O [$%05X] $%02X\n", bank+1, offs, data);
            /* Toggle between graphics and text modes? */
			if ((data ^ laser_latch) & 0x01)
				speaker_level_w(0, data & 1);
            laser_latch = data;
        }
        break;
    case 12:    /* ext. ROM #1 */
    case 13:    /* ext. ROM #2 */
    case 14:    /* ext. ROM #3 */
    case 15:    /* ext. ROM #4 */
		logerror("bank #%d write to ROM [$%05X] $%02X\n", bank+1, offs, data);
        break;
    default:    /* RAM */
        if( laser_bank[bank] == laser_video_bank && mem[offs] != data )
		{
			logerror("bank #%d write to videoram [$%05X] $%02X\n", bank+1, offs, data);
            dirtybuffer[offs&0x3fff] = 1;
		}
        mem[offs] = data;
        break;
    }
}
示例#2
0
文件: pc.c 项目: poliva/mame-rr
void pc_speaker_set_input(running_machine &machine, UINT8 data)
{
	device_t *speaker = machine.device(SPEAKER_TAG);
	pc_state *st = machine.driver_data<pc_state>();
	st->m_pc_input = data ? 1 : 0;
	speaker_level_w( speaker, pc_speaker_get_spk(machine) );
}
示例#3
0
static WRITE8_HANDLER(exidy_ff_port_w)
{
	logerror("exidy ff w: %04x %02x\n",offset,data);

	switch ((readinputport(0)>>1) & 0x01)
	{
		case 0:
		{
			int level;

			level = 0;
			if (data)
			{
				level = 0x0ff;
			}

			speaker_level_w(0, level);
		}
		break;

		case 1:
		{
			/* printer */
			/* bit 7 = strobe, bit 6..0 = data */
			centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
			centronics_write_handshake(0, (data>>7) & 0x01, CENTRONICS_STROBE);
			centronics_write_data(0,data & 0x07f);

		}
		break;
	}

}
示例#4
0
文件: cybiko.c 项目: cdenix/psmame
static WRITE8_HANDLER( cybiko_io_reg_w )
{
	cybiko_state *state = space->machine().driver_data<cybiko_state>();
	device_t *rtc = space->machine().device("rtc");
	device_t *speaker = space->machine().device("speaker");

	_logerror( 2, ("cybiko_io_reg_w (%08X/%02X)\n", offset, data));
	switch (offset)
	{
		// speaker
		case H8S_IO_P1DR : speaker_level_w( speaker, (data & H8S_P1_TIOCB1) ? 1 : 0); break;
		// serial dataflash
		case H8S_IO_P3DR :
		{
			device_t *device = space->machine().device("flash1");
			at45dbxx_pin_cs ( device, (data & H8S_P3_SCK0) ? 0 : 1);
			at45dbxx_pin_si ( device, (data & H8S_P3_TXD1) ? 1 : 0);
			at45dbxx_pin_sck( device, (data & H8S_P3_SCK1) ? 1 : 0);
		}
		break;
		// state->m_rs232
		case H8S_IO_P5DR :
		{
			cybiko_rs232_pin_txd(state, (data & H8S_P5_TXD2) ? 1 : 0);
			cybiko_rs232_pin_sck(state, (data & H8S_P5_SCK2) ? 1 : 0);
		}
		break;
		// real-time clock
		case H8S_IO_PFDR  : pcf8593_pin_scl(rtc, (data & H8S_PF_PF1) ? 1 : 0); break;
		case H8S_IO_PFDDR : pcf8593_pin_sda_w(rtc, (data & H8S_PF_PF0) ? 0 : 1); break;
	}
}
示例#5
0
文件: aquarius.c 项目: cdenix/psmame
/*
    Sound and cassette port use a common pin. Therefore the signal to cassette
    will appear on audio output. Sound port is a simple one bit I/O and therefore
    it must be toggled at a specific rate under software control.
*/
static WRITE8_HANDLER( cassette_w )
{
	device_t *speaker = space->machine().device("speaker");
	device_t *cassette = space->machine().device("cassette");

	speaker_level_w(speaker, BIT(data, 0));
	cassette_output(cassette, BIT(data, 0) ? +1.0 : -1.0);
}
示例#6
0
static WRITE8_HANDLER ( lviv_ppi_0_portc_w )	/* tape in/out, video memory on/off */
{
	lviv_ppi_port_outputs[0][2] = data;
	if (lviv_ppi_port_outputs[0][1]&0x80)
		speaker_level_w(0, data&0x01);
	cassette_output(image_from_devtype_and_index(IO_CASSETTE, 0), (data & 0x01) ? -1.0 : 1.0);
	lviv_update_memory();
}
示例#7
0
文件: vtech2.c 项目: poliva/mame-rr
/*************************************************
 * memory mapped I/O write
 * bit  function
 * 7-6  not assigned
 * 5    speaker B ???
 * 4    ???
 * 3    mode: 1 graphics, 0 text
 * 2    cassette out (MSB)
 * 1    cassette out (LSB)
 * 0    speaker A
 ************************************************/
static void mwa_bank(running_machine &machine, int bank, int offs, int data)
{
	vtech2_state *state = machine.driver_data<vtech2_state>();
	device_t *speaker = machine.device(SPEAKER_TAG);
	offs += 0x4000 * state->m_laser_bank[bank];
    switch (state->m_laser_bank[bank])
    {
    case  0:    /* ROM lower 16K */
    case  1:    /* ROM upper 16K */
		logerror("bank #%d write to ROM [$%05X] $%02X\n", bank+1, offs, data);
        break;
    case  2:    /* memory mapped output */
        if (data != state->m_laser_latch)
        {
            logerror("bank #%d write to I/O [$%05X] $%02X\n", bank+1, offs, data);
            /* Toggle between graphics and text modes? */
			if ((data ^ state->m_laser_latch) & 0x01)
				speaker_level_w(speaker, data & 1);
            state->m_laser_latch = data;
        }
        break;
    case 12:    /* ext. ROM #1 */
    case 13:    /* ext. ROM #2 */
    case 14:    /* ext. ROM #3 */
    case 15:    /* ext. ROM #4 */
		logerror("bank #%d write to ROM [$%05X] $%02X\n", bank+1, offs, data);
        break;
    default:    /* RAM */
        if( state->m_laser_bank[bank] == state->m_laser_video_bank && state->m_mem[offs] != data )
		{
			logerror("bank #%d write to videoram [$%05X] $%02X\n", bank+1, offs, data);
		}
        state->m_mem[offs] = data;
        break;
    }
}
示例#8
0
void irisha_state::update_speaker()
{
	int level = ((m_ppi_portc & 0x20) || (m_ppi_porta & 0x10) || !m_sg1_line) ? 1 : 0;

	speaker_level_w(m_speaker, level);
}
示例#9
0
文件: pc1512.c 项目: risico/jsmess
void pc1512_state::update_speaker()
{
	speaker_level_w(m_speaker, m_speaker_drive & m_pit2);
}
示例#10
0
/*
	port $F0: General Purpose output port
	Bit 0 - cassette output
	Bit 1 - cassette relay control; 0=relay on
	Bit 2 - turns screen on and off;0=screen off
	Bit 3 - Available for user projects [We will use it for sound]
	Bit 4 - Available for user projects [We will use it for video switching]
	Bit 5 - cassette LED; 0=LED on
	Bit 6/7 - not decoded
*/
static WRITE8_HANDLER (super80_gpo_w)
{
	speaker_level_w(0, (data & 0x08) ? 1 : 0);
	charset = (data & 0x10) ? 1 : 0;
}
示例#11
0
void tandy2k_state::speaker_update()
{
	int level = !(m_spkrdata & m_outspkr);

	speaker_level_w(m_speaker, level);
}
示例#12
0
文件: b2m.c 项目: cdenix/psmame
static WRITE_LINE_DEVICE_HANDLER(bm2_pit_out1)
{
	b2m_state *st =  device->machine().driver_data<b2m_state>();
	speaker_level_w(st->m_speaker, state);
}