Exemplo n.º 1
0
static void tecmo_adpcm_trigger_w(int offset,int data)
{
	ADPCM_setvol(0,(data & 0x0f) * 0x11);
	if (data & 0x0f)	/* maybe this selects the volume? */
		if (adpcm_start < 0x8000)
			ADPCM_play(0,adpcm_start,(adpcm_end - adpcm_start)*2);
}
Exemplo n.º 2
0
static void cabalbl_play_adpcm( int channel, int which ){
	if( which!=0xff ){
		unsigned char *RAM = memory_region(REGION_SOUND1);
		int offset = channel*0x10000;
		int start, len;

		which = which&0x7f;
		if( which ){
			which = which*2+0x100;
			start = RAM[offset+which] + 256*RAM[offset+which+1];
			len = (RAM[offset+start]*256 + RAM[offset+start+1])*2;
			start+=2;
			ADPCM_play( channel,offset+start,len );
		}
	}
}
Exemplo n.º 3
0
static WRITE_HANDLER( opwolf_adpcm_c_w )
{
	int start;
	int end;

	adpcm_c[offset] = data;

	if (offset==0x04) //trigger ?
	{
		start = adpcm_c[0] + adpcm_c[1]*256;
		end   = adpcm_c[2] + adpcm_c[3]*256;
		start *=16;
		end   *=16;
		ADPCM_play(1,start,(end-start)*2);
	}

	/*logerror("CPU #1     c00%i-data=%2x   pc=%4x\n",offset,data,activecpu_get_pc() );*/
}
Exemplo n.º 4
0
static WRITE_HANDLER( adpcm_play_w ){
	data -= 0x2c;
	if( data >= 0 ) ADPCM_play( 0, 0x2000*data, 0x2000*2 );
}
Exemplo n.º 5
0
static WRITE16_HANDLER( ioc_w )
{
	COMBINE_DATA(&gcpinbal_ioc_ram[offset]);

//	switch (offset)
//	{
//		case 0x??:	/* */
//			return;
//
//		case 0x88/2:	/* coin control (+ others) ??? */
//			coin_lockout_w(0, ~data & 0x01);
//			coin_lockout_w(1, ~data & 0x02);
//usrintf_showmessage(" address %04x value %04x",offset,data);
//	}

	switch (offset)
	{
		// these are all written every frame
		case 0x3b:
		case 0xa:
		case 0xc:
		case 0xb:
		case 0xd:
		case 0xe:
		case 0xf:
		case 0x10:
		case 0x47:
			break;

		// MSM6585 bank, coin LEDs, maybe others?
		case 0x44:
			if (data & 0x10)
			{
				bank = 0x100000;
			}
			else
			{
				bank = 0;
			}
			break;

		case 0x45:
			break;

		// OKIM6295
		case 0x50:
		case 0x51:
			OKIM6295_data_0_w(0, data>>8);
			break;

		// MSM6585 ADPCM - mini emulation
		case 0x60:
			start &= 0xffff00;
			start |= (data>>8);
			break;
		case 0x61:
			start &= 0xff00ff;
			start |= data;
			break;
		case 0x62:
			start &= 0x00ffff;
			start |= (data<<8);
			break;
		case 0x63:
			end &= 0xffff00;
			end |= (data>>8);
			break;
		case 0x64:
			end &= 0xff00ff;
			end |= data;
			break;
		case 0x65:
			end &= 0x00ffff;
			end |= (data<<8);
			break;
		case 0x66:
			if (start < end)
			{
				ADPCM_stop(0);
				ADPCM_play(0, start+bank, end-start);
			}
			break;

		default:
			logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n",activecpu_get_pc(),offset,data);
			break;
	}

}
Exemplo n.º 6
0
static void adpcm_play_w( int offset, int data ){
	data -= 0x2c;
	if( data >= 0 ) ADPCM_play( 0, 0x2000*data, 0x2000*2 );
}