Thursday, October 12, 2017

The Rise of Interlacing in Video Game Consoles

Until the Genesis and the SNES, all video game consoles used 240p resolutions.  However, in the quest to gain greater graphical detail without severely impacting performance, game programmers began to use interlaced video modes in the fourth and fifth generation of video game consoles.  Then in the sixth generation, interlacing was the norm and progressive scan was the option.  By the seventh generation, HD gaming was the norm and interlaced graphics usage was more or less here to stay.  Let's explore the issues surrounding interlaced video game graphics here.




Standard definition interlacing, 480i is almost identical to the TV's perspective to 240p.  The key difference is that in 480i mode, a delay of half a scanline which tells the TV to draw an even frame or an odd frame.  240p mode lacks the delay and the TV always draws odd or even scanlines.  Interlaced modes should run a display at a maximum of 30 frames per second whereas progressive modes run a display at 60fps.

A standard definition CRT is a particularly dumb device and will try to draw whatever you tell it to draw.  HDTVs are far more picky and many of them do not like non-standard signals like 240p, but will display a 480i signal.

The Sega Genesis typically uses a 320x224 or a 256x224 resolution.  The Sega Genesis does support interlaced modes but the only really known uses are in Sonic the Hedgehog 2 and Combat Cars in their two-player VS Modes.  In this case, the resolution is 320x448, a double height version of the standard 320x224 mode.  This is needed to display two screens' worth of information because the players are competing in a split screen mode.  The aspect ratio is quite squashed compared to the normal game.



The SNES supports not only interlacing but also high resolution modes using 512 pixels instead of the typical 256 pixels.  Thus you can have 512x239 or 512x224 pixel modes in addition to 256x224 and 256x239.  The SNES game RPM (Radical Psycho Machine) Racing supports a split-screen mode in all playing modes.  The game always uses a 512x448 mode.  You can also have 256x448, 256x478 or 512x478 interlaced modes.


The following SNES games use interlaced modes for static screens like Air Strike Patrol, Bishoujo Wrestler Retsuden. Power Drive, Ranma 1/2: Chounai Gekitou Hen and the SNES Test Program.  It is also used in one of the endings in Chrono Trigger.  Other games like Secret of Mana do not use interlaced modes, they use high definition progressive modes like 512x224.  The menus of the sd2snes and SNES PowerPak (Ramsis unofficial firmware) also use 512x224 for more text columns.

On a CRT, the use of interlaced modes can cause perceivable flicker or vertical jitteriness to text.  White text tends to be jittery.  RPM Racing has rather nasty flicker in its green backgrounds on its race tracks.  The game is practically unplayable for very long as a result.  Air Strike Patrol does not really have noticeable jitteriness in its static screens except for large areas of white graphics.  

This is one area where LCDs have an advantage over standard definition CRTs.  CRTs display interlaced signals naturally, because they draw lines.  An LCD draws frames, and it only wants full-frames.  The default way an LCD deinterlaces a video signal is by "weaving."  Weaving is essentially combining a pair of sequential odd and even half-frames into one frame.  If the image has not moved in between those half-frames, then the result is acceptable.  In Air Strike Patrol, interlacing is used for status screens and the image should be completely stable.

If the image has moved, then you will get combing artifacts in areas of the image where the position of the objects no longer matche.  This is what you may see when you run Sonic 2 or RPM Racing in an emulator.  The CRT flicker and LCD combing is especially noticeable here because the game is updating the screen greater than 30 times per second.  Games of the later generations should only update the screen at 30Hz, which reduces CRT flicker and should eliminate combing artifacts on LCDs.  This screenshot shows you the "mice teeth" artifact you obtain with the weave deinterlacing method used by emulators like higan :



When it comes to video scalers like the Framemeister or an LCD TV's internal scaler, they tend to have a very difficult time responding quickly to the transition between progressive and interlaced modes.  This is not a huge issue with 4th generation consoles like the Genesis and SNES where the interlaced modes are seldom used and the transitions do not generally affect gameplay.  But the 5th generation of video game consoles do transition between progressive and interlaced modes rather frequently.

The N64 usually used low resolution modes like 320x240p for speed.  Its Expansion Pak added more RAM to the base system and several games can take advantage of it for using high resolution modes up to 640x480i.  Castlevania: Legacy of Darkness, Daikatana, Duke Nukem: Zero Hour, Excitebike 64, FIFA 99, Hybrid Heaven, Indiana Jones and the Infernal Machine, Ken Griffey, Jr.'s Slugfest, Perfect Dark, Pok√©mon Stadium 2, Rayman 2: The Great Escape, Re-Volt, Resident Evil 2, South Park, Star Wars: Episode I: Battle for Naboo, Star Wars: Episode 1 Racer, Star Wars: Rogue Squadron, Top Gear Overdrive, Turok 2: Seeds of Evil, Turok 3: Shadow of Oblivion, Turok: Rage Wars, Vigilante 8: 2nd Offense, World Driver Championship.  Few, if any of these games actually ran in full 640x480, modes like 480x360, 400x440  and 640x222 were more common.  For most of these games, you have to change the graphics quality to high resolution in a setup menu, so you do not always have to be stuck with the higher resolution modes.

The Sony PlayStation used interlaced mode more rarely.  Chrono Cross, Dead or Alive, Ehrgeiz, iS: internal section, Gran Turismo, R4: Ridge Racer Type 4 (Bonus disc), Tekken 1, 2 & 3, Tobal No. 1 and Tobal 2, Turbo Prop Racing are known to use an interlaced mode.  The PS1 menu screen with the logo also uses interlacing.  Few of these games use it constantly throughout, and most use it for static/non-gameplay screens, so the scaler will have issues when switching.  The Sega Saturn also used interlaced modes on occasion, but even less often than PlayStation.

