Make the audio copy threaded

This commit is contained in:
meepingsnesroms
2018-10-25 14:03:18 -07:00
parent 14f2bbf4de
commit f622aa8695
2 changed files with 16 additions and 1 deletions

View File

@@ -556,7 +556,7 @@ void emulateFrame(){
blip_end_frame(palmAudioResampler, AUDIO_END_OF_FRAME);
//printf("There are %d audio samples available\n", blip_samples_avail(palmAudioResampler));
blip_read_samples(palmAudioResampler, palmAudio, AUDIO_SAMPLES_PER_FRAME, true);
for(uint32_t samples = 0; samples < AUDIO_SAMPLES_PER_FRAME * 2; samples += 2)
MULTITHREAD_LOOP for(uint32_t samples = 0; samples < AUDIO_SAMPLES_PER_FRAME * 2; samples += 2)
palmAudio[samples + 1] = palmAudio[samples];
//video

View File

@@ -18,6 +18,11 @@ static inline uint64_t uMax(uint64_t x, uint64_t y){
return x > y ? x : y;
}
static inline uint64_t uClamp(uint64_t x, uint64_t y, uint64_t z){
//x must always be less than z!
return (y < x ? x : y) > z ? z : y;
}
static inline int64_t sMin(int64_t x, int64_t y){
return x < y ? x : y;
}
@@ -26,6 +31,11 @@ static inline int64_t sMax(int64_t x, int64_t y){
return x > y ? x : y;
}
static inline int64_t sClamp(int64_t x, int64_t y, int64_t z){
//x must always be less than z!
return (y < x ? x : y) > z ? z : y;
}
static inline double dMin(double x, double y){
return x < y ? x : y;
}
@@ -34,6 +44,11 @@ static inline double dMax(double x, double y){
return x > y ? x : y;
}
static inline double dClamp(double x, double y, double z){
//x must always be less than z!
return (y < x ? x : y) > z ? z : y;
}
static inline uint64_t getUint64FromDouble(double data){
//1.32.31 fixed point