Luma3DS icon indicating copy to clipboard operation
Luma3DS copied to clipboard

Screen init has been fixed

Open profi200 opened this issue 4 years ago • 11 comments

I have spend some time reverse engineering GSP code to finally fix this. Corgi3DS was also a huge help. It mostly boils down to waiting for MCU events 24-29 and waiting for the LCDs to indicate they are ready. Not doing so causes random screen init problems like we have been plagued by for years. The fix only works if all homebrew bootloaders respect it because turning screens off for example and booting a FIRM too early can make screen init fail in the booted FIRM.

Because i'm not sure if/how IRQ stuff should be integrated into Luma (which is needed to wait for MCU events) i decided to make an issue instead of a PR. Hopefully that doesn't come across as lazy or something.

Here is the code: https://github.com/profi200/open_agb_firm/blob/master/source/arm11/hardware/gfx.c#L118

profi200 avatar Apr 25 '20 15:04 profi200

Wow, I certainly didn't expect that, thank you very much!

It's not going into this release but into the next one, for which I have planned to have an IRQ handler for the Arm11 (to prevent MCU i2c polling)

TuxSH avatar Apr 25 '20 16:04 TuxSH

No worries. It will do for now. When writing that GBA stuff i had screen init problems once more on my N3DS XL so i thought it's time to finally fix this.

profi200 avatar Apr 25 '20 17:04 profi200

Is it just me or does that link not work anymore

hunt-young1 avatar Jan 03 '23 05:01 hunt-young1

Perhaps because this is nearly 3 years old?

urherenow avatar Jan 03 '23 05:01 urherenow

The line you are searching for is now here: https://github.com/profi200/libn3ds/blob/master/source/arm11/drivers/gfx.c#L66

This new driver design has been stable for me and the ported version in GodMode9 is doing well too.

profi200 avatar Jan 03 '23 11:01 profi200

And what i have to do with this line? i have the same problem with the screen flicking with the splash screen on

justamii avatar Jan 11 '23 06:01 justamii

And what i have to do with this line? i have the same problem with the screen flicking with the splash screen on

These lines of code making up a "block of code" is more so pointed here for the developers of the software, who would port over the code from libn3ds/GodMode9 to Luma3DS. It is not beneficial to an end-user.

NightScript370 avatar Jan 30 '23 01:01 NightScript370

The code base Luma uses right now is missing some things like interrupts that are needed for this so i doubt libn3ds will help here (it's in a pretty messy state so i would assume they don't want to use it anyway). If i recall correctly an attempt was made to port this years ago but it didn't work as expected. GodMode9 has some basic interrupt support at least on ARM11 so it works good enough.

profi200 avatar Aug 29 '23 13:08 profi200

It has been in GodMode9 for years. Not in Luma3DS yet.

profi200 avatar Aug 29 '23 18:08 profi200