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


C++ running_machine::add_notifier方法代码示例

本文整理汇总了C++中running_machine::add_notifier方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::add_notifier方法的具体用法?C++ running_machine::add_notifier怎么用?C++ running_machine::add_notifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在running_machine的用法示例。


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

示例1:

output_manager::output_manager(running_machine &machine)
	: m_machine(machine),
		m_uniqueid(12345)
{
	/* add pause callback */
	machine.add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(output_manager::pause), this));
	machine.add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(output_manager::resume), this));
}
开发者ID:NULUSIOS,项目名称:mame,代码行数:8,代码来源:output.cpp

示例2: output_init

void output_init(running_machine &machine)
{
	/* add pause callback */
	machine.add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(output_pause), &machine));
	machine.add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(output_resume), &machine));

	/* get a callback when done */
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(output_exit), &machine));

	/* reset the lists */
	memset(itemtable, 0, sizeof(itemtable));
	global_notifylist.reset();
}
开发者ID:ursine,项目名称:mame,代码行数:13,代码来源:output.cpp

示例3: osd_xenon_video_hw_init

void osd_xenon_video_hw_init(running_machine &machine) {
    XenosSurface * fb = Xe_GetFramebufferSurface(g_pVideoDevice);

    Xe_SetRenderTarget(g_pVideoDevice, fb);

    LoadShaderEffects();

    g_pTexture = Xe_CreateTexture(g_pVideoDevice, XE_W, XE_H, 1, XE_FMT_8888 | XE_FMT_ARGB, 0);
    screen = (unsigned int*) Xe_Surface_LockRect(g_pVideoDevice, g_pTexture, 0, 0, 0, 0, XE_LOCK_WRITE);
    Xe_Surface_Unlock(g_pVideoDevice, g_pTexture);

    g_pTexture->use_filtering = 0;

    pitch = g_pTexture->wpitch;

    screen_width = fb->width;
    screen_height = fb->height;

    vb = Xe_CreateVertexBuffer(g_pVideoDevice, 65536 * sizeof (MameVerticeFormats));
    soft_vb = Xe_CreateVertexBuffer(g_pVideoDevice, 65536 * sizeof (MameVerticeFormats));


    float w = fb->width;
    float h = fb->height;

    Xe_SetClearColor(g_pVideoDevice, 0);

    osd_xenon_video_resume();

    // on mame exit
    machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(osd_xenon_video_cleanup), &machine));
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例4: sdlvideo_init

int sdlvideo_init(running_machine &machine)
{
	int index;

	// extract data from the options
	extract_video_config(machine);

	// ensure we get called on the way out
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(video_exit), &machine));

	// set up monitors first
	init_monitors();

	// we need the beam width in a float, contrary to what the core does.
	video_config.beamwidth = machine.options().beam();

	// initialize the window system so we can make windows
	if (sdlwindow_init(machine))
		return 1;

	// create the windows
	sdl_options &options = downcast<sdl_options &>(machine.options());
	for (index = 0; index < video_config.numscreens; index++)
	{
		sdl_window_config conf;
		memset(&conf, 0, sizeof(conf));
		extract_window_config(machine, index, &conf);
		if (sdlwindow_video_window_create(machine, index, pick_monitor(options, index), &conf))
			return 1;
	}

	return 0;
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例5: debugger_init

void debugger_init(running_machine &machine)
{
    /* only if debugging is enabled */
    if (machine.debug_flags & DEBUG_FLAG_ENABLED)
    {
        machine_entry *entry;

        /* initialize the submodules */
        machine.m_debug_view.reset(global_alloc(debug_view_manager(machine)));
        debug_cpu_init(machine);
        debug_command_init(machine);
        debug_console_init(machine);

        /* allocate a new entry for our global list */
        machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debugger_exit), &machine));
        entry = global_alloc(machine_entry);
        entry->next = machine_list;
        entry->machine = &machine;
        machine_list = entry;

        /* register an atexit handler if we haven't yet */
        if (!atexit_registered)
            atexit(debugger_flush_all_traces_on_abnormal_exit);
        atexit_registered = TRUE;

        /* listen in on the errorlog */
        machine.add_logerror_callback(debug_errorlog_write_line);

        /* initialize osd debugger features */
        machine.osd().init_debugger();
    }
}
开发者ID:robsonfr,项目名称:mame,代码行数:32,代码来源:debugger.cpp

