bogax Posted June 11, 2013 Share Posted June 11, 2013 (edited) Here's a bit of sillyness. It's a debounce routine using two bit vertical counters with simulated keypresses. A counter is used for to simulate the keypresses. The first line at the top is the simulated keypresses. The first half of each simulated press or release is random to simulate bounce. That's the second line, the bouncy key signal. The third line is the debounced signal. The last two lines are the two bit debounce counter. Debounce follows the keypress on the third good key sample. There's eight channels but only one is shown. It does 32 samples from left to right across screen then waits for fire and then does it again. debounce.bas edit I should point out that debounce is inverted relative to the key. On the screen debounce is inverted to appear the same as the keypress. A switch reads 0 when closed. Debounce goes to 1 when the switch is closed. I thought that would fit better with how it would be/is used in bB. (Although I don't expect that a debounce is necessary or that this debounce routine would ever actually be used ) Edited June 11, 2013 by bogax Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 11, 2013 Share Posted June 11, 2013 I know not what this be do. I think R.T. uses the word "debounce" to refer to stopping the fire button from repeating immediately. Is that what this is demonstrating? P.S. THANK YOU again for your score debug code. it greatly helped me recently overcome a coding block (like a writers block) I had with chasing enemies around a multi-screen map. Quote Link to comment Share on other sites More sharing options...
bogax Posted June 11, 2013 Author Share Posted June 11, 2013 (edited) No but that's what this bit does for fire. temp1 = ((jf ^ $80) | INPT4) & $80 : jf = INPT4 if temp1 then goto draw see this thread Demo - Batman Edited June 11, 2013 by bogax Quote Link to comment Share on other sites More sharing options...
bogax Posted June 11, 2013 Author Share Posted June 11, 2013 Still playing with it. Here I removed the inversion of debounce on the screen. Debounce goes high for the simulated keypress going low. I added edge detection (the fourth line) I streamlined the debounce and made it wait for 4 good samples. debounce2.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 12, 2013 Share Posted June 12, 2013 I think R.T. uses the word "debounce" to refer to stopping the fire button from repeating immediately. Is that what this is demonstrating? That has been changed to Repetition Restrainer: randomterrain.com/atari-2600-memories-batari-basic-commands.html#repetition_restrainer_for_fire_button A similar thing is used for the reset switch and the select switch. 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.