[Coco] Extended basic 1.1 command?

Harry Hurst hhos at st-tel.net
Wed Nov 21 08:58:57 EST 2012


If I understand this, then:

Entry conditions
A : 0 = Right  1 = Left   2 = both
U : Pointer to array with button data at BDWN offset

Exit conditions
Button condition in BDWN,U and B register
A, B and X are trampled

Is this right? If so, then why not eliminate the INCB at line 9200 and
enter with
A : 1 = Right  2 = Left  3 = both  ?

HH

> 08500 *THIS DOES A BUTTON READ OFF THE RIGHT/LEFT JOYSTICK
> 08600 BUTSTA   PSHS      A                           SAVE RIGHT/LEFT FLAG
> 08700                         LDX          #$FF00             POINT TO THE
> I/O PORT
> 08800                         LDA          2,X                       GET
> THE KEY SELECT DATA
> 08900                         LDB          #$FF         SELECT NO KEYS
> 09000                         STB          2,X                       TO
> READ JUST THE BUTTONS
> 09100                         PULS    B                            GET
> RIGHT/LEFT BUTTON SELECT
> 09200                         INCB
> MAKE IT "01"(R) OR "10" (L)
> 09300                         COMB
> MAKE SELECTED BIT ZERO
> 09400                         ORB     ,X                IS GET THAT BUTTON
> BIT
> 09500                         STA      2,X                        RESTORE
> KEY SELECT DATA
> 09600                         COMB
> MAKE IT A ONE IF PRESS
> 09700                         ANDB      #3                         ONLY
> RIGHT/LEFT BUTTON BITS!
> 09800                         STB       BDWN,U  UPDATE BUTTON DOWN STATUS
> 09900                         RTS
> AND EXIT
>






More information about the Coco mailing list