#include "plat.h"\r
#include "posix.h"\r
#include <version.h>\r
+#include <revision.h>\r
\r
#include <pico/pico_int.h>\r
#include <pico/patch.h>\r
-#include <zlib/zlib.h>\r
-\r
-#define array_size(x) (sizeof(x) / sizeof(x[0]))\r
\r
static char static_buff[64];\r
static char menu_error_msg[64] = { 0, };\r
plat_video_menu_end();\r
}\r
\r
-static void cdload_progress_cb(int percent)\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
memset(dst, 0xff, g_screen_width * (me_sfont_h - 2) * 2);\r
\r
smalltext_out16(1, 3 * me_sfont_h, "Processing CD image / MP3s", 0xffff);\r
- smalltext_out16(1, 4 * me_sfont_h, rom_fname_loaded, 0xffff);\r
+ smalltext_out16(1, 4 * me_sfont_h, fname, 0xffff);\r
dst += g_screen_width * me_sfont_h * 3;\r
\r
if (len > g_screen_width)\r
\r
void menu_romload_end(void)\r
{\r
- PicoCartLoadProgressCB = PicoCDLoadProgressCB = NULL;\r
+ PicoCartLoadProgressCB = NULL;\r
+ PicoCDLoadProgressCB = NULL;\r
smalltext_out16(1, (cdload_called ? 6 : 3) * me_sfont_h,\r
"Starting emulation...", 0xffff);\r
plat_video_menu_end();\r
}\r
}\r
\r
+ /* make sure action buttons are not pressed on entering menu */\r
+ draw_dirlist(curr_path, namelist, n, sel);\r
+ while (in_menu_wait_any(50) & (PBTN_MOK|PBTN_MBACK|PBTN_MENU))\r
+ ;\r
+\r
for (;;)\r
{\r
draw_dirlist(curr_path, namelist, n, sel);\r
struct PicoVideo tmp_pv;\r
unsigned short tmp_cram[0x40];\r
unsigned short tmp_vsram[0x40];\r
- void *tmp_vram, *file;\r
- char *fname;\r
+ void *tmp_vram;\r
+ const char *fname;\r
\r
fname = emu_get_save_fname(1, 0, slot);\r
if (!fname) return;\r
memcpy(tmp_vsram, Pico.vsram, sizeof(Pico.vsram));\r
memcpy(&tmp_pv, &Pico.video, sizeof(Pico.video));\r
\r
- if (strcmp(fname + strlen(fname) - 3, ".gz") == 0) {\r
- file = gzopen(fname, "rb");\r
- emu_setSaveStateCbs(1);\r
- } else {\r
- file = fopen(fname, "rb");\r
- emu_setSaveStateCbs(0);\r
- }\r
-\r
- if (file) {\r
- if (PicoAHW & PAHW_MCD) {\r
- PicoCdLoadStateGfx(file);\r
- } else {\r
- areaSeek(file, 0x10020, SEEK_SET); // skip header and RAM in state file\r
- areaRead(Pico.vram, 1, sizeof(Pico.vram), file);\r
- areaSeek(file, 0x2000, SEEK_CUR);\r
- areaRead(Pico.cram, 1, sizeof(Pico.cram), file);\r
- areaRead(Pico.vsram, 1, sizeof(Pico.vsram), file);\r
- areaSeek(file, 0x221a0, SEEK_SET);\r
- areaRead(&Pico.video, 1, sizeof(Pico.video), file);\r
- }\r
- areaClose(file);\r
- }\r
+ PicoStateLoadVDP(fname);\r
\r
/* do a frame and fetch menu bg */\r
pemu_forced_frame(POPT_EN_SOFTSCALE);\r
\r
state_check_slots();\r
\r
+ if (!(state_slot_flags & (1 << menu_sel)) && is_loading)\r
+ menu_sel = menu_sel_max;\r
+\r
for (;;)\r
{\r
draw_savestate_menu(menu_sel, is_loading);\r
\r
static int mh_opt_render(menu_id id, int keys)\r
{\r
- plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 1);\r
+ plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 0, 1);\r
return 0;\r
}\r
\r
}\r
}\r
\r
+#ifdef __GNUC__\r
+#define COMPILER "gcc " __VERSION__\r
+#else\r
+#define COMPILER\r
+#endif\r
+\r
static void draw_frame_debug(void)\r
{\r
- char layer_str[48] = "layers: ";\r
+ char layer_str[48] = "layers: ";\r
if (PicoDrawMask & PDRAW_LAYERB_ON) memcpy(layer_str + 8, "B", 1);\r
if (PicoDrawMask & PDRAW_LAYERA_ON) memcpy(layer_str + 10, "A", 1);\r
if (PicoDrawMask & PDRAW_SPRITES_LOW_ON) memcpy(layer_str + 12, "spr_lo", 6);\r
if (PicoDrawMask & PDRAW_SPRITES_HI_ON) memcpy(layer_str + 19, "spr_hi", 6);\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
- smalltext_out16(4, 1, "build: " __DATE__ " " __TIME__, 0xffff);\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
\r
g_screen_width, spr_offs);\r
draw_text_debug(PDebugSpriteList(), spr_offs, 6);\r
break;\r
+ case 4: plat_video_menu_begin();\r
+ tmp = PDebug32x();\r
+ draw_text_debug(tmp, 0, 0);\r
+ break;\r
}\r
plat_video_menu_end();\r
\r
inp = in_menu_wait(PBTN_MOK|PBTN_MBACK|PBTN_MA2|PBTN_MA3|PBTN_L|PBTN_R |\r
PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT, 70);\r
if (inp & PBTN_MBACK) return;\r
- if (inp & PBTN_L) { mode--; if (mode < 0) mode = 3; }\r
- if (inp & PBTN_R) { mode++; if (mode > 3) mode = 0; }\r
+ if (inp & PBTN_L) { mode--; if (mode < 0) mode = 4; }\r
+ if (inp & PBTN_R) { mode++; if (mode > 4) mode = 0; }\r
switch (mode)\r
{\r
case 0:\r
if (inp & PBTN_MOK)\r
- SekStepM68k();\r
+ PDebugCPUStep();\r
if (inp & PBTN_MA3) {\r
while (inp & PBTN_MA3)\r
inp = in_menu_wait_any(-1);\r
if (inp & PBTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;\r
if (inp & PBTN_DOWN) PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;\r
if (inp & PBTN_UP) PicoDrawMask ^= PDRAW_SPRITES_HI_ON;\r
+ if (inp & PBTN_MA2) PicoDrawMask ^= PDRAW_32X_ON;\r
if (inp & PBTN_MOK) {\r
PsndOut = NULL; // just in case\r
PicoSkipFrame = 1;\r
if (engineState == PGS_Menu)\r
engineState = PGS_Running;\r
/* wait until menu, ok, back is released */\r
- while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK));\r
+ while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK))\r
+ ;\r
}\r
\r
in_set_blocking(0);\r