comparison vdp.h @ 1866:84f16a804ce5

Rework sprite rendering phase 3 to better match behavior documented by Kabuto/Titan and fix edge case in sprite overflow flag that was breaking the RPS minigame in Alex Kidd
author Michael Pavone <pavone@retrodev.com>
date Thu, 20 Jun 2019 22:31:31 -0700
parents 4f3443ecb6d6
children dc94354eab66
comparison
equal deleted inserted replaced
1865:4c322abd9fa5 1866:84f16a804ce5
22 #define BORDER_RIGHT 14 22 #define BORDER_RIGHT 14
23 #define HORIZ_BORDER (BORDER_LEFT+BORDER_RIGHT) 23 #define HORIZ_BORDER (BORDER_LEFT+BORDER_RIGHT)
24 #define LINEBUF_SIZE (320+HORIZ_BORDER) //H40 + full border 24 #define LINEBUF_SIZE (320+HORIZ_BORDER) //H40 + full border
25 #define SCROLL_BUFFER_SIZE 32 25 #define SCROLL_BUFFER_SIZE 32
26 #define BORDER_BOTTOM 13 //TODO: Replace with actual value 26 #define BORDER_BOTTOM 13 //TODO: Replace with actual value
27 #define MAX_DRAWS 40
28 #define MAX_DRAWS_H32 32
29 #define MAX_DRAWS_H32_MODE4 8 27 #define MAX_DRAWS_H32_MODE4 8
30 #define MAX_SPRITES_LINE 20 28 #define MAX_SPRITES_LINE 20
31 #define MAX_SPRITES_LINE_H32 16 29 #define MAX_SPRITES_LINE_H32 16
32 #define MAX_SPRITES_FRAME 80 30 #define MAX_SPRITES_FRAME 80
33 #define MAX_SPRITES_FRAME_H32 64 31 #define MAX_SPRITES_FRAME_H32 64
131 typedef struct { 129 typedef struct {
132 uint16_t address; 130 uint16_t address;
133 int16_t x_pos; 131 int16_t x_pos;
134 uint8_t pal_priority; 132 uint8_t pal_priority;
135 uint8_t h_flip; 133 uint8_t h_flip;
134 uint8_t width;
135 uint8_t height;
136 } sprite_draw; 136 } sprite_draw;
137 137
138 typedef struct { 138 typedef struct {
139 uint8_t size; 139 uint8_t size;
140 uint8_t index; 140 uint8_t index;
193 uint16_t border_bot; 193 uint16_t border_bot;
194 uint16_t hscroll_a; 194 uint16_t hscroll_a;
195 uint16_t hscroll_b; 195 uint16_t hscroll_b;
196 uint16_t h40_lines; 196 uint16_t h40_lines;
197 uint16_t output_lines; 197 uint16_t output_lines;
198 sprite_draw sprite_draw_list[MAX_DRAWS]; 198 sprite_draw sprite_draw_list[MAX_SPRITES_LINE];
199 sprite_info sprite_info_list[MAX_SPRITES_LINE]; 199 sprite_info sprite_info_list[MAX_SPRITES_LINE];
200 uint8_t sat_cache[SAT_CACHE_SIZE]; 200 uint8_t sat_cache[SAT_CACHE_SIZE];
201 uint16_t col_1; 201 uint16_t col_1;
202 uint16_t col_2; 202 uint16_t col_2;
203 uint16_t hv_latch; 203 uint16_t hv_latch;