Table of Contents

Programming the Extended Joystick


This section discusses:

Extended Joystick Resistors

Compared to some peripherals, such as the control pad, the variable resistors used to sense the x, y, and z values in the extended joystick are inherently noisy. This has two implications for your software.

Calibrating the Extended Joystick

All software titles must allow the user to calibrate the extended joystick prior to game play. This is a critical element of joystick programming.

The purpose of a setup routine for the joystick is to:

An example calibration routine is included in the code listing in this chapter. This calibration routine is intended as a starting point only, to ensure that the final routine is user friendly.

The purpose of extended joystick autorecalibration is to:

The following procedure steps you through the recommended sequence for setting up the extended joystick at the beginning of a title. Use this sequence as a model to develope an extended joystick setup routine.

<HTML><ol></HTML> <HTML><li></HTML><HTML><p></HTML>Over a background image, center a small cursor over a target using just the trim controls. Position the cursor so that a value of 512 in the stk_HorizPosition and stk_VertPosition elements of the StickEventData structure place it visually in the center of the target.<HTML></p></HTML> <HTML><p></HTML>When the cursor is centered, press the Play button on the base of the consumer joystick; this is to encourage the hands-free aspect of this part of the setup.<HTML></p></HTML><HTML></li></HTML> <HTML><li></HTML>Move the stick to the top-left corner of its range and depress the Fire button.<HTML></li></HTML> <HTML><li></HTML><HTML><p></HTML>Move the stick to the bottom-right corner of its range and depress the Fire button.<HTML></p></HTML> <HTML><p></HTML>If stk_DepthPosition (z) is being used, roll the Auxiliary Axis control away from you to the extreme end position and press the Fire button.<HTML></p></HTML><HTML></li></HTML> <HTML><li></HTML>Roll the Auxiliary control towards you to the extreme end position and press the Fire button.<HTML></li></HTML><HTML></ol></HTML>

Sample programs are provided on the 3DO InfoServer bulletin board (415.261.3405). Sample programs also are provided in the 3DO:Examples:Eventbroker folder included with this version of the Portfolio. The Developer Technical Support staff on the InfoLine (415.261.3400) is available for additional information