shithub: riscv

Download patch

ref: 77a3391cf36cd24a3c01b0e45f512603b4d78e81
parent: d1822db1876754048ade2278aba664a6545590c8
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;