Re: [hatari-devel] Bugs with memory snapshot saving from SDL GUI

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 15.9.2022 1.55, Chris Jenkins wrote:
* Dialog not being shown when it should (or if SDL supports multiple
layers, not on top layer)


I just replied to the thread in atari-forum about this last one. Pasting
the same text here for visibility in this thread:

I think what's happening here is that Hatari only actually attempts to
write the snapshot to disk when emulation is unpaused, which in the case of
hte SDL GUI happens when the GUI is closed. The relevant code is in
MemorySnapShot_OpenFile in Hatari's source tree, which ultimately gets
called from the UAE code, though I confess that I don't understand it all
yet.

I'm not clear whether this is the cause of the issues reported in this
thread though.

Ahaa!

Debug UI calls MemorySnapShot_Capture_Immediate(), other cases do not:
--------------------------------------------
$ git grep '[^_]MemorySnapShot_Capture[(_]' | grep -F .c:
src/cpu/hatari-glue.c:	MemorySnapShot_Capture_Do ();
src/gui-osx/SDLMain.m: MemorySnapShot_Capture(ConfigureParams.Memory.szMemoryCaptureFileName, TRUE);
src/debug/debugui.c:		MemorySnapShot_Capture_Immediate(file, true);
src/gui-sdl/dlgMemory.c: MemorySnapShot_Capture(ConfigureParams.Memory.szMemoryCaptureFileName, true); src/main.c: MemorySnapShot_Capture(ConfigureParams.Memory.szAutoSaveFileName, false); src/memorySnapShot.c:void MemorySnapShot_Capture(const char *pszFileName, bool bConfirm) src/memorySnapShot.c: /* Make a temporary copy of the parameters for MemorySnapShot_Capture_Do() */ src/memorySnapShot.c:void MemorySnapShot_Capture_Immediate(const char *pszFileName, bool bConfirm) src/memorySnapShot.c: /* Make a temporary copy of the parameters for MemorySnapShot_Capture_Do() */
src/memorySnapShot.c:	MemorySnapShot_Capture_Do ();
src/memorySnapShot.c:void MemorySnapShot_Capture_Do(void)
src/shortcut.c: MemorySnapShot_Capture(ConfigureParams.Memory.szMemoryCaptureFileName, true);
--------------------------------------------

IMHO this does not need so many global functions, one with immediate/delayed bool would be enough, instead of having two, which would always checks file overwrite before setting up memory capture.

(If user wants to select another file instead overwriting existing one, he cannot do that with the delayed overwrite question.)


After that is fixed, there's still the alert level issue. Question dialogs should be shown *always*.


I'm not easily able to try to reproduce this issue myself because I'm using
a Mac but I might try getting Hatari working on my Raspberry Pi if I get
the chance and see if any of this stuff happens there.

According to sources, Mac GUI is also using the non-immediate memory capture function, so it should also be suffering of the too-late overwrite question.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/