SNES NTSC Composite Video Filter

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
byuu

Post by byuu »

It would be cooler if it supported automatic aspect correction, too. Modes like 1280x1024 throw an extra level of difficulty into the mix. Here you have a 4:3 monitor, with a 5:4 video mode trying to display an 8:7 video game in the proper aspect ratio.

So far, I just pretend all modes are 4:3. But I think what really needs to be done is to specify what the per-pixel dimensions are, eg height_size / width_size * height = width (5/4*1024=1280), and use that number to convert the pixel size to 8:7, and then multiply that by height to get your final width. And -then- add an option to recursively go through all possible x224 height combinations to find the best fit for the current mode. Fun, hm?
Dmog
Lurker
Posts: 192
Joined: Tue Aug 31, 2004 6:03 pm

Post by Dmog »

byuu wrote:1200x892 is a tiny bit off, but close enough. Unfortunately, none of my five systems support that resolution :(
Sorry if this is a stupid suggestion, but have you tried creating a custom resolution with powerstrip? I've had no trouble creating a 1200x892 @ 60hz mode on my machine (again, sorry if I'm being completely off-track here)
Firon
Trooper
Posts: 361
Joined: Fri May 05, 2006 4:37 pm
Contact:

Post by Firon »

I tried adding various custom resolutions (even interlaced!) with the NVIDIA drivers, but ZSNES just shows a black screen when it tries to use them. I can change on the desktop just fine and they show up without issue, though.
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

kick wrote:
The 600x448 size is hardcoded into the filter. Let people bitch about letterboxing. Those of us with eyes will appreciate the proper aspect ratio and non-blurry scanlines.
I appreciate proper aspect ratio,and I don't mind letterboxing.Actually,I love to see the black bars in PAL mode.
If I remember correctly, they weren't black in real hardware.

Perhaps there's something that can be done here to make it more accurate, like filling the unused screen border with the proper color? :?
blackmyst
Zealot
Posts: 1161
Joined: Sun Sep 26, 2004 8:36 pm
Location: Place.

Post by blackmyst »

ICEknight wrote:
kick wrote:
The 600x448 size is hardcoded into the filter. Let people bitch about letterboxing. Those of us with eyes will appreciate the proper aspect ratio and non-blurry scanlines.
I appreciate proper aspect ratio,and I don't mind letterboxing.Actually,I love to see the black bars in PAL mode.
If I remember correctly, they weren't black in real hardware.

Perhaps there's something that can be done here to make it more accurate, like filling the unused screen border with the proper color? :?
They look pretty black to me.
[size=75][b]Procrastination.[/b]
Hard Work Often Pays Off After Time, but Laziness Always Pays Off Now.[/size]
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

Oops, I think I got it mixed with the Genesis.
lain
New Member
Posts: 4
Joined: Mon Dec 25, 2006 12:14 am

Post by lain »

Sorry for bumping such an old thread D: but I was just wondering what the [refresh] thing does when enabled.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

lain wrote:Sorry for bumping such an old thread D: but I was just wondering what the [refresh] thing does when enabled.
You obviously haven't read the documentation that comes with ZSNES.
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

I invoke my level 10 "Sneaky Bastard" skill to take advantage of this bumped topic:

Any chance this filter could be upgraded to the latest, greatest version? I just don't have the kind of chutzpah it'd take to do it myself, but once it's done it will probably work on the Mac port. My futile attempts ended up producing weird, half-filled screens.
Only a couple screws loose.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

BRPXQZME wrote:I invoke my level 10 "Sneaky Bastard" skill to take advantage of this bumped topic:

Any chance this filter could be upgraded to the latest, greatest version? I just don't have the kind of chutzpah it'd take to do it myself, but once it's done it will probably work on the Mac port. My futile attempts ended up producing weird, half-filled screens.
I'd like to think it would happen at some point. However, just plugging the code in simply won't work.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

...this, I found out rather quickly. Otherwise I would have just said PLUG IT IN IT WORKS AHAHA or something to that effect. While still utilizing my "Sneaky Bastard" technique, of course.
Only a couple screws loose.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

