From 6173a782f24633b97f35c6e47e992ebf547657b5 Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Wed, 7 Dec 2022 23:36:56 +0100 Subject: [PATCH] Implement ATA hard disk stub. --- devices/common/ata/atabasedevice.h | 2 +- devices/common/ata/atahd.cpp | 35 +++++++++++++++++++++++++++ devices/common/ata/atahd.h | 38 ++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 devices/common/ata/atahd.cpp create mode 100644 devices/common/ata/atahd.h diff --git a/devices/common/ata/atabasedevice.h b/devices/common/ata/atabasedevice.h index 0da84ff..1e43779 100644 --- a/devices/common/ata/atabasedevice.h +++ b/devices/common/ata/atabasedevice.h @@ -40,7 +40,7 @@ public: virtual int perform_command() = 0; -private: +protected: uint8_t regs[33] = {}; }; diff --git a/devices/common/ata/atahd.cpp b/devices/common/ata/atahd.cpp new file mode 100644 index 0000000..88bf510 --- /dev/null +++ b/devices/common/ata/atahd.cpp @@ -0,0 +1,35 @@ +/* +DingusPPC - The Experimental PowerPC Macintosh emulator +Copyright (C) 2018-22 divingkatae and maximum + (theweirdo) spatium + +(Contact divingkatae#1017 or powermax#2286 on Discord for more info) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/** @file ATA hard disk emulation. */ + +#include +#include + +AtaHardDisk::AtaHardDisk() : AtaBaseDevice("ATA-HD") +{ +} + +int AtaHardDisk::perform_command() +{ + LOG_F(INFO, "%s: command 0x%x requested", this->name.c_str(), regs[IDE_Reg::COMMAND]); + return -1; +} diff --git a/devices/common/ata/atahd.h b/devices/common/ata/atahd.h new file mode 100644 index 0000000..c6319f2 --- /dev/null +++ b/devices/common/ata/atahd.h @@ -0,0 +1,38 @@ +/* +DingusPPC - The Experimental PowerPC Macintosh emulator +Copyright (C) 2018-22 divingkatae and maximum + (theweirdo) spatium + +(Contact divingkatae#1017 or powermax#2286 on Discord for more info) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/** @file TA hard disk definitions. */ + +#ifndef ATA_HARD_DISK_H +#define ATA_HARD_DISK_H + +#include + +class AtaHardDisk : public AtaBaseDevice +{ +public: + AtaHardDisk(); + ~AtaHardDisk() = default; + + int perform_command(); +}; + +#endif // ATA_HARD_DISK_H