Properly setting MBC RAM

This commit is contained in:
Lior Halphon 2016-09-10 13:25:18 +03:00
parent 6d836b9f48
commit 95cfb114a2
1 changed files with 1 additions and 0 deletions

View File

@ -109,6 +109,7 @@ void GB_configure_cart(GB_gameboy_t *gb)
static const int ram_sizes[256] = {0, 0x800, 0x2000, 0x8000, 0x20000, 0x10000}; static const int ram_sizes[256] = {0, 0x800, 0x2000, 0x8000, 0x20000, 0x10000};
gb->mbc_ram_size = ram_sizes[gb->rom[0x149]]; gb->mbc_ram_size = ram_sizes[gb->rom[0x149]];
gb->mbc_ram = malloc(gb->mbc_ram_size); 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). /* MBC1 has at least 3 types of wiring (We currently support two (Standard and 4bit-MBC1M) of these).