diff options
Diffstat (limited to 'apps/plugins/sdl/progs/wolf3d/fmopl_gpl.h')
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/fmopl_gpl.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/apps/plugins/sdl/progs/wolf3d/fmopl_gpl.h b/apps/plugins/sdl/progs/wolf3d/fmopl_gpl.h new file mode 100644 index 0000000000..c340a17a7d --- /dev/null +++ b/apps/plugins/sdl/progs/wolf3d/fmopl_gpl.h | |||
@@ -0,0 +1,117 @@ | |||
1 | #ifndef __FMOPL_H_ | ||
2 | #define __FMOPL_H_ | ||
3 | |||
4 | #include "wl_def.h" | ||
5 | |||
6 | #define HAS_YM3812 1 | ||
7 | |||
8 | /* --- select emulation chips --- */ | ||
9 | #define BUILD_YM3812 (HAS_YM3812) | ||
10 | #define BUILD_YM3526 (HAS_YM3526) | ||
11 | #define BUILD_Y8950 (HAS_Y8950) | ||
12 | |||
13 | /* select output bits size of output : 8 or 16 */ | ||
14 | #define OPL_SAMPLE_BITS 16 | ||
15 | |||
16 | /* compiler dependence */ | ||
17 | #ifndef OSD_CPU_H | ||
18 | #define OSD_CPU_H | ||
19 | typedef unsigned char UINT8; /* unsigned 8bit */ | ||
20 | typedef unsigned short UINT16; /* unsigned 16bit */ | ||
21 | typedef unsigned int UINT32; /* unsigned 32bit */ | ||
22 | typedef signed char INT8; /* signed 8bit */ | ||
23 | typedef signed short INT16; /* signed 16bit */ | ||
24 | typedef signed int INT32; /* signed 32bit */ | ||
25 | #endif | ||
26 | |||
27 | #if (OPL_SAMPLE_BITS==16) | ||
28 | typedef INT16 OPLSAMPLE; | ||
29 | #endif | ||
30 | #if (OPL_SAMPLE_BITS==8) | ||
31 | typedef INT8 OPLSAMPLE; | ||
32 | #endif | ||
33 | |||
34 | |||
35 | typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec); | ||
36 | typedef void (*OPL_IRQHANDLER)(int param,int irq); | ||
37 | typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us); | ||
38 | typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data); | ||
39 | typedef unsigned char (*OPL_PORTHANDLER_R)(int param); | ||
40 | |||
41 | |||
42 | #if BUILD_YM3812 | ||
43 | |||
44 | |||
45 | typedef void device_t; | ||
46 | void *YM3812Init(device_t *junk, UINT32 clock, UINT32 rate); | ||
47 | void YM3812Shutdown(void *chip); | ||
48 | void YM3812ResetChip(void *chip); | ||
49 | int YM3812Write(void *chip, int a, int v); | ||
50 | unsigned char YM3812Read(void *chip, int a); | ||
51 | void YM3812Mute(void *chip,int channel,bool mute); | ||
52 | int YM3812TimerOver(void *chip, int c); | ||
53 | void YM3812UpdateOne(void *chip, INT16 *buffer, int length); | ||
54 | |||
55 | // not used | ||
56 | //void YM3812SetTimerHandler(void *chip, OPL_TIMERHANDLER TimerHandler, int channelOffset); | ||
57 | //void YM3812SetIRQHandler(void *chip, OPL_IRQHANDLER IRQHandler, int param); | ||
58 | //void YM3812SetUpdateHandler(void *chip, OPL_UPDATEHANDLER UpdateHandler, int param); | ||
59 | |||
60 | #endif | ||
61 | |||
62 | |||
63 | #if BUILD_YM3526 | ||
64 | |||
65 | /* | ||
66 | ** Initialize YM3526 emulator(s). | ||
67 | ** | ||
68 | ** 'num' is the number of virtual YM3526's to allocate | ||
69 | ** 'clock' is the chip clock in Hz | ||
70 | ** 'rate' is sampling rate | ||
71 | */ | ||
72 | int YM3526Init(int num, int clock, int rate); | ||
73 | /* shutdown the YM3526 emulators*/ | ||
74 | void YM3526Shutdown(void); | ||
75 | void YM3526ResetChip(int which); | ||
76 | int YM3526Write(int which, int a, int v); | ||
77 | unsigned char YM3526Read(int which, int a); | ||
78 | int YM3526TimerOver(int which, int c); | ||
79 | /* | ||
80 | ** Generate samples for one of the YM3526's | ||
81 | ** | ||
82 | ** 'which' is the virtual YM3526 number | ||
83 | ** '*buffer' is the output buffer pointer | ||
84 | ** 'length' is the number of samples that should be generated | ||
85 | */ | ||
86 | void YM3526UpdateOne(int which, INT16 *buffer, int length); | ||
87 | |||
88 | void YM3526SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset); | ||
89 | void YM3526SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param); | ||
90 | void YM3526SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param); | ||
91 | |||
92 | #endif | ||
93 | |||
94 | |||
95 | #if BUILD_Y8950 | ||
96 | |||
97 | /* Y8950 port handlers */ | ||
98 | void Y8950SetPortHandler(int which, OPL_PORTHANDLER_W PortHandler_w, OPL_PORTHANDLER_R PortHandler_r, int param); | ||
99 | void Y8950SetKeyboardHandler(int which, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, int param); | ||
100 | void Y8950SetDeltaTMemory(int which, void * deltat_mem_ptr, int deltat_mem_size ); | ||
101 | |||
102 | int Y8950Init (int num, int clock, int rate); | ||
103 | void Y8950Shutdown (void); | ||
104 | void Y8950ResetChip (int which); | ||
105 | int Y8950Write (int which, int a, int v); | ||
106 | unsigned char Y8950Read (int which, int a); | ||
107 | int Y8950TimerOver (int which, int c); | ||
108 | void Y8950UpdateOne (int which, INT16 *buffer, int length); | ||
109 | |||
110 | void Y8950SetTimerHandler (int which, OPL_TIMERHANDLER TimerHandler, int channelOffset); | ||
111 | void Y8950SetIRQHandler (int which, OPL_IRQHANDLER IRQHandler, int param); | ||
112 | void Y8950SetUpdateHandler (int which, OPL_UPDATEHANDLER UpdateHandler, int param); | ||
113 | |||
114 | #endif | ||
115 | |||
116 | |||
117 | #endif /* __FMOPL_H_ */ | ||