summaryrefslogtreecommitdiff
path: root/vdp.h
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-08-22 09:46:18 -0700
committerMichael Pavone <pavone@retrodev.com>2016-08-22 09:46:18 -0700
commit4a56a7e2dfe615e03e81e29952003291090470fe (patch)
treee2a7fc9bc4d4188f934d8dcd80afba0ec278c8a7 /vdp.h
parent00c00b816bac8f05e49f4733ecbedd363b0b8da2 (diff)
Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Diffstat (limited to 'vdp.h')
-rw-r--r--vdp.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/vdp.h b/vdp.h
index 7812ee1..feca77d 100644
--- a/vdp.h
+++ b/vdp.h
@@ -13,8 +13,8 @@
#define CRAM_SIZE 64
#define VSRAM_SIZE 40
#define VRAM_SIZE (64*1024)
-#define LINEBUF_SIZE 320
-#define FRAMEBUF_ENTRIES (320+27)*(240+27) //PAL active display + full border
+#define LINEBUF_SIZE (320+27) //H40 + full border
+#define BORDER_BOTTOM 13 //TODO: Replace with actual value
#define MAX_DRAWS 40
#define MAX_DRAWS_H32 32
#define MAX_SPRITES_LINE 20
@@ -51,6 +51,7 @@
#define FLAG2_READ_PENDING 0x04
#define FLAG2_SPRITE_COLLIDE 0x08
#define FLAG2_REGION_PAL 0x10
+#define FLAG2_EVEN_FIELD 0x20
#define DISPLAY_ENABLE 0x40
@@ -138,15 +139,14 @@ typedef struct {
uint8_t *vdpmem;
//stores 2-bit palette + 4-bit palette index + priority for current sprite line
uint8_t *linebuf;
- //stores 12-bit color + shadow/highlight bits
- void *framebuf;
- void *oddbuf;
- void *evenbuf;
+ //pointer to current line in framebuffer
+ uint32_t *output;
uint16_t cram[CRAM_SIZE];
uint32_t colors[CRAM_SIZE*3];
uint32_t debugcolors[1 << (3 + 1 + 1 + 1)];//3 bits for source, 1 bit for priority, 1 bit for shadow, 1 bit for hilight
uint16_t vsram[VSRAM_SIZE];
uint16_t vscroll_latch[2];
+ uint32_t output_pitch;
uint32_t frame;
uint16_t vcounter;
uint16_t hscroll_a;
@@ -155,6 +155,7 @@ typedef struct {
uint8_t latched_mode;
uint8_t sprite_index;
uint8_t sprite_draws;
+ uint8_t h40_lines;
int8_t slot_counter;
int8_t cur_slot;
sprite_draw sprite_draw_list[MAX_DRAWS];