Support for font loading.
This commit is contained in:
1
cfg.cpp
1
cfg.cpp
@@ -48,6 +48,7 @@ const ini_var_t ini_vars[] = {
|
||||
{ "MENU_PAL", (void*)(&(cfg.menu_pal)), UINT8, 0, 1, 1 },
|
||||
{ "BOOTCORE", (void*)(&(cfg.bootcore)), STRING, 0, sizeof(cfg.bootcore) - 1, 1 },
|
||||
{ "BOOTCORE_TIMEOUT", (void*)(&(cfg.bootcore_timeout)), INT16, 10, 30, 1 },
|
||||
{ "FONT", (void*)(&(cfg.font)), STRING, 0, sizeof(cfg.font) - 1, 1 },
|
||||
};
|
||||
|
||||
// mist ini config
|
||||
|
||||
1
cfg.h
1
cfg.h
@@ -37,6 +37,7 @@ typedef struct {
|
||||
char video_conf[1024];
|
||||
char video_conf_pal[1024];
|
||||
char video_conf_ntsc[1024];
|
||||
char font[1024];
|
||||
} cfg_t;
|
||||
|
||||
//// functions ////
|
||||
|
||||
@@ -38,7 +38,7 @@ Middle Dot
|
||||
*/
|
||||
|
||||
// *character font
|
||||
unsigned char charfont[][8] =
|
||||
unsigned char charfont[256][8] =
|
||||
{
|
||||
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, // 0 [0x0]
|
||||
{ 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55 }, // 1 [0x1]
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define CHAR_IS_ALPHA_UPPER(c) (((c) >= 'A') && ((c) <= 'Z'))
|
||||
#define CHAR_IS_ALPHA(c) (CHAR_IS_ALPHA_LOWER(c) || CHAR_IS_ALPHA_UPPER(c))
|
||||
#define CHAR_IS_ALPHANUM(c) (CHAR_IS_ALPHA_LOWER(c) || CHAR_IS_ALPHA_UPPER(c) || CHAR_IS_NUM(c))
|
||||
#define CHAR_IS_SPECIAL(c) (((c) == '[') || ((c) == ']') || ((c) == '-') || ((c) == '_') || ((c) == ',') || ((c) == '.') || ((c) == '='))
|
||||
#define CHAR_IS_SPECIAL(c) (((c) == '[') || ((c) == ']') || ((c) == '-') || ((c) == '_') || ((c) == ',') || ((c) == '.') || ((c) == '=') || ((c) == '/') || ((c) == '(') || ((c) == ')'))
|
||||
#define CHAR_IS_VALID(c) (CHAR_IS_ALPHANUM(c) || CHAR_IS_SPECIAL(c))
|
||||
#define CHAR_IS_SPACE(c) (((c) == ' ') || ((c) == '\t'))
|
||||
#define CHAR_IS_LINEEND(c) (((c) == '\n'))
|
||||
|
||||
@@ -459,6 +459,8 @@ void SetMidiLinkMode(int mode)
|
||||
}
|
||||
}
|
||||
|
||||
extern unsigned char charfont[256][8];
|
||||
|
||||
void user_io_init(const char *path)
|
||||
{
|
||||
char *name;
|
||||
@@ -507,6 +509,7 @@ void user_io_init(const char *path)
|
||||
bootcore_init(path);
|
||||
}
|
||||
parse_video_mode();
|
||||
if(strlen(cfg.font)) FileLoad(cfg.font, &charfont, sizeof(charfont));
|
||||
FileLoadConfig("Volume.dat", &vol_att, 1);
|
||||
vol_att &= 0x1F;
|
||||
if (!cfg.volumectl) vol_att = 0;
|
||||
|
||||
Reference in New Issue
Block a user