summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/libndsfpc/src/nds/arm9/sound.inc
blob: 6d0081d5d21ebe95e5bb3e8e62e608b6aa7fdc3d (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
51
52
53
54
55
56
57
58
59
{$ifdef NDS_INTERFACE}

type
  MicCallback = procedure(completedBuffer: pointer; length: cint);

  SoundFormat = integer;
const
  SoundFormat_8Bit  : SoundFormat = 0;
  SoundFormat_16Bit : SoundFormat = 1;
  SoundFormat_ADPCM : SoundFormat = 2;
  SoundFormat_PSG   : SoundFormat = 3;

type
  MicFormat = integer;
const
  MicFormat_12Bit : MicFormat = 0;
  MicFormat_8Bit  : MicFormat = 1;
  
type
  DutyCycle = integer;
const
  DutyCycle_12  : DutyCycle = 0;
  DutyCycle_25  : DutyCycle = 1;
  DutyCycle_37  : DutyCycle = 2;
  DutyCycle_50  : DutyCycle = 3;
  DutyCycle_62  : DutyCycle = 4;
  DutyCycle_75  : DutyCycle = 5;
  DutyCycle_87  : DutyCycle = 6;
  DutyCycle_0   : DutyCycle = 7;
  
procedure soundEnable(); cdecl; external;

procedure soundDisable(); cdecl; external;

function soundPlaySample(const data: pointer; format: SoundFormat; dataSize: cuint32; freq: cuint16; volume, pan: cuint8; loop: cbool; loopPoint: cuint16): cint; cdecl; external; 

function soundPlayPSG(cycle: DutyCycle; freq: cuint16; volume, pan: cuint8): cint; cdecl; external;

function soundPlayNoise(freq: cuint16; volume, pan: cuint8): cint; cdecl; external;

procedure soundPause(soundId: cint); cdecl; external;

procedure soundSetWaveDuty(soundId: cint; cycle: DutyCycle); cdecl; external;

procedure soundKill(soundId: cint); cdecl; external;

procedure soundResume(soundId: cint); cdecl; external;

procedure soundSetVolume(soundId: cint; volume: cuint8); cdecl; external;

procedure soundSetPan(soundId: cint; pan: cuint8); cdecl; external;

procedure soundSetFreq(soundId: cint; freq: cuint16); cdecl; external;

function soundMicRecord(buffer: pointer; bufferLength: cuint32; format: MicFormat; freq: cint; callback: MicCallback): cint; cdecl; external;

procedure soundMicOff(); cdecl; external;

{$endif NDS_INTERFACE}