sdl-wii icon indicating copy to clipboard operation
sdl-wii copied to clipboard

Bugfix for SDL_GetTicks() with new libogc version.

Open retro100 opened this issue 3 years ago • 2 comments

SDL_GetTicks() doesn't start with zero if the current libogc version is used. But it should. The API docs of SDL_GetTicks() says: "Returns an unsigned 32-bit value representing the number of milliseconds since the SDL library initialized."

The problem is that the behaviour of the libogc function gettime() changed in a newer (current) version of libogc (I don't know at which libogc version this happend). The old libogc Version returns a timestamp relative to the starting point wenn the app was started. The current libogc version returns a very high value. Maybe the absolute time (system time)??? but definitely not the time since the app is started. But sdl-wii rely on the old behaviour. The bugfix is very easy. The bugfix also works for old libogc versions. If SDL_GetTicks() doesn't start at zero the 32bit value is not enough.

retro100 avatar May 02 '21 19:05 retro100

I know this is tedious, but the bugfix should also be supplied to ogc-sdl1.2 branch on devkitpro repo (https://github.com/devkitPro/SDL/blob/ogc-sdl1.2/src/timer/ogc/SDL_systimer.c) This way the wii-sdl and gamecube-sdl packages can profit from this and get updated as well. Thanks!

carstene1ns avatar May 02 '21 20:05 carstene1ns

I know this is tedious, but the bugfix should also be supplied to ogc-sdl1.2 branch on devkitpro repo (https://github.com/devkitPro/SDL/blob/ogc-sdl1.2/src/timer/ogc/SDL_systimer.c) This way the wii-sdl and gamecube-sdl packages can profit from this and get updated as well. Thanks!

Hi! Can you please clarify, which SDL library it's recommended to use? This or the one in the devkitpro repository?

Are there any practical differences between the two? I had a quick look at the code, and it seems to me that neither of the libraries do any 2D acceleration on blit operations.

mardy avatar Sep 24 '23 10:09 mardy