/*! * \return non zero if another game has to be launched */ int play_game (void) { cart_reload = 0; if (CartLoad(cart_name)) return 0; // Initialise the target machine (pce) if (InitPCE () != 0) return 0; osd_gfx_init(); osd_snd_init_sound(); #if defined(ENABLE_NETPLAY) osd_init_netplay(); #endif RunPCE (); #if defined(ENABLE_NETPLAY) osd_shutdown_netplay(); #endif osd_snd_trash_sound (); osd_gfx_shut_normal_mode(); TrashPCE (); return 0; }
/*! * \return non zero if another game has to be launched */ int play_game (char* romname) { // Initialise the target machine (pce) if (InitPCE (romname, backup_mem) != 0) return 0; if (!(*osd_gfx_driver_list[video_driver].init) ()) { Log ("Can't set graphic mode\n"); printf (MESSAGE[language][cant_set_gmode]); return 0; } if (!osd_snd_init_sound ()) { Log ("Couldn't open any sound hardware on the host machine.\n"); printf (MESSAGE[language][audio_init_failed]); } else printf (MESSAGE[language][audio_inited], 8, "SDL compatible soundcard", host.sound.freq); #if defined(ENABLE_NETPLAY) osd_init_netplay(); #endif // Run the emulation RunPCE (); #if defined(ENABLE_NETPLAY) osd_shutdown_netplay(); #endif osd_snd_trash_sound (); (*osd_gfx_driver_list[video_driver].shut) (); // Free the target machine (pce) TrashPCE (backup_mem); return cart_reload; }
int play_game (void) { const char *p = RomNext(); static int gfx_audio_net_init_done = 0; LoadNewGame = 0; strcpy( cart_name + strlen("/accounts/1000/shared/misc/roms/pce/"), p); fprintf(stderr,"play_game: LOAD cart_name = '%s'\n", cart_name); // Initialise the target machine (pce) if (InitPCE (cart_name, backup_mem) != 0) { fprintf(stderr,"InitPCE: failed to initialize ...\n"); return 0; } // Bring up GFX,AUDIO and NET if( gfx_audio_net_init_done == 0) { if (!(*osd_gfx_driver_list[video_driver].init) ()) { Log ("Can't set graphic mode\n"); printf (MESSAGE[language][cant_set_gmode]); return 0; } if (!osd_snd_init_sound ()) { Log ("Couldn't open any sound hardware on the host machine.\n"); printf (MESSAGE[language][audio_init_failed]); } else printf (MESSAGE[language][audio_inited], 8, "SDL compatible soundcard", host.sound.freq); #if defined(ENABLE_NETPLAY) osd_init_netplay(); #endif gfx_audio_net_init_done = 1; } #ifdef __QNXNTO__ if (!osd_snd_init_sound ()) { Log ("Couldn't open any sound hardware on the host machine.\n"); printf (MESSAGE[language][audio_init_failed]); } else printf (MESSAGE[language][audio_inited], 8, "SDL compatible soundcard", host.sound.freq); #endif // Run the emulation RunPCE (); #ifdef __QNXNTO__ osd_snd_trash_sound (); #endif fprintf(stderr, "Shutting down emulation ...\n"); // We init once and don't shutdown for Playbook. There is no need // to restart SDL services once we are launched we only need the emu core to be reset. #ifndef __QNXNTO__ #if defined(ENABLE_NETPLAY) osd_shutdown_netplay(); #endif osd_snd_trash_sound (); (*osd_gfx_driver_list[video_driver].shut) (); #endif // Free the target machine (pce) TrashPCE (backup_mem); fprintf(stderr,"play_game: TrashPCE done ...\n"); #ifdef __QNXNTO__ cart_reload = 1; fprintf(stderr,"QNX: returns to re-start ...\n"); return 1; #endif return cart_reload; }