From 749af5dbc624729862a88e07ca3641180bde9346 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Mon, 20 May 2024 16:44:03 +0200 Subject: [PATCH] unload DC11 --- bus.cpp | 6 ++++++ bus.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/bus.cpp b/bus.cpp index dff1b16..4e5f5a0 100644 --- a/bus.cpp +++ b/bus.cpp @@ -211,6 +211,12 @@ void bus::add_DC11(dc11 *const dc11_) this->dc11_ = dc11_; } +void bus::del_DC11() +{ + delete dc11_; + dc11_ = nullptr; +} + void bus::init() { mmu_->setMMR0(0); diff --git a/bus.h b/bus.h index 2bbb99c..4b9e571 100644 --- a/bus.h +++ b/bus.h @@ -105,6 +105,8 @@ public: void add_tty (tty *const tty_ ); void add_KW11_L(kw11_l *const kw11_l_); void add_DC11 (dc11 *const dc11_ ); + // required to release devices when doing a reload + void del_DC11 (); memory *getRAM() { return m; } cpu *getCpu() { return c; }