Skip to content

Commit

Permalink
fix - no black screen when reentering app
Browse files Browse the repository at this point in the history
  • Loading branch information
w3irDv committed Aug 3, 2024
1 parent 103c505 commit a22b7af
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/utils/DrawUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ uint32_t DrawUtils::sBufferSizeDRC = 0;
static SFT pFont = {};

static Color font_col(0xFFFFFFFF);
static Color black(0x000000FF);

void *DrawUtils::sBufferTV = NULL, *DrawUtils::sBufferDRC = NULL;
uint32_t DrawUtils::sBufferSizeTV = 0, DrawUtils::sBufferSizeDRC = 0;
Expand All @@ -52,10 +53,25 @@ DrawUtils::ConsoleProcCallbackAcquired(void *context)
sBufferDRC = MEMAllocFromFrmHeapEx(heap, sBufferSizeDRC, 4);
}


sConsoleHasForeground = TRUE;
DrawUtils::setRedraw(true);

OSScreenSetBufferEx(SCREEN_TV, sBufferTV);
OSScreenSetBufferEx(SCREEN_DRC, sBufferDRC);
DrawUtils::initBuffers(sBufferTV, sBufferDRC);

OSScreenEnableEx(SCREEN_TV, 1);
OSScreenEnableEx(SCREEN_DRC, 1);


for (int i = 0; i<2; i++) // both buffers to black
{
DrawUtils::clear(black);
DrawUtils::endDraw();
}

DrawUtils::setRedraw(true); // force a redraw when reentering

return 0;
}

Expand All @@ -77,13 +93,9 @@ DrawUtils::LogConsoleInit()
sBufferSizeDRC = OSScreenGetBufferSizeEx(SCREEN_DRC);

ConsoleProcCallbackAcquired(NULL);
OSScreenEnableEx(SCREEN_TV, 1);
OSScreenEnableEx(SCREEN_DRC, 1);


State::registerProcUICallbacks();

DrawUtils::initBuffers(sBufferTV, sBufferDRC);

return FALSE;
}

Expand Down

0 comments on commit a22b7af

Please sign in to comment.