Exemple #1
0
static WRITE8_DEVICE_HANDLER( okibank_w )
{
	/* bit 2 might be reset */
//  popmessage("%02x",data);

	okim6295_set_bank_base(device, (data & 3) * 0x40000);
}
Exemple #2
0
static WRITE16_DEVICE_HANDLER( soundbank_w )
{
	if (ACCESSING_BITS_0_7)
	{
		okim6295_set_bank_base(device, 0x40000 * ((data & 0x03) ^ 0x03));
	}
}
Exemple #3
0
static WRITE32_DEVICE_HANDLER(silk_6295_bank_w)
{
	if (ACCESSING_BITS_24_31)
	{
		int bank = (data & 0x3000000) >> 24;
		if(bank < 3)
			okim6295_set_bank_base(devtag_get_device(device->machine, "oki1"), 0x40000 * (bank));
	}
}
Exemple #4
0
static WRITE16_DEVICE_HANDLER( drtomy_okibank_w )
{
	static int oki_bank;

	if(oki_bank != (data & 3))
	{
		oki_bank = data & 3;
		okim6295_set_bank_base(device, oki_bank * 0x40000);
	}

	/* unknown bit 2 -> (data & 4) */
}
Exemple #5
0
static WRITE16_HANDLER( heberpop_coinctrl_w )
{
	if (ACCESSING_BITS_0_7)
	{
		/* the sound ROM bank is selected by the main CPU! */
		okim6295_set_bank_base(devtag_get_device(space->machine, "oki"),(data & 0x08) ? 0x40000 : 0x00000);

		coin_lockout_w(space->machine, 0,~data & 0x04);
		coin_lockout_w(space->machine, 1,~data & 0x04);
		coin_counter_w(space->machine, 0,data & 0x01);
		coin_counter_w(space->machine, 1,data & 0x02);
	}
}
Exemple #6
0
static MACHINE_RESET( relief )
{
	relief_state *state = (relief_state *)machine->driver_data;

	atarigen_eeprom_reset(&state->atarigen);
	atarigen_interrupt_reset(&state->atarigen, update_interrupts);
	atarivc_reset(machine->primary_screen, state->atarigen.atarivc_eof_data, 2);

	okim6295_set_bank_base(devtag_get_device(machine, "oki"), 0);
	state->ym2413_volume = 15;
	state->overall_volume = 127;
	state->adpcm_bank_base = 0;
}
Exemple #7
0
static WRITE16_HANDLER( audio_control_w )
{
	relief_state *state = (relief_state *)space->machine->driver_data;
	if (ACCESSING_BITS_0_7)
	{
		state->ym2413_volume = (data >> 1) & 15;
		atarigen_set_ym2413_vol(space->machine, (state->ym2413_volume * state->overall_volume * 100) / (127 * 15));
		state->adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (state->adpcm_bank_base & 0x100000);
	}
	if (ACCESSING_BITS_8_15)
		state->adpcm_bank_base = (0x100000 * ((data >> 8) & 1)) | (state->adpcm_bank_base & 0x0c0000);

	okim6295_set_bank_base(devtag_get_device(space->machine, "oki"), state->adpcm_bank_base);
}
Exemple #8
0
static WRITE8_HANDLER( playmark_snd_control_w )
{
	playmark_oki_control = data;

	if(data & 3)
	{
		if(playmark_oki_bank != ((data & 3) - 1))
		{
			playmark_oki_bank = (data & 3) - 1;
			okim6295_set_bank_base(devtag_get_device(space->machine, "oki"), 0x40000 * playmark_oki_bank);
		}
	}

	if ((data & 0x38) == 0x18)
	{
		okim6295_w(devtag_get_device(space->machine, "oki"), 0, playmark_oki_command);
	}

//  !(data & 0x80) -> sound enable
//   (data & 0x40) -> always set
}
Exemple #9
0
static WRITE8_DEVICE_HANDLER( egghunt_okibanking_w )
{
    egghunt_okibanking = data;
    okim6295_set_bank_base(device, (data & 0x10) ? 0x40000 : 0);
}
Exemple #10
0
static WRITE16_HANDLER( k3_soundbanks_w )
{
	okim6295_set_bank_base(devtag_get_device(space->machine, "oki1"), (data & 4) ? 0x40000 : 0);
	okim6295_set_bank_base(devtag_get_device(space->machine, "oki2"), (data & 2) ? 0x40000 : 0);
}
Exemple #11
0
static WRITE8_DEVICE_HANDLER( paradise_okibank_w )
{
	if (data & ~0x02)	logerror("%s: unknown oki bank bits %02X\n",cpuexec_describe_context(device->machine),data);

	okim6295_set_bank_base(device, (data & 0x02) ? 0x40000 : 0);
}
Exemple #12
0
static WRITE16_DEVICE_HANDLER( sslam_snd_w )
{
	if (ACCESSING_BITS_0_7)
	{
		logerror("%s Writing %04x to Sound CPU\n",cpuexec_describe_context(device->machine),data);
		if (data >= 0x40) {
			if (data == 0xfe) {
				/* This should reset the sound MCU and stop audio playback, but here, it */
				/* chops the first coin insert. So let's only stop any playing melodies. */
				sslam_play(device, 1, (0x80 | 0x40));		/* Stop playing the melody */
			}
			else {
				logerror("Unknown command (%02x) sent to the Sound controller\n",data);
				popmessage("Unknown command (%02x) sent to the Sound controller",data);
			}
		}
		else if (data == 0) {
			sslam_bar = 0;		/* Complete any current bars then stop sequencing */
			sslam_melody = 0;
		}
		else {
			sslam_sound = sslam_snd_cmd[data];

			if (sslam_sound == 0xff) {
				popmessage("Unmapped sound command %02x on Bank %02x",data,sslam_snd_bank);
			}
			else if (sslam_sound >= 0x70) {
				/* These vocals are in bank 1, but a bug in the actual MCU doesn't set the bank */
//              if (sslam_snd_bank != 1)
//                  okim6295_set_bank_base(device, (1 * 0x40000));
//              sslam_snd_bank = 1;
				sslam_play(device, 0, sslam_sound);
			}
			else if (sslam_sound >= 0x69) {
				if (sslam_snd_bank != 2)
					okim6295_set_bank_base(device, (2 * 0x40000));
				sslam_snd_bank = 2;
				switch (sslam_sound)
				{
					case 0x69:	sslam_melody = 5; break;
					case 0x6b:	sslam_melody = 6; break;
					case 0x6c:	sslam_melody = 7; break;
					default:	sslam_melody = 0; sslam_bar = 0; break;	/* Invalid */
				}
				sslam_play(device, sslam_melody, sslam_sound);
			}
			else if (sslam_sound >= 0x65) {
				if (sslam_snd_bank != 1)
					okim6295_set_bank_base(device, (1 * 0x40000));
				sslam_snd_bank = 1;
				sslam_melody = 4;
				sslam_play(device, sslam_melody, sslam_sound);
			}
			else if (sslam_sound >= 0x60) {
				if (sslam_snd_bank != 0)
					okim6295_set_bank_base(device, (0 * 0x40000));
				sslam_snd_bank = 0;
				switch (sslam_sound)
				{
					case 0x60:	sslam_melody = 1; break;
					case 0x63:	sslam_melody = 2; break;
					case 0x64:	sslam_melody = 3; break;
					default:	sslam_melody = 0; sslam_bar = 0; break;	/* Invalid */
				}
				sslam_play(device, sslam_melody, sslam_sound);
			}
			else {
				sslam_play(device, 0, sslam_sound);
			}
		}
	}
}
Exemple #13
0
static WRITE16_DEVICE_HANDLER( oki_bankswitch_w )
{
    if (ACCESSING_BITS_0_7)
        okim6295_set_bank_base(device, (data & 1) * 0x40000);
}
Exemple #14
0
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
	boogwing_state *state = (boogwing_state *)device->machine->driver_data;
	okim6295_set_bank_base(state->oki2, ((data & 2) >> 1) * 0x40000);
	okim6295_set_bank_base(state->oki1, (data & 1) * 0x40000);
}
Exemple #15
0
static WRITE16_DEVICE_HANDLER( oki_bank_w )
{
	okim6295_set_bank_base(device, 0x40000 * ((data & 3) - 1));
}
Exemple #16
0
static WRITE16_DEVICE_HANDLER(pktgaldx_oki_bank_w)
{
	okim6295_set_bank_base(device, (data & 3) * 0x40000);
}