mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-09-28 10:55:27 +00:00
ViaCuda: implement post-initialization.
This commit is contained in:
parent
c1208b398e
commit
0899186ffc
@ -78,6 +78,15 @@ ViaCuda::ViaCuda() {
|
|||||||
this->int_ctrl = nullptr;
|
this->int_ctrl = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ViaCuda::device_postinit()
|
||||||
|
{
|
||||||
|
this->int_ctrl = dynamic_cast<InterruptCtrl*>(
|
||||||
|
gMachineObj->get_comp_by_type(HWCompType::INT_CTRL));
|
||||||
|
this->irq_id = this->int_ctrl->register_dev_int(IntSrc::VIA_CUDA);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void ViaCuda::cuda_init() {
|
void ViaCuda::cuda_init() {
|
||||||
this->old_tip = 0;
|
this->old_tip = 0;
|
||||||
this->old_byteack = 0;
|
this->old_byteack = 0;
|
||||||
@ -189,17 +198,7 @@ void ViaCuda::print_enabled_ints() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViaCuda::init_ints() {
|
|
||||||
// lazy interrupt wiring
|
|
||||||
if (this->int_ctrl == nullptr) {
|
|
||||||
this->int_ctrl = dynamic_cast<InterruptCtrl*>(
|
|
||||||
gMachineObj->get_comp_by_type(HWCompType::INT_CTRL));
|
|
||||||
this->irq_id = this->int_ctrl->register_dev_int(IntSrc::VIA_CUDA);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ViaCuda::update_irq() {
|
inline void ViaCuda::update_irq() {
|
||||||
init_ints();
|
|
||||||
uint8_t new_irq = !!(this->_via_ifr & this->_via_ier & 0x7F);
|
uint8_t new_irq = !!(this->_via_ifr & this->_via_ier & 0x7F);
|
||||||
this->_via_ifr = (this->_via_ifr & 0x7F) | (new_irq << 7);
|
this->_via_ifr = (this->_via_ifr & 0x7F) | (new_irq << 7);
|
||||||
if (new_irq != this->irq) {
|
if (new_irq != this->irq) {
|
||||||
|
@ -154,10 +154,13 @@ public:
|
|||||||
ViaCuda();
|
ViaCuda();
|
||||||
~ViaCuda() = default;
|
~ViaCuda() = default;
|
||||||
|
|
||||||
|
// HWComponent methods
|
||||||
bool supports_type(HWCompType type) {
|
bool supports_type(HWCompType type) {
|
||||||
return (type == HWCompType::ADB_HOST || type == HWCompType::I2C_HOST);
|
return (type == HWCompType::ADB_HOST || type == HWCompType::I2C_HOST);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int device_postinit();
|
||||||
|
|
||||||
uint8_t read(int reg);
|
uint8_t read(int reg);
|
||||||
void write(int reg, uint8_t value);
|
void write(int reg, uint8_t value);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user