Dingoonity.org

GCW Zero => Development => Topic started by: gameblabla on January 20, 2016, 07:17:48 am

Title: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on January 20, 2016, 07:17:48 am
Hello guys,
i have ported something that might be of your interest...
This port is the work of 2 years... nah just kidding, i ported it in 1 day.

It is a proof of concept so it is not running very fast. (Pokemon Black 2 is running at around 2-5 FPS)

You can download the opk here (https://github.com/gameblabla/desmume-gcw0/raw/master/desmume.opk)
Github repo (https://github.com/gameblabla/desmume-gcw0)

Of course, without a JIT for MIPS and a OpenGLES renderer,
this will never run fullspeed on GCW0 so don't get your hopes too high.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 20, 2016, 04:41:42 pm
Congrats on getting it to work. Could you use the N64 port JIT?

Or is that impossible?
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zear on January 20, 2016, 05:50:03 pm
Congrats on getting it to work. Could you use the N64 port JIT?

Or is that impossible?
They're two different architectures, so on that fact alone it's impossible.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Quickman on January 20, 2016, 07:09:18 pm
 Incredible! Thank you @gameblabla  !
 Would love to play some new super Mario Bros! maybe one day, right? Really cool to see the GCW0 push the limits! :)
Thanks again
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on January 20, 2016, 09:57:44 pm
Worked a bit on this,
i have changed the default controls accordingly so now you are able to play your games. (albeit slowly)
I changed the color depth to 16 and enabled the frameskip and set it to 3.

Download Link is the same so you only have to download it again to have the latest version.

Would love to play some new super Mario Bros! maybe one day, right?
You can already ;)
I don't know well this game works though... but i doubt it runs much faster than Pokemon Black 2.

Quote
Congrats on getting it to work. Could you use the N64 port JIT?
Like zear said, this is not how it works.
Nobody in the world except Nebuleon are programming JITs for MIPS and i don't know how to do that.
As for the OpenGL core... i don't have the skills nor the patience to switch it to OpenGLES.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 20, 2016, 11:58:38 pm
Mario Kart runs at about 3 FPS :) when a race finally starts, it isn't too bad. If we could get it up to 15 FPS, it might be considered playable :D
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: RupeeClock on January 21, 2016, 01:32:33 am
That's a pretty neat proof of concept.
Seems like things emulate accurately, albeit slowly. It's slow whether you're trying anything 2D or 3D.

Heck it'll be nice to play some games which may only need one screen.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Albert on January 21, 2016, 07:00:14 am
So I posited this idea in a conversation with Nebuleon, and I'll repeat it here:

How about for emulation of both screens, have it so that the top screen is shown when the GCW is in it's upright orientation. And to switch to the second stylus screen, you would flip the GCW upside down to trigger the gyroscopic sensor to initiate a "stylus" mode that makes use of the joystick and/or DPAD in conjunction with a button to act as the "stylus touch" on the screen.

I haven't tried this emulator out yet, myself. But as soon as I made this idea up, I felt I had to share it here.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on January 21, 2016, 10:40:20 am
So I posited this idea in a conversation with Nebuleon, and I'll repeat it here:
How about for emulation of both screens, have it so that the top screen is shown when the GCW is in it's upright orientation. And to switch to the second stylus screen, you would flip the GCW upside down to trigger the gyroscopic sensor to initiate a "stylus" mode that makes use of the joystick and/or DPAD in conjunction with a button to act as the "stylus touch" on the screen.
I haven't tried this emulator out yet, myself. But as soon as I made this idea up, I felt I had to share it here.
That's not a bad idea, this could work well, thanks for the suggestion.
I will try to implement it as soon as desmume on gcw0 gets faster (which might not happen), i'll try to implement it.

It would have been better if there was something like glshim for GCW0 but i guess it's better to just do a proper OpenGL -> OpenGLES port.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: David Knight on January 21, 2016, 11:44:25 am
It would have been better if there was something like glshim for GCW0 but i guess it's better to just do a proper OpenGL -> OpenGLES port.

There's an old video of glshim working on the gcw0 but I've never seen any release or source code.

https://www.youtube.com/watch?v=wZJLspou69E
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: pcercuei on January 21, 2016, 12:07:03 pm
I tried to build glshim, to integrate it into OpenDingux, but it has build dependencies on X11. I don't know how it was built with our toolchain in the first place.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Aeter on January 21, 2016, 03:42:15 pm
Has anyone tested text heavy, low graphics games like Ace Attorney series, Hotel Dusk, 999, etc.?
Would be great if we could just get these games working decently. 
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 21, 2016, 03:52:28 pm
Has anyone tested text heavy, low graphics games like Ace Attorney series, Hotel Dusk, 999, etc.?
Would be great if we could just get these games working decently.