BRPXQZME wrote: Any chance this filter could be upgraded to the latest, greatest version? I just don't have the kind of chutzpah it'd take to do it myself, but once it's done it will probably work on the Mac port. My futile attempts ended up producing weird, half-filled screens.
Can you send me a copy of your current work? All I'm getting is crashing on my end. Although I see some obvious points why the new version isn't just drop in and play.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

All I did was drop in the new code and changed the line in NTSCFilterDraw to say 288 instead of 576 (this yields half a screen instead of 1/4 of a screen; changing it to 144 looks... interesting). Pretty much anything else I tried that seemed like it'd work caused crashage. And me being me, I didn't try anything besides really cheapass fixes. I didn't look into it too hard. (Also, after about 20 minutes of good ol' fiddlin' with it, I got it to the point where I only get crashing. With either enabling interpolation, enabling ntsc, but never both with the same executable. Hrrrrumph. This is why I hate technology. I'm a CS major, so unlike the Luddites I'm not entirely unfounded here.)

In the meantime, I figured out how to fix the crashing problem with the current code. Turns, out setting SDL_HWSURFACE instead of SDL_SWSURFACE (in sw_draw.c) will give the filter addresses it likes to write to (d'oh!). The SDL_DOUBLEBUF is still a bad idea for OS X, though; with it, HQ2X goes all seizure-licious in certain modes.
Only a couple screws loose.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

BRPXQZME wrote: In the meantime, I figured out how to fix the crashing problem with the current code. Turns, out setting SDL_HWSURFACE instead of SDL_SWSURFACE (in sw_draw.c) will give the filter addresses it likes to write to (d'oh!). The SDL_DOUBLEBUF is still a bad idea for OS X, though; with it, HQ2X goes all seizure-licious in certain modes.
That doesn't help me, I'm only using Linux.

This line is crashing for me:
SNES_NTSC_LORES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH );
And I've yet to figure out why...
Although I have yet to take out the really really big guns.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Yay for progress!

Image
Cookie if you know which game that's from.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I am currently banging my head on the wall, however...

Image
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Joe Camacho
Devil's Advocate
Posts: 2293
Joined: Mon Aug 02, 2004 7:51 pm
Location: Hmo. Son.

Post by Joe Camacho »

Nach wrote:Yay for progress!

Image
Cookie if you know which game that's from.
Battletoads & Double Dragon
*Sometimes I edit my posts just to correct mistakes.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Nach wrote:I am currently banging my head on the wall, however...

Image
Super Metroid. Yes, I know the feeling.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Cookies to byuu and Joe Camacho.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

This is implemented in windows, linux is pending.
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

Nach or pagefault, I'd like to discuss how to make future upgrades of the NTSC filter smoother. I had put together a wrapper for zsnes a while back but y'all were still busy with other things at the time. I'm not having much luck finding the ZSNES CVS to see how things are currently handled.
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

Nach wrote:
BRPXQZME wrote: In the meantime, I figured out how to fix the crashing problem with the current code. Turns, out setting SDL_HWSURFACE instead of SDL_SWSURFACE (in sw_draw.c) will give the filter addresses it likes to write to (d'oh!). The SDL_DOUBLEBUF is still a bad idea for OS X, though; with it, HQ2X goes all seizure-licious in certain modes.
That doesn't help me, I'm only using Linux.
Helps me, it doesn't crash anymore :lol:

(I do believe that deathlike has been denied a cookie, more importantly)
Only a couple screws loose.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

There was no cookie offered for the Super Metroid pic, that was too obvious.

blargg, you know where to reach us if you want to discuss anything.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Hey blargg, I have a question for you...

How are you outputting the graphics in this version, from what I can you are doing it per line? Does that mean I call this 60 times per second and build a buffer? How should I go about implementing this properly. Before it was easy just taking a buffer of the complete frame. I will have to do some rework on our blitters if this is the case.

Thanks.
Post Reply