static void smalltext_out16(int x, int y, const char *texto, int color)\r
{\r
char buffer[128];\r
- int maxw = (g_screen_width - x) / 6;\r
+ int maxw = (g_screen_width - x) / me_sfont_w;\r
\r
if (maxw < 0)\r
return;\r
memcpy(menu_font_data, menu_font_data + ((int)'>') * me_mfont_w * me_mfont_h / 2,\r
me_mfont_w * me_mfont_h / 2);\r
emu_make_path(buff, "skin/selector.png", sizeof(buff));\r
- readpng(menu_font_data, buff, READPNG_SELECTOR, MENU_X2 ? 16 : 8, MENU_X2 ? 20 : 10);\r
+ readpng(menu_font_data, buff, READPNG_SELECTOR, me_mfont_w, me_mfont_h);\r
\r
// load custom colors\r
emu_make_path(buff, "skin/skin.txt", sizeof(buff));\r
wt = col2_offs;\r
\r
switch (ent->beh) {\r
- case MB_NONE: break;\r
+ case MB_NONE:\r
+ break;\r
case MB_OPT_ONOFF:\r
- case MB_OPT_RANGE: wt += me_mfont_w * 3; break;\r
+ case MB_OPT_RANGE:\r
+ wt += me_mfont_w * 3;\r
+ break;\r
case MB_OPT_CUSTOM:\r
case MB_OPT_CUSTONOFF:\r
case MB_OPT_CUSTRANGE:\r
static void load_progress_cb(int percent)\r
{\r
int ln, len = percent * g_screen_width / 100;\r
- unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * 10 * 2;\r
+ unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * me_sfont_h * 2;\r
\r
if (len > g_screen_width)\r
len = g_screen_width;\r
- for (ln = 10 - 2; ln > 0; ln--, dst += g_screen_width)\r
+ for (ln = me_sfont_h - 2; ln > 0; ln--, dst += g_screen_width)\r
memset(dst, 0xff, len * 2);\r
plat_video_menu_end();\r
}\r
static void cdload_progress_cb(const char *fname, int percent)\r
{\r
int ln, len = percent * g_screen_width / 100;\r
- unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * 10 * 2;\r
+ unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * me_sfont_h * 2;\r
\r
memset(dst, 0xff, g_screen_width * (me_sfont_h - 2) * 2);\r
\r
menu_darken_bg(g_screen_ptr, g_screen_ptr, g_screen_width * g_screen_height, 0);\r
\r
len = strlen(fname);\r
- if (len > g_screen_width/6)\r
- len = g_screen_width/6;\r
+ if (len > g_screen_width / me_sfont_w)\r
+ len = g_screen_width / me_sfont_w;\r
\r
mid = g_screen_width / 2;\r
text_out16(mid - me_mfont_w * 15 / 2, 8 * me_mfont_h, "About to delete");\r
{\r
int max_cnt, start, i, pos, active;\r
\r
- max_cnt = g_screen_height / 10;\r
+ max_cnt = g_screen_height / me_sfont_h;\r
start = max_cnt / 2 - sel;\r
\r
plat_video_menu_begin();\r
if (pos < 0) continue;\r
if (pos >= max_cnt) break;\r
active = PicoPatches[i].active;\r
- smalltext_out16(14, pos * me_sfont_h, active ? "ON " : "OFF", active ? 0xfff6 : 0xffff);\r
- smalltext_out16(14+6*4, pos * me_sfont_h, PicoPatches[i].name, active ? 0xfff6 : 0xffff);\r
+ smalltext_out16(14, pos * me_sfont_h, active ? "ON " : "OFF", active ? 0xfff6 : 0xffff);\r
+ smalltext_out16(14 + me_sfont_w*4, pos * me_sfont_h, PicoPatches[i].name, active ? 0xfff6 : 0xffff);\r
}\r
pos = start + i;\r
if (pos < max_cnt)\r
PicoStateLoadGfx(fname);\r
\r
/* do a frame and fetch menu bg */\r
- pemu_forced_frame(POPT_EN_SOFTSCALE);\r
+ pemu_forced_frame(POPT_EN_SOFTSCALE, 0);\r
menu_enter(1);\r
\r
PicoTmpStateRestore(tmp_state);\r
\r
// ------------ 32X options menu ------------\r
\r
+#ifndef NO_32X\r
+\r
// convert from multiplier of VClk\r
static int mh_opt_sh2cycles(menu_id id, int keys)\r
{\r
return 0;\r
}\r
\r
+#endif\r
+\r
// ------------ adv options menu ------------\r
\r
static menu_entry e_menu_adv_options[] =\r
mee_range (cpu_clk_name, MA_OPT_CPU_CLOCKS, currentConfig.CPUclock, 20, 900),\r
mee_handler ("[Display options]", menu_loop_gfx_options),\r
mee_handler ("[Sega/Mega CD options]", menu_loop_cd_options),\r
+#ifndef NO_32X\r
mee_handler ("[32X options]", menu_loop_32x_options),\r
+#endif\r
mee_handler ("[Advanced options]", menu_loop_adv_options),\r
mee_cust_nosave("Save global config", MA_OPT_SAVECFG, mh_saveloadcfg, mgn_saveloadcfg),\r
mee_cust_nosave("Save cfg for loaded game",MA_OPT_SAVECFG_GAME, mh_saveloadcfg, mgn_saveloadcfg),\r
if (PicoDrawMask & PDRAW_32X_ON) memcpy(layer_str + 26, "32x", 4);\r
\r
memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);\r
- pemu_forced_frame(0);\r
+ pemu_forced_frame(0, 0);\r
smalltext_out16(4, 1, "build: r" REVISION " "__DATE__ " " __TIME__ " " COMPILER, 0xffff);\r
smalltext_out16(4, g_screen_height - me_sfont_h, layer_str, 0xffff);\r
}\r
dumped = 0;\r
}\r
break;\r
- case 1: draw_frame_debug(); break;\r
+ case 1: draw_frame_debug();\r
+ break;\r
case 2: memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);\r
- pemu_forced_frame(0);\r
+ pemu_forced_frame(0, 1);\r
menu_darken_bg(g_screen_ptr, g_screen_ptr, g_screen_width * g_screen_height, 0);\r
PDebugShowSpriteStats((unsigned short *)g_screen_ptr + (g_screen_height/2 - 240/2)*g_screen_width +\r
- g_screen_width/2 - 320/2, g_screen_width); break;\r
+ g_screen_width/2 - 320/2, g_screen_width);\r
+ break;\r
case 3: memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);\r
PDebugShowPalette(g_screen_ptr, g_screen_width);\r
PDebugShowSprite((unsigned short *)g_screen_ptr + g_screen_width*120 + g_screen_width/2 + 16,\r
e_menu_gfx_options,\r
e_menu_adv_options,\r
e_menu_cd_options,\r
+#ifndef NO_32X\r
e_menu_32x_options,\r
+#endif\r
e_menu_keyconfig,\r
e_menu_hidden,\r
};\r
g_menubg_ptr = temp_frame;\r
\r
defaultConfig.EmuOpt |= EOPT_VSYNC;\r
+ defaultConfig.s_PicoOpt |= POPT_EN_MCD_GFX|POPT_EN_MCD_PSYNC;\r
defaultConfig.scaling = SCALE_2x2_3x2;\r
}\r
\r
\r
static int emuscan_1x1(unsigned int num)\r
{\r
- DrawLineDest = (unsigned short *)g_screen_ptr + num*800 + 800/2 - 320/2;\r
- //int w = (Pico.video.reg[12]&1) ? 320 : 256;\r
- //DrawLineDest = (unsigned short *)g_screen_ptr + num*w;\r
+ DrawLineDest = (unsigned short *)g_screen_ptr +\r
+ g_screen_width * g_screen_height / 2 - g_screen_width * 240 / 2 +\r
+ num*g_screen_width + g_screen_width/2 - 320/2;\r
\r
return 0;\r
}\r
}\r
}\r
\r
-void pemu_forced_frame(int opts)\r
+void pemu_forced_frame(int opts, int no_scale)\r
{\r
+ int oldscale = currentConfig.scaling;\r
int po_old = PicoOpt;\r
\r
- PicoOpt &= ~0x10;\r
+ if (no_scale) {\r
+ currentConfig.scaling = SCALE_1x1;\r
+ emu_video_mode_change(0, 0, 0);\r
+ }\r
+\r
+ PicoOpt &= ~POPT_ALT_RENDERER;\r
PicoOpt |= opts|POPT_ACC_SPRITES; // acc_sprites\r
\r
Pico.m.dirtyPal = 1;\r
PicoFrameDrawOnly();\r
\r
PicoOpt = po_old;\r
+ currentConfig.scaling = oldscale;\r
}\r
\r
static void updateSound(int len)\r
\r
void pemu_loop_prep(void)\r
{\r
- emu_video_mode_change(0, 0, 0);\r
- \r
if (currentConfig.CPUclock != get_cpu_clock()) {\r
- FILE *f = fopen("/proc/pandora/cpu_mhz_max", "w");\r
- if (f != NULL) {\r
- fprintf(f, "%d\n", currentConfig.CPUclock);\r
- fclose(f);\r
- }\r
+ char buf[64];\r
+ snprintf(buf, sizeof(buf), "sudo /usr/pandora/scripts/op_cpuspeed.sh %d",\r
+ currentConfig.CPUclock);\r
+ system(buf);\r
}\r
\r
pemu_sound_start();\r
"Reesy & FluBBa: DrZ80 core\n"\r
"MAME devs: YM2612 and SN76496 cores\n"\r
"Pandora team: Pandora\n"\r
- "Inder: menu bg\n"\r
+ "Inder, ketchupgun: graphics\n"\r
"\n"\r
"special thanks (for docs, ideas):\n"\r
" Charles MacDonald, Haze,\n"\r