Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Can I port RetroArch to Native Client  (Read 2022 times)

0 Members and 1 Guest are viewing this topic.

aishwarya

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:July 11, 2018, 12:03:45 pm
  • I want to build my own arcade controls!
Can I port RetroArch to Native Client
« on: July 10, 2018, 01:17:39 am »
hello,
I've been cutting my teeth on another coding project, and figured that the best thing that I could try is to port RetroArch all in one Emulator into Native Client, so that it could very well be a packaged app with cloud saves entirely within a browser. Look up the project on Github since I don't have enough links.

The way RetroArch is built on linux is to run a configure script, then make, then sudo make install. Altering the configure agent to select the Native Client compilers, I was able to get a couple seconds into the build when this happened,

http://pastebin.com/0WtrY6aU

using this custom Makefile here.

http://pastebin.com/iv6RmQVr

I figure it's gonna be a long hard road building and debugging this puppy, but where do you recommend I get started?

Osirus23

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 849
  • Last login:August 23, 2021, 01:33:52 pm
Re: Can I port RetroArch to Native Client
« Reply #1 on: July 10, 2018, 12:42:11 pm »
Have you asked over on the Libretro forums? They've been pretty helpful in the past when I've gone about compiling Retro Arch customizations.

georgebelly

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:September 05, 2018, 12:16:49 pm
  • I want to build my own arcade controls!
Re: Can I port RetroArch to Native Client
« Reply #2 on: September 05, 2018, 12:17:07 pm »
You're starting from a good place, you've just hit your first compile error.

Here it is:

In file included from settings.c:23:
input/input_common.h:73: error: redefinition of typedef ‘rarch_joypad_driver_t’
driver.h:327: note: previous declaration of ‘rarch_joypad_driver_t’ was here
Here is an excerpt from input_common.h:

typedef struct rarch_joypad_driver
{
   ...
} rarch_joypad_driver_t;
Here is an excerpt from driver.h:

typedef struct rarch_joypad_driver rarch_joypad_driver_t;
Just as the error says, the typedef is being redefined. I ran a test using gcc 4.6.3 from Ubuntu 12.04:

typedef struct foo { int bar; } foo_t;
typedef struct foo foo_t;
int main() { return 0; }
This compiles and links fine. The same code compiled with x86_64-nacl-gcc (which is using gcc 4.4.3), gives the following error:

typedef.c:2: error: redefinition of typedef ‘foo_t’
typedef.c:1: note: previous declaration of ‘foo_t’ was here
It seems that this error has been relaxed in more recent versions of gcc. I did some searching and found this stackoverflow link: Why "Redefinition of typedef" error with GCC 4.3 but not GCC 4.6?.

It's worth noting that x86_64-nacl-g++ will compile this code unmodified. Here are two things to try:

Compile with CC using x86_64-nacl-g++ instead of x86_64-nacl-gcc
ifdef out the definition in driver.h, and replace the other use in that file with struct rarch_joypad_driver.
For #2, you can use the following: showbox

#ifndef __native_client__
...
#endif
Good luck, there likely will be more compile failures to fix. :)

Haze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1296
  • Last login:October 04, 2023, 08:30:02 am
  • I want to build my own arcade controls!
    • MAME Development Blog
Re: Can I port RetroArch to Native Client
« Reply #3 on: September 05, 2018, 01:04:24 pm »
Calling Retroarch an emulator is a disservice to those actually developing emulators.

It's a frontend that requires specifically hacked emulators (in the form of 'libretro cores') to work with it.

They're emulating nothing, and using every cheap trick in the book they can to win popularity.

This annoys me because I've had people containing me saying they donated money to RA related projects thinking it would improve MAME when the actual emulator devs see nothing at all of what goes there, only the people hacking up cores, often in ways that can't be backported to the original projects because they're quick fix hacks.