Interlacing and text

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
Señor Ventura
Posts: 233
Joined: Sat Aug 20, 2016 3:58 am

Interlacing and text

Post by Señor Ventura »

[Edit by Fiskbit: This was originally a reply to this post by rainwarrior in Making a BASIC for SNES dev. As the topic has diverged significantly from the original BASIC-for-SNES discussion, I have split it off.]
rainwarrior wrote: Thu Oct 20, 2022 10:11 amThe SNES also has some advantages that the NES doesn't. There was existing common support for much larger RAM than the NES has. High resolution and interlacing modes allows practical 64x28 or 64x56 character display.
But interlacing causes flickering in snes, right?.
User avatar
rainwarrior
Posts: 8735
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Making a BASIC for SNES dev

Post by rainwarrior »

Señor Ventura wrote: Thu Oct 20, 2022 1:17 pm
rainwarrior wrote: Thu Oct 20, 2022 10:11 amThe SNES also has some advantages that the NES doesn't. There was existing common support for much larger RAM than the NES has. High resolution and interlacing modes allows practical 64x28 or 64x56 character display.
But interlacing causes flickering in snes, right?.
It would have the characteristic "jittery" look of interlacing, but for displaying static text for code it's probably a good option to have. I say option, because it's also probably good to be able to turn it off, in case it bothers the user. Especially if the characters are mostly 2-pixel thick strokes, the jittering would probably be relatively mild in this usage.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Making a BASIC for SNES dev

Post by lidnariq »

In my experience, there were quite a number of Wii homebrew that used the interlaced video mode with the standard VGA 8x16 font. On a CRT, it was a painful flickery mess, and the CGA 8x8 font would probably become hard to discern as well.

Obviously for people on a HDTV that has a "weave" deinterlacer that's irrelevant, but I'd still like to discourage it.
User avatar
rainwarrior
Posts: 8735
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Making a BASIC for SNES dev

Post by rainwarrior »

lidnariq wrote: Thu Oct 20, 2022 1:55 pmIn my experience, there were quite a number of Wii homebrew that used the interlaced video mode with the standard VGA 8x16 font. On a CRT, it was a painful flickery mess, and the CGA 8x8 font would probably become hard to discern as well.

Obviously for people on a HDTV that has a "weave" deinterlacer that's irrelevant, but I'd still like to discourage it.
For aesthetic purposes I would probably never suggest interlacing, because I usually feel it hurts more than it helps, but display of code is about function rather than aesthetic.

I definitely wouldn't want it as a forced option, and probably not even as a default, but the advantage of 50 lines of code over 25 is a huge one to me. No real drawback at all for 480i weave situations (including some emulators), and would probably be worth it for those alone, but even on a CRT despite the jitter/flicker I'd consider it a useful option to have.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Making a BASIC for SNES dev

Post by tepples »

An 8x8-pixel font with most strokes at least 1.5 pixels wide should mitigate the flicker of interlace somewhat.
"PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS" weave simulation
"PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS" weave simulation
interlaced_packmybox.png (4.28 KiB) Viewed 1234 times
"PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS" interlace simulation
"PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS" interlace simulation
interlaced_packmybox.gif (4.62 KiB) Viewed 1234 times
User avatar
Individualised
Posts: 310
Joined: Mon Sep 05, 2022 6:46 am

Re: Making a BASIC for SNES dev

Post by Individualised »

Is the gif supposed to be animated? It changes between 2 different frames depending on refresh for me, even when right clicking and opening directly.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Making a BASIC for SNES dev

Post by creaothceann »

It's animated for me (FF 106.0.1).
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Making a BASIC for SNES dev

Post by lidnariq »

rainwarrior wrote: Fri Oct 21, 2022 1:03 am but display of code is about function rather than aesthetic.
In general that's true, but I genuinely found the use of the bilevel VGA 8x16 font to be so painful to look at that that would not be true here for me. It would only pop up for a few seconds when starting the Homebrew Channel or Priiloader and I had to look away because it was just that painful.
tepples wrote: Fri Oct 21, 2022 9:45 am An 8x8-pixel font with most strokes at least 1.5 pixels wide should mitigate the flicker of interlace somewhat.
The default VGA font has strokes at least 2 pixels wide and it was still incredibly painful. Blur it vertically when interlacing or don't use interlacing.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Making a BASIC for SNES dev

Post by tepples »

The default VGA font's vertical strokes are indeed 2 pixels wide. Its horizontal strokes are 1 pixel wide. That's what I sought to fix with this font. See for example the glyph for F: the gray lines provide a cue in the other field as to where the line is.
letter_F.png
letter_F.png (335 Bytes) Viewed 1196 times
User avatar
rainwarrior
Posts: 8735
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Making a BASIC for SNES dev

