README
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
int LeoGetKAdr(int sjis);
You can get the offset address where the kanji charactor is stored by
calling LeoGetKAdr(). The argument is expected to be a Shift-JIS code.
Example:
i=LeoGetKAdr(sjiscode);
dmaIOMessageBuf.hdr.pri = OS_MESG_PRI_NORMAL;
dmaIOMessageBuf.hdr.retQueue = &dmaMessageQ;
dmaIOMessageBuf.dramAddr = &kbuffer[kanadr];
dmaIOMessageBuf.devAddr = DDROM_FONT_START + i;
dmaIOMessageBuf.size = 128;
handler->transferInfo.cmdType = OS_OTHERS;
osEPiStartDma(handler, &dmaIOMessageBuf, OS_READ);
gDPLoadTextureBlock_4b(glistp++,&kbuffer[kanadr],G_IM_FMT_I,16,16,0,G_TX_CLAMP,G_TX_CLAMP,G_TX_NOMASK,G_TX_NOMASK,G_TX_NOLOD,G_TX_NOLOD);
gSPTextureRectangle(glistp++,x<<2,y<<2,(x+16)<<2,(y+16)<<2,0,0,0,0x400,0x400);
int LeoGetAAdr(int code,int *dx,int *dy, int *cy);
You can get the offset address where the alphabet is stored by calling
LeoGetAAdr(). code should be one of the codes between 0x480-0x6BF or
0x780-0x797. The width of the charactor will be stored in dx, the
height of the charactor will be stored in dy, the center y of the
charactor will be stored in cy. The return value of this function is
the offset address from the start address of font data (DDROM_FONT_
START). It's prohibited to specify code other than the values above.
If the return value is -1, it means that the charactor is not readable.
Example:
ofs=LeoGetAAdr(code,&dx,&dy,&cy);
dmaIOMessageBuf.hdr.pri = OS_MESG_PRI_NORMAL;
dmaIOMessageBuf.hdr.retQueue = &dmaMessageQ;
dmaIOMessageBuf.dramAddr = &kbuffer[kanadr];
dmaIOMessageBuf.devAddr = DDROM_FONT_START + ofs;
dmaIOMessageBuf.size = 128;
handler->transferInfo.cmdType = OS_OTHERS;
osEPiStartDma(handler, &dmaIOMessageBuf, OS_READ);
gDPLoadTextureTile_4b(glistp++,&kbuffer[kanadr+ofs],G_IM_FMT_I,dx,dy,0,0,(dx-1)<<G_TEXTURE_IMAGE_FRAC,(dy-1)<<G_TEXTURE_IMAGE_FRAC,0,G_TX_CLAMP,G_TX_CLAMP,G_TX_NOMASK,G_TX_NOMASK,G_TX_NOLOD,G_TX_NOLOD);
gSPTextureRectangle(glistp++,x<<2,(y-cy)<<2,(x+dx)<<2,(y-cy+dy)<<2,0,0,0,0x400,0x400);
For more information, see draw.c. Triggering Z changes the color of the
charactors.