diff --git a/Core/gb.c b/Core/gb.c index 38e3cd081..90a1804c2 100644 --- a/Core/gb.c +++ b/Core/gb.c @@ -1705,7 +1705,7 @@ static void GB_reset_internal(GB_gameboy_t *gb, bool quick) GB_update_clock_rate(gb); uint8_t rtc_section[GB_SECTION_SIZE(rtc)]; memcpy(rtc_section, GB_GET_SECTION(gb, rtc), sizeof(rtc_section)); - memset(gb, 0, (size_t)GB_GET_SECTION((GB_gameboy_t *) 0, unsaved)); + memset(gb, 0, GB_SECTION_OFFSET(unsaved)); memcpy(GB_GET_SECTION(gb, rtc), rtc_section, sizeof(rtc_section)); gb->model = model; gb->version = GB_STRUCT_VERSION;