Macros | |
| #define | SPU_ADDR *((unsigned short*)0x1f801da6) |
| PSXSDK. | |
| #define | SPU_DATA *((unsigned short*)0x1f801da8) |
| #define | SPU_CONTROL *((unsigned short*)0x1f801daa) |
| #define | SPU_STATUS *((unsigned short*)0x1f801dac) |
| #define | SPU_STATUS2 *((unsigned short*)0x1f801dae) |
| #define | SPU_MVOL_L *((unsigned short*)0x1f801d80) |
| #define | SPU_MVOL_R *((unsigned short*)0x1f801d82) |
| #define | SPU_REVERB_L *((unsigned short*)0x1f801d84) |
| #define | SPU_REVERB_R *((unsigned short*)0x1f801d86) |
| #define | SPU_KEY_ON1 *((unsigned short*)0x1f801d88) |
| #define | SPU_KEY_ON2 *((unsigned short*)0x1f801d8a) |
| #define | SPU_KEY_OFF1 *((unsigned short*)0x1f801d8c) |
| #define | SPU_KEY_OFF2 *((unsigned short*)0x1f801d8e) |
| #define | SPU_KEY_FM_MODE1 *((unsigned short*)0x1f801d90) |
| #define | SPU_KEY_FM_MODE2 *((unsigned short*)0x1f801d92) |
| #define | SPU_KEY_NOISE_MODE1 *((unsigned short*)0x1f801d94) |
| #define | SPU_KEY_NOISE_MODE2 *((unsigned short*)0x1f801d96) |
| #define | SPU_KEY_REVERB_MODE1 *((unsigned short*)0x1f801d98) |
| #define | SPU_KEY_REVERB_MODE2 *((unsigned short*)0x1f801d9a) |
| #define | SPU_CD_MVOL_L *((unsigned short*)0x1f801db0) |
| #define | SPU_CD_MVOL_R *((unsigned short*)0x1f801db2) |
| #define | SPU_EXT_VOL_L *((unsigned short*)0x1f801db4) |
| #define | SPU_EXT_VOL_R *((unsigned short*)0x1f801db6) |
| #define | SPU_REVERB_WORK_ADDR *((unsigned short*)0x1f801da2) |
| #define | SPU_VOICE_BASE_ADDR(x) (0x1f801c00 + (x<<4)) |
| #define | DPCR *((unsigned int*)0x1f8010f0) |
Functions | |
| void | SsVoiceVol (int voice, unsigned short left, unsigned short right) |
| Set voice volume. | |
| void | SsVoicePitch (int voice, unsigned short pitch) |
| Set voice pitch. | |
| void | SsVoiceStartAddr (int voice, unsigned int addr) |
| Set start Sound RAM address for voice. | |
| void | SsVoiceADSRRaw (int voice, unsigned short level, unsigned short rate) |
| Set ADSR level for voice. | |
| void | SsVoiceRepeatAddr (int voice, unsigned int addr) |
| Set repeat address for voice. | |
| void | SsKeyOn (int voice) |
| Set a voice to 'on'. | |
| void | SsKeyOff (int voice) |
| Set a voice to 'off'. | |
| void | SsKeyOnMask (int mask) |
| Set the voices specified by the bitmask to 'on'. | |
| void | SsKeyOffMask (int mask) |
| Set the voices specified by the bitmask to 'off'. | |
| void | SsWait () |
| Wait for the SPU to be ready. | |
| void | SsInit () |
| Intialize the SPU. | |
| void | SsUpload (void *addr, int size, int spu_addr) |
| Uploads sound data in PSX ADPCM format to Sound RAM. | |
| unsigned short | SsFreqToPitch (int hz) |
| Converts a sampling rate in hertz to PlayStation pitch rate used by the SPU. | |
| int | SsReadVag (SsVag *vag, void *data) |
| Reads information from a buffer containg a VAG file and stores it inside a SsVag structure. | |
| void | SsUploadVagEx (SsVag *vag, int spu_addr) |
| Uploads the sound data specified by a SsVag structure to the specified address in Sound RAM. | |
| void | SsUploadVag (SsVag *vag) |
| Uploads the sound data specified by a SsVag structure to Sound RAM, beginning from the base of usable Sound RAM and continuing from there, in an automatic fashion. | |
| void | SsPlayVag (SsVag *vag, unsigned char voice, unsigned short vl, unsigned short vr) |
| Plays the sound specified by the SsVag structure at specified voice and volume. | |
| void | SsStopVag (SsVag *vag) |
| Stops the sound specified by the SsVag structure. | |
| void | SsResetVagAddr () |
| Tell SsUploadVag() to start uploading from the base of usable Sound RAM again. | |
| void | SsEnableCd () |
| Enable CD Audio. | |
| void | SsEnableExt () |
| Enable External audio. | |
| void | SsCdVol (unsigned short left, unsigned short right) |
| Set CD Audio volume. | |
| #define DPCR *((unsigned int*)0x1f8010f0) |
| #define SPU_ADDR *((unsigned short*)0x1f801da6) |
PSXSDK.
Sound Processing Unit Functions Based on code from James Higgs's PSX lib and on code by bitmaster
| #define SPU_CD_MVOL_L *((unsigned short*)0x1f801db0) |
| #define SPU_CD_MVOL_R *((unsigned short*)0x1f801db2) |
| #define SPU_CONTROL *((unsigned short*)0x1f801daa) |
| #define SPU_DATA *((unsigned short*)0x1f801da8) |
| #define SPU_EXT_VOL_L *((unsigned short*)0x1f801db4) |
| #define SPU_EXT_VOL_R *((unsigned short*)0x1f801db6) |
| #define SPU_KEY_FM_MODE1 *((unsigned short*)0x1f801d90) |
| #define SPU_KEY_FM_MODE2 *((unsigned short*)0x1f801d92) |
| #define SPU_KEY_NOISE_MODE1 *((unsigned short*)0x1f801d94) |
| #define SPU_KEY_NOISE_MODE2 *((unsigned short*)0x1f801d96) |
| #define SPU_KEY_OFF1 *((unsigned short*)0x1f801d8c) |
| #define SPU_KEY_OFF2 *((unsigned short*)0x1f801d8e) |
| #define SPU_KEY_ON1 *((unsigned short*)0x1f801d88) |
| #define SPU_KEY_ON2 *((unsigned short*)0x1f801d8a) |
| #define SPU_KEY_REVERB_MODE1 *((unsigned short*)0x1f801d98) |
| #define SPU_KEY_REVERB_MODE2 *((unsigned short*)0x1f801d9a) |
| #define SPU_MVOL_L *((unsigned short*)0x1f801d80) |
| #define SPU_MVOL_R *((unsigned short*)0x1f801d82) |
| #define SPU_REVERB_L *((unsigned short*)0x1f801d84) |
| #define SPU_REVERB_R *((unsigned short*)0x1f801d86) |
| #define SPU_REVERB_WORK_ADDR *((unsigned short*)0x1f801da2) |
| #define SPU_STATUS *((unsigned short*)0x1f801dac) |
| #define SPU_STATUS2 *((unsigned short*)0x1f801dae) |
| #define SPU_VOICE_BASE_ADDR | ( | x | ) | (0x1f801c00 + (x<<4)) |
| void SsCdVol | ( | unsigned short | left, |
| unsigned short | right | ||
| ) |
Set CD Audio volume.
| left | Left channel volume |
| right | Right channel volume |
| void SsEnableCd | ( | void | ) |
Enable CD Audio.
| void SsEnableExt | ( | void | ) |
Enable External audio.
(???)
| unsigned short SsFreqToPitch | ( | int | hz | ) |
Converts a sampling rate in hertz to PlayStation pitch rate used by the SPU.
| hz | Sampling rate in hertz. |
| void SsInit | ( | void | ) |
Intialize the SPU.
| void SsKeyOff | ( | int | voice | ) |
Set a voice to 'off'.
This stops the sound specified for the voice.
| voice | Voice |
| void SsKeyOffMask | ( | int | mask | ) |
| void SsKeyOn | ( | int | voice | ) |
Set a voice to 'on'.
This has the effect of playing the sound specified for the voice.
| voice | Voice |
| void SsKeyOnMask | ( | int | mask | ) |
| void SsPlayVag | ( | SsVag * | vag, |
| unsigned char | voice, | ||
| unsigned short | vl, | ||
| unsigned short | vr | ||
| ) |
| int SsReadVag | ( | SsVag * | vag, |
| void * | data | ||
| ) |
Reads information from a buffer containg a VAG file and stores it inside a SsVag structure.
| vag | Pointer to structure in which to store information. |
| data | Pointer to VAG file data |
| void SsResetVagAddr | ( | void | ) |
Tell SsUploadVag() to start uploading from the base of usable Sound RAM again.
| void SsStopVag | ( | SsVag * | vag | ) |
| void SsUpload | ( | void * | addr, |
| int | size, | ||
| int | spu_addr | ||
| ) |
Uploads sound data in PSX ADPCM format to Sound RAM.
| addr | Pointer to PSX ADPCM sound data in main RAM |
| size | Sound data size |
| spu_addr | Destination address in Sound RAM (multiplier of 8). |
| void SsUploadVag | ( | SsVag * | vag | ) |
| void SsUploadVagEx | ( | SsVag * | vag, |
| int | spu_addr | ||
| ) |
Uploads the sound data specified by a SsVag structure to the specified address in Sound RAM.
The SsVag structure can then be used for playing with SsPlayVag()
| vag | Pointer to SsVag structure |
| spu_addr | Destination address in Sound RAM (multiplier of 8) |
| void SsVoiceADSRRaw | ( | int | voice, |
| unsigned short | level, | ||
| unsigned short | rate | ||
| ) |
Set ADSR level for voice.
| voice | Voice |
| level | ADSR level |
| rate | ADSR rate |
| void SsVoicePitch | ( | int | voice, |
| unsigned short | pitch | ||
| ) |
Set voice pitch.
| voice | Voice |
| pitch | Pitch. |
| void SsVoiceRepeatAddr | ( | int | voice, |
| unsigned int | addr | ||
| ) |
Set repeat address for voice.
| voice | Voice |
| addr | Address in Sound RAM (multiplier of 8) |
| void SsVoiceStartAddr | ( | int | voice, |
| unsigned int | addr | ||
| ) |
Set start Sound RAM address for voice.
| voice | Voice |
| addr | Start address in Sound RAM (multiplier of 8) |
| void SsVoiceVol | ( | int | voice, |
| unsigned short | left, | ||
| unsigned short | right | ||
| ) |
Set voice volume.
| voice | Voice number (0-23) |
| left | Left channel volume |
| right | Right channel volume |
| void SsWait | ( | void | ) |
Wait for the SPU to be ready.
1.8.2