X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Femu.c;h=1e60925707502ce112cdcebfd53a95dbc2507351;hb=74065be8cdfbcccb7e12d7e19f0a7cb35538db06;hp=b1927c120c50e1388e88af69308b3255624546fe;hpb=b120fe04313728fcaa4c3759280e88cccb7ef05c;p=libpicofe.git diff --git a/common/emu.c b/common/emu.c index b1927c1..1e60925 100644 --- a/common/emu.c +++ b/common/emu.c @@ -453,11 +453,14 @@ static void shutdown_MCD(void) static void system_announce(void) { - const char *sys_name, *tv_standard; + const char *sys_name, *tv_standard, *extra = ""; int fps; if (PicoAHW & PAHW_SMS) { sys_name = "Master System"; +#ifdef NO_SMS + extra = " [no support]"; +#endif } else if (PicoAHW & PAHW_PICO) { sys_name = "Pico"; } else if (PicoAHW & PAHW_MCD) { @@ -474,7 +477,7 @@ static void system_announce(void) tv_standard = Pico.m.pal ? "PAL" : "NTSC"; fps = Pico.m.pal ? 50 : 60; - emu_status_msg("%s %s / %dFPS", tv_standard, sys_name, fps); + emu_status_msg("%s %s / %dFPS%s", tv_standard, sys_name, fps, extra); } // note: this function might mangle rom_fname @@ -494,11 +497,13 @@ int emu_reload_rom(char *rom_fname) get_ext(rom_fname, ext); - // check for movie file + // early cleanup + PicoPatchUnload(); if (movie_data) { free(movie_data); movie_data = 0; } + if (!strcmp(ext, ".gmv")) { // check for both gmv and rom @@ -555,7 +560,6 @@ int emu_reload_rom(char *rom_fname) } shutdown_MCD(); - PicoPatchUnload(); PicoCartUnload(); rom_loaded = 0; @@ -1137,8 +1141,11 @@ static void emu_tray_close(void) void emu_32x_startup(void) { - plat_video_toggle_renderer(0, 0); + plat_video_toggle_renderer(0, 0); // HACK system_announce(); + + // force mode change event + rendstatus_old = -1; } void emu_reset_game(void) @@ -1250,7 +1257,7 @@ static void run_events_ui(unsigned int which) plat_status_msg_busy_first(tmp); - in_set_blocking(1); + in_set_config_int(0, IN_CFG_BLOCKING, 1); while (in_menu_wait_any(50) & (PBTN_MA3|PBTN_MBACK)) ; while ( !((keys = in_menu_wait_any(50)) & (PBTN_MA3|PBTN_MBACK)) ) @@ -1259,7 +1266,7 @@ static void run_events_ui(unsigned int which) do_it = 0; while (in_menu_wait_any(50) & (PBTN_MA3|PBTN_MBACK)) ; - in_set_blocking(0); + in_set_config_int(0, IN_CFG_BLOCKING, 0); } if (do_it) { plat_status_msg_busy_first((which & PEV_STATE_LOAD) ? "LOADING STATE" : "SAVING STATE"); @@ -1344,6 +1351,26 @@ static void mkdir_path(char *path_with_reserve, int pos, const char *name) lprintf("failed to create: %s\n", path_with_reserve); } +void emu_cmn_forced_frame(int no_scale, int do_emu) +{ + int po_old = PicoOpt; + + memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4); + + PicoOpt |= POPT_ACC_SPRITES; + if (!no_scale) + PicoOpt |= POPT_EN_SOFTSCALE; + + PicoDrawSetOutFormat(PDF_RGB555, 1); + Pico.m.dirtyPal = 1; + if (do_emu) + PicoFrame(); + else + PicoFrameDrawOnly(); + + PicoOpt = po_old; +} + void emu_init(void) { char path[512];