diff vdp.c @ 719:019d27995e32

Upgrade to SDL 2.0 and drop support for the non-OpenGL render path
author Michael Pavone <pavone@retrodev.com>
date Wed, 20 May 2015 19:05:11 -0700
parents eaba6789f316
children 15d9359fd771
line wrap: on
line diff
--- a/vdp.c	Wed May 20 10:35:03 2015 -0700
+++ b/vdp.c	Wed May 20 19:05:11 2015 -0700
@@ -62,10 +62,8 @@
 		memset(context->framebuf, 0, FRAMEBUF_ENTRIES * (32 / 8));
 		context->evenbuf = malloc(FRAMEBUF_ENTRIES * (32 / 8));
 		memset(context->evenbuf, 0, FRAMEBUF_ENTRIES * (32 / 8));
-		context->b32 = 1;
 	} else {
 		render_alloc_surfaces(context);
-		context->b32 = render_depth() == 32;
 	}
 	context->framebuf = context->oddbuf;
 	context->linebuf = malloc(LINEBUF_SIZE + SCROLL_BUFFER_SIZE*2);
@@ -788,20 +786,14 @@
 		return;
 	}
 	render_map(context->col_2, context->tmp_buf_b, context->buf_b_off+8, context);
-	uint16_t *dst;
-	uint32_t *dst32;
+	uint32_t *dst;
 	uint8_t *sprite_buf,  *plane_a, *plane_b;
 	int plane_a_off, plane_b_off;
 	if (col)
 	{
 		col-=2;
-		if (context->b32) {
-			dst32 = context->framebuf;
-			dst32 += line * 320 + col * 8;
-		} else {
-			dst = context->framebuf;
-			dst += line * 320 + col * 8;
-		}
+		dst = context->framebuf;
+		dst += line * 320 + col * 8;
 		sprite_buf = context->linebuf + col * 8;
 		uint8_t a_src, src;
 		if (context->flags & FLAG_WINDOW) {
@@ -859,11 +851,7 @@
 				} else {
 					outpixel = colors[pixel];
 				}
-				if (context->b32) {
-					*(dst32++) = outpixel;
-				} else {
-					*(dst++) = outpixel;
-				}
+				*(dst++) = outpixel;
 				//*dst = (context->cram[pixel & 0x3F] & 0xEEE) | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src;
 			}
 		} else {
@@ -890,11 +878,7 @@
 				} else {
 					outpixel = context->colors[pixel & 0x3F];
 				}
-				if (context->b32) {
-					*(dst32++) = outpixel;
-				} else {
-					*(dst++) = outpixel;
-				}
+				*(dst++) = outpixel;
 			}
 		}
 	}
@@ -1445,20 +1429,11 @@
 		}
 	}
 	if (starti >= 0) {
-		if (context->b32) {
-			uint32_t color = context->colors[context->regs[REG_BG_COLOR]];
-			uint32_t * start = context->framebuf;
-			start += starti;
-			for (int i = 0; i < 2; i++) {
-				*(start++) = color;
-			}
-		} else {
-			uint16_t color = context->colors[context->regs[REG_BG_COLOR]];
-			uint16_t * start = context->framebuf;
-			start += starti;
-			for (int i = 0; i < 2; i++) {
-				*(start++) = color;
-			}
+		uint32_t color = context->colors[context->regs[REG_BG_COLOR]];
+		uint32_t * start = context->framebuf;
+		start += starti;
+		for (int i = 0; i < 2; i++) {
+			*(start++) = color;
 		}
 	}
 }