git: 9front

Download patch

ref: 5c8f3fe1380638fa91731ddff49f84e45ece79f4
parent: 6ef776f2f8d4dabf00370ccd1064450e05a22b43
author: aiju <devnull@localhost>
date: Fri Mar 14 20:57:03 EDT 2014

games/snes: small hdma fix

--- a/sys/src/games/snes/mem.c
+++ b/sys/src/games/snes/mem.c
@@ -486,7 +486,7 @@
 {
 	int i, j, cyc;
 	u8int *p, *q, n, m, b, v, c;
-	u32int a;
+	u32int a, br;
 	
 	cyc = 0;
 	if(dma != 0)
@@ -502,12 +502,15 @@
 		if((hdma & (1<<(16+i))) != 0){
 			n = nbytes[c & 7];
 			m = modes[c & 7];
-			if((c & 0x40) != 0)
+			if((c & 0x40) != 0){
 				q = p + 5;
-			else
+				br = p[7] << 16;
+			}else{
 				q = p + 8;
+				br = p[4] << 16;
+			}
 			for(j = 0; j < n; j++){
-				a = q[0] | q[1] << 8 | p[4] << 16;
+				a = q[0] | q[1] << 8 | br;
 				b = p[1] + (m & 3);
 				if((c & 0x80) != 0){
 					v = dmavalid(b, 1) ? memread(0x2100 | b) : 0;
--