Author Topic: DeSmuME to Android  (Read 26840 times)

Offline jumpertwo

  • bit
  • Posts: 8
    • View Profile
DeSmuME to Android
« on: January 28, 2012, 11:31:30 AM »
hi paul! i've been following you since the beginning of your mupen64plus porting thread on emutalk,let me say that you did a magnificent work with this project and i think you are a very skilled real coder..so maybe your experience can help me through this : current NDS emulator on market lacks a dynamic recompilation and a openGLES renderer,as a port from openGL code; out of curiosity,i was looking at the only (efficent) open source NDS emulator "DeSmuME",particularly at his OGL code (stored in OGLrender.cpp) i don't think there's relatively so much rewrite work to do, something is just call adaptation [es: glClearColor() became glClearColorf() and so on] maybe i'm wrong here, cause i'been trying to research differences between openGL and openGLES, and i wasn't able to find a single document regarding ALL the differeces, just some few informations on the web. for the dynarec i think there's already an ARM ported one (if this is true,there's no assembly port involved), cause there's an ARM version of the emulator for Ubuntu (maybe i'm wrong again,and the one for ARM ubuntu goes for interpreter mode?)
« Last Edit: January 28, 2012, 11:43:17 AM by jumpertwo »
Device: Xperia sk17i
CPU: Qualcomm 1 GHz Scorpion (Snapdragon)
GPU: Adreno 205
RAM: 512 MB
Screen res: 480 ? 320
ROM: stock android 2.3.3 rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3172
  • Developer
    • View Profile
    • PaulsCode.Com
Re: DeSmuME to Android
« Reply #1 on: January 28, 2012, 03:02:12 PM »
I'll take a look at it and see if it has an ARM dynarec or not.  Where is the code?

For porting OpenGL to GLES, maybe the best thing to do is start with a wrapper (it probably won't cover everything, but will make the initial port easier).  Then slowly start "unwrapping" the wrapper.  This is what I'm planning to do with Yabause, but I can't say whether it is the best route to go or not (I've never ported OpenGL code to GLES before, so it will be a learning experience for me as well).
Device: Samsung Galaxy Nexus
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: 3.0.31-g396c4df (Android 4.2 Jelly Bean)

Device: Motorola Droid X
CPU: TI OMAP3630-1000, 1 GHz (single core, ARM Cortex-A8)
GPU: PowerVR SGX530, 200 MHz
RAM: 512 MB
Resolution: 480 x 854
Rom: Verizon 4.5.573.MB810 Gingerbread 2.3.34, rooted

Offline xperia64

  • Developer
  • float
  • *****
  • Posts: 470
    • View Profile
    • My Apps
Re: DeSmuME to Android
« Reply #2 on: January 28, 2012, 05:00:34 PM »
ds is arm based so what this will be doing is emulating an arm processor on an arm processor?

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3172
  • Developer
    • View Profile
    • PaulsCode.Com
Re: DeSmuME to Android
« Reply #3 on: January 28, 2012, 05:08:13 PM »
Well, it has two ARM CPUs, so it would need a dynarec to either map both to a single processor (or each to a separate core for dual-core devices), or oscillate back and forth between one emulated CPU and the other.
Device: Samsung Galaxy Nexus
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: 3.0.31-g396c4df (Android 4.2 Jelly Bean)

Device: Motorola Droid X
CPU: TI OMAP3630-1000, 1 GHz (single core, ARM Cortex-A8)
GPU: PowerVR SGX530, 200 MHz
RAM: 512 MB
Resolution: 480 x 854
Rom: Verizon 4.5.573.MB810 Gingerbread 2.3.34, rooted

Offline jumpertwo

  • bit
  • Posts: 8
    • View Profile
Re: DeSmuME to Android
« Reply #4 on: January 29, 2012, 02:58:11 PM »
here's the last version of DeSmuMe (builds + source)
https://launchpad.net/ubuntu/oneiric/+source/desmume/+builds

i see that there's also a build for ARMhf (hard float port?) and looking at this document http://wiki.debian.org/ArmHardFloatPort#Minimum_CPU_.26_FPU  Qualcomm Scorpion core processor ( es : Xperia 2011 family ) seems to be match the lowest worthwhile CPU implementation (ok i'm just a student,so this is all new for me,maybe i'm misunderstanding all the story lol) anyway i think that the major improvement will came from the GL renderer, cause things like "Yoshi's Island" or homebrew games (2D,less complex environment ?) run at 20/25 fps on 1ghz single core cpu and even 30 fps on dualcore device like sg2
Device: Xperia sk17i
CPU: Qualcomm 1 GHz Scorpion (Snapdragon)
GPU: Adreno 205
RAM: 512 MB
Screen res: 480 ? 320
ROM: stock android 2.3.3 rooted

Offline jumpertwo

  • bit
  • Posts: 8
    • View Profile
Re: DeSmuME to Android
« Reply #5 on: January 29, 2012, 04:29:44 PM »
just to take a look, i have "unpacked" the tiger NDS emulator, and checked libtigernds.so file,
between the code, i found a printf line that sounds familiar to me : "rasterizer rendering at x=%d! oops!" i put this on google..and this is where it came from originally http://desmume.sourcearchive.com/documentation/0.9.4/rasterize_8cpp-source.html (use ctrl+f and search for the line) if this isn't enough i also found this on the same libtiger.so :"DeSmuME cheats file. VERSION %i.%03i Name=%s". i think that the whole tigerNDS emulator project is based on DeSmuME 0.9.4 (pretty old version) without porting the GL renderer.being capable of reaching 20 fps in yoshi's island is like a miracle (maybe because of running ARM instructions on ARM?)
« Last Edit: January 29, 2012, 11:35:33 PM by jumpertwo »
Device: Xperia sk17i
CPU: Qualcomm 1 GHz Scorpion (Snapdragon)
GPU: Adreno 205
RAM: 512 MB
Screen res: 480 ? 320
ROM: stock android 2.3.3 rooted

