Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!well!ewhac From: ewhac@well.UUCP Newsgroups: comp.sys.amiga Subject: Re: gameport.device Message-ID: <2679@well.UUCP> Date: Sun, 1-Mar-87 05:43:51 EST Article-I.D.: well.2679 Posted: Sun Mar 1 05:43:51 1987 Date-Received: Mon, 2-Mar-87 06:36:16 EST References: <292@umbc3.UMD.EDU> <13567@sun.uucp> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 72 Keywords: gameport joystick cleanup arrrrgggg In article <13567@sun.uucp> cmcmanis@sun.uucp (Chuck McManis) writes: >In article <292@umbc3.UMD.EDU>, chiafari@umbc3.UMD.EDU (frank chiafari) writes: >[actually he is ghost writing for eric messick] >> ARRRRRRRGGGGGGGGG!!!!!!! >> Has anyone gotten the gameport.device to work? I've gotten entirely too >> frustrated with this. My problem goes something like this: > ... He goes on to describe the problem ... >> >> I think that's about all I can say... Code follows... Any suggestions >> would be appreciated... MAIL them (for GOD'S SAKE!) and if there's >> interest, I'll post my eventual solution. >> >> -eric messick > ... and lots of code followed ... > >Sorry for posting this to everyone unfortunately frank's address bounced >back faster than greased lightning. My advice to Eric and Frank and >anyone else doing exec level stuff on the Amiga : > * Reply to your messages! * >When someone sends you a message, be it exec, intuition, or some user >task, you sould reply to it with ReplyMsg() [.....] > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NO NO NO NO NO!!! You DON'T reply to everybody. This is how it works. All I/O on the Amiga is implemented as message passing. When you want the I/O system to do something, you create a message packet, open the device, and send your requests to it. When the I/O driver has completed your request, it lets you know by replying the message to a reply port which you've created. Note that it is the I/O DRIVER that is replying. It is replying because you sent the original message. DoIO() is a synchronous I/O call; it sends the I/O request to the driver and waits for it to complete. SendIO() is asynchronous; it passes the request to the driver, and returns control to you. WaitIO() waits for a particular I/O request to complete. If you wanted to do interleaved I/O (for example, asking for a disk block that you know you're going to need eventually, but you can do some computing in the meantime), then you'd send the request using SendIO(), do some other stuff for a while, then wait for the I/O to complete (if it hasn't already) with WaitIO(). BeginIO() is a low-level version of SendIO(). As always, never touch the message data while the I/O request is still outstanding, since the I/O driver owns that data for as long as it has it. The gameport is a device, so these rules apply. I haven't stared at the posted code, so I don't know what the problem is. For the sake of completeness, Intuition is a totally different animal. Intuition is not an I/O driver, it's a sort of application. You don't send requests (messages) to Intuition, Intuition sends messages to YOU. That's why, when you get an IntuiMessage, you should reply it as soon as you can (after you've copied all the relevant data into private variables). Hope this helps. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ________ ___ Leo L. Schwab \ /___--__ The Guy in The Cape ___ ___ /\ ---##\ ihnp4!ptsfa!well!ewhac / X \_____ | __ _---)) ..or.. / /_\-- -----+==____\ // \ _ well ---\ ___ ( o---+------------------O/ \/ \ dual ----> !unicom!ewhac \ / ___ \_ (`o ) hplabs -/ ("AE-wack") ____ \___/ \_/ Recumbent Bikes: "Work FOR? I don't work FOR The _O_n_l_y Way To Fly! anybody! I'm just having fun."