File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class BoxEmu : public espp::BaseComponent {
126126 // ///////////////////////////////////////////////////////////////////////////
127127
128128 bool initialize_memory ();
129+ void deinitialize_memory ();
129130 size_t copy_file_to_romdata (const std::string& filename);
130131 uint8_t *romdata () const ;
131132
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ sdmmc_card_t *BoxEmu::sdcard() const {
182182// Memory
183183// ///////////////////////////////////////////////////////////////////////////
184184
185- static constexpr size_t memory_size = 6 *1024 *1024 ;
185+ static constexpr size_t memory_size = 4 *1024 *1024 ;
186186
187187extern " C" uint8_t *osd_getromdata () {
188188 auto &emu = BoxEmu::get ();
@@ -206,6 +206,14 @@ bool BoxEmu::initialize_memory() {
206206 return true ;
207207}
208208
209+ void BoxEmu::deinitialize_memory () {
210+ if (romdata_) {
211+ logger_.info (" Deinitializing memory (romdata)" );
212+ free (romdata_);
213+ romdata_ = nullptr ;
214+ }
215+ }
216+
209217size_t BoxEmu::copy_file_to_romdata (const std::string& filename) {
210218 // load the file data and iteratively copy it over
211219 std::ifstream romfile (filename, std::ios::binary | std::ios::ate); // open file at end
You can’t perform that action at this time.
0 commit comments