From 53c9a66bbb5afee878fa8dc76c7791ef7c68009c Mon Sep 17 00:00:00 2001 From: Layer8 Date: Wed, 2 Aug 2023 19:02:41 +0900 Subject: [PATCH] Adjust for overclock --- infones/InfoNES_pAPU.h | 4 ++-- main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infones/InfoNES_pAPU.h b/infones/InfoNES_pAPU.h index c084bf4..e57a1b3 100644 --- a/infones/InfoNES_pAPU.h +++ b/infones/InfoNES_pAPU.h @@ -168,8 +168,8 @@ void InfoNES_pAPUHsync(bool enabled); /* these values subject to change without notice. */ /*-------------------------------------------------------------------*/ extern int ApuQuality; -#define pAPU_QUALITY 3 // to save battery... -#define SAMPLE_INTERVAL 24 // 1,000,000 us / 11015Hz +#define pAPU_QUALITY 3 // 44,100 Hz +#define SAMPLE_INTERVAL 22 // 1,000,000 us / 44,100 Hz /*-------------------------------------------------------------------*/ /* Rectangle Wave #1 resources */ diff --git a/main.cpp b/main.cpp index f6c7a2b..c1a4635 100644 --- a/main.cpp +++ b/main.cpp @@ -466,9 +466,9 @@ void InfoNES_SoundOutput(int samples, BYTE *wave1, BYTE *wave2, BYTE *wave3, BYT for (i = 0; i < samples; i++) { -#if 0 +#ifndef NO_OVERCLOCK final_wave[fw_wr][i] = - ((unsigned char)wave1[i] + (unsigned char)wave2[i] + (unsigned char)wave3[i] + (unsigned char)wave4[i] + (unsigned char)wave5[i]) / 5; + ((unsigned char)wave1[i] + (unsigned char)wave2[i] + (unsigned char)wave3[i] + (unsigned char)wave4[i] + (unsigned char)wave5[i]) * 4096 / 1280; #else final_wave[fw_wr][i] = ((unsigned char)wave1[i] + (unsigned char)wave2[i] + (unsigned char)wave3[i] + (unsigned char)wave4[i] + (unsigned char)wave5[i]) * 2048 / 1280;