-
Notifications
You must be signed in to change notification settings - Fork 4
/
pmp_mix.h
59 lines (49 loc) · 1.26 KB
/
pmp_mix.h
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
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "pmplay.h"
enum
{
Status_SetVol = 1,
Status_SetPan = 2,
Status_SetFrq = 4,
Status_StartTone = 8,
Status_StopTone = 16,
Status_QuickVol = 32,
SType_Fwd = 1,
SType_Rev = 2,
SType_RevDir = 4,
SType_Off = 8,
SType_16 = 16,
SType_Fadeout = 32
};
typedef struct
{
const void *SBase, *SRevBase;
uint8_t SType, SPan, SVol;
int32_t SLVol1, SRVol1, SLVol2, SRVol2, SLVolIP, SRVolIP, SVolIPLen;
int32_t SLen, SRepS, SRepL, SPos, SMixType;
uint32_t SPosDec, SFrq;
} CIType;
typedef struct
{
const void *SBase;
uint8_t Status, SType;
int16_t SVol, SPan;
int32_t SFrq, SLen, SRepS, SRepL, SStartPos;
} WaveChannelInfoType;
extern int16_t chnReloc[32];
extern int32_t *CDA_MixBuffer;
extern CIType CI[32 * 2];
void P_SetSpeed(uint16_t bpm);
void P_StartTone(sampleTyp *s, int32_t smpStartPos);
// 8bb: added these two
bool mix_Init(int32_t audioBufferSize);
void mix_Free(void);
// -------------------
void mix_ClearChannels(void);
void mix_UpdateBuffer(int16_t *buffer, int32_t numSamples);
bool dump_Init(int32_t frq, int32_t amp, int16_t songPos);
void dump_Close(void);
bool dump_EndOfTune(int32_t endSongPos);
int32_t dump_GetFrame(int16_t *p);