bgr888_to_rgb565(d, s, w * 3);
else
bgr555_to_rgb565(d, s, w * 2);
-#ifndef __ARM_ARCH_7A__
- // better darken this on small screens
- menu_darken_bg(d, d, w * 2, 0);
-#endif
+
+ // darken this so that menu text is visible
+ if (g_menuscreen_w - w < 320)
+ menu_darken_bg(d, d, w * 2, 0);
}
out:
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);
{
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)",
}
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);
}
}
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);
#endif
}
-// XXX: should really menu code cotrol the layer size?
void menu_notify_mode_change(int w, int h, int bpp)
{
float mult;
last_psx_h = h;
last_psx_bpp = bpp;
+ // XXX: should really menu code cotrol the layer size?
switch (scaling) {
case SCALE_1_1:
g_layer_w = w; g_layer_h = h;
plat_video_menu_enter(ready_to_go);
memcpy(g_menubg_ptr, g_menubg_src_ptr, g_menuscreen_w * g_menuscreen_h * 2);
- if (pl_vout_buf != NULL && ready_to_go && last_psx_bpp == 16) {
+ if (pl_vout_buf != NULL && ready_to_go) {
int x = max(0, g_menuscreen_w - last_psx_w);
int y = max(0, g_menuscreen_h / 2 - last_psx_h / 2);
int w = min(g_menuscreen_w, last_psx_w);
int h = min(g_menuscreen_h, last_psx_h);
u16 *d = (u16 *)g_menubg_ptr + g_menuscreen_w * y + x;
- u16 *s = pl_vout_buf;
+ char *s = pl_vout_buf;
- for (; h > 0; h--, d += g_menuscreen_w, s += last_psx_w)
- menu_darken_bg(d, s, w, 0);
+ if (last_psx_bpp == 16) {
+ for (; h > 0; h--, d += g_menuscreen_w, s += last_psx_w * 2)
+ menu_darken_bg(d, s, w, 0);
+ }
+ else {
+ for (; h > 0; h--, d += g_menuscreen_w, s += last_psx_w * 3) {
+ bgr888_to_rgb565(d, s, w * 3);
+ menu_darken_bg(d, d, w, 0);
+ }
+ }
}
if (ready_to_go)
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();