mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
trying to add movie support
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@3 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
720ee7f624
commit
1a20dbc8de
2 changed files with 33 additions and 4 deletions
33
gp2x/emu.c
33
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 int gp2x_old_gamma = 100;
|
||||||
static unsigned char *movie_data = NULL;
|
static unsigned char *movie_data = NULL;
|
||||||
static int movie_size = 0;
|
static int movie_size = 0;
|
||||||
static int frame_count = 0;
|
int frame_count = 0;
|
||||||
unsigned char *framebuff = 0; // temporary buffer for alt renderer
|
unsigned char *framebuff = 0; // temporary buffer for alt renderer
|
||||||
int state_slot = 0;
|
int state_slot = 0;
|
||||||
|
|
||||||
|
@ -219,11 +219,18 @@ int emu_ReloadRom(void)
|
||||||
if(movie_data[0x14] == '6')
|
if(movie_data[0x14] == '6')
|
||||||
PicoOpt |= 0x20; // 6 button pad
|
PicoOpt |= 0x20; // 6 button pad
|
||||||
else PicoOpt &= ~0x20;
|
else PicoOpt &= ~0x20;
|
||||||
|
PicoOpt |= 0x40; // accurate timing
|
||||||
if(movie_data[0xF] >= 'A') {
|
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
|
// TODO: bits 6 & 5
|
||||||
}
|
}
|
||||||
strcpy(noticeMsg, "MOVIE LOADED");
|
movie_data[0x18+30] = 0;
|
||||||
|
sprintf(noticeMsg, "MOVIE: %s", (char *) &movie_data[0x18]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -988,6 +995,26 @@ void emu_Loop(void)
|
||||||
updateKeys();
|
updateKeys();
|
||||||
PicoFrame();
|
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
|
// check time
|
||||||
gettimeofday(&tval, 0);
|
gettimeofday(&tval, 0);
|
||||||
if(thissec != tval.tv_sec) tval.tv_usec+=1000000;
|
if(thissec != tval.tv_sec) tval.tv_usec+=1000000;
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
// pico.c
|
// pico.c
|
||||||
#define CAN_HANDLE_240_LINES 1
|
#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...)
|
//#define dprintf(x...)
|
||||||
|
|
||||||
#endif //PORT_CONFIG_H
|
#endif //PORT_CONFIG_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue