ozzyfreakdude
Still Fresh
- Joined
- Feb 14, 2011
- Messages
- 92
This is a purely conceptual question, as I have no experience coding emulators.
The way I understand it, most emulators use either pure interpretation (in which the entire inner workings, system calls, etc of the system being emulated are directly translated) or dynamic recompilation.
From what I gather, dynamic recompilation (dynarec) is where some/all of the code for the system being emulated is recompiled on the fly from code the native processor architecture (say for the N64/PSX) to code for the architecture of the system emulating it (x86, ARM, etc...), which produces a speed boost. From what I gather, the recompilation on the fly seems like it would take a substantial amount of CPU cycles. But if, even after those CPU cycles are used to recompile, a performance boost still occurs, then that just means that the recompiled code is just that much faster.
Here's what I'm proposing: Provided that my understanding of the recompilation is correct (which it may not be), it seems like one would be able to recompile the code BEFORE launching it, IE, not at runtime. Say, in the case of Mupen (where speed boost is a major issue), you could feed the rom file to the emulator, it could compile it all at once to a rom file which has been recompiled for the ARM architecture (which could then be saved on the SD card for future use), and then that already-recompiled rom could be run directly, thus saving the cpu time spent recompiling the rom. If this was possible, it would theoretically result in a large performance boost.
Like I said, I have no experience coding emulators (or even coding at all in anything other than Java or VB.net), so I don't know if that's even possible. But the inquisitive computer scientist (about to graduate with bachelors in 2 weeks) in me has to at least wonder.
The way I understand it, most emulators use either pure interpretation (in which the entire inner workings, system calls, etc of the system being emulated are directly translated) or dynamic recompilation.
From what I gather, dynamic recompilation (dynarec) is where some/all of the code for the system being emulated is recompiled on the fly from code the native processor architecture (say for the N64/PSX) to code for the architecture of the system emulating it (x86, ARM, etc...), which produces a speed boost. From what I gather, the recompilation on the fly seems like it would take a substantial amount of CPU cycles. But if, even after those CPU cycles are used to recompile, a performance boost still occurs, then that just means that the recompiled code is just that much faster.
Here's what I'm proposing: Provided that my understanding of the recompilation is correct (which it may not be), it seems like one would be able to recompile the code BEFORE launching it, IE, not at runtime. Say, in the case of Mupen (where speed boost is a major issue), you could feed the rom file to the emulator, it could compile it all at once to a rom file which has been recompiled for the ARM architecture (which could then be saved on the SD card for future use), and then that already-recompiled rom could be run directly, thus saving the cpu time spent recompiling the rom. If this was possible, it would theoretically result in a large performance boost.
Like I said, I have no experience coding emulators (or even coding at all in anything other than Java or VB.net), so I don't know if that's even possible. But the inquisitive computer scientist (about to graduate with bachelors in 2 weeks) in me has to at least wonder.