]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Z2/Z3 RAM expansion with bad RAM config entry
authorToni Wilen <twilen@winuae.net>
Tue, 23 Apr 2024 17:35:10 +0000 (20:35 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 23 Apr 2024 17:35:10 +0000 (20:35 +0300)
cfgfile.cpp
include/options.h
memory.cpp

index ae26dbaac33aeb4a833cd75f6db2ececad80206c..1098a5ca6a4debed2f540ecd93654fc8b5daf7ea 100644 (file)
@@ -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) {
index 677cb1368ed38e198600c8b3c80f81b7f3b95495..7eb67c8cce325d1cd73cb2463da9f2c937708541 100644 (file)
@@ -473,6 +473,7 @@ struct ramboard
        bool nodma;
        bool force16bit;
        bool chipramtiming;
+       int fault;
        struct boardloadfile lf;
 };
 struct expansion_params
index c877ddbf4d6d91e3ce730e585dbf913136f618a5..c3e4ac67b0bbd61d94b1c20d5e7b7986643ade98 100644 (file)
@@ -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)