@@ -256,14 +256,13 @@ void MainWindow::create_core(
256256 bool keep_memory) {
257257 // Create machine
258258 auto *new_machine = new machine::Machine (config, true , load_executable);
259-
260259 if (keep_memory && (machine != nullptr )) {
261260 new_machine->memory_rw ()->reset (*machine->memory ());
261+ *new_machine->address_to_blocknum_rw () = *machine->address_to_blocknum ();
262262 }
263263
264264 // Remove old machine
265265 machine.reset (new_machine);
266-
267266 // Create machine view
268267 auto focused_index = central_widget_tabs->currentIndex ();
269268 corescene.reset ();
@@ -310,6 +309,7 @@ void MainWindow::create_core(
310309 connect (
311310 machine->core (), &machine::Core::stop_on_exception_reached, machine.data (),
312311 &machine::Machine::pause);
312+ connect (machine.data (), &machine::Machine::highlight_by_blocknum, this , &MainWindow::handle_highlight_by_blocknum);
313313
314314 // Setup docks
315315 registers->connectToMachine (machine.data ());
@@ -756,6 +756,7 @@ void MainWindow::compile_source() {
756756
757757 connect (&sasm, &SimpleAsm::report_message, this , &MainWindow::report_message);
758758
759+ machine->address_to_blocknum_rw ()->clear ();
759760 sasm.setup (
760761 mem, &symtab, machine::Address (0x00000200 ), machine->core ()->get_xlen (),
761762 machine->address_to_blocknum_rw ());
@@ -767,9 +768,7 @@ void MainWindow::compile_source() {
767768 }
768769 if (!sasm.finish ()) { error_occured = true ; }
769770
770- connect (
771- machine.data (), &machine::Machine::highlight_by_blocknum, editor,
772- &SrcEditor::highlightBlock);
771+ connect (this , &MainWindow::highlight_by_blocknum, editor, &SrcEditor::highlightBlock);
773772
774773 if (error_occured) { show_messages (); }
775774}
0 commit comments