Author Topic: Help new_dynarec  (Read 12096 times)

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Help new_dynarec
« Reply #30 on: December 22, 2014, 08:14:37 AM »
I posted on the pull request but will post here as well.  I integrated this into mupen64plus-ae for testing but am getting build errors as shown below.

Base version (works): https://github.com/littleguy77/mupen64plus-ae/commits/master
After integration (broken build): https://github.com/littleguy77/mupen64plus-ae/commits/test-bsmiles32-core

Build log:
Code: [Select]
"C:\\android-ndk-r10c\\ndk-build.cmd" -j6 all
[armeabi] Compile arm    : mupen64plus-core <= new_dynarec.c
In file included from jni/./mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c:965:0:
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c: In function 'do_readstub':
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2628:17: error: 'readmemb' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2628:17: note: each undeclared identifier is reported only once for each function it appears in
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2630:17: error: 'readmemh' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2632:17: error: 'readmem' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2634:17: error: 'readmemd' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2635:27: error: 'address' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c: In function 'inline_readstub':
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2702:17: error: 'readmemb' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2704:17: error: 'readmemh' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2706:17: error: 'readmem' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2708:17: error: 'readmemd' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2709:27: error: 'address' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c: In function 'do_writestub':
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2797:17: error: 'writememb' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2799:17: error: 'writememh' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2801:17: error: 'writemem' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2803:17: error: 'writememd' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2804:27: error: 'address' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2808:29: error: 'cpu_byte' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2810:30: error: 'hword' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2812:29: error: 'word' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2814:29: error: 'dword' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c: In function 'inline_writestub':
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2864:17: error: 'writememb' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2866:17: error: 'writememh' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2868:17: error: 'writemem' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2870:17: error: 'writememd' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2871:27: error: 'address' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2875:29: error: 'cpu_byte' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2877:30: error: 'hword' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2879:29: error: 'word' undeclared (first use in this function)
jni/./mupen64plus-core/src/r4300/new_dynarec/assem_arm.c:2881:29: error: 'dword' undeclared (first use in this function)
make.exe: *** [obj/local/armeabi/objs/mupen64plus-core/./mupen64plus-core/src/r4300/new_dynarec/new_dynarec.o] Error 1

Also, this is a non-starter for ARM users:
Code: [Select]
jni/./mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c: In function 'goto_tlb_exception':
jni/./mupen64plus-core/src/r4300/new_dynarec/new_dynarec.c:11162:2: error: #error TODO: goto tlb_exception not implemented
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Gillou68310

  • Developer
  • long
  • *****
  • Posts: 112
    • View Profile
Re: Help new_dynarec
« Reply #31 on: December 22, 2014, 08:44:32 AM »
That's because we are focusing on x86 first (easier to debug  ;))
Integration on ARM will come after we find an acceptable solution on x86.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Help new_dynarec
« Reply #32 on: December 22, 2014, 08:54:43 AM »
Ah, I see, thanks for clarifying.  For some reason I had assumed bsmiles was looking for arm testers right now.  I delete my integration branch to avoid confusion.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline bsmiles32

  • byte
  • *
  • Posts: 15
    • View Profile
Re: Help new_dynarec
« Reply #33 on: December 22, 2014, 01:31:13 PM »
@Gillou
Thanks for your response and code snippet. I'll see what I can do with it.

Notes:
I originally went with C versions of the code for the memory handlers because I thought I could reuse them with both the x86 and ARM backend. But it seems the two backends have some differences that might be better handled with the asm approach for now (+ the fact that with ASM you can fine-control your stack/register usage).

I'm also doing to more work in the core to remove the extra indirection involved by the read* arrays of pointers.

On another note, once we have a working solution for both x86 and ARM, I'd like to clean the commit history some more, in order to have every commit buildable/testable (it is the case for now if we don't enable the new_dynarec, but I think it is highly desirable to have every commit buildable).

