Jump to content
IGNORED

help with simple BASIC fix using strig(0)


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by vitoco
Link to comment
Share on other sites

 

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :P

  • Like 3
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...