Mercurial > repos > blastem
comparison vdp.h @ 317:e5e8b48ad157
Initial stab at horizontal interrupts and improving accuracy of vertical interrupts. Also added the VINT pending flag to status port.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 10 May 2013 22:57:56 -0700 |
parents | d3266cee02c9 |
children | 8e2fa485c0f2 |
comparison
equal
deleted
inserted
replaced
316:fd7c24b97ebf | 317:e5e8b48ad157 |
---|---|
28 #define FBUF_SRC_S 0x6000 | 28 #define FBUF_SRC_S 0x6000 |
29 #define FBUF_SRC_BG 0x8000 | 29 #define FBUF_SRC_BG 0x8000 |
30 | 30 |
31 #define MCLKS_LINE 3420 | 31 #define MCLKS_LINE 3420 |
32 | 32 |
33 #define FLAG_DOT_OFLOW 0x1 | 33 #define FLAG_DOT_OFLOW 0x01 |
34 #define FLAG_CAN_MASK 0x2 | 34 #define FLAG_CAN_MASK 0x02 |
35 #define FLAG_MASKED 0x4 | 35 #define FLAG_MASKED 0x04 |
36 #define FLAG_WINDOW 0x8 | 36 #define FLAG_WINDOW 0x08 |
37 #define FLAG_PENDING 0x10 | 37 #define FLAG_PENDING 0x10 |
38 #define FLAG_UNUSED_SLOT 0x20 | 38 #define FLAG_UNUSED_SLOT 0x20 |
39 #define FLAG_DMA_RUN 0x40 | 39 #define FLAG_DMA_RUN 0x40 |
40 #define FLAG_DMA_PROG 0x80 | 40 #define FLAG_DMA_PROG 0x80 |
41 | |
42 #define FLAG2_VINT_PENDING 0x01 | |
43 #define FLAG2_HINT_PENDING 0x02 | |
41 | 44 |
42 #define DISPLAY_ENABLE 0x40 | 45 #define DISPLAY_ENABLE 0x40 |
43 | 46 |
44 enum { | 47 enum { |
45 REG_MODE_1=0, | 48 REG_MODE_1=0, |
113 uint16_t col_1; | 116 uint16_t col_1; |
114 uint16_t col_2; | 117 uint16_t col_2; |
115 uint16_t dma_val; | 118 uint16_t dma_val; |
116 uint8_t v_offset; | 119 uint8_t v_offset; |
117 uint8_t dma_cd; | 120 uint8_t dma_cd; |
121 uint8_t hint_counter; | |
122 uint8_t flags2; | |
118 uint8_t *tmp_buf_a; | 123 uint8_t *tmp_buf_a; |
119 uint8_t *tmp_buf_b; | 124 uint8_t *tmp_buf_b; |
120 } vdp_context; | 125 } vdp_context; |
121 | 126 |
122 void init_vdp_context(vdp_context * context); | 127 void init_vdp_context(vdp_context * context); |
131 int vdp_data_port_write(vdp_context * context, uint16_t value); | 136 int vdp_data_port_write(vdp_context * context, uint16_t value); |
132 uint16_t vdp_control_port_read(vdp_context * context); | 137 uint16_t vdp_control_port_read(vdp_context * context); |
133 uint16_t vdp_data_port_read(vdp_context * context); | 138 uint16_t vdp_data_port_read(vdp_context * context); |
134 uint16_t vdp_hv_counter_read(vdp_context * context); | 139 uint16_t vdp_hv_counter_read(vdp_context * context); |
135 void vdp_adjust_cycles(vdp_context * context, uint32_t deduction); | 140 void vdp_adjust_cycles(vdp_context * context, uint32_t deduction); |
141 uint32_t vdp_next_hint(vdp_context * context); | |
142 uint32_t vdp_next_vint(vdp_context * context); | |
143 void vdp_int_ack(vdp_context * context, uint16_t int_num); | |
136 | 144 |
137 #endif //VDP_H_ | 145 #endif //VDP_H_ |