The emulator itself is slow, the games at this point don't matter :) although getting the Ace Attorney series to work would be great
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 21, 2016, 03:59:04 pm
@gameblabla would it be possible for you to do a quick port of the VirtualJag emulator?

Here: https://icculus.org/virtualjaguar/

I don't know how easy it would be to port, but it uses SDL and the Atari Jaguar is pretty much a 16-bit system :)
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Beerman1138 on January 21, 2016, 07:26:34 pm
I don't know how easy it would be to port, but it uses SDL and the Atari Jaguar is pretty much a 16-bit system :)

WHAT?!?!?!?!

http://www.cyberroach.com/jaguarcd/pics/true0203.jpg

DO THE MATH!

 ;D

Sorry, had to say/post that.  Carry on. 
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 21, 2016, 07:35:39 pm
I don't know how easy it would be to port, but it uses SDL and the Atari Jaguar is pretty much a 16-bit system :)

WHAT?!?!?!?!

http://www.cyberroach.com/jaguarcd/pics/true0203.jpg

DO THE MATH!

 ;D

Sorry, had to say/post that.  Carry on.
Tempest 2000 seemed to have been the only game to actually take advantage of the "64 bit" capabilities.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on January 21, 2016, 08:41:44 pm
I don't know how easy it would be to port, but it uses SDL and the Atari Jaguar is pretty much a 16-bit system :)
WHAT?!?!?!?!
http://www.cyberroach.com/jaguarcd/pics/true0203.jpg
DO THE MATH!
 ;D
Sorry, had to say/post that.  Carry on.
He's not that wrong :
The main cpu of the Atari Jaguar is the Motorola 68000, which is 16-bits.
Lots of expensive parts that the main cpu cannot take advantage of.
That and many reasons is why the Jaguar has the worst hardware design i have ever seen.
(The Sega Saturn is pretty close though)

In fact, the 32X is able to push much more polygons than the Jaguar.
I think it was 30,000 polygons per 60 frames versus 15,000.
In my opinion, it would have been better if they just released the Panther instead.

Anyways, Virtual Jaguar requires an OpenGL compliant card and has dependencies to Qt.
(the SDL version is old, deprecated and ran no games properly as far as i know)

ptitseb ported it to the Pandora (using glshim) and it was not really running fullspeed.

So no Virtual Jaguar port for now, i'm focusing on Desmume right now.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 21, 2016, 08:55:05 pm
I don't know how easy it would be to port, but it uses SDL and the Atari Jaguar is pretty much a 16-bit system :)
WHAT?!?!?!?!
http://www.cyberroach.com/jaguarcd/pics/true0203.jpg
DO THE MATH!
 ;D
Sorry, had to say/post that.  Carry on.
He's not that wrong :
The main cpu of the Atari Jaguar is the Motorola 68000, which is 16-bits.
Lots of expensive parts that the main cpu cannot take advantage of.
That and many reasons is why the Jaguar has the worst hardware design i have ever seen.
(The Sega Saturn is pretty close though)

In fact, the 32X is able to push much more polygons than the Jaguar.
I think it was 30,000 polygons per 60 frames versus 15,000.
In my opinion, it would have been better if they just released the Panther instead.

Anyways, Virtual Jaguar requires an OpenGL compliant card and has dependencies to Qt.
(the SDL version is old, deprecated and ran no games properly as far as i know)

ptitseb ported it to the Pandora (using glshim) and it was not really running fullspeed.

So no Virtual Jaguar port for now, i'm focusing on Desmume right now.

Okay, thanks :)
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on January 22, 2016, 09:00:04 pm
So i have switched the 2D OpenGL core to OpenGLES.
It works but it's just as slow as the libSDL software renderer...

Using a profiler, it seems like most of the cpu time is taken by the interpreter.
Anyone wants to improve the interpreter ?
Or at least loosen its accuracy ?
LOL

The Desmume authors said numerous time to people they have no focus on performence so
i won't even bother asking them for help or even advice...

Seems like it's a dead-end.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: zhongtiao1 on January 23, 2016, 01:18:38 am
So i have switched the 2D OpenGL core to OpenGLES.
It works but it's just as slow as the libSDL software renderer...

Using a profiler, it seems like most of the cpu time is taken by the interpreter.
Anyone wants to improve the interpreter ?
Or at least loosen its accuracy ?
LOL

The Desmume authors said numerous time to people they have no focus on performence so
i won't even bother asking them for help or even advice...

