Fordi / P2PPU

A NES-like Picture Processing Unit for the Pixel 2.0 by Rabid Prototypes
https://www.kickstarter.com/projects/rabidprototypes/pixel-20-the-arduino-compatible-smart-display
0 stars 0 forks source link

[Hands-off] Migrate `Tile` structure to uint32_t[8] #4

Closed Fordi closed 7 years ago

Fordi commented 7 years ago

Big-endian, obviously. That is b31..28 is x[0] and b3..0 is x[7].

It occurred to me that this would be more readable. Each nibble represents a pixel, so:

{
    { 0x00110000 },
    { 0x01112000 },
    { 0x11112000 },
    { 0x02112000 },
    { 0x00112000 },
    { 0x00112000 },
    { 0x11111120 },
    { 0x02222220 }
}

Is a bit more visually obvious as a number '1' than:

{
    { 0x00, 0x11, 0x00, 0x00 },
    { 0x01, 0x11, 0x20, 0x00 },
    { 0x11, 0x11, 0x20, 0x00 },
    { 0x02, 0x11, 0x20, 0x00 },
    { 0x00, 0x11, 0x20, 0x00 },
    { 0x00, 0x11, 0x20, 0x00 },
    { 0x11, 0x11, 0x11, 0x20 },
    { 0x02, 0x22, 0x22, 0x20 },
}