From 1324460d9dc92a21437a981a14872c0192a56dab Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Mon, 14 May 2018 18:51:11 +0100 Subject: [PATCH] Corrected branch cycles timing issue This fixes the sound timing for the system beep and lemonade stand --- cpu/cpu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cpu.go b/cpu/cpu.go index ea83d9a..ed4035e 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -137,7 +137,7 @@ func branch(instructionName string, doBranch bool) { os.Exit(0) } - samePage := (State.PC & 0xff00) != (relativeAddress & 0xff00) + samePage := (State.PC & 0xff00) == (relativeAddress & 0xff00) if samePage { system.FrameCycles += 1 } else {