3 //#include "attotime.h"
\r
5 /* --- select emulation chips --- */
\r
6 //#define BUILD_YM3812 (HAS_YM3812)
\r
7 //#define BUILD_YM3526 (HAS_YM3526)
\r
8 //#define BUILD_Y8950 (HAS_Y8950)
\r
9 #define BUILD_YM3812 1
\r
10 #define BUILD_YM3526 0
\r
11 #define BUILD_Y8950 0
\r
13 /* select output bits size of output : 8 or 16 */
\r
14 #define OPL_SAMPLE_BITS 16
\r
16 /* compiler dependence */
\r
17 /*#ifndef __OSDCOMM_H__
\r
18 #define __OSDCOMM_H__
\r
19 typedef unsigned char UINT8; // unsigned 8bit
\r
20 typedef unsigned short UINT16; // unsigned 16bit
\r
21 typedef unsigned int UINT32; // unsigned 32bit
\r
22 typedef signed char INT8; // signed 8bit
\r
23 typedef signed short INT16; // signed 16bit
\r
24 typedef signed int INT32; // signed 32bit
\r
25 #endif*/ /* __OSDCOMM_H__ */
\r
27 typedef stream_sample_t OPLSAMPLE;
\r
29 #if (OPL_SAMPLE_BITS==16)
\r
30 typedef INT16 OPLSAMPLE;
\r
32 #if (OPL_SAMPLE_BITS==8)
\r
33 typedef INT8 OPLSAMPLE;
\r
37 //typedef void (*OPL_TIMERHANDLER)(void *param,int timer,attotime period);
\r
38 typedef void (*OPL_TIMERHANDLER)(void *param,int timer,int period);
\r
39 typedef void (*OPL_IRQHANDLER)(void *param,int irq);
\r
40 typedef void (*OPL_UPDATEHANDLER)(void *param/*,int min_interval_us*/);
\r
41 typedef void (*OPL_PORTHANDLER_W)(void *param,unsigned char data);
\r
42 typedef unsigned char (*OPL_PORTHANDLER_R)(void *param);
\r
47 void *ym3812_init(UINT32 clock, UINT32 rate);
\r
48 void ym3812_shutdown(void *chip);
\r
49 void ym3812_reset_chip(void *chip);
\r
50 int ym3812_write(void *chip, int a, int v);
\r
51 unsigned char ym3812_read(void *chip, int a);
\r
52 int ym3812_timer_over(void *chip, int c);
\r
53 void ym3812_update_one(void *chip, OPLSAMPLE **buffer, int length);
\r
55 void ym3812_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
\r
56 void ym3812_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
\r
57 void ym3812_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
\r
59 #endif /* BUILD_YM3812 */
\r
65 ** Initialize YM3526 emulator(s).
\r
67 ** 'num' is the number of virtual YM3526's to allocate
\r
68 ** 'clock' is the chip clock in Hz
\r
69 ** 'rate' is sampling rate
\r
71 void *ym3526_init(UINT32 clock, UINT32 rate);
\r
72 /* shutdown the YM3526 emulators*/
\r
73 void ym3526_shutdown(void *chip);
\r
74 void ym3526_reset_chip(void *chip);
\r
75 int ym3526_write(void *chip, int a, int v);
\r
76 unsigned char ym3526_read(void *chip, int a);
\r
77 int ym3526_timer_over(void *chip, int c);
\r
79 ** Generate samples for one of the YM3526's
\r
81 ** 'which' is the virtual YM3526 number
\r
82 ** '*buffer' is the output buffer pointer
\r
83 ** 'length' is the number of samples that should be generated
\r
85 void ym3526_update_one(void *chip, OPLSAMPLE **buffer, int length);
\r
87 void ym3526_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
\r
88 void ym3526_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
\r
89 void ym3526_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
\r
91 #endif /* BUILD_YM3526 */
\r
96 /* Y8950 port handlers */
\r
97 void y8950_set_port_handler(void *chip, OPL_PORTHANDLER_W PortHandler_w, OPL_PORTHANDLER_R PortHandler_r, void *param);
\r
98 void y8950_set_keyboard_handler(void *chip, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, void *param);
\r
99 void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size );
\r
100 void y8950_write_pcmrom(void *chip, offs_t ROMSize, offs_t DataStart,
\r
101 offs_t DataLength, const UINT8* ROMData);
\r
103 void * y8950_init(UINT32 clock, UINT32 rate);
\r
104 void y8950_shutdown(void *chip);
\r
105 void y8950_reset_chip(void *chip);
\r
106 int y8950_write(void *chip, int a, int v);
\r
107 unsigned char y8950_read (void *chip, int a);
\r
108 int y8950_timer_over(void *chip, int c);
\r
109 void y8950_update_one(void *chip, OPLSAMPLE **buffer, int length);
\r
111 void y8950_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
\r
112 void y8950_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
\r
113 void y8950_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
\r
115 #endif /* BUILD_Y8950 */
\r
117 void opl_set_mute_mask(void *chip, UINT32 MuteMask);
\r