LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_sound.h File Reference
#include "lms2012.h"
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  SOUND_GLOBALS
 

Macros

#define STEP_SIZE_TABLE_ENTRIES   89
 
#define INDEX_TABLE_ENTRIES   16
 
#define SND_LEVEL_1   13
 
#define SND_LEVEL_2   25
 
#define SND_LEVEL_3   38
 
#define SND_LEVEL_4   50
 
#define SND_LEVEL_5   63
 
#define SND_LEVEL_6   75
 
#define SND_LEVEL_7   88
 
#define TONE_LEVEL_1   8
 
#define TONE_LEVEL_2   16
 
#define TONE_LEVEL_3   24
 
#define TONE_LEVEL_4   32
 
#define TONE_LEVEL_5   40
 
#define TONE_LEVEL_6   48
 
#define TONE_LEVEL_7   56
 
#define TONE_LEVEL_8   64
 
#define TONE_LEVEL_9   72
 
#define TONE_LEVEL_10   80
 
#define TONE_LEVEL_11   88
 
#define TONE_LEVEL_12   96
 
#define FILEFORMAT_RAW_SOUND   0x0100
 
#define FILEFORMAT_ADPCM_SOUND   0x0101
 
#define SOUND_MODE_ONCE   0x00
 
#define SOUND_LOOP   0x01
 
#define SOUND_ADPCM_INIT_VALPREV   0x7F
 
#define SOUND_ADPCM_INIT_INDEX   20
 
#define SoundInstance   (*gSoundInstance)
 

Enumerations

enum  {
  SOUND_STOPPED, SOUND_SETUP_FILE, SOUND_FILE_PLAYING, SOUND_FILE_LOOPING,
  SOUND_TONE_PLAYING, SOUND_TONE_LOOPING
}
 

Functions

RESULT cSoundInit (void)
 
RESULT cSoundOpen (void)
 
RESULT cSoundUpdate (void)
 
RESULT cSoundClose (void)
 
RESULT cSoundExit (void)
 
void cSoundEntry (void)
 opSOUND byte code More...
 
void cSoundReady (void)
 opSOUND_READY byte code More...
 
void cSoundTest (void)
 opSOUND_TEST byte code More...
 
void setSoundInstance (SOUND_GLOBALS *_Instance)
 
SOUND_GLOBALSgetSoundInstance ()
 

Variables

enum { ... }  SOUND_STATES
 
const SWORD StepSizeTable [STEP_SIZE_TABLE_ENTRIES]
 
const SWORD IndexTable [INDEX_TABLE_ENTRIES]
 
SOUND_GLOBALSgSoundInstance
 

Macro Definition Documentation

#define FILEFORMAT_ADPCM_SOUND   0x0101

Definition at line 102 of file c_sound.h.

#define FILEFORMAT_RAW_SOUND   0x0100

Definition at line 101 of file c_sound.h.

#define INDEX_TABLE_ENTRIES   16

Definition at line 30 of file c_sound.h.

#define SND_LEVEL_1   13

Definition at line 44 of file c_sound.h.

#define SND_LEVEL_2   25

Definition at line 45 of file c_sound.h.

#define SND_LEVEL_3   38

Definition at line 46 of file c_sound.h.

#define SND_LEVEL_4   50

Definition at line 47 of file c_sound.h.

#define SND_LEVEL_5   63

Definition at line 48 of file c_sound.h.

#define SND_LEVEL_6   75

Definition at line 49 of file c_sound.h.

#define SND_LEVEL_7   88

Definition at line 50 of file c_sound.h.

#define SOUND_ADPCM_INIT_INDEX   20

Definition at line 106 of file c_sound.h.

#define SOUND_ADPCM_INIT_VALPREV   0x7F

Definition at line 105 of file c_sound.h.

#define SOUND_LOOP   0x01

Definition at line 104 of file c_sound.h.

#define SOUND_MODE_ONCE   0x00

Definition at line 103 of file c_sound.h.

#define SoundInstance   (*gSoundInstance)

Definition at line 139 of file c_sound.h.

#define STEP_SIZE_TABLE_ENTRIES   89

Definition at line 29 of file c_sound.h.

#define TONE_LEVEL_1   8

Definition at line 52 of file c_sound.h.

#define TONE_LEVEL_10   80

Definition at line 61 of file c_sound.h.

#define TONE_LEVEL_11   88

Definition at line 62 of file c_sound.h.

#define TONE_LEVEL_12   96

Definition at line 63 of file c_sound.h.

#define TONE_LEVEL_2   16

Definition at line 53 of file c_sound.h.

#define TONE_LEVEL_3   24

Definition at line 54 of file c_sound.h.

#define TONE_LEVEL_4   32

Definition at line 55 of file c_sound.h.

#define TONE_LEVEL_5   40

Definition at line 56 of file c_sound.h.

#define TONE_LEVEL_6   48

Definition at line 57 of file c_sound.h.

#define TONE_LEVEL_7   56

Definition at line 58 of file c_sound.h.

#define TONE_LEVEL_8   64

Definition at line 59 of file c_sound.h.

#define TONE_LEVEL_9   72

Definition at line 60 of file c_sound.h.

Enumeration Type Documentation

anonymous enum
Enumerator
SOUND_STOPPED 
SOUND_SETUP_FILE 
SOUND_FILE_PLAYING 
SOUND_FILE_LOOPING 
SOUND_TONE_PLAYING 
SOUND_TONE_LOOPING 

Definition at line 31 of file c_sound.h.

Function Documentation

RESULT cSoundClose ( void  )

Definition at line 114 of file c_sound.c.

void cSoundEntry ( void  )

opSOUND byte code

Definition at line 440 of file c_sound.c.

RESULT cSoundExit ( void  )

Definition at line 396 of file c_sound.c.

RESULT cSoundInit ( void  )

Definition at line 71 of file c_sound.c.

RESULT cSoundOpen ( void  )

Definition at line 105 of file c_sound.c.

void cSoundReady ( void  )

opSOUND_READY byte code

Definition at line 797 of file c_sound.c.

void cSoundTest ( void  )

opSOUND_TEST byte code

Definition at line 773 of file c_sound.c.

RESULT cSoundUpdate ( void  )

Definition at line 199 of file c_sound.c.

SOUND_GLOBALS* getSoundInstance ( )

Definition at line 60 of file c_sound.c.

void setSoundInstance ( SOUND_GLOBALS _Instance)

Definition at line 55 of file c_sound.c.

Variable Documentation

SOUND_GLOBALS* gSoundInstance

Definition at line 53 of file c_sound.c.

const SWORD IndexTable[INDEX_TABLE_ENTRIES]
Initial value:
= {
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8
}

Definition at line 79 of file c_sound.h.

enum { ... } SOUND_STATES
const SWORD StepSizeTable[STEP_SIZE_TABLE_ENTRIES]
Initial value:
= { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
}

Definition at line 68 of file c_sound.h.