QL & PC Joysticks

A place to discuss general QL issues.
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

QL & PC Joysticks

Post by stevepoole »

Hi,
I have a working QL Joystick, with a 9 pin D socket, and 6 pin adapter.
It translates 4 arrow keys, with fire and base buttons.

I have written a shootem up game in full 3D perspective animation on QPC2.
Is there any way to adapt the joystick for a laptop?
i.e: it would need an adapter for USB no doubt, if such a thing exists.

Commercial PC 'Joysticks' do not seem to be compatible with QPC2...
Regards,
Steve Poole.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2816
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL & PC Joysticks

Post by vanpeebles »

I reckon there must be a way of mapping the PC joystick to the keys on the game?


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QL & PC Joysticks

Post by tofro »

vanpeebles wrote:I reckon there must be a way of mapping the PC joystick to the keys on the game?
There is -this one is just an example of many possibilities that might be worth trying.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
vanpeebles
Commissario Pebbli
Posts: 2816
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL & PC Joysticks

Post by vanpeebles »

Any screenshots of the game? Sounds interesting! :ugeek:


User avatar
Peter
QL Wafer Drive
Posts: 1953
Joined: Sat Jan 22, 2011 8:47 am

Re: QL & PC Joysticks

Post by Peter »

Sounds cool, any chance it will run on native hardware?


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Post by stevepoole »

Thanks for the replies,

I was hoping not to buy a PC joystick, as I have been quoted some pretty onerous prices for them.
Tofro's mapping method may be an option though, if I have no choice with my QL joystick.

I take it a screen-shot would be loaded onto the Forum via the 'Img' button above. I have not used this feature before.

As for native hardware, the program is fast enough on QPC2, but too slow on my SGC QL...

BTW, I can find no way to clear out the keyboard Queue completely. No doubt this is done to avoid people writing keyloggers?

Regards,
Steve Poole.


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Post by stevepoole »

Capture d’écran (59).png
Hi,
This is my first attempt to load a screenshot...

The program draws a 'hilly' draughtsboard. You fly around the scenery shooting at the draughts, against the clock.

(Just a rapid programming exercise, to test some general subroutine updates).

Two players can even play a game of draughts on it, but not against the QL.

Regards,
Steve Poole.


RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: QL & PC Joysticks

Post by RWAP »

Looks intriguing :)


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Post by stevepoole »

Hi,
The game could be accelerated considerably, if the keyboard queue could be cleared at will.
Unfortunately, both inkey$ and Keyrow constructs do not clear it, even though documentation states the opposite for the latter.
This means you have to 'peck' rapidly at keys, rather than, say, pressing an arrowkey continuously.
Machine code games seem to avoid this problem, but this game is written in SBasic... Perhaps m/c Pokes some obscure address to clear it out ?
Any suggestions ?
Steve Poole.


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QL & PC Joysticks

Post by pjw »

stevepoole wrote:Hi,
The game could be accelerated considerably, if the keyboard queue could be cleared at will.
Unfortunately, both inkey$ and Keyrow constructs do not clear it, even though documentation states the opposite for the latter.
This means you have to 'peck' rapidly at keys, rather than, say, pressing an arrowkey continuously.
Machine code games seem to avoid this problem, but this game is written in SBasic... Perhaps m/c Pokes some obscure address to clear it out ?
Any suggestions ?
Steve Poole.
I had this problem years ago and wrote a small toolkit to solve it. Then I discovered that a dummy keyrow call before the inkey$ does the same. Are you saying this doesnt work for you?

Code: Select all

k = KEYROW(0)
k$ = INKEY$(#ch; timeout)
Another thing you might try is

Code: Select all

rep lp: if inkey$(#ch; 0) = "": exit lp:endif:endrep lp
If thats no good, I could send you my ClearQ toolkit to try.


Per
dont be happy. worry
- ?
Post Reply