void neogeo_exit(void) { SceUID fd; char path[MAX_PATH]; msg_printf(TEXT(PLEASE_WAIT2)); sprintf(path, "%smemcard/%s.bin", launchDir, game_name); if ((fd = sceIoOpen(path, PSP_O_WRONLY|PSP_O_CREAT, 0777)) >= 0) { sceIoWrite(fd, neogeo_memcard, 0x800); sceIoClose(fd); } sprintf(path, "%snvram/%s.nv", launchDir, game_name); if ((fd = sceIoOpen(path, PSP_O_WRONLY|PSP_O_CREAT, 0777)) >= 0) { swab(neogeo_sram16, neogeo_sram16, 0x2000); sceIoWrite(fd, neogeo_sram16, 0x2000); sceIoClose(fd); } msg_printf(TEXT(DONE2)); sound_exit(); memory_shutdown(); }
void shutdown_machine(void) { int i; #ifdef MESS exit_devices(); #endif /* ASG 971007 free memory element map */ memory_shutdown(); /* free the memory allocated for ROM and RAM */ for (i = 0;i < MAX_MEMORY_REGIONS;i++) { if (Machine->memory_region[i]) free(Machine->memory_region[i]); Machine->memory_region[i] = 0; Machine->memory_region_length[i] = 0; Machine->memory_region_type[i] = 0; } /* free the memory allocated for input ports definition */ input_port_free(Machine->input_ports); Machine->input_ports = 0; input_port_free(Machine->input_ports_default); Machine->input_ports_default = 0; code_close(); uistring_shutdown (); /* LBO 042400 */ }
void neogeo_main(void) { Loop = LOOP_RESET; while (Loop >= LOOP_RESTART) { Loop = LOOP_EXEC; ui_popup_reset(); fatal_error = 0; video_clear_screen(); if (memory_init()) { if (sound_init()) { if (input_init()) { if (neogeo_init()) { neogeo_run(); } neogeo_exit(); } input_shutdown(); } sound_exit(); } memory_shutdown(); show_fatal_error(); } }
int neogeo_main(void) { if (memory_init()) { if (sound_init()) { if (input_init()) { if (neogeo_init()) { neogeo_reset(); return 1; } } } sound_exit(); } memory_shutdown(); return 0; }