Skip to content

Commit

Permalink
Fix screen tearing before displaying box art
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Sep 16, 2022
1 parent 0804c58 commit e7b1a0c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions romsel_dsimenutheme/arm9/source/graphics/ThemeTextures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,12 @@ void ThemeTextures::commitBgSubModify() {
bgLoc = _frameBufferBot[0];
}
DC_FlushRange(_bgSubBuffer, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
dmaCopyWords(2, _bgSubBuffer, bgLoc, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
if (boxArtColorDeband) {
DC_FlushRange(_bgSubBuffer2, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
}
while (REG_VCOUNT != 191); // Fix screen tearing
dmaCopyWords(2, _bgSubBuffer, bgLoc, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
if (boxArtColorDeband) {
dmaCopyWords(2, _bgSubBuffer2, _frameBufferBot[1], sizeof(u16) * BG_BUFFER_PIXELCOUNT);
}
}
Expand All @@ -644,9 +647,12 @@ void ThemeTextures::commitBgSubModifyAsync() {
bgLoc = _frameBufferBot[0];
}
DC_FlushRange(_bgSubBuffer, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
dmaCopyWordsAsynch(2, _bgSubBuffer, bgLoc, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
if (boxArtColorDeband) {
DC_FlushRange(_bgSubBuffer2, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
}
while (REG_VCOUNT != 191); // Fix screen tearing
dmaCopyWordsAsynch(2, _bgSubBuffer, bgLoc, sizeof(u16) * BG_BUFFER_PIXELCOUNT);
if (boxArtColorDeband) {
ndmaCopyWordsAsynch(2, _bgSubBuffer2, _frameBufferBot[1], sizeof(u16) * BG_BUFFER_PIXELCOUNT);
}
}
Expand Down

0 comments on commit e7b1a0c

Please sign in to comment.