Chilly Willy wrote:That really isn't simulating a TV very well. To REALLY simulate a TV, you need to take the RGB frame and convert it to YIQ. Low-pass filter the Y channel to 2.5 to 3.5 MHz (depending on how "sharp" you want the simulated TV to be). Then low-pass filter the I and Q channels to 0.5 HMz. Then delay the I/Q channels a few milliseconds. Then convert back to RGB.
I have a lot of experience in hamradio and I can tell where you are wrong.
1. Color schemes in TV standards - this is one luminance signal Y and two color signals R-Y and B-Y. Managing the magnitude of the signal Y, we can change the brightness and contrast, while controlling the extent of the R-Y and B-Y - the color saturation.
2. Color accuracy is half of brightness (on vertical). Since all television standards transmit R-Y signal at every even scanline and signal B-Y at every odd scanline. Then, using delay line at 64mks to combine R-Y and B-Y. Thus, the color accuracy of 2 neighboring lines are added. And given that this is all happening in each raster field, then combine the two fields definition color diluted to 4 lines (familiar, eh?).
3. Luminance signal clipped by frequency. The frequency cutoff depends on a system of color is needed to suppress the load of color and getting rid of "dot net" artefact. For NTSC that would be 3.579MHz or 4.43MHz, and for PAL 4.43MHz.
4. The signals R-Y and B-Y and really cut to 0.5MHz.
5. The delay spread of the signal in the decoder chromaticity offset line delays brightness. It delays the signal by about 0.6 microseconds. It will it affect combining color images and brightness.
So, when you want to emulate true low quality TV, you must do this:
Step 1: Get RGB field and split it to 3 separate fields: Y, R-Y, B-Y.
Step 2: Do some blur in every single scanline of Y field (do not blur between scanlines!).
Step 3: Do reduce the vertical resolution of R-Y and B-Y fields twice.
Step 4: Do some blur (more than for Y field) in every single scanline of R-Y and B-Y fields.
Step 5: Do left shift Y field by 0.5-1.5 pixels (or do right shift for R-Y and B-Y fields). This is optional step.
Step 6: Combine again all 3 fields Y, R-Y, B-Y to one RGB field and show it on screen.
This algorythm not depends on total frame resolution.
For emulate SECAM color space
YDbDr. For emulate PAL or NTSC can be used
YCbCr.
Remember! NES and SegaMD/Genesis do not used even/odd fields for video. They always show full frame in progressive scan. PSX and other powerfull consoles can use interlaced video mode, but you should remember: each frame must be handled separately before deinterlace!