Author Topic: Yabause On Android OS?  (Read 102970 times)

Ari64

  • Administrator
  • Newbie
  • *****
  • Posts: 21
    • View Profile
Re: Yabause On Android OS?
« Reply #30 on: January 31, 2012, 01:04:58 AM »
Try compiling without thumb.

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #31 on: January 31, 2012, 01:59:31 AM »
Thanks, I forgot about that.  I added "LOCAL_ARM_MODE := arm" to yabause/src/android/jni/Android.mk.in (both modules, just in case):

Code: [Select]
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := yabause
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := yui.c
LOCAL_STATIC_LIBRARIES := yabause-prebuilt
LOCAL_LDLIBS := -llog -ljnigraphics
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := yabause-prebuilt
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := libyabause.a
LOCAL_EXPORT_C_INCLUDES := @YABAUSE_INCLUDE_DIR@
include $(PREBUILT_STATIC_LIBRARY)


The output verifies that it is building the yui.c in ARM mode, but still getting the same error message:

Code: [Select]
Linking C static library libyabause.a
[ 75%] Built target yabause
Scanning dependencies of target yabause-android
[ 75%] Generating res/values/strings.xml
[ 75%] Generating jni/yui.c
[ 75%] Generating AndroidManifest.xml
[ 75%] Generating project.properties
[ 75%] Generating local.properties
Updated local.properties
No project name specified, using Activity name 'Yabause'.
If you wish to change it, edit the first line of build.xml.
Added file /home/paul/workspace/yabause-android/build/src/android/build.xml
Added file /home/paul/workspace/yabause-android/build/src/android/proguard.cfg
[ 75%] Generating jni/libyabause.a
[ 75%] Generating libs/armeabi/libyabause.so
Compile arm    : yabause <= yui.c
Prebuilt       : libyabause.a <= jni/
SharedLibrary  : libyabause.so
/home/paul/bin/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libyabause.a(linkage_arm.s.o): relocation R_ARM_MOVW_ABS_NC against `decilinestop_p' can not be used when making a shared object; recompile with -fPIC
./obj/local/armeabi/libyabause.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [obj/local/armeabi/libyabause.so] Error 1
make[2]: *** [src/android/libs/armeabi/libyabause.so] Error 2
make[1]: *** [src/android/CMakeFiles/yabause-android.dir/all] Error 2
make: *** [all] Error 2

Thanks for the help, BTW.  Any other ideas I could try?

Trev186

  • Scoobies
  • Newbie
  • *****
  • Posts: 37
    • View Profile
Re: Yabause On Android OS?
« Reply #32 on: February 03, 2012, 05:08:44 AM »
Any luck getting the dynarec running ?

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #33 on: February 03, 2012, 06:07:43 PM »
No, sorry.  Still stuck on that build error.

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #34 on: February 08, 2012, 12:16:23 AM »
I've done a little googling to try and understand what that error message is saying.  What I've read is that MOVT/MOVW relocations are absolute and cant be used in PIC code.  I assume this is why yabause is compiled as a static library.  What the message seems to be saying is that a shared library can not depend on a static library if that static library uses MOVW relocations.  If that's the case, it would seem to indicate that the dynarec can only be used in a completely static context (i.e. compiled into an executable).  Is this interpretation accurate, or am I missing something?

Ari64

  • Administrator
  • Newbie
  • *****
  • Posts: 21
    • View Profile
Re: Yabause On Android OS?
« Reply #35 on: February 08, 2012, 08:08:41 AM »
Ahh.. Yabause is compiled as a static library because there's no reason to make it a dynamic library for normal linux distros.  The ARMv7 movw/movt is used because it's generally more efficient than a load which may cause a cache miss, though for this very small amount of code it probably doesn't make much difference.  These instructions will need to be changed if the dynamic linker can't handle this.  The Debian folks were complaining about lack of ARMv5 support, so I guess it wiil need to be changed anyway...

Ari64

  • Administrator
  • Newbie
  • *****
  • Posts: 21
    • View Profile
Re: Yabause On Android OS?
« Reply #36 on: February 13, 2012, 10:29:58 PM »
Try r2821 from svn, and see if that works for you.  I replaced the movw/movt instructions.

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #37 on: February 14, 2012, 12:57:21 AM »
It compiles without the error and runs  ;D.  Awesome work, thanks!

Trev186

  • Scoobies
  • Newbie
  • *****
  • Posts: 37
    • View Profile
Re: Yabause On Android OS?
« Reply #38 on: February 14, 2012, 01:26:46 AM »
It compiles without the error and runs  ;D.  Awesome work, thanks!

What sort of speed u getting?

Any betas soon ??? :)

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #39 on: February 14, 2012, 02:19:23 AM »
Speed is about 2-3 FPS in the CD deck screen, running on my Droid X.  Neither of the games I have work though (I get the "invalid opcode" error I mentioned earlier).  I'll need to purchase some Saturn games that don't have audio tracks, so I can rip as .iso instead of .cue/ .bin.

Anyone have suggestions for good, compatible games to use for testing during development, that don't have CD audio tracks?

For now, I can work on just getting the CD deck screen running well (going to look into porting the render to GLES2, and hooking the audio up to SLES).

Trev186, next I'll add in a very basic GUI for selecting bios and CD image, so you can test your library of games to see if any of them can get past the invalid opcode error.  Give me a couple days (I'll be busy tomorrow studying for a quiz).

Ari64

  • Administrator
  • Newbie
  • *****
  • Posts: 21
    • View Profile
Re: Yabause On Android OS?
« Reply #40 on: February 14, 2012, 12:38:52 PM »
Anyone have suggestions for good, compatible games to use for testing during development, that don't have CD audio tracks?

Try Bubble Bobble, Shining Wisdom or Legend of Oasis.
« Last Edit: February 14, 2012, 12:46:54 PM by Ari64 »

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #41 on: February 14, 2012, 10:04:49 PM »
Anyone have suggestions for good, compatible games to use for testing during development, that don't have CD audio tracks?

Try Bubble Bobble, Shining Wisdom or Legend of Oasis.

Thanks, I'll get those.
« Last Edit: February 15, 2012, 12:46:17 AM by paulscode »

paulscode

  • Scoobies
  • Newbie
  • *****
  • Posts: 34
    • View Profile
Re: Yabause On Android OS?
« Reply #42 on: February 15, 2012, 08:52:09 PM »
Here is the test build.  For now I'll be working on it as a separate branch, so I can rearrange the source-code into a form I'm more used to working with.  Once I have something useful (and tested) to contribute, I'll post patches for consideration to add to the official project.

Test APK   (source code)

Trev186

  • Scoobies
  • Newbie
  • *****
  • Posts: 37
    • View Profile
Re: Yabause On Android OS?
« Reply #43 on: February 16, 2012, 04:52:58 PM »
Most games don't have speed problems...there are a lot of graphics glitches but they seem to be running at a decent fps

Albert odyssey loads up with no graphics glitches and runs at or near full speed :)

Encouraging cause it looks like with some more work this can be full speed on android devices in the near future

Thanks paul and guilhaume for your work on this

And ari64 :)

Ari64

  • Administrator
  • Newbie
  • *****
  • Posts: 21
    • View Profile
Re: Yabause On Android OS?
« Reply #44 on: February 21, 2012, 11:11:24 PM »
In r2834, I added ifdefs for HAVE_ARMv6 and HAVE_ARMv7, which enable instructions for these processors.  You'll need to make sure both of these are defined if you want a build optimized for ARMv7 (which you probably do).