2022-12-07 22:36:56 +00:00
|
|
|
/*
|
|
|
|
DingusPPC - The Experimental PowerPC Macintosh emulator
|
2023-04-17 07:56:03 +00:00
|
|
|
Copyright (C) 2018-23 divingkatae and maximum
|
2022-12-07 22:36:56 +00:00
|
|
|
(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 <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-04-17 07:56:03 +00:00
|
|
|
/** @file ATA hard disk definitions. */
|
2022-12-07 22:36:56 +00:00
|
|
|
|
|
|
|
#ifndef ATA_HARD_DISK_H
|
|
|
|
#define ATA_HARD_DISK_H
|
|
|
|
|
|
|
|
#include <devices/common/ata/atabasedevice.h>
|
2023-09-16 21:17:27 +00:00
|
|
|
#include <utils/imgfile.h>
|
|
|
|
|
2022-12-08 23:52:39 +00:00
|
|
|
#include <string>
|
2022-12-07 22:36:56 +00:00
|
|
|
|
2023-04-17 07:56:03 +00:00
|
|
|
#define ATA_HD_SEC_SIZE 512
|
|
|
|
|
2022-12-07 22:36:56 +00:00
|
|
|
class AtaHardDisk : public AtaBaseDevice
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AtaHardDisk();
|
|
|
|
~AtaHardDisk() = default;
|
|
|
|
|
2022-12-08 23:52:39 +00:00
|
|
|
void insert_image(std::string filename);
|
2023-04-24 21:02:32 +00:00
|
|
|
int perform_command() override;
|
2022-12-08 23:52:39 +00:00
|
|
|
|
|
|
|
private:
|
2023-09-16 21:17:27 +00:00
|
|
|
ImgFile hdd_img;
|
2022-12-08 23:52:39 +00:00
|
|
|
uint64_t img_size;
|
|
|
|
char * buffer = new char[1 <<17];
|
2022-12-11 23:08:43 +00:00
|
|
|
|
2023-04-17 07:56:03 +00:00
|
|
|
uint8_t hd_id_data[ATA_HD_SEC_SIZE] = {};
|
2022-12-07 22:36:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ATA_HARD_DISK_H
|