forked from retrofw/dingux-msx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemuadpcm.h
52 lines (39 loc) · 1.27 KB
/
emuadpcm.h
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
#ifndef _EMUADPCM_H_
#define _EMUADPCM_H_
#include "emutypes.h"
#ifdef EMU8950_ADPCM_DLL_EXPORTS
#define EMU8950_ADCPM_API __declspec(dllexport)
#elif EMU8950_ADPCM_DLL_IMPORTS
#define EMU8950_ADPCM_API __declspec(dllimport)
#else
#define EMU8950_ADPCM_API
#endif
typedef struct
{
e_uint8 reg[0x20];
e_uint8 *wave; /* ADPCM DATA */
e_uint8 *memory[2]; /* [0] RAM, [1] ROM */
e_uint8 status; /* STATUS Registar */
e_uint32 start_addr;
e_uint32 stop_addr;
e_uint32 play_addr; /* Current play address * 2 */
e_uint32 delta_addr; /* 16bit address */
e_uint32 delta_n;
e_uint32 play_addr_mask;
e_uint32 play_start;
e_int32 output[2];
e_uint32 diff;
void *timer1_user_data ;
void *timer2_user_data ;
void *(*timer1_func)(void *user) ;
void *(*timer2_func)(void *user) ;
} ADPCM ;
EMU8950_ADPCM_API void ADPCM_init(e_uint32 clk, e_uint32 rate);
EMU8950_ADPCM_API void ADPCM_close(void);
EMU8950_ADPCM_API ADPCM *ADPCM_new(void);
EMU8950_ADPCM_API void ADPCM_reset(ADPCM *);
EMU8950_ADPCM_API void ADPCM_delete(ADPCM *);
EMU8950_ADPCM_API void ADPCM_writeReg(ADPCM *, e_uint32 reg, e_uint32 val);
EMU8950_ADPCM_API e_int16 ADPCM_calc(ADPCM *);
EMU8950_ADPCM_API e_uint32 ADPCM_status(ADPCM *);
#endif