Skip to content

Commit

Permalink
Fixed texture copy race.
Browse files Browse the repository at this point in the history
  • Loading branch information
profi200 committed Dec 28, 2019
1 parent c5884f7 commit 04efa8e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions source/arm11/hardware/gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ void GFX_init(bool clearScreens)
GFX_waitForEvent(GFX_EVENT_PSC1, true);
GX_memoryFill((u64*)RENDERBUF_TOP, 1u<<9, SCREEN_SIZE_TOP, 0, (u64*)RENDERBUF_SUB, 1u<<9, SCREEN_SIZE_SUB, 0);
GFX_waitForEvent(GFX_EVENT_PSC0, true);

// The transfer engine is borked on screen init on New 3DS.
// Doing a dummy texture copy fixes it.
GX_textureCopy((u64*)RENDERBUF_TOP, 0, (u64*)RENDERBUF_SUB, 0, 16);
}

// We must make sure the I2C bus is not used until this finishes
Expand Down
1 change: 1 addition & 0 deletions source/arm11/menu/menu_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ void updateScreens(void)
{
GX_textureCopy((u64*)RENDERBUF_TOP, 0, (u64*)GFX_getFramebuffer(SCREEN_TOP),
0, SCREEN_SIZE_TOP + SCREEN_SIZE_SUB);
GFX_waitForEvent(GFX_EVENT_PPF, true); // Texture copy
GFX_swapFramebufs();
GFX_waitForEvent(GFX_EVENT_PDC0, true); // VBlank
}
Expand Down

0 comments on commit 04efa8e

Please sign in to comment.