Difference between revisions of "Text Output Functions"
From Archaic Pixels
(Created page with "** TEXT OUTPUT FUNCTIONS ** --------------------------- All the text output functions have two forms, one where you directly specify the video memory address, an...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{: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 | + | |
− | + | ||
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 == | |
− | + | {| | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_digit([color=red]char[/color] digit, [color=blue]int[/color] vaddr); | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_digit([color=red]char[/color] digit, [color=red]char[/color] x, [color=red]char[/color] 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 == | ||
+ | {| | ||
+ | |- | ||
+ | ! [color=green]void[/color] put_char([color=red]char[/color] c, [color=blue]int[/color] vaddr); | ||
+ | |- | ||
+ | ! [color=green]void[/color] put_char([color=red]char[/color] c, [color=red]char[/color] x, [color=red]char[/color] y); | ||
+ | |- | ||
+ | | | ||
Output an ASCII character. | Output an ASCII character. | ||
+ | |} | ||
− | + | == put_raw == | |
− | + | {| | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_raw([color=blue]int[/color] bat_val, [color=blue]int[/color] vaddr); | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_raw([color=blue]int[/color] bat_val, [color=red]char[/color] x, [color=red]char[/color] y); | |
− | + | |- | |
+ | | | ||
+ | |- | ||
+ | | | ||
Output a raw bat-value. | Output a raw bat-value. | ||
+ | |} | ||
− | + | == put_number == | |
− | + | {| | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_number([color=blue]int[/color] number, [color=red]char[/color] width, [color=blue]int[/color] vaddr); | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_number([color=blue]int[/color] number, [color=red]char[/color] width, [color=red]char[/color] x, [color=red]char[/color] 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 == | |
− | + | {| | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_hex([color=blue]int[/color] number, [color=red]char[/color] width, [color=blue]int[/color] vaddr); | |
− | + | |- | |
− | + | ! [color=green]void[/color] put_hex([color=blue]int[/color] number, [color=red]char[/color] width, [color=red]char[/color] x, [color=red]char[/color] y); | |
− | + | |- | |
− | Output an | + | | |
− | + | Output an hexadecimal number. | |
− | + | |} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | == put_string == | ||
+ | {| | ||
+ | |- | ||
+ | ! [color=green]void[/color] put_string([color=red]char[/color] *string, [color=blue]int[/color] vaddr); | ||
+ | |- | ||
+ | ! [color=green]void[/color] put_string([color=red]char[/color] *string, [color=red]char[/color] x, [color=red]char[/color] y); | ||
+ | |- | ||
+ | | | ||
Output a null terminated ASCII string. | Output a null terminated ASCII string. | ||
+ | |} |
Latest revision as of 12:37, 13 September 2010
Contents
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. |