From 95cfb114a255b5ad6d5adc9d3a9a12017a56357e Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 10 Sep 2016 13:25:18 +0300 Subject: [PATCH] Properly setting MBC RAM --- Core/mbc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/mbc.c b/Core/mbc.c index 5ba6c3f..2719208 100644 --- a/Core/mbc.c +++ b/Core/mbc.c @@ -109,6 +109,7 @@ void GB_configure_cart(GB_gameboy_t *gb) static const int ram_sizes[256] = {0, 0x800, 0x2000, 0x8000, 0x20000, 0x10000}; gb->mbc_ram_size = ram_sizes[gb->rom[0x149]]; gb->mbc_ram = malloc(gb->mbc_ram_size); + memset(gb->mbc_ram, 0xFF, gb->mbc_ram_size); } /* MBC1 has at least 3 types of wiring (We currently support two (Standard and 4bit-MBC1M) of these).