\r
/* checks if romFileName points to valid MegaCD image\r
* if so, checks for suitable BIOS */\r
-static int cd_check(char **bios_file)\r
+int emu_cd_check(char **bios_file)\r
{\r
unsigned char buf[32];\r
pm_file *cd_f;\r
return 0;\r
}\r
\r
- /* it seems we have a CD image here. Try to detect region and load a suitable BIOS now.. */\r
+ /* it seems we have a CD image here. Try to detect region now.. */\r
pm_seek(cd_f, (type == 1) ? 0x100+0x10B : 0x110+0x10B, SEEK_SET);\r
pm_read(buf, 1, cd_f);\r
pm_close(cd_f);\r
printf("overrided region to %s\n", region != 4 ? (region == 8 ? "EU" : "JAP") : "USA");\r
}\r
\r
- if(find_bios(region, bios_file))\r
+ if (bios_file == NULL) return type;\r
+\r
+ if (find_bios(region, bios_file))\r
return type; // CD and BIOS detected\r
\r
return -1; // CD detected but load failed\r
}\r
\r
// check for MegaCD image\r
- cd_state = cd_check(&used_rom_name);\r
+ cd_state = emu_cd_check(&used_rom_name);\r
if (cd_state > 0) {\r
PicoMCD |= 1;\r
get_ext(used_rom_name, ext);\r
\r
\r
static void emu_msg_cb(const char *msg);\r
+static void emu_msg_tray_open(void);\r
\r
void emu_Init(void)\r
{\r
\r
PicoInit();\r
PicoMessage = emu_msg_cb;\r
-\r
-// logf = fopen("log.txt", "w");\r
+ PicoMCDopenTray = emu_msg_tray_open;\r
+ PicoMCDcloseTray = menu_loop_tray;\r
}\r
\r
\r
}\r
scaling_update();\r
// some sanity checks\r
- if (currentConfig.CPUclock < 1 || currentConfig.CPUclock > 4096) currentConfig.CPUclock = 200;\r
+ if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 4096) currentConfig.CPUclock = 200;\r
if (currentConfig.gamma < 10 || currentConfig.gamma > 300) currentConfig.gamma = 100;\r
+ if (currentConfig.volume < 0 || currentConfig.volume > 99) currentConfig.volume = 50;\r
// if volume keys are unbound, bind them to volume control\r
if (!currentConfig.KeyBinds[23] && !currentConfig.KeyBinds[22]) {\r
currentConfig.KeyBinds[23] = 1<<29; // vol up\r
free(framebuff);\r
\r
PicoExit();\r
-// fclose(logf);\r
\r
// restore gamma\r
if (gp2x_old_gamma != 100)\r
blit("", str);\r
}\r
\r
+static void emu_msg_tray_open(void)\r
+{\r
+ strcpy(noticeMsg, "CD tray opened");\r
+ gettimeofday(¬iceMsgTime, 0);\r
+}\r
+\r
static void RunEvents(unsigned int which)\r
{\r
if(which & 0x1800) { // save or load (but not both)\r
if(events & 0x6000) {\r
int vol = currentConfig.volume;\r
if (events & 0x2000) {\r
- if (vol < 90) vol++;\r
+ if (vol < 99) vol++;\r
} else {\r
if (vol > 0) vol--;\r
}\r
if (frames_shown > frames_done) frames_shown = frames_done;\r
}\r
}\r
-#if 1\r
+#if 0\r
sprintf(fpsbuff, "%05i", Pico.m.frame_count);\r
#endif\r
lim_time = (frames_done+1) * target_frametime;\r