Homebrew How do most people do HW acceleration for emulators?

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,131
Country
United States
They utilize hardware components that are quicker than their emulated counterparts usually by interpreting or recompiling instructions. For the 3DS, the acceleration would likely be done with the GPU. I think dynamic recompilation can be considered hardware acceleration, but that's normally not what people mean, they typically mean something running on something more specialized than the main CPU.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
The general idea is to parallelize the computation on the greater number of available processors/HW components.

On 3DS it would be great to use the arm9 for some task (i.e. sound handling and timing like it's for 3DS). But at the moment it's not posible using ctrulib or latest entrypoints.

Another option is to move all the GFX computation on the GPU; there are some libs that helps doing this (like @xerpi sf2dlib) but to have the best performance one should write specilized code for every single need.

The last option could be to move some non graphic computation on the GPU using a relatively recent and experimental way to convert processive computation in parallel computation. This is called GPGPU (General purpouse computing on graphics processing units) which I recently started to study to experiment with it on 3ds. The bad thing is that on other GPU there are some high level languages to do this (a sort of C for GPU) but on 3DS one has to use the shaders asm (without any step by step tutorial available).
 

Spaqin

Well-Known Member
Member
Joined
Feb 17, 2015
Messages
123
Trophies
0
Age
29
XP
199
Country
Poland
I was going to say to nop90 that emulators can't be really parallelized, as manycore code must be written with that in mind from the beginning, and is only applicable when you have lots of the same stuff to calculate. It's worth it only for big amounts of data, where overhead of loading data to and then from vram can be ommited in the long run, and responsivity is not a concern. And emulators need to react fast to always changing data (instructions).
But then I realized that he's an active developer, so he must know what he's doing. I'd be glad if someone corrected me and showed how parallel computing can be used in emulation.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
I was going to say to nop90 that emulators can't be really parallelized, as manycore code must be written with that in mind from the beginning, and is only applicable when you have lots of the same stuff to calculate. It's worth it only for big amounts of data, where overhead of loading data to and then from vram can be ommited in the long run, and responsivity is not a concern. And emulators need to react fast to always changing data (instructions)
...

It's a very experimental area and I'm a only beginner, but i'm reading some papers on the matters and interesting algorithms
are under developements.

On Wii U GPGPU seem promising (only rumors). I don't know if something good can be achived on 3DS, but I'm curious abouth this technology.

At the moment I was only able to load dummy shaders with a template made modifying th GPU examples in the CTRUlib sources, so don't expect anything in the near future.

PS: @Spaqin you are right when you say that multicore code must be written with that in mind. This technology probably can't be useful for porting old emulators, but could help to write a new one from scratch.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Well start walking towards them +1