当前位置: 首页>>代码示例>>C++>>正文


C++ save_prepost_delegate函数代码示例

本文整理汇总了C++中save_prepost_delegate函数的典型用法代码示例。如果您正苦于以下问题:C++ save_prepost_delegate函数的具体用法?C++ save_prepost_delegate怎么用?C++ save_prepost_delegate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了save_prepost_delegate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void msx_slot_ram_mm_device::device_start()
{
	// Valid mapper sizes are 64KB, 128KB, 256KB, 512KB, 1MB, 2MB, and 4MB */
	switch (m_total_size)
	{
		case   64*1024: m_bank_mask = 0x03; break;
		case  128*1024: m_bank_mask = 0x07; break;
		case  256*1024: m_bank_mask = 0x0F; break;
		case  512*1024: m_bank_mask = 0x1F; break;
		case 1024*1024: m_bank_mask = 0x3F; break;
		case 2048*1024: m_bank_mask = 0x7F; break;
		case 4096*1024: m_bank_mask = 0xFF; break;
		default: fatalerror("Invalid memory mapper size specified\n");
	}

	m_ram.resize(m_total_size);

	for ( int i = 0; i < 4; i++ )
	{
		m_bank_selected[i] = 3 -i;
		m_bank_base[i] = &m_ram[0x4000 * m_bank_selected[i]];
	}

	save_item(NAME(m_ram));
	save_item(NAME(m_bank_selected));

	machine().save().register_postload(save_prepost_delegate(FUNC(msx_slot_ram_mm_device::restore_banks), this));

	// Install IO read/write handlers
	address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
	space.install_read_handler(0xFC, 0xFF, read8_delegate(FUNC(msx_slot_ram_mm_device::read_mapper_bank), this));
	space.install_write_handler(0xFC, 0xFF, write8_delegate(FUNC(msx_slot_ram_mm_device::write_mapper_bank), this));
}
开发者ID:Ashura-X,项目名称:mame,代码行数:33,代码来源:ram_mm.c

示例2: save_item

void msx_cart_disk_type1::device_start()
{
	save_item(NAME(m_side_control));
	save_item(NAME(m_control));

	machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_disk_type1::post_load), this));
}
开发者ID:dinkc64,项目名称:mame,代码行数:7,代码来源:disk.c

示例3: machine

void pv1000_state::machine_start()
{
	m_irq_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pv1000_state::d65010_irq_on_cb),this));
	m_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pv1000_state::d65010_irq_off_cb),this));

	m_gfxram = memregion("gfxram")->base();
	save_pointer(NAME(m_gfxram), 0x400);

	if (m_cart->exists())
	{
		m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x7fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));

		// FIXME: this is needed for gfx decoding, but there is probably a cleaner solution!
		std::string region_tag;
		memcpy(memregion("gfxrom")->base(), memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str())->base(), m_cart->get_rom_size());
	}

	save_item(NAME(m_io_regs));
	save_item(NAME(m_fd_data));
	save_item(NAME(m_pcg_bank));
	save_item(NAME(m_force_pattern));
	save_item(NAME(m_fd_buffer_flag));
	save_item(NAME(m_border_col));

	machine().save().register_postload(save_prepost_delegate(FUNC(pv1000_state::pv1000_postload), this));
}
开发者ID:Robbbert,项目名称:store1,代码行数:26,代码来源:pv1000.cpp

示例4: membank

SLOT_INTERFACE_END

/* Machine Initialization */

void xor100_state::machine_start()
{
	int banks = m_ram->size() / 0x10000;
	UINT8 *ram = m_ram->pointer();
	UINT8 *rom = m_rom->base();

	/* setup memory banking */
	membank("bank1")->configure_entries(1, banks, ram, 0x10000);
	membank("bank2")->configure_entry(0, rom);
	membank("bank2")->configure_entries(1, banks, ram, 0x10000);
	membank("bank3")->configure_entry(0, rom);
	membank("bank3")->configure_entries(1, banks, ram + 0xf800, 0x10000);

	machine().save().register_postload(save_prepost_delegate(FUNC(xor100_state::post_load), this));

	/* register for state saving */
	save_item(NAME(m_mode));
	save_item(NAME(m_bank));
	save_item(NAME(m_fdc_irq));
	save_item(NAME(m_fdc_drq));
	save_item(NAME(m_fdc_dden));
	save_item(NAME(m_centronics_busy));
	save_item(NAME(m_centronics_select));
}
开发者ID:mbcoguno,项目名称:mame,代码行数:28,代码来源:xor100.c

