Option to force (unconnected) floppy data line high.

This commit is contained in:
Toni Wilen 2024-02-03 15:58:49 +02:00
parent e611573153
commit 6d7cbf895a
3 changed files with 15 additions and 3 deletions

View 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);

View File

@ -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());
}

View 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];