├── .editorconfig ├── .github └── workflows │ ├── ci.yml │ └── doc.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE.txt ├── Makefile ├── README.md ├── cafe ├── avm.def ├── camera.def ├── coreinit.def ├── dc.def ├── dmae.def ├── drmapp.def ├── erreula.def ├── gx2.def ├── h264.def ├── lzma920.def ├── mic.def ├── nfc.def ├── nio_prof.def ├── nlibnss.def ├── nlibnss2.def ├── nn_ac.def ├── nn_acp.def ├── nn_act.def ├── nn_aoc.def ├── nn_boss.def ├── nn_ccr.def ├── nn_cmpt.def ├── nn_dlp.def ├── nn_ec.def ├── nn_fp.def ├── nn_hai.def ├── nn_hpad.def ├── nn_idbe.def ├── nn_ndm.def ├── nn_nets2.def ├── nn_nfp.def ├── nn_nim.def ├── nn_olv.def ├── nn_pdm.def ├── nn_save.def ├── nn_sl.def ├── nn_spm.def ├── nn_temp.def ├── nn_uds.def ├── nn_vctl.def ├── nsysccr.def ├── nsyshid.def ├── nsyskbd.def ├── nsysnet.def ├── nsysuhs.def ├── nsysuvd.def ├── ntag.def ├── padscore.def ├── proc_ui.def ├── sndcore2.def ├── snduser2.def ├── swkbd.def ├── sysapp.def ├── tcl.def ├── tve.def ├── uac.def ├── uac_rpl.def ├── usb_mic.def ├── uvc.def ├── uvd.def ├── vpad.def └── vpadbase.def ├── docs ├── CMakeLists.txt └── mainpage.dox ├── include ├── arpa │ └── inet.h ├── avm │ ├── avm.dox │ ├── cec.h │ ├── config.h │ ├── drc.h │ └── tv.h ├── camera │ └── camera.h ├── coreinit │ ├── alarm.h │ ├── atomic.h │ ├── atomic64.h │ ├── bsp.h │ ├── cache.h │ ├── codegen.h │ ├── condition.h │ ├── context.h │ ├── copydata.h │ ├── core.h │ ├── coreinit.dox │ ├── coroutine.h │ ├── cosreport.h │ ├── debug.h │ ├── dynload.h │ ├── energysaver.h │ ├── event.h │ ├── exception.h │ ├── exit.h │ ├── fastcondition.h │ ├── fastmutex.h │ ├── fiber.h │ ├── filesystem.h │ ├── filesystem_fsa.h │ ├── foreground.h │ ├── im.h │ ├── internal.h │ ├── interrupts.h │ ├── ios.h │ ├── ipcbufpool.h │ ├── kernel.h │ ├── launch.h │ ├── mcp.h │ ├── memallocator.h │ ├── memblockheap.h │ ├── memdefaultheap.h │ ├── memexpheap.h │ ├── memfrmheap.h │ ├── memheap.h │ ├── memlist.h │ ├── memory.h │ ├── memorymap.h │ ├── memunitheap.h │ ├── messagequeue.h │ ├── mutex.h │ ├── performancemonitor.h │ ├── rendezvous.h │ ├── savedframe.h │ ├── scheduler.h │ ├── screen.h │ ├── semaphore.h │ ├── smd.h │ ├── spinlock.h │ ├── stopwatch.h │ ├── stopwatchatomic.h │ ├── systeminfo.h │ ├── taskqueue.h │ ├── thread.h │ ├── threadqueue.h │ ├── time.h │ ├── title.h │ ├── transition.h │ └── userconfig.h ├── dmae │ ├── dmae.dox │ ├── mem.h │ └── sync.h ├── erreula │ ├── erreula.dox │ └── rpl_interface.h ├── gx2 │ ├── aperture.h │ ├── clear.h │ ├── context.h │ ├── debug.h │ ├── display.h │ ├── displaylist.h │ ├── draw.h │ ├── enum.h │ ├── event.h │ ├── gx2.dox │ ├── mem.h │ ├── registers.h │ ├── sampler.h │ ├── shaders.h │ ├── state.h │ ├── surface.h │ ├── swap.h │ ├── temp.h │ ├── tessellation.h │ ├── texture.h │ └── utils.h ├── gx2r │ ├── buffer.h │ ├── displaylist.h │ ├── draw.h │ ├── gx2r.dox │ ├── mem.h │ ├── resource.h │ └── surface.h ├── h264 │ ├── decode.h │ └── stream.h ├── mic │ └── mic.h ├── netdb.h ├── netinet │ ├── in.h │ └── tcp.h ├── nfc │ ├── nfc.dox │ └── nfc.h ├── nn │ ├── ac.h │ ├── ac │ │ ├── ac_c.h │ │ └── ac_cpp.h │ ├── acp.h │ ├── acp │ │ ├── client.h │ │ ├── device.h │ │ ├── drcled_c.h │ │ ├── drcled_cpp.h │ │ ├── nn_acp_types.h │ │ ├── result.h │ │ ├── save.h │ │ └── title.h │ ├── act.h │ ├── act │ │ └── client_cpp.h │ ├── ccr.h │ ├── ccr │ │ ├── sys.h │ │ └── sys_caffeine.h │ ├── cfg │ │ └── CTR.h │ ├── cmpt.h │ ├── cmpt │ │ └── cmpt.h │ ├── dlp.h │ ├── dlp │ │ └── Cafe.h │ ├── erreula.h │ ├── erreula │ │ └── erreula_cpp.h │ ├── ffl │ │ └── miidata.h │ ├── fp.h │ ├── fp │ │ └── fp_cpp.h │ ├── hpad.h │ ├── hpad │ │ ├── beta.h │ │ └── hpad.h │ ├── idb.h │ ├── nets2.h │ ├── nets2 │ │ └── somemopt.h │ ├── nfp.h │ ├── nfp │ │ ├── amiibo_settings_cpp.h │ │ └── nfp_cpp.h │ ├── nn.dox │ ├── pdm.h │ ├── pdm │ │ ├── pdm_c.h │ │ └── pdm_cpp.h │ ├── result.h │ ├── save.h │ ├── save │ │ └── save.h │ ├── sl.h │ ├── sl │ │ ├── CacheManager.h │ │ ├── Condition.h │ │ ├── DataCreator.h │ │ ├── DrcManager.h │ │ ├── FileStream.h │ │ ├── IAccountInfoAccessor.h │ │ ├── IBlackListAccessor.h │ │ ├── IDefaultTitleAccessor.h │ │ ├── IDiscCachedTitleAccessor.h │ │ ├── IIconInfoAccessor.h │ │ ├── IInstalledTitleListAccessor.h │ │ ├── IKillerNotificationAccessor.h │ │ ├── ILaunchedTitleListAccessor.h │ │ ├── IMetaInfoAccessor.h │ │ ├── IPreferentialTitleAccessor.h │ │ ├── ISerializer.h │ │ ├── ISettingAccessor.h │ │ ├── IStream.h │ │ ├── ITimeAccessor.h │ │ ├── ITitleIconCache.h │ │ ├── ITitleListAccessor.h │ │ ├── ITransferrer.h │ │ ├── IUpdatePackageAccessor.h │ │ ├── IWhiteListAccessor.h │ │ ├── KillerNotification.h │ │ ├── KillerNotificationSelector.h │ │ ├── KillerNotificationTransferRecordManager.h │ │ ├── KillerNotificationTransferRecordStream.h │ │ ├── LaunchInfoDatabase.h │ │ ├── QuickStartApplicationSelector.h │ │ ├── TitleIconCache.h │ │ ├── TitleListCache.h │ │ ├── details │ │ │ ├── IAccountInfoAccessorDetails.h │ │ │ ├── IBlackListAccessorDetails.h │ │ │ ├── IDefaultTitleAccessorDetails.h │ │ │ ├── IDiscCachedTitleAccessorDetails.h │ │ │ ├── IIconInfoAccessorDetails.h │ │ │ ├── IInstalledTitleListAccessorDetails.h │ │ │ ├── IKillerNotificationAccessorDetails.h │ │ │ ├── IKillerNotificationTransferRecordManagerDetails.h │ │ │ ├── ILaunchedTitleListAccessoDetails.h │ │ │ ├── IMetaInfoAccessorDetails.h │ │ │ ├── IPreferentialTitleAccessorDetails.h │ │ │ ├── ISerializerDetails.h │ │ │ ├── ISettingAccessorDetails.h │ │ │ ├── IStreamDetails.h │ │ │ ├── ITimeAccessorDetails.h │ │ │ ├── ITitleIconCacheDetails.h │ │ │ ├── ITitleListAccessorDetails.h │ │ │ ├── ITransferrerDetails.h │ │ │ ├── IUpdatePackageAccessorDetails.h │ │ │ └── IWhiteListAccessorDetails.h │ │ └── sl_cpp.h │ ├── spm.h │ ├── spm │ │ └── storage.h │ ├── swkbd.h │ ├── swkbd │ │ └── swkbd_cpp.h │ ├── temp.h │ ├── temp │ │ └── temp.h │ ├── uds.h │ └── uds │ │ ├── Cafe.h │ │ ├── NodeInformation.h │ │ └── ScrambledLocalFriendCode.h ├── nsysccr │ ├── ccr.h │ ├── cdc.h │ ├── cfg.h │ ├── hid.h │ ├── irda.h │ ├── nfc.h │ └── nsysccr.dox ├── nsyshid │ ├── hid.h │ └── nsyshid.dox ├── nsyskbd │ └── nsyskbd.h ├── nsysnet │ ├── _netdb.h │ ├── _socket.h │ ├── misc.h │ ├── netconfig.h │ ├── nssl.h │ ├── nsysnet.dox │ └── socket.h ├── nsysuhs │ ├── nsysuhs.dox │ ├── uhs.h │ └── uhs_usbspec.h ├── ntag │ ├── ntag.dox │ └── ntag.h ├── padscore │ ├── kpad.h │ ├── padscore.dox │ ├── wbc.h │ └── wpad.h ├── poll.h ├── proc_ui │ ├── memory.h │ ├── procui.dox │ └── procui.h ├── sndcore2 │ ├── core.h │ ├── device.h │ ├── drcvs.h │ ├── result.h │ ├── sndcore2.dox │ └── voice.h ├── swkbd │ ├── rpl_interface.h │ └── swkbd.dox ├── sys │ ├── ioctl.h │ ├── select.h │ └── socket.h ├── sysapp │ ├── args.h │ ├── launch.h │ ├── switch.h │ ├── sysapp.dox │ └── title.h ├── tve │ ├── cec.h │ ├── tve.dox │ └── tve.h ├── vpad │ ├── input.h │ └── vpad.dox ├── vpadbase │ ├── base.h │ └── vpadbase.dox ├── wut.h ├── wut_rplwrap.h ├── wut_structsize.h └── wut_types.h ├── libraries ├── libgfd │ ├── include │ │ └── gfd.h │ └── src │ │ └── gfd.c ├── libirc │ ├── include │ │ └── irc │ │ │ ├── cdc.h │ │ │ └── irc.h │ └── src │ │ ├── cdc.c │ │ └── irc.c ├── libwhb │ ├── include │ │ └── whb │ │ │ ├── align.h │ │ │ ├── crash.h │ │ │ ├── file.h │ │ │ ├── gfx.h │ │ │ ├── libmanager.h │ │ │ ├── log.h │ │ │ ├── log_cafe.h │ │ │ ├── log_console.h │ │ │ ├── log_module.h │ │ │ ├── log_udp.h │ │ │ ├── proc.h │ │ │ └── sdcard.h │ └── src │ │ ├── console.c │ │ ├── crash.c │ │ ├── file.c │ │ ├── gfx.c │ │ ├── gfx_heap.c │ │ ├── gfx_heap.h │ │ ├── gfx_shader.c │ │ ├── gfx_texture.c │ │ ├── libmanager.c │ │ ├── log.c │ │ ├── log_cafe.c │ │ ├── log_module.c │ │ ├── log_udp.c │ │ ├── proc.c │ │ └── sdcard.c ├── nn_erreula │ └── nn_erreula.cpp ├── nn_idb │ ├── include │ │ └── nn │ │ │ └── idb │ │ │ ├── IDBReader.h │ │ │ └── idb_cpp.h │ └── src │ │ └── IDBReader.cpp ├── nn_sl │ ├── IAccountInfoAccessor.cpp │ ├── IBlackListAccessor.cpp │ ├── IDefaultTitleAccessor.cpp │ ├── IDiscCachedTitleAccessor.cpp │ ├── IIconInfoAccessor.cpp │ ├── IInstalledTitleListAccessor.cpp │ ├── IKillerNotificationAccessor.cpp │ ├── ILaunchedTitleListAccessor.cpp │ ├── IMetaInfoAccessor.cpp │ ├── IPreferentialTitleAccessor.cpp │ ├── ISerializer.cpp │ ├── ISettingAccessor.cpp │ ├── ITimeAccessor.cpp │ ├── ITitleIconCache.cpp │ ├── ITitleListAccessor.cpp │ ├── ITransferrer.cpp │ ├── IUpdatePackageAccessor.cpp │ ├── IWhiteListAccessor.cpp │ ├── KillerNotificationTransferRecordManager.cpp │ ├── KillerNotificationTransferRecordStream.cpp │ └── TitleListCache.cpp ├── nn_swkbd │ └── nn_swkbd.cpp ├── wutcrt │ ├── crt0_rpl.s │ ├── crt0_rpx.s │ ├── wut_crt.c │ └── wut_preinit.c ├── wutdefaultheap │ └── wut_defaultheap.c ├── wutdevoptab │ ├── MutexWrapper.h │ ├── devoptab_fsa.cpp │ ├── devoptab_fsa.h │ ├── devoptab_fsa_chdir.cpp │ ├── devoptab_fsa_chmod.cpp │ ├── devoptab_fsa_close.cpp │ ├── devoptab_fsa_dirclose.cpp │ ├── devoptab_fsa_dirnext.cpp │ ├── devoptab_fsa_diropen.cpp │ ├── devoptab_fsa_dirreset.cpp │ ├── devoptab_fsa_fstat.cpp │ ├── devoptab_fsa_fsync.cpp │ ├── devoptab_fsa_mkdir.cpp │ ├── devoptab_fsa_open.cpp │ ├── devoptab_fsa_read.cpp │ ├── devoptab_fsa_rename.cpp │ ├── devoptab_fsa_rmdir.cpp │ ├── devoptab_fsa_seek.cpp │ ├── devoptab_fsa_stat.cpp │ ├── devoptab_fsa_statvfs.cpp │ ├── devoptab_fsa_truncate.cpp │ ├── devoptab_fsa_unlink.cpp │ ├── devoptab_fsa_utils.cpp │ └── devoptab_fsa_write.cpp ├── wutmalloc │ └── wut_malloc.c ├── wutnewlib │ ├── wut_clock.c │ ├── wut_clock.h │ ├── wut_gettod_r.c │ ├── wut_lock.c │ ├── wut_malloc_lock.c │ ├── wut_nanosleep.c │ ├── wut_newlib.c │ ├── wut_newlib.h │ ├── wut_reent.c │ ├── wut_sbrk.c │ ├── wut_thread_specific.c │ └── wut_thread_specific.h ├── wutsocket │ ├── NSSLCreateConnection.c │ ├── accept.c │ ├── addrinfo.c │ ├── bind.c │ ├── connect.c │ ├── fcntl.c │ ├── getpeername.c │ ├── getsockname.c │ ├── getsockopt.c │ ├── host.c │ ├── hostid.c │ ├── inet_addr.c │ ├── inet_ntop.c │ ├── inet_pton.c │ ├── ioctl.c │ ├── listen.c │ ├── poll.c │ ├── recv.c │ ├── recvfrom.c │ ├── select.c │ ├── send.c │ ├── sendto.c │ ├── setsockopt.c │ ├── shutdown.c │ ├── sockatmark.c │ ├── socket.c │ ├── somemopt.c │ ├── stubs.c │ ├── wut_socket.h │ ├── wut_socket_close.c │ ├── wut_socket_common.c │ ├── wut_socket_open.c │ ├── wut_socket_read.c │ └── wut_socket_write.c └── wutstdc++ │ ├── wut_gthread.cpp │ ├── wut_gthread.h │ ├── wut_gthread_cond.cpp │ ├── wut_gthread_keys.cpp │ ├── wut_gthread_mutex.cpp │ ├── wut_gthread_once.cpp │ ├── wut_gthread_recursive_mutex.cpp │ └── wut_gthread_thread.cpp ├── samples ├── cmake │ ├── CMakeLists.txt │ ├── content │ │ ├── README.txt │ │ ├── pos_col_shader.gsh │ │ ├── pos_col_shader.psh │ │ └── pos_col_shader.vsh │ ├── custom_default_heap │ │ ├── CMakeLists.txt │ │ ├── exports.def │ │ └── main.c │ ├── erreula │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── gx2_triangle │ │ ├── CMakeLists.txt │ │ └── main.c │ ├── helloworld │ │ ├── CMakeLists.txt │ │ └── main.c │ ├── helloworld_cpp │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── my_first_rpl │ │ ├── CMakeLists.txt │ │ ├── exports.def │ │ ├── my_first_rpl.c │ │ ├── my_first_rpl.h │ │ └── my_first_rpx.c │ └── swkbd │ │ ├── CMakeLists.txt │ │ └── main.cpp └── make │ ├── Makefile │ ├── helloworld │ ├── Makefile │ └── source │ │ └── main.c │ └── helloworld_cpp │ ├── Makefile │ └── source │ └── main.cpp ├── share ├── rpl.specs ├── wut.cmake ├── wut.ld ├── wut.specs ├── wut.toolchain.cmake └── wut_rules └── tests ├── CMakeLists.txt ├── test_compile_headers_as_c11 ├── CMakeLists.txt └── main.c ├── test_compile_headers_as_c99 ├── CMakeLists.txt └── main.c ├── test_compile_headers_as_cpp ├── CMakeLists.txt └── main.cpp └── test_compile_headers_common └── test_compile_headers_list.h /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 3 10 | 11 | [{Makefile,*/Makefile,*.mk,*_rules}] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [*.yml] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | name: ubuntu-latest 8 | runs-on: ubuntu-latest 9 | container: devkitpro/devkitppc:latest 10 | 11 | steps: 12 | - uses: actions/checkout@v3 13 | with: 14 | submodules: true 15 | 16 | - name: Build 17 | run: | 18 | make -j2 19 | make install 20 | 21 | - name: Build Test 22 | run: | 23 | cd tests 24 | mkdir build && cd build 25 | /opt/devkitpro/portlibs/wiiu/bin/powerpc-eabi-cmake ../ 26 | make -j2 27 | 28 | - name: Build Samples (Make) 29 | run: | 30 | cd samples/make 31 | make -j2 32 | 33 | - name: Build Samples (CMake) 34 | run: | 35 | cd samples/cmake 36 | mkdir build && cd build 37 | /opt/devkitpro/portlibs/wiiu/bin/powerpc-eabi-cmake ../ 38 | make -j2 39 | -------------------------------------------------------------------------------- /.github/workflows/doc.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | workflow_dispatch: 8 | 9 | jobs: 10 | doc: 11 | name: Deploy documentation 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | 16 | - name: Checkout the Git repository 17 | uses: actions/checkout@v4 18 | 19 | - name: Fetch tags 20 | run: | 21 | git fetch --tags 22 | 23 | - name: Get current tag 24 | id: vars 25 | run: echo "tag=`git tag --sort=-version:refname | head -n 1`" >> "$GITHUB_OUTPUT" 26 | 27 | - name: Generate Documentation 28 | run: | 29 | sudo apt-get update 30 | sudo apt-get install -y cmake doxygen doxygen-latex graphviz 31 | cd docs 32 | sudo env WUT_VERSION=${{ steps.vars.outputs.tag }} cmake . 33 | doxygen Doxyfile.docs >/dev/null 34 | 35 | - name: Deploy to GitHub Pages 36 | uses: JamesIves/github-pages-deploy-action@v4.2.3 37 | with: 38 | branch: gh-pages 39 | folder: docs/html 40 | single-commit: true 41 | clean: true 42 | clean-exclude: CNAME 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .*/ 2 | !.github/ 3 | build/ 4 | release/ 5 | debug/ 6 | lib/ 7 | *.a 8 | *.o 9 | *.d 10 | *.elf 11 | *.rpl 12 | *.rpx 13 | *.wuhb 14 | *.bz2 15 | docs/html/ 16 | CMakeSettings.json 17 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present devkitPro, wut Authors 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------------- /cafe/camera.def: -------------------------------------------------------------------------------- 1 | :NAME camera 2 | 3 | :TEXT 4 | CAMCheckMemSegmentation 5 | CAMClose 6 | CAMExit 7 | CAMGetMemReq 8 | CAMGetState 9 | CAMGetStateInfo 10 | CAMInit 11 | CAMOpen 12 | CAMSetState 13 | CAMSubmitTargetSurface 14 | -------------------------------------------------------------------------------- /cafe/dc.def: -------------------------------------------------------------------------------- 1 | :NAME dc 2 | 3 | :TEXT 4 | DCAssortedEnable 5 | DCCalcGamma 6 | DCCompat 7 | DCDisableCRTC 8 | DCDisableDVOCapInterrupt 9 | DCDisableTrigAInterrupt 10 | DCEnableCRTC 11 | DCEnableDVOCapInterrupt 12 | DCEnableDimming 13 | DCEnableFlipInterrupt 14 | DCEnablePipe 15 | DCEnableTrigAInterrupt 16 | DCEnableVlineInterrupt 17 | DCEnableVsyncInterrupt 18 | DCExit 19 | DCFlipBuffer 20 | DCForceMode 21 | DCGetBlankState 22 | DCGetBufferRequirement 23 | DCGetCRTCMode 24 | DCGetCurrentEye 25 | DCGetFormat 26 | DCGetFrameCount 27 | DCGetGamma 28 | DCGetLetterbox 29 | DCGetPitch 30 | DCGetRenderResolution 31 | DCGetUnderScan 32 | DCGetVertCount 33 | DCInit 34 | DCIsDimmingOn 35 | DCIsOVLEnable 36 | DCSetBuffer 37 | DCSetCRTCMode 38 | DCSetCompatPLL 39 | DCSetDVOCapCb 40 | DCSetFlipCb 41 | DCSetFormat 42 | DCSetGamma 43 | DCSetLetterbox 44 | DCSetPillarBox 45 | DCSetPitch 46 | DCSetRenderMode 47 | DCSetRenderResolution 48 | DCSetTVPALGamma 49 | DCSetTrigACb 50 | DCSetUnderScan 51 | DCSetUnderScanEx 52 | DCSetVIClock 53 | DCSetVlineCb 54 | DCSetVsyncCb 55 | DCUpdate 56 | -------------------------------------------------------------------------------- /cafe/dmae.def: -------------------------------------------------------------------------------- 1 | :NAME dmae 2 | 3 | :TEXT 4 | DMAECopyMem 5 | DMAEFillMem 6 | DMAEFillMemPhys 7 | DMAEGetLastSubmittedTimeStamp 8 | DMAEGetRetiredTimeStamp 9 | DMAEGetTimeout 10 | DMAESemaphore 11 | DMAESetTimeout 12 | DMAEWaitDone 13 | _DMAESubmit 14 | _DMAESubmitToRing 15 | -------------------------------------------------------------------------------- /cafe/drmapp.def: -------------------------------------------------------------------------------- 1 | :NAME drmapp 2 | 3 | :TEXT 4 | AocChkGetJumpCode__3RplFv 5 | AocChkGetState__3RplFv 6 | AocChkIsFinished__3RplFv 7 | AocChkIsHomeButtonAllowed__3RplFv 8 | AocChkIsPowerButtonAllowed__3RplFv 9 | AocChkStart__3RplFRCQ3_2nn6drmapp8StartArg 10 | AppChkGetState__3RplFv 11 | AppChkIsFinished__3RplFv 12 | AppChkIsHomeButtonAllowed__3RplFv 13 | AppChkIsPowerButtonAllowed__3RplFv 14 | AppChkStart__3RplFRCQ3_2nn6drmapp8StartArg 15 | Calculate__3RplFRCQ3_2nn6drmapp14ControllerInfo 16 | DrawDRC__3RplFv 17 | DrawTV__3RplFv 18 | Finalize__3RplFv 19 | Initialize__3RplFRCQ3_2nn6drmapp13InitializeArg 20 | InstallerGetState__3RplFv 21 | InstallerIsFinished__3RplFv 22 | InstallerIsHomeButtonAllowed__3RplFv 23 | InstallerIsPowerButtonAllowed__3RplFv 24 | InstallerStart__3RplFRCQ3_2nn6drmapp8StartArg 25 | IsProgressBarVisible__3RplFv 26 | NupChkGetState__3RplFPi 27 | NupChkIsFinished__3RplFv 28 | NupChkIsHomeButtonAllowed__3RplFv 29 | NupChkIsPowerButtonAllowed__3RplFv 30 | NupChkIsSyncButtonAllowed__3RplFv 31 | NupChkStart__3RplFRCQ3_2nn6drmapp8StartArg 32 | NupDlGetState__3RplFPi 33 | NupDlIsFinished__3RplFv 34 | NupDlIsHomeButtonAllowed__3RplFv 35 | NupDlIsPowerButtonAllowed__3RplFv 36 | NupDlStart__3RplFRCQ3_2nn6drmapp8StartArg 37 | PatchChkGetJumpCode__3RplFv 38 | PatchChkGetState__3RplFv 39 | PatchChkIsFinished__3RplFv 40 | PatchChkIsHomeButtonAllowed__3RplFv 41 | PatchChkIsPowerButtonAllowed__3RplFv 42 | PatchChkStart__3RplFRCQ3_2nn6drmapp8StartArg 43 | TicketChkGetState__3RplFv 44 | TicketChkIsFinished__3RplFv 45 | TicketChkIsHomeButtonAllowed__3RplFv 46 | TicketChkIsPowerButtonAllowed__3RplFv 47 | TicketChkStart__3RplFRCQ3_2nn6drmapp8StartArg 48 | -------------------------------------------------------------------------------- /cafe/erreula.def: -------------------------------------------------------------------------------- 1 | :NAME erreula 2 | 3 | :TEXT 4 | ErrEulaAppearError__3RplFRCQ3_2nn7erreula9AppearArg 5 | ErrEulaAppearHomeNixSign__3RplFRCQ3_2nn7erreula14HomeNixSignArg 6 | ErrEulaCalc__3RplFRCQ3_2nn7erreula14ControllerInfo 7 | ErrEulaChangeLang__3RplFQ3_2nn7erreula8LangType 8 | ErrEulaCreate__3RplFPUcQ3_2nn7erreula10RegionTypeQ3_2nn7erreula8LangTypeP8FSClient 9 | ErrEulaDestroy__3RplFv 10 | ErrEulaDisappearError__3RplFv 11 | ErrEulaDisappearHomeNixSign__3RplFv 12 | ErrEulaDrawDRC__3RplFv 13 | ErrEulaDrawTV__3RplFv 14 | ErrEulaGetResultCode__3RplFv 15 | ErrEulaGetResultType__3RplFv 16 | ErrEulaGetSelectButtonNumError__3RplFv 17 | ErrEulaGetStateErrorViewer__3RplFv 18 | ErrEulaIsAppearHomeNixSign__3RplFv 19 | ErrEulaIsDecideSelectButtonError__3RplFv 20 | ErrEulaIsDecideSelectLeftButtonError__3RplFv 21 | ErrEulaIsDecideSelectRightButtonError__3RplFv 22 | ErrEulaIsSelectCursorActive__3RplFv 23 | ErrEulaJump__3RplFPCcUi 24 | ErrEulaPlayAppearSE__3RplFb 25 | ErrEulaSetControllerRemo__3RplFQ3_2nn7erreula14ControllerType 26 | ErrEulaSetVersion__3RplFi 27 | -------------------------------------------------------------------------------- /cafe/h264.def: -------------------------------------------------------------------------------- 1 | :NAME h264 2 | 3 | :TEXT 4 | H264DECBegin 5 | H264DECCheckDecunitLength 6 | H264DECCheckMemSegmentation 7 | H264DECCheckSkipableFrame 8 | H264DECClose 9 | H264DECEnd 10 | H264DECExecute 11 | H264DECFindDecstartpoint 12 | H264DECFindIdrpoint 13 | H264DECFlush 14 | H264DECGetImageSize 15 | H264DECInitParam 16 | H264DECMemoryRequirement 17 | H264DECOpen 18 | H264DECSetBitstream 19 | H264DECSetParam 20 | H264DECSetParam_FPTR_OUTPUT 21 | H264DECSetParam_OUTPUT_PER_FRAME 22 | H264DECSetParam_USER_MEMORY 23 | -------------------------------------------------------------------------------- /cafe/lzma920.def: -------------------------------------------------------------------------------- 1 | :NAME lzma920 2 | 3 | :TEXT 4 | Bt3Zip_MatchFinder_GetMatches 5 | Bt3Zip_MatchFinder_Skip 6 | GetMatchesSpec1 7 | Hc3Zip_MatchFinder_GetMatches 8 | Hc3Zip_MatchFinder_Skip 9 | Lzma2Dec_Allocate 10 | Lzma2Dec_AllocateProbs 11 | Lzma2Dec_DecodeToBuf 12 | Lzma2Dec_DecodeToDic 13 | Lzma2Dec_Init 14 | Lzma2Decode 15 | Lzma2EncProps_Init 16 | Lzma2EncProps_Normalize 17 | Lzma2Enc_Create 18 | Lzma2Enc_Destroy 19 | Lzma2Enc_Encode 20 | Lzma2Enc_SetProps 21 | Lzma2Enc_WriteProperties 22 | LzmaCompress 23 | LzmaDec_Allocate 24 | LzmaDec_AllocateProbs 25 | LzmaDec_DecodeToBuf 26 | LzmaDec_DecodeToDic 27 | LzmaDec_Free 28 | LzmaDec_FreeProbs 29 | LzmaDec_Init 30 | LzmaDecode 31 | LzmaEncProps_GetDictSize 32 | LzmaEncProps_Init 33 | LzmaEncProps_Normalize 34 | LzmaEnc_Create 35 | LzmaEnc_Destroy 36 | LzmaEnc_Encode 37 | LzmaEnc_MemEncode 38 | LzmaEnc_SetProps 39 | LzmaEnc_WriteProperties 40 | LzmaEncode 41 | LzmaProps_Decode 42 | LzmaUncompress 43 | MatchFinder_Construct 44 | MatchFinder_Create 45 | MatchFinder_CreateVTable 46 | MatchFinder_Free 47 | MatchFinder_GetPointerToCurrentPos 48 | MatchFinder_Init 49 | MatchFinder_MoveBlock 50 | MatchFinder_NeedMove 51 | MatchFinder_Normalize3 52 | MatchFinder_ReadIfRequired 53 | MatchFinder_ReduceOffsets 54 | -------------------------------------------------------------------------------- /cafe/mic.def: -------------------------------------------------------------------------------- 1 | :NAME mic 2 | 3 | :TEXT 4 | MICClose 5 | MICGetState 6 | MICGetStatus 7 | MICInit 8 | MICOpen 9 | MICSetDataConsumed 10 | MICSetState 11 | MICUninit 12 | -------------------------------------------------------------------------------- /cafe/nfc.def: -------------------------------------------------------------------------------- 1 | :NAME nfc 2 | 3 | :TEXT 4 | NFCAbort 5 | NFCAntennaCheck 6 | NFCDetect 7 | NFCFormat 8 | NFCGetMode 9 | NFCGetTagInfo 10 | NFCGetTagInfoMulti 11 | NFCGetUIDFromActivationEventData 12 | NFCInit 13 | NFCInitEx 14 | NFCIsInit 15 | NFCIsTagPresent 16 | NFCProc 17 | NFCRead 18 | NFCReadT2T 19 | NFCSendRawData 20 | NFCSendRawDataEx 21 | NFCSendRawDataEx2 22 | NFCSendRawDataTwice 23 | NFCSendRawDataWithPrePolling 24 | NFCSendRawDataWithPrePollingEx 25 | NFCSetLockBitsForT1T 26 | NFCSetMode 27 | NFCSetReadOnly 28 | NFCSetTagDetectCallback 29 | NFCShutdown 30 | NFCWrite 31 | NFCWriteT2T 32 | __NFCSystemAbort 33 | -------------------------------------------------------------------------------- /cafe/nio_prof.def: -------------------------------------------------------------------------------- 1 | :NAME nio_prof 2 | 3 | :TEXT 4 | IO_ProfilerGetStatsAndEndCheckpoint 5 | IO_ProfilerGetStatsAndRestartCheckpoint 6 | IO_ProfilerLibFinish 7 | IO_ProfilerLibInit 8 | IO_ProfilerStartCheckpoint 9 | -------------------------------------------------------------------------------- /cafe/nlibnss.def: -------------------------------------------------------------------------------- 1 | :NAME nlibnss 2 | 3 | :TEXT 4 | NSSCreateSignatureContext 5 | NSSDestroySignatureContext 6 | NSSExportDeviceCertChain 7 | NSSFinish 8 | NSSGetRandom 9 | NSSInit 10 | NSSLibReady 11 | NSSSecureStoreDeleteAllObjects 12 | NSSSecureStoreDeleteObject 13 | NSSSecureStoreDeleteTitleObjStore 14 | NSSSecureStoreExportObject 15 | NSSSecureStoreImportObject 16 | NSSSignatureGetSignatureLength 17 | NSSSignatureSetPrivateKey 18 | NSSSignatureSetPrivateKeyExternal 19 | NSSSignatureSignDigest 20 | -------------------------------------------------------------------------------- /cafe/nlibnss2.def: -------------------------------------------------------------------------------- 1 | :NAME nlibnss2 2 | 3 | :TEXT 4 | NSSCreateHMACContext 5 | NSSCreateSymkeyCryptoContext 6 | NSSDestroyHMACContext 7 | NSSDestroySymkeyCryptoContext 8 | NSSHMACFinish 9 | NSSHMACUpdate 10 | NSSSymkeyCryptoDecryptFinish 11 | NSSSymkeyCryptoDecryptInitInternalKey 12 | NSSSymkeyCryptoDecryptUpdate 13 | NSSSymkeyCryptoEncryptFinish 14 | NSSSymkeyCryptoEncryptInitInternalKey 15 | NSSSymkeyCryptoEncryptUpdate 16 | NSSSymkeyCryptoGetCipherBlockSize 17 | -------------------------------------------------------------------------------- /cafe/nn_aoc.def: -------------------------------------------------------------------------------- 1 | :NAME nn_aoc 2 | 3 | :TEXT 4 | AOC_CalculateWorkBufferSize 5 | AOC_CloseTitle 6 | AOC_DebugRealDeviceAccess 7 | AOC_DeleteContent 8 | AOC_Finalize 9 | AOC_GetErrorCode 10 | AOC_GetOccupiedSize 11 | AOC_GetPurchaseInfo 12 | AOC_Initialize 13 | AOC_ListTitle 14 | AOC_LockTitle 15 | AOC_OpenTitle 16 | AOC_UnlockTitle 17 | AOC_UtilGetValidAocTitles 18 | -------------------------------------------------------------------------------- /cafe/nn_cmpt.def: -------------------------------------------------------------------------------- 1 | :NAME nn_cmpt 2 | 3 | :TEXT 4 | CMPTAcctClearInternalState 5 | CMPTAcctGetDrcCtrlEnabled 6 | CMPTAcctGetEula 7 | CMPTAcctGetPcConf 8 | CMPTAcctGetProfile 9 | CMPTAcctGetScreenType 10 | CMPTAcctSetDrcCtrlEnabled 11 | CMPTAcctSetEula 12 | CMPTAcctSetEulaBySlotNo 13 | CMPTAcctSetPcConf 14 | CMPTAcctSetProfile 15 | CMPTAcctSetScreenType 16 | CMPTCheckScreenState 17 | CMPTExLaunch 18 | CMPTExPrepareLaunch 19 | CMPTExPrepareLaunchTest 20 | CMPTExSetWorkBuffer 21 | CMPTGetDataSize 22 | CMPTGetSystemVersion 23 | CMPTInitSystem 24 | CMPTIsClean 25 | CMPTIsPlayableDisc 26 | CMPTLaunchDataManager 27 | CMPTLaunchMenu 28 | CMPTLaunchTest 29 | CMPTLaunchTitle 30 | CMPTSetDirty 31 | -------------------------------------------------------------------------------- /cafe/nn_hai.def: -------------------------------------------------------------------------------- 1 | :NAME nn_hai 2 | 3 | :TEXT 4 | DBGGetAutoStop__Q3_2nn3hai5errorFv 5 | DBGSetAutoStop__Q3_2nn3hai5errorFi 6 | GetLaunchBufferSize__Q3_2nn3hai6launchFPUi 7 | Init__Q3_2nn3hai5errorFv 8 | Launch__Q3_2nn3hai6launchFv 9 | PrepareLaunch__Q3_2nn3hai6launchFPvUi 10 | SetFatalError__Q3_2nn3hai5errorFPQ4_2nn3hai5error5ErroriT2PCcT2 11 | SetFsError__Q3_2nn3hai5errorFPQ4_2nn3hai5error5ErrorP8FSClientP10FSCmdBlock 12 | SetHalt__Q3_2nn3hai5errorFPQ4_2nn3hai5error5ErrorPCcT2i 13 | SetMcpError__Q3_2nn3hai5errorFPQ4_2nn3hai5error5Errori 14 | StopIfRequired__Q3_2nn3hai5errorFPCQ4_2nn3hai5error5Error 15 | -------------------------------------------------------------------------------- /cafe/nn_hpad.def: -------------------------------------------------------------------------------- 1 | :NAME nn_hpad 2 | 3 | :TEXT 4 | BETA_DEBUG_DUMP 5 | BETA_DEBUG_GET_QUEUE_SIZE 6 | BETA_DEBUG_GET_RAW_DATA 7 | BETA_DEBUG_SEND_REPT_ID 8 | BETA_DEBUG_SET_DUMP_MODE 9 | HPADControlMotor 10 | HPADGetGGGGStatus 11 | HPADInit 12 | HPADRecalibrate 13 | HPADResetDevice 14 | HPADSetConnectCallback 15 | HPADSetGgggConnectCallback 16 | HPADSetPowerSupplyCallback 17 | HPADSetSamplingCallback 18 | HPADShutdown 19 | 20 | :TEXT_WRAP 21 | HPADRead 22 | -------------------------------------------------------------------------------- /cafe/nn_idbe.def: -------------------------------------------------------------------------------- 1 | :NAME nn_idbe 2 | 3 | :TEXT 4 | Cancel__Q2_2nn4idbeFv 5 | CheckDownloadResult__Q2_2nn4idbeFPQ3_2nn4idbe15DownloadContext 6 | CreateIconDownloadContext__Q2_2nn4idbeFPQ3_2nn4idbe15DownloadContextPvULUsb 7 | CreateLatestIconDownloadContext__Q2_2nn4idbeFPQ3_2nn4idbe15DownloadContextPvULb 8 | DecryptIconFile__Q2_2nn4idbeFPvPCv 9 | DecryptIconFile__Q2_2nn4idbeFPvPCvUL 10 | DestroyDownloadContext__Q2_2nn4idbeFPQ3_2nn4idbe15DownloadContext 11 | DownloadIconFile__Q2_2nn4idbeFPvULUsb 12 | DownloadLatestIconFile__Q2_2nn4idbeFPvULb 13 | Finalize__Q2_2nn4idbeFv 14 | Initialize__Q2_2nn4idbeFv 15 | SupportCtrTitle__Q2_2nn4idbeFv 16 | -------------------------------------------------------------------------------- /cafe/nn_ndm.def: -------------------------------------------------------------------------------- 1 | :NAME nn_ndm 2 | 3 | :TEXT 4 | DisableResumeDaemons__Q2_2nn3ndmFv 5 | EnableConcurrentConnection__Q2_2nn3ndmFv 6 | EnableHomeButtonMenuAndBgProcess__Q2_2nn3ndmFi 7 | EnableResumeDaemons__Q2_2nn3ndmFv 8 | Finalize__Q2_2nn3ndmFv 9 | GetCurrentState__Q2_2nn3ndmFPQ4_2nn3ndm5CAFE_5State 10 | GetDaemonDisableCountByProcess__Q2_2nn3ndmFPiQ4_2nn3ndm4Cafe10DaemonName 11 | GetDaemonDisableCount__Q2_2nn3ndmFPiQ4_2nn3ndm4Cafe10DaemonName 12 | GetDaemonStatus__Q2_2nn3ndmFPQ4_2nn3ndm7IDaemon6StatusQ4_2nn3ndm4Cafe10DaemonName 13 | GetSchedulerDisableCount__Q2_2nn3ndmFPi 14 | GetTargetState__Q2_2nn3ndmFPQ4_2nn3ndm5CAFE_5State 15 | Initialize__Q2_2nn3ndmFv 16 | IsInitialized__Q2_2nn3ndmFv 17 | NDMDisableResumeDaemons 18 | NDMEnableHomeButtonMenuAndBgProcess 19 | NDMEnableResumeDaemons 20 | NDMFinalize 21 | NDMInitialize 22 | NDMIsResultSuccess 23 | ResumeDaemonsAndConnect__Q2_2nn3ndmFv 24 | ResumeDaemons__Q2_2nn3ndmFUi 25 | SuspendDaemonsAndDisconnectIfWireless__Q2_2nn3ndmFv 26 | SuspendDaemonsAndDisconnect__Q2_2nn3ndmFv 27 | SuspendDaemons__Q2_2nn3ndmFUi 28 | -------------------------------------------------------------------------------- /cafe/nn_nets2.def: -------------------------------------------------------------------------------- 1 | :NAME nn_nets2 2 | 3 | :TEXT 4 | NSSLAddCRLExternal 5 | NSSLContextClearFlags 6 | NSSLContextGetFlags 7 | NSSLContextSetFlags 8 | NSSLContextSetMode 9 | icmp_cancel 10 | icmp_close_handle 11 | icmp_create_handle 12 | icmp_last_code_type 13 | icmp_ping 14 | 15 | :TEXT_WRAP 16 | somemopt 17 | -------------------------------------------------------------------------------- /cafe/nn_spm.def: -------------------------------------------------------------------------------- 1 | :NAME nn_spm 2 | 3 | :TEXT 4 | CancelWaitStateUpdated__Q2_2nn3spmFv 5 | ClearExtendedStorage__Q2_2nn3spmFv 6 | Compare__Q3_2nn3spm8VolumeIdCFRCQ3_2nn3spm8VolumeId 7 | FilterBriefTitleList__Q2_2nn3spmFP22MCP_TitleListBriefTypeUi 8 | FilterTitleList__Q2_2nn3spmFP17MCP_TitleListTypeUi 9 | Finalize__Q2_2nn3spmFv 10 | FindStorageByVolumeId__Q2_2nn3spmFPQ3_2nn3spm12StorageIndexRCQ3_2nn3spm8VolumeId 11 | GetDefaultExtendedStorageVolumeId__Q2_2nn3spmFv 12 | GetExtendedStorageIndex__Q2_2nn3spmFPQ3_2nn3spm12StorageIndex 13 | GetPreviousExtendedStorageVolumeId__Q2_2nn3spmFPbPQ3_2nn3spm8VolumeId 14 | GetStorageInfo__Q2_2nn3spmFPQ3_2nn3spm11StorageInfoQ3_2nn3spm12StorageIndex 15 | GetStorageList__Q2_2nn3spmFPQ3_2nn3spm15StorageListItemUi 16 | GetUsbDetectionMaxTimeMilliSeconds__Q2_2nn3spmFv 17 | GetUsbDetectionRestTimeMilliSeconds__Q2_2nn3spmFv 18 | Initialize__Q2_2nn3spmFv 19 | IsDefaultTimedOut__Q2_2nn3spmFv 20 | IsStorageMaybePcFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex 21 | IsStorageMaybeWfsFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex 22 | NeedsManualExtendedStorageResolutionImpl__Q2_2nn3spmFPb 23 | NeedsManualExtendedStorageResolution__Q2_2nn3spmFv 24 | ReadRawStorageHead512__Q2_2nn3spmFQ3_2nn3spm12StorageIndexPc 25 | SetAutoFatal__Q2_2nn3spmFb 26 | SetDefaultExtendedStorageVolumeId__Q2_2nn3spmFRCQ3_2nn3spm8VolumeId 27 | SetExtendedStorage__Q2_2nn3spmFQ3_2nn3spm12StorageIndex 28 | SetResolveManuallyOnWarmBoot__Q2_2nn3spmFb 29 | StopFatalDetection__Q2_2nn3spmFv 30 | WaitStateUpdated__Q2_2nn3spmFPUL 31 | __CPR86__FormatExternalStorage__Q2_2nn3spmFPQ3_2nn3spm12StorageIndexiQ3_2nn3spmJ45JPi 32 | __ct__Q3_2nn3spm8VolumeIdFPCc 33 | -------------------------------------------------------------------------------- /cafe/nn_temp.def: -------------------------------------------------------------------------------- 1 | :NAME nn_temp 2 | 3 | :TEXT 4 | TEMPChangeDir 5 | TEMPChangeDirAsync 6 | TEMPChangeOthersMode 7 | TEMPChangeOthersModeAsync 8 | TEMPCreateAndInitTempDir 9 | TEMPGetDirGlobalPath 10 | TEMPGetDirPath 11 | TEMPGetFreeSpaceSize 12 | TEMPGetFreeSpaceSizeAsync 13 | TEMPGetStat 14 | TEMPGetStatAsync 15 | TEMPInit 16 | TEMPMakeDir 17 | TEMPMakeDirAsync 18 | TEMPMountTempDir 19 | TEMPOpenDir 20 | TEMPOpenDirAsync 21 | TEMPOpenFile 22 | TEMPOpenFileAsync 23 | TEMPOpenNewFile 24 | TEMPOpenNewFileAsync 25 | TEMPRemove 26 | TEMPRemoveAsync 27 | TEMPRename 28 | TEMPRenameAsync 29 | TEMPShutdown 30 | TEMPShutdownTempDir 31 | TEMPUnmountTempDir 32 | -------------------------------------------------------------------------------- /cafe/nn_vctl.def: -------------------------------------------------------------------------------- 1 | :NAME nn_vctl 2 | 3 | :TEXT 4 | Finalize__Q2_2nn4vctlFv 5 | GetInstallContentIds__Q2_2nn4vctlFPUiT1UiPCcULQ3_2nn4Cafe9MediaType 6 | GetInstallContentIndices__Q2_2nn4vctlFPUiPUsUiPCcULQ3_2nn4Cafe9MediaType 7 | GetInstallRequiredSize__Q2_2nn4vctlFPULPCcULQ3_2nn4Cafe9MediaType 8 | GetTentativeUpdateInfo__Q2_2nn4vctlFPQ3_2nn4vctl10UpdateInfoULQ3_2nn4Cafe9MediaType 9 | GetTitleVersionInfo__Q2_2nn4vctlFPQ3_2nn4vctl16TitleVersionInfoULQ3_2nn4Cafe9MediaType 10 | GetUpdateInfo__Q2_2nn4vctlFPQ3_2nn4vctl10UpdateInfoULQ3_2nn4Cafe9MediaType 11 | GetUpdateInfo__Q2_2nn4vctlFPQ3_2nn4vctl10UpdateInfoULQ3_2nn4Cafe9MediaTypeQ3_2nn4vctl16UpdateInfoOption 12 | Initialize__Q2_2nn4vctlFv 13 | -------------------------------------------------------------------------------- /cafe/nsyshid.def: -------------------------------------------------------------------------------- 1 | :NAME nsyshid 2 | 3 | :TEXT 4 | HIDAddClient 5 | HIDAddPassiveClient 6 | HIDDecodeError 7 | HIDDelClient 8 | HIDDelPassiveClient 9 | HIDGetDescriptor 10 | HIDGetHierarchy 11 | HIDGetIdle 12 | HIDGetProtocol 13 | HIDGetReport 14 | HIDRead 15 | HIDResetDevice 16 | HIDSetDescriptor 17 | HIDSetIdle 18 | HIDSetProtocol 19 | HIDSetReport 20 | HIDSetup 21 | HIDTeardown 22 | HIDWrite 23 | -------------------------------------------------------------------------------- /cafe/nsyskbd.def: -------------------------------------------------------------------------------- 1 | :NAME nsyskbd 2 | 3 | :TEXT 4 | KBDEmptyQueue 5 | KBDExit 6 | KBDGetAccessSticky 7 | KBDGetChannelStatus 8 | KBDGetCountry 9 | KBDGetKey 10 | KBDGetLockProcessing 11 | KBDGetModState 12 | KBDGetRepeat 13 | KBDInit 14 | KBDInitRegionEU 15 | KBDInitRegionJP 16 | KBDInitRegionUS 17 | KBDResetChannel 18 | KBDSetAccessSticky 19 | KBDSetCountry 20 | KBDSetLeds 21 | KBDSetLedsAsync 22 | KBDSetLedsAsyncEx 23 | KBDSetLedsEx 24 | KBDSetLedsRetry 25 | KBDSetLedsRetryEx 26 | KBDSetLockProcessing 27 | KBDSetModState 28 | KBDSetRepeat 29 | KBDSetup 30 | KBDTeardown 31 | KBDTranslateHidCode 32 | KPRClearQueue 33 | KPRGetChar 34 | KPRGetMode 35 | KPRInitQueue 36 | KPRInitRegionEU 37 | KPRInitRegionJP 38 | KPRInitRegionUS 39 | KPRLookAhead 40 | KPRPutChar 41 | KPRRemoveChar 42 | KPRSetMode 43 | SKBDEmptyQueue 44 | SKBDGetAccessSticky 45 | SKBDGetChannelStatus 46 | SKBDGetCountry 47 | SKBDGetKey 48 | SKBDGetLockProcessing 49 | SKBDGetModState 50 | SKBDGetRepeat 51 | SKBDKeyEvent 52 | SKBDResetChannel 53 | SKBDSetAccessSticky 54 | SKBDSetCountry 55 | SKBDSetLockProcessing 56 | SKBDSetModState 57 | SKBDSetMode 58 | SKBDSetRepeat 59 | SKBDSetup 60 | SKBDTeardown 61 | -------------------------------------------------------------------------------- /cafe/nsysuhs.def: -------------------------------------------------------------------------------- 1 | :NAME nsysuhs 2 | 3 | :TEXT 4 | UhsAcquireInterface 5 | UhsAdministerDevice 6 | UhsAdministerEndpoint 7 | UhsAdministerEndpointOpt 8 | UhsClassDrvReg 9 | UhsClassDrvUnReg 10 | UhsClearEndpointHalt 11 | UhsClientClose 12 | UhsClientOpen 13 | UhsGetAlternateInterface 14 | UhsGetCurrentFrame 15 | UhsGetDescriptorString 16 | UhsGetFullConfigDescriptor 17 | UhsGetInterface 18 | UhsQueryInterfaces 19 | UhsReleaseInterface 20 | UhsSetInterface 21 | UhsSubmitBulkRequest 22 | UhsSubmitBulkRequestAsync 23 | UhsSubmitControlRequest 24 | UhsSubmitControlRequestAsync 25 | UhsSubmitInterruptRequest 26 | UhsSubmitInterruptRequestAsync 27 | UhsSubmitIsocRequest 28 | UhsSubmitIsocRequestAsync 29 | -------------------------------------------------------------------------------- /cafe/nsysuvd.def: -------------------------------------------------------------------------------- 1 | :NAME nsysuvd 2 | 3 | :TEXT 4 | UVD_Func1 5 | UVD_Func2 6 | UVD_RootRun 7 | -------------------------------------------------------------------------------- /cafe/ntag.def: -------------------------------------------------------------------------------- 1 | :NAME ntag 2 | 3 | :TEXT 4 | NTAGAbort 5 | NTAGConvertMasterDataToWriteData 6 | NTAGConvertMasterDataToWriteDataForT2T 7 | NTAGConvertT2T 8 | NTAGCreateAllWriteData 9 | NTAGCreateAllWriteDataForT2T 10 | NTAGFormat 11 | NTAGInit 12 | NTAGInitEx 13 | NTAGIsInit 14 | NTAGParseHeader 15 | NTAGProc 16 | NTAGRead 17 | NTAGReadT2T 18 | NTAGReadT2TRawData 19 | NTAGSetFormatSettings 20 | NTAGSetReadOnly 21 | NTAGSetTagDetectCallback 22 | NTAGShutdown 23 | NTAGWrite 24 | NTAGWriteT2T 25 | NTAGWriteT2TConfigArea 26 | NTAGWriteT2TLockArea 27 | NTAGWriteT2TRawData 28 | NTAGWriteT2TRawDataEx 29 | NTAGWriteT2TWithConvert 30 | 31 | :TEXT_WRAP 32 | NTAGDetect 33 | -------------------------------------------------------------------------------- /cafe/proc_ui.def: -------------------------------------------------------------------------------- 1 | :NAME proc_ui 2 | 3 | :TEXT 4 | ProcUICalcMemorySize 5 | ProcUIClearCallbacks 6 | ProcUIDrawDoneRelease 7 | ProcUIInForeground 8 | ProcUIInShutdown 9 | ProcUIInit 10 | ProcUIInitEx 11 | ProcUIIsRunning 12 | ProcUIProcessMessages 13 | ProcUIRegisterBackgroundCallback 14 | ProcUIRegisterCallback 15 | ProcUIRegisterCallbackCore 16 | ProcUISetBucketStorage 17 | ProcUISetCallbackStackSize 18 | ProcUISetMEM1Storage 19 | ProcUISetMemoryPool 20 | ProcUISetSaveCallback 21 | ProcUIShutdown 22 | ProcUISubProcessMessages 23 | -------------------------------------------------------------------------------- /cafe/swkbd.def: -------------------------------------------------------------------------------- 1 | :NAME swkbd 2 | 3 | :TEXT 4 | SwkbdAppearInputForm__3RplFRCQ3_2nn5swkbd9AppearArg 5 | SwkbdAppearKeyboard__3RplFRCQ3_2nn5swkbd11KeyboardArg 6 | SwkbdCalcSubThreadFont__3RplFv 7 | SwkbdCalcSubThreadPredict__3RplFv 8 | SwkbdCalc__3RplFRCQ3_2nn5swkbd14ControllerInfo 9 | SwkbdConfirmUnfixAll__3RplFv 10 | SwkbdCreate__3RplFPUcQ3_2nn5swkbd10RegionTypeUiP8FSClient 11 | SwkbdDestroy__3RplFv 12 | SwkbdDisappearInputForm__3RplFv 13 | SwkbdDisappearKeyboard__3RplFv 14 | SwkbdDrawDRC__3RplFv 15 | SwkbdDrawTV__3RplFv 16 | SwkbdGetDrawStringInfo__3RplFPQ3_2nn5swkbd14DrawStringInfo 17 | SwkbdGetInputFormString__3RplFv 18 | SwkbdGetKeyboardCondition__3RplFPQ3_2nn5swkbd17KeyboardCondition 19 | SwkbdGetStateInputForm__3RplFv 20 | SwkbdGetStateKeyboard__3RplFv 21 | SwkbdInactivateSelectCursor__3RplFv 22 | SwkbdInitLearnDic__3RplFPv 23 | SwkbdIsCoveredWithSubWindow__3RplFv 24 | SwkbdIsDecideCancelButton__3RplFPb 25 | SwkbdIsDecideOkButton__3RplFPb 26 | SwkbdIsKeyboardTarget__3RplFPQ3_2nn5swkbd14IEventReceiver 27 | SwkbdIsNeedCalcSubThreadFont__3RplFv 28 | SwkbdIsNeedCalcSubThreadPredict__3RplFv 29 | SwkbdIsSelectCursorActive__3RplFv 30 | SwkbdMuteAllSound__3RplFb 31 | SwkbdSetControllerRemo__3RplFQ3_2nn5swkbd14ControllerType 32 | SwkbdSetCursorPos__3RplFi 33 | SwkbdSetEnableOkButton__3RplFb 34 | SwkbdSetInputFormString__3RplFPCw 35 | SwkbdSetReceiver__3RplFRCQ3_2nn5swkbd11ReceiverArg 36 | SwkbdSetSelectFrom__3RplFi 37 | SwkbdSetUserControllerEventObj__3RplFPQ3_2nn5swkbd19IControllerEventObj 38 | SwkbdSetUserSoundObj__3RplFPQ3_2nn5swkbd9ISoundObj 39 | SwkbdSetVersion__3RplFi 40 | -------------------------------------------------------------------------------- /cafe/tcl.def: -------------------------------------------------------------------------------- 1 | :NAME tcl 2 | 3 | :TEXT 4 | AddrCombineBankPipeSwizzle 5 | AddrComputeCmaskAddrFromCoord 6 | AddrComputeCmaskCoordFromAddr 7 | AddrComputeCmaskInfo 8 | AddrComputeFmaskAddrFromCoord 9 | AddrComputeFmaskCoordFromAddr 10 | AddrComputeFmaskInfo 11 | AddrComputeHtileAddrFromCoord 12 | AddrComputeHtileCoordFromAddr 13 | AddrComputeHtileInfo 14 | AddrComputeSliceSwizzle 15 | AddrComputeSurfaceAddrFromCoord 16 | AddrComputeSurfaceCoordFromAddr 17 | AddrComputeSurfaceInfo 18 | AddrConvertTileIndex 19 | AddrConvertTileInfoToHW 20 | AddrCreate 21 | AddrDestroy 22 | AddrExtractBankPipeSwizzle 23 | AddrGetTileIndex 24 | AddrGetVersion 25 | AddrUseTileIndex 26 | ElemFlt32ToColorPixel 27 | ElemFlt32ToDepthPixel 28 | ElemGetExportNorm 29 | TCLAllocTilingAperture 30 | TCLCloseDebugFile 31 | TCLDebug 32 | TCLFreeTilingAperture 33 | TCLGetIHThreadPriority 34 | TCLGetInfo 35 | TCLGetInterruptCount 36 | TCLIHEnableInterrupt 37 | TCLIHRegister 38 | TCLIHUnregister 39 | TCLOpenDebugFile 40 | TCLReadRegister 41 | TCLReadTimestamp 42 | TCLReset 43 | TCLSetHangWait 44 | TCLSetIHThreadPriority 45 | TCLSetTimeout 46 | TCLSubmit 47 | TCLSubmitToRing 48 | TCLWaitForIdle 49 | TCLWaitTimestamp 50 | TCLWriteRegister 51 | -------------------------------------------------------------------------------- /cafe/tve.def: -------------------------------------------------------------------------------- 1 | :NAME tve 2 | 3 | :TEXT 4 | I2CInit 5 | I2CMEnable 6 | I2CWriteDRCData 7 | I2CWriteDRCInfo 8 | TVECECInit 9 | TVECECReceiveCommand 10 | TVECECSendCommand 11 | TVECreateSysConfig 12 | TVEDisableStereoMode 13 | TVEDisableVideoOut 14 | TVEEnableVideoOut 15 | TVEExit 16 | TVEGet3DFormatEDID 17 | TVEGet3DInfo 18 | TVEGetAnalogAudioDACEnable 19 | TVEGetAnalogDTVStatus 20 | TVEGetAnalogStat 21 | TVEGetAudioConfig 22 | TVEGetAudioMute 23 | TVEGetCGMS 24 | TVEGetConfigVersion 25 | TVEGetContentType 26 | TVEGetCurrentConfig 27 | TVEGetCurrentPort 28 | TVEGetEDIDBaseCheckSum 29 | TVEGetEDIDInfo 30 | TVEGetEDIDRaw 31 | TVEGetHDCP 32 | TVEGetHDMIErrorStat 33 | TVEGetHotPlugState 34 | TVEGetMaxAudioChannel 35 | TVEGetSinkHDCPInfo 36 | TVEGetWSS 37 | TVEInit 38 | TVEIsCECEnable 39 | TVEIsForceRGBEnable 40 | TVEReset4in1 41 | TVESet3DInfo 42 | TVESetAll 43 | TVESetAllAsync 44 | TVESetAllEx 45 | TVESetAllExAsync 46 | TVESetAnalogAudioDACEnable 47 | TVESetAnalogAudioDACFlag 48 | TVESetAudioConfig 49 | TVESetAudioMute 50 | TVESetCECEnable 51 | TVESetCGMS 52 | TVESetContentType 53 | TVESetForceRGBMode 54 | TVESetForceShutDown 55 | TVESetHDCP 56 | TVESetHDMIHotplug5V 57 | TVESetRCA 58 | TVESetVideoMute 59 | TVESetWSS 60 | TVESetWiiCompat 61 | TVESetWiiCompatEx 62 | TVEShutDown 63 | TVEVsyncSignal 64 | TVEWait4in1Done 65 | TVEWait4in1DoneWithTimeout 66 | __TVESetContentTypeParam 67 | __TVESetRCAFlag 68 | -------------------------------------------------------------------------------- /cafe/uac.def: -------------------------------------------------------------------------------- 1 | :NAME uac 2 | 3 | :TEXT 4 | UACClose 5 | UACFreeISODesc 6 | UACGetAudio 7 | UACInit 8 | UACOpen 9 | UACRequest 10 | -------------------------------------------------------------------------------- /cafe/uac_rpl.def: -------------------------------------------------------------------------------- 1 | :NAME uac_rpl 2 | 3 | :TEXT 4 | UACClose 5 | UACGetState 6 | UACINGetStatus 7 | UACINSetDataConsumed 8 | UACINStart 9 | UACINStartExt 10 | UACINStop 11 | UACInit 12 | UACOUTGetStatus 13 | UACOUTSetDataConsumed 14 | UACOUTStart 15 | UACOUTStartExt 16 | UACOUTStop 17 | UACOpen 18 | UACOpenQuery 19 | UACSetState 20 | UACUninit 21 | -------------------------------------------------------------------------------- /cafe/usb_mic.def: -------------------------------------------------------------------------------- 1 | :NAME usb_mic 2 | 3 | :TEXT 4 | USBMICClose 5 | USBMICGetState 6 | USBMICGetStatus 7 | USBMICInit 8 | USBMICOpen 9 | USBMICOpenQuery 10 | USBMICSetDataConsumed 11 | USBMICSetState 12 | USBMICStart 13 | USBMICStartExt 14 | USBMICStop 15 | USBMICUninit 16 | -------------------------------------------------------------------------------- /cafe/uvc.def: -------------------------------------------------------------------------------- 1 | :NAME uvc 2 | 3 | :TEXT 4 | UVCClose 5 | UVCGetFrame 6 | UVCInit 7 | UVCOpen 8 | UVCRequest 9 | -------------------------------------------------------------------------------- /cafe/uvd.def: -------------------------------------------------------------------------------- 1 | :NAME uvd 2 | 3 | :TEXT 4 | UVDCheckSegmentViolation 5 | UVDCreateContext 6 | UVDCreateDecodeSession 7 | UVDDecodePicture 8 | UVDDeinitHW 9 | UVDDestroyContext 10 | UVDDestroyDecodeSession 11 | UVDEndDecodePicture 12 | UVDGetDPBSize 13 | UVDInitHW 14 | UVDStartDecodePicture 15 | -------------------------------------------------------------------------------- /cafe/vpadbase.def: -------------------------------------------------------------------------------- 1 | :NAME vpadbase 2 | 3 | :TEXT 4 | VPADBASEClearIRCEvent 5 | VPADBASEClearNFCEvent 6 | VPADBASEClearNFCMode 7 | VPADBASEClearSyncWaitCount 8 | VPADBASEGetCalibrationData 9 | VPADBASEGetEEPROMData 10 | VPADBASEGetFactorySetting 11 | VPADBASEGetGameControllerMode 12 | VPADBASEGetHeadphoneStatus 13 | VPADBASEGetIRCStatus 14 | VPADBASEGetLCDStatus 15 | VPADBASEGetMessageLEDStatus 16 | VPADBASEGetMicStatus 17 | VPADBASEGetMotorOnRemainingCount 18 | VPADBASEGetNFCStatus 19 | VPADBASEGetPowerButtonPressStatus 20 | VPADBASEGetSensorBarSetting 21 | VPADBASEGetSensorBarStatus 22 | VPADBASEGetState 23 | VPADBASEGetStickOffset 24 | VPADBASEGetTVMenuStatus 25 | VPADBASEGetTrollInvalidSetting 26 | VPADBASEGetTrollInvalidStatus 27 | VPADBASEGetVideoStreamingStatus 28 | VPADBASEGetVolumeOverrideSetting 29 | VPADBASEGetVolumeOverrideStatus 30 | VPADBASEInit 31 | VPADBASEInitVolumeOverrideSettingSyncTime 32 | VPADBASEIsInit 33 | VPADBASERead 34 | VPADBASESetAutoSamplingBuf 35 | VPADBASESetCalibrationData 36 | VPADBASESetGameControllerMode 37 | VPADBASESetMotorOnRemainingCount 38 | VPADBASESetPowerButtonDisableMode 39 | VPADBASESetPowerButtonPressStatus 40 | VPADBASESetSamplingCallback 41 | VPADBASESetSensorBarSetting 42 | VPADBASESetStickOffset 43 | VPADBASESetStickOrigin 44 | VPADBASESetTrollInvalidSetting 45 | VPADBASESetVolumeOverrideSetting 46 | VPADBASEShutdown 47 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.9) 2 | find_package(Doxygen) 3 | 4 | if(DOXYGEN_FOUND) 5 | set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/../docs/Doxyfile.in) 6 | set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) 7 | 8 | set(DOXYGEN_PROJECT_NAME "wut") 9 | set(DOXYGEN_PROJECT_NUMBER $ENV{WUT_VERSION}) 10 | set(DOXYGEN_PROJECT_BRIEF "Wii U Toolchain") 11 | 12 | set(DOXYGEN_GENERATE_HTML YES) 13 | set(DOXYGEN_GENERATE_LATEX NO) 14 | 15 | set(DOXYGEN_TAB_SIZE 3) 16 | set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES) 17 | set(DOXYGEN_INLINE_SIMPLE_STRUCTS YES) 18 | set(DOXYGEN_EXTRACT_ALL YES) 19 | set(DOXYGEN_EXTRACT_STATIC YES) 20 | set(DOXYGEN_HIDE_SCOPE_NAMES YES) 21 | set(DOXYGEN_SORT_MEMBER_DOCS NO) 22 | set(DOXYGEN_RECURSIVE YES) 23 | set(DOXYGEN_EXCLUDE_PATTERNS 24 | "wut_structsize.h") 25 | set(DOXYGEN_SOURCE_BROWSER YES) 26 | set(DOXYGEN_JAVADOC_AUTOBRIEF YES) 27 | set(DOXYGEN_ENUM_VALUES_PER_LINE 1) 28 | set(DOXYGEN_CLASS_DIAGRAMS NO) 29 | set(DOXYGEN_COLLABORATION_GRAPH NO) 30 | set(DOXYGEN_ENABLE_PREPROCESSING YES) 31 | set(DOXYGEN_MACRO_EXPANSION YES) 32 | set(DOXYGEN_EXPAND_ONLY_PREDEF YES) 33 | set(DOXYGEN_PREDEFINED 34 | "__cplusplus;" 35 | "WUT_PACKED=;" 36 | "WUT_ALIGNAS(x)=;" 37 | "WUT_CHECK_OFFSET(Type,Offset,Field)=;" 38 | "WUT_CHECK_SIZE(Type,Size)=;" 39 | "WUT_PADDING_BYTES(Size)=;" 40 | "WUT_UNKNOWN_BYTES(Size)=;" 41 | "WUT_UNKNOWN_SIZE(x)=;") 42 | 43 | doxygen_add_docs(docs 44 | "${CMAKE_CURRENT_SOURCE_DIR}/../include" 45 | "${CMAKE_CURRENT_SOURCE_DIR}/../docs") 46 | endif() 47 | -------------------------------------------------------------------------------- /docs/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage Wii U Toolchain 3 | * 4 | * \section Introduction 5 | * An experimental in-development Wii U toolchain, the source can be found at 6 | * https://github.com/devkitPro/wut 7 | * 8 | * \section Usage 9 | * TODO. 10 | */ 11 | -------------------------------------------------------------------------------- /include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | uint32_t 10 | htonl(uint32_t hostlong); 11 | 12 | uint16_t 13 | htons(uint16_t hostshort); 14 | 15 | uint32_t 16 | ntohl(uint32_t netlong); 17 | 18 | uint16_t 19 | ntohs(uint16_t netshort); 20 | 21 | in_addr_t 22 | inet_addr(const char *cp); 23 | 24 | int 25 | inet_aton(const char *cp, 26 | struct in_addr *inp); 27 | 28 | char * 29 | inet_ntoa(struct in_addr in); 30 | 31 | char * 32 | inet_ntoa_r(struct in_addr in, 33 | char *buf); 34 | 35 | const char * 36 | inet_ntop(int af, 37 | const void *src, 38 | char *dst, 39 | socklen_t size); 40 | 41 | int 42 | inet_pton(int af, 43 | const char *src, 44 | void *dst); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /include/avm/avm.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup avm avm 3 | * 4 | * Audio/Video Manager 5 | */ 6 | -------------------------------------------------------------------------------- /include/avm/drc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup avm_drc DRC 6 | * \ingroup avm 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef enum AVMDrcScanMode 15 | { 16 | AVM_DRC_SCAN_MODE_UNKNOWN_0 = 0, 17 | AVM_DRC_SCAN_MODE_UNKNOWN_1 = 1, 18 | AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3, 19 | AVM_DRC_SCAN_MODE_UNKNOWN_255 = 255, 20 | } AVMDrcScanMode; 21 | 22 | typedef enum AVMDrcMode 23 | { 24 | AVM_DRC_MODE_NONE = 0, 25 | AVM_DRC_MODE_SINGLE = 1, 26 | AVM_DRC_MODE_DOUBLE = 2, 27 | } AVMDrcMode; 28 | 29 | typedef enum AVMDrcSystemAudioMode 30 | { 31 | AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_0 = 0, // mono? 32 | AVM_DRC_SYSTEM_AUDIO_MODE_UNKNOWN_1 = 1, // stereo? 33 | AVM_DRC_SYSTEM_AUDIO_MODE_SURROUND = 2, 34 | } AVMDrcSystemAudioMode; 35 | 36 | /** 37 | * Uses AVMGetDRCSystemAudioMode internally 38 | * @param outAudioMode 39 | * @return 0 on success, -2 on error 40 | */ 41 | int 42 | AVMGetSystemDRCAudioMode(AVMDrcSystemAudioMode *outAudioMode); 43 | 44 | BOOL 45 | AVMGetDRCSystemAudioMode(AVMDrcSystemAudioMode *outAudioMode); 46 | 47 | uint32_t 48 | AVMGetDRCVertCount(); 49 | 50 | BOOL 51 | AVMIsDRCFirstFlippDone(); 52 | 53 | BOOL 54 | AVMGetDRCScanMode(AVMDrcScanMode *outScanMode); 55 | 56 | BOOL 57 | AVMGetDRCMode(AVMDrcMode *outMode); 58 | 59 | uint32_t 60 | AVMProbeDRCNum(void); 61 | 62 | BOOL 63 | AVMSetDRCEnable(BOOL enable); 64 | 65 | BOOL 66 | AVMSetDRCGamma(float *gamma); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | /** @} */ 73 | -------------------------------------------------------------------------------- /include/coreinit/atomic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_atomic Atomic Operations 6 | * \ingroup coreinit 7 | * 8 | * These functions are used for atomically operating on 32 bit values in memory. 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | BOOL 17 | OSCompareAndSwapAtomic(volatile uint32_t *ptr, 18 | uint32_t compare, 19 | uint32_t value); 20 | 21 | BOOL 22 | OSCompareAndSwapAtomicEx(volatile uint32_t *ptr, 23 | uint32_t compare, 24 | uint32_t value, 25 | uint32_t *old); 26 | 27 | uint32_t 28 | OSSwapAtomic(volatile uint32_t *ptr, 29 | uint32_t value); 30 | 31 | int32_t 32 | OSAddAtomic(volatile int32_t *ptr, 33 | int32_t value); 34 | 35 | uint32_t 36 | OSAndAtomic(volatile uint32_t *ptr, 37 | uint32_t value); 38 | 39 | uint32_t 40 | OSOrAtomic(volatile uint32_t *ptr, 41 | uint32_t value); 42 | 43 | uint32_t 44 | OSXorAtomic(volatile uint32_t *ptr, 45 | uint32_t value); 46 | 47 | BOOL 48 | OSTestAndClearAtomic(volatile uint32_t *ptr, 49 | uint32_t bit); 50 | 51 | BOOL 52 | OSTestAndSetAtomic(volatile uint32_t *ptr, 53 | uint32_t bit); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | /** @} */ 60 | -------------------------------------------------------------------------------- /include/coreinit/atomic64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_atomic64 Atomic Operations 64 bit 6 | * \ingroup coreinit 7 | * 8 | * These functions are used for atomically operating on 64 bit values in memory. 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | uint64_t 17 | OSGetAtomic64(volatile uint64_t *ptr); 18 | 19 | uint64_t 20 | OSSetAtomic64(volatile uint64_t *ptr, 21 | uint64_t value); 22 | 23 | BOOL 24 | OSCompareAndSwapAtomic64(volatile uint64_t *ptr, 25 | uint64_t compare, 26 | uint64_t value); 27 | 28 | BOOL 29 | OSCompareAndSwapAtomicEx64(volatile uint64_t *ptr, 30 | uint64_t compare, 31 | uint64_t value, 32 | uint64_t *old); 33 | 34 | uint64_t 35 | OSSwapAtomic64(volatile uint64_t *ptr, 36 | uint64_t value); 37 | 38 | int64_t 39 | OSAddAtomic64(volatile int64_t *ptr, 40 | int64_t value); 41 | 42 | uint64_t 43 | OSAndAtomic64(volatile uint64_t *ptr, 44 | uint64_t value); 45 | 46 | uint64_t 47 | OSOrAtomic64(volatile uint64_t *ptr, 48 | uint64_t value); 49 | 50 | uint64_t 51 | OSXorAtomic64(volatile uint64_t *ptr, 52 | uint64_t value); 53 | 54 | BOOL 55 | OSTestAndClearAtomic64(volatile uint64_t *ptr, 56 | uint32_t bit); 57 | 58 | BOOL 59 | OSTestAndSetAtomic64(volatile uint64_t *ptr, 60 | uint32_t bit); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | /** @} */ 67 | -------------------------------------------------------------------------------- /include/coreinit/copydata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_copydata CopyData 6 | * \ingroup coreinit 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void 16 | __OSClearCopyData(); 17 | 18 | BOOL 19 | __OSAppendCopyData(const void *data, 20 | uint32_t size); 21 | 22 | void * 23 | __OSGetCopyDataPtr(); 24 | 25 | uint32_t 26 | __OSGetCopyDataSize(); 27 | 28 | BOOL 29 | __OSResizeCopyData(uint32_t size); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | /** @} */ 36 | -------------------------------------------------------------------------------- /include/coreinit/core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_core Core 6 | * \ingroup coreinit 7 | * 8 | * Provides information about each core of the system's processor. 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | 17 | /** 18 | * Gets the number of cores in the system. On a retail Wii U, this is always 3. 19 | * 20 | * \returns 21 | * The core count of the system. 22 | */ 23 | uint32_t 24 | OSGetCoreCount(); 25 | 26 | 27 | /** 28 | * Gets the core executing the current thread. 29 | * 30 | * \returns 31 | * The ID of the current core. 32 | */ 33 | uint32_t 34 | OSGetCoreId(); 35 | 36 | 37 | /** 38 | * Gets the main core of the system. On a retail Wii U, this is always core 1. 39 | * 40 | * \returns 41 | * The ID of the main core. 42 | */ 43 | uint32_t 44 | OSGetMainCoreId(); 45 | 46 | 47 | /** 48 | * Determines whether the current thread is running on the main core. 49 | * On a retail Wii U, the main core is always core 1. 50 | * 51 | * \returns 52 | * \c true if the current core is the main core. 53 | * 54 | * \sa 55 | *
  • \link OSGetMainCoreId \endlink
