Thread
Mouse in Applesoft BASIC
Does anybody know how to access mouse movements (and maybe even the button! That would be wondrous!) in Applesoft BASIC? I know how to do the joystick, but I'm unsure about how to get the mouse. This would really make some little apps more fun and interesting.
Here's details on the machine language interfaces:
http://home.swbell.net/rubywand/R034MOUSEPRG.TXT
Convert the hex to decimals; peek, poke, and call - and you're good to go in BASIC. ;-)
http://home.swbell.net/rubywand/R034MOUSEPRG.TXT
Convert the hex to decimals; peek, poke, and call - and you're good to go in BASIC. ;-)
Hear that sound? That was my brain asploding
Is there an easier way? I know that to do things with the joystick in BASIC you use "pdl", but isn't there something like that for the mouse?
Is there an easier way? I know that to do things with the joystick in BASIC you use "pdl", but isn't there something like that for the mouse?
Depends what slot you have it in. Say you have it in slot 4, then try using IN #4 and then loop over INPUT X,Y,B and PRINT X, Y, B or something like that and see if you get the desired values.
Edit: I just had a try with an emulator, but couldn't get it to work. Might have more luck remembering the details on my real machine at home (with a couple of books to refer to!)
Edit: I just had a try with an emulator, but couldn't get it to work. Might have more luck remembering the details on my real machine at home (with a couple of books to refer to!)
Try searching comp.sys.apple2 and comp.sys.apple2.programmer on Google Groups... there's a bit of useful info on there.
http://your.head.asplode.net/Hear that sound? That was my brain asploding![]()
No, not built in. The paddle interface was there since day 1 of the Apple II, but the mouse card came much, much later. Long after BASIC updates had ceased. It wouldn't surprise me if there are extensions out there, but I'm not aware of any.Is there an easier way? I know that to do things with the joystick in BASIC you use "pdl", but isn't there something like that for the mouse?
Luddite: Thanks, I'll have to poke around in there a bit
Dave: Alrightey, thanks for confirming what I had thought but not hoped for
I'll keep looking around though.
Dave: Alrightey, thanks for confirming what I had thought but not hoped for
I'll keep looking around though.