changeset 30:03f9bb57cc54

Small cleanup
author Mike Pavone <pavone@retrodev.com>
date Sat, 08 Dec 2012 20:02:10 -0800
parents 9477d1289595
children 25016576b5f3
files vdp.c
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Sat Dec 08 19:59:32 2012 -0800
+++ b/vdp.c	Sat Dec 08 20:02:10 2012 -0800
@@ -180,9 +180,9 @@
 	}
 	uint16_t hscroll, offset;
 	for (int i = 0; i < 2; i++) {
-		hscroll = (hscroll_val + (column-(0-i)) * 8) & hscroll_mask;
+		hscroll = (hscroll_val + (column + i) * 8) & hscroll_mask;
 		offset = address + ((vscroll * v_mul + hscroll/4) & 0x1FFF);
-		printf("%s | line: %d, col: %d, x: %d, hs_mask %X, v_mul: %d, scr reg: %X, tbl addr: %X\n", (vsram_off ? "B" : "A"), line, (column-(2-i)), hscroll, hscroll_mask, v_mul, context->regs[REG_SCROLL], offset);
+		//printf("%s | line: %d, col: %d, x: %d, hs_mask %X, v_mul: %d, scr reg: %X, tbl addr: %X\n", (vsram_off ? "B" : "A"), line, (column-(2-i)), hscroll, hscroll_mask, v_mul, context->regs[REG_SCROLL], offset);
 		uint16_t col_val = (context->vdpmem[offset] << 8) | context->vdpmem[offset+1];
 		if (i) {
 			context->col_2 = col_val;
@@ -257,13 +257,8 @@
 		sprite_buf = context->linebuf + col * 8;
 		plane_a = context->tmp_buf_a + 8 - (context->hscroll_a & 0x7);
 		plane_b = context->tmp_buf_b + 8 - (context->hscroll_b & 0x7);
-		/*if (col == 40)
-		{
-			end = dst + 8;
-		} else {*/
-			end = dst + 16;
-		//}
-		printf("A | tmp_buf offset: %d\n", 8 - (context->hscroll_a & 0x7));
+		end = dst + 16;
+		//printf("A | tmp_buf offset: %d\n", 8 - (context->hscroll_a & 0x7));
 		for (; dst < end; ++plane_a, ++plane_b, ++sprite_buf, ++dst) {
 			uint8_t pixel;
 			if (*sprite_buf & BUF_BIT_PRIORITY && *sprite_buf & 0xF) {
@@ -424,7 +419,7 @@
 		address += line * 4;
 		context->hscroll_a = context->vdpmem[address] << 8 | context->vdpmem[address+1];
 		context->hscroll_b = context->vdpmem[address+2] << 8 | context->vdpmem[address+3];
-		printf("%d: HScroll A: %d, HScroll B: %d\n", line, context->hscroll_a, context->hscroll_b);
+		//printf("%d: HScroll A: %d, HScroll B: %d\n", line, context->hscroll_a, context->hscroll_b);
 		break;
 	case 36:
 	//!HSYNC high