aboutsummaryrefslogtreecommitdiff
path: root/src/io.rs
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-03-07 22:01:12 +0900
committerAstatin <[email protected]>2025-03-07 22:01:12 +0900
commitdf5a1c83d8c5d680e1bd4ef1c6793db964ebebea (patch)
tree4875d7634f915df26045a4f7c355422b531c372e /src/io.rs
parent85fd7f345b360fa644732e194498eaf3eacefbf4 (diff)
Add gamepad recorder & gamepad replay
Diffstat (limited to 'src/io.rs')
-rw-r--r--src/io.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/io.rs b/src/io.rs
index 87d6a2a..f426222 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -22,15 +22,9 @@ impl Memory {
0x42 => self.display.viewport_y,
0x43 => self.display.viewport_x,
0x41 => {
- let mut ret = match self.display.lcd_interrupt_mode {
- 3 => 0b01000000,
- 2 => 0b00100000,
- 1 => 0b00010000,
- 0 => 0b00001000,
- _ => 0,
- };
+ let mut ret = 0b00001000 << self.display.lcd_interrupt_mode;
- ret |= if self.display.ly > 0x90 {
+ ret |= if self.display.ly >= 0x90 {
1
} else if self.display.stat < 80 {
2