]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
CSMK1 update + SCSI module separation.
authorToni Wilen <twilen@winuae.net>
Sun, 24 Apr 2022 19:16:07 +0000 (22:16 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 24 Apr 2022 19:16:07 +0000 (22:16 +0300)
cpuboard.cpp
expansion.cpp
include/autoconf.h
include/ncr9x_scsi.h
include/rommgr.h
rommgr.cpp

index 2575c5227264885d1a72237d9eb3b1cb6eef18e9..f1e6fabc02fadc6575c6aa2852962705a2218309 100644 (file)
@@ -670,10 +670,6 @@ static uae_u32 REGPARAM2 blizzardf0_bget(uaecptr addr)
                addr &= 65535;
                addr += 65536;
                return flash_read(flashrom, addr);
-       } else if (is_csmk1(&currprefs)) {
-               addr &= 65535;
-               addr += 65536;
-               return flash_read(flashrom, addr);
        } else if (is_dkb_wildfire(&currprefs)) {
                if (flash_unlocked) {
                        if (addr & 1)
@@ -728,10 +724,6 @@ static void REGPARAM2 blizzardf0_bput(uaecptr addr, uae_u32 b)
                addr &= ~3;
                addr |= csmk2_flashaddressing;
                flash_write(flashrom, addr, b);
-       } else if (is_csmk1(&currprefs)) {
-               addr &= 65535;
-               addr += 65536;
-               flash_write(flashrom, addr, b);
        } else if (is_dkb_wildfire(&currprefs)) {
                if (flash_unlocked) {
                        if (addr & 1)
@@ -803,13 +795,10 @@ static uae_u32 REGPARAM2 blizzardea_bget(uaecptr addr)
                else
                        v = blizzardea_bank.baseaddr[addr];
        } else if (is_csmk1(&currprefs)) {
-               if (addr >= CYBERSTORM_MK1_SCSI_OFFSET) {
+               if (addr >= CYBERSTORM_MK1_SCSI_OFFSET)
                        v = cpuboard_ncr9x_scsi_get(addr);
-               } else if (flash_active(flashrom, addr)) {
-                       v = flash_read(flashrom, addr);
-               } else {
+               else
                        v = blizzardea_bank.baseaddr[addr];
-               }
        } else if (is_csmk2(&currprefs)) {
                if (addr >= CYBERSTORM_MK2_SCSI_OFFSET) {
                        v = cpuboard_ncr9x_scsi_get(addr);
@@ -860,8 +849,6 @@ static void REGPARAM2 blizzardea_bput(uaecptr addr, uae_u32 b)
        } else if (is_csmk1(&currprefs)) {
                if (addr >= CYBERSTORM_MK1_SCSI_OFFSET) {
                        cpuboard_ncr9x_scsi_put(addr, b);
-               } else {
-                       flash_write(flashrom, addr, b);
                }
        } else if (is_csmk2(&currprefs)) {
                if (addr >= CYBERSTORM_MK2_SCSI_OFFSET) {
@@ -2092,8 +2079,8 @@ static void cpuboard_init_2(void)
                blizzardf0_bank.mask = blizzardf0_bank.reserved_size - 1;
                mapped_malloc(&blizzardf0_bank);
 
-               blizzardea_bank.reserved_size = 2 * 65536;
-               blizzardea_bank.mask = 65535 - 1;
+               blizzardea_bank.reserved_size = 65536;
+               blizzardea_bank.mask = blizzardea_bank.reserved_size - 1;
                mapped_malloc(&blizzardea_bank);
 
                blizzardmaprom_bank.reserved_size = 524288;
@@ -2496,6 +2483,7 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
        struct boardromconfig *brc;
        bool autoconf = true;
        bool autoconf_stop = false;
+       bool autoconfig_nomandatory = false;
        const TCHAR *defaultromname = NULL;
        const TCHAR *romname = NULL;
        bool isflashrom = false;
@@ -2503,7 +2491,6 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
        const TCHAR *boardname;
        struct uae_prefs *p = aci->prefs;
        uae_u32 romtype = 0, romtype2 = 0;
-       bool cpucheck = false;
 
        boardname = cpuboards[p->cpuboard_type].subtypes[p->cpuboard_subtype].name;
        aci->label = boardname;
@@ -2651,8 +2638,8 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
                {
                        case BOARD_CYBERSTORM_SUB_MK1:
                                romtype = ROMTYPE_CB_CSMK1;
-                               cpucheck = true;
-                               isflashrom = true;
+                               romtype2 = ROMTYPE_CSMK1SCSI;
+                               autoconfig_nomandatory = true;
                                break;
                        case BOARD_CYBERSTORM_SUB_MK2:
                                romtype = ROMTYPE_CB_CSMK2;
@@ -2692,7 +2679,6 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
                                break;
                        case BOARD_BLIZZARD_SUB_PPC:
                                romtype = ROMTYPE_CB_BLIZPPC;
-                               cpucheck = true;
                                isflashrom = true;
                                break;
                }
@@ -2772,18 +2758,20 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
                }
        }
        
-       if (!autoconfig_rom && romtype) {
-               if (aci->doinit)
-                       romwarning(romtype);
-               write_log (_T("ROM id %08X not found for CPUBoard '%s' emulation\n"), romtype, boardname);
-               return false;
-       }
-       if (!autoconfig_rom) {
-               write_log(_T("Couldn't open CPUBoard '%s' rom '%s'\n"), boardname, defaultromname);
-               return false;
-       }
+       if (!autoconfig_nomandatory) {
+               if (!autoconfig_rom && romtype) {
+                       if (aci->doinit)
+                               romwarning(romtype);
+                       write_log(_T("ROM id %08X not found for CPUBoard '%s' emulation\n"), romtype, boardname);
+                       return false;
+               }
+               if (!autoconfig_rom) {
+                       write_log(_T("Couldn't open CPUBoard '%s' rom '%s'\n"), boardname, defaultromname);
+                       return false;
+               }
 
-       write_log(_T("CPUBoard '%s' ROM '%s' %lld loaded\n"), boardname, zfile_getname(autoconfig_rom), zfile_size(autoconfig_rom));
+               write_log(_T("CPUBoard '%s' ROM '%s' %lld loaded\n"), boardname, zfile_getname(autoconfig_rom), zfile_size(autoconfig_rom));
+       }
 
        uae_u8 *blizzardea_tmp = blizzardea_bank.baseaddr;
        uae_u8 *blizzardf0_tmp = blizzardf0_bank.baseaddr;
@@ -2901,25 +2889,35 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
                        blizzardea_bank.baseaddr[i * 2 + 0] = b;
                }
        } else if (is_csmk1(p)) {
-               earom_size = 131072; // really 64k but ea and f0 use same space
+               earom_size = 65536;
                f0rom_size = 65536;
-               for (int i = 0; i < 32768; i++) {
-                       uae_u8 b = 0xff;
-                       zfile_fread(&b, 1, 1, autoconfig_rom);
-                       blizzardea_bank.baseaddr[i * 2 + 0] = b;
-                       blizzardea_bank.baseaddr[i * 2 + 1] = 0xff;
-               }
-               zfile_fread(blizzardea_bank.baseaddr + 65536, 65536, 1, autoconfig_rom);
-               if (zfile_needwrite(autoconfig_rom)) {
-                       flashrom_file = autoconfig_rom;
+               aci->start = 0xf00000;
+               aci->size = f0rom_size;
+               if (autoconfig_rom) {
+                       zfile_fread(blizzardf0_bank.baseaddr, 1, f0rom_size, autoconfig_rom);
+                       zfile_fclose(autoconfig_rom);
                        autoconfig_rom = NULL;
                }
-               flashrom = flash_new(blizzardea_bank.baseaddr, earom_size, earom_size, 0x01, 0x20, flashrom_file, 0);
-               memcpy(blizzardf0_bank.baseaddr, blizzardea_bank.baseaddr + 65536, 65536);
+               if (romtype2) {
+                       int idx2;
+                       struct boardromconfig *brc2 = get_device_rom(p, romtype2, 0, &idx2);
+                       if (brc2 && brc2->roms[idx2].romfile[0])
+                               autoconfig_rom = board_rom_open(romtype2, brc2->roms[idx2].romfile);
+                       if (autoconfig_rom) {
+                               memset(blizzardea_bank.baseaddr, 0xff, 65536);
+                               for (int i = 0; i < 32768; i++) {
+                                       uae_u8 b = 0xff;
+                                       zfile_fread(&b, 1, 1, autoconfig_rom);
+                                       blizzardea_bank.baseaddr[i * 2 + 0] = b;
+                               }
+                       }
+               } else {
+                       autoconf = false;
+               }
        } else if (is_csmk2(p)) {
                earom_size = 131072;
                f0rom_size = 65536;
-               zfile_fread(blizzardea_bank.baseaddr, earom_size, 1, autoconfig_rom);
+               zfile_fread(blizzardea_bank.baseaddr, 1,earom_size, autoconfig_rom);
                if (zfile_needwrite(autoconfig_rom)) {
                        flashrom_file = autoconfig_rom;
                        autoconfig_rom = NULL;
index 1356d01fcc0f9028bf7e0f074f5420b6edf035ac..0d2aeaaf7a507f4e51017dad0152032d1b74b1c6 100644 (file)
@@ -5251,6 +5251,12 @@ const struct expansionromtype expansionroms[] = {
                NULL, 0,
                false, EXPANSIONTYPE_SCSI
        },
+       {
+               _T("csmk1cyberscsi"), _T("CyberSCSI module"), _T("Phase 5"),
+               NULL, NULL, NULL, cpuboard_ncr9x_add_scsi_unit, ROMTYPE_CSMK1SCSI, 0, 0, 0, true,
+               NULL, 0,
+               false, EXPANSIONTYPE_SCSI
+       },
        {
                _T("accessx"), _T("AccessX"), _T("Breitfeld Computersysteme"),
                NULL, accessx_init, NULL, accessx_add_ide_unit, ROMTYPE_ACCESSX, 0, 0, BOARD_AUTOCONFIG_Z2, false,
@@ -6350,10 +6356,13 @@ static const struct cpuboardsubtype cyberstormboard_sub[] = {
        {
                _T("CyberStorm MK I"),
                _T("CyberStormMK1"),
-               ROMTYPE_CB_CSMK1, 0, 4,
-               cpuboard_ncr9x_add_scsi_unit, EXPANSIONTYPE_SCSI,
+               ROMTYPE_CB_CSMK1 | ROMTYPE_NONE, 0, 4,
+               NULL, 0,
                BOARD_MEMORY_HIGHMEM,
-               128 * 1024 * 1024
+               128 * 1024 * 1024,
+               0,
+               NULL, NULL, 0, 0,
+               NULL
        },
        {
                _T("CyberStorm MK II"),
index d62d48b6f96b27d17b40e70b62e46b7884d02c86..de95e08733f209485a780183e1e0a82be617850b 100644 (file)
@@ -247,7 +247,8 @@ struct cpuboardsubtype
 {
        const TCHAR *name;
        const TCHAR *configname;
-       int romtype, romtype_extra;
+       uae_u32 romtype;
+       int romtype_extra;
        int cputype;
        DEVICE_ADD add;
        int deviceflags;
index 8984f4d5b0ab0f4e73f545a8607121a280646e3e..7a56e5775ebc0b61f57e0b1c48329f8a36c3d9b1 100644 (file)
@@ -56,7 +56,6 @@ void pcmcia_interrupt_set(int);
 
 #define BLIZZARD_SCSI_KIT4_SCSI_OFFSET 0x8000
 #define BLIZZARD_SCSI_KIT4_DMA_OFFSET 0x10000
-
 #define BLIZZARD_SCSI_KIT3_SCSI_OFFSET 0x10000
 
 #define CYBERSTORM_MK2_SCSI_OFFSET 0x1ff03
index a31829431a2f3e171b6c8504e791865831308379..e46682a981491ed1e5e027d738e824b16c7734da 100644 (file)
@@ -202,6 +202,7 @@ extern int decode_cloanto_rom_do (uae_u8 *mem, int size, int real_size);
 #define ROMTYPE_VOODOO5                0x0010008a
 #define ROMTYPE_HD20A          0x0010008b
 #define ROMTYPE_DEVHD          0x0010008c
+#define ROMTYPE_CSMK1SCSI      0x0010008d
 
 #define ROMTYPE_NOT                    0x00800000
 #define ROMTYPE_QUAD           0x01000000
index de10658bb6942505881e82f675f0b68e3af55652..f4671cf00996e115fd649ab979d85b6a54e859ab 100644 (file)
@@ -657,10 +657,10 @@ static struct romdata roms[] = {
        { _T("Combitec HD20A/HD40A"), 0, 0, 0, 0, _T("HD20A\0"), 32768, 267, 0, 0, ROMTYPE_HD20A, 0, 0, NULL,
        0x0e7391b4, 0x7c365adb,0x3496c479,0x5e94a166,0xd834254a,0x6112d91c, NULL, NULL },
 
-       { _T("CyberStorm MK I 68040"), 0, 0, 0, 0, _T("CSMKI\0"), 32768, 95, 0, 0, ROMTYPE_CB_CSMK1, 0, 0, NULL,
-         0, 0, 0, 0, 0, 0, NULL, _T("cyberstormmk1_040.rom") },
-       { _T("CyberStorm MK I 68060"), 0, 0, 0, 0, _T("CSMKI\0"), 65536, 101, 0, 0, ROMTYPE_CB_CSMK1, 0, 0, NULL,
-         0, 0, 0, 0, 0, 0, NULL, _T("cyberstormmk1_060.rom") },
+       { _T("CyberStorm MK I 68060 Support"), 0, 0, 0, 0, _T("CSMKI\0"), 32768, 95, 0, 0, ROMTYPE_CB_CSMK1, 0, 0, NULL,
+       0x33a8ff3a, 0x8f4bdda0,0x10338a48,0x51e4a2fb,0xb4aa6d6e,0x202fe98e, NULL, NULL },
+       { _T("CyberStorm MK I CyberSCSI Module"), 0, 0, 0, 0, _T("CSMKISCSI\0"), 32768, 101, 0, 0, ROMTYPE_CSMK1SCSI, 0, 0, NULL,
+       0x4e71ec63, 0x8e95bc8d,0xa06050fc,0xb596b5b4,0xc8cf9102,0x1ff4aeb3, NULL, NULL },
        { _T("CyberStorm MK II"), 0, 0, 0, 0, _T("CSMKII\0"), 131072, 96, 0, 0, ROMTYPE_CB_CSMK2, 0, 0, NULL,
          0, 0, 0, 0, 0, 0, NULL, _T("cyberstormmk2.rom") },
        { _T("CyberStorm MK III"), 0, 0, 0, 0, _T("CSMKIII\0"), 131072, 97, 0, 0, ROMTYPE_CB_CSMK3, 0, 0, NULL,