Difference between revisions of "Pixel Graphics Functions"

From Archaic Pixels
Jump to: navigation, search
(Pixel Graphics Functions)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{:HuC Function Style}}
 
= Pixel Graphics Functions =
 
= Pixel Graphics Functions =
  
Line 5: Line 6:
 
   are slow and are not suited for applications where high performance
 
   are slow and are not suited for applications where high performance
 
   is required.
 
   is required.
 +
  
 
== gfx_setbgpal ==
 
== gfx_setbgpal ==
 
{|
 
{|
| [color=#00AA00]void[/color] gfx_setbgpal([color=#AA0000]char[/color] bgcolor); || [ 3.04+ ]
+
! [color=#00AA00]void[/color] gfx_setbgpal([color=#AA0000]char[/color] bgcolor); [b][ 3.04+ ][/b]
 
|-
 
|-
 
|
 
|
 
     Set default BG palette group to bgcolor.
 
     Set default BG palette group to bgcolor.
 
     Used by gfx_init().
 
     Used by gfx_init().
|-
+
 
|
+
 
     Example: 'gfx_setbgpal(5)' before gfx_init() will cause the gfx_*()
 
     Example: 'gfx_setbgpal(5)' before gfx_init() will cause the gfx_*()
 
             functions to use the BG palette entries from $50 through $5F
 
             functions to use the BG palette entries from $50 through $5F
 
|}
 
|}
 +
  
 
== gfx_init ==
 
== gfx_init ==
 
{|
 
{|
| [color=#00AA00]void[/color] gfx_init([color=#0000AA]int[/color] vaddr); || [ 3.04+ ]
+
! [color=#00AA00]void[/color] gfx_init([color=#0000AA]int[/color] vaddr); [b][ 3.04+ ][/b]
 
|-
 
|-
 
|
 
|
Line 27: Line 29:
 
     starting at address 'vaddr' in VRAM.
 
     starting at address 'vaddr' in VRAM.
 
|}
 
|}
 +
  
 
== gfx_clear ==
 
== gfx_clear ==
 
{|
 
{|
| [color=#00AA00]void[/color] gfx_clear([color=#0000AA]int[/color] vaddr); || [ 3.04+ ]
+
! [color=#00AA00]void[/color] gfx_clear([color=#0000AA]int[/color] vaddr); [b][ 3.04+ ][/b]
 
|-
 
|-
 
|
 
|
Line 37: Line 40:
 
     tiles in VRAM to all zeroes, with a size based on the virtual map.
 
     tiles in VRAM to all zeroes, with a size based on the virtual map.
 
|}
 
|}
 +
  
 
== gfx_plot ==
 
== gfx_plot ==
 
{|
 
{|
| [color=#00AA00]void[/color] gfx_plot([color=#0000AA]int[/color] x, [color=#0000AA]int[/color] y, [color=#0000AA]int[/color] color); || [ 3.04+ ]
+
! [color=#00AA00]void[/color] gfx_plot([color=#0000AA]int[/color] x, [color=#0000AA]int[/color] y, [color=#0000AA]int[/color] color); [b][ 3.04+ ][/b]
 
|-
 
|-
 
|
 
|
Line 46: Line 50:
 
     'color' should be avalue between 0 and 15.
 
     'color' should be avalue between 0 and 15.
 
|}
 
|}
 +
  
 
== gfx_point ==
 
== gfx_point ==
 
{|
 
{|
| [color=#AA0000]char[/color] gfx_point([color=#0000AA]int[/color] x, [color=#0000AA]int[/color] y); || [ 3.04+ ]
+
! [color=#AA0000]char[/color] gfx_point([color=#0000AA]int[/color] x, [color=#0000AA]int[/color] y); [b][ 3.04+ ][/b]
 
|-
 
|-
 
|
 
|
 
     Return the color of the pixel at (x,y).
 
     Return the color of the pixel at (x,y).
 
|}
 
|}
 +
  
 
== gfx_line ==
 
== gfx_line ==
 
{|
 
{|
| [color=#00AA00]void[/color] gfx_line([color=#0000AA]int[/color] x1, [color=#0000AA]int[/color] y1, [color=#0000AA]int[/color] x2, [color=#0000AA]int[/color] y2, [color=#0000AA]int[/color] color); || [ 3.11+ ]
+
! [color=#00AA00]void[/color] gfx_line([color=#0000AA]int[/color] x1, [color=#0000AA]int[/color] y1, [color=#0000AA]int[/color] x2, [color=#0000AA]int[/color] y2, [color=#0000AA]int[/color] color); [b][ 3.11+ ][/b]
 
|-
 
|-
 
|
 
|

Latest revision as of 02:31, 13 September 2010

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.


gfx_setbgpal

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


gfx_init

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


gfx_clear

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.


gfx_plot

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.


gfx_point

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


gfx_line

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.