Views: 6,860,416 Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 04-19-24 05:56 PM
Guest:

0 users reading Original Xbox port and JIT | 1 bot

Main - Development - Original Xbox port and JIT Hide post layouts | New reply


hcf
Posted on 10-01-20 02:55 PM Link | #2499
Hi, and thank you very much for your work in this emulator!

I'm part of the original Xbox scene coders, and we would love to make a port of melonDS for this console. We are aware that performance will be different in each game, and many of them will not run at full speed (as an example, we have a port of Desmume and it runs well in many 2D games like Zoo Keeper, but it is really slow in many 3D games likke Diddy Kong Racing DS).

I am writing here because we have studied a bit the source code, and understood that you are not supporting any 32 bits build. The original Xbox has an Intel processor of 32 bits (the same that in some old PCs). We think that a lot of your code could be compiled indeed for 32 bits without any change, but we are worried about the dynamic recompiler, as it seems to be made with the 64bit architecture in mind.

Do you think that you could point us to any advice to have this JIT for a 32bit machine? (maybe there is a version of this recompiler for 32 bits that you don't merged in this project... or maybe adapting the 64bit recompiler to 32 bits could be done...). Of course, we know that we could simply avoid JIT, but being the Xbox a limited machine, JIT is really mandatory if we want to have a decent performance.

Besides, if you could give us any other information that you know, related to obstacles that we would face in our adventure to port melonDS to a 32bit machine, it would be very useful.
Thank you very much!

HCF

Arisotura
Posted on 10-01-20 03:01 PM Link | #2500
most of melonDS will run fine on a 32bit machine, although some parts that use 64bit integers might have worse performance. but as long as the Xbox is a little-endian machine, melonDS should work fine on it, atleast as far as the interpreter and software renderer go.

the JIT will be problematic indeed, you will need a 32bit x86 JIT.

the OpenGL renderer is built for modern OpenGL (3.2 or more recent), which I don't think the Xbox GPU supports. so if you want hardware acceleration, you'll need a new renderer tailored to the Xbox GPU. you can use the software renderer, but without a way to run it on a separate processor, it's going to slow things down. desktop melonDS has that 'threaded software renderer' setting but it's only worth using on multicore CPUs, which the Xbox doesn't have.

____________________
Kuribo64

hcf
Posted on 10-01-20 04:45 PM Link | #2511
Thank you very much for the quick answer! It's very good to confirm that the main part of the code will work.

As far as the JIT is related... it is what we thought and our main concern :(

I guess that converting your 64bit dynamic recompiler into that 32bit x86 one, is not an easy task, right? I'm not sure if there is anyone in our team who is able to create a recompiler from scratch. And running the emulator in interpreter mode will be slow for sure.

We already saw the OpenGL renderer, but we saw this as a secondary task. In a first stage we were thinking about using the software renderer. The port of Desmume is also using the software renderer, because in fact we did the huge effort to convert it to Direct3D 8 (supported by Xbox) but the emulator performed the same and with more artifacts... So in this project, converting the OpenGL code to Direct3D will be done, but not with high priority. Unless melonDS is taking more advantage of the hardware than Desmume!

Thank you very much again for your work and your help. By the way, you seem to know the Xbox architecture very well! You are right, multithreaded solutions are not useful for us, as our processor only has one core :D




Generic aka RSDuck
Posted on 10-01-20 05:11 PM Link | #2513
in theory most of the code could be reused between the 64 bit and a potiental 32 bit x86 JIT. We use the code emitter from Dolphin, they dropped 32-bit support a long time ago, though ppsspp uses it too and it still supports 32-bit so maybe you could take it from there.

Speaking as the developer of the Switch port, though tbh I doubt you will get that far. The Switch's processor is not only from the raw numbers superior and it's ISA is more similar to the DS's so the recompiler which doesn't do any crazy optimisations outputs better code. And still it took some additional GPU2D optimisations to get 2D games to fullspeed. Games which use 3D graphics are even with the threaded renderer not fullspeed with the current software renderer (though I plan on writing a more optimised one which makes use of arm neon simd instructions which hopefully changes this).

____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon

Sorer
(post deleted) #2514

hcf
Posted on 10-02-20 09:39 AM Link | #2518
Posted by Generic aka RSDuck
in theory most of the code could be reused between the 64 bit and a potiental 32 bit x86 JIT. We use the code emitter from Dolphin, they dropped 32-bit support a long time ago, though ppsspp uses it too and it still supports 32-bit so maybe you could take it from there.


I didn't know that you used the same code than PPSSPP and Dolphin! In that case, maybe we could try to use the JIT of PPSSPP, and hopefully it may work.


Posted by Generic aka RSDuck
Speaking as the developer of the Switch port, though tbh I doubt you will get that far. The Switch's processor is not only from the raw numbers superior and it's ISA is more similar to the DS's so the recompiler which doesn't do any crazy optimisations outputs better code. And still it took some additional GPU2D optimisations to get 2D games to fullspeed. Games which use 3D graphics are even with the threaded renderer not fullspeed with the current software renderer (though I plan on writing a more optimised one which makes use of arm neon simd instructions which hopefully changes this).


Thank you very much for sharing your experience. It is very useful to know that! If the Switch can't do it, I'm afraid that the original Xbox would have a very hard time trying to emulate it at a decent speed. I still have a bit of hope though; I don't know the reason, but the Xbox processor performs surprisingly well if we look at raw numbers. For example, the port of Desmume works faster in the Xbox than in the Wii, and both machines have a 733 MHz processor (and we did no special optimization in this port, other than using frameskip that I guess that every port also uses). Maybe endian magic? Although in this case, we are comparing consoles with a difference of 2 generations, and obviously the old black box is not even in the same league than the Switch... :(

Thank you very much!

Generic aka RSDuck
Posted on 10-02-20 03:34 PM Link | #2520
Posted by hcf
I didn't know that you used the same code than PPSSPP and Dolphin! In that case, maybe we could try to use the JIT of PPSSPP, and hopefully it may work.

I'm only talking about the code emitter, which is basically the piece of code we use to generate x64 or aarch64 code. The code which does the actual ARM->target architecture is ours.

____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon

hcf
Posted on 10-05-20 03:35 PM Link | #2547
Posted by Generic aka RSDuck
I'm only talking about the code emitter, which is basically the piece of code we use to generate x64 or aarch64 code. The code which does the actual ARM->target architecture is ours.


I understand. Thanks for clarifying and for your help :)


Main - Development - Original Xbox port and JIT Hide post layouts | New reply

Page rendered in 0.043 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 92/92, time: 0.019 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.