mirror of
https://github.com/gopher64/gopher64.git
synced 2026-11-14 18:19:04 +01:00
add cheats enabled var
This commit is contained in:
1 parent
6c6d0f32a7
commit
5857da0404
3 files changed
+6
-1
No files matched your search
@@ -12,6 +12,7 @@ pub struct DecodedCheat {
|
||||
pub struct Cheats {
|
||||
pub cheats: Vec<Vec<DecodedCheat>>,
|
||||
pub boot: bool,
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
pub fn init(
|
||||
@@ -69,6 +70,7 @@ pub fn init(
|
||||
}
|
||||
|
||||
if !device.cheats.cheats.is_empty() {
|
||||
device.cheats.enabled = true;
|
||||
ui::audio::play_cheat_event(&device.ui);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,6 +506,7 @@ impl Device {
|
||||
cheats: cheats::Cheats {
|
||||
cheats: vec![],
|
||||
boot: true,
|
||||
enabled: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -134,7 +134,9 @@ pub fn write_regs(device: &mut device::Device, address: u64, value: u32, mask: u
|
||||
}
|
||||
|
||||
pub fn vertical_interrupt_event(device: &mut device::Device) {
|
||||
cheats::execute_cheats(device, device.cheats.cheats.clone());
|
||||
if device.cheats.enabled {
|
||||
cheats::execute_cheats(device, device.cheats.cheats.clone());
|
||||
}
|
||||
let mut speed_limiter_toggled = ui::video::check_callback(device);
|
||||
|
||||
if device.netplay.is_some() {
|
||||
|
||||
Reference in new issue
Block a user