Skip to content

Commit

Permalink
Merge pull request #53 from esp-cpp/fix/sms-screenshot
Browse files Browse the repository at this point in the history
fix(sms): fix palette index issue when taking screenshots
  • Loading branch information
finger563 committed Jan 8, 2024
2 parents 522c7e4 + 422df16 commit a18cf2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/sms/src/sms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ std::vector<uint8_t> get_sms_video_buffer() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
uint8_t index = frame_buffer[y * pitch + x];
uint16_t rgb565 = palette[index];
uint16_t rgb565 = palette[index % PALETTE_SIZE];
frame[(y * width + x)*2] = rgb565 & 0xFF;
frame[(y * width + x)*2+1] = (rgb565 >> 8) & 0xFF;
}
Expand Down

0 comments on commit a18cf2c

Please sign in to comment.