Mercurial > repos > blastem
annotate memmap.h @ 2166:3a6680e9204a
xcftools is no longer packaged by Debian/Ubuntu so switched to imagemagick
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 23 Jul 2022 10:54:07 -0700 |
parents | 9caebcfeac72 |
children |
rev | line source |
---|---|
1595
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef MEMMAP_H_ |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define MEMMAP_H_ |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 typedef enum { |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 READ_16, |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 READ_8, |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 WRITE_16, |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 WRITE_8 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 } ftype; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 #define MMAP_READ 0x01 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 #define MMAP_WRITE 0x02 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 #define MMAP_CODE 0x04 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 #define MMAP_PTR_IDX 0x08 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 #define MMAP_ONLY_ODD 0x10 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 #define MMAP_ONLY_EVEN 0x20 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 #define MMAP_FUNC_NULL 0x40 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 #define MMAP_BYTESWAP 0x80 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 #define MMAP_AUX_BUFF 0x100 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 #define MMAP_READ_CODE 0x200 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 typedef uint16_t (*read_16_fun)(uint32_t address, void * context); |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 typedef uint8_t (*read_8_fun)(uint32_t address, void * context); |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 typedef void * (*write_16_fun)(uint32_t address, void * context, uint16_t value); |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 typedef void * (*write_8_fun)(uint32_t address, void * context, uint8_t value); |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 typedef struct { |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 uint32_t start; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 uint32_t end; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 uint32_t mask; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 uint32_t aux_mask; |
2134
9caebcfeac72
Implement word RAM interleaving in 1M mode, now passes mcd-verificator word RAM tests
Michael Pavone <pavone@retrodev.com>
parents:
1595
diff
changeset
|
32 int32_t shift; |
1595
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 uint16_t ptr_index; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 uint16_t flags; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 void * buffer; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 read_16_fun read_16; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 write_16_fun write_16; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 read_8_fun read_8; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 write_8_fun write_8; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 } memmap_chunk; |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 |
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 #endif //MEMMAP_H_ |