Jet Set Willie Posted August 22 Report Share Posted August 22 Hi, I´m back. My game is finished, it mainly needs just playtesting, JetsetDanny has kindly offered himself for that. But it has one problem, I haven´t been able to solve it. I had to cut the BASIC loader to two parts to make it work. The first part loads and runs OK, but the second part immediately brings an error message C Nonsense in BASIC, 100:1 even there is no error on that line. But typing RUN makes it to continue loading. I could release it without the BASIC loaders, but I want to keep it as is. Please, could somebody with enough knowledge about ZX BASIC give it a look, while keeping the game as a secret, until I can release it, thank you. 🙂 jetsetdanny and Spider 1 1 Quote Link to comment Share on other sites More sharing options...
Spider Posted August 22 Report Share Posted August 22 What is on line 100 Are you merging the second Basic into the first aka MERGE or are you loading it ? I'd expect it to fail with tape loading error if there was not enough space because ramtop was too low (technically a bug as it should say "no room" or similar iirc) Another possibility is any code being loaded low down has overwritten part of the Basic too but in that case it tends to (if you can do it) make a complete mess of the listing. Quote Link to comment Share on other sites More sharing options...
DigitalDuck Posted August 22 Report Share Posted August 22 2 minutes ago, Spider said: What is on line 100 Are you merging the second Basic into the first aka MERGE or are you loading it ? I'd expect it to fail with tape loading error if there was not enough space because ramtop was too low (technically a bug as it should say "no room" or similar iirc) G - No room for line is specifically for when adding a line via the BASIC interpreter, R - Tape loading error is correct for errors that occur during tape loading (or verification). C - Nonsense in BASIC suggests that the code is being changed while running; if you're loading a BASIC program in two parts then each part should be saved with LINE xxxx and jump to the next loader in sequence; trying to continue the existing program when it's changed is going to be unreliable at best. jetsetdanny and Spider 2 Quote Link to comment Share on other sites More sharing options...
Spider Posted August 22 Report Share Posted August 22 Had added a bit while you were typing @DigitalDuck 🙂 , Wrong error I meant to say "out of memory" not "no room" , that one I saw a lot of with 16K 😄 , but yes. The merging (if it is being merged) is usually reliable but I've not really had to ever use that "in anger" as such with a lot of Basic. I do agree if its throwing that kind of interpreter error it might be changed while running, a good thought. Not hard to poke a value in , while in Basic but actually accidentally*** change something. As you know what is 'shown' is not always what is executed, numbers certainly, example: not_what_list.tap *** Was done a bit on some custom protection schemes iirc , much obfuscation... But here in this case for the O.P its not intentional . I do suspect you're right in perhaps a stray POKE or similar is doing something, easily done with a typo. Quote Link to comment Share on other sites More sharing options...
DigitalDuck Posted August 22 Report Share Posted August 22 57 minutes ago, Spider said: But here in this case for the O.P its not intentional . I do suspect you're right in perhaps a stray POKE or similar is doing something, easily done with a typo. It can happen without POKEs too. Memory gets shifted around when loading and/or merging and it's usually fine as long as you're not relying on the program execution continuing from where it was afterwards; as I said, if you save it with LINE xxxx you force it to jump to somewhere else and avoid this issue. Quote Link to comment Share on other sites More sharing options...
DigitalDuck Posted August 23 Report Share Posted August 23 I was thinking about this overnight and I realised that if you're using MERGE then LINE won't work because MERGE ignores it. Spider 1 Quote Link to comment Share on other sites More sharing options...
Jet Set Willie Posted August 23 Author Report Share Posted August 23 What I want is to load in the first BASIC program. It will load the second BASIC program then and the second program should over write the first one, not merge them. Does ZX BASIC always bring an error, if two BASIC programs are loaded in like this, if they are not merged or does not have different line numbers? Line 100, the first program has 100 LOAD "name" The second one has 100 LOAD "name"CODE : INK 0: PAPER 0: PRINT AT 1,0: LOAD "name"CODE 32768 I have typed in both BASIC programs with ZX-Editor, so I haven´t SAVEd them using a BASIC command, ie not saved with SAVE "name" LINE... What number I should use in CLEAR command to make sure the program will not bring out of memory? Quote Link to comment Share on other sites More sharing options...
Spider Posted August 23 Report Share Posted August 23 What (where is it loaded) is the piece of code in line 100 of the second program ? You'd need CLEAR 32767 at a minimum really that will give plenty (ish) Basic space and let the main codeblock load at 32768 You're correct, 'load' the second one which will overwrite the first, i am thinking here -if- the second program does -not- have a LINE xyz to start it, as the original has been overwritten it -might- try to continue onwards from the program line counter instead of the start of it... if it was loaded in a new reset machine it would load and not do anything without a LINE however if something is already there... so if you had say line 200 (example) in the first program of LOAD "" , like 200 LOAD "" (load the next bit) and the second program did -not- have a LINE when saved... it -might- start running at line 201 in the -new- program. Its hugely preferable to add LINE xyz unless merging so that it won't confuse the basic interpreter. The issue could be as simple as something like that. I'm not sure how Basic will deal with a new piece of Basic without an autostart line number that is loaded (not merged) , assuming the old and new share a line number it may even start executing the 'new' Basic at the next statement in the line that was used in the old program to load it. Quote Link to comment Share on other sites More sharing options...
Jet Set Willie Posted August 23 Author Report Share Posted August 23 3 hours ago, Spider said: What (where is it loaded) is the piece of code in line 100 of the second program ? It loads a loading screen, then it starts to load the actual game. 3 hours ago, Spider said: You'd need CLEAR 32767 at a minimum really that will give plenty (ish) Basic space and let the main codeblock load at 32768 The first program has CLEAR 32767 already. The second program also starts with CLEAR 32767. How I can SAVE with LINE in ZX BASIC? When I type SAVE "name" LINE 10 it brings SAVE "name" ?LINE 10 Quote Link to comment Share on other sites More sharing options...
Jet Set Willie Posted August 23 Author Report Share Posted August 23 21 hours ago, DigitalDuck said: G - No room for line is specifically for when adding a line via the BASIC interpreter, R - Tape loading error is correct for errors that occur during tape loading (or verification). C - Nonsense in BASIC suggests that the code is being changed while running; if you're loading a BASIC program in two parts then each part should be saved with LINE xxxx and jump to the next loader in sequence; trying to continue the existing program when it's changed is going to be unreliable at best. Thank you, nice to learn these. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.