Hi all,
As said above, I'm looking for better "putpixel" routines than mine, if any. This is how I actually handle graphics in my emu.
1.- DDraw is initialized using this class: http://geocities.com/muchaserres/DDraw.cpp.txt
2.- When a frame starts, I call: Nes->DDraw->LockBuffer().
3.- When a scanline starts, I do: Buffer = ( unsigned char* )Nes->DDraw->DDraw.bpBuffer + ( Scln * Nes->DDraw->DDraw.iPitch ).
4.- When "putting" a pixel, I do: memcpy( Nes->Buffer + ClockTicks * Nes->DDraw->DDraw.bPixelWidth, &RGBPal[ Color ], Nes->DDraw->DDraw.bPixelWidth ).
5.- And finally, when the full frame has been drawn, I do: Nes->DDraw->UnlockBuffer(); Nes->DDraw->Draw().
I'm fearing this is a slow scheme, but I'm not too sure.. Well, any possible improvements?
Lotsa thanks.
As said above, I'm looking for better "putpixel" routines than mine, if any. This is how I actually handle graphics in my emu.
1.- DDraw is initialized using this class: http://geocities.com/muchaserres/DDraw.cpp.txt
2.- When a frame starts, I call: Nes->DDraw->LockBuffer().
3.- When a scanline starts, I do: Buffer = ( unsigned char* )Nes->DDraw->DDraw.bpBuffer + ( Scln * Nes->DDraw->DDraw.iPitch ).
4.- When "putting" a pixel, I do: memcpy( Nes->Buffer + ClockTicks * Nes->DDraw->DDraw.bPixelWidth, &RGBPal[ Color ], Nes->DDraw->DDraw.bPixelWidth ).
5.- And finally, when the full frame has been drawn, I do: Nes->DDraw->UnlockBuffer(); Nes->DDraw->Draw().
I'm fearing this is a slow scheme, but I'm not too sure.. Well, any possible improvements?
Lotsa thanks.