Author Topic: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch  (Read 10283 times)

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
[HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« on: September 26, 2012, 06:57:32 PM »
Ok, as a total Android noob I took a few wrong turns getting the source to build on Windows.  Hope some people find this helpful.  Keep in mind these instructions were made on 9/26/2012 and may get out of date eventually.

  • Download and install the Android SDK.
  • After installation, run (install location)\SDK Manager.exe as administrator and install platform-tools, usb driver, etc. just as described on Android dev website.
  • Run (install location)\AVD Manager.exe if you want to set up any device emulators, again following Android website.
  • Download the Android NDK and unzip it to a path with no spaces in the name (I used C:\android-ndk-r8b\).  Don't worry about GNU make or any of the other stuff the Android website discusses; we'll take care of all that next.
  • Download and install Cygwin.  Just leave the default settings for all the install prompts (next, next, next, ..., finish) and don't worry about installing extra packages.  Be sure it installs to a path with no spaces in the name (I used C:\cygwin\).
  • In Windows 7, open Control Panel->System and Security->System and click on Advanced system settings on the left column.  If you're using another Windows version, try to find the location where path variables are defined.
  • In the window that pops up, click the Advanced tab, then the Environment Variables... button at the bottom.
  • Go to System variables, select "Path", click the Edit... button, then append "C:\cygwin;C:\cygwin\bin;" (without quotes) to the string. Then press OK, OK.
  • Install Eclipse by unzipping it somewhere, e.g. C:\Program Files (x86)\.  I couldn't get the 64-bit version to run on my Win7-64 machine, but the 32-bit version was fine.
  • Install the ADT Plugin for Eclipse, including the Native Android Development Tools component.  Don't worry about installing Sequoyah like it says in the Mupen64Plus-ae readme.
  • In Eclipse, go to Window->Preferences->Android and be sure the path to the Android SDK is correct.  Then go to the NDK subitem and be sure the path to the NDK is correct as well.
  • Download or Git->Clone the Mupen64Plus-AE source code to your machine, again to a path no spaces in the name.
  • In Eclipse, go to File->Import... and select Existing Android Code Into Workspace.  Leave the default settings and finish.  You should not see any red messages in the console.
  • Right-click the mupen64plus-ae project and go to the Android Tools submenu.  Click the Fix Project Properties item.
  • In the same context menu, you should not see an option to add native library support.  If you do, you might have missed a step above.
  • In Eclipse, click Project->Clean... and just select the mupen64plus-ae project and continue.  Eclipse will now re-build the native portion of the project, which will take 5 or 10 minutes the first time.  You shouldn't see any error messages.
  • If you've made it this far, you're on the home stretch.  Plug in your phone/tablet or start an emulator, then in Eclipse click Run->Run.  Select "Android Application" if it prompts you.  Eclipse will build the remainder of the project and upload it to your device/emulator, which might take up to a minute the first time.
  • On your device/emulator try opening a game ROM to be sure the native library built correctly. If you have any run-time problems, go back to Eclipse and click Run->Debug and watch the LogCat for diagnostic messages.

And I think that's it!  Let me know if I missed a step... I'm going off memory.
« Last Edit: October 22, 2016, 06:32:51 PM by Paul »
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #1 on: September 26, 2012, 08:02:15 PM »
Awesome, thanks!  I stickied this so its easy to find.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline jacklebott

  • bit
  • Posts: 7
  • Scruffy... The janitor.
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #2 on: September 27, 2012, 12:34:08 AM »
Thanks a ton for making a guide! Though, I get stuck on step 10 with:
"Cannot complete the install because one or more required items could not be found.
  Software being installed: Android Native Development Tools 20.0.3.v201208082019-427395 (com.android.ide.eclipse.ndk.feature.group 20.0.3.v201208082019-427395)"
Any idea why this happens?

Nevermind, I tried a different version of Eclipse and it worked this time.
Well, I've tried reinstalling and doing everything all over again maybe 5 times now, and it keeps running into errors on step 17. Guess I'll just wait until normal builds are up and running again
« Last Edit: September 27, 2012, 01:48:01 AM by jacklebott »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #3 on: September 27, 2012, 04:24:49 PM »
For the first problem, it may have been google's dev servers.  I think they were down for maintenance or something because I had a heck of a time downloading the SDK components for a while (step 2).  When they came back online, everything installed fine.

What error messages are you getting in step 17?  What do you mean by "normal builds"?

BTW I installed the most up-to-date versions of everything, including Eclipse Juno.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #4 on: September 27, 2012, 04:36:52 PM »
The Sequoyah Android Native Support plug-in has some powerful debugging capabilities and a custom development perspective that is pretty nice.  That said, I didn't realize the ADT has native development tools in it now, so you'd probably only want to try Sequoyah if you are going to be doing a lot of work and debugging on the native components.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #5 on: September 27, 2012, 05:12:20 PM »
Yeah I figured that was the case re: Sequoyah.  I didn't want to muck around in the native code.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline jacklebott

  • bit
  • Posts: 7
  • Scruffy... The janitor.
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #6 on: September 27, 2012, 07:59:11 PM »
The error on step 17 was something about the code or something. I don't remember what it said exactly, but it was a very generic error. By "normal builds" I mean once it gets back to being officially updated. It's too confusing trying to compile it myself :P

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #7 on: September 28, 2012, 08:33:43 AM »
By "normal builds" I mean once it gets back to being officially updated.

A little off-topic, but I'm working to get the next official 1.10 build ready.  There are a few key points that I want to address with this version before I begin posting the release candidates for testing:

1) Fix the save-state/ load-state code, which has been broken by the core improvements lioncash added from the official repository.  The changes need to be integrated with Ari64's dynarec to prevent a crash, loss of audio, or freeze of the emulator on load-state.

2) Fix a dependency on Honeycomb caused by the new AlertFragment class that lioncash wrote to improve the code and reduce compiler warnings.  I'm not sure if the app will currently crash on devices pre-Honeycomb (since I don't currently have a device with Gingerbread to test on), but the dialogs will definitely not work as it is now (things like the credits, cheats info, etc).

3) Finish re-styling all the menus so they aren't a weird hybrid of the default Android preference style that lioncash introduced to improve the GUI, and the old GUI style that I wrote originally.  Everything should match the sections that lioncash updated.

4) Implement the Xperia Play controls the new way for Xperia Play users running Ice Cream Sandwich (to fix the unresponsive Action Bar).

5) Update the button mapping section to interface with the new axis input that littleguy wrote.

There are probably a few other small things I left out of there, but I think those are the main ones.  I'm doing a little work on the code when I have a couple free minutes here and there, but I'm having to use my netbook which is pretty slow.  Might be a while before all these things are finished.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline jacklebott

  • bit
  • Posts: 7
  • Scruffy... The janitor.
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #8 on: September 28, 2012, 03:43:50 PM »
Cool, that's great news! I'll be rooting for you :)

Offline massuod

  • bit
  • Posts: 1
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #9 on: March 15, 2014, 08:31:53 AM »
hi, thanks for this tutorial.
i compile the project, but i could not build it for Android 2.3.3 .
i choose the Android 2.3.3 API level 10 in the Project Build Target, but some features and codes has error.
how i do for build it to android 2.3.3 ?

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: [HowTo] Setup Windows to build Mupen64Plus-AE - from scratch
« Reply #10 on: March 15, 2014, 08:43:22 AM »
You should always use the highest build target possible since the app uses the latest API methods.  It will still run on Android 2.3.3 even if you specify a higher build target.  We are currently using a build target of 19.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version