static void notifier_callback(const char *outname, INT32 value, void *param) { if (output != NULL) { fprintf(output, "OUT " PID_FMT " %s %d\n", osd_getpid(), outname, value); fflush(output); } }
static void sdloutput_exit(running_machine &machine) { if (output != NULL) { fprintf(output, "MAME " PID_FMT " STOP %s\n", osd_getpid(), machine.system().name); fflush(output); fclose(output); output = NULL; mame_printf_verbose("ouput: closed output notifier file\n"); } }
void sdl_osd_interface::output_exit() { if (output != NULL) { fprintf(output, "MAME " PID_FMT " STOP %s\n", osd_getpid(), machine().system().name); fflush(output); fclose(output); output = NULL; osd_printf_verbose("output: closed output notifier file\n"); } }
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; }
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); }