devkitPro / libctru

Homebrew development library for Nintendo 3DS/Horizon OS user mode (Arm11)

Home Page:https://libctru.devkitpro.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If homebrew is launched directly after NSMB 2, GPU commands aren't being executed anymore

KonPet opened this issue · comments

commented

To reproduce this bug just launch New Super Mario Bros 2, and afterwards any other homebrew game. Now, after initializing the GPU, no gpu commands (like GX_MemoryFill) seem to go through. The functions also never return any errors. And as soon as you start doing more stuff, like drawing a frame, the gpu crashes completely. Despite trying for quite a while I wasn't able to figure out how to fix the crash, I simply don't know enough about how the GPU works.
While looking into the source code I noticed another oddity by the way. Calling GX_MemoryFill and only using the 2nd buffer doesn't work, as the event for a single memory fill being done on channel two is surpressed in source/gpu/gxqueue.c, line 29. Removing the check for that specific event doesn't seem to affect anything, though I haven't thouroughly tested that and I might be missing something. This doesn't matter much, only if the first buffer is busy for some reason so you want to use the second one.

I think I just reproduced this on my N3DSXL.

  1. Launched NSMB2
  2. Pressed Home
  3. Launched mGBA from the home screen
  4. Pressed (A) to confirm closing NSMB2 and launching mGBA
  5. The homebrew animation plays, then a black screen, then the screen is covered in noise.

I was able to take a screenshot with Luma but could not exit the application with the home button and had to use the Luma menu to reboot.
2023-05-15_14-27-19 138_top
2023-05-15_14-27-19 138_bot