endif\r
endif\r
\r
-rel: PicoDrive.gpe code940/code940.bin ../readme.txt config.txt PicoDrive.man.txt PicoDrive.png\r
+rel: PicoDrive.gpe code940/pico940.bin ../readme.txt config.txt PicoDrive.man.txt PicoDrive.png\r
zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r
\r
code940/code940.bin:\r
return 0;\r
}\r
\r
+ menu_romload_prepare(used_rom_name);\r
+\r
if(rom_data) {\r
free(rom_data);\r
rom_data = 0;\r
sprintf(menuErrorMsg, "PicoCartLoad() failed.");\r
printf("%s\n", menuErrorMsg);\r
pm_close(rom);\r
+ menu_romload_end();\r
return 0;\r
}\r
pm_close(rom);\r
+ menu_romload_end();\r
\r
// detect wrong files (Pico crashes on very small files), also see if ROM EP is good\r
if(rom_size <= 0x200 || strncmp((char *)rom_data, "Pico", 4) == 0 ||\r
\r
void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len)\r
{\r
- if (buffers & (1<<0)) memcpy((char *)gp2x_screens[0] + offset, data, len);\r
- if (buffers & (1<<1)) memcpy((char *)gp2x_screens[1] + offset, data, len);\r
- if (buffers & (1<<2)) memcpy((char *)gp2x_screens[2] + offset, data, len);\r
- if (buffers & (1<<3)) memcpy((char *)gp2x_screens[3] + offset, data, len);\r
+ char *dst;\r
+ if (buffers & (1<<0)) { dst = (char *)gp2x_screens[0] + offset; if (dst != data) memcpy(dst, data, len); }\r
+ if (buffers & (1<<1)) { dst = (char *)gp2x_screens[1] + offset; if (dst != data) memcpy(dst, data, len); }\r
+ if (buffers & (1<<2)) { dst = (char *)gp2x_screens[2] + offset; if (dst != data) memcpy(dst, data, len); }\r
+ if (buffers & (1<<3)) { dst = (char *)gp2x_screens[3] + offset; if (dst != data) memcpy(dst, data, len); }\r
}\r
\r
\r
\r
\r
\r
+// --------- loading ROM screen ----------\r
+\r
+static void load_progress_cb(int percent)\r
+{\r
+ int ln, len = percent * 320 / 100;\r
+ unsigned char *dst = (unsigned char *)gp2x_screen + 320*20;\r
+\r
+ if (len > 320) len = 320;\r
+ for (ln = 10; ln > 0; ln--, dst += 320)\r
+ memset(dst, 0xf0, len);\r
+ gp2x_video_flip2();\r
+}\r
+\r
+void menu_romload_prepare(const char *rom_name)\r
+{\r
+ const char *p = rom_name + strlen(rom_name);\r
+ while (p > rom_name && *p != '/') p--;\r
+\r
+ gp2x_pd_clone_buffer2();\r
+ gp2x_smalltext8(1, 1, "Loading");\r
+ gp2x_smalltext8_lim(1, 10, p, 53);\r
+ gp2x_memcpy_buffers(3, gp2x_screen, 0, 320*240);\r
+ gp2x_video_flip2();\r
+ PicoCartLoadProgressCB = load_progress_cb;\r
+}\r
+\r
+void menu_romload_end(void)\r
+{\r
+ PicoCartLoadProgressCB = NULL;\r
+ gp2x_smalltext8(1, 30, "Starting emulation...");\r
+ gp2x_video_flip2();\r
+}\r
+\r
// -------------- ROM selector --------------\r
\r
static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel)\r
start = 12 - sel;\r
n--; // exclude current dir (".")\r
\r
- //memset(gp2x_screen, 0, 320*240);\r
gp2x_pd_clone_buffer2();\r
\r
if(start - 2 >= 0)\r
void gp2x_text_out8_2(int x, int y, const char *texto, int color);\r
void menu_loop(void);\r
int menu_loop_tray(void);\r
+void menu_romload_prepare(const char *rom_name);\r
+void menu_romload_end(void);\r
\r
#define CONFIGURABLE_KEYS \\r
(GP2X_UP|GP2X_DOWN|GP2X_LEFT|GP2X_RIGHT|GP2X_A|GP2X_B|GP2X_X|GP2X_Y| \\r