Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

Revert "avoid snapshot_texture when BP writes product no side effects and are meaningless"

Layle28e30e80d436
diff --git a/crates/gecko/src/flipper/gx/bp.rs b/crates/gecko/src/flipper/gx/bp.rs
index c017efc..78b3a49 100644
--- a/crates/gecko/src/flipper/gx/bp.rs
+++ b/crates/gecko/src/flipper/gx/bp.rs
@@ -12,7 +12,6 @@ impl GraphicsProcessor {
let old = self.bp_regs[idx];
let val = (old & !self.bp_mask) | (raw_val & self.bp_mask);
- let changed = val != old;
self.bp_regs[idx] = val;
if idx == BP_BP_MASK {
self.bp_mask = val & 0x00ff_ffff;
@@ -31,11 +30,6 @@ impl GraphicsProcessor {
"BP register write"
);
- // This seems to improve performance in quite some games!
- if !changed && !self::bp_write_has_side_effect(idx) {
- return;
- }
-
// TX_SETIMAGE3 is written last for each texture slot, so we use it as
// the trigger to snapshot the full texture descriptor
let texture_slot = if idx >= BP_TX_SETIMAGE3_I0 && idx < BP_TX_SETIMAGE3_I0 + 4 {
@@ -582,14 +576,6 @@ impl GraphicsProcessor {
}
}
-#[inline(always)]
-fn bp_write_has_side_effect(idx: usize) -> bool {
- matches!(
- idx,
- BP_LOAD_TLUT1 | BP_PE_DONE | BP_PE_TOKEN | BP_PE_TOKEN_INT | BP_PE_COPY_CMD
- )
-}
-
fn slot_palette(palette_mem: &[u16], tmem_offset: u16) -> &[u16] {
let base = (tmem_offset as usize) * TLUT_ENTRIES_PER_UNIT;
palette_mem.get(base..).unwrap_or(&[])