cpclib_runner/runner/emulator/
winape.rs

1use std::sync::OnceLock;
2
3use cpclib_common::camino::Utf8PathBuf;
4
5use crate::delegated::{
6    ArchiveFormat, DownloadableInformation, ExecutableInformation,
7    InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation
8};
9
10pub const WINAPE_CMD: &str = "winape";
11
12#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
13pub enum WinapeVersion {
14    #[default]
15    V2_0b2
16}
17
18impl WinapeVersion {
19    pub fn roms_folder(&self) -> Utf8PathBuf {
20        let conf = self.configuration::<()>();
21        conf.cache_folder().join("ROM")
22    }
23}
24
25impl InternetStaticCompiledApplication for WinapeVersion {}
26
27impl ExecutableInformation for WinapeVersion {
28    fn target_os_folder(&self) -> &'static str {
29        "winape_2_0b2"
30    }
31
32    fn target_os_exec_fname(&self) -> &'static str {
33        "WinApe.exe"
34    }
35}
36
37impl DownloadableInformation for WinapeVersion {
38    fn target_os_archive_format(&self) -> ArchiveFormat {
39        ArchiveFormat::Zip
40    }
41}
42impl StaticInformation for WinapeVersion {
43    fn static_download_urls(&self) -> &'static crate::delegated::MutiplatformUrls {
44        static URL: OnceLock<MutiplatformUrls> = OnceLock::new();
45        URL.get_or_init(|| {
46            MutiplatformUrls::unique_url("http://www.winape.net/download/WinAPE20B2.zip")
47        })
48    }
49}