]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Accelerator board default CPU model setting.
authorToni Wilen <twilen@winuae.net>
Sat, 28 Sep 2019 10:01:08 +0000 (13:01 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 28 Sep 2019 10:01:08 +0000 (13:01 +0300)
cfgfile.cpp
cpuboard.cpp
expansion.cpp
include/autoconf.h
include/cpuboard.h
include/options.h
od-win32/win32gui.cpp

index 36da7f0cd478b4c2bbbb2ae664ae1acc4122320b..c76a2717b48d661be3739be8bbac0ef7c9e98bf1 100644 (file)
@@ -8986,67 +8986,6 @@ int built_in_chipset_prefs (struct uae_prefs *p)
        return 1;
 }
 
-int built_in_cpuboard_prefs(struct uae_prefs *p)
-{
-       int roms[2], roms2[2];
-       
-       roms[0] = -1;
-       roms[1] = -1;
-       roms2[0] = -1;
-       roms2[1] = -1;
-
-       switch(cpuboards[p->cpuboard_type].id)
-       {
-               case BOARD_MACROSYSTEM:
-               switch(p->cpuboard_subtype)
-               {
-                       case BOARD_MACROSYSTEM_SUB_WARPENGINE_A4000:
-                       roms[0] = 93;
-                       break;
-               }
-               break;
-               case BOARD_BLIZZARD:
-               switch(p->cpuboard_subtype)
-               {
-               case BOARD_BLIZZARD_SUB_1230IV:
-                       roms[0] = 89;
-                       break;
-               case BOARD_BLIZZARD_SUB_1260:
-                       roms[0] = 90;
-                       break;
-               case BOARD_BLIZZARD_SUB_2060:
-                       roms[0] = 92;
-                       break;
-               case BOARD_BLIZZARD_SUB_PPC:
-                       roms[0] = p->cpu_model == 68040 ? 99 : 100;
-                       break;
-               }
-               break;
-               case BOARD_CYBERSTORM:
-               switch(p->cpuboard_subtype)
-               {
-               case BOARD_CYBERSTORM_SUB_MK1:
-                       roms[0] = p->cpu_model == 68040 ? 95 : 101;
-                       break;
-               case BOARD_CYBERSTORM_SUB_MK2:
-                       roms[0] = 96;
-                       break;
-               case BOARD_CYBERSTORM_SUB_MK3:
-                       roms[0] = 97;
-                       break;
-               case BOARD_CYBERSTORM_SUB_PPC:
-                       roms[0] = 98;
-                       break;
-               }
-               break;
-       }
-       if (!configure_rom(p, roms, 0))
-               return 0;
-       if (!configure_rom(p, roms2, 0))
-               return 0;
-       return 1;
-}
-
 #ifdef _WIN32
 #define SHADERPARM "string winuae_config : WINUAE_CONFIG ="
 
index cef382bfa19a848c4b3d0837dd34ec71d203db32..60e8354bdba2b16fa94a5b8c8f1f4cb3b9aff3da 100644 (file)
@@ -3012,3 +3012,37 @@ bool cpuboard_autoconfig_init(struct autoconfig_info *aci)
 
        return true;
 }
+
+void cpuboard_set_cpu(struct uae_prefs *p)
+{
+       if (!p->cpuboard_type)
+               return;
+       
+       const struct cpuboardsubtype *cbt = &cpuboards[p->cpuboard_type].subtypes[p->cpuboard_subtype];
+
+       // Lower to higher model
+       if (p->cpu_model < cbt->cputype * 10 + 68000) {
+               p->cpu_model = cbt->cputype * 10 + 68000;
+               if ((p->fpu_model == 68881 || p->fpu_model == 68882) && cbt->cputype >= 4) {
+                       p->fpu_model = cbt->cputype * 10 + 68000;
+               }
+               if (p->mmu_model && p->cpu_model >= 68030) {
+                       p->mmu_model = p->cpu_model;
+               } else {
+                       p->mmu_model = 0;
+               }
+       }
+       // 68040/060 to 68020/030
+       if (p->cpu_model >= 68040 && cbt->cputype < 4) {
+               p->cpu_model = cbt->cputype * 10 + 68000;
+               if (p->fpu_model == 68040 || p->fpu_model == 68060) {
+                       p->fpu_model = 68882;
+               }
+               if (p->mmu_model && p->cpu_model == 68030) {
+                       p->mmu_model = 68030;
+               } else {
+                       p->mmu_model = 0;
+               }
+       }
+       p->address_space_24 = false;
+}
index 168fb065fa7e6520f894bbc1154a97fdda0fca4c..390b8cef0ee6469d7bdfd526c520685cc5b0a1d2 100644 (file)
@@ -6046,7 +6046,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("A3001 Series I"),
                _T("A3001SI"),
