dont crash when ram is not enabled on cartridge memory read

This commit is contained in:
Colby 2016-08-09 20:56:15 +10:00
parent b95a41520c
commit 00eec41f53

View file

@ -23,7 +23,7 @@ module Waterfoul
offset = @rom_bank * 0x4000
@game_program[offset + addr]
when 0xA000...0xC000
fail 'trying to read invalid ram' unless @ram_enabled
if @ram_enabled
addr = i - 0xA000
if @mode == 0
@ram[addr]
@ -31,6 +31,9 @@ module Waterfoul
offset = @rom_ram_bank_number * 0x8000
@ram[offset + addr]
end
else
0xFF
end
end
end