Stories
Slash Boxes
Comments

SoylentNews is people

posted by chromas on Thursday April 18 2019, @04:20AM   Printer-friendly
from the harder-better-faster-stronger...sharper? dept.

Submitted via IRC for AzumaHazuki

HD emulation mod makes "Mode 7" SNES games look like new

Gamers of a certain age probably remember being wowed by the quick, smooth scaling and rotation effects of the Super Nintendo's much-ballyhooed "Mode 7" graphics. Looking back, though, those gamers might also notice how chunky and pixelated those background transformations could end up looking, especially when viewed on today's high-end screens.

Emulation to the rescue. A modder going by the handle DerKoun has released an "HD Mode 7" patch for the accuracy-focused SNES emulator bsnes. In their own words, the patch "performs Mode 7 transformations... at up to 4 times the horizontal and vertical resolution" of the original hardware.

[...] Games that made use of the SNES "Graphics Mode 7" used backgrounds that were coded in the SNES memory as a 128x128 grid of 256-color, 8x8 pixel tiles. That made for a 1024×1024 "map" that could be manipulated en masse by basic linear algebra affine transforms to rotate, scale, shear, and translate the entire screen quickly.

Some Mode 7 games also made use of an additional HDMA mode (Horizontal-blanking Direct Memory Access) to fake a "3D" plane that stretches off into the horizon. These games would essentially draw every horizontal scanline in a single SDTV frame at a different scale, making pieces lower in the image appear "closer" than ones far away.

It's a clever effect but one that can make the underlying map data look especially smeary and blob-like, especially for parts of the map that are "far away." This smearing is exacerbated by the SNES' matrix math implementation, which uses trigonometric lookup tables and rounding to cut down on the time needed to perform all that linear algebra on '90s-era consumer hardware. Translating those transformation results back to SNES-scale tiles and a 420p SD screen leads to some problems on the edges of objects, which can look lumpy and "off" by a pixel or two at certain points on the screen.

The HD Mode 7 mod fixes this problem by making use of modern computer hardware to perform its matrix math "at the output resolution," upscaling the original tiles before any transformations are done. This provides more accurate underlying "sub-pixel" data, which lets the emulator effectively use the HD display and fill in some of the spaces between those "boxy" scaled-up pixels.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 4, Insightful) by jmorris on Thursday April 18 2019, @05:25AM (6 children)

    by jmorris (4844) on Thursday April 18 2019, @05:25AM (#831516)

    So this is basically like playing the same game with an upgraded video card. Nice use of modern overkill powered CPUs to make old games look better than they looked on the real hardware.

    • (Score: 2, Insightful) by Anonymous Coward on Thursday April 18 2019, @07:05AM (5 children)

      by Anonymous Coward on Thursday April 18 2019, @07:05AM (#831538)

      Having grown up through that era, my mind has a hard time processing the fact that all that detail was already there, just clipped off by the bad math. As someone mentioned in the comments on Reddit, this is basically giving a bunch of games on the SNES an HD remaster for free.

      • (Score: 2) by Tara Li on Thursday April 18 2019, @09:29AM

        by Tara Li (6248) on Thursday April 18 2019, @09:29AM (#831562)

        Damned straight. Remember how crappy those overworlds were in the mid Final Fantasy series? I looked at some of the samples, and ... WHOA!

      • (Score: 2) by ledow on Thursday April 18 2019, @10:16AM (1 child)

        by ledow (5567) on Thursday April 18 2019, @10:16AM (#831569) Homepage

        It had to be - the SNES didn't have the memory to hold multiple mipmaps (multiple bitmaps of textures at various resolutions to save memory/processing when distant, but look good close-up) of everything.

        So it had one high-res "texture" and just cherry-picked what it needed from it. It's not at all difficult to only take every second pixel, for example, when you're drawing it in the far distance. Cheap, easy to compute, only one copy of everything in memory, but looks good when you are made to scale it "close up". The Mode 7 had a primitive, quick, blocky-scaler which in this case has just been improved by using a completely different scaler. No different to when people use modern OpenGL to render Mario64 in an emulator and use the card's anti-aliasing etc. features to make it look better.

        With modern hardware (and zsnes used to do something very similar), you just always choose to render from the full bitmap rather than skip parts, but it's not something the SNES could ever have done.

        Modern games actually contain several copies of almost every texture in a variety of sizes for such purposes - even if they are created at texture-load time from a single hi-res source texture. They can afford not only to create them on the fly from the original, select and switch between multiple of them quickly, but also have them all loaded into memory at the same time. The SNES didn't have that luxury.

        I'd be more surprised if the SNES didn't work from one single, fixed-in-memory (cartridges, remember!) texture/bitmap and then had a clever-trick of just skipping every other pixel and doing real-primitive scaling in between. We're talking about a 3.5Mhz machine here, with 128KBytes of RAM (plus a bit more for special purposes, etc.).

        • (Score: 0) by Anonymous Coward on Thursday April 18 2019, @10:41PM

          by Anonymous Coward on Thursday April 18 2019, @10:41PM (#831928)

          Oh, I get that it was there on a technical level. I'm talking from the phenomenological perspective. I remember how low detail the graphics were, and that was (in some respects) made worse by the CRT televisions, which smeared and introduced other artifacts on its own.

          Of course, there are also some examples where my memory looks more like the new "version" because my brain extrapolated the necessary detail, which is helped by the way CRTs softened images. In those cases, I can't understand how the graphics looked so bad!

      • (Score: 2) by takyon on Thursday April 18 2019, @05:55PM (1 child)

        by takyon (881) <{takyon} {at} {soylentnews.org}> on Thursday April 18 2019, @05:55PM (#831758) Journal

        The Link to the Past and Dragon Quest III overworld maps look particularly better with this enhancement. Good job to the modder.

        --
        [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
        • (Score: 0) by Anonymous Coward on Thursday April 18 2019, @10:44PM

          by Anonymous Coward on Thursday April 18 2019, @10:44PM (#831931)

          Makes me wonder what Castlevania IV and a couple later games look like. Some of the effects there were achieved by making the "background" part of the foreground and the object or whatever in question was really the mode 7 background that had transforms done to it.

(1)