**This is a major release. Many essential components have been overhauled, although breaking changes are minimal and only affect rarely used functionality.**
### system
- Added support for userAppInit/userAppExit (backported from libnx).
- Changed default heap allocation logic to be more robust:
- Resource limit SVCs are now used to detect available memory.
- The heap size calculation algorithm was tweaked so that 32MB of linear heap are available for normal apps running under the default appmemtype layout on Old 3DS, as it was the case prior to libctru 1.8.0.
- SVC enhancements:
- Added svcControlPerformanceCounter with corresponding enums.
- These functions replace \_\_sync\_get\_arbiter (which has been removed).
- Added \_\_dmb (Data Memory Barrier) intrinsic.
- Added LightEvent_WaitTimeout.
- Added LightSemaphore_TryAcquire.
- Changed LightLock to support 0 as a valid initial (unlocked) state.
- This effectively adds support for trivially initialized/zerofilled locks.
- Fixed bug in LightSemaphore_Acquire.
### graphics
- Major refactor of the GSP service wrapper. It should now be possible to use GSP directly without the gfx API, if the user so desires.
- Major internal refactor of the gfx wrapper API that increases maintainability.
- Added support for 800px wide mode with non-square pixels on the top screen - usable on every 3DS model except for Old 2DS (but *including* New 2DS XL).
- Added support for 800px wide mode to the libctru console.
- Transferred most of the GSP initialization duties to gspInit/gspExit (previously done by the gfx wrapper).
- Added defines for screen IDs and screen dimensions.
- Added gspPresentBuffer for pushing a framebuffer to the internal GSP swap queue (previously this was an internal function in the gfx wrapper).
- Added gspGetBytesPerPixel, gspHasGpuRight.
- Added gfxScreenSwapBuffers, with support for duplicating left->right eye content during stereoscopic 3D mode.
- Fixed LCD configuration mode when using framebuffers on VRAM with the gfx wrapper.
- Changed gfxExit to set LCD force-black status to true.
- Changed the gfx wrapper to always use gspPresentBuffer during swap. This means the immediate parameter of gfxConfigScreen no longer has any effect, and gfxSwapBuffers/gfxSwapBuffersGpu now do the same thing - that is, present the rendered content during the next VBlank.
- Renamed GSPGPU_FramebufferFormats enum to GSPGPU_FramebufferFormat.
- Removed sharedGspCmdBuf param from gspSubmitGxCommand (now uses the proper GSP shared memory address automatically).
- Removed GSPGPU_REBASE_REG define (leftover from early 3DS homebrew).
- Removed numerous internal fields that were previously publicly accessible.
### audio
- DSP access rights are now managed using a hook mechanism, similar to the APT hook.
- This fixes audio playback during libapplet invocations, as they no longer relinquish DSP rights.
- Changed NDSP to use the DSP hook instead of the APT hook.
- Added dspIsComponentLoaded, dspHook, dspUnhook.
- Fixed and improved robustness of wavebuf handling in NDSP code.
- Fixed and refactored NDSP sleep/wakeup code to improve accuracy compared to official logic.
### filesystem
- Reduced TLS footprint of the archive/romfs devices by sharing buffers.
- Reduced the maximum number of concurrently registered archive devices from 32 to 8 in order to save memory.
- Backported multi-mount romfs system from libnx, with additional optimizations (breaking API change).
- Added romfsMountFromTitle.
- Fixed stat for romfs device to return -1 for non-existent files/directories.
### applet
- Major internal refactor of the APT service wrapper that should improve accuracy compared to official logic.
- Fixed sleep handling when the app is inactive (i.e. app is suspended).
- Added support for screen capture during libapplet transitions.
- Added support for proper DSP access right management.
- aptLaunchLibraryApplet no longer calls aptMainLoop internally. Library applet calls no longer return a bool value, users are advised to check APT state manually afterwards.
- Added support for the nwm::UDS service (Local wireless).
- Added support for the boss:P/boss:U service (SpotPass).
- Added support for using the err:f global port.
- Added support for using and parsing the shared system font.
- Added support for using the 3DS' built-in software keyboard applet.
- Added support for using Light Events, a lightweight alternative to normal events that doesn't consume handles.
- Added NDSP commands for setting up per-channel monopole & biquad filters.
* Major breaking changes:
- Major revamp of the APT code; some old deprecated functions were completely removed, homebrew code abiding by recent standards shouldn't be affected though.
- Major revamp of the HTTPC code, including both additions and bugfixes.
- Major revamp of the AM code, with some enhancements.
- Major revamp of FSUSER code, archive handle handling has been refactored. fs(End)UseSession replaced with fsExemptFromSession.
- Major revamp of MVD code to support video processing.
- Major revamp of the GPU shader code to fully support geometry shaders.
- The old deprecated GPU wrapper commands have been removed. Use direct GPU register writes or a separate GPU wrapper library (such as citro3d) instead.
- Major revamp and update of the SVC debugger API.
- Heap size management has been simplified and made more flexible. All applications now default to 32MB of linear heap and all remaining APPLICATION memory is allocated as the application heap, regardless of entrypoint or application format.
- libctru documentation is now available at http://smealum.github.io/ctrulib/
- Added the NDSP API, which allows the use of the DSP (audio).
- Added Inter Process Communication helpers.
- Added Result code helpers.
- Added support for lightweight synchronization primitives.
- Added support for making the C/C++ standard libraries thread safe.
- Added support for thread-local objects, with the use of standard C and C++ constructs (or GCC extensions).
- Added a new threading API that properly manages internal state. Direct usage of svcCreateThread is deprecated.
- Added a mappable address space allocator. Services which need to map shared memory blocks now use this allocator.
- Added support for embedded RomFS, embedded SMDH and GPU shader building in the template Makefiles.
* Changes and additions to the GPU code:
- Stateless wrapper functions (GPU_*) that merely masked GPU register usage were deprecated, in favour of external GPU wrapper libraries such as citro3d. A future release of libctru may remove them.
- The API set has therefore been simplified down to command list management.
- Synchronized register names with the 3dbrew Wiki.
- Added fragment lighting registers and enums.
- Added procedural texture registers and enums.
- Added shaderProgramSetGshInputPermutation, for configuring the wiring between the vertex shader and the geometry shader.
- Added shaderProgramSetGshMode, for configuring the geometry shader operation mode.
- Added shaderProgramConfigure, intended to be used by GPU wrapper libraries.
- SHBIN/shaderProgram code now correctly computes and sets the values of the GPUREG_SH_OUTATTR_MODE/CLOCK registers.
- GX function naming has been improved, and the initial GX command buffer parameter has been removed.
* Major changes and miscellaneous additions:
- Sweeping changes to make function/structure/enum naming more consistent across the whole library. This affects a lot of code.
- Compiler/linker flags have been tweaked to increase performance and reduce code size, through the garbage collection of unused functions.
- Service initialization is now reference counted in order to properly manage dependencies.
- Initial service handle parameters have been removed, since they were nearly always set to NULL.
- Completed coverage of srv and FSUSER service calls.
- Added fsUseSession and fsEndUseSession for overriding the FSUSER session used in commands in the current thread.
- Added osGet3DSliderState, osSetSpeedupEnable, osGetSystemVersionData and osGetSystemVersionDataString.
- Refactored the MICU service.
- NCCH versions of applications now detect the maximum amount of available memory on startup.
* Miscellaneous changes and bug fixes:
- Commits and pull requests are now built on travis to check that the library compiles, and to generate the documentation.
- General changes and improvements to overall code quality.
- Added the missing struct and functions for Y2R.
- Added srvGetServiceHandleDirect for bypassing the handle override mechanism.
- Usage of the CSND service in new applications is not recommended, however it is not deprecated. The usage of NDSP instead is advised.
- Usage of the HB service in new applications is not recommended due to its necessary removal in hax 2.x, however it is not deprecated.