i just want to know if there are better methods to implement ddraw interface to the emu. I have a secondary buffer on on board graphics card mem (of course). i mean having it in PC memory is a pain in the performance.
Im using 32 bit per pixel and i have a func like : DDPutPixel(DWORD x, DWORD y, DWORD Color)
What im currently doing is:
1- Lock the surface
3 - I put the pixels while NES is rendering pixels (sl 0 - 239)
4 - Then i unlock and blt the surface to the primary -> go back to 1
One thing to mention is that as screen witdh in NES is 256 this "DDPutPixel()" makes a:
In other words: << 8 to avoid multiplication. That's the only thing i can optimize .
Anyone having a ddraw implementation different from that?
Im using 32 bit per pixel and i have a func like : DDPutPixel(DWORD x, DWORD y, DWORD Color)
What im currently doing is:
1- Lock the surface
3 - I put the pixels while NES is rendering pixels (sl 0 - 239)
4 - Then i unlock and blt the surface to the primary -> go back to 1
One thing to mention is that as screen witdh in NES is 256 this "DDPutPixel()" makes a:
Code:
DDPutPixel(DWORD x, DOWRD y, DWORD Color)
{
*((LPDWORD)lpSurfacePtr + (Y << 8) + X) = Color;
}
{
*((LPDWORD)lpSurfacePtr + (Y << 8) + X) = Color;
}
In other words: << 8 to avoid multiplication. That's the only thing i can optimize .
Anyone having a ddraw implementation different from that?