Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also it was recently figured out that using the SNES's mosaic feature in an unconventional way could have nearly doubled the game's framerate.


Interesting, please do tell more!

I know that Wolf3D on the SNES uses Mode 7. Not for the walls or sprites, but for the entire screen. The graphics are rendered into a background tiles with a resolution of like 175x100 or something, then scaled up with Mode7 to fill the 224x192 screen. (those aren't the exact numbers, but you get the idea)


The "mosaic trick" is a way to perform horizontal pixel doubling in hardware rather than software. And to do this trick, you turn on the SNES's Mosaic feature, scroll 1 pixel to the left every other scanline, and scroll upward one pixel after each two scanlines have been drawn.

Normally the SNES mosaic feature just the top-left pixel of a 2x2 square into that entire square. But the trick makes a different set of pixels get doubled horizontally on the next scanline.

It requires a different arrangement of pixels than the normal way of drawing tiles. A tile containing these pixels:

01234567

becomes this when viewed on two scanlines:

00224466

11335577

Actually performing these scroll writes does not require any CPU intervention because you use the SNES's HDMA feature to do those scroll writes.

User "93143" on Nesdev describes the Mosaic trick in this post: https://forums.nesdev.org/viewtopic.php?p=205633#p205633, other discussion here: https://forums.nesdev.org/viewtopic.php?t=20393&start=135

---

So now that you've done this, you need half as much video memory as before, which effectively doubles your bandwidth for rendering and transfers.


WOW! That is so cool! Thank you, thank you, thank you for this reply.


Do you have more information on that?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: