Difference between revisions of "Text Output Functions"

From Archaic Pixels
Jump to: navigation, search
(Created page with "** TEXT OUTPUT FUNCTIONS ** --------------------------- All the text output functions have two forms, one where you directly specify the video memory address, an...")
 
Line 1: Line 1:
** TEXT OUTPUT FUNCTIONS **
+
{{:HuC Function Style}}
 
+
= Text Output Functions =
---------------------------
+
 
+
 
+
  
 
       All the text output functions have two forms, one where
 
       All the text output functions have two forms, one where
 
+
       you directly specifying the video memory address, and another
       you directly specify the video memory address, and another
+
 
+
 
       one where you specify x/y coordinates (in character unit).
 
       one where you specify x/y coordinates (in character unit).
 
 
       The second form is a bit slower but more user-friendly.
 
       The second form is a bit slower but more user-friendly.
  
  
 
+
== put_digit ==
  put_digit(char digit, int vaddr);
+
{|
 
+
|-
  put_digit(char digit, char x, char y);
+
! void put_digit(char digit, int vaddr);
 
+
|-
 
+
! void put_digit(char digit, char x, char y);
 
+
|-
 +
|
 
       Output a digit character '0'-'9' given its numeric
 
       Output a digit character '0'-'9' given its numeric
 
 
       value. Hexa digits ('A'-'F') are also supported,
 
       value. Hexa digits ('A'-'F') are also supported,
 
 
       a value of 10 will output 'A', a value of 11 will
 
       a value of 10 will output 'A', a value of 11 will
 
+
       output 'B', and so on.
       output 'B', and so on...
+
|}
 
+
 
+
 
+
  put_char(char c, int vaddr);
+
 
+
  put_char(char c, char x, char y);
+
 
+
  
  
 +
== put_char ==
 +
{|
 +
|-
 +
! void put_char(char c, int vaddr);
 +
|-
 +
! void put_char(char c, char x, char y);
 +
|-
 +
|
 
       Output an ASCII character.
 
       Output an ASCII character.
 +
|}
  
  
 
+
== put_raw ==
  put_raw(int bat_val, int vaddr);
+
{|
 
+
|-
  put_raw(int bat_val, char x, char y);
+
! void put_raw(int bat_val, int vaddr);
 
+
|-
 
+
! void put_raw(int bat_val, char x, char y);
 
+
|-
 +
|
 +
|-
 +
|
 
       Output a raw bat-value.
 
       Output a raw bat-value.
 +
|}
  
  
 
+
== put_number ==
  put_number(int number, char width, int vaddr);
+
{|
 
+
|-
  put_number(int number, char width, char x, char y);
+
! void put_number(int number, char width, int vaddr);
 
+
|-
 
+
! void put_number(int number, char width, char x, char y);
 
+
|-
 +
|
 
       Output a signed number. The 'width' argument is used
 
       Output a signed number. The 'width' argument is used
 
 
       to format the number. As much as 'width' digit(s)
 
       to format the number. As much as 'width' digit(s)
 
 
       will be displayed. If the number has less than 'width'
 
       will be displayed. If the number has less than 'width'
 
 
       digit(s), blank spaces will be added at its left.
 
       digit(s), blank spaces will be added at its left.
 
 
       If the number is negative, a '-' sign is added.
 
       If the number is negative, a '-' sign is added.
 +
|}
  
  
 
+
== put_hex ==
  put_hex(int number, char width, int vaddr);
+
{|
 
+
|-
  put_hex(int number, char width, char x, char y);
+
! void put_hex(int number, char width, int vaddr);
 
+
|-
 
+
! void put_hex(int number, char width, char x, char y);
 
+
|-
       Output an hexa number.
+
|
 
+
       Output an hexadecimal number.
 
+
|}
 
+
  put_string(char *string, int vaddr);
+
 
+
  put_string(char *string, char x, char y);
+
 
+
  
  
 +
== put_string ==
 +
{|
 +
|-
 +
! void put_string(char *string, int vaddr);
 +
|-
 +
! void put_string(char *string, char x, char y);
 +
|-
 +
|
 
       Output a null terminated ASCII string.
 
       Output a null terminated ASCII string.
 +
|}

Revision as of 01:50, 13 September 2010

Text Output Functions

     All the text output functions have two forms, one where
     you directly specifying the video memory address, and another
     one where you specify x/y coordinates (in character unit).
     The second form is a bit slower but more user-friendly.


put_digit

void put_digit(char digit, int vaddr);
void put_digit(char digit, char x, char y);
     Output a digit character '0'-'9' given its numeric
     value. Hexa digits ('A'-'F') are also supported,
     a value of 10 will output 'A', a value of 11 will
     output 'B', and so on.


put_char

void put_char(char c, int vaddr);
void put_char(char c, char x, char y);
     Output an ASCII character.


put_raw

void put_raw(int bat_val, int vaddr);
void put_raw(int bat_val, char x, char y);
     Output a raw bat-value.


put_number

void put_number(int number, char width, int vaddr);
void put_number(int number, char width, char x, char y);
     Output a signed number. The 'width' argument is used
     to format the number. As much as 'width' digit(s)
     will be displayed. If the number has less than 'width'
     digit(s), blank spaces will be added at its left.
     If the number is negative, a '-' sign is added.


put_hex

void put_hex(int number, char width, int vaddr);
void put_hex(int number, char width, char x, char y);
     Output an hexadecimal number.


put_string

void put_string(char *string, int vaddr);
void put_string(char *string, char x, char y);
     Output a null terminated ASCII string.