Ejemplo n.º 1
0
//static DEVICE_START( ymf262 )
int device_start_ymf262(UINT8 ChipID, int clock)
{
	//static const ymf262_interface dummy = { 0 };
	//ymf262_state *info = get_safe_token(device);
	ymf262_state *info;
	int rate;
	
	if (ChipID >= MAX_CHIPS)
		return 0;
	
	info = &YMF262Data[ChipID];
	rate = clock/288;
	if ((CHIP_SAMPLING_MODE == 0x01 && rate < CHIP_SAMPLE_RATE) ||
		CHIP_SAMPLING_MODE == 0x02)
		rate = CHIP_SAMPLE_RATE;

	//info->intf = device->static_config ? (const ymf262_interface *)device->static_config : &dummy;
	//info->intf = &dummy;
	//info->device = device;

	/* stream system initialize */
	switch(EMU_CORE)
	{
#ifdef ENABLE_ALL_CORES
	case EC_MAME:
		info->chip = ymf262_init(clock,rate);
		//assert_always(info->chip != NULL, "Error creating YMF262 chip");

		//info->stream = stream_create(device,0,4,rate,info,ymf262_stream_update);

		/* YMF262 setup */
		ymf262_set_timer_handler (info->chip, timer_handler_262, info);
		ymf262_set_irq_handler   (info->chip, IRQHandler_262, info);
		ymf262_set_update_handler(info->chip, _stream_update, info);

		//info->timer[0] = timer_alloc(device->machine, timer_callback_262_0, info);
		//info->timer[1] = timer_alloc(device->machine, timer_callback_262_1, info);
		break;
#endif
	case EC_DBOPL:
		info->chip = adlib_OPL3_init(clock, rate, _stream_update, info);
		break;
	}
	
	return rate;
}
Ejemplo n.º 2
0
void ymf262_device::device_start()
{
	int rate = clock()/288;

	m_irq_handler.resolve();

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

	m_stream = machine().sound().stream_alloc(*this,0,4,rate);

	/* YMF262 setup */
	ymf262_set_timer_handler (m_chip, timer_handler, this);
	ymf262_set_irq_handler   (m_chip, IRQHandler, this);
	ymf262_set_update_handler(m_chip, ymf262_update_request, this);

	m_timer[0] = timer_alloc(0);
	m_timer[1] = timer_alloc(1);
}
Ejemplo n.º 3
0
static DEVICE_START( ymf262 )
{
    static const ymf262_interface dummy = { 0 };
    ymf262_state *info = get_safe_token(device);
    int rate = device->clock()/288;

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

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

    info->stream = device->machine().sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);

    /* YMF262 setup */
    ymf262_set_timer_handler (info->chip, timer_handler_262, info);
    ymf262_set_irq_handler   (info->chip, IRQHandler_262, info);
    ymf262_set_update_handler(info->chip, _stream_update, info);

    info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_0), info);
    info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_1), info);
}