-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.h
126 lines (104 loc) · 2.25 KB
/
header.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#define TEMP_STACK_SIZE 6000
#define ALLOCATIONS 64
struct Allocation
{
struct MemHeader *mh;
UBYTE *addr;
ULONG size;
};
struct MemoryBank
{
UBYTE *addr;
ULONG flags;
UBYTE *targetaddr;
ULONG size;
ULONG targetsize;
ULONG offset;
UBYTE chunk[5];
};
// CHIP, SLOW, FAST
#define MEMORY_REGIONS 3
#define MB_CHIP 0
#define MB_SLOW 1
#define MB_FAST 2
#define MAPROM_ACA500 1
#define MAPROM_ACA500P 2
#define MAPROM_ACA1221EC 3
#define MAPROM_ACA12xx 4
#define MAPROM_GVP 5
#define MAPROM_BLIZZARD12x0 6
#define MAPROM_ACA1233N 7
#define MAPROM_ACA1221LC 8
#define MAPROM_ACA1234 9
#define MAPROM_MMU 255
#define FLAGS_NOCACHE 1
#define FLAGS_FORCEPAL 2
#define FLAGS_FORCENTSC 4
#define FLAGS_PAUSE 8
#define FLAGS_NOCACHE2 16
#define FLAGS_NOFLOPPY 32
struct mapromdata
{
UWORD type;
ULONG config;
ULONG addr;
APTR board;
UBYTE *memunavailable_start;
UBYTE *memunavailable_end;
};
#define MAX_EXTRARAM 4
struct extraram
{
UBYTE *base;
UBYTE *ptr;
ULONG size;
struct MemHeader *head;
};
#define HWTYPE_GENERIC 0
#define HWTYPE_CDTV 1
#define HWTYPE_CD32 2
struct uaestate
{
ULONG flags;
UBYTE *cpu_chunk;
UBYTE *fpu_chunk;
UBYTE *ciaa_chunk, *ciab_chunk;
UBYTE *custom_chunk;
UBYTE *aga_colors_chunk;
UBYTE *floppy_chunk[4];
UBYTE *audio_chunk[4];
UBYTE *sprite_chunk[8];
UBYTE *cd32_chunk;
UBYTE *cdtv_chunk, *cdtv_dmac_chunk;
ULONG *MMU_Level_A;
UBYTE *vbr;
UBYTE *debug_entry;
UBYTE *maprom;
ULONG mapromsize;
ULONG maprom_memlimit;
struct mapromdata mrd[2];
ULONG errors;
struct MemHeader *mem_allocated[MEMORY_REGIONS];
struct MemoryBank membanks[MEMORY_REGIONS];
WORD num_allocations;
struct Allocation allocations[ALLOCATIONS];
struct extraram eram[MAX_EXTRARAM];
WORD hwtype;
UWORD attnflags;
WORD mmutype;
UBYTE *page_ptr;
ULONG page_free;
UWORD romver, romrev;
ULONG exceptionmask;
UBYTE agastate;
UBYTE usemaprom;
UBYTE debug;
UBYTE testmode;
UBYTE nowait;
UBYTE canusemmu;
UBYTE mmuused;
};
UBYTE *extra_allocate(ULONG size, ULONG alignment, struct uaestate *st);
BOOL map_region(struct uaestate *st, void *addr, void *physaddr, ULONG size, BOOL invalid, BOOL writeprotect, BOOL supervisor, UBYTE cachemode);
BOOL unmap_region(struct uaestate *st, void *addr, ULONG size);
BOOL init_mmu(struct uaestate *st);