@@ -258,14 +258,13 @@ void MainWindow::create_core(
258258 bool keep_memory) {
259259 // Create machine
260260 auto *new_machine = new machine::Machine (config, true , load_executable);
261-
262261 if (keep_memory && (machine != nullptr )) {
263262 new_machine->memory_rw ()->reset (*machine->memory ());
263+ *new_machine->address_to_blocknum_rw () = *machine->address_to_blocknum ();
264264 }
265265
266266 // Remove old machine
267267 machine.reset (new_machine);
268-
269268 // Create machine view
270269 auto focused_index = central_widget_tabs->currentIndex ();
271270 corescene.reset ();
@@ -312,6 +311,7 @@ void MainWindow::create_core(
312311 connect (
313312 machine->core (), &machine::Core::stop_on_exception_reached, machine.data (),
314313 &machine::Machine::pause);
314+ connect (machine.data (), &machine::Machine::highlight_by_blocknum, this , &MainWindow::handle_highlight_by_blocknum);
315315
316316 // Setup docks
317317 registers->connectToMachine (machine.data ());
@@ -760,6 +760,7 @@ void MainWindow::compile_source() {
760760
761761 connect (&sasm, &SimpleAsm::report_message, this , &MainWindow::report_message);
762762
763+ machine->address_to_blocknum_rw ()->clear ();
763764 sasm.setup (
764765 mem, &symtab, machine::Address (0x00000200 ), machine->core ()->get_xlen (),
765766 machine->address_to_blocknum_rw ());
@@ -771,9 +772,7 @@ void MainWindow::compile_source() {
771772 }
772773 if (!sasm.finish ()) { error_occured = true ; }
773774
774- connect (
775- machine.data (), &machine::Machine::highlight_by_blocknum, editor,
776- &SrcEditor::highlightBlock);
775+ connect (this , &MainWindow::highlight_by_blocknum, editor, &SrcEditor::highlightBlock);
777776
778777 if (error_occured) { show_messages (); }
779778}
0 commit comments