Offline Messenger

  • bit
  • Posts: 3
    • View Profile
Re: DeSmuME to Android
« Reply #6 on: January 29, 2012, 05:21:33 PM »
Great job finding this. Really hope that someone ports the GL renderer, TigerLab claimed they would do that but they dropped everything when Google started pulling their apps from the market.

Offline Epic_bubble

  • long
  • ***
  • Posts: 235
    • View Profile
Re: DeSmuME to Android
« Reply #7 on: January 29, 2012, 05:30:50 PM »
Yeah they stopped updating all their emulators since the market removal, some of their emulators had some really cool features like thumbnails next to the game from your most recent game save and a built in rom downloader.

You can still get them here http://apps.tigerplay.info/
Device: Xperia play
CPU: Qualcomm 1 GHz Scorpion (Snapdragon)
GPU: Adreno 205
RAM: 512 MB
Screen res: 854 ? 480
ROM: stock android 2.3.4 rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3172
  • Developer
    • View Profile
    • PaulsCode.Com
Re: DeSmuME to Android
« Reply #8 on: January 29, 2012, 05:36:26 PM »
Thanks for the detailed research, jumpertwo.  I'll look into this as a possible side-project if I hit a roadblock on Yabause (I'm waiting to hear back from Guillaume on whether he is tackling the game-loading bug, and what options to add to the CMake files to have it add Ari64's code to the build paths).  If I do take on the project, I will definitely tackle the OpenGL to GLES porting (most Android devices are simply not suitable for any type of software rendering, IMO).  I should have more information on whether or not I'll tackle this as a side project in a couple weeks or so.

As for ROM downloaders, that's probably the best way to get pulled from the Market, haha.  Clearly illegal (although convenient)
Device: Samsung Galaxy Nexus
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: 3.0.31-g396c4df (Android 4.2 Jelly Bean)

Device: Motorola Droid X
CPU: TI OMAP3630-1000, 1 GHz (single core, ARM Cortex-A8)
GPU: PowerVR SGX530, 200 MHz
RAM: 512 MB
Resolution: 480 x 854
Rom: Verizon 4.5.573.MB810 Gingerbread 2.3.34, rooted

Offline jumpertwo

  • bit
  • Posts: 8
    • View Profile
Re: DeSmuME to Android
« Reply #9 on: January 30, 2012, 10:14:04 AM »
glad to hear that paul! i'll wait for your decision to tackle or not the project, i'm sure you could definitely do it, in the meantime i will "try" (just experimenting lol it's only for learning purpose) to port the renderer and messing with the last source code even if i think this is already over my capacity,so don't expect nothing,i will never be able to release not even a single file lol (<- this is a message for gamers people),this is my first attemp to android,and i'm not very familiar with java (we use C/C++ at university) anyway for me even this stage is fun and a good experience,i'm learning a lot of things regarding emulation and android architecture (activity and view.activity thing) i wish i could talk with more experienced coders like you
« Last Edit: January 30, 2012, 10:22:12 AM by jumpertwo »
Device: Xperia sk17i
CPU: Qualcomm 1 GHz Scorpion (Snapdragon)
GPU: Adreno 205
RAM: 512 MB
Screen res: 480 ? 320
ROM: stock android 2.3.3 rooted

Offline androidian

  • byte
  • *
  • Posts: 14
    • View Profile
Re: DeSmuME to Android
« Reply #10 on: February 01, 2012, 02:04:56 PM »
Glad to heard this!Maybe in future my low end phone can run this on armv6 proccesor(or even emulated easier than armv7 because nds runs on armv3 based processors)
By the way there is a ds emulator on android working on my galaxy 5 armv6 processor:http://digiex.net/downloads/download-center-2-0/consoles-homebrew/8041-android-tigernds-nintendo-ds-emulator-android-download.html very slow unplayable,but works ;) only tried yoshi island runs on 6-10 fps i think.If there will be fast emulator  working on my phone i will buy it  :)
« Last Edit: February 01, 2012, 08:33:32 PM by androidian »

Offline Messenger

  • bit
  • Posts: 3
    • View Profile
Re: DeSmuME to Android
« Reply #11 on: February 01, 2012, 09:52:47 PM »
It isn't really fully ported at all. It is just a bad modified code of DeSmuMe.
I believe that TigerLabs just took NDS4DROID and just changed a couple of small things.

Offline xperia64

  • Developer
  • float
  • *****
  • Posts: 470
    • View Profile
    • My Apps
Re: DeSmuME to Android
« Reply #12 on: February 01, 2012, 11:25:10 PM »
I don't think they are actually the same. Some games like animal crossing work better with tiger nds than nds4droid while wario ware touched works great on nds4droid but wont boot on tiger nds

Offline xperia64

  • Developer
  • float
  • *****
  • Posts: 470
    • View Profile
    • My Apps
Re: DeSmuME to Android
« Reply #13 on: February 16, 2012, 12:00:27 AM »
Oh and if this project ever starts, I recommend using either 0.9.6 or 0.9.5 of the code. 0.9.7 has a few problems loading certain games that the previous versions do not.

Offline Messenger

  • bit
  • Posts: 3
    • View Profile
Re: DeSmuME to Android
« Reply #14 on: February 25, 2012, 09:59:02 PM »
I really hope Paul works on this. The DS is a dead system now. DS had its run.
PSP running DS games. http://youtu.be/Fie-9E4PnyE
« Last Edit: February 29, 2012, 02:12:53 PM by Messenger »