Skip to content

Commit

Permalink
Fix undefined behavior oopsie.
Browse files Browse the repository at this point in the history
  • Loading branch information
coornio committed Sep 20, 2024
1 parent b5e4e00 commit 567b656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Systems/BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void BYTEPUSHER_STANDARD::instructionLoop() noexcept {

void BYTEPUSHER_STANDARD::renderAudioData() {
const std::span<u8, cAudioLength>
samplesOffset{ mMemoryBank.data() + (readData<2>(6) << 8), 0 };
samplesOffset{ mMemoryBank.data() + (readData<2>(6) << 8), cAudioLength };

std::vector<s8> samplesBuffer \
(samplesOffset.begin(), samplesOffset.end());
Expand All @@ -56,7 +56,7 @@ void BYTEPUSHER_STANDARD::renderAudioData() {

void BYTEPUSHER_STANDARD::renderVideoData() {
const std::span<u8, cScreenSizeT>
displayBuffer{ mMemoryBank.data() + (readData<1>(5) << 16), 0 };
displayBuffer{ mMemoryBank.data() + (readData<1>(5) << 16), cScreenSizeT };

BVS->modifyTexture<u8>(displayBuffer,
[](const u32 pixel) noexcept {
Expand Down

0 comments on commit 567b656

Please sign in to comment.