mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 23:07:46 -04:00
partial gmv implementation
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@6 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
1a20dbc8de
commit
47f22a1fd8
3 changed files with 52 additions and 19 deletions
65
gp2x/emu.c
65
gp2x/emu.c
|
@ -55,7 +55,6 @@ 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;
|
||||||
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;
|
||||||
|
|
||||||
|
@ -246,7 +245,7 @@ int emu_ReloadRom(void)
|
||||||
if(currentConfig.EmuOpt & 1)
|
if(currentConfig.EmuOpt & 1)
|
||||||
emu_SaveLoadGame(1, 1);
|
emu_SaveLoadGame(1, 1);
|
||||||
|
|
||||||
frame_count = 0;
|
Pico.m.frame_count = 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -713,7 +712,7 @@ static void updateKeys(void)
|
||||||
|
|
||||||
if(movie_data)
|
if(movie_data)
|
||||||
{
|
{
|
||||||
int offs = frame_count*3 + 0x40;
|
int offs = Pico.m.frame_count*3 + 0x40;
|
||||||
if (offs+3 > movie_size) {
|
if (offs+3 > movie_size) {
|
||||||
free(movie_data);
|
free(movie_data);
|
||||||
movie_data = 0;
|
movie_data = 0;
|
||||||
|
@ -736,8 +735,6 @@ static void updateKeys(void)
|
||||||
PicoPad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX
|
PicoPad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX
|
||||||
if(!(movie_data[offs+2] & 0x10)) PicoPad[1] |= 0x0400; // X
|
if(!(movie_data[offs+2] & 0x10)) PicoPad[1] |= 0x0400; // X
|
||||||
if(!(movie_data[offs+2] & 0x40)) PicoPad[1] |= 0x0100; // Z
|
if(!(movie_data[offs+2] & 0x40)) PicoPad[1] |= 0x0100; // Z
|
||||||
if ((PicoPad[0] & 0x80) || (PicoPad[1] & 0x80))
|
|
||||||
printf("%d: start\n", frame_count);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -745,7 +742,7 @@ static void updateKeys(void)
|
||||||
PicoPad[0] = (unsigned short) allActions[0];
|
PicoPad[0] = (unsigned short) allActions[0];
|
||||||
PicoPad[1] = (unsigned short) allActions[1];
|
PicoPad[1] = (unsigned short) allActions[1];
|
||||||
}
|
}
|
||||||
frame_count++;
|
Pico.m.frame_count++;
|
||||||
|
|
||||||
events = (allActions[0] | allActions[1]) >> 16;
|
events = (allActions[0] | allActions[1]) >> 16;
|
||||||
|
|
||||||
|
@ -995,21 +992,59 @@ void emu_Loop(void)
|
||||||
updateKeys();
|
updateKeys();
|
||||||
PicoFrame();
|
PicoFrame();
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (Pico.m.frame_count == 31563) {
|
||||||
|
FILE *f;
|
||||||
|
f = fopen("ram_p.bin", "wb");
|
||||||
|
if (!f) { printf("!f\n"); exit(1); }
|
||||||
|
fwrite(Pico.ram, 1, 0x10000, f);
|
||||||
|
fclose(f);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
// debug
|
// debug
|
||||||
{
|
{
|
||||||
static unsigned char oldscr[320*240*2];
|
#define BYTE unsigned char
|
||||||
FILE *f; char name[128]; int i;
|
#define WORD unsigned short
|
||||||
for (i = 0; i < 320*240*2; i++)
|
struct
|
||||||
if(oldscr[i] != ((unsigned char *)gp2x_screen)[i]) break;
|
|
||||||
if (i < 320*240*2)
|
|
||||||
{
|
{
|
||||||
for (i = 0; i < 320*240*2; i++)
|
BYTE IDLength; /* 00h Size of Image ID field */
|
||||||
oldscr[i] = ((unsigned char *)gp2x_screen)[i];
|
BYTE ColorMapType; /* 01h Color map type */
|
||||||
sprintf(name, "%05i.raw", frame_count);
|
BYTE ImageType; /* 02h Image type code */
|
||||||
|
WORD CMapStart; /* 03h Color map origin */
|
||||||
|
WORD CMapLength; /* 05h Color map length */
|
||||||
|
BYTE CMapDepth; /* 07h Depth of color map entries */
|
||||||
|
WORD XOffset; /* 08h X origin of image */
|
||||||
|
WORD YOffset; /* 0Ah Y origin of image */
|
||||||
|
WORD Width; /* 0Ch Width of image */
|
||||||
|
WORD Height; /* 0Eh Height of image */
|
||||||
|
BYTE PixelDepth; /* 10h Image pixel size */
|
||||||
|
BYTE ImageDescriptor; /* 11h Image descriptor byte */
|
||||||
|
} __attribute__((packed)) TGAHEAD;
|
||||||
|
static unsigned short oldscr[320*240];
|
||||||
|
FILE *f; char name[128]; int i;
|
||||||
|
|
||||||
|
memset(&TGAHEAD, 0, sizeof(TGAHEAD));
|
||||||
|
TGAHEAD.ImageType = 2;
|
||||||
|
TGAHEAD.Width = 320;
|
||||||
|
TGAHEAD.Height = 240;
|
||||||
|
TGAHEAD.PixelDepth = 16;
|
||||||
|
TGAHEAD.ImageDescriptor = 2<<4; // image starts at top-left
|
||||||
|
|
||||||
|
#define CONV(X) (((X>>1)&0x7fe0)|(X&0x1f)) // 555?
|
||||||
|
|
||||||
|
for (i = 0; i < 320*240; i++)
|
||||||
|
if(oldscr[i] != CONV(((unsigned short *)gp2x_screen)[i])) break;
|
||||||
|
if (i < 320*240)
|
||||||
|
{
|
||||||
|
for (i = 0; i < 320*240; i++)
|
||||||
|
oldscr[i] = CONV(((unsigned short *)gp2x_screen)[i]);
|
||||||
|
sprintf(name, "%05i.tga", Pico.m.frame_count);
|
||||||
f = fopen(name, "wb");
|
f = fopen(name, "wb");
|
||||||
if (!f) { printf("!f\n"); exit(1); }
|
if (!f) { printf("!f\n"); exit(1); }
|
||||||
fwrite(gp2x_screen, 1, 320*240*2, f);
|
fwrite(&TGAHEAD, 1, sizeof(TGAHEAD), f);
|
||||||
|
fwrite(oldscr, 1, 320*240*2, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,7 +603,7 @@ static void draw_amenu_options(int menu_sel)
|
||||||
|
|
||||||
static void amenu_loop_options(void)
|
static void amenu_loop_options(void)
|
||||||
{
|
{
|
||||||
int menu_sel = 0, menu_sel_max = 11;
|
int menu_sel = 0, menu_sel_max = 10;
|
||||||
unsigned long inp = 0;
|
unsigned long inp = 0;
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
// pico.c
|
// pico.c
|
||||||
#define CAN_HANDLE_240_LINES 1
|
#define CAN_HANDLE_240_LINES 1
|
||||||
|
|
||||||
extern int frame_count;
|
#define dprintf(f,...) printf("%05i: " f "\n",Pico.m.frame_count,##__VA_ARGS__)
|
||||||
|
|
||||||
#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