Homebrew Project Accelerated 2D operations in SDL

  • Thread starter Thread starter mudrik
  • Start date Start date
  • Views Views 2,124
  • Replies Replies 6
  • Likes Likes 3

mudrik

Well-Known Member
Newcomer
Joined
Nov 18, 2022
Messages
66
Reaction score
120
Trophies
1
Age
33
XP
699
Country
Turkey
Hi all!
I'm happy to announce that I've added support for hardware-accelerated blit and fillrect operations to libSDL for the Wii and GameCube. I hope that the changes will be accepted into devkitPro's SDL port, but in any case in the meantime you can play with my fork (I'm not allowed to post links to this forum, but just append mardy/SDL to the github homepage and you'll find it).

The README file has step-by-step instructions on how to build the library, so hopefully it's something that you can try easily.

I've tried it on a few games already, and they do work, but they almost made no use of 2D operations (they mostly call SDL_LockSurface() and then handle pixels by hand), so this is not a full test. If you know of Wii games using SDL with many calls to SDL_FillRect or SDL_BlitSurface, please let me know, I will try to test them :-)

Now I'll go back to work on my little game, hopefully you'll get news about it in a couple of months :-)
 
  • Like
Reactions: Disorarara
Thanks!

As for World of Goo, as far as I understand the game is not open source, so I'm afraid there's little we can do about it. I found this nice page of SDL games on the wiibrew wiki (https://wiibrew.org/wiki/Category:Homebrew_using_SDL_libraries -- finally I can post links, too :-) ), and I tried a couple of them. They do work, but all they do is direct pixel manipulation, so using my build of SDL doesn't bring a performance benefit in their case. But if someone knows of an open source Wii SDL game that has low FPS, please let me know, maybe we can do something about it.
 
Hi all!
I'm happy to announce that I've added support for hardware-accelerated blit and fillrect operations to libSDL for the Wii and GameCube. I hope that the changes will be accepted into devkitPro's SDL port, but in any case in the meantime you can play with my fork (I'm not allowed to post links to this forum, but just append mardy/SDL to the github homepage and you'll find it).

The README file has step-by-step instructions on how to build the library, so hopefully it's something that you can try easily.

I've tried it on a few games already, and they do work, but they almost made no use of 2D operations (they mostly call SDL_LockSurface() and then handle pixels by hand), so this is not a full test. If you know of Wii games using SDL with many calls to SDL_FillRect or SDL_BlitSurface, please let me know, I will try to test them :-)

Now I'll go back to work on my little game, hopefully you'll get news about it in a couple of months :-)

Did you actually TEST this?

I have several SDL projects running with the original SDL library and some tweaks.
Yet, I've never managed to get above more than 8bpp for that one.

The / your repository over at GitHub doesn't even show anything on the screen.
I have a nice black screen all the time.
All I can hear is sound and that's it.

The same applies to the ogc-sdl-1.2 branch of "devkitPro".

Yet, it would be good to know which devkitPro release to use to make it work properly because right at this moment it doesn't.
I'm currently porting another game to the Wii where graphics and sound work for the original SDL library as mentioned above but as soon as I use your library code, it just won't.

Thanks in advance.

EDIT: Forget about it - I just got it to work.
 
Last edited by nitr8,
EDIT: Forget about it - I just got it to work.
Nice!

By the way, my changes have not yet been merged upstream, the only reason being that other changes were merged in between and I haven't yet got back to fix the conflict and resubmit it, but it's in my TODO list. :-)
 
Nice!

By the way, my changes have not yet been merged upstream, the only reason being that other changes were merged in between and I haven't yet got back to fix the conflict and resubmit it, but it's in my TODO list. :-)
Question:

Why is in the devkitpro branch "ogc-sdl-1.2" of SDL for the Wii assumed, 8bit == 16bit?

I'm specifically referring to this particular line:

https://github.com/devkitPro/SDL/blob/ogc-sdl-1.2/src/video/ogc/SDL_ogc_video.c#L679

I couldn't make this branch work on my project which makes use of 8bpp only.

Compared to the original SDL port to the Wii, the whole function "flipHWSurface_8_16" is missing (which I previously made use of).
 

Site & Scene News

Popular threads in this forum