diff --git a/Core/gb.h b/Core/gb.h index a2e8db1..4241a61 100644 --- a/Core/gb.h +++ b/Core/gb.h @@ -543,7 +543,7 @@ struct GB_gameboy_internal_s { GB_SECTION(rtc, GB_rtc_time_t rtc_real, rtc_latched; uint64_t last_rtc_second; - bool rtc_latch; + GB_PADDING(bool, rtc_latch); uint32_t rtc_cycles; uint8_t tpp1_mr4; ); diff --git a/Core/memory.c b/Core/memory.c index a25b860..f499e74 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -541,10 +541,7 @@ static void write_mbc(GB_gameboy_t *gb, uint16_t addr, uint8_t value) gb->mbc3_rtc_mapped = value & 8; break; case 0x6000: case 0x7000: - if (!gb->rtc_latch && (value & 1)) { /* Todo: verify condition is correct */ - memcpy(&gb->rtc_latched, &gb->rtc_real, sizeof(gb->rtc_real)); - } - gb->rtc_latch = value & 1; + memcpy(&gb->rtc_latched, &gb->rtc_real, sizeof(gb->rtc_real)); break; } break; @@ -781,7 +778,7 @@ static void write_mbc_ram(GB_gameboy_t *gb, uint16_t addr, uint8_t value) if (gb->mbc_ram_bank == 0) { gb->rtc_cycles = 0; } - gb->rtc_latched.data[gb->mbc_ram_bank] = gb->rtc_real.data[gb->mbc_ram_bank] = value; + gb->rtc_real.data[gb->mbc_ram_bank] = value; } return; }