Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

fix pi

Laylee81f3f5353d3
diff --git a/crates/gecko/src/flipper/pi.rs b/crates/gecko/src/flipper/pi.rs
index 7db2b32..14efb86 100644
--- a/crates/gecko/src/flipper/pi.rs
+++ b/crates/gecko/src/flipper/pi.rs
@@ -29,6 +29,7 @@ pub enum InterruptFlag {
Cp = 1 << 11,
Debug = 1 << 12,
Hsp = 1 << 13,
+ Hw = 1 << 14,
}
impl ProcessorInterface {
diff --git a/crates/gecko/src/flipper/pi/regs.rs b/crates/gecko/src/flipper/pi/regs.rs
index d1eabd0..6145e31 100644
--- a/crates/gecko/src/flipper/pi/regs.rs
+++ b/crates/gecko/src/flipper/pi/regs.rs
@@ -48,6 +48,9 @@ pub struct InterruptCause {
#[bits(13, alias = "hsp")]
pub highspeed_port: bool,
+ #[bits(14, alias = "iop")]
+ pub hollywood: bool,
+
#[bits(16)]
pub rswst: bool,
}
@@ -120,6 +123,9 @@ pub struct InterruptMask {
#[bits(13, alias = "hsp")]
pub highspeed_port: bool,
+
+ #[bits(14, alias = "iop")]
+ pub hollywood: bool,
}
crate::mmio_reg!(InterruptMask: u32 @ 0xCC003004);
crate::mmio_default_access!(InterruptMask => System.pi.intmr);
diff --git a/crates/gecko/src/hollywood/irq.rs b/crates/gecko/src/hollywood/irq.rs
index d2c94c4..4fc58e9 100644
--- a/crates/gecko/src/hollywood/irq.rs
+++ b/crates/gecko/src/hollywood/irq.rs
@@ -19,9 +19,9 @@ impl Irq {
pub fn route_to_pi<const SYSTEM: SystemId>(sys: &mut System<SYSTEM>) {
let firing = (sys.hollywood.irq.cause.raw() & sys.hollywood.irq.mask.raw()) != 0;
if firing {
- sys.pi.assert_interrupt(crate::flipper::pi::InterruptFlag::Hsp);
+ sys.pi.assert_interrupt(crate::flipper::pi::InterruptFlag::Hw);
} else {
- sys.pi.clear_interrupt(crate::flipper::pi::InterruptFlag::Hsp);
+ sys.pi.clear_interrupt(crate::flipper::pi::InterruptFlag::Hw);
}
}