aboutsummaryrefslogtreecommitdiffstats
path: root/options.h
blob: 26eed5074b0f6bd9aa17dc335defb22369bd018a (plain)
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
#ifndef OPTIONS_H
#define OPTIONS_H

#include "compiler.h"
#include "hostfile.h"

enum model {
    MODEL_ABC80,
    MODEL_ABC800C,
    MODEL_ABC800M,		/* Partially implemented */
    MODEL_ABC802,
    MODEL_ABC806		/* Not yet implemented */
};

enum tkn80 {
    TKN80_NONE,
    TKN80_MYAB,
    TKN80_GEJO,
    TKN80_29K
};

/*
 * Will be converted to a boolean at the end of command-line parsing
 * if set to A_AUTO at that point. Use the same way as a normal
 * boolean after that point.
 */
enum autobool {
    A_NO,
    A_YES,
    A_AUTO
};

enum memflags {
    MEMFL_DEFAULT = 0,
    MEMFL_NOBASIC = 1,
    MEMFL_NODOS   = 2,
    MEMFL_NOPR    = 4,
    MEMFL_NODEV   = MEMFL_NODOS|MEMFL_NOPR
};

enum abc80_basic {
    BASIC_NONE,			/* No BASIC */
    BASIC_NEW,			/* Checksum 9913 */
    BASIC_10042,		/* Checksum 10042, early "new" */
    BASIC_OLD,			/* Checksum 11723 */
    BASIC_II			/* BASIC II (modified ABC800 BASIC) */
};

/* System options set on the command line */
struct opts {
    enum model model;
    unsigned int kb;	        /* Main memory in kilobytes */
    enum tkn80 tkn80;		/* ABC80 form of 80 characters */
    bool startup_width40;	/* Start in 40-char mode (if applicable) */
    enum abc80_basic basic;	/* BASIC version (ABC80 only) */
    bool color;			/* Color screen */
    bool hr;			/* High resolution graphics (ABC800C/M) */
    bool magic;			/* Allow magic I/O port */
    bool sram;			/* ABC80 SRAM card */
    const char *sram_config;	/* SRAM card per-socket configuration */
    enum autobool faketype;	/* ABC80 keyboard fake for high speeds */
    enum memflags memflags;	/* Memory configuration */
    double hz;			/* Frequency in Hz (HUGE_VAL if unlimited) */
};
extern struct opts opts;

/* Predicates for when adding future models */

/* Any ABC80 model */
static inline bool is_abc80(void)
{
    return opts.model == MODEL_ABC80;
}

/* Any ABC800 model */
static inline bool is_abc800(void)
{
  return opts.model != MODEL_ABC80;
}

#endif