blob: 517714cb416fed7f7cb66e41551266fb0f4e7897 (
plain) (
blame)
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
62
63
64
|
// license:???
// copyright-holders:???
/***************************************************************************
okiadpcm.h
OKI ADCPM emulation.
***************************************************************************/
#pragma once
#ifndef __OKIADPCM_H__
#define __OKIADPCM_H__
// ======================> oki_adpcm_state
// Internal ADPCM state, used by external ADPCM generators with compatible specs to the OKIM 6295.
class oki_adpcm_state
{
public:
oki_adpcm_state() { compute_tables(); reset(); }
void reset();
INT16 clock(UINT8 nibble);
INT32 m_signal;
INT32 m_step;
private:
static const INT8 s_index_shift[8];
static int s_diff_lookup[49*16];
static void compute_tables();
static bool s_tables_computed;
};
// ======================> oki_adpcm2_state
// Internal ADPCM2 state, used by external ADPCM generators with compatible specs to the OKI MSM9810.
// TODO: not thoroughly tested: is the output 15 bit?
class oki_adpcm2_state
{
public:
oki_adpcm2_state() { compute_tables(); reset(); }
void reset();
INT16 clock(UINT8 nibble);
INT32 m_signal;
INT32 m_step;
private:
static const INT8 s_index_shift[8];
static int s_diff_lookup[49*16];
static void compute_tables();
static bool s_tables_computed;
};
#endif // __OKIADPCM_H__
|