From: Toni Wilen Date: Tue, 23 Apr 2024 17:35:10 +0000 (+0300) Subject: Z2/Z3 RAM expansion with bad RAM config entry X-Git-Tag: 5300~26 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e5e6f7e9fe1f5c95de8b118bffc608e0572103ad;p=francis%2Fwinuae.git Z2/Z3 RAM expansion with bad RAM config entry --- diff --git a/cfgfile.cpp b/cfgfile.cpp index ae26dbaa..1098a5ca 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -1600,7 +1600,8 @@ static void cfgfile_write_board_rom(struct uae_prefs *prefs, struct zfile *f, st _stprintf(buf, _T("%s%s_rom"), name, i ? _T("_ext") : _T("")); cfgfile_dwrite_str (f, buf, rc->romident); } - if (rc->autoboot_disabled || rc->dma24bit || rc->inserted || ert->subtypes || ert->settings || ert->id_jumper || br->device_order > 0 || is_custom_romboard(br)) { + if (rc->autoboot_disabled || rc->dma24bit || rc->inserted || ert->subtypes || + ert->settings || ert->id_jumper || br->device_order > 0 || is_custom_romboard(br)) { TCHAR buf2[256], *p; buf2[0] = 0; p = buf2; @@ -1778,6 +1779,10 @@ static bool cfgfile_readramboard(const TCHAR *option, const TCHAR *value, const if (s) rb->product = (uae_u8)_tstol(s); xfree(s); + s = cfgfile_option_get(value, _T("fault")); + if (s) + rb->fault = _tstol(s); + xfree(s); if (cfgfile_option_get_bool(value, _T("no_reset_unmap"))) rb->no_reset_unmap = true; if (cfgfile_option_get_bool(value, _T("nodma"))) @@ -1916,6 +1921,12 @@ static void cfgfile_writeramboard(struct uae_prefs *prefs, struct zfile *f, cons _tcscpy(p, _T("force16bit=true")); p += _tcslen(p); } + if (rb->fault) { + if (tmp2[0]) + *p++ = ','; + _stprintf(p, _T("fault=%d"), rb->fault); + p += _tcslen(p); + } if (!_tcsicmp(tmp1, _T("chipmem_options")) || !_tcsicmp(tmp1, _T("bogomem_options"))) { if (!rb->chipramtiming) { if (tmp2[0]) @@ -5660,7 +5671,7 @@ static bool cfgfile_read_board_rom(struct uae_prefs *p, const TCHAR *option, con brc->roms[idx].dma24bit = true; } if (cfgfile_option_bool(buf2, _T("inserted")) == 1) { - brc->roms[idx].inserted= true; + brc->roms[idx].inserted = true; } p = cfgfile_option_get(buf2, _T("order")); if (p) { diff --git a/include/options.h b/include/options.h index 677cb136..7eb67c8c 100644 --- a/include/options.h +++ b/include/options.h @@ -473,6 +473,7 @@ struct ramboard bool nodma; bool force16bit; bool chipramtiming; + int fault; struct boardloadfile lf; }; struct expansion_params diff --git a/memory.cpp b/memory.cpp index c877ddbf..c3e4ac67 100644 --- a/memory.cpp +++ b/memory.cpp @@ -2603,6 +2603,13 @@ static void setmemorywidth(struct ramboard *mb, addrbank *ab) ce_banktype[i] = ce_banktype[0]; } } + if (mb->fault) { + ab->baseaddr_direct_w = NULL; + ab->baseaddr_direct_r = NULL; + ab->lput = &dummy_lput; + ab->wput = &dummy_wput; + ab->bput = &dummy_bput; + } } static void fill_ce_banks (void)