From af2c089e75d170fed6ead75ad80250c8630e7fa6 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Mon, 1 Apr 2024 00:11:14 +0200 Subject: ti99: Prevent re-appearing memory contents when swapping cartridges. --- src/devices/bus/ti99/gromport/cartridges.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp index 2846233cf57..e54f82e42ec 100644 --- a/src/devices/bus/ti99/gromport/cartridges.cpp +++ b/src/devices/bus/ti99/gromport/cartridges.cpp @@ -386,6 +386,19 @@ void ti99_cartridge_device::call_unload() } } + // If we don't clear this, swapping cartridges may make old contents reappear + if (memregion("grom")) + machine().memory().region_free(memregion("grom")->name()); + + if (memregion("rom")) + machine().memory().region_free(memregion("rom")->name()); + + if (memregion("nvram")) + machine().memory().region_free(memregion("nvram")->name()); + + if (memregion("ram")) + machine().memory().region_free(memregion("ram")->name()); + m_pcb = nullptr; m_connector->remove(); } -- cgit v1.2.3