Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

fix web

Layle197cf76ef873
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b9b34a3..88167bb 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -72,9 +72,9 @@ jobs:
- name: Build debugger + multitool (dev profile, with tracing output)
run: cargo build --profile dev --target ${{ matrix.target }} -p debugger -p multitool
- - name: Patch chipi dispatch strategy (tinyapp only)
- shell: bash
- run: perl -pi -e 's/strategy fn_ptr_lut/strategy jump_table/g' crates/gecko/spec/*.bindings.chipi
+ # - name: Patch chipi dispatch strategy (tinyapp only)
+ # shell: bash
+ # run: perl -pi -e 's/strategy fn_ptr_lut/strategy jump_table/g' crates/gecko/spec/*.bindings.chipi
- name: Build tinyapp (release)
run: cargo build --release --package tinyapp --target ${{ matrix.target }}
diff --git a/Dockerfile.native b/Dockerfile.native
index 79454db..50974e7 100644
--- a/Dockerfile.native
+++ b/Dockerfile.native
@@ -50,7 +50,7 @@ RUN mkdir -p /out/debug \
FROM base AS release-build
-RUN sed -i 's/strategy fn_ptr_lut/strategy jump_table/g' crates/gecko/spec/*.bindings.chipi
+#RUN sed -i 's/strategy fn_ptr_lut/strategy jump_table/g' crates/gecko/spec/*.bindings.chipi
RUN cargo build --release \
--target x86_64-unknown-linux-gnu \
diff --git a/crates/backend-wgpu/Cargo.toml b/crates/backend-wgpu/Cargo.toml
index cfa6910..6c4a841 100644
--- a/crates/backend-wgpu/Cargo.toml
+++ b/crates/backend-wgpu/Cargo.toml
@@ -10,7 +10,7 @@ hotpath = ["dep:hotpath", "hotpath/hotpath", "hotpath/crossbeam"]
[dependencies]
wgpu = "28.0.0"
bytemuck = { version = "1.25.0", features = ["derive"] }
-gecko = { path = "../gecko" }
+gecko = { path = "../gecko", default-features = false }
chapa = "0.1.2"
wesl = "0.3.2"
glam = { version = "0.32.1", features = ["bytemuck"] }
diff --git a/crates/image/Cargo.toml b/crates/image/Cargo.toml
index 6cefd2c..12a89ef 100644
--- a/crates/image/Cargo.toml
+++ b/crates/image/Cargo.toml
@@ -4,12 +4,13 @@ version = "0.1.0"
edition = "2024"
[features]
-default = ["symbols"]
+default = ["symbols", "rvz"]
symbols = ["dep:idb-rs", "dep:object"]
+rvz = ["dep:zstd"]
[dependencies]
idb-rs = { git = "https://github.com/ioncodes/idb-rs.git", optional = true }
object = { version = "0.36.7", default-features = false, features = ["elf", "read"], optional = true }
zerocopy = { version = "0.8.48", features = ["derive"] }
-zstd = "0.13.3"
+zstd = { version = "0.13.3", optional = true }
zip = { version = "8.5.1", default-features = false, features = ["deflate"] }
diff --git a/crates/image/src/lib.rs b/crates/image/src/lib.rs
index d05236b..cd09067 100644
--- a/crates/image/src/lib.rs
+++ b/crates/image/src/lib.rs
@@ -1,6 +1,7 @@
pub mod dol;
pub mod dvd;
pub mod iso;
+#[cfg(feature = "rvz")]
pub mod rvz;
#[cfg(feature = "symbols")]
@@ -13,6 +14,7 @@ pub mod symbols;
pub use dol::Dol;
pub use iso::Iso;
+#[cfg(feature = "rvz")]
pub use rvz::Rvz;
use dvd::{Apploader, Header};
@@ -99,7 +101,14 @@ pub fn load_dvd(data: Vec<u8>) -> Box<dyn Dvd> {
};
if data.starts_with(b"RVZ\x01") {
- Box::new(Rvz::parse(data))
+ #[cfg(feature = "rvz")]
+ {
+ Box::new(Rvz::parse(data))
+ }
+ #[cfg(not(feature = "rvz"))]
+ {
+ panic!("RVZ support is not compiled in (enable the `rvz` feature)");
+ }
} else {
Box::new(Iso::parse(data))
}
diff --git a/crates/web/Cargo.lock b/crates/web/Cargo.lock
index 3fc235c..3c3b557 100644
--- a/crates/web/Cargo.lock
+++ b/crates/web/Cargo.lock
@@ -1378,7 +1378,6 @@ version = "0.1.0"
dependencies = [
"zerocopy",
"zip",
- "zstd",
]
[[package]]
@@ -4061,31 +4060,3 @@ dependencies = [
"log",
"simd-adler32",
]
-
-[[package]]
-name = "zstd"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "7.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d"
-dependencies = [
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "2.0.16+zstd.1.5.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748"
-dependencies = [
- "cc",
- "pkg-config",
-]