Mednaffe frontend GUI for Mednafen

A couple of days ago, I managed to successfully build the Mednafen emulator from Haikuports, which now gives me emulation of a few systems in Haiku! (The below screenshot is of Ys Book I & II running in the PC Engine emulator of Mednafen)

However, it looks like Mednaffe, a frontend GUI for Mednafen, isn’t available for Haiku, and probably for good reason.

The GUI depends on GTK3, so I’m curious to know how difficult, or how easy, it would be to adapt Mednaffe to the Haiku GUI. One the one hand, it would make the emulator more easy to use for most users, but on the other hand, I know there’s going to be quite a bit of work to be done to get it working.

1 Like

We’ve had GTK3 for a few months now, so why not try building it?

2 Likes

It compiles and runs great! I just need to find the mednefen source to use with it. I don’t see anything other than the libretro mednafen cores in the depot.

6 Likes

I built the non-libretro Mednefen through Haikuports.

$ haikuports --get-dependencies mednafen

Of course, you need to set up and configure Haikuports first: https://github.com/haikuports/haikuporter

1 Like

does the mednafen port not work on the x86_64 edition of haiku? I get a message that says that it is skipping it due to it being untested on the target architecture.

That’s strange. It built without complaint on my setup, and I’m running the x86_64 build of Haiku (hrev56217 at the time of this post).

Mednaffe built without issue! Fonts are a little weird but it’s fully working! It even picked up on Mednafen right away and I was able to launch games!

This was built on the x86_64 version of Haiku; hrev56217 nightly. It should build on 32-bit Haiku as well if anyone wants to test.

Changing the font used will make it look a little nicer, but I wonder what is needed to make a recipe for this in Haikuports?

(EDIT) Spoke too soon; Mednaffe throws tons of warnings and errors in the terminal when launched; here’s a clipping of those warnings and errors; it’s… a long list!

4 Likes

See in your haikuports.conf file if the line is uncommented:

# --------------
# ALLOW_UNTESTED:
#     Allow build of untested recipes. '?x86' for example
ALLOW_UNTESTED="yes"
1 Like

You could start with one of the generic recipes provided with haikuporter (if you cloned in your home directory you should find them in ~/haikuporter/generic)

Insert the recipe as ~/haikuports/games-emulation/mednaffe/mednaffe-0.9.2.recipe and change the needed steps in there.

In case you need some help please let us know. :slight_smile:

PS, looking into bumping mednafen to 1.29.0 atm, seems the patches are upstreamed, so you could just duplicate the one in the haikuports tree, rename to mednafen-1.29.0.recipe and adjust the checksum provided by haikuporter when you first launch it (and remove the line for the patchset) :slight_smile:

EDIT latest mednaffen needs patching again … (32bit)

Joystick.cpp:503:23: error: call of overloaded 'MDFN_log2(unsigned int)' is ambiguous
  503 |     index += MDFN_log2(old_index & 0xF);
      |              ~~~~~~~~~^~~~~~~~~~~~~~~~~

Mednafen 1.29.0 builds ok for 64bit (needs libFLAC in REQUIRES)
Menaffe builds ok on 64bit with mednafen:

Created a first draft, anyone wanting to take a tackle on writing a recipe for it, I’m around to guide you through it. :slight_smile:

3 Likes

Yeah buddy! That was the trick.

2 Likes

This is actually a general problem with the GTK port itself. I think I found a way to fix this in the X11 compatibility layer directly rather than by patching GTK but I didn’t implement it yet.

These are all related to the GTK port and are mostly harmless. Most GTK applications print stuff like this to the terminal output, so don’t worry about it too much.

3 Likes

Latest mednafen 1.29.0 has been merged and can be installed for 64bit Haiku, 32bit is still broken as mentioned earlier in this thread. One down to build your self if you want to build Mednaffe :wink:

2 Likes

I’m willing to help test and coddle the recipe into something usable! :smile:

2 Likes

The idea would be that someone here would try to tackle a new recipe, I could create one and push it, but maybe it’s time we see some new faces at haikuports. :wink:
I could push what I have now, but that doesn’t help anyone trying to create a recipe :slight_smile:

OK, think I have most things covered for Mednaffe, even found a rom to check it out, Icon added isn’t complete (missing the M in there, svg icon was the one provided in the source).
If no one steps up I can push it into haikuports tree. :slight_smile:

6 Likes

My work for it has been pushed to one of my branches here: mednaffe, new recipe · Begasus/haikuports@b7bc0ef · GitHub

Think it should be ok as it is but you could check it out, I did a patch for both mednafen and mednaffe so mednafen stores it’s settings in ~/config/settings/mednafen instead of ~/.mednafen, mednaffe now also looks for it’s presence there. :slight_smile:

EDIT Pushed the recipe to haikuports, Mednaffe can be installed on 64bit now through pkgman or HaikuDepot, works mostly fine, just a few crashes here when closing (but that could also be bogus archives) :slight_smile:

3 Likes

Been testing the Mednaffe application built through Haikuports. Unfortunately, there are some issues on my setup (running hrev56253):

  • When I go to launch anything through Mednaffe, Mednafen launches for about a split second and closes immediately,
  • Mednaffe shows rendering issues after Mednafen closes (e.g. clicking the menus leaves black spaces everywhere,
  • Mednaffe refuses to close clean and crashes instead.

Meanwhile, the build of Mednaffe I rolled from source works well still, and aside from crashing upon closing, launches Mednafen just fine.

Can confirm the issues, only tested a few games, one didn’t launch a graphic dispay, others launched ok though :frowning:

I tested with two PC Engine games and one PlayStation game; none launched.

Mednafen is working as I can launch it from the terminal.

1 Like