shithub: riscv

Download patch

ref: d9a964788bede9b48d1444d2d7a39ece0cef17c5
parent: fe1e95d6d80a1d5185198072d794457e7c94c511
author: aiju <aiju@phicode.de>
date: Sun Feb 12 07:28:02 EST 2017

games/gb: fix bug that prevented timer data from being accessed (thanks qwx)

--- a/sys/src/games/gb/mem.c
+++ b/sys/src/games/gb/mem.c
@@ -384,7 +384,7 @@
 		b0 %= nrom >> 14;
 		romb = rom + (b0 << 14);
 		return 0;
-	case 2: b1 = v & 15; b1 %= nbackbank; break;
+	case 2: b1 = v & 15; break;
 	case 3:
 		if(latch == 0 && v == 1){
 			timerl = timer;
@@ -404,7 +404,7 @@
 		}
 		return 0;
 	}
-	eramb = ramen && b1 < 4 ? back + (b1 << 13) : nil;
+	eramb = ramen && b1 < nbackbank ? back + (b1 << 13) : nil;
 	return 0;
 }