Author Topic: SDL Suggestions/Workarrounds on Wiki  (Read 3796 times)

D_Skywalk

  • Guest
SDL Suggestions/Workarrounds on Wiki
« on: October 19, 2009, 02:18:56 am »
I published on Wiki some suggestions to avoid the graphics erros and get a perfect graphic sync on your dingoo.

http://dingoowiki.com/index.php/Development:Tutorials:SetupVideo
I hope this helps to other devs too :)

Cu!

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #1 on: October 19, 2009, 04:35:34 am »
Great! Thanks for sharing  :D

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #2 on: December 07, 2009, 02:33:37 pm »
Hello D_Skywalk, do you know if is there any way to use 8bpp screens surfaces? Even a possible workaround?

I'm trying to port a game that only works in 8bpp.

Thank you very much.

darfgarf

  • Guest
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #3 on: December 07, 2009, 03:27:06 pm »
there's no support for that as far as i know, the best thing i've personally got working was converting the screen format pixel by pixel (very slow)

you might be able to use something like

init sdl with 16 bit screen surface (a new surface)
let the code blit to the old surface
use SDL_DisplayFormat on the old surface (converts surface to the current display format as best as it can)
then flip the new surface

i never got that working myself though, and gave up working on it, booboo did say he would look into adding other display depths to the graphics drivers though, when he had time, and after all the filesystem corruption issues etc

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #4 on: December 07, 2009, 04:00:44 pm »
Thank you very much darfgarf, I'll try it later and report the results here.

vimrc

  • Posts: 66
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #5 on: December 07, 2009, 04:52:58 pm »
Here is a very good example:
http://dl.openhandhelds.org/cgi-bin/dingoo.cgi?0,1,0,0,3,142

Read the relevant comment in the vid_sdl.c file.

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #6 on: December 08, 2009, 03:45:13 pm »
I tried something like this:

Code: [Select]

...

screen_dingoo = SDL_SetVideoMode(rw, rh, 16, sdl_flags);
old_screen = SDL_CreateRGBSurface(sdl_flags, rw, rh, 8, 0, 0, 0, 0);

...

temp = SDL_DisplayFormat(old_screen);
SDL_BlitSurface(temp, NULL, screen_dingoo, NULL);
SDL_Flip(screen_dingoo);

...

but got only a black screen  :(

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #7 on: December 09, 2009, 03:35:26 pm »
It worked!

The problem was the palette. Just added SDL_LOGPAL on SDL_SetPalette and everything worked as expected. No more black screen  ;)


Thank you guys!
« Last Edit: December 09, 2009, 03:37:18 pm by Shin-NiL »

darfgarf

  • Guest
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #8 on: December 09, 2009, 04:16:23 pm »
nice, i may have to look into it, as i almost had cdogs up and running

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: SDL Suggestions/Workarrounds on Wiki
« Reply #9 on: December 09, 2009, 04:22:41 pm »
This game is exactly what I'm working on  :o

It's running just fine now.

 

Post a new topic
Post a new topic