+Tarzilla Posted October 6, 2016 Share Posted October 6, 2016 While I have it on my mind, a reminder that a compiler flag for OPTION EXPLICIT style variable declarations enfocement would have come in real handy about 3 months ago 2 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted October 6, 2016 Share Posted October 6, 2016 Ok. No questions in a while. So now we are all pros? Just one. for doesn't count backward. for example, for i=239 to 0 poke $200+i,0 next i One work around I found is i=239 while i<>0 then poke $200+i,0 i=i-1 wend Just glanced at the manual just now, maybe I needed to add step -1 for i=239 to 0 step -1 I think I answered my own question. This is why I don't ask question often. 1 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted October 6, 2016 Share Posted October 6, 2016 Just glanced at the manual just now, maybe I needed to add step -1 Perhaps the compiler should generate an error if the termination value of a loop is less than its starting value and no negative step amount is supplied. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted October 6, 2016 Share Posted October 6, 2016 Perhaps the compiler should generate an error if the termination value of a loop is less than its starting value and no negative step amount is supplied. That's not really a good idea. A program may depend on the fact that a variable has decrement below a threshold and expect the loop to be skipped. You can't predict it when the counter values are variables and the normal "BASIC" expected behaviour is for the loop to not execute. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted October 6, 2016 Share Posted October 6, 2016 That's not really a good idea. A program may depend on the fact that a variable has decrement below a threshold and expect the loop to be skipped. You can't predict it when the counter values are variables and the normal "BASIC" expected behaviour is for the loop to not execute. In the case of constants you know the start and end limits at compile time. 1 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted October 6, 2016 Share Posted October 6, 2016 In the case of constants you know the start and end limits at compile time. Well of course, but then you have special code that offers one behaviour on Mondays, Tuesdays, and Wednesdays, and different a behaviour on Thursdays and Fridays, and God knows what it does when the noon is full. Unpredictability and I consistency is the enemy of programmer productivity. That said, I can't see it ever being valid to have the initial constant being lower than the maximum, so perhaps it wouldn't be too bad as a warning. dZ. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 6, 2016 Author Share Posted October 6, 2016 While I have it on my mind, a reminder that a compiler flag for OPTION EXPLICIT style variable declarations enfocement would have come in real handy about 3 months ago Working hard for the programmer https://github.com/nanochess/IntyBASIC/commit/92c94d655110195ae5f764919d9133ccfb23d8ff 2 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 6, 2016 Author Share Posted October 6, 2016 In the case of constants you know the start and end limits at compile time. Well of course, but then you have special code that offers one behaviour on Mondays, Tuesdays, and Wednesdays, and different a behaviour on Thursdays and Fridays, and God knows what it does when the noon is full. Unpredictability and I consistency is the enemy of programmer productivity. That said, I can't see it ever being valid to have the initial constant being lower than the maximum, so perhaps it wouldn't be too bad as a warning. dZ. Hmmm... so something like this https://github.com/nanochess/IntyBASIC/commit/a225e142c161aa0767ac36c1ba96b5f05a9cab87 Quote Link to comment Share on other sites More sharing options...
carlsson Posted October 6, 2016 Share Posted October 6, 2016 (edited) At least in every Microsoft BASIC implementation I have encountered, a FOR loop always runs at least once before the TO statement is checked. Thus FOR i=239 TO 0 without the STEP argument would assign 239 to i, execute the loop once, increase i by one, check if it is zero and then exit, unless of course the variable i is furthermore modified inside the loop. Edit: Nope, changing the variable inside the loop doesn't affect FOR behavior for the case where start > end. However you can make interesting things. 10 poke36878,15:dx=1.5:l=0 15 fori=170to250:poke36875,i:i=i-dx:ifi<128theni=128:dx=-dx 17 ifi>200andl<15thendx=-dx*1.5:i=200:l=l+1 20 next:printi Edited October 6, 2016 by carlsson 2 Quote Link to comment Share on other sites More sharing options...
First Spear Posted October 6, 2016 Share Posted October 6, 2016 Will that be a new binary release? Hmmm... so something like this https://github.com/nanochess/IntyBASIC/commit/a225e142c161aa0767ac36c1ba96b5f05a9cab87 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 7, 2016 Author Share Posted October 7, 2016 Will that be a new binary release? As soon as there are enough enhancements 1 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted October 7, 2016 Share Posted October 7, 2016 Hmmm... so something like this https://github.com/nanochess/IntyBASIC/commit/a225e142c161aa0767ac36c1ba96b5f05a9cab87 Hey, Oscar, you're on a roll!!! :thumsup: 1 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted October 7, 2016 Share Posted October 7, 2016 Oh yea, now I remembered the questions. Is there something like case/break for IntyBASIC. As the list of objects behavior list grows, the slower the game goes.(Hey it rhymes.) When I switch from if's to case/break series in Rockcutter, the chance of slowdown decreased by a lot. What the other question I had. I knew I should have written it down... I'll spam err post the question later when it come back to me within a couple minutes. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted October 7, 2016 Share Posted October 7, 2016 Is there something like case/break for IntyBASIC. The nearest is ON expr GOTO label1,label2,... or ON expr GOSUB label1,label2,... 1 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 7, 2016 Author Share Posted October 7, 2016 New in version 1.2.8: (download in first post) Added DATA PACKED for strings, same as DATA but fits two characters per word. Added OPTION EXPLICIT to force declaration of variables using DIM (without index), for example DIM A,B Added OPTION WARNINGS to disable compilation warnings. Warns about strange use of constants in FOR/NEXT Changed CC3/JLP memory flags to "=RM" for as1600 (needed for LTO-Flash) Solved three minor bugs. (optimization: reused register already trashed, weird expression a<5>b crashing, array optimization would trigger as1600 error because of "big" constant) Enjoy it! 3 Quote Link to comment Share on other sites More sharing options...
freewheel Posted October 8, 2016 Share Posted October 8, 2016 Ok. No questions in a while. So now we are all pros? Hey Oscar, I think I've run into something new. Unless someone's mentioned this before and I've forgotten: When I run an IntyBASIC game on a Sears console, it very quickly displays the standard EXEC titlescreen with "IntyBASIC program" as title and whatever random year you threw into the headers. On other consoles, this is entirely bypassed. I don't even know if this is fixable, from what I understand about how you're bypassing the EXEC. It's brief, but it does show up every time you hit reset. Quote Link to comment Share on other sites More sharing options...
freewheel Posted October 8, 2016 Share Posted October 8, 2016 New in version 1.2.8: (download in first post) Changed CC3/JLP memory flags to "=RM" for as1600 (needed for LTO-Flash) Could you elaborate on this? I've had no issues running my stuff on the LTO Flash, including games that save to its internal flash memory. You have me worried though. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 8, 2016 Author Share Posted October 8, 2016 Could you elaborate on this? I've had no issues running my stuff on the LTO Flash, including games that save to its internal flash memory. You have me worried though. I stumble upon this when using the --cc3 flag of IntyBASIC, LTO Flash woudn't detect the ROM file correctly and would run without the extra RAM memory until the flags where "=RW" Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 8, 2016 Author Share Posted October 8, 2016 Hey Oscar, I think I've run into something new. Unless someone's mentioned this before and I've forgotten: When I run an IntyBASIC game on a Sears console, it very quickly displays the standard EXEC titlescreen with "IntyBASIC program" as title and whatever random year you threw into the headers. On other consoles, this is entirely bypassed. I don't even know if this is fixable, from what I understand about how you're bypassing the EXEC. It's brief, but it does show up every time you hit reset. I didn't knew. Quote Link to comment Share on other sites More sharing options...
freewheel Posted October 8, 2016 Share Posted October 8, 2016 I stumble upon this when using the --cc3 flag of IntyBASIC, LTO Flash woudn't detect the ROM file correctly and would run without the extra RAM memory until the flags where "=RW" OK, so it doesn't affect JLP use - cool I didn't knew. Yeah, I doubt anyone has tested an IntyBASIC game on a Sears console yet (I think there's only been one IntyBASIC game on cart so far, and the LTO Flash was just released. Let me know if I can help out somehow, if you don't have a Sears console. Desert Bus will just have to live with this as a bug for now. Also, THANK YOU for DATA PACKED. I've been doing it manually for a while now; this will save me loads of time. Now I just have to see if reading/decoding is any simpler, or if you've just done what I do (sounds like it, from your description). 1 Quote Link to comment Share on other sites More sharing options...
+Tarzilla Posted October 8, 2016 Share Posted October 8, 2016 New in version 1.2.8: (download in first post) Added DATA PACKED for strings, same as DATA but fits two characters per word. Added OPTION EXPLICIT to force declaration of variables using DIM (without index), for example DIM A,B Enjoy it! Well, that's two things I could have used 3 months ago Thanks, it will be a great help for my next game! 1 Quote Link to comment Share on other sites More sharing options...
+Tarzilla Posted October 8, 2016 Share Posted October 8, 2016 Hey Oscar, I think I've run into something new. Unless someone's mentioned this before and I've forgotten: When I run an IntyBASIC game on a Sears console, it very quickly displays the standard EXEC titlescreen with "IntyBASIC program" as title and whatever random year you threw into the headers. On other consoles, this is entirely bypassed. I don't even know if this is fixable, from what I understand about how you're bypassing the EXEC. It's brief, but it does show up every time you hit reset. Doesn't intvsteve have a sears? He has everything else... Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted October 9, 2016 Share Posted October 9, 2016 New in version 1.2.8: (download in first post) Added DATA PACKED for strings, same as DATA but fits two characters per word. Added OPTION EXPLICIT to force declaration of variables using DIM (without index), for example DIM A,B Added OPTION WARNINGS to disable compilation warnings. Warns about strange use of constants in FOR/NEXT Changed CC3/JLP memory flags to "=RM" for as1600 (needed for LTO-Flash) Solved three minor bugs. (optimization: reused register already trashed, weird expression a<5>b crashing, array optimization would trigger as1600 error because of "big" constant) Enjoy it! Hi, Oscar, Perhaps it's something small, but you may want to consider the consistency of the "OPTION" keyword. It seems rather strange and unintuitive that "OPTION EXPLICIT" enables strict variable declarations, while "OPTION WARNINGS" disables warnings. Why not disable warnings by default and allow people to turn them on with the option? That way, IntyBASIC is permissive out of the box like typical BASIC. -dZ. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted October 9, 2016 Author Share Posted October 9, 2016 Hi, Oscar, Perhaps it's something small, but you may want to consider the consistency of the "OPTION" keyword. It seems rather strange and unintuitive that "OPTION EXPLICIT" enables strict variable declarations, while "OPTION WARNINGS" disables warnings. Why not disable warnings by default and allow people to turn them on with the option? That way, IntyBASIC is permissive out of the box like typical BASIC. -dZ. Well, the syntax for OPTION WARNINGS requires ON/OFF, so it is OPTION WARNINGS ON or OPTION WARNINGS OFF. The syntax for OPTION EXPLICIT is per Visual BASIC, you can have the following: OPTION EXPLICIT ' Same as ON OPTION EXPLICIT ON OPTION EXPLICIT OFF Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted October 9, 2016 Share Posted October 9, 2016 Well, the syntax for OPTION WARNINGS requires ON/OFF, so it is OPTION WARNINGS ON or OPTION WARNINGS OFF. The syntax for OPTION EXPLICIT is per Visual BASIC, you can have the following: OPTION EXPLICIT ' Same as ON OPTION EXPLICIT ON OPTION EXPLICIT OFF Ah! That's good! 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.