Support for font loading.

This commit is contained in:
sorgelig
2019-03-22 19:14:33 +08:00
parent faf262b392
commit fef4b3507a
5 changed files with 7 additions and 2 deletions

View File

@@ -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
View File

@@ -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 ////

View File

@@ -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]

View File

@@ -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'))

View File

@@ -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;