mirror of
https://github.com/dingusdev/dingusppc.git
synced 2026-04-20 18:17:02 +00:00
Add type and description to device descriptors.
Add supports_types to device descriptors so that we can determine supported types without having to create the hardware device. Add description so that each device can have an optional description.
This commit is contained in:
@@ -94,7 +94,7 @@ void AdbAppleJack::set_register_3() {
|
||||
}
|
||||
|
||||
static const DeviceDescription AdbAppleJack_Descriptor = {
|
||||
AdbAppleJack::create, {}, {}
|
||||
AdbAppleJack::create, {}, {}, HWCompType::ADB_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AdbAppleJack, AdbAppleJack_Descriptor);
|
||||
|
||||
@@ -133,7 +133,7 @@ static const PropMap AdbBus_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription AdbBus_Descriptor = {
|
||||
AdbBus::create, {}, AdbBus_Properties
|
||||
AdbBus::create, {}, AdbBus_Properties, HWCompType::ADB_HOST
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AdbBus, AdbBus_Descriptor);
|
||||
|
||||
@@ -111,7 +111,7 @@ void AdbKeyboard::set_register_3() {
|
||||
}
|
||||
|
||||
static const DeviceDescription AdbKeyboard_Descriptor = {
|
||||
AdbKeyboard::create, {}, {}
|
||||
AdbKeyboard::create, {}, {}, HWCompType::ADB_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AdbKeyboard, AdbKeyboard_Descriptor);
|
||||
|
||||
@@ -172,7 +172,7 @@ uint8_t AdbMouse::get_buttons_state() const {
|
||||
}
|
||||
|
||||
static const DeviceDescription AdbMouse_Descriptor = {
|
||||
AdbMouse::create, {}, {}
|
||||
AdbMouse::create, {}, {}, HWCompType::ADB_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AdbMouse, AdbMouse_Descriptor);
|
||||
|
||||
@@ -331,7 +331,7 @@ static const PropMap AtaHardDisk_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription AtaHardDisk_Descriptor = {
|
||||
AtaHardDisk::create, {}, AtaHardDisk_Properties
|
||||
AtaHardDisk::create, {}, AtaHardDisk_Properties, HWCompType::IDE_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AtaHardDisk, AtaHardDisk_Descriptor);
|
||||
|
||||
@@ -438,7 +438,7 @@ static const PropMap AtapiCdrom_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription AtapiCdrom_Descriptor = {
|
||||
AtapiCdrom::create, {}, AtapiCdrom_Properties
|
||||
AtapiCdrom::create, {}, AtapiCdrom_Properties, HWCompType::IDE_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AtapiCdrom, AtapiCdrom_Descriptor);
|
||||
|
||||
@@ -117,11 +117,11 @@ void MacioIdeChannel::write(const uint8_t reg_addr, const uint32_t val, const in
|
||||
}
|
||||
|
||||
static const DeviceDescription Ide0_Descriptor = {
|
||||
MacioIdeChannel::create_first, {}, {}
|
||||
MacioIdeChannel::create_first, {}, {}, HWCompType::IDE_BUS
|
||||
};
|
||||
|
||||
static const DeviceDescription Ide1_Descriptor = {
|
||||
MacioIdeChannel::create_second, {}, {}
|
||||
MacioIdeChannel::create_second, {}, {}, HWCompType::IDE_BUS
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Ide0, Ide0_Descriptor);
|
||||
|
||||
@@ -99,7 +99,7 @@ void NVram::save() {
|
||||
}
|
||||
|
||||
static const DeviceDescription Nvram_Descriptor = {
|
||||
NVram::create, {}, {}
|
||||
NVram::create, {}, {}, HWCompType::NVRAM
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(NVRAM, Nvram_Descriptor);
|
||||
|
||||
@@ -394,23 +394,23 @@ static const std::vector<std::string> Chaos_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Bandit1_Descriptor = {
|
||||
Bandit::create_first, {}, Bandit1_Properties
|
||||
Bandit::create_first, {}, Bandit1_Properties, HWCompType::PCI_HOST
|
||||
};
|
||||
|
||||
static const DeviceDescription Bandit2_Descriptor = {
|
||||
Bandit::create_second, {}, Bandit2_Properties
|
||||
Bandit::create_second, {}, Bandit2_Properties, HWCompType::PCI_HOST
|
||||
};
|
||||
|
||||
static const DeviceDescription PsxPci1_Descriptor = {
|
||||
Bandit::create_psx_first, {}, PsxPci1_Properties
|
||||
Bandit::create_psx_first, {}, PsxPci1_Properties, HWCompType::PCI_HOST
|
||||
};
|
||||
|
||||
static const DeviceDescription Chaos_Descriptor = {
|
||||
Chaos::create, Chaos_Subdevices, Chaos_Properties
|
||||
Chaos::create, Chaos_Subdevices, Chaos_Properties, HWCompType::PCI_HOST
|
||||
};
|
||||
|
||||
static const DeviceDescription AspenPci1_Descriptor = {
|
||||
AspenPci::create, {}, Bandit1_Properties
|
||||
AspenPci::create, {}, Bandit1_Properties, HWCompType::PCI_HOST
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Bandit1, Bandit1_Descriptor);
|
||||
|
||||
@@ -102,11 +102,11 @@ static const PropMap Dec21154Yosemite_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Dec21154_Descriptor = {
|
||||
DecPciBridge::create, {}, {}
|
||||
DecPciBridge::create, {}, {}, HWCompType::PCI_HOST | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
static const DeviceDescription Dec21154Yosemite_Descriptor = {
|
||||
DecPciBridge::create_yosemite, {}, Dec21154Yosemite_Properties
|
||||
DecPciBridge::create_yosemite, {}, Dec21154Yosemite_Properties, HWCompType::PCI_HOST | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Dec21154, Dec21154_Descriptor);
|
||||
|
||||
@@ -304,11 +304,11 @@ static const std::vector<std::string> Mesh_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Mesh_Tnt_Descriptor = {
|
||||
MeshController::create_for_tnt, Mesh_Subdevices, Mesh_properties
|
||||
MeshController::create_for_tnt, Mesh_Subdevices, Mesh_properties, HWCompType::SCSI_HOST | HWCompType::SCSI_DEV
|
||||
};
|
||||
|
||||
static const DeviceDescription Mesh_Heathrow_Descriptor = {
|
||||
MeshController::create_for_heathrow, Mesh_Subdevices, Mesh_properties
|
||||
MeshController::create_for_heathrow, Mesh_Subdevices, Mesh_properties, HWCompType::SCSI_HOST | HWCompType::SCSI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(MeshTnt, Mesh_Tnt_Descriptor);
|
||||
|
||||
@@ -929,7 +929,7 @@ static const std::vector<std::string> Sc53C94_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Sc53C94_Descriptor = {
|
||||
Sc53C94::create, Sc53C94_Subdevices, Sc53C94_properties
|
||||
Sc53C94::create, Sc53C94_Subdevices, Sc53C94_properties, HWCompType::SCSI_HOST | HWCompType::SCSI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Sc53C94, Sc53C94_Descriptor);
|
||||
|
||||
@@ -377,11 +377,11 @@ void ScsiBus::attach_scsi_devices(const std::string bus_suffix)
|
||||
}
|
||||
|
||||
static const DeviceDescription ScsiCurio_Descriptor = {
|
||||
ScsiBus::create_ScsiCurio, {}, {}
|
||||
ScsiBus::create_ScsiCurio, {}, {}, HWCompType::SCSI_BUS
|
||||
};
|
||||
|
||||
static const DeviceDescription ScsiMesh_Descriptor = {
|
||||
ScsiBus::create_ScsiMesh, {}, {}
|
||||
ScsiBus::create_ScsiMesh, {}, {}, HWCompType::SCSI_BUS
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(ScsiCurio, ScsiCurio_Descriptor);
|
||||
|
||||
@@ -861,7 +861,7 @@ static const vector<string> Cuda_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription ViaCuda_Descriptor = {
|
||||
ViaCuda::create, Cuda_Subdevices, {}
|
||||
ViaCuda::create, Cuda_Subdevices, {}, HWCompType::ADB_HOST | HWCompType::I2C_HOST
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(ViaCuda, ViaCuda_Descriptor);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
DingusPPC - The Experimental PowerPC Macintosh emulator
|
||||
Copyright (C) 2018-22 divingkatae and maximum
|
||||
Copyright (C) 2018-25 divingkatae and maximum
|
||||
(theweirdo) spatium
|
||||
|
||||
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
||||
@@ -40,6 +40,8 @@ struct DeviceDescription {
|
||||
CreateFunc m_create_func;
|
||||
std::vector<std::string> subdev_list;
|
||||
PropMap properties;
|
||||
uint64_t supports_types;
|
||||
std::string description;
|
||||
};
|
||||
|
||||
class DeviceRegistry
|
||||
|
||||
@@ -444,11 +444,11 @@ void BigMac::srom_xmit_bit(const uint8_t bit_val) {
|
||||
}
|
||||
|
||||
static const DeviceDescription BigMac_Heathrow_Descriptor = {
|
||||
BigMac::create_for_heathrow, {}, {}
|
||||
BigMac::create_for_heathrow, {}, {}, HWCompType::MMIO_DEV | HWCompType::ETHER_MAC
|
||||
};
|
||||
|
||||
static const DeviceDescription BigMac_Paddington_Descriptor = {
|
||||
BigMac::create_for_paddington, {}, {}
|
||||
BigMac::create_for_paddington, {}, {}, HWCompType::MMIO_DEV | HWCompType::ETHER_MAC
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(BigMacHeathrow, BigMac_Heathrow_Descriptor);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
DingusPPC - The Experimental PowerPC Macintosh emulator
|
||||
Copyright (C) 2018-24 divingkatae and maximum
|
||||
Copyright (C) 2018-25 divingkatae and maximum
|
||||
(theweirdo) spatium
|
||||
|
||||
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
||||
@@ -113,7 +113,7 @@ void MaceController::write(uint8_t reg_offset, uint8_t value)
|
||||
}
|
||||
|
||||
static const DeviceDescription Mace_Descriptor = {
|
||||
MaceController::create, {}, {}
|
||||
MaceController::create, {}, {}, HWCompType::MMIO_DEV | HWCompType::ETHER_MAC
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Mace, Mace_Descriptor);
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace Swim3;
|
||||
Swim3Ctrl::Swim3Ctrl()
|
||||
{
|
||||
this->name = "SWIM3";
|
||||
this->supported_types = HWCompType::FLOPPY_CTRL;
|
||||
supports_types(HWCompType::FLOPPY_CTRL);
|
||||
|
||||
this->reset();
|
||||
|
||||
@@ -440,7 +440,7 @@ static const PropMap Swim3_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Swim3_Descriptor = {
|
||||
Swim3Ctrl::create, {}, Swim3_Properties
|
||||
Swim3Ctrl::create, {}, Swim3_Properties, HWCompType::FLOPPY_CTRL
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Swim3, Swim3_Descriptor);
|
||||
|
||||
@@ -831,7 +831,7 @@ static std::vector<std::string> Amic_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Amic_Descriptor = {
|
||||
AMIC::create, Amic_Subdevices, {}
|
||||
AMIC::create, Amic_Subdevices, {}, HWCompType::MMIO_DEV | HWCompType::INT_CTRL
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Amic, Amic_Descriptor);
|
||||
|
||||
@@ -586,11 +586,13 @@ static const std::vector<std::string> GrandCentralTnt_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription GrandCentralCatalyst_Descriptor = {
|
||||
GrandCentral::create, GrandCentralCatalyst_Subdevices, {}
|
||||
GrandCentral::create, GrandCentralCatalyst_Subdevices, {},
|
||||
HWCompType::MMIO_DEV | HWCompType::PCI_DEV | HWCompType::INT_CTRL
|
||||
};
|
||||
|
||||
static const DeviceDescription GrandCentralTnt_Descriptor = {
|
||||
GrandCentral::create, GrandCentralTnt_Subdevices, {}
|
||||
GrandCentral::create, GrandCentralTnt_Subdevices, {},
|
||||
HWCompType::MMIO_DEV | HWCompType::PCI_DEV | HWCompType::INT_CTRL
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(GrandCentralCatalyst, GrandCentralCatalyst_Descriptor);
|
||||
|
||||
@@ -546,7 +546,8 @@ static const vector<string> Heathrow_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Heathrow_Descriptor = {
|
||||
HeathrowIC::create, Heathrow_Subdevices, {}
|
||||
HeathrowIC::create, Heathrow_Subdevices, {},
|
||||
HWCompType::MMIO_DEV | HWCompType::PCI_DEV | HWCompType::INT_CTRL
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Heathrow, Heathrow_Descriptor);
|
||||
|
||||
@@ -493,7 +493,8 @@ static const std::vector<std::string> OHare_Subdevices = {
|
||||
};
|
||||
|
||||
static const DeviceDescription OHare_Descriptor = {
|
||||
OHare::create, OHare_Subdevices, {
|
||||
}};
|
||||
OHare::create, OHare_Subdevices, {},
|
||||
HWCompType::MMIO_DEV | HWCompType::PCI_DEV | HWCompType::INT_CTRL
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(OHare, OHare_Descriptor);
|
||||
|
||||
@@ -172,7 +172,7 @@ int AspenCtrl::map_phys_ram() {
|
||||
}
|
||||
|
||||
static const DeviceDescription Aspen_Descriptor = {
|
||||
AspenCtrl::create, {}, {}
|
||||
AspenCtrl::create, {}, {}, HWCompType::MEM_CTRL | HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Aspen, Aspen_Descriptor);
|
||||
|
||||
@@ -170,7 +170,7 @@ void HammerheadCtrl::map_phys_ram()
|
||||
}
|
||||
|
||||
static const DeviceDescription Hammerhead_Descriptor = {
|
||||
HammerheadCtrl::create, {}, {}
|
||||
HammerheadCtrl::create, {}, {}, HWCompType::MEM_CTRL | HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Hammerhead, Hammerhead_Descriptor);
|
||||
|
||||
@@ -205,7 +205,7 @@ int HMC::install_ram(uint32_t mb_bank_size, uint32_t bank_a_size, uint32_t bank_
|
||||
}
|
||||
|
||||
static const DeviceDescription Hmc_Descriptor = {
|
||||
HMC::create, {}, {}
|
||||
HMC::create, {}, {}, HWCompType::MEM_CTRL | HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(HMC, Hmc_Descriptor);
|
||||
|
||||
@@ -324,7 +324,8 @@ static const PropMap Grackle_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Grackle_Descriptor = {
|
||||
MPC106::create, {}, Grackle_Properties
|
||||
MPC106::create, {}, Grackle_Properties,
|
||||
HWCompType::MEM_CTRL | HWCompType::MMIO_DEV | HWCompType::PCI_HOST | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Grackle, Grackle_Descriptor);
|
||||
|
||||
@@ -618,7 +618,7 @@ static const PropMap Platinum_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Platinum_Descriptor = {
|
||||
PlatinumCtrl::create, {}, Platinum_Properties
|
||||
PlatinumCtrl::create, {}, Platinum_Properties, HWCompType::MEM_CTRL | HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Platinum, Platinum_Descriptor);
|
||||
|
||||
@@ -122,7 +122,7 @@ void PsxCtrl::map_phys_ram()
|
||||
}
|
||||
|
||||
static const DeviceDescription Psx_Descriptor = {
|
||||
PsxCtrl::create, {}, {}
|
||||
PsxCtrl::create, {}, {}, HWCompType::MEM_CTRL | HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Psx, Psx_Descriptor);
|
||||
|
||||
@@ -486,7 +486,7 @@ static const PropMap Escc_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Escc_Descriptor = {
|
||||
EsccController::create, {}, Escc_Properties
|
||||
EsccController::create, {}, Escc_Properties, HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Escc, Escc_Descriptor);
|
||||
|
||||
@@ -249,7 +249,7 @@ void AwacsScreamer::snd_ctrl_write(uint32_t offset, uint32_t value, int size) {
|
||||
}
|
||||
|
||||
static const DeviceDescription Screamer_Descriptor = {
|
||||
AwacsScreamer::create, {}, {}
|
||||
AwacsScreamer::create, {}, {}, HWCompType::SND_CODEC
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(ScreamerSnd, Screamer_Descriptor);
|
||||
|
||||
@@ -99,7 +99,7 @@ void BurgundyCodec::snd_ctrl_write(uint32_t offset, uint32_t value, int size) {
|
||||
}
|
||||
|
||||
static const DeviceDescription Burgundy_Descriptor = {
|
||||
BurgundyCodec::create, {}, {}
|
||||
BurgundyCodec::create, {}, {}, HWCompType::SND_CODEC
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(BurgundySnd, Burgundy_Descriptor);
|
||||
|
||||
@@ -1090,7 +1090,7 @@ static const PropMap AtiMach64gx_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription AtiMach64Gx_Descriptor = {
|
||||
AtiMach64Gx::create, {}, AtiMach64gx_Properties
|
||||
AtiMach64Gx::create, {}, AtiMach64gx_Properties, HWCompType::MMIO_DEV | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AtiMach64Gx, AtiMach64Gx_Descriptor);
|
||||
|
||||
@@ -985,11 +985,11 @@ static const PropMap AtiRage_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription AtiRageGT_Descriptor = {
|
||||
ATIRage::create_gt, {}, AtiRage_Properties
|
||||
ATIRage::create_gt, {}, AtiRage_Properties, HWCompType::MMIO_DEV | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
static const DeviceDescription AtiRagePro_Descriptor = {
|
||||
ATIRage::create_pro, {}, AtiRage_Properties
|
||||
ATIRage::create_pro, {}, AtiRage_Properties, HWCompType::MMIO_DEV | HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(AtiRageGT, AtiRageGT_Descriptor);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace loguru {
|
||||
ControlVideo::ControlVideo()
|
||||
: PCIDevice("Control-Video"), VideoCtrlBase()
|
||||
{
|
||||
supports_types(HWCompType::PCI_HOST | HWCompType::PCI_DEV);
|
||||
supports_types(HWCompType::PCI_DEV);
|
||||
|
||||
// get VRAM size in MBs and convert it to bytes
|
||||
this->vram_size = GET_INT_PROP("gfxmem_size") << 20;
|
||||
@@ -702,7 +702,7 @@ static const PropMap Control_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Control_Descriptor = {
|
||||
ControlVideo::create, {}, Control_Properties
|
||||
ControlVideo::create, {}, Control_Properties, HWCompType::PCI_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(ControlVideo, Control_Descriptor);
|
||||
|
||||
@@ -441,7 +441,7 @@ static const PropMap Sixty6_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Sixty6_Descriptor = {
|
||||
Sixty6Video::create, {}, Sixty6_Properties
|
||||
Sixty6Video::create, {}, Sixty6_Properties, HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Sixty6Video, Sixty6_Descriptor);
|
||||
|
||||
@@ -267,7 +267,7 @@ static const PropMap Taos_Properties = {
|
||||
};
|
||||
|
||||
static const DeviceDescription Taos_Descriptor = {
|
||||
TaosVideo::create, {}, Taos_Properties
|
||||
TaosVideo::create, {}, Taos_Properties, HWCompType::MMIO_DEV
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(TaosVideo, Taos_Descriptor);
|
||||
|
||||
Reference in New Issue
Block a user