forked from jeremyrayner/beebem-rg350
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeebconfig.h
99 lines (75 loc) · 2.21 KB
/
beebconfig.h
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef BEEBCONFIG_HEADER
#define BEEBCONFIG_HEADER
/* BeebEm configuration structures:
*
* All configurable details are stored here.
*/
#define MAX_DIR_LEN 256+1
//#define MAX_DIR_LEN 1024+1
void ClearXX(void);
void PrintXX(char*);
typedef struct {
char root_dir[MAX_DIR_LEN];
char font_loc[MAX_DIR_LEN];
char teletext_font_loc[MAX_DIR_LEN];
char owl_loc[MAX_DIR_LEN];
char romimg_rc_loc[MAX_DIR_LEN];
char romimg_dir[MAX_DIR_LEN];
char default_config_loc[MAX_DIR_LEN];
char forced_config_loc[MAX_DIR_LEN];
char disc_images_dir[MAX_DIR_LEN];
char save_state_dir[MAX_DIR_LEN];
char kbd_files_dir[MAX_DIR_LEN];
char virtual_keyboard_loc[MAX_DIR_LEN];
// char xx[1024*5];
} BeebConfig_Files;
enum Scaling {CENTER, TOP, BOTTOM, SCALED};
enum Orientation {NORMAL, REVERSED};
enum Protection8271 {RO_8271, RW_8271};
enum Stick{CRITICAL, MULTI, HORIZONTAL, VERTICAL};
/* Not all settings are read from here, but these values should
* be set via routines that control the setting:
*/
typedef struct {
unsigned int speed;
unsigned int volume;
Scaling vscale;
Orientation orientation;
Protection8271 protection_8271_0;
Protection8271 protection_8271_1;
Stick stick;
int disable_cursor;
int vsyncoffset;
int skin;
} BeebConfig_Settings;
typedef struct {
int x, y, z;
} BeebConfig_Diagnostic;
/* Main configuration structure for an instance of BeebEm:
*/
typedef struct {
BeebConfig_Files files;
BeebConfig_Settings settings;
BeebConfig_Diagnostic diagostic;
char drive_0_path[MAX_DIR_LEN];
char drive_1_path[MAX_DIR_LEN];
} BeebConfig;
/* Initialize/Free:
*/
void Config_Initialize(const char *executable_name_p);
void Config_FreeResources();
int Config_LoadDiscConfig(const char *filename_p);
const char* Config_GetDiscImageFilename(unsigned int drive);
const char* Config_GetDiscImagePath(void);
const char* Config_GetSaveStatePath(void);
/* SET options:
*/
void RemoveLeadingWhiteSpace(char *p);
void RemoveTrailingWhiteSpace(char *p);
int ParseSetOption(char *p, char **name_pp, char **value_pp);
void ActionSetOption(char *name_p, char *value_p);
int ProcessSetOption(char *p);
/* Accessor wrappers:
*/
#define Config_DisableCursor (config.settings.disable_cursor)
#endif