mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-16 14:29:00 +00:00
Load working better.
This commit is contained in:
parent
45ab9bafe2
commit
0e94a6fbb0
@ -176,7 +176,6 @@ def _saveGame()
|
|||||||
|
|
||||||
// Perform garbage collection and record the size of the heap so we can restore it correctly
|
// Perform garbage collection and record the size of the heap so we can restore it correctly
|
||||||
global=>w_heapSize = mmgr(HEAP_COLLECT, 0) - HEAP_BOTTOM
|
global=>w_heapSize = mmgr(HEAP_COLLECT, 0) - HEAP_BOTTOM
|
||||||
printf1("heapSize=$%x\n", global=>w_heapSize)
|
|
||||||
|
|
||||||
// Copy data to main memory
|
// Copy data to main memory
|
||||||
mmgr(FINISH_LOAD, WITH_CLOSE)
|
mmgr(FINISH_LOAD, WITH_CLOSE)
|
||||||
@ -234,8 +233,8 @@ def loadInternal()
|
|||||||
|
|
||||||
// Init the heap with the correct size
|
// Init the heap with the correct size
|
||||||
p_loaded = $4000
|
p_loaded = $4000
|
||||||
printf1("Loaded heap size: $%x\n", p_loaded=>w_heapSize)
|
|
||||||
initHeap(p_loaded=>w_heapSize)
|
initHeap(p_loaded=>w_heapSize)
|
||||||
|
global = getGlobals()
|
||||||
|
|
||||||
// Now copy the data back up to the heap space, and we're done
|
// Now copy the data back up to the heap space, and we're done
|
||||||
copyHeap(1) // main to aux
|
copyHeap(1) // main to aux
|
||||||
|
@ -2074,7 +2074,11 @@ def _initHeap(loadedSize)
|
|||||||
mmgr(HEAP_ADD_TYPE, typeTbls[i])
|
mmgr(HEAP_ADD_TYPE, typeTbls[i])
|
||||||
i = i+1
|
i = i+1
|
||||||
loop
|
loop
|
||||||
|
if loadedSize <> 0
|
||||||
|
global = HEAP_BOTTOM
|
||||||
|
else
|
||||||
global = mmgr(HEAP_ALLOC, TYPE_GLOBAL)
|
global = mmgr(HEAP_ALLOC, TYPE_GLOBAL)
|
||||||
|
fin
|
||||||
end
|
end
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user