diff --git a/Core/gb.h b/Core/gb.h index 1103647..6a22b2f 100644 --- a/Core/gb.h +++ b/Core/gb.h @@ -504,8 +504,7 @@ struct GB_gameboy_internal_s { struct { uint8_t bank_low:6; uint8_t bank_high:3; - bool mode:1; - bool ir_mode:1; + bool ir_mode; } huc1; struct { diff --git a/Core/mbc.c b/Core/mbc.c index bb5f917..6f8f21a 100644 --- a/Core/mbc.c +++ b/Core/mbc.c @@ -138,14 +138,8 @@ void GB_update_mbc_mappings(GB_gameboy_t *gb) } break; case GB_HUC1: - if (gb->huc1.mode == 0) { - gb->mbc_rom_bank = gb->huc1.bank_low | (gb->mbc1.bank_high << 6); - gb->mbc_ram_bank = 0; - } - else { - gb->mbc_rom_bank = gb->huc1.bank_low; - gb->mbc_ram_bank = gb->huc1.bank_high; - } + gb->mbc_rom_bank = gb->huc1.bank_low; + gb->mbc_ram_bank = gb->huc1.bank_high; break; case GB_HUC3: gb->mbc_rom_bank = gb->huc3.rom_bank; diff --git a/Core/memory.c b/Core/memory.c index bf7f957..f123e46 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -888,7 +888,6 @@ static void write_mbc(GB_gameboy_t *gb, uint16_t addr, uint8_t value) case 0x0000: case 0x1000: gb->huc1.ir_mode = (value & 0xF) == 0xE; break; case 0x2000: case 0x3000: gb->huc1.bank_low = value; break; case 0x4000: case 0x5000: gb->huc1.bank_high = value; break; - case 0x6000: case 0x7000: gb->huc1.mode = value; break; } break; case GB_HUC3: diff --git a/Core/save_state.c b/Core/save_state.c index 20f0eef..9212ce8 100644 --- a/Core/save_state.c +++ b/Core/save_state.c @@ -261,7 +261,7 @@ static size_t bess_size_for_cartridge(const GB_cartridge_t *cart) case GB_MMM01: return sizeof(BESS_block_t) + 8 * sizeof(BESS_MBC_pair_t); case GB_HUC1: - return sizeof(BESS_block_t) + 4 * sizeof(BESS_MBC_pair_t); + return sizeof(BESS_block_t) + 3 * sizeof(BESS_MBC_pair_t); case GB_HUC3: return sizeof(BESS_block_t) + 3 * sizeof(BESS_MBC_pair_t) + sizeof(BESS_HUC3_t); case GB_TPP1: @@ -489,8 +489,7 @@ static int save_bess_mbc_block(GB_gameboy_t *gb, virtual_file_t *file) pairs[0] = (BESS_MBC_pair_t){LE16(0x0000), gb->huc1.ir_mode? 0xE : 0x0}; pairs[1] = (BESS_MBC_pair_t){LE16(0x2000), gb->huc1.bank_low}; pairs[2] = (BESS_MBC_pair_t){LE16(0x4000), gb->huc1.bank_high}; - pairs[3] = (BESS_MBC_pair_t){LE16(0x6000), gb->huc1.mode}; - mbc_block.size = 4 * sizeof(pairs[0]); + mbc_block.size = 3 * sizeof(pairs[0]); case GB_HUC3: pairs[0] = (BESS_MBC_pair_t){LE16(0x0000), gb->huc3.mode}; pairs[1] = (BESS_MBC_pair_t){LE16(0x2000), gb->huc3.rom_bank};