The NesDev wiki says:
I have a ddraw surface of 256 x 240 pixels where emulated are put and then i blt it to the primary surface (lock->put pixels->unlock->blt). That's is the way im doing it. And im cofused. In a nutshell: i don't know how to make what the wiki says. How to stretch to 292 the x? and then it says "pad" it to 320x240?
Im confused wit the terminology too. I don't know what "pad" is.
Some advice here please...
Code:
For emulator developers
There are two ways to emulate the pixel aspect ratio of the NES: scale before padding and pad before scaling. The NES PPU hardware performs the padding first, adding 24 pixels of border to form a 280x240 pixel picture that can be resized to 320x240, 640x480, or 960x720 square pixels, or to 352x240 or 704x480 if your SDTV output circuit produces non-square pixels at 13.5 MHz. But as a slight optimization, you can scale first (256 * 8/7 = 292) and then pad: stretch the 256x240 pixels to 292x240, 584x480, 876x720, or 1168x960 square pixels or 320x240 or 640x480 non-square pixels. Then you can emulate the overscan by drawing a TV bezel on top of the edges of the emulated picture.
There are two ways to emulate the pixel aspect ratio of the NES: scale before padding and pad before scaling. The NES PPU hardware performs the padding first, adding 24 pixels of border to form a 280x240 pixel picture that can be resized to 320x240, 640x480, or 960x720 square pixels, or to 352x240 or 704x480 if your SDTV output circuit produces non-square pixels at 13.5 MHz. But as a slight optimization, you can scale first (256 * 8/7 = 292) and then pad: stretch the 256x240 pixels to 292x240, 584x480, 876x720, or 1168x960 square pixels or 320x240 or 640x480 non-square pixels. Then you can emulate the overscan by drawing a TV bezel on top of the edges of the emulated picture.
I have a ddraw surface of 256 x 240 pixels where emulated are put and then i blt it to the primary surface (lock->put pixels->unlock->blt). That's is the way im doing it. And im cofused. In a nutshell: i don't know how to make what the wiki says. How to stretch to 292 the x? and then it says "pad" it to 320x240?
Im confused wit the terminology too. I don't know what "pad" is.
Some advice here please...