Skip to content
  • Rafael Kitover's avatar
    GB: fix 32/64 bit save/state incompatibility · 98cb298e
    Rafael Kitover authored
    
    
    The MBC3 and TAMA5 battery formats save the RTC data including a
    `time_t` field which is the last field.
    
    Since `time_t` is 32 bits for 32 bit builds and 64 bits for 64 bit
    builds, pad it in the two battery structs with a `uint64_t` and detect
    the 4 byte shorter saves made by older 32 bit builds.
    
    Also remove some pointless code in save state reading that also uses
    `sizeof(time_t)`.
    
    Add two new constants for RTC data size in gbMemory.h and use them.
    
    Signed-off-by: default avatarRafael Kitover <rkitover@gmail.com>
    98cb298e