428 Commits

Author SHA1 Message Date
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
Bent
0c3f51815e Rosalina: Fix crash for external PMDBG_DebugNextApplicationByForce 2022-09-25 22:59:02 +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
ea8f9f4667 loader: refactor part around HIO 2022-05-06 19:53:27 +01:00
TuxSH
65825020ab bootdiag: add process list dumping 2022-04-23 23:55:48 +02:00
TuxSH
e17ff09713 rosalina: Add define to print process creation time 2022-04-23 13:03:30 +02:00
TuxSH
c0eaf1ea3c Add option to toggle power to card slot.
Fixes #1202. This option is meant to be used when you have something like e.g. a flashcard that is misbehaving.
2022-04-15 21:41:23 +01:00
TuxSH
1e95344588 bootdiag: forgot #else 2022-04-11 13:36:14 +01:00
TuxSH
ef842dda2a Fix extremely obnoxious race-cond+uninit handle bug
This is mostly a libctru bug (well, sort of).

This can only happen to built-in sysmodules, and to
processes waiting for err:f, that fail to obtain
handles through svcConnectToPort first try; and only
prior to 11.0.

Prior to fw 11.0, kernel didn't zero-initialize output
handles, and thus the output handle gets filled with
junk (leaked kernel stack data) in case of failure.
Libctru does not account for this, and closes such
handles anyway (in srvInit, errfInit, and possibly
more).

The problem is that, in our case, that garbage was
equal to 0x8000, actually a valid handle, in fact
the first handle to be created (and not closed) in
a process... a handle to KAddressArbiter.

Accidentally closing this handle resulted in one or
more KIPs spin-waiting and starving core1, resulting
in an inability to boot.

We fix this simply by replicating what recent k11 does,
in kext (for svcConnectToPort). For srvGetServiceHandle,
add two layers of safety.
2022-04-10 22:19:32 +01:00
TuxSH
56be46b4bd rosalina: introduce bootdiag, tool to dump state of a process in early init 2022-04-10 21:43:19 +01:00
TuxSH
188d86cb7f gdb: always pass current thread ID when stopping 2022-04-09 21:26:47 +01:00
TuxSH
01ebbf114c Restore extended-remote support & map <GDB PID>-><1 + 3DS PID> (breaking change)
Once more, the "official" gdb client is the one than is the least compliant to its very own stub specs (compared to, say, IDA)
2022-04-09 19:28:33 +01:00
TuxSH
3463effeae rosalina: add "time to boot to HM" in debug menu 2022-04-05 18:33:12 +01:00
TuxSH
c71474a668 Fix #1737 (screen filters CCT was OOB) 2022-03-31 01:16:02 +01:00
TuxSH
676bbf0d88 Moved config file to INI, and more
- Add support for saving screen filters color temperature and NTP timezone offset (you still need to go to misc->save config)
- some advanced options moved to "in ini file only"; "patch games" is now enabled by default
- ntp: fix support for UTC+12 to +14
- remove deprecated custom svc 0x2e
2022-03-28 20:30:02 +01:00
TuxSH
bc6e14ada7 ntp: more precise & also set system time
System time is what System Settings (only) changes; user time seems to be set periodically by HM.
2022-03-16 22:19:49 +00:00
TuxSH
44c1711805 Update copyright years 2022-03-13 18:00:00 +00:00
TuxSH
26ea031f0e
Merge pull request #1623 from s5bug/master
Fix various things about the cheat system
2022-03-08 23:50:20 +00:00
TuxSH
8c3ae4a2fe Wait for B release before exiting rosalina menu
Closes #1701
2022-03-08 23:42:52 +00:00
Gabe Cook
fd4d54a2cc Allow patches in the home menu 2022-03-07 22:19:43 +00:00
George-lewis
e9b8b0daef
Add ASCII View to Rosalina Process List (#1703) 2022-03-07 20:47:06 +00:00
Kookies
b83a0abb9d
Updated sysmodule Defines for latest libctru (#1669) 2021-08-27 06:46:36 +02:00
PabloMK7
352a59fd29
rosalina: fix temperature display
Added 3 leading spaces to the temperature display format string.
2021-07-16 18:23:50 +02:00
PabloMK7
caadb3ae5d
loader: fix fileOpen argument order 2021-06-29 01:20:38 +02:00
TuxSH
8e9a3bfc74 Fix #1638 2021-06-14 23:41:43 +01:00
TuxSH
99a2b8e3b2 Disable gcc 11 false positives 2021-04-30 19:08:50 +01:00
TuxSH
50c81f8165 loader: use fsMakePath 2021-04-30 19:01:13 +01:00
Aly
84e64220ab Actually check whether float instructions should execute 2021-04-10 13:49:48 -07:00
Aly
a3be4673b1 Fix float mode checking for arithmetic operators 2021-04-10 12:38:37 -07:00
Aly
9e3e01b6ac Fix conditional mode checking for the conditional operators 2021-04-10 12:17:41 -07:00
TuxSH
4ae4d16dba rosalina: print sdmmc speed info in debug menu 2021-02-01 02:51:14 +00:00
TuxSH
3afecb064c rosalina: fix #1573 2021-01-27 23:22:09 +00:00
TuxSH
7a0ff659a8 rosalina: simplify SysConfigMenu_ToggleWireless 2021-01-27 23:14:59 +00:00
TuxSH
be6d64260c rosalina: fix bug where config file wasn't closed nor truncated 2021-01-16 21:26:37 +00:00
TuxSH
505a17bba1 rosalina: add DSP firm dumping option 2021-01-16 21:16:32 +00:00
TuxSH
883c5e25dd sysmodules: update ifile, process_patches 2021-01-16 21:16:06 +00:00
TuxSH
2a947b5c42 rosalina: split ntp and timeoffset nullification
- NTP option doesn't require a reboot to take effect anymore and behaves as if you'd used System Settings, taking effect immediately. This is the proper way to do it, and is easier to use.
- Timeoffset nullification kept as a separate option for compatibility. RTC is supposed to be somehwat monotonic; using this option causes issues with SpotPass. IMHO GodMode9 should parse the cfg save file and do things *properly*
2021-01-13 23:55:55 +00:00
TuxSH
a9c021d1c9 rosalina: use mcu optimization trick 2021-01-11 01:02:12 +00:00
TuxSH
57c4d022ab rosalina: fix screen flickering regression 2021-01-08 01:26:17 +00:00
TuxSH
12ed3ae65f rosalina: add kernel&mcu fw ver. to debug info menu 2021-01-07 01:38:40 +00:00
TuxSH
f54c709f64 rosalina: add extra battery info
- Battery percentage now has a resolution of 0.1%
- Battery temperature and battery voltage are now displayed
2021-01-07 01:32:29 +00:00
TuxSH
2fcd2d862d Add small debug helper for sysmodule reimpls 2020-12-07 20:17:30 +00:00
TuxSH
cb4a23a2ba gdb: fix handling of bkpt instructions 2020-12-03 21:48:16 +00:00
TuxSH
c058e3f446
Merge pull request #1466 from Nanquitas/black-fillcolor
Rosalina: ignore fillcolor when opening the menu
2020-11-17 01:30:24 +00:00
Michael Scire
94b5113b17 pm: Fix argument truncation to be compatible with 11.14 ABI 2020-11-16 17:10:45 -08:00
Chris Feger
ebeef7ab7f
Special case for final line read (#1473)
Fixes cheat files without a trailing newline
2020-07-30 05:22:57 +02:00