#132 Soft resets should not clear RAM

open
nobody
None
5
2013-02-10
2007-12-06
Stuart Brady
No

Currently, machine_reset() calls memory_pool_free() for both hard and soft resets -- the peripheral reset functions then have to reallocate and initialise the RAM. However, for a soft reset, the RAM should not be cleared -- this is needed if we are to use memory pools for +D emulation, where G+DOS remains loaded after a soft reset.

Discussion

  • Stuart Brady
    Stuart Brady
    2013-02-10

    I notice that there's a concept of a 'persistent' memory pool now, although this doesn't quite make sense to me. Surely all memory, whether for peripherals or otherwise, is just memory. Hard resets (and any change of the machine to emulate) should clear it. Soft resets should generally not.

    I suppose what's needed is a better separation of the concepts of resetting and initialisation, as has been done for the peripherals that now make use of the periph_t 'activate' method.

    TBH, the IF2's use of memory_pool_allocate() seems okay, but I don't really get the dck, scld or slt code.

    It seems to me that this has almost been fixed, although I would have expected that if I loaded a snapshot with a custom ROM / cartridge / whatever, and then performed a soft reset, then I would expect that memory to be left unchanged. For example, if I have +D snapshot using a ROM image, and the DOS stays resident in RAM after a reset, I would also expect to retain the same ROM image.

    It might also be useful for a hard reset to behave in the same way. This then begs the question of how to get rid of unwanted custom ROMs after loading a snapshot, and also raises the issue that there is, as far as I'm aware, no obvious way for the user to tell whether custom ROMs have been loaded from snapshots, something which might cause considerable confusion. It would probably make sense to compare any ROM included in a snapshot with the one selected in the user's preferences to ensure that it is actually different, in this case.

     
  • Stuart Brady
    Stuart Brady
    2013-02-10

    What would make sense to me would be to fix any remaining RAM issues as part of this bug, and handle reverting of the use of custom ROMs upon reset and warning the user of the use of custom ROMs loaded from snapshots as two separate bugs.