X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmenu.c;h=d99156bcfc65968ed08dd8ae6a24c65ae7827ccf;hp=2cfcc6e2f943600600a8fedee595fe8dba06b287;hb=b07c18e8645a17be916266820ae564e0d320cc1a;hpb=a72ac8031937bb80f36e9392d07724a954995029 diff --git a/frontend/menu.c b/frontend/menu.c index 2cfcc6e2..d99156bc 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -22,7 +22,6 @@ #include "config.h" #include "plugin.h" #include "plugin_lib.h" -#include "omap.h" #include "plat.h" #include "pcnt.h" #include "common/plat.h" @@ -295,6 +294,16 @@ static const struct { CE_INTVAL_P(gpu_unai.no_light), CE_INTVAL_P(gpu_unai.no_blend), CE_INTVAL_P(gpu_neon.allow_interlace), + CE_INTVAL_P(gpu_peopsgl.bDrawDither), + CE_INTVAL_P(gpu_peopsgl.iFilterType), + CE_INTVAL_P(gpu_peopsgl.iFrameTexType), + CE_INTVAL_P(gpu_peopsgl.iUseMask), + CE_INTVAL_P(gpu_peopsgl.bOpaquePass), + CE_INTVAL_P(gpu_peopsgl.bAdvancedBlend), + CE_INTVAL_P(gpu_peopsgl.bUseFastMdec), + CE_INTVAL_P(gpu_peopsgl.iVRamSize), + CE_INTVAL_P(gpu_peopsgl.iTexGarbageCollection), + CE_INTVAL_P(gpu_peopsgl.dwActFixes), CE_INTVAL_V(iUseReverb, 3), CE_INTVAL_V(iXAPitch, 3), CE_INTVAL_V(iUseInterpolation, 3), @@ -1137,7 +1146,7 @@ static int menu_loop_cscaler(int id, int keys) scaling = SCALE_CUSTOM; - omap_enable_layer(1); + plat_gvideo_open(); for (;;) { @@ -1172,11 +1181,12 @@ static int menu_loop_cscaler(int id, int keys) g_layer_w = 800 - g_layer_x; if (g_layer_y + g_layer_h > 480) g_layer_h = 480 - g_layer_y; - omap_enable_layer(1); + // resize the layer + plat_gvideo_open(); } } - omap_enable_layer(0); + plat_gvideo_close(); return 0; } @@ -1494,7 +1504,7 @@ static int menu_loop_options(int id, int keys) int i; i = me_id2offset(e_menu_options, MA_OPT_CPU_CLOCKS); - e_menu_options[i].enabled = cpu_clock_st != 0 ? 1 : 0; + e_menu_options[i].enabled = cpu_clock_st > 0 ? 1 : 0; me_enable(e_menu_options, MA_OPT_SAVECFG_GAME, ready_to_go && CdromId[0]); me_loop(e_menu_options, &sel); @@ -1704,8 +1714,10 @@ static void draw_frame_main(void) { struct tm *tmp; time_t ltime; + int capacity; char ltime_s[16]; char buff[64]; + char *out; if (CdromId[0] != 0) { snprintf(buff, sizeof(buff), "%.32s/%.9s (running as %s, with %s)", @@ -1715,11 +1727,17 @@ static void draw_frame_main(void) } if (ready_to_go) { + capacity = plat_get_bat_capacity(); ltime = time(NULL); tmp = localtime(<ime); strftime(ltime_s, sizeof(ltime_s), "%H:%M", tmp); - snprintf(buff, sizeof(buff), "%s %3d%%", ltime_s, plat_get_bat_capacity()); - smalltext_out16(4, 1 + me_sfont_h, buff, 0x105f); + if (capacity >= 0) { + snprintf(buff, sizeof(buff), "%s %3d%%", ltime_s, capacity); + out = buff; + } + else + out = ltime_s; + smalltext_out16(4, 1 + me_sfont_h, out, 0x105f); } } @@ -2231,8 +2249,12 @@ void menu_init(void) last_psx_bpp = 16; g_menubg_src_ptr = calloc(g_menuscreen_w * g_menuscreen_h * 2, 1); - if (g_menubg_src_ptr == NULL) + g_menubg_ptr = calloc(g_menuscreen_w * g_menuscreen_h * 2, 1); + if (g_menubg_src_ptr == NULL || g_menubg_ptr == NULL) { + fprintf(stderr, "OOM\n"); exit(1); + } + emu_make_path(buff, "skin/background.png", sizeof(buff)); readpng(g_menubg_src_ptr, buff, READPNG_BG, g_menuscreen_w, g_menuscreen_h); @@ -2248,6 +2270,7 @@ void menu_init(void) #endif } +// XXX: should really menu code cotrol the layer size? void menu_notify_mode_change(int w, int h, int bpp) { float mult; @@ -2351,7 +2374,8 @@ void menu_prepare_emu(void) menu_sync_config(); apply_lcdrate(Config.PsxType); apply_filter(filter); - plat_cpu_clock_apply(cpu_clock); + if (cpu_clock > 0) + plat_cpu_clock_apply(cpu_clock); // push config to GPU plugin plugin_call_rearmed_cbs();