X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Femu.c;h=7f375a3c593bcbe74eee221ab927a323858dfbb7;hb=f7e40c9b2e6d5ca446cb8c2edf9e7601dd9c97cd;hp=1024b84b6cbfb0f227adac855b1a4a526bea970b;hpb=68af34fe20d7d9658100668f86a87bf73506bcb4;p=picodrive.git diff --git a/platform/common/emu.c b/platform/common/emu.c index 1024b84..7f375a3 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -151,13 +151,13 @@ void emu_status_msg(const char *format, ...) } static const char * const biosfiles_us[] = { - "us_scd1_9210", "us_scd2_9306", "SegaCDBIOS9303", "bios_CD_U" + "us_scd2_9306", "SegaCDBIOS9303", "us_scd1_9210", "bios_CD_U" }; static const char * const biosfiles_eu[] = { - "eu_mcd1_9210", "eu_mcd2_9306", "eu_mcd2_9303", "bios_CD_E" + "eu_mcd2_9306", "eu_mcd2_9303", "eu_mcd1_9210", "bios_CD_E" }; static const char * const biosfiles_jp[] = { - "jp_mcd1_9112", "jp_mcd1_9111", "bios_CD_J" + "jp_mcd2_921222", "jp_mcd1_9112", "jp_mcd1_9111", "bios_CD_J" }; static const char *find_bios(int *region, const char *cd_fname) @@ -322,6 +322,10 @@ static void system_announce(void) #endif } else if (PicoAHW & PAHW_PICO) { sys_name = "Pico"; + } else if ((PicoAHW & (PAHW_32X|PAHW_MCD)) == (PAHW_32X|PAHW_MCD)) { + sys_name = "32X + Mega CD"; + if ((Pico.m.hardware & 0xc0) == 0x80) + sys_name = "32X + Sega CD"; } else if (PicoAHW & PAHW_MCD) { sys_name = "Mega CD"; if ((Pico.m.hardware & 0xc0) == 0x80) @@ -526,19 +530,20 @@ out: int emu_swap_cd(const char *fname) { - cd_img_type cd_type; + enum cd_img_type cd_type; int ret = -1; cd_type = PicoCdCheck(fname, NULL); if (cd_type != CIT_NOT_CD) - ret = Insert_CD(fname, cd_type); + ret = cdd_load(fname, cd_type); if (ret != 0) { menu_update_msg("Load failed, invalid CD image?"); return 0; } strncpy(rom_fname_loaded, fname, sizeof(rom_fname_loaded)-1); - rom_fname_loaded[sizeof(rom_fname_loaded)-1] = 0; + rom_fname_loaded[sizeof(rom_fname_loaded) - 1] = 0; + return 1; } @@ -602,7 +607,6 @@ void emu_set_defconfig(void) PsndRate = currentConfig.s_PsndRate; PicoRegionOverride = currentConfig.s_PicoRegion; PicoAutoRgnOrder = currentConfig.s_PicoAutoRgnOrder; - PicoCDBuffers = currentConfig.s_PicoCDBuffers; } int emu_read_config(const char *rom_fname, int no_defaults) @@ -734,8 +738,26 @@ mk_text_out(emu_text_out16_rot, unsigned short, 0xffff, #undef mk_text_out +void emu_osd_text16(int x, int y, const char *text) +{ + int len = strlen(text) * 8; + int i, h; + + len++; + if (x + len > g_screen_width) + len = g_screen_width - x; + + for (h = 0; h < 8; h++) { + unsigned short *p; + p = (unsigned short *)g_screen_ptr + + x + g_screen_width * (y + h); + for (i = len; i > 0; i--, p++) + *p = (*p >> 2) & 0x39e7; + } + emu_text_out16(x, y, text); +} -void update_movie(void) +static void update_movie(void) { int offs = Pico.m.frame_count*3 + 0x40; if (offs+3 > movie_size) { @@ -1069,9 +1091,9 @@ static void run_events_ui(unsigned int which) char tmp[64]; int keys, len; - strcpy(tmp, (which & PEV_STATE_LOAD) ? "LOAD STATE?" : "OVERWRITE SAVE?"); + strcpy(tmp, (which & PEV_STATE_LOAD) ? "LOAD STATE? " : "OVERWRITE SAVE? "); len = strlen(tmp); - nm = in_get_key_name(-1, -PBTN_MA3); + nm = in_get_key_name(-1, -PBTN_MOK); snprintf(tmp + len, sizeof(tmp) - len, "(%s=yes, ", nm); len = strlen(tmp); nm = in_get_key_name(-1, -PBTN_MBACK); @@ -1080,13 +1102,13 @@ static void run_events_ui(unsigned int which) plat_status_msg_busy_first(tmp); in_set_config_int(0, IN_CFG_BLOCKING, 1); - while (in_menu_wait_any(NULL, 50) & (PBTN_MA3|PBTN_MBACK)) + while (in_menu_wait_any(NULL, 50) & (PBTN_MOK | PBTN_MBACK)) ; - while ( !((keys = in_menu_wait_any(NULL, 50)) & (PBTN_MA3|PBTN_MBACK)) ) + while ( !((keys = in_menu_wait_any(NULL, 50)) & (PBTN_MOK | PBTN_MBACK))) ; if (keys & PBTN_MBACK) do_it = 0; - while (in_menu_wait_any(NULL, 50) & (PBTN_MA3|PBTN_MBACK)) + while (in_menu_wait_any(NULL, 50) & (PBTN_MOK | PBTN_MBACK)) ; in_set_config_int(0, IN_CFG_BLOCKING, 0); } @@ -1332,10 +1354,6 @@ void emu_loop(void) PicoLoopPrepare(); - // prepare CD buffer - if (PicoAHW & PAHW_MCD) - PicoCDBufferInit(); - plat_video_loop_prepare(); emu_loop_prep(); pemu_sound_start(); @@ -1379,6 +1397,8 @@ void emu_loop(void) { notice_msg_time = 0; plat_status_msg_clear(); + plat_video_flip(); + plat_status_msg_clear(); /* Do it again in case of double buffering */ notice_msg = NULL; } else { @@ -1497,10 +1517,4 @@ void emu_loop(void) pemu_loop_end(); emu_sound_stop(); - - // pemu_loop_end() might want to do 1 frame for bg image, - // so free CD buffer here - if (PicoAHW & PAHW_MCD) - PicoCDBufferFree(); } -