Chameleon-AVR Nurve Networks, Chameleon-AVR Datasheet - Page 178

MCU, MPU & DSP Development Tools AVR8 & PROPELLER DEV SYSTEM (SBC)

Chameleon-AVR

Manufacturer Part Number
Chameleon-AVR
Description
MCU, MPU & DSP Development Tools AVR8 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-AVR

Processor To Be Evaluated
AVR 328P
Data Bus Width
8 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Tile Bitmap Format
The font bitmap was converted using a tool I wrote which you can find here:
The tool takes as an input a BMP file and outputs SPIN compatible data statements. Read the C source file for the control
parameters and to understand how it works. For example, the output of the tool for the “!” character looks like this:
The tool outputs a text line description of the location and file where the tile was extracted from then encodes the tile in 2-
bit pixels where each 2-bit pixel value represents one of four colors from the tile palette to use. Thus, each tile has its own
palette of 4 colors. Also, you may notice the funny “%%” character sequence this is how SPIN indicates binary
representation, but “%%”means to use 2-bit encoding to simplify your typing thus instead of writing 00
can write 1,2,3,4 – which is convenient. Summing up, each tile is a 8x8 pixels. Each pixel is 2-bits, therefore, each tile
bitmap row is a single 16-bit WORD, and there are 8 WORDs that make up a tile. Each 2-bit pixel represents 1 of 4 colors
from the palette that is indexed from the tile entry’s high byte. So each tile has its own palette.
The tile bitmaps themselves are defined by the declaration _tile_bitmaps in the driver and you can change the pointer to
them with the global tile_bitmaps_base_ptr_parm in the register interface. However, this is rare unless you want to point
the tile_bitmaps_base_ptr_parm to another character set. If you move the pointer only one bitmap in length, then it would
have the effect of shifting all the character, so “A” would be “B” etc. not very useful.
Palette Entry and Color Format
The palette entries are very simple. Each tile in the tile map character is actually 2-bytes (as discussed above). The low
byte is the character which is a direct index into the character bitmaps and the 2
index into the palettes. Thus, a palette entry of 0 means use palette 0, a 1 means use palette 1 and so forth. Each palette
consists of 4 colors. Each color encoded as a single byte (which I will discuss the encoding in a moment). Currently the
driver has 16 palettes allocated, nothing special, just made up colors, black, white, blue, basic colors kind of thing. You
will want to define your own palettes and your own colors as you define your bitmaps, art, and level designs for your
games. Below is a peek at the palette definition in the driver:
DVD-ROM:\ CHAM_AVR \ TOOLS \ GRAPHICS \ BMP2SPIN.EXE
TIP
Figure 22.2 the tile engine font (I added a couple Space Invaders at the end for fun!).
The tile engine is very optimized and thus needs the tile bitmaps in a specific format.
That is reversed. So the 2-bit pixels are reversed when output, that is the bitmaps you
enter must be mirrored, so that when displayed they are correct. Normally, bitmaps in
tile engines might be left to right as they are on the screen, but in this case the left most
pixels will display on the right, etc. So keep that in mind when making your own tiles.
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon AVR 8-Bit”
nd
byte is the color attribute which is an
b
, 01
b
, 10
b
, 11
b
, we
178

Related parts for Chameleon-AVR