A GameCube/Wii emulator and debugger written in Rust.
allow ipl hle from gecko app
Layle4229416e11a6
diff --git a/README.md b/README.mdindex 3432f98..ba3d083 100644--- a/README.md+++ b/README.md@@ -72,7 +72,10 @@ Gecko is developed with homebrew development and reverse engineering in mind, buPrebuilt releases (including debug builds) can be downloaded [here](https://github.com/ioncodes/gecko/releases). GameCube and Wii require system files to use the emulator, please refer to the ["Required Files"](https://github.com/ioncodes/gecko#required-files) chapter. Minimal commands to launch a game:```sh-# Launch a GameCube game+# Launch a GameCube game with the built-in IPL HLE+./tinyapp --dsp dsp_rom.bin --coef dsp_coef.bin --dvd YourGame.rvz++# Launch a GameCube game with a real IPL (skip the boot animation)./tinyapp --ipl IPL.decoded.bin --dsp dsp_rom.bin --coef dsp_coef.bin --skip-ipl --dvd YourGame.rvz# Launch a Wii game@@ -85,9 +88,11 @@ A more modern and friendly experience is provided via `gecko` ([short preview onOn first launch, a guided setup popup asks for your DSP ROM (`dsp_rom.bin`), DSP coefficient ROM (`dsp_coef.bin`), optional GameCube IPL and game folders. It validates and copies the system files with the correct names, automatically decodes an encoded IPL, saves your settings and scans your games. You can skip setup for now or reopen it from **Settings -> Guided Setup**.+Enable **Settings -> Boot -> IPL HLE (GameCube)** to boot GameCube discs using [Hazel's](https://codeberg.org/hazelwiss) built-in IPL replacement, even if a real IPL is installed. The setting is saved as `ipl_hle = true` in `config.toml` and applies the next time you launch a game. Guided setup enables HLE automatically if you leave the IPL file empty. Disable HLE to use your real IPL. **Skip IPL (GameCube)** then controls whether its boot animation is skipped. DSP ROMs are still required with either boot method.+You can also import an optional Wii NAND folder containing `title/` and `shared2/`. The wizard copies it into `fs/` (or `GECKO_FS_ROOT`) only if that destination does not already exist, preserving existing saves. Otherwise, leave NAND unselected to keep existing storage or generate it on first boot.-The launcher scans the configured GameCube and Wii folders for `.iso`, `.rvz` and `.zip` files. Double-clicking on a row opens a dedicated player window for that game. For manual setup, place the decoded GameCube IPL and DSP files inside `system` using the names below. Data paths are relative to the working directory or `GECKO_DATA_DIR` when set:+The launcher scans the configured GameCube and Wii folders for `.iso`, `.rvz` and `.zip` files. Double-clicking on a row opens a dedicated player window for that game. For manual setup, place the DSP files and, if using real IPL boot, a decoded GameCube IPL inside `system` using the names below. Data paths are relative to the working directory or `GECKO_DATA_DIR` when set:```sh<gecko data dir>/@@ -96,7 +101,7 @@ The launcher scans the configured GameCube and Wii folders for `.iso`, `.rvz` anscreenshots/ # F12 screenshots, auto-generatedinternal/ # contains SRAM and memory cards, auto-generatedsystem/ # system files, copied by guided setup- IPL.bin # GameCube only (must be decoded! see multitool)+ IPL.bin # GameCube real IPL boot only (must be decoded! see multitool)dsp_rom.bin # GameCube and Wiidsp_coef.bin # GameCube and Wiifs/ # Wii NAND, auto-generated if missing (or drop in a Dolphin/real dump)@@ -254,7 +259,7 @@ The panel also provides a speed slider and `Reset view` button. Game input is su## Required files-Gecko does not ship any system files.+Gecko does not ship original console ROMs. A built-in IPL HLE replacement is available for GameCube disc boot.Reference SHA-256 hashes (these are the files the project is developed against):@@ -268,11 +273,13 @@ Reference SHA-256 hashes (these are the files the project is developed against):| `dsp_coef.bin` | `d7741279c2e8ec5c5fb318f8fbdd6de6bf583520d288e836a5383233a4238179` |### GameCube-- IPL (NTSC and PAL tested)+- IPL for real IPL boot only (NTSC and PAL tested); not required with IPL HLE- DSP IROM- DSP coefficient ROM-If you only have an encoded IPL, decode it first with multitool:+For IPL HLE in `tinyapp`, pass `--dvd` without `--ipl`. In the `gecko` app, enable **Settings -> Boot -> IPL HLE (GameCube)**.++If using a real IPL and you only have an encoded copy, decode it first with multitool (guided setup does this automatically):```shmultitool ipl --action decode private/IPL.bin private/IPL.decoded.bindiff --git a/crates/app/src/app.rs b/crates/app/src/app.rsindex 6d2a754..3d3bf15 100644--- a/crates/app/src/app.rs+++ b/crates/app/src/app.rs@@ -59,6 +59,7 @@ pub enum Message {MenuQuit,MenuToggleCpu(CpuMode),MenuToggleSkipIpl,+ MenuToggleIplHle,MenuToggleMemoryCard,MenuToggleSram,MenuSetTheme(ThemePreference),@@ -571,6 +572,11 @@ impl App {self.persist_config();Task::none()}+ Message::MenuToggleIplHle => {+ self.config.ipl_hle = !self.config.ipl_hle;+ self.persist_config();+ Task::none()+ }Message::MenuToggleSkipIpl => {self.config.skip_ipl = !self.config.skip_ipl;self.persist_config();@@ -941,6 +947,7 @@ impl App {palette,self.config.cpu_mode,self.config.theme,+ self.config.ipl_hle,self.config.skip_ipl,self.config.upscale,self.config.aspect,diff --git a/crates/app/src/config.rs b/crates/app/src/config.rsindex 99806a5..b2bf549 100644--- a/crates/app/src/config.rs+++ b/crates/app/src/config.rs@@ -17,6 +17,7 @@ pub struct Config {pub dsp_rom: Option<PathBuf>,pub dsp_coef: Option<PathBuf>,pub ipl: Option<PathBuf>,+ pub ipl_hle: bool,#[serde(default = "self::default_skip_ipl")]pub skip_ipl: bool,#[serde(default = "self::default_upscale")]@@ -176,6 +177,7 @@ impl Default for Config {dsp_rom: None,dsp_coef: None,ipl: None,+ ipl_hle: false,skip_ipl: self::default_skip_ipl(),upscale: self::default_upscale(),aspect: AspectMode::default(),diff --git a/crates/app/src/player/state.rs b/crates/app/src/player/state.rsindex e16a9f5..e249863 100644--- a/crates/app/src/player/state.rs+++ b/crates/app/src/player/state.rs@@ -83,8 +83,20 @@ impl PlayerState {let system_dir = config.system_dir_resolved();let dsp = Config::resolve_in_dir(&config.dsp_rom, &system_dir, DSP_ROM_FILE);let coef = Config::resolve_in_dir(&config.dsp_coef, &system_dir, DSP_COEF_FILE);- let ipl = Config::resolve_in_dir(&config.ipl, &system_dir, IPL_FILE);- let boot_error = self::validate(game.platform, game.format, &dsp, &coef, &ipl, &system_dir);+ let ipl = if config.ipl_hle {+ None+ } else {+ Config::resolve_in_dir(&config.ipl, &system_dir, IPL_FILE)+ };+ let boot_error = self::validate(+ game.platform,+ game.format,+ &dsp,+ &coef,+ &ipl,+ config.ipl_hle,+ &system_dir,+ );Arc::new(Self {boot: Mutex::new(Some(BootParams {@@ -448,6 +460,7 @@ fn validate(dsp: &Option<PathBuf>,coef: &Option<PathBuf>,ipl: &Option<PathBuf>,+ ipl_hle: bool,system_dir: &Path,) -> Option<String> {let mut missing: Vec<&'static str> = Vec::new();@@ -457,7 +470,7 @@ fn validate(if coef.is_none() {missing.push(DSP_COEF_FILE);}- if platform == Platform::Gcn && format != Format::Dol && ipl.is_none() {+ if platform == Platform::Gcn && format != Format::Dol && !ipl_hle && ipl.is_none() {missing.push(IPL_FILE);}@@ -469,7 +482,10 @@ fn validate("DOL executables require dsp_rom.bin and dsp_coef.bin"} else {match platform {- Platform::Gcn => "GameCube games require IPL.bin, dsp_rom.bin and dsp_coef.bin",+ Platform::Gcn if !ipl_hle => {+ "GameCube games require IPL.bin, dsp_rom.bin and dsp_coef.bin. Enable Settings > Boot > IPL HLE (GameCube) to boot without IPL.bin"+ }+ Platform::Gcn => "GameCube games require dsp_rom.bin and dsp_coef.bin with IPL HLE",Platform::Wii => "Wii games require dsp_rom.bin and dsp_coef.bin",}};diff --git a/crates/app/src/setup.rs b/crates/app/src/setup.rsindex 29e0ed1..22f4751 100644--- a/crates/app/src/setup.rs+++ b/crates/app/src/setup.rs@@ -26,7 +26,7 @@ impl Field {match self {Self::Dsp => ("DSP ROM", "Required"),Self::Coef => ("DSP coefficients", "Required"),- Self::Ipl => ("GameCube IPL", "GameCube only"),+ Self::Ipl => ("GameCube IPL", "Optional"),Self::GameCube => ("GameCube games", "Optional"),Self::Wii => ("Wii games", "Optional"),Self::Nand => ("Wii NAND", "Optional"),@@ -133,7 +133,7 @@ impl Setup {&& (!config_exists|| self.sources.dsp.is_none()|| self.sources.coef.is_none()- || (cfg.gcn_library.is_some() && self.sources.ipl.is_none()))+ || (cfg.gcn_library.is_some() && !cfg.ipl_hle && self.sources.ipl.is_none()))}pub fn view(&self, palette: &Palette, cfg: &Config) -> Element<'static, Message> {@@ -171,7 +171,7 @@ impl Setup {let fields_and_note = match self.step {Step::System => Some(([Field::Dsp, Field::Coef, Field::Ipl],- "IPL is only needed for GameCube. Encoded IPLs are decoded automatically.",+ "Leave IPL empty to use IPL HLE for GameCube. Encoded IPLs are decoded automatically.",)),Step::Folders => Some(([Field::GameCube, Field::Wii, Field::Nand],@@ -224,8 +224,11 @@ impl Setup {));}notes = notes.push(self::note("System files with these names will be replaced.", palette));- if self.sources.ipl.is_none() {- notes = notes.push(self::note("Add a GameCube IPL later in Guided Setup.", palette));+ if self.sources.ipl.is_none() || cfg.ipl_hle {+ notes = notes.push(self::note(+ "GameCube games will use IPL HLE. Change this in Settings > Boot.",+ palette,+ ));}content = content.push(container(column![self::divider(palette.border), notes].spacing(16))@@ -480,10 +483,6 @@ fn validate_folders(sources: &Sources) -> anyhow::Result<()> {ensure!(path.is_dir(), "Game folder does not exist: {}", path.display());}- ensure!(- sources.gcn.is_none() || sources.ipl.is_some(),- "Choose a GameCube IPL in step 1 to use a GameCube library."- );Ok(())}@@ -574,6 +573,8 @@ pub fn install(sources: Sources, mut cfg: Config, config_path: &Path, nand_dest:cfg.dsp_coef = Some(system.join(DSP_COEF_FILE));if sources.ipl.is_some() {cfg.ipl = Some(system.join(IPL_FILE));+ } else {+ cfg.ipl_hle = true;}cfg.gcn_library = sources.gcn;cfg.wii_library = sources.wii;diff --git a/crates/app/src/widgets/menubar.rs b/crates/app/src/widgets/menubar.rsindex 04affe5..075690a 100644--- a/crates/app/src/widgets/menubar.rs+++ b/crates/app/src/widgets/menubar.rs@@ -14,6 +14,7 @@ pub fn menubar(palette: &Palette,cpu: CpuMode,theme_pref: ThemePreference,+ ipl_hle: bool,skip_ipl: bool,upscale: u32,aspect: AspectMode,@@ -32,6 +33,7 @@ pub fn menubar(palette,cpu,theme_pref,+ ipl_hle,skip_ipl,upscale,aspect,@@ -234,6 +236,7 @@ fn settings_menu(palette: &Palette,cpu: CpuMode,theme_pref: ThemePreference,+ ipl_hle: bool,skip_ipl: bool,upscale: u32,aspect: AspectMode,@@ -242,6 +245,15 @@ fn settings_menu() -> Menu<'static, Message, iced::Theme, iced::Renderer> {let check = |label: &'static str, msg: Message, on: bool| Item::new(self::menu_item(palette, label, msg, Some(on)));+ let mut boot_items = vec![check("IPL HLE (GameCube)", Message::MenuToggleIplHle, ipl_hle)];+ if !ipl_hle {+ boot_items.push(check("Skip IPL (GameCube)", Message::MenuToggleSkipIpl, skip_ipl));+ }+ boot_items.extend([+ check("Memory Card (Slot A)", Message::MenuToggleMemoryCard, memcard_enabled),+ check("Persist SRAM", Message::MenuToggleSram, sram_enabled),+ ]);+Menu::new(vec![Item::new(self::menu_item(palette, "Guided Setup...", Message::MenuSetup, None)),Item::new(self::separator(palette)),@@ -261,15 +273,7 @@ fn settings_menu(),],),- self::submenu(- palette,- "Boot",- vec![- check("Skip IPL (GameCube)", Message::MenuToggleSkipIpl, skip_ipl),- check("Memory Card (Slot A)", Message::MenuToggleMemoryCard, memcard_enabled),- check("Persist SRAM", Message::MenuToggleSram, sram_enabled),- ],- ),+ self::submenu(palette, "Boot", boot_items),self::submenu(palette,"Graphics",diff --git a/other/example.conf b/other/example.confindex d4a61f1..c5a5d20 100644--- a/other/example.conf+++ b/other/example.conf@@ -7,7 +7,8 @@ ipl = "/path/to/IPL.bin"cpu_mode = "jit" # jit | interpretertheme = "system" # system | light | dark-skip_ipl = true+ipl_hle = false # true: boot GameCube discs without an IPL file+skip_ipl = true # skip the real IPL animation; ignored with IPL HLEupscale = 1 # internal resolution multiplier, 1-4[input]