Since I got the full source text a few days ago, I'm currently porting "Giana's Return" to OS4. The MorphOS version is already running perfectly, but I won't release anything before both versions are working. ;)
Unfortunately there seems to be a problem with hardware surfaces with the recent libSDL.so from Google Code. After running the game for a short time I'm always getting system hangs (cannot move the mouse or switch display). The bug occurs in different situations, but now I finally found an SDL call which didn't return: SDL_ConvertSurface().
Hundreds of small graphics are converted into the native screen's graphics format with this call. So it must have run serveral times before, but suddenly it freezes.
I realized that the function was requesting a SDL_HWSURFACE, like many other calls in the game. Surprisingly, when I changed this call to SDL_SWSURFACE the program continues, and seems to work!
Why is that? Could it be that at some point no more video RAM for hardware surfaces is available? But then the system should just return a software-surface and continue? A bug?
But the performance was disappointing: 10 fps. Then, just for a test, I replaced all SDL_HWSURFACE with SDL_SWSURFACE and it accelerated to 50 fps!
Is it a bug in SDL_ConvertSurface() or with hardware surfaces in general? Can somebody check or confirm that?
@phx I notice the same some time ago, and everythere and all the time i try to replace HWSURFACE on SWSURFACE. But imho we need to ask for help from AfxGroup, maybe he can explain that .. I remember that 1 year ago or so, someone talk about it, but do not remember where and what exactly (sorry)
Cool! I have been curious of this game since it was announced! I have noticed speed differences with hw/sw surfaces as well. The best place to report os4sdl bugs is on the google code project page.
As far as i rememeber, there is not any crash. The problem is speed of programm: when you use HWSURFACE as options for SDL (in SetVideoModE), you have very slow work of app itself. If you set SWSURFACE options, it works faster in 4-5-6 times.
For me, it looks like just SWSURFACE and HWSURFACE in our SDL changes beetwen.
@afxgroup I will try to create an example source for you and contact you privately. I don't have your email address, so I hope the one linked under Contacts at www.amigasoft.net is correct?
1. HWSURFACE is very slow. 2. When creating too many hardware surfaces the system will lock up.
Another problem I just realized, is not related to hardware surfaces: the SDL Joystick doesn't work. Does it support USB joysticks? AFAICS those three are all problems to fix for brining the OS4-version on the same level as the MorphOS version.
i have no joystick and so i cannot test it but iirc it should work. If you make me a small example i'll try to fix the problem related the SDL surfaces
i've fixed the problem on 24BIT screen and SDL_SWSURFACE. Regard the speed it seems you are using an old version of SDL.. but it seems i've fixed a most important thing.. must check.. maybe are my eyes..
If you're using 4.1 update 1 or 2, then USB joysticks should basically work.
If the USB joystick is detected in AmigaInput prefs, and you can calibrate it, it should work with SDL. For example, it works perfectly with Giddy 3 for me. You might want to try with that game to see if it is working with SDL at all on your system.
@xeron, afxgroup : Nice to see there is activity around SDL. I think we should write some tests (or get existing ones) to put them in the repository. I am still testing SDL and its extra libs, notably with vbcc.
i've found some interesting tests that are useful with SDL and OpenGL. I'll put them into the trunk. They are simply to compile and they seems valid tests
I would like to see Emilia Pinball working properly. All of the obstacles on the table flicker. If anyone wants the source (modified so it actually compiles and runs on OS4), let me know. Or if you just want the binary and game data to see what i'm talking about.