示例5: assert

void tms9927_device::device_start()
{
	assert(clock() > 0);
	assert(m_hpixels_per_column > 0);

	/* copy the initial parameters */
	m_clock = clock();

	/* get the screen device */
	m_screen = downcast<screen_device *>(machine().device(m_screen_tag));
	assert(m_screen != NULL);

	/* get the self-load PROM */
	if (m_selfload_region != NULL)
	{
		m_selfload = machine().root_device().memregion(m_selfload_region)->base();
		assert(m_selfload != NULL);
	}

	/* register for state saving */
	machine().save().register_postload(save_prepost_delegate(FUNC(tms9927_device::state_postload), this));

	save_item(NAME(m_reg));
	save_item(NAME(m_start_datarow));
	save_item(NAME(m_reset));
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:26,代码来源:tms9927.c

示例6: assert

void msx_slot_panasonic08_device::device_start()
{
	assert(m_region != NULL );

	memory_region *m_rom_region = owner()->memregion(m_region);

	// Sanity checks
	if (m_rom_region == NULL )
	{
		fatalerror("Rom slot '%s': Unable to find memory region '%s'\n", tag(), m_region);
	}
	if (m_rom_region->bytes() < m_region_offset + 0x200000)
	{
		fatalerror("Memory region '%s' is too small for the FS4600 firmware\n", m_region);
	}

	m_sram.resize(0x4000);

	m_nvram->set_base((UINT8*)m_sram, 0x4000);

	m_rom = m_rom_region->base() + m_region_offset;

	save_item(NAME(m_selected_bank));
	save_item(NAME(m_control));

	machine().save().register_postload(save_prepost_delegate(FUNC(msx_slot_panasonic08_device::restore_banks), this));

	restore_banks();
}
开发者ID:Ander-son,项目名称:libretro-mame,代码行数:29,代码来源:panasonic08.c

示例7: auto_alloc_clear

poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags)
{
	poly_manager *poly;

	/* allocate the manager itself */
	poly = auto_alloc_clear(machine, poly_manager);
	poly->flags = flags;

	/* allocate polygons */
	poly->polygon_size = sizeof(polygon_info);
	poly->polygon_count = MAX(max_polys, 1);
	poly->polygon_next = 0;
	poly->polygon = (polygon_info **)allocate_array(machine, &poly->polygon_size, poly->polygon_count);

	/* allocate extra data */
	poly->extra_size = extra_data_size;
	poly->extra_count = poly->polygon_count;
	poly->extra_next = 1;
	poly->extra = allocate_array(machine, &poly->extra_size, poly->extra_count);

	/* allocate triangle work units */
	poly->unit_size = (flags & POLYFLAG_ALLOW_QUADS) ? sizeof(quad_work_unit) : sizeof(tri_work_unit);
	poly->unit_count = MIN(poly->polygon_count * UNITS_PER_POLY, 65535);
	poly->unit_next = 0;
	poly->unit = (work_unit **)allocate_array(machine, &poly->unit_size, poly->unit_count);

	/* create the work queue */
	if (!(flags & POLYFLAG_NO_WORK_QUEUE))
		poly->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ);

	/* request a pre-save callback for synchronization */
	machine.save().register_presave(save_prepost_delegate(FUNC(poly_state_presave), poly));
	return poly;
}
开发者ID:NastyNoah,项目名称:groovyarcade.groovymame,代码行数:34,代码来源:poly.c

示例8: MACHINE_START

