LeoGetKAdr LeoGetKAdr (function)

LeoGetKAdr, LeoGetAAdr, LeoGetAAdr2

Obtains the storage offset address for a character

Syntax

#include<PR/leo.h>     /* leo.h */

int LeoGetKAdr(int sjis);
int LeoGetAAdr(int code, int *dx, int *dy, int *cy);
int LeoGetAAdr2(int ccode, int *dx, int *dy, int *cy);

Description

A variety of different kanji and ASCII character fonts are held in the mask ROM (DDROM) in the N64 Disk Drive. The application programmer can use these three functions to get the storage address of the desired character.

LeoGetKAdr gets the storage offset address for a kanji character specified by the shift-JIS code in the sjis argument.

The shift-JIS codes take values with the lower two digits ranging 0x40-0x7e and 0x80-0xfc in hexiadecimal values. In "APPENDIX B: Drive-built-in Font Data" of the 64DD Programming Manual, the table that corresponds to values with the lower two digits 0x7f, 0xfd, 0xfe, and 0xff in hexiadecimal values left blank, which doesn't indicate a blank character. Those blanks mean no corresponding characters to the codes are provided. It is not guaranteed that a specific character is displayed if these codes are specified.
Use code 0x8140 for a blank character.

An error value -1 will be returned when a value out of the range of 0x8140 to 0x9872 is specified for sjis.

LeoGetAAdr gets the storage offset address for an ASCII character for the character information data specified by the code argument. The dx argument specified the character width, dy the height, and cy the alignment. An error value of -1 will be returned when a value out of the range of 0 to 0x907 is specified for code. See "APPENDIX B: Drive-built-in Font Data" of the 64DD Programming Manual for information regarding which character code specifically corresponds to which character.

LeoGetAAdr2 gets the storage offset address for a ASCII character for the character information data specified by the code argument. The dx argument specified the character width, dy the height, and cy the alignment. Character Information data can be obtained from the asccode tool.

LeoGetAAdr links with all the data tables regarding characters. LeoGetAAdr2 can be the faster way to go if your use of characters is limited in a game. Using LeoGetAAdr2 can make the size smaller. It is better to use LeoGetAAdr if your game uses all of the characters as is the case, for example, when the game user is presented with a menu of characters to input their name.

The term "offset" refers to the offset from the font portion of the DDROM. You must add DDROM_FONT_START to it in order to make the number refer to the offset from the start (top) of the DDROM. After adding DDROM_FONT_START, pass the resulting number to the osEPiStartDma function.

To learn more about the meaning of the dx, dy, and cy arguments, see the "Font Data" section of the 64DD Programming Manual.

See Also

Leo*CreateLeoManager, asccode

Revision History

04/30/1999 Changed Format