Mercurial > repos > blastem
comparison vdp.h @ 2685:da2e06c42d16
Add a compile-time flag to use RGB565 instead of ABGR/ARGB
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 30 Mar 2025 00:06:53 -0700 |
parents | dbff641a33df |
children | 05915f01046d |
comparison
equal
deleted
inserted
replaced
2684:c649bcc18487 | 2685:da2e06c42d16 |
---|---|
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #include "system.h" | 11 #include "system.h" |
12 #include "serialize.h" | 12 #include "serialize.h" |
13 #include "pixel.h" | |
13 | 14 |
14 #define VDP_REGS 24 | 15 #define VDP_REGS 24 |
15 #define CRAM_SIZE 64 | 16 #define CRAM_SIZE 64 |
16 #define SHADOW_OFFSET CRAM_SIZE | 17 #define SHADOW_OFFSET CRAM_SIZE |
17 #define HIGHLIGHT_OFFSET (SHADOW_OFFSET+CRAM_SIZE) | 18 #define HIGHLIGHT_OFFSET (SHADOW_OFFSET+CRAM_SIZE) |
181 typedef void (*vdp_data_hook)(vdp_context *, uint16_t value); | 182 typedef void (*vdp_data_hook)(vdp_context *, uint16_t value); |
182 | 183 |
183 struct vdp_context { | 184 struct vdp_context { |
184 system_header *system; | 185 system_header *system; |
185 //pointer to current line in framebuffer | 186 //pointer to current line in framebuffer |
186 uint32_t *output; | 187 pixel_t *output; |
187 //pointer to current framebuffer | 188 //pointer to current framebuffer |
188 uint32_t *fb; | 189 pixel_t *fb; |
189 uint8_t *done_composite; | 190 uint8_t *done_composite; |
190 uint32_t *debug_fbs[NUM_DEBUG_TYPES]; | 191 pixel_t *debug_fbs[NUM_DEBUG_TYPES]; |
191 char *kmod_msg_buffer; | 192 char *kmod_msg_buffer; |
192 vdp_hook dma_hook; | 193 vdp_hook dma_hook; |
193 vdp_reg_hook reg_hook; | 194 vdp_reg_hook reg_hook; |
194 vdp_data_hook data_hook; | 195 vdp_data_hook data_hook; |
195 uint32_t kmod_buffer_storage; | 196 uint32_t kmod_buffer_storage; |
201 int32_t fifo_write; | 202 int32_t fifo_write; |
202 int32_t fifo_read; | 203 int32_t fifo_read; |
203 uint32_t address; | 204 uint32_t address; |
204 uint32_t address_latch; | 205 uint32_t address_latch; |
205 uint32_t serial_address; | 206 uint32_t serial_address; |
206 uint32_t colors[CRAM_SIZE*4]; | 207 pixel_t colors[CRAM_SIZE*4]; |
207 uint32_t debugcolors[1 << (3 + 1 + 1 + 1)];//3 bits for source, 1 bit for priority, 1 bit for shadow, 1 bit for hilight | 208 pixel_t debugcolors[1 << (3 + 1 + 1 + 1)];//3 bits for source, 1 bit for priority, 1 bit for shadow, 1 bit for hilight |
208 uint16_t cram[CRAM_SIZE]; | 209 uint16_t cram[CRAM_SIZE]; |
209 uint32_t frame; | 210 uint32_t frame; |
210 uint32_t vsram_size; | 211 uint32_t vsram_size; |
211 uint8_t cd; | 212 uint8_t cd; |
212 uint8_t flags; | 213 uint8_t flags; |