pkgsrc/emulators/gens/patches/patch-aq
dillo 0271939835 Add support for playing back gmv movies (recording of previously
played game), based on
	http://bisqwit.iki.fi/src/Gens212a-moviepatch-jyzero,bisqwit.gz
adapted to rc3 and cleaned up by me.

More information and movies can be found at
	http://bisqwit.iki.fi/jutut/nesvideos/FrontPage.html

Bump PKGREVISION.
2004-08-15 12:13:53 +00:00

112 lines
2.9 KiB
Text

$NetBSD: patch-aq,v 1.1 2004/08/15 12:13:53 dillo Exp $
--- src/gens/sdllayer/g_sdldraw.c.orig 2004-08-15 11:46:04.000000000 +0200
+++ src/gens/sdllayer/g_sdldraw.c
@@ -462,7 +462,11 @@ Update_Emulation (void)
Write_Sound_Buffer (NULL);
}
- Update_Controllers ();
+ if (MoviePlaying)
+ MoviePlayingStuff();
+ else
+ Update_Controllers();
+ FrameCount++;
if (Frame_Number++ < Frame_Skip)
{
@@ -487,7 +491,12 @@ Update_Emulation (void)
//{
Write_Sound_Buffer (NULL);
//WP = (WP + 1) & (Sound_Segs - 1);
- Update_Controllers ();
+ if (MoviePlaying)
+ MoviePlayingStuff();
+ else
+ Update_Controllers();
+ FrameCount++;
+
//if (WP != RP)
//{
@@ -518,13 +527,21 @@ Update_Emulation (void)
for (; Frame_Number > 1; Frame_Number--)
{
- Update_Controllers ();
+ if (MoviePlaying)
+ MoviePlayingStuff();
+ else
+ Update_Controllers();
+ FrameCount++;
Update_Frame_Fast ();
}
if (Frame_Number)
{
- Update_Controllers ();
+ if (MoviePlaying)
+ MoviePlayingStuff();
+ else
+ Update_Controllers();
+ FrameCount++;
Update_Frame ();
Flip ();
}
@@ -540,7 +557,12 @@ Update_Emulation (void)
int
Update_Emulation_One (void)
{
- Update_Controllers ();
+ if (MoviePlaying)
+ MoviePlayingStuff();
+ else
+ Update_Controllers();
+ FrameCount++;
+
Update_Frame ();
Flip ();
@@ -686,3 +708,42 @@ Take_Shot ()
surface->h, surface->w * 2);
return 0;
}
+
+void
+MoviePlayingStuff()
+{
+ char PadData[3]; //Modif
+
+ if(FrameCount >= MovieLastFrame)
+ {
+ MoviePlaying=0;
+ sprintf(Str_Tmp, "Movie finished", Current_State);
+ Put_Info(Str_Tmp, 2000);
+ return;
+ }
+ ReadInMovie(FrameCount,&PadData[0],&PadData[1],&PadData[2]);
+ Controller_1_Up=(PadData[0]&1);
+ Controller_1_Down=(PadData[0]&2)>>1;
+ Controller_1_Left=(PadData[0]&4)>>2;
+ Controller_1_Right=(PadData[0]&8)>>3;
+ Controller_1_A=(PadData[0]&16)>>4;
+ Controller_1_B=(PadData[0]&32)>>5;
+ Controller_1_C=(PadData[0]&64)>>6;
+ Controller_1_Start=(PadData[0]&128)>>7;
+ Controller_2_Up=(PadData[1]&1);
+ Controller_2_Down=(PadData[1]&2)>>1;
+ Controller_2_Left=(PadData[1]&4)>>2;
+ Controller_2_Right=(PadData[1]&8)>>3;
+ Controller_2_A=(PadData[1]&16)>>4;
+ Controller_2_B=(PadData[1]&32)>>5;
+ Controller_2_C=(PadData[1]&64)>>6;
+ Controller_2_Start=(PadData[1]&128)>>7;
+ Controller_1_X=(PadData[2]&1);
+ Controller_1_Y=(PadData[2]&2)>>1;
+ Controller_1_Z=(PadData[2]&4)>>2;
+ Controller_1_Mode=(PadData[2]&8)>>3;
+ Controller_2_X=(PadData[2]&16)>>4;
+ Controller_2_Y=(PadData[2]&32)>>5;
+ Controller_2_Z=(PadData[2]&64)>>6;
+ Controller_2_Mode=(PadData[2]&128)>>7;
+}