-               ROMTYPE_CB_A3001S1, 0,
+               ROMTYPE_CB_A3001S1, 0, 3,
                gvp_add_ide_unit, EXPANSIONTYPE_IDE | EXPANSIONTYPE_24BIT,
                BOARD_MEMORY_Z2,
                8 * 1024 * 1024,
@@ -6056,7 +6056,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("A3001 Series II"),
                _T("A3001SII"),
-               0, 0,
+               0, 0, 3,
                gvp_add_ide_unit, EXPANSIONTYPE_IDE | EXPANSIONTYPE_24BIT,
                BOARD_MEMORY_Z2,
                8 * 1024 * 1024,
@@ -6066,7 +6066,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("A530"),
                _T("GVPA530"),
-               ROMTYPE_GVPS2, 0,
+               ROMTYPE_GVPS2, 0, 3,
                gvp_s2_add_accelerator_scsi_unit, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_24BIT,
                BOARD_MEMORY_Z2,
                8 * 1024 * 1024,
@@ -6078,7 +6078,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("G-Force 030"),
                _T("GVPGFORCE030"),
-               ROMTYPE_GVPS2, ROMTYPE_GVPS12,
+               ROMTYPE_GVPS2, ROMTYPE_GVPS12, 3,
                gvp_s2_add_accelerator_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_25BITMEM,
                128 * 1024 * 1024,
@@ -6088,7 +6088,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("Tek Magic 2040/2060"),
                _T("TekMagic"),
-               ROMTYPE_CB_TEKMAGIC, 0,
+               ROMTYPE_CB_TEKMAGIC, 0, 4,
                tekmagic_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024
@@ -6096,7 +6096,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("A1230 Turbo+ Series II"),
                _T("A1230SII"),
-               ROMTYPE_CB_A1230S2, 0,
+               ROMTYPE_CB_A1230S2, 0, 3,
                gvp_s2_add_accelerator_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_25BITMEM,
                128 * 1024 * 1024,
