1704 Commits

Author SHA1 Message Date
PabloMK7
06c3215546 Add svcGetSystemInfo option to get booted firm path 2023-07-07 14:13:24 +02:00
TuxSH
82d689b485 Fix build issues
Closes #1894
2023-06-16 21:28:08 +02:00
TuxSH
631dddeff8 Fix config text wrapping for hb autoboot 2023-03-28 22:24:07 +02:00
TuxSH
64eda63132 Update singleOptionsText 2023-03-28 19:53:11 +02:00
TuxSH
3e6399490c Hide "force audio output" option 2023-03-28 00:40:30 +02:00
TuxSH
4025f252c7 boot menu: clarify autoboot hb is meant to launch hbmenu 2023-03-27 23:44:18 +02:00
TuxSH
985380c0d8 loader: break when failing to load process (e.g. missing boot.3dsx) 2023-03-27 21:49:00 +02:00
TuxSH
dc7edbd44f Fix handling negative screen filters values 2023-03-27 21:35:51 +02:00
TuxSH
ef1072f996 Add option to force audio routing to speakers, closes #1837
Also refactor ini file a little bit
2023-02-10 01:02:01 +00:00
TuxSH
89f77db986 rosalina: clarify name of default screen filter 2023-02-09 00:20:38 +00:00
TuxSH
2e08b7b44f libctru svcCreateCodeSet changes 2023-02-08 18:25:03 +00:00
TuxSH
1d7cca25d1 Fix long-standing bug affecting hbldr TID change option
This was a long-standing bug since Luma3DS v8.0.

If you changed the homebrew title and didn't immediately reboot, then
the ExHeader during termination would not match the ExHeader that was
was used for loading the process, and thus sysmodule process refcounts
would get all messed up.

The obvious solution to this is to ensure no application is running
while changing the hbldr titleID (hence the changes in custom PM).

This was quite possibly one of the cause of homebrew failing to load
when using N3DS H&S.
2023-02-08 16:14:59 +00:00
TuxSH
1888e17b22 Add ability to force routing audio to headphones...
... even when HPs aren't inserted.

This is aimed at people using Bluetooth audio hw mods.

There are some software limitations, please read the INI/option
description.

Closes #1828.
2023-02-08 00:52:57 +00:00
TuxSH
dfeda19451 Fix #1821 2023-02-06 01:27:25 +00:00
TuxSH
5a5332a212 Do not always reboot to HM when autobooting HB
Also fix CRC calculation
2023-02-05 22:08:15 +00:00
TuxSH
9957d6db1a rosalina: move "save settings" to top-level menu 2023-02-05 16:34:37 +00:00
TuxSH
e7a4003f06 rosalina: fix shell open notif. handling at boot
Was causing boot failure with recent commits.
2023-02-05 01:13:02 +00:00
TuxSH
faa4a0d4f9 rosalina: always try to display battery percentage
Even when apps like 3dsident and mGBA open but never relinquish their
mcu::HWC handle.
2023-01-31 17:14:18 +00:00
TuxSH
777b43b285 rosalina: allow setting top and bot screen filters separately 2023-01-31 00:32:16 +00:00
TuxSH
35e6c5ace9 hbldr: fix dependency list (and launch mp)...
Also fix handling of HBLDR_DEFAULT_3DSX_TITLE_NAME, and always display
process creation time in process list on non-release builds.
2023-01-29 19:25:32 +00:00
TuxSH
088cf6b673 hbldr: add act/cecd/friends to deplist
And make WiFi usable earlier when autobooting homebrew
2023-01-25 22:07:21 +00:00
TuxSH
7b97af473a Add ability to redirect app core1 threads to core2
N3DS-only option. See config.ini for details and context. This should
make very demanding games (those which already use 3x clockrate and L2C
by default, like Pokémon US/UM) between 5 to 15% faster. Not widely
tested, and can potentially break some games and other apps.
2023-01-24 22:05:57 +00:00
TuxSH
ceea6afa05 loader: add external CXI loading.
When "load external firms and modules" is enabled, Loader will load the
sysmodule from /luma/sysmodule/<titleid>.cxi (all uppercase, and with
the N3DS title ID bit if relevant) and skip patching. Note that this is
a title ID here, not a process name (unlike what we do for KIPs).

