nsn Posted February 22, 2017 Share Posted February 22, 2017 Hi! I need a second "gesture" in my game (to switch between different display modes), and I don't want players to have to reach for any of the h/w switches on the console - so I want to detect whenever the player presses the fire button for a significant duration (say 500ms?) Are there any best practices to do this? Preferably w/o using a byte of ram for counting frames? I'm using plain assembler, no bAtari basic thanks! Quote Link to comment Share on other sites More sharing options...
ZackAttack Posted February 22, 2017 Share Posted February 22, 2017 I think you have to count frames. For 500ms it's only 5 bits though. Just increment the variable every frame. And with $e0 if button isn't pressed. If count exceeds threshold switch modes. You could make $20 the flag for displaying the other mode so you switch modes for free once it counts to 32 frames. Then you can and with $C0 regardless of the display mode and releasing the button switches back to the original mode. Quote Link to comment Share on other sites More sharing options...
nsn Posted February 23, 2017 Author Share Posted February 23, 2017 OK, I'll just count frames then thanks for the quick answer! 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.