2008-12-08 04:46:09 +00:00
|
|
|
//__________________________________________________________________________________________________
|
|
|
|
// Common dsp plugin spec, version #1.0 maintained by F|RES
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _DSP_H_INCLUDED__
|
|
|
|
#define _DSP_H_INCLUDED__
|
|
|
|
|
|
|
|
#include "PluginSpecs.h"
|
|
|
|
#include "ExportProlog.h"
|
|
|
|
|
2008-12-13 16:58:06 +00:00
|
|
|
typedef unsigned char (*TARAM_Read_U8)(const unsigned int _uAddress);
|
2009-06-21 08:39:21 +00:00
|
|
|
typedef void (*TARAM_Write_U8)(const unsigned char _uValue, const unsigned int _uAddress);
|
2008-12-13 16:58:06 +00:00
|
|
|
typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _uAddress);
|
|
|
|
typedef unsigned char* (*TGetARAMPointer)(void);
|
|
|
|
typedef void (*TLogv)(const char* _szMessage, int _v);
|
|
|
|
typedef const char* (*TName)(void);
|
|
|
|
typedef void (*TDebuggerBreak)(void);
|
|
|
|
typedef void (*TGenerateDSPInt)(void);
|
2009-12-23 15:34:14 +00:00
|
|
|
typedef unsigned int (*TAudioGetStreaming)(short* _pDestBuffer, unsigned int _numSamples, unsigned int _sampleRate);
|
2009-12-25 11:59:04 +00:00
|
|
|
typedef void (*TGetSampleRate)(unsigned int &AISampleRate, unsigned int &DACSampleRate);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-01-20 18:42:01 +00:00
|
|
|
void *hWnd;
|
2008-12-08 04:46:09 +00:00
|
|
|
TARAM_Read_U8 pARAM_Read_U8;
|
2009-06-21 08:39:21 +00:00
|
|
|
TARAM_Write_U8 pARAM_Write_U8;
|
2008-12-08 04:46:09 +00:00
|
|
|
TGetMemoryPointer pGetMemoryPointer;
|
|
|
|
TGetARAMPointer pGetARAMPointer;
|
|
|
|
TLogv pLog;
|
|
|
|
TName pName;
|
|
|
|
TDebuggerBreak pDebuggerBreak;
|
|
|
|
TGenerateDSPInt pGenerateDSPInterrupt;
|
|
|
|
TAudioGetStreaming pGetAudioStreaming;
|
2009-12-23 15:34:14 +00:00
|
|
|
TGetSampleRate pGetSampleRate;
|
2009-01-20 18:42:01 +00:00
|
|
|
int *pEmulatorState;
|
2009-02-02 20:05:24 +00:00
|
|
|
bool bWii;
|
2009-04-08 20:26:33 +00:00
|
|
|
bool bOnThread;
|
2008-12-08 04:46:09 +00:00
|
|
|
} DSPInitialize;
|
|
|
|
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_ReadMailboxHigh
|
|
|
|
// Purpose: Send mail to high DSP Mailbox
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT unsigned short CALL DSP_ReadMailboxHigh(bool _CPUMailbox);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_ReadMailboxLow
|
|
|
|
// Purpose: Send mail to low DSP Mailbox
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT unsigned short CALL DSP_ReadMailboxLow(bool _CPUMailbox);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_WriteMailboxHigh
|
|
|
|
// Purpose: Send mail to high CPU Mailbox
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL DSP_WriteMailboxHigh(bool _CPUMailbox, unsigned short _uHighMail);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_WriteMailboxLow
|
|
|
|
// Purpose: Send mail to low CPU Mailbox
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL DSP_WriteMailboxLow(bool _CPUMailbox, unsigned short _uLowMail);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_WriteControlRegister
|
|
|
|
// Purpose: This function is called if the core reads from the DSP control register
|
|
|
|
// input: Value to be written
|
|
|
|
// output: value of the control register
|
|
|
|
//
|
|
|
|
EXPORT unsigned short CALL DSP_WriteControlRegister(unsigned short _Value);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_ReadControlRegister
|
|
|
|
// Purpose: This function is called if the core reads from the DSP control register
|
|
|
|
// output: value of the control register
|
|
|
|
//
|
|
|
|
EXPORT unsigned short CALL DSP_ReadControlRegister(void);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_Update
|
|
|
|
// Purpose: This function is called from time to time from the core.
|
|
|
|
// input: cycles - run this number of DSP clock cycles.
|
|
|
|
// output: TRUE if the flag is set, else FALSE
|
|
|
|
//
|
|
|
|
EXPORT void CALL DSP_Update(int cycles);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_SendAIBuffer
|
|
|
|
// Purpose: This function sends the current AI Buffer to the DSP plugin
|
|
|
|
// input: _Address : Memory-Address
|
2009-12-23 15:34:14 +00:00
|
|
|
// input: _Number : Number of the Samples
|
2008-12-08 04:46:09 +00:00
|
|
|
//
|
2009-12-25 11:59:04 +00:00
|
|
|
EXPORT void CALL DSP_SendAIBuffer(unsigned int address, unsigned int num_samples);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-02-20 22:04:52 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_StopSoundStream
|
|
|
|
// Purpose: Stops audio playback. Must be called before Shutdown().
|
|
|
|
EXPORT void CALL DSP_StopSoundStream();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-11-07 20:01:39 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DSP_ClearAudioBuffer
|
|
|
|
// Purpose: Stops audio. Called while pausing to stop the annoying noises.
|
2010-01-13 14:18:13 +00:00
|
|
|
EXPORT void CALL DSP_ClearAudioBuffer(bool mute);
|
2009-11-07 20:01:39 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#include "ExportEpilog.h"
|
|
|
|
#endif
|