www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/17/02:06:32

Xref: news-dnh.mv.net comp.os.msdos.djgpp:4457
From: robhenry AT atl DOT mindspring DOT com (Robert Henry)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Mouse code - What am I doing wrong?
Date: Tue, 16 Jan 1996 01:03:30 GMT
Organization: MindSpring Enterprises, Inc.
Lines: 33
Message-ID: <4dhhrk$pqi@stealth.mindspring.com>
References: <4cvd2h$etf AT brickbat DOT mindspring DOT com>
Reply-To: robhenry AT atl DOT mindspring DOT com
NNTP-Posting-Host: user-168-121-70-97.dialup.mindspring.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thanks folks, the following code works, and I have downloaded the FAQ.

Does the function click_handler() get locked into memory by the call
to _go32_dpmi_allocate_real_mode_callback_retf?

How do I lock mc, mx and my?

int mc;
int mx;
int my;

void click_handler (_go32_dpmi_registers *r)
{
    mc=r->d.eax;
    mx=r->d.ecx;
    my=r->d.edx;
}

_go32_dpmi_registers regs;
_go32_dpmi_seginfo info;

void init_mouse(void)
{
        info.pm_offset = (u_long)click_handler;
        a=_go32_dpmi_allocate_real_mode_callback_retf(&info, &regs);
        regs.x.ax=0xC;
        regs.x.cx=0xFFFF;
        regs.x.dx=info.rm_offset;
        regs.x.es=info.rm_segment;
        regs.x.ss=regs.x.sp=0;
        _go32_dpmi_simulate_int(0x33,&regs);
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019