Seems like it's a dead-end.
Darn :(

Now maybe we could get a port of ppsspp? ;) LOL
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Quickman on January 23, 2016, 01:42:11 am
@gameblabla
Awwww :(
Oh well, thanks for all your work! I was psyched on this possibility!!
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: care16la20 on January 26, 2016, 12:56:42 pm


Hi
Thanks for all the efforts. One thing that I think it would be cool and possible to add is the option to rotate 90* , because the graphic novels such as Phoenix Wright are more or less playable already, but with small letters of the dialogs...

Best regards,
Carlos
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 01, 2016, 07:52:51 pm
@gameblabla  Man! You port some really cool stuff! Is there still any chance of development in this emulator?! This would be really great to keep pushing forward and see the light of day!

Thanks for your work dude!!

Edit: the Ds Mario kart & new super Mario are so fun!
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Aeter on July 02, 2016, 04:46:40 am
@gameblabla  Man! You port some really cool stuff! Is there still any chance of development in this emulator?! This would be really great to keep pushing forward and see the light of day!

Thanks for your work dude!!

Edit: the Ds Mario kart looks so fun!
Meh snes version is best imho.
And if you like mario kart, try wacky wheels, now that's some old school stuff that is still cool to this day.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 03, 2016, 01:10:23 am
@gameblabla  there's some really good potential here! I just tried both new super Mario Brothers and Mario kart? Both are very slow but looked incredible on the GCW zero's screen.
  Is it possible there will be any further development in this emulator?!? Or should I not get my hopes up?

Thanks again for the port regardless

@Aeter I'll check out WW👍
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Aeter on July 03, 2016, 01:31:48 am
@gameblabla  there's some really good potential here! I just tried both new super Mario Brothers and Mario kart? Both are very slow but looked incredible on the GCW zero's screen.
  Is it possible there will be any further development in this emulator?!? Or should I not get my hopes up?

Thanks again for the port regardless

@Aeter I'll check out WW👍
I think proof of concept is as far as this goes and should go. Most effort to make this better will not result in any playable games I think.
There's also the gba emulator btw. Gba has a great mario kart game as well. I have the original for both DS and GBA both are a blast to play.
Other awesome racing game that might work well on gcw0 is CTR aka Crash Team Racing for PSX. It's basically mario kart equivalent for the Playstation with Crash Bandicoot as the main hero of course.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 03, 2016, 02:04:50 am
haha  come on man!😂 I'm trying to get information from the man whom ported this emulator... While your opinions are appreciated, It's obvious that I'm trying to seek specific information from @gameblabla 😁😁😁

 Also, I've tried getting crash team racing to run for the PSX multiple times/different roms? If you check, I left information about my results in the PSX thread😀

Edit: CRT supposedly works now. 👍
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Nebuleon on July 03, 2016, 02:23:39 am
haha  come on man!😂 I'm trying to get information from the man whom ported this emulator... While your opinions are appreciated, It's obvious that I'm trying to seek specific information from @gameblabla 😁😁😁
This is the most polite way I've ever seen someone on a forum say "buzz off, I didn't want your opinion". I like it.

But gameblabla already stated that you shouldn't get your hopes up too high because there's a lot of work to be done, and you don't appear to be asking anything more specific than "will it be faster?".

Think about Mupen64plus -- but you also have the added bonus of needing to emulate 2 screens with 1, and 1 touchscreen with none. I can see why this is still a proof of concept.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Quickman on July 03, 2016, 02:24:53 am
 Tried out/tested both of those games too.  Really does look incredible on the zero!  Would also love to see further development
@gameblabla were you saying that you would need to build a new version of this for the zero (JIT) if it were to be further optimized?.. and if so, is that out of your job description/abilities?

You're the best thanks!
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 03, 2016, 03:41:48 am
 Thank you @Nebuleon for the breakdown. I am absolutely trying to be positive and polite on this forum. Words can get misconstrued so easily.   So I usually try hard to remain diplomatic and careful with my words.
  It's unfortunate that my posts came off sounding like "will it be faster?", When in actuality what I'm really trying to ask is:  Is this project still being personally pursued by @gameblabla whatsoever? ..because I, amongst a few other people, are very interested.
 Also,  you have to understand the frustration of telling a developer how excited or interested you are in their work only to have someone else chime in and state things like, "Proof of concept is as far as it should go"...  To me one negative response is easier perceived as disinterest from the majority, rather when the actual majority are saying, "hey this is cool! You should pursue this and see it further! Either way, thank you!!"

 Also, this was not meant to be offensive to @Aeter in any way. I just hope this post better explains where I was coming from. Also, I will check out your recommendations, thank you!

I'm sorry for any drama caused.

EDIT:
Also, I said "also" a LOT.


Details:
 -Mario kart surprisingly ran a bit faster than new super Mario Brothers.
-The double screens were not an issue with the gameplay  on these two games whatsoever.
- It looked really good on the LCD of the zero. Very close to the size of two Game Boy micro's screens stacked on top of each other inside of the zero's bezel.

Thanks for your port👍
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Nebuleon on July 03, 2016, 04:22:01 am
Right, what I meant was more "I can see that the effort required is too large for the project to currently be anything more than a proof of concept".

It's a lot of effort to raise the speed enough while not breaking the emulated execution environment (aka game compatibility). A just-in-time compiler (JIT) needs to be made for this part, which turns the ARM code of Nintendo DS games into MIPS code for the GCW Zero to run without constantly needing to consult translation tables. Because the DS runs an ARM7 processor, which is also present in the GBA, some of the code could be taken from ReGBA... but it would need to be hooked into the new memory map of the DS, and Desmume's way of doing things.

Secondly, because the DS has two processors, an emulator must synchronise two chips, running some of the ARM7 code, then the ARM9, then the ARM7, then the ARM9, etc. Those processor switches are expensive because they must save the first processor's state, restore the second's and determine where to go after each switch.

After those are done, you then get into issues with rendering the screens; because there is a 3D renderer, the part of the emulator that deals with the GPU must be optimised. And, because the 2D graphics modes are much more plentiful and complex than on the GBA, there is much more code to select and perform the correct renderer for each graphics mode, sprite size, background tile size, rotation etc. than ReGBA. All of that makes emulation yet slower.

And then, finally, you can get into the 2-screen to 1-screen mapping, and the touchscreen emulation with no touchscreen on the GCW.

I'm not saying that this should stay a proof-of-concept forever. If gameblabla has done any work on Desmume past the version in the Original Post, you can be certain that I will appreciate it. I'm merely saying that I won't blame gameblabla if he has started to do work but finds that it's insufficient -or- he has hit roadblocks and the last public version stays a proof-of-concept. The demands placed on the GCW to emulate a Nintendo DS are simply very great; a JIT compiler takes lots of knowledge, design effort and time to make, and won't guarantee that any game runs fast enough; and if you get past those hurdles, then input and output are going to suck.

ReGBA takes 35%-55% of the GCW Zero's 1 GHz CPU to emulate a 16 MHz ARM7 processor. The Nintendo DS has a 33 MHz ARM7 and a 66 MHz ARM9. As the Atari Jaguar ad (http://www.cyberroach.com/jaguarcd/pics/true0203.jpg) said, Do The Math! :)
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Aeter on July 03, 2016, 11:47:12 am
Well all I was saying really is that it wouldn't be very realistic or fair to ask for more development on this as it won't be very rewarding.
The GCW0 is just not the device for DS emulation.
Even if the speed and all would be faster I still think all the effort put wouldn't weigh up to the final result.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 03, 2016, 07:50:20 pm
@Nebuleon  thank you for the vast technical write-up. You are wise beyond your words, friend.  And I always love details.

@Aeter  I respect your opinion, but I hope you can understand that what I am trying to do is reconnect with and receive information/opinions solely & directly from the original poster.  No harm intended.

To @gameblabla
 - I left information on the games tested w/DesMume at the end of my last post. Thank you for reading🍕
 -And thank you so much for the port.

Also, As Neb stated... If this were never to make it past "proof of concept", I completely understand. I was only engaging to say thank you and show interest with the others whom also show interest. Your work is very much appreciated!
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Aeter on July 03, 2016, 07:58:33 pm
I understand that you want to hear it straight from the horse's mouth, but just don't get your hopes up.
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: gameblabla on July 04, 2016, 06:05:39 am
@Mar8 I hate to break your dreams but basically, what Nebuleon said is mostly true.
In no case should you expect fullspeed DS emulation on the GCW0.

The thing that kills this project is the fact that Desmume has recompilers for ARM and x86/amd64 but not for
MIPS, which is the architecture the GCW0 is currently using.
I'm pretty sure it is possible to reach speeds like Xdesmume but without someone dedicated to write such a JIT,
it will not run very fast. (let alone fullspeed)

Nebuleon said that the DS has 2 ARM processors.
That's true but i don't think a lot of DS games is using the ARM7 processor so perhaps that could be stripped out.
I could be wrong though, i need to test this further.

There is no guarantee that i will work more on it though,
i was just interested to see if emulating DS games on the Zero was possible.
It also doesn't help that the Desmume authors are not interested to speed up their emulator for low-end devices...
Title: Re: Desmume for GCW0 - Proof of Concept
Post by: Mar8 on July 05, 2016, 05:59:21 pm
@gameblabla  thanks for the detailed reply. Yes, as Neb had stated? I did not expect this to be, nor was I asking if it would ever be full speed/or when it would be full speed. I was more so just curious to see if you were still working on it, or thought about pursuing it again whatsoever.  Thank you so much for all of your work! It looks gorgeous on the GCW zero's LCD though I must say. Thanks again!