Subversion Repositories SvarDOS

Rev

Rev 1542 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1542 Rev 1778
1
 
1
 
2
                             Mateusz' DOS Routines
2
                             Mateusz' DOS Routines
3
                               http://mdr.osdn.io
3
                          http://mdrlib.sourceforge.io
4
 
4
 
5
 
5
 
6
Mateusz' DOS Routines (MDR) is a C library that contains a variety of routines
6
Mateusz' DOS Routines (MDR) is a C library that contains a variety of routines
7
to ease the development of real mode DOS applications.
7
to ease the development of real mode DOS applications.
8
 
8
 
9
These routines are mostly targeted at the Open Watcom compiler, but might work
9
These routines are mostly targeted at the Open Watcom compiler, but might work
10
with other C compilers as well.
10
with other C compilers as well.
11
 
11
 
12
All the routines have been created by Mateusz Viste and are published under the
12
All the routines have been created by Mateusz Viste and are published under the
13
terms of the MIT license.
13
terms of the MIT license.
14
 
14
 
15
List of available modules:
15
List of available modules:
16
 
16
 
17
BIOS     BIOS-based functions
17
BIOS     BIOS-based functions
18
COUT     console output (writing to text-mode display)
18
COUT     console output (writing to text-mode display)
19
DOS      functions interacting with DOS
19
DOS      functions interacting with DOS
20
KEYB     basic functions to interact with the keyboard
20
KEYB     basic functions to interact with the keyboard
21
MOUSE    mouse routines
21
MOUSE    mouse routines
22
OPL      OPL2 (Adlib style) audio
22
OPL      OPL2 (Adlib style) audio
23
PCX      parsing, loading and uncompressing PCX images
23
PCX      parsing, loading and uncompressing PCX images
24
RS232    writing to and reading from an RS-232 ("COM") port
24
RS232    writing to and reading from an RS-232 ("COM") port
25
SBDIGI   playing digitized sounds with a SoundBlaster-compatible card
25
SBDIGI   playing digitized sounds with a SoundBlaster-compatible card
26
TIMER    high-resolution (1 kHz) timer, relies on PIT reprogramming
26
TIMER    high-resolution (1 kHz) timer, relies on PIT reprogramming
27
TRIGINT  sin and cos functions using integers only (8086-compatible)
27
TRIGINT  sin and cos functions using integers only (8086-compatible)
28
UNZIP    iteration over ZIP archives (no decompression code)
28
UNZIP    iteration over ZIP archives (no decompression code)
29
VID12    driver for mode 12h VGA graphic (640x480, 16 colors)
29
VID12    driver for mode 12h VGA graphic (640x480, 16 colors)
30
VIDEO    drivers for 320x200 video modes (256 colors on VGA, 16 colors on CGA)
30
VIDEO    drivers for 320x200 video modes (256 colors on VGA, 16 colors on CGA)
31
WAVE     parsing and loading WAVE sound files
31
WAVE     parsing and loading WAVE sound files
32
XMS      detecting and using XMS memory to store data
32
XMS      detecting and using XMS memory to store data
33
 
33
 
34
Documentation is contained in header (*.H) files in the INC\MDR\ directory.
34
Documentation is contained in header (*.H) files in the INC\MDR\ directory.
35
 
35
 
36
 
36
 
37
+============================================================================+
37
+============================================================================+
38
| USAGE                                                                      |
38
| USAGE                                                                      |
39
+============================================================================+
39
+============================================================================+
40
 
40
 
41
Using MDR is no different than using any other library: you need to include
41
Using MDR is no different than using any other library: you need to include
42
the header file(s) you wish to rely on and pass the lib file that matches your
42
the header file(s) you wish to rely on and pass the lib file that matches your
43
memory model (small/compact/medium/large) to your linker.
43
memory model (small/compact/medium/large) to your linker.
44
 
44
 
45
Example program, KBTEST.C:
45
Example program, KBTEST.C:
46
 
46
 
47
  #include <mdr\dos.h>
47
  #include <mdr\dos.h>
48
 
48
 
49
  int main(void) {
49
  int main(void) {
50
    mdr_dos_getkey();
50
    mdr_dos_getkey();
51
    return(0);
51
    return(0);
52
  }
52
  }
53
 
53
 
54
How to compile with the Watcom C Compile and Link Utility:
54
How to compile with the Watcom C Compile and Link Utility:
55
 
55
 
56
  wcl -ms kbtest.c mdrs2024.lib
56
  wcl -ms kbtest.c mdrs2024.lib
57
 
57
 
58
 
58
 
59
+============================================================================+
59
+============================================================================+
60
| COMPILATION FROM SOURCES                                                   |
60
| COMPILATION FROM SOURCES                                                   |
61
+============================================================================+
61
+============================================================================+
62
 
62
 
63
Should you wish to compile MDR from sources instead of relying on precompiled
63
Should you wish to compile MDR from sources instead of relying on precompiled
64
LIB binaries, you will need the Watcom (or Open Watcom) C compiler and use its
64
LIB binaries, you will need the Watcom (or Open Watcom) C compiler and use its
65
wmake utility as follows:
65
wmake utility as follows:
66
 
66
 
67
  wmake clean
67
  wmake clean
68
  wmake model=<MEMORY MODEL>
68
  wmake model=<MEMORY MODEL>
69
 
69
 
70
valid memory model options are:
70
valid memory model options are:
71
 
71
 
72
  wmake model=s
72
  wmake model=s
73
  wmake model=c
73
  wmake model=c
74
  wmake model=m
74
  wmake model=m
75
  wmake model=l
75
  wmake model=l
76
 
76
 
77
 
77
 
78
==============================================================================
78
==============================================================================
79
 
79