Exemple #1
0
void lua_engine::emu_hook_output(lua_State *L)
{
	luaL_argcheck(L, lua_isfunction(L, 1), 1, "callback function expected");
	hook_output_cb.set(L, 1);

	if (!output_notifier_set) {
		output_set_notifier(NULL, s_output_notifier, this);
		output_notifier_set = true;
	}
}
Exemple #2
0
void winoutput_init(running_machine &machine)
{
	int result;

	// ensure we get cleaned up
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(winoutput_exit), &machine));

	// reset globals
	clientlist = NULL;

	// create our window class
	result = create_window_class();
	assert(result == 0);
	(void)result; // to silence gcc 4.6

	// create a window
	output_hwnd = CreateWindowEx(
						WINDOW_STYLE_EX,
						OUTPUT_WINDOW_CLASS,
						OUTPUT_WINDOW_NAME,
						WINDOW_STYLE,
						0, 0,
						1, 1,
						NULL,
						NULL,
						GetModuleHandle(NULL),
						NULL);
	assert(output_hwnd != NULL);

	// set a pointer to the running machine
	SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)&machine);

	// allocate message ids
	om_mame_start = RegisterWindowMessage(OM_MAME_START);
	assert(om_mame_start != 0);
	om_mame_stop = RegisterWindowMessage(OM_MAME_STOP);
	assert(om_mame_stop != 0);
	om_mame_update_state = RegisterWindowMessage(OM_MAME_UPDATE_STATE);
	assert(om_mame_update_state != 0);

	om_mame_register_client = RegisterWindowMessage(OM_MAME_REGISTER_CLIENT);
	assert(om_mame_register_client != 0);
	om_mame_unregister_client = RegisterWindowMessage(OM_MAME_UNREGISTER_CLIENT);
	assert(om_mame_unregister_client != 0);
	om_mame_get_id_string = RegisterWindowMessage(OM_MAME_GET_ID_STRING);
	assert(om_mame_get_id_string != 0);

	// broadcast a startup message
	PostMessage(HWND_BROADCAST, om_mame_start, (WPARAM)output_hwnd, 0);

	// register a notifier for output changes
	output_set_notifier(NULL, notifier_callback, NULL);
}
Exemple #3
0
void winoutput_init(running_machine *machine)
{
	int result;

	// ensure we get cleaned up
	add_exit_callback(machine, winoutput_exit);

	// reset globals
	clientlist = NULL;

	// create our window class
	result = create_window_class();
	assert(result == 0);

	// create a window
	output_hwnd = CreateWindowEx(
						WINDOW_STYLE_EX,
						OUTPUT_WINDOW_CLASS,
						OUTPUT_WINDOW_NAME,
						WINDOW_STYLE,
						0, 0,
						1, 1,
						NULL,
						NULL,
						GetModuleHandle(NULL),
						NULL);
	assert(output_hwnd != NULL);

	// allocate message ids
	om_mame_start = RegisterWindowMessage(OM_MAME_START);
	assert(om_mame_start != 0);
	om_mame_stop = RegisterWindowMessage(OM_MAME_STOP);
	assert(om_mame_stop != 0);
	om_mame_update_state = RegisterWindowMessage(OM_MAME_UPDATE_STATE);
	assert(om_mame_update_state != 0);

	om_mame_register_client = RegisterWindowMessage(OM_MAME_REGISTER_CLIENT);
	assert(om_mame_register_client != 0);
	om_mame_unregister_client = RegisterWindowMessage(OM_MAME_UNREGISTER_CLIENT);
	assert(om_mame_unregister_client != 0);
	om_mame_get_id_string = RegisterWindowMessage(OM_MAME_GET_ID_STRING);
	assert(om_mame_get_id_string != 0);

	// broadcast a startup message
	PostMessage(HWND_BROADCAST, om_mame_start, (WPARAM)output_hwnd, 0);

	// register a notifier for output changes
	output_set_notifier(NULL, notifier_callback, NULL);
}
Exemple #4
0
bool sdl_osd_interface::output_init()
{
	int fildes;

	fildes = open(SDLMAME_OUTPUT, O_RDWR | O_NONBLOCK);

	if (fildes < 0)
	{
		output = NULL;
		osd_printf_verbose("output: unable to open output notifier file %s\n", SDLMAME_OUTPUT);
	}
	else
	{
		output = fdopen(fildes, "w");

		osd_printf_verbose("output: opened output notifier file %s\n", SDLMAME_OUTPUT);
		fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine().system().name);
		fflush(output);
	}

	output_set_notifier(NULL, notifier_callback, NULL);
	return true;
}
Exemple #5
0
void sdloutput_init(running_machine &machine)
{
    int fildes;

    machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(sdloutput_exit), &machine));

    fildes = open(SDLMAME_OUTPUT, O_RDWR | O_NONBLOCK);

    if (fildes < 0)
    {
        output = NULL;
        mame_printf_verbose("ouput: unable to open output notifier file %s\n", SDLMAME_OUTPUT);
    }
    else
    {
        output = fdopen(fildes, "w");

        mame_printf_verbose("ouput: opened output notifier file %s\n", SDLMAME_OUTPUT);
        fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine.system().name);
        fflush(output);
    }

    output_set_notifier(NULL, notifier_callback, NULL);
}