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).