summaryrefslogtreecommitdiff
path: root/include/nw4r/snd/snd_adpcm.h
blob: bea2b73721f8e295ef4c97cc2c903c1fe48838b7 (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
#ifndef NW4R_SND_ADPCM_H
#define NW4R_SND_ADPCM_H

/*******************************************************************************
 * headers
 */

#include "common.h"

#include <rvl/AX/AXVPB.h> // AXPBADPCM

/*******************************************************************************
 * types
 */

namespace nw4r { namespace snd { // namespace detail
// {
	// Why are these just the AX types

	// [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x291b3
	struct AdpcmParam // AXPBADPCM
	{
		u16	coef[8 * 2];	// size 0x20, offset 0x00
		u16	gain;			// size 0x02, offset 0x20
		u16	pred_scale;		// size 0x02, offset 0x22
		u16	yn1;			// size 0x02, offset 0x24
		u16	yn2;			// size 0x02, offset 0x26
	}; // size 0x28
namespace detail
{
	// [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x29290
	struct AdpcmLoopParam // AXPBADPCMLOOP
	{
		u16	loop_pred_scale;	// size 0x02, offset 0x00
		u16	loop_yn1;			// size 0x02, offset 0x02
		u16	loop_yn2;			// size 0x02, offset 0x04
	}; // size 0x06
}
}} // namespace nw4r::snd // ::detail

/*******************************************************************************
 * classes and functions
 */

namespace nw4r { namespace snd { namespace detail
{
	s16 DecodeDspAdpcm(AXPBADPCM *adpcm, byte_t bits);
}}} // namespace nw4r::snd::detail

#endif // NW4R_SND_ADPCM_H