3 * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
4 * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
5 * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
6 * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
7 * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
10 * By Shawn Hargreaves,
16 * Some definitions for internal use by the library code.
17 * This should not be included by user programs.
19 * See readme.txt for copyright information.
27 #error This file should only be used by the djgpp version of Allegro
34 /* file access macros */
35 #define FILE_OPEN(filename, handle) handle = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR)
36 #define FILE_CREATE(filename, handle) handle = open(filename, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)
37 #define FILE_CLOSE(handle) close(handle)
38 #define FILE_READ(handle, buf, size, sz) sz = read(handle, buf, size)
39 #define FILE_WRITE(handle, buf, size, sz) sz = write(handle, buf, size)
40 #define FILE_SEARCH_STRUCT struct ffblk
41 #define FILE_FINDFIRST(filename, attrib, dta) findfirst(filename, dta, attrib)
42 #define FILE_FINDNEXT(dta) findnext(dta)
43 #define FILE_ATTRIB ff_attrib
44 #define FILE_SIZE ff_fsize
45 #define FILE_NAME ff_name
46 #define FILE_TIME ff_ftime
47 #define FILE_DATE ff_fdate
50 /* macros to enable and disable interrupts */
51 #define DISABLE() asm volatile ("cli")
52 #define ENABLE() asm volatile ("sti")
55 __INLINE__ void enter_critical()
57 if (windows_version >= 3) {
67 __INLINE__ void exit_critical()
69 if (windows_version >= 3) {
79 /* interrupt hander stuff */
80 int _install_irq(int num, int (*handler)());
81 void _remove_irq(int num);
83 typedef struct _IRQ_HANDLER
85 int (*handler)(); /* our C handler */
86 int number; /* irq number */
87 __dpmi_paddr old_vector; /* original protected mode vector */
91 /* DPMI memory mapping routines */
92 int _create_physical_mapping(unsigned long *linear, int *segment, unsigned long physaddr, int size);
93 void _remove_physical_mapping(unsigned long *linear, int *segment);
94 int _create_linear_mapping(unsigned long *linear, unsigned long physaddr, int size);
95 void _remove_linear_mapping(unsigned long *linear);
96 int _create_selector(int *segment, unsigned long linear, int size);
97 void _remove_selector(int *segment);
98 void _unlock_dpmi_data(void *addr, int size);
101 /* bank switching routines */
102 void _vesa_window_1();
103 void _vesa_window_1_end();
104 void _vesa_window_2();
105 void _vesa_window_2_end();
107 void _vesa_pm_window_1();
108 void _vesa_pm_window_1_end();
109 void _vesa_pm_window_2();
110 void _vesa_pm_window_2_end();
112 void _vesa_pm_es_window_1();
113 void _vesa_pm_es_window_1_end();
114 void _vesa_pm_es_window_2();
115 void _vesa_pm_es_window_2_end();
118 void _vbeaf_bank_end();
120 void _vbeaf_linear_lookup();
121 void _vbeaf_linear_lookup_end();
124 void _ati_bank_end();
126 void _mach64_write_bank();
127 void _mach64_write_bank_end();
128 void _mach64_read_bank();
129 void _mach64_read_bank_end();
131 void _cirrus64_write_bank();
132 void _cirrus64_write_bank_end();
133 void _cirrus64_read_bank();
134 void _cirrus64_read_bank_end();
136 void _cirrus54_bank();
137 void _cirrus54_bank_end();
139 void _paradise_write_bank();
140 void _paradise_read_bank();
141 void _paradise_write_bank_end();
142 void _paradise_read_bank_end();
147 void _trident_bank();
148 void _trident_bank_end();
149 void _trident_read_bank();
150 void _trident_read_bank_end();
151 void _trident_write_bank();
152 void _trident_write_bank_end();
154 void _et3000_write_bank();
155 void _et3000_write_bank_end();
156 void _et3000_read_bank();
157 void _et3000_read_bank_end();
159 void _et4000_write_bank();
160 void _et4000_write_bank_end();
161 void _et4000_read_bank();
162 void _et4000_read_bank_end();
165 void _video7_bank_end();
168 /* stuff for the VESA and VBE/AF drivers */
169 extern __dpmi_regs _dpmi_reg;
171 extern int _window_2_offset;
173 extern void (*_pm_vesa_switcher)();
174 extern void (*_pm_vesa_scroller)();
175 extern void (*_pm_vesa_pallete)();
177 extern int _mmio_segment;
179 extern void *_af_driver;
181 extern int _af_active;
183 extern void *_af_set_bank;
184 extern void *_af_wait_till_idle;
185 extern void *_af_enable_direct_access;
188 /* stuff for setting up bitmaps */
189 long _vesa_vidmem_check(long mem);
192 /* sound lib stuff */
194 extern int _mpu_port;
200 int _sb_read_dsp_version();
201 int _sb_set_mixer(int digi_volume, int midi_volume);
203 int _dma_allocate_mem(int bytes, int *sel, unsigned long *phys);
204 void _dma_start(int channel, unsigned long addr, int size, int auto_init);
205 void _dma_stop(int channel);
206 unsigned long _dma_todo(int channel);
207 void _dma_lock_mem();
210 #endif /* ifndef INTERNDJ_H */