Interrupt in FPC 
Author Message
 Interrupt in FPC

Hi,

I used a Mouse Unit in TP7. This Unit included a interrupt procedure, which
redraw the MouseCursor whenever the mouse was moved. It used Interrupt $1C,
and then asked the mousedriver via int $33 about changes of the
Mouseposition.
Now I use Free Pascal, and the keyword "interrrupt" ddoes not work anymore.
So how can I make a procedure which will be called, without calling it in my
proramm?

Hope you understand what I mean...



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:

> Hi,

> I used a Mouse Unit in TP7. This Unit included a interrupt procedure, which
> redraw the MouseCursor whenever the mouse was moved. It used Interrupt $1C,
> and then asked the mousedriver via int $33 about changes of the
> Mouseposition.
> Now I use Free Pascal, and the keyword "interrrupt" ddoes not work anymore.
> So how can I make a procedure which will be called, without calling it in my
> proramm?

> Hope you understand what I mean...

Hi Martin,
there is a Mouse unit in FPC (for DOS/go32v2) called MSmouse.
You can't use your interrupt function in FPC (here FPC can't be TP
compatibe).
I don't understand why there is an interrupt function needed to show the
mouse cursor. Int $1C is called 18.2 times/second and has usually
nothing to do with a mouse unit.

Wolf



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC



Quote:

> Hi Martin,
> there is a Mouse unit in FPC (for DOS/go32v2) called MSmouse.

Yes, I know. But that unit just calls the mouseriver functions of a MSmouse
compatible
Mousedriver. That works well, as long as you use a Textmode, or some
"Normal" Graphicmode. But in SVGA Modes not all Mousedrivers display a Mouse
Cursor.

Quote:
> I don't understand why there is an interrupt function needed to show the
> mouse cursor. Int $1C is called 18.2 times/second and has usually
> nothing to do with a mouse unit.

I usesd that 18.2 calls a second to see if the mouseposition changed, and
redraw my Mousecursor if so. (By the way, this allowed me to use any of the
256 colors, or even animat the cursor.

Quote:
> You can't use your interrupt function in FPC (here FPC can't be TP
> compatibe).

There is a function called set_rm_interrupt, which seems to pbe somehow
equal  to TP's "SetIntVec", but it doesn't works as I want  it to...

Martin

Martin



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:
> Hi,

> I used a Mouse Unit in TP7. This Unit included a interrupt procedure, which
> redraw the MouseCursor whenever the mouse was moved. It used Interrupt $1C,
> and then asked the mousedriver via int $33 about changes of the
> Mouseposition.

This is a bad way of moving the mouse anyway. You should use the mouse driver
callback, setup by calling int $33/12. Check your mouse driver API for the
details.

--
Jay

Jason Burgon - Author of "Graphic Vision"
Professional Win95-style GUI for DOS/DPMI
NEW version 2.10 available from:
http://www.jayman.demon.co.uk



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:
> 256 colors, or even animat the cursor.

> > You can't use your interrupt function in FPC (here FPC can't be TP
> > compatibe).
> There is a function called set_rm_interrupt, which seems to pbe somehow
> equal  to TP's "SetIntVec", but it doesn't works as I want  it to...

Hmm. That is the procedure you should look into.

The documentation of the Go32 unit contains an example about how to set
up a interrupt hook/callback somwhere.

--




Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC
Quote:

> >  "set_rm_interrupt"
> Hmm. That is the procedure you should look into.

> The documentation of the Go32 unit contains an example about how to set
> up a interrupt hook/callback somwhere.


Yes! I found a progrann called "KeyKlick" (or something) in the chapter
"Hardware interrupt" of the documentationto the GO32 Unit.
Well, that works fine. I also replaced the Keyboardinterrupt ($9) by "my"
interrupt, and got a lots of klicks...(Well not 18.2 a second, because of
the delay..)
But i still don't understand why that works. Maybe there ist a easier way,
as Jason Burgon mentioned, i will look for a callback function in the
mouseunits /drivers documentation.

Thanks

    Martin.



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC


969394793.2264.0.nnrp-

