Go to the source code of this file.
Flags for MODLoad.
- Enumerator:
MODLOAD_NOSAMPLES |
Do not load the samples in memory.
|
Format identification IDs.
- Enumerator:
-
int MOD4PSX_Upload |
( |
void * |
d, |
|
|
int |
base_addr |
|
) |
| |
Upload preconverted ADPCM samples, as generated by the mod4psx tool.
- Parameters
-
d | Pointer to buffer containing the ADPCM samples archive |
base_addr | Base address at which the samples will start to be uploaded. |
- Returns
- The sound address after all the uploaded samples
Just like MODLoadEx() but with the flags parameters set to zero, i.e.
default behaviour.
- Parameters
-
d | Pointer to a buffer containing a music module file |
- Returns
- Pointer to newly allocated ModMusic structure.
ModMusic* MODLoadEx |
( |
void * |
d, |
|
|
unsigned int |
flags |
|
) |
| |
Allocate a ModMusic structure and copy data to it from data in memory containing a music module file.
Almost all data from the music module file is copied into another location in memory for the ModMusic structure.
This means your free memory should be roughly the double of the size of the MOD you're loading.
You can avoid loading the samples in the module file's native format, thus saving useful memory, by passing the MODLOAD_NOSAMPLES flag. This is especially the case when you use MOD4PSX_Upload().
- Parameters
-
d | Pointer to a buffer containing a music module file |
flags | Flag bitmask. |
- Returns
- Pointer to newly allocated ModMusic structure.
Play a tick of a music.
This has to be called 60 / 50 times per second.
MODPlay decreases the value referenced by t every time the music finishes.
Set the variable pointed by t when you want to set the number of times again!
- Parameters
-
m | Pointer to ModMusic structure |
t | Pointer to an int which contains how many times the music module has to be played. i.e. if *t == 1, play once, if *t == 2, play twice, ..., if *t == -1, loop endlessly |
Rewind music, that is, make it restart from the beginning.
- Parameters
-
m | Pointer to ModMusic structure for the music. |
void MODSetBaseVoice |
( |
int |
base_voice | ) |
|
Sets the SPU voice to use as the first channel when playing music.
The voice for the second channel will then be this (value+1), and so on...
Usually the base voice is 0; a MOD file can have up to eight channels, so take care of that.
A 669 file can always have 8 channels.
- Parameters
-
base_voice | Desired base voice (0-23) |
void MODSetMaxVolume |
( |
unsigned short |
max_volume | ) |
|
Set maximum volume for MODPlay.
- Parameters
-
max_volume | Maximum volume desired (0-0x3FFF) |
void MODSetMono |
( |
int |
value | ) |
|
Set mono mode.
- Parameters
-
value | If 0 set stereo mode, if 1 set mono mode |
void MODSetTranspose |
( |
ModMusic * |
m, |
|
|
short |
transpose |
|
) |
| |
Sets transpose for music.
Changing the transpose value for a music shifts the frequency its samples are played at, but the music's tempo is unchanged.
- Parameters
-
m | Pointer to ModMusic structure |
transpose | Transpose value |
Stop a music.
- Parameters
-
m | Pointer to ModMusic structure for the music. |
Free memory allocated for music module.
- Parameters
-
int MODUploadSamples |
( |
ModMusic * |
m, |
|
|
int |
base_addr |
|
) |
| |
Upload the samples of the module music to Sound RAM.
- Parameters
-
m | Pointer to ModMusic structure for the music. |
base_addr | Sound RAM address to start from when uploading to Sound RAM If -1 it is interpreted to be the same as the start of the section for sound data in Sound RAM (SPU_DATA_BASE_ADDR). base_addr must be a multiply of 8. |
- Returns
- The sound address after all the uploaded samples