1/*****************************************************************************\
2 Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3 This file is licensed under the Snes9x License.
4 For further information, consult the LICENSE file in the root directory.
5\*****************************************************************************/
6
7#ifndef _MSU1_H_
8#define _MSU1_H_
9#include "snes9x.h"
10
11#define MSU1_REVISION 0x02
12
13struct SMSU1
14{
15 uint8 MSU1_STATUS;
16 uint32 MSU1_DATA_SEEK;
17 uint32 MSU1_DATA_POS;
18 uint16 MSU1_TRACK_SEEK;
19 uint16 MSU1_CURRENT_TRACK;
20 uint32 MSU1_RESUME_TRACK;
21 uint8 MSU1_VOLUME;
22 uint8 MSU1_CONTROL;
23 uint32 MSU1_AUDIO_POS;
24 uint32 MSU1_RESUME_POS;
25};
26
27enum SMSU1_FLAG {
28 Revision = 0x07, // bitmask, not the actual version number
29 AudioError = 0x08,
30 AudioPlaying = 0x10,
31 AudioRepeating = 0x20,
32 AudioBusy = 0x40,
33 DataBusy = 0x80
34};
35
36enum SMSU1_CMD {
37 Play = 0x01,
38 Repeat = 0x02,
39 Resume = 0x04
40};
41
42extern struct SMSU1 MSU1;
43
44void S9xResetMSU(void);
45void S9xMSU1Init(void);
46void S9xMSU1DeInit(void);
47bool S9xMSU1ROMExists(void);
48STREAM S9xMSU1OpenFile(const char *msu_ext, bool skip_unpacked = FALSE);
49void S9xMSU1Init(void);
50void S9xMSU1Generate(size_t sample_count);
51uint8 S9xMSU1ReadPort(uint8 port);
52void S9xMSU1WritePort(uint8 port, uint8 byte);
53size_t S9xMSU1Samples(void);
54class Resampler;
55void S9xMSU1SetOutput(Resampler *resampler);
56void S9xMSU1PostLoadState(void);
57
58#endif
59