]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Option to force (unconnected) floppy data line high.
authorToni Wilen <twilen@winuae.net>
Sat, 3 Feb 2024 13:58:49 +0000 (15:58 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 3 Feb 2024 13:58:49 +0000 (15:58 +0200)
cfgfile.cpp
disk.cpp
include/options.h

index ee267e9bd06a165389faf49691d8d67be662a75a..8b84fc8abf9089af4f63a2dd4687b81d70530d90 100644 (file)
@@ -2747,6 +2747,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_strarr(f, _T("unmapped_address_space"), unmapped, p->cs_unmapped_space);
        cfgfile_dwrite_bool(f, _T("memory_pattern"), p->cs_memorypatternfill);
        cfgfile_dwrite_bool(f, _T("ipl_delay"), p->cs_ipldelay);
+       cfgfile_dwrite_bool(f, _T("floppydata_pullup"), p->cs_floppydatapullup);
        cfgfile_dwrite(f, _T("keyboard_handshake"), _T("%d"), currprefs.cs_kbhandshake);
        cfgfile_dwrite(f, _T("chipset_hacks"), _T("0x%x"), p->cs_hacks);
        cfgfile_dwrite(f, _T("eclockphase"), _T("%d"), p->cs_eclockphase);
@@ -5993,6 +5994,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_strval(option, value, _T("unmapped_address_space"), &p->cs_unmapped_space, unmapped, 0)
                || cfgfile_yesno(option, value, _T("memory_pattern"), &p->cs_memorypatternfill)
                || cfgfile_yesno(option, value, _T("ipl_delay"), &p->cs_ipldelay)
+               || cfgfile_yesno(option, value, _T("floppydata_pullup"), &p->cs_floppydatapullup)
                || cfgfile_strval(option, value, _T("ciaa_type"), &p->cs_ciatype[0], ciatype, 0)
                || cfgfile_strval(option, value, _T("ciab_type"), &p->cs_ciatype[1], ciatype, 0)
                || cfgfile_strboolval(option, value, _T("comp_flushmode"), &p->comp_hardflush, flushmode, 0)
@@ -8499,6 +8501,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
        p->cs_ciatype[1] = 0;
        p->cs_memorypatternfill = true;
        p->cs_ipldelay = false;
+       p->cs_floppydatapullup = false;
 
        for (int i = 0; i < MAX_FILTERDATA; i++) {
                struct gfx_filterdata *f = &p->gf[i];
@@ -9424,6 +9427,7 @@ static int bip_alg(struct uae_prefs* p, int config, int compa, int romcheck)
        p->genlock_image = 6;
        p->floppyslots[0].dfxtype = DRV_NONE;
        p->floppyslots[1].dfxtype = DRV_NONE;
+       p->cs_floppydatapullup = true;
        set_68000_compa(p, compa);
        p->cs_compatible = CP_A500;
        built_in_chipset_prefs(p);
index 123a3342c92af18cae1f3c975f0c6c30d6de208b..4041b912297e9f9becafa9aec008aea5c5316b0f 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -4294,9 +4294,11 @@ static void wordsync_detected(bool startup)
        }
 }
 
-static void disk_doupdate_read_reallynothing(int floppybits, bool state)
+static void disk_doupdate_read_reallynothing(int floppybits)
 {
        int speed = get_floppy_speed();
+       bool state = currprefs.cs_floppydatapullup;
+
        while (floppybits >= speed) {
                bool skipbit = false;
                bool waszero = word == 0;
@@ -4333,10 +4335,15 @@ static void disk_doupdate_read_reallynothing(int floppybits, bool state)
 static void disk_doupdate_read_nothing(int floppybits)
 {
        int speed = get_floppy_speed();
+       bool state = currprefs.cs_floppydatapullup;
        while (floppybits >= speed) {
                bool skipbit = false;
                word <<= 1;
-               word |= (uaerand() & 0x1000) ? 1 : 0;
+               if (state) {
+                       word |= 1;
+               } else {
+                       word |= (uaerand() & 0x1000) ? 1 : 0;
+               }
                doreaddma();
                // MSBSYNC
                if (adkcon & 0x200) {
@@ -4791,7 +4798,7 @@ void DISK_update (int tohpos)
                /* no floppy selected and no DMA */
                if ((selected | disabled) == 15) {
                        if (dskdmaen < DSKDMA_WRITE) {
-                               disk_doupdate_read_reallynothing(cycles, false);
+                               disk_doupdate_read_reallynothing(cycles);
                        } else if (dskdmaen == DSKDMA_WRITE) {
                                disk_doupdate_write(cycles, get_floppy_speed());
                        }
index 7a9d3cd58683fa31e7b178aafd189390545447b5..283b761b8f0679dabe9e5726b37eabcc6330fd96 100644 (file)
@@ -730,6 +730,7 @@ struct uae_prefs {
        int cs_denisemodel;
        bool cs_memorypatternfill;
        bool cs_ipldelay;
+       bool cs_floppydatapullup;
        uae_u32 seed;
 
        struct boardromconfig expansionboard[MAX_EXPANSION_BOARDS];