Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

fuckass stm stuff

Laylefa4d1cd83108
diff --git a/.gitmodules b/.gitmodules
index 1341f47..4bc676f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -19,3 +19,6 @@
[submodule "submodules/lily-gamecube-roms"]
path = submodules/lily-gamecube-roms
url = https://github.com/xOx-Liy-Codez-XD-oXo/lily-gamecube-roms
+[submodule "submodules/guy"]
+ path = submodules/guy
+ url = https://github.com/xOx-Liy-Codez-XD-oXo/guy
diff --git a/crates/gecko/src/hollywood/ipc/stm.rs b/crates/gecko/src/hollywood/ipc/stm.rs
index 5314a8a..3d5f039 100644
--- a/crates/gecko/src/hollywood/ipc/stm.rs
+++ b/crates/gecko/src/hollywood/ipc/stm.rs
@@ -1,16 +1,5 @@
-pub struct Stm;
+pub mod eventhook;
+pub mod immediate;
-impl super::IosDevice for Stm {
- fn ioctl(
- &mut self,
- _ctx: &mut super::DeviceContext<'_>,
- cmd: u32,
- in_buf: u32,
- in_len: u32,
- out_buf: u32,
- out_len: u32,
- ) -> i32 {
- tracing::error!(cmd, in_buf, in_len, out_buf, out_len, "IOS_Ioctl: unimplemented");
- super::IPC_EINVAL
- }
-}
+pub use eventhook::EventHook;
+pub use immediate::Immediate;
diff --git a/crates/gecko/src/hollywood/ipc/stm/eventhook.rs b/crates/gecko/src/hollywood/ipc/stm/eventhook.rs
new file mode 100644
index 0000000..4f9a436
--- /dev/null
+++ b/crates/gecko/src/hollywood/ipc/stm/eventhook.rs
@@ -0,0 +1,25 @@
+use crate::hollywood::ipc::{DeviceContext, IosDevice};
+
+pub struct EventHook;
+
+impl IosDevice for EventHook {
+ fn ioctl(
+ &mut self,
+ _ctx: &mut DeviceContext<'_>,
+ cmd: u32,
+ in_buf: u32,
+ in_len: u32,
+ out_buf: u32,
+ out_len: u32,
+ ) -> i32 {
+ tracing::warn!(
+ cmd = format!("{cmd:#010X}"),
+ in_buf = format!("{in_buf:#010X}"),
+ in_len,
+ out_buf = format!("{out_buf:#010X}"),
+ out_len,
+ "STM_EventHook fucked up"
+ );
+ 0
+ }
+}
diff --git a/crates/gecko/src/hollywood/ipc/stm/immediate.rs b/crates/gecko/src/hollywood/ipc/stm/immediate.rs
new file mode 100644
index 0000000..5d6aa24
--- /dev/null
+++ b/crates/gecko/src/hollywood/ipc/stm/immediate.rs
@@ -0,0 +1,18 @@
+use crate::hollywood::ipc::{DeviceContext, IPC_EINVAL, IosDevice};
+
+pub struct Immediate;
+
+impl IosDevice for Immediate {
+ fn ioctl(
+ &mut self,
+ _ctx: &mut DeviceContext<'_>,
+ cmd: u32,
+ in_buf: u32,
+ in_len: u32,
+ out_buf: u32,
+ out_len: u32,
+ ) -> i32 {
+ tracing::error!(cmd, in_buf, in_len, out_buf, out_len, "IOS_Ioctl: unimplemented");
+ IPC_EINVAL
+ }
+}
diff --git a/crates/gecko/src/starlet.rs b/crates/gecko/src/starlet.rs
index 21173ed..7068f2d 100644
--- a/crates/gecko/src/starlet.rs
+++ b/crates/gecko/src/starlet.rs
@@ -61,8 +61,10 @@ impl Starlet {
impl System<{ crate::WII }> {
pub fn initialize_starlet_devices(&mut self) {
- self.starlet
- .register("/dev/stm/immediate", Box::new(crate::hollywood::ipc::stm::Stm));
+ use crate::hollywood::ipc::stm;
+
+ self.starlet.register("/dev/stm/immediate", Box::new(stm::Immediate));
+ self.starlet.register("/dev/stm/eventhook", Box::new(stm::EventHook));
}
pub fn create_device_context(&mut self) -> (&mut Starlet, DeviceContext<'_>) {
diff --git a/submodules/guy b/submodules/guy
new file mode 160000
index 0000000..653748b
--- /dev/null
+++ b/submodules/guy
@@ -0,0 +1 @@
+Subproject commit 653748b3bae8f761b3089494aec393262245205f