NTSC Artifacts

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
uze6666
Site Admin
Posts: 4814
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: NTSC Artifacts

Post by uze6666 »

The pixels are written by default between 1440 cycles. And the pixel amount drawn on screen is cut in half. So this means that the resulting image is 720 pixels wide.
Should the image really be more like 596x448? Which means that it should draw only 82.8% of the columns? Don't kill me if this is a stupid question, I'm trying to understand why the resolution is wrong in the first place, before I make a fix for the emulator :P
Yes, you are right. English is not my first langauge so I didn't expressed myslef well. What I meant was: I skip a pixel "once in a while", but spread regularly. In fact the trick is multiply the scan line pointer by 7/16 when putting pixels, here's the code to change:

avr8.cpp, around line 1510:

Code: Select all

screen = SDL_SetVideoMode(630,448,32,sdl_flags);
avr8.cpp, around line 2061:
#if GUI && VIDEO_METHOD == 1
if (scanline_count >= 0 && current_cycle < 1440)
{
while (cycles)
{
if (current_cycle >= 0 && current_cycle < 1440 && (current_cycle&1))//{
current_scanline[(current_cycle*7)>>4] = next_scanline[(current_cycle*7)>>4] = pixel;

++current_cycle;
--cycles;
}
}
#endif

That's it. That give 630x480, which is damn close to a 1.33 aspect ratio. It create slight artifact when scrolling, but otherwise perfect on still games. If you guys likes it, let me know and I'll commit that code and we'll now have that new aspect ratio for uzem. :)
User avatar
lunatic
Posts: 49
Joined: Sun Jul 28, 2013 12:29 am
Location: Horten, Norway
Contact:

Re: NTSC Artifacts

Post by lunatic »

Nice :)

Remember to update the fullscreen centering too.

Code: Select all

inset = ((600-448)/2) * screen->pitch + 4 * ((800-630)/2);
I think you should commit it. Since it's much more correct resolution than before.
Post Reply