summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input_common/helpers/joycon_protocol/nfc.cpp6
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp
index 3b7a628e5..f7058c4a7 100644
--- a/src/input_common/helpers/joycon_protocol/nfc.cpp
+++ b/src/input_common/helpers/joycon_protocol/nfc.cpp
@@ -528,9 +528,9 @@ NFCWritePackage NfcProtocol::MakeAmiiboWritePackage(const TagUUID& tag_uuid,
528} 528}
529 529
530NFCDataChunk NfcProtocol::MakeAmiiboChunk(u8 page, u8 size, std::span<const u8> data) const { 530NFCDataChunk NfcProtocol::MakeAmiiboChunk(u8 page, u8 size, std::span<const u8> data) const {
531 constexpr u8 PAGE_SIZE = 4; 531 constexpr u8 NFC_PAGE_SIZE = 4;
532 532
533 if (static_cast<std::size_t>(page * PAGE_SIZE) + size >= data.size()) { 533 if (static_cast<std::size_t>(page * NFC_PAGE_SIZE) + size >= data.size()) {
534 return {}; 534 return {};
535 } 535 }
536 536
@@ -539,7 +539,7 @@ NFCDataChunk NfcProtocol::MakeAmiiboChunk(u8 page, u8 size, std::span<const u8>
539 .data_size = size, 539 .data_size = size,
540 .data = {}, 540 .data = {},
541 }; 541 };
542 std::memcpy(chunk.data.data(), data.data() + (page * PAGE_SIZE), size); 542 std::memcpy(chunk.data.data(), data.data() + (page * NFC_PAGE_SIZE), size);
543 return chunk; 543 return chunk;
544} 544}
545 545
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index c336be707..427afd5fc 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -63,8 +63,12 @@ void BufferCache<P>::RunGarbageCollector() {
63 63
64template <class P> 64template <class P>
65void BufferCache<P>::TickFrame() { 65void BufferCache<P>::TickFrame() {
66 // Calculate hits and shots and move hit bits to the right 66 // Homebrew console apps don't create or bind any channels, so this will be nullptr.
67 if (!channel_state) {
68 return;
69 }
67 70
71 // Calculate hits and shots and move hit bits to the right
68 const u32 hits = std::reduce(channel_state->uniform_cache_hits.begin(), 72 const u32 hits = std::reduce(channel_state->uniform_cache_hits.begin(),
69 channel_state->uniform_cache_hits.end()); 73 channel_state->uniform_cache_hits.end());
70 const u32 shots = std::reduce(channel_state->uniform_cache_shots.begin(), 74 const u32 shots = std::reduce(channel_state->uniform_cache_shots.begin(),