Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

pageflip is doing smth now

Layle5c610bdf4c35
diff --git a/crates/gekko/src/flipper/pi.rs b/crates/gekko/src/flipper/pi.rs
index 029f415..5bc0237 100644
--- a/crates/gekko/src/flipper/pi.rs
+++ b/crates/gekko/src/flipper/pi.rs
@@ -30,7 +30,7 @@ pub enum InterruptFlag {
impl Pi {
pub fn new() -> Self {
Pi {
- intsr: regs::InterruptCause::from_raw(0),
+ intsr: regs::InterruptCause::default(),
intmr: regs::InterruptMask::from_raw(0),
}
}
diff --git a/crates/gekko/src/flipper/pi/regs.rs b/crates/gekko/src/flipper/pi/regs.rs
index 40d2871..a6b03b2 100644
--- a/crates/gekko/src/flipper/pi/regs.rs
+++ b/crates/gekko/src/flipper/pi/regs.rs
@@ -62,11 +62,19 @@ impl crate::mmio::traits::MmioAccess<Pi> for InterruptCause {
fn read_at(dev: &mut Pi, addr: u32, access_size: u32) -> u32 {
let val = Self::read_sub(dev.intsr.to_raw(), addr, access_size);
- dev.intsr = InterruptCause::from_raw(0); // auto-clear
+ // TODO: What should we reset??
+ dev.intsr = InterruptCause::default();
val
}
}
+impl Default for InterruptCause {
+ fn default() -> Self {
+ // RSWST needs to be set
+ Self::from_raw(0).with_rswst(true)
+ }
+}
+
// 0xCC003004 4 r/w INTMR - Interrupt Mask
crate::mmio_register! {
InterruptMask: u32 @ 0xCC003004 => Pi.intmr {