![]() |
128K SPECTRUM COMPATIBILITY... - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14) +---- Thread: 128K SPECTRUM COMPATIBILITY... (/showthread.php?tid=137) Pages:
1
2
|
Re: 128K SPECTRUM COMPATIBILITY... - boriel - 07-03-2012 Then we might have to add some new syntax sugar like: Code: SUB dada(param) AT 26000 Re: 128K SPECTRUM COMPATIBILITY... - britlion - 07-03-2012 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. Re: 128K SPECTRUM COMPATIBILITY... - boriel - 07-04-2012 Another strategy could be:
An alternative syntax: Code: REM Stay in BANK #4 Re: 128K SPECTRUM COMPATIBILITY... - LCD - 07-04-2012 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 Re: 128K SPECTRUM COMPATIBILITY... - Joflof - 03-27-2019 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... Re: 128K SPECTRUM COMPATIBILITY... - boriel - 03-27-2019 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/zxb/#Command_Line_Options Re: 128K SPECTRUM COMPATIBILITY... - boriel - 03-27-2019 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). Re: 128K SPECTRUM COMPATIBILITY... - Joflof - 03-28-2019 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! Re: 128K SPECTRUM COMPATIBILITY... - boriel - 03-28-2019 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. Re: 128K SPECTRUM COMPATIBILITY... - britlion - 04-11-2019 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/ Re: 128K SPECTRUM COMPATIBILITY... - boriel - 04-19-2019 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. Re: 128K SPECTRUM COMPATIBILITY... - Joflof - 06-11-2019 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 ![]() |