Mercurial > repos > blastem
comparison lc8951.h @ 2072:cc13c100b027
Merge Sega CD branch now that it sort of works
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 30 Jan 2022 22:29:29 -0800 |
parents | f22e04b69272 |
children | 28b6453cf7e3 |
comparison
equal
deleted
inserted
replaced
2052:3748a2a8a4b7 | 2072:cc13c100b027 |
---|---|
1 #ifndef LC8951_H_ | |
2 #define LC8951_H_ | |
3 | |
4 #include <stdint.h> | |
5 | |
6 typedef uint8_t (*lcd8951_byte_recv_fun)(void *data, uint8_t byte); | |
7 | |
8 typedef struct { | |
9 lcd8951_byte_recv_fun byte_handler; | |
10 void *handler_data; | |
11 uint32_t cycle; | |
12 uint32_t clock_step; | |
13 uint32_t decode_end; | |
14 uint32_t transfer_end; | |
15 | |
16 uint8_t buffer[0x4000]; | |
17 | |
18 uint8_t regs[16]; | |
19 uint8_t comin[8]; | |
20 | |
21 uint16_t dac; | |
22 uint8_t comin_write; | |
23 uint8_t comin_count; | |
24 uint8_t ifctrl; | |
25 uint8_t ctrl0; | |
26 uint8_t ctrl1; | |
27 uint8_t ar; | |
28 uint8_t ar_mask; | |
29 } lc8951; | |
30 | |
31 void lc8951_init(lc8951 *context, lcd8951_byte_recv_fun byte_handler, void *handler_data); | |
32 void lc8951_run(lc8951 *context, uint32_t cycle); | |
33 void lc8951_reg_write(lc8951 *context, uint8_t value); | |
34 uint8_t lc8951_reg_read(lc8951 *context); | |
35 void lc8951_ar_write(lc8951 *context, uint8_t value); | |
36 void lc8951_write_byte(lc8951 *context, uint32_t cycle, int sector_offset, uint8_t byte); | |
37 uint32_t lc8951_next_interrupt(lc8951 *context); | |
38 void lc8951_resume_transfer(lc8951 *context, uint32_t cycle); | |
39 void lc8951_adjust_cycles(lc8951 *context, uint32_t deduction); | |
40 | |
41 #endif //LC8951_H_ |