Update Audio_1.1.h

Fix comments
This commit is contained in:
Derek "Turtle" Roe 2021-03-27 03:48:29 -05:00
parent d8503d659a
commit 4ee3ab59da
1 changed files with 68 additions and 59 deletions

View File

@ -1,14 +1,12 @@
/********************************************************************************** // Common audio plugin spec, version 1.1
Common Audio plugin spec, version #1.1
**********************************************************************************
Notes:
------
Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which /*
Notes:
Setting the appropriate bits in the MI_INTR_REG and calling CheckInterrupts which
are both passed to the DLL in InitiateAudio will generate an Interrupt from with in are both passed to the DLL in InitiateAudio will generate an Interrupt from with in
the plugin. the plugin.
*/
**********************************************************************************/
#pragma once #pragma once
#include <Common/stdtypes.h> #include <Common/stdtypes.h>
@ -32,20 +30,21 @@ enum
enum enum
{ {
AI_STATUS_FIFO_FULL = 0x80000000, /* Bit 31: full */ AI_STATUS_FIFO_FULL = 0x80000000, // Bit 31: full
AI_STATUS_DMA_BUSY = 0x40000000, /* Bit 30: busy */ AI_STATUS_DMA_BUSY = 0x40000000, // Bit 30: busy
MI_INTR_AI = 0x04, /* Bit 2: AI intr */ MI_INTR_AI = 0x04, // Bit 2: AI INTR
AI_CONTROL_DMA_ON = 0x01, AI_CONTROL_DMA_ON = 0x01,
AI_CONTROL_DMA_OFF = 0x00, AI_CONTROL_DMA_OFF = 0x00,
}; };
/***** Structures *****/ // Structures
typedef struct typedef struct
{ {
uint16_t Version; /* Should be set to 0x0101 */ uint16_t Version; // Should be set to 0x0101
uint16_t Type; /* Set to PLUGIN_TYPE_AUDIO */ uint16_t Type; // Set to PLUGIN_TYPE_AUDIO
char Name[100]; /* Name of the DLL */ char Name[100]; // Name of the DLL
int32_t NormalMemory; int32_t NormalMemory;
int32_t MemoryBswaped; int32_t MemoryBswaped;
} PLUGIN_INFO; } PLUGIN_INFO;
@ -55,12 +54,10 @@ typedef struct
void * hwnd; void * hwnd;
void * hinst; void * hinst;
int32_t MemoryBswaped; // If this is set to TRUE, then the memory has been pre int32_t MemoryBswaped; // If this is set to TRUE, then the memory has been pre-bswap'd on a DWORD (32-bit) boundary
// bswap on a dword (32 bits) boundry
// eg. the first 8 bytes are stored like this: // eg. the first 8 bytes are stored like this:
// 4 3 2 1 8 7 6 5 // 4 3 2 1 8 7 6 5
uint8_t * HEADER; // This is the rom header (first 40h bytes of the rom uint8_t * HEADER; // This is the ROM header (first 40h bytes of the ROM)
// This will be in the same memory format as the rest of the memory. // This will be in the same memory format as the rest of the memory.
uint8_t * RDRAM; uint8_t * RDRAM;
uint8_t * DMEM; uint8_t * DMEM;
@ -78,127 +75,139 @@ typedef struct
void(CALL *CheckInterrupts)(void); void(CALL *CheckInterrupts)(void);
} AUDIO_INFO; } AUDIO_INFO;
/****************************************************************** /*
Function: AiDacrateChanged Function: AiDacrateChanged
Purpose: This function is called to notify the dll that the Purpose: This function is called to notify the DLL that the
AiDacrate registers value has been changed. AiDacrate registers value has been changed.
input: The System type: input: The System type:
SYSTEM_NTSC 0 SYSTEM_NTSC 0
SYSTEM_PAL 1 SYSTEM_PAL 1
SYSTEM_MPAL 2 SYSTEM_MPAL 2
output: none output: none
*******************************************************************/ */
EXPORT void CALL AiDacrateChanged(int32_t SystemType); EXPORT void CALL AiDacrateChanged(int32_t SystemType);
/****************************************************************** /*
Function: AiLenChanged Function: AiLenChanged
Purpose: This function is called to notify the dll that the Purpose: This function is called to notify the DLL that the
AiLen registers value has been changed. AiLen registers value has been changed.
input: none input: none
output: none output: none
*******************************************************************/ */
EXPORT void CALL AiLenChanged(void); EXPORT void CALL AiLenChanged(void);
/****************************************************************** /*
Function: AiReadLength Function: AiReadLength
Purpose: This function is called to allow the dll to return the Purpose: This function is called to allow the DLL to return the
value that AI_LEN_REG should equal value that AI_LEN_REG should equal
input: none input: none
output: The amount of bytes still left to play. output: The amount of bytes still left to play.
*******************************************************************/ */
EXPORT uint32_t CALL AiReadLength(void); EXPORT uint32_t CALL AiReadLength(void);
/****************************************************************** /*
Function: AiUpdate Function: AiUpdate
Purpose: This function is called to allow the dll to update Purpose: This function is called to allow the DLL to update
things on a regular basis (check how long to sound to things on a regular basis (check how long to sound to
go, copy more stuff to the buffer, anyhting you like). go, copy more stuff to the buffer, anything you like).
The function is designed to go in to the message loop The function is designed to go in to the message loop
of the main window ... but can be placed anywhere you of the main window...but can be placed anywhere you
like. like.
input: if Wait is set to true, then this function should wait input: if Wait is set to true, then this function should wait
till there is a messgae in the its message queue. till there is a message in its message queue.
output: none output: none
*******************************************************************/ */
EXPORT void CALL AiUpdate(int32_t Wait); EXPORT void CALL AiUpdate(int32_t Wait);
/****************************************************************** /*
Function: CloseDLL Function: CloseDLL
Purpose: This function is called when the emulator is closing Purpose: This function is called when the emulator is closing
down allowing the dll to de-initialise. down allowing the DLL to de-initialize.
input: none input: none
output: none output: none
*******************************************************************/ */
EXPORT void CALL CloseDLL(void); EXPORT void CALL CloseDLL(void);
/****************************************************************** /*
Function: DllAbout Function: DllAbout
Purpose: This function is optional function that is provided Purpose: This function is optional function that is provided
to give further information about the DLL. to give further information about the DLL.
input: a handle to the window that calls this function input: a handle to the window that calls this function
output: none output: none
*******************************************************************/ */
EXPORT void CALL DllAbout(void * hParent); EXPORT void CALL DllAbout(void * hParent);
/****************************************************************** /*
Function: DllConfig Function: DllConfig
Purpose: This function is optional function that is provided Purpose: This function is optional function that is provided
to allow the user to configure the dll to allow the user to configure the DLL
input: a handle to the window that calls this function input: a handle to the window that calls this function
output: none output: none
*******************************************************************/ */
EXPORT void CALL DllConfig(void * hParent); EXPORT void CALL DllConfig(void * hParent);
/****************************************************************** /*
Function: DllTest Function: DllTest
Purpose: This function is optional function that is provided Purpose: This function is optional function that is provided
to allow the user to test the dll to allow the user to test the DLL
input: a handle to the window that calls this function input: a handle to the window that calls this function
output: none output: none
*******************************************************************/ */
EXPORT void CALL DllTest(void * hParent); EXPORT void CALL DllTest(void * hParent);
/****************************************************************** /*
Function: GetDllInfo Function: GetDllInfo
Purpose: This function allows the emulator to gather information Purpose: This function allows the emulator to gather information
about the dll by filling in the PluginInfo structure. about the DLL by filling in the PluginInfo structure.
input: a pointer to a PLUGIN_INFO stucture that needs to be input: a pointer to a PLUGIN_INFO structure that needs to be
filled by the function. (see def above) filled by the function. (see def above)
output: none output: none
*******************************************************************/ */
EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo); EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo);
/****************************************************************** /*
Function: InitiateSound Function: InitiateSound
Purpose: This function is called when the DLL is started to give Purpose: This function is called when the DLL is started to give
information from the emulator that the n64 audio information from the emulator that the N64 audio
interface needs interface needs
Input: Audio_Info is passed to this function which is defined Input: Audio_Info is passed to this function which is defined
above. above.
Output: TRUE on success Output: TRUE on success
FALSE on failure to initialise FALSE on failure to initialize
** note on interrupts **: ** Note on interrupts **:
To generate an interrupt set the appropriate bit in MI_INTR_REG To generate an interrupt set the appropriate bit in MI_INTR_REG
and then call the function CheckInterrupts to tell the emulator and then call the function CheckInterrupts to tell the emulator
that there is a waiting interrupt. that there is a waiting interrupt.
*******************************************************************/ */
EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info); EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info);
/****************************************************************** /*
Function: ProcessAList Function: ProcessAList
Purpose: This function is called when there is a Alist to be Purpose: This function is called when there is a Alist to be
processed. The Dll will have to work out all the info processed. The DLL will have to work out all the info
about the AList itself. about the AList itself.
input: none input: none
output: none output: none
*******************************************************************/ */
EXPORT void CALL ProcessAList(void); EXPORT void CALL ProcessAList(void);
/****************************************************************** /*
Function: RomClosed Function: RomClosed
Purpose: This function is called when a rom is closed. Purpose: This function is called when a ROM is closed.
input: none input: none
output: none output: none
*******************************************************************/ */
EXPORT void CALL RomClosed(void); EXPORT void CALL RomClosed(void);