Hardware Reference
In-Depth Information
sprite2x2(sprite #, position x, position y, image #, palette, rotation,
collision) : Sets a 2×2 sprite to be drawn at the center four corners; uses same parameters
as sprite() .
ascii() : Loads Gameduino's standard font.
putstr(position x, position y, string) : Prints a string encapsulated in quotes at the
position (x, y). Needs ascii() to be run first to load the default font.
voice(voice #, wave type, frequency, left volume, right volume) : Sets a tone to be
played out of the Gameduino's audio port. Table 11-2 describes the voice() parameters.
Table 11-2. Arguments for the voice() Function
Parameter
Description
voice #
Individual hardware voice number used to output
sound; takes a value between 0 and 63
wave type
Waveform (0 is sine wave, 1 is noise)
frequency
Frequency in quarter-Hertz (e.g., 100 Hz is 400)
left volume , right volume
Amplitude of the wave output per channel; takes a value
between 0 and 255; total volume for all voices should be
less than or equal to 255
Some of the functions require a memory address to be able to read or place data into the Gameduino. The library
also defines some keywords that are helpful when calling functions that deal with memory addresses. Table 11-3
provides the name, address, and descriptor; the keywords referenced are the common memory locations for
developing games.
Table 11-3. Useful Keywords Specific to the Gameduino's memory sructure and begging adresse locations.
memory addresses * Byte length = total bytes in memory
Keyword
Address
Description
RAM_CHR
0x1000
Screen characters (256 ×16 = 4096 bytes)
RAM_PAL
0x2000
Screen character palette (256×8 = 2048 bytes)
RAM_SPR
0x3000
Sprite control (512×4 = 2048 bytes)
RAM_SPRPAL
0x3800
Sprite palettes (4×256 = 2048 bytes)
RAM_SPRIMG
0x4000
Sprite image (64×256 = 16384 bytes)
PALETTE16A
0x2840
16-color palette RAM A (32 bytes)
PALETTE16B
0x2860
16-color palette RAM B (32 bytes)
PALETTE4A
0x2880
4-color palette RAM A (8 bytes)
PALETTE4B
0x2888
4-color palette RAM A (8 bytes)
VOICES
0x2a00
Voice controls
 
 
Search WWH ::




Custom Search