Quote:
> > I used a Mouse Unit in TP7. This Unit included a interrupt procedure,
which
> > redraw the MouseCursor whenever the mouse was moved. It used Interrupt
$1C,
> > and then asked the mousedriver via int $33 about changes of the
> > Mouseposition.

> This is a bad way of moving the mouse anyway. You should use the mouse
driver
> callback, setup by calling int $33/12. Check your mouse driver API for the
> details.

Your right. I tried your $33/12 and it worked well (till now i just tried it
in TP, because I know that
compiler better than FPC,And I don't have to worry the DPMI mode...).
I'll try to implement that call back in FPC, but not tonight...

Thanks a lot for that Hint

    Martin



Sat, 08 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:
> > The documentation of the Go32 unit contains an example about how to set
> > up a interrupt hook/callback somwhere.


Hi again. I now used the callback function of the mousedriver (int$33). But
that still works only in TP (=real mode).
The documentation of FPC contains an example programm, that should do
exactly what I am looking for.
(Doc. for "Go32" , "get_rm_callback"). But that programm just dosn't work.
I won't include the whole source, since that's about 129 Lines, and it can
be found in the documentation as discribed.
But one problem is:

var
     userproc_proc : pointer;
..


I changed that to

      lock_data(userproc_proc, sizeof(userproc_proc));

That compiles, an runs, until you move the mouse, or press a mouse button.
(<=> The mousedriver trys to use the callback function).Then my computer
boots again...

I use the IDE, and run it in a WIN98 Dos -Box.

I had many reboots today...

So please , could anyone help me?

 Thanks

     Martin.



Mon, 10 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:

> Hi again. I now used the callback function of the mousedriver (int$33). But
> that still works only in TP (=real mode).
> The documentation of FPC contains an example programm, that should do
> exactly what I am looking for.
> (Doc. for "Go32" , "get_rm_callback"). But that programm just dosn't work.

RMCB's are tricky little beasts. That's why I wrote rather clever (even if I
do say so myself) inline entry and exit code "procedures" (more like macros
really) and setup functions in my GDOS.PAS unit. If I port Graphic Vision to
FPC, then one of the first jobs will be to convert GDOS.PAS.

However, the GDOS source is available from my website if you feel like trying
to convert it it FPC yourself.

Jay

Jason Burgon - Author of "Graphic Vision"  GUI for DOS/DPMI
=== Free LFN capable Dos/WinDos replacement and ===
=== New Graphic Vision  version 2.10 available from:  ===
http://www.jayman.demon.co.uk



Mon, 10 Mar 2003 03:00:00 GMT  
 Interrupt in FPC


Quote:
> var
>      userproc_proc : pointer;
> ..




this pointer in memory (since it's contents are probably read in the
callback).

I also don't see why the compiler would accept
"lock_data(userproc_proc, sizeof(userproc_proc));" and not


untyped pointer.

Jonas



Mon, 10 Mar 2003 03:00:00 GMT  
 Interrupt in FPC

Quote:


> this pointer in memory (since it's contents are probably read in the
> callback).

> I also don't see why the compiler would accept
> "lock_data(userproc_proc, sizeof(userproc_proc));" and not


> untyped pointer.

You may also want to look at the file api/go32v2/mouse.inc, that one
installs a mouse callback (so you don't have to convert the keyclick
demo anymore). It works under Dos, OS/2 and Win9x, but crashes on some
NT systems. We don't know why.

Jonas



Mon, 10 Mar 2003 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. FPC:problem with printing from fpc programs

2. FPC: translate execvp from c to FPC

3. FPC Win32 memory mapped files for IPC

4. multi threading in fpc linux?

5. Port to FPC, - advice needed please.

6. GetEnvVar in TPC versus FPC

7. FPC and makefile

8. ANN: SoundLib 2a3 for BP7&FPC released

9. Norton Guide or equivalent for FPC

10. FreePascal (FPC) and RHIDE

11. GraphiX 4 ready for FPC 1.0.10

12. FPC - wasted memory...

 

 
Powered by phpBB® Forum Software