flat assembler
Message board for the users of flat assembler.

Index > DOS > INT 33 mouse demo

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41
ohhh.... dang... Sad so now we need to find a way to possibly use Bios?
Post 05 May 2009, 17:21
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
There is no BIOS function for mouse.
But here some code i written for MiniDos that does not need a driver, it will work on normal Dos to
http://www.dex4u.com/tuts/MouseDemo.zip
Post 05 May 2009, 18:06
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41
Cool, so, the Bios cant really handle a mouse Confused
Post 05 May 2009, 18:19
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Back in the middle of 2008 I made something similar. White dot that remembers the background pixel. LMB is one color, RMB is another, Both together is the mix of the two.

Very unoptimized code, was just a personal test:
Assembles to 154 bytes.
Code:
org 100h

push 0a000h
pop es

mov ax,13h
int 10h

start:
call vsync1
call mouse

key:
mov ax,0c00h
int 21h
in al,60h
dec al
jnz start
mov ax,03h
int 10h
ret

mouse:
        mov al,[temp1]
        mov di,[temp2]
        stosb
        mov ax,03h
        int 33h
        shr cx,1h
        cmp bx,1h
        je col1
        cmp bx,2h
        je col2
        cmp bx,3h
        je col3
        mov ax,dx
        shl ax,8h
        shl dx,6h
        add ax,dx
        mov di,ax
        add di,cx
        mov al,[es:di]
        mov [temp1],al
        mov [temp2],di
        mov al,0fh
        stosb
        ret
        col1:
        mov [color],1
        jmp mouse1
        col2:
        mov [color],2
        jmp mouse1
        col3:
        mov [color],3
        mouse1:
        mov ax,dx
        shl ax,8h
        shl dx,6h
        add ax,dx
        mov di,ax
        add di,cx
        mov al,0fh
        mov [temp2],di
        mov bl,[color]
        mov [temp1],bl
        stosb
        ret


vsync1:
        pusha
        mov dx,3dah
vsync:
        in al,dx
        and al,8
        jz vsync
        popa
        ret

temp1 db 0
temp2 dw 0
color db 0
    


Edit:
Included a drawing I made. I doubled the size of the picture to make it more easily seen.
The drawing is bad, I can't draw good on a computer and the resolution didnt help much.


Description:
Filesize: 6.69 KB
Viewed: 496 Time(s)

drawing.png



_________________
----> * <---- My star, won HERE
Post 10 May 2009, 01:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.