From e2d7b5113692d067114d221c8b635d391993afcc Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Sat, 28 Jun 2025 20:41:49 +0200 Subject: [PATCH] rename variables for consistency with existing code --- bsnes/sfc/cpu/cpu.hpp | 2 +- bsnes/sfc/cpu/serialization.cpp | 2 +- bsnes/sfc/cpu/timing.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bsnes/sfc/cpu/cpu.hpp b/bsnes/sfc/cpu/cpu.hpp index 54db38c8..2d79adbc 100644 --- a/bsnes/sfc/cpu/cpu.hpp +++ b/bsnes/sfc/cpu/cpu.hpp @@ -120,8 +120,8 @@ private: uint autoJoypadCounter = 33; //state machine; 4224 / 128 = 33 (inactive) - uint2 autoJoypadPort0 = 0; uint2 autoJoypadPort1 = 0; + uint2 autoJoypadPort2 = 0; bool cpuLatch = false; bool autoJoypadLatch = false; diff --git a/bsnes/sfc/cpu/serialization.cpp b/bsnes/sfc/cpu/serialization.cpp index edeff5c9..ec6f2e39 100644 --- a/bsnes/sfc/cpu/serialization.cpp +++ b/bsnes/sfc/cpu/serialization.cpp @@ -45,8 +45,8 @@ auto CPU::serialize(serializer& s) -> void { s.integer(status.autoJoypadCounter); - s.integer(status.autoJoypadPort0); s.integer(status.autoJoypadPort1); + s.integer(status.autoJoypadPort2); s.boolean(status.cpuLatch); s.boolean(status.autoJoypadLatch); diff --git a/bsnes/sfc/cpu/timing.cpp b/bsnes/sfc/cpu/timing.cpp index a325fa05..dfc8b7a5 100644 --- a/bsnes/sfc/cpu/timing.cpp +++ b/bsnes/sfc/cpu/timing.cpp @@ -243,13 +243,13 @@ auto CPU::joypadEdge() -> void { //sixteen bits are shifted into joy{1-4}, one bit per 256 clocks //the bits are read on one 128-clock cycle and written on the next if ((status.autoJoypadCounter & 1) == 0) { - status.autoJoypadPort0 = controllerPort1.device->data(); - status.autoJoypadPort1 = controllerPort2.device->data(); + status.autoJoypadPort1 = controllerPort1.device->data(); + status.autoJoypadPort2 = controllerPort2.device->data(); } else { - io.joy1 = io.joy1 << 1 | status.autoJoypadPort0.bit(0); - io.joy2 = io.joy2 << 1 | status.autoJoypadPort1.bit(0); - io.joy3 = io.joy3 << 1 | status.autoJoypadPort0.bit(1); - io.joy4 = io.joy4 << 1 | status.autoJoypadPort1.bit(1); + io.joy1 = io.joy1 << 1 | status.autoJoypadPort1.bit(0); + io.joy2 = io.joy2 << 1 | status.autoJoypadPort2.bit(0); + io.joy3 = io.joy3 << 1 | status.autoJoypadPort1.bit(1); + io.joy4 = io.joy4 << 1 | status.autoJoypadPort2.bit(1); } } }