Add ability to override built-in GPU.
This commit is contained in:
parent
077e6ebae5
commit
d0a5a1e7be
|
@ -60,7 +60,7 @@ int MPC106::device_postinit()
|
||||||
std::string pci_dev_name;
|
std::string pci_dev_name;
|
||||||
|
|
||||||
static const std::map<std::string, int> pci_slots = {
|
static const std::map<std::string, int> pci_slots = {
|
||||||
{"pci_PERCH", DEV_FUN(0xC,0)}, {"pci_A1", DEV_FUN(0xD,0)}, {"pci_B1", DEV_FUN(0xE,0)}, {"pci_C1", DEV_FUN(0xF,0)}
|
{"pci_PERCH", DEV_FUN(0xC,0)}, {"pci_A1", DEV_FUN(0xD,0)}, {"pci_B1", DEV_FUN(0xE,0)}, {"pci_C1", DEV_FUN(0xF,0)}, {"pci_GPU", DEV_FUN(0x12,0)}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto& slot : pci_slots) {
|
for (auto& slot : pci_slots) {
|
||||||
|
@ -351,6 +351,8 @@ static const PropMap Grackle_Properties = {
|
||||||
new StrProperty("")},
|
new StrProperty("")},
|
||||||
{"pci_C1",
|
{"pci_C1",
|
||||||
new StrProperty("")},
|
new StrProperty("")},
|
||||||
|
{"pci_GPU",
|
||||||
|
new StrProperty("")},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const DeviceDescription Grackle_Descriptor = {
|
static const DeviceDescription Grackle_Descriptor = {
|
||||||
|
|
|
@ -123,8 +123,10 @@ int initialize_gossamer(std::string& id)
|
||||||
// add pci devices
|
// add pci devices
|
||||||
grackle_obj->pci_register_device(
|
grackle_obj->pci_register_device(
|
||||||
DEV_FUN(0x10,0), dynamic_cast<PCIDevice*>(gMachineObj->get_comp_by_name("Heathrow")));
|
DEV_FUN(0x10,0), dynamic_cast<PCIDevice*>(gMachineObj->get_comp_by_name("Heathrow")));
|
||||||
grackle_obj->pci_register_device(
|
|
||||||
DEV_FUN(0x12,0), dynamic_cast<PCIDevice*>(gMachineObj->get_comp_by_name(id == "pmg3twr" ? "AtiRagePro" : "AtiRageGT")));
|
std::string gpu = GET_STR_PROP("pci_GPU");
|
||||||
|
if (gpu.empty())
|
||||||
|
SET_STR_PROP("pci_GPU", id == "pmg3twr" ? "AtiRagePro" : "AtiRageGT");
|
||||||
|
|
||||||
// add Athens clock generator device and register it with the I2C host
|
// add Athens clock generator device and register it with the I2C host
|
||||||
gMachineObj->add_device("Athens", std::unique_ptr<AthensClocks>(new AthensClocks(0x28)));
|
gMachineObj->add_device("Athens", std::unique_ptr<AthensClocks>(new AthensClocks(0x28)));
|
||||||
|
@ -168,11 +170,11 @@ static const PropMap gossamer_settings = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static vector<string> pmg3_devices = {
|
static vector<string> pmg3_devices = {
|
||||||
"Grackle", "ScreamerSnd", "Heathrow", "AtiRageGT", "AtaHardDisk", "AtapiCdrom"
|
"Grackle", "ScreamerSnd", "Heathrow", "AtaHardDisk", "AtapiCdrom"
|
||||||
};
|
};
|
||||||
|
|
||||||
static vector<string> pmg3twr_devices = {
|
static vector<string> pmg3twr_devices = {
|
||||||
"Grackle", "ScreamerSnd", "Heathrow", "AtiRagePro", "AtaHardDisk", "AtapiCdrom"
|
"Grackle", "ScreamerSnd", "Heathrow", "AtaHardDisk", "AtapiCdrom"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const MachineDescription pmg3dt_descriptor = {
|
static const MachineDescription pmg3dt_descriptor = {
|
||||||
|
|
|
@ -196,6 +196,9 @@ typedef map<string, BasicProperty*> PropMap;
|
||||||
extern map<string, unique_ptr<BasicProperty>> gMachineSettings;
|
extern map<string, unique_ptr<BasicProperty>> gMachineSettings;
|
||||||
|
|
||||||
/** Conveniency macros to hide complex casts. */
|
/** Conveniency macros to hide complex casts. */
|
||||||
|
#define SET_STR_PROP(name, value) \
|
||||||
|
dynamic_cast<StrProperty*>(gMachineSettings.at(name).get())->set_string(value)
|
||||||
|
|
||||||
#define GET_STR_PROP(name) \
|
#define GET_STR_PROP(name) \
|
||||||
dynamic_cast<StrProperty*>(gMachineSettings.at(name).get())->get_string()
|
dynamic_cast<StrProperty*>(gMachineSettings.at(name).get())->get_string()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue