Jump to content

Recommended Posts

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 by DZ-Jay
  • Like 1

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.

 

attachicon.gifpmach_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...

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.

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

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? ;)

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

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.

 

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?

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