Commit Graph

1598 Commits

Author SHA1 Message Date
TuxSH
8e55cdf05d Add full support for all QTM services.
This commit adds support for all service commands of all 4 QTM services
(`qtm:u`, `qtm:s`, `qtm:sp` (which are built on top of one another) and
`qtm:c` ("hardware check")), with precise documentation about each command's
behaviour and about I/O internals.

The existing `qtm:c` code in libctru had a lot of misconceptions; this commit is
a full rewrite with breaking changes.

In particular: QTM does *not* track the position of 4 points on the user's face.
Instead, it tracks the position of the user's eyes (but not the direction they are
looking at) and reports their coordinates in camera space and in world space.
The data is presented in a console/hardware-agnostic way to the user.

QTM is a service process responsible for:

- eye tracking (see above). Head tracking data is available even when "super-stable 3D"
  is disabled
- parallax barrier management through the TI TCA6416A I2C->Parallel expander.
  The parallax barrier hardware on N3DS requires that software (in this case, QTM process)
  alternates between writing the barrier's mask pattern & polarity followed by the bit-negation
  of that pattern on polarity continuously, at all times
- automatic barrier management by adjusting it with the results of eye-tracking ("super-stable 3D")
- automatic (and manual) IR LED emitter management so that eye-tracking can work even in the dark
- fowarding camera brightness information from cam:q. GSP uses this for auto-brightness
2024-09-15 21:53:43 +02:00
Nikki
5f06a037d7
Add MCUHWC_SetInfoLedPattern (#549) 2024-09-15 20:45:49 +02:00
Rambo6Glaz
cc5b884d7d
Fix NDMU_QueryStatus (#543) 2024-09-15 18:13:27 +02:00
TuxSH
c5ecf54d51 Fix cmdbuf->bool conversion
Affected code was previously reading 3 uninitialized bytes, making the
conversion return wrong results.
2024-09-07 19:41:47 +02:00
TuxSH
faf5162b60 Fix PTMSYSM_CheckNew3DS, closes #540 2024-03-13 19:24:54 +01:00
TuxSH
a6a6548348 Fix documentation of two functions in ac.h 2024-02-08 00:25:27 +01:00
Kayden Tran
0da8705527
Added ndspChnGetFormat (#538) 2024-01-29 12:04:08 +00:00
fincs
d0936b879b
shaderInstanceInit: properly initialize structure (fix #535) 2023-12-16 16:25:47 +01:00
Dave Murphy
c579a65655
don't pollute system headers with 3ds headers 2023-11-05 11:39:10 +00:00
Dave Murphy
bf4a24a4e7
Changelog for 2.3.0 2023-10-28 20:08:55 +01:00
Chris Feger
bd69c96b7d
Buffer console control sequences (#522) 2023-10-28 19:48:16 +01:00
Gleb Mazovetskiy
41e31d3921
Add CTR_ prefix to ALIGN,PACKED,DEPRECATED macros (#532)
Co-authored-by: fincs <fincs@devkitpro.org>
2023-10-11 21:57:13 +02:00
Tekito_256
687aaf6cfc
FSUSER_GetLegacyBannerData: Fix documentation typo (#526) 2023-10-11 21:29:38 +02:00
Dave Murphy
4de90c3436
remove extra __libc_fini_array 2023-09-25 18:17:34 +01:00
TuxSH
5b2a9f6136 ac: add SSID-related ac:i functions
ACI_LoadNetworkSetting and ACI_GetNetworkWirelessEssidSecuritySsid, plus acGetSessionHandle.
2023-09-16 21:22:37 +02:00
TuxSH
0f098853f2 Add isb and prevent CPU from postponing threadOnException memory writes 2023-09-15 23:15:58 +02:00
oreo639
a4634c0290 Add GPU_DOT3_RGBA texture combiner function 2023-08-12 16:52:12 +02:00
fincs
e9fa000e94
Implement dkA r60 threading syscalls (pthread, std::thread support) 2023-06-24 16:07:06 +02:00
DeltaF1
0cbae436c8
Fix typo in docs (#525)
s/bufger/buffer
2023-05-15 18:19:35 +01:00
Dave Murphy
a9a9d9ab69
libctru v2.2.2 2023-05-08 00:11:49 +01:00
Dave Murphy
6714c04806
adjust struct hostent for compatibility 2023-05-08 00:09:58 +01:00
oreo639
39a53c4fe5
archive_dev: Ensure path separator for local path (#524)
Fixes issue where fopen("test.txt","r") opens 3dstest.txt instead of test.txt.

Also correct misuse of strncat() as count applies to src not dest.

See:
8136d94657
806a4d34c5
2023-05-07 12:08:13 +01:00
Dave Murphy
8d90551306
add define for curl 2023-04-18 12:03:44 +01:00
Dave Murphy
032f3dad40
libctru v2.2.0 2023-04-03 21:39:43 +01:00
TuxSH
b18f04d887 apt: add deliver arg support to chainloader + minor fixes 2023-02-25 20:39:04 +00:00
fincs
98324d412f
libctru v2.1.2 2023-02-09 20:11:27 +01:00
TuxSH
cd78fb05cb Change arg types of svcCreateCodeSet and improve documentation
Since kernel doesn't directly access the LMA, but just does memory
management on them instead, they should be passed as u32 (uptr) instead
of void *.

Also change CodeSetInfo to CodeSetHeader to avoid confusion with
ExHeader types.
2023-02-08 18:17:59 +00:00
TuxSH
a30628058c Implement cdc:CHK service 2023-02-08 00:26:18 +00:00
TuxSH
cb9d682f65 Fix svcGetDmaState
Kernel and official app stubs are buggy, as they read 4 bytes when the
enum is only one byte (meaning 3 garbage bytes).
2023-02-06 17:44:12 +00:00
TuxSH
1de86ea38a Add mcuHwcGetSessionHandle 2023-01-31 17:11:02 +00:00
TuxSH
e253c2c005 errf: implement ERRF_SetUserString & clarify 2023-01-11 23:49:31 +00:00
TuxSH
08b76e2e17 apt: fix dirty homebrew chainload
Fix chainload method used when HM is not launched.

We now wait for custom PM to change our launch flag and ask us to
terminate. We previously had a few issues:
- a potential race condition where we exit before PM changes our
  runflags (not observed)
- a kernel deadlock between ExitProcess and TerminateProcess (observed,
  this is due to Nintendo's lack of barrier in many of their atomics
  code)
- debuggers reporting that we were terminated, instead of exiting
  gracefully (not desirable)
2023-01-09 23:58:32 +00:00
GaryOderNichts
da323fa50b ir: Add IRU_GetSend/RecvFinishedEvent 2022-12-06 12:45:49 +01:00
TurtleP
af5321c78e spaces to tabs 2022-09-25 18:39:09 +02:00
TurtleP
58719f32ac fix ndspGetMasterVol and ndspChnGetMix 2022-09-14 23:52:19 +02:00
TurtleP
ef806d5bd8
add various ndspChnGet* methods (#506) 2022-09-14 19:35:11 +02:00
TurtleP
e6fcbef36c
add various ndspGet* methods (#505) 2022-09-14 19:34:32 +02:00
Ian Chamberlain
b20ac22ab7
Use __tdata_align to align thread local storage (#504) 2022-09-14 19:26:23 +02:00
csnikki
59cf50c201 Include for size_t 2022-08-12 16:45:58 +02:00
ZeroSkill
607f1d1fb6
Fix FSPXI_CreateFile and FSPXI_WriteFile (#496) 2022-06-29 18:19:50 +02:00
Théo B
10cf9bb95a
Mark svcExitProcess as taking no arguments (#499) 2022-06-29 12:37:10 +01:00
Teodor Spæren
813d28ddc4 Implement clock_gettime syscall
This implements the syscalls for `clock_gettime` and `clock_getres`. We
support two clocks: CLOCK_REALTIME and CLOCK_MONOTONIC. I've opted to
use the existing `osGetTime()` code for the realtime clock, because it's
known to work.

For CLOCK_MONOTONIC I've used `svcGetSystemTick()` directly, as it has a
higher resolution. We can ignore the drift and so on, because it's
supposed to be just the number of ticks since last boot.
2022-06-27 20:50:39 +02:00
Théo B
82f821156a
Minor style consistency fix for svcExitProcess (#498) 2022-06-26 17:57:28 +01:00
TuxSH
59e0d7596f Fix PMAPP_TerminateTitle 2022-05-24 19:51:52 +01:00
fincs
d4e08aa2cc
libctru v2.1.1 2022-05-22 16:35:03 +02:00
Dave Murphy
b76a245b79
disable array bounds checking for __tls_start 2022-05-02 15:10:17 +01:00
TuxSH
11686876ac Make sure FPSCR is properly initialized
This is a potentially breaking change as the register was left with an unpredictable/unspecified value.

Config: default NaN mode enabled, flush-to-zero enabled, and round to nearest.
2022-04-12 22:22:56 +01:00
TuxSH
c36d9cc4a6 Provide gspGetSessionHandle and gspLcdGetSessionHandle 2022-04-11 22:55:53 +01:00
TuxSH
cf538b1fa8 Make sure all data is initialized in srv and errf
Prior to system version 11.0, the kernel filled the resulting handle with junk in case of failure, when calling svcConnectToPort, etc.

In some situations libctru could accidentally close valid handles.
2022-04-11 21:15:08 +01:00
Eli Clark
ebb5305188
Fix a typo (NEOPT_IP_INFO comment) (#492) 2022-02-17 09:14:26 +00:00