jtothebell / fake-08

A Pico-8 player/emulator for console homebrew
Other
559 stars 49 forks source link

Add Unix target #184

Closed HTV04 closed 9 months ago

HTV04 commented 1 year ago

Adds build support for Linux (and similar operating systems with SDL2 support like macOS, hence the encompassing "Unix" name).

Let me know if there's anything I should change!

jtothebell commented 1 year ago

I took a quick look at this and it looks very similar to the SDL2 target which should already work on Unix targets (I use it for development on both desktop Linux and MacOS). It looks like the biggest difference was using SDL_GetPrefPath instead of the user's home directory. Is there some other reason this implementation would be preferable to the existing one?

HTV04 commented 1 year ago

In addition to the missing SDL_GetPrefPath, the window initialization appears to be different, and the resolution isn't defined. I based the Unix target script on the one for the Windows target so that they appear and function as similar as possible.

Is SDL2Desktop intended to be what I'm trying to achieve with the Unix target? If so, I could edit this PR to apply these changes to that target instead.

EDIT: Additionally, I think using the path generated by SDL2 is preferable to defaulting to the home directory, since that's where most applications on those platforms store data.

jtothebell commented 1 year ago

the SDL2Desktop, SDL1_2, and windows builds are all intended to be used for development only. Per the readme:

The goal of Fake-08 is to make Pico-8 games playable on platforms that aren't officially supported. As such, I will only be providing builds for platforms that won't run Pico-8 proper (No Windows, Mac, Linux, Raspberry Pi, or web builds)

That being said, anyone comfortable compiling is obviously free to make their own builds for any of those platforms, and using SDL_GetPrefPath sounds like it would be preferred, even if just for development, so if you'd like to modify this PR or make a new one to make that change, that would be fine.

HTV04 commented 1 year ago

Of course, I wasn't intending to make the Unix target one that would be used for release builds, just one that allows compilation for that target in the first place.

I have to say, SDL2Desktop is kind of a misleading name, which one of the reasons why I made this PR in the first place. The name sounds like it's targeting all platforms that have a desktop interface and support window management. Instead SDL2Desktop seems to just be a target for Unix-like platforms, given the filesystem settings.

I could modify the PR to apply the SDL_GetPrefPath change to SDL2Desktop if you'd like, but wouldn't it be a better idea to instead change the name to Unix to make it more clear what the target platform is?

As for the other changes, are they acceptable as well? There were also changes I made to the Makefile, such as generating a lower-case-named target to match the casing of most binaries, and I also had all of the window initialization settings ported from the Windows target. I haven't compiled the SDL2Desktop target, so I'm not sure how exactly the window initialization is different, though. I'll try to when I get the chance.