mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-23 21:29:28 +00:00
platinum: self-registration with the device registry.
This commit is contained in:
parent
97b3b9a6f8
commit
5f8a927846
@ -21,6 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
/** Platinum Memory/Display Controller emulation. */
|
||||
|
||||
#include <devices/deviceregistry.h>
|
||||
#include <devices/memctrl/platinum.h>
|
||||
#include <devices/video/displayid.h>
|
||||
#include <loguru.hpp>
|
||||
@ -34,6 +35,8 @@ PlatinumCtrl::PlatinumCtrl() : MemCtrlBase()
|
||||
{
|
||||
this->name = "Platinum Memory Controller";
|
||||
|
||||
supports_types(HWCompType::MEM_CTRL | HWCompType::MMIO_DEV);
|
||||
|
||||
// add MMIO region for the configuration and status registers
|
||||
add_mmio_region(0xF8000000, 0x500, this);
|
||||
|
||||
@ -196,3 +199,9 @@ void PlatinumCtrl::map_phys_ram()
|
||||
ABORT_F("Platinum: could not allocate RAM storage");
|
||||
}
|
||||
}
|
||||
|
||||
static const DeviceDescription Platinum_Descriptor = {
|
||||
PlatinumCtrl::create, {}, {}
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Platinum, Platinum_Descriptor);
|
||||
|
@ -160,8 +160,8 @@ public:
|
||||
PlatinumCtrl();
|
||||
~PlatinumCtrl() = default;
|
||||
|
||||
bool supports_type(HWCompType type) {
|
||||
return (type == HWCompType::MEM_CTRL || type == HWCompType::MMIO_DEV);
|
||||
static std::unique_ptr<HWComponent> create() {
|
||||
return std::unique_ptr<PlatinumCtrl>(new PlatinumCtrl());
|
||||
}
|
||||
|
||||
/* MMIODevice methods */
|
||||
|
Loading…
Reference in New Issue
Block a user