aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-09-06 22:44:29 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-09-06 22:44:29 +0200
commit83e5edac2cde5630a6acb26f7e1135f1b933db9a (patch)
treee54f349b2c9457835006357781cd2080c79bb5ea
parent9c685d5b6ca1686f944fb239ec89511f24801d44 (diff)
downloadtools.nes-83e5edac2cde5630a6acb26f7e1135f1b933db9a.tar.gz
tools.nes-83e5edac2cde5630a6acb26f7e1135f1b933db9a.zip
vnf: don't flip the given joypad inputs
I am not sure from where I got this bit flipping part, but I believe things worked because of another bug (see 9c685d5b6ca1 ("vnf: also set the carry on a zero compare")). Fixes: ad77503d9533 ("vnf: add support for standard joypads") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--lib/vnf/src/lib.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs
index 6c0a6f2..715a264 100644
--- a/lib/vnf/src/lib.rs
+++ b/lib/vnf/src/lib.rs
@@ -242,11 +242,7 @@ impl Joypad {
return Err("no more input on the queue".to_string());
}
self.reads = 0;
-
- // NOTE: flip the bits as the consumer actually expects a 1 for
- // unpressed and a 0 for pressed. This is not done directly in the
- // 'BUTTON_*' constants out of convenience from the API point of view.
- self.shift = !self.values.remove(0);
+ self.shift = self.values.remove(0);
Ok(())
}