[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NTSC Emulation
On 2011-01-23 23:48:07 -0500, mdj said:
On Jan 24, 1:26�pm, Sheldon Simms <wsspa...@gmail.com> wrote:
The real code is kind of hard to follow because I use fixed point
math and combine and simplify expressions for performance
reasons, but it generally goes like this:
Curious. What's the performance difference between fixed point and
floating point versions ?
Not too much, the fixed point is maybe 5-10% faster.
I wonder if you've considered translating the code to Core Image ? 50%
of one core (I have a slightly faster though similar Mac to you) would
probably see me turning the feature off most of the time to save
battery life.
50% is maximum load, not typical. The main reason it consumes so
much CPU is that the display routine is ideally called after every
emulated instruction. You can save CPU at the cost a loss of emulation
accuracy by calling it less often.
As for the Mac-specific stuff, the last time I was halfway knowledgeable
about Mac programming was back in the System 7 days, so the current
stuff is all new to me. I currently create an offscreen bitmap that is
matched up to the layout of display memory and manipulate the
pixels in that offscreen bitmap directly. I then copy the updated
part of the offscreen bitmap to the window at 60Hz. It's pretty quick
that way.
I read some Mac developer forums looking for ideas and a common
suggestion for things like this was to use OpenGL where you basically
manipulate a texture in RAM and get hardware accelerated application
of the texture to video memory. That seems fairly promising.