2018-11-16 00:31:39 +01: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 20:43:07 +01:00
|
|
|
|
2016-11-03 19:40:47 +01:00
|
|
|
#ifndef _MSU1_H_
|
|
|
|
#define _MSU1_H_
|
|
|
|
#include "snes9x.h"
|
|
|
|
|
2017-10-13 00:59:33 +02:00
|
|
|
#define MSU1_REVISION 0x02
|
|
|
|
|
2016-11-03 19:40:47 +01:00
|
|
|
struct SMSU1
|
|
|
|
{
|
|
|
|
uint8 MSU1_STATUS;
|
2016-11-07 20:03:37 +01:00
|
|
|
uint32 MSU1_DATA_SEEK;
|
|
|
|
uint32 MSU1_DATA_POS;
|
|
|
|
uint16 MSU1_TRACK_SEEK;
|
|
|
|
uint16 MSU1_CURRENT_TRACK;
|
|
|
|
uint32 MSU1_RESUME_TRACK;
|
2016-11-03 19:40:47 +01:00
|
|
|
uint8 MSU1_VOLUME;
|
|
|
|
uint8 MSU1_CONTROL;
|
2016-11-07 20:03:37 +01:00
|
|
|
uint32 MSU1_AUDIO_POS;
|
|
|
|
uint32 MSU1_RESUME_POS;
|
2016-11-03 19:40:47 +01:00
|
|
|
};
|
|
|
|
|
2016-11-14 20:09:47 +01:00
|
|
|
enum SMSU1_FLAG {
|
2017-10-13 00:59:33 +02:00
|
|
|
Revision = 0x07, // bitmask, not the actual version number
|
2016-11-03 19:40:47 +01:00
|
|
|
AudioError = 0x08,
|
2016-11-14 20:09:47 +01:00
|
|
|
AudioPlaying = 0x10,
|
|
|
|
AudioRepeating = 0x20,
|
2016-11-03 19:40:47 +01:00
|
|
|
AudioBusy = 0x40,
|
2016-11-14 20:09:47 +01:00
|
|
|
DataBusy = 0x80
|
2016-11-03 19:40:47 +01:00
|
|
|
};
|
|
|
|
|
2016-11-14 20:09:47 +01:00
|
|
|
enum SMSU1_CMD {
|
2016-11-07 20:03:37 +01:00
|
|
|
Play = 0x01,
|
|
|
|
Repeat = 0x02,
|
2016-11-14 20:09:47 +01:00
|
|
|
Resume = 0x04
|
2016-11-07 20:03:37 +01:00
|
|
|
};
|
|
|
|
|
2016-11-03 19:40:47 +01:00
|
|
|
extern struct SMSU1 MSU1;
|
|
|
|
|
2016-12-07 06:19:23 +01:00
|
|
|
void S9xResetMSU(void);
|
2016-11-03 19:40:47 +01:00
|
|
|
void S9xMSU1Init(void);
|
2017-10-14 00:08:39 +02:00
|
|
|
void S9xMSU1DeInit(void);
|
2016-12-07 06:19:23 +01:00
|
|
|
bool S9xMSU1ROMExists(void);
|
2017-09-09 13:17:55 +02:00
|
|
|
STREAM S9xMSU1OpenFile(const char *msu_ext, bool skip_unpacked = FALSE);
|
2016-11-03 19:40:47 +01:00
|
|
|
void S9xMSU1Init(void);
|
2017-07-06 02:01:07 +02:00
|
|
|
void S9xMSU1Generate(size_t sample_count);
|
|
|
|
uint8 S9xMSU1ReadPort(uint8 port);
|
|
|
|
void S9xMSU1WritePort(uint8 port, uint8 byte);
|
|
|
|
size_t S9xMSU1Samples(void);
|
|
|
|
void S9xMSU1SetOutput(int16 *out, size_t size);
|
2016-11-07 20:03:37 +01:00
|
|
|
void S9xMSU1PostLoadState(void);
|
2016-11-03 19:40:47 +01:00
|
|
|
|
|
|
|
#endif
|