Commit Graph

1519 Commits

Author SHA1 Message Date
Nanquitas
bc6c097dbb Add LightEvent_WaitTimeout 2020-07-15 00:16:16 +02:00
fincs
3874788e85
gsplcd: It's 2020 and we still have typos in IPC wrapper code 2020-07-14 00:28:40 +02:00
fincs
846b79e5a6
cfgu: Correct CFG_Get/SetConfigInfoBlk2/4/8 parameter type 2020-07-13 21:56:08 +02:00
fincs
bd9e559309
Add gfxScreenSwapBuffers, see details:
- Added the ability to duplicate the left eye image to the right eye
  (allows apps to skip rendering to the right eye framebuffer when
   the 3d slider is set to 0.0)
- Deprecated gfxConfigScreen
2020-07-07 13:06:28 +02:00
fincs
4a9c547d8b
Add CondVar implementation 2020-07-07 12:44:18 +02:00
TuxSH
ef6289f977 Add svcControlPerformanceCounter 2020-07-07 12:43:41 +02:00
TuxSH
1ba8d40069 Add/update DMA svcs 2020-07-06 13:22:18 +02:00
TuxSH
58b30bad06 Reorder svcs and replace some void* params, see details:
- New category: "device drivers" (svc 0x5x)
- Use u32 instead of void* when process handles are required
2020-07-06 13:22:18 +02:00
fincs
577fe60268
archive_dev: Reduce maximum simultaneous opened archives from 32 to 8 in order to conserve memory 2020-07-03 20:24:11 +02:00
fincs
75a7312e40
Add romfsMountFromTitle and refactor os-versionbin.c to use it 2020-07-03 20:20:26 +02:00
fincs
24dded1c79
Remove long-since obsolete hb:HB code 2020-07-03 18:09:14 +02:00
fincs
33a570b1c3
Refactor default heap allocation code, see details:
- Use reslimit svcs to retrieve free mem (suggested by @TuxSH) - this
  removes the hardcoded assumption that the process is in APPLICATION.
- The algorithm for calculating default app/linear heap sizes has been
  tweaked to ensure 32MB of linear heap are available for normal apps
  running on Old3DS consoles under appmemtype 0 (i.e. the default).
- Misc cleanup and error checking.
2020-07-03 18:07:20 +02:00
fincs
da529aed21
romfs_dev: Backport proper multimount system from libnx with some tweaks 2020-07-03 00:24:32 +02:00
fincs
1c7914e2f4
archive/romfs: Reduce TLS usage by sharing buffers + changed archive_rename to use a VLA 2020-07-03 00:24:32 +02:00
fincs
3e1d03aecd
Fix typo in osKernelConfig_s 2020-07-03 00:23:42 +02:00
fincs
83e1f97b5b
Remove superfluous casts in FS_Path usage 2020-07-02 16:34:37 +02:00
fincs
818931b51c
Remove unmaintained cppcheck files 2020-07-02 16:32:58 +02:00
fincs
976d284f3a
Use MemPerm enum instead of magic numbers in svcMapMemoryBlock calls 2020-07-02 00:13:55 +02:00
fincs
4e387679f7
Add structs for kernel/shared pages + related refactor, see details:
- Added osKernelConfig_s/osSharedConfig_s structs
- Added OS_KernelConfig/OS_SharedConfig macros for accessing the pages
- Replaced 0x1FF8nnnn hardcoded addresses with struct accesses
- Added osIsHeadsetConnected function
- Refactored and rewritten RTC time support with the correct algorithm
  (many thanks to @TuxSH for reverse engineering the PTM sysmodule):
  - Fully added and documented the osTimeRef_s structure
    - This replaces the previous internal datetime_t struct type
  - Added osGetTimeRef function:
    - This replaces the previous internal getSysTime function
    - Added missing barrier to the lock free reading algorithm
  - osGetTime rewritten to implement the drift-correction algorithm
    - **This introduces a dependency to __aeabi_ldivmod**
  - __libctru_gtod rewritten to reuse osGetTime
2020-07-01 21:02:22 +02:00
fincs
53cbfc231f
Replace magic numbers with defines for Arm11 userland memory regions; clean up and enhance osConvertVirtToPhys 2020-07-01 20:48:18 +02:00
fincs
dfbfc1564f
os.h: Move MemRegion to svc.h; move osGetMemRegionUsed to header; correct osGetMemRegionUsed/Free return type 2020-07-01 18:11:31 +02:00
fincs
64f29fa024
Fix osStrError (previously it was completely broken...) 2020-07-01 00:21:40 +02:00
fincs
41d0d615f5
ndm: Add NDM_ prefix to enum members in order to avoid name collisions 2020-07-01 00:20:42 +02:00
fincs
9a707b2269
Improve safety of usermode synchronization primitives, see details:
- Added data memory barriers where required to ensure intercore safety
- Changed LightLock to handle 0 during locking instead of silently failing
  (this means trivially initialized/zerofilled LightLocks are now supported)
