From: notaz Date: Fri, 16 Mar 2007 20:59:11 +0000 (+0000) Subject: loading msgs, bugfixes X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfa4c846f44d3717288758b38d267d157858aaf7;p=libpicofe.git loading msgs, bugfixes git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@69 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/gp2x/940ctl.c b/gp2x/940ctl.c index 5c53761..48ebfa0 100644 --- a/gp2x/940ctl.c +++ b/gp2x/940ctl.c @@ -563,6 +563,12 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 if (loaded_mp3 != f) { // printf("loading mp3... "); fflush(stdout); + if (PicoMessage != NULL) + { + fseek(f, 0, SEEK_END); + if (ftell(f) > 2*1024*1024) + PicoMessage("Loading MP3..."); + } fseek(f, 0, SEEK_SET); fread(mp3_mem, 1, MP3_SIZE_MAX, f); // if (feof(f)) printf("done.\n"); diff --git a/gp2x/Makefile b/gp2x/Makefile index d6ba1d5..7818741 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -8,7 +8,7 @@ CROSS = arm-linux- dprint = 1 #mz80 = 1 #debug_cyclone = 1 -asm_memory = 0 # TODO +asm_memory = 1 asm_render = 1 asm_ym2612 = 1 asm_misc = 1 diff --git a/gp2x/emu.c b/gp2x/emu.c index a98a5be..033f275 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -393,6 +393,8 @@ int emu_ReloadRom(void) } +static void emu_msg_cb(const char *msg); + void emu_Init(void) { // make temp buffer for alt renderer @@ -409,6 +411,7 @@ void emu_Init(void) mkdir("cfg", 0777); PicoInit(); + PicoMessage = emu_msg_cb; // logf = fopen("log.txt", "w"); } @@ -771,6 +774,23 @@ static void vidResetMode(void) } +static void emu_msg_cb(const char *msg) +{ + if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) { + // 8-bit renderers + gp2x_memset_all_buffers(320*232, 0xe0, 320*8); + osd_text(4, 232, msg); + gp2x_memcpy_all_buffers((char *)gp2x_screen+320*232, 320*232, 320*8); + } else { + // 16bit accurate renderer + gp2x_memset_all_buffers(320*232*2, 0, 320*8*2); + osd_text(4, 232, msg); + gp2x_memcpy_all_buffers((char *)gp2x_screen+320*232*2, 320*232*2, 320*8*2); + } + gettimeofday(¬iceMsgTime, 0); + noticeMsgTime.tv_sec -= 2; +} + static void emu_state_cb(const char *str) { clearArea(0); diff --git a/gp2x/menu.c b/gp2x/menu.c index 5cab760..7050b98 100644 --- a/gp2x/menu.c +++ b/gp2x/menu.c @@ -744,7 +744,7 @@ static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_j gp2x_text_out8(tl_x, (y+=10), "CD LEDs %s", (currentConfig.EmuOpt &0x0400)?"ON":"OFF"); // 3 gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x0800)?"ON":"OFF"); // 4 gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x0400)?"ON":"OFF"); // 5 - gp2x_text_out8(tl_x, (y+=10), "Better sync (slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6 + gp2x_text_out8(tl_x, (y+=10), "Better sync (slower) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6 gp2x_text_out8(tl_x, (y+=10), "ReadAhead buffer %s", ra_buff); // 7 gp2x_text_out8(tl_x, (y+=10), "Done");