When it comes to hybrid interlaced games like those found on the PlayStation and N64, the Framemeister can take seconds to display an image if the resolution has changed from progressive to interlaced and vice versa.  You could be losing/dying in between those seconds, depending on when the game wants to switch modes.  The best current solution to displaying such content on an LCD is the Open Source Scan Converter, which can handle the transition in about one second.  My 4K TV does not display 240p, so a solution like the OSSC would be best for my systems.  Unfortunately the OSSC only accepts RGB or Component analog inputs and can be a bit picky about the TVs it will work with.

In the sixth generation, interlacing was the norm as games aspired to "high resolution" graphics to give more detail to their textures and less jagged edges to their polygons.  The Dreamcast had a VGA adapter for 640x480 at 60Hz.   Quite a few PlayStation 2 games supported progressive scan via component video cables.  Similarly, a number of GameCube games could also support progressive scan via component video cables but they require now extremely expensive official cables.  A tiny number of PlayStation 2 and GameCube games actually support 240p!  Most original Xbox games can support 480p and a few even support 720p and 1080i, all through component video cables of course.

All consoles of the seventh generation support progressive scan, and the PS3 and Xbox 360 support high resolution progressive scan modes.  By these consoles introduction, LCD HDTVs were becoming the new norm.  This does not mean, however, that your game will run in HD or at 60fps.  Many games of this generation could run in 720p or 1080i or both, giving the user to choose between higher graphical detail or more fluid gameplay.  These consoles can be run on standard definition CRTs, and thus must be able to interlace.  The PS4 and Xbox One do not support analog output, but the Wii U did.

7 comments:

  1. I'm surprised that Tekken 1 and 2 already used interlace modes, I assume that's not ingame though? I know 3 did, but from what I remember it kept the horizontal res fairly standard, like 320. I believe Virtua Fighter 2 and Last Bronx on Saturn used higher resolution.

    What struck me as odd was when I learned that the 3DO's output was always interlaced despite an internal resolution of 320x240. Why was that? I recall reading the Towns Marty may also not do 240p, but I guess the may be related to it's computer origins. I would think something like the Pippin was also stuck at 480i.

    ReplyDelete
    Replies
    1. Cool that you mentioned the 3DO. It does some conversion with specialiazed 2x2 corner pixel interpolation to 640x480. The programmer though only knows 240p and 60fps. The software framebuffer on 3DO is 320x240x15bpp but the final output is 480i, and there is an interesting conversion in the DAC hardware to a final 640x480x24bpp. There is limited control from software (but as a programmer of the system I don't know how to control it properly and emulators don't support it), even some kind of "interpolation" where one framebuffer pixel is converted to 2x2 blocks with different corner weights. Even the color conversion from 15bpp to 24bpp can be done with some CLUTs in software, something I haven't looked into yet. So, we don't have a physical resolution of 640x480 but rather a 320x240, however there is some sort of interpolation and color conversion happening, some of it I wasn't able to control by software. I still write code like my system is 240p and 60fps, even if it's different in the output.

      I got also puzzled recently, as we had a discussion on 3DO discord, that the output was 30fps. At the time I didn't know about the difference of 240p vs 640i, and remembering that from the coder's perspective I get a 60hz vsync, while 2d games seem to run smoothly, I was puzzled. But quickly I made a test, I swapped after vsync a square on the screen, and the result would be either flicker or blend of two images (blend of the interlace odd/even lines). It was the second. It is 30hz output as expected by 640i.

      Some people don't like the blurry feel of this pseudo 480i mode, they made an RGB mod that doubles the scanlines to a 240p mode. Also a Japanese FZ-1 3DO has a switch behind to switch it on and off. Here is the interesting thing. Switching it to 240p mode, scanlines were doubled and pixels were clearer, but seemed from my square non-flicker test to still blend two frames in one (so possibly still 30hz). But recently I acquired a retrotink 2x upscaler and the same test seem to do 60fps with squares flicker and movement faster. Later, I tried to play Super Street Fighter 2 on the machine and indeed it feels quite smoother. Previously, I thought I would recognize the difference between 30 and 60 (PAL is even worse, 25-50) but couldn't guess it, maybe the mix of the scanline and upscale to 480 with corner interpolation smoothens the animation? But surprsingly, the retrotink 2x improves to the proper 60fps feel (320p is cool, as the 480i wasn't a real highres resolution, but hardware interpolation with limited control from software (high bits in pixels and other parameters are supposed to control the 2x2 corner weights, but with few tests I couldn't make them change, need to do more research).

      Delete
  2. 3D0 was the brain child of Trip Hawkins, who founded Electronic Arts. Like with the FM Towns Marty, a PC-centric design would have eschewed 240p. VGA is not intended to do 240p either, but these adapters are designed to be used with monitors that must do 480p. 240p is better than 240p to 480i on a TV monitor.

    ReplyDelete
  3. Good article!

    I linked to it from mine :D
    Cheers
    Mike

    ReplyDelete
  4. Just found your article after recording a video of Ehrgeiz: God Bless the Ring for the PlayStation and wracking my brain trying to figure out why the heck the video was interlaced.

    I didn't even know an interlaced mode existed on the PSX hardware. Great read, thanks for putting the article together!

    ReplyDelete
  5. great! this help me understanding the 240p thing on video games

    ReplyDelete
  6. I think there's some bull going on with all these claims of noticeable flicker with interlaced games on CRT, because I'm pretty sure I played plenty of interlaced games back in the on various consoles and never noticed obvious flicker. I feel like either everyone is viewing games on their CRTs wrong or they're being nerds and calling out something that 99% of normal people just wouldn't notice if they weren't looking for it.

    ReplyDelete