mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-11 05:29:43 +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;
|
||||
}
|
||||
|
||||
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() {
|
||||
this->old_tip = 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() {
|
||||
init_ints();
|
||||
uint8_t new_irq = !!(this->_via_ifr & this->_via_ier & 0x7F);
|
||||
this->_via_ifr = (this->_via_ifr & 0x7F) | (new_irq << 7);
|
||||
if (new_irq != this->irq) {
|
||||
|
@ -154,10 +154,13 @@ public:
|
||||
ViaCuda();
|
||||
~ViaCuda() = default;
|
||||
|
||||
// HWComponent methods
|
||||
bool supports_type(HWCompType type) {
|
||||
return (type == HWCompType::ADB_HOST || type == HWCompType::I2C_HOST);
|
||||
};
|
||||
|
||||
int device_postinit();
|
||||
|
||||
uint8_t read(int reg);
|
||||
void write(int reg, uint8_t value);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user