While this is aimed at enabling people to easily load replacements for
official sysmodules, you can load your own custom sysmodules that don't
correspond to anything installed. You can use gdb to do so:

  set remote exec-file <tid>
  run
2023-01-23 19:53:01 +00:00
TuxSH
eb6d8523d1 loader: enable layeredfs+locale emu for all applets
Not tested (except for HM which is known to work).

And restrict code.bin and exheader.bin to when *both* "external firm
and modules" and "game patching" are enabled.
2023-01-22 18:45:47 +00:00
TuxSH
ee9f283d4d rosalina: fix rare screen filter race condition 2023-01-21 20:32:57 +00:00
TuxSH
8dd40158ca Add config persistence for new screen filters stuff 2023-01-21 18:28:53 +00:00
TuxSH
e2e38d9b9f rosalina: refactor screen filter stuff again & add invert 2023-01-20 18:41:16 +00:00
TuxSH
7397c85434 rosalina: add color gamma control, and more
This commits adds an "Advanced configuration" option to screen filters,
where CCT, color gamma, contrast and "brightness" can be fine-tuned,
instead of just using a preset.

Persistence in config.ini TBD in a later commit.
2023-01-20 02:10:14 +00:00
TuxSH
6592b516a4 rosalina: refactor screen filter code
https://i.kym-cdn.com/photos/images/original/001/264/842/220.png
2023-01-17 23:48:07 +00:00
TuxSH
571592ca7c pm: fix handling of "force next app debug" when autobooting homebrew 2023-01-17 00:06:02 +00:00
TuxSH
19f7ef372b errdisp: properly handle game medium being removed
- transform some error codes into "NAND damaged" or "Gamecard removed"
like official errdisp does
- fix bug in SetUserString
- add more info to logfile (/luma/errdisp.txt)
2023-01-11 23:24:59 +00:00
TuxSH
635235c86c pm: fix racecond regression introduced by 7074ac1
It prevented games such as Mario & Luigi: Bowser's Inside Story from booting.

g_manager.runningApplicationData needs to be accessed through the lock.
2023-01-09 14:22:37 +00:00
TuxSH
a812990f0d pm: mitigate libctru race condition+kernel bug
(when doing dirty hb chainload)
2023-01-08 19:39:38 +00:00
TuxSH
d09bfaf348 hbldr: grant full RW access to DSP RAM
This makes testing custom DSP firmware binaries much easier.
2023-01-07 22:36:01 +00:00
TuxSH
5cdbfab54b Add build options to Makefile
For stuff like testing PASLR, *hax2x, khc3ds, etc.

Also fix a corner-case bug when changing the 3dsx app from itself to
itself, if its TID corresponds to the default.
2023-01-07 15:38:36 +00:00
TuxSH
da0b1a1389 Revert force-setting SysNAND when launching TWL Mode
This being said, neither legacy FIRM nor DSiWare actually support
EmuNAND; installing the same TWL title on both SysNAND and EmuNAND and
then launch it from EmuNAND will work though.

It is only when exiting AGB firm that we want to boot SysNAND no matter
what, because the save file has been written on a partition in SysNAND.

This is mainly to ensure we reboot to the proper NAND in case we reboot.
2023-01-03 21:31:37 +01:00
TuxSH
fe4bb0857b Implement autobooting into homebrew (3DS and DSi modes)
Add config option to autoboot into 3DS and DSi homebrew menu, without
going through Home Menu (nor launching it).

For 3DS homebrew, this requires homebrew built with libctru v2.0.0 or
later (v2.0.0 was released 2.5y ago).

