Sprites are 8x8 pixel bitmap graphics stored in 16 byte blocks in the CHR
data banks. Those 16 bytes are stored as 2 channels of 8 bytes each. Since
a byte is 8 bits, each byte of the channel represents one row of the
sprite.
When the channels are combined, channel B has a "weight" of 2. Gander at this Truth table-like diagram
of how to determine the composite image (ChannelA, ChannelB, Composite):
I hope that makes sense. ;) It's the only way I can think of explaining
this. No other guides really do a decent job of explaining this. If you've
got any experience with neural computing, this should be a piece of cake.
:P
ChannelA is the first 8 bytes, ChannelB is the second.
Brief example of how sprites are stored in a ROM file:
How it looks in hex:
F0 F0 F0 F0 0F 0F 0F 0F | 00 00 FF FF 00 00 FF FF
|
Channel A |
Channel B |
All you have to do is look at the binary representation of that data and
apply the above truth table to it.
Channel A | Channel B | Composite |
11110000 | 00000000 | 11110000 |
11110000 | 00000000 | 11110000 |
11110000 | 11111111 | 33332222 |
11110000 | 11111111 | 33332222 |
00001111 | 00000000 | 00001111 |
00001111 | 00000000 | 00001111 |
00001111 | 11111111 | 22223333 |
00001111 | 11111111 | 22223333 |
Assuming colors 0 through 3 are black, red, green, and blue, respectively,
this example composite should look like a series of rectangles in the
different colors.
Generally where the 0s are in the composite, it will be transparent. Color
palettes seem to be generated on the fly, so I'm not sure how to find out
exactly what colors are used for graphics and when.
|