@@ -6108,7 +6108,7 @@ static const struct cpuboardsubtype gvpboard_sub[] = {
        {
                _T("QuikPak XP"),
                _T("quikpakxp"),
-               ROMTYPE_CB_QUIKPAK, 0,
+               ROMTYPE_CB_QUIKPAK, 0, 6,
                quikpak_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024,
@@ -6121,7 +6121,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard 1230 I/II"),
                _T("Blizzard1230II"),
-               ROMTYPE_CB_B1230MK2, 0,
+               ROMTYPE_CB_B1230MK2, 0, 3,
                cpuboard_ncr9x_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_BLIZZARD_12xx,
                64 * 1024 * 1024,
@@ -6132,7 +6132,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard 1230 III"),
                _T("Blizzard1230III"),
-               ROMTYPE_CB_B1230MK3, 0,
+               ROMTYPE_CB_B1230MK3, 0, 3,
                NULL, 0,
                BOARD_MEMORY_BLIZZARD_12xx,
                32 * 1024 * 1024,
@@ -6143,7 +6143,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard 1230 IV"),
                _T("Blizzard1230IV"),
-               ROMTYPE_CB_BLIZ1230, 0,
+               ROMTYPE_CB_BLIZ1230, 0, 3,
                NULL, EXPANSIONTYPE_FALLBACK_DISABLE | EXPANSIONTYPE_HAS_FALLBACK,
                BOARD_MEMORY_BLIZZARD_12xx,
                256 * 1024 * 1024,
@@ -6154,7 +6154,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard 1260"),
                _T("Blizzard1260"),
-               ROMTYPE_CB_BLIZ1260, 0,
+               ROMTYPE_CB_BLIZ1260, 0, 6,
                NULL, EXPANSIONTYPE_FALLBACK_DISABLE | EXPANSIONTYPE_HAS_FALLBACK,
                BOARD_MEMORY_BLIZZARD_12xx,
                256 * 1024 * 1024,
@@ -6165,7 +6165,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard 2060"),
                _T("Blizzard2060"),
-               ROMTYPE_CB_BLIZ2060, 0,
+               ROMTYPE_CB_BLIZ2060, 0, 6,
                cpuboard_ncr9x_add_scsi_unit, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_FALLBACK_DISABLE | EXPANSIONTYPE_HAS_FALLBACK,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024,
@@ -6176,7 +6176,7 @@ static const struct cpuboardsubtype blizzardboard_sub[] = {
        {
                _T("Blizzard PPC"),
                _T("BlizzardPPC"),
-               ROMTYPE_CB_BLIZPPC, 0,
+               ROMTYPE_CB_BLIZPPC, 0, 4,
                blizzardppc_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_BLIZZARD_PPC,
                256 * 1024 * 1024
@@ -6189,7 +6189,7 @@ static const struct cpuboardsubtype cyberstormboard_sub[] = {
        {
                _T("CyberStorm MK I"),
                _T("CyberStormMK1"),
-               ROMTYPE_CB_CSMK1, 0,
+               ROMTYPE_CB_CSMK1, 0, 4,
                cpuboard_ncr9x_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024
@@ -6197,7 +6197,7 @@ static const struct cpuboardsubtype cyberstormboard_sub[] = {
        {
                _T("CyberStorm MK II"),
                _T("CyberStormMK2"),
-               ROMTYPE_CB_CSMK2, 0,
+               ROMTYPE_CB_CSMK2, 0, 4,
                cpuboard_ncr9x_add_scsi_unit, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_FALLBACK_DISABLE | EXPANSIONTYPE_HAS_FALLBACK,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024
@@ -6205,7 +6205,7 @@ static const struct cpuboardsubtype cyberstormboard_sub[] = {
        {
                _T("CyberStorm MK III"),
                _T("CyberStormMK3"),
-               ROMTYPE_CB_CSMK3, 0,
+               ROMTYPE_CB_CSMK3, 0, 4,
                cyberstorm_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024
@@ -6213,7 +6213,7 @@ static const struct cpuboardsubtype cyberstormboard_sub[] = {
        {
                _T("CyberStorm PPC"),
                _T("CyberStormPPC"),
-               ROMTYPE_CB_CSPPC, 0,
+               ROMTYPE_CB_CSPPC, 0, 4,
                cyberstorm_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024
@@ -6226,7 +6226,7 @@ static const struct cpuboardsubtype macrosystem_sub[] = {
        {
                _T("Warp Engine A4000"),
                _T("WarpEngineA4000"),
-               ROMTYPE_CB_WENGINE, 0,
+               ROMTYPE_CB_WENGINE, 0, 4,
                warpengine_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024,
@@ -6259,7 +6259,7 @@ static const struct cpuboardsubtype mtec_sub[] = {
        {
                _T("E-Matrix 530"),
                _T("e-matrix530"),
-               ROMTYPE_CB_EMATRIX, 0,
+               ROMTYPE_CB_EMATRIX, 0, 3,
                ematrix_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_CUSTOM_32,
                128 * 1024 * 1024,
@@ -6322,7 +6322,7 @@ static const struct cpuboardsubtype commodore_sub[] = {
        {
                _T("A2620/A2630"),
                _T("A2630"),
-               ROMTYPE_CB_A26x0, 0,
+               ROMTYPE_CB_A26x0, 0, 2,
                NULL, 0,
                BOARD_MEMORY_25BITMEM,
                128 * 1024 * 1024,
@@ -6349,7 +6349,7 @@ static const struct cpuboardsubtype dbk_sub[] = {
        {
                _T("1230/1240/Cobra"),
                _T("DKB12x0"),
-               ROMTYPE_CB_DKB, 0,
+               ROMTYPE_CB_DKB, 0, 3,
                cpuboard_dkb_add_scsi_unit, EXPANSIONTYPE_SCSI,
                0,
                128 * 1024 * 1024,
@@ -6360,7 +6360,7 @@ static const struct cpuboardsubtype dbk_sub[] = {
        {
                _T("Wildfire"),
                _T("wildfire"),
-               ROMTYPE_CB_DBK_WF, 0,
+               ROMTYPE_CB_DBK_WF, 0, 4,
                wildfire_add_scsi_unit, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_HAS_FALLBACK,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024,
@@ -6389,7 +6389,7 @@ static const struct cpuboardsubtype fusionforty_sub[] = {
        {
                _T("Fusion Forty"),
                _T("FusionForty"),
-               ROMTYPE_CB_FUSION, 0,
+               ROMTYPE_CB_FUSION, 0, 4,
                NULL, 0,
                0,
                32 * 1024 * 1024
@@ -6402,7 +6402,7 @@ static const struct cpuboardsubtype ivs_sub[] = {
        {
                _T("Vector"),
                _T("Vector"),
-               ROMTYPE_CB_VECTOR, 0,
+               ROMTYPE_CB_VECTOR, 0, 3,
                ivsvector_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                32 * 1024 * 1024,
@@ -6438,7 +6438,7 @@ static const struct cpuboardsubtype pps_sub[] = {
        {
                _T("Zeus 040"),
                _T("Zeus"),
-               ROMTYPE_CB_ZEUS040, 0,
+               ROMTYPE_CB_ZEUS040, 0, 4,
                zeus040_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                64 * 1024 * 1024,
@@ -6456,7 +6456,7 @@ static const struct cpuboardsubtype csa_sub[] = {
        {
                _T("Magnum 40/4"),
                _T("Magnum40"),
-               ROMTYPE_CB_MAGNUM40, 0,
+               ROMTYPE_CB_MAGNUM40, 0, 4,
                magnum40_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_HIGHMEM,
                128 * 1024 * 1024,
@@ -6467,7 +6467,7 @@ static const struct cpuboardsubtype csa_sub[] = {
        {
                _T("Twelve Gauge"),
                _T("twelvegauge"),
-               ROMTYPE_CB_12GAUGE, 0,
+               ROMTYPE_CB_12GAUGE, 0, 3,
                twelvegauge_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_CUSTOM_32,
                32 * 1024 * 1024,
@@ -6498,7 +6498,7 @@ static const struct cpuboardsubtype apollo_sub[] = {
        {
                _T("Apollo 1240/1260"),
                _T("Apollo"),
-               ROMTYPE_CB_APOLLO, 0,
+               ROMTYPE_CB_APOLLO, 0, 4,
                apollo_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_CUSTOM_32,
                64 * 1024 * 1024,
@@ -6514,7 +6514,7 @@ static const struct cpuboardsubtype kupkeboard_sub[] = {
        {
                _T("Golem 030"),
                _T("golem030"),
-               ROMTYPE_CB_GOLEM030, 0,
+               ROMTYPE_CB_GOLEM030, 0, 3,
                NULL, 0,
                BOARD_MEMORY_25BITMEM,
                16 * 1024 * 1024
@@ -6527,7 +6527,7 @@ static const struct cpuboardsubtype dceboard_sub[] = {
        {
                _T("SX32 Pro"),
                _T("sx32pro"),
-               ROMTYPE_CB_SX32PRO, 0,
+               ROMTYPE_CB_SX32PRO, 0, 3,
                NULL, 0,
                BOARD_MEMORY_CUSTOM_32,
                64 * 1024 * 1024
@@ -6535,7 +6535,7 @@ static const struct cpuboardsubtype dceboard_sub[] = {
        {
                _T("Typhoon MK2"),
                _T("typhoon2"),
-               ROMTYPE_CB_TYPHOON2, 0,
+               ROMTYPE_CB_TYPHOON2, 0, 3,
                typhoon2scsi_add_scsi_unit, EXPANSIONTYPE_SCSI,
                BOARD_MEMORY_CUSTOM_32,
                128 * 1024 * 1024,
@@ -6551,7 +6551,7 @@ static const struct cpuboardsubtype harms_sub[] = {
        {
                _T("Professional 3000"),
                _T("harms3kp"),
-               ROMTYPE_CB_HARMS3KP, 0,
+               ROMTYPE_CB_HARMS3KP, 0, 2,
                NULL, 0,
                BOARD_MEMORY_25BITMEM,
                128 * 1024 * 1024,
index a69ef4735f1fce01db508a0b0890781a307d6f85..8830f4d3cad71d58df470ea310386d8a92c4cd50 100644 (file)
@@ -245,6 +245,7 @@ struct cpuboardsubtype
        const TCHAR *name;
        const TCHAR *configname;
        int romtype, romtype_extra;
+       int cputype;
        DEVICE_ADD add;
        int deviceflags;
        int memorytype;
index 7f0f6e3d3818c994633f82215134b644477175d3..d1ee97532ee649e73bcace37ca171bc1a1b27c62 100644 (file)
@@ -22,6 +22,7 @@ void cpuboard_overlay_override(void);
 void cpuboard_setboard(struct uae_prefs *p, int type, int subtype);
 uaecptr cpuboard_get_reset_pc(uaecptr *stack);
 void cpuboard_set_flash_unlocked(bool unlocked);
+void cpuboard_set_cpu(struct uae_prefs *p);
 
 bool ppc_interrupt(int new_m68k_ipl);
 
index 2ef8a4002aab12093d42658177dbd8b21bf1295b..4d483a2abf31153f449c8fe10e0af8ddc9178a77 100644 (file)
@@ -963,7 +963,6 @@ extern uae_u32 cfgfile_modify (uae_u32 index, const TCHAR *parms, uae_u32 size,
 extern void cfgfile_addcfgparam (TCHAR *);
 extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
 extern int built_in_chipset_prefs (struct uae_prefs *p);
-extern int built_in_cpuboard_prefs(struct uae_prefs *p);
 extern int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max);
 extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
 extern void fixup_prefs (struct uae_prefs *prefs, bool userconfig);
index 8f21969289bf797727d43fa64084d7c68c072a77..e8be66ba01cb39251255c44a17c57a084fa3a3fe 100644 (file)
@@ -10685,7 +10685,7 @@ static INT_PTR CALLBACK Expansion2DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LP
                                                } else if (workprefs.ppc_mode == 2) {
                                                        workprefs.ppc_mode = 0;
                                                }
-                                               built_in_cpuboard_prefs(&workprefs);
+                                               cpuboard_set_cpu(&workprefs);
                                                setcpuboardmemsize(hDlg);
                                                enable_for_expansion2dlg(hDlg);
                                                values_to_expansion2dlg(hDlg, 2);
@@ -10702,7 +10702,7 @@ static INT_PTR CALLBACK Expansion2DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LP
                                                } else if (workprefs.ppc_mode == 2) {
                                                        workprefs.ppc_mode = 0;
                                                }
-                                               built_in_cpuboard_prefs(&workprefs);
+                                               cpuboard_set_cpu(&workprefs);
                                                setcpuboardmemsize(hDlg);
                                                enable_for_expansion2dlg(hDlg);
                                                values_to_expansion2dlg(hDlg, 2);