Unity Web Player | 2D Palette Gfx Test


This is a demonstration NES Pixel Processing Unit homage implemented in Unity2D. I would accept it being called a full PPU emulator since it's probably on par with early functional-reproduction emulators, but since it does not actually have any conception of timing, vblank, interrupts, etc., from a technical engineering standpoint I'm personally more comfortable not putting the full weight of the term "emulator" on it as such.

Nonetheless, under the hood it covers the vast majority of player-facing NES graphics hardware functionality. It sports an arbitrary number of CHR banks imported on-demand (as custom palette-shader'd sprite sets from 128x128px 4-color BMPs) into the usual 2 pattern tables, from which it populates 4 nametables and 64 sprites. The nametables are address-accessible, support horizontal, vertical, or no mirroring, and full x/y scrolling with a kludge for multiple-scroll-region raster effects. Sprites are controlled via a 256-byte OAM-style array which can either be accessed address-wise or updated block-at-once DMA-style. A passable rendition of the NES system palette has been implemented in the palette controller, which also provides color-emphasis and grayscale functions. Sprite priority layering in front of or behind the background works as expected, and the nametable controller and the sprite controller can both be flagged to hide the left 8 pixels or turn off entirely.

The displayed demo uses graphics from my 8-Bit Hero Trainer NES homebrew, but only contains enough functionality to show the system at work. It uses only 2 CHR banks (input textures), displayed below, of which 1 is mainly to demonstrate bank switching. All of the work to get from these 4-color image to what you see above is done programmatically on the fly.