コード例 #1
0
ファイル: icecold.c プロジェクト: coinhelper/jsmess
INPUT_PORTS_END

void icecold_state::machine_reset()
{
	// CH-C is used for generate a 30hz clock
	ay8910_set_volume(m_ay8910_0, 2, 0);

	m_rmotor = m_lmotor = 10;
	m_sint = 0;
	m_motenbl = 0;
	m_ball_gate_sw = 1;
}
コード例 #2
0
ファイル: zaccaria.c プロジェクト: DarrenBranford/MAME4iOS
static WRITE8_DEVICE_HANDLER( ay8910_port0a_w )
{
	/* bits 0-2 go to a 74LS156 with open collector outputs
     * one out of 8 Resitors is than used to form a resistor
     * divider with Analog input 5 (tromba)
     */

	// bits 3-4 control the analog drum emulation on 8910 #0 ch. A

	static const int table[8] = { 8200, 5600, 3300, 1500, 820, 390, 150, 47 };
	int b0, b1, b2, ba, v;
	b0 = data & 0x01;
	b1 = (data & 0x02) >> 1;
	b2 = (data & 0x04) >> 2;
	ba = (b0<<2) | (b1<<1) | b2;
	/* 150 below to scale to volume 100 */
	v = (150 * table[ba]) / (4700 + table[ba]);
	//printf("dac1w %02d %04d\n", ba, v);
	ay8910_set_volume(device->machine->device("ay2"), 1, v);
}