From: Toni Wilen Date: Sat, 28 Sep 2019 10:01:08 +0000 (+0300) Subject: Accelerator board default CPU model setting. X-Git-Tag: 4300~95 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a4a7e258a2ab7717f9059de9852dd30e320a80a0;p=francis%2Fwinuae.git Accelerator board default CPU model setting. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 36da7f0c..c76a2717 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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 =" diff --git a/cpuboard.cpp b/cpuboard.cpp index cef382bf..60e8354b 100644 --- a/cpuboard.cpp +++ b/cpuboard.cpp @@ -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; +} diff --git a/expansion.cpp b/expansion.cpp index 168fb065..390b8cef 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -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, diff --git a/include/autoconf.h b/include/autoconf.h index a69ef473..8830f4d3 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -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; diff --git a/include/cpuboard.h b/include/cpuboard.h index 7f0f6e3d..d1ee9753 100644 --- a/include/cpuboard.h +++ b/include/cpuboard.h @@ -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); diff --git a/include/options.h b/include/options.h index 2ef8a400..4d483a2a 100644 --- a/include/options.h +++ b/include/options.h @@ -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); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 8f219692..e8be66ba 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -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);