29#ifndef __DC_BIOSFONT_H
30#define __DC_BIOSFONT_H
51#define BFONT_THIN_WIDTH 12
52#define BFONT_WIDE_WIDTH (BFONT_THIN_WIDTH * 2)
53#define BFONT_HEIGHT 24
57#define BFONT_BYTES_PER_CHAR (BFONT_THIN_WIDTH * BFONT_HEIGHT / 8)
64#define BFONT_NARROW_START 0
65#define BFONT_OVERBAR BFONT_NARROW_START
66#define BFONT_ISO_8859_1_33_126 (BFONT_NARROW_START + ( 1 * BFONT_BYTES_PER_CHAR))
67#define BFONT_YEN (BFONT_NARROW_START + (95 * BFONT_BYTES_PER_CHAR))
68#define BFONT_ISO_8859_1_160_255 (BFONT_NARROW_START + (96 * BFONT_BYTES_PER_CHAR))
73#define JISX_0208_ROW_SIZE 94
75#define BFONT_WIDE_START (288 * BFONT_BYTES_PER_CHAR)
77#define BFONT_JISX_0208_ROW1 BFONT_WIDE_START
79#define BFONT_JISX_0208_ROW16 (BFONT_WIDE_START + (658 * BFONT_BYTES_PER_CHAR))
81#define BFONT_JISX_0208_ROW48 (BFONT_JISX_0208_ROW16 + ((32 * JISX_0208_ROW_SIZE) * BFONT_BYTES_PER_CHAR))
84#define BFONT_DREAMCAST_SPECIFIC (BFONT_WIDE_START + (7056 * BFONT_BYTES_PER_CHAR))
86#define BFONT_DC_ICON(offset) (BFONT_DREAMCAST_SPECIFIC + ((offset) * BFONT_BYTES_PER_CHAR))
92#define BFONT_CIRCLECOPYRIGHT BFONT_DC_ICON(0)
93#define BFONT_CIRCLER BFONT_DC_ICON(1)
94#define BFONT_TRADEMARK BFONT_DC_ICON(2)
95#define BFONT_UPARROW BFONT_DC_ICON(3)
96#define BFONT_DOWNARROW BFONT_DC_ICON(4)
97#define BFONT_LEFTARROW BFONT_DC_ICON(5)
98#define BFONT_RIGHTARROW BFONT_DC_ICON(6)
99#define BFONT_UPRIGHTARROW BFONT_DC_ICON(7)
100#define BFONT_DOWNRIGHTARROW BFONT_DC_ICON(8)
101#define BFONT_DOWNLEFTARROW BFONT_DC_ICON(9)
102#define BFONT_UPLEFTARROW BFONT_DC_ICON(10)
103#define BFONT_ABUTTON BFONT_DC_ICON(11)
104#define BFONT_BBUTTON BFONT_DC_ICON(12)
105#define BFONT_CBUTTON BFONT_DC_ICON(13)
106#define BFONT_DBUTTON BFONT_DC_ICON(14)
107#define BFONT_XBUTTON BFONT_DC_ICON(15)
108#define BFONT_YBUTTON BFONT_DC_ICON(16)
109#define BFONT_ZBUTTON BFONT_DC_ICON(17)
110#define BFONT_LTRIGGER BFONT_DC_ICON(18)
111#define BFONT_RTRIGGER BFONT_DC_ICON(19)
112#define BFONT_STARTBUTTON BFONT_DC_ICON(20)
113#define BFONT_VMUICON BFONT_DC_ICON(21)
116#define BFONT_ICON_DIMEN 32
117#define BFONT_VMU_DREAMCAST_SPECIFIC (BFONT_DREAMCAST_SPECIFIC+(22 * BFONT_BYTES_PER_CHAR))
126typedef enum bfont_vmu_icon {
293typedef enum bfont_code {
391 uint32_t bg, uint8_t bpp,
bool opaque, uint32_t c,
392 bool wide,
bool iskana);
407size_t bfont_draw(
void *buffer, uint32_t bufwidth,
bool opaque, uint32_t c);
423 uint32_t c,
bool iskana);
467 uint8_t bpp,
bool opaque,
const char *str);
487 uint8_t bpp,
bool opaque,
const char *fmt, ...)
508 uint8_t bpp,
bool opaque, const
char *fmt,
558 bool opaque, const
char *fmt,
void bfont_draw_str_ex_fmt(void *b, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *fmt,...) __printflike(7
Draw a full formatted string of any sort to any sort of buffer.
void bfont_draw_str_vram_fmt(uint32_t x, uint32_t y, bool opaque, const char *fmt,...) __printflike(4
Draw a full string to video ram.
size_t bfont_draw_ex(void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, uint32_t c, bool wide, bool iskana)
Draw a single character of any sort to the buffer.
size_t bfont_draw_thin(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c, bool iskana)
Draw a single thin character to a buffer.
uint8_t * bfont_find_char_jp_half(uint32_t ch)
Find an half-width Japanese character in the font.
void bfont_draw_str_ex(void *b, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *str)
Draw a full string of any sort to any sort of buffer.
size_t bfont_draw(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single character to a buffer.
void bfont_set_encoding(bfont_code_t enc)
Set the font encoding.
void void bfont_draw_str_ex_vfmt(void *b, uint32_t width, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, const char *fmt, va_list *var_args)
Draw formatted string of any sort to buffer (with va_args).
uint32_t bfont_set_background_color(uint32_t c)
Set the font background color.
uint8_t * bfont_find_icon(bfont_vmu_icon_t icon)
Find a VMU icon.
void bfont_draw_str(void *b, uint32_t width, bool opaque, const char *str)
Draw a full string to a buffer.
void void bfont_draw_str_vram_vfmt(uint32_t x, uint32_t y, uint32_t fg, uint32_t bg, bool opaque, const char *fmt, va_list *var_args)
Draw a full formatted string to video ram (with va_args).
size_t bfont_draw_wide(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single wide character to a buffer.
uint32_t bfont_set_foreground_color(uint32_t c)
Set the font foreground color.
uint8_t * bfont_find_char(uint32_t ch)
Find an ISO-8859-1 character in the font.
bfont_code_t
Definition biosfont.h:293
@ BFONT_CODE_ISO8859_1
ISO-8859-1 (western) charset.
Definition biosfont.h:294
@ BFONT_CODE_RAW
Raw indexing to the BFONT.
Definition biosfont.h:297
@ BFONT_CODE_SJIS
Shift-JIS charset.
Definition biosfont.h:296
@ BFONT_CODE_EUC
EUC-JP charset.
Definition biosfont.h:295
void bfont_draw_str_fmt(void *b, uint32_t width, bool opaque, const char *fmt,...) __printflike(4
Draw a full formatted string to a buffer.
uint8_t * bfont_find_char_jp(uint32_t ch)
Find an full-width Japanese character in the font.
Definitions for builtin attributes and compiler directives.
bfont_vmu_icon_t
Builtin VMU Icons.
Definition biosfont.h:126
@ BFONT_ICON_INVALID_VMU
Invalid.
Definition biosfont.h:127
@ BFONT_ICON_BOAT
Boat.
Definition biosfont.h:171
@ BFONT_ICON_TREBLE_CLEF
Treble clef.
Definition biosfont.h:170
@ BFONT_ICON_CUP
Cup.
Definition biosfont.h:180
@ BFONT_ICON_GRID
Grid.
Definition biosfont.h:250
@ BFONT_ICON_HOURGLASS_FOUR
Hourglass 4.
Definition biosfont.h:131
@ BFONT_ICON_CLOCK
Clock.
Definition biosfont.h:177
@ BFONT_ICON_W
W letter
Definition biosfont.h:245
@ BFONT_ICON_TWO_STARS
Two stars.
Definition biosfont.h:201
@ BFONT_ICON_EMBROIDERY
Embroidery.
Definition biosfont.h:255
@ BFONT_ICON_HOURGLASS_THREE
Hourglass 3.
Definition biosfont.h:130
@ BFONT_ICON_Q
Q letter
Definition biosfont.h:239
@ BFONT_ICON_TEDDY_BEAR
Teddy bear.
Definition biosfont.h:192
@ BFONT_ICON_3
3 digit
Definition biosfont.h:216
@ BFONT_ICON_0
0 digit
Definition biosfont.h:213
@ BFONT_ICON_PIANO
Piano.
Definition biosfont.h:167
@ BFONT_ICON_G
G letter
Definition biosfont.h:229
@ BFONT_ICON_BULB
Bulb.
Definition biosfont.h:191
@ BFONT_ICON_CLOUD
Cloud.
Definition biosfont.h:198
@ BFONT_ICON_CACTUS
Cactus.
Definition biosfont.h:166
@ BFONT_ICON_UMBRELLA
Umbrella.
Definition biosfont.h:199
@ BFONT_ICON_TRUCK
Truck.
Definition biosfont.h:176
@ BFONT_ICON_C
C letter
Definition biosfont.h:225
@ BFONT_ICON_HOURGLASS_TWO
Hourglass 2.
Definition biosfont.h:129
@ BFONT_ICON_9
9 digit
Definition biosfont.h:222
@ BFONT_ICON_SATURN
Saturn.
Definition biosfont.h:134
@ BFONT_ICON_LAUGHING_FACE
Laughing face.
Definition biosfont.h:136
@ BFONT_ICON_CRAB
Crab.
Definition biosfont.h:155
@ BFONT_ICON_HOURGLASS_ONE
Hourglass 1.
Definition biosfont.h:128
@ BFONT_ICON_SAKURA
Sakura.
Definition biosfont.h:163
@ BFONT_ICON_MONKEY
Monkye.
Definition biosfont.h:146
@ BFONT_ICON_I
I letter
Definition biosfont.h:231
@ BFONT_ICON_K
K letter
Definition biosfont.h:233
@ BFONT_ICON_KING
King.
Definition biosfont.h:210
@ BFONT_ICON_LIGHTNING
Lightning.
Definition biosfont.h:196
@ BFONT_ICON_TELEPHONE
Telephone.
Definition biosfont.h:178
@ BFONT_ICON_BASEBALL
Baseball.
Definition biosfont.h:189
@ BFONT_ICON_BEAR
Bear.
Definition biosfont.h:148
@ BFONT_ICON_H
H letter
Definition biosfont.h:230
@ BFONT_ICON_R
R letter
Definition biosfont.h:240
@ BFONT_ICON_BOOK
Book.
Definition biosfont.h:188
@ BFONT_ICON_U
U letter
Definition biosfont.h:243
@ BFONT_ICON_4
4 digit
Definition biosfont.h:217
@ BFONT_ICON_QUARTER_MOON
Quarter moon.
Definition biosfont.h:135
@ BFONT_ICON_PANDA
Panda.
Definition biosfont.h:147
@ BFONT_ICON_CHERRIES
Cherries.
Definition biosfont.h:160
@ BFONT_ICON_LION
Lion.
Definition biosfont.h:145
@ BFONT_ICON_ANGRY_FACE
Angry face.
Definition biosfont.h:139
@ BFONT_ICON_HORSE
Horse.
Definition biosfont.h:141
@ BFONT_ICON_CROWN
Crown.
Definition biosfont.h:184
@ BFONT_ICON_F
F letter
Definition biosfont.h:228
@ BFONT_ICON_ANGLER_FISH
Angler fish.
Definition biosfont.h:158
@ BFONT_ICON_1
1 digit
Definition biosfont.h:214
@ BFONT_ICON_V
V letter
Definition biosfont.h:244
@ BFONT_ICON_B
B letter
Definition biosfont.h:224
@ BFONT_ICON_2
2 digit
Definition biosfont.h:215
@ BFONT_ICON_WHALE
Whale.
Definition biosfont.h:154
@ BFONT_ICON_X
X letter
Definition biosfont.h:246
@ BFONT_ICON_HELMET
Helmet.
Definition biosfont.h:173
@ BFONT_ICON_CLUB
Club.
Definition biosfont.h:207
@ BFONT_ICON_CHECKER_BOARD
Checker board.
Definition biosfont.h:249
@ BFONT_ICON_DIAMOND
Diamond.
Definition biosfont.h:205
@ BFONT_ICON_JACK
Jack.
Definition biosfont.h:208
@ BFONT_ICON_ISLAND
Island.
Definition biosfont.h:212
@ BFONT_ICON_APPLE
Apple.
Definition biosfont.h:164
@ BFONT_ICON_JOKER
Joker.
Definition biosfont.h:211
@ BFONT_ICON_DARK_GRAY
Dark gray.
Definition biosfont.h:254
@ BFONT_ICON_CAKE
cake
Definition biosfont.h:186
@ BFONT_ICON_VAN
Van.
Definition biosfont.h:175
@ BFONT_ICON_L
L letter
Definition biosfont.h:234
@ BFONT_ICON_CAR
Car.
Definition biosfont.h:172
@ BFONT_ICON_CASUAL_FACE
Casual face.
Definition biosfont.h:138
@ BFONT_ICON_CHICK
Chick.
Definition biosfont.h:144
@ BFONT_ICON_7
7 digit
Definition biosfont.h:220
@ BFONT_ICON_BELL
Bell.
Definition biosfont.h:183
@ BFONT_ICON_S
S letter
Definition biosfont.h:241
@ BFONT_ICON_PENGUIN
Penguin.
Definition biosfont.h:159
@ BFONT_ICON_DOG
Dog.
Definition biosfont.h:150
@ BFONT_ICON_LIGHT_GRAY
Light gray.
Definition biosfont.h:251
@ BFONT_ICON_BOW_ARROW
Bow and arrow.
Definition biosfont.h:194
@ BFONT_ICON_BOW_TIE
Bow tie.
Definition biosfont.h:193
@ BFONT_ICON_VMUICON
VMU.
Definition biosfont.h:132
@ BFONT_ICON_FOUR_STARS
Four stars.
Definition biosfont.h:203
@ BFONT_ICON_M
M letter
Definition biosfont.h:235
@ BFONT_ICON_OCTOPUS
Octopus.
Definition biosfont.h:152
@ BFONT_ICON_SNOWMAN
Snowman.
Definition biosfont.h:195
@ BFONT_ICON_FISH
Fish.
Definition biosfont.h:151
@ BFONT_ICON_SPADE
Spade.
Definition biosfont.h:206
@ BFONT_ICON_A
A letter
Definition biosfont.h:223
@ BFONT_ICON_LADYBUG
Ladybug.
Definition biosfont.h:157
@ BFONT_ICON_5
5 digit
Definition biosfont.h:218
@ BFONT_ICON_SUN
Sun.
Definition biosfont.h:197
@ BFONT_ICON_P
P letter
Definition biosfont.h:238
@ BFONT_ICON_SOCK
Sock.
Definition biosfont.h:185
@ BFONT_ICON_DIAG_GRID
Diagonal grid.
Definition biosfont.h:252
@ BFONT_ICON_D
D letter
Definition biosfont.h:226
@ BFONT_ICON_Y
Y letter
Definition biosfont.h:247
@ BFONT_ICON_E
E letter
Definition biosfont.h:227
@ BFONT_ICON_SOCCER
Soccer.
Definition biosfont.h:190
@ BFONT_ICON_RABBIT
Rabbit.
Definition biosfont.h:142
@ BFONT_ICON_EIGHTH_NOTE
Eighth note.
Definition biosfont.h:169
@ BFONT_ICON_ICECREAM
Ice cream.
Definition biosfont.h:165
@ BFONT_ICON_SILVERWARE
Silverware.
Definition biosfont.h:181
@ BFONT_ICON_LEAF
Leaf.
Definition biosfont.h:162
@ BFONT_ICON_HEART
Heart.
Definition biosfont.h:204
@ BFONT_ICON_PIG
Pig.
Definition biosfont.h:149
@ BFONT_ICON_COW
Cow.
Definition biosfont.h:140
@ BFONT_ICON_THREE_STARS
Three stars.
Definition biosfont.h:202
@ BFONT_ICON_O
O letter
Definition biosfont.h:237
@ BFONT_ICON_SMILING_FACE
Smiling face.
Definition biosfont.h:137
@ BFONT_ICON_T
T letter
Definition biosfont.h:242
@ BFONT_ICON_KEY
Key.
Definition biosfont.h:187
@ BFONT_ICON_GUITAR
Guitar.
Definition biosfont.h:168
@ BFONT_ICON_PACMAN_GRID
Pacman grid.
Definition biosfont.h:253
@ BFONT_ICON_QUEEN
Queen.
Definition biosfont.h:209
@ BFONT_ICON_CAT
Cat.
Definition biosfont.h:143
@ BFONT_ICON_EARTH
Earth.
Definition biosfont.h:133
@ BFONT_ICON_PENCIL
Pencil.
Definition biosfont.h:179
@ BFONT_ICON_ONE_STAR
One star.
Definition biosfont.h:200
@ BFONT_ICON_BUTTERFLY
Butterfly.
Definition biosfont.h:156
@ BFONT_ICON_TULIP
Tulip.
Definition biosfont.h:161
@ BFONT_ICON_HOUSE
House.
Definition biosfont.h:182
@ BFONT_ICON_SQUID
Squid.
Definition biosfont.h:153
@ BFONT_ICON_8
8 digit
Definition biosfont.h:221
@ BFONT_ICON_J
J letter
Definition biosfont.h:232
@ BFONT_ICON_Z
Z letter
Definition biosfont.h:248
@ BFONT_ICON_MOTORCYCLE
Motorcycle.
Definition biosfont.h:174
@ BFONT_ICON_N
N letter
Definition biosfont.h:236
@ BFONT_ICON_6
6 digit
Definition biosfont.h:219
#define __printflike(fmtarg, firstvararg)
Identify a function as accepting formatting like printf().
Definition cdefs.h:132