Mercurial > repos > blastem
diff lc8951.h @ 2065:02a9846668d1 segacd
Implement transfer of data from CDC to elsewhere. Other miscellaneous CDD/CDC improvements
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 29 Jan 2022 17:43:37 -0800 |
parents | 07ed42bd7b4c |
children | a61a8a87410c |
line wrap: on
line diff
--- a/lc8951.h Fri Jan 28 22:48:06 2022 -0800 +++ b/lc8951.h Sat Jan 29 17:43:37 2022 -0800 @@ -3,35 +3,40 @@ #include <stdint.h> +typedef uint8_t (*lcd8951_byte_recv_fun)(void *data, uint8_t byte); + typedef struct { + lcd8951_byte_recv_fun byte_handler; + void *handler_data; uint32_t cycle; uint32_t clock_step; uint32_t decode_end; uint32_t transfer_end; - uint8_t buffer[0x4000]; + uint8_t buffer[0x4000]; - uint8_t regs[16]; - uint8_t comin[8]; + uint8_t regs[16]; + uint8_t comin[8]; uint16_t dac; - uint8_t comin_write; - uint8_t comin_count; - uint8_t ifctrl; - uint8_t ctrl0; - uint8_t ctrl1; - uint8_t ar; - uint8_t ar_mask; - uint8_t decoding; + uint8_t comin_write; + uint8_t comin_count; + uint8_t ifctrl; + uint8_t ctrl0; + uint8_t ctrl1; + uint8_t ar; + uint8_t ar_mask; + uint8_t decoding; uint16_t ptl_internal; } lc8951; -void lc8951_init(lc8951 *context); +void lc8951_init(lc8951 *context, lcd8951_byte_recv_fun byte_handler, void *handler_data); void lc8951_run(lc8951 *context, uint32_t cycle); void lc8951_reg_write(lc8951 *context, uint8_t value); uint8_t lc8951_reg_read(lc8951 *context); void lc8951_ar_write(lc8951 *context, uint8_t value); void lc8951_write_byte(lc8951 *context, uint32_t cycle, int sector_offset, uint8_t byte); uint32_t lc8951_next_interrupt(lc8951 *context); +void lc8951_resume_transfer(lc8951 *context); #endif //LC8951_H_