cpclib_runner/runner/emulator/
cpcemupower.rs1const URL: &str =
2 "https://www.cpc-power.com/cpcarchives/download/Emulateurs/20210531_CPCEPower_SDL_Release.zip";
3
4use std::sync::OnceLock;
5
6use crate::delegated::{
7 ArchiveFormat, DownloadableInformation, ExecutableInformation,
8 InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation
9};
10use crate::runner::runner::RunInDir;
11
12pub const CPCEMUPOWER_CMD: &str = "cpcemupower";
13
14#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
15pub enum CpcEmuPowerVersion {
16 #[default]
17 R20210531
18}
19
20impl InternetStaticCompiledApplication for CpcEmuPowerVersion {}
21
22impl ExecutableInformation for CpcEmuPowerVersion {
23 fn target_os_folder(&self) -> &'static str {
24 match self {
25 Self::R20210531 => "20210531_CPCEPower_SDL_Release"
26 }
27 }
28
29 fn target_os_exec_fname(&self) -> &'static str {
30 match self {
31 Self::R20210531 => {
32 #[cfg(target_os = "windows")]
33 return "CPCEPower_SDL_x64.exe";
34 #[cfg(target_os = "linux")]
35 return "CPCEPower_SDL_Linux_x64";
36 #[cfg(target_os = "macosx")]
37 return "CPCEPower_SDL_MacOS";
38 }
39 }
40 }
41
42 fn target_os_run_in_dir(&self) -> RunInDir {
43 RunInDir::AppDir
44 }
45}
46
47impl StaticInformation for CpcEmuPowerVersion {
48 fn static_download_urls(&self) -> &'static MutiplatformUrls {
49 match self {
50 CpcEmuPowerVersion::R20210531 => {
51 static URLS: OnceLock<MutiplatformUrls> = OnceLock::new();
52 URLS.get_or_init(|| MutiplatformUrls::unique_url(URL))
53 }
54 }
55 }
56}
57
58impl DownloadableInformation for CpcEmuPowerVersion {
59 fn target_os_archive_format(&self) -> ArchiveFormat {
60 ArchiveFormat::Zip
61 }
62
63 }