|Re: [hatari-devel] ENABLE_SMALL_MEM problem|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
Le 27/12/2017 à 10:10, Nicolas Pomarède a écrit :
Le 27/12/2017 à 08:34, Thomas Huth a écrit :
I agree with you. But then the _Init functions should not call the
_Reset functions directly - that should be part of Reset_ST later.
So to fix the current ENABLE_SMALL_MEM problem, I think it's the
easiest and best solution to remove the call to STMemory_Reset() from
the STMemory_Init() function. Then, after the release, we can consider
whether we also want to rework memory_init() or not, OK?
OK, let's do it this way.
working on something different, I found that sometimes STF MMU memory
config was not correctly restored after reloading a memory snapshot and
program would crash.
This is because STMemory_Init() is called after saving a snapshot from
the UI, which calls :
STMemory_MMU_ConfToBank(0, &MMU_Bank0_Size, &MMU_Bank1_Size);
So after saving a snapshot, MMU_Bank0_Size and MMU_Bank1_Size are set to
the equivalent of 128 kb (but STF MMU memory mapping is not updated, so
program still work).
But if you save again a snapshot, this time this will write the wrong
values of MMU_Bank0_Size/MMU_Bank1_Size and next time you will reload
this snapshot, program will crash because those values don't match the
ST RAM sizes in RAM_Bank0_Size / RAM_Bank1_Size.
I committed a change for this to use "0" on first run (only when using
ENABLE_SMALL_MEM and ioMem is not allocated yet), else use the current
value for $ff8001.