From: Toni Wilen Date: Sat, 3 Feb 2024 13:58:49 +0000 (+0200) Subject: Option to force (unconnected) floppy data line high. X-Git-Tag: 5200~27 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6d7cbf895a6589bc277a4c1e7f5c0b195eb2d0fc;p=francis%2Fwinuae.git Option to force (unconnected) floppy data line high. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index ee267e9b..8b84fc8a 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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); diff --git a/disk.cpp b/disk.cpp index 123a3342..4041b912 100644 --- 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()); } diff --git a/include/options.h b/include/options.h index 7a9d3cd5..283b761b 100644 --- a/include/options.h +++ b/include/options.h @@ -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];