Again thansk for the continuous help and feedback.

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: Help new_dynarec
« Reply #34 on: December 27, 2014, 01:22:50 PM »
How's that x86 test apk coming Gillou? :)

Offline bsmiles32

  • byte
  • *
  • Posts: 15
    • View Profile
Re: Help new_dynarec
« Reply #35 on: December 28, 2014, 09:26:58 PM »
@Gillou:  I ported your fix proposal with some modifications.
See updated pull request on github.

On another note, thanks to Santa Claus, I should receive an ARM device soon :)

Offline Gillou68310

  • Developer
  • long
  • *****
  • Posts: 112
    • View Profile
Re: Help new_dynarec
« Reply #36 on: December 30, 2014, 02:42:38 AM »
Quote
@Gillou:  I ported your fix proposal with some modifications.
See updated pull request on github.

Just saw it ;) I will take a closer look at this next week (still on holiday  8)) I also need to check your load_regs_bt fix btw.

Quote
On another note, thanks to Santa Claus, I should receive an ARM device soon

Thanks Santa Claus ;D

I was wondering what tools you're using to debug on linux?

Offline Narann

  • byte
  • *
  • Posts: 18
  • mupen64plus Rice dev
    • View Profile
    • My Blog
Re: Help new_dynarec
« Reply #37 on: January 03, 2015, 08:32:49 PM »
On another note, thanks to Santa Claus, I should receive an ARM device soon :)
Which one which one? :D

Offline bsmiles32

  • byte
  • *
  • Posts: 15
    • View Profile
Re: Help new_dynarec
« Reply #38 on: January 06, 2015, 12:32:57 PM »
Quote
I was wondering what tools you're using to debug on linux?

I use GDB.

Quote
Which one which one?

I got a Motorola Moto G (2nd generation).
I still need to setup dev environment for it. Any easy to follow tutorial on that ?

Quote
I will take a closer look at this next week (still on holiday  8)) I also need to check your load_regs_bt fix btw.

Anything new in this area ?

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Help new_dynarec
« Reply #39 on: January 06, 2015, 01:00:47 PM »
I still need to setup dev environment for it. Any easy to follow tutorial on that ?

I am on Windows but the setup should be the same for Linux for building mupen64plus-ae.

Note that Android Studio (modified Intellij IDEA) recently became the official IDE, but no one here has started using that yet.  We use Eclipse, which was the official IDE up until a few weeks ago.


Install the Android SDK Stand-Alone Tools
    http://developer.android.com/sdk/installing/index.html?pkg=tools
    After installing, use the SDK updater app that comes with it to update

Install the Android NDK
    https://developer.android.com/tools/sdk/ndk/index.html

Install Eclipse (any distro should work).  I'm running the latest version (Luna) but you can probably use earlier versions if you prefer.

Install the Android add-ons for Eclipse
    In Eclipse go to Help -> Install New Software...
    Add the google site https://dl.google.com/eclipse/plugin/4.4 or 4.3 for Kepler, etc.
    Install all elements in the "Developer Tools" category (dependencies install automatically)

Import mupen64plus-ae project into Eclipse
    git clone https://github.com/mupen64plus-ae/mupen64plus-ae.git
    In Eclipse go to File -> Import... -> Existing Android Code Into Workspace
    Select root of your working copy

Add NDK support
    In Eclipse go to Window -> Preferences -> Android -> NDK and specify local path to NDK
    In Eclipse right-click on project, Android Tools -> Add Native Support... (or something like that)
    In the prompt, type "foo", finish
    Delete /jni/foo.cpp from project

Build project as "Android App" in Eclipse.

I might have missed a step or two, so let me know if you get stuck and I'll be glad to help.

« Last Edit: January 06, 2015, 01:02:44 PM by littleguy »
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline bsmiles32

  • byte
  • *
  • Posts: 15
    • View Profile
Re: Help new_dynarec
« Reply #40 on: January 06, 2015, 04:33:44 PM »
@littleguy Thanks a lot for this detailled explanation. I'll give this a try later this week.