07-03-2012, 06:32 PM
Then we might have to add some new syntax sugar like:
:?:
Code:
SUB dada(param) AT 26000
END SUB
128K SPECTRUM COMPATIBILITY...
|
07-03-2012, 06:32 PM
Then we might have to add some new syntax sugar like:
Code: SUB dada(param) AT 26000
07-03-2012, 06:38 PM
Hmm.
I think that's too specific - and has issues of overrun. I could have one routine at a low address that's too long, and a second routine at a higher address that then backs down and overwrites the lower one. That would be hell to diagnose! I'm fairly Okay with zxb managing the very specific bits of memory - I just want to say "this bit goes in this zone" - and the compiler to tell me if it gets too big to fit in there... What did you think about my bank directive idea earlier in this thread? Doesn't have to be 128K yet to start on that path. Could just cover three 48K bank areas.
07-04-2012, 07:38 AM
Another strategy could be:
An alternative syntax: Code: REM Stay in BANK #4
07-04-2012, 03:19 PM
How about defining which Bank and which addresser can be used fpr specific data at the beginn of compiled code, as compiler directives?
Code: #BANK 4,49152,1000 FOR HEAP
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead Visit my http://members.inode.at/838331/index.html home page!
03-27-2019, 06:18 AM
I am totally stuck with that same issue. I was trying to maintain all code below the 0xC000 so I could use the 4rth bank and the other 4 extra ones to have compressed data there, but even if I use ORG 25000 or whatever it doesn't work and I got totally unexpected results. It is possible, also, to use the non-screen informartion (above the 6912) from the screen bank for data?
I know I am resurrecting a 5 year old topic, so... Any new options nowadays? Also, I still don't have a clue if it is possible to play AY music with ZXBasic...
That should work. The problem might be the HEAP. Perhaps using --heap-size option will help: by default ZX BASIC will use all remaining memory for the HEAP (which is used mostly for string management at this moment).
Try compiling with --heap-size=200 (use only 200 bytes for heap) More info at https://zxbasic.readthedocs.io/en/docs/z...ne_Options
03-27-2019, 08:28 AM
LCD Wrote:How about defining which Bank and which addresser can be used fpr specific data at the beginn of compiled code, as compiler directives? That's what I was thinking for (or something similar).
03-28-2019, 01:13 AM
Well, at the end I managed (reading the documentation) to make the code start at 24200 with the -ORG command when compiling, then when I load the data that I want to be starting at 0xC000 i put the asm org 0xC000 and at the end of this loading stuff code I return with another ORG command to the memory adress the code wat before that moment (checking memory.txt and recompiling) so I finally managed to keep everything under 0xC000 except the specific data I want. I haven't tried bank changing yet, but I think that is a good start!
Also, the problem was the heap, that was overlaping some data from 0xC000; I changed ir to 1024 because now that I start the program at 24200 I have enough space, but in fact, I have no idea what is the heap for. Something related to strings? Cause all the text I show on the game is printed char by char, reading from memory, no strings. Do I nead a heap at all? What is the minimmum or recomendable size? Also, about printing chars each by each... Is there a faster alternative to print available? Thanks and sorry for spreading many topics around!
03-28-2019, 08:38 AM
Cesc Wrote:Well, at the end I managed (reading the documentation) to make the code start at 24200 with the -ORG command when compiling, then when I load the data that I want to be starting at 0xC000 i put the asm org 0xC000 and at the end of this loading stuff code I return with another ORG command to the memory adress the code wat before that moment (checking memory.txt and recompiling) so I finally managed to keep everything under 0xC000 except the specific data I want. I haven't tried bank changing yet, but I think that is a good start!As answered above, it's for managing strings (i.e. a$ = b$ + c$). If you use PRINT "A" you might not need it. But if you use a$ = "XXX": PRINT a$ you will. For small strings, like in your case, a 256 bytes heap is more than enough. Cesc Wrote:Well, at the end I managed (reading the documentation) to make the code start at 24200 with the -ORG command when compiling, then when I load the data that I want to be starting at 0xC000 i put the asm org 0xC000 and at the end of this loading stuff code I return with another ORG command to the memory adress the code wat before that moment (checking memory.txt and recompiling) so I finally managed to keep everything under 0xC000 except the specific data I want. I haven't tried bank changing yet, but I think that is a good start! Are any of the routines in the library helpful? What are you trying to achieve? https://zxbasic.readthedocs.io/en/docs/library/
04-19-2019, 09:39 AM
britlion Wrote:Any chance that memory management will be included?Just for the record, this is already supported in the upcoming 1.8.10. I'm (slowly) hearing towards 128K memory support without breaking compatibility. britlion Wrote:Are any of the routines in the library helpful? What are you trying to achieve? I was trying to have more space available for my code, basically. I didn't had the time to test enough stuff yet, but I will start back soon. Probably gonna move to worldspectrum forums as you suggested |
« Next Oldest | Next Newest »
|