vprette Posted October 22, 2014 Share Posted October 22, 2014 (edited) This is my intybasic prog to test the keypad (0-9, ctrl,enter and disc) values C1 and C2 are read from intybasic variables cont1 and cont2 (controllers) keypad_v1.rom Edited October 22, 2014 by vprette 3 Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/ Share on other sites More sharing options...
+DZ-Jay Posted October 23, 2014 Share Posted October 23, 2014 (edited) I just tested this on an emulator and it doesn't properly detect the "ENTER" keys in either controller. Also, the "0" key on the left controller (i.e., Pad-1), is highlighted on top of the "C" when pressed. Also, the detection is rather slow. I have to press the keys hard and long for them to be noticed. It does not seem to detect slight "taps." Contrast it with the attached ROM (which only tests the left controller), which is very fast and responsive. (Please ignore the crappy look, the screen manipulation libraries are not implemented yet.) Is the sluggishness due to your code or is it IntyBASIC itself? -dZ. pmach_driver.rom Edited October 23, 2014 by DZ-Jay 1 Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097766 Share on other sites More sharing options...
+DZ-Jay Posted October 23, 2014 Share Posted October 23, 2014 It seems to detect the keys (the numbers are updated). It's the display over the screen keypad that seems to not work correctly for those keys. Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097791 Share on other sites More sharing options...
vprette Posted October 23, 2014 Author Share Posted October 23, 2014 I just tested this on an emulator and it doesn't properly detect the "ENTER" keys in either controller. Also, the "0" key on the left controller (i.e., Pad-1), is highlighted on top of the "C" when pressed. Also, the detection is rather slow. I have to press the keys hard and long for them to be noticed. It does not seem to detect slight "taps." Contrast it with the attached ROM (which only tests the left controller), which is very fast and responsive. (Please ignore the crappy look, the screen manipulation libraries are not implemented yet.) Is the sluggishness due to your code or is it IntyBASIC itself? -dZ. pmach_driver.rom is the rom you attached made in asm or basic? I do correct the left "0" bug tonight, for the rest I'm not sure how can I improve. On my PC the detection is very fast... Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097792 Share on other sites More sharing options...
+DZ-Jay Posted October 23, 2014 Share Posted October 23, 2014 It was made in Assembly, but using a general-purpose framework, so its functionality from a generalized game engine and not just made exclusively to poll the controller. Your test is fine for something like Tic-Tac-Toe, but it may be too sluggish for an action game. I think that's because IntyBASIC only polls at most at 60 Hz, and the program has to pause until the next ISR happens. Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097801 Share on other sites More sharing options...
vprette Posted October 23, 2014 Author Share Posted October 23, 2014 It was made in Assembly, but using a general-purpose framework, so its functionality from a generalized game engine and not just made exclusively to poll the controller. Your test is fine for something like Tic-Tac-Toe, but it may be too sluggish for an action game. I think that's because IntyBASIC only polls at most at 60 Hz, and the program has to pause until the next ISR happens. yes my test was made with the purpose to re-use the code in tic tac toe... it works properly for tic tac but I agree some further test would be made for action game... anyway I hope to have added some useful input for the intybasic community speaking about the controllers Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097809 Share on other sites More sharing options...
+DZ-Jay Posted October 23, 2014 Share Posted October 23, 2014 anyway I hope to have added some useful input for the intybasic community speaking about the controllers Yes, you have. Did you post your source code as well so that others can take advantage of it? Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097833 Share on other sites More sharing options...
vprette Posted October 23, 2014 Author Share Posted October 23, 2014 Yes, you have. Did you post your source code as well so that others can take advantage of it? I will after fixing the bug Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3097869 Share on other sites More sharing options...
vprette Posted October 23, 2014 Author Share Posted October 23, 2014 last version and source Anyone can improve: it can be polished and it is possible to use directly the con1 and con2 value instead of con.key.. code will be shorter but I did use con.key in purpose to understand how this works keypad.zip Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3098141 Share on other sites More sharing options...
intvnut Posted October 24, 2014 Share Posted October 24, 2014 last version and source Anyone can improve: it can be polished and it is possible to use directly the con1 and con2 value instead of con.key.. code will be shorter but I did use con.key in purpose to understand how this works Ah, I see why the update is slow. The main loop has two WAITs in it, and the controller-scan loop has two more WAITs in it. Each WAIT waits for a vertical refresh. The whole thing will run no faster than 15Hz. Also, couldn't you shorten this up quite a bit? IF cont1.left THEN tasto=20 IF cont1.right THEN tasto=20 IF cont1.up THEN tasto=20 IF cont1.down THEN tasto=20 IF CONT1.KEY=0 THEN tasto=0 IF CONT1.KEY=1 THEN tasto=1 IF CONT1.KEY=2 THEN tasto=2 IF CONT1.KEY=3 THEN tasto=3 IF CONT1.KEY=4 THEN tasto=4 IF CONT1.KEY=5 THEN tasto=5 IF CONT1.KEY=6 THEN tasto=6 IF CONT1.KEY=7 THEN tasto=7 IF CONT1.KEY=8 THEN tasto=8 IF CONT1.KEY=9 THEN tasto=9 IF CONT1.KEY=10 THEN tasto=10 IF CONT1.KEY=11 THEN tasto=11 Seems like that could be something more like: tasto = CONT1.KEY IF cont1.left THEN tasto=20 IF cont1.right THEN tasto=20 IF cont1.up THEN tasto=20 IF cont1.down THEN tasto=20 Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3098317 Share on other sites More sharing options...
+DZ-Jay Posted October 24, 2014 Share Posted October 24, 2014 Why don't you check out the "controller.bas" example that comes with IntyBASIC, for reference? The test seems very similar to yours, but it is very fast and responsive. -dZ. Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3098390 Share on other sites More sharing options...
freewheel Posted October 25, 2014 Share Posted October 25, 2014 Why don't you check out the "controller.bas" example that comes with IntyBASIC, for reference? The test seems very similar to yours, but it is very fast and responsive. -dZ. I've already mentioned this before (possibly in another thread). The cont1.key syntax, for whatever reason, is dead slow. You need to do something like c1=cont1, or heck even c1=cont.key, and then base your logic on c1. Checking the cont1.key so many times in a row is what slows it down. Or muddles up the input returned, giving the same effect (depends on exactly where you place your WAITs). My experience leads me to believe that the keypad is nearly useless for in-game use, with IntyBASIC, unless you start to get a lot more clever with it. Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3098915 Share on other sites More sharing options...
intvnut Posted October 25, 2014 Share Posted October 25, 2014 I've already mentioned this before (possibly in another thread). The cont1.key syntax, for whatever reason, is dead slow. You need to do something like c1=cont1, or heck even c1=cont.key, and then base your logic on c1. Checking the cont1.key so many times in a row is what slows it down. Or muddles up the input returned, giving the same effect (depends on exactly where you place your WAITs). My experience leads me to believe that the keypad is nearly useless for in-game use, with IntyBASIC, unless you start to get a lot more clever with it. Have you or anyone else looked at the code IntyBASIC generates, to try to understand why? Quote Link to comment https://forums.atariage.com/topic/231041-keypad-tester-for-intv/#findComment-3098923 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.