mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-23 05:29:26 +00:00
G3 CPU upgrade property.
This commit is contained in:
parent
5c2bd0b3bb
commit
74274f164d
@ -76,8 +76,22 @@ int initialize_catalyst(std::string& id)
|
|||||||
// allocate and map physical RAM
|
// allocate and map physical RAM
|
||||||
platinum_obj->map_phys_ram();
|
platinum_obj->map_phys_ram();
|
||||||
|
|
||||||
|
std::string cpu = GET_STR_PROP("cpu");
|
||||||
|
if (cpu == "601") {
|
||||||
// init virtual CPU and request MPC601
|
// init virtual CPU and request MPC601
|
||||||
ppc_cpu_init(platinum_obj, PPC_VER::MPC601, 7833600ULL);
|
ppc_cpu_init(platinum_obj, PPC_VER::MPC601, 7833600ULL);
|
||||||
|
}
|
||||||
|
else if (cpu == "750") {
|
||||||
|
// configure CPU clocks
|
||||||
|
uint64_t bus_freq = 50000000ULL;
|
||||||
|
uint64_t timebase_freq = bus_freq / 4;
|
||||||
|
|
||||||
|
// initialize virtual CPU and request MPC750 CPU aka G3
|
||||||
|
ppc_cpu_init(platinum_obj, PPC_VER::MPC750, timebase_freq);
|
||||||
|
|
||||||
|
// set CPU PLL ratio to 3.5
|
||||||
|
ppc_state.spr[SPR::HID1] = 0xE << 28;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -93,6 +107,8 @@ static const PropMap pm7200_settings = {
|
|||||||
new IntProperty( 0, vector<uint32_t>({0, 4, 8, 16, 32, 64, 128}))},
|
new IntProperty( 0, vector<uint32_t>({0, 4, 8, 16, 32, 64, 128}))},
|
||||||
{"emmo",
|
{"emmo",
|
||||||
new BinProperty(0)},
|
new BinProperty(0)},
|
||||||
|
{"cpu",
|
||||||
|
new StrProperty("601", vector<std::string>({"601", "750"}))},
|
||||||
};
|
};
|
||||||
|
|
||||||
static vector<string> pm7200_devices = {
|
static vector<string> pm7200_devices = {
|
||||||
|
@ -97,6 +97,7 @@ static const map<string, string> PropHelp = {
|
|||||||
{"vci_F", "insert a VCI device 0x0F"},
|
{"vci_F", "insert a VCI device 0x0F"},
|
||||||
{"serial_backend", "specifies the backend for the serial port"},
|
{"serial_backend", "specifies the backend for the serial port"},
|
||||||
{"emmo", "enables/disables factory HW tests during startup"},
|
{"emmo", "enables/disables factory HW tests during startup"},
|
||||||
|
{"cpu", "specifies CPU"},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool MachineFactory::add(const string& machine_id, MachineDescription desc)
|
bool MachineFactory::add(const string& machine_id, MachineDescription desc)
|
||||||
|
@ -99,14 +99,27 @@ int initialize_tnt(std::string& id)
|
|||||||
memctrl_obj->map_phys_ram();
|
memctrl_obj->map_phys_ram();
|
||||||
|
|
||||||
// init virtual CPU
|
// init virtual CPU
|
||||||
if (id == "pm7300")
|
std::string cpu = GET_STR_PROP("cpu");
|
||||||
|
if (cpu == "604e")
|
||||||
ppc_cpu_init(memctrl_obj, PPC_VER::MPC604E, 12500000ULL);
|
ppc_cpu_init(memctrl_obj, PPC_VER::MPC604E, 12500000ULL);
|
||||||
else
|
else if (cpu == "601")
|
||||||
ppc_cpu_init(memctrl_obj, PPC_VER::MPC601, 7833600ULL);
|
ppc_cpu_init(memctrl_obj, PPC_VER::MPC601, 7833600ULL);
|
||||||
|
else if (cpu == "750") {
|
||||||
|
// configure CPU clocks
|
||||||
|
uint64_t bus_freq = 50000000ULL;
|
||||||
|
uint64_t timebase_freq = bus_freq / 4;
|
||||||
|
|
||||||
|
// initialize virtual CPU and request MPC750 CPU aka G3
|
||||||
|
ppc_cpu_init(memctrl_obj, PPC_VER::MPC750, timebase_freq);
|
||||||
|
|
||||||
|
// set CPU PLL ratio to 3.5
|
||||||
|
ppc_state.spr[SPR::HID1] = 0xE << 28;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <uint32_t cpu>
|
||||||
static const PropMap pm7500_settings = {
|
static const PropMap pm7500_settings = {
|
||||||
{"rambank1_size",
|
{"rambank1_size",
|
||||||
new IntProperty(16, vector<uint32_t>({4, 8, 16, 32, 64, 128}))},
|
new IntProperty(16, vector<uint32_t>({4, 8, 16, 32, 64, 128}))},
|
||||||
@ -122,6 +135,12 @@ static const PropMap pm7500_settings = {
|
|||||||
new BinProperty(0)},
|
new BinProperty(0)},
|
||||||
{"has_mesh",
|
{"has_mesh",
|
||||||
new BinProperty(1)},
|
new BinProperty(1)},
|
||||||
|
{"cpu",
|
||||||
|
new StrProperty(
|
||||||
|
cpu == PPC_VER::MPC601 ? "601" :
|
||||||
|
cpu == PPC_VER::MPC604 ? "604" :
|
||||||
|
cpu == PPC_VER::MPC604E ? "604e" :
|
||||||
|
"604e", vector<std::string>({"601", "604", "604e", "750"}))},
|
||||||
};
|
};
|
||||||
|
|
||||||
static vector<string> pm7500_devices = {
|
static vector<string> pm7500_devices = {
|
||||||
@ -132,7 +151,7 @@ static const MachineDescription pm7300_descriptor = {
|
|||||||
.name = "pm7300",
|
.name = "pm7300",
|
||||||
.description = "Power Macintosh 7300",
|
.description = "Power Macintosh 7300",
|
||||||
.devices = pm7500_devices,
|
.devices = pm7500_devices,
|
||||||
.settings = pm7500_settings,
|
.settings = pm7500_settings<PPC_VER::MPC604E>,
|
||||||
.init_func = &initialize_tnt
|
.init_func = &initialize_tnt
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -140,7 +159,7 @@ static const MachineDescription pm7500_descriptor = {
|
|||||||
.name = "pm7500",
|
.name = "pm7500",
|
||||||
.description = "Power Macintosh 7500",
|
.description = "Power Macintosh 7500",
|
||||||
.devices = pm7500_devices,
|
.devices = pm7500_devices,
|
||||||
.settings = pm7500_settings,
|
.settings = pm7500_settings<PPC_VER::MPC601>,
|
||||||
.init_func = &initialize_tnt
|
.init_func = &initialize_tnt
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user