diff options
author | Benji Dial <benji@benjidial.net> | 2023-05-30 22:06:09 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2023-05-30 22:06:09 -0400 |
commit | a988f6a27db39eac6de698a8d0ad31673c865d41 (patch) | |
tree | 6c4acdfa2756d9d2ca0410b32b345773490a2aa2 /bench/bench_window.cpp | |
parent | 1a0a068b87e3f04e9c7301b6c7b238dc4baf1af2 (diff) | |
download | lib94-a988f6a27db39eac6de698a8d0ad31673c865d41.tar.gz |
core fading toggle
Diffstat (limited to 'bench/bench_window.cpp')
-rw-r--r-- | bench/bench_window.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bench/bench_window.cpp b/bench/bench_window.cpp index 7393e9f..60d44f3 100644 --- a/bench/bench_window.cpp +++ b/bench/bench_window.cpp @@ -8,11 +8,13 @@ bench_window::bench_window() runner_stop_on_death(true), runner_stop_on_win(true), runner_hyperspeed(false), + core_fading(true), control_box(Gtk::Orientation::VERTICAL), new_round_button("new round"), single_step_button("single step"), start_button("start"), stop_button("stop"), + core_fading_toggle("core fading"), hyperspeed_toggle("hyperspeed"), pause_on_death_toggle("pause on death"), pause_on_win_toggle("pause on win"), @@ -47,6 +49,7 @@ bench_window::bench_window() update_ui(); + core_fading_toggle.activate(); pause_on_death_toggle.activate(); pause_on_win_toggle.activate(); @@ -57,6 +60,7 @@ bench_window::bench_window() add_warrior_button.signal_clicked().connect(sigc::mem_fun(*this, &bench_window::on_click_add_warrior)); remove_warrior_button.signal_clicked().connect(sigc::mem_fun(*this, &bench_window::on_click_remove_warrior)); + core_fading_toggle.signal_toggled().connect(sigc::mem_fun(*this, &bench_window::on_toggle_core_fading)); hyperspeed_toggle.signal_toggled().connect(sigc::mem_fun(*this, &bench_window::on_toggle_hyperspeed)); pause_on_death_toggle.signal_toggled().connect(sigc::mem_fun(*this, &bench_window::on_toggle_pause_on_death)); pause_on_win_toggle.signal_toggled().connect(sigc::mem_fun(*this, &bench_window::on_toggle_pause_on_win)); @@ -70,6 +74,7 @@ bench_window::bench_window() control_box.append(single_step_button); control_box.append(start_button); control_box.append(stop_button); + control_box.append(core_fading_toggle); control_box.append(hyperspeed_toggle); control_box.append(pause_on_death_toggle); control_box.append(pause_on_win_toggle); @@ -118,10 +123,14 @@ const lib94::warrior *bench_window::do_step() { const lib94::warrior *result = lib94::single_step<true>(); core.mut.lock(); - core.age_all(); + + if (core_fading) + core.age_all(); + core.add_new_writes(lib94::get_written_addresses()); core.add_new_reads(lib94::get_read_addresses()); core.add_new_executions(lib94::get_executed_addresses()); + core.mut.unlock(); add_modified_for_instruction_view(lib94::get_written_addresses()); @@ -197,6 +206,10 @@ void bench_window::on_click_stop() { runner_stop_now = true; } +void bench_window::on_toggle_core_fading() { + core_fading = core_fading_toggle.get_active(); +} + void bench_window::on_toggle_hyperspeed() { runner_hyperspeed = hyperspeed_toggle.get_active(); } |