/* * Exit emulator */ static void do_exit_machine (void) { graphics_leave (); inputdevice_close (); #ifdef SCSIEMU scsidev_exit (); #endif DISK_free (); audio_close (); dump_counts (); #ifdef SERIAL_PORT serial_exit (); #endif #ifdef CD32 akiko_free (); #endif gui_exit (); #ifdef AUTOCONFIG expansion_cleanup (); #endif #ifdef FILESYS filesys_cleanup (); hardfile_cleanup (); rtarea_cleanup (); #endif #ifdef SAVESTATE savestate_free (); #endif memory_cleanup (); cfgfile_addcfgparam (0); }
void do_leave_program (void) { graphics_leave (); inputdevice_close (); #ifdef SCSIEMU scsidev_exit (); #endif DISK_free (); close_sound (); dump_counts (); #ifdef SERIAL_PORT serial_exit (); #endif /* #ifdef CD32 akiko_free (); #endif */ if (! no_gui) gui_exit (); #ifdef AUTOCONFIG expansion_cleanup (); #endif #ifdef FILESYS filesys_cleanup (); #endif #ifdef SAVESTATE savestate_free (); #endif memory_cleanup (); cfgfile_addcfgparam (0); }
void do_leave_program (void) { sampler_free (); graphics_leave (); inputdevice_close (); DISK_free (); close_sound (); dump_counts (); #ifdef SERIAL_PORT serial_exit (); #endif #ifdef CDTV cdtv_free (); #endif #ifdef A2091 a2091_free (); a3000scsi_free (); #endif #ifdef NCR ncr710_free(); ncr_free(); #endif #ifdef NCR9X ncr9x_free(); #endif #ifdef CD32 akiko_free (); cd32_fmv_free(); #endif if (! no_gui) gui_exit (); #ifdef USE_SDL SDL_Quit (); #endif #ifdef AUTOCONFIG expansion_cleanup (); #endif #ifdef FILESYS filesys_cleanup (); #endif #ifdef BSDSOCKET bsdlib_reset (); #endif gayle_free (); device_func_reset (); #ifdef WITH_LUA uae_lua_free (); #endif savestate_free (); memory_cleanup (); free_shm (); cfgfile_addcfgparam (0); machdep_free (); }
void do_leave_program (void) { #ifdef SAMPLER sampler_free (); #endif graphics_leave (); inputdevice_close (); DISK_free (); close_sound (); dump_counts (); #ifdef SERIAL_PORT serial_exit (); #endif #ifdef CDTV cdtv_free (); #endif #ifdef A2091 a2091_free (); #endif #ifdef NCR ncr_free (); #endif #ifdef CD32 akiko_free (); #endif if (! no_gui) gui_exit (); #ifdef USE_SDL SDL_Quit (); #endif #ifdef AUTOCONFIG expansion_cleanup (); #endif #ifdef FILESYS filesys_cleanup (); #endif #ifdef BSDSOCKET bsdlib_reset (); #endif #ifdef SCSIEMU #ifdef GAYLE gayle_free (); #endif device_func_reset (); #endif savestate_free (); memory_cleanup (); #ifdef NATMEM_OFFSET free_shm (); #endif cfgfile_addcfgparam (0); machdep_free (); }
void do_leave_program (void) { graphics_leave (); inputdevice_close (); close_sound (); dump_counts (); serial_exit (); zfile_exit (); if (! no_gui) gui_exit (); #ifdef USE_SDL SDL_Quit (); #endif expansion_cleanup (); memory_cleanup (); }
void do_leave_program (void) { sampler_free (); graphics_leave (); inputdevice_close (); DISK_free (); close_sound (); dump_counts (); #ifdef PARALLEL_PORT parallel_exit(); #endif #ifdef SERIAL_PORT serial_exit (); #endif #ifdef CDTV cdtv_free(); cdtvcr_free(); #endif #ifdef A2091 a2091_free (); gvp_free (); a3000scsi_free (); #endif soft_scsi_free(); #ifdef NCR ncr_free(); #endif #ifdef NCR9X ncr9x_free(); #endif #ifdef CD32 akiko_free (); cd32_fmv_free(); #endif if (! no_gui) gui_exit (); #ifdef USE_SDL SDL_Quit (); #endif #ifdef AUTOCONFIG expansion_cleanup (); #endif #ifdef WITH_PCI pci_free(); #endif #ifdef WITH_X86 x86_bridge_free(); #endif #ifdef FILESYS filesys_cleanup (); #endif #ifdef BSDSOCKET bsdlib_reset (); #endif gayle_free (); idecontroller_free(); device_func_reset (); #ifdef WITH_LUA uae_lua_free (); #endif #ifdef WITH_PPC uae_ppc_free(); #endif #ifdef WITH_TOCCATA sndboard_free(); #endif gfxboard_free(); #ifdef SAVESTATE savestate_free (); #endif memory_cleanup (); free_shm (); cfgfile_addcfgparam (0); machdep_free (); #ifdef DRIVESOUND driveclick_free(); #endif ethernet_enumerate_free(); }
int main(int argc, char *argv[]) { int ret, len; context *pctx; input *in; char buf[512]; int send = 0, backgroud = 0, i; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "tcp")) { send = 1; } if (!strcmp(argv[i], "deamon")) { backgroud = 1; } } if (backgroud) daemon_mode(); pctx = calloc(1, sizeof(context)); if (pctx == NULL) { DBG("error allocating context\n"); return -ENOMEM; } if(signal(SIGINT, fatal_signal) == SIG_ERR) { DBG("could not register signal handler\n"); return -EINVAL; } // create syslog openlog("iMX28-UVC", LOG_PID | LOG_CONS, LOG_USER); // get params from flash ret = params_load(); if (ret < 0) { fprintf(stderr, "load nvram params failed...\n"); } // open manage serial, 1152008N1 ret = serial_init(NULL); if (ret < 0) { fprintf(stderr, "serial_init failed\n"); free(pctx); closelog(); return -1; } // register input video stream ret = input_init(pctx, UVCDEV); if (ret < 0) { fprintf(stderr, "input_init failed, exit\n"); goto exit; } if (send) { // register output video stream ret = output_init("192.168.0.99", 5500); // tcp if (ret < 0 ) { goto exit; } } ret = input_run(pctx); if (ret < 0) { goto exit; } if (send) ret = output_run(pctx->in); in = pctx->in; while (!stop && in) { /* save_jpeg(in->buf, in->size); */ /* allow others to access the global buffer again */ /* sys_if_test(); */ len = recv_packet(buf, sizeof(buf)); if (len > 0) { hex_dump("SP0 RECV:", buf, len); packet_parse(pctx, buf, len); } } /* wait for signals */ pause(); if (send) output_stop(); exit: if (pctx->in->buf) free(pctx->in->buf); free(pctx); closelog(); serial_exit(); DBG("%s:Exit\n", __func__); return 0; }