Re: [hatari-devel] fixed a crash when restoring a snapshot using DSP

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


Le 03/01/2015 17:03, Laurent Sallafranque a écrit :
Hello,

I don't see a problem with your fix except perhaps in dsp_core_init()
where there's :

     memset(&dsp_core, 0, sizeof(dsp_core_t));

This is here to initialize the dsp memory area with 0 (or NOP
instructions for the P memory).
The DSP memory is not reseted to zero after a reboot, so we just must be
careful to keep this working as it should (ie: correctly init the DSP
memory at first init, but not after a reboot or a continuity in using it).
But we can consider that loading a memory snapshot inits the memory
first and then the snapshot will rewrite it with the saved datas.


Yes, I think reloading the snapshot will restore "dsp_core" structure, so it should be OK.


 > But I think code could be simplified a bit, there're some calls to
DSP_Init and DSP_UnInit when nDSPType is changed, but I wonder if it's
necessary.

I think we must be careful here with this memory reset to 0 if we
disable / reenable the DSP (it must be considered as a first start to
have the DSP memory full clean)


I hope this makes sense to you.


When enabling/disabling DSP, I was thinking about just toggling bDspEnabled in another function.

I will give it a try to see if it doesn't break anything :)

Nicolas



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