Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

yagcd wrong about fbb (xfb addr)? this seems to work well in consoletest and pageflip

Layle767124638c86
diff --git a/crates/gekko/src/flipper/vi.rs b/crates/gekko/src/flipper/vi.rs
index bf59314..b5e786d 100644
--- a/crates/gekko/src/flipper/vi.rs
+++ b/crates/gekko/src/flipper/vi.rs
@@ -121,9 +121,9 @@ impl Vi {
pub fn xfb_addr(&self) -> u32 {
if self.tfbl.page_offset() {
- self.tfbl.xfb_addr() << 4
+ self.tfbl.xfb_addr() << 5
} else {
- self.tfbr.xfb_addr() << 9
+ self.tfbl.xfb_addr()
}
}
diff --git a/crates/gekko/src/flipper/vi/regs.rs b/crates/gekko/src/flipper/vi/regs.rs
index c246f45..1fe2e3d 100644
--- a/crates/gekko/src/flipper/vi/regs.rs
+++ b/crates/gekko/src/flipper/vi/regs.rs
@@ -58,6 +58,12 @@ crate::mmio_register! {
}
}
+impl DisplayConfiguration {
+ pub fn interlaced(&self) -> bool {
+ !self.nin()
+ }
+}
+
impl MmioAccess<Vi> for DisplayConfiguration {
fn read(vi: &Vi) -> Self {
vi.dcr
@@ -137,7 +143,7 @@ crate::mmio_register! {
crate::mmio_register! {
TopFieldBase: u32 @ 0xCC00201C => Vi.tfbl {
- #[bits(9..=23, alias = "fbb")]
+ #[bits(0..=23, alias = "fbb")]
pub xfb_addr: u32,
#[bits(24..=27, alias = "xof")]
@@ -153,7 +159,7 @@ crate::mmio_register! {
crate::mmio_register! {
TopFieldBaseRight: u32 @ 0xCC002020 => Vi.tfbr {
- #[bits(9..=23, alias = "fbb")] pub xfb_addr: u32,
+ #[bits(0..=23, alias = "fbb")] pub xfb_addr: u32,
}
}
@@ -161,7 +167,7 @@ crate::mmio_register! {
crate::mmio_register! {
BottomFieldBase: u32 @ 0xCC002024 => Vi.bfbl {
- #[bits(9..=23, alias = "fbb")]
+ #[bits(0..=23, alias = "fbb")]
pub xfb_addr: u32,
#[bits(28)]
@@ -174,7 +180,7 @@ crate::mmio_register! {
crate::mmio_register! {
BottomFieldBaseRight: u32 @ 0xCC002028 => Vi.bfbr {
- #[bits(9..=23, alias = "fbb")] pub xfb_addr: u32,
+ #[bits(0..=23, alias = "fbb")] pub xfb_addr: u32,
}
}