Skip to content

TheHelloWorldWriter/pasmouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pascal Mouse

Turbo Pascal 7.0 MS-DOS Written in 1996 License: MIT GitHub Release GitHub Downloads

Pascal Mouse is a mouse interface library for Turbo and Borland Pascal that I wrote in 1996. I needed mouse support in a Pascal program and could not find a library that was both complete and easy to use — some were too simple, others were too complex. So I found Ralf Brown's Interrupt List, learned how INT 33H works, and wrote my own.

The Circles demo drawing colorful circles with the mouse in DOSBox-X on macOS

The library provides 55 procedures and functions wrapping almost all standard INT 33H mouse driver calls. Written in assembler for speed and small code size. Full source code included.

What you can do with it

  • Detect the mouse driver, read position and button state
  • Show, hide, and position the mouse cursor
  • Define custom cursor shapes in text and graphics modes
  • Set movement range, sensitivity, and double-speed threshold
  • Install custom mouse event handlers
  • Save and restore mouse driver state
  • Enable and disable the mouse driver
  • Query driver version, mouse type, and IRQ
  • Convert between virtual and text-mode coordinates

Download

Download Pascal Mouse from GitHub Releases

The ZIP contains the source code, a pre-compiled unit for Turbo Pascal 7.0, a reference manual, and 8 demo programs.

Building and running

I build and run Pascal Mouse using DOSBox-X on macOS, with a copy of Borland Turbo Pascal 7.0 downloaded from WinWorld:

  1. Mount the project directory and the Turbo Pascal installation in DOSBox-X
  2. Launch TURBO.EXE and set Options > Directories to point at your units path
  3. Open SRC\MOUSE.PAS and press ALT+F9 to compile the unit
  4. Open any demo from SRC\DEMOS\ and press Ctrl+F9 to run it

The graphics demos need EGAVGA.BGI from your Turbo Pascal installation. Each demo has a BGIPath constant near the top that you can change to match your setup (defaults to C:\TP\BGI).

Turbo Pascal 7 IDE showing successful compilation of MOUSE.PAS in DOSBox-X on macOS
Compiling in Turbo Pascal on macOS
The Eyes demo following the mouse cursor in DOSBox-X on macOS
The Eyes demo on macOS via DOSBox-X

Source layout

SRC/
  MOUSE.PAS           the mouse interface unit (55 procedures/functions)
  DEMOS/
    SIMPLE.PAS         a minimum mouse program
    TEXTMOUS.PAS       virtual-to-text coordinate conversion
    VIDEOMOD.PAS       mouse in different video modes
    BARS.PAS           draw colored bars with the mouse
    CIRCLES1.PAS       draw circles with the mouse
    CIRCLES2.PAS       auto-moving circles with keyboard control
    CURSOR.PAS         changing the mouse cursor shape
    EYES.PAS           eyes that follow the mouse
dist/
  MOUSE.TPU            pre-compiled unit (Turbo Pascal 7.0)
  MANUAL.TXT           complete reference manual
  README.TXT           introduction and release history
  FILE_ID.DIZ          BBS file description

License

Pascal Mouse is licensed under the MIT License.


Made with ❤️ in Oradea, Romania https://www.thehelloworldwriter.com

About

A mouse interface for Turbo/Borland Pascal, from 1996. 55 procedures and functions, written in assembler for speed and small code. Still compiles and runs in DOSBox-X.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors