GLBasic forum

Main forum => GLBasic - en => Topic started by: Minion on 2011-May-29

Title: Pandora Joysticks
Post by: Minion on 2011-May-29
OK... I give up ;( Has anyone else been able to read the joypad/nubs/buttons on the Pandora ?

Ive tried everything to get the data from them and nothing is coming back. I can get the info back from a standard usb joytick on the PC, but for the life of me I can get nothing back on the Pandora (barr the left nub, and thats all ;( )

Anyone else had any luck with this ?
Title: Re: Pandora Joysticks
Post by: MrTAToad on 2011-May-29
Post a bug report, although users with a Pandora are rarer than a hen with doggy dentures.
Title: Re: Pandora Joysticks
Post by: Minion on 2011-May-29
Cant repost a bug report as it doesnt thro up any errors ;(

Im using the following code just to get feedback on the controls...and I get nothing.

Code (glbasic) Select

LOCAL n,n$,x,y,z,rx,ry,rz,b,dx,dy,n


WHILE TRUE
n$ = GETJOYNAME$(n)
x# = GETJOYX(n)
y# = GETJOYY(n)
z# = GETJOYZ(n)
rx# = GETJOYRX(n)
ry# = GETJOYRY(n)
rz# = GETJOYRZ(n)
dx# = GETDIGIX(n)
dy# = GETDIGIY(n)

PRINT n$,0,0
PRINT "x#  "+x#,0,32
PRINT "y#  "+y#,0,48
PRINT "z#  "+z#,0,64

PRINT "rx# "+rx#,0,96
PRINT "ry# "+ry#,0,112
PRINT "rz# "+rz#,0,128

PRINT "dx# "+dx#,0,160
PRINT "dy# "+dy#,0,176

FOR m=0 TO 15
b = GETJOYBUTTON(n, m)
PRINT "b"+m+"  "+b,400,(m*16)+32
NEXT

SHOWSCREEN

WEND
Title: Re: Pandora Joysticks
Post by: MrTAToad on 2011-May-29
The fact that it may not be working could mean its a bug  :P
Title: Re: Pandora Joysticks
Post by: Kitty Hello on 2011-May-30
Are you sure the nub is working properly? There's a test porgram installed and some (mine e.g.) right nubs are broken.
Title: Re: Pandora Joysticks
Post by: Minion on 2011-May-30
Both nubs work fine, but I can only get the data back for the left nub ;(

I can get all the data back for the buttons, l/r sholder buttons and the d-pad by using KEY(#) tho, so its not a total disaster, it just made more sense to use the joystick commands. I just cant use the nubs ;(
Title: Re: Pandora Joysticks
Post by: Kitty Hello on 2011-May-30
I was told you have to set the nub in joystick mode. Then the right nub should be joystick #3 from GLBasic.
(There's a switch: right nub=mouse/joystick somewhere IIRC).
Title: Re: Pandora Joysticks
Post by: Minion on 2011-May-30
Cheers, I`ll look into that.

For the time being the KEY() will be fine tho as I only need the d-pad and buttons for what Im doing next ... a slew of the old VFD tabletop games ;) I thinky Pandy is ideal for that ;)
Title: Re: Pandora Joysticks
Post by: Kitty Hello on 2011-May-31
Oh, I never heared of the VFT games. Had a quick look, was not well known in Gemany. Or I'm too young. Bright idea to port!
Title: Re: Pandora Joysticks
Post by: Minion on 2011-May-31
Bit rough and ready, but this is the basic idea (for the first). As Ive got lots of these it shouldn`t be too hard to "sim" the rest ;)

[attachment deleted by admin]
Title: Re: Pandora Joysticks
Post by: Kitty Hello on 2011-May-31
awesome!
Maybe placing the icons not on a rectangular grid, but move the topper ones a bit closer to the center will look even better.
Title: Re: Pandora Joysticks
Post by: LineOf7s on 2011-Jun-01
Just had to chime in lamely and say:  I had that game!   =D
Title: Re: Pandora Joysticks
Post by: quangdx on 2011-Jun-01
Quote from: Kitty Hello on 2011-May-31
Oh, I never heared of the VFT games. Had a quick look, was not well known in Gemany. Or I'm too young. Bright idea to port!

Great simulation of a classic
http://www.pica-pic.com/#/caveman/ (http://www.pica-pic.com/#/caveman/)
Title: Re: Pandora Joysticks
Post by: Minion on 2011-Jun-12
I dont know how many other people here use GL for coding on the Pandora, but I`d like to know if there is any. Im giving up on this. 1 sprite on screen and I cant get it over 3fps ;(

*edit* Ah...it would appear that pandy doesnt like CREATESCREEN/USESCREEN :( ... without it I get a rock steady 60 fps with hundreds of sprites !

* * Edit * * Im an arse .... please excuse my inability to code atm. USESCREEN 0 works fine on my PC so didnt see my error, which was I should be using -1 .... I`ll go and sit in a corner somewhere and shoot myself. Sorry for the inconvenience.
Title: Re: Pandora Joysticks
Post by: Minion on 2011-Jun-16
Just thought I`d post an update screenshot now ive finally got it all working :)




[attachment deleted by admin]
Title: Re: Pandora Joysticks
Post by: erico on 2011-Jun-16
looks great! congrats! :good:
Title: Re: Pandora Joysticks
Post by: Moru on 2011-Jun-17
Aw, I want my pandora!
Title: Re: Pandora Joysticks
Post by: Minion on 2011-Jun-17
And the deom mode running ;)

http://www.youtube.com/watch?v=lM1cebXI0do
Title: Re: Pandora Joysticks
Post by: LineOf7s on 2011-Jun-18
Oh, very nice.  Well done.   =D
Title: Re: Pandora Joysticks
Post by: erico on 2011-Jun-18
Hey Minion,
post your game and video on a new thread, that way you get more people commenting and into it.
Title: Re: Pandora Joysticks
Post by: Minion on 2011-Jun-20
Opps ...ive found a few problems. Firstly with SOUNDPLAYING. This little nugget took me hours to work out ;( I was doing the old "play a sound and dont do anything until the sound stops" routine. But for the life of me I couldn`t get the SOUNDPLAYING to work ;( turns out that andy sound abouve 15 doesnt register with sound playing (I used sound 100 for my music piece)

This doesnt work (Anything 16 and above)
Code (glbasic) Select

LOADSOUND "sound.wav",16,1
LOCAL ch
ch=PLAYSOUND(16,0,1)
WHILE SOUNDPLAYING(ch)
SHOWSCREEN
WEND
END


But this does work
Code (glbasic) Select

LOADSOUND "sound.wav",15,1
LOCAL ch
ch=PLAYSOUND(15,0,1)
WHILE SOUNDPLAYING(ch)
SHOWSCREEN
WEND
END


Also...I was trying the old speed test using DRAWSPRITE and POLYVECTOR and USESCREEN to see which was giving me the best results. I wrote a noddy program to test it to see the results, but tested it on the PC first.

Results I got upset me. On my PC when drawing 50,000 sprites using DRAWSPRITE I got an fps of around 25 to 30, using POLYVECTOR I got 59fps, and when using POLYVECTOR to a virtual screen and then copying that screen to the backbuffer I also got 59 fps (Which is pretty much what I expected)

But doing a similar thing on the pandora using only 500 sprites the results where very odd

Just using DRAWSPRITE I got 55 fps
using just POLYVECTOR I get 48 fps
and using POLYVECTOR to a virtual screen and then copying to the backbuffer I get 22 fps ;(

Is this right ?

Ive also noticed some strange oddities with sound on the Pandy, but haven`t got around to pinpoint these yet, so as soon as I find out whats what I`ll let you know.

Title: Re: Pandora Joysticks
Post by: Minion on 2011-Jun-30
Is there anything I can do with this speed issue ?

Also, is there a problem with PLAYSOUND or is it something I`m missing ?
Title: Re: Pandora Joysticks
Post by: Kitty Hello on 2011-Jun-30
It seems the pandora virtual buffer copying takes so long. That's very strange. I will see if I can do anything about it. Maybe the colour format of the internal surfaces does not equal the screen surface.