summaryrefslogtreecommitdiff
path: root/media-sound/gbsplay/files/gbsplay-0.0.94-fix-off-by-one-err.patch
blob: 5b9b076ed2cd40ebf2db7ccd450007d912cdd7a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From e9ef7a872ac7f7201b195c961b64f6ce33a5b110 Mon Sep 17 00:00:00 2001
From: Sanqui <me@sanqui.net>
Date: Thu, 23 Jul 2020 21:41:16 +0300
Subject: [PATCH] Fix off-by-one error in gbhw_io_peek

This bug made e.g. WAVE display when verbose incorrect, as the
last byte of the waveform would always be given as FF.
---
 gbhw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gbhw.c b/gbhw.c
index 931c79d..dd60066 100644
--- a/gbhw.c
+++ b/gbhw.c
@@ -1000,7 +1000,7 @@ regparm void gbhw_io_put(uint16_t addr, uint8_t val) {
 /* unmasked peek used by gbsplay.c to print regs */
 regparm uint8_t gbhw_io_peek(uint16_t addr)
 {
-	if (addr >= 0xff10 && addr <= 0xff3e) {
+	if (addr >= 0xff10 && addr <= 0xff3f) {
 		return ioregs[addr & 0x7f];
 	}
 	return 0xff;