From b2451ac666326a748e1c7174416a3baacd09e6b1 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 15 Aug 2009 14:23:09 +0000 Subject: [PATCH] fix CD load filename display git-svn-id: file:///home/notaz/opt/svn/PicoDrive@753 be3aeb3a-fb24-0410-a615-afba39da0efa --- pico/cart.c | 2 +- pico/cd/cd_file.c | 12 ++++++++---- pico/pico.h | 2 +- platform/common/menu.c | 7 ++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pico/cart.c b/pico/cart.c index 06b7917..44a1a25 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -18,7 +18,7 @@ static char *rom_exts[] = { "bin", "gen", "smd", "iso" }; void (*PicoCartUnloadHook)(void) = NULL; void (*PicoCartLoadProgressCB)(int percent) = NULL; -void (*PicoCDLoadProgressCB)(int percent) = NULL; // handled in Pico/cd/cd_file.c +void (*PicoCDLoadProgressCB)(const char *fname, int percent) = NULL; // handled in Pico/cd/cd_file.c static void PicoCartDetect(void); diff --git a/pico/cd/cd_file.c b/pico/cd/cd_file.c index f5d8744..31efd0e 100644 --- a/pico/cd/cd_file.c +++ b/pico/cd/cd_file.c @@ -73,7 +73,8 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type) #endif }; - if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(1); + if (PicoCDLoadProgressCB != NULL) + PicoCDLoadProgressCB(cd_img_name, 1); Unload_ISO(); @@ -118,7 +119,8 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type) i = 100 / cue_data->track_count+1; for (num_track = 2; num_track <= cue_data->track_count; num_track++) { - if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(i * num_track); + if (PicoCDLoadProgressCB != NULL) + PicoCDLoadProgressCB(cd_img_name, i * num_track); index = num_track - 1; Cur_LBA += cue_data->tracks[num_track].pregap; if (cue_data->tracks[num_track].type == CT_MP3) { @@ -179,7 +181,8 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type) for (num_track = 2, i = 0, missed = 0; i < 100 && missed < 4; i++) { - if (PicoCDLoadProgressCB != NULL && i > 1) PicoCDLoadProgressCB(i + (100-i)*missed/4); + if (PicoCDLoadProgressCB != NULL && i > 1) + PicoCDLoadProgressCB(cd_img_name, i + (100-i)*missed/4); for (j = 0; j < sizeof(exts)/sizeof(char *); j++) { @@ -225,7 +228,8 @@ finish: elprintf(EL_STATUS, "End CD - %02d:%02d:%02d\n", Tracks[index].MSF.M, Tracks[index].MSF.S, Tracks[index].MSF.F); - if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(100); + if (PicoCDLoadProgressCB != NULL) + PicoCDLoadProgressCB(cd_img_name, 100); return 0; } diff --git a/pico/pico.h b/pico/pico.h index ba7349e..828a63d 100644 --- a/pico/pico.h +++ b/pico/pico.h @@ -138,7 +138,7 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize); void Byteswap(unsigned char *data,int len); void PicoCartUnload(void); extern void (*PicoCartLoadProgressCB)(int percent); -extern void (*PicoCDLoadProgressCB)(int percent); +extern void (*PicoCDLoadProgressCB)(const char *fname, int percent); // Draw.c void PicoDrawSetColorFormat(int which); // 0=BGR444, 1=RGB555, 2=8bit(HighPal pal) diff --git a/platform/common/menu.c b/platform/common/menu.c index bd4eb70..688d538 100644 --- a/platform/common/menu.c +++ b/platform/common/menu.c @@ -602,7 +602,7 @@ static void load_progress_cb(int percent) plat_video_menu_end(); } -static void cdload_progress_cb(int percent) +static void cdload_progress_cb(const char *fname, int percent) { int ln, len = percent * g_screen_width / 100; unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * 10 * 2; @@ -610,7 +610,7 @@ static void cdload_progress_cb(int percent) memset(dst, 0xff, g_screen_width * (me_sfont_h - 2) * 2); smalltext_out16(1, 3 * me_sfont_h, "Processing CD image / MP3s", 0xffff); - smalltext_out16(1, 4 * me_sfont_h, rom_fname_loaded, 0xffff); + smalltext_out16(1, 4 * me_sfont_h, fname, 0xffff); dst += g_screen_width * me_sfont_h * 3; if (len > g_screen_width) @@ -647,7 +647,8 @@ void menu_romload_prepare(const char *rom_name) void menu_romload_end(void) { - PicoCartLoadProgressCB = PicoCDLoadProgressCB = NULL; + PicoCartLoadProgressCB = NULL; + PicoCDLoadProgressCB = NULL; smalltext_out16(1, (cdload_called ? 6 : 3) * me_sfont_h, "Starting emulation...", 0xffff); plat_video_menu_end(); -- 2.39.2