Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!uiucdcs!miller
From: miller@uiucdcs.UUCP (miller )
Newsgroups: net.micro.cbm
Subject: more on c64 joysticks - (nf)
Message-ID: <5609@uiucdcs.UUCP>
Date: Tue, 14-Feb-84 03:26:20 EST
Article-I.D.: uiucdcs.5609
Posted: Tue Feb 14 03:26:20 1984
Date-Received: Fri, 17-Feb-84 03:59:43 EST
Lines: 42

#N:uiucdcs:36100041:000:1778
uiucdcs!miller    Feb 13 23:53:00 1984

     Since there was a question by Lew over what I meant when I said joystick
port 1 in the west direction, fire button not pressed "slows the machine down",
I thought I'd write two programs to demonstrate what I was talking about.  The
first one reports on the position of the joystick in columns 1 & 2 (and a * in
3 if the fire button is pressed).

10FORI=0TO10:READD$(I):NEXT
20DATAC,N,S,,W,NW,SW,,E,NE,SE
30INPUT"PORT 1 OR 2";PO
40IFPO=1THENPO=56321
50IFPO=2THENPO=56320
60J=PEEK(PO)
70IF(JAND16)=0THEN?"  *xxx";  replace the 3 x's by back cursors <=
80?D$(15-(JAND15))
90GOTO60

     (Get line 70 right - two blanks, *, 3 <= and don't forget the trailing ;)
     The next program is in assembly lang.  I'm too lazy to translate the whole
program above, so I simply had it print a whole slew of A's.  But you can no-
tice the same affect.  The program runs fast anytime *except* when the joystick
is in that one configuration.  Then, it really does "slow down".

START LDA# 65
      JSR  65490  chrout routine
      JMP  START

     You'll notice it pauses in between lines at about the same speed as the
Basic LIST with the CTRL key down.  As I stated in my previous note, I really
don't know how the CTRL key is programmed to work; I haven't spent the time to
find out.  I made a guess before, but that's all it was.
     As to why Lew's FROGGER goes fast, I can only hazard another guess.  I've
noticed that FROGGER won't return control when my reset button (which I added)
is pressed.  This forces a cold start.  FROGGER *must* flip out the c64 kernal
ROM in order to prevent that.  Hence, the CTRL software goes with it.  (BTW,
FROGGER is the only program I've seen so far that imploys that trick.  Usually,
my reset button gets them all.)

A. Ray Miller
Univ Illinois