Caple C871i Bedienungsanleitung Seite 220

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 572
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 219
Apple II Computer Info
#############################################################################
### FILE : joystck.read
#############################################################################
### Created : Sunday, January 14, 1996 Modified: Sunday, January 14, 1996
### File Type: "TEXT" File Creator: "LMAN"
### File Size: 3757 bytes 3 KB
#############################################################################
Newsgroups: comp.sys.apple2
Path: news.weeg.uiowa.edu!news.uiowa.edu!hobbes.physics.uiowa.edu!zaphod.mps.ohio-
state.edu!cs.utexas.edu!sun-barr!ames!agate!dog.ee.lbl.gov!news!nosc!crash!pro-
nbs!pro-harold!pro-cajun!pro-gumbo!tgeer
(Smail3.1.28.1 #7) id m0nEz5Z-0000l2C; Thu, 21 Jan 93 02: 24 PST
From: [email protected] (System Administrator)
Subject: Re: Attention assembly programmers...
Organization: Apple Gumbo BBS
Date: Tue, 19 Jan 93 20:29:30 CST
Message-ID: <[email protected]>
In-Reply-To: [email protected] (Andre Prellwitz)
References: <[email protected]>
Lines: 59
[email protected] (Andre Prellwitz) writes:
>A while ago someone posted about how to read the joystick on a //gs in native
>mode. They said that it was possible to read both paddles at once and there-
>fore get much more accurate readings. I don't recall exactly how to do this,
>but I've been trying the following: strobe the analog paddle reset ($c070)
>and then read locations $c064 and $c065 and wait until both return to zero.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Only the high bit of these locations is valid. When the high bit of either
location becomes 0 then the corresponding analog input has timed out. You
will actually get more accurate results by reading them one after the other
with the accumulator set to 8 bits wide and the index registers used to hold
the counts (16 bits wide). This allows for a much faster loop, giving better
resolution. Assuming that this routine is called from full native mode, the
following code will do the trick:
strobe equ $C070 ; analog input timing reset
pdl0 equ $C064 ; analog input 0
pdl1 equ $C065 ; analog input 1
start php ; save processor status register
phb ; and data bank register
sep #%100000 ; make accumulator 8 bits wide
lda #0 ; make data bank = 0
pha
plb
ldx #0 ; initialize the counters
txy
lda strobe ; strobe the timing reset
loop1 inx ; increment pdl0 count
lda pdl0 ; is high bit = 0?
bmi loop1 ; no, keep checking
lda strobe ; yes, strobe the timing reset again
Apple II Computer Technical Information : Apple II Family Hardware Info
ftp://ground.ecn.uiowa.edu/2/apple2/miscinfo/hardware : May 2001 : 220 of 572
Seitenansicht 219
1 2 ... 215 216 217 218 219 220 221 222 223 224 225 ... 571 572

Kommentare zu diesen Handbüchern

Keine Kommentare