static MACHINE_START( othunder )
{
	othunder_state *state = machine.driver_data<othunder_state>();

	state->membank("bank10")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0xc000, 0x4000);

	state->m_maincpu = machine.device("maincpu");
	state->m_audiocpu = machine.device("audiocpu");
	state->m_eeprom = machine.device<eeprom_device>("eeprom");
	state->m_tc0220ioc = machine.device("tc0220ioc");
	state->m_tc0100scn = machine.device("tc0100scn");
	state->m_tc0110pcr = machine.device("tc0110pcr");
	state->m_tc0140syt = machine.device("tc0140syt");
	state->m_2610_0l = machine.device("2610.0l");
	state->m_2610_0r = machine.device("2610.0r");
	state->m_2610_1l = machine.device("2610.1l");
	state->m_2610_1r = machine.device("2610.1r");
	state->m_2610_2l = machine.device("2610.2l");
	state->m_2610_2r = machine.device("2610.2r");

	state->save_item(NAME(state->m_vblank_irq));
	state->save_item(NAME(state->m_ad_irq));
	state->save_item(NAME(state->m_banknum));
	state->save_item(NAME(state->m_pan));
	machine.save().register_postload(save_prepost_delegate(FUNC(reset_sound_region), &machine));
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:26,代码来源:othunder.c

示例9: device_missing_dependencies

void k052109_device::device_start()
{
	if (m_screen_tag != nullptr)
	{
		// make sure our screen is started
		screen_device *screen = m_owner->subdevice<screen_device>(m_screen_tag);
		if (!screen->started())
			throw device_missing_dependencies();

		// and register a callback for vblank state
		screen->register_vblank_callback(vblank_state_delegate(FUNC(k052109_device::vblank_callback), this));
	}

	if (region() != nullptr)
	{
		m_char_rom = region()->base();
		m_char_size = region()->bytes();
	}

	decode_gfx();
	gfx(0)->set_colors(palette().entries() / gfx(0)->depth());

	m_ram = make_unique_clear<UINT8[]>(0x6000);

	m_colorram_F = &m_ram[0x0000];
	m_colorram_A = &m_ram[0x0800];
	m_colorram_B = &m_ram[0x1000];
	m_videoram_F = &m_ram[0x2000];
	m_videoram_A = &m_ram[0x2800];
	m_videoram_B = &m_ram[0x3000];
	m_videoram2_F = &m_ram[0x4000];
	m_videoram2_A = &m_ram[0x4800];
	m_videoram2_B = &m_ram[0x5000];

	m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);

	m_tilemap[0]->set_transparent_pen(0);
	m_tilemap[1]->set_transparent_pen(0);
	m_tilemap[2]->set_transparent_pen(0);

	// bind callbacks
	m_k052109_cb.bind_relative_to(*owner());

	// resolve callbacks
	m_irq_handler.resolve_safe();
	m_firq_handler.resolve_safe();
	m_nmi_handler.resolve_safe();

	save_pointer(NAME(m_ram.get()), 0x6000);
	save_item(NAME(m_rmrd_line));
	save_item(NAME(m_romsubbank));
	save_item(NAME(m_scrollctrl));
	save_item(NAME(m_irq_enabled));
	save_item(NAME(m_charrombank));
	save_item(NAME(m_charrombank_2));
	save_item(NAME(m_has_extra_video_ram));
	machine().save().register_postload(save_prepost_delegate(FUNC(k052109_device::tileflip_reset), this));
}
开发者ID:ccmurray,项目名称:mame,代码行数:60,代码来源:k052109.cpp

示例10: memregion

INPUT_PORTS_END


