I think the overhead of code generation and memory management (the basic block hash table) might outweigh the key dynarec benefit of eliminating the fetch/decode loop, especially with a CPU like the SNES's. You'll also have to keep strict account of timing, which is possible in a dynarec, but could get messy depending on whether or not you can simply do the timing on a per-basic block basis.
I would say you ought to profile first. Premature optimization is often a complete waste of time. You need to know what to optimize first. It may be that the CPU isn't the bottleneck. I'm sure that the solution will ultimately require a healthy dose of assembly language in all major components of the emulator (CPU, graphics, sound, etc.) The SNES CPU is fairly simple and given the MIPS' large register file, you should be able to write a pretty nice CPU core.
Fetch/decode might be a bit messy, as will flags, but you can probably store everything in the registers and minimize memory overhead.
> Homebrew emulation for the PSP is a thriving scene but the problem with most
> systems more complex than an NES is that the emulation is slow. Normally it's a
> direct port from a Linux/Windows open source project to the PSP. Difference
> being how they're built.
> There is definitely some horsepower under the hood of the PSP. Sony has written
> a near perfect emulator of the PS1 that runs at full speed. I'm trying to
> imagine that the SNES should be able to attain full speed as well.
> There may be a couple logical fallacies there as the PS1 is not a SNES and the
> PSP's hardware may be better suited to handle the PS1's architecture. Maybe
> it's just a simulator that does a damn good job of recreating the original PS1
> hardware functionality. Who knows (outside of Sony?)
> Regardless I want to make a faster SNES emulator. I have thought of a number of
> solutions but I have no idea how feasible or realistic they are. Basically it
> would be best to start with an open source project and modify components of it
> to perform better on the native PSP hardware. Forgive my ignorance on the topic
> but indulge me if you would.
> The thoughts in order of no import:
> 1. Dynarec, baby. How hard would it be to take something like ZSNES and put a
> dynarec at its core?
> 2. Inject assembly in key areas. Find areas of commonly executed code and
> speed them up with assembly.
> 3. Ummm, there is no 3.
> Any takers?