2020-07-01 00:17:08 +02:00
fincs
19fd446ac5
Add and use svcArbitrateAddressNoTimeout (minor ABI optimization) 2020-06-30 18:45:03 +02:00
piepie62
9974ed1aa3 Add LightSemaphore_TryAcquire and fix Acquire 2020-06-24 00:03:13 +02:00
fincs
8662687a2a
ndsp: Refactor sleep/wakeup code for maintainability/accuracy reasons 2020-06-23 00:36:21 +02:00
fincs
03c41754e8
ndsp: Make wavebuf handling more robust (and fix glaring omissions...) 2020-06-22 22:47:53 +02:00
fincs
2ff08fbac8
synchronization.h: Add __dmb() intrinsic 2020-06-22 22:08:21 +02:00
fincs
b93e7f19bf
Refactor DSP<->APT interaction, see details:
- DSP wrapper is now in charge of handling sleep/awake/cancel events
  - Added DSP hook mechanism (similar to APT hook)
  - The DSP component now gets automatically unloaded/reloaded as needed
- NDSP now uses DSP hook instead of APT hook to manage lifetime
  - Moved sleep/wakeup component management logic into NDSP
- APT now calls into DSP wrapper in order to arbitrate access to the DSP
  - Launching libapplets no longer relinquishes DSP rights - this means
    music can now be played in the background during libapplet activity
2020-06-22 00:34:38 +02:00
Ezekiel Bethel
b559d93eda
fix return value of romfs_stat for non-existent files/directories (#466) 2020-06-18 10:58:39 +01:00
fincs
bfc6ea48fb
gfx: Avoid graphical glitches after deinitialization 2020-06-14 01:20:46 +02:00
fincs
bf55423903
gspgpu: Add gspHasGpuRight 2020-06-14 01:19:13 +02:00
fincs
5ac710a0a2
console: Adjust for wide mode 2020-06-13 22:49:52 +02:00
fincs
d521c99769
gfx: Add support for the top screen's 800px high resolution mode (!!!) 2020-06-13 22:48:36 +02:00
fincs
09d629aa85
gspPresentBuffer: stride is u32 2020-06-13 21:57:09 +02:00
fincs
6ef91576ae
Overhaul gspgpu/gfx code, see details:
- GSPGPU changes:
  - gspInit now properly initializes the event queue, GSP shared memory
    and first-time initialization - previously this was done in gfxInit.
  - Removed gspInitEventHandler/gspExitEventHandler in line with above.
  - Added gspPresentBuffer for pushing a framebuffer to the internal
    GSP swap queue (previously this was an internal function in gfx.c).
  - Added defines for screen IDs and screen dimensions.
  - Removed sharedGspCmdBuf param from gspSubmitGxCommand (now uses
    the correct GSP shared memory address automatically).
  - Removed gxCmdBuf global variable (no longer needed as per above).
  - Removed GSPGPU_REBASE_REG (leftover from early 3DS homebrew).
- GFX changes:
  - Documentation overhaul and code cleanup.
  - Simplified implementation using the enhanced GSPGPU service wrapper.
  - Top left/right framebuffers now form a single allocation instead of
    being split into two separate allocations.
  - Fixed LCD configuration mode when framebuffers are on VRAM.
  - Removed the ability to forcefully swap the screens: gspPresentBuffer
    is now always used (i.e. GSP shared mem). The 'immediate' parameter
    of gfxConfigScreen now does nothing, and gfxSwapBuffers/Gpu now do
    the same thing.
  - Removed gfx{TopLeft,TopRight,Bottom}Framebuffers global variables
    (please use gfxGetFramebuffer instead as originally intended...)
2020-06-13 20:08:37 +02:00
oreo639
26f5f7eb33 Fix travis 2020-06-13 12:32:24 +02:00
fincs
9c1c847388
Introduce syncArbitrateAddress/WithTimeout (replaces __sync_get_arbiter) 2020-06-12 20:40:47 +02:00
fincs
528f8feb0b
Add gspGetBytesPerPixel (replaces internal function)
Also fixes GSPGPU_FramebufferFormat's name
2020-06-12 19:24:15 +02:00
fincs
6c0f7ac99c
threadCreate: correct misleading parameter name 2020-06-12 14:31:42 +02:00
fincs
f49efc3cc7
Add support for userAppInit/userAppExit (backported from libnx) 2020-06-12 14:16:46 +02:00
fincs
8e3c9f9784
Minor internal cleanup 2020-06-12 14:15:18 +02:00
fincs
1442eef9e4
Update travis config again 2020-06-11 20:01:32 +02:00
fincs
ea57fb8821
apt: Revamp chainload handling, see details:
- Added aptClearChainloader (clears pending chainloads)
- Added aptSetChainloaderToSelf (reboots to self, i.e. "soft-reset")
- Internal refactoring
2020-06-11 16:28:57 +02:00
fincs
80fad02255
Add travis badge 2020-06-11 03:43:39 +02:00
fincs
08bff23736
Attempt to fix travis 2020-06-11 03:38:42 +02:00
fincs
5986713066
apt: Refactor sleep/home state handling to be more intuitive, see details:
- Added functions for checking APT state:
  - aptIsActive
  - aptShouldClose
  - aptShouldJumpToHome
  - aptCheckHomePressRejected (replaces aptIsHomePressed)
- Added functions for handling incoming requests:
  - aptHandleSleep
  - aptHandleJumpToHome
- Added aptJumpToHomeMenu (callable anytime) because why not
- aptMainLoop is now aptHandleSleep/JumpToHome + return !aptShouldClose
- APTHOOK_ONEXIT is now called during aptExit
- Internal refactoring
2020-06-11 03:02:24 +02:00
fincs
b48b5da211
apt: Add APT_LockTransition, use it in aptWaitForWakeUp 2020-06-10 21:46:48 +02:00
fincs
6ce690828c
apt: Remove aptLaunchLibraryApplet's return value/hidden aptMainLoop call 2020-06-10 20:14:01 +02:00