void xmen_state::machine_start()
{
	UINT8 *ROM = memregion("audiocpu")->base();

	membank("bank4")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
	membank("bank4")->set_entry(0);

	m_maincpu = machine().device<cpu_device>("maincpu");
	m_audiocpu = machine().device<cpu_device>("audiocpu");
	m_k053246 = machine().device("k053246");
	m_k053251 = machine().device("k053251");
	m_k052109 = machine().device("k052109");
	m_k054539 = machine().device("k054539");
	m_lscreen = machine().device("lscreen");
	m_rscreen = machine().device("rscreen");

	save_item(NAME(m_sound_curbank));
	save_item(NAME(m_sprite_colorbase));
	save_item(NAME(m_layer_colorbase));
	save_item(NAME(m_layerpri));
	save_item(NAME(m_vblank_irq_mask));
	machine().save().register_postload(save_prepost_delegate(FUNC(sound_reset_bank), &machine()));
}
开发者ID:clobber,项目名称:UME,代码行数:26,代码来源:xmen.c

示例11: add_map

void pci9050_device::device_start()
{
	pci_device::device_start();

	add_map(0x80, M_MEM, FUNC(pci9050_device::map));           // map 0 is our config registers, mem space
	add_map(0x80, M_IO,  FUNC(pci9050_device::map));           // map 1 is our config registers, i/o space

	for(int i=0; i<4; i++)
		if(!m_maps[i].isnull())
			add_map(0, M_MEM | M_DISABLED, m_maps[i], m_devices[i]);
		else
			add_map(0, M_MEM | M_DISABLED, address_map_constructor(), nullptr);

	m_user_input_handler.resolve();
	m_user_output_handler.resolve();
	// Save states
	save_item(NAME(m_lasrr));
	save_item(NAME(m_lasba));
	save_item(NAME(m_lasbrd));
	save_item(NAME(m_csbase));
	save_item(NAME(m_eromrr));
	save_item(NAME(m_eromba));
	save_item(NAME(m_erombrd));
	save_item(NAME(m_intcsr));
	save_item(NAME(m_cntrl));
	machine().save().register_postload(save_prepost_delegate(FUNC(pci9050_device::postload), this));

}
开发者ID:RafTacker,项目名称:mame,代码行数:28,代码来源:pci9050.cpp

示例12: machine

void nmk112_device::device_start()
{
	const nmk112_interface *intf = (const nmk112_interface *)static_config();

	if (intf->rgn0 == NULL)
	{
		m_rom0 = NULL;
		m_size0 = 0;
	}
	else
	{
		m_rom0 = machine().root_device().memregion(intf->rgn0)->base();
		m_size0 = machine().root_device().memregion(intf->rgn0)->bytes() - 0x40000;
	}

	if (intf->rgn1 == NULL)
	{
		m_rom1 = NULL;
		m_size1 = 0;
	}
	else
	{
		m_rom1 = machine().root_device().memregion(intf->rgn1)->base();
		m_size1 = machine().root_device().memregion(intf->rgn1)->bytes() - 0x40000;
	}

	m_page_mask = ~intf->disable_page_mask;

	save_item(NAME(m_current_bank));
	machine().save().register_postload(save_prepost_delegate(FUNC(nmk112_device::postload_bankswitch), this));
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:31,代码来源:nmk112.c

示例13: save_item

void msx_cart_konami_scc::device_start()
{
	save_item(NAME(m_selected_bank));
	save_item(NAME(m_scc_active));

	machine().save().register_postload(save_prepost_delegate(FUNC(msx_cart_konami_scc::restore_banks), this));
}
开发者ID:Enverex,项目名称:mame,代码行数:7,代码来源:konami.cpp

示例14: MACHINE_START

static MACHINE_START( taitox )
{
	taitox_state *state = machine.driver_data<taitox_state>();

	state->m_banknum = -1;
	state->save_item(NAME(state->m_banknum));
	machine.save().register_postload(save_prepost_delegate(FUNC(reset_sound_region), &machine));
}
开发者ID:vikke,项目名称:mame_0145,代码行数:8,代码来源:taito_x.c

示例15: memregion

void wgp_state::machine_start()
{
	m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);

	save_item(NAME(m_cpua_ctrl));
	save_item(NAME(m_port_sel));
	machine().save().register_postload(save_prepost_delegate(FUNC(wgp_state::wgp_postload), this));
}
开发者ID:bradhugh,项目名称:mame,代码行数:8,代码来源:wgp.cpp


注:本文中的save_prepost_delegate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。