Welcome to Emulationworld

Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Speeding up emulation Reply to this message
Posted byBart T.
Posted on11/26/07 11:05 PM



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?
>
> pixel-eight.com
>


-
Entire Thread
Subject  Posted byPosted On
*Speeding up emulation  Snowball 211/26/07 08:52 PM
..Re: Speeding up emulation  Bart T.11/26/07 11:05 PM
..*Re: Speeding up emulation  Snowball 211/27/07 08:45 PM
...*Re: Speeding up emulation  Bart T.11/28/07 01:25 PM
....*I'll have to look around for an IDE  Snowball 211/28/07 08:42 PM
.....*Re: I'll have to look around for an IDE  Dracula-X11/30/07 06:56 PM
......*Yeah, finding this out as I go  Snowball 211/30/07 11:33 PM
.......*Re: Yeah, finding this out as I go  Dracula-X12/01/07 04:43 PM