示例6:

cheat_manager::cheat_manager(running_machine &machine)
	: m_machine(machine),
		m_disabled(true),
		m_symtable(&machine)
{
	// if the cheat engine is disabled, we're done
	if (!machine.options().cheat())
		return;

	// request a callback
	machine.add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(cheat_manager::frame_update), this));

	// create a global symbol table
	m_symtable.add("frame", symbol_table::READ_ONLY, &m_framecount);
	m_symtable.add("frombcd", NULL, 1, 1, execute_frombcd);
	m_symtable.add("tobcd", NULL, 1, 1, execute_tobcd);

	// we rely on the debugger expression callbacks; if the debugger isn't
	// enabled, we must jumpstart them manually
	if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
		debug_cpu_init(machine);

	// configure for memory access (shared with debugger)
	debug_cpu_configure_memory(machine, m_symtable);

	// load the cheats
	reload();
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:28,代码来源:cheat.c

示例7: init

void ui_menu::init(running_machine &machine)
{
	int x;

	// initialize the menu stack
	ui_menu::stack_reset(machine);

	// create a texture for hilighting items
	hilight_bitmap = std::make_unique<bitmap_rgb32>(256, 1);
	for (x = 0; x < 256; x++)
	{
		int alpha = 0xff;
		if (x < 25) alpha = 0xff * x / 25;
		if (x > 256 - 25) alpha = 0xff * (255 - x) / 25;
		hilight_bitmap->pix32(0, x) = rgb_t(alpha,0xff,0xff,0xff);
	}
	hilight_texture = machine.render().texture_alloc();
	hilight_texture->set_bitmap(*hilight_bitmap, hilight_bitmap->cliprect(), TEXFORMAT_ARGB32);

	// create a texture for arrow icons
	arrow_texture = machine.render().texture_alloc(render_triangle);

	// add an exit callback to free memory
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_menu::exit), &machine));
}
开发者ID:toughkidcst,项目名称:mame,代码行数:25,代码来源:menu.cpp

示例8: ui_gfx_init

void ui_gfx_init(running_machine &machine)
{
	ui_gfx_state *state = &ui_gfx;
	UINT8 rotate = machine.system().flags & ORIENTATION_MASK;

	// make sure we clean up after ourselves
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_gfx_exit), &machine));

	// initialize our global state
	memset(state, 0, sizeof(*state));

	// set up the palette state
	state->palette.columns = 16;

	// set up the graphics state
	for (UINT8 i = 0; i < MAX_GFX_DECODERS; i++)
		for (UINT8 j = 0; j < MAX_GFX_ELEMENTS; j++)
		{
			state->gfxdev[i].rotate[j] = rotate;
			state->gfxdev[i].columns[j] = 16;
		}

	// set up the tilemap state
	state->tilemap.rotate = rotate;
}
开发者ID:GiuseppeGorgoglione,项目名称:mame,代码行数:25,代码来源:viewgfx.cpp

示例9: rom_init

void rom_init(running_machine &machine)
{
	rom_load_data *romdata;

	/* allocate private data */
	machine.romload_data = romdata = auto_alloc_clear(machine, romload_private);

	/* make sure we get called back on the way out */
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(rom_exit), &machine));

	/* reset the romdata struct */
	romdata->m_machine = &machine;

	/* figure out which BIOS we are using */
	determine_bios_rom(romdata);

	/* count the total number of ROMs */
	count_roms(romdata);

	/* reset the disk list */
	romdata->chd_list.reset();

	/* process the ROM entries we were passed */
	process_region_list(romdata);

	/* display the results and exit */
	display_rom_load_results(romdata);
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:28,代码来源:romload.c

示例10: image_postdevice_init

void image_postdevice_init(running_machine &machine)
{
	device_image_interface *image = NULL;

	/* make sure that any required devices have been allocated */
    for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
    {
			int result = image->finish_load();
			/* did the image load fail? */
			if (result)
			{
				/* retrieve image error message */
				astring image_err = astring(image->error());

				/* unload all images */
				image_unload_all(machine);

				fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
					image->device().name(),
					image_err.cstr());
			}
	}

	/* add a callback for when we shut down */
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(image_unload_all), &machine));
}
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:26,代码来源:image.c

示例11: winvideo_init

