🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.dec.micro
1 messages
1 total messages Started by MARTIN KNIRSCH Sat, 15 Aug 1992 14:08
RE: Mouse Interface
#439
Author: MARTIN KNIRSCH
Date: Sat, 15 Aug 1992 14:08
39 lines
2333 bytes
Mouse Interface
-1- A adapter from eight pin mouse connector to RS232 should be
    avaiable in any electronic store.
-2- My mouse (Z-NIX Microsoft compatrible) uses the following
    RS232 pins : TXD(2), RXD(3), DTR(20), SGND(7) and RTS(4)
-3- Programming (on a Rainbow) is as follows :
    Set up Communication Control Block
    (Microsoft standard is 7 Bit, no Parity, 1200 Boud)
    
    MOV AH,44H
    MOV	AL,FUNCTION CODE
    MOV	BX,HANDLE		; USE HANDLE 3 FOR COMM1
    MOV	DX,OFFSET CCB		; ADDRESS OF COMMUNICATION CONTROL BLOCK
    INT	21H
   
    Lot's of function codes for programming the RS232 are avaiable 
    (Consult a DOD manual). 
    First disable receiver interrupts, then clear DTR and RTS.
    Program CCB to Microsoft Mouse Protocol as listyed above.
    Enable receiver interrupts and set DTR and RTS.
    The Mouse sends back three data bytes :
  
                   Bit #  7  6  5  4  3  2  1  0
    Byte0 :               X  1  L  R  Y7 Y6 X7 X6
    Byte1 :               X  0  X5 X4 X3 X2 X1 X0
    Byte2 :               X  0  Y5 Y4 Y3 Y2 Y1 Y0

    Data ranges are -128 to + 127  (Don't forget the 2'nds Complement
                                    for negative values)

    Mouse Data is written into a circular buffer. When DTR and RTS
    are set for the first time, the mouse sends a "M" identifying
    itself. If you receive the "M" most work is done. Reading 
    mouse data then is don by first testing Bit 6 of Byte 0, the sync Bit.
    (Bit 5 and 4 indicate pressed mouse buttons.) When Byte 0 is identified
    generate the X and Y databytes. They are representing the distance the
    mouse was moved since the last movement measured in mickeys (1/200 inch
    or 1/400 inch). 
    Hope that helps a little.               Martin
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads