]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fixed only audio filter mode
authorToni Wilen <twilen@winuae.net>
Fri, 15 Mar 2024 15:43:53 +0000 (17:43 +0200)
committerToni Wilen <twilen@winuae.net>
Fri, 15 Mar 2024 15:43:53 +0000 (17:43 +0200)
audio.cpp
cfgfile.cpp
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/sounddep/sound.h
od-win32/win32gui.cpp

index a03a4df56d939d2469931b3bf3734b9e343f6565..6c7fbf153577c26d89970ec02c8e6876f9d35de3 100644 (file)
--- a/audio.cpp
+++ b/audio.cpp
@@ -432,7 +432,8 @@ static float filter_a0; /* a500 and a1200 use the same */
 enum {
        FILTER_NONE = 0,
        FILTER_MODEL_A500,
-       FILTER_MODEL_A1200
+       FILTER_MODEL_A1200,
+       FILTER_MODEL_A500_FIXEDONLY
 };
 
 /* Amiga has two separate filtering circuits per channel, a static RC filter
@@ -471,6 +472,13 @@ static int filter (int input, struct filter_state *fs)
                led_output = fs->rc5;
                break;
 
+       case FILTER_MODEL_A500_FIXEDONLY:
+               fs->rc1 = (float)(a500e_filter1_a0 * input + (1.0f - a500e_filter1_a0) * fs->rc1 + DENORMAL_OFFSET);
+               fs->rc2 = a500e_filter2_a0 * fs->rc1 + (1.0f - a500e_filter2_a0) * fs->rc2;
+               normal_output = fs->rc2;
+               led_output = fs->rc2;
+               break;
+
        case FILTER_MODEL_A1200:
                normal_output = (float)input;
 
@@ -626,7 +634,7 @@ static void samplexx_sinc_handler (int *datasp, int ch_start, int ch_num)
        int const *winsinc;
 
        if (sound_use_filter_sinc && ch_start == 0) {
-               n = (sound_use_filter_sinc == FILTER_MODEL_A500) ? 0 : 2;
+               n = (sound_use_filter_sinc == FILTER_MODEL_A500 || sound_use_filter_sinc == FILTER_MODEL_A500_FIXEDONLY) ? 0 : 2;
                if (led_filter_on)
                        n += 1;
        } else {
@@ -2193,6 +2201,8 @@ void set_audio (void)
                        sound_use_filter = FILTER_MODEL_A500;
                else if (currprefs.sound_filter_type == FILTER_SOUND_TYPE_A1200)
                        sound_use_filter = FILTER_MODEL_A1200;
+               else if (currprefs.sound_filter_type == FILTER_SOUND_TYPE_A500_FIXEDONLY)
+                       sound_use_filter = FILTER_MODEL_A500_FIXEDONLY;
        }
        a500e_filter1_a0 = rc_calculate_a0 (currprefs.sound_freq, 6200);
        a500e_filter2_a0 = rc_calculate_a0 (currprefs.sound_freq, 20000);
index 33e4b56c723e228c4917470b932e46df6eb8c319..58b3a5ab358f5dbc8b64bc15dd322dc542463f83 100644 (file)
@@ -160,7 +160,7 @@ static const TCHAR *compmode[] = { _T("direct"), _T("indirect"), _T("indirectKS"
 static const TCHAR *flushmode[] = { _T("soft"), _T("hard"), 0 };
 static const TCHAR *kbleds[] = { _T("none"), _T("POWER"), _T("DF0"), _T("DF1"), _T("DF2"), _T("DF3"), _T("HD"), _T("CD"), _T("DFx"), 0 };
 static const TCHAR *onscreenleds[] = { _T("false"), _T("true"), _T("rtg"), _T("both"), 0 };
-static const TCHAR *soundfiltermode1[] = { _T("off"), _T("emulated"), _T("on"), 0 };
+static const TCHAR *soundfiltermode1[] = { _T("off"), _T("emulated"), _T("on"), _T("fixedonly"), 0 };
 static const TCHAR *soundfiltermode2[] = { _T("standard"), _T("enhanced"), 0 };
 static const TCHAR *lorestype1[] = { _T("lores"), _T("hires"), _T("superhires"), 0 };
 static const TCHAR *lorestype2[] = { _T("true"), _T("false"), 0 };
index 66f74ecf54a6078093d992f87184cd068790b3e1..07a8c87f2ea0be5ed15ba9fb83e459a9f66250f1 100644 (file)
 #define IDS_NONE2                       440
 #define IDS_SOUND_CLONED71              441
 #define IDS_SOUND_71                    442
+#define IDS_SOUND_FILTER_ON_FIXEDONLY   443
 #define IDS_QS_MODELS                   1000
 #define IDS_QS_MODEL_A500               1001
 #define IDS_QS_MODEL_A500P              1002
index 64e3a38145ba2a400236fc169ac726cdd23869e3..63f79d875ecd61c1f74b47373a1f5990398280aa 100644 (file)
@@ -2239,6 +2239,7 @@ BEGIN
     IDS_NONE2               "<none>"
     IDS_SOUND_CLONED71      "Cloned stereo (7.1)"
     IDS_SOUND_71            "7.1 channels"
+    IDS_SOUND_FILTER_ON_FIXEDONLY "Always on (Fixed only)"
 END
 
 #endif    // English (United Kingdom) resources
index 384f6f0a1176b1b8b5c3412eb56b8a474ce36bf3..56fa34bbdec40a5e8eb9b21d00ce2fffc90d5e3f 100644 (file)
@@ -82,6 +82,7 @@ extern int active_sound_stereo;
 
 #define FILTER_SOUND_TYPE_A500 0
 #define FILTER_SOUND_TYPE_A1200 1
+#define FILTER_SOUND_TYPE_A500_FIXEDONLY 2
 
 struct dsaudiomodes {
        int ch;
index 67483aa402757445a0838ff64b83ed65c4450298..5e7084c21bc8b6369afaa11ac39f7018c03a7775 100644 (file)
@@ -14024,8 +14024,10 @@ static void values_to_sounddlg (HWND hDlg)
        xSendDlgItemMessage (hDlg, IDC_SOUNDFILTER, CB_ADDSTRING, 0, (LPARAM)txt);
        WIN32GUI_LoadUIString (IDS_SOUND_FILTER_ON_AGA, txt, sizeof (txt) / sizeof (TCHAR));
        xSendDlgItemMessage (hDlg, IDC_SOUNDFILTER, CB_ADDSTRING, 0, (LPARAM)txt);
-       WIN32GUI_LoadUIString (IDS_SOUND_FILTER_ON_A500, txt, sizeof (txt) / sizeof (TCHAR));
-       xSendDlgItemMessage (hDlg, IDC_SOUNDFILTER, CB_ADDSTRING, 0, (LPARAM)txt);
+       WIN32GUI_LoadUIString(IDS_SOUND_FILTER_ON_A500, txt, sizeof(txt) / sizeof(TCHAR));
+       xSendDlgItemMessage(hDlg, IDC_SOUNDFILTER, CB_ADDSTRING, 0, (LPARAM)txt);
+       WIN32GUI_LoadUIString(IDS_SOUND_FILTER_ON_FIXEDONLY, txt, sizeof(txt) / sizeof(TCHAR));
+       xSendDlgItemMessage(hDlg, IDC_SOUNDFILTER, CB_ADDSTRING, 0, (LPARAM)txt);
        i = 0;
        switch (workprefs.sound_filter)
        {
@@ -14036,7 +14038,7 @@ static void values_to_sounddlg (HWND hDlg)
                i = workprefs.sound_filter_type ? 2 : 1;
                break;
        case 2:
-               i = workprefs.sound_filter_type ? 4 : 3;
+               i = workprefs.sound_filter_type == 2 ? 5 : (workprefs.sound_filter_type == 1 ? 4 : 3);
                break;
        }
        xSendDlgItemMessage (hDlg, IDC_SOUNDFILTER, CB_SETCURSEL, i, 0);
@@ -14243,6 +14245,10 @@ static void values_from_sounddlg (HWND hDlg)
                workprefs.sound_filter = FILTER_SOUND_ON;
                workprefs.sound_filter_type = 1;
                break;
+       case 5:
+               workprefs.sound_filter = FILTER_SOUND_ON;
+               workprefs.sound_filter_type = 2;
+               break;
        }
 
        workprefs.sound_stereo_swap_paula = (xSendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_GETCURSEL, 0, 0) & 1) ? 1 : 0;