void winvideo_init(running_machine &machine)
{
	int index;

	// ensure we get called on the way out
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(winvideo_exit), &machine));

	// extract data from the options
	extract_video_config(machine);

	// set up monitors first
	init_monitors();

	// initialize the window system so we can make windows
	winwindow_init(machine);

	// create the windows
	windows_options &options = downcast<windows_options &>(machine.options());
	for (index = 0; index < video_config.numscreens; index++)
		winwindow_video_window_create(machine, index, pick_monitor(options, index), &video_config.window[index]);
	if (video_config.mode != VIDEO_MODE_NONE)
		SetForegroundWindow(win_window_list->hwnd);

	// possibly create the debug window, but don't show it yet
	if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
		machine.osd().init_debugger();
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:27,代码来源:video.c

示例12: ui_gfx_init

void ui_gfx_init(running_machine &machine)
{
	ui_gfx_state *state = &ui_gfx;
	uint8_t rotate = machine.system().flags & machine_flags::MASK_ORIENTATION;

	// make sure we clean up after ourselves
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&ui_gfx_exit, &machine));

	// initialize our global state
	memset(state, 0, sizeof(*state));

	// set up the palette state
	state->palette.columns = 16;

	// set up the graphics state
	for (uint8_t i = 0; i < MAX_GFX_DECODERS; i++)
		for (uint8_t j = 0; j < MAX_GFX_ELEMENTS; j++)
		{
			state->gfxdev[i].rotate[j] = rotate;
			state->gfxdev[i].columns[j] = 16;
		}

	// set up the tilemap state
	state->tilemap.rotate = rotate;
	state->tilemap.flags = TILEMAP_DRAW_ALL_CATEGORIES;
}
开发者ID:qwijibo,项目名称:mame,代码行数:26,代码来源:viewgfx.cpp

示例13: generic_machine_init

void generic_machine_init(running_machine &machine)
{
	generic_machine_private *state;
	int counternum;

	/* allocate our state */
	machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
	state = machine.generic_machine_data;

	/* reset coin counters */
	for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
	{
		state->lastcoin[counternum] = 0;
		state->coinlockedout[counternum] = 0;
	}

	/* register coin save state */
	machine.save().save_item(NAME(state->coin_count));
	machine.save().save_item(NAME(state->coinlockedout));
	machine.save().save_item(NAME(state->lastcoin));

	/* reset memory card info */
	state->memcard_inserted = -1;

	/* register for configuration */
	config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine));

	/* for memory cards, request save state and an exit callback */
	if (machine.config().m_memcard_handler != NULL)
	{
		machine.save().save_item(NAME(state->memcard_inserted));
		machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(memcard_eject), &machine));
	}
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:34,代码来源:generic.c

示例14: generic_machine_init

void generic_machine_init(running_machine &machine)
{
    generic_machine_private *state;
    int counternum;

    /* allocate our state */
    machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
    state = machine.generic_machine_data;

    /* reset coin counters */
    for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
    {
        state->lastcoin[counternum] = 0;
        state->coinlockedout[counternum] = 0;
    }

    // map devices to the interrupt state
    memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
    device_execute_interface *exec = NULL;
    int index = 0;
    for (bool gotone = machine.devicelist().first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
        state->interrupt_device[index++] = &exec->device();

    /* register coin save state */
    machine.save().save_item(NAME(state->coin_count));
    machine.save().save_item(NAME(state->coinlockedout));
    machine.save().save_item(NAME(state->lastcoin));

    /* reset memory card info */
    state->memcard_inserted = -1;

    /* register a reset callback and save state for interrupt enable */
    machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(interrupt_reset), &machine));
    machine.save().save_item(NAME(state->interrupt_enable));

    /* register for configuration */
    config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine));

    /* for memory cards, request save state and an exit callback */
    if (machine.config().m_memcard_handler != NULL)
    {
        state_save_register_global(machine, state->memcard_inserted);
        machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(memcard_eject), &machine));
    }
}
开发者ID:Luke-Nukem,项目名称:mame-144-vector_mod,代码行数:45,代码来源:generic.c

示例15: gtia_init

void gtia_init(running_machine &machine, const gtia_interface *intf)
{
	memset(&gtia, 0, sizeof(gtia));
	gtia.intf = *intf;

	machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(gtia_reset), &machine));

	/* state saves */
	gtia_state(machine);
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:10,代码来源:gtia.c


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