JoyPad - Coded by MidnightDreamer
===============================>>


What is it?
--------->>

JoyPad is a program which reads and records input from a Joystick/
Joypad. The readings are taken from Qbasics own STICK comand, and the 
number recorded from the address for the buttons.

A slightly pointless program I wrote to muck around with the joystick. 
Hopefully someone may actually use it...

What is data.joy?
--------------->>

After you run the program you will find that you end up with a file called 
data.joy. So, pretty obviously, you'll find that this file contains info 
which came from the joystick... stuff which QB recorded. Of course, this 
is all catalogued for your convenience in a nice little file. Some lines 
of numbers. Great, wow, but what the hell does it actually mean? Well, thats 
why im writing this. OK, so here is a list of what comes out:

1) "on "/"off" - a 3 digit string containing the words to tell you...
2) Xcenter (2 digit integer)
3) ycenter (2 digit integer)
4) 
5)
6)
7)
8) A button (2/3 digit integer)
9) B button (2/3 digit integer)
10) START button (2/3 digit integer)
11) SELECT button (2/3 digit integer)

This looks like crap!
===================>>

Yeah, I know, it doesn't seem to have any actual value does it? But wait, 
what about when I give you a simple basic program to show you just how?
OK then, sure. Heres one I made earlier:

CLS
'
TYPE PadType
  DeviceOn  AS STRING * 3
  Xcenter   AS INTEGER
  Ycenter   AS INTEGER
  Up        AS INTEGER
  Right     AS INTEGER
  Down      AS INTEGER
  Left      AS INTEGER
  BtnA      AS INTEGER
  BtnB      AS INTEGER
  BtnStart  AS INTEGER
  BtnSelect AS INTEGER
END TYPE
DIM SHARED Pad AS PadType 'define types and create an array
'
FileNo% = FREEFILE
OPEN "data.pad" FOR INPUT AS #FileNo%
  INPUT #FileNo%, Pad.DeviceOn
  INPUT #FileNo%, Pad.Xcenter
  INPUT #FileNo%, Pad.Ycenter
  INPUT #FileNo%, Pad.Up
  INPUT #FileNo%, Pad.Right
  INPUT #FileNo%, Pad.Down
  INPUT #FileNo%, Pad.Left
  INPUT #FileNo%, Pad.BtnA
  INPUT #FileNo%, Pad.BtnB
  INPUT #FileNo%, Pad.BtnStart
  INPUT #FileNo%, Pad.BtnSelect
CLOSE #FileNo%                    'load specs
'
DO
KEYcode = INP(&H60)    'keyboard input code
JOYcode = INP(&H201)   'joystick button input code
  IF STICK(1) <= Pad.Up + 10 THEN
    LOCATE 3, 3: PRINT "U     "
  ELSEIF STICK(1) >= Pad.Down - 10 THEN
    LOCATE 3, 3: PRINT "D     "
  ELSEIF STICK(0) <= Pad.Left + 10 THEN
    LOCATE 3, 3: PRINT "L     "
  ELSEIF STICK(0) >= Pad.Right - 10 THEN
    LOCATE 3, 3: PRINT "R     "
  ELSEIF JOYcode = Pad.BtnA THEN
    LOCATE 3, 3: PRINT "A     "
  ELSEIF JOYcode = Pad.BtnB THEN
    LOCATE 3, 3: PRINT "B     "
  ELSEIF JOYcode = Pad.BtnStart THEN
    LOCATE 3, 3: PRINT "START "
  ELSEIF JOYcode = Pad.BtnSelect THEN
    LOCATE 3, 3: PRINT "SELECT"
  END IF
DEF SEG = 0: POKE &H41A, PEEK(&H41C)  'clears the keyboard buffer
LOOP UNTIL KEYcode = 1  'escape quits
END

Waddya think? A neat little program which reads and puts together a nice 
little routine which reads from the joystick! Wow!

If you've got a question, or want to generally moan at me for the poor 
standard of programs, heh, just e-mail me:
--->>midnightdreamer@wongfaye.com
or visit the site:
--->>http://blackgc.f2g.net

COPYRIGHT
=======>>

THIS PROGRAM IS FREEWARE, AND YOU ARE FREE TO DISTRIBUTE AT WILL WHERE NO 
CHARGE IS PAID FOR THE PROGRAM ITSELF AND ONLY THE DISTRIBUTION COSTS. 
JOYPAD IS COPYRIGHT (C) 2002 BLACK GATE CORPS AND (C) 2002 DOUG INMAN / 
MIDNIGHTDREAMER AND MAY NOT BE EDITED FOR RE-DISTRIBUTION PURPOSES. 
FOR INFORMATION CONTACT MIDNIGHTDREAMER AT MIDNIGHTDREAMER@WONGFAYE.COM . 
