shithub: riscv

Download patch

ref: b1cd72cfef46f3362b6207e56a5581625c0c3a68
parent: f2f46f4a33ee9ccb4f0475163408b8a699ec4f7f
author: aiju <devnull@localhost>
date: Mon Mar 17 10:54:12 EDT 2014

games/snes: BIT #imm does not set NZ flags

--- a/sys/src/games/snes/cpu.c
+++ b/sys/src/games/snes/cpu.c
@@ -857,7 +857,11 @@
 			rY &= 0xff;
 		nzx(rY);
 		return 2;
-	case 0x89: bit(imm(0)); return 2+cyc;
+	case 0x89:
+		rP &= ~FLAGZ;
+		if((imm(0) & rA) == 0)
+			rP |= FLAGZ;
+		return 2+cyc;
 	case 0x8A: setra(rX); return 2+cyc;
 	case 0x8B: push8(rDB >> 16); return 3;
 	case 0x8C: memwx816(abso(0, 0), rY); return 4+cyc;