]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Manual config file floppybridge setting
authorToni Wilen <twilen@winuae.net>
Sat, 8 Oct 2022 12:15:28 +0000 (15:15 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 8 Oct 2022 12:15:28 +0000 (15:15 +0300)
cfgfile.cpp
disk.cpp
include/options.h

index 4c6019dd329d0a2968895d1d9b3f7159ee530428..7bd8565a62efbb0104c3529883e2e1e9447fd9c8 100644 (file)
@@ -2019,6 +2019,10 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
                                _stprintf(tmp, _T("floppy%dsubtypeid"), i);
                                cfgfile_dwrite_escape(f, tmp, _T("%s"), p->floppyslots[i].dfxsubtypeid);
                        }
+                       if (p->floppyslots[i].dfxprofile[0]) {
+                               _stprintf(tmp, _T("floppy%dprofile"), i);
+                               cfgfile_dwrite_escape(f, tmp, _T("%s"), p->floppyslots[i].dfxprofile);
+                       }
                }
                _stprintf (tmp, _T("floppy%dsound"), i);
                cfgfile_dwrite (f, tmp, _T("%d"), p->floppyslots[i].dfxclick);
@@ -6050,6 +6054,10 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                if (cfgfile_string_escape(option, value, tmpbuf, p->floppyslots[i].dfxsubtypeid, sizeof p->floppyslots[i].dfxsubtypeid / sizeof(TCHAR))) {
                        return 1;
                }
+               _stprintf(tmpbuf, _T("floppy%dprofile"), i);
+               if (cfgfile_string_escape(option, value, tmpbuf, p->floppyslots[i].dfxprofile, sizeof p->floppyslots[i].dfxprofile / sizeof(TCHAR))) {
+                       return 1;
+               }
        }
 
        if (cfgfile_intval (option, value, _T("chipmem_size"), &dummyint, 1)) {
index 682d952ec3f9726cdce0d43c75d98c7a7a666235..8a0b3c66cb625729aaab89e6088640dd767499bc 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -5015,24 +5015,31 @@ static void floppybridge_init2(struct uae_prefs *p)
                                bridge_type[dr] = type;
                                FloppyBridgeAPI *bridge = NULL;
                                int id = _tstol(p->floppyslots[dr].dfxsubtypeid);
-                               const TCHAR *name = _tcschr(p->floppyslots[dr].dfxsubtypeid, ':');
-                               if (name) {
-                                       name++;
-                                       for (int i = 0; i < bridgeprofiles.size(); i++) {
-                                               FloppyBridgeAPI::FloppyBridgeProfileInformation fbpi = bridgeprofiles.at(i);
-                                               if (fbpi.profileID == id && !_tcscmp(fbpi.name, name)) {
-                                                       bridge = FloppyBridgeAPI::createDriverFromProfileID(id);
-                                                       break;
-                                               }
-                                       }
-                                       if (!bridge) {
+                               if (p->floppyslots[dr].dfxprofile[0]) {
+                                       char *a = ua(p->floppyslots[dr].dfxprofile);
+                                       bridge = FloppyBridgeAPI::createDriverFromString(a);
+                                       xfree(a);
+                               }
+                               if (!bridge) {
+                                       const TCHAR *name = _tcschr(p->floppyslots[dr].dfxsubtypeid, ':');
+                                       if (name) {
+                                               name++;
                                                for (int i = 0; i < bridgeprofiles.size(); i++) {
                                                        FloppyBridgeAPI::FloppyBridgeProfileInformation fbpi = bridgeprofiles.at(i);
-                                                       if (!_tcscmp(fbpi.name, name)) {
-                                                               bridge = FloppyBridgeAPI::createDriverFromProfileID(fbpi.profileID);
+                                                       if (fbpi.profileID == id && !_tcscmp(fbpi.name, name)) {
+                                                               bridge = FloppyBridgeAPI::createDriverFromProfileID(id);
                                                                break;
                                                        }
                                                }
+                                               if (!bridge) {
+                                                       for (int i = 0; i < bridgeprofiles.size(); i++) {
+                                                               FloppyBridgeAPI::FloppyBridgeProfileInformation fbpi = bridgeprofiles.at(i);
+                                                               if (!_tcscmp(fbpi.name, name)) {
+                                                                       bridge = FloppyBridgeAPI::createDriverFromProfileID(fbpi.profileID);
+                                                                       break;
+                                                               }
+                                                       }
+                                               }
                                        }
                                }
                                if (!bridge) {
index 05fe3e104fa32925b0db17d4ab96d16709fd8fcc..a009b053f9429e43b8fcbacf24bdcf37604b900b 100644 (file)
@@ -163,6 +163,7 @@ struct floppyslot
        int dfxtype;
        int dfxsubtype;
        TCHAR dfxsubtypeid[32];
+       TCHAR dfxprofile[32];
        int dfxclick;
        TCHAR dfxclickexternal[256];
        bool forcedwriteprotect;