CompuServe Thread

Joystickport programming

4 messages in this thread
#46691From: Jochen SchonfeldMay 2, 1995 2:42 PM
>> English translation follows << Hallo! Ich bin normalerweise PC-Programmierer und soll nun ein Programm auf dem Amiga schreiben, das uber einen der beiden Joystick-Ports digitale Daten Daten annimmt (eine Leitung 1/0 bzw. +5V/0V, also TTL-kompatibel, am Druckerport des PC z. B. uberhaupt kein Problem). Nun meine Frage: Ist es moglich, den Joystick-Port des Amiga bitweise abzufragen? Wenn ja: Wie lasst sich dies in C realisieren? Fur jeden sachdienlichen Hinweis dazu bin ich dankbar und freue mich schon auf (hoffentlich positive) Antworten dazu. Viele Grusse aus Berlin Jochen Hello! I am "normally" PC-programmer and shall now write a program for the Amiga that reads (using one joystick-port) digital data (one cable 1/0 resp. +5V/0V, e. g. TTL-compatible, no problem when using the printer port of a PC). Now my question: Is it possible to read the status of the joystick-port pins bitwise? If yes: How to do in C? I'll be grateful for every useful solution and am looking forward to receiving (hope so positive) answers concerning my prob. Many greetings from Berlin Jochen
#46704From: Phillip WoollerMay 4, 1995 12:40 PM
You can read the joystick from C, I haven't got the information here, but if you get hold of the Amiga Hardware Reference (any revision) it will tell you there. There are other books that have these details but I cannot remember the names. The Joystick port though is a bit wierd in that you have to do some shifting and ANDing to get the actual results you are looking for (something to do with the mouse hardware). You MAY be able to use the OS, but that may be to complicated. You could also use the parralel port on the Amiga though. Reading that is easier to do, it's how most 8-bit sound samplers do it. I even did the same, but you may be better off switching to assembler. Phill
#46716From: Jochen SchonfeldMay 5, 1995 4:29 PM
Thanks, Phillip, for your help. I will try to get the hardware reference. Bye and greetinx from Berlin!
#46719From: Werner KazmierzakMay 5, 1995 11:43 PM
Jochen, of course it is possible to read the status of the joystick-ports pins (except pin 7, wich is +5V, and pin 8, which is GND). For details, read the AMIGA Hardware Reference Manual. I doubt that there is a C libs routine that will do the job you want. I fear you have to code this subroutine from scratch using assembler. There is quite an overhead to do the programming, because the Amiga is an multitasking machine, and for this you must not poll the port directly by your routine. – wkc – … via AP from Hamburg, Germany