Skip to content

Commit

Permalink
Bring back green mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Staacks committed Jul 4, 2023
1 parent 1c2faf3 commit d9a6895
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions firmware/jpeg/jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define JPEG_DATA_SIZE (SCREEN_SIZE * 5 / 8) //5bit per pixel, see https://github.com/Staacks/gbinterceptor/issues/17
#define JPEG_HEADER_SIZE 188
#define JPEG_END_SIZE 2895
#define JPEG_CHROMA_OFFSET (JPEG_HEADER_SIZE + JPEG_DATA_SIZE + 12)

void prepareJpegEncoding();
void startBackbufferToJPEG(bool allowFrameBlend);
Expand Down
7 changes: 7 additions & 0 deletions firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ enum FallbackScreenType {FST_NONE = 0, FST_DEFAULT, FST_OFF, FST_ERROR} fallback
int dmaChannel;
dma_channel_config dmaConfig;

bool dmgColorMode = false;

void setupGPIO() {
gpio_init(GBSENSE_PIN);
gpio_init(LED_SWITCH_PIN);
Expand All @@ -58,6 +60,11 @@ void checkModeSwitch() {
modeButtonDebounce = true;
//Button pressed, switch mode
frameBlending = !frameBlending;
if (frameBlending) {
dmgColorMode = !dmgColorMode;
frontBuffer[JPEG_CHROMA_OFFSET] = dmgColorMode ? 0b10001000 : 0x00;
readyBuffer[JPEG_CHROMA_OFFSET] = dmgColorMode ? 0b10001000 : 0x00;
}
renderOSD(frameBlending ? "Blending ON" : "Blending OFF", 0x03, 0x00, MODE_INFO_DURATION);
}
} else if (modeButtonDebounce) {
Expand Down

0 comments on commit d9a6895

Please sign in to comment.