notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finish migrating to new mem handling. Make carthw db external.
[picodrive.git]
/
platform
/
common
/
menu.c
diff --git
a/platform/common/menu.c
b/platform/common/menu.c
index
774f05c
..
e651694
100644
(file)
--- a/
platform/common/menu.c
+++ b/
platform/common/menu.c
@@
-17,12
+17,11
@@
#include "plat.h"
\r
#include "posix.h"
\r
#include <version.h>
\r
#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
\r
\r
#include <pico/pico_int.h>
\r
#include <pico/patch.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
static int menu_error_time = 0;
\r
static char static_buff[64];
\r
static char menu_error_msg[64] = { 0, };
\r
static int menu_error_time = 0;
\r
@@
-601,7
+600,7
@@
static void load_progress_cb(int percent)
plat_video_menu_end();
\r
}
\r
\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
{
\r
int ln, len = percent * g_screen_width / 100;
\r
unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * 10 * 2;
\r
@@
-609,7
+608,7
@@
static void cdload_progress_cb(int percent)
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
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
dst += g_screen_width * me_sfont_h * 3;
\r
\r
if (len > g_screen_width)
\r
@@
-646,7
+645,8
@@
void menu_romload_prepare(const char *rom_name)
\r
void menu_romload_end(void)
\r
{
\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
smalltext_out16(1, (cdload_called ? 6 : 3) * me_sfont_h,
\r
"Starting emulation...", 0xffff);
\r
plat_video_menu_end();
\r
@@
-814,6
+814,11
@@
rescan:
}
\r
}
\r
\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
for (;;)
\r
{
\r
draw_dirlist(curr_path, namelist, n, sel);
\r
@@
-1036,6
+1041,9
@@
static int menu_loop_savestate(int is_loading)
\r
state_check_slots();
\r
\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
for (;;)
\r
{
\r
draw_savestate_menu(menu_sel, is_loading);
\r
@@
-1736,6
+1744,12
@@
static void draw_text_debug(const char *str, int skip, int from)
}
\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
static void draw_frame_debug(void)
\r
{
\r
char layer_str[48] = "layers: ";
\r
@@
-1746,7
+1760,7
@@
static void draw_frame_debug(void)
\r
memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);
\r
pemu_forced_frame(0);
\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
smalltext_out16(4, g_screen_height - me_sfont_h, layer_str, 0xffff);
\r
}
\r
\r
@@
-1794,7
+1808,7
@@
static void debug_menu_loop(void)
{
\r
case 0:
\r
if (inp & PBTN_MOK)
\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_MA3) {
\r
while (inp & PBTN_MA3)
\r
inp = in_menu_wait_any(-1);
\r
@@
-1936,7
+1950,8
@@
void menu_loop(void)
if (engineState == PGS_Menu)
\r
engineState = PGS_Running;
\r
/* wait until menu, ok, back is released */
\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
}
\r
\r
in_set_blocking(0);
\r