diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 30ebcf662..223e1411c 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -12,7 +12,7 @@ * * Author: Miran Grca, * - * Copyright 2018,2019 Miran Grca. + * Copyright 2018-2021 Miran Grca. */ #include #include diff --git a/src/codegen_new/codegen_allocator.c b/src/codegen_new/codegen_allocator.c index f441c2c4b..ad07afd73 100644 --- a/src/codegen_new/codegen_allocator.c +++ b/src/codegen_new/codegen_allocator.c @@ -120,7 +120,11 @@ void codegen_allocator_clean_blocks(struct mem_block_t *block) #if defined __ARM_EABI__ || defined _ARM_ || defined __aarch64__ || defined _M_ARM || defined _M_ARM64 while (1) { +#ifndef _MSC_VER __clear_cache(&mem_block_alloc[block->offset], &mem_block_alloc[block->offset + MEM_BLOCK_SIZE]); +#else + FlushInstructionCache(GetCurrentProcess(), &mem_block_alloc[block->offset], MEM_BLOCK_SIZE); +#endif if (block->next) block = &mem_blocks[block->next - 1]; else diff --git a/src/codegen_new/codegen_ops_helpers.c b/src/codegen_new/codegen_ops_helpers.c index 6a3e8f6d8..6d8cbfd3a 100644 --- a/src/codegen_new/codegen_ops_helpers.c +++ b/src/codegen_new/codegen_ops_helpers.c @@ -62,7 +62,7 @@ int codegen_can_unroll_full(codeblock_t *block, ir_data_t *ir, uint32_t next_pc, return 0; max_unroll = UNROLL_MAX_UOPS / ((ir->wr_pos-start)+6); - if (max_unroll > (UNROLL_MAX_REG_REFERENCES / max_version_refcount)) + if ((max_version_refcount != 0) && (max_unroll > (UNROLL_MAX_REG_REFERENCES / max_version_refcount))) max_unroll = (UNROLL_MAX_REG_REFERENCES / max_version_refcount); if (max_unroll > UNROLL_MAX_COUNT) max_unroll = UNROLL_MAX_COUNT; diff --git a/src/include/86box/filters.h b/src/include/86box/filters.h index ff11a05d4..98eff66e2 100644 --- a/src/include/86box/filters.h +++ b/src/include/86box/filters.h @@ -299,6 +299,37 @@ static inline double high_cut_iir(int c, int i, double NewSample) { return y[c][i][0]; } +/* fc=5.283kHz, gain=-9.477dB, width=0.4845 */ +static inline double deemph_iir(int i, double NewSample) { + double ACoef[NCoef+1] = { + 0.46035077886318842566, + -0.28440821191249848754, + 0.03388877229118691936 + }; + + double BCoef[NCoef+1] = { + 1.00000000000000000000, + -1.05429146278569141337, + 0.26412280202756849290 + }; + static double y[2][NCoef+1]; /* output samples */ + static double x[2][NCoef+1]; /* input samples */ + int n; + + /* shift the old samples */ + for(n=NCoef; n>0; n--) { + x[i][n] = x[i][n-1]; + y[i][n] = y[i][n-1]; + } + + /* Calculate the new output */ + x[i][0] = NewSample; + y[i][0] = ACoef[0] * x[i][0]; + for(n=1; n<=NCoef; n++) + y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n]; + + return y[i][0]; +} #undef NCoef #define NCoef 2 diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 886ab4ff2..e34324657 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -16,7 +16,6 @@ #include <86box/timer.h> #include <86box/sound.h> #include <86box/midi.h> -#include <86box/snd_mpu401.h> #include <86box/snd_ac97.h> @@ -27,8 +26,6 @@ static float low_fir_es1371_coef[ES1371_NCoef]; typedef struct { - mpu_t mpu; - uint8_t pci_command, pci_serr; uint32_t base_addr; @@ -897,7 +894,7 @@ static uint8_t es1371_pci_read(int func, int addr, void *p) case 0x04: return es1371->pci_command; case 0x05: return es1371->pci_serr; - case 0x06: return 0x10; /* Supports support ACPI */ + case 0x06: return 0x10; /* Supports ACPI */ case 0x07: return 0x00; case 0x08: return 0x02; /* Revision ID */