fix CD load filename display

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@753 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-08-15 14:23:09 +00:00
parent c8d1e9b662
commit b2451ac666
4 changed files with 14 additions and 9 deletions

View file

@ -18,7 +18,7 @@ static char *rom_exts[] = { "bin", "gen", "smd", "iso" };
void (*PicoCartUnloadHook)(void) = NULL; void (*PicoCartUnloadHook)(void) = NULL;
void (*PicoCartLoadProgressCB)(int percent) = 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); static void PicoCartDetect(void);

View file

@ -73,7 +73,8 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type)
#endif #endif
}; };
if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(1); if (PicoCDLoadProgressCB != NULL)
PicoCDLoadProgressCB(cd_img_name, 1);
Unload_ISO(); 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; i = 100 / cue_data->track_count+1;
for (num_track = 2; num_track <= cue_data->track_count; num_track++) 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; index = num_track - 1;
Cur_LBA += cue_data->tracks[num_track].pregap; Cur_LBA += cue_data->tracks[num_track].pregap;
if (cue_data->tracks[num_track].type == CT_MP3) { 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++) 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++) 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, elprintf(EL_STATUS, "End CD - %02d:%02d:%02d\n", Tracks[index].MSF.M,
Tracks[index].MSF.S, Tracks[index].MSF.F); Tracks[index].MSF.S, Tracks[index].MSF.F);
if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(100); if (PicoCDLoadProgressCB != NULL)
PicoCDLoadProgressCB(cd_img_name, 100);
return 0; return 0;
} }

View file

@ -138,7 +138,7 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize);
void Byteswap(unsigned char *data,int len); void Byteswap(unsigned char *data,int len);
void PicoCartUnload(void); void PicoCartUnload(void);
extern void (*PicoCartLoadProgressCB)(int percent); extern void (*PicoCartLoadProgressCB)(int percent);
extern void (*PicoCDLoadProgressCB)(int percent); extern void (*PicoCDLoadProgressCB)(const char *fname, int percent);
// Draw.c // Draw.c
void PicoDrawSetColorFormat(int which); // 0=BGR444, 1=RGB555, 2=8bit(HighPal pal) void PicoDrawSetColorFormat(int which); // 0=BGR444, 1=RGB555, 2=8bit(HighPal pal)

View file

@ -602,7 +602,7 @@ static void load_progress_cb(int percent)
plat_video_menu_end(); 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; int ln, len = percent * g_screen_width / 100;
unsigned short *dst = (unsigned short *)g_screen_ptr + g_screen_width * 10 * 2; 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); 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, 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; dst += g_screen_width * me_sfont_h * 3;
if (len > g_screen_width) if (len > g_screen_width)
@ -647,7 +647,8 @@ void menu_romload_prepare(const char *rom_name)
void menu_romload_end(void) void menu_romload_end(void)
{ {
PicoCartLoadProgressCB = PicoCDLoadProgressCB = NULL; PicoCartLoadProgressCB = NULL;
PicoCDLoadProgressCB = NULL;
smalltext_out16(1, (cdload_called ? 6 : 3) * me_sfont_h, smalltext_out16(1, (cdload_called ? 6 : 3) * me_sfont_h,
"Starting emulation...", 0xffff); "Starting emulation...", 0xffff);
plat_video_menu_end(); plat_video_menu_end();