home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,897 of 4,255   
   wolfgang kern to Robert Pengelly   
   Re: COM1 interrupt for 16-bit OS   
   12 Nov 23 13:08:37   
   
   From: nowhere@never.at   
      
   On 12/11/2023 12:11, Robert Pengelly wrote:   
   ...   
   > I'm having a little bit of trouble with the cooridnates from the IRQ4.    
   Going by https://roborooter.com/post/serial-mice/ I have:   
   >   
   >      mov     dx,     HEX (03FD)   
   >      xor     ax,     ax   
   >      in      al,     dx   
   >      nop   
   >   
   >      test    al,     0b01000000   
   >      jz      serial_handler.done   
   >   
   >      test    al,     0b00000001   
   >      jz      serial_handler.done   
   >   
   >      mov     dx,     HEX (03F8)   
   >      xor     ax,     ax   
   >      in      al,     dx   
   >      nop   
   >   
   >      mov     si,     ax   
   >      mov     di,     ax   
   >   
   >      and     si,     0b00001100   
   >      and     di,     0b00000011   
   >   
   >      mov     cl,     4   
   >      shl     si,     cl   
   >   
   >      mov     cl,     6   
   >      shl     di,     cl   
   >   
   >      mov     dx,     HEX (03F8)   
   >      xor     ax,     ax   
   >      in      al,     dx   
   >      nop   
   >   
   >      or      di,     ax   
   >      add     di,     cs:[mouse_x]   
   >   
   >      mov     dx,     HEX (03F8)   
   >      xor     ax,     ax   
   >      in      al,     dx   
   >      nop   
   >   
   >      or      si,     ax   
   >      add     si,     cs:[mouse_y]   
   >   
   > but the initial values seem a bit off (e.g. for Y I have 205 and X is 77),   
   have I mixed up the values or am I just doing the calculations wrong after I   
   read the port?   
      
   the mouse sends a sequence of bytes where every byte causes in IRQ.   
   so you first need to fill a buffer with the gotten bytes before you can   
   calculate/scale/interpret the values. mouse IRQs can easy come out of   
   sync, so checking always for the first byte mark is a good idea.   
   __   
   wolfgang   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca