+hloberg Posted August 27, 2018 Share Posted August 27, 2018 This is fairly simple I just can't seem to get a good fix on it. I have a Atari BASIC (actually TBXL) program where you move the stick then choose a menu option by pressing the trigger. then I jump to another menu option that also presses the trigger for confirmation. Problem is the 1st trigger press will carry over to the 2nd menu if you don't pull off the trigger fast enough. I have tried a timing loop for a short pause but that only mostly work. what i want to do is after the 1st trigger press make the user re-press the trigger before it works again. any ideas? thx, HLO Quote Link to comment Share on other sites More sharing options...
thank you Posted August 27, 2018 Share Posted August 27, 2018 when the trigger is pressed branch to a loop that waits for it to be released, then jump to the second menu. Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 27, 2018 Author Share Posted August 27, 2018 when the trigger is pressed branch to a loop that waits for it to be released, then jump to the second menu. in other words: 90 rem ***strig wait loop*** 100 if strig(0)<>15 then 100 200 return don't know why i didn't think of that. i guess i was trying to make it too complicated. thx Quote Link to comment Share on other sites More sharing options...
vitoco Posted August 27, 2018 Share Posted August 27, 2018 Turbo Basic XL? REPEAT:UNTIL STRIG(0) Quote Link to comment Share on other sites More sharing options...
vitoco Posted August 27, 2018 Share Posted August 27, 2018 (edited) in other words: 90 rem ***strig wait loop*** 100 if strig(0)<>15 then 100 200 return don't know why i didn't think of that. i guess i was trying to make it too complicated. thx Line with 15 seems to be checking for joystick position, and that should be using STICK(0) function instead of STRIG(0), which can only return 0 (pressed) or 1 (released). Edited August 27, 2018 by vitoco Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 27, 2018 Author Share Posted August 27, 2018 Line with 15 seems to be checking for joystick position, and that should be using STICK(0) function instead of STRIG(0), which can only return 0 (pressed) or 1 (released). figured that I had goofed later but didn't have the time to change it. yup, should be strig(0)<>0 been out of 800 programming for so long forgot the basics. Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 27, 2018 Author Share Posted August 27, 2018 Turbo Basic XL? REPEAT:UNTIL STRIG(0) elegant. i try it Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 27, 2018 Author Share Posted August 27, 2018 another question 10 if x=y then gosub 4000: g=g+1 20 rem dummy line in line 10 does the return from 'gosub 4000' go to to the next statement in the IF statement 'g=g+1' or does it drop down to line 20 after the return from 4000 ignoring the 'g=g+1'? some BASICs have a real problem with this. I can't remember if TBXL and Atari BASIC does. Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 27, 2018 Share Posted August 27, 2018 After return it'll execute the g=g+1. To get it to execute only if x isn't = y you'd use ELSE. But Atari basic doesn't support it. The substitute for else would be to put a GOTO that skips the next line, and put your "ELSE" code in the skipped line. 2 Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 28, 2018 Author Share Posted August 28, 2018 Ugh. I'm rewriting a MilleBourne BASIC card game for joystick entry instead of keyboard. I'm going to use it on my Atari 800 emulator of my Sony PSP (which works really well with games that don't use the keyboard). finding out how much I forgot about Atari 8-bit programing. can't wait till I get back to assembler. should be real fun. 3 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.