2018-11-15 23:31:39 +00:00
|
|
|
/*****************************************************************************\
|
|
|
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
|
|
|
This file is licensed under the Snes9x License.
|
|
|
|
For further information, consult the LICENSE file in the root directory.
|
|
|
|
\*****************************************************************************/
|
2016-11-03 19:43:07 +00:00
|
|
|
|
2016-11-03 18:40:47 +00:00
|
|
|
#ifndef _MSU1_H_
|
|
|
|
#define _MSU1_H_
|
|
|
|
#include "snes9x.h"
|
|
|
|
|
2017-10-12 22:59:33 +00:00
|
|
|
#define MSU1_REVISION 0x02
|
|
|
|
|
2016-11-03 18:40:47 +00:00
|
|
|
struct SMSU1
|
|
|
|
{
|
|
|
|
uint8 MSU1_STATUS;
|
2016-11-07 19:03:37 +00:00
|
|
|
uint32 MSU1_DATA_SEEK;
|
|
|
|
uint32 MSU1_DATA_POS;
|
|
|
|
uint16 MSU1_TRACK_SEEK;
|
|
|
|
uint16 MSU1_CURRENT_TRACK;
|
|
|
|
uint32 MSU1_RESUME_TRACK;
|
2016-11-03 18:40:47 +00:00
|
|
|
uint8 MSU1_VOLUME;
|
|
|
|
uint8 MSU1_CONTROL;
|
2016-11-07 19:03:37 +00:00
|
|
|
uint32 MSU1_AUDIO_POS;
|
|
|
|
uint32 MSU1_RESUME_POS;
|
2016-11-03 18:40:47 +00:00
|
|
|
};
|
|
|
|
|
2016-11-14 19:09:47 +00:00
|
|
|
enum SMSU1_FLAG {
|
2017-10-12 22:59:33 +00:00
|
|
|
Revision = 0x07, // bitmask, not the actual version number
|
2016-11-03 18:40:47 +00:00
|
|
|
AudioError = 0x08,
|
2016-11-14 19:09:47 +00:00
|
|
|
AudioPlaying = 0x10,
|
|
|
|
AudioRepeating = 0x20,
|
2016-11-03 18:40:47 +00:00
|
|
|
AudioBusy = 0x40,
|
2016-11-14 19:09:47 +00:00
|
|
|
DataBusy = 0x80
|
2016-11-03 18:40:47 +00:00
|
|
|
};
|
|
|
|
|
2016-11-14 19:09:47 +00:00
|
|
|
enum SMSU1_CMD {
|
2016-11-07 19:03:37 +00:00
|
|
|
Play = 0x01,
|
|
|
|
Repeat = 0x02,
|
2016-11-14 19:09:47 +00:00
|
|
|
Resume = 0x04
|
2016-11-07 19:03:37 +00:00
|
|
|
};
|
|
|
|
|
2016-11-03 18:40:47 +00:00
|
|
|
extern struct SMSU1 MSU1;
|
|
|
|
|
2016-12-07 05:19:23 +00:00
|
|
|
void S9xResetMSU(void);
|
2016-11-03 18:40:47 +00:00
|
|
|
void S9xMSU1Init(void);
|
2017-10-13 22:08:39 +00:00
|
|
|
void S9xMSU1DeInit(void);
|
2016-12-07 05:19:23 +00:00
|
|
|
bool S9xMSU1ROMExists(void);
|
2017-09-09 11:17:55 +00:00
|
|
|
STREAM S9xMSU1OpenFile(const char *msu_ext, bool skip_unpacked = FALSE);
|
2016-11-03 18:40:47 +00:00
|
|
|
void S9xMSU1Init(void);
|
2017-07-06 00:01:07 +00:00
|
|
|
void S9xMSU1Generate(size_t sample_count);
|
|
|
|
uint8 S9xMSU1ReadPort(uint8 port);
|
|
|
|
void S9xMSU1WritePort(uint8 port, uint8 byte);
|
|
|
|
size_t S9xMSU1Samples(void);
|
2019-02-09 22:46:08 +00:00
|
|
|
class Resampler;
|
2019-02-09 18:03:34 +00:00
|
|
|
void S9xMSU1SetOutput(Resampler *resampler);
|
2016-11-07 19:03:37 +00:00
|
|
|
void S9xMSU1PostLoadState(void);
|
2016-11-03 18:40:47 +00:00
|
|
|
|
|
|
|
#endif
|