@@ -258,14 +258,13 @@ void MainWindow::create_core(
258
258
bool keep_memory) {
259
259
// Create machine
260
260
auto *new_machine = new machine::Machine (config, true , load_executable);
261
-
262
261
if (keep_memory && (machine != nullptr )) {
263
262
new_machine->memory_rw ()->reset (*machine->memory ());
263
+ *new_machine->address_to_blocknum_rw () = *machine->address_to_blocknum ();
264
264
}
265
265
266
266
// Remove old machine
267
267
machine.reset (new_machine);
268
-
269
268
// Create machine view
270
269
auto focused_index = central_widget_tabs->currentIndex ();
271
270
corescene.reset ();
@@ -312,6 +311,7 @@ void MainWindow::create_core(
312
311
connect (
313
312
machine->core (), &machine::Core::stop_on_exception_reached, machine.data (),
314
313
&machine::Machine::pause );
314
+ connect (machine.data (), &machine::Machine::highlight_by_blocknum, this , &MainWindow::handle_highlight_by_blocknum);
315
315
316
316
// Setup docks
317
317
registers->connectToMachine (machine.data ());
@@ -760,6 +760,7 @@ void MainWindow::compile_source() {
760
760
761
761
connect (&sasm, &SimpleAsm::report_message, this , &MainWindow::report_message);
762
762
763
+ machine->address_to_blocknum_rw ()->clear ();
763
764
sasm.setup (
764
765
mem, &symtab, machine::Address (0x00000200 ), machine->core ()->get_xlen (),
765
766
machine->address_to_blocknum_rw ());
@@ -771,9 +772,7 @@ void MainWindow::compile_source() {
771
772
}
772
773
if (!sasm.finish ()) { error_occured = true ; }
773
774
774
- connect (
775
- machine.data (), &machine::Machine::highlight_by_blocknum, editor,
776
- &SrcEditor::highlightBlock);
775
+ connect (this , &MainWindow::highlight_by_blocknum, editor, &SrcEditor::highlightBlock);
777
776
778
777
if (error_occured) { show_messages (); }
779
778
}
0 commit comments