Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Win64 take two #17

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions arm-wt-22k/host_src/eas_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ typedef long EAS_RESULT;
#define EAS_BUFFER_FULL 5

/* EAS_STATE return codes */
#if defined(_WIN64)
typedef long long EAS_STATE;
#else
typedef long EAS_STATE;
#endif
typedef enum
{
EAS_STATE_READY = 0,
Expand Down Expand Up @@ -123,8 +127,13 @@ typedef char EAS_CHAR;
typedef unsigned short EAS_U16;
typedef short EAS_I16;

#if defined(_WIN64)
typedef unsigned long long EAS_U32;
typedef long long EAS_I32;
#else
typedef unsigned long EAS_U32;
typedef long EAS_I32;
#endif

typedef unsigned EAS_UINT;
typedef int EAS_INT;
Expand Down
15 changes: 9 additions & 6 deletions arm-wt-22k/lib_src/eas_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ void EAS_MixEnginePrep (S_EAS_DATA *pEASData, EAS_I32 numSamples)

/* clear the mix buffer */
#if (NUM_OUTPUT_CHANNELS == 2)
EAS_HWMemSet(pEASData->pMixBuffer, 0, numSamples * (EAS_I32) sizeof(long) * 2);
EAS_HWMemSet(pEASData->pMixBuffer, 0, numSamples * (EAS_I32) sizeof(EAS_I32) * 2);
#else
EAS_HWMemSet(pEASData->pMixBuffer, 0, (EAS_I32) numSamples * (EAS_I32) sizeof(long));
EAS_HWMemSet(pEASData->pMixBuffer, 0, (EAS_I32) numSamples * (EAS_I32) sizeof(EAS_I32));
#endif

/* need to clear other side-chain effect buffers (chorus & reverb) */
Expand Down Expand Up @@ -263,11 +263,14 @@ void EAS_MixEnginePost (S_EAS_DATA *pEASData, EAS_I32 numSamples)
*
*----------------------------------------------------------------------------
*/
void SynthMasterGain (long *pInputBuffer, EAS_PCM *pOutputBuffer, EAS_U16 nGain, EAS_U16 numSamples) {

void SynthMasterGain(EAS_I32 *pInputBuffer,
EAS_PCM *pOutputBuffer,
EAS_U16 nGain,
EAS_U16 numSamples)
{
/* loop through the buffer */
while (numSamples) {
long s;
EAS_I32 s;

numSamples--;
/* read a sample from the input buffer and add some guard bits */
Expand All @@ -278,7 +281,7 @@ void SynthMasterGain (long *pInputBuffer, EAS_PCM *pOutputBuffer, EAS_U16 nGain,
s = s >> 7;

/* apply master gain */
s *= (long) nGain;
s *= (EAS_I32) nGain;

/* shift to lower 16-bits */
/*lint -e{704} <avoid divide for performance>*/
Expand Down
5 changes: 4 additions & 1 deletion arm-wt-22k/lib_src/eas_mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@

#include "eas_effects.h"

extern void SynthMasterGain( long *pInputBuffer, EAS_PCM *pOutputBuffer, EAS_U16 nGain, EAS_U16 nNumLoopSamples);
extern void SynthMasterGain(EAS_I32 *pInputBuffer,
EAS_PCM *pOutputBuffer,
EAS_U16 nGain,
EAS_U16 nNumLoopSamples);

/*----------------------------------------------------------------------------
* EAS_MixEngineInit()
Expand Down