Revision | 50 (tree) |
---|---|
Time | 2022-11-12 18:12:32 |
Author | mateuszviste |
headers moved to a subdirectory to avoid mdr clashing with default libc headers
@@ -1,72 +0,0 @@ | ||
1 | -/* | |
2 | - * a few functions for mode 12h programming (640x480 4bpp) | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_VID12_H | |
29 | - | |
30 | - #define MDR_VID12_H | |
31 | - | |
32 | - /* init video mode 12h (640x480x16c) */ | |
33 | - void vid12_init(void); | |
34 | - | |
35 | - /* Wait until VBLANK */ | |
36 | - void vid12_waitvblank(void); | |
37 | - | |
38 | - /* clear screen using color | |
39 | - * this function is fastest when color is 0 or 15 */ | |
40 | - void vid12_cls(unsigned char color); | |
41 | - | |
42 | - /* clear a single scanline (0..479) with a solid color (0..15) | |
43 | - * this function is fastest when color is 0 or 15 */ | |
44 | - void vid12_clrline(unsigned short line, unsigned char color); | |
45 | - | |
46 | - /* fill lines from linefirst to linelast with an 8 pixels pattern | |
47 | - * linelast must be equal to or greater than linelast | |
48 | - * pattern must be 8 bytes long */ | |
49 | - void vid12_linepat(unsigned short linefirst, unsigned short linelast, const unsigned char *pattern); | |
50 | - | |
51 | - void vid12_close(void); | |
52 | - | |
53 | - void vid12_putpixel(unsigned short x, unsigned short y, unsigned char col); | |
54 | - | |
55 | - /* draws a horizonatal line from [x1,y] to [x2,y] */ | |
56 | - void vid12_hline(unsigned short y, unsigned short x1, unsigned short x2, unsigned char color); | |
57 | - | |
58 | - void vid12_putscanline(unsigned short scanline, const unsigned char *pixels); | |
59 | - | |
60 | - /* prepares VGA for a VRAM-to-VRAM copy operation */ | |
61 | - void vid12_vramcpy_prep(void); | |
62 | - | |
63 | - /* fast (VRAM-to-VRAM) copy of a scanline (0..479) to another scanline. | |
64 | - * vid12_vramcpy_prep() must be called before and vid12_vramcpy_done must be | |
65 | - * called after one or more vid12_vramcpy_scanline() calls. */ | |
66 | - void vid12_vramcpy_scanline(unsigned short dst, unsigned short src); | |
67 | - | |
68 | - /* sets VGA back to its normal state after VRAM-to-VRAM operations */ | |
69 | - void vid12_vramcpy_done(void); | |
70 | - | |
71 | - void vid12_setpalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b); | |
72 | -#endif |
@@ -1,48 +0,0 @@ | ||
1 | -/* | |
2 | - * Mouse routines | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2014-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_MOUSE_H | |
29 | - #define MDR_MOUSE_H | |
30 | - | |
31 | - /* init the mouse driver (and checks for presence of mouse support at same time) | |
32 | - * returns 0 if no mouse is present, and the number of buttons otherwise */ | |
33 | - int mouse_init(void); | |
34 | - | |
35 | - /* shows the mouse pointer */ | |
36 | - void mouse_show(void); | |
37 | - | |
38 | - /* hides the mouse pointer */ | |
39 | - void mouse_hide(void); | |
40 | - | |
41 | - /* get x/y coordinates of the mouse, and returns a bitfield with state of buttons */ | |
42 | - int mouse_getstate(int *x, int *y); | |
43 | - | |
44 | - /* get x/y coordinates of the mouse when the last button release occured since last check. | |
45 | - returns the id of the button pressed (1 or 2), or 0 if no event occured. */ | |
46 | - int mouse_fetchrelease(int *x, int *y); | |
47 | - | |
48 | -#endif |
@@ -1,52 +0,0 @@ | ||
1 | -/* | |
2 | - * High-resolution timing routines (PIT reprogramming) | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2014-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_TIMER_H | |
29 | -#define MDR_TIMER_H | |
30 | - | |
31 | -/* reset the timer value, this can be used by the application to make sure | |
32 | - * no timer wrap occurs during critical parts of the code flow */ | |
33 | -void timer_reset(void); | |
34 | - | |
35 | -/* This routine will stop the fast clock if it is going. It has void return | |
36 | - * value so that it can be an exit procedure. */ | |
37 | -void timer_stop(void); | |
38 | - | |
39 | -/* This routine will start the fast clock rate by installing the | |
40 | - * handle_clock routine as the interrupt service routine for the clock | |
41 | - * interrupt and then setting the interrupt rate up to its higher speed | |
42 | - * by programming the 8253 timer chip. | |
43 | - * This routine does nothing if the clock rate is already set to | |
44 | - * its higher rate, but then it returns -1 to indicate the error. */ | |
45 | -void timer_init(void); | |
46 | - | |
47 | -/* This routine will return the present value of the time, which is | |
48 | - * read from the nowtime structure. Interrupts are disabled during this | |
49 | - * time to prevent the clock from changing while it is being read. */ | |
50 | -void timer_read(unsigned long *res); | |
51 | - | |
52 | -#endif |
@@ -1,47 +0,0 @@ | ||
1 | -/* | |
2 | - * Reading from and writing to an RS-232 port | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2015-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_RS232_H | |
29 | -#define MDR_RS232_H | |
30 | - | |
31 | -/* get the I/O port for COMx (1..4) */ | |
32 | -unsigned short rs232_getport(int x); | |
33 | - | |
34 | -/* check if the COM port is ready for write. loops for some time waiting. | |
35 | - * returns 0 if port seems ready eventually, non-zero otherwise. can be used | |
36 | - * to verify the rs232 presence */ | |
37 | -int rs232_check(unsigned short port); | |
38 | - | |
39 | -/* write a byte to the COM port at 'port'. this function will block if the | |
40 | - * UART is not ready to transmit yet. */ | |
41 | -void rs232_write(unsigned short port, int data); | |
42 | - | |
43 | -/* read a byte from COM port at 'port'. returns the read byte, or -1 if | |
44 | - * nothing was available to read. */ | |
45 | -int rs232_read(unsigned short port); | |
46 | - | |
47 | -#endif |
@@ -1,57 +0,0 @@ | ||
1 | -/* | |
2 | - * SoundBlaster routines for DSP driving | |
3 | - * | |
4 | - * Copyright (C) 2022 Mateusz Viste | |
5 | - * | |
6 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | - * of this software and associated documentation files (the "Software"), to | |
8 | - * deal in the Software without restriction, including without limitation the | |
9 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
10 | - * sell copies of the Software, and to permit persons to whom the Software is | |
11 | - * furnished to do so, subject to the following conditions: | |
12 | - * | |
13 | - * The above copyright notice and this permission notice shall be included in | |
14 | - * all copies or substantial portions of the Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
22 | - * IN THE SOFTWARE. | |
23 | - */ | |
24 | - | |
25 | -#ifndef MDR_SBDIGI_H | |
26 | -#define MDR_SBDIGI_H | |
27 | - | |
28 | -struct sbdigi_ctx; | |
29 | - | |
30 | -/* initializes the SoundBlaster DSP chip | |
31 | - * blaster must point to a BLASTER environment string (like "A220 I5 D1") | |
32 | - * returns a pointer to a context, NULL on error | |
33 | - * NOTE: DSP's state after initialization may or may not be muted, depending | |
34 | - * on the exact hardware revision. use sbdigi_spkoff() to make sure it is | |
35 | - * unmuted */ | |
36 | -struct sbdigi_ctx *sbdigi_init(const char *blaster); | |
37 | - | |
38 | -/* unmutes the SoundBlaster DSP */ | |
39 | -void sbdigi_spkon(struct sbdigi_ctx *ctx); | |
40 | - | |
41 | -/* mutes the SoundBlaster DSP */ | |
42 | -void sbdigi_spkoff(struct sbdigi_ctx *ctx); | |
43 | - | |
44 | -/* plays a short sample | |
45 | - * ctx - DSP context, as returned by sbdigi_init() | |
46 | - * buf - pointer to sample data (must be PCM, 8000 Hz, mono, 8-bit unsigned | |
47 | - * len - length of the sample, in bytes | |
48 | - * NOTES: this routine uses DMA to transfer memory. This has two implications: | |
49 | - * 1. the routine will return almost immediately, while the sound is playing | |
50 | - * 2. sample data must be contained in a buffer that does NOT cross a 64K page | |
51 | - * because DMA transfers are unable to cross 64K boundaries */ | |
52 | -void sbdigi_playsample(struct sbdigi_ctx *ctx, void *buf, unsigned short len); | |
53 | - | |
54 | -/* shuts down the DSP and frees context memory */ | |
55 | -void sbdigi_quit(struct sbdigi_ctx *ctx); | |
56 | - | |
57 | -#endif |
@@ -1,46 +0,0 @@ | ||
1 | -/* | |
2 | - * Routines for computation of basic transcendental functions sin and cos. | |
3 | - * These routines use only integers, hence they do not require an FPU nor any | |
4 | - * kind of FPU emulation. Works reasonably fast even on an 8086 CPU. | |
5 | - * | |
6 | - * The results are computed using polynomial approximations. Their precision | |
7 | - * is not expected to be ideal, but "good enough" for common usage. | |
8 | - * | |
9 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
10 | - * Published under the terms of the MIT License, as stated below. | |
11 | - * | |
12 | - * Copyright (C) 2022 Mateusz Viste | |
13 | - * | |
14 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
15 | - * of this software and associated documentation files (the "Software"), to | |
16 | - * deal in the Software without restriction, including without limitation the | |
17 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
18 | - * sell copies of the Software, and to permit persons to whom the Software is | |
19 | - * furnished to do so, subject to the following conditions: | |
20 | - * | |
21 | - * The above copyright notice and this permission notice shall be included in | |
22 | - * all copies or substantial portions of the Software. | |
23 | - * | |
24 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
25 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
26 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
27 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
28 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
29 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
30 | - * IN THE SOFTWARE. | |
31 | - */ | |
32 | - | |
33 | -#ifndef MDR_TRIGINT_H | |
34 | -#define MDR_TRIGINT_H | |
35 | - | |
36 | -/* Computes the cosine value for the given radian. | |
37 | - * The radian argument must be provided multiplied by 1000. | |
38 | - * Returns the cosine value multiplied by 1000. */ | |
39 | -short trigint_cos(short rad1000); | |
40 | - | |
41 | -/* Computes the sine value for the given radian angle. | |
42 | - * The radian argument must be provided multiplied by 1000. | |
43 | - * Returns the cosine value multiplied by 1000. */ | |
44 | -short trigint_sin(short rad1000); | |
45 | - | |
46 | -#endif |
@@ -1,50 +0,0 @@ | ||
1 | -/* | |
2 | - * PCX-loading routines | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_PCX_H | |
29 | -#define MDR_PCX_H | |
30 | - | |
31 | -struct pcx_hdr { | |
32 | - unsigned char rle; | |
33 | - unsigned char bpp; | |
34 | - unsigned short max_x; | |
35 | - unsigned short max_y; | |
36 | - unsigned short bytes_per_scanline; | |
37 | - struct { | |
38 | - unsigned char r; | |
39 | - unsigned char g; | |
40 | - unsigned char b; | |
41 | - } pal[256]; | |
42 | -}; | |
43 | - | |
44 | -int pcx_anal(struct pcx_hdr *h, FILE *fd, unsigned long offset, unsigned short len); | |
45 | -int pcx_load(void *ptr, size_t ptrsz, const struct pcx_hdr *h, FILE *fd, unsigned long offset); | |
46 | - | |
47 | -/* convert img to 8bpp if needed (ie unpack 2 and 4bpp data to 8bpp) */ | |
48 | -int pcx_convto8bpp(void *img, const struct pcx_hdr *h); | |
49 | - | |
50 | -#endif |
@@ -1,42 +0,0 @@ | ||
1 | -/* | |
2 | - * WAVE-loading routines | |
3 | - * | |
4 | - * Copyright (C) 2022 Mateusz Viste | |
5 | - * | |
6 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | - * of this software and associated documentation files (the "Software"), to | |
8 | - * deal in the Software without restriction, including without limitation the | |
9 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
10 | - * sell copies of the Software, and to permit persons to whom the Software is | |
11 | - * furnished to do so, subject to the following conditions: | |
12 | - * | |
13 | - * The above copyright notice and this permission notice shall be included in | |
14 | - * all copies or substantial portions of the Software. | |
15 | - * | |
16 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
22 | - * IN THE SOFTWARE. | |
23 | - */ | |
24 | - | |
25 | -#ifndef MDR_WAVE_H | |
26 | -#define MDR_WAVE_H | |
27 | - | |
28 | -struct wave_t { | |
29 | - unsigned short format; | |
30 | - unsigned short channels; | |
31 | - unsigned short rate; | |
32 | - unsigned short bitdepth; | |
33 | - unsigned long dataoffset; | |
34 | - unsigned long len; | |
35 | -}; | |
36 | - | |
37 | -/* looks at an open WAVE file and fills the wav structure with related | |
38 | - * information (format, number of channels, bit depth, data rate, etc) | |
39 | - * returns 0 on success */ | |
40 | -int wave_anal(struct wave_t *wav, FILE *fd); | |
41 | - | |
42 | -#endif |
@@ -1,51 +0,0 @@ | ||
1 | -/* | |
2 | - * XMS driver | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2014-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_XMS_H | |
29 | -#define MDR_XMS_H | |
30 | - | |
31 | -struct xms_struct { | |
32 | - unsigned int handle; | |
33 | - long memsize; /* allocated memory size, in bytes */ | |
34 | -}; | |
35 | - | |
36 | -/* checks if a XMS driver is installed, inits it and allocates a memory block of memsize K-bytes. | |
37 | - * if memsize is 0, then the maximum possible block will be allocated. | |
38 | - * returns the amount of allocated memory (in K-bytes) on success, 0 otherwise. */ | |
39 | -unsigned int xms_init(struct xms_struct *xms, unsigned int memsize); | |
40 | - | |
41 | -/* free XMS memory */ | |
42 | -void xms_close(struct xms_struct *xms); | |
43 | - | |
44 | -/* copies a chunk of memory from conventional memory into the XMS block. | |
45 | - returns 0 on sucess, non-zero otherwise. */ | |
46 | -int xms_push(struct xms_struct *xms, void far *src, unsigned int len, long xmsoffset); | |
47 | - | |
48 | -/* copies a chunk of memory from the XMS block into conventional memory */ | |
49 | -int xms_pull(struct xms_struct *xms, long xmsoffset, void far *dst, unsigned int len); | |
50 | - | |
51 | -#endif |
@@ -1,41 +0,0 @@ | ||
1 | -/* | |
2 | - * Keyboard routines | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2014-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef KEYB_MDR_H | |
29 | - #define KEYB_MDR_H | |
30 | - | |
31 | - /* wait for a keypress and return it. Returns 0 for extended keystroke, | |
32 | - * then function must be called again to return scan code. */ | |
33 | - int keyb_getkey(void); | |
34 | - | |
35 | - /* poll the keyboard, and return the next input key if any, or -1 */ | |
36 | - int keyb_getkey_ifany(void); | |
37 | - | |
38 | - /* flush the keyboard buffer */ | |
39 | - void keyb_flush(void); | |
40 | - | |
41 | -#endif |
@@ -1,91 +0,0 @@ | ||
1 | -/* | |
2 | - * video library - provides a few functions for mode 4 and 13h programming. | |
3 | - * | |
4 | - * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | - * Published under the terms of the MIT License, as stated below. | |
6 | - * | |
7 | - * Copyright (C) 2014-2022 Mateusz Viste | |
8 | - * | |
9 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | - * of this software and associated documentation files (the "Software"), to | |
11 | - * deal in the Software without restriction, including without limitation the | |
12 | - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | - * sell copies of the Software, and to permit persons to whom the Software is | |
14 | - * furnished to do so, subject to the following conditions: | |
15 | - * | |
16 | - * The above copyright notice and this permission notice shall be included in | |
17 | - * all copies or substantial portions of the Software. | |
18 | - * | |
19 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | - * IN THE SOFTWARE. | |
26 | - */ | |
27 | - | |
28 | -#ifndef MDR_VIDEO_H | |
29 | - | |
30 | - #define MDR_VIDEO_H | |
31 | - | |
32 | - #define VIDEO_DBUF 1 | |
33 | - | |
34 | - struct video_handler { | |
35 | - unsigned char far *dbuf; | |
36 | - int flags; | |
37 | - int mode; | |
38 | - unsigned char lastmode; | |
39 | - }; | |
40 | - | |
41 | - /* returns 0 if no VGA has been detected, non-zero otherwise */ | |
42 | - int video_detectvga(void); | |
43 | - | |
44 | - /* init video mode. either 0x04 for CGA or 0x13 for VGA */ | |
45 | - struct video_handler *video_open(int mode, int flags); | |
46 | - | |
47 | - /* reads a screen dump from file and puts it to the screen buffer */ | |
48 | - void video_file2screen(struct video_handler *handler, char *file); | |
49 | - | |
50 | - /* load count colors of palette from array of rgb triplets */ | |
51 | - void video_loadpal(const unsigned char *pal, int count, int offset); | |
52 | - | |
53 | - /* Wait until VBLANK */ | |
54 | - void video_waitvblank(void); | |
55 | - | |
56 | - void video_flip(struct video_handler *handler); | |
57 | - | |
58 | - /* copies line ysrc over ydst in CGA mode memory */ | |
59 | - void video_cgalinecopy(struct video_handler *handler, int ydst, int ysrc); | |
60 | - | |
61 | - /* clear screen using color */ | |
62 | - void video_cls(struct video_handler *handler, unsigned char color); | |
63 | - | |
64 | - /* renders a sprite of width and height dimensions onscreen, starting at specified x/y location | |
65 | - coloffset is an offset to add to color indexes, while transp is the index of the transparent color (set to -1 if none) */ | |
66 | - void video_putsprite(struct video_handler *handler, unsigned char *sprite, int x, int y, int width, int height, int coloffset, int transp, int maxcol); | |
67 | - | |
68 | - /* same as video_putsprite(), but reads the sprite from a file */ | |
69 | - void video_putspritefromfile(struct video_handler *handler, char *file, long foffset, int x, int y, int width, int height, int coloffset, int transp, int maxcol); | |
70 | - | |
71 | - void video_close(struct video_handler *handler); | |
72 | - | |
73 | - void video_rputpixel(struct video_handler *handler, int x, int y, unsigned char col, int repeat); | |
74 | - | |
75 | - /* render a horizontal line of length len starting at x/y */ | |
76 | - void video_hline(struct video_handler *handler, int x, int y, int len, unsigned char color); | |
77 | - | |
78 | - /* render a vertical line of length len starting at x/y */ | |
79 | - void video_vline(struct video_handler *handler, int x, int y, int len, unsigned char color); | |
80 | - | |
81 | - void video_line(struct video_handler *handler, int x1, int y1, int x2, int y2, unsigned char color); | |
82 | - | |
83 | - void video_rect(struct video_handler *handler, int x, int y, int width, int height, unsigned char color); | |
84 | - | |
85 | - /* renders a rectangle on screen, at position x/y, filled with color */ | |
86 | - void video_rectfill(struct video_handler *handler, int x, int y, int width, int height, unsigned char color); | |
87 | - | |
88 | - void video_setpalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b); | |
89 | - | |
90 | - void video_getpalette(unsigned char index, unsigned char *r, unsigned char *g, unsigned char *b); | |
91 | -#endif |
@@ -0,0 +1,41 @@ | ||
1 | +/* | |
2 | + * Keyboard routines | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2014-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef KEYB_MDR_H | |
29 | + #define KEYB_MDR_H | |
30 | + | |
31 | + /* wait for a keypress and return it. Returns 0 for extended keystroke, | |
32 | + * then function must be called again to return scan code. */ | |
33 | + int keyb_getkey(void); | |
34 | + | |
35 | + /* poll the keyboard, and return the next input key if any, or -1 */ | |
36 | + int keyb_getkey_ifany(void); | |
37 | + | |
38 | + /* flush the keyboard buffer */ | |
39 | + void keyb_flush(void); | |
40 | + | |
41 | +#endif |
@@ -0,0 +1,48 @@ | ||
1 | +/* | |
2 | + * Mouse routines | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2014-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_MOUSE_H | |
29 | + #define MDR_MOUSE_H | |
30 | + | |
31 | + /* init the mouse driver (and checks for presence of mouse support at same time) | |
32 | + * returns 0 if no mouse is present, and the number of buttons otherwise */ | |
33 | + int mouse_init(void); | |
34 | + | |
35 | + /* shows the mouse pointer */ | |
36 | + void mouse_show(void); | |
37 | + | |
38 | + /* hides the mouse pointer */ | |
39 | + void mouse_hide(void); | |
40 | + | |
41 | + /* get x/y coordinates of the mouse, and returns a bitfield with state of buttons */ | |
42 | + int mouse_getstate(int *x, int *y); | |
43 | + | |
44 | + /* get x/y coordinates of the mouse when the last button release occured since last check. | |
45 | + returns the id of the button pressed (1 or 2), or 0 if no event occured. */ | |
46 | + int mouse_fetchrelease(int *x, int *y); | |
47 | + | |
48 | +#endif |
@@ -0,0 +1,50 @@ | ||
1 | +/* | |
2 | + * PCX-loading routines | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_PCX_H | |
29 | +#define MDR_PCX_H | |
30 | + | |
31 | +struct pcx_hdr { | |
32 | + unsigned char rle; | |
33 | + unsigned char bpp; | |
34 | + unsigned short max_x; | |
35 | + unsigned short max_y; | |
36 | + unsigned short bytes_per_scanline; | |
37 | + struct { | |
38 | + unsigned char r; | |
39 | + unsigned char g; | |
40 | + unsigned char b; | |
41 | + } pal[256]; | |
42 | +}; | |
43 | + | |
44 | +int pcx_anal(struct pcx_hdr *h, FILE *fd, unsigned long offset, unsigned short len); | |
45 | +int pcx_load(void *ptr, size_t ptrsz, const struct pcx_hdr *h, FILE *fd, unsigned long offset); | |
46 | + | |
47 | +/* convert img to 8bpp if needed (ie unpack 2 and 4bpp data to 8bpp) */ | |
48 | +int pcx_convto8bpp(void *img, const struct pcx_hdr *h); | |
49 | + | |
50 | +#endif |
@@ -0,0 +1,47 @@ | ||
1 | +/* | |
2 | + * Reading from and writing to an RS-232 port | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2015-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_RS232_H | |
29 | +#define MDR_RS232_H | |
30 | + | |
31 | +/* get the I/O port for COMx (1..4) */ | |
32 | +unsigned short rs232_getport(int x); | |
33 | + | |
34 | +/* check if the COM port is ready for write. loops for some time waiting. | |
35 | + * returns 0 if port seems ready eventually, non-zero otherwise. can be used | |
36 | + * to verify the rs232 presence */ | |
37 | +int rs232_check(unsigned short port); | |
38 | + | |
39 | +/* write a byte to the COM port at 'port'. this function will block if the | |
40 | + * UART is not ready to transmit yet. */ | |
41 | +void rs232_write(unsigned short port, int data); | |
42 | + | |
43 | +/* read a byte from COM port at 'port'. returns the read byte, or -1 if | |
44 | + * nothing was available to read. */ | |
45 | +int rs232_read(unsigned short port); | |
46 | + | |
47 | +#endif |
@@ -0,0 +1,57 @@ | ||
1 | +/* | |
2 | + * SoundBlaster routines for DSP driving | |
3 | + * | |
4 | + * Copyright (C) 2022 Mateusz Viste | |
5 | + * | |
6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | + * of this software and associated documentation files (the "Software"), to | |
8 | + * deal in the Software without restriction, including without limitation the | |
9 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
10 | + * sell copies of the Software, and to permit persons to whom the Software is | |
11 | + * furnished to do so, subject to the following conditions: | |
12 | + * | |
13 | + * The above copyright notice and this permission notice shall be included in | |
14 | + * all copies or substantial portions of the Software. | |
15 | + * | |
16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
22 | + * IN THE SOFTWARE. | |
23 | + */ | |
24 | + | |
25 | +#ifndef MDR_SBDIGI_H | |
26 | +#define MDR_SBDIGI_H | |
27 | + | |
28 | +struct sbdigi_ctx; | |
29 | + | |
30 | +/* initializes the SoundBlaster DSP chip | |
31 | + * blaster must point to a BLASTER environment string (like "A220 I5 D1") | |
32 | + * returns a pointer to a context, NULL on error | |
33 | + * NOTE: DSP's state after initialization may or may not be muted, depending | |
34 | + * on the exact hardware revision. use sbdigi_spkoff() to make sure it is | |
35 | + * unmuted */ | |
36 | +struct sbdigi_ctx *sbdigi_init(const char *blaster); | |
37 | + | |
38 | +/* unmutes the SoundBlaster DSP */ | |
39 | +void sbdigi_spkon(struct sbdigi_ctx *ctx); | |
40 | + | |
41 | +/* mutes the SoundBlaster DSP */ | |
42 | +void sbdigi_spkoff(struct sbdigi_ctx *ctx); | |
43 | + | |
44 | +/* plays a short sample | |
45 | + * ctx - DSP context, as returned by sbdigi_init() | |
46 | + * buf - pointer to sample data (must be PCM, 8000 Hz, mono, 8-bit unsigned | |
47 | + * len - length of the sample, in bytes | |
48 | + * NOTES: this routine uses DMA to transfer memory. This has two implications: | |
49 | + * 1. the routine will return almost immediately, while the sound is playing | |
50 | + * 2. sample data must be contained in a buffer that does NOT cross a 64K page | |
51 | + * because DMA transfers are unable to cross 64K boundaries */ | |
52 | +void sbdigi_playsample(struct sbdigi_ctx *ctx, void *buf, unsigned short len); | |
53 | + | |
54 | +/* shuts down the DSP and frees context memory */ | |
55 | +void sbdigi_quit(struct sbdigi_ctx *ctx); | |
56 | + | |
57 | +#endif |
@@ -0,0 +1,52 @@ | ||
1 | +/* | |
2 | + * High-resolution timing routines (PIT reprogramming) | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2014-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_TIMER_H | |
29 | +#define MDR_TIMER_H | |
30 | + | |
31 | +/* reset the timer value, this can be used by the application to make sure | |
32 | + * no timer wrap occurs during critical parts of the code flow */ | |
33 | +void timer_reset(void); | |
34 | + | |
35 | +/* This routine will stop the fast clock if it is going. It has void return | |
36 | + * value so that it can be an exit procedure. */ | |
37 | +void timer_stop(void); | |
38 | + | |
39 | +/* This routine will start the fast clock rate by installing the | |
40 | + * handle_clock routine as the interrupt service routine for the clock | |
41 | + * interrupt and then setting the interrupt rate up to its higher speed | |
42 | + * by programming the 8253 timer chip. | |
43 | + * This routine does nothing if the clock rate is already set to | |
44 | + * its higher rate, but then it returns -1 to indicate the error. */ | |
45 | +void timer_init(void); | |
46 | + | |
47 | +/* This routine will return the present value of the time, which is | |
48 | + * read from the nowtime structure. Interrupts are disabled during this | |
49 | + * time to prevent the clock from changing while it is being read. */ | |
50 | +void timer_read(unsigned long *res); | |
51 | + | |
52 | +#endif |
@@ -0,0 +1,46 @@ | ||
1 | +/* | |
2 | + * Routines for computation of basic transcendental functions sin and cos. | |
3 | + * These routines use only integers, hence they do not require an FPU nor any | |
4 | + * kind of FPU emulation. Works reasonably fast even on an 8086 CPU. | |
5 | + * | |
6 | + * The results are computed using polynomial approximations. Their precision | |
7 | + * is not expected to be ideal, but "good enough" for common usage. | |
8 | + * | |
9 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
10 | + * Published under the terms of the MIT License, as stated below. | |
11 | + * | |
12 | + * Copyright (C) 2022 Mateusz Viste | |
13 | + * | |
14 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
15 | + * of this software and associated documentation files (the "Software"), to | |
16 | + * deal in the Software without restriction, including without limitation the | |
17 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
18 | + * sell copies of the Software, and to permit persons to whom the Software is | |
19 | + * furnished to do so, subject to the following conditions: | |
20 | + * | |
21 | + * The above copyright notice and this permission notice shall be included in | |
22 | + * all copies or substantial portions of the Software. | |
23 | + * | |
24 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
25 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
26 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
27 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
28 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
29 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
30 | + * IN THE SOFTWARE. | |
31 | + */ | |
32 | + | |
33 | +#ifndef MDR_TRIGINT_H | |
34 | +#define MDR_TRIGINT_H | |
35 | + | |
36 | +/* Computes the cosine value for the given radian. | |
37 | + * The radian argument must be provided multiplied by 1000. | |
38 | + * Returns the cosine value multiplied by 1000. */ | |
39 | +short trigint_cos(short rad1000); | |
40 | + | |
41 | +/* Computes the sine value for the given radian angle. | |
42 | + * The radian argument must be provided multiplied by 1000. | |
43 | + * Returns the cosine value multiplied by 1000. */ | |
44 | +short trigint_sin(short rad1000); | |
45 | + | |
46 | +#endif |
@@ -0,0 +1,72 @@ | ||
1 | +/* | |
2 | + * a few functions for mode 12h programming (640x480 4bpp) | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_VID12_H | |
29 | + | |
30 | + #define MDR_VID12_H | |
31 | + | |
32 | + /* init video mode 12h (640x480x16c) */ | |
33 | + void vid12_init(void); | |
34 | + | |
35 | + /* Wait until VBLANK */ | |
36 | + void vid12_waitvblank(void); | |
37 | + | |
38 | + /* clear screen using color | |
39 | + * this function is fastest when color is 0 or 15 */ | |
40 | + void vid12_cls(unsigned char color); | |
41 | + | |
42 | + /* clear a single scanline (0..479) with a solid color (0..15) | |
43 | + * this function is fastest when color is 0 or 15 */ | |
44 | + void vid12_clrline(unsigned short line, unsigned char color); | |
45 | + | |
46 | + /* fill lines from linefirst to linelast with an 8 pixels pattern | |
47 | + * linelast must be equal to or greater than linelast | |
48 | + * pattern must be 8 bytes long */ | |
49 | + void vid12_linepat(unsigned short linefirst, unsigned short linelast, const unsigned char *pattern); | |
50 | + | |
51 | + void vid12_close(void); | |
52 | + | |
53 | + void vid12_putpixel(unsigned short x, unsigned short y, unsigned char col); | |
54 | + | |
55 | + /* draws a horizonatal line from [x1,y] to [x2,y] */ | |
56 | + void vid12_hline(unsigned short y, unsigned short x1, unsigned short x2, unsigned char color); | |
57 | + | |
58 | + void vid12_putscanline(unsigned short scanline, const unsigned char *pixels); | |
59 | + | |
60 | + /* prepares VGA for a VRAM-to-VRAM copy operation */ | |
61 | + void vid12_vramcpy_prep(void); | |
62 | + | |
63 | + /* fast (VRAM-to-VRAM) copy of a scanline (0..479) to another scanline. | |
64 | + * vid12_vramcpy_prep() must be called before and vid12_vramcpy_done must be | |
65 | + * called after one or more vid12_vramcpy_scanline() calls. */ | |
66 | + void vid12_vramcpy_scanline(unsigned short dst, unsigned short src); | |
67 | + | |
68 | + /* sets VGA back to its normal state after VRAM-to-VRAM operations */ | |
69 | + void vid12_vramcpy_done(void); | |
70 | + | |
71 | + void vid12_setpalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b); | |
72 | +#endif |
@@ -0,0 +1,91 @@ | ||
1 | +/* | |
2 | + * video library - provides a few functions for mode 4 and 13h programming. | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2014-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_VIDEO_H | |
29 | + | |
30 | + #define MDR_VIDEO_H | |
31 | + | |
32 | + #define VIDEO_DBUF 1 | |
33 | + | |
34 | + struct video_handler { | |
35 | + unsigned char far *dbuf; | |
36 | + int flags; | |
37 | + int mode; | |
38 | + unsigned char lastmode; | |
39 | + }; | |
40 | + | |
41 | + /* returns 0 if no VGA has been detected, non-zero otherwise */ | |
42 | + int video_detectvga(void); | |
43 | + | |
44 | + /* init video mode. either 0x04 for CGA or 0x13 for VGA */ | |
45 | + struct video_handler *video_open(int mode, int flags); | |
46 | + | |
47 | + /* reads a screen dump from file and puts it to the screen buffer */ | |
48 | + void video_file2screen(struct video_handler *handler, char *file); | |
49 | + | |
50 | + /* load count colors of palette from array of rgb triplets */ | |
51 | + void video_loadpal(const unsigned char *pal, int count, int offset); | |
52 | + | |
53 | + /* Wait until VBLANK */ | |
54 | + void video_waitvblank(void); | |
55 | + | |
56 | + void video_flip(struct video_handler *handler); | |
57 | + | |
58 | + /* copies line ysrc over ydst in CGA mode memory */ | |
59 | + void video_cgalinecopy(struct video_handler *handler, int ydst, int ysrc); | |
60 | + | |
61 | + /* clear screen using color */ | |
62 | + void video_cls(struct video_handler *handler, unsigned char color); | |
63 | + | |
64 | + /* renders a sprite of width and height dimensions onscreen, starting at specified x/y location | |
65 | + coloffset is an offset to add to color indexes, while transp is the index of the transparent color (set to -1 if none) */ | |
66 | + void video_putsprite(struct video_handler *handler, unsigned char *sprite, int x, int y, int width, int height, int coloffset, int transp, int maxcol); | |
67 | + | |
68 | + /* same as video_putsprite(), but reads the sprite from a file */ | |
69 | + void video_putspritefromfile(struct video_handler *handler, char *file, long foffset, int x, int y, int width, int height, int coloffset, int transp, int maxcol); | |
70 | + | |
71 | + void video_close(struct video_handler *handler); | |
72 | + | |
73 | + void video_rputpixel(struct video_handler *handler, int x, int y, unsigned char col, int repeat); | |
74 | + | |
75 | + /* render a horizontal line of length len starting at x/y */ | |
76 | + void video_hline(struct video_handler *handler, int x, int y, int len, unsigned char color); | |
77 | + | |
78 | + /* render a vertical line of length len starting at x/y */ | |
79 | + void video_vline(struct video_handler *handler, int x, int y, int len, unsigned char color); | |
80 | + | |
81 | + void video_line(struct video_handler *handler, int x1, int y1, int x2, int y2, unsigned char color); | |
82 | + | |
83 | + void video_rect(struct video_handler *handler, int x, int y, int width, int height, unsigned char color); | |
84 | + | |
85 | + /* renders a rectangle on screen, at position x/y, filled with color */ | |
86 | + void video_rectfill(struct video_handler *handler, int x, int y, int width, int height, unsigned char color); | |
87 | + | |
88 | + void video_setpalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b); | |
89 | + | |
90 | + void video_getpalette(unsigned char index, unsigned char *r, unsigned char *g, unsigned char *b); | |
91 | +#endif |
@@ -0,0 +1,42 @@ | ||
1 | +/* | |
2 | + * WAVE-loading routines | |
3 | + * | |
4 | + * Copyright (C) 2022 Mateusz Viste | |
5 | + * | |
6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | + * of this software and associated documentation files (the "Software"), to | |
8 | + * deal in the Software without restriction, including without limitation the | |
9 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
10 | + * sell copies of the Software, and to permit persons to whom the Software is | |
11 | + * furnished to do so, subject to the following conditions: | |
12 | + * | |
13 | + * The above copyright notice and this permission notice shall be included in | |
14 | + * all copies or substantial portions of the Software. | |
15 | + * | |
16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
21 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
22 | + * IN THE SOFTWARE. | |
23 | + */ | |
24 | + | |
25 | +#ifndef MDR_WAVE_H | |
26 | +#define MDR_WAVE_H | |
27 | + | |
28 | +struct wave_t { | |
29 | + unsigned short format; | |
30 | + unsigned short channels; | |
31 | + unsigned short rate; | |
32 | + unsigned short bitdepth; | |
33 | + unsigned long dataoffset; | |
34 | + unsigned long len; | |
35 | +}; | |
36 | + | |
37 | +/* looks at an open WAVE file and fills the wav structure with related | |
38 | + * information (format, number of channels, bit depth, data rate, etc) | |
39 | + * returns 0 on success */ | |
40 | +int wave_anal(struct wave_t *wav, FILE *fd); | |
41 | + | |
42 | +#endif |
@@ -0,0 +1,51 @@ | ||
1 | +/* | |
2 | + * XMS driver | |
3 | + * | |
4 | + * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io | |
5 | + * Published under the terms of the MIT License, as stated below. | |
6 | + * | |
7 | + * Copyright (C) 2014-2022 Mateusz Viste | |
8 | + * | |
9 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | + * of this software and associated documentation files (the "Software"), to | |
11 | + * deal in the Software without restriction, including without limitation the | |
12 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
13 | + * sell copies of the Software, and to permit persons to whom the Software is | |
14 | + * furnished to do so, subject to the following conditions: | |
15 | + * | |
16 | + * The above copyright notice and this permission notice shall be included in | |
17 | + * all copies or substantial portions of the Software. | |
18 | + * | |
19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
24 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
25 | + * IN THE SOFTWARE. | |
26 | + */ | |
27 | + | |
28 | +#ifndef MDR_XMS_H | |
29 | +#define MDR_XMS_H | |
30 | + | |
31 | +struct xms_struct { | |
32 | + unsigned int handle; | |
33 | + long memsize; /* allocated memory size, in bytes */ | |
34 | +}; | |
35 | + | |
36 | +/* checks if a XMS driver is installed, inits it and allocates a memory block of memsize K-bytes. | |
37 | + * if memsize is 0, then the maximum possible block will be allocated. | |
38 | + * returns the amount of allocated memory (in K-bytes) on success, 0 otherwise. */ | |
39 | +unsigned int xms_init(struct xms_struct *xms, unsigned int memsize); | |
40 | + | |
41 | +/* free XMS memory */ | |
42 | +void xms_close(struct xms_struct *xms); | |
43 | + | |
44 | +/* copies a chunk of memory from conventional memory into the XMS block. | |
45 | + returns 0 on sucess, non-zero otherwise. */ | |
46 | +int xms_push(struct xms_struct *xms, void far *src, unsigned int len, long xmsoffset); | |
47 | + | |
48 | +/* copies a chunk of memory from the XMS block into conventional memory */ | |
49 | +int xms_pull(struct xms_struct *xms, long xmsoffset, void far *dst, unsigned int len); | |
50 | + | |
51 | +#endif |
@@ -27,7 +27,7 @@ | ||
27 | 27 | |
28 | 28 | #include <dos.h> |
29 | 29 | |
30 | -#include "keyb.h" /* include self for control */ | |
30 | +#include <mdr\keyb.h> /* include self for control */ | |
31 | 31 | |
32 | 32 | |
33 | 33 | /* waits for a keypress and return it. Returns 0 for extended keystroke, then |
@@ -27,7 +27,7 @@ | ||
27 | 27 | |
28 | 28 | #include <dos.h> |
29 | 29 | |
30 | -#include "mouse.h" /* include self for control */ | |
30 | +#include <mdr\mouse.h> /* include self for control */ | |
31 | 31 | |
32 | 32 | /* init the mouse driver (and checks for presence of mouse support at same time) |
33 | 33 | * returns 0 if no mouse is present, and the number of buttons otherwise */ |
@@ -28,7 +28,7 @@ | ||
28 | 28 | #include <stdio.h> |
29 | 29 | #include <string.h> |
30 | 30 | |
31 | -#include "pcx.h" | |
31 | +#include <mdr\pcx.h> | |
32 | 32 | |
33 | 33 | |
34 | 34 | int pcx_anal(struct pcx_hdr *h, FILE *fd, unsigned long offset, unsigned short len) { |
@@ -28,7 +28,7 @@ | ||
28 | 28 | #include <conio.h> |
29 | 29 | #include <dos.h> |
30 | 30 | |
31 | -#include "rs232.h" | |
31 | +#include <mdr\rs232.h> | |
32 | 32 | |
33 | 33 | /* get the I/O port for COMx (1..4) */ |
34 | 34 | unsigned short rs232_getport(int x) { |
@@ -25,7 +25,7 @@ | ||
25 | 25 | #include <conio.h> /* inp() and outp() */ |
26 | 26 | #include <stdlib.h> /* NULL, free(), ... */ |
27 | 27 | |
28 | -#include "sbdigi.h" | |
28 | +#include <mdr\sbdigi.h> | |
29 | 29 | |
30 | 30 | |
31 | 31 | struct sbdigi_ctx { |
@@ -28,8 +28,9 @@ | ||
28 | 28 | #include <stdlib.h> |
29 | 29 | #include <dos.h> |
30 | 30 | #include <conio.h> /* outp() */ |
31 | -#include "timer.h" /* include self for control */ | |
32 | 31 | |
32 | +#include <mdr\timer.h> /* include self for control */ | |
33 | + | |
33 | 34 | /* selects timer's resolution */ |
34 | 35 | #define TIMER_1165_HZ |
35 | 36 | /*#define TIMER_582_HZ*/ |
@@ -30,7 +30,7 @@ | ||
30 | 30 | * IN THE SOFTWARE. |
31 | 31 | */ |
32 | 32 | |
33 | -#include "trigint.h" | |
33 | +#include <mdr\trigint.h> | |
34 | 34 | |
35 | 35 | /* helper definitions for common "angle to rad*1000" values */ |
36 | 36 | #define ANGLE_360 6283 |
@@ -26,9 +26,10 @@ | ||
26 | 26 | */ |
27 | 27 | |
28 | 28 | #include <dos.h> /* provides int86() along with the union REGS type */ |
29 | -#include "video.h" /* include self for control */ | |
30 | 29 | |
30 | +#include <mdr\video.h> /* include self for control */ | |
31 | 31 | |
32 | + | |
32 | 33 | /* returns 1 if VGA has been detected, zero otherwise */ |
33 | 34 | int video_detectvga(void) { |
34 | 35 | union REGS regs; |
@@ -29,9 +29,10 @@ | ||
29 | 29 | #include <malloc.h> /* _fcalloc() and friends */ |
30 | 30 | #include <stdlib.h> |
31 | 31 | #include <string.h> /* memcpy() */ |
32 | -#include "video.h" /* include self for control */ | |
33 | 32 | |
33 | +#include <mdr\video.h> /* include self for control */ | |
34 | 34 | |
35 | + | |
35 | 36 | /* init video mode */ |
36 | 37 | struct video_handler *video_open(int mode, int flags) { |
37 | 38 | union REGS regs; |
@@ -26,8 +26,10 @@ | ||
26 | 26 | */ |
27 | 27 | |
28 | 28 | #include <string.h> /* memcpy() */ |
29 | -#include "video.h" /* include self for control */ | |
30 | 29 | |
30 | +#include <mdr\video.h> /* include self for control */ | |
31 | + | |
32 | + | |
31 | 33 | /* update the screen (if double-buffered) */ |
32 | 34 | void video_flip(struct video_handler *handler) { |
33 | 35 | unsigned char far *vram; |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "video.h" /* include self for control */ | |
28 | +#include <mdr\video.h> /* include self for control */ | |
29 | 29 | |
30 | 30 | void video_getpalette(unsigned char index, unsigned char *r, unsigned char *g, unsigned char *b) { |
31 | 31 | unsigned char rr = 0, gg = 0, bb = 0; |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "video.h" /* include self for control */ | |
28 | +#include <mdr\video.h> /* include self for control */ | |
29 | 29 | |
30 | 30 | /* load count colors of palette from array of rgb triplets */ |
31 | 31 | void video_loadpal(const unsigned char *pal, int count, int offset) { |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "video.h" /* include self for control */ | |
28 | +#include <mdr\video.h> /* include self for control */ | |
29 | 29 | |
30 | 30 | /* renders a sprite of width and height dimensions onscreen, starting at specified x/y location |
31 | 31 | coloffset is an offset to add to color indexes, while transp is the index of the transparent color (set to -1 if none) */ |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "video.h" /* include self for control */ | |
28 | +#include <mdr\video.h> /* include self for control */ | |
29 | 29 | |
30 | 30 | /* renders a rectangle on screen, at position x/y, filled with color */ |
31 | 31 | void video_rectfill(struct video_handler *handler, int x, int y, int width, int height, unsigned char color) { |
@@ -28,7 +28,7 @@ | ||
28 | 28 | #include <stdio.h> /* FILE */ |
29 | 29 | #include <stdlib.h> /* malloc() */ |
30 | 30 | |
31 | -#include "video.h" /* include self for control */ | |
31 | +#include <mdr\video.h> /* include self for control */ | |
32 | 32 | |
33 | 33 | |
34 | 34 | /* uncompress a RLE stream from a file into a buffer */ |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "video.h" /* include self for control */ | |
28 | +#include <mdr\video.h> /* include self for control */ | |
29 | 29 | |
30 | 30 | |
31 | 31 | void video_setpalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b) { |
@@ -1,6 +1,6 @@ | ||
1 | 1 | #include <stdio.h> |
2 | 2 | |
3 | -#include "vid12.h" | |
3 | +#include <mdr\vid12.h> | |
4 | 4 | |
5 | 5 | |
6 | 6 | /* get number of ticks from the BIOS 18.2 Hz timer */ |
@@ -25,7 +25,7 @@ | ||
25 | 25 | * IN THE SOFTWARE. |
26 | 26 | */ |
27 | 27 | |
28 | -#include "vid12.h" | |
28 | +#include <mdr\vid12.h> | |
29 | 29 | |
30 | 30 | #define VGA ((unsigned char far *)(0xA0000000l)) |
31 | 31 |
@@ -48,7 +48,7 @@ | ||
48 | 48 | |
49 | 49 | #include <string.h> /* _fmemset() */ |
50 | 50 | |
51 | -#include "vid12.h" /* include self for control */ | |
51 | +#include <mdr\vid12.h> /* include self for control */ | |
52 | 52 | |
53 | 53 | #define VGA ((unsigned char far *)(0xA0000000l)) |
54 | 54 | //static unsigned char far *VGA = (void far *)0xA0000000l; /* MK_FP(0xA000, 0); */ |
@@ -25,7 +25,7 @@ | ||
25 | 25 | #include <stdio.h> /* FILE and friends */ |
26 | 26 | #include <string.h> /* bzero(), bcmp() */ |
27 | 27 | |
28 | -#include "wave.h" | |
28 | +#include <mdr\wave.h> | |
29 | 29 | |
30 | 30 | |
31 | 31 | int wave_anal(struct wave_t *wav, FILE *fd) { |
@@ -28,7 +28,7 @@ | ||
28 | 28 | #include <dos.h> |
29 | 29 | #include <stdlib.h> |
30 | 30 | |
31 | -#include "xms.h" /* include self for control */ | |
31 | +#include <mdr\xms.h> /* include self for control */ | |
32 | 32 | |
33 | 33 | /* a function pointer to save the XMS driver address */ |
34 | 34 | void far (*xmsdrv)(void); |