We simulate a "reboot into title" to achieve this. This being said, when
launching stuff like Pokemon US/UM on O3DS, Home Menu reboots into
itself and not the game directly. This will cause Home Menu to crash if
you use this feature and configure it to use a non-default memory layout
(but if you don't, Home Menu will work just fine).
2023-01-03 15:30:07 +01:00
TuxSH
0a6b6865ca loader: always reload ExHeader for hb, after all
Caching exheader for applications launched through Home Menu has very
little benefit, as UnregisterProgram is called a lot, and, for 3DSX,
boot.3dsx/target 3DSX can be changed at any time.
2022-12-29 18:47:43 +01:00
TuxSH
ffbd8554d5 loader: implement PASLR (disabled by default)
Faithfully implement the PASLR algorithm official Loader
uses (it's not very good). Physical address space layout
randomization means that the layout of the pages in physical
memory are randomized, but doens't randomize the virtual addresses.

Also refactor some parts of our Loader impl a little more.
2022-12-29 00:23:45 +01:00
TuxSH
7074ac1166 Move hb:ldr from Rosalina to Loader
Let's not pretend in 2022 that it needed things from rosalina sysmodule
- it did not.

This moves 3DSX loading from Rosalina to Loader, and also removes all
the dependencies Loader had to other Luma3DS components (if kernel ext.
is missing, a default config will be used). This means that, as long as
you replace Loader to the one in here, you will be able to properly load
3DSX files.

Changes:
- hb:ldr is now hosted in loader
- hb:ldr LoadProcess, PatchExHeaderInfo, DebugNextApplicationByForce:
  all removed
- fix a bug where some malformed 3DSX files were not rejected
- grant access to CONFIG11 registers to 3DSX homebrew
- move dirty homebrew chainload (when HM. isn't loaded nor loadable) to
  pm
- pm:dbg (ext.) PrepareToChainloadHomebrew: removed
2022-12-25 23:27:48 +01:00
TuxSH
6fa80c959d Update FatFS from R0.13c to R0.15 2022-12-23 19:25:23 +01:00
TuxSH
a7b840e531 Fix upgrade process possibly copying non-Luma firms
Upgrade process always copied sdmc:/boot.firm to nand:/boot.firm even if
Luma3DS was chainloaded from another path.

Fix this by copying from argv[0], if Luma3DS was launched from the SD
card.

Also use "sdmc:" and "nand:" instead of "0:" and "1:" when using FatFS.

Closes #1776.
2022-12-23 14:48:35 +01:00
TuxSH
fcd08d6614 Patch kernel11 to remove checks on core2/3 thread creation
This stubs checks in SvcCreateThread and SvcSetProcessIdealProcessor
that applied when creating threads on core2 and core3. This allows
non-sysmodules to create threads on core3.

Please note, core2 access was already being automatically granted to
3dsx apps for a long time (this is controlled through a kernel flag),
and other apps that needed it had that flag too.
This commit thus changes nothing for all these applications.

Do not create threads on core3 unless you know exactly what you're doing.
On N3DS, gsp (GPU sysmodule) depends on qtm (head-tracking sysmodule) which
runs many threads at very high priority on core3. Running code that needs the
GPU (including printf) on core3 can thus result in thread starvation /
deadlock.

If you just need an extra application core, just use core2 as it is intended
for that exact purpose and is by default completely idle.

Closes #1668
2022-12-17 23:47:19 +01:00
PabloMK7
71cf677b00 config: Ignore rest of pressed buttons (fixes #1769) 2022-09-25 23:01:21 +01:00
Bent
0c3f51815e Rosalina: Fix crash for external PMDBG_DebugNextApplicationByForce 2022-09-25 22:59:02 +01:00
TuxSH
80aee6fdc1 Fix mcu firmware version check (byte order was inverted) 2022-06-10 22:55:18 +01:00
TuxSH
2c184cf7a3 Update chainloader version number 2022-06-04 22:27:31 +01:00
TuxSH
3227b2ea4b Fix battery voltage calculation (thanks nocash) 2022-06-03 23:53:07 +01:00
TuxSH
e5e09c1e13 gdb: use 'swbreak' for bkpt too 2022-06-03 22:18:10 +01:00
TuxSH
4de0375bde kext: fix bug in rosalinaThreadLockPredicate (thanks @hax0kartik) 2022-05-21 20:19:36 +01:00