for (h = me_mfont_h + 1; h > 0; h--)\r
{\r
dst = dest;\r
for (h = me_mfont_h + 1; h > 0; h--)\r
{\r
dst = dest;\r
- for (i = w; i > 0; i--)\r
+ for (i = w - 14; i > 0; i--)\r
*dst++ = menu_sel_color;\r
dest += g_screen_width;\r
}\r
*dst++ = menu_sel_color;\r
dest += g_screen_width;\r
}\r
- while (!menu[sel].enabled && sel < menu_sel_max)\r
+ while ((!menu[sel].enabled || !menu[sel].selectable) && sel < menu_sel_max)\r
sel++;\r
\r
/* make sure action buttons are not pressed on entering menu */\r
sel++;\r
\r
/* make sure action buttons are not pressed on entering menu */\r
{\r
const char *p = rom_name + strlen(rom_name);\r
\r
{\r
const char *p = rom_name + strlen(rom_name);\r
\r
- plat_video_menu_begin();\r
-\r
while (p > rom_name && *p != '/')\r
p--;\r
\r
/* fill both buffers, callbacks won't update in full */\r
while (p > rom_name && *p != '/')\r
p--;\r
\r
/* fill both buffers, callbacks won't update in full */\r
+ plat_video_menu_begin();\r
smalltext_out16(1, 1, "Loading", 0xffff);\r
smalltext_out16(1, 10, p, 0xffff);\r
plat_video_menu_end();\r
\r
smalltext_out16(1, 1, "Loading", 0xffff);\r
smalltext_out16(1, 10, p, 0xffff);\r
plat_video_menu_end();\r
\r
+ plat_video_menu_begin();\r
smalltext_out16(1, 1, "Loading", 0xffff);\r
smalltext_out16(1, 10, p, 0xffff);\r
plat_video_menu_end();\r
smalltext_out16(1, 1, "Loading", 0xffff);\r
smalltext_out16(1, 10, p, 0xffff);\r
plat_video_menu_end();\r
text_out16(x, y, is_loading ? "Load state" : "Save state");\r
y += 3 * me_mfont_h;\r
\r
text_out16(x, y, is_loading ? "Load state" : "Save state");\r
y += 3 * me_mfont_h;\r
\r
- menu_draw_selection(x - me_mfont_w * 2, y + menu_sel * me_mfont_h, 13 * me_mfont_w + 4);\r
+ menu_draw_selection(x - me_mfont_w * 2, y + menu_sel * me_mfont_h, (13 + 2) * me_mfont_w + 4);\r
\r
/* draw all 10 slots */\r
for (i = 0; i < 10; i++, y += me_mfont_h)\r
\r
/* draw all 10 slots */\r
for (i = 0; i < 10; i++, y += me_mfont_h)\r
static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx,\r
int sel, int dev_id, int dev_count, int is_bind)\r
{\r
static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx,\r
int sel, int dev_id, int dev_count, int is_bind)\r
{\r
- x = g_screen_width / 2 - 20 * me_mfont_w / 2;\r
+ w = ((player_idx >= 0) ? 20 : 30) * me_mfont_w;\r
+ x = g_screen_width / 2 - w / 2;\r
y = (g_screen_height - 4 * me_mfont_h) / 2 - (2 + opt_cnt) * me_mfont_h / 2;\r
if (x < me_mfont_w * 2)\r
x = me_mfont_w * 2;\r
y = (g_screen_height - 4 * me_mfont_h) / 2 - (2 + opt_cnt) * me_mfont_h / 2;\r
if (x < me_mfont_w * 2)\r
x = me_mfont_w * 2;\r
text_out16(x, y, "Emulator controls");\r
\r
y += 2 * me_mfont_h;\r
text_out16(x, y, "Emulator controls");\r
\r
y += 2 * me_mfont_h;\r
- menu_draw_selection(x - me_mfont_w * 2, y + sel * me_mfont_h, me_mfont_w); // FIXME last arg\r
+ menu_draw_selection(x - me_mfont_w * 2, y + sel * me_mfont_h, w + 2 * me_mfont_w);\r
\r
for (i = 0; i < opt_cnt; i++, y += me_mfont_h)\r
text_out16(x, y, "%s : %s", opts[i].name,\r
\r
for (i = 0; i < opt_cnt; i++, y += me_mfont_h)\r
text_out16(x, y, "%s : %s", opts[i].name,\r
\r
static menu_entry e_menu_main[] =\r
{\r
\r
static menu_entry e_menu_main[] =\r
{\r
+ mee_label ("PicoDrive " VERSION),\r
+ mee_label (""),\r
+ mee_label (""),\r
+ mee_label (""),\r
mee_handler_id("Resume game", MA_MAIN_RESUME_GAME, main_menu_handler),\r
mee_handler_id("Save State", MA_MAIN_SAVE_STATE, main_menu_handler),\r
mee_handler_id("Load State", MA_MAIN_LOAD_STATE, main_menu_handler),\r
mee_handler_id("Resume game", MA_MAIN_RESUME_GAME, main_menu_handler),\r
mee_handler_id("Save State", MA_MAIN_SAVE_STATE, main_menu_handler),\r
mee_handler_id("Load State", MA_MAIN_LOAD_STATE, main_menu_handler),\r
plat_video_menu_enter(rom_loaded);\r
in_set_blocking(1);\r
me_loop(e_menu_main, &sel);\r
plat_video_menu_enter(rom_loaded);\r
in_set_blocking(1);\r
me_loop(e_menu_main, &sel);\r
- if (rom_loaded && engineState == PGS_Menu) {\r
+ if (rom_loaded) {\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
/* wait until menu, ok, back is released */\r
while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK));\r
- engineState = PGS_Running;\r
+\r
+ in_set_blocking(0);\r
}\r
\r
// --------- CD tray close menu ----------\r
}\r
\r
// --------- CD tray close menu ----------\r
\r
in_set_blocking(1);\r
me_loop(e_menu_tray, &sel);\r
\r
in_set_blocking(1);\r
me_loop(e_menu_tray, &sel);\r
\r
if (engineState != PGS_RestartRun) {\r
engineState = PGS_RestartRun;\r
\r
if (engineState != PGS_RestartRun) {\r
engineState = PGS_RestartRun;\r
}\r
\r
while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK));\r
}\r
\r
while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK));\r
OBJCOPY = $(CROSS)objcopy\r
\r
# frontend\r
OBJCOPY = $(CROSS)objcopy\r
\r
# frontend\r
-OBJS += main.o gp2x.o emu.o in_gp2x.o squidgehack.o cpuctrl.o\r
+# TODO: clean cpuctrl\r
+OBJS += main.o gp2x.o emu.o in_gp2x.o plat.o squidgehack.o cpuctrl.o\r
# 940 core control\r
OBJS += 940ctl.o\r
\r
# common\r
OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
# 940 core control\r
OBJS += 940ctl.o\r
\r
# common\r
OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
- platform/common/mp3_helix.o platform/common/input.o platform/linux/usbjoy.o \\r
+ platform/common/mp3_helix.o platform/common/input.o \\r
platform/linux/sndout_oss.o platform/linux/plat.o\r
\r
# Pico\r
platform/linux/sndout_oss.o platform/linux/plat.o\r
\r
# Pico\r
#include "../linux/sndout_oss.h"\r
#include "../common/arm_utils.h"\r
#include "../common/arm_linux.h"\r
#include "../linux/sndout_oss.h"\r
#include "../common/arm_utils.h"\r
#include "../common/arm_linux.h"\r
+#include "../common/emu.h"\r
\r
volatile unsigned short *gp2x_memregs;\r
//static\r
\r
volatile unsigned short *gp2x_memregs;\r
//static\r
\r
unsigned long gp2x_joystick_read(int unused)\r
{\r
\r
unsigned long gp2x_joystick_read(int unused)\r
{\r
unsigned long value=(gp2x_memregs[0x1198>>1] & 0x00FF); // GPIO M\r
if(value==0xFD) value=0xFA;\r
if(value==0xF7) value=0xEB;\r
unsigned long value=(gp2x_memregs[0x1198>>1] & 0x00FF); // GPIO M\r
if(value==0xFD) value=0xFA;\r
if(value==0xF7) value=0xEB;\r
#ifndef PORT_CONFIG_H\r
#define PORT_CONFIG_H\r
\r
#ifndef PORT_CONFIG_H\r
#define PORT_CONFIG_H\r
\r
+#include "version.h"\r
+\r
#define CASE_SENSITIVE_FS 1 // CS filesystem\r
#define DONT_OPEN_MANY_FILES 0\r
#define REDUCE_IO_CALLS 0\r
#define CASE_SENSITIVE_FS 1 // CS filesystem\r
#define DONT_OPEN_MANY_FILES 0\r
#define REDUCE_IO_CALLS 0\r
#ifndef PORT_CONFIG_H\r
#define PORT_CONFIG_H\r
\r
#ifndef PORT_CONFIG_H\r
#define PORT_CONFIG_H\r
\r
+#include "../gp2x/version.h" /* FIXME */\r
+\r
#define CASE_SENSITIVE_FS 1 // CS filesystem\r
#define DONT_OPEN_MANY_FILES 0\r
#define REDUCE_IO_CALLS 0\r
#define CASE_SENSITIVE_FS 1 // CS filesystem\r
#define DONT_OPEN_MANY_FILES 0\r
#define REDUCE_IO_CALLS 0\r