Skip to content

[MEGAFLASH] Persistent core boot slot #938

Description

@lydon42

The idea is to provide a way to store the core boot slot (perhaps on a special key press) in a way so that on a consecutive boot this slot will be selected as the default slot.

The SD card might be to slow for this (could make the startup time longer, we don't want that), so we need a different place.

There is still the persistent RAM in the RTC. Both on-board models do have at least 16 byte. So one could try to use those.

  • determine default state of RAM after RTC has no power (need to know to determine if a slot was set)
  • add keypress or toggle that will trigger the storage of the slot on selection
  • store info with guard byte in RTC
  • start slot
  • on new startup: change default slot determination to read RTC ram for stored slot

To discuss:

  • which keys?
  • how to store?
  • does cartridge detection still override persistent slot?

Activity

  1. added
    newNew report, not classified yet
    on Jul 8, 2026
  2. added theissue type on Jul 8, 2026
  3. lydon42 commented on Jul 8, 2026

    @lydon42
    MemberAuthor

    Hints for implementation:

    Look in megaflash.c starting at search_cart = check_cartridge(); for the part that reads if there was a last slot.

    And around the case 0x0d: // RET to see how the selected slot is started and to add an extra key that does the saving first and then falls-through to the RET part.

    For clock detection look at megainfo in mega65-freezemenu.

    Warning: I think the description of the user RAM of both RTCs might be wrong. Both r3 and r4 i2c list 64 bytes of RAM, but the R3 ISL12020M has 128 bytes and the R4+ RV-3032-C7 has only 16 bytes. The Groove connected DS1307 seems to have 56 bytes of RAM (this one might not even have the code to access the RAM).

    So perhaps those should also be capped to 16 bytes, so we can use the common interface.

  4. added this to the Volunteer Project milestone on Jul 8, 2026
  5. removed
    newNew report, not classified yet
    on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions