Pixel Graphics Functions

From Archaic Pixels
Jump to: navigation, search

Pixel Graphics Functions

  The Pixel Graphics functions allow the HuC programmer to plot pixels
  directly to the screen.  However, bear in mind that these functions
  are slow and are not suited for applications where high performance
  is required.


void gfx_setbgpal(char bgcolor); [ 3.04+ ]
   Set default BG palette group to bgcolor.
   Used by gfx_init().
   Example: 'gfx_setbgpal(5)' before gfx_init() will cause the gfx_*()
            functions to use the BG palette entries from $50 through $5F


void gfx_init(int vaddr); [ 3.04+ ]
   Initialize screen to point to sequential graphics tiles, located
   starting at address 'vaddr' in VRAM.


void gfx_clear(int vaddr); [ 3.04+ ]
   Clear graphical screen.
   Starting at address 'vaddr' in VRAM, this function sets sequential
   tiles in VRAM to all zeroes, with a size based on the virtual map.


void gfx_plot(int x, int y, int color); [ 3.04+ ]
   Set a pixel at (x,y) to color listed.
   'color' should be avalue between 0 and 15.


char gfx_point(int x, int y); [ 3.04+ ]
   Return the color of the pixel at (x,y).


void gfx_line(int x1, int y1, int x2, int y2, int color); [ 3.11+ ]
   Draw a line from (x1,y1) to (x2,y2) in color listed.
   'color' should be avalue between 0 and 15.