ocornut / meka

MEKA - Sega 8-bit emulator with debugging/hacking tools
http://www.smspower.org/meka
302 stars 49 forks source link

SDL Port? #25

Open MikeDX opened 8 years ago

MikeDX commented 8 years ago

Have there been any discussions to a potential SDL port? I am not quite familiar with all the inner workings of MEKA yet (although I was an avid user back in the early 00s when I was in "the scene"), so I don't know what MEKA relies on in terms of the Allegro libs.

Whilst I like Allegro - it was my lib of choice for years, SDL is much more widely supported on many platforms, the most exciting of which being html/javascript, so we could see MEKA running in a browser, and I think that would be pretty awesome. I've got quite a bit of experience in that, so that's something I could assist with.

I'll take a look at the code whilst waiting for a reply

maxim-zhao commented 8 years ago

I had a brief look some time ago and it's going to be quite painful, Meka relies on Allegro functionality beyond rendering video and audio, for example config and resource loading and drawing primitives. The imgui port may well reduce some of this, though.

ocornut commented 8 years ago

I think we should aim for that. Allegro is a crumbling mess. Part of my plan was to replace the gui with a skinned ImGui which would have the advantage of getting rid of pretty much every Allegro draw primitives everywhere in the code for tools/ui. From there the entirely of rendering would be quite portable.

We don't use Allegro for config, we don't even use it for "data/package" file anymore, the files are standalone png, etc. stb_image.h can load them very well. It would be quite easy after the GUI is replaced.

If you want to help that'd be great :)

MikeDX commented 8 years ago

I wonder if we could start by including SDL (1 or 2, doesn't really matter which) just to render the display buffer, and the gradually move over the inputs and audio calls. There doesn't seem to be an "easy" way to change over all in one go as everything is a bit tangled in with the allegro defines and routines.

ARoxdale commented 3 years ago

We could try moving all the allegro calls behind a quasi-platform interface. That might make it easier to eventually crate alternative ports. Allegro calls are fairly scattered throughout the code, but as an initial step they could be moved behind an API layer, so they are all in one place.

ocornut commented 3 years ago

My plan what to rewrite the UI and most of the rendering using Dear ImGui, make it look fairly similar and then 90% of the Allegro calls will be done and UI will be easier to work with and improve. From there it'll be very easier to switch to something like SDL.