summaryrefslogtreecommitdiff
path: root/src/emulators
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-07-07 21:49:48 +1200
committerBen Bridle <ben@derelict.engineering>2025-07-07 21:49:48 +1200
commita702893fd1e1e59b5bfc770c5088120e8c3ece56 (patch)
treeab0d40be922c47d053367f32b15d3e8fc16f005f /src/emulators
parent0d9bfa0731259edfe9496e90c7f41820442cb130 (diff)
downloadbedrock-pc-a702893fd1e1e59b5bfc770c5088120e8c3ece56.zip
Sandbox the file device
Unless the --trust-files switch is used, the file device will be sandboxed to a program-specific config folder placed according to the conventions of the operating system.
Diffstat (limited to 'src/emulators')
-rw-r--r--src/emulators/graphical_emulator.rs2
-rw-r--r--src/emulators/headless_emulator.rs2
-rw-r--r--src/emulators/mod.rs3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/emulators/graphical_emulator.rs b/src/emulators/graphical_emulator.rs
index 2680d3f..03e3057 100644
--- a/src/emulators/graphical_emulator.rs
+++ b/src/emulators/graphical_emulator.rs
@@ -112,7 +112,7 @@ impl GraphicalDeviceBus {
input: InputDevice::new(),
screen: ScreenDevice::new(&config),
stream: StreamDevice::new(&config),
- file: FileDevice::new(),
+ file: FileDevice::new(&config),
wake_queue: WakeQueue::new(),
}
}
diff --git a/src/emulators/headless_emulator.rs b/src/emulators/headless_emulator.rs
index cac58cf..770bae3 100644
--- a/src/emulators/headless_emulator.rs
+++ b/src/emulators/headless_emulator.rs
@@ -70,7 +70,7 @@ impl HeadlessDeviceBus {
math: MathDevice::new(),
clock: ClockDevice::new(),
stream: StreamDevice::new(&config),
- file: FileDevice::new(),
+ file: FileDevice::new(&config),
wake_queue: WakeQueue::new(),
}
}
diff --git a/src/emulators/mod.rs b/src/emulators/mod.rs
index 8f04e4d..d4a58f9 100644
--- a/src/emulators/mod.rs
+++ b/src/emulators/mod.rs
@@ -15,7 +15,10 @@ pub struct EmulatorConfig {
pub show_cursor: bool,
pub decode_stdin: bool,
pub encode_stdout: bool,
+ pub trust_files: bool,
pub symbols_path: Option<PathBuf>,
+ pub name: Option<String>,
+ pub identifier: Option<String>,
pub title: String,
pub icon: Option<Icon>,
}