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,914 of 4,255   
   wolfgang kern to Robert Pengelly   
   Re: COM1 interrupt for 16-bit OS   
   13 Nov 23 00:48:39   
   
   From: nowhere@never.at   
      
   On 12/11/2023 23:03, Robert Pengelly wrote:   
   > On Sunday, 12 November 2023 at 21:51:33 UTC, wolfgang kern wrote:   
   >> On 12/11/2023 21:31, Robert Pengelly wrote:   
   >> ...   
   >>>>> Ahh you have 3 variables instead of 2, right I think I understand. What   
   should I do about the buffer though? Like should I get them in say a 1Ch   
   handler to move the cursor in there?   
   >>>> That should have been "What should I do about the values though?" Like   
   should I parse the buffer in say 1Ch and move the cursor in there?   
   >> yeah, sorry for delayed response, I tend to sleep from time to time :)   
   >> if your screen is in text-mode then you need to scale all down by 8   
   >> because mice work on pixels rather than on character row/column.   
   >>> Am I updating the x and y correctly with:   
   >>>   
   >>> xor ax, ax   
   >>> xor dx, dx   
   >>> xor cx, cx   
   >>> mov bx, offset buffer   
   >>>   
   >>> mov al, [bx]   
   >>> mov dl, [bx]   
   >>>   
   >>> and al, HEX (0C)   
   >>> and dl, HEX (03)   
   >>>   
   >>> mov cl, 4   
   >>> shl ax, cl   
   >>>   
   >>> mov cl, 6   
   >>> shl dx, cl   
   >>>   
   >>> mov cl, [bx + 2]   
   >>> or ax, cx   
   >>> add ax, [mouse_y]   
   >>>   
   >>> mov cl, [bx + 1]   
   >>> or dx, cx   
   >>> add dx, [mouse_x]   
   >>>   
   >>> mov [mouse_x], dx   
   >>> mov [mouse_y], ax   
   >>>   
   >>> If I am how do I stop it wrapping around the screen as doing:   
   >>>   
   >>> cmp ax, 80   
   >>> jge .no_x_inc   
   >>>   
   >>> cmp ax, 0   
   >>> jl .no_x_inc   
   >>>   
   >>> .inc_x:   
   >>>   
   >>> mov cs:[mouse_x], ax   
   >>>   
   >>> .no_x_inc:   
   >>>   
   >>> cmp dx, 25   
   >>> jge .done   
   >>>   
   >>> cmp dx, 0   
   >>> jl .done   
   >>>   
   >>> .inc_y:   
   >>>   
   >>> mov cs:[mouse_y], dx   
   >>>   
   >>> doesn't seem to work.   
   >> I never supported a mouse in text mode, so my experience is limited to   
   >> graphic modes.   
   >> my clipping just used AND or CMOVcc w/o CMP/JUMP lines.   
      
   >   What values am I scaling down the values passed to the interrupt or the   
   values I calculate after I got all three bytes?   
      
   the latter. text character cells may be 16*8 so vertical need SHR,4   
   note that the screen coordinates are always positive 0,0 is top left.   
      
   >> I never supported a mouse in text mode, so my experience is limited to   
   >> graphic modes.   
   >   
   > I'm only using text mode at the moment as a test case.  The plan is to only   
   have the mouse in graphics mode eventually.  I didn't think of using AND,   
   would I do something like "and [mouse_x], 319" and would that also work if the   
   value is negative so it    
   will stay at zero?   
      
   319 may not be a good choice :)   
   my older standard mode was 1024x768x8 so my AND values were 03ff/2ff   
   this may not make it zero but keeps it on bottom/right edges.   
   I later used CMP 03f8/02f8 followed by CMOVa to clip it visible.   
      
   an AND with a positive value will always result in a positive.   
   __   
   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