diff --git a/src/hw/machine.hpp b/src/hw/machine.hpp index 84b261a..a3baea3 100644 --- a/src/hw/machine.hpp +++ b/src/hw/machine.hpp @@ -62,6 +62,7 @@ class machine { m_cpu.deinit(); m_cmos.deinit(); m_nv2a.deinit(); + m_smbus.deinit(); } void start() { m_cpu.start(); } void exit() { m_cpu.exit(); } diff --git a/src/hw/smbus.cpp b/src/hw/smbus.cpp index ffb471b..244acbc 100644 --- a/src/hw/smbus.cpp +++ b/src/hw/smbus.cpp @@ -281,6 +281,14 @@ smbus::reset() m_block_off = 0; } +void +smbus::deinit() +{ + for (auto dev : m_devs) { + dev.second->deinit(); + } +} + bool smbus::init() { diff --git a/src/hw/smbus.hpp b/src/hw/smbus.hpp index b38870e..206aad2 100644 --- a/src/hw/smbus.hpp +++ b/src/hw/smbus.hpp @@ -33,6 +33,7 @@ class smbus { public: smbus(machine *machine) : m_machine(machine) {} bool init(); + void deinit(); void reset(); void update_io_logging() { update_io(true); } template