Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game is crashing due to out of memory (48k) (*solved*)
#3
(04-26-2021, 05:48 PM)RandomiserUsr Wrote: UPDATE:
I have now moved all the .BAS files that originally segregated into modules into one file and now the ZX0 compression routines are working.

A new Out of memory is now being displayed but I am not sure why?

Compiling with the following (Not the big heap) 
--tzx --BASIC --autorun  --heap=4800 --optimize 3 --org=25000  --debug-memory  --debug-array

Putting an output of the memory just before the line that causes it 
i.e. EX$(AVL) = ExitsDesc(LOC)

mem avl 3515
mem MaxAvl 1571


and you can see there is plenty of available memory.

I am decompressing to 62000 (F230) so it is out of the way

Next the memory map. Below you can see the program starts at 25,000 (61A8) and ends at 59,402


Quote:61A8: .core.__START_PROGRAM
61C1: .core.__CALL_BACK__
61C3: .core.ZXBASIC_MEM_HEAP
61C3: .core.ZXBASIC_USER_DATA
7483: ._GX
7485: ._GY

..
..
..
E78E: .core.__STRGT
E79C: .core.__STRGE
E7A4: .core.__FREE_STR
E7BA: .core.__STRSLICE
E7BE: .core.__STRSLICE_FAST
E805: .LABEL.__LABEL645
E808: .LABEL.__LABEL649
E80A: .LABEL.__LABEL650

So I am not sure how/why it running out of memory.  

Could the out of memory error be a false message, could it be a memory address clash?

Any tips would be useful.

Thank you in advance.

UPDATE - SOLVED :

Okay I found out the issue !
DIM MSG1 as UBYTE = 0
DIM MSG2 as UBYTE = 1
DIM MSG3 as UBYTE = 2
DIM A$(10)
A$(MSG1) = "Msg 1 on page 1"
A$(MSG2) = "Msg 2 on page 1"
A$(MSG3) = "Msg 2 on page 1"

So changing it to this works
A$(1) = "Msg 1 on page 1"
A$(2) = "Msg 2 on page 1"
A$(3) = "Msg 3 on page 1"

The above is only an example but still shows the error which is actually correct. 
To be exact the compiler should complain about DIM A$(MSG1) is not valid instead it compiles then gives the out of memory message.

:-)

Thanks

This is weird. A$(0) should also work, because you're not using --array-base=1, so arrays start at 0. Huh
We should investigate this further. If you can elaborate a tiny example that reproduces the bug, please, let me know.
Reply


Messages In This Thread
RE: Game is crashing due to out of memory (48k) - by boriel - 04-27-2021, 04:43 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)