Mercurial > repos > blastem
annotate lc8951.h @ 2061:7c1760b5b3e5 segacd
Implemented basic TOC functionality of CDD MCU
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 27 Jan 2022 00:33:41 -0800 |
parents | 70260f6051dd |
children | 07ed42bd7b4c |
rev | line source |
---|---|
2058
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef LC8951_H_ |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define LC8951_H_ |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdint.h> |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 typedef struct { |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 uint32_t cycles; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 uint8_t buffer[0x4000]; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 uint8_t regs[16]; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 uint8_t comin[8]; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 uint16_t dac; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 uint8_t comin_write; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 uint8_t comin_count; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 uint8_t ifctrl; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 uint8_t ctrl0; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 uint8_t ctrl1; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 uint8_t ar; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 uint8_t ar_mask; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 } lc8951; |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 void lc8951_init(lc8951 *context); |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 //void lc8951_run(lc8951 *context, uint32_t cycle); |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 void lc8951_reg_write(lc8951 *context, uint8_t value); |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 uint8_t lc8951_reg_read(lc8951 *context); |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 void lc8951_ar_write(lc8951 *context, uint8_t value); |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 |
70260f6051dd
Initial work on CDC emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 #endif //LC8951_H_ |