From 1bc5b75dba12a594a873aed514dd816bc41bd356 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Mon, 13 Oct 2025 00:39:34 +0200 Subject: [PATCH] format --- Firmware/sdk/apps/gameboy/src/gameboy_app.cpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Firmware/sdk/apps/gameboy/src/gameboy_app.cpp b/Firmware/sdk/apps/gameboy/src/gameboy_app.cpp index 6f58d3b..c89f210 100644 --- a/Firmware/sdk/apps/gameboy/src/gameboy_app.cpp +++ b/Firmware/sdk/apps/gameboy/src/gameboy_app.cpp @@ -435,12 +435,12 @@ public: GameboyApp* owner = nullptr; std::array regs{}; - bool enabled = true; - mutable uint8_t squareAlternate = 0; - mutable uint8_t lastChannel = 0xFF; - mutable double filteredFreqHz = 0.0; - mutable std::array lastSquareRaw{}; - mutable std::array squareStable{}; + bool enabled = true; + mutable uint8_t squareAlternate = 0; + mutable uint8_t lastChannel = 0xFF; + mutable double filteredFreqHz = 0.0; + mutable std::array lastSquareRaw{}; + mutable std::array squareStable{}; static constexpr bool inRange(uint16_t addr) { return addr >= kBaseAddr && addr <= (kBaseAddr + static_cast(kRegisterCount) - 1); @@ -510,7 +510,7 @@ public: // Track how stable each square channel's raw frequency is so we can bias selection. auto updateSquareHistory = [&](int idx, uint16_t raw) { if (raw == 0 || raw >= 2048U) { - squareStable[static_cast(idx)] = 0; + squareStable[static_cast(idx)] = 0; lastSquareRaw[static_cast(idx)] = 0; return; } @@ -520,7 +520,7 @@ public: squareStable[static_cast(idx)] = static_cast(current + 1); } else { lastSquareRaw[static_cast(idx)] = raw; - squareStable[static_cast(idx)] = 0; + squareStable[static_cast(idx)] = 0; } }; @@ -548,7 +548,7 @@ public: updateSquareHistory(0, raw); pushCandidate(freq, loud, 3, Channel::Square1); } else { - squareStable[0] = 0; + squareStable[0] = 0; lastSquareRaw[0] = 0; } } @@ -568,7 +568,7 @@ public: updateSquareHistory(1, raw); pushCandidate(freq, loud, 3, Channel::Square2); } else { - squareStable[1] = 0; + squareStable[1] = 0; lastSquareRaw[1] = 0; } } @@ -625,7 +625,7 @@ public: for (int idx = 0; idx < 2; ++idx) { if (!squareActive[idx]) { - squareStable[static_cast(idx)] = 0; + squareStable[static_cast(idx)] = 0; lastSquareRaw[static_cast(idx)] = 0; } } @@ -691,9 +691,8 @@ public: bestSquare = squareCandidates[1]; } if (!bestSquare) { - const Candidate* preferred = - (squareAlternate & 1U) ? squareCandidates[1] : squareCandidates[0]; - bestSquare = preferred; + const Candidate* preferred = (squareAlternate & 1U) ? squareCandidates[1] : squareCandidates[0]; + bestSquare = preferred; squareAlternate ^= 1U; } } @@ -705,7 +704,7 @@ public: if (!best) best = bestOther; else if (bestOther) { - int bestScore = static_cast(best->loud); + int bestScore = static_cast(best->loud); int otherScore = static_cast(bestOther->loud); if (waveBass) { if (best->channel == Channel::Wave)