From 1caa17c00bf58a54956f16711a574e89536a47e4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 2 Jun 2017 15:58:00 -0700 Subject: [PATCH] GB I/O: Fix bootrom running forever --- src/gb/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gb/io.c b/src/gb/io.c index 0f386aaae..8b4102c0d 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -382,7 +382,7 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) { value = gb->video.stat; break; case 0x50: - if (gb->memory.romBase < gb->memory.rom && gb->memory.romBase > &gb->memory.rom[gb->memory.romSize - 1]) { + if (gb->memory.romBase < gb->memory.rom || gb->memory.romBase > &gb->memory.rom[gb->memory.romSize - 1]) { free(gb->memory.romBase); gb->memory.romBase = gb->memory.rom; }