From: notaz Date: Thu, 21 Dec 2006 22:55:45 +0000 (+0000) Subject: trying to add movie support X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a20dbc8deacc0ad37a9556ada910981d6d97b50;p=libpicofe.git trying to add movie support git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@3 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/gp2x/emu.c b/gp2x/emu.c index 0e4fdd7..14eadeb 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -55,7 +55,7 @@ static int combo_keys = 0, combo_acts = 0; // keys and actions which need button static int gp2x_old_gamma = 100; static unsigned char *movie_data = NULL; static int movie_size = 0; -static int frame_count = 0; +int frame_count = 0; unsigned char *framebuff = 0; // temporary buffer for alt renderer int state_slot = 0; @@ -219,11 +219,18 @@ int emu_ReloadRom(void) if(movie_data[0x14] == '6') PicoOpt |= 0x20; // 6 button pad else PicoOpt &= ~0x20; + PicoOpt |= 0x40; // accurate timing if(movie_data[0xF] >= 'A') { - //Pico.m.pal = movie_data[0x16] >> 7; + if(movie_data[0x16] & 0x80) { + PicoRegionOverride = 8; + } else { + PicoRegionOverride = 4; + } + PicoReset(0); // TODO: bits 6 & 5 } - strcpy(noticeMsg, "MOVIE LOADED"); + movie_data[0x18+30] = 0; + sprintf(noticeMsg, "MOVIE: %s", (char *) &movie_data[0x18]); } else { @@ -988,6 +995,26 @@ void emu_Loop(void) updateKeys(); PicoFrame(); +#if 0 + // debug + { + static unsigned char oldscr[320*240*2]; + FILE *f; char name[128]; int i; + for (i = 0; i < 320*240*2; i++) + if(oldscr[i] != ((unsigned char *)gp2x_screen)[i]) break; + if (i < 320*240*2) + { + for (i = 0; i < 320*240*2; i++) + oldscr[i] = ((unsigned char *)gp2x_screen)[i]; + sprintf(name, "%05i.raw", frame_count); + f = fopen(name, "wb"); + if (!f) { printf("!f\n"); exit(1); } + fwrite(gp2x_screen, 1, 320*240*2, f); + fclose(f); + } + } +#endif + // check time gettimeofday(&tval, 0); if(thissec != tval.tv_sec) tval.tv_usec+=1000000; diff --git a/linux/port_config.h b/linux/port_config.h index 4f183c7..b679bab 100644 --- a/linux/port_config.h +++ b/linux/port_config.h @@ -12,7 +12,9 @@ // pico.c #define CAN_HANDLE_240_LINES 1 -#define dprintf(f,...) printf(f"\n",##__VA_ARGS__) +extern int frame_count; + +#define dprintf(f,...) printf("%05i: " f "\n",frame_count,##__VA_ARGS__) //#define dprintf(x...) #endif //PORT_CONFIG_H