Mercurial > repos > blastem
comparison vdp.h @ 471:f065769836e8
Implement FIFO as a ring buffer so the behavior of reads from invalid CRAM and VSRAM bits can be implemented properly
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 15 Sep 2013 22:20:43 -0700 |
parents | 541c1ae8abf3 |
children | 2e4a4188cfb0 |
comparison
equal
deleted
inserted
replaced
470:541c1ae8abf3 | 471:f065769836e8 |
---|---|
108 uint8_t size; | 108 uint8_t size; |
109 uint8_t index; | 109 uint8_t index; |
110 int16_t y; | 110 int16_t y; |
111 } sprite_info; | 111 } sprite_info; |
112 | 112 |
113 #define FIFO_SIZE 4 | |
114 | |
113 typedef struct { | 115 typedef struct { |
114 uint32_t cycle; | 116 uint32_t cycle; |
115 uint16_t address; | 117 uint16_t address; |
116 uint16_t value; | 118 uint16_t value; |
117 uint8_t cd; | 119 uint8_t cd; |
118 uint8_t partial; | 120 uint8_t partial; |
119 } fifo_entry; | 121 } fifo_entry; |
120 | 122 |
121 typedef struct { | 123 typedef struct { |
122 fifo_entry *fifo_cur; | 124 fifo_entry fifo[FIFO_SIZE]; |
123 fifo_entry *fifo_end; | 125 int32_t fifo_write; |
126 int32_t fifo_read; | |
124 uint16_t address; | 127 uint16_t address; |
125 uint8_t cd; | 128 uint8_t cd; |
126 uint8_t flags; | 129 uint8_t flags; |
127 uint8_t regs[VDP_REGS]; | 130 uint8_t regs[VDP_REGS]; |
128 //cycle count in MCLKs | 131 //cycle count in MCLKs |