summaryrefslogtreecommitdiff
path: root/plugins/gme/game-music-emu-0.6pre/gme/ym2413.h
blob: 679db3525720bab1771cf70fc5e1eb978bbb4719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once

#ifndef __YM2413_H__
#define __YM2413_H__

#ifdef __cplusplus
extern "C" {
#endif

/* select output bits size of output : 8 or 16 */
#define SAMPLE_BITS 16

/* compiler dependence */
#ifndef __OSDCOMM_H__
#define __OSDCOMM_H__
typedef unsigned char	UINT8;   /* unsigned  8bit */
typedef unsigned short	UINT16;  /* unsigned 16bit */
typedef unsigned int	UINT32;  /* unsigned 32bit */
typedef signed char		INT8;    /* signed  8bit   */
typedef signed short	INT16;   /* signed 16bit   */
typedef signed int		INT32;   /* signed 32bit   */

typedef INT32           stream_sample_t;
#endif

typedef stream_sample_t SAMP;
/*
#if (SAMPLE_BITS==16)
typedef INT16 SAMP;
#endif
#if (SAMPLE_BITS==8)
typedef INT8 SAMP;
#endif
*/



void *ym2413_init(int clock, int rate, int type);
void ym2413_shutdown(void *chip);
void ym2413_reset_chip(void *chip);
void ym2413_write(void *chip, int a, int v);
unsigned char ym2413_read(void *chip, int a);
void ym2413_update_one(void *chip, SAMP **buffers, int length);

void ym2413_advance_lfo(void *chip);    /* call this once */
SAMP ym2413_calcch(void *chip, int ch); /* then call this for each channel */
void ym2413_advance(void *chip);        /* then call this */

void * ym2413_get_inst0(void *chip);

void ym2413_set_mask(void *chip, UINT32 mask);

typedef void (*OPLL_UPDATEHANDLER)(void *param,int min_interval_us);

void ym2413_set_update_handler(void *chip, OPLL_UPDATEHANDLER UpdateHandler, void *param);

#ifdef __cplusplus
}
#endif

#endif /*__YM2413_H__*/