Board index » delphi » Mouse in protected mode
Ricardo Dunn
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Ricardo Dunn
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Mouse in protected mode
Hi, folks
I'm trying to make the Mouse interrupt , service 9 (Set graphics cursor) Some kind of operation with the segment selectors has to be done to set Do someone can help me ? Thanks in advance |
Alexei A. Frounz
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Mouse in protected modeQuoteRicardo Dunna wrote: own cursor drawing routine? I recommend this because I've also had problems with mouse pointer under pmode. And this method works. You may try my GFXXMOUSE example in the grafixx.zip archive at the http://www.chat.ru/~alexfru Good Luck |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Mouse in protected modeIn article <3841261C.97084...@infolink.com.br>, Ricardo Dunna <rdu...@infolink.com.br> wrote: Quote>Hi, folks var rg:registers; rg.ax:=9; I.we. just like one would use int in DOS-unit with the exception of the Remember to use the unit after DOS, or alternatively use Unit var rg:IntProt.resgisters; I have not tested it in this particular case. Unit IntProt; interface {$ifdef dpmi} uses DOS,WInapi; { The register structure for Int 21h, ax=300h. The filler fields Type registers= record { for int 31h, ax=300h, simulate RM interrupt } Procedure Intr(inro:word;var rg:registers); { This routine is for setting the buffers before Intr or MSDos. One for example SetBuffer(rg.ds,rg.si,256); If several buffers point to same area in the protected mode memory Procedure SetBuffer(var sg,os:word; size:word); { This converts a segment into a selector. Use when the interrupt Function Selector(x:word):word; const IntrError:boolean=false; { check this after the interrupt } {$else} { Dummy functionality for real mode, so one does not have to use any type Selector=word; { A dummy "function" } Procedure SetBuffer(seg,ofs,size:word); {$endif} implementation {$ifdef dpmi} const stacksize=1024; { The size of the real mode stack } type pword=^word; var buffers:array[1..maxbuff] of record Procedure SetBuffer(var sg,os:word; size:word); Procedure Intr(inro:word;var rg:registers); type words=record lo,hi:word; end; Begin { First allocate the base memory buffer, its size is adjusted to the with buffers[nbuff] do allocsize:=(stacksize+siz+loc+1) and not 1; { Get the segment (real mode) and selector (PM) of the allocated block } AllocSeg:=words(x).hi; { Set the stack pointers in the registers record } rg.ss:=AllocSeg; { Now copy the buffers to the base memory buffer for i:=1 to nbuff do with buffers[i] do begin { now one simulates the actual interrupt } asm { Now one copies the (possibly altered) buffers back to their original Note that one restores the registers (fields) to point to the for i:=1 to nbuff do with buffers[i] do begin { Finally lets deallocate the base memory buffer and reset the number of GlobalDosFree(AllocSel); Procedure MsDOS(var rg:registers); Function Selector(x:word):word; assembler; {$endif} End. Osmo |
2. Mouse driver check in DPMI protected mode BP
3. Mouse, Vesa in Protected Mode
4. Mouse-Problem in Protected Mode BP7 (DOS!)
5. Mouse-Problem in Protected Mode BP7
6. Protected mode VS Real mode ???
7. Real Mode from Protected Mode: Accessing an RMode TSR from PMode
8. Protected mode vs. Real mode
9. Vesa unit for all 256 and 65K color modes (protected,real mode)