From 4ccb7499574533ce809aa285c5016ddee94fefdf Mon Sep 17 00:00:00 2001 From: Colby Date: Mon, 8 Aug 2016 22:06:10 +1000 Subject: [PATCH] fixed incorrect behavior of mbc1 ram access gameboy will simply not write to memory if memory is not enabled. --- lib/waterfoul/mbc/mbc1.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/waterfoul/mbc/mbc1.rb b/lib/waterfoul/mbc/mbc1.rb index 00a63c2..d531761 100644 --- a/lib/waterfoul/mbc/mbc1.rb +++ b/lib/waterfoul/mbc/mbc1.rb @@ -55,7 +55,7 @@ module Waterfoul when 0x6000...0x8000 @mode = v & 0x1 when 0xA000...0xC000 - fail 'trying to write invalid ram' unless @ram_enabled + return unless @ram_enabled addr = i - 0xA000 if @mode == 0 @ram[addr] = v