56 | */ 57 | BOOL 58 | OSIsMainCore(); 59 | 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /** @} */ 66 | -------------------------------------------------------------------------------- /include/coreinit/coreinit.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup coreinit coreinit 3 | * 4 | * Contains all core operating system functions such as threads, synchronisation 5 | * objects, filesystem, memory, exception handling, etc... 6 | */ 7 | -------------------------------------------------------------------------------- /include/coreinit/coroutine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_coroutine Coroutines 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct OSCoroutine OSCoroutine; 15 | 16 | struct OSCoroutine 17 | { 18 | uint32_t nia; 19 | uint32_t cr; 20 | uint32_t ugqr1; 21 | uint32_t stack; 22 | uint32_t sda2Base; 23 | uint32_t sdaBase; 24 | uint32_t gpr[18]; 25 | double fpr[18]; 26 | double psr[18]; 27 | }; 28 | WUT_CHECK_OFFSET(OSCoroutine, 0x00, nia); 29 | WUT_CHECK_OFFSET(OSCoroutine, 0x04, cr); 30 | WUT_CHECK_OFFSET(OSCoroutine, 0x08, ugqr1); 31 | WUT_CHECK_OFFSET(OSCoroutine, 0x0C, stack); 32 | WUT_CHECK_OFFSET(OSCoroutine, 0x10, sda2Base); 33 | WUT_CHECK_OFFSET(OSCoroutine, 0x14, sdaBase); 34 | WUT_CHECK_OFFSET(OSCoroutine, 0x18, gpr); 35 | WUT_CHECK_OFFSET(OSCoroutine, 0x60, fpr); 36 | WUT_CHECK_OFFSET(OSCoroutine, 0xF0, psr); 37 | WUT_CHECK_SIZE(OSCoroutine, 0x180); 38 | 39 | void 40 | OSInitCoroutine(OSCoroutine *coroutine, 41 | void *entry, 42 | void *stack); 43 | 44 | uint32_t 45 | OSLoadCoroutine(OSCoroutine *coroutine, 46 | uint32_t result); 47 | 48 | uint32_t 49 | OSSaveCoroutine(OSCoroutine *coroutine); 50 | 51 | void 52 | OSSwitchCoroutine(OSCoroutine *from, 53 | OSCoroutine *to); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | /** @} */ 60 | -------------------------------------------------------------------------------- /include/coreinit/cosreport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_cosreport COS Report 6 | * \ingroup coreinit 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum COSReportLevel{ 16 | COS_REPORT_LEVEL_ERROR = 0, 17 | COS_REPORT_LEVEL_WARN = 1, 18 | COS_REPORT_LEVEL_INFO = 2, 19 | COS_REPORT_LEVEL_VERBOSE = 3, 20 | } COSReportLevel; 21 | 22 | typedef enum COSReportModule{ 23 | COS_REPORT_MODULE_UNKNOWN_0 = 0, 24 | COS_REPORT_MODULE_UNKNOWN_1 = 1, 25 | COS_REPORT_MODULE_UNKNOWN_2 = 2, 26 | COS_REPORT_MODULE_UNKNOWN_5 = 5, 27 | } COSReportModule; 28 | 29 | void 30 | COSVReport(COSReportModule module, 31 | COSReportLevel level, 32 | const char* fmt, 33 | ...) 34 | WUT_FORMAT_PRINTF(3, 4); 35 | 36 | void 37 | COSError(COSReportModule module, 38 | const char* fmt, 39 | ...) 40 | WUT_FORMAT_PRINTF(2, 3); 41 | 42 | void 43 | COSInfo(COSReportModule module, 44 | const char* fmt, 45 | ...) 46 | WUT_FORMAT_PRINTF(2, 3); 47 | 48 | void 49 | COSVerbose(COSReportModule module, 50 | const char* fmt, 51 | ...) 52 | WUT_FORMAT_PRINTF(2, 3); 53 | 54 | void 55 | COSWarn(COSReportModule module, 56 | const char* fmt, 57 | ...) 58 | WUT_FORMAT_PRINTF(2, 3); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | /** @} */ 65 | -------------------------------------------------------------------------------- /include/coreinit/energysaver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_energysaver Energy saver 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef int32_t IMError; 15 | 16 | IMError 17 | IMDisableAPD(); 18 | 19 | IMError 20 | IMDisableDim(); 21 | 22 | IMError 23 | IMEnableAPD(); 24 | 25 | IMError 26 | IMEnableDim(); 27 | 28 | IMError 29 | IMIsAPDEnabled(uint32_t *outValue); 30 | 31 | IMError 32 | IMIsAPDEnabledBySysSettings(uint32_t *outValue); 33 | 34 | IMError 35 | IMIsDimEnabled(uint32_t *outValue); 36 | 37 | IMError 38 | IMGetDimEnableDRC(uint32_t *outValue); 39 | 40 | IMError 41 | IMGetDimEnableTV(uint32_t *outValue); 42 | 43 | IMError 44 | IMGetDimPeriod(uint32_t *outValue); 45 | 46 | IMError 47 | IMGetTimeBeforeAPD(uint32_t *outSeconds); 48 | 49 | IMError 50 | IMGetTimeBeforeDimming(uint32_t *outSeconds); 51 | 52 | IMError 53 | IMSetDimEnableDRC(BOOL value); 54 | 55 | IMError 56 | IMSetDimEnableTV(BOOL value); 57 | 58 | IMError 59 | IMStartAPDVideoMode(); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /** @} */ 66 | -------------------------------------------------------------------------------- /include/coreinit/exit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_exit Exit 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void 15 | RPLWRAP(exit)(int code); 16 | 17 | void 18 | _Exit(int code); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | /** @} */ 25 | -------------------------------------------------------------------------------- /include/coreinit/fastcondition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "threadqueue.h" 4 | 5 | /** 6 | * \defgroup coreinit_fastcond Fast Condition Variable 7 | * \ingroup coreinit 8 | * 9 | * A condition variable to be used with an OSFastMutex. 10 | * 11 | * @{ 12 | */ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | typedef struct OSFastCondition OSFastCondition; 19 | typedef struct OSFastMutex OSFastMutex; 20 | 21 | #define OS_FAST_CONDITION_TAG 0x664E6456u 22 | 23 | struct OSFastCondition 24 | { 25 | uint32_t tag; 26 | const char *name; 27 | WUT_UNKNOWN_BYTES(4); 28 | OSThreadQueue queue; 29 | }; 30 | WUT_CHECK_OFFSET(OSFastCondition, 0x00, tag); 31 | WUT_CHECK_OFFSET(OSFastCondition, 0x04, name); 32 | WUT_CHECK_OFFSET(OSFastCondition, 0x0c, queue); 33 | WUT_CHECK_SIZE(OSFastCondition, 0x1c); 34 | 35 | void 36 | OSFastCond_Init(OSFastCondition *condition, 37 | const char *name); 38 | 39 | void 40 | OSFastCond_Wait(OSFastCondition *condition, 41 | OSFastMutex *mutex); 42 | 43 | void 44 | OSFastCond_Signal(OSFastCondition *condition); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | /** @} */ 51 | -------------------------------------------------------------------------------- /include/coreinit/fastmutex.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "threadqueue.h" 4 | 5 | /** 6 | * \defgroup coreinit_fastmutex Fast Mutex 7 | * \ingroup coreinit 8 | * 9 | * Similar to OSMutex but tries to acquire the mutex without using the global 10 | * scheduler lock, and does not test for thread cancel. 11 | * @{ 12 | */ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | typedef struct OSFastMutex OSFastMutex; 19 | typedef struct OSFastMutexLink OSFastMutexLink; 20 | typedef struct OSFastCondition OSFastCondition; 21 | 22 | struct OSFastMutexLink 23 | { 24 | OSFastMutex *next; 25 | OSFastMutex *prev; 26 | }; 27 | WUT_CHECK_OFFSET(OSFastMutexLink, 0x00, next); 28 | WUT_CHECK_OFFSET(OSFastMutexLink, 0x04, prev); 29 | WUT_CHECK_SIZE(OSFastMutexLink, 0x08); 30 | 31 | #define OS_FAST_MUTEX_TAG 0x664D7458u 32 | 33 | struct OSFastMutex 34 | { 35 | uint32_t tag; 36 | const char *name; 37 | WUT_UNKNOWN_BYTES(4); 38 | OSThreadSimpleQueue queue; 39 | OSFastMutexLink link; 40 | WUT_UNKNOWN_BYTES(16); 41 | }; 42 | WUT_CHECK_OFFSET(OSFastMutex, 0x00, tag); 43 | WUT_CHECK_OFFSET(OSFastMutex, 0x04, name); 44 | WUT_CHECK_OFFSET(OSFastMutex, 0x0c, queue); 45 | WUT_CHECK_OFFSET(OSFastMutex, 0x14, link); 46 | WUT_CHECK_SIZE(OSFastMutex, 0x2c); 47 | 48 | void 49 | OSFastMutex_Init(OSFastMutex *mutex, 50 | const char *name); 51 | 52 | void 53 | OSFastMutex_Lock(OSFastMutex *mutex); 54 | 55 | void 56 | OSFastMutex_Unlock(OSFastMutex *mutex); 57 | 58 | BOOL 59 | OSFastMutex_TryLock(OSFastMutex *mutex); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /** @} */ 66 | -------------------------------------------------------------------------------- /include/coreinit/fiber.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_fiber Fiber 6 | * \ingroup coreinit 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef void (*OSFiberEntryFn)(); 16 | typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, 17 | uint32_t arg3, uint32_t arg4); 18 | 19 | int32_t 20 | OSSwitchFiber(OSFiberEntryFn entry, 21 | void *stack); 22 | 23 | int32_t 24 | OSSwitchFiberEx(uint32_t arg1, 25 | uint32_t arg2, 26 | uint32_t arg3, 27 | uint32_t arg4, 28 | OSFiberExEntryFn entry, 29 | void *stack); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | /** @} */ 36 | -------------------------------------------------------------------------------- /include/coreinit/foreground.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_foreground Foreground Management 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void 15 | OSEnableForegroundExit(); 16 | 17 | void 18 | OSReleaseForeground(); 19 | 20 | void 21 | OSSavesDone_ReadyToRelease(); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | /** @} */ 28 | -------------------------------------------------------------------------------- /include/coreinit/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int 9 | __os_snprintf(char *buf, size_t n, const char *format, ... ) 10 | WUT_FORMAT_PRINTF(3, 4); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /include/coreinit/interrupts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /** 6 | * \defgroup coreinit_interrupts Interrupt Management 7 | * \ingroup coreinit 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum OSInterruptType 16 | { 17 | OS_INTERRUPT_TYPE_ERROR = 0, 18 | OS_INTERRUPT_TYPE_DSP = 1, 19 | OS_INTERRUPT_TYPE_GPU7 = 2, 20 | OS_INTERRUPT_TYPE_GPIPPC = 3, 21 | OS_INTERRUPT_TYPE_PRIMARYI2C = 4, 22 | OS_INTERRUPT_TYPE_DSPAI = 5, 23 | OS_INTERRUPT_TYPE_DSPAI2 = 6, 24 | OS_INTERRUPT_TYPE_DSPACC = 7, 25 | OS_INTERRUPT_TYPE_DSPDSP = 8, 26 | OS_INTERRUPT_TYPE_IPCPPC0 = 9, 27 | OS_INTERRUPT_TYPE_IPCPPC1 = 10, 28 | OS_INTERRUPT_TYPE_IPCPPC2 = 11, 29 | OS_INTERRUPT_TYPE_AHB = 12 30 | } OSInterruptType; 31 | 32 | typedef void(*OSUserInterruptHandler)(OSInterruptType type, OSContext* interruptedContext); 33 | 34 | BOOL 35 | OSEnableInterrupts(); 36 | 37 | BOOL 38 | OSDisableInterrupts(); 39 | 40 | BOOL 41 | OSRestoreInterrupts(BOOL enable); 42 | 43 | BOOL 44 | OSIsInterruptEnabled(); 45 | 46 | OSUserInterruptHandler 47 | __OSSetInterruptHandler(OSInterruptType type, 48 | OSUserInterruptHandler handler); 49 | 50 | void 51 | __OSClearAndEnableInterrupt(OSInterruptType type); 52 | 53 | void 54 | __OSDisableInterrupt(OSInterruptType type); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | /** @} */ 61 | -------------------------------------------------------------------------------- /include/coreinit/memdefaultheap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "memheap.h" 4 | 5 | /** 6 | * \defgroup coreinit_memdefaultheap Default Heap 7 | * \ingroup coreinit 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef void *(*MEMAllocFromDefaultHeapFn)(uint32_t size); 16 | typedef void *(*MEMAllocFromDefaultHeapExFn)(uint32_t size, int32_t alignment); 17 | typedef void (*MEMFreeToDefaultHeapFn)(void *ptr); 18 | 19 | extern MEMAllocFromDefaultHeapFn MEMAllocFromDefaultHeap; 20 | extern MEMAllocFromDefaultHeapExFn MEMAllocFromDefaultHeapEx; 21 | extern MEMFreeToDefaultHeapFn MEMFreeToDefaultHeap; 22 | 23 | /** 24 | * Default implementation of __preinit_user. 25 | */ 26 | void 27 | CoreInitDefaultHeap(MEMHeapHandle *outMem1, 28 | MEMHeapHandle *outFG, 29 | MEMHeapHandle *outMem2); 30 | 31 | /** 32 | * Allows the user to completely customise the default heaps, this runs after 33 | * the rpx code section has loaded but before the data section as the data 34 | * sections are allocated from the default heap. 35 | * 36 | * This is for a user to export from their .rpx file, it is not exported from 37 | * coreinit.rpl 38 | */ 39 | void 40 | __preinit_user(MEMHeapHandle *outMem1, 41 | MEMHeapHandle *outFG, 42 | MEMHeapHandle *outMem2); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | /** @} */ 49 | -------------------------------------------------------------------------------- /include/coreinit/memunitheap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "memheap.h" 4 | 5 | /** 6 | * \defgroup coreinit_unitheap Unit Heap 7 | * \ingroup coreinit 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct MEMUnitHeap MEMUnitHeap; 16 | typedef struct MEMUnitHeapFreeBlock MEMUnitHeapFreeBlock; 17 | 18 | struct MEMUnitHeapFreeBlock 19 | { 20 | MEMUnitHeapFreeBlock *next; 21 | }; 22 | WUT_CHECK_OFFSET(MEMUnitHeapFreeBlock, 0x00, next); 23 | WUT_CHECK_SIZE(MEMUnitHeapFreeBlock, 0x04); 24 | 25 | struct WUT_PACKED MEMUnitHeap 26 | { 27 | MEMHeapHeader header; 28 | MEMUnitHeapFreeBlock *freeBlocks; 29 | uint32_t blockSize; 30 | }; 31 | WUT_CHECK_OFFSET(MEMUnitHeap, 0x00, header); 32 | WUT_CHECK_OFFSET(MEMUnitHeap, 0x40, freeBlocks); 33 | WUT_CHECK_OFFSET(MEMUnitHeap, 0x44, blockSize); 34 | WUT_CHECK_SIZE(MEMUnitHeap, 0x48); 35 | 36 | MEMHeapHandle 37 | MEMCreateUnitHeapEx(void *heap, 38 | uint32_t size, 39 | uint32_t blockSize, 40 | int32_t alignment, 41 | uint16_t flags); 42 | 43 | void * 44 | MEMDestroyUnitHeap(MEMHeapHandle heap); 45 | 46 | void * 47 | MEMAllocFromUnitHeap(MEMHeapHandle heap); 48 | 49 | void 50 | MEMFreeToUnitHeap(MEMHeapHandle heap, 51 | void *block); 52 | 53 | void 54 | MEMiDumpUnitHeap(MEMHeapHandle heap); 55 | 56 | uint32_t 57 | MEMCountFreeBlockForUnitHeap(MEMHeapHandle heap); 58 | 59 | uint32_t 60 | MEMCalcHeapSizeForUnitHeap(uint32_t blockSize, 61 | uint32_t count, 62 | int32_t alignment); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | /** @} */ 69 | -------------------------------------------------------------------------------- /include/coreinit/rendezvous.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /** 6 | * \defgroup coreinit_rendezvous Rendezvous 7 | * \ingroup coreinit 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct OSRendezvous OSRendezvous; 16 | 17 | struct OSRendezvous 18 | { 19 | uint32_t core[3]; 20 | WUT_UNKNOWN_BYTES(4); 21 | }; 22 | WUT_CHECK_OFFSET(OSRendezvous, 0x00, core); 23 | WUT_CHECK_SIZE(OSRendezvous, 0x10); 24 | 25 | void 26 | OSInitRendezvous(OSRendezvous *rendezvous); 27 | 28 | BOOL 29 | OSWaitRendezvous(OSRendezvous *rendezvous, 30 | uint32_t coreMask); 31 | 32 | BOOL 33 | OSWaitRendezvousWithTimeout(OSRendezvous *rendezvous, 34 | uint32_t coreMask, 35 | OSTime timeout); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | /** @} */ 42 | -------------------------------------------------------------------------------- /include/coreinit/scheduler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_scheduler Scheduler 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | extern void* __OSSchedulerLock; 15 | 16 | void 17 | __OSEnableScheduler(); 18 | 19 | void 20 | __OSDisableScheduler(); 21 | 22 | void 23 | __OSLockScheduler(void* lockId); 24 | 25 | void 26 | __OSUnlockScheduler(void* lockId); 27 | 28 | BOOL 29 | OSIsSchedulerLocked(void* lockId); 30 | 31 | void 32 | __OSTryLockScheduler(void* lockId); 33 | 34 | void 35 | __OSTouchSchedulerLock(); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | /** @} */ 42 | -------------------------------------------------------------------------------- /include/coreinit/spinlock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "time.h" 4 | 5 | /** 6 | * \defgroup coreinit_spinlock Spinlock 7 | * \ingroup coreinit 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct OSSpinLock OSSpinLock; 16 | 17 | struct WUT_ALIGNAS(16) OSSpinLock 18 | { 19 | uint32_t owner; 20 | WUT_UNKNOWN_BYTES(0x4); 21 | uint32_t recursion; 22 | WUT_UNKNOWN_BYTES(0x4); 23 | }; 24 | WUT_CHECK_OFFSET(OSSpinLock, 0x0, owner); 25 | WUT_CHECK_OFFSET(OSSpinLock, 0x8, recursion); 26 | WUT_CHECK_SIZE(OSSpinLock, 0x10); 27 | 28 | void 29 | OSInitSpinLock(OSSpinLock *spinlock); 30 | 31 | BOOL 32 | OSAcquireSpinLock(OSSpinLock *spinlock); 33 | 34 | BOOL 35 | OSTryAcquireSpinLock(OSSpinLock *spinlock); 36 | 37 | BOOL 38 | OSTryAcquireSpinLockWithTimeout(OSSpinLock *spinlock, 39 | OSTime timeout); 40 | 41 | BOOL 42 | OSReleaseSpinLock(OSSpinLock *spinlock); 43 | 44 | BOOL 45 | OSUninterruptibleSpinLock_Acquire(OSSpinLock *spinlock); 46 | 47 | BOOL 48 | OSUninterruptibleSpinLock_TryAcquire(OSSpinLock *spinlock); 49 | 50 | BOOL 51 | OSUninterruptibleSpinLock_TryAcquireWithTimeout(OSSpinLock *spinlock, 52 | OSTime timeout); 53 | 54 | BOOL 55 | OSUninterruptibleSpinLock_Release(OSSpinLock *spinlock); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | /** @} */ 62 | -------------------------------------------------------------------------------- /include/coreinit/stopwatchatomic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "time.h" 5 | 6 | /** 7 | * \defgroup coreinit_stopwatchatomic Atomic Stopwatch 8 | * \ingroup coreinit 9 | * 10 | * @{ 11 | */ 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef struct OSStopWatchAtomic OSStopWatchAtomic; 17 | 18 | struct OSStopWatchAtomic 19 | { 20 | //! Last time the watch was started 21 | OSTime startTime; 22 | //! Total time from first start to last stop 23 | OSTime totalTime; 24 | }; 25 | WUT_CHECK_OFFSET(OSStopWatchAtomic, 0x00, startTime); 26 | WUT_CHECK_OFFSET(OSStopWatchAtomic, 0x08, totalTime); 27 | WUT_CHECK_SIZE(OSStopWatchAtomic, 0x10); 28 | 29 | /** 30 | * Start the stopwatch. 31 | * Only updates the start time 32 | * \returns total time on stopwatch 33 | */ 34 | OSTime 35 | OSStopWatchStart(OSStopWatchAtomic *stopWatch); 36 | 37 | /** 38 | * Stop the stopwatch. 39 | * Resets the start time to 0 40 | * \returns total time on stopwatch 41 | */ 42 | OSTime 43 | OSStopWatchStop(OSStopWatchAtomic *stopWatch); 44 | 45 | /** 46 | * Get the current time on the stopwatch 47 | * \returns current time on stopwatch 48 | */ 49 | OSTime 50 | OSStopWatchLap(OSStopWatchAtomic *stopWatch); 51 | 52 | 53 | /** 54 | * Stops and resets the stop watch. 55 | * Clears start and total time 56 | * \returns previous total time 57 | */ 58 | OSTime 59 | OSStopWatchReset(OSStopWatchAtomic *stopWatch); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /** @} */ 66 | -------------------------------------------------------------------------------- /include/coreinit/systeminfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_systeminfo System Info 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct OSSystemInfo OSSystemInfo; 15 | 16 | struct OSSystemInfo 17 | { 18 | uint32_t busClockSpeed; 19 | uint32_t coreClockSpeed; 20 | int64_t baseTime; 21 | WUT_UNKNOWN_BYTES(0x10); 22 | }; 23 | WUT_CHECK_OFFSET(OSSystemInfo, 0x0, busClockSpeed); 24 | WUT_CHECK_OFFSET(OSSystemInfo, 0x4, coreClockSpeed); 25 | WUT_CHECK_OFFSET(OSSystemInfo, 0x8, baseTime); 26 | WUT_CHECK_SIZE(OSSystemInfo, 0x20); 27 | 28 | OSSystemInfo * 29 | OSGetSystemInfo(); 30 | 31 | BOOL 32 | OSEnableHomeButtonMenu(BOOL enable); 33 | 34 | BOOL 35 | OSIsHomeButtonMenuEnabled(); 36 | 37 | uint64_t 38 | OSGetOSID(); 39 | 40 | uint32_t 41 | __OSGetProcessSDKVersion(); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | /** @} */ 48 | -------------------------------------------------------------------------------- /include/coreinit/threadqueue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_threadq Thread Queue 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct OSThread OSThread; 15 | 16 | typedef struct OSThreadLink OSThreadLink; 17 | typedef struct OSThreadQueue OSThreadQueue; 18 | typedef struct OSThreadSimpleQueue OSThreadSimpleQueue; 19 | 20 | struct OSThreadLink 21 | { 22 | OSThread *next; 23 | OSThread *prev; 24 | }; 25 | WUT_CHECK_OFFSET(OSThreadLink, 0x00, next); 26 | WUT_CHECK_OFFSET(OSThreadLink, 0x04, prev); 27 | WUT_CHECK_SIZE(OSThreadLink, 0x8); 28 | 29 | struct OSThreadQueue 30 | { 31 | OSThread *head; 32 | OSThread *tail; 33 | void *parent; 34 | WUT_UNKNOWN_BYTES(4); 35 | }; 36 | WUT_CHECK_OFFSET(OSThreadQueue, 0x00, head); 37 | WUT_CHECK_OFFSET(OSThreadQueue, 0x04, tail); 38 | WUT_CHECK_OFFSET(OSThreadQueue, 0x08, parent); 39 | WUT_CHECK_SIZE(OSThreadQueue, 0x10); 40 | 41 | struct OSThreadSimpleQueue 42 | { 43 | OSThread *head; 44 | OSThread *tail; 45 | }; 46 | WUT_CHECK_OFFSET(OSThreadSimpleQueue, 0x00, head); 47 | WUT_CHECK_OFFSET(OSThreadSimpleQueue, 0x04, tail); 48 | WUT_CHECK_SIZE(OSThreadSimpleQueue, 0x08); 49 | 50 | void 51 | OSInitThreadQueue(OSThreadQueue *queue); 52 | 53 | void 54 | OSInitThreadQueueEx(OSThreadQueue *queue, 55 | void *parent); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | /** @} */ 62 | -------------------------------------------------------------------------------- /include/coreinit/title.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup coreinit_title Title 6 | * \ingroup coreinit 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | uint64_t OSGetTitleID(void); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | /** @} */ 21 | -------------------------------------------------------------------------------- /include/coreinit/transition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | int 10 | __OSGetSavedAudioFlags(); 11 | 12 | int __OSGetTransitionAudioBuffer(void **buffer, 13 | uint32_t *size); 14 | 15 | void 16 | __OSSetTransitionAudioSize(uint32_t size); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /include/dmae/dmae.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup dmae dmae 3 | * DMA Engine. 4 | */ 5 | -------------------------------------------------------------------------------- /include/dmae/sync.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup dmae_sync Synchronization 6 | * \ingroup dmae 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | //! Timestamp for a DMAE operation. 15 | typedef uint64_t DMAETimeStamp; 16 | 17 | /** 18 | * Waits for a DMAE operation to complete. 19 | * 20 | * \param timestamp 21 | * Timestamp of the operation to wait for. 22 | * 23 | * \return 24 | * TRUE when successful. 25 | */ 26 | BOOL 27 | DMAEWaitDone(DMAETimeStamp timestamp); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | /** @} */ 34 | -------------------------------------------------------------------------------- /include/erreula/erreula.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup erreula erreula 3 | * 4 | * C++ linkage for the error viewer, see \link nn::erreula \endlink for 5 | * general use. 6 | */ 7 | -------------------------------------------------------------------------------- /include/erreula/rpl_interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | /** 7 | * \defgroup erreula_rpl RPL Interface 8 | * \ingroup erreula 9 | * C++ linkage for erreula, see \link nn::erreula \endlink for general use. 10 | * @{ 11 | */ 12 | 13 | #ifdef __cplusplus 14 | 15 | struct FSClient; 16 | 17 | namespace Rpl 18 | { 19 | 20 | void ErrEulaSetVersion(int version); 21 | bool ErrEulaJump(const char *buffer, uint32_t bufferSize); 22 | void ErrEulaPlayAppearSE(bool playAppearSoundEffect); 23 | bool ErrEulaIsSelectCursorActive(); 24 | void ErrEulaChangeLang(nn::erreula::LangType language); 25 | void ErrEulaDisappearHomeNixSign(); 26 | bool ErrEulaIsAppearHomeNixSign(); 27 | void ErrEulaAppearHomeNixSign(const nn::erreula::HomeNixSignArg &arg); 28 | void ErrEulaSetControllerRemo(nn::erreula::ControllerType controller); 29 | int32_t ErrEulaGetSelectButtonNumError(); 30 | int32_t ErrEulaGetResultCode(); 31 | nn::erreula::ResultType ErrEulaGetResultType(); 32 | nn::erreula::State ErrEulaGetStateErrorViewer(); 33 | bool ErrEulaIsDecideSelectRightButtonError(); 34 | bool ErrEulaIsDecideSelectLeftButtonError(); 35 | bool ErrEulaIsDecideSelectButtonError(); 36 | void ErrEulaDisappearError(); 37 | void ErrEulaAppearError(const nn::erreula::AppearArg &arg); 38 | void ErrEulaCalc(const nn::erreula::ControllerInfo &controllerInfo); 39 | void ErrEulaDrawDRC(); 40 | void ErrEulaDrawTV(); 41 | void ErrEulaDestroy(); 42 | void ErrEulaCreate(void *workMemory, nn::erreula::RegionType region, 43 | nn::erreula::LangType language, FSClient *fsClient); 44 | 45 | } // namespace Rpl 46 | 47 | #endif // ifdef __cplusplus 48 | 49 | /** @} */ 50 | -------------------------------------------------------------------------------- /include/gx2/aperture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "enum.h" 4 | #include "surface.h" 5 | 6 | /** 7 | * \defgroup gx2_aperture Aperture 8 | * \ingroup gx2 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef uint32_t GX2ApertureHandle; 17 | 18 | /** 19 | * Allocates a tiling aperture. 20 | * This function creates a linear and untiled buffer to read from and write to the surface. 21 | * The total size of the buffer will be width * height * bpp. 22 | * 23 | * \param surface 24 | * A pointer to the surface to create the tiling aperture for. 25 | * 26 | * \param level 27 | * The level of the surface to create the tiling aperture for. 28 | * 29 | * \param depth 30 | * The depth of the surface to create the tiling aperture for. 31 | * 32 | * \param endian 33 | * The endian swap mode. 34 | * 35 | * \param outHandle 36 | * A pointer to store the handle for the aperture. 37 | * 38 | * \param outAddress 39 | * A pointer to store the address for the aperture. 40 | */ 41 | void 42 | GX2AllocateTilingApertureEx(GX2Surface *surface, 43 | uint32_t level, 44 | uint32_t depth, 45 | GX2EndianSwapMode endian, 46 | GX2ApertureHandle *outHandle, 47 | void **outAddress); 48 | 49 | /** 50 | * Frees an allocated tiling aperture. 51 | * 52 | * \param handle 53 | * The handle of the tiling aperture which should be freed. 54 | */ 55 | void 56 | GX2FreeTilingAperture(GX2ApertureHandle handle); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | /** @} */ 63 | -------------------------------------------------------------------------------- /include/gx2/clear.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "enum.h" 4 | 5 | /** 6 | * \defgroup gx2_clear Clear 7 | * \ingroup gx2 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct GX2ColorBuffer GX2ColorBuffer; 16 | typedef struct GX2DepthBuffer GX2DepthBuffer; 17 | 18 | void 19 | GX2ClearColor(GX2ColorBuffer *colorBuffer, 20 | float red, 21 | float green, 22 | float blue, 23 | float alpha); 24 | 25 | void 26 | GX2ClearDepthStencilEx(GX2DepthBuffer *depthBuffer, 27 | float depth, 28 | uint8_t stencil, 29 | GX2ClearFlags clearMode); 30 | 31 | void 32 | GX2ClearBuffersEx(GX2ColorBuffer *colorBuffer, 33 | GX2DepthBuffer *depthBuffer, 34 | float red, 35 | float green, 36 | float blue, 37 | float alpha, 38 | float depth, 39 | uint8_t stencil, 40 | GX2ClearFlags clearMode); 41 | 42 | void 43 | GX2SetClearDepth(GX2DepthBuffer *depthBuffer, 44 | float depth); 45 | 46 | void 47 | GX2SetClearStencil(GX2DepthBuffer *depthBuffer, 48 | uint8_t stencil); 49 | 50 | void 51 | GX2SetClearDepthStencil(GX2DepthBuffer *depthBuffer, 52 | float depth, 53 | uint8_t stencil); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | /** @} */ 60 | -------------------------------------------------------------------------------- /include/gx2/displaylist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup gx2_displaylist Display List 6 | * \ingroup gx2 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void 15 | GX2BeginDisplayListEx(void *displayList, 16 | uint32_t bytes, 17 | BOOL unk1); 18 | 19 | uint32_t 20 | GX2EndDisplayList(void *displayList); 21 | 22 | void 23 | GX2DirectCallDisplayList(const void *displayList, 24 | uint32_t bytes); 25 | 26 | void 27 | GX2CallDisplayList(const void *displayList, 28 | uint32_t bytes); 29 | 30 | BOOL 31 | GX2GetDisplayListWriteStatus(); 32 | 33 | BOOL 34 | GX2GetCurrentDisplayList(void **outDisplayList, 35 | uint32_t *outSize); 36 | 37 | void 38 | GX2CopyDisplayList(const void *displayList, 39 | uint32_t bytes); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | /** @} */ 46 | -------------------------------------------------------------------------------- /include/gx2/draw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "enum.h" 4 | 5 | /** 6 | * \defgroup gx2_draw Draw 7 | * \ingroup gx2 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void 16 | GX2SetAttribBuffer(uint32_t index, 17 | uint32_t size, 18 | uint32_t stride, 19 | const void *buffer); 20 | 21 | void 22 | GX2DrawEx(GX2PrimitiveMode mode, 23 | uint32_t count, 24 | uint32_t offset, 25 | uint32_t numInstances); 26 | 27 | void 28 | GX2DrawEx2(GX2PrimitiveMode mode, 29 | uint32_t count, 30 | uint32_t offset, 31 | uint32_t numInstances, 32 | uint32_t baseInstance); 33 | 34 | void 35 | GX2DrawIndexedEx(GX2PrimitiveMode mode, 36 | uint32_t count, 37 | GX2IndexType indexType, 38 | const void *indices, 39 | uint32_t offset, 40 | uint32_t numInstances); 41 | 42 | void 43 | GX2DrawIndexedEx2(GX2PrimitiveMode mode, 44 | uint32_t count, 45 | GX2IndexType indexType, 46 | const void *indices, 47 | uint32_t offset, 48 | uint32_t numInstances, 49 | uint32_t baseInstance); 50 | 51 | void 52 | GX2DrawIndexedImmediateEx(GX2PrimitiveMode mode, 53 | uint32_t count, 54 | GX2IndexType indexType, 55 | const void *indices, 56 | uint32_t offset, 57 | uint32_t numInstances); 58 | 59 | void 60 | GX2SetPrimitiveRestartIndex(uint32_t index); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | /** @} */ 67 | -------------------------------------------------------------------------------- /include/gx2/gx2.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup gx2 gx2 3 | * Graphics driver. 4 | */ 5 | -------------------------------------------------------------------------------- /include/gx2/mem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "enum.h" 4 | 5 | /** 6 | * \defgroup gx2_mem Memory 7 | * \ingroup gx2 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void 16 | GX2Invalidate(GX2InvalidateMode mode, 17 | void *buffer, 18 | uint32_t size); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | /** @} */ 25 | -------------------------------------------------------------------------------- /include/gx2/state.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "enum.h" 5 | 6 | /** 7 | * \defgroup gx2_state State 8 | * \ingroup gx2 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | void 17 | GX2Init(uint32_t *attributes); 18 | 19 | void 20 | GX2Shutdown(); 21 | 22 | void 23 | GX2Flush(); 24 | 25 | void 26 | GX2ResetGPU(uint32_t unknown); 27 | 28 | /** 29 | * @return -1 if GX2 is not running, on success the core where GX2Init has been called is returned. 30 | */ 31 | int 32 | GX2GetMainCoreId(); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | /** @} */ 39 | -------------------------------------------------------------------------------- /include/gx2/swap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "enum.h" 4 | 5 | /** 6 | * \defgroup gx2_swap Swap 7 | * \ingroup gx2 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct GX2ColorBuffer GX2ColorBuffer; 16 | typedef struct GX2Texture GX2Texture; 17 | 18 | void 19 | GX2CopyColorBufferToScanBuffer(const GX2ColorBuffer *buffer, 20 | GX2ScanTarget scanTarget); 21 | 22 | void 23 | GX2SwapScanBuffers(); 24 | 25 | BOOL 26 | GX2GetLastFrame(GX2ScanTarget scanTarget, 27 | GX2Texture *texture); 28 | 29 | BOOL 30 | GX2GetLastFrameGamma(GX2ScanTarget scanTarget, 31 | float *gammaOut); 32 | 33 | uint32_t 34 | GX2GetSwapInterval(); 35 | 36 | void 37 | GX2SetSwapInterval(uint32_t interval); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | /** @} */ 44 | -------------------------------------------------------------------------------- /include/gx2/temp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup gx2_temp Temp 6 | * \ingroup gx2 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | uint32_t 15 | GX2TempGetGPUVersion(); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | /** @} */ 22 | -------------------------------------------------------------------------------- /include/gx2/tessellation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "enum.h" 5 | 6 | /** 7 | * \defgroup gx2_tessellation Tessellation 8 | * \ingroup gx2 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | void 17 | GX2SetTessellation(GX2TessellationMode tessellationMode, 18 | GX2PrimitiveMode primitiveMode, 19 | GX2IndexType indexType); 20 | 21 | void 22 | GX2SetMinTessellationLevel(float min); 23 | 24 | void 25 | GX2SetMaxTessellationLevel(float max); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | /** @} */ 32 | -------------------------------------------------------------------------------- /include/gx2/texture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "surface.h" 4 | 5 | /** 6 | * \defgroup gx2_texture Texture 7 | * \ingroup gx2 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct GX2Texture GX2Texture; 16 | 17 | struct GX2Texture 18 | { 19 | GX2Surface surface; 20 | uint32_t viewFirstMip; 21 | uint32_t viewNumMips; 22 | uint32_t viewFirstSlice; 23 | uint32_t viewNumSlices; 24 | uint32_t compMap; 25 | 26 | uint32_t regs[5]; 27 | }; 28 | WUT_CHECK_OFFSET(GX2Texture, 0x0, surface); 29 | WUT_CHECK_OFFSET(GX2Texture, 0x74, viewFirstMip); 30 | WUT_CHECK_OFFSET(GX2Texture, 0x78, viewNumMips); 31 | WUT_CHECK_OFFSET(GX2Texture, 0x7c, viewFirstSlice); 32 | WUT_CHECK_OFFSET(GX2Texture, 0x80, viewNumSlices); 33 | WUT_CHECK_OFFSET(GX2Texture, 0x84, compMap); 34 | WUT_CHECK_OFFSET(GX2Texture, 0x88, regs); 35 | WUT_CHECK_SIZE(GX2Texture, 0x9c); 36 | 37 | void 38 | GX2InitTextureRegs(GX2Texture *texture); 39 | 40 | void 41 | GX2SetPixelTexture(const GX2Texture *texture, 42 | uint32_t unit); 43 | 44 | void 45 | GX2SetVertexTexture(const GX2Texture *texture, 46 | uint32_t unit); 47 | 48 | void 49 | GX2SetGeometryTexture(const GX2Texture *texture, 50 | uint32_t unit); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | /** @} */ 57 | -------------------------------------------------------------------------------- /include/gx2/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup gx2_utils Utils 6 | * \ingroup gx2 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef enum GX2_SQ_SEL 15 | { 16 | GX2_SQ_SEL_X = 0, 17 | GX2_SQ_SEL_Y = 1, 18 | GX2_SQ_SEL_Z = 2, 19 | GX2_SQ_SEL_W = 3, 20 | 21 | GX2_SQ_SEL_R = 0, 22 | GX2_SQ_SEL_G = 1, 23 | GX2_SQ_SEL_B = 2, 24 | GX2_SQ_SEL_A = 3, 25 | 26 | GX2_SQ_SEL_0 = 4, 27 | GX2_SQ_SEL_1 = 5, 28 | GX2_SQ_SEL_MASK = 7, 29 | } GX2_SQ_SEL; 30 | 31 | #define GX2_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w)) 32 | #define GX2_COMP_MAP(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w)) 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | /** @} */ 39 | -------------------------------------------------------------------------------- /include/gx2r/displaylist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "resource.h" 4 | 5 | /** 6 | * \defgroup gx2r_displaylist Display List 7 | * \ingroup gx2r 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct GX2RBuffer GX2RBuffer; 16 | 17 | void 18 | GX2RBeginDisplayListEx(GX2RBuffer *displayList, 19 | uint32_t unknown, 20 | GX2RResourceFlags flags); 21 | 22 | uint32_t 23 | GX2REndDisplayList(GX2RBuffer *displayList); 24 | 25 | void 26 | GX2RCallDisplayList(GX2RBuffer *displayList, 27 | uint32_t size); 28 | 29 | void 30 | GX2RDirectCallDisplayList(GX2RBuffer *displayList, 31 | uint32_t size); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | /** @} */ 38 | -------------------------------------------------------------------------------- /include/gx2r/draw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "resource.h" 5 | 6 | /** 7 | * \defgroup gx2r_draw Draw 8 | * \ingroup gx2r 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef struct GX2RBuffer GX2RBuffer; 17 | 18 | void 19 | GX2RSetAttributeBuffer(GX2RBuffer *buffer, 20 | uint32_t index, 21 | uint32_t stride, 22 | uint32_t offset); 23 | 24 | void 25 | GX2RDrawIndexed(GX2PrimitiveMode mode, 26 | GX2RBuffer *buffer, 27 | GX2IndexType indexType, 28 | uint32_t count, 29 | uint32_t indexOffset, 30 | uint32_t vertexOffset, 31 | uint32_t numInstances); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | /** @} */ 38 | -------------------------------------------------------------------------------- /include/gx2r/gx2r.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup gx2r gx2r 3 | * 4 | * Contains utilities to help manage memory invalidation for gx2. 5 | */ 6 | -------------------------------------------------------------------------------- /include/gx2r/mem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "resource.h" 4 | 5 | /** 6 | * \defgroup gx2r_mem Memory 7 | * \ingroup gx2r 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef void * (*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t); 16 | typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *); 17 | 18 | void 19 | GX2RInvalidateMemory(GX2RResourceFlags flags, 20 | void *buffer, 21 | uint32_t size); 22 | 23 | BOOL 24 | GX2RIsUserMemory(GX2RResourceFlags flags); 25 | 26 | void 27 | GX2RSetAllocator(GX2RAllocFunction allocFn, 28 | GX2RFreeFunction freeFn); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | /** @} */ 35 | -------------------------------------------------------------------------------- /include/gx2r/surface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "resource.h" 4 | 5 | /** 6 | * \defgroup gx2r_surface Surface 7 | * \ingroup gx2r 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct GX2Surface GX2Surface; 16 | 17 | BOOL 18 | GX2RCreateSurface(GX2Surface *surface, 19 | GX2RResourceFlags flags); 20 | 21 | BOOL 22 | GX2RCreateSurfaceUserMemory(GX2Surface *surface, 23 | uint8_t *image, 24 | uint8_t *mipmap, 25 | GX2RResourceFlags flags); 26 | 27 | BOOL 28 | GX2RDestroySurfaceEx(GX2Surface *surface, 29 | GX2RResourceFlags flags); 30 | 31 | BOOL 32 | GX2RInvalidateSurface(GX2Surface *surface, 33 | int32_t level, 34 | GX2RResourceFlags flags); 35 | 36 | void * 37 | GX2RLockSurfaceEx(GX2Surface *surface, 38 | int32_t level, 39 | GX2RResourceFlags flags); 40 | 41 | void 42 | GX2RUnlockSurfaceEx(GX2Surface *surface, 43 | int32_t level, 44 | GX2RResourceFlags flags); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | /** @} */ 51 | -------------------------------------------------------------------------------- /include/netinet/in.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #define INADDR_ANY 0x00000000 6 | #define INADDR_LOOPBACK 0x7F000001 7 | #define INADDR_BROADCAST 0xFFFFFFFF 8 | #define INADDR_NONE 0xFFFFFFFF 9 | 10 | #define INET_ADDRSTRLEN 16 11 | 12 | #define IPPROTO_IP 0 13 | #define IPPROTO_TCP 6 14 | #define IPPROTO_UDP 17 15 | 16 | #define IP_TOS 3 17 | #define IP_TTL 4 18 | #define IP_MULTICAST_IF 9 19 | #define IP_MULTICAST_TTL 10 20 | #define IP_MULTICAST_LOOP 11 21 | #define IP_ADD_MEMBERSHIP 12 22 | #define IP_DROP_MEMBERSHIP 13 23 | #define IP_UNKNOWN 14 24 | 25 | typedef uint16_t in_port_t; 26 | typedef uint32_t in_addr_t; 27 | 28 | struct in_addr 29 | { 30 | in_addr_t s_addr; 31 | }; 32 | 33 | struct sockaddr_in 34 | { 35 | sa_family_t sin_family; 36 | in_port_t sin_port; 37 | struct in_addr sin_addr; 38 | unsigned char sin_zero[8]; 39 | }; 40 | 41 | struct ip_mreq 42 | { 43 | struct in_addr imr_multiaddr; 44 | struct in_addr imr_interface; 45 | }; 46 | -------------------------------------------------------------------------------- /include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define SOL_TCP 6 4 | 5 | #define TCP_ACKDELAYTIME 0x2001 6 | #define TCP_NOACKDELAY 0x2002 7 | #define TCP_MAXSEG 0x2003 8 | #define TCP_NODELAY 0x2004 9 | #define TCP_UNKNOWN 0x2005 // amount of mss received before sending an ack 10 | -------------------------------------------------------------------------------- /include/nfc/nfc.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nfc nfc 3 | * Near Field Communication (NFC). 4 | */ 5 | -------------------------------------------------------------------------------- /include/nn/ac.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_ac nn_ac 5 | * Auto Connect API, used for managing and connecting to internet connection 6 | * profiles. 7 | */ 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /include/nn/acp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_acp nn_acp 5 | * 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | -------------------------------------------------------------------------------- /include/nn/acp/client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void 11 | ACPInitialize(); 12 | 13 | void 14 | ACPFinalize(); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | /** @} */ 21 | -------------------------------------------------------------------------------- /include/nn/acp/device.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /** 6 | * \defgroup nn_acp_device 7 | * \ingroup nn_acp 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum ACPDeviceType { 16 | ACP_DEVICE_TYPE_AUTO = 1, 17 | ACP_DEVICE_TYPE_ODD = 2, 18 | ACP_DEVICE_TYPE_HFIODISC = 2, /* when ApplicationDevice is emulated */ 19 | ACP_DEVICE_TYPE_MLC = 3, 20 | ACP_DEVICE_TYPE_HFIOMLC = 3, /* when ApplicationDevice is emulated */ 21 | ACP_DEVICE_TYPE_USB = 4, 22 | } ACPDeviceType; 23 | 24 | ACPResult 25 | ACPCheckApplicationDeviceEmulation(BOOL* emulation); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | /** @} */ 32 | -------------------------------------------------------------------------------- /include/nn/acp/drcled_c.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef uint8_t ACPDrcLedStatus; 12 | typedef uint32_t ACPDrcLedPattern; 13 | 14 | void 15 | ACPDrcLedStartTest(); 16 | 17 | void 18 | ACPDrcLedStopTest(); 19 | 20 | void 21 | ACPGetDrcLedStat(ACPDrcLedStatus *ledStatus); 22 | 23 | void 24 | ACPGetDrcLedStatusOfPattern(ACPDrcLedStatus *ledStatus, 25 | ACPDrcLedPattern pattern); 26 | 27 | void 28 | ACPSetDrcLedDummyPowerStat(uint8_t unk1); 29 | 30 | void 31 | ACPSetDrcLedTimerLength(uint64_t unk1, 32 | uint64_t unk2); 33 | 34 | void 35 | ACPSetDrcLedTimerSpeed(uint32_t speed); 36 | 37 | void 38 | ACPTurnOffDrcLed(); 39 | 40 | void 41 | ACPTurnOffDrcLedTest(uint8_t unk1); 42 | 43 | void 44 | ACPTurnOnDrcLed(uint32_t unk1, 45 | ACPDrcLedPattern pattern); 46 | 47 | void 48 | ACPTurnOnDrcLedTest(uint8_t unk1, 49 | uint32_t unk2, 50 | ACPDrcLedPattern pattern); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | /** @} */ 57 | -------------------------------------------------------------------------------- /include/nn/acp/drcled_cpp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | 9 | namespace nn { 10 | 11 | namespace acp { 12 | 13 | typedef uint8_t DrcLedStatus; 14 | typedef uint32_t DrcLedPattern; 15 | 16 | void 17 | GetDrcLedStatusOfPattern(DrcLedStatus *ledStatus, 18 | DrcLedPattern pattern) 19 | asm("GetDrcLedStatusOfPattern__Q2_2nn3acpFPQ3_2nn3acp12DrcLedStatusQ3_2nn3acp13DrcLedPattern"); 20 | 21 | void 22 | SetDrcLedDummyPowerStat(uint8_t unk1) 23 | asm("SetDrcLedDummyPowerStat__Q2_2nn3acpFUc"); 24 | 25 | void 26 | SetDrcLedTimerLength(uint64_t unk1, 27 | uint64_t unk2) 28 | asm("SetDrcLedTimerLength__Q2_2nn3acpFULT1"); 29 | 30 | void 31 | SetDrcLedTimerSpeed(uint32_t speed) 32 | asm("SetDrcLedTimerSpeed__Q2_2nn3acpFUi"); 33 | 34 | void 35 | TurnOffDrcLed() 36 | asm("TurnOffDrcLed__Q2_2nn3acpFv"); 37 | 38 | void 39 | TurnOffDrcLedTest(uint8_t unk1) 40 | asm("TurnOffDrcLedTest__Q2_2nn3acpFUc"); 41 | 42 | void 43 | TurnOnDrcLed(uint32_t unk1, 44 | DrcLedPattern pattern) 45 | asm("TurnOnDrcLed__Q2_2nn3acpFUiQ3_2nn3acp13DrcLedPattern"); 46 | 47 | void 48 | TurnOnDrcLedTest(uint8_t unk1, 49 | uint32_t unk2, 50 | DrcLedPattern pattern) 51 | asm("TurnOnDrcLedTest__Q2_2nn3acpFUcUiQ3_2nn3acp13DrcLedPattern"); 52 | 53 | } //namespace acp 54 | 55 | } //namespace nn 56 | 57 | #endif 58 | 59 | /** @} */ 60 | -------------------------------------------------------------------------------- /include/nn/acp/nn_acp_types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /* Included for compatibility - though this header was never in a released 5 | * version of wut. It had the definition of ACPMetaXml. 6 | */ 7 | //#warning " is deprecated! Please use ." 8 | -------------------------------------------------------------------------------- /include/nn/act.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_act nn_act 5 | * Accounts API, manages user profiles and personal info. 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/ccr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_ccr nn_ccr 5 | * 6 | */ 7 | 8 | #include 9 | #include 10 | -------------------------------------------------------------------------------- /include/nn/ccr/sys_caffeine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nn_ccr_sys_caffeine 6 | * \ingroup nn_ccr 7 | * (see nn::ccr) 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct CCRAppLaunchParam CCRAppLaunchParam; 16 | 17 | struct WUT_PACKED CCRAppLaunchParam 18 | { 19 | uint64_t launchInfoDatabaseEntryId; // id used in the \link nn::sl::LaunchInfoDatabase 20 | char uuid[16]; // account uuid 21 | WUT_UNKNOWN_BYTES(0xE7); 22 | }; 23 | WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x00, launchInfoDatabaseEntryId); 24 | WUT_CHECK_OFFSET(CCRAppLaunchParam, 0x08, uuid); 25 | WUT_CHECK_SIZE(CCRAppLaunchParam, 0xFF); 26 | 27 | void 28 | CCRSysCaffeineGetAppLaunchParam(CCRAppLaunchParam * data); 29 | 30 | uint32_t 31 | CCRSysCaffeineBootCheck(); 32 | 33 | void 34 | CCRSysCaffeineBootCheckAbort(); 35 | 36 | /** 37 | * @return 0 on success, -1 on error 38 | */ 39 | int32_t 40 | CCRSysCaffeineSetDRCEnableFlag(int32_t enabled); 41 | 42 | /** 43 | * @return 0 on success, -1 on error 44 | */ 45 | int32_t 46 | CCRSysCaffeineSetEnableFlag(int32_t enabled); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | /** @} */ 53 | -------------------------------------------------------------------------------- /include/nn/cfg/CTR.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef __cplusplus 6 | 7 | namespace nn { 8 | 9 | namespace cfg { 10 | 11 | namespace CTR { 12 | 13 | //! Represents a console username, used in UDS and DLP 14 | struct UserName { 15 | char16_t name[12]; 16 | }; 17 | WUT_CHECK_SIZE(UserName, 0x18); 18 | 19 | } // namespace CTR 20 | 21 | } // namespace cfg 22 | 23 | } // namespace nn 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/nn/cmpt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_cmpt nn_cmpt 5 | * Wii backwards compatibility (vWii) 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/cmpt/cmpt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nn_cmpt 6 | * \ingroup nn_cmpt 7 | * Wii backwards compatibility (vWii) 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum CmptScreenType { 16 | CMPT_SCREEN_TYPE_TV = 1, 17 | CMPT_SCREEN_TYPE_DRC, 18 | CMPT_SCREEN_TYPE_BOTH, 19 | } CmptScreenType; 20 | 21 | /** 22 | * Gets the required size which needs to be allocated for the "dataBuffer". 23 | * The allocated buffer needs to be aligned by 0x40. 24 | * 25 | * \return 26 | * 0 on success. 27 | */ 28 | int32_t 29 | CMPTGetDataSize(uint32_t* outSize); 30 | 31 | /** 32 | * Launches the specified vWii title. 33 | * 34 | * \return 35 | * 0 on success. 36 | */ 37 | int32_t 38 | CMPTLaunchTitle(void* dataBuffer, uint32_t bufferSize, uint64_t titleId); 39 | 40 | /** 41 | * Launches vWii System Menu. 42 | * 43 | * \return 44 | * 0 on success. 45 | */ 46 | int32_t 47 | CMPTLaunchMenu(void* dataBuffer, uint32_t bufferSize); 48 | 49 | /** 50 | * Launches vWii Data Management. 51 | * 52 | * \return 53 | * 0 on success. 54 | */ 55 | int32_t 56 | CMPTLaunchDataManager(void* dataBuffer, uint32_t bufferSize); 57 | 58 | /** 59 | * Sets the screen type. 60 | * 61 | * \return 62 | * 0 on success. 63 | */ 64 | int32_t 65 | CMPTAcctSetScreenType(CmptScreenType type); 66 | 67 | /** 68 | * Checks if the current screen configuration is valid. 69 | * 70 | * \return 71 | * 0 on success. 72 | */ 73 | int32_t 74 | CMPTCheckScreenState(void); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | /** @} */ 81 | -------------------------------------------------------------------------------- /include/nn/dlp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_dlp nn_dlp 5 | * Download Play functions 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/erreula.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_erreula nn_erreula 5 | * Graphical error viewer, supporting several languages and configurations. 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/fp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_fp nn_fp 5 | * Friend Presence API 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/hpad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_hpad nn_hpad 5 | * Library for using the USB Gamecube Controller Adapter (HID Pad?). 6 | */ 7 | 8 | #include 9 | #include 10 | -------------------------------------------------------------------------------- /include/nn/hpad/beta.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /** 6 | * \defgroup nn_hpad_beta 7 | * \ingroup nn_hpad 8 | * Beta functions for HPAD. 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | * Prints internal state info to the COS shell. 18 | */ 19 | void 20 | BETA_DEBUG_DUMP(void); 21 | 22 | /** 23 | * Gets the command queue size of the specified adapter. 24 | * 25 | * \param chan 26 | * The channel to get the size of. 27 | * 28 | * \return 29 | * The command queue size. 30 | */ 31 | int32_t 32 | BETA_DEBUG_GET_QUEUE_SIZE(HPADGGGGChan chan); 33 | 34 | 35 | /** 36 | * Sends a report to the specified adapter. 37 | * 38 | * \param chan 39 | * The channel to send the report to. 40 | * 41 | * \param reptId 42 | * The ID of the report to send. 43 | */ 44 | void 45 | BETA_DEBUG_SEND_REPT_ID(HPADGGGGChan chan, 46 | uint32_t reptId); 47 | 48 | /** 49 | * Returns immediately. 50 | */ 51 | void 52 | BETA_DEBUG_GET_RAW_DATA(void); 53 | 54 | /** 55 | * Returns immediately. 56 | */ 57 | void 58 | BETA_DEBUG_SET_DUMP_MODE(void); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | /** @} */ 65 | -------------------------------------------------------------------------------- /include/nn/idb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_idb nn_idb 5 | */ 6 | 7 | #include 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/nets2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_nets2 nn_nets2 5 | * Network functions 2. 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/nfp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_nfp nn_nfp 5 | * Nintendo Figurine (amiibo) Platform library. 6 | */ 7 | 8 | #include 9 | #include 10 | -------------------------------------------------------------------------------- /include/nn/nn.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nn nn 3 | * Helper functions and classes for other APIs 4 | */ 5 | -------------------------------------------------------------------------------- /include/nn/pdm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_pdm nn_pdm 5 | * Log Activities for Titles 6 | */ 7 | 8 | #include 9 | #include 10 | -------------------------------------------------------------------------------- /include/nn/pdm/pdm_c.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nn_pdm_c 6 | * \ingroup nn_pdm 7 | * C functions for PDM 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /** 16 | * Initializes PDM. 17 | * Needs to be called before using other functions. 18 | * 19 | * \return 20 | * 0 on success. 21 | */ 22 | uint32_t 23 | PDMInitialize(); 24 | 25 | /** 26 | * Finalize PDM. 27 | */ 28 | void 29 | PDMFinalize(); 30 | 31 | /** 32 | * Close all opened PDM Files. 33 | */ 34 | void 35 | PDMCloseAllFiles(); 36 | 37 | void 38 | PDMNotifySetTimeBeginEvent(); 39 | 40 | void 41 | PDMNotifySetTimeEndEvent(); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | /** @} */ 48 | -------------------------------------------------------------------------------- /include/nn/save.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_save nn_save 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /include/nn/sl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_sl nn_sl 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | -------------------------------------------------------------------------------- /include/nn/sl/IAccountInfoAccessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | 9 | namespace nn::sl { 10 | class IAccountInfoAccessor : public details::IAccountInfoAccessorBase { 11 | 12 | public: 13 | IAccountInfoAccessor() { 14 | InitInternalVtable(); 15 | } 16 | 17 | IAccountInfoAccessor(IAccountInfoAccessor &src) { 18 | InitInternalVtable(); 19 | } 20 | 21 | IAccountInfoAccessor &operator=(const IAccountInfoAccessor &other) { 22 | InitInternalVtable(); 23 | return *this; 24 | } 25 | 26 | IAccountInfoAccessor &operator=(IAccountInfoAccessor &&src) noexcept { 27 | InitInternalVtable(); 28 | return *this; 29 | } 30 | 31 | ~IAccountInfoAccessor() override = default; 32 | 33 | private: 34 | static nn::Result GetWrapper(details::IAccountInfoAccessorInternal *instance, AccountInfo *outAccountInfo) { 35 | return instance->vtable->instance->Get(outAccountInfo); 36 | } 37 | 38 | details::IAccountInfoAccessorInternal *GetInternal() override { 39 | return &mInstance; 40 | } 41 | 42 | void InitInternalVtable() { 43 | mVTable = {.instance = this, 44 | .GetFn = &GetWrapper}; 45 | mInstance.vtable = &mVTable; 46 | } 47 | 48 | details::IAccountInfoAccessorInternal mInstance{}; 49 | details::IAccountInfoAccessorInternalVTable mVTable{}; 50 | }; 51 | 52 | details::IAccountInfoAccessorBase &GetDefaultAccountInfoAccessor(); 53 | } // namespace nn::sl 54 | 55 | #endif -------------------------------------------------------------------------------- /include/nn/sl/ISettingAccessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __cplusplus 9 | 10 | namespace nn::sl { 11 | class ISettingAccessor : public details::ISettingAccessorBase { 12 | 13 | public: 14 | ISettingAccessor() { 15 | InitInternalVtable(); 16 | } 17 | 18 | ISettingAccessor(ISettingAccessor &src) { 19 | InitInternalVtable(); 20 | } 21 | 22 | ISettingAccessor &operator=(const ISettingAccessor &other) { 23 | InitInternalVtable(); 24 | return *this; 25 | } 26 | 27 | ISettingAccessor &operator=(ISettingAccessor &&src) noexcept { 28 | InitInternalVtable(); 29 | return *this; 30 | } 31 | 32 | ~ISettingAccessor() override = default; 33 | 34 | private: 35 | static nn::Result GetWrapper(details::ISettingAccessorInternal *instance, Setting *outSetting) { 36 | return instance->vtable->instance->Get(outSetting); 37 | } 38 | 39 | details::ISettingAccessorInternal *GetInternal() override { 40 | return &mInstance; 41 | } 42 | 43 | void InitInternalVtable() { 44 | mVTable = {.instance = this, 45 | .GetFn = &GetWrapper}; 46 | mInstance.vtable = &mVTable; 47 | } 48 | 49 | details::ISettingAccessorInternal mInstance{}; 50 | details::ISettingAccessorInternalVTable mVTable{}; 51 | }; 52 | 53 | details::ISettingAccessorBase &GetDefaultSettingAccessor(); 54 | } // namespace nn::sl 55 | 56 | #endif -------------------------------------------------------------------------------- /include/nn/spm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_spm nn_spm 5 | * Functions for extended storage 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/swkbd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_swkbd nn_swkbd 5 | * Graphical software keyboard, supporting several languages and configurations. 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/temp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_temp nn_temp 5 | */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /include/nn/uds.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup nn_uds nn_uds 5 | * UDS Network functions 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/nn/uds/NodeInformation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __cplusplus 9 | 10 | namespace nn { 11 | 12 | namespace uds { 13 | 14 | namespace Cafe { 15 | //! Stores information about a node 16 | struct WUT_PACKED NodeInformation { 17 | //! The scrambled local friend code of the node 18 | ScrambledLocalFriendCode scrambledLocalFriendCode; 19 | //! The node username 20 | nn::cfg::CTR::UserName username; 21 | //! The network node ID 22 | uint16_t networkNodeId; 23 | //! Unknown 24 | WUT_UNKNOWN_BYTES(0x2); 25 | }; 26 | WUT_CHECK_SIZE(NodeInformation, 0x28); 27 | WUT_CHECK_OFFSET(NodeInformation, 0x00, scrambledLocalFriendCode); 28 | WUT_CHECK_OFFSET(NodeInformation, 0x0C, username); 29 | WUT_CHECK_OFFSET(NodeInformation, 0x24, networkNodeId); 30 | } // namespace Cafe 31 | 32 | } // namespace uds 33 | 34 | } // namespace nn 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/nn/uds/ScrambledLocalFriendCode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | 8 | namespace nn { 9 | 10 | namespace uds { 11 | 12 | namespace Cafe { 13 | //! Stores data about the scrambled local friend code of a node 14 | struct WUT_PACKED ScrambledLocalFriendCode { 15 | //! The scrambled local friend code. On the Wii U this is always descrambled 16 | uint64_t localFriendCode; 17 | //! The node ID that the local friend code belongs to 18 | uint16_t networkNodeId; 19 | //! The XOR key used for descrambling the local friend code 20 | uint16_t xorKey; 21 | }; 22 | WUT_CHECK_SIZE(ScrambledLocalFriendCode, 0x0C); 23 | WUT_CHECK_OFFSET(ScrambledLocalFriendCode, 0x00, localFriendCode); 24 | WUT_CHECK_OFFSET(ScrambledLocalFriendCode, 0x08, networkNodeId); 25 | WUT_CHECK_OFFSET(ScrambledLocalFriendCode, 0x0A, xorKey); 26 | } // namespace Cafe 27 | 28 | } // namespace uds 29 | 30 | } // namespace nn 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/nsysccr/ccr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nsysccr_ccr 6 | * \ingroup nsysccr 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | int32_t 16 | CCRSetCompatMode(uint32_t compatMode); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | /** @} */ 23 | -------------------------------------------------------------------------------- /include/nsysccr/cfg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nsysccr_cfg 6 | * \ingroup nsysccr 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | int32_t 16 | CCRCFGInit(void); 17 | 18 | /** 19 | * Read from the cached Eeprom of the specified device. 20 | * 21 | * \param drcSlot 22 | * The DRC to read the eeprom from (0 or 1). 23 | * 24 | * \param offset 25 | * Offset of the Eeprom data. 26 | * 27 | * \return 28 | * 0 on success. 29 | */ 30 | int32_t 31 | CCRCFGGetCachedEeprom(uint32_t drcSlot, 32 | uint32_t offset, 33 | void *buf, 34 | uint32_t size); 35 | 36 | /** 37 | * Write to the cached Eeprom of the specified device. 38 | * 39 | * \param drcSlot 40 | * The DRC to read the eeprom from (0 or 1). 41 | * 42 | * \param offset 43 | * Offset of the Eeprom data. 44 | * 45 | * \return 46 | * 0 on success. 47 | */ 48 | int32_t 49 | CCRCFGSetCachedEeprom(uint32_t drcSlot, 50 | uint32_t offset, 51 | void *buf, 52 | uint32_t size); 53 | 54 | /** 55 | * Get the version check flag. 56 | * 57 | * \param outFlag 58 | * Pointer to write the flag to. 59 | * 60 | * \return 61 | * 0 on success. 62 | */ 63 | int32_t 64 | CCRCFGGetVersionCheckFlag(uint32_t *outFlag); 65 | 66 | /** 67 | * Set the version check flag. 68 | * 69 | * \param outFlag 70 | * The flag to set. 71 | * 72 | * \return 73 | * 0 on success. 74 | */ 75 | int32_t 76 | CCRCFGSetVersionCheckFlag(uint32_t flag); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | /** @} */ 83 | -------------------------------------------------------------------------------- /include/nsysccr/nsysccr.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nsysccr nsysccr 3 | * 4 | * 5 | */ 6 | -------------------------------------------------------------------------------- /include/nsyshid/nsyshid.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nsyshid nsyshid 3 | * 4 | * Human Input Device functions. 5 | */ 6 | -------------------------------------------------------------------------------- /include/nsysnet/_netdb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /** 6 | * \defgroup nsysnet_netdb Netdb 7 | * \ingroup nsysnet 8 | * @{ 9 | */ 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct hostent * 15 | RPLWRAP(gethostbyaddr)(const void *addr, 16 | size_t len, 17 | int type); 18 | 19 | struct hostent * 20 | RPLWRAP(gethostbyname)(const char *name); 21 | 22 | int 23 | RPLWRAP(getaddrinfo)(const char *node, 24 | const char *service, 25 | const struct addrinfo *hints, 26 | struct addrinfo **res); 27 | 28 | void 29 | RPLWRAP(freeaddrinfo)(struct addrinfo *res); 30 | 31 | int 32 | RPLWRAP(getnameinfo)(const struct sockaddr *addr, 33 | socklen_t addrlen, 34 | char *host, 35 | socklen_t hostlen, 36 | char *serv, 37 | socklen_t servlen, 38 | int flags); 39 | 40 | void 41 | RPLWRAP(clear_resolver_cache)(void); 42 | 43 | int 44 | RPLWRAP(set_resolver_allocator)(void* (*alloc)(uint32_t), 45 | void (*free)(void*)); 46 | 47 | int * 48 | RPLWRAP(get_h_errno)(void); 49 | 50 | const char * 51 | RPLWRAP(gai_strerror)(int ecode); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | /** @} */ 58 | -------------------------------------------------------------------------------- /include/nsysnet/misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup nsysnet_misc 6 | * \ingroup nsysnet 7 | * @{ 8 | */ 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | int 14 | set_multicast_state(BOOL multicastEnable); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | /** @} */ 21 | -------------------------------------------------------------------------------- /include/nsysnet/nsysnet.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nsysnet nsysnet 3 | * 4 | * Network functions. 5 | */ 6 | -------------------------------------------------------------------------------- /include/nsysnet/socket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #warning "nsysnet/socket.h is deprecated; please use standard socket headers instead." 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define NSN_EAGAIN EAGAIN 19 | #define NSN_EWOULDBLOCK EWOULDBLOCK 20 | 21 | __attribute__ ((deprecated)) 22 | static inline int 23 | socketclose(int sockfd) 24 | { 25 | return close(sockfd); 26 | } 27 | 28 | __attribute__ ((deprecated)) 29 | static inline int 30 | socketlasterr() 31 | { 32 | return errno; 33 | } 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /include/nsysuhs/nsysuhs.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup nsysuhs nsysuhs 3 | * 4 | */ 5 | -------------------------------------------------------------------------------- /include/ntag/ntag.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup ntag ntag 3 | * Nintendo? Tag (NTAG). 4 | * NFC library for Amiibo and Pokemon Rumble U. 5 | */ 6 | -------------------------------------------------------------------------------- /include/padscore/padscore.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup padscore padscore 3 | * 4 | * Input library for Wii controllers. 5 | */ 6 | -------------------------------------------------------------------------------- /include/poll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define POLLIN 0x01 4 | #define POLLPRI 0x02 5 | #define POLLOUT 0x04 6 | #define POLLERR 0x08 7 | #define POLLHUP 0x10 8 | #define POLLNVAL 0x20 9 | 10 | typedef unsigned long nfds_t; 11 | 12 | struct pollfd 13 | { 14 | int fd; 15 | int events; 16 | int revents; 17 | }; 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | int 24 | poll(struct pollfd *fds, 25 | nfds_t nfds, 26 | int timeout); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /include/proc_ui/procui.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup proc_ui proc_ui 3 | * 4 | * Process management library used for managing transitions between foreground 5 | * and background applications. 6 | */ 7 | -------------------------------------------------------------------------------- /include/sndcore2/result.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup sndcore2_result Result 6 | * \ingroup sndcore2 7 | * 8 | * @{ 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | //! A value from enum AX_RESULT. 16 | typedef int32_t AXResult; 17 | 18 | enum AX_RESULT 19 | { 20 | AX_RESULT_SUCCESS = 0, 21 | AX_RESULT_INVALID_DEVICE_TYPE = -1, 22 | AX_RESULT_INVALID_DRC_VS_MODE = -13, 23 | AX_RESULT_VOICE_IS_RUNNING = -18, 24 | AX_RESULT_DELAY_TOO_BIG = -19, 25 | }; 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | /** @} */ 32 | -------------------------------------------------------------------------------- /include/sndcore2/sndcore2.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup sndcore2 sndcore2 3 | * 4 | * Sound playback and utility library. 5 | */ 6 | -------------------------------------------------------------------------------- /include/swkbd/swkbd.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup swkbd swkbd 3 | * 4 | * C++ linkage for the software keyboard, see \link nn::swkbd \endlink for 5 | * general use. 6 | */ 7 | -------------------------------------------------------------------------------- /include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define FIONBIO (0x8004667E) 4 | #define FIONREAD (0x4004667F) 5 | #define FIONWRITE (0x40046677) 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | int ioctl(int fd, 12 | int request, 13 | ...); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /include/sys/select.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define FD_SETSIZE 32 4 | 5 | #include_next 6 | -------------------------------------------------------------------------------- /include/sysapp/sysapp.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup sysapp sysapp 3 | * 4 | * Functions to switch applications, launch overlay apps and perform other 5 | * multitasking functions. 6 | */ 7 | -------------------------------------------------------------------------------- /include/tve/tve.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup tve tve 3 | * 4 | * TV Encoder 5 | */ 6 | -------------------------------------------------------------------------------- /include/vpad/vpad.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup vpad vpad 3 | * 4 | * Input library for the Wii U Gamepad (Display Remote Controller). 5 | */ 6 | -------------------------------------------------------------------------------- /include/vpadbase/vpadbase.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \defgroup vpadbase vpadbase 3 | * 4 | * Wii U Gamepad base library. 5 | */ 6 | -------------------------------------------------------------------------------- /include/wut.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * wut 1.0.0-beta 5 | * 6 | * https://github.com/devkitPro/wut 7 | */ 8 | 9 | #if defined(__GNUC__) || defined(__clang__) 10 | 11 | #define WUT_DEPRECATED(reason) __attribute__((__deprecated__(reason))) 12 | #define WUT_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args))) 13 | 14 | #else // not __GNUC__ and not __clang__ 15 | 16 | #define WUT_DEPRECATED(reason) 17 | #define WUT_FORMAT_PRINTF(fmt, args) 18 | 19 | #endif //__GNUC__ or __clang__ 20 | 21 | #ifdef DEBUG 22 | #define WUT_DEBUG_REPORT(fmt, ...) OSReport(fmt, ##__VA_ARGS__) 23 | #else 24 | #define WUT_DEBUG_REPORT(fmt, ...) 25 | #endif 26 | 27 | #include "wut_structsize.h" 28 | #include "wut_types.h" 29 | #include "wut_rplwrap.h" 30 | #ifdef DEBUG 31 | #include 32 | #endif 33 | -------------------------------------------------------------------------------- /include/wut_rplwrap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define RPLWRAP(func) __rplwrap_##func 4 | -------------------------------------------------------------------------------- /include/wut_structsize.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | // Ensure structs are correct size & offsets 6 | #if defined(static_assert) || defined(__cplusplus) 7 | # define WUT_CHECK_SIZE(Type, Size) \ 8 | static_assert(sizeof(Type) == Size, \ 9 | #Type " must be " #Size " bytes") 10 | 11 | # define WUT_CHECK_OFFSET(Type, Offset, Field) \ 12 | static_assert(offsetof(Type, Field) == Offset, \ 13 | #Type "::" #Field " must be at offset " #Offset) 14 | #else 15 | # define WUT_CHECK_SIZE(Type, Size) 16 | # define WUT_CHECK_OFFSET(Type, Offset, Field) 17 | #endif 18 | 19 | // Workaround weird macro concat ## behaviour 20 | #define WUT_PP_CAT(a, b) WUT_PP_CAT_I(a, b) 21 | #define WUT_PP_CAT_I(a, b) WUT_PP_CAT_II(~, a ## b) 22 | #define WUT_PP_CAT_II(p, res) res 23 | 24 | // Allow us to easily add UNKNOWN / PADDING bytes into our structs, 25 | // generates unique variable names using __COUNTER__ 26 | #define WUT_UNKNOWN_BYTES(Size) char WUT_PP_CAT(__unk, __COUNTER__) [Size] 27 | #define WUT_PADDING_BYTES(Size) WUT_UNKNOWN_BYTES(Size) 28 | 29 | // Unknown struct size 30 | #define WUT_UNKNOWN_SIZE(x) 31 | 32 | // Marks a struct as packed 33 | #define WUT_PACKED __attribute__((__packed__)) 34 | 35 | // Sets alignment for a struct 36 | #if defined(__alignas_is_defined) || defined(__cplusplus) 37 | #define WUT_ALIGNAS(x) alignas(x) 38 | #elif defined(__GNUC__) || defined(__clang__) 39 | #define WUT_ALIGNAS(x) __attribute__((__aligned__(x))) 40 | #endif 41 | -------------------------------------------------------------------------------- /libraries/libirc/include/irc/cdc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup irc_cdc 6 | * \ingroup irc 7 | * Low-Level InfraRed Connection 8 | * 9 | * @{ 10 | */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | int32_t 17 | __CCRCDCIRCConnect(int32_t drcIndex, 18 | uint8_t *result, 19 | uint16_t timeout, 20 | CCRCDCIrdaBitrate bitrate, 21 | uint32_t receiveSize, 22 | uint8_t targetId, 23 | CCRCDCIrdaConnectionType type); 24 | 25 | int32_t 26 | __CCRCDCIRCSend(int32_t drcIndex, 27 | uint8_t *result, 28 | uint32_t size, 29 | uint32_t receiveSize, 30 | void *data); 31 | 32 | int32_t 33 | __CCRCDCIRCReceive(int32_t drcIndex, 34 | uint8_t *result, 35 | uint16_t *receivedSize, 36 | void *data); 37 | 38 | int32_t 39 | __CCRCDCIRCDisconnect(int32_t drcIndex, 40 | uint8_t *result); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | /** @} */ 47 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/align.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_align Align 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define WHBAlignUp(val, align) ((val + align - 1) & ~(align - 1)) 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | /** @} */ 21 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/crash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_crash Crash Handler 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | BOOL 15 | WHBInitCrashHandler(); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | /** @} */ 22 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/file.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_file Filesystem 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef enum WHBFileError 15 | { 16 | WHB_FILE_OK = 0, 17 | WHB_FILE_FATAL_ERROR = -1, 18 | } WHBFileError; 19 | 20 | BOOL 21 | WHBDeInitFileSystem(); 22 | 23 | int32_t 24 | WHBOpenFile(const char *path, 25 | const char *mode); 26 | 27 | uint32_t 28 | WHBGetFileSize(int32_t handle); 29 | 30 | uint32_t 31 | WHBReadFile(int32_t handle, 32 | void *buf, 33 | uint32_t size, 34 | uint32_t count); 35 | 36 | int32_t 37 | WHBCloseFile(int32_t handle); 38 | 39 | char * 40 | WHBReadWholeFile(const char *path, 41 | uint32_t *outSize); 42 | 43 | void 44 | WHBFreeWholeFile(char *file); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | /** @} */ 51 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/libmanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * \defgroup whb_socketinit Socket Library Initialization Manager 5 | * \ingroup whb 6 | * @{ 7 | */ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** 14 | * Socket Library (nsysnet.rpl) 15 | */ 16 | 17 | __attribute__ ((deprecated)) void 18 | WHBInitializeSocketLibrary(); 19 | 20 | __attribute__ ((deprecated)) void 21 | WHBDeinitializeSocketLibrary(); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | /** @} */ 28 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_log Logger 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef void (*LogHandlerFn)(const char *msg); 15 | 16 | BOOL 17 | WHBAddLogHandler(LogHandlerFn fn); 18 | 19 | BOOL 20 | WHBRemoveLogHandler(LogHandlerFn fn); 21 | 22 | BOOL 23 | WHBLogWrite(const char *str); 24 | 25 | BOOL 26 | WHBLogPrint(const char *str); 27 | 28 | BOOL 29 | WHBLogWritef(const char *fmt, ...) 30 | WUT_FORMAT_PRINTF(1, 2); 31 | 32 | BOOL 33 | WHBLogPrintf(const char *fmt, ...) 34 | WUT_FORMAT_PRINTF(1, 2); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | /** @} */ 41 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/log_cafe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_log_cafe Cafe OS System Log Output 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | BOOL 15 | WHBLogCafeInit(); 16 | 17 | BOOL 18 | WHBLogCafeDeinit(); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | /** @} */ 25 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/log_console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_log_console On screen console log output 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define WHB_SERVER_BUFFER_SIZE 1024 15 | 16 | BOOL 17 | WHBLogConsoleInit(); 18 | 19 | void 20 | WHBLogConsoleFree(); 21 | 22 | void 23 | WHBLogConsoleSetColor(uint32_t color); 24 | 25 | void 26 | WHBLogConsoleDraw(); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | /** @} */ 33 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/log_module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_log_module Log using the LoggingModule. 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | BOOL 15 | WHBLogModuleInit(); 16 | 17 | BOOL 18 | WHBLogModuleDeinit(); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | /** @} */ 25 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/log_udp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_log_udp UDP Log Output 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | BOOL 15 | WHBLogUdpInit(); 16 | 17 | BOOL 18 | WHBLogUdpDeinit(); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | /** @} */ 25 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/proc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_proc ProcUI Utilities 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void 15 | WHBProcInit(); 16 | 17 | void 18 | WHBProcShutdown(); 19 | 20 | void 21 | WHBProcStopRunning(); 22 | 23 | BOOL 24 | WHBProcIsRunning(); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | /** @} */ 31 | -------------------------------------------------------------------------------- /libraries/libwhb/include/whb/sdcard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /** 5 | * \defgroup whb_sdcard SDCard Access 6 | * \ingroup whb 7 | * @{ 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | BOOL 15 | WHBMountSdCard(); 16 | 17 | char * 18 | WHBGetSdCardMountPath(); 19 | 20 | BOOL 21 | WHBUnmountSdCard(); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | /** @} */ 28 | -------------------------------------------------------------------------------- /libraries/libwhb/src/gfx_heap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | BOOL 5 | GfxHeapInitMEM1(); 6 | 7 | BOOL 8 | GfxHeapDestroyMEM1(); 9 | 10 | BOOL 11 | GfxHeapInitForeground(); 12 | 13 | BOOL 14 | GfxHeapDestroyForeground(); 15 | 16 | void * 17 | GfxHeapAllocMEM1(uint32_t size, 18 | uint32_t alignment); 19 | 20 | void 21 | GfxHeapFreeMEM1(void *block); 22 | 23 | void * 24 | GfxHeapAllocForeground(uint32_t size, 25 | uint32_t alignment); 26 | 27 | void 28 | GfxHeapFreeForeground(void *block); 29 | 30 | void * 31 | GfxHeapAllocMEM2(uint32_t size, 32 | uint32_t alignment); 33 | 34 | void 35 | GfxHeapFreeMEM2(void *block); 36 | -------------------------------------------------------------------------------- /libraries/libwhb/src/gfx_texture.c: -------------------------------------------------------------------------------- 1 | #include "gfx_heap.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | GX2Texture * 9 | WHBGfxLoadGFDTexture(uint32_t index, 10 | const void *file) 11 | { 12 | uint32_t headerSize, imageSize; 13 | GX2Texture *texture = NULL; 14 | 15 | if (index >= GFDGetTextureCount(file)) { 16 | WHBLogPrintf("%s: invalid GFD texture index %u", __FUNCTION__, index); 17 | goto error; 18 | } 19 | 20 | headerSize = GFDGetTextureHeaderSize(index, file); 21 | imageSize = GFDGetTextureImageSize(index, file); 22 | 23 | if (!headerSize || !imageSize) { 24 | goto error; 25 | } 26 | 27 | texture = (GX2Texture *)GfxHeapAllocMEM2(headerSize, 64); 28 | if (!texture) { 29 | WHBLogPrintf("%s: GfxHeapAllocMEM2(0x%X, 64) failed", __FUNCTION__, 30 | headerSize); 31 | goto error; 32 | } 33 | 34 | if (!GFDGetGX2RTexture(texture, index, file)) { 35 | goto error; 36 | } 37 | 38 | return texture; 39 | 40 | error: 41 | if (texture) { 42 | GX2RDestroySurfaceEx(&texture->surface, 0); 43 | GfxHeapFreeMEM2(texture); 44 | } 45 | 46 | return NULL; 47 | } 48 | 49 | BOOL 50 | WHBGfxFreeTexture(GX2Texture *texture) 51 | { 52 | GX2RDestroySurfaceEx(&texture->surface, 0); 53 | GfxHeapFreeMEM2(texture); 54 | return TRUE; 55 | } 56 | -------------------------------------------------------------------------------- /libraries/libwhb/src/libmanager.c: -------------------------------------------------------------------------------- 1 | void 2 | WHBInitializeSocketLibrary() 3 | { 4 | } 5 | 6 | void 7 | WHBDeinitializeSocketLibrary() 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /libraries/libwhb/src/log_cafe.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | static void 7 | cafeLogHandler(const char * msg) 8 | { 9 | int length = strlen(msg); 10 | 11 | if(msg[length-1] != '\n') { 12 | OSReport("%s\n", msg); 13 | } 14 | else { 15 | OSReport(msg); 16 | } 17 | } 18 | 19 | BOOL 20 | WHBLogCafeInit() 21 | { 22 | return WHBAddLogHandler(cafeLogHandler); 23 | } 24 | 25 | BOOL 26 | WHBLogCafeDeinit() 27 | { 28 | return WHBRemoveLogHandler(cafeLogHandler); 29 | } 30 | -------------------------------------------------------------------------------- /libraries/libwhb/src/log_module.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static OSDynLoad_Module sModuleHandle = NULL; 7 | static void (*sWUMSLogWrite)(const char *, size_t) = NULL; 8 | 9 | static void 10 | moduleLogHandler(const char *msg) 11 | { 12 | if(sWUMSLogWrite != NULL) { 13 | sWUMSLogWrite(msg, strlen(msg)); 14 | } 15 | } 16 | 17 | BOOL 18 | WHBLogModuleInit() 19 | { 20 | if (OSDynLoad_Acquire("homebrew_logging", &sModuleHandle) != OS_DYNLOAD_OK) { 21 | OSReport("WHBLogModuleInit: OSDynLoad_Acquire failed.\n"); 22 | return false; 23 | } 24 | 25 | if (OSDynLoad_FindExport(sModuleHandle, FALSE, "WUMSLogWrite", (void**) &sWUMSLogWrite) != OS_DYNLOAD_OK) { 26 | OSReport("WHBLogModuleInit: OSDynLoad_FindExport failed.\n"); 27 | return false; 28 | } 29 | 30 | return WHBAddLogHandler(moduleLogHandler); 31 | } 32 | 33 | BOOL 34 | WHBLogModuleDeinit() 35 | { 36 | return WHBRemoveLogHandler(moduleLogHandler); 37 | } -------------------------------------------------------------------------------- /libraries/libwhb/src/log_udp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static int 13 | sSocket = -1; 14 | 15 | static struct sockaddr_in 16 | sSendAddr; 17 | 18 | #define SERVER_PORT 4405 19 | 20 | static void 21 | udpLogHandler(const char *msg) 22 | { 23 | sendto(sSocket, 24 | msg, 25 | strlen(msg), 26 | 0, 27 | (struct sockaddr *)&sSendAddr, 28 | sizeof(struct sockaddr_in)); 29 | } 30 | 31 | BOOL 32 | WHBLogUdpInit() 33 | { 34 | int broadcastEnable = 1; 35 | 36 | sSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); 37 | if (sSocket < 0) { 38 | return FALSE; 39 | } 40 | 41 | setsockopt(sSocket, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable)); 42 | 43 | memset(&sSendAddr, 0, sizeof(struct sockaddr_in)); 44 | sSendAddr.sin_family = AF_INET; 45 | sSendAddr.sin_port = htons(SERVER_PORT); 46 | sSendAddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); 47 | 48 | return WHBAddLogHandler(udpLogHandler); 49 | } 50 | 51 | BOOL 52 | WHBLogUdpDeinit() 53 | { 54 | shutdown(sSocket, SHUT_WR); 55 | close(sSocket); 56 | sSocket = -1; 57 | 58 | return WHBRemoveLogHandler(udpLogHandler); 59 | } 60 | -------------------------------------------------------------------------------- /libraries/nn_idb/include/nn/idb/IDBReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace nn::idb { 11 | class IDBReader { 12 | public: 13 | IDBReader() = default; 14 | 15 | ~IDBReader(); 16 | 17 | nn::Result LoadIconDataFromIdb(uint64_t titleId, nn::idb::IconDataRaw &iconData) const; 18 | 19 | bool SearchFromDataBase(nn::idb::IconDataKey &key, uint32_t &outIndex) const; 20 | 21 | bool LoadIconDataFromDatabase(uint32_t index, nn::idb::IconDataRaw &iconData) const; 22 | 23 | bool LoadIconData(uint64_t titleId, uint32_t u1, nn::idb::IconDataRaw &iconData) const; 24 | 25 | /** 26 | * Initializes the IDBReader from a custom path 27 | * @param path Path to "BaristaIconDataBase.dat" 28 | * @return true on success, false on error 29 | */ 30 | bool Initialize(const std::string &path); 31 | 32 | /** 33 | * Initializes the IDBReader to read icons from the Wii U Menu icon cache 34 | * (fs:/vol/storage_mlc01/usr/save/%08X/%08X/user/common/BaristaIconDataBase.dat) 35 | * @return true on success, false on error 36 | */ 37 | bool Initialize(); 38 | 39 | void Finalize(); 40 | 41 | private: 42 | bool InitializeFile(); 43 | 44 | void FinalizeFile(); 45 | 46 | int LoadFromFile(void *buffer, uint32_t size, uint32_t offset) const; 47 | 48 | std::string mPath = {}; 49 | FileHeader *mFileHeader = {}; 50 | FILE *mFile = {}; 51 | bool mInitDone = false; 52 | }; 53 | } // namespace nn::idb 54 | 55 | #endif -------------------------------------------------------------------------------- /libraries/nn_sl/IAccountInfoAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IAccountInfoAccessorInternal *GetDefaultAccountInfoAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::AccountInfoAccessorFromPtr gAccountInfoAccessor(GetDefaultAccountInfoAccessor__Q2_2nn2slFv()); 9 | 10 | details::IAccountInfoAccessorBase &GetDefaultAccountInfoAccessor() { 11 | return gAccountInfoAccessor; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IBlackListAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IBlackListAccessorInternal *GetDefaultBlackListAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::BlackListAccessorFromPtr sDefaultIconInfoAccessor(GetDefaultBlackListAccessor__Q2_2nn2slFv()); 9 | 10 | details::IBlackListAccessorBase &GetDefaultBlackListAccessor() { 11 | return sDefaultIconInfoAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IDefaultTitleAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IDefaultTitleAccessorInternal *GetDefaultDefaultTitleAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::DefaultTitleAccessorFromPtr sDefaultDefaultTitleAccessor(GetDefaultDefaultTitleAccessor__Q2_2nn2slFv()); 9 | 10 | details::IDefaultTitleAccessorBase &GetDefaultDefaultTitleAccessor() { 11 | return sDefaultDefaultTitleAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IDiscCachedTitleAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IDiscCachedTitleAccessorInternal *GetDefaultDiscCachedTitleAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::DiscCachedTitleAccessorFromPtr sDefaultDiscCachedTitleListAccessor(GetDefaultDiscCachedTitleAccessor__Q2_2nn2slFv()); 9 | 10 | details::IDiscCachedTitleAccessorBase &GetDefaultDiscCachedTitleAccessor() { 11 | return sDefaultDiscCachedTitleListAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IIconInfoAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IIconInfoAccessorInternal *GetDefaultIconInfoAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::IconInfoAccessorFromPtr sDefaultIconInfoAccessor(GetDefaultIconInfoAccessor__Q2_2nn2slFv()); 9 | 10 | details::IIconInfoAccessorBase &GetDefaultIconInfoAccessor() { 11 | return sDefaultIconInfoAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IInstalledTitleListAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IInstalledTitleListAccessorInternal *GetDefaultInstalledTitleListAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::InstalledTitleListAccessorFromPtr sDefaultInstalledTitleListAccessor(GetDefaultInstalledTitleListAccessor__Q2_2nn2slFv()); 9 | 10 | details::IInstalledTitleListAccessorBase &GetDefaultInstalledTitleListAccessor() { 11 | return sDefaultInstalledTitleListAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IKillerNotificationAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IKillerNotificationAccessorInternal *GetDefaultKillerNotificationAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::KillerNotificationAccessorFromPtr sDefaultKillerNotificationAccessor(GetDefaultKillerNotificationAccessor__Q2_2nn2slFv()); 9 | 10 | details::IKillerNotificationAccessorBase &GetDefaultKillerNotificationAccessor() { 11 | return sDefaultKillerNotificationAccessor; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/ILaunchedTitleListAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace nn::sl { 5 | 6 | namespace { 7 | extern "C" details::ILaunchedTitleListAccessorInternal *GetDefaultLaunchedTitleListAccessor__Q2_2nn2slFQ3_2nn2sl29LaunchedTitleListAccessorType(LaunchedTitleListAccessorType type); 8 | extern "C" details::ILaunchedTitleListAccessorInternal *GetDefaultLaunchedTitleListAccessor__Q2_2nn2slFv(); 9 | } // namespace 10 | static details::LaunchedTitleListAccessorFromPtr sDefaultLaunchedTitleListAccessorType0(GetDefaultLaunchedTitleListAccessor__Q2_2nn2slFQ3_2nn2sl29LaunchedTitleListAccessorType(TITLE_LIST_ACCESSOR_LAUNCHED_TITLES)); 11 | static details::LaunchedTitleListAccessorFromPtr sDefaultLaunchedTitleListAccessorType1(GetDefaultLaunchedTitleListAccessor__Q2_2nn2slFQ3_2nn2sl29LaunchedTitleListAccessorType(TITLE_LIST_ACCESSOR_PLAY_STATS)); 12 | 13 | details::ILaunchedTitleListAccessorBase &GetDefaultLaunchedTitleListAccessor(LaunchedTitleListAccessorType type) { 14 | if (type == TITLE_LIST_ACCESSOR_LAUNCHED_TITLES) { 15 | return sDefaultLaunchedTitleListAccessorType0; 16 | } else if (type == TITLE_LIST_ACCESSOR_PLAY_STATS) { 17 | return sDefaultLaunchedTitleListAccessorType1; 18 | } 19 | OSFatal("Called GetDefaultLaunchedTitleListAccessor with invalid type"); 20 | // not reached 21 | return sDefaultLaunchedTitleListAccessorType1; 22 | } 23 | details::ILaunchedTitleListAccessorBase &GetDefaultLaunchedTitleListAccessor() { 24 | return sDefaultLaunchedTitleListAccessorType0; 25 | } 26 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IMetaInfoAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IMetaInfoAccessorInternal *GetDefaultMetaInfoAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::MetaInfoAccessorFromPtr sDefaultMetaInfoAccessor(GetDefaultMetaInfoAccessor__Q2_2nn2slFv()); 9 | 10 | details::IMetaInfoAccessorBase &GetDefaultMetaInfoAccessor() { 11 | return sDefaultMetaInfoAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IPreferentialTitleAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IPreferentialTitleAccessorInternal *GetDefaultPreferentialTitleAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::PreferentialTitleAccessorFromPtr sDefaultPreferentialTitleAccessor(GetDefaultPreferentialTitleAccessor__Q2_2nn2slFv()); 9 | 10 | details::IPreferentialTitleAccessorBase &GetDefaultPreferentialTitleAccessor() { 11 | return sDefaultPreferentialTitleAccessor; 12 | } 13 | 14 | } // namespace nn::sl 15 | -------------------------------------------------------------------------------- /libraries/nn_sl/ISettingAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::ISettingAccessorInternal *GetDefaultSettingAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::SettingAccessorFromPtr sDefaultSettingAccessor(GetDefaultSettingAccessor__Q2_2nn2slFv()); 9 | 10 | details::ISettingAccessorBase &GetDefaultSettingAccessor() { 11 | return sDefaultSettingAccessor; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/ITimeAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::ITimeAccessorInternal *GetDefaultTimeAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::TimeAccessorFromPtr sDefaultTimeAccessor(GetDefaultTimeAccessor__Q2_2nn2slFv()); 9 | 10 | details::ITimeAccessorBase &GetDefaultTimeAccessor() { 11 | return sDefaultTimeAccessor; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/ITitleIconCache.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace nn::sl { 5 | 6 | namespace { 7 | extern "C" details::ITitleIconCacheInternal *GetDefaultTitleIconCache__Q2_2nn2slFv(); 8 | } 9 | 10 | static details::TitleIconCacheFromPtr sDefaultTitleIconCache(GetDefaultTitleIconCache__Q2_2nn2slFv()); 11 | 12 | details::ITitleIconCacheBase &GetDefaultTitleIconCache() { 13 | return sDefaultTitleIconCache; 14 | } 15 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/ITitleListAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::ITitleListAccessorInternal *GetDefaultTitleListAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::TitleListAccessorFromPtr sDefaultTitleListAccessor(GetDefaultTitleListAccessor__Q2_2nn2slFv()); 9 | 10 | details::ITitleListAccessorBase &GetDefaultTitleListAccessor() { 11 | return sDefaultTitleListAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/ITransferrer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::ITransferrerInternal *GetDrcTransferrer__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::TransferrerFromPtr sDrcTransferrer(GetDrcTransferrer__Q2_2nn2slFv()); 9 | 10 | details::ITransferrerBase &GetDrcTransferrer() { 11 | return sDrcTransferrer; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IUpdatePackageAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IUpdatePackageAccessorInternal *GetDefaultUpdatePackageAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::UpdatePackageAccessorFromPtr sDefaultUpdatePackageAccessor(GetDefaultUpdatePackageAccessor__Q2_2nn2slFv()); 9 | 10 | details::IUpdatePackageAccessorBase &GetDefaultUpdatePackageAccessor() { 11 | return sDefaultUpdatePackageAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/IWhiteListAccessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IWhiteListAccessorInternal *GetDefaultWhiteListAccessor__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::WhiteListAccessorFromPtr sDefaultIconInfoAccessor(GetDefaultWhiteListAccessor__Q2_2nn2slFv()); 9 | 10 | details::IWhiteListAccessorBase &GetDefaultWhiteListAccessor() { 11 | return sDefaultIconInfoAccessor; 12 | } 13 | 14 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/KillerNotificationTransferRecordManager.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::IKillerNotificationTransferRecordManagerInternal *GetDefaultKillerNotificationTransferRecordManager__Q2_2nn2slFv(); 6 | } 7 | 8 | static details::KillerNotificationTransferRecordManagerFromPtr sDefaultKillerNotificationTransferRecordManager(GetDefaultKillerNotificationTransferRecordManager__Q2_2nn2slFv()); 9 | 10 | details::IKillerNotificationTransferRecordManagerBase &GetDefaultKillerNotificationTransferRecordManager() { 11 | return sDefaultKillerNotificationTransferRecordManager; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/KillerNotificationTransferRecordStream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::KillerNotificationTransferRecordStreamInternal *GetDefaultKillerNotificationTransferRecordStream__Q2_2nn2slFv(); 6 | } 7 | 8 | static KillerNotificationTransferRecordStream sDefaultKillerNotificationTransferRecordStream(GetDefaultKillerNotificationTransferRecordStream__Q2_2nn2slFv()); 9 | 10 | nn::sl::details::IStreamBase &GetDefaultKillerNotificationTransferRecordStream() { 11 | return sDefaultKillerNotificationTransferRecordStream; 12 | } 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/nn_sl/TitleListCache.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace nn::sl { 4 | namespace { 5 | extern "C" details::ITitleListCacheInternal *GetDefaultTitleListCache__Q2_2nn2slFv(); 6 | } 7 | static TitleListCacheFromPtr sDefaultTitleListCache(GetDefaultTitleListCache__Q2_2nn2slFv()); 8 | 9 | details::ITitleListCacheBase &GetDefaultTitleListCache() { 10 | return sDefaultTitleListCache; 11 | } 12 | 13 | } // namespace nn::sl -------------------------------------------------------------------------------- /libraries/wutcrt/crt0_rpl.s: -------------------------------------------------------------------------------- 1 | .extern main 2 | .extern exit 3 | .extern __init_wut 4 | .extern __fini_wut 5 | 6 | .section .crt0, "ax", @progbits 7 | .global __rpl_start 8 | __rpl_start: 9 | stwu 1, -0x10(1) 10 | mflr 0 11 | stw 0, 0x14(1) 12 | stw 3, 0x8(1) 13 | stw 4, 0xC(1) 14 | cmpwi 3, 2 15 | beq unload 16 | 17 | load: 18 | # Load 19 | bl __init_wut 20 | # rpl files use wutmalloc instead of the custom heap 21 | bl __init_wut_malloc 22 | bl __eabi 23 | lwz 3, 0x8(1) 24 | lwz 4, 0xC(1) 25 | bl rpl_entry 26 | addi 1, 1, 0x10 27 | blr 28 | 29 | unload: 30 | # Handle unload 31 | lwz 3, 0x8(1) 32 | lwz 4, 0xC(1) 33 | bl rpl_entry 34 | addi 1, 1, 0x10 35 | b exit 36 | 37 | -------------------------------------------------------------------------------- /libraries/wutcrt/crt0_rpx.s: -------------------------------------------------------------------------------- 1 | .extern main 2 | .extern exit 3 | .extern __init_wut 4 | .extern __fini_wut 5 | .extern __preinit_user 6 | .extern OSIsDebuggerInitialized 7 | 8 | .section .crt0, "ax", @progbits 9 | .global __rpx_start 10 | __rpx_start: 11 | stwu 1, -0x10(1) 12 | mflr 0 13 | stw 0, 0x14(1) 14 | stw 3, 0x8(1) 15 | stw 4, 0xC(1) 16 | bl OSIsDebuggerInitialized 17 | cmpwi 3,0x0 18 | beq init_wut 19 | li 3, 2 # DBGCTL_INIT_BREAKPOINT 20 | lis 4, main@h # Used for the initial bp if (((appFlags & 0x40) != 0) || ((appFlags & 0x10) != 0)) 21 | ori 4,4, main@l 22 | lis 5, __init_wut@h # Used for the initial bp if ((appFlags & 0x20) == 0) 23 | ori 5,5, __init_wut@l 24 | tw 0x1f, 30, 0 # DBGCTL_INSTRUCTION 25 | init_wut: 26 | bl __init_wut 27 | lwz 3, 0x8(1) 28 | lwz 4, 0xC(1) 29 | bl main 30 | addi 1, 1, 0x10 31 | b exit 32 | 33 | # ----------------------------------- 34 | # export for __preinit_user 35 | # ----------------------------------- 36 | .section .fexports, "ax", @0x80000001 37 | .align 4 38 | 39 | .long 1 40 | .long 0xa7fef0c2 41 | 42 | .long __preinit_user 43 | .long 0x10 44 | 45 | .string "__preinit_user" 46 | -------------------------------------------------------------------------------- /libraries/wutcrt/wut_crt.c: -------------------------------------------------------------------------------- 1 | #include 2 | void __init_wut_newlib(); 3 | void __init_wut_stdcpp(); 4 | void __init_wut_devoptab(); 5 | void __attribute__((weak)) __init_wut_socket(); 6 | 7 | void __fini_wut_newlib(); 8 | void __fini_wut_stdcpp(); 9 | void __fini_wut_devoptab(); 10 | void __attribute__((weak)) __fini_wut_socket(); 11 | 12 | void __attribute__((weak)) 13 | __init_wut() 14 | { 15 | __init_wut_newlib(); 16 | __init_wut_stdcpp(); 17 | __init_wut_devoptab(); 18 | if (&__init_wut_socket) __init_wut_socket(); 19 | } 20 | 21 | void __attribute__((weak)) 22 | __fini_wut() 23 | { 24 | if (&__fini_wut_socket) __fini_wut_socket(); 25 | __fini_wut_devoptab(); 26 | __fini_wut_stdcpp(); 27 | __fini_wut_newlib(); 28 | } 29 | -------------------------------------------------------------------------------- /libraries/wutcrt/wut_preinit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void __init_wut_sbrk_heap(MEMHeapHandle heapHandle); 4 | void __init_wut_malloc_lock(); 5 | void __init_wut_defaultheap(); 6 | 7 | void __attribute__((weak)) 8 | __preinit_user(MEMHeapHandle *mem1, 9 | MEMHeapHandle *foreground, 10 | MEMHeapHandle *mem2) 11 | { 12 | __init_wut_sbrk_heap(*mem2); 13 | __init_wut_malloc_lock(); 14 | __init_wut_defaultheap(); 15 | } 16 | -------------------------------------------------------------------------------- /libraries/wutdefaultheap/wut_defaultheap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void * 5 | __wut_alloc_from_defaultheap(uint32_t size) 6 | { 7 | return malloc(size); 8 | } 9 | 10 | void * 11 | __wut_alloc_from_defaultheap_ex(uint32_t size, 12 | int32_t alignment) 13 | { 14 | return memalign(alignment, size); 15 | } 16 | 17 | void 18 | __wut_free_to_defaultheap(void *ptr) 19 | { 20 | free(ptr); 21 | } 22 | 23 | void 24 | __init_wut_defaultheap(void) 25 | { 26 | MEMAllocFromDefaultHeap = __wut_alloc_from_defaultheap; 27 | MEMAllocFromDefaultHeapEx = __wut_alloc_from_defaultheap_ex; 28 | MEMFreeToDefaultHeap = __wut_free_to_defaultheap; 29 | } 30 | 31 | void 32 | __fini_wut_defaultheap(void) 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/MutexWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "coreinit/cache.h" 5 | 6 | class MutexWrapper { 7 | public: 8 | MutexWrapper() = default; 9 | 10 | void init(const char *name) { 11 | OSInitMutexEx(&mutex, name); 12 | } 13 | 14 | void lock() { 15 | OSLockMutex(&mutex); 16 | } 17 | 18 | void unlock() { 19 | OSUnlockMutex(&mutex); 20 | } 21 | 22 | private: 23 | OSMutex mutex{}; 24 | }; 25 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_chdir.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "devoptab_fsa.h" 3 | 4 | int 5 | __wut_fsa_chdir(struct _reent *r, 6 | const char *path) { 7 | FSError status; 8 | __wut_fsa_device_t *deviceData; 9 | 10 | if (!path) { 11 | r->_errno = EINVAL; 12 | return -1; 13 | } 14 | 15 | char *fixedPath = __wut_fsa_fixpath(r, path); 16 | if (!fixedPath) { 17 | r->_errno = ENOMEM; 18 | return -1; 19 | } 20 | deviceData = (__wut_fsa_device_t *) r->deviceData; 21 | 22 | status = FSAChangeDir(deviceData->clientHandle, fixedPath); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSAChangeDir(0x%08X, %s) failed: %s\n", deviceData->clientHandle, fixedPath, FSAGetStatusStr(status)); 25 | free(fixedPath); 26 | r->_errno = __wut_fsa_translate_error(status); 27 | return -1; 28 | } 29 | 30 | // Remove trailing '/' 31 | if (fixedPath[0] != '\0') { 32 | if (fixedPath[strlen(fixedPath) - 1] == '/') { 33 | fixedPath[strlen(fixedPath) - 1] = 0; 34 | } 35 | } 36 | 37 | if (snprintf(deviceData->cwd, sizeof(deviceData->cwd), "%s", fixedPath) >= (int) sizeof(deviceData->cwd)) { 38 | WUT_DEBUG_REPORT("__wut_fsa_chdir: snprintf result was truncated\n"); 39 | } 40 | 41 | free(fixedPath); 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_chmod.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | #include 4 | 5 | int 6 | __wut_fsa_chmod(struct _reent *r, 7 | const char *path, 8 | mode_t mode) { 9 | FSError status; 10 | __wut_fsa_device_t *deviceData; 11 | 12 | if (!path) { 13 | r->_errno = EINVAL; 14 | return -1; 15 | } 16 | 17 | char *fixedPath = __wut_fsa_fixpath(r, path); 18 | if (!fixedPath) { 19 | r->_errno = ENOMEM; 20 | return -1; 21 | } 22 | 23 | FSMode translatedMode = __wut_fsa_translate_permission_mode(mode); 24 | 25 | deviceData = (__wut_fsa_device_t *) r->deviceData; 26 | 27 | status = FSAChangeMode(deviceData->clientHandle, fixedPath, translatedMode); 28 | if (status < 0) { 29 | WUT_DEBUG_REPORT("FSAChangeMode(0x%08X, %s, 0x%X) failed: %s\n", 30 | deviceData->clientHandle, fixedPath, translatedMode, FSAGetStatusStr(status)); 31 | free(fixedPath); 32 | r->_errno = __wut_fsa_translate_error(status); 33 | return -1; 34 | } 35 | free(fixedPath); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_close.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_close(struct _reent *r, 6 | void *fd) { 7 | FSError status; 8 | __wut_fsa_file_t *file; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!fd) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | file = (__wut_fsa_file_t *) fd; 17 | 18 | deviceData = (__wut_fsa_device_t *) r->deviceData; 19 | 20 | std::scoped_lock lock(file->mutex); 21 | 22 | status = FSACloseFile(deviceData->clientHandle, file->fd); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSACloseFile(0x%08X, 0x%08X) (%s) failed: %s\n", 25 | deviceData->clientHandle, file->fd, file->fullPath, FSAGetStatusStr(status)); 26 | r->_errno = __wut_fsa_translate_error(status); 27 | return -1; 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_dirclose.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_dirclose(struct _reent *r, 6 | DIR_ITER *dirState) { 7 | FSError status; 8 | __wut_fsa_dir_t *dir; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!dirState) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | dir = (__wut_fsa_dir_t *) (dirState->dirStruct); 17 | 18 | deviceData = (__wut_fsa_device_t *) r->deviceData; 19 | 20 | std::scoped_lock lock(dir->mutex); 21 | 22 | status = FSACloseDir(deviceData->clientHandle, dir->fd); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSACloseDir(0x%08X, 0x%08X) (%s) failed: %s\n", 25 | deviceData->clientHandle, dir->fd, dir->fullPath, FSAGetStatusStr(status)); 26 | r->_errno = __wut_fsa_translate_error(status); 27 | return -1; 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_diropen.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | DIR_ITER * 5 | __wut_fsa_diropen(struct _reent *r, 6 | DIR_ITER *dirState, 7 | const char *path) { 8 | FSADirectoryHandle fd; 9 | FSError status; 10 | __wut_fsa_dir_t *dir; 11 | __wut_fsa_device_t *deviceData; 12 | 13 | if (!dirState || !path) { 14 | r->_errno = EINVAL; 15 | return NULL; 16 | } 17 | 18 | char *fixedPath = __wut_fsa_fixpath(r, path); 19 | if (!fixedPath) { 20 | return NULL; 21 | } 22 | dir = (__wut_fsa_dir_t *) (dirState->dirStruct); 23 | deviceData = (__wut_fsa_device_t *) r->deviceData; 24 | 25 | // Remove trailing '/' 26 | if (fixedPath[0] != '\0') { 27 | if (fixedPath[strlen(fixedPath) - 1] == '/') { 28 | fixedPath[strlen(fixedPath) - 1] = 0; 29 | } 30 | } 31 | 32 | if (snprintf(dir->fullPath, sizeof(dir->fullPath), "%s", fixedPath) >= (int) sizeof(dir->fullPath)) { 33 | WUT_DEBUG_REPORT("__wut_fsa_diropen: snprintf result was truncated\n"); 34 | } 35 | 36 | free(fixedPath); 37 | 38 | dir->mutex.init(dir->fullPath); 39 | std::scoped_lock lock(dir->mutex); 40 | 41 | status = FSAOpenDir(deviceData->clientHandle, dir->fullPath, &fd); 42 | if (status < 0) { 43 | WUT_DEBUG_REPORT("FSAOpenDir(0x%08X, %s, %p) failed: %s\n", 44 | deviceData->clientHandle, dir->fullPath, &fd, FSAGetStatusStr(status)); 45 | r->_errno = __wut_fsa_translate_error(status); 46 | return NULL; 47 | } 48 | 49 | dir->magic = FSA_DIRITER_MAGIC; 50 | dir->fd = fd; 51 | memset(&dir->entry_data, 0, sizeof(dir->entry_data)); 52 | return dirState; 53 | } 54 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_dirreset.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_dirreset(struct _reent *r, 6 | DIR_ITER *dirState) { 7 | FSError status; 8 | __wut_fsa_dir_t *dir; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!dirState) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | dir = (__wut_fsa_dir_t *) (dirState->dirStruct); 17 | deviceData = (__wut_fsa_device_t *) r->deviceData; 18 | 19 | std::scoped_lock lock(dir->mutex); 20 | 21 | status = FSARewindDir(deviceData->clientHandle, dir->fd); 22 | if (status < 0) { 23 | WUT_DEBUG_REPORT("FSARewindDir(0x%08X, 0x%08X) (%s) failed: %s\n", 24 | deviceData->clientHandle, dir->fd, dir->fullPath, FSAGetStatusStr(status)); 25 | r->_errno = __wut_fsa_translate_error(status); 26 | return -1; 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_fstat.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_fstat(struct _reent *r, 6 | void *fd, 7 | struct stat *st) { 8 | FSError status; 9 | FSAStat fsStat; 10 | __wut_fsa_file_t *file; 11 | __wut_fsa_device_t *deviceData; 12 | 13 | if (!fd || !st) { 14 | r->_errno = EINVAL; 15 | return -1; 16 | } 17 | 18 | file = (__wut_fsa_file_t *) fd; 19 | deviceData = (__wut_fsa_device_t *) r->deviceData; 20 | 21 | std::scoped_lock lock(file->mutex); 22 | 23 | status = FSAGetStatFile(deviceData->clientHandle, file->fd, &fsStat); 24 | if (status < 0) { 25 | WUT_DEBUG_REPORT("FSAGetStatFile(0x%08X, 0x%08X, %p) (%s) failed: %s\n", 26 | deviceData->clientHandle, file->fd, &fsStat, 27 | file->fullPath, FSAGetStatusStr(status)); 28 | r->_errno = __wut_fsa_translate_error(status); 29 | return -1; 30 | } 31 | 32 | ino_t ino = __wut_fsa_hashstring(file->fullPath); 33 | __wut_fsa_translate_stat(deviceData->clientHandle, &fsStat, ino, st); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_fsync.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_fsync(struct _reent *r, 6 | void *fd) { 7 | FSError status; 8 | __wut_fsa_file_t *file; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!fd) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | file = (__wut_fsa_file_t *) fd; 17 | 18 | deviceData = (__wut_fsa_device_t *) r->deviceData; 19 | 20 | std::scoped_lock lock(file->mutex); 21 | 22 | status = FSAFlushFile(deviceData->clientHandle, file->fd); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSAFlushFile(0x%08X, 0x%08X) (%s) failed: %s\n", 25 | deviceData->clientHandle, file->fd, file->fullPath, FSAGetStatusStr(status)); 26 | r->_errno = __wut_fsa_translate_error(status); 27 | return -1; 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_mkdir.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | 3 | int 4 | __wut_fsa_mkdir(struct _reent *r, 5 | const char *path, 6 | int mode) { 7 | FSError status; 8 | char *fixedPath; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!path) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | fixedPath = __wut_fsa_fixpath(r, path); 17 | if (!fixedPath) { 18 | r->_errno = ENOMEM; 19 | return -1; 20 | } 21 | 22 | deviceData = (__wut_fsa_device_t *) r->deviceData; 23 | 24 | FSMode translatedMode = __wut_fsa_translate_permission_mode(mode); 25 | 26 | status = FSAMakeDir(deviceData->clientHandle, fixedPath, translatedMode); 27 | if (status < 0) { 28 | WUT_DEBUG_REPORT("FSAMakeDir(0x%08X, %s, 0x%X) failed: %s\n", 29 | deviceData->clientHandle, fixedPath, translatedMode, FSAGetStatusStr(status)); 30 | free(fixedPath); 31 | r->_errno = __wut_fsa_translate_error(status); 32 | return -1; 33 | } 34 | free(fixedPath); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_rename.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | 3 | int 4 | __wut_fsa_rename(struct _reent *r, 5 | const char *oldName, 6 | const char *newName) { 7 | FSError status; 8 | char *fixedOldPath, *fixedNewPath; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!oldName || !newName) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | fixedOldPath = __wut_fsa_fixpath(r, oldName); 17 | if (!fixedOldPath) { 18 | r->_errno = ENOMEM; 19 | return -1; 20 | } 21 | 22 | fixedNewPath = __wut_fsa_fixpath(r, newName); 23 | if (!fixedNewPath) { 24 | free(fixedOldPath); 25 | r->_errno = ENOMEM; 26 | return -1; 27 | } 28 | 29 | deviceData = (__wut_fsa_device_t *) r->deviceData; 30 | 31 | status = FSARename(deviceData->clientHandle, fixedOldPath, fixedNewPath); 32 | if (status < 0) { 33 | WUT_DEBUG_REPORT("FSARename(0x%08X, %s, %s) failed: %s\n", 34 | deviceData->clientHandle, fixedOldPath, fixedNewPath, FSAGetStatusStr(status)); 35 | free(fixedOldPath); 36 | free(fixedNewPath); 37 | r->_errno = __wut_fsa_translate_error(status); 38 | return -1; 39 | } 40 | free(fixedOldPath); 41 | free(fixedNewPath); 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_rmdir.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | 3 | int 4 | __wut_fsa_rmdir(struct _reent *r, 5 | const char *name) { 6 | FSError status; 7 | __wut_fsa_device_t *deviceData; 8 | 9 | if (!name) { 10 | r->_errno = EINVAL; 11 | return -1; 12 | } 13 | 14 | char *fixedPath = __wut_fsa_fixpath(r, name); 15 | if (!fixedPath) { 16 | r->_errno = ENOMEM; 17 | return -1; 18 | } 19 | 20 | deviceData = (__wut_fsa_device_t *) r->deviceData; 21 | 22 | status = FSARemove(deviceData->clientHandle, fixedPath); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSARemove(0x%08X, %s) failed: %s\n", 25 | deviceData->clientHandle, fixedPath, FSAGetStatusStr(status)); 26 | free(fixedPath); 27 | r->_errno = __wut_fsa_translate_error(status); 28 | return -1; 29 | } 30 | 31 | free(fixedPath); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_stat.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | 3 | int 4 | __wut_fsa_stat(struct _reent *r, 5 | const char *path, 6 | struct stat *st) { 7 | FSError status; 8 | FSAStat fsStat; 9 | __wut_fsa_device_t *deviceData; 10 | 11 | if (!path || !st) { 12 | r->_errno = EINVAL; 13 | return -1; 14 | } 15 | 16 | char *fixedPath = __wut_fsa_fixpath(r, path); 17 | if (!fixedPath) { 18 | r->_errno = ENOMEM; 19 | return -1; 20 | } 21 | 22 | deviceData = (__wut_fsa_device_t *) r->deviceData; 23 | 24 | status = FSAGetStat(deviceData->clientHandle, fixedPath, &fsStat); 25 | if (status < 0) { 26 | if (status != FS_ERROR_NOT_FOUND) { 27 | WUT_DEBUG_REPORT("FSAGetStat(0x%08X, %s, %p) failed: %s\n", 28 | deviceData->clientHandle, fixedPath, &fsStat, FSAGetStatusStr(status)); 29 | } 30 | free(fixedPath); 31 | r->_errno = __wut_fsa_translate_error(status); 32 | return -1; 33 | } 34 | ino_t ino = __wut_fsa_hashstring(fixedPath); 35 | free(fixedPath); 36 | 37 | __wut_fsa_translate_stat(deviceData->clientHandle, &fsStat, ino, st); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_truncate.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | #include 3 | 4 | int 5 | __wut_fsa_ftruncate(struct _reent *r, 6 | void *fd, 7 | off_t len) { 8 | FSError status; 9 | __wut_fsa_file_t *file; 10 | __wut_fsa_device_t *deviceData; 11 | 12 | // Make sure length is non-negative 13 | if (!fd || len < 0) { 14 | r->_errno = EINVAL; 15 | return -1; 16 | } 17 | 18 | file = (__wut_fsa_file_t *) fd; 19 | 20 | deviceData = (__wut_fsa_device_t *) r->deviceData; 21 | 22 | std::scoped_lock lock(file->mutex); 23 | 24 | // Set the new file size 25 | status = FSASetPosFile(deviceData->clientHandle, file->fd, len); 26 | if (status < 0) { 27 | WUT_DEBUG_REPORT("FSASetPosFile(0x%08X, 0x%08X, 0x%08llX) failed: %s\n", 28 | deviceData->clientHandle, file->fd, len, FSAGetStatusStr(status)); 29 | r->_errno = __wut_fsa_translate_error(status); 30 | return -1; 31 | } 32 | 33 | status = FSATruncateFile(deviceData->clientHandle, file->fd); 34 | if (status < 0) { 35 | WUT_DEBUG_REPORT("FSATruncateFile(0x%08X, 0x%08X) failed: %s\n", 36 | deviceData->clientHandle, file->fd, FSAGetStatusStr(status)); 37 | r->_errno = __wut_fsa_translate_error(status); 38 | return -1; 39 | } 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /libraries/wutdevoptab/devoptab_fsa_unlink.cpp: -------------------------------------------------------------------------------- 1 | #include "devoptab_fsa.h" 2 | 3 | int 4 | __wut_fsa_unlink(struct _reent *r, 5 | const char *name) { 6 | FSError status; 7 | char *fixedPath; 8 | __wut_fsa_device_t *deviceData; 9 | 10 | if (!name) { 11 | r->_errno = EINVAL; 12 | return -1; 13 | } 14 | 15 | fixedPath = __wut_fsa_fixpath(r, name); 16 | if (!fixedPath) { 17 | r->_errno = ENOMEM; 18 | return -1; 19 | } 20 | deviceData = (__wut_fsa_device_t *) r->deviceData; 21 | 22 | status = FSARemove(deviceData->clientHandle, fixedPath); 23 | if (status < 0) { 24 | WUT_DEBUG_REPORT("FSARemove(0x%08X, %s) failed: %s\n", 25 | deviceData->clientHandle, fixedPath, FSAGetStatusStr(status)); 26 | free(fixedPath); 27 | r->_errno = __wut_fsa_translate_error(status); 28 | return -1; 29 | } 30 | 31 | free(fixedPath); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_clock.c: -------------------------------------------------------------------------------- 1 | #include "wut_newlib.h" 2 | #include "wut_clock.h" 3 | 4 | #include 5 | #include 6 | 7 | int 8 | __wut_clock_gettime(clockid_t clock_id, 9 | struct timespec *tp) 10 | { 11 | if (clock_id == CLOCK_MONOTONIC) { 12 | OSTime time = OSGetSystemTime(); 13 | tp->tv_sec = (time_t)OSTicksToSeconds(time); 14 | 15 | time -= OSSecondsToTicks(tp->tv_sec); 16 | tp->tv_nsec = (long)OSTicksToNanoseconds(time); 17 | } else if (clock_id == CLOCK_REALTIME) { 18 | OSTime time = OSGetTime(); 19 | tp->tv_sec = (time_t)OSTicksToSeconds(time); 20 | 21 | time -= OSSecondsToTicks(tp->tv_sec); 22 | tp->tv_nsec = (long)OSTicksToNanoseconds(time); 23 | 24 | tp->tv_sec += EPOCH_DIFF_SECS(WIIU_OSTIME_EPOCH_YEAR); 25 | } else { 26 | return EINVAL; 27 | } 28 | 29 | return 0; 30 | } 31 | 32 | int 33 | __wut_clock_settime(clockid_t clock_id, 34 | const struct timespec *tp) 35 | { 36 | return EPERM; 37 | } 38 | 39 | int 40 | __wut_clock_getres(clockid_t clock_id, 41 | struct timespec *res) 42 | { 43 | if (clock_id != CLOCK_MONOTONIC && 44 | clock_id != CLOCK_REALTIME) { 45 | return EINVAL; 46 | } 47 | 48 | res->tv_sec = 0; 49 | res->tv_nsec = (long)((1000000000ull + (uint64_t)OSTimerClockSpeed) / (uint64_t)OSTimerClockSpeed); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_clock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The Wii U OSTime epoch is at 2000, so we must map it to 1970 for gettime 4 | #define WIIU_OSTIME_EPOCH_YEAR (2000) 5 | // The Wii U FSTime epoch is at 1980, so we must map it to 1970 for gettime 6 | #define WIIU_FSTIME_EPOCH_YEAR (1980) 7 | 8 | #define EPOCH_YEAR (1970) 9 | #define EPOCH_YEARS_SINCE_LEAP 2 10 | #define EPOCH_YEARS_SINCE_CENTURY 70 11 | #define EPOCH_YEARS_SINCE_LEAP_CENTURY 370 12 | 13 | #define EPOCH_DIFF_YEARS(year) (year - EPOCH_YEAR) 14 | #define EPOCH_DIFF_DAYS(year) \ 15 | ((EPOCH_DIFF_YEARS(year) * 365) + \ 16 | (EPOCH_DIFF_YEARS(year) - 1 + EPOCH_YEARS_SINCE_LEAP) / 4 - \ 17 | (EPOCH_DIFF_YEARS(year) - 1 + EPOCH_YEARS_SINCE_CENTURY) / 100 + \ 18 | (EPOCH_DIFF_YEARS(year) - 1 + EPOCH_YEARS_SINCE_LEAP_CENTURY) / 400) 19 | #define EPOCH_DIFF_SECS(year) (60ull * 60ull * 24ull * (uint64_t)EPOCH_DIFF_DAYS(year)) 20 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_gettod_r.c: -------------------------------------------------------------------------------- 1 | #include "wut_newlib.h" 2 | #include "wut_clock.h" 3 | 4 | #include 5 | 6 | int 7 | __wut_gettod_r(struct _reent *ptr, 8 | struct timeval *tp, 9 | struct timezone *tz) 10 | { 11 | OSTime time = OSGetTime(); 12 | 13 | if (tp != NULL) { 14 | tp->tv_sec = (time_t)OSTicksToSeconds(time); 15 | 16 | time -= OSSecondsToTicks(tp->tv_sec); 17 | tp->tv_usec = (long)OSTicksToMicroseconds(time); 18 | 19 | tp->tv_sec += EPOCH_DIFF_SECS(WIIU_OSTIME_EPOCH_YEAR); 20 | } 21 | 22 | if (tz != NULL) { 23 | tz->tz_minuteswest = 0; 24 | tz->tz_dsttime = 0; 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_malloc_lock.c: -------------------------------------------------------------------------------- 1 | #include "wut_newlib.h" 2 | 3 | #include 4 | 5 | static OSSpinLock sMallocSpinLock; 6 | 7 | void 8 | __wut_malloc_lock(struct _reent *r) 9 | { 10 | OSUninterruptibleSpinLock_Acquire(&sMallocSpinLock); 11 | } 12 | 13 | void 14 | __wut_malloc_unlock(struct _reent *r) 15 | { 16 | OSUninterruptibleSpinLock_Release(&sMallocSpinLock); 17 | } 18 | 19 | void 20 | __init_wut_malloc_lock() 21 | { 22 | OSInitSpinLock(&sMallocSpinLock); 23 | } 24 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_nanosleep.c: -------------------------------------------------------------------------------- 1 | #include "wut_newlib.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | int 8 | __wut_nanosleep(const struct timespec *req, 9 | struct timespec *rem) 10 | { 11 | OSSleepTicks(OSSecondsToTicks(req->tv_sec) + 12 | OSNanosecondsToTicks(req->tv_nsec)); 13 | rem->tv_sec = 0; 14 | rem->tv_nsec = 0; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_newlib.h: -------------------------------------------------------------------------------- 1 | #ifndef __WUT_NEWLIB_H 2 | #define __WUT_NEWLIB_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void * __wut_sbrk_r(struct _reent *r, ptrdiff_t incr); 10 | int __wut_lock_init(int *lock, int recursive); 11 | int __wut_lock_close(int *lock); 12 | int __wut_lock_acquire(int *lock); 13 | int __wut_lock_release(int *lock); 14 | void __wut_malloc_lock(struct _reent *r); 15 | void __wut_malloc_unlock(struct _reent *r); 16 | int __wut_gettod_r(struct _reent *ptr, struct timeval *tp, 17 | struct timezone *tz); 18 | int __wut_clock_gettime(clockid_t clock_id, struct timespec *tp); 19 | int __wut_clock_settime(clockid_t clock_id, const struct timespec *tp); 20 | int __wut_clock_getres(clockid_t clock_id, struct timespec *res); 21 | int __wut_nanosleep(const struct timespec *req, struct timespec *rem); 22 | struct _reent *__wut_getreent(void); 23 | 24 | void __fini_wut_sbrk_heap(); 25 | 26 | #endif // ifndef __WUT_NEWLIB_H 27 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_sbrk.c: -------------------------------------------------------------------------------- 1 | #include "wut_newlib.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static MEMHeapHandle sHeapHandle = NULL; 9 | static void *sHeapBase = NULL; 10 | static uint32_t sHeapMaxSize = 0; 11 | static volatile uint32_t sHeapSize = 0; 12 | 13 | void * 14 | __wut_sbrk_r(struct _reent *r, 15 | ptrdiff_t incr) 16 | { 17 | uint32_t newSize; 18 | uint32_t oldSize = sHeapSize; 19 | 20 | do { 21 | newSize = oldSize + incr; 22 | 23 | if (newSize > sHeapMaxSize) { 24 | r->_errno = ENOMEM; 25 | return (void *)-1; 26 | } 27 | } while (!OSCompareAndSwapAtomicEx(&sHeapSize, oldSize, newSize, &oldSize)); 28 | 29 | return ((uint8_t *)sHeapBase) + oldSize; 30 | } 31 | 32 | void 33 | __init_wut_sbrk_heap(MEMHeapHandle heapHandle) 34 | { 35 | if (sHeapBase) { 36 | // Already initialised 37 | return; 38 | } 39 | 40 | sHeapHandle = heapHandle; 41 | 42 | // Use all of the available memory for the custom heap 43 | sHeapMaxSize = MEMGetAllocatableSizeForExpHeapEx(sHeapHandle, 4); 44 | sHeapBase = MEMAllocFromExpHeapEx(sHeapHandle, sHeapMaxSize, 4); 45 | 46 | sHeapSize = 0; 47 | } 48 | 49 | void 50 | __fini_wut_sbrk_heap() 51 | { 52 | if (!sHeapBase) { 53 | // Already finalised 54 | return; 55 | } 56 | 57 | if (sHeapHandle) { 58 | MEMFreeToExpHeap(sHeapHandle, sHeapBase); 59 | } 60 | 61 | sHeapBase = NULL; 62 | sHeapSize = 0; 63 | sHeapMaxSize = 0; 64 | } 65 | -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_thread_specific.c: -------------------------------------------------------------------------------- 1 | #include "wut_thread_specific.h" 2 | #include 3 | #include 4 | 5 | void __attribute__((weak)) 6 | wut_set_thread_specific(__wut_thread_specific_id id, void *value) { 7 | OSSetThreadSpecific(OS_THREAD_SPECIFIC_WUT_RESERVED_0 + id - WUT_THREAD_SPECIFIC_0, value); 8 | } 9 | 10 | void *__attribute__((weak)) 11 | wut_get_thread_specific(__wut_thread_specific_id id) { 12 | return OSGetThreadSpecific(OS_THREAD_SPECIFIC_WUT_RESERVED_0 + id - WUT_THREAD_SPECIFIC_0);; 13 | } -------------------------------------------------------------------------------- /libraries/wutnewlib/wut_thread_specific.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum __wut_thread_specific_id { 4 | WUT_THREAD_SPECIFIC_0 = 0, 5 | WUT_THREAD_SPECIFIC_1 = 1, 6 | } __wut_thread_specific_id; 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | void wut_set_thread_specific(__wut_thread_specific_id id, void *value); 13 | 14 | void *wut_get_thread_specific(__wut_thread_specific_id id); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /libraries/wutsocket/NSSLCreateConnection.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | #include 3 | 4 | NSSLConnectionHandle 5 | RPLWRAP(NSSLCreateConnection)(NSSLContextHandle context, 6 | const char *host, 7 | int32_t hostLength, 8 | int32_t options, 9 | int32_t socket, 10 | int32_t block); 11 | 12 | NSSLConnectionHandle 13 | NSSLCreateConnection(NSSLContextHandle context, 14 | const char *host, 15 | int32_t hostLength, 16 | int32_t options, 17 | int32_t socket, 18 | int32_t block) 19 | { 20 | socket = __wut_get_nsysnet_fd(socket); 21 | if (socket == -1) { 22 | return NSSL_ERROR_INVALID_FD; 23 | } 24 | 25 | return RPLWRAP(NSSLCreateConnection)(context, 26 | host, 27 | hostLength, 28 | options, 29 | socket, 30 | block); 31 | } 32 | -------------------------------------------------------------------------------- /libraries/wutsocket/accept.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | accept(int sockfd, 5 | struct sockaddr *address, 6 | socklen_t *addrlen) 7 | { 8 | int rc, fd, dev; 9 | 10 | fd = __wut_get_nsysnet_fd(sockfd); 11 | if (fd == -1) { 12 | return -1; 13 | } 14 | 15 | dev = __get_handle(sockfd)->device; 16 | sockfd = fd; 17 | 18 | fd = __alloc_handle(dev); 19 | if (fd == -1) { 20 | return -1; 21 | } 22 | 23 | rc = RPLWRAP(accept)(sockfd, address, addrlen); 24 | if (rc == -1) { 25 | __release_handle(fd); 26 | return __wut_get_nsysnet_result(NULL, rc); 27 | } 28 | 29 | *(int *)__get_handle(fd)->fileStruct = rc; 30 | return fd; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /libraries/wutsocket/addrinfo.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | #include 3 | #include 4 | 5 | int 6 | getaddrinfo(const char *node, 7 | const char *service, 8 | const struct addrinfo *hints, 9 | struct addrinfo **res) 10 | { 11 | int rc; 12 | 13 | if (!node && !service) { 14 | return EAI_NONAME; 15 | } 16 | 17 | if (!res) { 18 | errno = EINVAL; 19 | return EAI_SYSTEM; 20 | } 21 | 22 | rc = RPLWRAP(getaddrinfo)(node, service, hints, res); 23 | 24 | return rc; 25 | } 26 | 27 | void 28 | freeaddrinfo(struct addrinfo *res) 29 | { 30 | RPLWRAP(freeaddrinfo)(res); 31 | } 32 | 33 | int 34 | getnameinfo(const struct sockaddr *addr, 35 | socklen_t addrlen, 36 | char *host, 37 | socklen_t hostlen, 38 | char *serv, 39 | socklen_t servlen, 40 | int flags) 41 | { 42 | int rc; 43 | 44 | rc = RPLWRAP(getnameinfo)(addr, addrlen, host, hostlen, serv, servlen, flags); 45 | 46 | return rc; 47 | } 48 | 49 | const char * 50 | gai_strerror(int ecode) 51 | { 52 | return RPLWRAP(gai_strerror)(ecode); 53 | } 54 | -------------------------------------------------------------------------------- /libraries/wutsocket/bind.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | bind(int sockfd, 5 | const struct sockaddr *addr, 6 | socklen_t addrlen) 7 | { 8 | int rc; 9 | sockfd = __wut_get_nsysnet_fd(sockfd); 10 | if (sockfd == -1) { 11 | return -1; 12 | } 13 | rc = RPLWRAP(bind)(sockfd, addr, addrlen); 14 | return __wut_get_nsysnet_result(NULL, rc); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /libraries/wutsocket/connect.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int connect(int sockfd, 4 | const struct sockaddr *addr, 5 | socklen_t addrlen) 6 | { 7 | int rc; 8 | sockfd = __wut_get_nsysnet_fd(sockfd); 9 | if (sockfd == -1) { 10 | return -1; 11 | } 12 | rc = RPLWRAP(connect)(sockfd, addr, addrlen); 13 | return __wut_get_nsysnet_result(NULL, rc); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /libraries/wutsocket/fcntl.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | fcntl(int fd, 5 | int cmd, ...) 6 | { 7 | va_list args; 8 | int sockfd, rc, flags, nonblock; 9 | socklen_t nonblock_len = sizeof(nonblock); 10 | 11 | if (cmd != F_GETFL && cmd != F_SETFL) { 12 | errno = EOPNOTSUPP; 13 | return -1; 14 | } 15 | 16 | sockfd = __wut_get_nsysnet_fd(fd); 17 | if (sockfd == -1) { 18 | return -1; 19 | } 20 | 21 | /* F_SETFL */ 22 | if (cmd == F_SETFL) { 23 | va_start(args, cmd); 24 | flags = va_arg(args, int); 25 | va_end(args); 26 | 27 | nonblock = !!(flags & O_NONBLOCK); 28 | rc = RPLWRAP(setsockopt)(sockfd, 29 | SOL_SOCKET, 30 | SO_NONBLOCK, 31 | &nonblock, 32 | nonblock_len); 33 | return __wut_get_nsysnet_result(NULL, rc); 34 | } 35 | 36 | /* F_GETFL */ 37 | rc = RPLWRAP(getsockopt)(sockfd, 38 | SOL_SOCKET, 39 | SO_NONBLOCK, 40 | &nonblock, 41 | &nonblock_len); 42 | if (rc == -1) { 43 | return __wut_get_nsysnet_result(NULL, rc); 44 | } 45 | flags = (nonblock) ? O_NONBLOCK : 0; 46 | return flags; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /libraries/wutsocket/getpeername.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | getpeername(int sockfd, 5 | struct sockaddr *addr, 6 | socklen_t *addrlen) 7 | { 8 | int rc; 9 | sockfd = __wut_get_nsysnet_fd(sockfd); 10 | if (sockfd == -1) { 11 | return -1; 12 | } 13 | rc = RPLWRAP(getpeername)(sockfd, addr, addrlen); 14 | return __wut_get_nsysnet_result(NULL, rc); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /libraries/wutsocket/getsockname.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | getsockname(int sockfd, 5 | struct sockaddr *addr, 6 | socklen_t *addrlen) 7 | { 8 | int rc; 9 | sockfd = __wut_get_nsysnet_fd(sockfd); 10 | if (sockfd == -1) { 11 | return -1; 12 | } 13 | rc = RPLWRAP(getsockname)(sockfd, addr, addrlen); 14 | return __wut_get_nsysnet_result(NULL, rc); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /libraries/wutsocket/getsockopt.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | getsockopt(int sockfd, 5 | int level, 6 | int optname, 7 | void *optval, 8 | socklen_t *optlen) 9 | { 10 | int rc; 11 | sockfd = __wut_get_nsysnet_fd(sockfd); 12 | if (sockfd == -1) { 13 | return -1; 14 | } 15 | rc = RPLWRAP(getsockopt)(sockfd, level, optname, optval, optlen); 16 | return __wut_get_nsysnet_result(NULL, rc); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /libraries/wutsocket/host.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | #include 3 | #include 4 | 5 | struct hostent * 6 | gethostbyaddr(const void *addr, 7 | socklen_t len, 8 | int type) 9 | { 10 | if (!addr || !len) { 11 | h_errno = HOST_NOT_FOUND; 12 | return NULL; 13 | } 14 | 15 | if (type != AF_INET) { 16 | h_errno = HOST_NOT_FOUND; 17 | return NULL; 18 | } 19 | 20 | struct hostent *ent = RPLWRAP(gethostbyaddr)(addr, len, type); 21 | 22 | h_errno = *RPLWRAP(get_h_errno)(); 23 | 24 | return ent; 25 | } 26 | 27 | struct hostent * 28 | gethostbyname(const char *name) 29 | { 30 | if (!name) { 31 | h_errno = HOST_NOT_FOUND; 32 | return NULL; 33 | } 34 | 35 | struct hostent *ent = RPLWRAP(gethostbyname)(name); 36 | 37 | h_errno = *RPLWRAP(get_h_errno)(); 38 | 39 | return ent; 40 | } 41 | -------------------------------------------------------------------------------- /libraries/wutsocket/hostid.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | #include 4 | 5 | long 6 | gethostid(void) 7 | { 8 | uint32_t ip = UINT32_MAX; 9 | ACGetAssignedAddress(&ip); 10 | return (long)ip; 11 | } 12 | 13 | int 14 | gethostname(char *name, 15 | size_t len) 16 | { 17 | struct in_addr in; 18 | in.s_addr = gethostid(); 19 | const char *hostname = inet_ntop(AF_INET, &in, name, len); 20 | return hostname ? 0 : -1; 21 | } 22 | -------------------------------------------------------------------------------- /libraries/wutsocket/inet_addr.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | in_addr_t 4 | inet_addr(const char *cp) 5 | { 6 | struct in_addr addr = { 7 | .s_addr = INADDR_NONE, 8 | }; 9 | inet_aton(cp, &addr); 10 | return addr.s_addr; 11 | } 12 | -------------------------------------------------------------------------------- /libraries/wutsocket/inet_ntop.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | const char * 4 | inet_ntop(int af, 5 | const void *src, 6 | char *dst, 7 | socklen_t size) 8 | { 9 | const char *rc = RPLWRAP(inet_ntop)(af, src, dst, size); 10 | if (!rc) { 11 | errno = EAFNOSUPPORT; 12 | } 13 | return rc; 14 | } 15 | -------------------------------------------------------------------------------- /libraries/wutsocket/inet_pton.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | inet_pton(int af, 5 | const char *src, 6 | void *dst) 7 | { 8 | int rc = RPLWRAP(inet_pton)(af, src, dst); 9 | if (rc < 0) { 10 | errno = EAFNOSUPPORT; 11 | } 12 | return rc; 13 | } 14 | -------------------------------------------------------------------------------- /libraries/wutsocket/ioctl.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | #include 3 | 4 | int 5 | ioctl(int fd, 6 | int request, 7 | ...) 8 | { 9 | va_list args; 10 | int sockfd; 11 | int rc; 12 | 13 | sockfd = __wut_get_nsysnet_fd(fd); 14 | if (sockfd == -1) { 15 | return -1; 16 | } 17 | 18 | switch(request) { 19 | case FIONBIO: { 20 | va_start(args, request); 21 | int *data = va_arg(args, int *); 22 | va_end(args); 23 | 24 | if(data == NULL) { 25 | errno = EFAULT; 26 | return -1; 27 | } 28 | 29 | int flags = fcntl(fd, F_GETFL, 0); 30 | if(flags == -1) { 31 | return -1; 32 | } 33 | flags = (*data != 0) ? (flags | O_NONBLOCK) : (flags & ~O_NONBLOCK); 34 | return fcntl(fd, F_SETFL, flags); 35 | } 36 | case FIONREAD: 37 | case FIONWRITE: { 38 | socklen_t optlen = sizeof(int32_t); 39 | va_start(args, request); 40 | int32_t *data = va_arg(args, int32_t *); 41 | va_end(args); 42 | 43 | if(data == NULL) { 44 | errno = EFAULT; 45 | return -1; 46 | } 47 | 48 | rc = RPLWRAP(getsockopt)(sockfd, 49 | SOL_SOCKET, 50 | (request == FIONREAD) ? SO_RXDATA : SO_TXDATA, 51 | data, 52 | &optlen); 53 | return __wut_get_nsysnet_result(NULL, rc); 54 | } 55 | default: 56 | errno = ENOTTY; 57 | break; 58 | } 59 | 60 | return -1; 61 | } 62 | -------------------------------------------------------------------------------- /libraries/wutsocket/listen.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | listen(int sockfd, 5 | int backlog) 6 | { 7 | int rc; 8 | sockfd = __wut_get_nsysnet_fd(sockfd); 9 | if (sockfd == -1) { 10 | return -1; 11 | } 12 | rc = RPLWRAP(listen)(sockfd, backlog); 13 | return __wut_get_nsysnet_result(NULL, rc); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /libraries/wutsocket/recv.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | recv(int sockfd, 5 | void *buf, 6 | size_t len, 7 | int flags) 8 | { 9 | int rc; 10 | sockfd = __wut_get_nsysnet_fd(sockfd); 11 | if (sockfd == -1) { 12 | return -1; 13 | } 14 | rc = RPLWRAP(recv)(sockfd, buf, len, flags); 15 | return (ssize_t)__wut_get_nsysnet_result(NULL, rc); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /libraries/wutsocket/recvfrom.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | recvfrom(int sockfd, 5 | void *buf, 6 | size_t len, 7 | int flags, 8 | struct sockaddr *src_addr, 9 | socklen_t *addrlen) 10 | { 11 | int rc; 12 | sockfd = __wut_get_nsysnet_fd(sockfd); 13 | if (sockfd == -1) { 14 | return -1; 15 | } 16 | rc = RPLWRAP(recvfrom)(sockfd, buf, len, flags, src_addr, addrlen); 17 | return (ssize_t)__wut_get_nsysnet_result(NULL, rc); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libraries/wutsocket/send.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | send(int sockfd, 5 | const void* buf, 6 | size_t len, 7 | int flags) 8 | { 9 | int rc; 10 | sockfd = __wut_get_nsysnet_fd(sockfd); 11 | if (sockfd == -1) { 12 | return -1; 13 | } 14 | rc = RPLWRAP(send)(sockfd, buf, len, flags); 15 | return (ssize_t)__wut_get_nsysnet_result(NULL, rc); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /libraries/wutsocket/sendto.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | sendto(int sockfd, 5 | const void *buf, 6 | size_t len, 7 | int flags, 8 | const struct sockaddr *dest_addr, 9 | socklen_t addrlen) 10 | { 11 | int rc; 12 | sockfd = __wut_get_nsysnet_fd(sockfd); 13 | if (sockfd == -1) { 14 | return -1; 15 | } 16 | rc = RPLWRAP(sendto)(sockfd, buf, len, flags, dest_addr, addrlen); 17 | return (ssize_t)__wut_get_nsysnet_result(NULL, rc); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libraries/wutsocket/setsockopt.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | setsockopt(int sockfd, 5 | int level, 6 | int optname, 7 | const void *optval, 8 | socklen_t optlen) 9 | { 10 | int rc; 11 | sockfd = __wut_get_nsysnet_fd(sockfd); 12 | if (sockfd == -1) { 13 | return -1; 14 | } 15 | rc = RPLWRAP(setsockopt)(sockfd, level, optname, optval, optlen); 16 | return __wut_get_nsysnet_result(NULL, rc); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /libraries/wutsocket/shutdown.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | shutdown(int sockfd, 5 | int how) 6 | { 7 | int rc; 8 | sockfd = __wut_get_nsysnet_fd(sockfd); 9 | if (sockfd == -1) { 10 | return -1; 11 | } 12 | rc = RPLWRAP(shutdown)(sockfd, how); 13 | return __wut_get_nsysnet_result(NULL, rc); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /libraries/wutsocket/sockatmark.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int sockatmark(int sockfd) 4 | { 5 | char buf[1]; 6 | int rc; 7 | 8 | sockfd = __wut_get_nsysnet_fd(sockfd); 9 | 10 | rc = RPLWRAP(recv)(sockfd, buf, sizeof(buf), MSG_OOB | MSG_PEEK | MSG_DONTWAIT); 11 | if (rc > 0) { 12 | return 1; 13 | } 14 | 15 | rc = __wut_get_nsysnet_result(NULL, rc); 16 | 17 | return (errno == EWOULDBLOCK) ? 0 : rc; 18 | } 19 | -------------------------------------------------------------------------------- /libraries/wutsocket/socket.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | socket(int domain, 5 | int type, 6 | int protocol) 7 | { 8 | int rc, fd, dev; 9 | 10 | dev = FindDevice("soc:"); 11 | if (dev == -1) { 12 | return -1; 13 | } 14 | 15 | fd = __alloc_handle(dev); 16 | if (fd == -1) { 17 | return -1; 18 | } 19 | 20 | rc = RPLWRAP(socket)(domain, type, protocol); 21 | if (rc == -1) { 22 | __release_handle(fd); 23 | return __wut_get_nsysnet_result(NULL, rc); 24 | } 25 | 26 | *(int *)__get_handle(fd)->fileStruct = rc; 27 | return fd; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /libraries/wutsocket/somemopt.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | #include 4 | 5 | int 6 | somemopt(SOMemOptRequest request, 7 | void *buffer, 8 | uint32_t size, 9 | SOMemOptFlags flags) 10 | { 11 | int rc = RPLWRAP(somemopt)(request, buffer, size, flags); 12 | return __wut_get_nsysnet_result(NULL, rc); 13 | } 14 | -------------------------------------------------------------------------------- /libraries/wutsocket/stubs.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | #include 3 | 4 | struct servent * 5 | getservbyname(const char *name, 6 | const char *proto) 7 | { 8 | h_errno = NO_RECOVERY; 9 | errno = ENOSYS; 10 | return NULL; 11 | } 12 | 13 | struct servent * 14 | getservbyport(int port, 15 | const char *proto) 16 | { 17 | h_errno = NO_RECOVERY; 18 | errno = ENOSYS; 19 | return NULL; 20 | } 21 | 22 | struct servent * 23 | getservent(void) 24 | { 25 | h_errno = NO_RECOVERY; 26 | errno = ENOSYS; 27 | return NULL; 28 | } 29 | 30 | struct hostent * 31 | gethostent(void) 32 | { 33 | h_errno = NO_RECOVERY; 34 | errno = ENOSYS; 35 | return NULL; 36 | } 37 | -------------------------------------------------------------------------------- /libraries/wutsocket/wut_socket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #define __LINUX_ERRNO_EXTENSIONS__ 11 | #include 12 | 13 | int __wut_get_nsysnet_fd(int fd); 14 | int __wut_get_nsysnet_result(struct _reent *r, int rc); 15 | 16 | int __wut_socket_open(struct _reent *r, void *fileStruct, const char *path, int flags, int mode); 17 | int __wut_socket_close(struct _reent *r, void *fd); 18 | ssize_t __wut_socket_write(struct _reent *r, void *fd, const char *ptr, size_t len); 19 | ssize_t __wut_socket_read(struct _reent *r, void *fd, char *ptr, size_t len); 20 | 21 | -------------------------------------------------------------------------------- /libraries/wutsocket/wut_socket_close.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | __wut_socket_close(struct _reent *r, 5 | void *fd) 6 | { 7 | int sockfd = *(int *)fd; 8 | int rc = RPLWRAP(socketclose)(sockfd); 9 | return __wut_get_nsysnet_result(r, rc); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /libraries/wutsocket/wut_socket_open.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | int 4 | __wut_socket_open(struct _reent *r, 5 | void *fileStruct, 6 | const char *path, 7 | int flags, 8 | int mode) 9 | { 10 | r->_errno = ENOSYS; 11 | return -1; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /libraries/wutsocket/wut_socket_read.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | __wut_socket_read(struct _reent *r, 5 | void *fd, 6 | char *ptr, 7 | size_t len) 8 | { 9 | int sockfd = *(int *)fd; 10 | int rc = RPLWRAP(recv)(sockfd, ptr, len, 0); 11 | return (ssize_t)__wut_get_nsysnet_result(r, rc); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /libraries/wutsocket/wut_socket_write.c: -------------------------------------------------------------------------------- 1 | #include "wut_socket.h" 2 | 3 | ssize_t 4 | __wut_socket_write(struct _reent *r, 5 | void *fd, 6 | const char *ptr, 7 | size_t len) 8 | { 9 | int sockfd = *(int *)fd; 10 | int rc = RPLWRAP(send)(sockfd, ptr, len, 0); 11 | return (ssize_t)__wut_get_nsysnet_result(r, rc); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /libraries/wutstdc++/wut_gthread_mutex.cpp: -------------------------------------------------------------------------------- 1 | #include "wut_gthread.h" 2 | 3 | void 4 | __wut_mutex_init_function(OSMutex *mutex) 5 | { 6 | OSInitMutex(mutex); 7 | } 8 | 9 | int 10 | __wut_mutex_lock(OSMutex *mutex) 11 | { 12 | OSLockMutex(mutex); 13 | return 0; 14 | } 15 | 16 | int 17 | __wut_mutex_trylock(OSMutex *mutex) 18 | { 19 | if (!OSTryLockMutex(mutex)) { 20 | return -1; 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | int 27 | __wut_mutex_unlock(OSMutex *mutex) 28 | { 29 | OSUnlockMutex(mutex); 30 | return 0; 31 | } 32 | 33 | int 34 | __wut_mutex_destroy(OSMutex *mutex) 35 | { 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /libraries/wutstdc++/wut_gthread_once.cpp: -------------------------------------------------------------------------------- 1 | #include "wut_gthread.h" 2 | 3 | int 4 | __wut_once(__wut_once_t *once, 5 | void (*func) (void)) 6 | { 7 | uint32_t value = 0; 8 | 9 | if (OSCompareAndSwapAtomicEx(once, 10 | __WUT_ONCE_VALUE_INIT, 11 | __WUT_ONCE_VALUE_STARTED, 12 | &value)) { 13 | func(); 14 | OSSwapAtomic(once, 15 | __WUT_ONCE_VALUE_DONE); 16 | } else if (value != __WUT_ONCE_VALUE_DONE) { 17 | while (!OSCompareAndSwapAtomic(once, 18 | __WUT_ONCE_VALUE_DONE, 19 | __WUT_ONCE_VALUE_DONE)); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /libraries/wutstdc++/wut_gthread_recursive_mutex.cpp: -------------------------------------------------------------------------------- 1 | #include "wut_gthread.h" 2 | 3 | int 4 | __wut_recursive_mutex_init_function(OSMutex *mutex) 5 | { 6 | OSInitMutex(mutex); 7 | return 0; 8 | } 9 | 10 | int 11 | __wut_recursive_mutex_lock(OSMutex *mutex) 12 | { 13 | OSLockMutex(mutex); 14 | return 0; 15 | } 16 | 17 | int 18 | __wut_recursive_mutex_trylock(OSMutex *mutex) 19 | { 20 | if (!OSTryLockMutex(mutex)) { 21 | return -1; 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | int 28 | __wut_recursive_mutex_unlock(OSMutex *mutex) 29 | { 30 | OSUnlockMutex(mutex); 31 | return 0; 32 | } 33 | 34 | int 35 | __wut_recursive_mutex_destroy(OSMutex *mutex) 36 | { 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /samples/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(samples) 3 | 4 | add_subdirectory(custom_default_heap) 5 | add_subdirectory(erreula) 6 | add_subdirectory(gx2_triangle) 7 | add_subdirectory(helloworld) 8 | add_subdirectory(helloworld_cpp) 9 | add_subdirectory(my_first_rpl) 10 | add_subdirectory(swkbd) 11 | 12 | install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/content/" 13 | DESTINATION "${CMAKE_INSTALL_PREFIX}/content") 14 | -------------------------------------------------------------------------------- /samples/cmake/content/README.txt: -------------------------------------------------------------------------------- 1 | Samples assume that this content directory is copied to /sdcard/wut/content 2 | 3 | e.g. For gx2_triangle /sdcard/wut/content/pos_col_shader.gsh must exist! 4 | -------------------------------------------------------------------------------- /samples/cmake/content/pos_col_shader.gsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/wut/fa650f92c4b2fd150d0cfda96d773835e5a7c556/samples/cmake/content/pos_col_shader.gsh -------------------------------------------------------------------------------- /samples/cmake/content/pos_col_shader.psh: -------------------------------------------------------------------------------- 1 | ; $MODE = "UniformRegister" 2 | ; $NUM_SPI_PS_INPUT_CNTL = 1 3 | ; $SPI_PS_INPUT_CNTL[0].SEMANTIC = 0 4 | ; $SPI_PS_INPUT_CNTL[0].DEFAULT_VAL = 1 5 | 6 | 00 EXP_DONE: PIX0, R0.xyzw 7 | END_OF_PROGRAM 8 | -------------------------------------------------------------------------------- /samples/cmake/content/pos_col_shader.vsh: -------------------------------------------------------------------------------- 1 | ; $MODE = "UniformRegister" 2 | ; $ATTRIB_VARS[0].name = "aColour" 3 | ; $ATTRIB_VARS[0].type = "Float4" 4 | ; $ATTRIB_VARS[0].location = 0 5 | ; $ATTRIB_VARS[1].name = "aPosition" 6 | ; $ATTRIB_VARS[1].type = "Float4" 7 | ; $ATTRIB_VARS[1].location = 1 8 | ; $NUM_SPI_VS_OUT_ID = 1 9 | ; $SPI_VS_OUT_ID[0].SEMANTIC_0 = 0 10 | 11 | 00 CALL_FS NO_BARRIER 12 | 01 EXP_DONE: POS0, R2.xyzw 13 | 02 EXP_DONE: PARAM0, R1.xyzw NO_BARRIER 14 | END_OF_PROGRAM 15 | -------------------------------------------------------------------------------- /samples/cmake/custom_default_heap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(custom_default_heap C) 3 | 4 | add_executable(custom_default_heap 5 | main.c) 6 | 7 | wut_add_exports(custom_default_heap exports.def) 8 | wut_create_rpx(custom_default_heap) 9 | 10 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/custom_default_heap.rpx" 11 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 12 | -------------------------------------------------------------------------------- /samples/cmake/custom_default_heap/exports.def: -------------------------------------------------------------------------------- 1 | :TEXT 2 | __preinit_user 3 | -------------------------------------------------------------------------------- /samples/cmake/erreula/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(erreula CXX) 3 | 4 | add_executable(erreula 5 | main.cpp) 6 | 7 | wut_create_rpx(erreula) 8 | 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/erreula.rpx" 10 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 11 | -------------------------------------------------------------------------------- /samples/cmake/gx2_triangle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(gx2_triangle C) 3 | 4 | add_executable(gx2_triangle 5 | main.c) 6 | 7 | wut_create_rpx(gx2_triangle) 8 | 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gx2_triangle.rpx" 10 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 11 | -------------------------------------------------------------------------------- /samples/cmake/helloworld/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(helloworld C) 3 | 4 | add_executable(helloworld 5 | main.c) 6 | 7 | wut_create_rpx(helloworld) 8 | 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/helloworld.rpx" 10 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 11 | -------------------------------------------------------------------------------- /samples/cmake/helloworld/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main(int argc, char **argv) 10 | { 11 | int last_tm_sec = -1; 12 | OSCalendarTime tm; 13 | 14 | WHBProcInit(); 15 | WHBLogConsoleInit(); 16 | WHBLogPrintf("Hello World!"); 17 | 18 | while(WHBProcIsRunning()) { 19 | OSTicksToCalendarTime(OSGetTime(), &tm); 20 | 21 | if (tm.tm_sec != last_tm_sec) { 22 | WHBLogPrintf("%02d/%02d/%04d %02d:%02d:%02d I'm still here.", 23 | tm.tm_mday, tm.tm_mon, tm.tm_year, 24 | tm.tm_hour, tm.tm_min, tm.tm_sec); 25 | last_tm_sec = tm.tm_sec; 26 | } 27 | 28 | WHBLogConsoleDraw(); 29 | OSSleepTicks(OSMillisecondsToTicks(100)); 30 | } 31 | 32 | WHBLogPrintf("Exiting... good bye."); 33 | WHBLogConsoleDraw(); 34 | OSSleepTicks(OSMillisecondsToTicks(1000)); 35 | 36 | WHBLogConsoleFree(); 37 | WHBProcShutdown(); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /samples/cmake/helloworld_cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(helloworld_cpp CXX) 3 | 4 | add_executable(helloworld_cpp 5 | main.cpp) 6 | 7 | wut_create_rpx(helloworld_cpp) 8 | 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/helloworld_cpp.rpx" 10 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 11 | -------------------------------------------------------------------------------- /samples/cmake/my_first_rpl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(my_first_rpl C) 3 | 4 | add_executable(my_first_rpl my_first_rpl.c) 5 | wut_add_exports(my_first_rpl exports.def) 6 | wut_create_rpl(my_first_rpl) 7 | 8 | add_executable(my_first_rpx my_first_rpx.c) 9 | wut_link_rpl(my_first_rpx my_first_rpl) 10 | wut_create_rpx(my_first_rpx) 11 | 12 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/my_first_rpx.rpx" 13 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 14 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/my_first_rpl.rpl" 15 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 16 | -------------------------------------------------------------------------------- /samples/cmake/my_first_rpl/exports.def: -------------------------------------------------------------------------------- 1 | :NAME my_first_rpl 2 | 3 | :TEXT 4 | my_first_export 5 | -------------------------------------------------------------------------------- /samples/cmake/my_first_rpl/my_first_rpl.c: -------------------------------------------------------------------------------- 1 | #include "my_first_rpl.h" 2 | 3 | #include 4 | 5 | const char * 6 | my_first_export() 7 | { 8 | return "Hello from my_first_rpl!"; 9 | } 10 | 11 | int 12 | rpl_entry(OSDynLoad_Module module, 13 | OSDynLoad_EntryReason reason) 14 | { 15 | if (reason == OS_DYNLOAD_LOADED) { 16 | // Do stuff on load 17 | } else if (reason == OS_DYNLOAD_UNLOADED) { 18 | // Do stuff on unload 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /samples/cmake/my_first_rpl/my_first_rpl.h: -------------------------------------------------------------------------------- 1 | #ifndef MY_FIRST_RPL_H 2 | #define MY_FIRST_RPL_H 3 | 4 | const char *my_first_export(); 5 | 6 | #endif // MY_FIRST_RPL_H 7 | -------------------------------------------------------------------------------- /samples/cmake/my_first_rpl/my_first_rpx.c: -------------------------------------------------------------------------------- 1 | #include "my_first_rpl.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | int 11 | main(int argc, char **argv) 12 | { 13 | WHBProcInit(); 14 | WHBLogConsoleInit(); 15 | WHBLogPrintf(my_first_export()); 16 | 17 | while(WHBProcIsRunning()) { 18 | WHBLogConsoleDraw(); 19 | OSSleepTicks(OSMillisecondsToTicks(30)); 20 | } 21 | 22 | WHBLogConsoleFree(); 23 | WHBProcShutdown(); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /samples/cmake/swkbd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(swkbd CXX) 3 | 4 | add_executable(swkbd 5 | main.cpp) 6 | 7 | wut_create_rpx(swkbd) 8 | 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/swkbd.rpx" 10 | DESTINATION "${CMAKE_INSTALL_PREFIX}") 11 | -------------------------------------------------------------------------------- /samples/make/Makefile: -------------------------------------------------------------------------------- 1 | MAKEFILES := $(shell find . -mindepth 2 -name Makefile) 2 | 3 | DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d) 4 | 5 | all: 6 | @for i in $(MAKEFILES); do $(MAKE) -C `dirname $$i` || exit 1; done; 7 | 8 | clean: 9 | @for i in $(MAKEFILES); do $(MAKE) -C `dirname $$i` clean || exit 1; done; 10 | -------------------------------------------------------------------------------- /samples/make/helloworld/source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main(int argc, char **argv) 10 | { 11 | int last_tm_sec = -1; 12 | OSCalendarTime tm; 13 | 14 | WHBProcInit(); 15 | WHBLogConsoleInit(); 16 | WHBLogPrintf("Hello World!"); 17 | 18 | while(WHBProcIsRunning()) { 19 | OSTicksToCalendarTime(OSGetTime(), &tm); 20 | 21 | if (tm.tm_sec != last_tm_sec) { 22 | WHBLogPrintf("%02d/%02d/%04d %02d:%02d:%02d I'm still here.", 23 | tm.tm_mday, tm.tm_mon, tm.tm_year, 24 | tm.tm_hour, tm.tm_min, tm.tm_sec); 25 | last_tm_sec = tm.tm_sec; 26 | } 27 | 28 | WHBLogConsoleDraw(); 29 | OSSleepTicks(OSMillisecondsToTicks(100)); 30 | } 31 | 32 | WHBLogPrintf("Exiting... good bye."); 33 | WHBLogConsoleDraw(); 34 | OSSleepTicks(OSMillisecondsToTicks(1000)); 35 | 36 | WHBLogConsoleFree(); 37 | WHBProcShutdown(); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /share/rpl.specs: -------------------------------------------------------------------------------- 1 | *wut_entry: 2 | --entry=__rpl_start 3 | -------------------------------------------------------------------------------- /share/wut.cmake: -------------------------------------------------------------------------------- 1 | message(DEPRECATION 2 | "The functionality provided by wut.cmake has moved to devkitPro CMake. " 3 | "Please remove the corresponding include() in your CMakeLists.txt. " 4 | "devkitPro CMake for Wii U can be invoked with the following wrapper script:\n" 5 | "" 6 | "/opt/devkitpro/portlibs/wiiu/bin/powerpc-eabi-cmake" 7 | ) 8 | -------------------------------------------------------------------------------- /share/wut.specs: -------------------------------------------------------------------------------- 1 | %rename link old_link 2 | 3 | *link: 4 | %(old_link) -T %:getenv(DEVKITPRO /wut/share/wut.ld) --gc-sections --emit-relocs --no-eh-frame-hdr -z nocopyreloc %(wut_entry) 5 | -------------------------------------------------------------------------------- /share/wut.toolchain.cmake: -------------------------------------------------------------------------------- 1 | message(DEPRECATION 2 | "This toolchain file has been superseded by devkitPro CMake. " 3 | "devkitPro CMake for Wii U can be invoked with the following wrapper script:\n" 4 | "" 5 | "/opt/devkitpro/portlibs/wiiu/bin/powerpc-eabi-cmake" 6 | ) 7 | 8 | include(/opt/devkitpro/cmake/WiiU.cmake) 9 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(tests) 3 | 4 | include_directories("test_compile_headers_common") 5 | add_subdirectory(test_compile_headers_as_c11) 6 | add_subdirectory(test_compile_headers_as_c99) 7 | add_subdirectory(test_compile_headers_as_cpp) 8 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_c11/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(test_compile_headers_as_c11 C) 3 | 4 | set(CMAKE_C_STANDARD 11) 5 | 6 | add_executable(test_compile_headers_as_c11 7 | main.c) 8 | 9 | target_compile_options(test_compile_headers_as_c11 PRIVATE 10 | -Wall 11 | -Wextra 12 | -pedantic 13 | -Werror) 14 | 15 | wut_create_rpx(test_compile_headers_as_c11) 16 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_c11/main.c: -------------------------------------------------------------------------------- 1 | #include "test_compile_headers_list.h" 2 | 3 | int main(int argc, char **argv) 4 | { 5 | (void)argc, (void)argv; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_c99/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(test_compile_headers_as_c99 C) 3 | 4 | set(CMAKE_C_STANDARD 99) 5 | 6 | add_executable(test_compile_headers_as_c99 7 | main.c) 8 | 9 | target_compile_options(test_compile_headers_as_c99 PRIVATE 10 | -Wall 11 | -Wextra 12 | -pedantic 13 | -Werror) 14 | 15 | wut_create_rpx(test_compile_headers_as_c99) 16 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_c99/main.c: -------------------------------------------------------------------------------- 1 | #include "test_compile_headers_list.h" 2 | 3 | int main(int argc, char **argv) 4 | { 5 | (void)argc, (void)argv; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(test_compile_headers_as_cpp CXX) 3 | 4 | add_executable(test_compile_headers_as_cpp 5 | main.cpp) 6 | 7 | target_compile_options(test_compile_headers_as_cpp PRIVATE 8 | -Wall 9 | -Wextra 10 | -pedantic 11 | -Werror) 12 | 13 | wut_create_rpx(test_compile_headers_as_cpp) 14 | -------------------------------------------------------------------------------- /tests/test_compile_headers_as_cpp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "test_compile_headers_list.h" 2 | 3 | int main(int argc, char **argv) 4 | { 5 | (void)argc, (void)argv; 6 | return 0; 7 | } 8 | --------------------------------------------------------------------------------