KallistiOS / kos-ports

Ported library collection for KallistiOS
Other
57 stars 35 forks source link

Question About SDL2 support #14

Closed bedwardly-down closed 11 months ago

bedwardly-down commented 2 years ago

I’m in a Discord server with one of the core maintainers of SDL, Ryan Gordon, and we were wondering why SDL2 hasn’t been supported yet? I remember years back hacking on Kallistios and seem to recall SDL2 not having an equivalent to a disc reading implementation used but I wanted to verify my findings. If you have any interest in discussing this further, I could link the Discord server and we could try to figure something out with it.

ljsebald commented 2 years ago

Well, essentially nobody's done a port of it yet, so there's no way it can be included here. I'm not sure if anyone has expressed more than a passing interest in doing so, especially considering the bad rap that SDL 1.x had with the Dreamcast (let's just say, the port of SDL 1.x isn't all that great and has some... rather major issues).

I suspect that at least some reason why nobody has done a port has to do with how many SDL programs these days essentially require OpenGL ES or OpenGL 3.x, which there is no way that the Dreamcast's hardware can support in any sort of complete form.

That said, if someone wants to attempt a port, I'd be more than happy to include it in kos-ports once they get it working.

bedwardly-down commented 2 years ago

Thanks for the quick response. I don’t have access to my source anymore but I remember exactly what stopped me when I was hacking on it before: SDL 2 doesn’t support reading audio from a disc. There’d have to be a port of an external library for it added or a custom solution to get it working. I’m interested in trying again now that the repo is a bit more accessible and I’m definitely a better programmer these days.

I can see Opengl definitely being an issue too. I didn’t know the SDL 1 port was bad either

gyrovorbis commented 1 year ago

I was also extremely interested in having SDL2 when I get back to working on my engine code. I love the Haptic API which doesn't even have an equivalent in SDL1 and thought I would just implement that instead of some custom abstraction.

...but I quit pursuing it, because I had heard from someone that SDL2 uses too much memory for DC, which turned me off to pursuing it, but I'm not actually positive if that's the case. @bedwardly-down Do you know? If it's not using too much memory, well... that changes things...

Also I looked at the SDL2 video API, and from what I saw at least, it looked like it would work on fixed function hardware? Take a look at the PSP, who is in a similar position as we are in terms of graphics, and their implementation is just sitting atop something VERY similar to our GLdc. A few others and myself took a look and think the video side is doable.

We actually have working SDL1 and OpenGL interop support int he scene here: https://github.com/ianmicheal/SDL-dreamhal--GLDC, so you can definitely get it working in terms of SDL1 at least.

EDIT: in case there's someone watching this who is interested in getting SDL2 on Dreamcast: we actually now have a 32MB RAM expansion mod which is gaining some popularity within the scene and is supported by us in KallistiOS. I'm using it right now, and it's pretty epic. So that would put us up to what the PSP is working with.

darcagn commented 11 months ago

I'm closing this issue as the question seems to have been answered. Feel free to reply if you need to know more.