Main Page | Data Structures | File List | Data Fields | Globals

gfx.h File Reference

main library functions More...

#include "defs.h"

Go to the source code of this file.

Video

VRAM and VDP related functions

#define MODE2_MAX   (256 * 24)
 screen 2 section bytecount
#define MODE2_ATTR   (8192)
 screen 2 attributes section start address
#define MODE2_WIDTH   256
 screen 2 width in pixels
#define MODE2_HEIGHT   192
 screen 2 height in pixels
enum  video_mode
 video modes
enum  screen_map
 mangled screen sections (3 maps)
void set_mode (u_int mode)
 set screen mode
void set_mangled_mode ()
 set screen to mangled mode (screen 1 + 2)
void set_color (u_char front, u_char back, u_char border)
 set screen color
void fill (u_int addr, u_char value, u_int count)
 fill vram from addr, with value, for count bytes
void vpoke (u_int addr, u_char value)
 set value at a given vram address addr
u_char vpeek (u_int addr)
 get value from a given vram address addr
void vmerge (u_int addr, u_char value)
 set value at a given vram address addr, merging bits (OR) with the existing value
void vwrite (void *source, u_int dest, u_int count)
 transfer count bytes from ram to vram
void vread (u_int source, void *dest, u_int count)
 transfer count bytes from vram to ram
void set_vdp (u_char reg, u_char value)
 set a vdp register with a value
u_char get_vdp (u_char reg)
 get a vdp value from register reg
void locate (u_char x, u_char y)
 move the screen cursor to a given position
void fill_v (u_int addr, u_char value, u_char count)
 vertical fill on vram starting at adress addr, of a given value, for count lines
void pset (int x, int y)
 set point at the given position on vram
void set_char_form (char c, void *form, u_char place)
 set char c shape, from form, at the given screen map place
void set_char_attr (char c, void *attr, u_char place)
 set char c attributes, from attr, at the given screen map place
void set_char_color (char c, u_char color, u_char place)
 set char c with color, at the given screen map place
void set_char (char c, void *form, void *attr, u_char color, u_char place)

PSG

PSG (sound generator) manipulation functions

#define sound(reg, value)   psg_set(reg, value)
 alias for setting psg registers (for the BASIC fans)
#define psgT(hz)   ((int)(111760.0 / (hz)))
 convert a given frequency into a suitable period for PSG
enum  {
  chanNone = 0, chan0 = 1, chan1 = 2, chan2 = 4,
  chanAll = 7
}
enum  {
  envD = 0, envU = 4, envDD = 8, envDUD = 10,
  envDH = 11, envUU = 12, envUH = 13, envUDUD = 14
}
 volume envelopes, where U = up, D = down, H = high More...
void psg_set (u_char reg, u_char value)
 set a psg register with a value
u_char psg_get (u_char reg)
 get value from psg register
void psg_init ()
 initialize psg
void psg_tone (u_char channel, int period)
 set a given tone for the channel (0-2)
void psg_noise (u_char period)
 set the global noise period
void psg_volume (u_char channel, u_char volume)
 set channel's volume
void psg_envelope (u_char waveform, int period, u_char channels)
 set the volume envelope of number waveform, with the given period, on a group of channels (ORed bits)
void psg_channels (u_char tone_channels, u_char noise_channels)
 set noise or tone generation on a group of channels (ORed bits)
u_char psg_tone_channels ()
 get the group of channels currently generating tone (ORed bits)
u_char psg_noise_channels ()
 get the group of channels currently generating noise (ORed bits)

Sprites

enum  sprite_mode
 sprite modes
void set_sprite_mode (u_char mode)
 set the sprite mode
void set_sprite_8 (u_char handle, void *data)
 set the sprite handle, with the shape from data (small size)
void set_sprite_16 (u_char handle, void *data)
 set the sprite handle, with the shape from data (big size)
void put_sprite_8 (u_char id, int x, int y, u_char handle, u_char color)
 put the sprite with id and shape from handle, into the given position with color (small size)
void put_sprite_16 (u_char id, int x, int y, u_char handle, u_char color)
 put the sprite with id and shape from handle, into the given position with color (big size)

Controllers

u_char get_stick (u_char id)
 get state of joystick number id
bool get_trigger (u_char id)
 get state of joystick button (trigger) number id, true = pressed

Random

Fast and dirty pseudo-random number generator

void seed_rnd (int seed)
 seed the pseudo-random number generator
u_char get_rnd ()
 get the next number from the pseudo-random number generator


Detailed Description

main library functions

Definition in file gfx.h.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
chanNone  no channel
chan0  the first audio channel
chan1  the second audio channel
chan2  the third audio channel
chanAll  all audio channels

Definition at line 263 of file gfx.h.

00263      {  
00264         chanNone = 0,   
00265         chan0 = 1,      
00266         chan1 = 2,      
00267         chan2 = 4,      
00268         chanAll = 7     
00269 };

anonymous enum
 

volume envelopes, where U = up, D = down, H = high

Enumeration values:
envD  envelope, falling into silence
envU  envelope, raising to highest volume, then silenced
envDD  envelope, falling into silence multiple times
envDUD  envelope, first falling, and then triangle shaped
envDH  envelope, falling into silence, then abrupt high volume
envUU  envelope, raising until top multiple times
envUH  envelope, raising until top and then mantaining high volume
envUDUD  envelope, triangle shaped

Definition at line 272 of file gfx.h.

00272      {
00273         envD = 0,       
00274         envU = 4,       
00275         envDD = 8,      
00276         envDUD = 10,    
00277         envDH = 11,     
00278         envUU = 12,     
00279         envUH = 13,     
00280         envUDUD = 14    
00281 };


Generated on Thu Mar 3 19:55:02 2005 for GFX lib by  doxygen 1.4.1