04-03-2019, 09:42 AM
If possible use the function maxavail() and print the free heap memory while playing. This way you can check the free memory almost in real time.
Also, two more things: IX register is important for ZX Basic, so if you're not sure your ASM routines modifies it, better do:
on every ASM call
The other thing is that setting the ORG to low (i.e. 24000) leaves very very little stack space, and ASM calls, functions, SUBs, GOSUBS, etc might produce a silent stack overflow and the program might do those weirds things.
Perhaps this helps... :roll:
If you manage to solve, please tell us!
Also, two more things: IX register is important for ZX Basic, so if you're not sure your ASM routines modifies it, better do:
Code:
ASM
PUSH IX
CALL YOUR_ASM_ROUTINE
POP IX
END ASM
The other thing is that setting the ORG to low (i.e. 24000) leaves very very little stack space, and ASM calls, functions, SUBs, GOSUBS, etc might produce a silent stack overflow and the program might do those weirds things.
Perhaps this helps... :roll:
If you manage to solve, please tell us!