예제 #1
0
//static DEVICE_START( ym3526 )
int device_start_ym3526(void **_info, int clock, int CHIP_SAMPLING_MODE, int CHIP_SAMPLE_RATE)
{
	//static const ym3526_interface dummy = { 0 };
	//ym3526_state *info = get_safe_token(device);
	ym3526_state *info;
	int rate;
	
	info = (ym3526_state *) calloc(1, sizeof(ym3526_state));
	*_info = (void *) info;	

	rate = clock/72;
	if ((CHIP_SAMPLING_MODE == 0x01 && rate < CHIP_SAMPLE_RATE) ||
		CHIP_SAMPLING_MODE == 0x02)
		rate = CHIP_SAMPLE_RATE;
	//info->intf = device->static_config ? (const ym3526_interface *)device->static_config : &dummy;
	//info->intf = &dummy;
	//info->device = device;

	/* stream system initialize */
	info->chip = ym3526_init(clock,rate);
	//assert_always(info->chip != NULL, "Error creating YM3526 chip");

	//info->stream = stream_create(device,0,1,rate,info,ym3526_stream_update);
	/* YM3526 setup */
	ym3526_set_timer_handler (info->chip, TimerHandler, info);
	ym3526_set_irq_handler   (info->chip, IRQHandler, info);
	ym3526_set_update_handler(info->chip, _stream_update, info);

	//info->timer[0] = timer_alloc(device->machine, timer_callback_0, info);
	//info->timer[1] = timer_alloc(device->machine, timer_callback_1, info);

	return rate;
}
예제 #2
0
파일: 3526intf.c 프로젝트: LeWoY/MAMEHub
void ym3526_device::device_start()
{
	int rate = clock()/72;

	// resolve callbacks
	m_irq_handler.resolve();

	/* stream system initialize */
	m_chip = ym3526_init(this,clock(),rate);
	assert_always(m_chip != NULL, "Error creating YM3526 chip");

	m_stream = machine().sound().stream_alloc(*this,0,1,rate);
	/* YM3526 setup */
	ym3526_set_timer_handler (m_chip, timer_handler, this);
	ym3526_set_irq_handler   (m_chip, IRQHandler, this);
	ym3526_set_update_handler(m_chip, ym3526_update_request, this);

	m_timer[0] = timer_alloc(0);
	m_timer[1] = timer_alloc(1);
}
예제 #3
0
static DEVICE_START( ym3526 )
{
	static const ym3526_interface dummy = { 0 };
	ym3526_state *info = get_safe_token(device);
	int rate = device->clock/72;

	info->intf = device->baseconfig().static_config ? (const ym3526_interface *)device->baseconfig().static_config : &dummy;
	info->device = device;

	/* stream system initialize */
	info->chip = ym3526_init(device,device->clock,rate);
	assert_always(info->chip != NULL, "Error creating YM3526 chip");

	info->stream = stream_create(device,0,1,rate,info,ym3526_stream_update);
	/* YM3526 setup */
	ym3526_set_timer_handler (info->chip, TimerHandler, info);
	ym3526_set_irq_handler   (info->chip, IRQHandler, info);
	ym3526_set_update_handler(info->chip, _stream_update, info);

	info->timer[0] = timer_alloc(device->machine, timer_callback_0, info);
	info->timer[1] = timer_alloc(device->machine, timer_callback_1, info);
}