ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <stdarg.h>
#include <string.h>
#include <malloc.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include "ahx_rpc.h"
Go to the source code of this file.
Macros | |
#define | IOP_MEM 0xbc000000 |
Functions | |
void | iop_readwrite (void *addr, void *buf, u32 size, u32 read) |
int | AHX_Init () |
int | AHX_Play () |
int | AHX_Pause () |
int | AHX_SubSong (int songNo) |
int | AHX_SetVolume (int volumePercentage) |
int | AHX_SetBoost (int boostValue) |
int | AHX_ToggleOversampling () |
int | AHX_Quit () |
int | AHX_LoadSongBuffer (char *songdata, int songsize) |
int | AHX_LoadSong (char *filename) |
Variables | |
static unsigned | sbuff [64] |
static struct t_SifRpcClientData | cd0 |
char * | songbuffer_addr |
int | ahx_init_done = 0 |
AHX EE-side RPC code.
Definition in file ahx_rpc.c.
int AHX_Init | ( | ) |
AHX Init
Sends a call the the loaded AHX IRX, telling it to set things up ready for loading a song.
Definition at line 48 of file ahx_rpc.c.
References AHX_INIT, ahx_init_done, AHX_IRX, cd0, NULL, sbuff, SifBindRpc(), SifCallRpc(), and songbuffer_addr.
int AHX_LoadSong | ( | char * | filename | ) |
AHX LongSongBuffer
This loads a song from disk etc. It loads the songdata into memory and passes it to LongSongBuffer.
Definition at line 191 of file ahx_rpc.c.
References AHX_LoadSongBuffer(), and buffer.
int AHX_LoadSongBuffer | ( | char * | songdata, |
int | songsize | ||
) |
AHX LongSongBuffer
This loads a song from a buffer in memory. It copies [songsize] bytes from [songdata] to the IOP memory song buffer.
Definition at line 167 of file ahx_rpc.c.
References AHX_IRX, AHX_LOADSONG, cd0, iop_readwrite(), NULL, sbuff, SifBindRpc(), SifCallRpc(), and songbuffer_addr.
Referenced by AHX_LoadSong().
int AHX_Pause | ( | ) |
AHX Pause
Sends a call the the loaded AHX IRX, telling it to pause the currently loaded song.
Definition at line 86 of file ahx_rpc.c.
References AHX_IRX, AHX_PAUSE, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_Play | ( | ) |
AHX Play
Sends a call the the loaded AHX IRX, telling it to play the currently loaded song.
Definition at line 73 of file ahx_rpc.c.
References AHX_IRX, AHX_PLAY, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_Quit | ( | ) |
AHX Quit
Sends a call the the loaded AHX IRX, telling it to quit. This frees up IOP mem, quites threads, deletes semaphores and all that jazz....
Definition at line 154 of file ahx_rpc.c.
References AHX_IRX, AHX_QUIT, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_SetBoost | ( | int | boostValue | ) |
AHX Set Boost
Sends a call the the loaded AHX IRX, telling it to change the output boost value. Boost value multiplies the level of the output for the AHX Mixer. A boost value of 1 is twice as load as a boost value of 0. A boost value of 3 is twice as load as 2 etc etc (ala DB)
Definition at line 127 of file ahx_rpc.c.
References AHX_IRX, AHX_SETBOOST, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_SetVolume | ( | int | volumePercentage | ) |
AHX Set Volume
Sends a call the the loaded AHX IRX, telling it to change the output volume of the SPU2. volumePercentage argument can range from 0 (0% silence) to 100 (100% full volume)
Definition at line 113 of file ahx_rpc.c.
References AHX_IRX, AHX_QUIT, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_SubSong | ( | int | songNo | ) |
AHX Play Subsong
Sends a call the the loaded AHX IRX, telling it to load subsong (songNo). You can determine the number of subsongs by checking the values returned by AHX_LoadSong() and AHX_LoadSongBuffer();
Definition at line 99 of file ahx_rpc.c.
References AHX_IRX, AHX_PAUSE, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
int AHX_ToggleOversampling | ( | ) |
AHX Toggle Oversampling
Switches oversampling on/off. Oversampling produces a smoother output sound but uses a lot more CPU power. It sounds nasty/slows down for a lot of songs - use with caution (or not at all)
Definition at line 141 of file ahx_rpc.c.
References AHX_IRX, AHX_OVERSAMPLING, cd0, NULL, sbuff, SifBindRpc(), and SifCallRpc().
Read/Write IOP Mem
This is an internal function used to read and write directly to IOP memory (write songdata to iop etc)
Definition at line 39 of file ahx_rpc.c.
References DI, ee_kmode_enter(), ee_kmode_exit(), EI, and IOP_MEM.
Referenced by AHX_LoadSongBuffer().
int ahx_init_done = 0 |
Definition at line 32 of file ahx_rpc.c.
Referenced by AHX_Init().
|
static |
Definition at line 27 of file ahx_rpc.c.
Referenced by AHX_Init(), AHX_LoadSongBuffer(), AHX_Pause(), AHX_Play(), AHX_Quit(), AHX_SetBoost(), AHX_SetVolume(), AHX_SubSong(), and AHX_ToggleOversampling().
|
static |
Definition at line 27 of file ahx_rpc.c.
Referenced by AHX_Init(), AHX_LoadSongBuffer(), AHX_Pause(), AHX_Play(), AHX_Quit(), AHX_SetBoost(), AHX_SetVolume(), AHX_SubSong(), and AHX_ToggleOversampling().
char* songbuffer_addr |
Definition at line 31 of file ahx_rpc.c.
Referenced by AHX_Init(), and AHX_LoadSongBuffer().