Main > Software Forum

Lazarus 3.0 here!

Pages: << < (3/4) > >>

Yarb:

Ahh that is binary so you can use boolean to isolate them. In a binary word, say 4 bits for a joystick each switch would map to one of the bits. Since each bit is a power of 2 it would work like this

Assuming left right up down

L R U D
1 1 1 1   4 Bits read 1 if pressed and 0 if not
1 2 4 8   Their Decimal values

If the joy is pressed left the value would be 1, if up it would be 4 if left and up it would be 5 (The sum of the two bits).You can test a single switch with the boolean AND function, if you wanted to test if the up switch is pressed just AND the word with 0010 or Decimal 4. Since in binary the and function requires a 1 in the corrisonding bit of both arguments to return a one in that position the 0's effecively mask out the unwanted bits. If the result is 0 then the button is not pressed regardless of the other buttons, if it is non zero then it is pressed. You can easily make a table of values for all combinations as well. I'm not sure how you need to read and use the informations but if you want add more info or drop an e-mail I'd be glad to help.

Yarb

Howard_Casto:

Yeah that'll work, but there is an odd thing about the buttons which make them hard to isolate....  Usually they do go by powers of two but i've found that on some they jump around.  It makes no sense to me and seems to depend upon the type of joystick.  Anyway when I feel like starting joystick support again I'll drop you a line... thanks for your advice.  :)

mhoward211:

If I am reading this correctly the joystick in our cabinets is not supported?  Would this mean not supported when you needed to scroll this list of games and whatnot?  How is one suppose to navigate your front end when it is used within a cabinet?

)p(:


--- Quote from: mhoward211 on September 05, 2002, 12:41:30 pm ---
If I am reading this correctly the joystick in our cabinets is not supported?  Would this mean not supported when you needed to scroll this list of games and whatnot?  How is one suppose to navigate your front end when it is used within a cabinet?

--- End quote ---


it uses keyboard strokes for input. As you know most of us use keyboard encoders like the ipac for our arcade joysticks.. If you use a joystick there are programs like joytokey to make lazarus, and also 3darcade,  work with them...

Peter

SirPoonga:

Those with gamepad hacks will have to get driver software that maps buttons to keys.  Yeah, it sucks.

Pages: << < (3/4) > >>

Go to full version