Post by rainwarrior »

I don't feel that GIFs can really express what it looks like, so I started writing up a test ROM so we could have a non-hypothetical version to look on CRTs...

But then I realized that the whole point is moot because SNES can't actually do this in a very practical way. Tiles in hires mode are always 16 pixels wide, which means that 64 character display can't really be done easily.

I guess you could use up most of your 64k of VRAM to software render each tile pair, so it's not totally out of the question, but that's a whole lot crankier than what I was thinking, and would be pretty slow to update.

So, never mind. Sorry about creating this digression. :S

Edit: So I made a demo ROM anyway...

Here's a demonstration of what it could look like:

ROM: smalltext.sfc
Source: github

In this case it's just a custom image, so the character pairs are pre-computed.

I have a shadow under the font characters, offset vertically by one pixel. The L and R buttons adjust the brightness of this shadow, basically at full brightness we have 2px tall strokes, and at 0 brightness we have 1px tall strokes.

On my CRT, 1px tall is simply intolerable to look at. At 2px tall, the jittering is fairly mild and I'd be perfeclty fine looking at it for a while. Unfortunately, the sharpness of my CRT isn't good enough for the legibility to be very good. It's readable but not enough to be a practical benefit on this monitor.

Still, it looks very well with a weave display. It works great on my LCD TV, or in an emulator like Mesen. I do think it's a very nice potential benefit for that situation.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Making a BASIC for SNES dev

Post by lidnariq »

rainwarrior wrote: Sun Oct 23, 2022 4:15 am But then I realized that the whole point is moot because SNES can't actually do this in a very practical way. Tiles in hires mode are always 16 pixels wide, which means that 64 character display can't really be done easily.
Mode 5, put left tiles on the 4bpp layer and right tiles on the 2bpp layer (or vice versa). I used this some of my test ROMs (e.g. viewtopic.php?p=190848#p190848 ). Having to weave text between two nametables is a little stupid now, but it's doable.
User avatar
Señor Ventura
Posts: 233
Joined: Sat Aug 20, 2016 3:58 am

Re: Making a BASIC for SNES dev

Post by Señor Ventura »

Do sega genesis/megadrive has the same flickering problem at its 448i resolution mode?, Where the problem is born in the snes?, Do this it in the ppu's itself?.

I don't see a problem of using so much vram, but rom. Conmuting every character with every any other possible character, yo would write any word simply calling the corresponding graph.

I want to use an "D", so i write a "D", so i call the graph:
"D"+" "

The next word is an "O", so i call the graph:
"D"+"O".

...in substitution of the graphic "D"+" ".



You know, hard for the programmer, but easy for the hardware resources... and you only have to create the algorithm one only time. The cost in rom is nowadays derisory.

The only remain problem, then, is the flickering issue...



EDIT: And you save the 4bpp bitplane for another purposes... or the 2bpp one, if you want richer color fonts.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Making a BASIC for SNES dev

Post by TmEE »

This is purely to do with the process of interlacing itself. You have what is essentially hardware assisted "sprite" flickering, where a detail is shown only on every other frame. A small low resolution CRT has the successive lines overlap and that reduces the flicker a bit, but a larger one will have things go right between the old lines without overlap and you get lot of flicker from that.

It will look the same regardless of console, on a given display device.
User avatar
rainwarrior
Posts: 8735
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Making a BASIC for SNES dev

Post by rainwarrior »

lidnariq wrote: Sun Oct 23, 2022 11:12 amMode 5, put left tiles on the 4bpp layer and right tiles on the 2bpp layer (or vice versa). I used this some of my test ROMs (e.g. viewtopic.php?p=190848#p190848 ). Having to weave text between two nametables is a little stupid now, but it's doable.
Ah, that's a good way!
User avatar
Señor Ventura
Posts: 233
Joined: Sat Aug 20, 2016 3:58 am

Re: Making a BASIC for SNES dev

Post by Señor Ventura »

rainwarrior wrote: Sun Oct 23, 2022 3:44 pm
lidnariq wrote: Sun Oct 23, 2022 11:12 amMode 5, put left tiles on the 4bpp layer and right tiles on the 2bpp layer (or vice versa). I used this some of my test ROMs (e.g. viewtopic.php?p=190848#p190848 ). Having to weave text between two nametables is a little stupid now, but it's doable.
Ah, that's a good way!
But you loose a layer.
Post Reply