atabasedevice: Set dev_id.

Extracted from @Wack0's Wack0/dingusppc-nt@529991bd78

Co-authored-by: Rairii <2650838+Wack0@users.noreply.github.com>
This commit is contained in:
joevt 2024-07-06 15:53:51 -07:00 committed by Mihai Parparita
parent 7d6e87a0d3
commit 7fdfd6109f
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,10 @@ public:
AtaBaseDevice(const std::string name, uint8_t type);
~AtaBaseDevice() = default;
void set_host(IdeChannel* host) { this->host_obj = host; };
void set_host(IdeChannel* host, uint8_t dev_id) {
this->host_obj = host;
this->my_dev_id = dev_id;
};
uint16_t read(const uint8_t reg_addr) override;
void write(const uint8_t reg_addr, const uint16_t value) override;

View File

@ -66,7 +66,7 @@ void IdeChannel::register_device(int id, AtaInterface* dev_obj) {
this->devices[id] = dev_obj;
((AtaBaseDevice*)dev_obj)->set_host(this);
((AtaBaseDevice*)dev_obj)->set_host(this, id);
}
uint32_t IdeChannel::read(const uint8_t reg_addr, const int size)