[patch] DirectFB driver: MGA CRTC2 support

Hi!

Attached you’ll find a patch for the DirectFB driver of SDL CVS
to emulate the DVDmax feature of Matrox G450/G550 cards:
You see the output from the first head also on the TV.
-> This patch allows me to run Freevo / xmame / zsnes on my TV.

Why is this patch needed? Because the second head (CRTC2) got a
fixed resolution of 720x576 (PAL) or 720x480 (NTSC). Freevo f.e.
will only run in 800x600 or 640x480.

The new code is activated when you set the environment variable
SDL_DIRECTFB_MGA_CRTC=x.

The picture can also be stretched fit-to-screen with the environment
variable SDL_DIRECTFB_MGA_STRETCH=x.

Please let me know what you think.

Cheers,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl-directfb-mga-crtc2.patch
Type: text/x-diff
Size: 9361 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030928/13c78226/attachment.patch

Attached you’ll find a patch for the DirectFB driver of SDL CVS
to emulate the DVDmax feature of Matrox G450/G550 cards:
You see the output from the first head also on the TV.
-> This patch allows me to run Freevo / xmame / zsnes on my TV.

I’ve never used DirectFB, but the patch looks sane.

Can I get you to take out the printf() calls and “//” comments in the
patch, though? If DirectFB isn’t Linux-specific (or may work on other Unix
flavors in the future), then the “//” will confuse some not-C99 compiler
somewhere (this has happened with SDL before).

–ryan.

Attached you’ll find a patch for the DirectFB driver of SDL CVS
to emulate the DVDmax feature of Matrox G450/G550 cards:
You see the output from the first head also on the TV.
-> This patch allows me to run Freevo / xmame / zsnes on my TV.

I’ve never used DirectFB, but the patch looks sane.

One thing came to my mind during breakfast this morning:
Isn’t the output of the second head in DirectFB_FlipHWSurface
one frame behind? I first flip the “offscreen” memory and
then copy it. Shouldn’t I copy it first and the flip it?

Can I get you to take out the printf() calls and “//” comments in the
patch, though? If DirectFB isn’t Linux-specific (or may work on other Unix
flavors in the future), then the “//” will confuse some not-C99 compiler
somewhere (this has happened with SDL before).

Ok, I’ll change the “//” to “/* */”, but I would like
to keep the comments if possible :wink:

Also I’ll put the printf() calls in f.e. #ifdef DIRECTFB_CRTC2_DEBUG.

Thomas

I’ve never used DirectFB, but the patch looks sane.

One thing came to my mind during breakfast this morning:
Isn’t the output of the second head in DirectFB_FlipHWSurface
one frame behind? I first flip the “offscreen” memory and
then copy it. Shouldn’t I copy it first and the flip it?

Ok, I wrote a test program and the code works the way it is.
-> First flip, then copy

Attached is the “final” version of the patch. I’ve fixed the comments,
#ifdefed the printfs() and changed the indent of my code.
Should be ready for CVS :slight_smile:

Thomas
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl-directfb-mga-crtc2.patch
Type: text/x-diff
Size: 10129 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030929/b9c045a4/attachment.patch