Author Topic: Porting FBA to Linux (Win|OSX) with Qt  (Read 25867 times)

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Porting FBA to Linux (Win|OSX) with Qt
« on: April 23, 2014, 11:26:17 PM »
I started working on porting FBA to linux using one GUI code across multiple oses with Qt support. By now I only have emulation of video (no inputs or sound), for this I'll use SDL backends for portability. But at moment I'm focusing on reconstruct FBA GUI... the code is still at early stage.


This is a little demo:
https://www.youtube.com/watch?v=HmPCH08HpkE

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #1 on: April 24, 2014, 05:15:57 AM »
Very nice work - I would be interested in this being applied to the main source tree when you ready if you are interested.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

kev

  • Guest
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #2 on: April 24, 2014, 07:33:54 AM »
That's very cool. I'd also be interested in seeing this in the main tree, i'd also help out building it if I had any time.

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #3 on: April 24, 2014, 02:03:49 PM »
That would be great, but there's a lot of work to be done yet.

My source tree is here:
https://bitbucket.org/zxmarcos/fba-qt

Rom scanning and reporting errors on load implemented...


Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #4 on: April 24, 2014, 02:11:40 PM »
Wow! Looks great!


Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #5 on: April 24, 2014, 07:20:57 PM »
It looks very nice. Keep up the good work. :)
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #6 on: April 30, 2014, 01:52:44 AM »
I'm trying to get sound but even with SDL backend it doesn't work.. :(
I don't understand how nAudNextSound, nAudSegCount, nAudSegLen and nAudAllocSegLen work together. That's very confusing...
And what is the fps magic? I didn't see any code related to that...
:S

kev

  • Guest
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #7 on: April 30, 2014, 07:00:42 AM »
FYI, I am not sure that SDL audio driver was ever fully tested.

As for the FPS stuff, that will be to make it frameskip and/or run without sound depending on which bit you mean.

Is there an easy way to get this building on OSX? I could take a quick look if so.


Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #8 on: April 30, 2014, 01:14:27 PM »
Well, the source tree is here:
https://bitbucket.org/zxmarcos/fba-qt/src

To compile you'll need QtSDK (http://qt-project.org/downloads).
Dependencies are: SDL, libz and libpng.

EDIT:
I've got sound running (very buggy :)) with my QtMultimedia backend :)
https://www.youtube.com/watch?v=K19kbLuX0iA
« Last Edit: April 30, 2014, 04:57:27 PM by Romhack »

kev

  • Guest
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #9 on: April 30, 2014, 07:12:56 PM »
I have it building and running on OSX. I had to make a few patches as it seems that clang is a bit harsher on certain bits of code when it comes to casting and type sizes than MSVC and GCC. Also there were a few things I had to do with regards to OpenGL as some of the headers are named slightly differently. Also, I had to change the build to include the version of libpng thats in the FBA sources.

I may now be able to help :)

And good work with the sound. In fact good work with the whole Qt thing :)

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #10 on: May 02, 2014, 04:35:34 PM »
Looks nice! However that is the first version of code :D
I fixed sound backend using multithreaded code. The sound and fps are okay, however CPS-3 sound is not good, it seems to be playing slowly :S
https://www.youtube.com/watch?v=zua6x3C54_0

All changes are committed to bitbucket.

EDIT:
Title Screens :)
« Last Edit: May 02, 2014, 08:28:39 PM by Romhack »

Offline Hiko

  • Newbies
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #11 on: May 03, 2014, 08:49:54 AM »
I have it building and running on OSX. I had to make a few patches as it seems that clang is a bit harsher on certain bits of code when it comes to casting and type sizes than MSVC and GCC. Also there were a few things I had to do with regards to OpenGL as some of the headers are named slightly differently. Also, I had to change the build to include the version of libpng thats in the FBA sources.

I may now be able to help :)

And good work with the sound. In fact good work with the whole Qt thing :)

This is awesome! Is it possible to update the source code with your patch? Mac has been waiting for FBA for years!

kev

  • Guest
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #12 on: May 04, 2014, 10:01:14 AM »
This is awesome! Is it possible to update the source code with your patch? Mac has been waiting for FBA for years!

Yeah, I can probably work on a pull request for Romhack. I just need to work out how to make the Qt creator project have some mac specific lines and get his latest code. there are also a few things that stop it being really usable with regards to rom loading. it seems that Qt on the mac likes to have a different path setup for accessing outside of the application package than Linux. Still, it is possible to run most of the games with a bit of messing around. I may spend some time on this later today if I get chance.

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #13 on: May 04, 2014, 04:10:38 PM »
Yeah, I can probably work on a pull request for Romhack. I just need to work out how to make the Qt creator project have some mac specific lines and get his latest code. there are also a few things that stop it being really usable with regards to rom loading. it seems that Qt on the mac likes to have a different path setup for accessing outside of the application package than Linux. Still, it is possible to run most of the games with a bit of messing around. I may spend some time on this later today if I get chance.
You can use Q_OS_MAC macro.
Or use platform scopes in project file: http://qt-project.org/doc/qt-5/qmake-language.html#platform-scope-values

EDIT:
Inputs are working (keyboard only).  I would use SDL but it requires a visible window (created with SDL_SetVideoMode) :p The good news is that joysticks don't need that.
https://www.youtube.com/watch?v=QTg1R0RGS-8
« Last Edit: May 05, 2014, 11:27:42 PM by Romhack »

Offline Hiko

  • Newbies
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Porting FBA to Linux (Win|OSX) with Qt
« Reply #14 on: May 05, 2014, 08:53:56 PM »
Yeah, I can probably work on a pull request for Romhack. I just need to work out how to make the Qt creator project have some mac specific lines and get his latest code. there are also a few things that stop it being really usable with regards to rom loading. it seems that Qt on the mac likes to have a different path setup for accessing outside of the application package than Linux. Still, it is possible to run most of the games with a bit of messing around. I may spend some time on this later today if I get chance.
Well, maybe compile Qt by yourself or use homebrew to install Qt would be easier to solve the PATH problem, install the binary from the official site may cause some issues.

BTW, I don't know which version of Qt is for this port, 4.8.x or 5.2.1?