Skip to content

Commit

Permalink
Merge pull request #17 from pedrolcl/win64_take_two
Browse files Browse the repository at this point in the history
Win64 take two
  • Loading branch information
pedrolcl authored Mar 17, 2024
2 parents 56ae8ca + d66f099 commit 86decc1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
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

0 comments on commit 86decc1

Please sign in to comment.