コード例 #1
0
ファイル: badlands.c プロジェクト: libretro/mame2003-libretro
static void scanline_update(int scanline)
{
	/* sound IRQ is on 32V */
	if (scanline & 32)
		atarigen_6502_irq_ack_r(0);
	else if (!(readinputport(0) & 0x40))
		atarigen_6502_irq_gen();
}
コード例 #2
0
static void scanline_update(screen_device &screen, int scanline)
{
	address_space *space = cputag_get_address_space(screen.machine, "audiocpu", ADDRESS_SPACE_PROGRAM);

	/* sound IRQ is on 32V */
	if (scanline & 32)
		atarigen_6502_irq_ack_r(space, 0);
	else if (!(input_port_read(screen.machine, "FE4000") & 0x40))
		atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
}
コード例 #3
0
ファイル: badlands.c プロジェクト: stuartcarnie/MAME-OS-X
static void scanline_update(screen_device &screen, int scanline)
{
	address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);

	/* sound IRQ is on 32V */
	if (scanline & 32)
		atarigen_6502_irq_ack_r(space, 0);
	else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
		atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
コード例 #4
0
static READ8_HANDLER( audio_io_r )
{
	badlands_state *state = space->machine->driver_data<badlands_state>();
	int result = 0xff;

	switch (offset & 0x206)
	{
		case 0x000:		/* n/c */
			logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206);
			break;

		case 0x002:		/* /RDP */
			result = atarigen_6502_sound_r(space, offset);
			break;

		case 0x004:		/* /RDIO */
			/*
                0x80 = self test
                0x40 = NMI line state (active low)
                0x20 = sound output full
                0x10 = self test
                0x08 = +5V
                0x04 = +5V
                0x02 = coin 2
                0x01 = coin 1
            */
			result = input_port_read(space->machine, "AUDIO");
			if (!(input_port_read(space->machine, "FE4000") & 0x0080)) result ^= 0x90;
			if (state->cpu_to_sound_ready) result ^= 0x40;
			if (state->sound_to_cpu_ready) result ^= 0x20;
			result ^= 0x10;
			break;

		case 0x006:		/* /IRQACK */
			atarigen_6502_irq_ack_r(space, 0);
			break;

		case 0x200:		/* /VOICE */
		case 0x202:		/* /WRP */
		case 0x204:		/* /WRIO */
		case 0x206:		/* /MIX */
			logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206);
			break;
	}

	return result;
}
コード例 #5
0
ファイル: badlands.cpp プロジェクト: AlanApter/steamlink-sdk
static READ_HANDLER( audio_io_r )
{
	int result = 0xff;

	switch (offset & 0x206)
	{
		case 0x000:		/* n/c */
			//logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206);
			break;

		case 0x002:		/* /RDP */
			result = atarigen_6502_sound_r(offset);
			break;

		case 0x004:		/* /RDIO */
			/*
				0x80 = self test
				0x40 = NMI line state (active low)
				0x20 = sound output full
				0x10 = self test
				0x08 = +5V
				0x04 = +5V
				0x02 = coin 2
				0x01 = coin 1
			*/
			result = readinputport(3);
			if (!(readinputport(0) & 0x0080)) result ^= 0x90;
			if (atarigen_cpu_to_sound_ready) result ^= 0x40;
			if (atarigen_sound_to_cpu_ready) result ^= 0x20;
			result ^= 0x10;
			break;

		case 0x006:		/* /IRQACK */
			atarigen_6502_irq_ack_r(0);
			break;

		case 0x200:		/* /VOICE */
		case 0x202:		/* /WRP */
		case 0x204:		/* /WRIO */
		case 0x206:		/* /MIX */
			//logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206);
			break;
	}

	return result;
}
コード例 #6
0
static WRITE8_HANDLER( audio_io_w )
{
	badlands_state *state = space->machine->driver_data<badlands_state>();

	switch (offset & 0x206)
	{
		case 0x000:		/* n/c */
		case 0x002:		/* /RDP */
		case 0x004:		/* /RDIO */
			logerror("audio_io_w: Unknown write (%02X) at %04X\n", data & 0xff, offset & 0x206);
			break;

		case 0x006:		/* /IRQACK */
			atarigen_6502_irq_ack_r(space, 0);
			break;

		case 0x200:		/* n/c */
		case 0x206:		/* n/c */
			break;

		case 0x202:		/* /WRP */
			atarigen_6502_sound_w(space, offset, data);
			break;

		case 0x204:		/* WRIO */
			/*
                0xc0 = bank address
                0x20 = coin counter 2
                0x10 = coin counter 1
                0x08 = n/c
                0x04 = n/c
                0x02 = n/c
                0x01 = YM2151 reset (active low)
            */

			/* update the bank */
			memcpy(state->bank_base, &state->bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
			break;
	}
}