Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JoyStick Support #7

Open
trudnai opened this issue May 19, 2020 · 2 comments
Open

Add JoyStick Support #7

trudnai opened this issue May 19, 2020 · 2 comments

Comments

@trudnai
Copy link
Owner

trudnai commented May 19, 2020

  • Mouse 2 Joystick
  • Keyboard 2 Joystick
  • USB Joystick 2 Joystick
  • USB Game Controller 2 Joystick (is this same as above?)
@trudnai
Copy link
Owner Author

trudnai commented May 20, 2020

Two keys on the //e's keyboard are actually directly connected to the game I/0 connector's push-button input lines. These are the OPEN-APPLE and CLOSED-APPLE keys that flank the space bar. These two keys are connected to PB0 and PB1, respectively.

$C061 (49249) PB0   Status of push button 0 (bit 7)
$C062 (49250) PB1   Status of push button 1 (bit 7)
$C063 (49251) PB2   Status of push button 2 (bit 7)
100 IF PEEK<49249>>127 THEN PRINT "DOWN WE GO!"
200 IF PEEK<49249><128 THEN PRINT "BACK AGAIN!"
300 GOTO 100

@trudnai
Copy link
Owner Author

trudnai commented May 20, 2020

$C064  (49252) GC0  Status of game controller 0 (bit 7)
$C065  (49253) GC1  Status of game controller 1 (bit 7)
$C066  (49254) GC2  Status of game controller 2 (bit 7)
$C067  (49255) GC3  Status of game controller 3 (bit 7)
$C070  (49264) GCRESET  Reset the game controllers

When this timer is reset, by accessing GCRESET ($C070), bit 7 of each GC I/0 memory location becomes high (1) but will eventually become low (0) when the timer "times out," that is,
the period of time equal to the time constant for each of the four "RC" circuits has elapsed.

Maximum time constant for this circuit is 0.022 x 150,000 ohms
= 0.0033 second. That is, when the resistance is at its maximum, the time required for the 558 Timer to bring bit 7 of the GC I/0 memory location low (0) is about 3.3 milliseconds

PREAD ($FB1E) subroutine located in the system monitor; it checks for a timeout condition every 11 microseconds.) You should note, however, that the PDL functions assume that your input resistance is in the range 0-150K ohms. This translates to a time constant that ranges from 0 to about 2.8 milliseconds and to PDL readings between 0 and 255. (Remember that the PDL subroutine's counter increments every 11 microseconds until the timer has timed out. This means that the maximum allowable time constant is 255* 11 microseconds, or 2.8 milliseconds.) If the upper limit of the resistance is higher than
150K ohms, then there will be a "dead area" where the resistance may change but the value calculated stays at 255; if it is lower, then the highest PDL value that can be generated will be less than 255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant