From b7dd0d4f5a24618a3026136c718a77becbac3b89 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Sun, 11 Aug 2024 13:10:20 -0700 Subject: [PATCH] remove old code --- src_remove/ConfigFile.cpp | 120 - src_remove/ConfigFile.hpp | 181 -- src_remove/Controller.cpp | 40 - src_remove/Controller.hpp | 37 - src_remove/Justfile | 106 - src_remove/Key.hpp | 88 - src_remove/KeyMgr.cpp | 66 - src_remove/KeyMgr.hpp | 54 - src_remove/KingPtr.hpp | 24 - src_remove/MemPtr.hpp | 51 - src_remove/State.cpp | 71 - src_remove/State.hpp | 55 - src_remove/StateLevel1.cpp | 55 - src_remove/StateLevel1.hpp | 27 - src_remove/StateLevel2.cpp | 164 -- src_remove/StateLevel2.hpp | 43 - src_remove/StateLevel3.cpp | 137 - src_remove/StateStorage.hpp | 85 - src_remove/StringBuffer.hpp | 87 - src_remove/Time.hpp | 11 - src_remove/Worker.hpp | 79 - src_remove/WorkerActions.cpp | 131 - src_remove/WorkerConfig.cpp | 38 - src_remove/WorkerCore.cpp | 116 - src_remove/WorkerThread.cpp | 51 - src_remove/WorkerThread.hpp | 13 - src_remove/build.mk | 114 - src_remove/config/app.json | 164 -- src_remove/config/application.ld | 172 -- src_remove/config/exported | 8 - src_remove/config/switch.specs | 7 - src_remove/config/symbols.ld | 6 - src_remove/config/workspace.toml | 36 - src_remove/crt0.s | 60 - src_remove/crti.c | 13 - src_remove/fs/Logger.cpp | 62 - src_remove/fs/Logger.hpp | 84 - src_remove/ips.py | 364 --- .../lib/botw/Game/UI/uiPauseMenuDataMgr.h | 538 ---- .../botw/KingSystem/ActorSystem/actBaseProc.h | 336 --- .../KingSystem/ActorSystem/actBaseProcJob.h | 99 - .../KingSystem/ActorSystem/actBaseProcMap.h | 63 - .../Utils/Container/LockFreeQueue.h | 107 - .../KingSystem/Utils/Container/StrTreeMap.h | 44 - .../Utils/Container/UniqueArrayPtr.h | 31 - src_remove/lib/botw/KingSystem/Utils/Types.h | 14 - src_remove/lib/nnheaders/include/nn/account.h | 57 - src_remove/lib/nnheaders/include/nn/aoc.h | 9 - .../include/nn/atk/SoundArchivePlayer.h | 37 - .../include/nn/atk/SoundDataManager.h | 25 - .../nnheaders/include/nn/atk/SoundPlayer.h | 56 - .../nn/atk/detail/AdvancedWaveSoundRuntime.h | 28 - .../include/nn/atk/detail/BasicSound.h | 137 - .../nn/atk/detail/SequenceSoundRuntime.h | 37 - .../nn/atk/detail/SoundArchiveManager.h | 42 - .../nn/atk/detail/StreamSoundRuntime.h | 22 - .../include/nn/atk/detail/WaveSoundRuntime.h | 29 - src_remove/lib/nnheaders/include/nn/audio.h | 43 - src_remove/lib/nnheaders/include/nn/bcat.h | 112 - src_remove/lib/nnheaders/include/nn/crypto.h | 86 - src_remove/lib/nnheaders/include/nn/diag.h | 33 - src_remove/lib/nnheaders/include/nn/err.h | 31 - src_remove/lib/nnheaders/include/nn/friends.h | 42 - src_remove/lib/nnheaders/include/nn/fs.h | 132 - .../nnheaders/include/nn/g3d/BindFuncTable.h | 31 - .../lib/nnheaders/include/nn/g3d/ResFile.h | 75 - .../lib/nnheaders/include/nn/g3d/ResFogAnim.h | 21 - .../nnheaders/include/nn/g3d/ResLightAnim.h | 12 - .../nnheaders/include/nn/g3d/ResMaterial.h | 29 - .../include/nn/g3d/ResMaterialAnim.h | 19 - .../lib/nnheaders/include/nn/g3d/ResModel.h | 32 - .../nnheaders/include/nn/g3d/ResSceneAnim.h | 41 - .../nnheaders/include/nn/g3d/ResShapeAnim.h | 15 - .../include/nn/g3d/ResSkeletalAnim.h | 15 - src_remove/lib/nnheaders/include/nn/gfx/api.h | 22 - .../lib/nnheaders/include/nn/gfx/buffer.h | 28 - .../include/nn/gfx/detail/bufferimpl.h | 55 - .../include/nn/gfx/detail/deviceimpl.h | 24 - .../nnheaders/include/nn/gfx/detail/pool.h | 41 - .../lib/nnheaders/include/nn/gfx/device.h | 20 - .../lib/nnheaders/include/nn/gfx/memory.h | 14 - src_remove/lib/nnheaders/include/nn/hid.h | 43 - src_remove/lib/nnheaders/include/nn/image.h | 50 - src_remove/lib/nnheaders/include/nn/init.h | 21 - src_remove/lib/nnheaders/include/nn/mem.h | 30 - .../lib/nnheaders/include/nn/nex/RootObject.h | 30 - .../lib/nnheaders/include/nn/nex/auth.h | 20 - .../lib/nnheaders/include/nn/nex/buffer.h | 25 - .../lib/nnheaders/include/nn/nex/cache.h | 33 - .../lib/nnheaders/include/nn/nex/checksum.h | 61 - .../lib/nnheaders/include/nn/nex/client.h | 111 - .../lib/nnheaders/include/nn/nex/data.h | 21 - src_remove/lib/nnheaders/include/nn/nex/ddl.h | 40 - .../lib/nnheaders/include/nn/nex/dynamic.h | 21 - .../lib/nnheaders/include/nn/nex/encryption.h | 61 - .../lib/nnheaders/include/nn/nex/hash.h | 35 - .../lib/nnheaders/include/nn/nex/instance.h | 46 - src_remove/lib/nnheaders/include/nn/nex/key.h | 39 - .../lib/nnheaders/include/nn/nex/plugin.h | 33 - .../lib/nnheaders/include/nn/nex/pseudo.h | 80 - .../lib/nnheaders/include/nn/nex/reference.h | 18 - .../lib/nnheaders/include/nn/nex/socket.h | 73 - .../lib/nnheaders/include/nn/nex/string.h | 47 - .../lib/nnheaders/include/nn/nex/system.h | 66 - .../lib/nnheaders/include/nn/nex/time.h | 49 - src_remove/lib/nnheaders/include/nn/nifm.h | 21 - src_remove/lib/nnheaders/include/nn/nn.h | 33 - src_remove/lib/nnheaders/include/nn/oe.h | 37 - src_remove/lib/nnheaders/include/nn/os.h | 272 -- src_remove/lib/nnheaders/include/nn/prepo.h | 62 - src_remove/lib/nnheaders/include/nn/ro.h | 115 - .../lib/nnheaders/include/nn/settings.h | 31 - src_remove/lib/nnheaders/include/nn/sf/hipc.h | 15 - src_remove/lib/nnheaders/include/nn/socket.h | 29 - src_remove/lib/nnheaders/include/nn/ssl.h | 26 - src_remove/lib/nnheaders/include/nn/svc.h | 16 - src_remove/lib/nnheaders/include/nn/time.h | 82 - src_remove/lib/nnheaders/include/nn/types.h | 23 - .../lib/nnheaders/include/nn/ui2d/Layout.h | 49 - .../lib/nnheaders/include/nn/ui2d/Material.h | 29 - .../lib/nnheaders/include/nn/ui2d/Pane.h | 75 - .../lib/nnheaders/include/nn/ui2d/Parts.h | 29 - .../include/nn/ui2d/detail/TexCoordArray.h | 38 - src_remove/lib/nnheaders/include/nn/util.h | 60 - .../lib/nnheaders/include/nn/util/Float2.h | 19 - .../lib/nnheaders/include/nn/vfx/Config.h | 15 - .../lib/nnheaders/include/nn/vfx/Heap.h | 17 - .../lib/nnheaders/include/nn/vfx/System.h | 27 - src_remove/lib/nnheaders/include/nn/vi.h | 40 - src_remove/lib/nnheaders/include/nvn/nvn.h | 6 - .../lib/nnheaders/include/nvn/nvn_api.h | 1646 ----------- .../lib/nnheaders/include/nvn/nvn_types.h | 1074 ------- .../lib/nnheaders/include/vapours/results.hpp | 55 - .../include/vapours/results/cal_results.hpp | 26 - .../vapours/results/capsrv_results.hpp | 92 - .../vapours/results/creport_results.hpp | 37 - .../include/vapours/results/debug_results.hpp | 28 - .../include/vapours/results/dmnt_results.hpp | 50 - .../include/vapours/results/erpt_results.hpp | 43 - .../include/vapours/results/err_results.hpp | 27 - .../vapours/results/exosphere_results.hpp | 30 - .../include/vapours/results/fatal_results.hpp | 31 - .../include/vapours/results/fs_results.hpp | 409 --- .../include/vapours/results/hipc_results.hpp | 41 - .../include/vapours/results/i2c_results.hpp | 30 - .../include/vapours/results/kvdb_results.hpp | 33 - .../vapours/results/loader_results.hpp | 65 - .../include/vapours/results/lr_results.hpp | 35 - .../include/vapours/results/ncm_results.hpp | 75 - .../include/vapours/results/nim_results.hpp | 26 - .../include/vapours/results/ns_results.hpp | 31 - .../include/vapours/results/os_results.hpp | 40 - .../include/vapours/results/pgl_results.hpp | 30 - .../include/vapours/results/pm_results.hpp | 31 - .../include/vapours/results/psc_results.hpp | 27 - .../vapours/results/results_common.hpp | 196 -- .../include/vapours/results/ro_results.hpp | 45 - .../vapours/results/settings_results.hpp | 47 - .../include/vapours/results/sf_results.hpp | 54 - .../include/vapours/results/sm_results.hpp | 42 - .../include/vapours/results/spl_results.hpp | 43 - .../include/vapours/results/svc_results.hpp | 81 - .../include/vapours/results/time_results.hpp | 32 - .../vapours/results/updater_results.hpp | 30 - .../include/vapours/results/vi_results.hpp | 28 - src_remove/lib/sead/include/basis/seadNew.h | 70 - .../lib/sead/include/basis/seadRawPrint.h | 95 - src_remove/lib/sead/include/basis/seadTypes.h | 27 - .../lib/sead/include/codec/seadBase64.h | 14 - .../lib/sead/include/codec/seadHashCRC16.h | 33 - .../lib/sead/include/codec/seadHashCRC32.h | 33 - .../lib/sead/include/container/seadBuffer.h | 442 --- .../lib/sead/include/container/seadFreeList.h | 74 - .../lib/sead/include/container/seadListImpl.h | 132 - .../lib/sead/include/container/seadObjArray.h | 267 -- .../lib/sead/include/container/seadObjList.h | 245 -- .../sead/include/container/seadOffsetList.h | 219 -- .../sead/include/container/seadOrderedSet.h | 189 -- .../lib/sead/include/container/seadPtrArray.h | 377 --- .../sead/include/container/seadRingBuffer.h | 337 --- .../sead/include/container/seadSafeArray.h | 158 - .../sead/include/container/seadStrTreeMap.h | 171 -- .../lib/sead/include/container/seadTList.h | 206 -- .../lib/sead/include/container/seadTreeMap.h | 584 ---- .../lib/sead/include/container/seadTreeNode.h | 64 - .../cafe/seadCafeDRCControllerCafe.h | 49 - .../cafe/seadCafeDRCPatternRumbleAddonCafe.h | 35 - .../cafe/seadCafeRemoteControllerCafe.h | 39 - .../seadCafeRemotePatternRumbleAddonCafe.h | 26 - .../controller/cafe/seadCafeVPadDeviceCafe.h | 43 - .../controller/cafe/seadCafeWPadDeviceCafe.h | 62 - .../controller/seadAccelerometerAddon.h | 41 - .../include/controller/seadControlDevice.h | 45 - .../sead/include/controller/seadController.h | 116 - .../include/controller/seadControllerAddon.h | 44 - .../include/controller/seadControllerBase.h | 120 - .../include/controller/seadControllerDefine.h | 51 - .../include/controller/seadControllerMgr.h | 45 - .../controller/seadControllerWrapper.h | 33 - .../controller/seadControllerWrapperBase.h | 47 - .../controller/seadPatternRumbleAddon.h | 38 - .../sead/include/devenv/seadAssertConfig.h | 22 - .../lib/sead/include/devenv/seadEnvUtil.h | 18 - .../lib/sead/include/devenv/seadGameConfig.h | 24 - .../lib/sead/include/devenv/seadStackTrace.h | 55 - .../cafe/seadCafeFSAFileDeviceCafe.h | 65 - .../filedevice/nin/seadNinAocFileDeviceNin.h | 14 - .../nin/seadNinContentFileDeviceNin.h | 14 - .../filedevice/nin/seadNinFileDeviceBaseNin.h | 51 - .../filedevice/nin/seadNinHostIOFileDevice.h | 17 - .../filedevice/nin/seadNinSDFileDeviceNin.h | 16 - .../filedevice/nin/seadNinSaveFileDeviceNin.h | 15 - .../filedevice/seadArchiveFileDevice.h | 55 - .../sead/include/filedevice/seadFileDevice.h | 419 --- .../include/filedevice/seadFileDeviceMgr.h | 81 - .../include/filedevice/seadMainFileDevice.h | 112 - .../lib/sead/include/filedevice/seadPath.h | 22 - .../include/framework/seadCalculateTask.h | 32 - .../sead/include/framework/seadFramework.h | 91 - .../sead/include/framework/seadHeapPolicies.h | 47 - .../include/framework/seadInfLoopChecker.h | 40 - .../sead/include/framework/seadMethodTree.h | 88 - .../include/framework/seadMethodTreeMgr.h | 30 - .../sead/include/framework/seadProcessMeter.h | 19 - .../include/framework/seadProcessMeterBar.h | 82 - .../lib/sead/include/framework/seadTaskBase.h | 103 - .../lib/sead/include/framework/seadTaskID.h | 53 - .../lib/sead/include/framework/seadTaskMgr.h | 125 - .../include/framework/seadTaskParameter.h | 11 - .../gfx/cafe/seadPrimitiveRendererCafe.h | 126 - .../include/gfx/cafe/seadTextureCafeGX2.h | 28 - src_remove/lib/sead/include/gfx/seadCamera.h | 45 - src_remove/lib/sead/include/gfx/seadColor.h | 147 - .../lib/sead/include/gfx/seadDrawContext.h | 28 - .../lib/sead/include/gfx/seadFrameBuffer.h | 82 - .../sead/include/gfx/seadPrimitiveRenderer.h | 148 - .../include/gfx/seadPrimitiveRendererUtil.h | 36 - .../lib/sead/include/gfx/seadProjection.h | 54 - .../lib/sead/include/gfx/seadTextWriter.h | 45 - src_remove/lib/sead/include/gfx/seadTexture.h | 23 - src_remove/lib/sead/include/heap/seadArena.h | 23 - .../lib/sead/include/heap/seadDisposer.h | 134 - .../lib/sead/include/heap/seadExpHeap.h | 110 - .../lib/sead/include/heap/seadFrameHeap.h | 60 - src_remove/lib/sead/include/heap/seadHeap.h | 129 - .../lib/sead/include/heap/seadHeapMgr.h | 95 - .../lib/sead/include/heap/seadMemBlock.h | 24 - .../lib/sead/include/hostio/seadHostIOCurve.h | 167 -- .../include/hostio/seadHostIOEventListener.h | 112 - .../lib/sead/include/hostio/seadHostIOMgr.h | 16 - .../lib/sead/include/hostio/seadHostIONode.h | 51 - .../include/hostio/seadHostIOReflexible.h | 90 - .../include/hostio/seadHostIOThreadLock.h | 25 - .../lib/sead/include/math/seadBoundBox.h | 109 - .../lib/sead/include/math/seadBoundBox.hpp | 282 -- .../lib/sead/include/math/seadMathBase.h | 101 - .../sead/include/math/seadMathCalcCommon.h | 190 -- .../sead/include/math/seadMathCalcCommon.hpp | 565 ---- .../lib/sead/include/math/seadMathNumbers.h | 46 - .../lib/sead/include/math/seadMathPolicies.h | 21 - src_remove/lib/sead/include/math/seadMatrix.h | 288 -- .../lib/sead/include/math/seadMatrix.hpp | 683 ----- .../sead/include/math/seadMatrixCalcCommon.h | 164 -- .../include/math/seadMatrixCalcCommon.hpp | 2618 ----------------- src_remove/lib/sead/include/math/seadQuat.h | 80 - src_remove/lib/sead/include/math/seadQuat.hpp | 82 - .../sead/include/math/seadQuatCalcCommon.h | 28 - .../sead/include/math/seadQuatCalcCommon.hpp | 129 - src_remove/lib/sead/include/math/seadVector.h | 262 -- .../lib/sead/include/math/seadVector.hpp | 289 -- .../sead/include/math/seadVectorCalcCommon.h | 62 - .../include/math/seadVectorCalcCommon.hpp | 250 -- src_remove/lib/sead/include/mc/seadCoreInfo.h | 117 - src_remove/lib/sead/include/mc/seadJob.h | 25 - src_remove/lib/sead/include/mc/seadJobQueue.h | 154 - src_remove/lib/sead/include/mc/seadWorker.h | 53 - .../lib/sead/include/mc/seadWorkerMgr.h | 57 - .../include/prim/cafe/seadMemUtilCafe.hpp | 36 - .../sead/include/prim/nin/seadMemUtilNin.hpp | 41 - .../lib/sead/include/prim/seadBitFlag.h | 126 - .../lib/sead/include/prim/seadBitUtil.h | 48 - .../sead/include/prim/seadContainerIterator.h | 135 - .../lib/sead/include/prim/seadDelegate.h | 632 ---- .../sead/include/prim/seadDelegateEventSlot.h | 96 - src_remove/lib/sead/include/prim/seadEndian.h | 114 - src_remove/lib/sead/include/prim/seadEnum.h | 418 --- .../lib/sead/include/prim/seadFormatPrint.h | 166 -- .../lib/sead/include/prim/seadLongBitFlag.h | 123 - .../lib/sead/include/prim/seadMemUtil.h | 38 - .../lib/sead/include/prim/seadNamable.h | 23 - .../lib/sead/include/prim/seadPtrUtil.h | 60 - .../sead/include/prim/seadRuntimeTypeInfo.h | 116 - .../lib/sead/include/prim/seadSafeString.h | 492 ---- .../lib/sead/include/prim/seadSafeString.hpp | 939 ------ .../lib/sead/include/prim/seadScopeGuard.h | 41 - .../lib/sead/include/prim/seadScopedLock.h | 52 - .../lib/sead/include/prim/seadSizedEnum.h | 26 - .../lib/sead/include/prim/seadStorageFor.h | 85 - .../lib/sead/include/prim/seadStringBuilder.h | 350 --- .../lib/sead/include/prim/seadStringUtil.h | 79 - .../lib/sead/include/prim/seadTypedBitFlag.h | 119 - .../sead/include/prim/seadTypedLongBitFlag.h | 137 - .../sead/include/random/seadGlobalRandom.h | 13 - .../lib/sead/include/random/seadRandom.h | 107 - .../sead/include/resource/seadArchiveRes.h | 88 - .../sead/include/resource/seadDecompressor.h | 38 - .../lib/sead/include/resource/seadResource.h | 102 - .../sead/include/resource/seadResourceMgr.h | 101 - .../include/resource/seadSZSDecompressor.h | 80 - .../include/resource/seadSharcArchiveRes.h | 85 - .../sead/include/stream/seadBufferStream.h | 93 - .../lib/sead/include/stream/seadStream.h | 98 - .../sead/include/stream/seadStreamFormat.h | 44 - .../lib/sead/include/stream/seadStreamSrc.h | 17 - .../thread/nin/seadThreadLocalStorageNin.hpp | 30 - .../lib/sead/include/thread/seadAtomic.h | 287 -- .../sead/include/thread/seadCriticalSection.h | 46 - .../sead/include/thread/seadDelegateThread.h | 25 - .../lib/sead/include/thread/seadEvent.h | 52 - .../sead/include/thread/seadMessageQueue.h | 47 - .../lib/sead/include/thread/seadMutex.h | 43 - .../sead/include/thread/seadReadWriteLock.h | 40 - .../lib/sead/include/thread/seadSemaphore.h | 59 - .../lib/sead/include/thread/seadSpinLock.h | 29 - .../lib/sead/include/thread/seadThread.h | 199 -- .../include/thread/seadThreadLocalStorage.h | 36 - .../lib/sead/include/thread/seadThreadUtil.h | 14 - .../lib/sead/include/time/seadCalendarSpan.h | 53 - .../lib/sead/include/time/seadCalendarTime.h | 141 - .../lib/sead/include/time/seadDateSpan.h | 82 - .../lib/sead/include/time/seadDateTime.h | 98 - .../lib/sead/include/time/seadDateUtil.h | 22 - .../lib/sead/include/time/seadTickSpan.h | 103 - .../lib/sead/include/time/seadTickTime.h | 44 - src_remove/lv_1.cpp | 80 - src_remove/lv_1.hpp | 55 - src_remove/lv_2.cpp | 230 -- src_remove/lv_2.hpp | 30 - src_remove/main.cpp | 30 - src_remove/module.cpp | 14 - src_remove/patch/UIMessage.patch.s | 4 - src_remove/tools/ftp.py | 215 -- src_remove/types.h | 54 - src_remove/ui/OverlayString.cpp | 52 - src_remove/ui/OverlayString.hpp | 59 - 345 files changed, 34909 deletions(-) delete mode 100644 src_remove/ConfigFile.cpp delete mode 100644 src_remove/ConfigFile.hpp delete mode 100644 src_remove/Controller.cpp delete mode 100644 src_remove/Controller.hpp delete mode 100644 src_remove/Justfile delete mode 100644 src_remove/Key.hpp delete mode 100644 src_remove/KeyMgr.cpp delete mode 100644 src_remove/KeyMgr.hpp delete mode 100644 src_remove/KingPtr.hpp delete mode 100644 src_remove/MemPtr.hpp delete mode 100644 src_remove/State.cpp delete mode 100644 src_remove/State.hpp delete mode 100644 src_remove/StateLevel1.cpp delete mode 100644 src_remove/StateLevel1.hpp delete mode 100644 src_remove/StateLevel2.cpp delete mode 100644 src_remove/StateLevel2.hpp delete mode 100644 src_remove/StateLevel3.cpp delete mode 100644 src_remove/StateStorage.hpp delete mode 100644 src_remove/StringBuffer.hpp delete mode 100644 src_remove/Time.hpp delete mode 100644 src_remove/Worker.hpp delete mode 100644 src_remove/WorkerActions.cpp delete mode 100644 src_remove/WorkerConfig.cpp delete mode 100644 src_remove/WorkerCore.cpp delete mode 100644 src_remove/WorkerThread.cpp delete mode 100644 src_remove/WorkerThread.hpp delete mode 100644 src_remove/build.mk delete mode 100644 src_remove/config/app.json delete mode 100644 src_remove/config/application.ld delete mode 100644 src_remove/config/exported delete mode 100644 src_remove/config/switch.specs delete mode 100644 src_remove/config/symbols.ld delete mode 100644 src_remove/config/workspace.toml delete mode 100644 src_remove/crt0.s delete mode 100644 src_remove/crti.c delete mode 100644 src_remove/fs/Logger.cpp delete mode 100644 src_remove/fs/Logger.hpp delete mode 100644 src_remove/ips.py delete mode 100644 src_remove/lib/botw/Game/UI/uiPauseMenuDataMgr.h delete mode 100644 src_remove/lib/botw/KingSystem/ActorSystem/actBaseProc.h delete mode 100644 src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcJob.h delete mode 100644 src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcMap.h delete mode 100644 src_remove/lib/botw/KingSystem/Utils/Container/LockFreeQueue.h delete mode 100644 src_remove/lib/botw/KingSystem/Utils/Container/StrTreeMap.h delete mode 100644 src_remove/lib/botw/KingSystem/Utils/Container/UniqueArrayPtr.h delete mode 100644 src_remove/lib/botw/KingSystem/Utils/Types.h delete mode 100644 src_remove/lib/nnheaders/include/nn/account.h delete mode 100644 src_remove/lib/nnheaders/include/nn/aoc.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/SoundArchivePlayer.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/SoundDataManager.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/SoundPlayer.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/AdvancedWaveSoundRuntime.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/BasicSound.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/SequenceSoundRuntime.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/SoundArchiveManager.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/StreamSoundRuntime.h delete mode 100644 src_remove/lib/nnheaders/include/nn/atk/detail/WaveSoundRuntime.h delete mode 100644 src_remove/lib/nnheaders/include/nn/audio.h delete mode 100644 src_remove/lib/nnheaders/include/nn/bcat.h delete mode 100644 src_remove/lib/nnheaders/include/nn/crypto.h delete mode 100644 src_remove/lib/nnheaders/include/nn/diag.h delete mode 100644 src_remove/lib/nnheaders/include/nn/err.h delete mode 100644 src_remove/lib/nnheaders/include/nn/friends.h delete mode 100644 src_remove/lib/nnheaders/include/nn/fs.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/BindFuncTable.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResFile.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResFogAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResLightAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResMaterial.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResMaterialAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResModel.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResSceneAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResShapeAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/g3d/ResSkeletalAnim.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/api.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/buffer.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/detail/bufferimpl.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/detail/deviceimpl.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/detail/pool.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/device.h delete mode 100644 src_remove/lib/nnheaders/include/nn/gfx/memory.h delete mode 100644 src_remove/lib/nnheaders/include/nn/hid.h delete mode 100644 src_remove/lib/nnheaders/include/nn/image.h delete mode 100644 src_remove/lib/nnheaders/include/nn/init.h delete mode 100644 src_remove/lib/nnheaders/include/nn/mem.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/RootObject.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/auth.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/buffer.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/cache.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/checksum.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/client.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/data.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/ddl.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/dynamic.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/encryption.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/hash.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/instance.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/key.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/plugin.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/pseudo.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/reference.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/socket.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/string.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/system.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nex/time.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nifm.h delete mode 100644 src_remove/lib/nnheaders/include/nn/nn.h delete mode 100644 src_remove/lib/nnheaders/include/nn/oe.h delete mode 100644 src_remove/lib/nnheaders/include/nn/os.h delete mode 100644 src_remove/lib/nnheaders/include/nn/prepo.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ro.h delete mode 100644 src_remove/lib/nnheaders/include/nn/settings.h delete mode 100644 src_remove/lib/nnheaders/include/nn/sf/hipc.h delete mode 100644 src_remove/lib/nnheaders/include/nn/socket.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ssl.h delete mode 100644 src_remove/lib/nnheaders/include/nn/svc.h delete mode 100644 src_remove/lib/nnheaders/include/nn/time.h delete mode 100644 src_remove/lib/nnheaders/include/nn/types.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ui2d/Layout.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ui2d/Material.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ui2d/Pane.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ui2d/Parts.h delete mode 100644 src_remove/lib/nnheaders/include/nn/ui2d/detail/TexCoordArray.h delete mode 100644 src_remove/lib/nnheaders/include/nn/util.h delete mode 100644 src_remove/lib/nnheaders/include/nn/util/Float2.h delete mode 100644 src_remove/lib/nnheaders/include/nn/vfx/Config.h delete mode 100644 src_remove/lib/nnheaders/include/nn/vfx/Heap.h delete mode 100644 src_remove/lib/nnheaders/include/nn/vfx/System.h delete mode 100644 src_remove/lib/nnheaders/include/nn/vi.h delete mode 100644 src_remove/lib/nnheaders/include/nvn/nvn.h delete mode 100644 src_remove/lib/nnheaders/include/nvn/nvn_api.h delete mode 100644 src_remove/lib/nnheaders/include/nvn/nvn_types.h delete mode 100644 src_remove/lib/nnheaders/include/vapours/results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/cal_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/capsrv_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/creport_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/debug_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/dmnt_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/erpt_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/err_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/exosphere_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/fatal_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/fs_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/hipc_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/i2c_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/kvdb_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/loader_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/lr_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/ncm_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/nim_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/ns_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/os_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/pgl_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/pm_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/psc_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/results_common.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/ro_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/settings_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/sf_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/sm_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/spl_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/svc_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/time_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/updater_results.hpp delete mode 100644 src_remove/lib/nnheaders/include/vapours/results/vi_results.hpp delete mode 100644 src_remove/lib/sead/include/basis/seadNew.h delete mode 100644 src_remove/lib/sead/include/basis/seadRawPrint.h delete mode 100644 src_remove/lib/sead/include/basis/seadTypes.h delete mode 100644 src_remove/lib/sead/include/codec/seadBase64.h delete mode 100644 src_remove/lib/sead/include/codec/seadHashCRC16.h delete mode 100644 src_remove/lib/sead/include/codec/seadHashCRC32.h delete mode 100644 src_remove/lib/sead/include/container/seadBuffer.h delete mode 100644 src_remove/lib/sead/include/container/seadFreeList.h delete mode 100644 src_remove/lib/sead/include/container/seadListImpl.h delete mode 100644 src_remove/lib/sead/include/container/seadObjArray.h delete mode 100644 src_remove/lib/sead/include/container/seadObjList.h delete mode 100644 src_remove/lib/sead/include/container/seadOffsetList.h delete mode 100644 src_remove/lib/sead/include/container/seadOrderedSet.h delete mode 100644 src_remove/lib/sead/include/container/seadPtrArray.h delete mode 100644 src_remove/lib/sead/include/container/seadRingBuffer.h delete mode 100644 src_remove/lib/sead/include/container/seadSafeArray.h delete mode 100644 src_remove/lib/sead/include/container/seadStrTreeMap.h delete mode 100644 src_remove/lib/sead/include/container/seadTList.h delete mode 100644 src_remove/lib/sead/include/container/seadTreeMap.h delete mode 100644 src_remove/lib/sead/include/container/seadTreeNode.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeDRCControllerCafe.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeDRCPatternRumbleAddonCafe.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeRemoteControllerCafe.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeRemotePatternRumbleAddonCafe.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeVPadDeviceCafe.h delete mode 100644 src_remove/lib/sead/include/controller/cafe/seadCafeWPadDeviceCafe.h delete mode 100644 src_remove/lib/sead/include/controller/seadAccelerometerAddon.h delete mode 100644 src_remove/lib/sead/include/controller/seadControlDevice.h delete mode 100644 src_remove/lib/sead/include/controller/seadController.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerAddon.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerBase.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerDefine.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerMgr.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerWrapper.h delete mode 100644 src_remove/lib/sead/include/controller/seadControllerWrapperBase.h delete mode 100644 src_remove/lib/sead/include/controller/seadPatternRumbleAddon.h delete mode 100644 src_remove/lib/sead/include/devenv/seadAssertConfig.h delete mode 100644 src_remove/lib/sead/include/devenv/seadEnvUtil.h delete mode 100644 src_remove/lib/sead/include/devenv/seadGameConfig.h delete mode 100644 src_remove/lib/sead/include/devenv/seadStackTrace.h delete mode 100644 src_remove/lib/sead/include/filedevice/cafe/seadCafeFSAFileDeviceCafe.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinAocFileDeviceNin.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinContentFileDeviceNin.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinFileDeviceBaseNin.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinHostIOFileDevice.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinSDFileDeviceNin.h delete mode 100644 src_remove/lib/sead/include/filedevice/nin/seadNinSaveFileDeviceNin.h delete mode 100644 src_remove/lib/sead/include/filedevice/seadArchiveFileDevice.h delete mode 100644 src_remove/lib/sead/include/filedevice/seadFileDevice.h delete mode 100644 src_remove/lib/sead/include/filedevice/seadFileDeviceMgr.h delete mode 100644 src_remove/lib/sead/include/filedevice/seadMainFileDevice.h delete mode 100644 src_remove/lib/sead/include/filedevice/seadPath.h delete mode 100644 src_remove/lib/sead/include/framework/seadCalculateTask.h delete mode 100644 src_remove/lib/sead/include/framework/seadFramework.h delete mode 100644 src_remove/lib/sead/include/framework/seadHeapPolicies.h delete mode 100644 src_remove/lib/sead/include/framework/seadInfLoopChecker.h delete mode 100644 src_remove/lib/sead/include/framework/seadMethodTree.h delete mode 100644 src_remove/lib/sead/include/framework/seadMethodTreeMgr.h delete mode 100644 src_remove/lib/sead/include/framework/seadProcessMeter.h delete mode 100644 src_remove/lib/sead/include/framework/seadProcessMeterBar.h delete mode 100644 src_remove/lib/sead/include/framework/seadTaskBase.h delete mode 100644 src_remove/lib/sead/include/framework/seadTaskID.h delete mode 100644 src_remove/lib/sead/include/framework/seadTaskMgr.h delete mode 100644 src_remove/lib/sead/include/framework/seadTaskParameter.h delete mode 100644 src_remove/lib/sead/include/gfx/cafe/seadPrimitiveRendererCafe.h delete mode 100644 src_remove/lib/sead/include/gfx/cafe/seadTextureCafeGX2.h delete mode 100644 src_remove/lib/sead/include/gfx/seadCamera.h delete mode 100644 src_remove/lib/sead/include/gfx/seadColor.h delete mode 100644 src_remove/lib/sead/include/gfx/seadDrawContext.h delete mode 100644 src_remove/lib/sead/include/gfx/seadFrameBuffer.h delete mode 100644 src_remove/lib/sead/include/gfx/seadPrimitiveRenderer.h delete mode 100644 src_remove/lib/sead/include/gfx/seadPrimitiveRendererUtil.h delete mode 100644 src_remove/lib/sead/include/gfx/seadProjection.h delete mode 100644 src_remove/lib/sead/include/gfx/seadTextWriter.h delete mode 100644 src_remove/lib/sead/include/gfx/seadTexture.h delete mode 100644 src_remove/lib/sead/include/heap/seadArena.h delete mode 100644 src_remove/lib/sead/include/heap/seadDisposer.h delete mode 100644 src_remove/lib/sead/include/heap/seadExpHeap.h delete mode 100644 src_remove/lib/sead/include/heap/seadFrameHeap.h delete mode 100644 src_remove/lib/sead/include/heap/seadHeap.h delete mode 100644 src_remove/lib/sead/include/heap/seadHeapMgr.h delete mode 100644 src_remove/lib/sead/include/heap/seadMemBlock.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIOCurve.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIOEventListener.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIOMgr.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIONode.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIOReflexible.h delete mode 100644 src_remove/lib/sead/include/hostio/seadHostIOThreadLock.h delete mode 100644 src_remove/lib/sead/include/math/seadBoundBox.h delete mode 100644 src_remove/lib/sead/include/math/seadBoundBox.hpp delete mode 100644 src_remove/lib/sead/include/math/seadMathBase.h delete mode 100644 src_remove/lib/sead/include/math/seadMathCalcCommon.h delete mode 100644 src_remove/lib/sead/include/math/seadMathCalcCommon.hpp delete mode 100644 src_remove/lib/sead/include/math/seadMathNumbers.h delete mode 100644 src_remove/lib/sead/include/math/seadMathPolicies.h delete mode 100644 src_remove/lib/sead/include/math/seadMatrix.h delete mode 100644 src_remove/lib/sead/include/math/seadMatrix.hpp delete mode 100644 src_remove/lib/sead/include/math/seadMatrixCalcCommon.h delete mode 100644 src_remove/lib/sead/include/math/seadMatrixCalcCommon.hpp delete mode 100644 src_remove/lib/sead/include/math/seadQuat.h delete mode 100644 src_remove/lib/sead/include/math/seadQuat.hpp delete mode 100644 src_remove/lib/sead/include/math/seadQuatCalcCommon.h delete mode 100644 src_remove/lib/sead/include/math/seadQuatCalcCommon.hpp delete mode 100644 src_remove/lib/sead/include/math/seadVector.h delete mode 100644 src_remove/lib/sead/include/math/seadVector.hpp delete mode 100644 src_remove/lib/sead/include/math/seadVectorCalcCommon.h delete mode 100644 src_remove/lib/sead/include/math/seadVectorCalcCommon.hpp delete mode 100644 src_remove/lib/sead/include/mc/seadCoreInfo.h delete mode 100644 src_remove/lib/sead/include/mc/seadJob.h delete mode 100644 src_remove/lib/sead/include/mc/seadJobQueue.h delete mode 100644 src_remove/lib/sead/include/mc/seadWorker.h delete mode 100644 src_remove/lib/sead/include/mc/seadWorkerMgr.h delete mode 100644 src_remove/lib/sead/include/prim/cafe/seadMemUtilCafe.hpp delete mode 100644 src_remove/lib/sead/include/prim/nin/seadMemUtilNin.hpp delete mode 100644 src_remove/lib/sead/include/prim/seadBitFlag.h delete mode 100644 src_remove/lib/sead/include/prim/seadBitUtil.h delete mode 100644 src_remove/lib/sead/include/prim/seadContainerIterator.h delete mode 100644 src_remove/lib/sead/include/prim/seadDelegate.h delete mode 100644 src_remove/lib/sead/include/prim/seadDelegateEventSlot.h delete mode 100644 src_remove/lib/sead/include/prim/seadEndian.h delete mode 100644 src_remove/lib/sead/include/prim/seadEnum.h delete mode 100644 src_remove/lib/sead/include/prim/seadFormatPrint.h delete mode 100644 src_remove/lib/sead/include/prim/seadLongBitFlag.h delete mode 100644 src_remove/lib/sead/include/prim/seadMemUtil.h delete mode 100644 src_remove/lib/sead/include/prim/seadNamable.h delete mode 100644 src_remove/lib/sead/include/prim/seadPtrUtil.h delete mode 100644 src_remove/lib/sead/include/prim/seadRuntimeTypeInfo.h delete mode 100644 src_remove/lib/sead/include/prim/seadSafeString.h delete mode 100644 src_remove/lib/sead/include/prim/seadSafeString.hpp delete mode 100644 src_remove/lib/sead/include/prim/seadScopeGuard.h delete mode 100644 src_remove/lib/sead/include/prim/seadScopedLock.h delete mode 100644 src_remove/lib/sead/include/prim/seadSizedEnum.h delete mode 100644 src_remove/lib/sead/include/prim/seadStorageFor.h delete mode 100644 src_remove/lib/sead/include/prim/seadStringBuilder.h delete mode 100644 src_remove/lib/sead/include/prim/seadStringUtil.h delete mode 100644 src_remove/lib/sead/include/prim/seadTypedBitFlag.h delete mode 100644 src_remove/lib/sead/include/prim/seadTypedLongBitFlag.h delete mode 100644 src_remove/lib/sead/include/random/seadGlobalRandom.h delete mode 100644 src_remove/lib/sead/include/random/seadRandom.h delete mode 100644 src_remove/lib/sead/include/resource/seadArchiveRes.h delete mode 100644 src_remove/lib/sead/include/resource/seadDecompressor.h delete mode 100644 src_remove/lib/sead/include/resource/seadResource.h delete mode 100644 src_remove/lib/sead/include/resource/seadResourceMgr.h delete mode 100644 src_remove/lib/sead/include/resource/seadSZSDecompressor.h delete mode 100644 src_remove/lib/sead/include/resource/seadSharcArchiveRes.h delete mode 100644 src_remove/lib/sead/include/stream/seadBufferStream.h delete mode 100644 src_remove/lib/sead/include/stream/seadStream.h delete mode 100644 src_remove/lib/sead/include/stream/seadStreamFormat.h delete mode 100644 src_remove/lib/sead/include/stream/seadStreamSrc.h delete mode 100644 src_remove/lib/sead/include/thread/nin/seadThreadLocalStorageNin.hpp delete mode 100644 src_remove/lib/sead/include/thread/seadAtomic.h delete mode 100644 src_remove/lib/sead/include/thread/seadCriticalSection.h delete mode 100644 src_remove/lib/sead/include/thread/seadDelegateThread.h delete mode 100644 src_remove/lib/sead/include/thread/seadEvent.h delete mode 100644 src_remove/lib/sead/include/thread/seadMessageQueue.h delete mode 100644 src_remove/lib/sead/include/thread/seadMutex.h delete mode 100644 src_remove/lib/sead/include/thread/seadReadWriteLock.h delete mode 100644 src_remove/lib/sead/include/thread/seadSemaphore.h delete mode 100644 src_remove/lib/sead/include/thread/seadSpinLock.h delete mode 100644 src_remove/lib/sead/include/thread/seadThread.h delete mode 100644 src_remove/lib/sead/include/thread/seadThreadLocalStorage.h delete mode 100644 src_remove/lib/sead/include/thread/seadThreadUtil.h delete mode 100644 src_remove/lib/sead/include/time/seadCalendarSpan.h delete mode 100644 src_remove/lib/sead/include/time/seadCalendarTime.h delete mode 100644 src_remove/lib/sead/include/time/seadDateSpan.h delete mode 100644 src_remove/lib/sead/include/time/seadDateTime.h delete mode 100644 src_remove/lib/sead/include/time/seadDateUtil.h delete mode 100644 src_remove/lib/sead/include/time/seadTickSpan.h delete mode 100644 src_remove/lib/sead/include/time/seadTickTime.h delete mode 100644 src_remove/lv_1.cpp delete mode 100644 src_remove/lv_1.hpp delete mode 100644 src_remove/lv_2.cpp delete mode 100644 src_remove/lv_2.hpp delete mode 100644 src_remove/main.cpp delete mode 100644 src_remove/module.cpp delete mode 100644 src_remove/patch/UIMessage.patch.s delete mode 100644 src_remove/tools/ftp.py delete mode 100644 src_remove/types.h delete mode 100644 src_remove/ui/OverlayString.cpp delete mode 100644 src_remove/ui/OverlayString.hpp diff --git a/src_remove/ConfigFile.cpp b/src_remove/ConfigFile.cpp deleted file mode 100644 index c0ef35c..0000000 --- a/src_remove/ConfigFile.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include "ConfigFile.hpp" -#include -#include "Logger.hpp" -//#include "util/StringBuffer.hpp" - -namespace botwsavs::fs { - -bool ConfigFile::Save(const Config& config) { - if (!mFile.Open()) { - return false; - } - - if (!mFile.Clear()) { - mFile.Close(); - return false; - } - mSuccess = true; - mMode = Mode::Save; - config.Save(*this); - mFile.Close(); - return mSuccess; -} - -bool ConfigFile::Load(Config& config) { - if (!mFile.Open()) { - return false; - } - mSuccess = true; - mMode = Mode::Load; - mBuffer.Clear(); - config.Load(*this); - mFile.Close(); - return mSuccess; -} - -bool ConfigFile::ReadLine(u32* outLineLength) { - u32 lineLength; - if (!mBuffer.IndexOf('\n', 0, &lineLength)) { - // no new line character found, try reading more - s64 readSize = mFile.Read(mBuffer); - if (readSize < 0) { - error("Reached end of file"); - return false; - } - - if (!mBuffer.IndexOf('\n', 0, &lineLength)) { - // still no new line, probably error - error("Line is too long and cannot fit in buffer"); - return false; - } - } - - mBuffer.SafeSet(lineLength, '\0'); - // find a comment character - u32 commentIndex; - if (mBuffer.IndexOf('#', 0, &commentIndex)) { - // remove comment - mBuffer.SafeSet(commentIndex, '\0'); - } - - *outLineLength = lineLength; - return true; -} - -bool ConfigFile::WriteIntegerInternal(const char* fieldName, u64 value) { - if (mMode == Mode::Load) { - error("Cannot write in load mode"); - return false; - } - mBuffer.Clear(); - mBuffer.SafeAppendF("0x%016x", value); - mBuffer.SafeAppendF("# %s\n", fieldName); - return mFile.Write(mBuffer); -} - -bool ConfigFile::ReadIntegerInternal(u64* outValue) { - if (mMode == Mode::Save) { - error("Cannot read in save mode"); - return false; - } - u32 lineLength; - if (!ReadLine(&lineLength)) { - return false; - } - - // Convert to hex - u64 value = strtol(mBuffer.Content(), nullptr, 0); - mBuffer.SafeDeleteFront(lineLength + 1); - *outValue = value; - return true; -} - -bool ConfigFile::WriteStringInternal(const char* fieldName, const char* string) { - if (mMode == Mode::Load) { - error("Cannot write in load mode"); - return false; - } - mBuffer.Clear(); - mBuffer.SafeAppendF("%s", string); - mBuffer.SafeAppendF("# %s\n", fieldName); - return mFile.Write(mBuffer); -} - -bool ConfigFile::ReadStringInternal(char* outString, const u32 bufferLength) { - if (mMode == Mode::Save) { - error("Cannot read in save mode"); - return false; - } - u32 lineLength; - if (!ReadLine(&lineLength)) { - return false; - } - strncpy(outString, mBuffer.Content(), bufferLength); - mBuffer.SafeDeleteFront(lineLength + 1); - outString[bufferLength - 1] = '\0'; - - return true; -} - -} // namespace botwsavs::fs diff --git a/src_remove/ConfigFile.hpp b/src_remove/ConfigFile.hpp deleted file mode 100644 index d60d4f7..0000000 --- a/src_remove/ConfigFile.hpp +++ /dev/null @@ -1,181 +0,0 @@ -#pragma once -#include "File.hpp" -#include "util/NamedValue.hpp" -#include "util/StringBuffer.hpp" - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -namespace botwsavs { - -namespace fs { - -class ConfigFile; - -class Config { -public: - virtual void Save(ConfigFile& file) const; - virtual void Load(ConfigFile& file); -}; - -class ConfigFile { -public: - ConfigFile(const char* path) : mFile(path) {} - ~ConfigFile() = default; - - bool Exists() { return mFile.Exists(); } - - bool Save(const Config& config); - bool Load(Config& config); - - void WriteInteger(const char* fieldName, const u64 value) { - if (mSuccess) { - mSuccess = WriteIntegerInternal(fieldName, value); - } - } - - void ReadInteger(u64* outValue) { - if (mSuccess) { - mSuccess = ReadIntegerInternal(outValue); - } - } - - void WriteString(const char* fieldName, const char* string) { - if (mSuccess) { - mSuccess = WriteStringInternal(fieldName, string); - } - } - - void ReadString(char* outString, const u32 maxLength) { - if (mSuccess) { - mSuccess = ReadStringInternal(outString, maxLength); - } - } - - void ReadInteger(u32* outValue) { - u64 iValue; - if (!ReadIntegerInternal(&iValue)) { - mSuccess = false; - return; - } - - u32 truncated = (u32)(iValue); - *outValue = truncated; - } - - void ReadInteger(s32* outValue) { ReadInteger(reinterpret_cast(outValue)); } - - void WriteFloat(const char* fieldName, const f32 value) { - WriteInteger(fieldName, reinterpret_cast(value)); - } - - void ReadFloat(f32* value) { - u32 iValue; - ReadInteger(&iValue); - if (!mSuccess) { - return; - } - *value = reinterpret_cast(iValue); - } - - template - void WriteIntegerArray(const char* fieldName, const T* array, u32 size) { - WriteInteger(fieldName, array[0]); - if (!mSuccess) { - return; - } - for (u32 i = 1; i < size; i++) { - WriteInteger(" ---", array[i]); - if (!mSuccess) { - return; - } - } - } - - template - void ReadIntegerArray(T* outArray, u32 size) { - ReadInteger(outArray); - if (!mSuccess) { - return; - } - for (u32 i = 1; i < size; i++) { - ReadInteger(outArray + i); - if (!mSuccess) { - return; - } - } - } - - void WriteFloatArray(const char* fieldName, const f32* array, u32 size) { - WriteFloat(fieldName, array[0]); - if (!mSuccess) { - return; - } - for (u32 i = 1; i < size; i++) { - WriteFloat(" ---", array[i]); - if (!mSuccess) { - return; - } - } - } - - void ReadFloatArray(f32* outArray, u32 size) { - ReadFloat(outArray); - if (!mSuccess) { - return; - } - for (u32 i = 1; i < size; i++) { - ReadFloat(outArray + i); - if (!mSuccess) { - return; - } - } - } - - template - void WriteNamedInteger(const char* fieldName, const util::NamedValue& value) { - WriteString("Name of value below", value.GetName()); - WriteInteger(fieldName, value.GetValue()); - } - - template - void ReadNamedInteger(util::NamedValue& value) { - ReadString(value.Name(), L); - ReadInteger(value.GetValuePtr()); - } - - template - void WriteNamedFloat(const char* fieldName, const util::NamedValue& value) { - WriteString("Name of value below", value.GetName()); - WriteFloat(fieldName, value.GetValue()); - } - - template - void ReadNamedFloat(const char* fieldName, const util::NamedValue& value) { - ReadString(value.Name(), L); - ReadFloat(value.GetValuePtr()); - } - -private: - // In save mode all read functions will be disabled, vise versa - enum class Mode { Save, Load }; - - Mode mMode = Mode::Save; - bool mSuccess = true; - File mFile; - FileBuffer mBuffer; - - bool ReadLine(u32* outLineLength); - - bool WriteIntegerInternal(const char* fieldName, const u64 value); - - bool ReadIntegerInternal(u64* outValue); - - bool WriteStringInternal(const char* fieldName, const char* string); - - bool ReadStringInternal(char* outString, const u32 maxLength); -}; - -} // namespace fs - -} // namespace botwsavs -#pragma GCC diagnostic pop diff --git a/src_remove/Controller.cpp b/src_remove/Controller.cpp deleted file mode 100644 index e263b67..0000000 --- a/src_remove/Controller.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "Controller.hpp" -#include -#include -#include "fs/Logger.hpp" -#include "mem/KingPtr.hpp" - -namespace botwsavs::core { - -bool Controller::TryGetController() { - if (mpController) { - return true; - } - info("Try accessing controller instance"); - - auto* pControllerMgr = mem::KingPtr::sControllerMgrInstance; - if (!pControllerMgr) { - error("Failed to access ControllerMgr: nullptr"); - return false; - } - sead::Controller* pController = pControllerMgr->getController(0); - if (!pController) { - error("Failed to find controller instance"); - return false; - } - - infof("Found controller instance: %p", pController); - - mpController = pController; - return true; -} - -bool Controller::IsOnlyHolding(u32 mask) { - return mpController->isHoldAll(mask) && !mpController->isHold(~mask); -} - -u32 Controller::GetHoldKeys() { - return mpController->getHoldMask(); -} - -} // namespace botwsavs::core diff --git a/src_remove/Controller.hpp b/src_remove/Controller.hpp deleted file mode 100644 index 8372d05..0000000 --- a/src_remove/Controller.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "types.h" - -namespace sead { -struct Controller; -} - -namespace botwsavs { - -namespace core { -class Controller { -public: - Controller() = default; - ~Controller() { mpController = nullptr; } - - bool IsInitialized() { - if (!mpController) { - TryGetController(); - } - return mpController != nullptr; - } - - bool IsOnlyHolding(u32 mask); - - u32 GetHoldKeys(); - -private: - // Return true if controller is cached succesfully - bool TryGetController(); - -private: - sead::Controller* mpController = nullptr; -}; - -} // namespace core -} // namespace botwsavs diff --git a/src_remove/Justfile b/src_remove/Justfile deleted file mode 100644 index 3a59b24..0000000 --- a/src_remove/Justfile +++ /dev/null @@ -1,106 +0,0 @@ -set dotenv-load -set shell := ["bash", "-uc"] - -CHANGELOG_LATEST_LAST := `grep -n "###" CHANGELOG.md | cut -d ":" -f 1 | tr "\n" " " | cut -d " " -f 2` -VERSION_TEXT := ``` - grep LATEST CHANGELOG.md | cut -d "\`" -f 2 -``` -# ``` - -# Show help -default: - @just --list - -# Lint .cpp, .hpp and .py files. Pass --verbose to see more output -lint VERBOSE="": (lintpy VERBOSE) (lintc VERBOSE) - -# Lint text files and python scripts -lintpy VERBOSE="": - pylint tools - -# Lint Cpp files with clang-format -lintc VERBOSE="": - clang-format-12 -n -Werror {{VERBOSE}} $(find src -name *.hpp) - clang-format-12 -n -Werror {{VERBOSE}} $(find src -name *.cpp) - -# Run clang-format on source files -format VERBOSE="": - @echo "Checking .hpp" - clang-format-12 -i {{VERBOSE}} $(find src -name *.hpp) - @echo "Checking .cpp" - clang-format-12 -i {{VERBOSE}} $(find src -name *.cpp) - -# Run make -_make EXTRA_DEFINES="": - mkdir -p build{{EXTRA_DEFINES}} - make -C build{{EXTRA_DEFINES}} -f ../build.mk EXTRA_DEFINES={{EXTRA_DEFINES}} - python3 tools/ips.py build{{EXTRA_DEFINES}} - -# Build debug configuration -build: (_make "-DDEBUG") - echo -n SS-DEBUG > build-DDEBUG/DebugVersion.txt - -# Build release configuration and package -release EXTRA_DEFINES="": clean (_make EXTRA_DEFINES) - mkdir -p release/atmosphere/contents/01007EF00011E000/exefs - mkdir -p release/atmosphere/contents/01007EF00011E000/romfs/System - mkdir -p release/atmosphere/exefs_patches/botwsavs - mkdir -p release/botwsavs - cp build{{EXTRA_DEFINES}}/botwsavs.nso release/atmosphere/contents/01007EF00011E000/exefs/subsdk9 - cp build{{EXTRA_DEFINES}}/app.npdm release/atmosphere/contents/01007EF00011E000/exefs/main.npdm - cp build{{EXTRA_DEFINES}}/8E9978D50BDD20B4C8395A106C27FFDE.ips release/atmosphere/exefs_patches/botwsavs/8E9978D50BDD20B4C8395A106C27FFDE.ips - cp README.md release - cp CHANGELOG.md release - echo "" > release/botwsavs/latest.txt - echo -n {{VERSION_TEXT}} > release/atmosphere/contents/01007EF00011E000/romfs/System/Version.txt - cd release && zip -r ../save-state-{{VERSION_TEXT}}{{EXTRA_DEFINES}}.zip * - -# Build gold rush configuration and package -release-gold-rush: (release "-DGOLD_RUSH") - -# Create git tag and push -publish: - @echo - @echo "Latest Version: v{{VERSION_TEXT}}" - @echo - @read -p "Press Enter to tag this commit " output - git tag v{{VERSION_TEXT}} - git push origin v{{VERSION_TEXT}} - -# Display draft release notes -draft-release: - @sed -n $(grep -n "LATEST" CHANGELOG.md | cut -d ":" -f 1)',{{CHANGELOG_LATEST_LAST}}p;{{CHANGELOG_LATEST_LAST}}q' CHANGELOG.md | head -n -1 | tail -n +2 - -# Clean output -clean: - rm -rf build build-DDEBUG build-DGOLD_RUSH release save-state-*.zip - -nuke: clean - rm -rf .env - -# Set console IP -set-ip IP="": - @export SWITCH_CONSOLE_IP={{IP}} - @echo SWITCH_CONSOLE_IP={{IP}} > .env - @echo "Done" - -# Run ftp util. See tools/ftp.py -ftp COMMAND="install": - @if [[ -z ${SWITCH_CONSOLE_IP:+x} ]] ; then python3 tools/ftp.py {{COMMAND}}; else python3 tools/ftp.py {{COMMAND}} $SWITCH_CONSOLE_IP; fi - -# Run standalone ftp util wrapper for sending restore state. -send-restore: - @if [[ -z ${SWITCH_CONSOLE_IP:+x} ]] ; then python3 tools/ftp.py install; else python3 standalone_ftp.py runtime/restore.txt set -ip $SWITCH_CONSOLE_IP ; fi - -# Run standalone ftp util wrapper for getting latest state. -get-latest: - @if [[ -z ${SWITCH_CONSOLE_IP:+x} ]] ; then python3 tools/ftp.py install; else python3 standalone_ftp.py runtime/latest.txt get -ip $SWITCH_CONSOLE_IP ; fi - -# Search for symbol in dumpped (debug) build -find-symbol SYMBOL: - @objdump -T build-DDEBUG/botwsavs.elf | grep {{SYMBOL}} | cut -c 49- - -# Add symbol to config/symbols.ld and relink -add-symbol SYMBOL ADDRESS: && build - echo "$(just find-symbol {{SYMBOL}}) = {{ADDRESS}} - 0x3483000; /* {{SYMBOL}} */" >> config/symbols.ld - rm build-DDEBUG/botwsavs.* diff --git a/src_remove/Key.hpp b/src_remove/Key.hpp deleted file mode 100644 index c2e3a1d..0000000 --- a/src_remove/Key.hpp +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once - -#include "types.h" -#include "util/StringBuffer.hpp" - -namespace botwsavs::core { -enum Key : u32 { - A = 0, - B = 1 << 1, - ZL = 1 << 2, - Y = 1 << 3, - X = 1 << 4, - ZR = 1 << 5, - RStick = 1 << 6, - LStick = 1 << 7, - - Minus = (1 << 9) | (1 << 12), - Plus = (1 << 10) | (1 << 11), - - L = 1 << 13, - R = 1 << 14, - - DpadUp = 1 << 16, - DpadDown = 1 << 17, - DpadLeft = 1 << 18, - DpadRight = 1 << 19 -}; - -namespace key { -template -void GetKeyString(u32 mask, util::StringBuffer& outBuffer) { - static_assert(L >= 100, "Key string buffer length should be at least 100"); - outBuffer.Clear(); - if (mask == 0) { - return; - } - if (mask & Key::A) { - outBuffer.SafeAppend("A+"); - } - if (mask & Key::B) { - outBuffer.SafeAppend("B+"); - } - if (mask & Key::X) { - outBuffer.SafeAppend("X+"); - } - if (mask & Key::Y) { - outBuffer.SafeAppend("Y+"); - } - if (mask & Key::L) { - outBuffer.SafeAppend("L+"); - } - if (mask & Key::R) { - outBuffer.SafeAppend("R+"); - } - if (mask & Key::ZL) { - outBuffer.SafeAppend("ZL+"); - } - if (mask & Key::ZR) { - outBuffer.SafeAppend("ZR+"); - } - if (mask & Key::DpadUp) { - outBuffer.SafeAppend("DpadUp+"); - } - if (mask & Key::DpadDown) { - outBuffer.SafeAppend("DpadDown+"); - } - if (mask & Key::DpadLeft) { - outBuffer.SafeAppend("DpadLeft+"); - } - if (mask & Key::DpadRight) { - outBuffer.SafeAppend("DpadRight+"); - } - if (mask & Key::Minus) { - outBuffer.SafeAppend("Minus+"); - } - if (mask & Key::Plus) { - outBuffer.SafeAppend("Plus+"); - } - if (mask & Key::LStick) { - outBuffer.SafeAppend("LStick+"); - } - if (mask & Key::RStick) { - outBuffer.SafeAppend("RStick+"); - } - outBuffer.SafeDeleteEnd(1); -} -} // namespace key -} // namespace botwsavs::core diff --git a/src_remove/KeyMgr.cpp b/src_remove/KeyMgr.cpp deleted file mode 100644 index cd4f129..0000000 --- a/src_remove/KeyMgr.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "KeyMgr.hpp" -#include "fs/ConfigFile.hpp" -#include "fs/Logger.hpp" - -namespace botwsavs::core { - -bool KeyMgr::DidHoldFor(u32 keys, u32 seconds) { - if (mHoldingKeys != keys) { - mHoldCounter = 0; - mHoldingKeys = keys; - } else { - mHoldCounter++; - } - // 1 tick = 3 frames - // 1s = 30 frames = 10 ticks - u32 ticks = seconds * 10; - if (mHoldCounter >= ticks) { - mHoldCounter = 0; - return true; - } - return false; -} - -void KeyMgr::StartConfigure(u32* configureKey) { - info("Configuring key binding"); - ClearHold(); - mpConfiguringKey = configureKey; - mConfigureCounter = 0; -} - -KeyMgr::ConfigureResult KeyMgr::FinishConfigure(u32 newKey) { - if (newKey == 0) { - mConfigureCounter = 0; - return ConfigureResult::Pending; - } - if (mConfigureCounter < 30) { - mConfigureCounter++; - return ConfigureResult::Pending; - } - - ClearHold(); - if (newKey == 0) { - mpConfiguringKey = nullptr; - return ConfigureResult::FailEmpty; - } - *mpConfiguringKey = newKey; - mpConfiguringKey = nullptr; - infof("New combo: %x", newKey); - return ConfigureResult::Success; -} - -void KeyMgr::Save(fs::ConfigFile& file) const { - file.WriteInteger(named(mKeySave)); - file.WriteInteger(named(mKeySaveFile)); - file.WriteInteger(named(mKeyRestore)); - file.WriteInteger(named(mKeyRestoreFile)); -} - -void KeyMgr::Load(fs::ConfigFile& file) { - file.ReadInteger(&mKeySave); - file.ReadInteger(&mKeySaveFile); - file.ReadInteger(&mKeyRestore); - file.ReadInteger(&mKeyRestoreFile); -} - -} // namespace botwsavs::core diff --git a/src_remove/KeyMgr.hpp b/src_remove/KeyMgr.hpp deleted file mode 100644 index 8cfb986..0000000 --- a/src_remove/KeyMgr.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include "Key.hpp" - -namespace botwsavs { - -namespace fs { -class ConfigFile; -} - -namespace core { -// class for managing key combos and key presses -class KeyMgr { -public: - enum class ConfigureResult : u32 { - Success = 0, - Pending = 1, - FailEmpty = 2, - FailRelease = 3, - }; - - bool DidHoldFor(u32 keys, u32 seconds); - void ClearHold() { - mHoldingKeys = 0; - mHoldCounter = 0; - } - void Save(fs::ConfigFile& file) const; - void Load(fs::ConfigFile& file); - - bool IsConfiguring() const { return mpConfiguringKey != nullptr; } - void StartConfigure(u32* configureKey); - ConfigureResult FinishConfigure(u32 newKey); - -public: - // Configurable - u32 mKeySave = Key::ZL | Key::L | Key::Plus | Key::DpadLeft; - u32 mKeySaveFile = Key::ZL | Key::L | Key::Plus | Key::DpadLeft | Key::RStick; - u32 mKeyRestore = Key::ZL | Key::L | Key::Plus | Key::DpadRight; - u32 mKeyRestoreFile = Key::ZL | Key::L | Key::Plus | Key::DpadRight | Key::RStick; - - // Not configurable - u32 mKeySwitchMode = Key::DpadDown | Key::ZL | Key::ZR | Key::L | Key::R; - u32 mKeyIncreaseLevel = Key::R; - u32 mKeyDecreaseLevel = Key::L; - -private: - u32 mHoldCounter = 0; - u32 mHoldingKeys = 0; - u32* mpConfiguringKey = nullptr; - u32 mConfigureCounter = 0; -}; - -} // namespace core -} // namespace botwsavs diff --git a/src_remove/KingPtr.hpp b/src_remove/KingPtr.hpp deleted file mode 100644 index eab5268..0000000 --- a/src_remove/KingPtr.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "types.h" -namespace sead { -struct ControllerMgr; -} - -/** - * MAKE SURE TO UPDATE symbols.ld IF YOU CHANGE SOMETHING HERE - * - */ -namespace botwsavs::mem::KingPtr { - -// main offset from mod 0x3483000 -// 0x0 -// _ZN8botwsavs3mem7KingPtr10MainMemoryE -extern void* MainMemory; - -// Other used: -// uking::ui::PauseMenuDataMgr::sInstance -// 0x02CA6D50 -// _ZN5uking2ui16PauseMenuDataMgr9sInstanceE -// -} // namespace botwsavs::mem::KingPtr diff --git a/src_remove/MemPtr.hpp b/src_remove/MemPtr.hpp deleted file mode 100644 index 342aa5a..0000000 --- a/src_remove/MemPtr.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "KingPtr.hpp" -#include "SafePtr.hpp" -#include "types.h" - -namespace botwsavs::mem { - -class MemPtr { -public: - // Create pointer to main - MemPtr() { mPtr = reinterpret_cast(&KingPtr::MainMemory); } - // Copy constructor - MemPtr(const MemPtr& other) { - mPtr = other.mPtr; - mError = other.mError; - } - // Offset - MemPtr& Add(s64 offset) { - mPtr += offset; - return *this; - } - // p+x is the same as p.Add(xxx) - MemPtr& operator+(s64 offset) { return Add(offset); } - // Deferring and storing the value as pointer - MemPtr& Deref() { - if (!PtrLooksSafe(mPtr)) { - mError = true; - error("MemPtr deref failed"); - return *this; - } - char** pp = reinterpret_cast(mPtr); - mPtr = *pp; - return *this; - } - // p[x] is the same as p.Add(xxx).Deref() - MemPtr& operator[](s64 offset) { return Add(offset).Deref(); } - - template - SafePtr AsPtrTo() { - T* ptr = mError ? nullptr : reinterpret_cast(mPtr); - SafePtr safePtr{ptr}; - return safePtr; - } - -private: - char* mPtr; - bool mError = false; -}; - -} // namespace botwsavs::mem diff --git a/src_remove/State.cpp b/src_remove/State.cpp deleted file mode 100644 index 71bbbe1..0000000 --- a/src_remove/State.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "State.hpp" - -namespace botwsavs::core { - -bool State::ReadFromGame(u32 level) { - ClearError(); - switch (level) { - case 3: - mStorageLevel3.ReadFromGame(); - // fall through - case 2: - mStorageLevel2.ReadFromGame(); - // fall through - case 1: - mStorageLevel1.ReadFromGame(); - } - mLevel = level; - return !HasAnyError(); -} - -bool State::WriteToGame(u32 level) { - if (mLevel < level) { - return false; - } - ClearError(); - switch (level) { - case 3: - mStorageLevel3.WriteToGame(); - // fall through - case 2: - mStorageLevel2.WriteToGame(); - // fall through - case 1: - mStorageLevel1.WriteToGame(); - } - return !HasAnyError(); -} -bool State::CanReadFromFile() { - return fs::ConfigFile(RESTORE_TXT_PATH).Exists(); -} -bool State::ReadFromFile() { - return fs::ConfigFile(RESTORE_TXT_PATH).Load(*this); -} -bool State::WriteToFile() const { - return fs::ConfigFile(LATEST_TXT_PATH).Save(*this); -} - -void State::Load(fs::ConfigFile& file) { - u32 version = 0; - file.ReadInteger(&version); - file.ReadInteger(&mLevel); - - if (version < 1 || version > STATE_SAVE_FILE_VERSION) { - errorf("Bad version: %d", version); - return; - } - - mStorageLevel1.ReadFromFile(file, version); - mStorageLevel2.ReadFromFile(file, version); - mStorageLevel3.ReadFromFile(file, version); -} -void State::Save(fs::ConfigFile& file) const { - file.WriteInteger("version", STATE_SAVE_FILE_VERSION); - file.WriteInteger(named(mLevel)); - - mStorageLevel1.WriteToFile(file); - mStorageLevel2.WriteToFile(file); - mStorageLevel3.WriteToFile(file); -} - -} // namespace botwsavs::core diff --git a/src_remove/State.hpp b/src_remove/State.hpp deleted file mode 100644 index c07b7f6..0000000 --- a/src_remove/State.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include "fs/ConfigFile.hpp" -#include "util/NamedValue.hpp" - -#include "StateLevel1.hpp" -#include "StateLevel2.hpp" -#include "StateLevel3.hpp" - -#include "types.h" - -#define LATEST_TXT_PATH "sd:/botwsavs/latest.txt" -#define RESTORE_TXT_PATH "sd:/botwsavs/restore.txt" -#define STATE_SAVE_FILE_VERSION 4 - -namespace botwsavs::core { -class State : fs::Config { -public: - u32 GetErrorMask() const { - return mStorageLevel1.GetErrorMask() | mStorageLevel2.GetErrorMask() | - mStorageLevel3.GetErrorMask(); - } - bool HasError(StateError mask) const { return (GetErrorMask() & mask) != 0; } - bool HasAnyError() const { return GetErrorMask() != StateError::None; } - - u32 GetLevel() const { return mLevel; } - - // Read from game memory - bool ReadFromGame(u32 level); - // Write to game memory - bool WriteToGame(u32 level); - // Read from file - bool ReadFromFile(); - bool CanReadFromFile(); - // Write to file - bool WriteToFile() const; - -private: - void ClearError() { - mStorageLevel1.ClearError(); - mStorageLevel2.ClearError(); - mStorageLevel3.ClearError(); - } - - // internal functions for read/write file - void Load(fs::ConfigFile& file) override; - void Save(fs::ConfigFile& file) const override; - -private: - u32 mLevel = 0; // 0 = nothing stored - StateLevel1 mStorageLevel1; - StateLevel2 mStorageLevel2; - StateLevel3 mStorageLevel3; -}; - -} // namespace botwsavs::core diff --git a/src_remove/StateLevel1.cpp b/src_remove/StateLevel1.cpp deleted file mode 100644 index 9165c96..0000000 --- a/src_remove/StateLevel1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "StateLevel1.hpp" -#include "fs/ConfigFile.hpp" -#include "mem/GamePtr.h" - -namespace botwsavs::core { - -void StateLevel1::ReadFromGame() { - ReadMemory(named(mem::GamePtr::Health()), &mHealth); - ReadMemory(named(mem::GamePtr::Stamina()), &mStamina); - ReadMemoryArray(named(mem::GamePtr::HavokPosition()), mHavokPosition, 3); - ReadMemoryArray(named(mem::GamePtr::MainPositionMatrix()), mMainPositionMatrix, 12); - ReadMemoryArray(named(mem::GamePtr::CameraPanMatrix()), mCameraPanMatrix, 12); - ReadMemory(named(mem::GamePtr::CameraZoom()), &mCameraZoom); - ReadMemory(named(mem::GamePtr::CameraTilt()), &mCameraTilt); -} - -void StateLevel1::WriteToGame() { - WriteMemory(named(mem::GamePtr::Health()), mHealth); - WriteMemory(named(mem::GamePtr::Stamina()), mStamina); - WriteMemoryArray(named(mem::GamePtr::HavokPosition()), mHavokPosition, 3); - WriteMemoryArray(named(mem::GamePtr::MainPositionMatrix()), mMainPositionMatrix, 12); - WriteMemoryArray(named(mem::GamePtr::CameraPanMatrix()), mCameraPanMatrix, 12); - WriteMemory(named(mem::GamePtr::CameraZoom()), mCameraZoom); - WriteMemory(named(mem::GamePtr::CameraTilt()), mCameraTilt); - - // extras - WriteMemory(named(mem::GamePtr::RoundBombCooldown()), 360.0F); - WriteMemory(named(mem::GamePtr::SquareBombCooldown()), 360.0F); - WriteMemory(named(mem::GamePtr::StasisCooldown()), 1.0F); -} - -void StateLevel1::ReadFromFile(fs::ConfigFile& file, u32 version) { - if (version < 1) { - return; - } - file.ReadInteger(&mHealth); - file.ReadFloat(&mStamina); - file.ReadFloatArray(mHavokPosition, 3); - file.ReadFloatArray(mMainPositionMatrix, 12); - file.ReadFloatArray(mCameraPanMatrix, 12); - file.ReadFloat(&mCameraZoom); - file.ReadFloat(&mCameraTilt); -} - -void StateLevel1::WriteToFile(fs::ConfigFile& file) const { - file.WriteInteger(named(mHealth)); - file.WriteFloat(named(mStamina)); - file.WriteFloatArray(named(mHavokPosition), 3); - file.WriteFloatArray(named(mMainPositionMatrix), 12); - file.WriteFloatArray(named(mCameraPanMatrix), 12); - file.WriteFloat(named(mCameraZoom)); - file.WriteFloat(named(mCameraTilt)); -} - -} // namespace botwsavs::core diff --git a/src_remove/StateLevel1.hpp b/src_remove/StateLevel1.hpp deleted file mode 100644 index 16ae62d..0000000 --- a/src_remove/StateLevel1.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "StateStorage.hpp" - -namespace botwsavs::core { - -class StateLevel1 : public StateStorage { -public: - void ReadFromGame() override; - void WriteToGame() override; - void ReadFromFile(fs::ConfigFile& file, u32 version) override; - void WriteToFile(fs::ConfigFile& file) const override; - -private: - u32 mHealth; - f32 mStamina; - f32 mHavokPosition[3]; - f32 mMainPositionMatrix[12]; - f32 mCameraPanMatrix[12]; - f32 mCameraZoom; - f32 mCameraTilt; - // Extras: - // reset rune cooldown - // TODO reset fall damage -}; - -} // namespace botwsavs::core diff --git a/src_remove/StateLevel2.cpp b/src_remove/StateLevel2.cpp deleted file mode 100644 index de35130..0000000 --- a/src_remove/StateLevel2.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include - -#include "fs/ConfigFile.hpp" -#include "fs/Logger.hpp" -#include "mem/GamePtr.h" - -#include "StateLevel2.hpp" -namespace botwsavs::core { - -void StateLevel2::ReadInventoryEquipment(const char* name, uking::ui::PouchItem* pItem, - util::NamedValue& value) { - if (mem::PtrLooksSafe(pItem)) { - value.Set(pItem->getName(), pItem->getValue()); - } else { - value.ClearName(); - SetError(StateError::NotEquipped); - warnf("Cannot read equipped %s count", name); - } -} - -void StateLevel2::WriteInventoryEquipment(const char* name, uking::ui::PouchItem* pItem, - const util::NamedValue& value) { - if (mem::PtrLooksSafe(pItem)) { - if (value.NameMatches(pItem->getName())) { - pItem->setValue(value.GetValue()); - } else { - SetError(StateError::DifferentName); - warnf("Cannot restore equipped %s count: different name", name); - } - } else { - SetError(StateError::NotEquipped); - warnf("Cannot restore equipped %s count", name); - } -} - -void StateLevel2::ReadOverworldEquipment(const char* name, - const mem::SafePtr& safepActor, - const mem::SafePtr& safepDurability, - util::NamedValue& value) { - ksys::act::BaseProc* pActor; - if (safepActor.TakePtr(&pActor)) { - u32 durability; - if (safepDurability.Get(&durability)) { - value.Set(pActor->getName(), durability); - } else { - value.ClearName(); - SetError(StateError::Pointer); - warnf("Cannot read equipped overworld %s durability", name); - } - } else { - value.ClearName(); - SetError(StateError::NotEquipped); - warnf("Cannot read equipped overworld %s actor", name); - } -} - -void StateLevel2::WriteOverworldEquipment(const char* name, - const mem::SafePtr& safepActor, - const mem::SafePtr& safepDurability, - const util::NamedValue& value) { - ksys::act::BaseProc* pActor; - if (safepActor.TakePtr(&pActor)) { - if (value.NameMatches(pActor->getName())) { - if (!safepDurability.Set(value.GetValue())) { - SetError(StateError::Pointer); - warnf("Cannot restore equipped overworld %s: pointer error", name); - } - } else { - SetError(StateError::DifferentName); - warnf("Cannot restore equipped overworld %s: different name", name); - } - } else { - SetError(StateError::NotEquipped); - warnf("Cannot restore equipped overworld %s actor", name); - } -} - -void StateLevel2::ReadFromGame() { - uking::ui::PauseMenuDataMgr* pPauseMenuDataMgr; - if (TakePtrOrError(named(mem::SafePtr(uking::ui::PauseMenuDataMgr::instance())), - &pPauseMenuDataMgr)) { - // update equipped weapons - pPauseMenuDataMgr->updateEquippedItemArray(); - - // Save arrow, weapon, bow, shield - ReadInventoryEquipment( - "arrow", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Arrow), - mMenuEquippedArrow); - ReadInventoryEquipment( - "weapon", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Sword), - mMenuEquippedWeapon); - ReadInventoryEquipment("bow", - pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Bow), - mMenuEquippedBow); - ReadInventoryEquipment( - "shield", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Shield), - mMenuEquippedShield); - } - - ReadOverworldEquipment("weapon", - mem::GamePtr::OverworldWeaponActor(), - mem::GamePtr::OverworldWeaponDurability(), mOverworldEquippedWeapon); - ReadOverworldEquipment("bow", mem::GamePtr::OverworldBowActor(), - mem::GamePtr::OverworldBowDurability(), mOverworldEquippedBow); - ReadOverworldEquipment("shield", mem::GamePtr::OverworldShieldActor(), - mem::GamePtr::OverworldShieldDurability(), mOverworldEquippedShield); -} - -void StateLevel2::WriteToGame() { - uking::ui::PauseMenuDataMgr* pPauseMenuDataMgr; - if (TakePtrOrError(named(mem::SafePtr(uking::ui::PauseMenuDataMgr::instance())), - &pPauseMenuDataMgr)) { - // update equipped weapons - pPauseMenuDataMgr->updateEquippedItemArray(); - - // Restore arrow, weapon, bow, shield - WriteInventoryEquipment( - "arrow", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Arrow), - mMenuEquippedArrow); - WriteInventoryEquipment( - "weapon", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Sword), - mMenuEquippedWeapon); - WriteInventoryEquipment("bow", - pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Bow), - mMenuEquippedBow); - WriteInventoryEquipment( - "shield", pPauseMenuDataMgr->getEquippedWeapon(uking::ui::PouchItemType::Shield), - mMenuEquippedShield); - } - - WriteOverworldEquipment("weapon", mem::GamePtr::OverworldWeaponActor(), - mem::GamePtr::OverworldWeaponDurability(), mOverworldEquippedWeapon); - WriteOverworldEquipment("bow", mem::GamePtr::OverworldBowActor(), - mem::GamePtr::OverworldBowDurability(), mOverworldEquippedBow); - WriteOverworldEquipment("shield", mem::GamePtr::OverworldShieldActor(), - mem::GamePtr::OverworldShieldDurability(), mOverworldEquippedShield); -} - -void StateLevel2::ReadFromFile(fs::ConfigFile& file, u32 version) { - if (version < 2) { - return; - } - file.ReadNamedInteger(mMenuEquippedArrow); - file.ReadNamedInteger(mMenuEquippedWeapon); - file.ReadNamedInteger(mMenuEquippedBow); - file.ReadNamedInteger(mMenuEquippedShield); - file.ReadNamedInteger(mOverworldEquippedWeapon); - file.ReadNamedInteger(mOverworldEquippedBow); - file.ReadNamedInteger(mOverworldEquippedShield); -} - -void StateLevel2::WriteToFile(fs::ConfigFile& file) const { - file.WriteNamedInteger(named(mMenuEquippedArrow)); - file.WriteNamedInteger(named(mMenuEquippedWeapon)); - file.WriteNamedInteger(named(mMenuEquippedBow)); - file.WriteNamedInteger(named(mMenuEquippedShield)); - file.WriteNamedInteger(named(mOverworldEquippedWeapon)); - file.WriteNamedInteger(named(mOverworldEquippedBow)); - file.WriteNamedInteger(named(mOverworldEquippedShield)); -} - -} // namespace botwsavs::core diff --git a/src_remove/StateLevel2.hpp b/src_remove/StateLevel2.hpp deleted file mode 100644 index 8a353d7..0000000 --- a/src_remove/StateLevel2.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include "StateStorage.hpp" -#include "util/NamedValue.hpp" - -namespace uking::ui { -class PouchItem; -} - -namespace ksys::act { -class BaseProc; -} -namespace botwsavs::core { - -class StateLevel2 : public StateStorage { -public: - void ReadFromGame() override; - void WriteToGame() override; - void ReadFromFile(fs::ConfigFile& file, u32 version) override; - void WriteToFile(fs::ConfigFile& file) const override; - -private: - void ReadInventoryEquipment(const char* name, uking::ui::PouchItem* pItem, - util::NamedValue& value); - void WriteInventoryEquipment(const char* name, uking::ui::PouchItem* pItem, - const util::NamedValue& value); - void ReadOverworldEquipment(const char* name, - const mem::SafePtr& safepActor, - const mem::SafePtr& safepDurability, - util::NamedValue& value); - void WriteOverworldEquipment(const char* name, - const mem::SafePtr& safepActor, - const mem::SafePtr& safepDurability, - const util::NamedValue& value); - util::NamedValue mMenuEquippedArrow{sInvalid}; - util::NamedValue mMenuEquippedWeapon{sInvalid}; - util::NamedValue mMenuEquippedBow{sInvalid}; - util::NamedValue mMenuEquippedShield{sInvalid}; - util::NamedValue mOverworldEquippedWeapon{sInvalid}; - util::NamedValue mOverworldEquippedBow{sInvalid}; - util::NamedValue mOverworldEquippedShield{sInvalid}; -}; - -} // namespace botwsavs::core diff --git a/src_remove/StateLevel3.cpp b/src_remove/StateLevel3.cpp deleted file mode 100644 index 76f9b24..0000000 --- a/src_remove/StateLevel3.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include -#include - -#include "fs/ConfigFile.hpp" -#include "fs/Logger.hpp" -#include "mem/GamePtr.h" - -#include "StateLevel3.hpp" - -namespace botwsavs::core { - -void StateLevel3::ReadFromGame() { - ReadMemory(named(mem::GamePtr::TimeOfDayPaused()), &mTimeOfDayPaused); - ReadMemory(named(mem::GamePtr::TimeOfDayUnpaused()), &mTimeOfDayUnpaused); - ReadMemory(named(mem::GamePtr::BloodMoonTimer()), &mBloodMoonTimer); - ReadMemory(named(mem::GamePtr::TemperatureDamageTimer()), &mTemperatureDamageTimer); - ReadMemory(named(mem::GamePtr::FlameTimer()), &mFlameTimer); - ReadMemory(named(mem::GamePtr::GaleTimer()), &mGaleTimer); - ReadMemory(named(mem::GamePtr::FuryTimer()), &mFuryTimer); - ReadMemory(named(mem::GamePtr::ProtectionTimer()), &mProtectionTimer); - ReadMemory(named(mem::GamePtr::GraceTimer()), &mGraceTimer); - ReadMemoryArray(named(mem::GamePtr::AbilityUses()), mAbilityUses, 3); - ReadMemory(named(mem::GamePtr::MasterSwordCooldown()), &mMasterSwordCooldown); - ReadMemory(named(mem::GamePtr::SpeedPotionTimer1()), &mSpeedPotionTimer1); - ReadMemory(named(mem::GamePtr::SpeedPotionTimer2()), &mSpeedPotionTimer2); - ReadMemory(named(mem::GamePtr::SpeedPotionTimer3()), &mSpeedPotionTimer3); - ReadMemory(named(mem::GamePtr::AttackPotionTimer()), &mAttackPotionTimer); - ReadMemory(named(mem::GamePtr::DefensePotionTimer()), &mDefensePotionTimer); - ReadMemory(named(mem::GamePtr::HeatResistPotionTimer()), &mHeatResistPotionTimer); - ReadMemory(named(mem::GamePtr::ColdResistPotionTimer()), &mColdResistPotionTimer); - ReadMemory(named(mem::GamePtr::FlameResistPotionTimer()), &mFlameResistPotionTimer); - ReadMemory(named(mem::GamePtr::ShockResistPotionTimer()), &mShockResistPotionTimer); - ReadMemory(named(mem::GamePtr::StealthPotionTimer()), &mStealthPotionTimer); - - uking::ui::PauseMenuDataMgr* pPauseMenuDataMgr; - if (TakePtrOrError(named(mem::SafePtr(uking::ui::PauseMenuDataMgr::instance())), - &pPauseMenuDataMgr)) { - // Save mCount Offset - s32 count = pPauseMenuDataMgr->getItems().size(); - s32 actualSize = pPauseMenuDataMgr->getItems().sizeSlow(); - mCountOffset = actualSize - count; - } -} - -void StateLevel3::WriteToGame() { - WriteMemory(named(mem::GamePtr::TimeOfDayPaused()), mTimeOfDayPaused); - WriteMemory(named(mem::GamePtr::TimeOfDayUnpaused()), mTimeOfDayUnpaused); - WriteMemory(named(mem::GamePtr::BloodMoonTimer()), mBloodMoonTimer); - WriteMemory(named(mem::GamePtr::TemperatureDamageTimer()), mTemperatureDamageTimer); - WriteMemory(named(mem::GamePtr::FlameTimer()), mFlameTimer); - WriteMemory(named(mem::GamePtr::GaleTimer()), mGaleTimer); - WriteMemory(named(mem::GamePtr::FuryTimer()), mFuryTimer); - WriteMemory(named(mem::GamePtr::ProtectionTimer()), mProtectionTimer); - WriteMemory(named(mem::GamePtr::GraceTimer()), mGraceTimer); - WriteMemoryArray(named(mem::GamePtr::AbilityUses()), mAbilityUses, 3); - WriteMemory(named(mem::GamePtr::MasterSwordCooldown()), mMasterSwordCooldown); - WriteMemory(named(mem::GamePtr::SpeedPotionTimer1()), mSpeedPotionTimer1); - WriteMemory(named(mem::GamePtr::SpeedPotionTimer2()), mSpeedPotionTimer2); - WriteMemory(named(mem::GamePtr::SpeedPotionTimer3()), mSpeedPotionTimer3); - WriteMemory(named(mem::GamePtr::AttackPotionTimer()), mAttackPotionTimer); - WriteMemory(named(mem::GamePtr::DefensePotionTimer()), mDefensePotionTimer); - WriteMemory(named(mem::GamePtr::HeatResistPotionTimer()), mHeatResistPotionTimer); - WriteMemory(named(mem::GamePtr::ColdResistPotionTimer()), mColdResistPotionTimer); - WriteMemory(named(mem::GamePtr::FlameResistPotionTimer()), mFlameResistPotionTimer); - WriteMemory(named(mem::GamePtr::ShockResistPotionTimer()), mShockResistPotionTimer); - WriteMemory(named(mem::GamePtr::StealthPotionTimer()), mStealthPotionTimer); - - uking::ui::PauseMenuDataMgr* pPauseMenuDataMgr; - if (TakePtrOrError(named(mem::SafePtr(uking::ui::PauseMenuDataMgr::instance())), - &pPauseMenuDataMgr)) { - // Set mCount Offset - s32 actualSize = pPauseMenuDataMgr->getItems().sizeSlow(); - s32 count = actualSize - mCountOffset; - pPauseMenuDataMgr->getItems().setSize(count); - } -} - -void StateLevel3::ReadFromFile(fs::ConfigFile& file, u32 version) { - if (version < 3) { - return; - } - file.ReadFloat(&mTimeOfDayPaused); - file.ReadFloat(&mTimeOfDayUnpaused); - file.ReadFloat(&mBloodMoonTimer); - file.ReadFloat(&mTemperatureDamageTimer); - file.ReadFloat(&mFlameTimer); - file.ReadFloat(&mGaleTimer); - file.ReadFloat(&mFuryTimer); - file.ReadFloat(&mProtectionTimer); - file.ReadFloat(&mGraceTimer); - file.ReadIntegerArray(mAbilityUses, 3); - file.ReadFloat(&mMasterSwordCooldown); - file.ReadFloat(&mSpeedPotionTimer1); - file.ReadFloat(&mSpeedPotionTimer2); - file.ReadFloat(&mSpeedPotionTimer3); - file.ReadFloat(&mAttackPotionTimer); - file.ReadFloat(&mDefensePotionTimer); - file.ReadFloat(&mHeatResistPotionTimer); - file.ReadFloat(&mColdResistPotionTimer); - file.ReadFloat(&mFlameResistPotionTimer); - file.ReadFloat(&mShockResistPotionTimer); - file.ReadFloat(&mStealthPotionTimer); - - if (version < 4) { - return; - } - // Version 4 - file.ReadInteger(&mCountOffset); -} - -void StateLevel3::WriteToFile(fs::ConfigFile& file) const { - file.WriteFloat(named(mTimeOfDayPaused)); - file.WriteFloat(named(mTimeOfDayUnpaused)); - file.WriteFloat(named(mBloodMoonTimer)); - file.WriteFloat(named(mTemperatureDamageTimer)); - file.WriteFloat(named(mFlameTimer)); - file.WriteFloat(named(mGaleTimer)); - file.WriteFloat(named(mFuryTimer)); - file.WriteFloat(named(mProtectionTimer)); - file.WriteFloat(named(mGraceTimer)); - file.WriteIntegerArray(named(mAbilityUses), 3); - file.WriteFloat(named(mMasterSwordCooldown)); - file.WriteFloat(named(mSpeedPotionTimer1)); - file.WriteFloat(named(mSpeedPotionTimer2)); - file.WriteFloat(named(mSpeedPotionTimer3)); - file.WriteFloat(named(mAttackPotionTimer)); - file.WriteFloat(named(mDefensePotionTimer)); - file.WriteFloat(named(mHeatResistPotionTimer)); - file.WriteFloat(named(mColdResistPotionTimer)); - file.WriteFloat(named(mFlameResistPotionTimer)); - file.WriteFloat(named(mShockResistPotionTimer)); - file.WriteFloat(named(mStealthPotionTimer)); - // Version 4 - file.WriteInteger(named(mCountOffset)); -} - -} // namespace botwsavs::core diff --git a/src_remove/StateStorage.hpp b/src_remove/StateStorage.hpp deleted file mode 100644 index 308d976..0000000 --- a/src_remove/StateStorage.hpp +++ /dev/null @@ -1,85 +0,0 @@ -#pragma once - -#include "fs/Logger.hpp" -#include "mem/SafePtr.hpp" -#include "types.h" - -namespace botwsavs { - -namespace fs { -class ConfigFile; -} - -namespace core { - -enum StateError : u32 { - None = 0, - Pointer = 1, - NotEquipped = 1 << 1, - DifferentName = 1 << 2, -}; - -class StateStorage { -public: - virtual void ReadFromGame(); - virtual void WriteToGame(); - virtual void ReadFromFile(fs::ConfigFile& file, u32 version); - virtual void WriteToFile(fs::ConfigFile& file) const; - - u32 GetErrorMask() const { return mError; } - bool HasError(StateError mask) const { return (mError & mask) != 0; } - bool HasAnyError() const { return mError != StateError::None; } - void ClearError() { mError = StateError::None; } - -protected: - void SetError(StateError mask) { mError = static_cast(mError | mask); } - // Helper functions for read/write game value - template - void ReadMemory(const char* name, mem::SafePtr ptr, T* out) { - if (!ptr.Get(out)) { - errorf("Read %s failed", name); - SetError(StateError::Pointer); - } - } - - template - void WriteMemory(const char* name, mem::SafePtr ptr, const T value) { - if (!ptr.Set(value)) { - errorf("Write %s failed", name); - SetError(StateError::Pointer); - } - } - - template - void ReadMemoryArray(const char* name, mem::SafePtr ptr, T* outArray, u32 size) { - if (!ptr.GetArray(outArray, size)) { - errorf("Read %s array failed", name); - SetError(StateError::Pointer); - } - } - - template - void WriteMemoryArray(const char* name, mem::SafePtr ptr, const T* outArray, u32 size) { - if (!ptr.SetArray(outArray, size)) { - errorf("Write %s array failed", name); - SetError(StateError::Pointer); - } - } - - template - bool TakePtrOrError(const char* name, mem::SafePtr ptr, T** out) { - if (!ptr.TakePtr(out)) { - errorf("Get pointer %s failed", name); - SetError(StateError::Pointer); - return false; - } - return true; - } - - StateError mError = StateError::None; - - static const u32 sInvalid = 0xFFFFFFFF; -}; - -} // namespace core -} // namespace botwsavs diff --git a/src_remove/StringBuffer.hpp b/src_remove/StringBuffer.hpp deleted file mode 100644 index eb24916..0000000 --- a/src_remove/StringBuffer.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include -#include - -#include "types.h" - -namespace botwsavs::util { - -template -class StringBuffer { -public: - StringBuffer() { Clear(); } - void Clear() { - mLen = 0; - EnsureTermination(); - } - const char* Content() const { return mContent; } - char* Last() { return mContent + mLen; } - u32 Len() const { return mLen; } - u32 StrLen() const { return strlen(mContent); } - - void IncLen(u32 size) { - if (size > 0) { - mLen += size; - if (mLen > L) { - mLen = L; - } - EnsureTermination(); - } - } - - void SafeAppend(const char* text) { - strncpy(Last(), text, L - mLen); - IncLen(strlen(text)); - } - - template - void SafeAppendF(const char* format, T value) { - IncLen(sprintf(Last(), format, value)); - } - - void EnsureTermination() { mContent[mLen] = '\0'; } - - bool IndexOf(char search, u32 from, u32* outIndex) { - for (u32 i = from; i < mLen; i++) { - if (mContent[i] == search) { - *outIndex = i; - return true; - } - } - return false; - } - - void SafeSet(u32 i, char c) { - if (i < mLen) { - mContent[i] = c; - } - } - - void SafeDeleteFront(u32 size) { - if (size > mLen) { - Clear(); - return; - } - for (u32 i = 0; i < mLen - size; i++) { - mContent[i] = mContent[i + size]; - } - mLen -= size; - EnsureTermination(); - } - - void SafeDeleteEnd(u32 size) { - if (mLen <= size) { - mLen = 0; - } else { - mLen -= size; - } - EnsureTermination(); - } - -private: - char mContent[L + 1]; - u32 mLen; -}; - -} // namespace botwsavs::util diff --git a/src_remove/Time.hpp b/src_remove/Time.hpp deleted file mode 100644 index 02d8586..0000000 --- a/src_remove/Time.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "StringBuffer.hpp" - -namespace botwsavs::util { -using TimeBuffer = StringBuffer<20>; -/** - * Get current time as string, format YYYY-MM-DD HH:MM:SS - */ -void CurrentTimeString(TimeBuffer& outBuffer); -} // namespace botwsavs::util diff --git a/src_remove/Worker.hpp b/src_remove/Worker.hpp deleted file mode 100644 index c512fee..0000000 --- a/src_remove/Worker.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include "fs/ConfigFile.hpp" - -#include "Controller.hpp" -#include "KeyMgr.hpp" -#include "State.hpp" - -#define WORKER_TXT_PATH "sd:/botwsavs/worker.txt" - -namespace botwsavs { - -namespace core { - -class Worker : fs::Config { -public: - enum class Mode { Active, Setting }; - // enum class Hold { - // None, - // ModeSwitch, - // IncreaseLevel, - // DecreaseLevel, - // }; - -public: - bool Init(); - // Return if work is successful - bool Work() { - if (!CanWork()) { - return false; - } - if (TrySwitchMode()) { - return true; - } - if (mMode == Mode::Active) { - return WorkActiveMode(); - } else { - return WorkSettingMode(); - } - } - - void Save(fs::ConfigFile& configFile) const override; - void Load(fs::ConfigFile& configFile) override; - -private: - // Core - bool CanWork() { return mController.IsInitialized(); } - bool WorkActiveMode(); - bool WorkSettingMode(); - bool TrySwitchMode(); - - // Save state to memory - void ExecuteSave(); - // Save state to file - void ExecuteSaveToFile(); - // Restore state from memory - void ExecuteRestore(); - // Restore state from file - void ExecuteRestoreFromFile(); - // Display the most important state error - void DisplayStateError(State& state); - // Save worker config - bool SaveConfig() const; - // Load worker config - bool LoadConfig(); - -public: - u32 mLevel = 1; - -private: - Controller mController; - KeyMgr mKeyMgr; - State mState; - Mode mMode = Mode::Active; -}; - -} // namespace core - -} // namespace botwsavs diff --git a/src_remove/WorkerActions.cpp b/src_remove/WorkerActions.cpp deleted file mode 100644 index 22a5a1a..0000000 --- a/src_remove/WorkerActions.cpp +++ /dev/null @@ -1,131 +0,0 @@ - -#include "Worker.hpp" -#include "fs/Logger.hpp" -#include "ui/OverlayString.hpp" - -namespace botwsavs::core { - -void Worker::ExecuteSave() { - info("Saving state to memory"); - if (mLevel == 0) { - error("Save failed because setting level is 0"); - return; - } - if (!mState.ReadFromGame(mLevel)) { - DisplayStateError(mState); - error("State read failed"); - return; - } - ui::ShowFormattedMessage("Saved state to memory (level %d)", mLevel); - info("State saved to memory"); -} - -void Worker::ExecuteSaveToFile() { - info("Saving state to file"); - if (mLevel == 0) { - error("Save failed because setting level is 0"); - return; - } - State tempState; - if (!tempState.ReadFromGame(mLevel)) { - DisplayStateError(tempState); - warnf("State read gives error 0x%x, but continuing to write file anyway", - tempState.GetErrorMask()); - } - - if (!tempState.WriteToFile()) { - ui::ShowError(); - error("File operation failed"); - return; - } - - ui::ShowFormattedMessage("Saved state to file (level %d)", mLevel); - info("State saved to file"); -} -void Worker::ExecuteRestore() { - info("Restoring state from memory"); - - if (mLevel == 0) { - error("Restore failed because setting level is 0"); - return; - } - - if (mState.GetLevel() == 0) { - error("Restore failed because state level is 0 (nothing stored)"); - ui::ShowCantDoThatRightNow(); - return; - } - - if (mState.GetLevel() < mLevel) { - error("Restore failed because state level is less than setting level"); - ui::ShowLevelError(mState.GetLevel()); - return; - } - - if (!mState.WriteToGame(mLevel)) { - DisplayStateError(mState); - error("State write failed"); - return; - } -#ifndef GOLD_RUSH - // Don't show restore message for gold rush - ui::ShowFormattedMessage("Restored state from memory (level %d)", mLevel); -#endif - info("State restored from memory"); -} - -void Worker::ExecuteRestoreFromFile() { - info("Restoring state from file"); - if (mLevel == 0) { - error("Restore failed because setting level is 0"); - return; - } - - State tempState; - if (!tempState.CanReadFromFile()) { - error("Restore failed because restore.txt does not exist"); - ui::ShowCantDoThatRightNow(); - return; - } - - if (!tempState.ReadFromFile()) { - ui::ShowError(); - error("File operation failed"); - return; - } - if (tempState.GetLevel() < mLevel) { - error("Restore failed because state level is less than setting level"); - ui::ShowLevelError(tempState.GetLevel()); - return; - } - - if (!tempState.WriteToGame(mLevel)) { - DisplayStateError(tempState); - error("State write failed"); - return; - } - -#ifndef GOLD_RUSH - // Don't show restore message for gold rush - ui::ShowFormattedMessage("Restored state from file (level %d)", mLevel); -#endif - info("State restored from file"); -} - -void Worker::DisplayStateError(State& state) { - if (state.HasError(StateError::DifferentName)) { - ui::ShowOverridenMessage("Warning: Some equipped items are different!"); - return; - } - - if (state.HasError(StateError::NotEquipped)) { - ui::ShowOverridenMessage("Warning: Something not equipped?"); - return; - } - - if (state.HasError(StateError::Pointer)) { - ui::ShowOverridenMessage("Pointer error!"); - } -} - -} // namespace botwsavs::core diff --git a/src_remove/WorkerConfig.cpp b/src_remove/WorkerConfig.cpp deleted file mode 100644 index c1ead60..0000000 --- a/src_remove/WorkerConfig.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "Worker.hpp" -#include "fs/Logger.hpp" - -namespace botwsavs::core { - -void Worker::Save(fs::ConfigFile& file) const { - file.WriteInteger(named(mLevel)); - mKeyMgr.Save(file); -} - -void Worker::Load(fs::ConfigFile& file) { - file.ReadInteger(&mLevel); - mKeyMgr.Load(file); -} - -bool Worker::SaveConfig() const { - info("Saving worker config to file"); - fs::ConfigFile configFile(WORKER_TXT_PATH); - - if (!configFile.Save(*this)) { - warn("File operation failed. Cannot save worker config."); - return false; - } - return true; -} - -bool Worker::LoadConfig() { - info("Loading worker config from file"); - fs::ConfigFile configFile(WORKER_TXT_PATH); - - if (!configFile.Load(*this)) { - warn("File operation failed. Cannot init worker config. Will use default values."); - return false; - } - return true; -} - -} // namespace botwsavs::core diff --git a/src_remove/WorkerCore.cpp b/src_remove/WorkerCore.cpp deleted file mode 100644 index 9114a6e..0000000 --- a/src_remove/WorkerCore.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "Worker.hpp" -#include "fs/Logger.hpp" -#include "ui/OverlayString.hpp" - -namespace botwsavs::core { - -bool Worker::Init() { - info("Init worker"); - - return LoadConfig(); -} - -bool Worker::TrySwitchMode() { - if (mController.IsOnlyHolding(mKeyMgr.mKeySwitchMode)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeySwitchMode, 3)) { - info("Switching mode"); - if (mMode == Mode::Active) { - mMode = Mode::Setting; - ui::ShowOverridenMessage("Save State: Setting Mode"); - } else { - mMode = Mode::Active; - ui::ShowOverridenMessage("Save State: Active Mode"); - } - mKeyMgr.ClearHold(); - } - return true; - } - - return false; -} -bool Worker::WorkActiveMode() { - if (mController.IsOnlyHolding(mKeyMgr.mKeySave)) { - ExecuteSave(); - } else if (mController.IsOnlyHolding(mKeyMgr.mKeySaveFile)) { - ExecuteSaveToFile(); - } else if (mController.IsOnlyHolding(mKeyMgr.mKeyRestore)) { - ExecuteRestore(); - } else if (mController.IsOnlyHolding(mKeyMgr.mKeyRestoreFile)) { - ExecuteRestoreFromFile(); - } - - return true; -} - -bool Worker::WorkSettingMode() { - if (mKeyMgr.IsConfiguring()) { - u32 newKey = mController.GetHoldKeys(); - KeyMgr::ConfigureResult result = mKeyMgr.FinishConfigure(newKey); - switch (result) { - case KeyMgr::ConfigureResult::Success: { - util::StringBuffer<120> buffer; - key::GetKeyString(newKey, buffer); - ui::ShowFormattedMessage("Configured: %s", buffer.Content()); - SaveConfig(); - break; - } - case KeyMgr::ConfigureResult::FailEmpty: - ui::ShowOverridenMessage("Key binding cannot be updated to none!"); - break; - case KeyMgr::ConfigureResult::FailRelease: - ui::ShowOverridenMessage("Holding keys changed, key binding change failed!"); - break; - case KeyMgr::ConfigureResult::Pending: - default: - break; - } - return true; - } - - if (mController.IsOnlyHolding(mKeyMgr.mKeyIncreaseLevel)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeyIncreaseLevel, 1)) { - info("Increase level"); - if (mLevel < 3) { - mLevel++; - SaveConfig(); - } - ui::ShowSetLevel(mLevel); - mKeyMgr.ClearHold(); - } - } else if (mController.IsOnlyHolding(mKeyMgr.mKeyDecreaseLevel)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeyDecreaseLevel, 1)) { - info("Decrease level"); - if (mLevel > 0) { - mLevel--; - SaveConfig(); - } - ui::ShowSetLevel(mLevel); - mKeyMgr.ClearHold(); - } - } else if (mController.IsOnlyHolding(mKeyMgr.mKeySave)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeySave, 3)) { - ui::ShowSetKeyBinding("memory save"); - mKeyMgr.StartConfigure(&mKeyMgr.mKeySave); - } - } else if (mController.IsOnlyHolding(mKeyMgr.mKeySaveFile)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeySaveFile, 3)) { - ui::ShowSetKeyBinding("file save"); - mKeyMgr.StartConfigure(&mKeyMgr.mKeySaveFile); - } - } else if (mController.IsOnlyHolding(mKeyMgr.mKeyRestore)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeyRestore, 3)) { - ui::ShowSetKeyBinding("memory restore"); - mKeyMgr.StartConfigure(&mKeyMgr.mKeyRestore); - } - } else if (mController.IsOnlyHolding(mKeyMgr.mKeyRestoreFile)) { - if (mKeyMgr.DidHoldFor(mKeyMgr.mKeyRestoreFile, 3)) { - ui::ShowSetKeyBinding("file restore"); - mKeyMgr.StartConfigure(&mKeyMgr.mKeyRestoreFile); - } - } else { - mKeyMgr.ClearHold(); - } - - return true; -} -} // namespace botwsavs::core diff --git a/src_remove/WorkerThread.cpp b/src_remove/WorkerThread.cpp deleted file mode 100644 index 7603446..0000000 --- a/src_remove/WorkerThread.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "WorkerThread.hpp" -#include -#include -#include -#include "Worker.hpp" -#include "fs/File.hpp" -#include "fs/Logger.hpp" - -namespace botwsavs::core { - -static nn::os::ThreadType sThread; - -void WorkerMain(void* arg) { - info("Worker thread started"); - - nn::TimeSpan shortWait = nn::TimeSpan::FromNanoSeconds(100000000); // 3f - nn::TimeSpan longWait = nn::TimeSpan::FromSeconds(5); - - Worker worker; - if (!worker.Init()) { - error("Worker init failed"); - } - - while (true) { - bool success = worker.Work(); - - nn::os::YieldThread(); // let other parts of OS do their thing - if (!success) { - nn::os::SleepThread(longWait); - } else { - nn::os::SleepThread(shortWait); - } - } - - info("Worker thread stopping"); -} - -void StartWorkerThread() { - const size_t stackSize = 0x80000; - void* threadStack = memalign(0x1000, stackSize); - - sThread.thread_name_addr = "botwsavs"; - nn::Result result = - nn::os::CreateThread(&sThread, WorkerMain, nullptr, threadStack, stackSize, 16, 0); - if (result.IsFailure()) { - return; - } - nn::os::StartThread(&sThread); -} - -} // namespace botwsavs::core diff --git a/src_remove/WorkerThread.hpp b/src_remove/WorkerThread.hpp deleted file mode 100644 index e255387..0000000 --- a/src_remove/WorkerThread.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace botwsavs { - -namespace core { - -void StartWorkerThread(); - -void WorkerMain(); - -} // namespace core - -} // namespace botwsavs diff --git a/src_remove/build.mk b/src_remove/build.mk deleted file mode 100644 index 316f022..0000000 --- a/src_remove/build.mk +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile -# This is for building .nso and .npdm -# The content in build directory are managed by this make file -# The other wrapper scripts are contained in Justfile - -ifeq ($(strip $(DEVKITPRO)),) -$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro") -endif - -include $(DEVKITPRO)/libnx/switch_rules - -#--------------------------------------------------------------------------------- -# Variables - -# Target name -TARGET := botwsavs - -# DIRECTORIES -# Build Output (This mk file operates inside the build folder) -BUILD_DIR := . -# Root Directory -ROOT_DIR := .. -# Dependencies -LIB_DIR := $(ROOT_DIR)/lib -# Our Sources -SOURCE_DIR := $(ROOT_DIR)/src/ -# Config files. These are needed to link -CONFIG_DIR := $(ROOT_DIR)/config -# Skyline (the injection framework) source -#SKYLINE_SRC := $(LIB_DIR)/locked/skyline/src - -# Scan for nested source directories -ALL_SOURCES_DIRS := $(shell find $(SOURCE_DIR) -type d) -# Library paths -LIBDIRS := $(PORTLIBS) $(LIBNX) -# Include paths -ALL_INCLUDE_DIRS := \ -$(SOURCE_DIR) \ -${LIB_DIR}/nnheaders/include \ -$(LIB_DIR)/sead/include \ -$(LIB_DIR)/botw -# $(LIB_DIR)/locked/skyline/include -# $(LIB_DIR)/locked/libeiffel/include -# $(LIB_DIR)/sync/agl/include - - -# ${LIB_DIR}/sync/xlink2/include -# ${LIB_DIR}/sync/botw/src - -# VPATH for make to search for files -VPATH := $(foreach dir,$(ALL_SOURCES_DIRS),$(CURDIR)/$(dir)) - -# Linker script for uking symbols -LDSCRIPT := $(CONFIG_DIR)/symbols.ld -# Linker version script -LINKER_VERSION_SCRIPT := $(CONFIG_DIR)/exported -# .specs file for linking -SWITCH_SPECS := $(CONFIG_DIR)/switch.specs -# Source files -CFILES := $(foreach dir,$(ALL_SOURCES_DIRS),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(ALL_SOURCES_DIRS),$(notdir $(wildcard $(dir)/*.cpp))) -SFILES := $(foreach dir,$(ALL_SOURCES_DIRS),$(notdir $(wildcard $(dir)/*.s))) - -# OUTPUT FILES - -# .o files -OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) -# .d files -DFILES := $(OFILES:.o=.d) -# Application json for generating npdm -APP_JSON := $(CONFIG_DIR)/app.json - -# CODE GEN OPTIONS -# Use CXX for linking -LD := $(CXX) -# Include path -INCLUDE := \ -$(foreach dir,$(ALL_INCLUDE_DIRS),-I$(CURDIR)/$(dir)) \ -$(foreach dir,$(LIBDIRS),-I$(dir)/include) -# Defines -DEFINES := -D__SWITCH__ -DSWITCH -DNNSDK $(EXTRA_DEFINES) -# Architecture -ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec -# C flags -CFLAGS := -g -Wall -ffunction-sections -O3 $(ARCH) $(DEFINES) $(INCLUDE) -# CXX flags -CXXFLAGS := $(CFLAGS) -fno-rtti -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -enable-libstdcxx-allocator=new -fpermissive -std=c++17 -# AS flags -ASFLAGS := -g $(ARCH) -# LD flags -LDFLAGS := -specs=$(SWITCH_SPECS) -g $(ARCH) -Wl,-Map,$(TARGET).map -Wl,--version-script=$(LINKER_VERSION_SCRIPT) -Wl,-init=__custom_init -Wl,-fini=__custom_fini -Wl,--export-dynamic -nodefaultlibs -# LD libs -LIBS := -lgcc -lstdc++ -u malloc -# LD lib paths -LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) -# DEPSDIR used by DEVKITPRO for exporting .d files -DEPSDIR ?= . - -#--------------------------------------------------------------------------------- -# Make Targets -.PHONY: all -all: $(TARGET).nso app.npdm - -# Make target ELF depend on all .o files -$(TARGET).elf : $(OFILES) $(SWITCH_SPECS) - -# Not sure why the default npdm rule fails. Redefining the rule here. -# The tool prints error message for missing fields in json. They are not important so we ignore the errors -app.npdm: $(APP_JSON) - npdmtool $(APP_JSON) $@ 2> /dev/null -# The rest of the build rules are specified by the devkitpro makefile - -# Include the .d files generated --include $(DFILES) diff --git a/src_remove/config/app.json b/src_remove/config/app.json deleted file mode 100644 index 138465d..0000000 --- a/src_remove/config/app.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "name": "Application", - "title_id": "0x01007ef00011e000", - "title_id_range_min": "0x0100000000010000", - "title_id_range_max": "0x01ffffffffffffff", - "main_thread_stack_size": "0x00100000", - "main_thread_priority": 44, - "default_cpu_id": 0, - "process_category": 0, - "is_retail": true, - "pool_partition": 0, - "is_64_bit": true, - "address_space_type": 3, - "filesystem_access": { - "permissions": "0xFFFFFFFFFFFFFFFF" - }, - "service_access": ["*"], - "service_host": [], - "kernel_capabilities": [{ - "type": "kernel_flags", - "value": { - "highest_thread_priority": 59, - "lowest_thread_priority": 28, - "lowest_cpu_id": 0, - "highest_cpu_id": 3 - } - }, { - "type": "syscalls", - "value": { - "svcUnknown": "0x00", - "svcSetHeapSize": "0x01", - "svcSetMemoryPermission": "0x02", - "svcSetMemoryAttribute": "0x03", - "svcMapMemory": "0x04", - "svcUnmapMemory": "0x05", - "svcQueryMemory": "0x06", - "svcExitProcess": "0x07", - "svcCreateThread": "0x08", - "svcStartThread": "0x09", - "svcExitThread": "0x0a", - "svcSleepThread": "0x0b", - "svcGetThreadPriority": "0x0c", - "svcSetThreadPriority": "0x0d", - "svcGetThreadCoreMask": "0x0e", - "svcSetThreadCoreMask": "0x0f", - "svcGetCurrentProcessorNumber": "0x10", - "svcSignalEvent": "0x11", - "svcClearEvent": "0x12", - "svcMapSharedMemory": "0x13", - "svcUnmapSharedMemory": "0x14", - "svcCreateTransferMemory": "0x15", - "svcCloseHandle": "0x16", - "svcResetSignal": "0x17", - "svcWaitSynchronization": "0x18", - "svcCancelSynchronization": "0x19", - "svcArbitrateLock": "0x1a", - "svcArbitrateUnlock": "0x1b", - "svcWaitProcessWideKeyAtomic": "0x1c", - "svcSignalProcessWideKey": "0x1d", - "svcGetSystemTick": "0x1e", - "svcConnectToNamedPort": "0x1f", - "svcSendSyncRequestLight": "0x20", - "svcSendSyncRequest": "0x21", - "svcSendSyncRequestWithUserBuffer": "0x22", - "svcSendAsyncRequestWithUserBuffer": "0x23", - "svcGetProcessId": "0x24", - "svcGetThreadId": "0x25", - "svcBreak": "0x26", - "svcOutputDebugString": "0x27", - "svcReturnFromException": "0x28", - "svcGetInfo": "0x29", - "svcFlushEntireDataCache": "0x2a", - "svcFlushDataCache": "0x2b", - "svcMapPhysicalMemory": "0x2c", - "svcUnmapPhysicalMemory": "0x2d", - "svcGetFutureThreadInfo": "0x2e", - "svcGetLastThreadInfo": "0x2f", - "svcGetResourceLimitLimitValue": "0x30", - "svcGetResourceLimitCurrentValue": "0x31", - "svcSetThreadActivity": "0x32", - "svcGetThreadContext3": "0x33", - "svcWaitForAddress": "0x34", - "svcSignalToAddress": "0x35", - "svcDumpInfo": "0x3c", - "svcDumpInfoNew": "0x3d", - "svcCreateSession": "0x40", - "svcAcceptSession": "0x41", - "svcReplyAndReceiveLight": "0x42", - "svcReplyAndReceive": "0x43", - "svcReplyAndReceiveWithUserBuffer": "0x44", - "svcCreateEvent": "0x45", - "svcMapPhysicalMemoryUnsafe": "0x48", - "svcUnmapPhysicalMemoryUnsafe": "0x49", - "svcSetUnsafeLimit": "0x4a", - "svcCreateCodeMemory": "0x4b", - "svcControlCodeMemory": "0x4c", - "svcSleepSystem": "0x4d", - "svcReadWriteRegister": "0x4e", - "svcSetProcessActivity": "0x4f", - "svcCreateSharedMemory": "0x50", - "svcMapTransferMemory": "0x51", - "svcUnmapTransferMemory": "0x52", - "svcCreateInterruptEvent": "0x53", - "svcQueryPhysicalAddress": "0x54", - "svcQueryIoMapping": "0x55", - "svcCreateDeviceAddressSpace": "0x56", - "svcAttachDeviceAddressSpace": "0x57", - "svcDetachDeviceAddressSpace": "0x58", - "svcMapDeviceAddressSpaceByForce": "0x59", - "svcMapDeviceAddressSpaceAligned": "0x5a", - "svcMapDeviceAddressSpace": "0x5b", - "svcUnmapDeviceAddressSpace": "0x5c", - "svcInvalidateProcessDataCache": "0x5d", - "svcStoreProcessDataCache": "0x5e", - "svcFlushProcessDataCache": "0x5f", - "svcDebugActiveProcess": "0x60", - "svcBreakDebugProcess": "0x61", - "svcTerminateDebugProcess": "0x62", - "svcGetDebugEvent": "0x63", - "svcContinueDebugEvent": "0x64", - "svcGetProcessList": "0x65", - "svcGetThreadList": "0x66", - "svcGetDebugThreadContext": "0x67", - "svcSetDebugThreadContext": "0x68", - "svcQueryDebugProcessMemory": "0x69", - "svcReadDebugProcessMemory": "0x6a", - "svcWriteDebugProcessMemory": "0x6b", - "svcSetHardwareBreakPoint": "0x6c", - "svcGetDebugThreadParam": "0x6d", - "svcGetSystemInfo": "0x6f", - "svcCreatePort": "0x70", - "svcManageNamedPort": "0x71", - "svcConnectToPort": "0x72", - "svcSetProcessMemoryPermission": "0x73", - "svcMapProcessMemory": "0x74", - "svcUnmapProcessMemory": "0x75", - "svcQueryProcessMemory": "0x76", - "svcMapProcessCodeMemory": "0x77", - "svcUnmapProcessCodeMemory": "0x78", - "svcCreateProcess": "0x79", - "svcStartProcess": "0x7a", - "svcTerminateProcess": "0x7b", - "svcGetProcessInfo": "0x7c", - "svcCreateResourceLimit": "0x7d", - "svcSetResourceLimitLimitValue": "0x7e", - "svcCallSecureMonitor": "0x7f" - } - }, { - "type": "application_type", - "value": 1 - }, { - "type": "min_kernel_version", - "value": "0x0060" - }, { - "type": "handle_table_size", - "value": 512 - }, { - "type": "debug_flags", - "value": { - "allow_debug": true, - "force_debug": false - } - }] -} diff --git a/src_remove/config/application.ld b/src_remove/config/application.ld deleted file mode 100644 index 22305bb..0000000 --- a/src_remove/config/application.ld +++ /dev/null @@ -1,172 +0,0 @@ -OUTPUT_FORMAT(elf64-littleaarch64) -OUTPUT_ARCH(aarch64) - -PHDRS -{ - text PT_LOAD FLAGS(5); - rodata PT_LOAD FLAGS(4); - data PT_LOAD FLAGS(6); - dynamic PT_DYNAMIC; -} - -SECTIONS -{ - PROVIDE(__start__ = 0x0); - . = __start__; - __code_start__ = .; - - /* App code */ - .text : { - HIDDEN(__text_start__ = .); - KEEP (*(.text.crt0)) - *(.text .text.*) - HIDDEN(__text_end__ = .); - } :text - - /* Trampoline and stuffs */ - .plt : { *(.plt .plt.*) } :text - __code_end__ = .; - - /* Read-only sections */ - . = ALIGN(0x1000); - - /* App name */ - .module_name : { KEEP (*(.rodata.module_name)) } :rodata - - /* Make sure everything is aligned */ - . = ALIGN(8); - - /* App rodata */ - .rodata : { - *(.rodata .rodata.*) - } :rodata - - /* All the symbols needed for relocation lookup */ - .hash : { *(.hash) } :rodata - .gnu.hash : { *(.gnu.hash) } :rodata - .dynsym : { *(.dynsym .dynsym.*) } :rodata - .dynstr : { *(.dynstr .dynstr.*) } :rodata - - __rel_dyn_start__ = .; - .rel.dyn : { *(.rel.dyn) } :rodata - __rel_dyn_end__ = .; - - __rela_dyn_start__ = .; - .rela.dyn : { *(.rela.dyn) } :rodata - __rela_dyn_end__ = .; - - __rel_plt_start__ = .; - .rel.plt : { *(.rel.plt) } :rodata - __rel_plt_end__ = .; - - __rela_plt_start__ = .; - .rela.plt : { *(.rela.plt) } :rodata - __rela_plt_end__ = .; - - /* All exception handling sections */ - .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } :rodata - .eh_frame_hdr : { - HIDDEN(__eh_frame_hdr_start__ = .); - *(.eh_frame_hdr) - HIDDEN(__eh_frame_hdr_end__ = .); - } :rodata - .eh_frame : { KEEP (*(.eh_frame)) } :rodata - - /* Misc .rodata stuffs (build-id, ect) */ - .note.gnu.build-id : { *(.note.gnu.build-id) } :rodata - - /* Read-write sections */ - . = ALIGN(0x1000); - - /* App data */ - .data : { - *(.data .data.*) - } :data - - /* This section should be made read only after relocation but in practice we will not do that */ - .data.rela.ro : { - *(.data.rela.ro.local*) - *(.data.rela.ro .data.rela.ro.*) - } :data - - /* This section should be made read only after relocation but in practice we will not do that */ - .data.rel.ro : { - *(.data.rel.ro.local*) - *(.data.rel.ro .data.rel.ro.*) - } :data - - /* All GOT sections */ - __got_start__ = .; - .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) } :data - __got_end__ = .; - - /* The dynamic section as we need it to be stored in the binary */ - .dynamic : { - HIDDEN(__dynamic_start__ = .); - *(.dynamic) - } :data :dynamic - - /* Align for .init_array/.fini_array */ - . = ALIGN(8); - - .preinit_array ALIGN(8) : - { - PROVIDE (__preinit_array_start__ = .); - KEEP (*(.preinit_array)) - PROVIDE (__preinit_array_end__ = .); - } :data - - /* App init array */ - .init_array : { - PROVIDE (__init_array_start__ = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) - KEEP (*(.init_array)) - PROVIDE (__init_array_end__ = .); - } :data - - /* App fini array */ - .fini_array : { - PROVIDE (__fini_array_start__ = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) - KEEP (*(.fini_array)) - PROVIDE (__fini_array_end__ = .); - } :data - - /* Thread Local sections */ - - .tdata : { - __tdata_align_abs__ = ABSOLUTE(.); - __tdata_start__ = .; - *(.tdata .tdata.*) - __tdata_end__ = .; - } :data - - .tbss : { - __tbss_align_abs__ = ABSOLUTE(.); - __tbss_start__ = .; - *(.tbss .tbss.*) - *(.tcommon) - __tbss_end__ = .; - } :data - - /* BSS section */ - . = ALIGN(0x1000); - - .bss : { - HIDDEN(__bss_start__ = .); - *(.bss .bss.*) - *(COMMON) - . = ALIGN(8); - HIDDEN(__bss_end__ = .); - . = ALIGN(0x1000); - } :data - - __end__ = ABSOLUTE(.); - - HIDDEN(__argdata__ = .); - - /DISCARD/ : { - /* No need of the interpreter */ - *(.interp) - } -} diff --git a/src_remove/config/exported b/src_remove/config/exported deleted file mode 100644 index 8572f84..0000000 --- a/src_remove/config/exported +++ /dev/null @@ -1,8 +0,0 @@ -{ - global: - __custom_init; - __custom_fini; - _ZN8botwsavs2ui20GetMessageStringHookEPvRN4sead14SafeStringBaseIcEEPNS0_10WideStringE; - - local: *; -}; diff --git a/src_remove/config/switch.specs b/src_remove/config/switch.specs deleted file mode 100644 index 0d4fc34..0000000 --- a/src_remove/config/switch.specs +++ /dev/null @@ -1,7 +0,0 @@ -%rename link old_link - -*link: -%(old_link) -T ../config/application.ld ../config/symbols.ld --shared --gc-sections --build-id=sha1 - -*startfile: -crti%O%s crtbegin%O%s diff --git a/src_remove/config/symbols.ld b/src_remove/config/symbols.ld deleted file mode 100644 index 097a684..0000000 --- a/src_remove/config/symbols.ld +++ /dev/null @@ -1,6 +0,0 @@ -blank = 0; -_ZN8botwsavs3mem7KingPtr10MainMemoryE = 0x0 - 0x3483000; /* MainMemory */ -_ZN8botwsavs3mem7KingPtr22sControllerMgrInstanceE = 0x2CBF658 - 0x3483000; /* sControllerMgrInstance */ -_ZN8botwsavs3mem7KingPtr25ShowInfoOverlayWithStringEmPKv = 0x1238680 - 0x3483000; /* ShowInfoOverlayWithString */ -_ZN8botwsavs3mem7KingPtr16GetMessageStringEPvS2_S2_ = 0x123DEA0 - 0x3483000; /* GetMessageString */ -_ZN5uking2ui16PauseMenuDataMgr9sInstanceE = 0x02CA6D50 - 0x3483000; /* PauseMenu */ diff --git a/src_remove/config/workspace.toml b/src_remove/config/workspace.toml deleted file mode 100644 index 433c22e..0000000 --- a/src_remove/config/workspace.toml +++ /dev/null @@ -1,36 +0,0 @@ -[ftp] -crash_reports = "atmosphere/crash_reports" -runtime = "botwsavs" - -# Mod files -[[ftp.file]] -local = "build-DDEBUG/botwsavs.nso" -target = "atmosphere/contents/01007EF00011E000/exefs/subsdk9" - -[[ftp.file]] -local = "build-DDEBUG/app.npdm" -target = "atmosphere/contents/01007EF00011E000/exefs/main.npdm" - -[[ftp.file]] -local = "build-DDEBUG/8E9978D50BDD20B4C8395A106C27FFDE.ips" -target = "atmosphere/exefs_patches/botwsavs/8E9978D50BDD20B4C8395A106C27FFDE.ips" - -[ips] -mod_offset = "0x3483000" # this is used for address conversion for branching - -[ips.main160] -id = "8E9978D50BDD20B4C8395A106C27FFDE" -offset = "0" - -# Runtime placeholder/version files -[[ftp.file]] -local = "build-DDEBUG/DebugVersion.txt" -target = "botwsavs/main.log" - -[[ftp.file]] -local = "build-DDEBUG/DebugVersion.txt" -target = "botwsavs/latest.txt" - -[[ftp.file]] -local = "build-DDEBUG/DebugVersion.txt" -target = "atmosphere/contents/01007EF00011E000/romfs/System/Version.txt" diff --git a/src_remove/crt0.s b/src_remove/crt0.s deleted file mode 100644 index 5d99cc2..0000000 --- a/src_remove/crt0.s +++ /dev/null @@ -1,60 +0,0 @@ -.section ".text.crt0","ax" -.global __module_start -.extern __nx_module_runtime - -__module_start: - b startup - .word __nx_mod0 - __module_start - -.org __module_start+0x80 -startup: - // save lr - mov x7, x30 - - // get aslr base - bl +4 - sub x6, x30, #0x88 - - // context ptr and main thread handle - mov x5, x0 - mov x4, x1 -bssclr_start: - mov x27, x7 - mov x25, x5 - mov x26, x4 - - // clear .bss - adrp x0, __bss_start__ - adrp x1, __bss_end__ - add x0, x0, #:lo12:__bss_start__ - add x1, x1, #:lo12:__bss_end__ - sub x1, x1, x0 // calculate size - add x1, x1, #7 // round up to 8 - bic x1, x1, #7 - -bss_loop: - str xzr, [x0], #8 - subs x1, x1, #8 - bne bss_loop - - // store stack pointer - mov x1, sp - adrp x0, __stack_top - str x1, [x0, #:lo12:__stack_top] - - // initialize system - mov x0, x25 - mov x1, x26 - mov x2, x27 - .word deadbeef - -.section ".rodata.mod0" -.global __nx_mod0 -__nx_mod0: - .ascii "MOD0" - .word __dynamic_start__ - __nx_mod0 - .word __bss_start__ - __nx_mod0 - .word __bss_end__ - __nx_mod0 - .word 0 - .word 0 - .word __nx_module_runtime - __nx_mod0 diff --git a/src_remove/crti.c b/src_remove/crti.c deleted file mode 100644 index 78848a5..0000000 --- a/src_remove/crti.c +++ /dev/null @@ -1,13 +0,0 @@ - -void* __stack_top; - -void application_init(void); -void application_clean(void); - -void __custom_init(void){ - application_init(); -} - -void __custom_fini(void){ - application_clean(); -} diff --git a/src_remove/fs/Logger.cpp b/src_remove/fs/Logger.cpp deleted file mode 100644 index 78ae3cf..0000000 --- a/src_remove/fs/Logger.cpp +++ /dev/null @@ -1,62 +0,0 @@ - -#include "Logger.hpp" -#include -#include "util/Time.hpp" - -namespace botwsavs::fs { - -void Logger::Init() { - if (mReady) { - return; - } - if (!mFile.Exists()) { - if (!mFile.Create()) { - return; - } - } - - bool result = mFile.Open(); - if (!result) { - return; - } - result = mFile.Clear(); - if (!result) { - return; - } - mReady = true; -} - -void Logger::Close() { - if (mFile.isOpened()) { - mFile.Close(); - } - mReady = false; -} - -void Logger::Log(const char* level, const char* message) { - if (!mReady || mLogging) { - return; - } - mLogging = true; - FileBuffer buffer; - buffer.SafeAppend(message); - mLogging = false; - Log(level, buffer); -} - -void Logger::Log(const char* level, const FileBuffer& content) { - if (!mReady || mLogging) { - return; - } - mLogging = true; - mOutputBuffer.Clear(); - util::TimeBuffer time; - util::CurrentTimeString(time); - mOutputBuffer.SafeAppendF("[%s]", time.Content()); - mOutputBuffer.SafeAppendF("[%s]", level); - mOutputBuffer.SafeAppendF("%s\n", content.Content()); - mLogging = false; - mFile.Write(mOutputBuffer); -} - -} // namespace botwsavs::fs diff --git a/src_remove/fs/Logger.hpp b/src_remove/fs/Logger.hpp deleted file mode 100644 index 435ec34..0000000 --- a/src_remove/fs/Logger.hpp +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once -#include -#include -#include - -#include "File.hpp" -#include "util/StringBuffer.hpp" - -namespace botwsavs::fs { -// Note that Logger is not thread safe -class Logger { -public: - static Logger& Instance() { - static Logger sInstance; - return sInstance; - } - -private: - Logger() {} - -public: - Logger(Logger const&) = delete; - void operator=(Logger const&) = delete; - ~Logger(); - - void Init(); - void Close(); - - void Log(const char* level, const char* message); - - void Log(const char* level, const FileBuffer& message); - - template - void LogF(const char* level, const char* format, T value) { - FileBuffer b; - b.SafeAppendF(format, value); - Log(level, b); - } - - void Info(const char* message) { Log("info", message); } - - void Info(const FileBuffer& message) { Log("info", message); } - - template - void InfoF(const char* format, T value) { - LogF("info", format, value); - } - - void Warn(const char* message) { Log("warn", message); } - - void Warn(const FileBuffer& message) { Log("warn", message); } - - template - void WarnF(const char* format, T value) { - LogF("warn", format, value); - } - - void Error(const char* message) { Log("error", message); } - - void Error(const FileBuffer& message) { Log("error", message); } - - template - void ErrorF(const char* format, T value) { - LogF("error", format, value); - } - - void Debug(const char* message) { Log("debug", message); } - - void Debug(const FileBuffer& message) { Log("debug", message); } - - template - void DebugF(const char* format, T value) { - LogF("debug", format, value); - } - -private: - bool mReady = false; - // prevent logger error being logged and going into infinite recursion - bool mLogging = false; - File mFile{"sd:/botwsavs/main.log"}; - FileBuffer mOutputBuffer; -}; - -} // namespace botwsavs::fs diff --git a/src_remove/ips.py b/src_remove/ips.py deleted file mode 100644 index b7cf5f3..0000000 --- a/src_remove/ips.py +++ /dev/null @@ -1,364 +0,0 @@ -#pylint: disable=import-error -"""Generate ips patch""" -from os.path import isfile, isdir, join -from os import listdir -import enum -import sys -import re -import ctypes -import struct -import keystone -import toml - -# consts -SRC = "patch" -PATCH_EXTENSION = ".patch.s" -MOD_NAME = "botwsavs" - -NSO_HEADER_LEN = 0x100 - -IPS_FORMAT = ".ips" -IPS_HEADER_MAGIC = bytes("IPS32", 'ASCII') -IPS_EOF_MAGIC = bytes("EEOF", 'ASCII') - -WORKSPACE_TOML = "config/workspace.toml" - -BUILD_DIR = "build" -def read_config(): - """Read config from workspace.toml""" - # pylint: disable-next=global-statement - global BUILD_DIR - - if len(sys.argv) > 1: - BUILD_DIR = sys.argv[1] - - if isfile(WORKSPACE_TOML): - with open(WORKSPACE_TOML, "r", encoding="utf-8") as config_file: - return toml.load(config_file)["ips"] - print("Cannot read config") - sys.exit(-1) - -class Patch: - """Data for patch. offset and byte array content""" - def __init__(self, offset, content): - self.offset = offset + NSO_HEADER_LEN - self.content = content - - def __str__(self): - return f"{hex(self.offset)}:{len(self.content)}:{self.content.hex()}" - - def __repr__(self) -> str: - return str(self) - -class PatchType(enum.Enum): - """Enum for patch type""" - UNKNOWN = 0 - BYTES = 1 - STRING = 2 - ASSEMBLY = 3 - -def run(): - """Main""" - ips_config = read_config() - if ips_config is None: - print("Error: cannot read ips config") - sys.exit(-1) - - # build_id: string -> Patch[] - id_to_patchlist = {} - mod_offset = int(ips_config["mod_offset"], 16) - fail_count = process_path(SRC, mod_offset, ips_config, id_to_patchlist) - if fail_count > 0: - print("Failed to compile ips patches") - sys.exit(fail_count) - - for build_id, patch_list in id_to_patchlist.items(): - #print(id) - ips_path = join(BUILD_DIR, build_id + IPS_FORMAT) - with open(ips_path, 'wb') as ips_file: - ips_file.write(IPS_HEADER_MAGIC) - for patch in patch_list: - #print(patch) - ips_file.write(struct.pack('>I', patch.offset)) - ips_file.write(struct.pack('>H', len(patch.content))) - ips_file.write(patch.content) - ips_file.write(IPS_EOF_MAGIC) - print("Generated", ips_path) - -def process_path(path, mod_offset, ips_config, id_to_patchlist): - """ - Recursively compiles the all source patches in directory - See compile_patch - Return the number of files that failed to compile - """ - - if isfile(path): - if path.endswith(PATCH_EXTENSION): - return 0 if compile_patch(path, mod_offset, ips_config, id_to_patchlist) else 1 - return 0 - - if isdir(path): - fail_count = 0 - for sub_path in listdir(path): - fail_count += process_path( \ - join(path, sub_path), mod_offset, ips_config, id_to_patchlist) - return fail_count - - return 0 - -def compile_patch(path, mod_offset, ips_config, id_to_patchlist): - """ - Compile the patch. - Adds the patch to patch list if successful. - Returns whether the compilation was successful - - path File path - mod_offset The offset for mod relative to start of main, - used for calculating branches in asm patches - ips_config The ips config, used to read offsets for targets - (i.e. ips_config[target]["offset"] - id_to_patchlist The map (string -> Patch[]) to add the patches to - """ - - target = None - mod_offset_from_target = 0 - # int -> bytearray - target_to_addr_to_patchbytes = {} - address = 0 - patch_type = PatchType.UNKNOWN - - with open(path, "r", encoding="utf-8") as patch_file: - for i, line in enumerate(patch_file): - # Strip off comments - line = line.split(';', 1)[0].strip() - # Skip empty lines - if len(line) == 0: - continue - - # Process directives - if line.startswith(".target "): - target = line.split(' ', 1)[1].strip() - target_offset = int(ips_config[target]["offset"], 16) - mod_offset_from_target = mod_offset - target_offset - continue - if line.startswith(".asm"): - patch_type = PatchType.ASSEMBLY - continue - if line.startswith(".bytes"): - patch_type = PatchType.BYTES - continue - if line.startswith(".string"): - patch_type = PatchType.STRING - continue - - # parse patches - if target is None: - print_build_error(path, i, "Target not specified") - return False - # if address starts with 0x, set the address - if line.startswith("0x"): - address_split = line.split(' ', 1) - - address = int(address_split[0], 16) - if len(address_split) < 2: - continue - line = address_split[1] - - if patch_type is None or patch_type == PatchType.UNKNOWN: - print_build_error(path, i, "Patch type not specified. Use \ -.asm, .bytes or .string to specify the type of the patch") - return False - patch_content = \ - produce_patch_content(patch_type, line, address, mod_offset_from_target) - - if patch_content is None: - print_build_error(path, i, "Failed to compile") - return False - - add_patch_line(target_to_addr_to_patchbytes, target, address, patch_content) - - add_to_patch_map(target_to_addr_to_patchbytes, id_to_patchlist, ips_config) - - print(f"Compiled {path}") - return True - -def produce_patch_content(patch_type, line, address, mod_offset_from_target): - """ Produce patch bytes according to type, or None if type is not valid""" - if patch_type == PatchType.BYTES: - return gen_bytes_patch_bytes(line) - if patch_type == PatchType.STRING: - return gen_string_patch_bytes(line) - if patch_type == PatchType.ASSEMBLY: - return gen_asm_patch_bytes(address, line, mod_offset_from_target) - - return None - -def add_patch_line(target_to_addr_to_patchbytes, target, address, patch_content): - """ Add patch_content to the map""" - if target not in target_to_addr_to_patchbytes: - target_to_addr_to_patchbytes[target] = {} - addr_to_patchbytes = target_to_addr_to_patchbytes[target] - if address not in addr_to_patchbytes: - addr_to_patchbytes[address] = patch_content - else: - addr_to_patchbytes[address] = addr_to_patchbytes[address] + patch_content - -def add_to_patch_map(target_to_addr_to_patchbytes, id_to_patchlist, ips_config): - """ Optimize the compiled patch pieces and add to patch list """ - # Generate a list of patches - for tar in target_to_addr_to_patchbytes: - addr_to_patchbytes = target_to_addr_to_patchbytes[tar] - build_id = ips_config[tar]["id"] - if build_id not in id_to_patchlist: - id_to_patchlist[build_id] = [] - patchlist = id_to_patchlist[build_id] - # Optimize patches - start_addr = None - current_addr = None - current_patch = None - for addr in sorted(addr_to_patchbytes): - if current_addr == addr: - # The patches are next to each other, we can just append - next_patch = addr_to_patchbytes[addr] - current_patch = current_patch+next_patch - current_addr = current_addr+len(next_patch) - else: - if start_addr is not None: - patchlist.append(Patch(start_addr, current_patch)) - next_patch = addr_to_patchbytes[addr] - start_addr = addr - current_addr = addr+len(next_patch) - current_patch = next_patch - if start_addr is not None: - patchlist.append(Patch(start_addr, current_patch)) - -def gen_bytes_patch_bytes(hex_str): - """ Return bytes """ - try: - return bytearray.fromhex(hex_str) - except ValueError: - print(f"Error: invalid bytes format: {hex_str}") - return None - -def gen_string_patch_bytes(content): - """ Return bytes containing utf-8 string """ - match = re.search(r'"(.+)"', content) - if match: - return bytearray(bytes(match.group(1), 'utf-8').decode('unicode_escape') + '\0', 'utf-8') - print(f"Error: invalid string format: {content}") - return None - -ASSEMBLER = keystone.Ks(keystone.KS_ARCH_ARM64, keystone.KS_MODE_LITTLE_ENDIAN) -def gen_asm_patch_bytes(address, assembly_code_str, mod_offset_from_target): - """ - Return bytes containing code, or None if an error occurs - address Address of the instruction, - relative to start of target - assembly_code_str Code - mod_offset_from_target Offset from target binary to mod - """ - # asm patch - bl_match = re.match(r'([Bb][Ll]?\s+)([^\#]+$)', assembly_code_str) - if bl_match: - branch_instruction = bl_match.group(1) - branch_symbol = bl_match.group(2) - branch_offset = resolve_bl_symbol(address,mod_offset_from_target, branch_symbol) - if branch_offset is None: - print(f"^ Failed to assemble instruction: {assembly_code_str}") - return None - assembly_code_str = f"{branch_instruction}#{hex(branch_offset)}" - - encoded_bytes, _ = ASSEMBLER.asm(assembly_code_str) - return bytearray(encoded_bytes) - -def print_build_error(file, line_num, error): - """ Print build error """ - print(f"Error in {file}:{line_num}: {error}") - -def resolve_bl_symbol(branch_address, mod_offset_from_target, branch_symbol): - """ - Return the offset for branching - - branch_address Where the bl instruction is, relative to start of target - mod_offset_from_target Offset from target binary to mod - branch_symbol The symbol to resolve; - can be a symbol in mod or address - relative to the load offset - """ - - target_address = 0 # relative to start of target - # resolve offset - plus_split = branch_symbol.split('+', 1) - if len(plus_split) > 1: - branch_symbol = plus_split[0] - target_address += int(plus_split[1], 16) - - # If the symbol is an address - if branch_symbol.startswith("0x"): - target_address += int(branch_symbol, 16) - return target_address - branch_address - - # If not, try searching the symbol in mod - symbol_address = search_mod_symbol_addr(branch_symbol) - if symbol_address is not None: - target_address += symbol_address - target_address += mod_offset_from_target - return target_address - branch_address - - print(f"^ Failed to resolve branch symbol: {branch_symbol}") - return None - -# Memoization -BOTW_IGD_SYMBOL_MAP = None -BOTW_IGD_SYMBOL_CACHE = {} -def search_mod_symbol_addr(symbol): - """ - Return the address of the symbol in mod, relative to start of mod - If not found, None is returned - The result is memoized - """ - # pylint: disable-next=global-statement - global BOTW_IGD_SYMBOL_MAP - if symbol in BOTW_IGD_SYMBOL_CACHE: - return BOTW_IGD_SYMBOL_CACHE[symbol] - # Lazy load symbol map - if BOTW_IGD_SYMBOL_MAP is None: - with open(join(BUILD_DIR, f"{MOD_NAME}.map"), 'r', encoding="utf-8") as map_file: - BOTW_IGD_SYMBOL_MAP = map_file.read() - - func_search_regex = symbol + r'\(' - pos, address = find_symbol_address(func_search_regex, 0, BOTW_IGD_SYMBOL_MAP) - if pos == -1: - print(f"Error: Cannot find {MOD_NAME} symbol: {symbol}") - return None - # check uniqueness - while True: - pos, other_address = find_symbol_address(func_search_regex, pos, BOTW_IGD_SYMBOL_MAP) - if pos == -1: - break - - if other_address != address: - print(f"Error: Ambiguous {MOD_NAME} symbol: {symbol}") - return None - - BOTW_IGD_SYMBOL_CACHE[symbol] = address - return ctypes.c_long(address).value - -def find_symbol_address(func_search_regex, start_pos, map_file_str): - """ - Find in map_file_str - Returns ,
if found, or -1,-1 if not found - """ - - regex_match = re.search(func_search_regex, map_file_str[start_pos:]) - if not regex_match: - return -1, -1 - - found_line_pos = map_file_str.rfind('\n', 0, regex_match.span()[0] + start_pos) + 1 - found_line_end_pos = map_file_str.find('\n', regex_match.span()[1] + start_pos) - found_line = map_file_str[found_line_pos:found_line_end_pos].strip() - found_addr = int(found_line[:found_line.find(" ")].replace("00000000:00000071", ''), 16) - return found_line_end_pos, found_addr - -if __name__ == "__main__": - run() diff --git a/src_remove/lib/botw/Game/UI/uiPauseMenuDataMgr.h b/src_remove/lib/botw/Game/UI/uiPauseMenuDataMgr.h deleted file mode 100644 index f5b4107..0000000 --- a/src_remove/lib/botw/Game/UI/uiPauseMenuDataMgr.h +++ /dev/null @@ -1,538 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "KingSystem/Utils/Types.h" - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Winvalid-offsetof" -namespace al { -class ByamlIter; -} - -namespace ksys::act { -class BaseProcLink; -class InfoData; -} // namespace ksys::act - -namespace uking::act { -enum class WeaponModifier : u32; -struct WeaponModifierInfo; -} // namespace uking::act - -namespace ksys { -struct CookItem; -} - -namespace uking::ui { - -constexpr int NumSwordsMax = 20; -constexpr int NumBowsMax = 14; -constexpr int NumArrowItemsMax = 6; -constexpr int NumShieldsMax = 20; -constexpr int NumArmorsMax = 100; -constexpr int NumMaterialsMax = 160; -constexpr int NumFoodMax = 60; -constexpr int NumKeyItemsMax = 40; - -constexpr int NumPouchItemsMax = NumSwordsMax + NumBowsMax + NumArrowItemsMax + NumShieldsMax + - NumArmorsMax + NumMaterialsMax + NumFoodMax + NumKeyItemsMax; - -static_assert(NumPouchItemsMax == 420, "NumPouchItemsMax must be 420 for now"); - -constexpr int ItemStackSizeMax = 999; - -// TODO: figure out what this is -constexpr int NumPouch50 = 50; - -constexpr int NumGrabbableItems = 5; - -enum class PouchItemType { - Sword = 0, - Bow = 1, - Arrow = 2, - Shield = 3, - ArmorHead = 4, - ArmorUpper = 5, - ArmorLower = 6, - Material = 7, - Food = 8, - KeyItem = 9, - Invalid = -1, -}; - -constexpr int NumPouchItemTypes = 10; - -constexpr bool isPouchItemWeapon(PouchItemType type) { - return type == PouchItemType::Sword || type == PouchItemType::Bow || - type == PouchItemType::Arrow || type == PouchItemType::Shield; -} - -constexpr bool isPouchItemBowOrArrow(PouchItemType type) { - return type == PouchItemType::Bow || type == PouchItemType::Arrow; -} - -constexpr bool isPouchItemNotWeapon(PouchItemType type) { - return !isPouchItemWeapon(type); -} - -constexpr bool isPouchItemArmor(PouchItemType type) { - return PouchItemType::ArmorHead <= type && type <= PouchItemType::ArmorLower; -} - -constexpr bool isPouchItemEquipment(PouchItemType type) { - return isPouchItemWeapon(type) || isPouchItemArmor(type); -} - -constexpr bool isPouchItemInvalid(PouchItemType type) { - return u32(type) > u32(PouchItemType::KeyItem); -} - -enum class PouchCategory { - Sword = 0, - Bow = 1, - Shield = 2, - Armor = 3, - Material = 4, - Food = 5, - KeyItem = 6, - Invalid = -1, -}; - -constexpr int NumPouchCategories = 7; - -enum class EquipmentSlot { - WeaponRight = 0, - WeaponBow = 1, - WeaponArrow = 2, - WeaponLeft = 3, - ArmorHead = 4, - ArmorUpper = 5, - ArmorLower = 6, -}; - -enum class ItemUse { - WeaponSmallSword = 0, - WeaponLargeSword = 1, - WeaponSpear = 2, - WeaponBow = 3, - WeaponShield = 4, - ArmorHead = 5, - ArmorUpper = 6, - ArmorLower = 7, - Item = 8, - ImportantItem = 9, - CureItem = 10, - Invalid = -1, -}; - -constexpr int NumDyeColors = 15; -constexpr int FirstDyeColorIndex = 1; -constexpr int LastDyeColorIndex = 15; -static_assert(NumDyeColors == LastDyeColorIndex - FirstDyeColorIndex + 1, - "Dye color indices must be contiguous"); -constexpr int NumRequiredDyeItemsPerColor = 5; - -struct CookTagInfo { - u32 is_tag; - sead::SafeString name; - u32 hash; -}; - -class PouchItem { -public: - struct CookData { - f32 getStaminaRecoverValue() const { return f32(mStaminaRecoverY) * 30.0f; } - void setStaminaRecoverX(int x) { mStaminaRecoverX = x; } - void setStaminaRecoverY(int y) { mStaminaRecoverY = y; } - void setCookEffect1(int effect) { mCookEffect1 = effect; } - void setCookEffect0(const sead::Vector2f& effect) { mCookEffect0 = effect; } - - int mStaminaRecoverX; - int mStaminaRecoverY; - int mCookEffect1; - sead::Vector2f mCookEffect0; - }; - - struct WeaponData { - u32 mAddValue; - u32 b; - u32 mAddType; - u32 d; - u32 e; - }; - - PouchItem(); - virtual ~PouchItem() = default; - - PouchItemType getType() const { return mType; } - bool isEquipped() const { return mEquipped; } - u8 get25() const { return _25; } - const sead::SafeString& getName() const { return mName; } - ItemUse getItemUse() const { return mItemUse; } - - bool isWeapon() const { return getType() <= PouchItemType::Shield; } - - // This is only valid if the item is not a weapon. - s32 getCount() const { return getValue(); } - - s32 getValue() const { return mValue; } - // SAVE-STATE-HACK need to expose this - void setValue(s32 value) { mValue = value; } - - // Only valid if this is not a weapon. - CookData& getCookData() { return mData.cook; } - const CookData& getCookData() const { return mData.cook; } - - const sead::SafeString& getIngredient(s32 idx) const { return *mIngredients[idx]; } - void setIngredient(s32 idx, const sead::SafeString& value) const { *mIngredients[idx] = value; } - void sortIngredients(); - - // Only valid if this is a weapon. - WeaponData& getWeaponData() { return mData.weapon; } - const WeaponData& getWeaponData() const { return mData.weapon; } - - sead::TypedBitFlag getWeaponAddFlags() const { - if (!isWeapon()) - return {}; - return sead::TypedBitFlag{mData.weapon.mAddType}; - } - - u32 getWeaponAddValue() const { - if (!isWeapon()) - return 0; - return mData.weapon.mAddValue; - } - - void setWeaponAddType(u32 type) { - if (isWeapon()) - mData.weapon.mAddType = type; - } - - void setWeaponAddValue(u32 value) { - if (isWeapon()) - mData.weapon.mAddValue = value; - } - - static auto getListNodeOffset() { return offsetof(PouchItem, mListNode); } - -private: - friend class PauseMenuDataMgr; - - union Data { - CookData cook; - WeaponData weapon; - }; - - static constexpr int NumIngredientsMax = 5; - - sead::ListNode mListNode; - PouchItemType mType = PouchItemType::Invalid; - ItemUse mItemUse = ItemUse::Invalid; - s32 mValue = 0; - bool mEquipped = false; - u8 _25 = 1; - sead::FixedSafeString<64> mName; - Data mData{}; - sead::FixedObjArray, NumIngredientsMax> mIngredients; -}; -KSYS_CHECK_SIZE_NX150(PouchItem, 0x298); - -// TODO -class PauseMenuDataMgr { - SEAD_SINGLETON_DISPOSER(PauseMenuDataMgr) - PauseMenuDataMgr(); - virtual ~PauseMenuDataMgr(); - -public: - void init(sead::Heap* heap); - void initForNewSave(); - void loadFromGameData(); - - bool cannotGetItem(const sead::SafeString& name, int n) const; - - static PouchItemType getType(const sead::SafeString& item, al::ByamlIter* iter = nullptr); - - int countItems(PouchItemType type, bool count_any_weapon = false) const; - bool isWeaponSectionFull(const sead::SafeString& get_flag) const; - - void itemGet(const sead::SafeString& name, int value, const act::WeaponModifierInfo* modifier); - void cookItemGet(const ksys::CookItem& cook_item); - - void setCookDataOnLastAddedItem(const ksys::CookItem& cook_item); - - void autoEquipLastAddedItem(); - const sead::SafeString& autoEquip(PouchItem* item, const sead::OffsetList& list); - /// Unequip all inventory items with the specified type. - /// If type is PouchItemType::Invalid, all inventory items will be unequipped. - void unequipAll(PouchItemType type = PouchItemType::Invalid); - - void removeItem(const sead::SafeString& name); - void removeWeaponIfEquipped(const sead::SafeString& name); - void removeArrow(const sead::SafeString& arrow_name, int count = 1); - - int getItemCount(const sead::SafeString& name, bool count_equipped = true) const; - - // TODO: requires CreatePlayerEquipActorMgr - void createPlayerEquipment(); - void setEquippedWeaponItemValue(s32 value, PouchItemType type); - const sead::SafeString& getDefaultEquipment(EquipmentSlot idx) const; - - bool hasItem(const sead::SafeString& name) const; - PouchItem* getMasterSword() const; - - void removeGrabbedItems(); - bool removeGrabbedItem(ksys::act::BaseProcLink* link); - - bool getEquippedArrowType(sead::BufferedSafeString* name, int* count) const; - int getArrowCount(const sead::SafeString& name) const; - /// Get the number of arrows in the real inventory (ignoring any temporary inventory data). - /// This was added in 1.3.1 to patch the Trial of the Sword arrow restock glitch. - int getRealArrowCount(const sead::SafeString& name) const; - - void breakMasterSword(); - void restoreMasterSword(bool only_if_broken); - - bool checkAddOrRemoveItem(const sead::SafeString& name, int count, - bool include_equipped_items) const; - int getFreeSlotCount() const; - - int calculateEnemyMaterialMamo() const; - void removeAllEnemyMaterials(); - - int countItemsWithProfile(const sead::SafeString& profile, bool count_stacked_items) const; - int countItemsWithTag(u32 tag, bool count_stacked_items) const; - int countCookResults(const sead::SafeString& name = {}, s32 effect_type = 0x11, - bool check_effect_type = false) const; - int countItemsWithCategory(PouchCategory category) const; - PouchCategory getCategoryForType(PouchItemType type) const; - - void removeCookResult(const sead::SafeString& name = {}, s32 effect_type = 0x11, - bool check_effect = false); - - bool switchEquipment(const sead::SafeString& name, int* value = nullptr, - act::WeaponModifierInfo* modifier = nullptr); - - void initPouchForQuest(); - void restorePouchForQuest(); - - void sortItems(PouchCategory category, bool do_not_save = false); - - const sead::SafeString* getEquippedItemName(PouchItemType type) const; - const PouchItem* getEquippedItem(PouchItemType type) const; - int getItemValue(const sead::SafeString& name) const; - - bool getFromShop(const sead::SafeString& name, int value, - const act::WeaponModifierInfo* modifier = nullptr); - - int countArmorDye() const; - int countAlreadyDyedArmor() const; - - int getNextGrabbedItemIndex() const; - bool canGrabAnotherItem() const; - bool isNothingBeingGrabbed() const; - - bool isHeroSoulEnabled(const sead::SafeString& name) const; - bool hasRitoSoulPlus() const; - bool hasGoronSoulPlus() const; - bool hasGerudoSoulPlus() const; - bool hasZoraSoulPlus() const; - - int countItemsWithCategoryByType(PouchCategory category) const; - const PouchItem* getItemByIndex(PouchCategory category, int index) const; - - bool hasItemDye() const; - bool hasItemDye(int color) const; - - const PouchItem* getLastAddedItem() const; - - void updateEquippedItemArray(); - void resetEquippedItemArray(); - - bool isOverCategoryLimit(PouchItemType type) const; - - int countArmors(const sead::SafeString& lowest_rank_armor_name) const; - - void openItemCategoryIfNeeded() const; - - void initInventoryForOpenWorldDemo(); - - PouchCategory getCategoryToSort() const { return mCategoryToSort; } - - void equipWeapon(PouchItem* weapon); - void unequip(PouchItem* item); - - // FIXME: types - bool useItemFromRecipeAndSave(void* unk, int multiplier, PouchItem* item); - - void grabbedItemStuff(PouchItem* item); - - // SAVE-STATE-HACK expose equipped weapons array - PouchItem* getEquippedWeapon(PouchItemType type) { - return mEquippedWeapons[u32(type)]; - } - -private: - // TODO: rename - struct GrabbedItemInfo { - PouchItem* item{}; - bool _8{}; - bool _9{}; - }; - KSYS_CHECK_SIZE_NX150(GrabbedItemInfo, 0x10); - - struct Lists { - Lists() { - list1.initOffset(PouchItem::getListNodeOffset()); - list2.initOffset(PouchItem::getListNodeOffset()); - for (auto& item : buffer) { - new (&item) PouchItem(); - list2.pushFront(&item); - } - } - - void destroyAndRecycleItem(PouchItem* item) { - list1.erase(item); - item->~PouchItem(); - new (item) PouchItem; - list2.pushFront(item); - } - - sead::OffsetList list1; - sead::OffsetList list2; - sead::SafeArray buffer; - }; - -// BOTW-SAVE-STATE hack: make these public -public: - sead::OffsetList& getItems() { return mItemLists.list1; } - const sead::OffsetList& getItems() const { return mItemLists.list1; } -// BOTW-SAVE-STATE hack end -private: - // FIXME: types - bool useItemFromRecipe(Lists* lists, void* unk, int multiplier, PouchItem* item); - - PouchItem* getItemHead(PouchCategory category) const { - auto* p_head = mListHeads[u32(category)]; - if (!p_head) - return nullptr; - return *p_head; - } - - PouchItem** getItemHeadp(PouchCategory category) const { return mListHeads[u32(category)]; } - - PouchItem* nextItem(const PouchItem* item) const { return getItems().next(item); } - bool isList2Empty() const { return mItemLists.list2.isEmpty(); } - - const PouchItem* getItemByIndex(PouchItemType type, int index) const; - - void destroyAndRecycleItem(PouchItem* item) { - item->~PouchItem(); - new (item) PouchItem; - mItemLists.list2.pushFront(item); - } - - void destroyAndRecycleItem(Lists& lists, PouchItem* item) { - if (mItem_444f0 == item) - mItem_444f0 = nullptr; - if (mLastAddedItem == item) - mLastAddedItem = nullptr; - - lists.destroyAndRecycleItem(item); - } - - void resetItem(); - - void resetItemAndPointers() { - mLastAddedItem = nullptr; - mItem_444f0 = nullptr; - _444f8 = -1; - resetItem(); - } - - void setItemModifier(PouchItem& item, const act::WeaponModifierInfo* modifier); - - void doLoadFromGameData(); - - // 710096c954 - void updateInventoryInfo(const sead::OffsetList& list); - void updateListHeads(); - void saveToGameData(const sead::OffsetList& list) const; - void updateAfterAddingItem(bool only_sort); - - void addToPouch(const sead::SafeString& name, PouchItemType type, Lists& lists, int value, - bool equipped, const act::WeaponModifierInfo* modifier = nullptr, - bool is_inventory_load = false); - - void doAddToPouch(PouchItemType type, const sead::SafeString& name, Lists& lists, int value, - bool equipped, const act::WeaponModifierInfo* modifier = nullptr, - bool is_inventory_load = false); - - void deleteItem_(const sead::OffsetList& list, PouchItem* item, - const sead::SafeString& name); - - void addNonDefaultItem(const sead::SafeString& name, int value, - const act::WeaponModifierInfo* modifier = nullptr); - - bool hasFreeSpaceForItem(const Lists& lists, const sead::SafeString& name, int n = 1) const; - - /// @param num_cleared_beasts The number of divine beasts that have been done. - void updateDivineBeastClearFlags(int num_cleared_beasts); - - mutable sead::CriticalSection mCritSection; - Lists mItemLists; - sead::SafeArray mListHeads; - sead::SafeArray mArray1; - sead::SafeArray mArray2; - PouchItem* mLastAddedItem{}; - s32 _44490 = -1; - s32 _44494 = -1; - s32 _44498{}; - sead::SafeArray mGrabbedItems; - PouchItem* mItem_444f0{}; - s32 _444f8 = -1; - s32 _444fc{}; - s32 _44500 = -1; - u32 _44504{}; - u32 _44508{}; - u32 _4450c{}; - u32 _44510{}; - u32 _44514{}; - PouchItem* mRitoSoulItem{}; - PouchItem* mGoronSoulItem{}; - PouchItem* mZoraSoulItem{}; - PouchItem* mGerudoSoulItem{}; - bool _44538 = false; - PouchItem mNewlyAddedItem; - - /// Indicates if a temporary inventory ("pouch for quest") is being used. - bool mIsPouchForQuest = false; - - sead::SafeArray mEquippedWeapons; - PouchCategory mCategoryToSort = PouchCategory::Invalid; -}; -KSYS_CHECK_SIZE_NX150(PauseMenuDataMgr, 0x44808); - -int compareWeapon(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareBow(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareShield(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareArmor(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareMaterial(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareFood(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); -int compareKeyItem(const PouchItem* lhs, const PouchItem* rhs, ksys::act::InfoData* data); - -int getCookItemOrder(const PouchItem* item, ksys::act::InfoData* data); - -ItemUse getItemUse(const sead::SafeString& name); - -} // namespace uking::ui -#pragma GCC diagnostic pop diff --git a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProc.h b/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProc.h deleted file mode 100644 index bf47c7b..0000000 --- a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProc.h +++ /dev/null @@ -1,336 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "KingSystem/ActorSystem/actBaseProcJob.h" -#include "KingSystem/ActorSystem/actBaseProcMap.h" -#include "KingSystem/Utils/Container/StrTreeMap.h" -#include "KingSystem/Utils/Types.h" - -namespace ksys::act { - -class ActorLinkConstDataAccess; -class BaseProc; -class BaseProcLinkData; -class BaseProcJobHandler; -class BaseProcUnit; - -/// Actor base class that encapsulates all the low-level actor lifetime logic. -class BaseProc { -public: - enum State : u8 { - /// The actor is constructed, but not fully initialized yet. - Init = 0, - /// The actor is active. - Calc = 1, - /// The actor is sleeping: its update jobs won't be run. - Sleep = 2, - /// The actor is scheduled for deletion. - Delete = 3, - }; - - enum class DeleteReason : u32 { - _0 = 0, - _1 = 1, - _2 = 2, - BaseProcMgrDeleteAll = 4, - _f = 0xf, - _15 = 0x15, - _16 = 0x16, - _17 = 0x17, - _18 = 0x18, - _19 = 0x19, - }; - - enum class SleepWakeReason : u32 { - _0 = 0, - }; - - struct ClassInfo { - sead::SafeString name; - u8 priority; - }; - KSYS_CHECK_SIZE_NX150(ClassInfo, 0x18); - - struct CreateArg { - const ClassInfo* class_info; - void* _10; - u32 _14; - u32 _18; - sead::SafeString actor_name; - }; - KSYS_CHECK_SIZE_NX150(CreateArg, 0x28); - - struct PreDeleteArg { - bool do_not_destruct_immediately = false; - }; - - explicit BaseProc(const CreateArg& arg); - virtual ~BaseProc(); - - SEAD_RTTI_BASE(BaseProc) - - /// @return true iff state is Calc and the actor is not being deleted. - bool init(sead::Heap* heap, bool sleep_after_init); - /// Put this actor to sleep. The request is queued. - void sleep(SleepWakeReason reason); - /// Wake up this actor. The request is queued. - void wakeUp(SleepWakeReason reason); - /// Delete this actor. The request is queued. - bool deleteLater(DeleteReason reason); - void freeLinkData(); - - u32 getId() const { return mId; } - const sead::SafeString& getName() const { return mName; } - - u8 getPriority() const { return mPriority; } - void setPriority(u8 priority) { mPriority = priority; } - - State getState() const { return mState; } - bool isInit() const { return mState == State::Init; } - bool isCalc() const { return mState == State::Calc; } - bool isSleep() const { return mState == State::Sleep; } - bool isDelete() const { return mState == State::Delete; } - bool isDeletedOrDeleting() const { - return mState == State::Delete || mStateFlags.isOn(StateFlags::RequestDelete); - } - bool isDeleteOrInvalid() const { return mState >= act::BaseProc::State::Delete; } - - /// For BaseProcLink or ActorLinkConstDataAccess. - bool acquire(ActorLinkConstDataAccess& accessor); - BaseProcLinkData* getBaseProcLinkData() const { return mBaseProcLinkData; } - /// For BaseProcLink or ActorLinkConstDataAccess. - void release(); - - BaseProc* getConnectedCalcParent() const; - bool setConnectedCalcParent(BaseProc* parent, bool delete_parent_on_delete); - void resetConnectedCalcParent(bool clear_existing_set_request); - - BaseProc* getConnectedCalcChild() const; - bool setConnectedCalcChild(BaseProc* child, bool delete_child_on_delete); - void resetConnectedCalcChild(bool clear_existing_set_request); - - bool isSpecialJobType(JobType type); - bool shouldSkipJobPush(JobType type); - void setJobPriority(u8 actorparam_priority, JobType type); - void setJobPriority2(u8 actorparam_priority, JobType type); - - void setCreatePriorityState1(); - void setCreatePriorityState2(); - - void onJobPush(JobType type) { - onJobPush1_(type); - onJobPush2_(type); - } - - /// Actually pre-delete the actor. Called from BaseProcDeleter. - void doPreDelete(const PreDeleteArg& arg); - - /// Set the BaseProcUnit. Only for use by BaseProcCreateTask. - void setUnitForBaseProcCreateTask(BaseProcUnit* unit) { mProcUnit = unit; } - void setInitializedFlag() { mFlags.set(Flags::Initialized); } - bool requestDeleteProcUnit() { return setStateFlag(StateFlags::RequestDeleteProcUnit); } - - bool isInitialized() const { return mFlags.isOn(Flags::Initialized); } - bool isDeleting() const { return mFlags.isOn(Flags::PreDeleteStarted); } - bool isDeleteRequested() const { return mStateFlags.isOn(StateFlags::RequestDelete); } - -protected: - friend class BaseProcLinkDataMgr; - friend class BaseProcMgr; - - enum class Flags : u32 { - Initialized = 1, - PreDeleteStarted = 2, - PreDeleteFailed = 4, - Destructed = 8, - DoNotDelete = 0x10, - DeleteChildOnDelete = 0x20, - DeleteParentOnDelete = 0x40, - _80 = 0x80, - _100 = 0x100, - PreDeleting = 0x200, - SleepWakeReason0 = 0x400, - SleepWakeReason1 = 0x800, - SleepWakeReason2 = 0x1000, - SleepWakeReason3 = 0x2000, - SleepWakeReasonAny = - SleepWakeReason0 | SleepWakeReason1 | SleepWakeReason2 | SleepWakeReason3, - }; - - enum class StateFlags : u32 { - RequestDelete = 1, - _2 = 2, - RequestSleep = 4, - RequestWakeUp = 8, - _a = _2 | RequestWakeUp, - RequestChangeCalcJobPriority = 0x10, - _20 = 0x20, - _40 = 0x40, - _80 = 0x80, - RequestSetParent = 0x100, - RequestSetChild = 0x200, - RequestResetParent = 0x400, - RequestResetChild = 0x800, - _1000 = 0x1000, - _2000 = 0x2000, - _4000 = 0x4000, - RequestDeleteProcUnit = 0x8000, - }; - - enum class InitResult : u32 { - Ok = 1, - Failed = 2, - Skipped = 3, - }; - - enum class PreDeletePrepareResult : u32 { - NotDone = 0, - Done = 1, - }; - - enum class IsSpecialJobTypeResult { - No = 0, - Yes = 1, - _2 = 2, - }; - - struct InitContext { - InitResult result; - bool sleep_after_init; - }; - - struct PrepareArg { - bool _0 = false; - int _4; - }; - - /// Initialize the actor. - /// @return Ok to keep the actor alive, anything else to kill it? - virtual InitResult init_(); - /// @return whether prepareInit_ and init_ should be called. - virtual bool shouldInit_(); - /// Finalize the initialization; the actor is deleted if the result is not Ok. - virtual void finalizeInit_(InitContext* context); - - /// Called every tick to prepare for pre-delete (after startPreparingForPreDelete_). - virtual PreDeletePrepareResult prepareForPreDelete_(); - /// Called to start preparing for pre-delete. Return true to allow pre-delete to go ahead. - virtual bool startPreparingForPreDelete_(); - - /// Destructs this actor if should_destruct is 1. - /// @warning The actor must NOT be used after calling this function. - virtual void destruct_(int should_destruct); - - /// Called when entering the Calc state. - virtual void onEnterCalc_(); - - /// Called when a new delete operation is queued. - virtual void onDeleteRequested_(DeleteReason reason); - /// Called when a new sleep operation is queued. - virtual void onSleepRequested_(SleepWakeReason reason); - /// Called when a new wakeup operation is queued. - virtual void onWakeUpRequested_(SleepWakeReason reason); - - virtual bool shouldClearStateFlag4000_() { return true; } - - /// Called when entering the Delete state. - virtual void onEnterDelete_(); - /// Called when entering the Sleep state. - virtual void onEnterSleep_(); - - /// Called to actually pre-delete (third and final callback). - virtual void preDelete3_(const PreDeleteArg& arg); - - virtual bool prepareInit_(sead::Heap* heap, PrepareArg& arg); - - /// Called when pre-delete actually starts (after preparation, before requesting it). - virtual void onPreDeleteStart_(PrepareArg&); - /// Called to actually pre-delete (second callback). - virtual void preDelete2_(const PreDeleteArg& arg); - /// Called to actually pre-delete (first callback). - virtual void preDelete1_(); - - virtual IsSpecialJobTypeResult isSpecialJobType_(JobType type); - virtual bool canWakeUp_(); - virtual void queueExtraJobPush_(JobType type, int idx); - virtual bool hasJobType_(JobType type); - /// Called after processStateUpdate() is called for all actors in the update state list. - virtual void afterUpdateState_(); - - virtual bool shouldSkipJobPush_(JobType type); - /// Called before pushing a job with the specified job type (first callback). - virtual void onJobPush1_(JobType type); - /// Called before pushing a job with the specified job type (second and final callback). - virtual void onJobPush2_(JobType type); - - bool processStateUpdate(u8 counter); - void processPreDelete(); - void startDelete_(); - - /// Called from BaseProcMgr when a job for this process is invoked. - void jobInvoked(JobType type); - - bool isSpecialJobTypeForThisActor_(JobType type) const { - return mSpecialJobTypesMask.isOnBit(int(type)); - } - - BaseProcJobHandler*& getJobHandler(JobType type) { return mJobHandlers[int(type)]; } - BaseProcJobHandler* getJobHandler(JobType type) const { return mJobHandlers[int(type)]; } - - bool setStateFlag(u32 flag_bit); - bool setStateFlag(StateFlags flag) { return setStateFlag(sead::log2(u32(flag))); } - - bool x00000071011ba9fc(); - - sead::FixedSafeString<64> mName; - u32 mId = -1; - State mState = State::Init; - u8 mPriority = 0; - u8 mCreatePriorityState = 0; - u8 mCounter = 0; - BaseProcLinkData* mBaseProcLinkData = nullptr; - sead::BitFlag16 mSkippedJobTypesMask; - sead::BitFlag16 mSpecialJobTypesMask; - sead::TypedBitFlag> mFlags; - sead::TypedBitFlag> mStateFlags; - BaseProc* mConnectedCalcParent = nullptr; - BaseProc* mConnectedCalcChild = nullptr; - BaseProc* mConnectedCalcParentNew = nullptr; - BaseProc* mConnectedCalcChildNew = nullptr; - sead::SafeArray mJobHandlers{}; - sead::Delegate1R mInvoker; - sead::ListNode mPreDeleteListNode; - sead::ListNode mUpdateStateListNode; - BaseProcMapNode mMapNode{this}; - BaseProcUnit* mProcUnit = nullptr; - sead::Atomic mRefCount = 0; - -private: - void unlinkProcUnit_(); - void unlinkCalcChild_(); - void unlinkCalcParent_(); - void loadNewCalcChild_(u8 counter); - void loadNewCalcParent_(u8 counter); - - void handleSleepRequest_(); - void handleWakeUpRequest_(); - void handleJobPriorityChangeRequest_(); - - void setJobPriorityDuringCalc_(BaseProcJobHandler*& handler, JobType type); - - bool canWakeUpOrFlagsSet_() { - return mFlags.isOn(Flags::_80) ? mFlags.isOn(Flags::_100) : canWakeUp_(); - } -}; -KSYS_CHECK_SIZE_NX150(BaseProc, 0x180); - -} // namespace ksys::act diff --git a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcJob.h b/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcJob.h deleted file mode 100644 index 41debba..0000000 --- a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcJob.h +++ /dev/null @@ -1,99 +0,0 @@ -#pragma once - -#include -#include -#include -#include "KingSystem/Utils/Types.h" - -namespace ksys::act { - -class BaseProc; - -enum class Priority { - PlayerBefore = 0, - Player = 2, - PlayerAfter = 2, - AllAfter = 3, -}; - -enum class JobType { - PreCalc = 0, - Calc1 = 1, - Calc2 = 2, - Calc3 = 3, - Calc4 = 4, - AfterMessageDispatch = 5, - Calc3Alt = 6, - Invalid = 7, -}; - -class BaseProcJobLink : public sead::TListNode { -public: - BaseProcJobLink(BaseProc* proc, u8 priority); - - BaseProc* getProc() const { return mData; } - - u8 getPriority() const { return mPriority; } - u8 getPriority2() const { return mPriority2; } - - void setNewPriority(u8 priority) { mNewPriority = priority; } - void setNewPriority2(u8 priority) { mNewPriority2 = priority; } - - void loadNewPriority() { mPriority = mNewPriority; } - void loadNewPriority2() { mPriority2 = mNewPriority2; } - - bool hasPriorityChange() const { - return mPriority != mNewPriority || mPriority2 != mNewPriority2; - } - -private: - u8 mPriority; - u8 mNewPriority; - u8 mPriority2; - u8 mNewPriority2; -}; -KSYS_CHECK_SIZE_NX150(BaseProcJobLink, 0x28); - -struct BaseProcJobList { - sead::TListNode* front() const; - sead::TListNode* next(BaseProcJobLink* link) const; - int size() const; - - sead::SafeArray, 2> lists; -}; - -class BaseProcJobLists { -public: - BaseProcJobLists() = default; - ~BaseProcJobLists() { ; } - - void pushJob(BaseProcJobLink& link); - void eraseJob(BaseProcJobLink& link); - sead::TListNode* getJobWithTopPriority() const; - sead::TListNode* getNextJobWithTopPriority(BaseProcJobLink* link) const; - sead::TListNode* getNextJob(BaseProcJobLink* link) const; - BaseProcJobList& getList(int idx) { return mLists[idx]; } - const BaseProcJobList& getList(int idx) const { return mLists[idx]; } - -private: - sead::SafeArray mLists{}; -}; - -class BaseProcJob final : public sead::Job { -public: - BaseProcJob() = default; - void invoke() override; - - void set(BaseProcJobLink* link, int rounds) { - mJobLink = link; - mRequiredCalcRounds = rounds; - } - -private: - friend class BaseProcJobQue; - - BaseProcJobLink* mJobLink = nullptr; - int mRequiredCalcRounds = 0; -}; - -} // namespace ksys::act diff --git a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcMap.h b/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcMap.h deleted file mode 100644 index 304a04c..0000000 --- a/src_remove/lib/botw/KingSystem/ActorSystem/actBaseProcMap.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -#include "KingSystem/Utils/Container/StrTreeMap.h" - -namespace ksys::act { - -class BaseProc; - -class BaseProcMapNode final : public util::StrTreeMapNode { -public: - explicit BaseProcMapNode(BaseProc* proc) : mProc(proc) {} - ~BaseProcMapNode() override; - - void erase_() override { - unlink_(); - StrTreeMapNode::erase_(); - mInserted = false; - mPrev = mNext = nullptr; - } - - util::StrTreeMapKey& key() { return mKey; } - const util::StrTreeMapKey& key() const { return mKey; } - BaseProc* proc() const { return mProc; } - BaseProcMapNode* prev() const { return mPrev; } - BaseProcMapNode* next() const { return mNext; } - - void add(BaseProcMapNode* node); - - bool isInserted() const { return mInserted; } - void setInserted() { mInserted = true; } - -private: - void unlink_() { - if (mPrev) - mPrev->mNext = mNext; - - if (mNext) - mNext->mPrev = mPrev; - } - - BaseProc* mProc = nullptr; - BaseProcMapNode* mPrev = nullptr; - BaseProcMapNode* mNext = nullptr; - bool mInserted = false; -}; - -class BaseProcMap : public util::StrTreeMap { -public: - void insert(BaseProcMapNode* node); - - void erase(BaseProcMapNode* node) { - auto prev = node->prev(); - auto next = node->next(); - if (prev) - node->erase_(); - else if (next) - StrTreeMap::insert(next); - else - StrTreeMap::erase(node->key()); - } -}; - -} // namespace ksys::act diff --git a/src_remove/lib/botw/KingSystem/Utils/Container/LockFreeQueue.h b/src_remove/lib/botw/KingSystem/Utils/Container/LockFreeQueue.h deleted file mode 100644 index f072d69..0000000 --- a/src_remove/lib/botw/KingSystem/Utils/Container/LockFreeQueue.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace ksys::util { - -/// A lock-free multiple producer, single consumer queue. -/// -/// Values are stored in a ring buffer of T*. -template -class LockFreeQueue { -public: - LockFreeQueue() = default; - /// @warning This does not automatically free elements. - ~LockFreeQueue() = default; - - /// Allocate the underlying buffer. - /// @param capacity Buffer capacity. *Must* be a power of 2. - void alloc(int capacity, sead::Heap* heap) { - SEAD_ASSERT(sead::Mathi::isPow2(capacity)); - mBuffer.allocBufferAssert(capacity, heap); - mBuffer.fill(nullptr); - } - - void freeBuffer() { mBuffer.freeBuffer(); } - - int getSize() const { return mWriteIdx - mReadIdx; } - int getCapacity() const { return mBuffer.size(); } - - /// Pop an element from the front of the queue. Non-blocking. - /// @returns a non-null pointer to an element or nullptr if the queue is empty. - // NON_MATCHING: control flow is a total mess - T* pop() { - while (getSize() > 0) { - // No need to check if mWriteIdx has changed: the only thing that *could* - // happen is mWriteIdx being incremented by a producer. In that situation - // mWriteIdx - read_idx > 0 still holds. - - T* value = get(mReadIdx); - if (!value) { - SEAD_ASSERT_MSG(false, "corrupted buffer"); - return nullptr; - } - - // Advance the read position and return the value if it's not a dummy pointer. - get(mReadIdx++) = nullptr; - if (uintptr_t(value) != uintptr_t(-1)) - return value; - } - return nullptr; - } - - /// Push a new element at the back of the queue. Non-blocking: may fail if the queue is full. - /// @param value The value to insert. Must not be nullptr. - bool push(T* value) { - if (!value) - return false; - - while (true) { - const u32 write_idx = mWriteIdx; - if (int(write_idx) - int(mReadIdx) >= getCapacity()) { - // The buffer is full. - return false; - } - - // There is no need to check whether mReadIdx has changed here: - // the only change that could occur is mReadIdx being incremented by a consumer. - // If we passed the capacity check, it's okay if the capacity increases. - - if (!mWriteIdx.compareExchange(write_idx, write_idx + 1)) { - // A producer inserted an element after we checked the capacity. Try again. - continue; - } - - get(write_idx) = value; - return true; - } - } - - /// Erase an element from the queue. - /// @warning Not thread safe! - void erase(T* value) { - for (u32 i = mReadIdx; i < mWriteIdx; ++i) { - if (get(i) == value) - get(i) = reinterpret_cast(uintptr_t(-1)); - } - } - -private: - T*& get(u32 idx) { return mBuffer(moduloCapacity(idx)); } - const T*& get(u32 idx) const { return mBuffer(moduloCapacity(idx)); } - - int moduloCapacity(u32 idx) const { - // Because the capacity is a power of 2, we can avoid costly divisions - // and instead rely on x % 2^n being equal to x & (2^n - 1). - return idx & (getCapacity() - 1); - } - - sead::Buffer mBuffer; - sead::Atomic mWriteIdx; - u32 mReadIdx{}; -}; - -} // namespace ksys::util diff --git a/src_remove/lib/botw/KingSystem/Utils/Container/StrTreeMap.h b/src_remove/lib/botw/KingSystem/Utils/Container/StrTreeMap.h deleted file mode 100644 index dfe4183..0000000 --- a/src_remove/lib/botw/KingSystem/Utils/Container/StrTreeMap.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace ksys::util { - -class StrTreeMapKey { -public: - StrTreeMapKey() = default; - StrTreeMapKey(u32 key_hash, const sead::SafeString& key) : mKeyHash(key_hash), mKey(key) {} - StrTreeMapKey(const sead::SafeString& key) - : StrTreeMapKey(sead::HashCRC32::calcStringHash(key), key) {} - - const sead::SafeString& key() const { return mKey; } - - void setKey(const sead::SafeString& key) { *this = StrTreeMapKey{key}; } - - s32 compare(const StrTreeMapKey& rhs) const { - if (mKeyHash < rhs.mKeyHash) - return -1; - if (mKeyHash > rhs.mKeyHash) - return 1; - return mKey.compare(rhs.mKey); - } - -private: - u32 mKeyHash = 0; - sead::SafeString mKey; -}; - -class StrTreeMapNode : public sead::TreeMapNode { -public: - using KeyType = StrTreeMapKey; - ~StrTreeMapNode() override { ; } - void erase_() override { mLeft = mRight = nullptr; } -}; - -template -class StrTreeMap : public sead::IntrusiveTreeMap {}; - -} // namespace ksys::util diff --git a/src_remove/lib/botw/KingSystem/Utils/Container/UniqueArrayPtr.h b/src_remove/lib/botw/KingSystem/Utils/Container/UniqueArrayPtr.h deleted file mode 100644 index c8adadc..0000000 --- a/src_remove/lib/botw/KingSystem/Utils/Container/UniqueArrayPtr.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include "KingSystem/Utils/SafeDelete.h" - -namespace ksys::util { - -template -class UniqueArrayPtr { -public: - UniqueArrayPtr() = default; - UniqueArrayPtr(const UniqueArrayPtr&) = delete; - // Not movable either for now. - UniqueArrayPtr(UniqueArrayPtr&&) = delete; - ~UniqueArrayPtr() { safeDeleteArray(mData); } - - auto& operator=(const UniqueArrayPtr&) = delete; - auto& operator=(UniqueArrayPtr&&) = delete; - - T* data() const { return mData; } - std::size_t size() const { return N; } - - T* begin() const { return mData; } - T* end() const { return mData + N; } - T*& operator[](std::size_t i) const { return mData[i]; } - -private: - T* mData = new T[N]; -}; - -} // namespace ksys::util diff --git a/src_remove/lib/botw/KingSystem/Utils/Types.h b/src_remove/lib/botw/KingSystem/Utils/Types.h deleted file mode 100644 index 941ec17..0000000 --- a/src_remove/lib/botw/KingSystem/Utils/Types.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -#ifdef SEAD_DEBUG -#define KSYS_CHECK_SIZE_NX150(CLASS, SIZE) -#else -#define KSYS_CHECK_SIZE_NX150(CLASS, SIZE) static_assert(sizeof(CLASS) == SIZE) -#endif - -#ifdef __GNUC__ -#define KSYS_ALWAYS_INLINE [[gnu::always_inline]] -#define KSYS_VISIBILITY_HIDDEN [[gnu::visibility("hidden")]] -#endif diff --git a/src_remove/lib/nnheaders/include/nn/account.h b/src_remove/lib/nnheaders/include/nn/account.h deleted file mode 100644 index 739c9c0..0000000 --- a/src_remove/lib/nnheaders/include/nn/account.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file account.h - * @brief Account service implementation. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace account { -typedef char Nickname[0x21]; -typedef u64 NetworkServiceAccountId; - -class AsyncContext; - -class Uid { -public: - bool IsValid() const { return m_Storage[0] != 0 || m_Storage[1] != 0; } - - u64 m_Storage[2]; -}; - -class UserHandle { -public: - Uid m_Uid; - void* m_Handle; -}; - -void Initialize(); -Result ListAllUsers(s32*, Uid*, s32 numUsers); -Result OpenUser(UserHandle*, Uid const&); -Result IsNetworkServiceAccountAvailable(bool* out, UserHandle const&); -void CloseUser(UserHandle const&); - -Result EnsureNetworkServiceAccountAvailable(UserHandle const& userHandle); -Result EnsureNetworkServiceAccountIdTokenCacheAsync(AsyncContext*, UserHandle const&); -Result LoadNetworkServiceAccountIdTokenCache(u64*, char*, u64, UserHandle const&); - -Result GetLastOpenedUser(Uid*); -Result GetNickname(Nickname* nickname, Uid const& userID); - -Result GetUserId(Uid* uid, const UserHandle& handle); -Result OpenPreselectedUser(UserHandle* handle); - -class AsyncContext { -public: - AsyncContext(); - - Result HasDone(bool*); - Result GetResult(); - Result Cancel(); - Result GetSystemEvent(nn::os::SystemEvent*); -}; -}; // namespace account -}; // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/aoc.h b/src_remove/lib/nnheaders/include/nn/aoc.h deleted file mode 100644 index 623e3fa..0000000 --- a/src_remove/lib/nnheaders/include/nn/aoc.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -namespace nn::aoc { - -int ListAddOnContent(int*, int, int); - -} // namespace nn::aoc diff --git a/src_remove/lib/nnheaders/include/nn/atk/SoundArchivePlayer.h b/src_remove/lib/nnheaders/include/nn/atk/SoundArchivePlayer.h deleted file mode 100644 index e8a35a4..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/SoundArchivePlayer.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file SoundArchivePlayer.h - * @brief Basic sound player from a sound archive. - */ - -#pragma once - -#include -#include -#include -#include -#include - -namespace nn { -namespace atk { -class SoundArchivePlayer { -public: - SoundArchivePlayer(); - - virtual ~SoundArchivePlayer(); - - bool IsAvailable() const; - void Finalize(); - void StopAllSound(s32, bool); - void DisposeInstances(); - - nn::atk::detail::SoundArchiveManager mArchiveManager; // _8 - nn::atk::detail::SequenceSoundRuntime mSeqSoundRuntime; // _50 - nn::atk::detail::WaveSoundRuntime mWaveSoundRuntime; // _130 - nn::atk::detail::AdvancedWaveSoundRuntime mAdvancedWaveSound; // _1B0 - nn::atk::detail::StreamSoundRuntime mStreamSoundRuntime; // _1E0 - u64 _290; - u32 _298; - u8 _29C[0x2E8 - 0x29C]; -}; -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/SoundDataManager.h b/src_remove/lib/nnheaders/include/nn/atk/SoundDataManager.h deleted file mode 100644 index f3dbc73..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/SoundDataManager.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @file SoundDataManager.h - * @brief Sound data management implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -class SoundDataManager { -public: - SoundDataManager(); - virtual ~SoundDataManager(); - - virtual void InvalidateData(void const*, void const*); - virtual void SetFileAddressToTable(u32, void const*); - virtual u64 GetFileAddressFromTable(u32) const; - virtual u32 GetFileAddressImpl(u32) const; - - u8 _0[0x240]; -}; -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/SoundPlayer.h b/src_remove/lib/nnheaders/include/nn/atk/SoundPlayer.h deleted file mode 100644 index fc90829..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/SoundPlayer.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file SoundPlayer.h - * @brief Sound player. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -enum PauseMode { - -}; - -class SoundPlayer { -public: - SoundPlayer(); - ~SoundPlayer(); - - void StopAllSound(s32); - void Update(); - void DoFreePlayerHeap(); - void detail_SortPriorityList(bool); - void PauseAllSound(s32, bool); - void PauseAllSound(bool, s32, nn::atk::PauseMode); - void SetVolume(f32 vol); - void SetLowPassFilterFrequency(f32 filterFreq); - void SetBiquadFilter(s32 filterType, f32 baseFreq); - void SetDefaultOutputLine(u32 line); - - void detail_SetPlayableSoundLimit(s32 limit); - bool CanPlaySound(s32); - - u64 _0; - u64 _8; - u64 _10; - u64 _18; - u64 _20; - u64 _28; - u64 _30; - u64 _38; - s32 _40; - s32 mPlayableSoundCount; // _44 - s32 _48; - f32 mVolume; // _4C - f32 mLowPassFreq; // _50 - s32 mFilterType; // _54 - f32 mBaseFreq; // _58 - u32 mDefaultOutputLine; // _5C - f32 mOutputVolume; // _60 - u64 _64; - u64 _6C; -}; -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/AdvancedWaveSoundRuntime.h b/src_remove/lib/nnheaders/include/nn/atk/detail/AdvancedWaveSoundRuntime.h deleted file mode 100644 index de45e9e..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/AdvancedWaveSoundRuntime.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @file AdvancedWaveSoundRuntime.h - * @brief Runtime wave sound api. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -namespace detail { -class AdvancedWaveSoundRuntime { -public: - AdvancedWaveSoundRuntime(); - ~AdvancedWaveSoundRuntime(); - - void Initialize(s32, void**, void const*); - void Finalize(); - s32 GetActiveCount() const; - void SetupUserParam(void**, u64); - void Update(); - - u8 _0[0x30]; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/BasicSound.h b/src_remove/lib/nnheaders/include/nn/atk/detail/BasicSound.h deleted file mode 100644 index 1f7667a..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/BasicSound.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @file BasicSound.h - * @brief A basic sound. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -class SoundActor; - -enum MixMode { - -}; - -namespace detail { -class PlayerHeap; -class ExternalSoundPlayer; - -class BasicSound { -public: - BasicSound(); - virtual ~BasicSound(); - - virtual void Initialize(); - virtual void Finalize(); - virtual bool IsPrepared() const = 0; - virtual bool IsAttachedTempSpecialHandle() = 0; - virtual void DetachTempSpecialHandle() = 0; - virtual void OnUpdatePlayerPriority(); - virtual void UpdateMoveValue(); - virtual void OnUpdateParam(); - - void SetPriority(s32, s32); - void GetPriority(s32*, s32*) const; - void ClearIsFinalizedForCannotAllocatedResourceFlag(); - void SetId(u32 newID); - bool IsAttachedGeneralHandle(); - void DetachGeneralHandle(); - bool IsAttachedTempGeneralHandle(); - void DetachTempGeneralHandle(); - void StartPrepared(); - void Stop(s32); - void SetPlayerPriority(s32); - void ForceStop(); - void Pause(bool, s32); - void Mute(bool, s32); - void SetAutoStopCounter(s32); - void FadeIn(s32); - bool IsPause() const; - bool IsMute() const; - void Update(); - void UpdateParam(); - void UpdateMoveValue(); - void CalculateVolume() const; - f32 CalculatePitch() const; - f32 CalculateLpfFrequency() const; - u32 CalculateOutLineFlag() const; - void CalculateBiquadFilter(s32*, f32*) const; - void AttachPlayerHeap(nn::atk::detail::PlayerHeap*); - void DetachPlayerHeap(nn::atk::detail::PlayerHeap*); - void AttachSoundPlayer(nn::atk::SoundPlayer*); - void DetachSoundPlayer(nn::atk::SoundPlayer*); - void AttachSoundActor(nn::atk::SoundActor*); - void DetachSoundActor(nn::atk::SoundActor*); - void AttachExternalSoundPlayer(nn::atk::detail::ExternalSoundPlayer*); - void DetachExternalSoundPlayer(nn::atk::detail::ExternalSoundPlayer*); - u32 GetRemainingFadeFrames() const; - u32 GetRemainingPauseFadeFrames() const; - u32 GetRemainingMuteFadeFrames() const; - void SetInitialVolume(f32 vol); - f32 GetInitialVolume() const; - void SetVolume(f32, s32); - s32 GetVolume() const; - void SetPitch(f32); - f32 GetPitch() const; - void SetLpfFreq(f32); - f32 GetLpfFreq() const; - void SetBiquadFilter(s32, f32); - void GetBiquadFilter(s32*, f32*) const; - void SetOutputLine(u32); - u32 GetOutputLine() const; - void ResetOutputLine(); - void SetMixMode(nn::atk::MixMode); - nn::atk::MixMode GetMixMode(); - void SetPan(f32); - f32 GetPan() const; - void SetSurroundPan(f32); - f32 GetSurroundPan() const; - void SetMainSend(f32); - f32 GetMainSend() const; - - u64* _8; // nn::atk::detail::PlayerHeap* - u64* _10; // nn::atk::SoundHandle* - u64* _18; // nn::atk::SoundHandle* - nn::atk::SoundPlayer* mSoundPlayer; // _20 - u64* _28; // nn::atk::SoundActor* - u64* _30; // nn::atk::detail::ExternalSoundPlayer* - u64* _38; // nn::atk::SoundArchive* - u8 _40[0xF0 - 0x40]; - s32 mPriority; // _F0 - u32 _F4; - u32 _F8; - s32 mAutoStopCounter; // _FC - u64 _100; - u32 mID; // _108 - u32 _10C; - u32 _110; - u32 _114; - f32 mInitialVolume; // _118 - f32 mPitch; // _11C - f32 mLpfFreq; // _120 - f32 _124; - u32 mOutputLine; // _128 - f32 _12C; - f32 mVolume; // _130 - u32 _134; - u32 _138; - nn::atk::MixMode mMixMode; // _13C - f32 mPan; // _140 - f32 mSurroundPan; // _144 - f32 mMainSend; // _148 - u8 _14C[0x158 - 0x14C]; - f32 mOutputVol; // _158 - u8 _15C[0x190 - 0x15C]; - f32 mOutputPan; // _190 - f32 mOutputSurroundPan; // _194 - f32 mOutputMainSend; // _198 - f32 mOutputFxSend; // _19C - - static u64 g_LastInstanceId; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/SequenceSoundRuntime.h b/src_remove/lib/nnheaders/include/nn/atk/detail/SequenceSoundRuntime.h deleted file mode 100644 index c4d23ae..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/SequenceSoundRuntime.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file SequenceSoundRuntime.h - * @brief Sequenced Sound Runtime Info - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -namespace detail { -class SoundArchiveManager; - -class SequenceSoundRuntime { -public: - SequenceSoundRuntime(); - ~SequenceSoundRuntime(); - - void Initialize(s32, void**, void const*); - void Finalize(); - void SetupSequenceTrack(s32, void**, void const*); - void SetupUserParam(void**, u64); - bool IsSoundArchiveAvailable() const; - s32 GetActiveCount() const; - s32 GetFreeCount() const; - void SetSequenceSkipIntervalTick(s32 tick); - s32 GetSequenceSkipIntervalTick(); - void Update(); - - u8 _0[0xD0]; - nn::atk::detail::SoundArchiveManager* mArchiveManager; // _D0 - u64 _D8; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/SoundArchiveManager.h b/src_remove/lib/nnheaders/include/nn/atk/detail/SoundArchiveManager.h deleted file mode 100644 index 0aa5066..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/SoundArchiveManager.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file SoundArchiveManager.h - * @brief Sound archive manager implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -class SoundHandle; -class SoundArchive; -class SoundDataManager; - -namespace detail { -class AddonSoundArchiveContainer; - -class SoundArchiveManager { -public: - SoundArchiveManager(); - - virtual ~SoundArchiveManager(); - - void Initialize(nn::atk::SoundArchive const*, nn::atk::SoundDataManager const*); - void ChangeTargetArchive(char const*); - void Finalize(); - bool IsAvailable() const; - nn::atk::detail::AddonSoundArchiveContainer* GetAddonSoundArchive(char const*) const; - - u64 _8; - u64* _10; - nn::atk::detail::AddonSoundArchiveContainer* _18; - u64* _20; - nn::atk::SoundArchive* mSoundArchive; // _28 - u64 _30; - u64 _38; - u64 _40; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/StreamSoundRuntime.h b/src_remove/lib/nnheaders/include/nn/atk/detail/StreamSoundRuntime.h deleted file mode 100644 index 11a24d6..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/StreamSoundRuntime.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file StreamSoundRuntime.h - * @brief Stream sound runtime information. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -namespace detail { -class StreamSoundRuntime { -public: - StreamSoundRuntime(); - ~StreamSoundRuntime(); - - u8 _0[0xB0]; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/atk/detail/WaveSoundRuntime.h b/src_remove/lib/nnheaders/include/nn/atk/detail/WaveSoundRuntime.h deleted file mode 100644 index 501d50a..0000000 --- a/src_remove/lib/nnheaders/include/nn/atk/detail/WaveSoundRuntime.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file WaveSoundRuntime.h - * @brief Wave sound runtime info. - */ - -#pragma once - -#include - -namespace nn { -namespace atk { -namespace detail { -class WaveSoundRuntime { -public: - WaveSoundRuntime(); - ~WaveSoundRuntime(); - - void Initialize(s32, void**, void const*); - void Finalize(); - s32 GetActiveCount() const; - s32 GetFreeWaveSoundCount() const; - void SetupUserParam(void**, u64); - void Update(); - - u8 _0[0x80]; -}; -}; // namespace detail -}; // namespace atk -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/audio.h b/src_remove/lib/nnheaders/include/nn/audio.h deleted file mode 100644 index 1e093de..0000000 --- a/src_remove/lib/nnheaders/include/nn/audio.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file audio.h - * @brief Audio implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace audio { -struct AudioRendererConfig { - u64* _0; - u64* _8; - u64* _10; - u64* _18; - u64* _20; - u64* _28; - u64* _30; - u64* _38; - u64* _40; - u64* _48; - u64* _50; -}; - -struct DelayType { - u64* _0; -}; - -struct FinalMixType { - u64* _0; -}; - -struct SubMixType { - u64* _0; -}; - -void SetDelayInputOutput(nn::audio::DelayType*, s8 const*, s8 const*, s32); -void* RemoveDelay(nn::audio::AudioRendererConfig*, nn::audio::DelayType*, nn::audio::FinalMixType*); -void* RemoveDelay(nn::audio::AudioRendererConfig*, nn::audio::DelayType*, nn::audio::SubMixType*); -bool IsDelayRemoveable(nn::audio::DelayType*); -}; // namespace audio -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/bcat.h b/src_remove/lib/nnheaders/include/nn/bcat.h deleted file mode 100644 index a47c06c..0000000 --- a/src_remove/lib/nnheaders/include/nn/bcat.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @file bcat.h - * @brief BCAT service implementation. - */ - -#pragma once - -#include -#include - -namespace nn { - -namespace bcat { - -struct DirectoryName { - void isValid(); -}; - -struct FileName { - void isValid(); -}; - -class DeliveryCacheDirectory { -public: - DeliveryCacheDirectory(); - ~DeliveryCacheDirectory(); - Result Open(nn::bcat::DirectoryName const&); - Result GetCount(); - Result Close(); -}; - -class DeliveryCacheFile { -public: - DeliveryCacheFile(); - ~DeliveryCacheFile(); - Result Open(nn::bcat::DirectoryName const&, nn::bcat::FileName const&); - Result Read(size_t file1, s64, void*, size_t file2); - Result GetSize(); - Result GetDigest(); - Result Close(); -}; - -class DeliveryCacheProgress { -public: - DeliveryCacheProgress(); - ~DeliveryCacheProgress(); - Result Detach(); - Result Update(); - Result GetStatus(); - Result GetCurrentDirectoryName(); - Result GetCurrentFileName(); - Result GetCurrentDownloaded(); - Result GetCurrentTotale(); - Result GetWholeDownloaded(); - Result GetWholeTotal(); - Result GetResult(); - // void Attach(nn::bcat::detail::ipc::IDeliveryCacheProgressService*); -}; - -namespace detail { - -namespace DeliveryCacheProgressImpl { -Result Clear(); -Result NotifyStartConnect(); -Result NotifyStartProcessList(); -Result SetWholeDownloadSize(s64); -Result SetDownloadProgress(s64, nn::bcat::DirectoryName const&, nn::bcat::FileName const&, s64); -Result NotifyStartDownloadFile(nn::bcat::DirectoryName const&, nn::bcat::FileName const&, s64); -Result UpdateDownloadFileProgress(s64); -Result NotifyStartCommitDirectory(nn::bcat::DirectoryName const&); -Result NotifyDone(nn::Result); - -} // namespace DeliveryCacheProgressImpl -class ShimLibraryGlobal { -public: - ShimLibraryGlobal(); - ~ShimLibraryGlobal(); - Result Initialize(); - Result GetSession(); - Result MountDeliveryCacheStorage(); - Result IsDeliveryCacheStorageMounted(); - Result UnmountDeliveryCacheStorage(); - // void CreateFileService(nn::bcat::detail::ipc::IDeliveryCacheFileService**); - // void CreateDirectoryService(nn::bcat::detail::ipc::IDeliveryCacheDirectoryService**) - Result IncrementDeliveryCacheFileCount(); - Result DecrementDeliveryCacheFileCount(); - Result IncrementDeliveryCacheDirectoryCount(); - Result DecrementDeliveryCacheFileCount(); - Result EnumerateDeliveryCacheDirectory(int*, nn::bcat::DirectoryName*, int); -}; - -namespace ipc { -Result Initialize(); -// void CreateBcatService(nn::bcat::detail::ipc::IBcatService**); -Result Finalize(); -// void CreateBcatService(nn::bcat::detail::ipc::IBcatService**); -// void CreateDeliveryCacheStorageService(nn::bcat::detail::ipc::IDeliveryCacheStorageService**); -// void CreateDeliveryCacheStorageService(nn::bcat::detail::ipc::IDeliveryCacheStorageService**, -// nn::ApplicationId); - -} // namespace ipc -} // namespace detail - -Result Initialize(); -Result MountDeliveryCacheStorage(); -Result UnmountDeliveryCacheStorage(); -Result EnumerateDeliveryCacheDirectory(int*, nn::bcat::DirectoryName*, int); -Result RequestSyncDeliveryCache(nn::bcat::DeliveryCacheProgress*); -Result EnumerateDeliveryCacheDirectory(int*, nn::bcat::DirectoryName*, int); - -} // namespace bcat -} // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/crypto.h b/src_remove/lib/nnheaders/include/nn/crypto.h deleted file mode 100644 index 872bb0c..0000000 --- a/src_remove/lib/nnheaders/include/nn/crypto.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @file crypto.h - * @brief Crypto service implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace crypto { -void GenerateSha256Hash(void*, ulong, void const*, ulong); - -class Sha256Context; - -void DecryptAes128Cbc(void*, u64, void const*, u64, void const*, u64, void const*, u64); -void EncryptAes128Cbc(void*, u64, void const*, u64, void const*, u64, void const*, u64); -void DecryptAes128Ccm(void*, u64, void*, u64, void const*, u64, void const*, u64, void const*, u64, - void const*, u64, u64); - -namespace detail { -class Md5Impl { -public: - void Initialize(); - void Update(void const*, u64 dataSize); - void ProcessBlock(); - void GetHash(void*, u64 hashSize); - void ProcessLastBlock(); - - u32 _x0; - u32 _x4; - u32 _x8; - u32 _xC; - u8 _x10[0x50 - 0x10]; - u64 _x50; - u32 _x58; -}; - -class Sha1Impl { -public: - void Initialize(); - void Update(void const*, u64); - void ProcessBlock(void const*); - void GetHash(void* destHash, u64); - void ProcessLastBlock(); - - u64 _x0; - u64 _x8; - u32 _x10; - u128 _x14; - u128 _x24; - u128 _x34; - u32 _x44; - u64 _x48; - u64 _x50; - u64 _x58; - u64 _x60; -}; - -class Sha256Impl { -public: - void Initialize(); - void Update(void const*, u64); - void ProcessBlocks(u8 const*, u64); - void GetHash(void* destHash, u64); - void ProcessLastBlock(); - void InitializeWithContext(nn::crypto::Sha256Context const*); - void GetContext(nn::crypto::Sha256Context*) const; - - u64 _x0; - u64 _x8; - u32 _x10; - u128 _x14; - u128 _x24; - u128 _x34; - u32 _x44; - u64 _x48; - u64 _x50; - u64 _x58; - u64 _x60; - u64 _x68; - u32 _x70; -}; -}; // namespace detail -}; // namespace crypto -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/diag.h b/src_remove/lib/nnheaders/include/nn/diag.h deleted file mode 100644 index a2791a9..0000000 --- a/src_remove/lib/nnheaders/include/nn/diag.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file diag.h - * @brief Module, logging, and symbol operations. - */ - -#pragma once - -#include - -namespace nn { -namespace diag { -struct LogMetaData; - -struct ModuleInfo { - char* mPath; - u64 mBaseAddr; - u64 mSize; -}; - -namespace detail { -// LOG -void LogImpl(nn::diag::LogMetaData const&, char const*, ...); -void AbortImpl(char const*, char const*, char const*, s32); -void AbortImpl(char const*, char const*, char const*, int, Result); -}; // namespace detail - -// MODULE / SYMBOL -u32* GetSymbolName(char* name, u64 nameSize, u64 addr); -u64 GetRequiredBufferSizeForGetAllModuleInfo(); -s32 GetAllModuleInfo(nn::diag::ModuleInfo** out, void* buffer, u64 bufferSize); -u64 GetSymbolSize(u64 addr); -}; // namespace diag -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/err.h b/src_remove/lib/nnheaders/include/nn/err.h deleted file mode 100644 index 1635bb0..0000000 --- a/src_remove/lib/nnheaders/include/nn/err.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include - -namespace nn { -namespace err { -enum ErrorCodeCategoryType : u32 { - unk1, - unk2, -}; - -class ApplicationErrorArg { -public: - ApplicationErrorArg(); - ApplicationErrorArg(u32 error_code, const char* dialog_message, const char* fullscreen_message, - const nn::settings::LanguageCode& languageCode); - void SetApplicationErrorCodeNumber(u32 error_code); - void SetDialogMessage(const char* message); - void SetFullScreenMessage(const char* message); - - u64 unk; - u32 error_code; - nn::settings::LanguageCode language_code; - char dialog_message[2048]; - char fullscreen_message[2048]; -}; - -u32 MakeErrorCode(ErrorCodeCategoryType err_category_type, u32 errorCodeNumber); -void ShowApplicationError(const ApplicationErrorArg& arg); -} // namespace err -} // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/friends.h b/src_remove/lib/nnheaders/include/nn/friends.h deleted file mode 100644 index e8c097b..0000000 --- a/src_remove/lib/nnheaders/include/nn/friends.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file friends.h - * @brief Friend implementation. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace friends { -typedef char Url[0xA0]; - -class AsyncContext; -class Profile; - -void Initialize(); -Result GetProfileList(nn::friends::AsyncContext* context, nn::friends::Profile* profiles, - nn::account::Uid const& userID, - nn::account::NetworkServiceAccountId const* accountIDs, s32 numAccounts); - -class Profile { -public: - Profile(); - - nn::account::NetworkServiceAccountId GetAccountId() const; - nn::account::Nickname& GetNickname() const; - bool IsValid() const; - Result GetProfileImageUrl(nn::friends::Url*, s32); -}; - -class AsyncContext { -public: - AsyncContext(); - ~AsyncContext(); - - Result GetSystemEvent(nn::os::SystemEvent*); - Result GetResult() const; -}; -}; // namespace friends -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/fs.h b/src_remove/lib/nnheaders/include/nn/fs.h deleted file mode 100644 index 9e60bca..0000000 --- a/src_remove/lib/nnheaders/include/nn/fs.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @file fs.h - * @brief Filesystem implementation. - */ - -#pragma once - -#include -#include - -namespace nn { -typedef u64 ApplicationId; - -namespace fs { -using namespace ams::fs; - -typedef u64 UserId; - -struct DirectoryEntry { - char name[0x300 + 1]; - char _x302[3]; - u8 type; - char _x304; - s64 fileSize; -}; - -struct FileHandle { - void* handle; -}; - -struct DirectoryHandle { - void* handle; -}; - -enum DirectoryEntryType { DirectoryEntryType_Directory, DirectoryEntryType_File }; - -enum OpenMode { - OpenMode_Read = 1 << 0, - OpenMode_Write = 1 << 1, - OpenMode_Append = 1 << 2, - - OpenMode_ReadWrite = OpenMode_Read | OpenMode_Write -}; - -enum OpenDirectoryMode { - OpenDirectoryMode_Directory = 1 << 0, - OpenDirectoryMode_File = 1 << 1, - OpenDirectoryMode_All = OpenDirectoryMode_Directory | OpenDirectoryMode_File, -}; - -struct ReadOption { - u32 value; - - static const ReadOption None; -}; -inline constexpr const ReadOption ReadOption::None = {0}; - -enum WriteOptionFlag { - WriteOptionFlag_Flush = 1 << 0, -}; - -struct WriteOption { - int flags; - - static WriteOption CreateOption(int flags) { - WriteOption op; - op.flags = flags; - return op; - } -}; - -// ROM -Result QueryMountRomCacheSize(size_t* size); -Result QueryMountRomCacheSize(size_t* size, nn::ApplicationId); -Result QueryMountAddOnContentCacheSize(size_t* size, int id); -Result MountRom(char const* name, void* cache, size_t cache_size); -Result MountAddOnContent(char const* name, int id, void* cache, size_t cache_size); -bool CanMountRomForDebug(); -Result CanMountRom(nn::ApplicationId); -Result QueryMountRomOnFileCacheSize(u64*, nn::fs::FileHandle); -Result MountRomOnFile(char const*, nn::fs::FileHandle, void*, u64); - -// SAVE -Result EnsureSaveData(nn::account::Uid const&); -Result MountSaveData(char const*, nn::fs::UserId); -Result MountSaveDataForDebug(char const*); -Result CommitSaveData(const char* path); - -// FILE -Result GetEntryType(nn::fs::DirectoryEntryType* type, char const* path); -Result CreateFile(char const* filepath, s64 size); -Result OpenFile(nn::fs::FileHandle*, char const* path, s32); -Result SetFileSize(FileHandle fileHandle, s64 filesize); -void CloseFile(FileHandle fileHandle); -Result FlushFile(FileHandle fileHandle); -Result DeleteFile(char const* filepath); -Result ReadFile(u64* outSize, nn::fs::FileHandle handle, s64 offset, void* buffer, u64 bufferSize, - const ReadOption& option); -Result ReadFile(u64* outSize, nn::fs::FileHandle handle, s64 offset, void* buffer, u64 bufferSize); -Result ReadFile(nn::fs::FileHandle handle, s64 offset, void* buffer, u64 bufferSize); -Result WriteFile(FileHandle handle, s64 fileOffset, void const* buff, u64 size, - WriteOption const& option); -Result GetFileSize(s64* size, FileHandle fileHandle); - -// DIRECTORY -// there are three open modes; dir, file, all -Result OpenDirectory(DirectoryHandle* handle, char const* path, s32 openMode); -void CloseDirectory(DirectoryHandle directoryHandle); -Result ReadDirectory(s64*, DirectoryEntry*, DirectoryHandle directoryHandle, s64); -Result CreateDirectory(char const* directorypath); -Result GetDirectoryEntryCount(s64*, DirectoryHandle); - -// SD -Result MountSdCard(char const*); -Result MountSdCardForDebug(char const*); -bool IsSdCardInserted(); -Result FormatSdCard(); -Result FormatSdCardDryRun(); -bool IsExFatSupported(); - -Result MountHost(char const* mount, char const* path); -Result MountHostRoot(); -Result UnmountHostRoot(); - -Result Unmount(char const* mount); - -// BCAT -Result MountBcatSaveData(char const*, ApplicationId); -Result CreateBcatSaveData(ApplicationId, s64); - -}; // namespace fs -}; // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/g3d/BindFuncTable.h b/src_remove/lib/nnheaders/include/nn/g3d/BindFuncTable.h deleted file mode 100644 index 3f0da76..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/BindFuncTable.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include - -namespace nn { -namespace g3d { -struct DDLDeclarations { - u64 _0; - u32 _8; - u32 DDLDeclarations_xC; - u64 _10; - u64 _18; -}; - -class BindFuncTable { - struct StringLength { - size_t length; - const char* content; - }; - struct EntryPointer { - void* something_0; - nn::g3d::BindFuncTable::StringLength* string; - }; - -private: - int lengths[4]; - nn::g3d::BindFuncTable::EntryPointer strings[4]; -}; - -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResFile.h b/src_remove/lib/nnheaders/include/nn/g3d/ResFile.h deleted file mode 100644 index ed7c865..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResFile.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file ResFile.h - * @brief Resource file for models. - */ - -#pragma once - -#include -#include -#include -#include - -namespace nn { - -namespace gfx { -template -class TDevice; -} - -namespace g3d { -class ResModel; -class ResMaterialAnim; -class ResShapeAnim; -class ResSceneAnim; -typedef void* TextureRef; - -class ResFile : public nn::util::BinaryFileHeader { -public: - static bool IsValid(void const* modelSrc); - void Relocate(); - void Unrelocate(); - static nn::g3d::ResFile* ResCast(void*); - s32 BindTexture(nn::g3d::TextureRef (*ref)(char const*, void*), void*); - void ReleaseTexture(); - void - Setup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*); - void - Setup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*, - nn::gfx::TMemoryPool, nn::gfx::ApiVersion<8>>>*, - s64, u64); - void - Cleanup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*); - void Reset(); - - u64 mFileNameLength; // _20 - nn::g3d::ResModel* mModels; // _28 - u64 mModelDictOffset; // _30 - u64 mSkeleAnimOffset; // _38 - u64 mSkeleAnimDictOffset; // _40 - nn::g3d::ResMaterialAnim* mMatAnims; // _48 - u64 mMatAnimsDictOffset; // _50 - u64 mBoneVisiOffset; // _58 - u64 mBoneVisiDictOffset; // _60 - nn::g3d::ResShapeAnim* mShapeAnims; // _68 - u64 mShapeAnimDictOffset; // _70 - nn::g3d::ResSceneAnim* mSceneAnims; // _78 - u64 mSceneAnimDictOffset; // _80 - u64 mMemoryPool; // _88 - u64 mBufferSection; // _90 - u64 mEmbeddedFilesOffset; // _98 - u64 mEmbeddedFilesDictOffset; // _A0 - u64 mPadding; // _A8 - u64 mStrTableOffset; // _B0 - u32 mStrTableSize; // _B8 - u16 mModelCount; // _BC - u16 mSkeleAnimCount; // _BE - u16 mMatAnimCount; // _C0 - u16 mBoneAnimCount; // _C2 - u16 mShapeAnimCount; // _C4 - u16 mSceneAnimCount; // _C6 - u16 mExternalFileCount; // _C8 - u8 mPad[0x6]; // _CA -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResFogAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResFogAnim.h deleted file mode 100644 index e55846f..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResFogAnim.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -namespace nn { -namespace g3d { -class ResFogAnim { -public: - char mMagic[4]; // _0 - u16 mFlags; // _4 - u16 mPad; // _6 - s32 mNumFrames; // _8 - u8 mNumCurves; // _C - u8 mIdxDistanceAttnFunc; // _D - u16 mNumUserData; // _E - u32 mSizeBaked; // _10 - u64 mNameOffset; // _14 - u64 mFuncNameOffset; // _1C -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResLightAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResLightAnim.h deleted file mode 100644 index 46cd6c3..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResLightAnim.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -namespace nn { -namespace g3d { -class ResLightAnim { -public: - s32 Bind(nn::g3d::BindFuncTable const&); -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResMaterial.h b/src_remove/lib/nnheaders/include/nn/g3d/ResMaterial.h deleted file mode 100644 index 60dcea7..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResMaterial.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file ResMaterial.h - * @brief Resource material for models. - */ - -#pragma once - -#include - -namespace nn { -namespace g3d { -typedef void* TextureRef; - -class ResMaterial { -public: - u64 BindTexture(nn::g3d::TextureRef (*)(char const*, void*), void*); - void ForceBindTexture(nn::g3d::TextureRef const&, char const*); - void ReleaseTexture(); - void - Setup(nn::gfx::TDevice, nn::gfx::ApiVersion<4>>>*); - void - Cleanup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*); - void Reset(); - void Reset(u32); - - u8 _0[0xB4]; -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResMaterialAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResMaterialAnim.h deleted file mode 100644 index 6556628..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResMaterialAnim.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file ResMaterialAnim.h - * @brief Resource file for material animations. - */ - -#pragma once - -namespace nn { -namespace g3d { -typedef void* TextureRef; - -class ResMaterialAnim { -public: - void ReleaseTexture(); - s32 BindTexture(nn::g3d::TextureRef (*)(char const*, void*), void*); - void Reset(); -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResModel.h b/src_remove/lib/nnheaders/include/nn/g3d/ResModel.h deleted file mode 100644 index 8c47380..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResModel.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file ResModel.h - * @brief Resource model. - */ - -#pragma once - -#include - -namespace nn { -namespace g3d { -class ResMaterial; - -typedef void* TextureRef; - -class ResModel { -public: - u64 BindTexture(nn::g3d::TextureRef (*)(char const*, void*), void*); - void ForceBindTexture(nn::g3d::TextureRef const&, char const*); - void ReleaseTexture(); - void - Setup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*); - void - Cleanup(nn::gfx::TDevice, nn::gfx::ApiVersion<8>>>*); - void Reset(); - void Reset(u32); - nn::g3d::ResMaterial* FindMaterial(char const* materialName) const; - - u8 _0[0x70]; -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResSceneAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResSceneAnim.h deleted file mode 100644 index 0f45a9f..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResSceneAnim.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file ResSceneAnim.h - * @brief Resource file for scene animations. - */ - -#pragma once - -#include - -namespace nn { -namespace g3d { -class ResLightAnim; -class ResFogAnim; -struct BindFuncTable; - -class ResSceneAnim { -public: - s32 Bind(nn::g3d::BindFuncTable const&); - void Release(); - void Reset(); - - char mMagic[4]; // _0 - s32 mBlockOffset; // _4 - u64 mBlockSize; // _8 - u64 mNameOffset; // _10 - u64 mPathOffset; // _18 - u64 mCameraAnimOffset; // _20 - u64 mCameraAnimDictOffset; // _28 - nn::g3d::ResLightAnim* mLightAnims; // _30 - u64 mLightAnimDictOffset; // _38 - nn::g3d::ResFogAnim* mFogAnims; // _40 - u64 mFogAnimDictOffset; // _48 - u64 mUserDataOffset; // _50 - u64 mUserDataDictOffset; // _58 - u16 mUserDataCount; // _60 - u16 mCameraAnimCount; // _62 - u16 mLightAnimCount; // _64 - u16 mFogAnimCount; // _66 -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResShapeAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResShapeAnim.h deleted file mode 100644 index 45355e8..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResShapeAnim.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @file ResShapeAnim.h - * @brief Resource file for shape animations. - */ - -#pragma once - -namespace nn { -namespace g3d { -class ResShapeAnim { -public: - void Reset(); -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/g3d/ResSkeletalAnim.h b/src_remove/lib/nnheaders/include/nn/g3d/ResSkeletalAnim.h deleted file mode 100644 index 5216851..0000000 --- a/src_remove/lib/nnheaders/include/nn/g3d/ResSkeletalAnim.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @file ResSkeletalAnim.h - * @brief Resource file for skeletal animations. - */ - -#pragma once - -namespace nn { -namespace g3d { -class ResSkeletalAnim { -public: - void Reset(); -}; -}; // namespace g3d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/api.h b/src_remove/lib/nnheaders/include/nn/gfx/api.h deleted file mode 100644 index 4aa5398..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/api.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file api.h - * @brief GFX API version and typing. - */ - -#pragma once - -namespace nn { -namespace gfx { -// passes both ApiType<4> and ApiVersion<8> -template -class ApiVariation {}; - -// usually passed as just a 4 -template -class ApiType {}; - -// usually passed as just a 8 -template -class ApiVersion {}; -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/buffer.h b/src_remove/lib/nnheaders/include/nn/gfx/buffer.h deleted file mode 100644 index 791fa54..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/buffer.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @file buffer.h - * @brief GFX Buffers. - */ - -#pragma once - -#include - -namespace nn { -namespace gfx { -class BufferInfo { -public: - void SetDefault(); - - u64 mInfo; // _0 -}; - -class BufferTextureViewInfo { -public: - void SetDefault(); - - u64 _0; - u64 _8; - u64 _10; -}; -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/detail/bufferimpl.h b/src_remove/lib/nnheaders/include/nn/gfx/detail/bufferimpl.h deleted file mode 100644 index a437b33..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/detail/bufferimpl.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file bufferimpl.h - * @brief Buffer implementation for GFX. - */ - -#pragma once - -namespace nn { -namespace gfx { -class GpuAddress; -class BufferInfo; - -namespace detail { -template -class MemoryPoolImpl; -template -class DeviceImpl; - -template -class BufferImpl { -public: - BufferImpl(); - ~BufferImpl(); - - void Initialize(nn::gfx::detail::DeviceImpl< - nn::gfx::ApiVariation, nn::gfx::ApiVersion<8>>>*, - nn::gfx::BufferInfo const&, - nn::gfx::detail::MemoryPoolImpl< - nn::gfx::ApiVariation, nn::gfx::ApiVersion<8>>>*, - s64, u64); - void Finalize(nn::gfx::detail::DeviceImpl< - nn::gfx::ApiVariation, nn::gfx::ApiVersion<8>>>*); - void* Map() const; - void Unmap() const; - void FlushMappedRange(s64, u64) const; - void InvalidateMappedRange(s64, u64) const; - void GetGpuAddress(nn::gfx::GpuAddress*) const; - - T* mBuff; // _0 -}; - -template -class CommandBufferImpl { -public: - CommandBufferImpl(); - ~CommandBufferImpl(); - - void Reset(); - void Begin(); - void End(); - void Dispatch(s32, s32, s32); -}; -}; // namespace detail -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/detail/deviceimpl.h b/src_remove/lib/nnheaders/include/nn/gfx/detail/deviceimpl.h deleted file mode 100644 index 569d6dc..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/detail/deviceimpl.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @file deviceimpl.h - * @brief Device implementation for GFX. - */ - -#pragma once - -namespace nn { -namespace gfx { -class DeviceInfo; - -namespace detail { -template -class DeviceImpl { -public: - DeviceImpl(); - ~DeviceImpl(); - - void Initialize(nn::gfx::DeviceInfo const& deviceInfo); - void Finalize(); -}; -}; // namespace detail -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/detail/pool.h b/src_remove/lib/nnheaders/include/nn/gfx/detail/pool.h deleted file mode 100644 index a332ab9..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/detail/pool.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include - -namespace nn { -namespace gfx { -struct MemoryPoolInfo; -template -struct DeviceImpl; - -namespace detail { -class MemoryPoolData { -public: - void SetDefault(); - - s32 _0; // set to 0x88 - s32 _4; - u64 _8; -}; - -template -class MemoryPoolImpl { -public: - MemoryPoolImpl(); - ~MemoryPoolImpl(); - - void Initialize(nn::gfx::detail::DeviceImpl< - nn::gfx::ApiVariation, nn::gfx::ApiVersion<8>>>*, - nn::gfx::MemoryPoolInfo const&); - void Finalize(nn::gfx::detail::DeviceImpl< - nn::gfx::ApiVariation, nn::gfx::ApiVersion<8>>>*); - void* Map() const; - void Unmap() const; - void FlushMappedRange(s64, u64) const; - void InvalidateMappedRange(s64, u64) const; - - u8 _0[0x120]; // pool data -}; -}; // namespace detail -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/device.h b/src_remove/lib/nnheaders/include/nn/gfx/device.h deleted file mode 100644 index 7c00621..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/device.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file device.h - * @brief Device implementation for GFX. - */ - -#pragma once - -#include - -namespace nn { -namespace gfx { -class DeviceInfo { -public: - u64 mInfo; // _0 -}; - -template -class TDevice {}; -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/gfx/memory.h b/src_remove/lib/nnheaders/include/nn/gfx/memory.h deleted file mode 100644 index 9404a1e..0000000 --- a/src_remove/lib/nnheaders/include/nn/gfx/memory.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file memory.h - * @brief GFX Memory Pool. - */ - -#pragma once - -namespace nn { -namespace gfx { -// todo: finish me! -template -class TMemoryPool {}; -}; // namespace gfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/hid.h b/src_remove/lib/nnheaders/include/nn/hid.h deleted file mode 100644 index 76ebd9d..0000000 --- a/src_remove/lib/nnheaders/include/nn/hid.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file hid.h - * @brief Functions that help process gamepad inputs. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace hid { -struct NpadHandheldState; -struct NpadStyleTag; - -struct ControllerSupportArg { - u8 mMinPlayerCount; - u8 mMaxPlayerCount; - u8 mTakeOverConnection; - bool mLeftJustify; - bool mPermitJoyconDual; - bool mSingleMode; - bool mUseColors; - sead::Color4u8 mColors[4]; - u8 mUsingControllerNames; - char mControllerNames[4][0x81]; -}; - -struct ControllerSupportResultInfo { - int mPlayerCount; - int mSelectedId; -}; - -void InitializeNpad(); -void SetSupportedNpadIdType(u32 const*, u64); -void SetSupportedNpadStyleSet(nn::util::BitFlagSet<32, nn::hid::NpadStyleTag>); -void GetNpadStyleSet(u32 const&); -void GetNpadStates(nn::hid::NpadHandheldState*, s32, u32 const&); -static int ShowControllerSupport(nn::hid::ControllerSupportResultInfo*, - ControllerSupportArg const&); - -}; // namespace hid -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/image.h b/src_remove/lib/nnheaders/include/nn/image.h deleted file mode 100644 index 44e50bd..0000000 --- a/src_remove/lib/nnheaders/include/nn/image.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file image.h - * @brief JPEG decoding library. - */ - -#pragma once - -#include - -namespace nn { -namespace image { -// there's probably more -enum JpegStatus { - OK = 0, - INVALID_FORMAT = -32, - UNSUPPORTED_FORMAT = -33, - OUT_OF_MEMORY = -64, -}; - -enum PixelFormat { RGBA32, RGB24 }; - -enum ProcessStage { UNREGISTERED = 0, REGISTERED = 1, ANALYZED = 2 }; - -struct Dimension { - f32 width; - f32 height; -}; - -class JpegDecoder { -public: - JpegDecoder(); - virtual ~JpegDecoder(); - - void SetImageData(void const* source, u64 size); - nn::image::JpegStatus Analyze(); - nn::image::Dimension GetAnalyzedDimension() const; - s64 GetAnalyzedWorkBufferSize() const; - JpegStatus Decode(void* out, s64, s32 alignment, void*, s64); - - nn::image::ProcessStage mProcessStage; // _8 - void* mData; // _C - s64 mSize; // _14 - s32 _18; - nn::image::PixelFormat mFormat; // _1C - Dimension mImgDimensions; // _20 - s64 _28; - // rest is related to EXIF processing -}; -}; // namespace image -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/init.h b/src_remove/lib/nnheaders/include/nn/init.h deleted file mode 100644 index 2f84910..0000000 --- a/src_remove/lib/nnheaders/include/nn/init.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file init.h - * @brief Initialization functions for OS related functions. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace init { -void InitializeAllocator(void* addr, u64 size); -nn::mem::StandardAllocator* GetAllocator(); - -namespace detail { -void* DefaultAllocatorForThreadLocal(u64, u64); -void* DefaultDeallocatorForThreadLocal(void*, u64); -}; // namespace detail -} // namespace init -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/mem.h b/src_remove/lib/nnheaders/include/nn/mem.h deleted file mode 100644 index 5cb5974..0000000 --- a/src_remove/lib/nnheaders/include/nn/mem.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file mem.h - * @brief Memory allocation functions. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace mem { -class StandardAllocator { -public: - StandardAllocator(); - - void Initialize(void* address, u64 size); - void Finalize(); - void* Reallocate(void* address, u64 newSize); - void* Allocate(u64 size); - void Free(void* address); - void Dump(); - - bool mIsInitialized; // _0 - bool mIsEnabledThreadCache; // _1 - u16 _2; - u64* mAllocAddr; // _4 -}; -}; // namespace mem -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/RootObject.h b/src_remove/lib/nnheaders/include/nn/nex/RootObject.h deleted file mode 100644 index 68e9649..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/RootObject.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file RootObject.h - * @brief RootObject for NEX. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class RootObject { -public: - enum TargetPool {}; - - virtual ~RootObject(); - - void* operator new(u64); - void operator delete(void*); - void* operator new(u64, char const*, u32); - void* operator new[](u64); - void* operator new[](u64, char const*, u32); - void operator delete[](void*); - void operator delete(void*, char const*, u32); - void operator delete[](void*, char const*, u32); - void* operator new(u64, nn::nex::RootObject::TargetPool); - void* operator new(u64, nn::nex::RootObject::TargetPool, char const*, u32); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/auth.h b/src_remove/lib/nnheaders/include/nn/nex/auth.h deleted file mode 100644 index 30676b4..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/auth.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file auth.h - * @brief Authorization for DDL. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class NintendoAuthenticationDDLDeclarations : public nn::nex::DDLDeclarations { -public: - virtual ~NintendoAuthenticationDDLDeclarations(); - virtual void Init(); - - void Register(); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/buffer.h b/src_remove/lib/nnheaders/include/nn/nex/buffer.h deleted file mode 100644 index eab8d2a..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/buffer.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @file buffer.h - * @brief NEX buffer implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class String; -// todo -class Buffer { -public: - Buffer(nn::nex::Buffer const&); - Buffer(nn::nex::Buffer&&); - Buffer(nn::nex::String const&); - - void FreeDataBuffer(u8*, u64); - - virtual ~Buffer(); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/cache.h b/src_remove/lib/nnheaders/include/nn/nex/cache.h deleted file mode 100644 index c94285d..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/cache.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file cache.h - * @brief NEX Cache Mangement. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class String; -class BasicCache; - -class CacheManager { -public: - CacheManager(); - ~CacheManager(); - - nn::nex::BasicCache* GetCache(nn::nex::String const&); -}; - -class BasicCache { -public: - BasicCache(nn::nex::String const&); - - virtual ~BasicCache(); - - u64 _8; - u8 _10; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/checksum.h b/src_remove/lib/nnheaders/include/nn/nex/checksum.h deleted file mode 100644 index 44006cd..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/checksum.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file checksum.h - * @brief NEX Checksum Implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class Buffer; - -class ChecksumAlgorithm : public nn::nex::RootObject { -public: - ChecksumAlgorithm(); - - virtual ~ChecksumAlgorithm(); - - virtual bool ComputeChecksum(nn::nex::Buffer const&, nn::nex::Buffer*) = 0; - // virtual bool ComputeChecksum(u8 const **, u64 const *, u64, nn::nex::SignatureBytes &) = 0; - virtual bool IsReady() const; - virtual void ComputeChecksumForTransport(u8 const*, u64); - virtual u32 ComputeChecksumForTransportArray(u8 const**, u64 const*, u64) = 0; - virtual u32 GetChecksumLength() = 0; - - u64 _8; - u8 _10; -}; - -class MD5Checksum : public nn::nex::ChecksumAlgorithm { -public: - MD5Checksum(); - - virtual ~MD5Checksum(); - - virtual bool ComputeChecksum(nn::nex::Buffer const&, nn::nex::Buffer*); - virtual u32 ComputeChecksumForTransportArray(u8 const**, u64 const*, u64); - virtual u32 GetChecksumLength(); -}; - -class CRC16Checksum : public nn::nex::ChecksumAlgorithm { -public: - CRC16Checksum(); - - virtual ~CRC16Checksum(); - - virtual bool ComputeChecksum(nn::nex::Buffer const&, nn::nex::Buffer*); - virtual u32 ComputeChecksumForTransportArray(u8 const**, u64 const*, u64); - virtual u32 GetChecksumLength(); -}; - -/* -this actually inherits some sort of KeyedChecksum thing. whatever -class HMACChecksum : public nn::nex::ChecksumAlgorithm -{ - -}; -*/ -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/client.h b/src_remove/lib/nnheaders/include/nn/nex/client.h deleted file mode 100644 index df00dd0..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/client.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @file client.h - * @brief Client implementations for NEX. - */ -#pragma once - -#include - -namespace nn { -namespace nex { -class Credentials; -class EndPoint; -class Message; -class ProtocolCallContext; -class ProtocolRequestBrokerInterface; - -class Protocol : public nn::nex::SystemComponent { -public: - enum _Command { Response, Request }; - - enum _Type { - Client, // implemented in nn::nex::ClientProtocol - Server // implemented in nn::nex::ServerProtocol - }; - - Protocol(u32); - - virtual ~Protocol(); - - virtual char* GetType() const; - virtual bool IsAKindOf(char const*) const; - virtual void EnforceDeclareSysComponentMacro(); - - virtual bool BeginInitialization(); - virtual bool BeginTermination(); - - virtual nn::nex::Protocol::_Type GetProtocolType() const = 0; - virtual void EndPointDisconnected(nn::nex::EndPoint*); - virtual void FaultDetected(nn::nex::EndPoint*, u32); - virtual nn::nex::Protocol* Clone() const; - virtual bool Reload(); - - nn::nex::EndPoint* GetOutgoingConnection() const; - void SetIncomingConnection(nn::nex::EndPoint*); - void SetProtocolID(u16); - void AddMethodID(nn::nex::Message*, u32); - void CopyMembers(nn::nex::Protocol const*); - void AssociateProtocolRequestBroker(nn::nex::ProtocolRequestBrokerInterface*); - void ClearFlag(u32 newFlag); - - static void ExtractProtocolKey(nn::nex::Message*, nn::nex::Protocol::_Command&, u16&); - static bool IsOldRVDDLVersion(nn::nex::EndPoint*); - - u16 mProtocolID; // _48 - u16 _4A; - u32 _4C; - nn::nex::EndPoint* mOutgoingConnection; // _50 - nn::nex::ProtocolRequestBrokerInterface* mBrokerInterface; // _58 - u32 mFlags; // _60 - u32 _64; - nn::nex::EndPoint* mIncomingConnection; // _68 - u32 mUseLoopback; // _70 (boolean) - u32 _74; - u64 _78; - u32 _80; - u32 _84; -}; - -class ClientProtocol : public nn::nex::Protocol { -public: - ClientProtocol(u32); - - virtual ~ClientProtocol(); - - virtual char* GetType() const; - virtual bool IsAKindOf(char const*) const; - virtual void EnforceDeclareSysComponentMacro(); - - virtual nn::nex::Protocol::_Type GetProtocolType() const = 0; - - virtual void ExtractCallSpecificResults(nn::nex::Message*, nn::nex::ProtocolCallContext*) = 0; - virtual nn::nex::ClientProtocol* CreateResponder() const = 0; - virtual void SetDefaultCredentials(nn::nex::Credentials*); - - bool SendOverLocalLoopback(nn::nex::ProtocolCallContext*, nn::nex::Message*); - bool SendRMCMessage(nn::nex::ProtocolCallContext*, nn::nex::Message*); - void ProcessResponse(nn::nex::Message*, nn::nex::EndPoint*); - - nn::nex::Credentials* mCredentials; // _88 -}; - -class ServerProtocol : public nn::nex::Protocol { -public: - ServerProtocol(u32); - - virtual ~ServerProtocol(); - - virtual char* GetType() const; - virtual bool IsAKindOf(char const*) const; - virtual void EnforceDeclareSysComponentMacro(); - - virtual nn::nex::Protocol::_Type GetProtocolType() const = 0; - - virtual void DispatchProtocolMessage(nn::nex::Message*, nn::nex::Message*, bool*, - nn::nex::EndPoint*) = 0; - virtual void DispatchProtocolMessageWithAttemptCount(u64, nn::nex::Message*, nn::nex::Message*, - bool*, int*, nn::nex::EndPoint*); - virtual bool UseAttemptCountMethod(); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/data.h b/src_remove/lib/nnheaders/include/nn/nex/data.h deleted file mode 100644 index 2446fce..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/data.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file data.h - * @brief NEX Data. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class Data : public nn::nex::RootObject { -public: - Data(); - - virtual ~Data(); - - u8 _8; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/ddl.h b/src_remove/lib/nnheaders/include/nn/nex/ddl.h deleted file mode 100644 index 85ee927..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/ddl.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file ddl.h - * @brief DDL Declaration Implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class DDLDeclarations : public nn::nex::RootObject { -public: - DDLDeclarations(bool); - - virtual ~DDLDeclarations(); - - virtual void Init() = 0; - - void RegisterIfRequired(); - void Unregister(); - static void UnregisterAll(); - void LoadAll(); - void Load(); - void UnloadAll(); - void Unload(); - void ResetDOClassIDs(); - - u32 mNumDecsLoaded; // _8 - u8 DDLDeclarations_xC; - u8 _D; // padding - u8 _E; // ^^ - u8 _F; // ^^ - u64 _10; - bool _18; - - static nn::nex::DDLDeclarations* s_pFirstDDLDecl; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/dynamic.h b/src_remove/lib/nnheaders/include/nn/nex/dynamic.h deleted file mode 100644 index b28da43..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/dynamic.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file dynamic.h - * @brief NEX Dyamnic Runtime. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class DynamicRunTimeInterface : public nn::nex::RootObject { -public: - DynamicRunTimeInterface(); - - virtual ~DynamicRunTimeInterface(); - - u64* GetInstance(); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/encryption.h b/src_remove/lib/nnheaders/include/nn/nex/encryption.h deleted file mode 100644 index f155d5d..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/encryption.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file encryption.h - * @brief NEX Encryption Algorithm. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class Buffer; -class Key; - -class EncryptionAlgorithm : public nn::nex::RootObject { -public: - EncryptionAlgorithm(u32, u32); - - virtual ~EncryptionAlgorithm(); - - virtual bool Encrypt(nn::nex::Buffer const&, nn::nex::Buffer*) = 0; - virtual bool Encrypt(nn::nex::Buffer*); - virtual bool Decrypt(nn::nex::Buffer const&, nn::nex::Buffer*) = 0; - virtual bool Decrypt(nn::nex::Buffer*); - virtual bool GetErrorString(u32, char* destStr, u64 errLen); - virtual void KeyHasChanged(); - - bool SetKey(nn::nex::Key const& key); - - u64 _8; - u64 _10; - u64 _18; - u64 _20; - u64 _28; - u64 _30; - u64 _38; - u64 _40; -}; - -class RC4Encryption : public nn::nex::EncryptionAlgorithm { -public: - RC4Encryption(); - - virtual ~RC4Encryption(); - - virtual bool Encrypt(nn::nex::Buffer const&, nn::nex::Buffer*); - virtual bool Encrypt(nn::nex::Buffer*); - virtual bool Decrypt(nn::nex::Buffer const&, nn::nex::Buffer*); - virtual bool Decrypt(nn::nex::Buffer*); - - virtual void KeyHasChanged(); - - void GetDefaultKey(); - void PrepareEncryption(); - void ReinitStateArray(); - void SetReinitEverytime(bool); - - u8 _48[0x298 - 0x48]; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/hash.h b/src_remove/lib/nnheaders/include/nn/nex/hash.h deleted file mode 100644 index 5da8b3f..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/hash.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @file hash.h - * @brief NEX Hash Implementation. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace nex { -class MD5 : public nn::crypto::detail::Md5Impl, public nn::nex::RootObject { -public: - MD5(); - - void init(); - void raw_digest(u8*); - void hex_digest(); - - u8 _5C[0x74 - 0x5C]; -}; - -class Sha1 : public nn::crypto::detail::Sha1Impl, public nn::nex::RootObject { -public: - Sha1(); - - void Update(void const*, u64); - void GetHash(void*, u64); - void GenerateHash(void*, u64, void const*, u64); - - u32 _68; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/instance.h b/src_remove/lib/nnheaders/include/nn/nex/instance.h deleted file mode 100644 index 833419f..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/instance.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file instance.h - * @brief NEX Instance Controllers. - */ -#pragma once - -#include - -namespace nn { -namespace nex { -class InstanceTable; - -class InstanceControl : public nn::nex::RootObject { -public: - InstanceControl(u32, u32); - - u32 mInstanceContext; // _8 - u32 mInstanceType; // _C - void* mDelegateInstance; // _10 - bool mIsValidControl; // _18 - u8 _19; // probably padding - u8 _1A; - u8 _1B; - - static nn::nex::InstanceTable* s_oInstanceTable; -}; - -class InstanceTable : public nn::nex::RootObject { -public: - InstanceTable(); - - virtual ~InstanceTable(); - - bool AddInstance(nn::nex::InstanceControl*, u32, u32); - void DelInstance(nn::nex::InstanceControl*, u32, u32); - u32 CreateContext(); - bool DeleteContext(u32); - void AllocateExtraContexts(u64 size); - void FreeExtraContexts(); - u32 GetHighestID() const; - u32 FindInstanceContext(nn::nex::InstanceControl*, u32); - - u8 _0[0x94]; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/key.h b/src_remove/lib/nnheaders/include/nn/nex/key.h deleted file mode 100644 index 359618d..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/key.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file key.h - * @brief NEX Key Implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class String; - -class Key : public nn::nex::RootObject { -public: - Key(); - Key(u8 const* src, u64 size); - Key(u64 size); - Key(nn::nex::Key const&); - Key(nn::nex::String const&); - - virtual ~Key(); - - u64* GetContentPtr(); - u64 GetLength() const; - nn::nex::Key& operator=(nn::nex::Key const&); - bool operator==(nn::nex::Key const&); - bool operator!=(nn::nex::Key const&); - void PrepareContentPtr(u64); - nn::nex::String* ToString(); - void ExtractToString(nn::nex::String*) const; - void Trace(u64) const; - void GenerateRandomKey(u64); - - u64* mContentPtrStart; // _10 - u64* mContentPtrEnd; // _18 -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/plugin.h b/src_remove/lib/nnheaders/include/nn/nex/plugin.h deleted file mode 100644 index 2e86ca8..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/plugin.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file plugin.h - * @brief Plugin interface for NEX. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class PluginObject : public nn::nex::RootObject {}; - -class Plugin : public nn::nex::RootObject { -public: - Plugin(); - - virtual ~Plugin(); - - // there's a bunch of pure virtual methods but nothing ever inherits this class... - virtual bool Initalize(); - virtual void ThreadAttach(); - virtual void ThreadDetach(); - virtual void Destroy(); - - void SetLibrary(void*); - - void* mLibrary; // _8s - - static nn::nex::Plugin* s_pInstance; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/pseudo.h b/src_remove/lib/nnheaders/include/nn/nex/pseudo.h deleted file mode 100644 index 1fde1a7..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/pseudo.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file psuedo.h - * @brief Psuedo variable implementation for NEX. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace nex { -class PseudoGlobalVariableList; - -class PseudoGlobalVariableRoot : public nn::nex::RootObject { -public: - PseudoGlobalVariableRoot(); - - virtual ~PseudoGlobalVariableRoot(); - - virtual void AllocateExtraContexts() = 0; - virtual void FreeExtraContexts() = 0; - virtual void ResetContext(u32) = 0; - virtual PseudoGlobalVariableRoot* GetNext() = 0; - virtual void SetNext(PseudoGlobalVariableRoot* pNextVariable) = 0; - - static void ResetContextForAllVariables(u32); - static void AllocateExtraContextsForAllVariables(u64); - static void FreeExtraContextsForAllVariables(); - static s64 GetNbOfExtraContexts(); - - nn::nex::PseudoGlobalVariableRoot* mNextRoot; // _8 - - static s64 s_uiNbOfExtraContexts; - static PseudoGlobalVariableList s_oList; -}; - -class PseudoGlobalVariableList : public nn::nex::RootObject { -public: - PseudoGlobalVariableList(); - - virtual ~PseudoGlobalVariableList(); - - void AddVariable(nn::nex::PseudoGlobalVariableRoot*); - void RemoveVariable(nn::nex::PseudoGlobalVariableRoot*); - static nn::nex::PseudoGlobalVariableRoot* GetVariable(u32 idx); - static u32 FindVariableIndex(nn::nex::PseudoGlobalVariableRoot*); - void AllocateExtraContextsForAllVariables(); - void FreeExtraContextsForAllVariables(); - void ResetContextForAllVariables(u32); - static u32 GetNbOfVariables(); - - static PseudoGlobalVariableRoot* s_pVariableListHead; - static u32 m_uiNbOfVariables; -}; - -template -class PseudoGlobalVariable : public nn::nex::PseudoGlobalVariableRoot { -public: - PseudoGlobalVariable(); - - virtual ~PseudoGlobalVariable(); - - virtual void AllocateExtraContexts(); - virtual void FreeExtraContexts(); - virtual void ResetContext(u32); - virtual PseudoGlobalVariableRoot* GetNext(); - virtual void SetNext(PseudoGlobalVariableRoot* pNextVariable); -}; - -class PseudoSingleton : public nn::nex::InstanceControl { -public: - PseudoSingleton(u32); - - virtual ~PseudoSingleton(); - - static bool s_bUseInstantiationContext; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/reference.h b/src_remove/lib/nnheaders/include/nn/nex/reference.h deleted file mode 100644 index 44c171e..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/reference.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @file reference.h - * @brief Reference implementations for NEX. - */ -#pragma once - -#include - -namespace nn { -namespace nex { -class RefCountedObject : public nn::nex::RootObject { -public: - virtual ~RefCountedObject(); - - u32 _8; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/socket.h b/src_remove/lib/nnheaders/include/nn/nex/socket.h deleted file mode 100644 index 660a8e4..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/socket.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include //FIXME requires proper musl-setup -#include -#include "RootObject.h" - -namespace nn { -namespace nex { -class TransportProtocol { -public: - enum Type { - Sock_Default = 0, - Sock_Stream = SOCK_STREAM, - Sock_DGram = SOCK_DGRAM, - Sock_Raw = SOCK_RAW, - Sock_SeqPacket = SOCK_SEQPACKET, - Sock_NonBlock = SOCK_NONBLOCK - }; -}; - -class SocketDriver : nn::nex::RootObject { -public: - typedef in_addr_t InetAddress; - - enum _SocketFlag : int32_t { - Msg_None = 0, - Msg_Oob = MSG_OOB, - Msg_Peek = MSG_PEEK, - Msg_DontRoute = MSG_DONTROUTE, - Msg_Eor = MSG_EOR, - Msg_Trunc = MSG_TRUNC, - Msg_CTrunc = MSG_CTRUNC, - Msg_WaitAll = MSG_WAITALL, - Msg_DontWait = MSG_DONTWAIT, - Msg_Eof = MSG_EOF, - Msg_Notification = MSG_NOTIFICATION, - Msg_Nbio = MSG_NBIO, - Msg_Compat = MSG_COMPAT, - // Msg_SoCallbck = MSG_SOCALLBCK, - // Msg_NoSignal = MSG_NOSIGNAL, - Msg_CMsg_CloExec = MSG_CMSG_CLOEXEC - }; - - class Socket { - virtual void Open(nn::nex::TransportProtocol::Type); - virtual void Close(); - virtual void Bind(ushort&); - virtual void RecvFrom(uchar*, ulong, InetAddress*, ulong*, - nn::nex::SocketDriver::_SocketFlag); - virtual void SendTo(uchar const*, ulong, nn::nex::SocketDriver::InetAddress const&, ulong*); - }; - - class PollInfo {}; - - virtual Socket* Create(); - virtual void Delete(Socket*); - virtual int Poll(PollInfo*, uint, uint); - virtual bool CanUseGetAllReceivableSockets(); - virtual void GetAllReceivableSockets(Socket**, ulong, uint); -}; - -class BerkelySocket : public SocketDriver::Socket {}; - -class BerkeleySocketDriver - : SocketDriver { // inherits SocketDriver and RootObject but not documented - virtual ~BerkeleySocketDriver(); -}; - -class ClientWebSocketDriver : SocketDriver { - class ClientWebSocket : Socket {}; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/string.h b/src_remove/lib/nnheaders/include/nn/nex/string.h deleted file mode 100644 index 48151c5..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/string.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file string.h - * @brief NEX String Implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class String : public nn::nex::RootObject { -public: - String(); - String(const char*); - String(const wchar_t*); - String(const char16_t*); - String(const String&); - String(String&&); - - String& operator=(String&&); - String& operator=(const char*); - String& operator=(const wchar_t*); - String& operator=(const String&); - String& operator=(const char16_t*); - String& operator+=(const String&); - String operator==(const String&); - bool operator<(nn::nex::String const&); - - void Truncate(u64) const; - u64 GetLength() const; - void Reserve(u64); - void SetBufferChar(char*); - void SetStringToPreReservedBuffer(char const*); - s32 GetWideCharLength() const; - void CopyString(char*, u64) const; - void CreateCopy(wchar_t**) const; - void ReleaseCopy(wchar_t*); - void ToUpper(); - void ToLower(); - void DeleteContent(); - - template - void Assign(T const*); -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/system.h b/src_remove/lib/nnheaders/include/nn/nex/system.h deleted file mode 100644 index cd763de..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/system.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file system.h - * @brief System state / component interface for NEX. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class String; - -class SystemComponent : public nn::nex::RefCountedObject { -public: - enum _State { - State_Uninitialized = 1 << 0, - State_Initializing = 1 << 1, - State_Ready = 1 << 2, - State_ReadyInUse = 1 << 3, - State_Terminating = 1 << 4, - State_TerminatingWhileInUse = 1 << 5, - State_Terminated = 1 << 6, - State_Faulty = 1 << 7, - State_Unknown = 1 << 8, - State_HighestState = 1 << 8 - }; - - SystemComponent(nn::nex::String const&); - - virtual ~SystemComponent(); - - virtual char* GetType() const; - virtual bool IsAKindOf(char const*) const; - virtual void EnforceDeclareSysComponentMacro() = 0; - virtual void StateTransition(nn::nex::SystemComponent::_State); - virtual void OnInitialize(); - virtual void OnTerminate(); - virtual bool BeginInitialization(); - virtual bool EndInitialization(); - virtual bool BeginTermination(); - virtual bool EndTermination(); - virtual bool ValidTransition(nn::nex::SystemComponent::_State); - virtual bool UseIsAllowed(); - virtual nn::nex::SystemComponent::_State TestState(); - virtual void DoWork(); - - nn::nex::SystemComponent::_State Initialize(); - nn::nex::SystemComponent::_State Terminate(); - - u8 SystemComponent_xC; - u8 _D; - u8 _E; - u8 _F; - u64 _10; - u64 _18; - u64 _20; - u32 _28; - u32 _2C; - u64 _30; - nn::nex::SystemComponent::_State mState; // _38 - u32 _3C; - u64 _40; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nex/time.h b/src_remove/lib/nnheaders/include/nn/nex/time.h deleted file mode 100644 index 9ee3612..0000000 --- a/src_remove/lib/nnheaders/include/nn/nex/time.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file time.h - * @brief NEX Time Library. - */ - -#pragma once - -#include - -namespace nn { -namespace nex { -class TimeProvider; - -class Time { -public: - static void Reset(); - static void RegisterTimeProvider(TimeProvider* provider); - - Time Multiply(f32) const; - Time Divide(f32) const; - Time Scale(f32) const; - - static Time ConvertTimeoutToDeadline(u32 timeout); - static u32 ConvertDeadlineToTimeout(Time deadline); - - u64 mCurTime; // _0 - - static u64* s_pfGetSessionTime; // some sort of callback? -}; - -class SystemClock { -public: - SystemClock(); - - virtual ~SystemClock(); - - static void RegisterTimeProvider(nn::nex::TimeProvider*, bool); - static void ApplyCorrection(Time curTime, Time newTime); - static Time ProtectedGetTime(); - static Time GetTimeImpl(bool); - static Time GetTimeImplCorrectless(); - static void Reset(); - - static nn::nex::TimeProvider* s_pTimeProvider; - static bool s_needCorrection; - static bool s_tiCorrection; -}; -}; // namespace nex -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nifm.h b/src_remove/lib/nnheaders/include/nn/nifm.h deleted file mode 100644 index f79bf25..0000000 --- a/src_remove/lib/nnheaders/include/nn/nifm.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file nifm.h - * @brief Network inferface module. - */ - -#pragma once - -#include - -namespace nn { -namespace nifm { -Result Initialize(); -void SetLocalNetworkMode(bool); -void SubmitNetworkRequestAndWait(); -bool IsNetworkAvailable(); -Result HandleNetworkRequestResult(); -void SubmitNetworkRequest(); -bool IsNetworkRequestOnHold(); -Result GetCurrentPrimaryIpAddress(u64* inAddr); -}; // namespace nifm -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/nn.h b/src_remove/lib/nnheaders/include/nn/nn.h deleted file mode 100644 index d367d9b..0000000 --- a/src_remove/lib/nnheaders/include/nn/nn.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file nn.h - * @brief Barebones NN functions, such as init and nnMain. - */ - -#pragma once - -#include - -namespace nn { -typedef u64 ApplicationId; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -int main(int argc, char** argv); -void nninitStartup(); - -void _init(); -void _fini(); -void __nnDetailNintendoSdkRuntimeObjectFileRefer(); -void __nnDetailNintendoSdkRuntimeObjectFile(); -void __nnDetailNintendoSdkNsoFileRefer(); - -void __nnmusl_init_dso_0(); -void __nnmusl_fini_dso_0(); -void __nnDetailNintendoSdkNsoFile_0(); - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/oe.h b/src_remove/lib/nnheaders/include/nn/oe.h deleted file mode 100644 index 2199e71..0000000 --- a/src_remove/lib/nnheaders/include/nn/oe.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file oe.h - * @brief Extenstions to OS functions. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace oe { -typedef s32 FocusHandlingMode; -typedef s32 PerformanceMode; - -struct DisplayVersion { - char name[16]; -}; - -void Initialize(); -void SetPerformanceConfiguration(nn::oe::PerformanceMode, s32); -s32 GetOperationMode(); -s32 GetPerformanceMode(); -void SetResumeNotificationEnabled(bool); -void SetOperationModeChangedNotificationEnabled(bool); -void SetPerformanceModeChangedNotificationEnabled(bool); -void SetFocusHandlingMode(nn::oe::FocusHandlingMode); -bool TryPopNotificationMessage(u32*); -s32 GetCurrentFocusState(); -void EnableGamePlayRecording(void*, u64); -bool IsUserInactivityDetectionTimeExtended(); -void SetUserInactivityDetectionTimeExtended(bool); -void FinishStartupLogo(); -nn::settings::LanguageCode GetDesiredLanguage(); -void GetDisplayVersion(DisplayVersion*); -}; // namespace oe -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/os.h b/src_remove/lib/nnheaders/include/nn/os.h deleted file mode 100644 index d6e7116..0000000 --- a/src_remove/lib/nnheaders/include/nn/os.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - * @file os.h - * @brief Operating System implementations. - */ - -#pragma once - -#include - -#include -#include - -namespace nn { -namespace os { -namespace detail { -struct InternalCriticalSection { - u32 Image; -}; - -struct InternalConditionVariable { - u32 Image; -}; -} // namespace detail - -typedef u64 Tick; - -struct LightEventType { - std::aligned_storage_t<0xc, 4> storage; -}; - -// https://github.com/misson20000/nn-types/blob/master/nn_os.h -struct EventType { - nn::os::EventType* _x0; - nn::os::EventType* _x8; - bool isSignaled; - bool initiallySignaled; - bool shouldAutoClear; - bool isInit; - u32 signalCounter; - u32 signalCounter2; - nn::os::detail::InternalCriticalSection crit; - nn::os::detail::InternalConditionVariable condvar; -}; -typedef EventType Event; - -enum EventClearMode { EventClearMode_ManualClear, EventClearMode_AutoClear }; - -// https://github.com/misson20000/nn-types/blob/master/nn_os.h -struct ThreadType { - u64 field_8; - u64 field_10; - u64 field_18; - char field_20[32]; - uint32_t thread_status; - char field_41; - u16 field_42; - uint32_t thread_prio_shift; - uint64_t thread_stack_base_addr; - uint64_t thread_stack_base_addr_mirror; - uint64_t thread_stack_size; - uint64_t thread_param; - uint64_t thread_func; - u64 field_70; - u64 field_78; - u64 field_80; - char field_88[0x100]; - char thread_name[0x20]; - const char* thread_name_addr; - nn::os::detail::InternalCriticalSection crit; - nn::os::detail::InternalConditionVariable condvar; - u32 thread_handle; -}; -#ifdef SWITCH -static_assert(sizeof(ThreadType) == 0x1C0, "Wrong size"); -#endif - -struct MessageQueueType { - u64 _x0; - u64 _x8; - u64 _x10; - u64 _x18; - void* Buffer; - u32 MaxCount; - u32 Count; - u32 Offset; - bool Initialized; - detail::InternalCriticalSection _x38; - detail::InternalConditionVariable _x3C; - detail::InternalConditionVariable _x40; -}; - -struct ConditionVariableType {}; - -struct SemaphoreType { - std::aligned_storage_t<0x28, 8> storage; -}; - -struct SystemEvent; -struct SystemEventType; - -// ARG -void SetHostArgc(s32); -s32 GetHostArgc(); -void SetHostArgv(char**); -char** GetHostArgv(); - -// MEMORY -void InitializeVirtualAddressMemory(); -Result AllocateAddressRegion(u64*, u64); -Result AllocateMemory(u64*, u64); -Result AllocateMemoryPages(u64, u64); -void AllocateMemoryBlock(u64*, u64); -void FreeMemoryBlock(u64, u64); -void SetMemoryHeapSize(u64); - -// MUTEX -struct MutexType { - u8 _state; - bool _isRecursive; - int _lockLevel; - int _nestCount; - nn::os::ThreadType* _ownerThread; - union { - int32_t _mutexImage[1]; - nn::os::detail::InternalCriticalSection _mutex; - }; -}; - -void InitializeMutex(nn::os::MutexType*, bool, s32); -void FinalizeMutex(nn::os::MutexType*); -void LockMutex(nn::os::MutexType*); -bool TryLockMutex(nn::os::MutexType*); -void UnlockMutex(nn::os::MutexType*); -bool IsMutexLockedByCurrentThread(nn::os::MutexType const*); - -// QUEUE -void InitializeMessageQueue(nn::os::MessageQueueType*, u64* buf, u64 queueCount); -void FinalizeMessageQueue(nn::os::MessageQueueType*); - -bool TrySendMessageQueue(MessageQueueType*, u64); -void SendMessageQueue(MessageQueueType*, u64); -bool TimedSendMessageQueue(MessageQueueType*, u64, nn::TimeSpan); - -bool TryReceiveMessageQueue(u64* out, MessageQueueType*); -void ReceiveMessageQueue(u64* out, MessageQueueType*); -bool TimedReceiveMessageQueue(u64* out, MessageQueueType*, nn::TimeSpan); - -bool TryPeekMessageQueue(u64*, MessageQueueType const*); -void PeekMessageQueue(u64*, MessageQueueType const*); -bool TimedPeekMessageQueue(u64*, MessageQueueType const*); - -bool TryJamMessageQueue(nn::os::MessageQueueType*, u64); -void JamMessageQueue(nn::os::MessageQueueType*, u64); -bool TimedJamMessageQueue(nn::os::MessageQueueType*, u64, nn::TimeSpan); - -// CONDITION VARIABLE -void InitializeConditionVariable(ConditionVariableType*); -void FinalizeConditionVariable(ConditionVariableType*); - -void SignalConditionVariable(ConditionVariableType*); -void BroadcastConditionVariable(ConditionVariableType*); -void WaitConditionVariable(ConditionVariableType*); -u8 TimedWaitConditionVariable(ConditionVariableType*, MutexType*, nn::TimeSpan); - -// THREAD -Result CreateThread(nn::os::ThreadType*, void (*)(void*), void* arg, void* srcStack, u64 stackSize, - s32 priority, s32 coreNum); -Result CreateThread(nn::os::ThreadType*, void (*)(void*), void* arg, void* srcStack, u64 stackSize, - s32 priority); -void DestroyThread(nn::os::ThreadType*); -void StartThread(nn::os::ThreadType*); -void SetThreadName(nn::os::ThreadType*, char const* threadName); -void SetThreadNamePointer(nn::os::ThreadType*, char const*); -char* GetThreadNamePointer(nn::os::ThreadType const*); -nn::os::ThreadType* GetCurrentThread(); -void GetCurrentStackInfo(uintptr_t* stack_addr, size_t* stack_size); -s32 ChangeThreadPriority(nn::os::ThreadType* thread, s32 priority); -s32 GetThreadPriority(nn::os::ThreadType const* thread); -u64 GetThreadId(const nn::os::ThreadType* thread); -void YieldThread(); -void SuspendThread(nn::os::ThreadType*); -void ResumeThread(nn::os::ThreadType*); -void SleepThread(nn::TimeSpan); -void WaitThread(nn::os::ThreadType*); -void SetThreadCoreMask(nn::os::ThreadType*, int, u64 mask); - -// EVENTS -void InitializeEvent(EventType*, bool initiallySignaled, EventClearMode eventClearMode); -void FinalizeEvent(EventType*); -void SignalEvent(EventType*); -void WaitEvent(EventType*); -bool TryWaitEvent(EventType*); -bool TimedWaitEvent(EventType*, nn::TimeSpan); -void ClearEvent(EventType*); - -// LIGHT EVENTS -void InitializeLightEvent(LightEventType*, bool initiallySignaled, EventClearMode eventClearMode); -void FinalizeLightEvent(LightEventType*); -void SignalLightEvent(LightEventType*); -void WaitLightEvent(LightEventType*); -bool TimedWaitLightEvent(LightEventType*, nn::TimeSpan); -void ClearLightEvent(LightEventType*); - -TimeSpan ConvertToTimeSpan(Tick ticks); - -// SEMAPHORES -void InitializeSemaphore(SemaphoreType* semaphore, s32 initial_count, s32 max_count); -void FinalizeSemaphore(SemaphoreType* semaphore); -void AcquireSemaphore(SemaphoreType* semaphore); -bool TryAcquireSemaphore(SemaphoreType* semaphore); -void ReleaseSemaphore(SemaphoreType* semaphore); - -// EXCEPTION HANDLING -typedef union { - u64 x; ///< 64-bit AArch64 register view. - u32 w; ///< 32-bit AArch64 register view. - u32 r; ///< AArch32 register view. -} CpuRegister; -/// Armv8 NEON register. - -typedef union { - u128 v; ///< 128-bit vector view. - double d; ///< 64-bit double-precision view. - float s; ///< 32-bit single-precision view. -} FpuRegister; - -struct UserExceptionInfo { - u32 ErrorDescription; ///< See \ref ThreadExceptionDesc. - u32 pad[3]; - - CpuRegister CpuRegisters[29]; ///< GPRs 0..28. Note: also contains AArch32 registers. - CpuRegister FP; ///< Frame pointer. - CpuRegister LR; ///< Link register. - CpuRegister SP; ///< Stack pointer. - CpuRegister PC; ///< Program counter (elr_el1). - - u64 padding; - - FpuRegister FpuRegisters[32]; ///< 32 general-purpose NEON registers. - - u32 PState; ///< pstate & 0xFF0FFE20 - u32 AFSR0; - u32 AFSR1; - u32 ESR; - - CpuRegister FAR; ///< Fault Address Register. -}; -void SetUserExceptionHandler(void (*)(UserExceptionInfo*), void*, ulong, UserExceptionInfo*); - -// OTHER -void GenerateRandomBytes(void*, u64); -nn::os::Tick GetSystemTick(); -nn::os::Tick GetSystemTickFrequency(); -u64 GetThreadAvailableCoreMask(); -void SetMemoryHeapSize(u64 size); - -// Thread-local storage -struct TlsSlot { - u32 slot; -}; -Result AllocateTlsSlot(TlsSlot* slot_out, void (*)(u64)); -void FreeTlsSlot(TlsSlot slot); -u64 GetTlsValue(TlsSlot slot); -void SetTlsValue(TlsSlot slot, u64 value); -u32 GetCurrentCoreNumber(); - -namespace detail { -extern s32 g_CommandLineParameter; -extern char** g_CommandLineParameterArgv; -}; // namespace detail -}; // namespace os -}; // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/prepo.h b/src_remove/lib/nnheaders/include/nn/prepo.h deleted file mode 100644 index 0f927d3..0000000 --- a/src_remove/lib/nnheaders/include/nn/prepo.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include - -namespace nn::account { -class Uid; -} - -namespace nn::prepo { - -namespace detail { -class PlayReportGenerator { -public: - PlayReportGenerator() = default; - void Initialize(); - -private: - void* m_Data = nullptr; -}; -} // namespace detail - -enum class TransmissionStatus {}; - -class PlayReport { -public: - PlayReport(); - explicit PlayReport(const char* event_id); - - Result SetEventId(const char* event_id); - void SetBuffer(void* buffer, size_t size); - void Clear(); - - Result Add(const char* key, s64 value); - Result Add(const char* key, f64 value); - Result Add(const char* key, const char* value); - - Result Save(); - Result Save(const account::Uid& uid); - - s32 GetCount() const; - - static u32 CalcBufferSize(s32 num_entries) { return size_t(0x82) * num_entries + 3; } - -private: - char m_EventId[32]; - void* m_Buffer; - size_t m_BufferSize; - detail::PlayReportGenerator m_Generator; -}; - -void Initialize(); - -Result RequestImmediateTransmission(); -Result GetTransmissionStatus(TransmissionStatus* status); - -Result ClearStorage(); -Result SetOperationMode(s64 mode); -Result IsUserAgreementCheckEnabled(bool* enabled); -Result SetUserAgreementCheckEnabled(bool enabled); -Result GetStorageUsage(s64*, s64*); - -} // namespace nn::prepo diff --git a/src_remove/lib/nnheaders/include/nn/ro.h b/src_remove/lib/nnheaders/include/nn/ro.h deleted file mode 100644 index 92fe4f3..0000000 --- a/src_remove/lib/nnheaders/include/nn/ro.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file ro.h - * @brief Dynamic module API. - */ - -#pragma once - -#include - -namespace nn { -namespace ro { - -namespace rtld { -struct ModuleObject; // TODO find this object and implement it. Original `#include` name: - // ModuleObject.hpp, full path name: nn::ro::rtld::ModuleObject -} - -class Module { -public: - rtld::ModuleObject* ModuleObject; - u32 State; - void* NroPtr; - void* BssPtr; - void* _x20; - void* SourceBuffer; - char Name[256]; /* Created by retype action */ - u8 _x130; - u8 _x131; - bool isLoaded; // bool -}; - -struct ModuleId { - u8 build_id[0x20]; -}; - -struct NroHeader { - u32 entrypoint_insn; - u32 mod_offset; - u8 _x8[0x8]; - u32 magic; - u8 _x14[0x4]; - u32 size; - u8 reserved_1C[0x4]; - u32 text_offset; - u32 text_size; - u32 ro_offset; - u32 ro_size; - u32 rw_offset; - u32 rw_size; - u32 bss_size; - u8 _x3C[0x4]; - ModuleId module_id; - u8 _x60[0x20]; -}; -static_assert(sizeof(NroHeader) == 0x80, "NroHeader definition!"); - -struct ProgramId { - u64 value; - - inline explicit operator u64() const { return this->value; } -}; - -struct NrrHeader { - u32 magic; - u8 _x4[0xC]; - u64 program_id_mask; - u64 program_id_pattern; - u8 _x20[0x10]; - u8 modulus[0x100]; - u8 fixed_key_signature[0x100]; - u8 nrr_signature[0x100]; - ProgramId program_id; - u32 size; - u8 type; /* 7.0.0+ */ - u8 _x33D[3]; - u32 hashes_offset; - u32 num_hashes; - u8 _x348[8]; -}; -static_assert(sizeof(NrrHeader) == 0x350, "NrrHeader definition!"); - -struct RegistrationInfo { - enum State { - State_Unregistered, - State_Registered, - }; - State state; - NrrHeader* nrrPtr; - u64 _x10; - u64 _x18; -}; - -enum BindFlag { - BindFlag_Now = BIT(0), - BindFlag_Lazy = BIT(1), -}; - -Result Initialize(); - -Result LookupSymbol(uintptr_t* pOutAddress, const char* name); - -Result LookupModuleSymbol(uintptr_t* pOutAddress, const Module* pModule, const char* name); -Result LoadModule(Module* pOutModule, const void* pImage, void* buffer, size_t bufferSize, - int flag); -// Result LoadModule(Module *pOutModule, const void *pImage, void *buffer, size_t bufferSize,int -// flag, bool isNotReferenced); -Result UnloadModule(Module*); -Result GetBufferSize(size_t*, const void*); - -Result RegisterModuleInfo(RegistrationInfo*, void const*); -Result RegisterModuleInfo(RegistrationInfo*, void const*, u32); -Result UnregisterModuleInfo(RegistrationInfo*, void const*); -}; // namespace ro - -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/settings.h b/src_remove/lib/nnheaders/include/nn/settings.h deleted file mode 100644 index 6278e35..0000000 --- a/src_remove/lib/nnheaders/include/nn/settings.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -namespace nn { -namespace settings { -enum Language { - Language_Japanese, - Language_English, - Language_French, - Language_German, - Language_Italian, - Language_Spanish, - Language_Chinese, - Language_Korean, - Language_Dutch, - Language_Portuguese, - Language_Russian, - Language_Taiwanese, - Language_BritishEnglish, - Language_CanadianFrench, - Language_LatinAmericanSpanish -}; - -struct LanguageCode { - char code[0x8]; - - static LanguageCode Make(nn::settings::Language); -}; - -bool operator==(nn::settings::LanguageCode const&, nn::settings::LanguageCode const&); -}; // namespace settings -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/sf/hipc.h b/src_remove/lib/nnheaders/include/nn/sf/hipc.h deleted file mode 100644 index cafe910..0000000 --- a/src_remove/lib/nnheaders/include/nn/sf/hipc.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -namespace nn::sf::hipc { -void* GetMessageBufferOnTls(); - -Result InitializeHipcServiceResolution(); -Result ConnectToHipcService(svc::Handle*, const char*); -Result FinalizeHipcServiceResolution(); - -Result SendSyncRequest(svc::Handle, void*, u64); -Result CloseClientSessionHandle(svc::Handle); - -} // namespace nn::sf::hipc diff --git a/src_remove/lib/nnheaders/include/nn/socket.h b/src_remove/lib/nnheaders/include/nn/socket.h deleted file mode 100644 index d11a1c4..0000000 --- a/src_remove/lib/nnheaders/include/nn/socket.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file socket.h - * @brief Functions for opening sockets for wireless communication. - */ - -#pragma once - -#include -#include - -namespace nn { -namespace socket { -struct InAddr { - u32 addr; -}; - -Result Initialize(void* pool, ulong poolSize, ulong allocPoolSize, int concurLimit); -Result Finalize(); -s32 SetSockOpt(s32 socket, s32 socketLevel, s32 option, void const*, u32 len); -u64 Send(s32 socket, void const* buffer, u64 bufferLength, s32 flags); -s32 Socket(s32 domain, s32 type, s32 proto); -u16 InetHtons(u16); -u32 InetAton(const char* str, InAddr*); -u32 Connect(s32 socket, const sockaddr* addr, u32 addrLen); -u32 Bind(s32 socket, const sockaddr* addr, u32 addrLen); -u32 Listen(s32 socket, s32 backlog); -u32 Accept(s32 socket, sockaddr* addrOut, u32* addrLenOut); -} // namespace socket -} // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/ssl.h b/src_remove/lib/nnheaders/include/nn/ssl.h deleted file mode 100644 index e2bb9e2..0000000 --- a/src_remove/lib/nnheaders/include/nn/ssl.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @file ssl.h - * @brief SSL implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace ssl { -enum CertificateFormat { PEM = 0x01, DER = 0x02 }; - -class Context { -public: - enum SslVersion { Auto = 0x01, v10 = 0x08, v11 = 0x10, v12 = 0x20 }; - - Result Create(nn::ssl::Context::SslVersion version); - Result ImportServerPki(u64*, char const* certData, u32 certSize, - nn::ssl::CertificateFormat certFormat); -}; - -Result Initialize(); -Result Finalize(); -}; // namespace ssl -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/svc.h b/src_remove/lib/nnheaders/include/nn/svc.h deleted file mode 100644 index 9d7f7ac..0000000 --- a/src_remove/lib/nnheaders/include/nn/svc.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace nn::svc { -struct Handle { - u32 handle; - - Handle(u32 h) { handle = h; } - - Handle() : Handle(0) {} - - operator u32() const { return handle; } -}; - -} // namespace nn::svc diff --git a/src_remove/lib/nnheaders/include/nn/time.h b/src_remove/lib/nnheaders/include/nn/time.h deleted file mode 100644 index 3d668fd..0000000 --- a/src_remove/lib/nnheaders/include/nn/time.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file time.h - * @brief Time implementation. - */ - -#pragma once - -#include - -namespace nn { -class TimeSpan { -public: - u64 nanoseconds; - - static TimeSpan FromNanoSeconds(u64 nanoSeconds) { - TimeSpan ret; - ret.nanoseconds = nanoSeconds; - return ret; - } - - static TimeSpan FromSeconds(u64 seconds) { - return FromNanoSeconds(seconds * 1000 * 1000 * 1000); - } - static TimeSpan FromMinutes(u64 minutes) { - return FromNanoSeconds(minutes * 1000 * 1000 * 1000 * 60); - } - static TimeSpan FromHours(u64 hours) { - return FromNanoSeconds(hours * 1000 * 1000 * 1000 * 60 * 60); - } - static TimeSpan FromDays(u64 days) { - return FromNanoSeconds(days * 1000 * 1000 * 1000 * 60 * 60 * 24); - } -}; - -namespace time { - -Result Initialize(); -bool IsInitialized(); - -struct CalendarTime { - s16 year; - s8 month; - s8 day; - s8 hour; - s8 minute; - s8 second; -}; - -enum DayOfTheWeek { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }; - -struct TimeZone { - char standardTimeName[0x8]; - bool _9; // daylight savings or something? - s32 utcOffset; // in seconds -}; - -struct CalendarAdditionalInfo { - nn::time::DayOfTheWeek dayOfTheWeek; - s32 dayofYear; - nn::time::TimeZone timeZone; -}; - -struct PosixTime { - u64 time; -}; - -class StandardUserSystemClock { -public: - static Result GetCurrentTime(nn::time::PosixTime*); -}; - -struct TimeZoneRule; // shrug - -Result ToCalendarTime(nn::time::CalendarTime*, nn::time::CalendarAdditionalInfo*, - nn::time::PosixTime const&); -Result ToCalendarTime(nn::time::CalendarTime*, nn::time::CalendarAdditionalInfo*, - nn::time::PosixTime const&, nn::time::TimeZoneRule const&); -Result ToPosixTime(int*, PosixTime*, int, const CalendarTime&); -CalendarTime ToCalendarTimeInUtc(const PosixTime&); -PosixTime ToPosixTimeFromUtc(const CalendarTime&); -}; // namespace time -}; // namespace nn diff --git a/src_remove/lib/nnheaders/include/nn/types.h b/src_remove/lib/nnheaders/include/nn/types.h deleted file mode 100644 index 0745700..0000000 --- a/src_remove/lib/nnheaders/include/nn/types.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include -#include - -using u8 = std::uint8_t; -using u16 = std::uint16_t; -using u32 = std::uint32_t; -using u64 = std::uint64_t; -using u128 = __uint128_t; - -using s8 = std::int8_t; -using s16 = std::int16_t; -using s32 = std::int32_t; -using s64 = std::int64_t; - -using f32 = float; -using f64 = double; - -using char16 = char16_t; -using size_t = std::size_t; -using ulong = u64; diff --git a/src_remove/lib/nnheaders/include/nn/ui2d/Layout.h b/src_remove/lib/nnheaders/include/nn/ui2d/Layout.h deleted file mode 100644 index 1ef4a5a..0000000 --- a/src_remove/lib/nnheaders/include/nn/ui2d/Layout.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file Layout.h - * @brief UI Layout implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace ui2d { -class AnimTransform; -class Pane; - -class Layout { -public: - Layout(); - - virtual ~Layout(); - - virtual void DeleteAnimTransform(nn::ui2d::AnimTransform*); - virtual void BindAnimation(nn::ui2d::AnimTransform*); - virtual void UnbindAnimation(nn::ui2d::AnimTransform*); - virtual void UnbindAnimation(nn::ui2d::Pane*); - virtual void UnbindAllAnimation(); - - virtual void Animate(); - virtual void UpdateAnimFrame(f32 frame); - virtual void AnimateAndUpdateAnimFrame(f32 frame); - - void SetAllocator(void* (*)(u64, u64, void*), void (*)(void*, void*), void*); - void AllocateMemory(u64, u64); - void AllocateMemory(u64); - void FreeMemory(void* src); - - u64 _10; - u64 _18; - u64 _20; - u64 _28; - u64 _30; - - u64 _40; - u64 _48; - u64 _50; - u64 _58; - u64 _60; -}; -}; // namespace ui2d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/ui2d/Material.h b/src_remove/lib/nnheaders/include/nn/ui2d/Material.h deleted file mode 100644 index d9db2d5..0000000 --- a/src_remove/lib/nnheaders/include/nn/ui2d/Material.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file Material.h - * @brief UI Material implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace ui2d { -class AnimTransform; -class BuildResultInformation; -struct UserShaderInformation; - -class Material { -public: - Material(); - - void Initialize(); - void ReserveMem(s32, s32, s32, s32, bool, s32, bool, s32, bool, bool); - void SetupUserShaderConstantBufferInformation(nn::ui2d::UserShaderInformation const&); - - virtual ~Material(); - virtual void BindAnimation(nn::ui2d::AnimTransform*); - virtual void UnbindAnimation(nn::ui2d::AnimTransform*); -}; -}; // namespace ui2d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/ui2d/Pane.h b/src_remove/lib/nnheaders/include/nn/ui2d/Pane.h deleted file mode 100644 index 54fc7a3..0000000 --- a/src_remove/lib/nnheaders/include/nn/ui2d/Pane.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file Pane.h - * @brief Base UI panel. - */ - -#pragma once - -#include "sead/runtime.h" //FIXME this definitely is wrong -#include "types.h" - -namespace nn { -namespace ui2d { -class AnimTransform; -class Layout; - -class Pane { -public: - Pane(); - Pane(nn::ui2d::Pane const&); - - virtual ~Pane(); - - virtual sead::RuntimeTypeInfo::Interface* GetRuntimeTypeInfo() const; - virtual s32 GetVertexColor(s32); - virtual u8 GetColorElement(s32); - virtual void SetColorElement(u32, u8); - virtual u8 GetVertexColorElement(s32); - virtual void SetVertexColorElement(u32, u8); - virtual u32 GetMaterialCount() const; - virtual u64* GetMaterial(s32) const; - - virtual void BindAnimation(nn::ui2d::AnimTransform*, bool, bool); - virtual void UnbindAnimation(nn::ui2d::AnimTransform*, bool); - - void Initialize(); - void SetName(char const*); - void SetUserData(char const*); - void AppendChild(nn::ui2d::Pane*); - void PrependChild(nn::ui2d::Pane*); - void InsertChild(nn::ui2d::Pane*, nn::ui2d::Pane*); - void RemoveChild(nn::ui2d::Pane*); - void GetVertexPos() const; - - u64 _8; - u64 _10; - u64 _18; - u64 _20; - u64 _28; - u64 _30; - u64 _38; - u64 _40; - u32 _48; - u32 _4C; - u64 _50; - u16 _58; - u16 _5A; - u32 _5C; - u64 _60; - nn::ui2d::Layout* mLayout; // _68 - u128 _70; - u128 _80; - u128 _90; - u64 _A0; - u64 _A8; - u64 _B0; - u64 _B8; - u64 _C0; - u64 _C8; - u64 _D0; - u16 _D8; - u16 _DA; - u32 _DC; -}; -}; // namespace ui2d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/ui2d/Parts.h b/src_remove/lib/nnheaders/include/nn/ui2d/Parts.h deleted file mode 100644 index 11c3fa6..0000000 --- a/src_remove/lib/nnheaders/include/nn/ui2d/Parts.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file Parts.h - * @brief Layout parts. - */ - -#pragma once - -#include - -namespace nn { -namespace ui2d { -struct BuildArgSet; -struct ResParts; - -class Parts : nn::ui2d::Pane { -public: - Parts(); - Parts(nn::ui2d::ResParts const*, nn::ui2d::ResParts const*, nn::ui2d::BuildArgSet const&); - Parts(nn::ui2d::Parts const&); - - virtual ~Parts(); - virtual sead::RuntimeTypeInfo::Interface* GetRuntimeTypeInfo() const; - - u64 _E0; - u64 _E8; - u32 _F0; -}; -}; // namespace ui2d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/ui2d/detail/TexCoordArray.h b/src_remove/lib/nnheaders/include/nn/ui2d/detail/TexCoordArray.h deleted file mode 100644 index 522b583..0000000 --- a/src_remove/lib/nnheaders/include/nn/ui2d/detail/TexCoordArray.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file TexCoordArray.h - * @brief Texture coordinate array implementation. - */ - -#pragma once - -#include - -namespace nn { - -namespace util { -struct Float2; -} - -namespace ui2d { -class Layout; - -namespace detail { -class TexCoordArray { -public: - void Initialize(); - void Free(); - void Reserve(s32); - void SetSize(s32 size); - void GetCoord(nn::util::Float2*, s32) const; - void SetCoord(s32, nn::util::Float2 const*); - void Copy(void const*, s32); - bool CompareCopiedInstanceTest(nn::ui2d::detail::TexCoordArray const&) const; - - u16 _0; - u16 _2; - u32 _4; // padding? - nn::ui2d::Layout* mLayout; // _8 -}; -}; // namespace detail -}; // namespace ui2d -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/util.h b/src_remove/lib/nnheaders/include/nn/util.h deleted file mode 100644 index 9a1023b..0000000 --- a/src_remove/lib/nnheaders/include/nn/util.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file util.h - * @brief Helper functions for OS functionality. - */ - -#pragma once - -#include - -namespace nn { -namespace util { -struct Unorm8x4 { - u8 elements[0x4]; -}; - -enum CharacterEncodingResult { Success, BadLength, InvalidFormat }; - -CharacterEncodingResult PickOutCharacterFromUtf8String(char*, char const** str); -CharacterEncodingResult ConvertCharacterUtf8ToUtf32(u32* dest, char const* src); -CharacterEncodingResult ConvertStringUtf16NativeToUtf8(char*, s32, u16 const*, s32); -CharacterEncodingResult ConvertStringUtf8ToUtf16Native(u16*, s32, char const*, s32); - -class RelocationTable { -public: - void Relocate(); - void Unrelocate(); - - s32 mMagic; // _0 - u32 mPosition; // _4 - s32 mSectionCount; // _8 -}; - -class BinaryFileHeader { -public: - bool IsValid(s64 packedSig, s32 majorVer, s32 minorVer, s32 microVer) const; - bool IsRelocated() const; - bool IsEndianReverse() const; - nn::util::RelocationTable* GetRelocationTable(); - - s32 mMagic; // _0 - u32 mSig; // _4 - u8 mVerMicro; // _8 - u8 mVerMinor; // _9 - u16 mVerMajor; // _A - u16 mBOM; // _C - u8 mAlignment; // _E - u8 mTargetAddrSize; // _F - u32 mFileNameOffset; // _10 - u16 mFlag; // _14 - u16 mFirstBlockOffs; // _16 - u32 mRelocationTableOffs; // _18 - u32 mSize; // _1C -}; - -template -struct BitFlagSet {}; -}; // namespace util - -void ReferSymbol(void const*); -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/util/Float2.h b/src_remove/lib/nnheaders/include/nn/util/Float2.h deleted file mode 100644 index 39a231b..0000000 --- a/src_remove/lib/nnheaders/include/nn/util/Float2.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file Float2.h - * @brief Some odd float implementation that I don't understand yet... - */ - -#pragma once - -#include - -namespace nn { -namespace util { -struct Float2 { - u64 _0; - u64 _8; - u64 _10; - u64 _18; -}; -}; // namespace util -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/vfx/Config.h b/src_remove/lib/nnheaders/include/nn/vfx/Config.h deleted file mode 100644 index 86c17f2..0000000 --- a/src_remove/lib/nnheaders/include/nn/vfx/Config.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @file Config.h - * @brief VFX configuration. - */ - -#pragma once - -namespace nn { -namespace vfx { -class Config { -public: - virtual ~Config(); -}; -}; // namespace vfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/vfx/Heap.h b/src_remove/lib/nnheaders/include/nn/vfx/Heap.h deleted file mode 100644 index c6aa91c..0000000 --- a/src_remove/lib/nnheaders/include/nn/vfx/Heap.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @file Heap.h - * @brief VFX heap implementation. - */ - -#pragma once - -#include - -namespace nn { -namespace vfx { -class Heap { -public: - virtual ~Heap(); -}; -}; // namespace vfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/vfx/System.h b/src_remove/lib/nnheaders/include/nn/vfx/System.h deleted file mode 100644 index 7e1ade4..0000000 --- a/src_remove/lib/nnheaders/include/nn/vfx/System.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file System.h - * @brief VFX system implementation. - */ - -#pragma once - -#include -#include - -// this class is massive -namespace nn { -namespace vfx { - -struct Heap; - -class System { -public: - System(nn::vfx::Config const&); - - virtual ~System(); - virtual void Initialize(nn::vfx::Heap*, nn::vfx::Heap*, nn::vfx::Config const&); - - u8 _0[0x1700]; -}; -}; // namespace vfx -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nn/vi.h b/src_remove/lib/nnheaders/include/nn/vi.h deleted file mode 100644 index e1e3182..0000000 --- a/src_remove/lib/nnheaders/include/nn/vi.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file vi.h - * @brief Visual interface implementation. - */ - -#pragma once - -#include - -namespace nn { - -namespace os { -struct SystemEventType; -} - -namespace vi { -class Display; -class Layer; -class NativWindow; -struct DisplayInfo { - static const int maxNameLen = 64; - char name[maxNameLen]; - bool hasLayerLimit; - int64_t maxLayers; - int64_t maxWidth; - int64_t maxHeight; -}; - -enum ScalingMode { None, Exact, FitLayer, ScaleAndCrop, PreserveAspectRatio }; - -void Initialize(); -Result OpenDefaultDisplay(nn::vi::Display** outDisp); -Result CreateLayer(nn::vi::Layer** outLayer, nn::vi::Display* disp); -Result SetLayerScalingMode(nn::vi::Layer* layer, nn::vi::ScalingMode scalingMode); -Result GetDisplayVsyncEvent(nn::os::SystemEventType*, nn::vi::Display*); -Result GetNativeWindow(void** window, nn::vi::Layer*); -Result GetLatestFrameNumber(u64* pOutFrameNumber, const Layer* pLayer); -int ListDisplays(DisplayInfo* outDisplays, int count); -}; // namespace vi -}; // namespace nn \ No newline at end of file diff --git a/src_remove/lib/nnheaders/include/nvn/nvn.h b/src_remove/lib/nnheaders/include/nvn/nvn.h deleted file mode 100644 index e462944..0000000 --- a/src_remove/lib/nnheaders/include/nvn/nvn.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -#include - -NVNdummyProc nvnBootstrapLoader(const char* name); diff --git a/src_remove/lib/nnheaders/include/nvn/nvn_api.h b/src_remove/lib/nnheaders/include/nvn/nvn_api.h deleted file mode 100644 index 6bf5d16..0000000 --- a/src_remove/lib/nnheaders/include/nvn/nvn_api.h +++ /dev/null @@ -1,1646 +0,0 @@ -// AUTOGENERATED DO NOT EDIT -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -// Function definitions -typedef void (*nvnDeviceBuilderSetDefaultsFunction)(NVNdeviceBuilder*); -typedef void (*nvnDeviceBuilderSetFlagsFunction)(NVNdeviceBuilder*, NVNdeviceFlagBits); -typedef bool (*nvnDeviceInitializeFunction)(NVNdevice*, const NVNdeviceBuilder*); -typedef void (*nvnDeviceFinalizeFunction)(NVNdevice*); -typedef void (*nvnDeviceSetDebugLabelFunction)(NVNdevice*, const char*); -typedef NVNdummyProc (*nvnDeviceGetProcAddressFunction)(const NVNdevice*, const char*); -typedef void (*nvnDeviceGetIntegerFunction)(const NVNdevice*, NVNdeviceInfo, int*); -typedef uint64_t (*nvnDeviceGetCurrentTimestampInNanosecondsFunction)(const NVNdevice*); -typedef void (*nvnDeviceSetIntermediateShaderCacheFunction)(NVNdevice*, int); -typedef NVNtextureHandle (*nvnDeviceGetTextureHandleFunction)(const NVNdevice*, int, int); -typedef NVNtextureHandle (*nvnDeviceGetTexelFetchHandleFunction)(const NVNdevice*, int); -typedef NVNimageHandle (*nvnDeviceGetImageHandleFunction)(const NVNdevice*, int); -typedef void (*nvnDeviceInstallDebugCallbackFunction)(NVNdevice*, const NVNdebugCallback, void*, - bool); -typedef NVNdebugDomainId (*nvnDeviceGenerateDebugDomainIdFunction)(const NVNdevice*, const char*); -typedef void (*nvnDeviceSetWindowOriginModeFunction)(NVNdevice*, NVNwindowOriginMode); -typedef void (*nvnDeviceSetDepthModeFunction)(NVNdevice*, NVNdepthMode); -typedef bool (*nvnDeviceRegisterFastClearColorFunction)(NVNdevice*, const float*, NVNformat); -typedef bool (*nvnDeviceRegisterFastClearColoriFunction)(NVNdevice*, const int*, NVNformat); -typedef bool (*nvnDeviceRegisterFastClearColoruiFunction)(NVNdevice*, const uint32_t*, NVNformat); -typedef bool (*nvnDeviceRegisterFastClearDepthFunction)(NVNdevice*, float); -typedef NVNwindowOriginMode (*nvnDeviceGetWindowOriginModeFunction)(const NVNdevice*); -typedef NVNdepthMode (*nvnDeviceGetDepthModeFunction)(const NVNdevice*); -typedef uint64_t (*nvnDeviceGetTimestampInNanosecondsFunction)(const NVNdevice*, - const NVNcounterData*); -typedef void (*nvnDeviceApplyDeferredFinalizesFunction)(NVNdevice*, int); -typedef void (*nvnDeviceFinalizeCommandHandleFunction)(NVNdevice*, NVNcommandHandle); -typedef void (*nvnDeviceWalkDebugDatabaseFunction)(const NVNdevice*, NVNdebugObjectType, - NVNwalkDebugDatabaseCallback, void*); -typedef NVNseparateTextureHandle (*nvnDeviceGetSeparateTextureHandleFunction)(const NVNdevice*, - int); -typedef NVNseparateSamplerHandle (*nvnDeviceGetSeparateSamplerHandleFunction)(const NVNdevice*, - int); -typedef bool (*nvnDeviceIsExternalDebuggerAttachedFunction)(const NVNdevice*); -typedef NVNqueueGetErrorResult (*nvnQueueGetErrorFunction)(NVNqueue*, NVNqueueErrorInfo*); -typedef size_t (*nvnQueueGetTotalCommandMemoryUsedFunction)(NVNqueue*); -typedef size_t (*nvnQueueGetTotalControlMemoryUsedFunction)(NVNqueue*); -typedef size_t (*nvnQueueGetTotalComputeMemoryUsedFunction)(NVNqueue*); -typedef void (*nvnQueueResetMemoryUsageCountsFunction)(NVNqueue*); -typedef void (*nvnQueueBuilderSetDeviceFunction)(NVNqueueBuilder*, NVNdevice*); -typedef void (*nvnQueueBuilderSetDefaultsFunction)(NVNqueueBuilder*); -typedef void (*nvnQueueBuilderSetFlagsFunction)(NVNqueueBuilder*, int); -typedef void (*nvnQueueBuilderSetCommandMemorySizeFunction)(NVNqueueBuilder*, size_t); -typedef void (*nvnQueueBuilderSetComputeMemorySizeFunction)(NVNqueueBuilder*, size_t); -typedef void (*nvnQueueBuilderSetControlMemorySizeFunction)(NVNqueueBuilder*, size_t); -typedef size_t (*nvnQueueBuilderGetQueueMemorySizeFunction)(const NVNqueueBuilder*); -typedef void (*nvnQueueBuilderSetQueueMemoryFunction)(NVNqueueBuilder*, void*, size_t); -typedef void (*nvnQueueBuilderSetCommandFlushThresholdFunction)(NVNqueueBuilder*, size_t); -typedef bool (*nvnQueueInitializeFunction)(NVNqueue*, const NVNqueueBuilder*); -typedef void (*nvnQueueFinalizeFunction)(NVNqueue*); -typedef void (*nvnQueueSetDebugLabelFunction)(NVNqueue*, const char*); -typedef void (*nvnQueueSubmitCommandsFunction)(NVNqueue*, int, const NVNcommandHandle*); -typedef void (*nvnQueueFlushFunction)(NVNqueue*); -typedef void (*nvnQueueFinishFunction)(NVNqueue*); -typedef void (*nvnQueuePresentTextureFunction)(NVNqueue*, NVNwindow*, int); -typedef NVNqueueAcquireTextureResult (*nvnQueueAcquireTextureFunction)(NVNqueue*, NVNwindow*, int*); -typedef void (*nvnWindowBuilderSetDeviceFunction)(NVNwindowBuilder*, NVNdevice*); -typedef void (*nvnWindowBuilderSetDefaultsFunction)(NVNwindowBuilder*); -typedef void (*nvnWindowBuilderSetNativeWindowFunction)(NVNwindowBuilder*, NVNnativeWindow); -typedef void (*nvnWindowBuilderSetTexturesFunction)(NVNwindowBuilder*, int, NVNtexture* const*); -typedef void (*nvnWindowBuilderSetPresentIntervalFunction)(NVNwindowBuilder*, int); -typedef NVNnativeWindow (*nvnWindowBuilderGetNativeWindowFunction)(const NVNwindowBuilder*); -typedef int (*nvnWindowBuilderGetPresentIntervalFunction)(const NVNwindowBuilder*); -typedef bool (*nvnWindowInitializeFunction)(NVNwindow*, const NVNwindowBuilder*); -typedef void (*nvnWindowFinalizeFunction)(NVNwindow*); -typedef void (*nvnWindowSetDebugLabelFunction)(NVNwindow*, const char*); -typedef NVNwindowAcquireTextureResult (*nvnWindowAcquireTextureFunction)(NVNwindow*, NVNsync*, - int*); -typedef NVNnativeWindow (*nvnWindowGetNativeWindowFunction)(const NVNwindow*); -typedef int (*nvnWindowGetPresentIntervalFunction)(const NVNwindow*); -typedef void (*nvnWindowSetPresentIntervalFunction)(NVNwindow*, int); -typedef void (*nvnWindowSetCropFunction)(NVNwindow*, int, int, int, int); -typedef void (*nvnWindowGetCropFunction)(const NVNwindow*, NVNrectangle*); -typedef bool (*nvnProgramInitializeFunction)(NVNprogram*, NVNdevice*); -typedef void (*nvnProgramFinalizeFunction)(NVNprogram*); -typedef void (*nvnProgramSetDebugLabelFunction)(NVNprogram*, const char*); -typedef bool (*nvnProgramSetShadersFunction)(NVNprogram*, int, const NVNshaderData*); -typedef void (*nvnMemoryPoolBuilderSetDeviceFunction)(NVNmemoryPoolBuilder*, NVNdevice*); -typedef void (*nvnMemoryPoolBuilderSetDefaultsFunction)(NVNmemoryPoolBuilder*); -typedef void (*nvnMemoryPoolBuilderSetStorageFunction)(NVNmemoryPoolBuilder*, void*, size_t); -typedef void (*nvnMemoryPoolBuilderSetFlagsFunction)(NVNmemoryPoolBuilder*, int); -typedef void (*nvnMemoryPoolBuilderGetMemoryFunction)(const NVNmemoryPoolBuilder*); -typedef size_t (*nvnMemoryPoolBuilderGetSizeFunction)(const NVNmemoryPoolBuilder*); -typedef NVNmemoryPoolFlags (*nvnMemoryPoolBuilderGetFlagsFunction)(const NVNmemoryPoolBuilder*); -typedef bool (*nvnMemoryPoolInitializeFunction)(NVNmemoryPool*, const NVNmemoryPoolBuilder*); -typedef void (*nvnMemoryPoolSetDebugLabelFunction)(NVNmemoryPool*, const char*); -typedef void (*nvnMemoryPoolFinalizeFunction)(NVNmemoryPool*); -typedef void (*nvnMemoryPoolMapFunction)(const NVNmemoryPool*); -typedef void (*nvnMemoryPoolFlushMappedRangeFunction)(const NVNmemoryPool*, ptrdiff_t, size_t); -typedef void (*nvnMemoryPoolInvalidateMappedRangeFunction)(const NVNmemoryPool*, ptrdiff_t, size_t); -typedef NVNbufferAddress (*nvnMemoryPoolGetBufferAddressFunction)(const NVNmemoryPool*); -typedef bool (*nvnMemoryPoolMapVirtualFunction)(NVNmemoryPool*, int, const NVNmappingRequest*); -typedef size_t (*nvnMemoryPoolGetSizeFunction)(const NVNmemoryPool*); -typedef NVNmemoryPoolFlags (*nvnMemoryPoolGetFlagsFunction)(const NVNmemoryPool*); -typedef bool (*nvnTexturePoolInitializeFunction)(NVNtexturePool*, const NVNmemoryPool*, ptrdiff_t, - int); -typedef void (*nvnTexturePoolSetDebugLabelFunction)(NVNtexturePool*, const char*); -typedef void (*nvnTexturePoolFinalizeFunction)(NVNtexturePool*); -typedef void (*nvnTexturePoolRegisterTextureFunction)(const NVNtexturePool*, int, const NVNtexture*, - const NVNtextureView*); -typedef void (*nvnTexturePoolRegisterImageFunction)(const NVNtexturePool*, int, const NVNtexture*, - const NVNtextureView*); -typedef const NVNmemoryPool* (*nvnTexturePoolGetMemoryPoolFunction)(const NVNtexturePool*); -typedef ptrdiff_t (*nvnTexturePoolGetMemoryOffsetFunction)(const NVNtexturePool*); -typedef int (*nvnTexturePoolGetSizeFunction)(const NVNtexturePool*); -typedef bool (*nvnSamplerPoolInitializeFunction)(NVNsamplerPool*, const NVNmemoryPool*, ptrdiff_t, - int); -typedef void (*nvnSamplerPoolSetDebugLabelFunction)(NVNsamplerPool*, const char*); -typedef void (*nvnSamplerPoolFinalizeFunction)(NVNsamplerPool*); -typedef void (*nvnSamplerPoolRegisterSamplerFunction)(const NVNsamplerPool*, int, - const NVNsampler*); -typedef void (*nvnSamplerPoolRegisterSamplerBuilderFunction)(const NVNsamplerPool*, int, - const NVNsamplerBuilder*); -typedef const NVNmemoryPool* (*nvnSamplerPoolGetMemoryPoolFunction)(const NVNsamplerPool*); -typedef ptrdiff_t (*nvnSamplerPoolGetMemoryOffsetFunction)(const NVNsamplerPool*); -typedef int (*nvnSamplerPoolGetSizeFunction)(const NVNsamplerPool*); -typedef void (*nvnBufferBuilderSetDeviceFunction)(NVNbufferBuilder*, NVNdevice*); -typedef void (*nvnBufferBuilderSetDefaultsFunction)(NVNbufferBuilder*); -typedef void (*nvnBufferBuilderSetStorageFunction)(NVNbufferBuilder*, NVNmemoryPool*, ptrdiff_t, - size_t); -typedef NVNmemoryPool (*nvnBufferBuilderGetMemoryPoolFunction)(const NVNbufferBuilder*); -typedef ptrdiff_t (*nvnBufferBuilderGetMemoryOffsetFunction)(const NVNbufferBuilder*); -typedef size_t (*nvnBufferBuilderGetSizeFunction)(const NVNbufferBuilder*); -typedef bool (*nvnBufferInitializeFunction)(NVNbuffer*, const NVNbufferBuilder*); -typedef void (*nvnBufferSetDebugLabelFunction)(NVNbuffer*, const char*); -typedef void (*nvnBufferFinalizeFunction)(NVNbuffer*); -typedef void (*nvnBufferMapFunction)(const NVNbuffer*); -typedef NVNbufferAddress (*nvnBufferGetAddressFunction)(const NVNbuffer*); -typedef void (*nvnBufferFlushMappedRangeFunction)(const NVNbuffer*, ptrdiff_t, size_t); -typedef void (*nvnBufferInvalidateMappedRangeFunction)(const NVNbuffer*, ptrdiff_t, size_t); -typedef NVNmemoryPool (*nvnBufferGetMemoryPoolFunction)(const NVNbuffer*); -typedef ptrdiff_t (*nvnBufferGetMemoryOffsetFunction)(const NVNbuffer*); -typedef size_t (*nvnBufferGetSizeFunction)(const NVNbuffer*); -typedef uint64_t (*nvnBufferGetDebugIDFunction)(const NVNbuffer*); -typedef void (*nvnTextureBuilderSetDeviceFunction)(NVNtextureBuilder*, NVNdevice*); -typedef void (*nvnTextureBuilderSetDefaultsFunction)(NVNtextureBuilder*); -typedef void (*nvnTextureBuilderSetFlagsFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetTargetFunction)(NVNtextureBuilder*, NVNtextureTarget); -typedef void (*nvnTextureBuilderSetWidthFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetHeightFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetDepthFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetSize1DFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetSize2DFunction)(NVNtextureBuilder*, int, int); -typedef void (*nvnTextureBuilderSetSize3DFunction)(NVNtextureBuilder*, int, int, int); -typedef void (*nvnTextureBuilderSetLevelsFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetFormatFunction)(NVNtextureBuilder*, NVNformat); -typedef void (*nvnTextureBuilderSetSamplesFunction)(NVNtextureBuilder*, int); -typedef void (*nvnTextureBuilderSetSwizzleFunction)(NVNtextureBuilder*, NVNtextureSwizzle, - NVNtextureSwizzle, NVNtextureSwizzle, - NVNtextureSwizzle); -typedef void (*nvnTextureBuilderSetDepthStencilModeFunction)(NVNtextureBuilder*, - NVNtextureDepthStencilMode); -typedef size_t (*nvnTextureBuilderGetStorageSizeFunction)(const NVNtextureBuilder*); -typedef size_t (*nvnTextureBuilderGetStorageAlignmentFunction)(const NVNtextureBuilder*); -typedef void (*nvnTextureBuilderSetStorageFunction)(NVNtextureBuilder*, NVNmemoryPool*, ptrdiff_t); -typedef void (*nvnTextureBuilderSetPackagedTextureDataFunction)(NVNtextureBuilder*, const void*); -typedef void (*nvnTextureBuilderSetPackagedTextureLayoutFunction)(NVNtextureBuilder*, - const NVNpackagedTextureLayout*); -typedef void (*nvnTextureBuilderSetStrideFunction)(NVNtextureBuilder*, ptrdiff_t); -typedef void (*nvnTextureBuilderSetGLTextureNameFunction)(NVNtextureBuilder*, uint32_t); -typedef NVNstorageClass (*nvnTextureBuilderGetStorageClassFunction)(const NVNtextureBuilder*); -typedef NVNtextureFlags (*nvnTextureBuilderGetFlagsFunction)(const NVNtextureBuilder*); -typedef NVNtextureTarget (*nvnTextureBuilderGetTargetFunction)(const NVNtextureBuilder*); -typedef int (*nvnTextureBuilderGetWidthFunction)(const NVNtextureBuilder*); -typedef int (*nvnTextureBuilderGetHeightFunction)(const NVNtextureBuilder*); -typedef int (*nvnTextureBuilderGetDepthFunction)(const NVNtextureBuilder*); -typedef int (*nvnTextureBuilderGetLevelsFunction)(const NVNtextureBuilder*); -typedef NVNformat (*nvnTextureBuilderGetFormatFunction)(const NVNtextureBuilder*); -typedef int (*nvnTextureBuilderGetSamplesFunction)(const NVNtextureBuilder*); -typedef void (*nvnTextureBuilderGetSwizzleFunction)(const NVNtextureBuilder*, NVNtextureSwizzle*, - NVNtextureSwizzle*, NVNtextureSwizzle*, - NVNtextureSwizzle*); -typedef NVNtextureDepthStencilMode (*nvnTextureBuilderGetDepthStencilModeFunction)( - const NVNtextureBuilder*); -typedef const void* (*nvnTextureBuilderGetPackagedTextureDataFunction)(const NVNtextureBuilder*); -typedef ptrdiff_t (*nvnTextureBuilderGetStrideFunction)(const NVNtextureBuilder*); -typedef void (*nvnTextureBuilderGetSparseTileLayoutFunction)(const NVNtextureBuilder*, - NVNtextureSparseTileLayout*); -typedef uint32_t (*nvnTextureBuilderGetGLTextureNameFunction)(const NVNtextureBuilder*); -typedef size_t (*nvnTextureBuilderGetZCullStorageSizeFunction)(const NVNtextureBuilder*); -typedef NVNmemoryPool (*nvnTextureBuilderGetMemoryPoolFunction)(const NVNtextureBuilder*); -typedef ptrdiff_t (*nvnTextureBuilderGetMemoryOffsetFunction)(const NVNtextureBuilder*); -typedef void (*nvnTextureViewSetDefaultsFunction)(NVNtextureView*); -typedef void (*nvnTextureViewSetLevelsFunction)(NVNtextureView*, int, int); -typedef void (*nvnTextureViewSetLayersFunction)(NVNtextureView*, int, int); -typedef void (*nvnTextureViewSetFormatFunction)(NVNtextureView*, NVNformat); -typedef void (*nvnTextureViewSetSwizzleFunction)(NVNtextureView*, NVNtextureSwizzle, - NVNtextureSwizzle, NVNtextureSwizzle, - NVNtextureSwizzle); -typedef void (*nvnTextureViewSetDepthStencilModeFunction)(NVNtextureView*, - NVNtextureDepthStencilMode); -typedef void (*nvnTextureViewSetTargetFunction)(NVNtextureView*, NVNtextureTarget); -typedef bool (*nvnTextureViewGetLevelsFunction)(const NVNtextureView*, int*, int*); -typedef bool (*nvnTextureViewGetLayersFunction)(const NVNtextureView*, int*, int*); -typedef bool (*nvnTextureViewGetFormatFunction)(const NVNtextureView*, NVNformat*); -typedef bool (*nvnTextureViewGetSwizzleFunction)(const NVNtextureView*, NVNtextureSwizzle*, - NVNtextureSwizzle*, NVNtextureSwizzle*, - NVNtextureSwizzle*); -typedef bool (*nvnTextureViewGetDepthStencilModeFunction)(const NVNtextureView*, - NVNtextureDepthStencilMode*); -typedef bool (*nvnTextureViewGetTargetFunction)(const NVNtextureView*, NVNtextureTarget*); -typedef bool (*nvnTextureViewCompareFunction)(const NVNtextureView*, const NVNtextureView*); -typedef bool (*nvnTextureInitializeFunction)(NVNtexture*, const NVNtextureBuilder*); -typedef size_t (*nvnTextureGetZCullStorageSizeFunction)(const NVNtexture*); -typedef void (*nvnTextureFinalizeFunction)(NVNtexture*); -typedef void (*nvnTextureSetDebugLabelFunction)(NVNtexture*, const char*); -typedef NVNstorageClass (*nvnTextureGetStorageClassFunction)(const NVNtexture*); -typedef ptrdiff_t (*nvnTextureGetViewOffsetFunction)(const NVNtexture*, const NVNtextureView*); -typedef NVNtextureFlags (*nvnTextureGetFlagsFunction)(const NVNtexture*); -typedef NVNtextureTarget (*nvnTextureGetTargetFunction)(const NVNtexture*); -typedef int (*nvnTextureGetWidthFunction)(const NVNtexture*); -typedef int (*nvnTextureGetHeightFunction)(const NVNtexture*); -typedef int (*nvnTextureGetDepthFunction)(const NVNtexture*); -typedef int (*nvnTextureGetLevelsFunction)(const NVNtexture*); -typedef NVNformat (*nvnTextureGetFormatFunction)(const NVNtexture*); -typedef int (*nvnTextureGetSamplesFunction)(const NVNtexture*); -typedef void (*nvnTextureGetSwizzleFunction)(const NVNtexture*, NVNtextureSwizzle*, - NVNtextureSwizzle*, NVNtextureSwizzle*, - NVNtextureSwizzle*); -typedef NVNtextureDepthStencilMode (*nvnTextureGetDepthStencilModeFunction)(const NVNtexture*); -typedef ptrdiff_t (*nvnTextureGetStrideFunction)(const NVNtexture*); -typedef NVNtextureAddress (*nvnTextureGetTextureAddressFunction)(const NVNtexture*); -typedef void (*nvnTextureGetSparseTileLayoutFunction)(const NVNtexture*, - NVNtextureSparseTileLayout*); -typedef void (*nvnTextureWriteTexelsFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*, const void*); -typedef void (*nvnTextureWriteTexelsStridedFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*, const void*, ptrdiff_t, - ptrdiff_t); -typedef void (*nvnTextureReadTexelsFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*, void*); -typedef void (*nvnTextureReadTexelsStridedFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*, void*, ptrdiff_t, - ptrdiff_t); -typedef void (*nvnTextureFlushTexelsFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*); -typedef void (*nvnTextureInvalidateTexelsFunction)(const NVNtexture*, const NVNtextureView*, - const NVNcopyRegion*); -typedef NVNmemoryPool (*nvnTextureGetMemoryPoolFunction)(const NVNtexture*); -typedef ptrdiff_t (*nvnTextureGetMemoryOffsetFunction)(const NVNtexture*); -typedef int (*nvnTextureGetStorageSizeFunction)(const NVNtexture*); -typedef bool (*nvnTextureCompareFunction)(const NVNtexture*, const NVNtexture*); -typedef uint64_t (*nvnTextureGetDebugIDFunction)(const NVNtexture*); -typedef void (*nvnSamplerBuilderSetDeviceFunction)(NVNsamplerBuilder*, NVNdevice*); -typedef void (*nvnSamplerBuilderSetDefaultsFunction)(NVNsamplerBuilder*); -typedef void (*nvnSamplerBuilderSetMinMagFilterFunction)(NVNsamplerBuilder*, NVNminFilter, - NVNmagFilter); -typedef void (*nvnSamplerBuilderSetWrapModeFunction)(NVNsamplerBuilder*, NVNwrapMode, NVNwrapMode, - NVNwrapMode); -typedef void (*nvnSamplerBuilderSetLodClampFunction)(NVNsamplerBuilder*, float, float); -typedef void (*nvnSamplerBuilderSetLodBiasFunction)(NVNsamplerBuilder*, float); -typedef void (*nvnSamplerBuilderSetCompareFunction)(NVNsamplerBuilder*, NVNcompareMode, - NVNcompareFunc); -typedef void (*nvnSamplerBuilderSetBorderColorFunction)(NVNsamplerBuilder*, const float*); -typedef void (*nvnSamplerBuilderSetBorderColoriFunction)(NVNsamplerBuilder*, const int*); -typedef void (*nvnSamplerBuilderSetBorderColoruiFunction)(NVNsamplerBuilder*, const uint32_t*); -typedef void (*nvnSamplerBuilderSetMaxAnisotropyFunction)(NVNsamplerBuilder*, float); -typedef void (*nvnSamplerBuilderSetReductionFilterFunction)(NVNsamplerBuilder*, - NVNsamplerReduction); -typedef void (*nvnSamplerBuilderSetLodSnapFunction)(NVNsamplerBuilder*, float); -typedef void (*nvnSamplerBuilderGetMinMagFilterFunction)(const NVNsamplerBuilder*, NVNminFilter*, - NVNmagFilter*); -typedef void (*nvnSamplerBuilderGetWrapModeFunction)(const NVNsamplerBuilder*, NVNwrapMode*, - NVNwrapMode*, NVNwrapMode*); -typedef void (*nvnSamplerBuilderGetLodClampFunction)(const NVNsamplerBuilder*, float*, float*); -typedef float (*nvnSamplerBuilderGetLodBiasFunction)(const NVNsamplerBuilder*); -typedef void (*nvnSamplerBuilderGetCompareFunction)(const NVNsamplerBuilder*, NVNcompareMode*, - NVNcompareFunc*); -typedef void (*nvnSamplerBuilderGetBorderColorFunction)(const NVNsamplerBuilder*, float*); -typedef void (*nvnSamplerBuilderGetBorderColoriFunction)(const NVNsamplerBuilder*, int*); -typedef void (*nvnSamplerBuilderGetBorderColoruiFunction)(const NVNsamplerBuilder*, uint32_t*); -typedef float (*nvnSamplerBuilderGetMaxAnisotropyFunction)(const NVNsamplerBuilder*); -typedef NVNsamplerReduction (*nvnSamplerBuilderGetReductionFilterFunction)( - const NVNsamplerBuilder*); -typedef float (*nvnSamplerBuilderGetLodSnapFunction)(const NVNsamplerBuilder*); -typedef bool (*nvnSamplerInitializeFunction)(NVNsampler*, const NVNsamplerBuilder*); -typedef void (*nvnSamplerFinalizeFunction)(NVNsampler*); -typedef void (*nvnSamplerSetDebugLabelFunction)(NVNsampler*, const char*); -typedef void (*nvnSamplerGetMinMagFilterFunction)(const NVNsampler*, NVNminFilter*, NVNmagFilter*); -typedef void (*nvnSamplerGetWrapModeFunction)(const NVNsampler*, NVNwrapMode*, NVNwrapMode*, - NVNwrapMode*); -typedef void (*nvnSamplerGetLodClampFunction)(const NVNsampler*, float*, float*); -typedef float (*nvnSamplerGetLodBiasFunction)(const NVNsampler*); -typedef void (*nvnSamplerGetCompareFunction)(const NVNsampler*, NVNcompareMode*, NVNcompareFunc*); -typedef void (*nvnSamplerGetBorderColorFunction)(const NVNsampler*, float*); -typedef void (*nvnSamplerGetBorderColoriFunction)(const NVNsampler*, int*); -typedef void (*nvnSamplerGetBorderColoruiFunction)(const NVNsampler*, uint32_t*); -typedef float (*nvnSamplerGetMaxAnisotropyFunction)(const NVNsampler*); -typedef NVNsamplerReduction (*nvnSamplerGetReductionFilterFunction)(const NVNsampler*); -typedef bool (*nvnSamplerCompareFunction)(const NVNsampler*, const NVNsampler*); -typedef uint64_t (*nvnSamplerGetDebugIDFunction)(const NVNsampler*); -typedef void (*nvnBlendStateSetDefaultsFunction)(NVNblendState*); -typedef void (*nvnBlendStateSetBlendTargetFunction)(NVNblendState*, int); -typedef void (*nvnBlendStateSetBlendFuncFunction)(NVNblendState*, NVNblendFunc, NVNblendFunc, - NVNblendFunc, NVNblendFunc); -typedef void (*nvnBlendStateSetBlendEquationFunction)(NVNblendState*, NVNblendEquation, - NVNblendEquation); -typedef void (*nvnBlendStateSetAdvancedModeFunction)(NVNblendState*, NVNblendAdvancedMode); -typedef void (*nvnBlendStateSetAdvancedOverlapFunction)(NVNblendState*, NVNblendAdvancedOverlap); -typedef void (*nvnBlendStateSetAdvancedPremultipliedSrcFunction)(NVNblendState*, bool); -typedef void (*nvnBlendStateSetAdvancedNormalizedDstFunction)(NVNblendState*, bool); -typedef int (*nvnBlendStateGetBlendTargetFunction)(const NVNblendState*); -typedef void (*nvnBlendStateGetBlendFuncFunction)(const NVNblendState*, NVNblendFunc*, - NVNblendFunc*, NVNblendFunc*, NVNblendFunc*); -typedef void (*nvnBlendStateGetBlendEquationFunction)(const NVNblendState*, NVNblendEquation*, - NVNblendEquation*); -typedef NVNblendAdvancedMode (*nvnBlendStateGetAdvancedModeFunction)(const NVNblendState*); -typedef NVNblendAdvancedOverlap (*nvnBlendStateGetAdvancedOverlapFunction)(const NVNblendState*); -typedef bool (*nvnBlendStateGetAdvancedPremultipliedSrcFunction)(const NVNblendState*); -typedef bool (*nvnBlendStateGetAdvancedNormalizedDstFunction)(const NVNblendState*); -typedef void (*nvnColorStateSetDefaultsFunction)(NVNcolorState*); -typedef void (*nvnColorStateSetBlendEnableFunction)(NVNcolorState*, int, bool); -typedef void (*nvnColorStateSetLogicOpFunction)(NVNcolorState*, NVNlogicOp); -typedef void (*nvnColorStateSetAlphaTestFunction)(NVNcolorState*, NVNalphaFunc); -typedef bool (*nvnColorStateGetBlendEnableFunction)(const NVNcolorState*, int); -typedef NVNlogicOp (*nvnColorStateGetLogicOpFunction)(const NVNcolorState*); -typedef NVNalphaFunc (*nvnColorStateGetAlphaTestFunction)(const NVNcolorState*); -typedef void (*nvnChannelMaskStateSetDefaultsFunction)(NVNchannelMaskState*); -typedef void (*nvnChannelMaskStateSetChannelMaskFunction)(NVNchannelMaskState*, int, bool, bool, - bool, bool); -typedef void (*nvnChannelMaskStateGetChannelMaskFunction)(const NVNchannelMaskState*, int, bool*, - bool*, bool*, bool*); -typedef void (*nvnMultisampleStateSetDefaultsFunction)(NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetMultisampleEnableFunction)(NVNmultisampleState*, bool); -typedef void (*nvnMultisampleStateSetSamplesFunction)(NVNmultisampleState*, int); -typedef void (*nvnMultisampleStateSetAlphaToCoverageEnableFunction)(NVNmultisampleState*, bool); -typedef void (*nvnMultisampleStateSetAlphaToCoverageDitherFunction)(NVNmultisampleState*, bool); -typedef bool (*nvnMultisampleStateGetMultisampleEnableFunction)(const NVNmultisampleState*); -typedef int (*nvnMultisampleStateGetSamplesFunction)(const NVNmultisampleState*); -typedef bool (*nvnMultisampleStateGetAlphaToCoverageEnableFunction)(const NVNmultisampleState*); -typedef bool (*nvnMultisampleStateGetAlphaToCoverageDitherFunction)(const NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetRasterSamplesFunction)(NVNmultisampleState*, int); -typedef int (*nvnMultisampleStateGetRasterSamplesFunction)(NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetCoverageModulationModeFunction)(NVNmultisampleState*, - NVNcoverageModulationMode); -typedef NVNcoverageModulationMode (*nvnMultisampleStateGetCoverageModulationModeFunction)( - const NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetCoverageToColorEnableFunction)(NVNmultisampleState*, bool); -typedef bool (*nvnMultisampleStateGetCoverageToColorEnableFunction)(const NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetCoverageToColorOutputFunction)(NVNmultisampleState*, int); -typedef int (*nvnMultisampleStateGetCoverageToColorOutputFunction)(const NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetSampleLocationsEnableFunction)(NVNmultisampleState*, bool); -typedef bool (*nvnMultisampleStateGetSampleLocationsEnableFunction)(const NVNmultisampleState*); -typedef void (*nvnMultisampleStateGetSampleLocationsGridFunction)(NVNmultisampleState*, int*, int*); -typedef void (*nvnMultisampleStateSetSampleLocationsGridEnableFunction)(NVNmultisampleState*, bool); -typedef bool (*nvnMultisampleStateGetSampleLocationsGridEnableFunction)(const NVNmultisampleState*); -typedef void (*nvnMultisampleStateSetSampleLocationsFunction)(NVNmultisampleState*, bool); -typedef void (*nvnPolygonStateSetDefaultsFunction)(NVNpolygonState*); -typedef void (*nvnPolygonStateSetCullFaceFunction)(NVNpolygonState*, NVNface); -typedef void (*nvnPolygonStateSetFrontFaceFunction)(NVNpolygonState*, NVNfrontFace); -typedef void (*nvnPolygonStateSetPolygonModeFunction)(NVNpolygonState*, NVNpolygonMode); -typedef void (*nvnPolygonStateSetPolygonOffsetEnablesFunction)(NVNpolygonState*, int); -typedef NVNface (*nvnPolygonStateGetCullFaceFunction)(const NVNpolygonState*); -typedef NVNfrontFace (*nvnPolygonStateGetFrontFaceFunction)(const NVNpolygonState*); -typedef NVNpolygonMode (*nvnPolygonStateGetPolygonModeFunction)(const NVNpolygonState*); -typedef NVNpolygonOffsetEnable (*nvnPolygonStateGetPolygonOffsetEnablesFunction)( - const NVNpolygonState*); -typedef void (*nvnDepthStencilStateSetDefaultsFunction)(NVNdepthStencilState*); -typedef void (*nvnDepthStencilStateSetDepthTestEnableFunction)(NVNdepthStencilState*, bool); -typedef void (*nvnDepthStencilStateSetDepthWriteEnableFunction)(NVNdepthStencilState*, bool); -typedef void (*nvnDepthStencilStateSetDepthFuncFunction)(NVNdepthStencilState*, NVNdepthFunc); -typedef void (*nvnDepthStencilStateSetStencilTestEnableFunction)(NVNdepthStencilState*, bool); -typedef void (*nvnDepthStencilStateSetStencilFuncFunction)(NVNdepthStencilState*, NVNface, - NVNstencilFunc); -typedef void (*nvnDepthStencilStateSetStencilOpFunction)(NVNdepthStencilState*, NVNface, - NVNstencilOp, NVNstencilOp, NVNstencilOp); -typedef bool (*nvnDepthStencilStateGetDepthTestEnableFunction)(const NVNdepthStencilState*); -typedef bool (*nvnDepthStencilStateGetDepthWriteEnableFunction)(const NVNdepthStencilState*); -typedef NVNdepthFunc (*nvnDepthStencilStateGetDepthFuncFunction)(const NVNdepthStencilState*); -typedef bool (*nvnDepthStencilStateGetStencilTestEnableFunction)(const NVNdepthStencilState*); -typedef NVNstencilFunc (*nvnDepthStencilStateGetStencilFuncFunction)(const NVNdepthStencilState*, - NVNface); -typedef void (*nvnDepthStencilStateGetStencilOpFunction)(const NVNdepthStencilState*, NVNface, - NVNstencilOp*, NVNstencilOp*, - NVNstencilOp*); -typedef void (*nvnVertexAttribStateSetDefaultsFunction)(NVNvertexAttribState*); -typedef void (*nvnVertexAttribStateSetFormatFunction)(NVNvertexAttribState*, NVNformat, ptrdiff_t); -typedef void (*nvnVertexAttribStateSetStreamIndexFunction)(NVNvertexAttribState*, int); -typedef void (*nvnVertexAttribStateGetFormatFunction)(const NVNvertexAttribState*, NVNformat*, - ptrdiff_t*); -typedef int (*nvnVertexAttribStateGetStreamIndexFunction)(const NVNvertexAttribState*); -typedef void (*nvnVertexStreamStateSetDefaultsFunction)(NVNvertexStreamState*); -typedef void (*nvnVertexStreamStateSetStrideFunction)(NVNvertexStreamState*, ptrdiff_t); -typedef void (*nvnVertexStreamStateSetDivisorFunction)(NVNvertexStreamState*, int); -typedef ptrdiff_t (*nvnVertexStreamStateGetStrideFunction)(const NVNvertexStreamState*); -typedef int (*nvnVertexStreamStateGetDivisorFunction)(const NVNvertexStreamState*); -typedef bool (*nvnCommandBufferInitializeFunction)(NVNcommandBuffer*, NVNdevice*); -typedef void (*nvnCommandBufferFinalizeFunction)(NVNcommandBuffer*); -typedef void (*nvnCommandBufferSetDebugLabelFunction)(NVNcommandBuffer*, const char*); -typedef void (*nvnCommandBufferSetMemoryCallbackFunction)(NVNcommandBuffer*, - NVNcommandBufferMemoryCallback); -typedef void (*nvnCommandBufferSetMemoryCallbackDataFunction)(NVNcommandBuffer*, void*); -typedef void (*nvnCommandBufferAddCommandMemoryFunction)(NVNcommandBuffer*, const NVNmemoryPool*, - ptrdiff_t, size_t); -typedef void (*nvnCommandBufferAddControlMemoryFunction)(NVNcommandBuffer*, void*, size_t); -typedef size_t (*nvnCommandBufferGetCommandMemorySizeFunction)(const NVNcommandBuffer*); -typedef size_t (*nvnCommandBufferGetCommandMemoryUsedFunction)(const NVNcommandBuffer*); -typedef size_t (*nvnCommandBufferGetCommandMemoryFreeFunction)(const NVNcommandBuffer*); -typedef size_t (*nvnCommandBufferGetControlMemorySizeFunction)(const NVNcommandBuffer*); -typedef size_t (*nvnCommandBufferGetControlMemoryUsedFunction)(const NVNcommandBuffer*); -typedef size_t (*nvnCommandBufferGetControlMemoryFreeFunction)(const NVNcommandBuffer*); -typedef void (*nvnCommandBufferBeginRecordingFunction)(NVNcommandBuffer*); -typedef NVNcommandHandle (*nvnCommandBufferEndRecordingFunction)(NVNcommandBuffer*); -typedef void (*nvnCommandBufferCallCommandsFunction)(NVNcommandBuffer*, int, - const NVNcommandHandle*); -typedef void (*nvnCommandBufferCopyCommandsFunction)(NVNcommandBuffer*, int, - const NVNcommandHandle*); -typedef void (*nvnCommandBufferBindBlendStateFunction)(NVNcommandBuffer*, const NVNblendState*); -typedef void (*nvnCommandBufferBindChannelMaskStateFunction)(NVNcommandBuffer*, - const NVNchannelMaskState*); -typedef void (*nvnCommandBufferBindColorStateFunction)(NVNcommandBuffer*, const NVNcolorState*); -typedef void (*nvnCommandBufferBindMultisampleStateFunction)(NVNcommandBuffer*, - const NVNmultisampleState*); -typedef void (*nvnCommandBufferBindPolygonStateFunction)(NVNcommandBuffer*, const NVNpolygonState*); -typedef void (*nvnCommandBufferBindDepthStencilStateFunction)(NVNcommandBuffer*, - const NVNdepthStencilState*); -typedef void (*nvnCommandBufferBindVertexAttribStateFunction)(NVNcommandBuffer*, int, - const NVNvertexAttribState*); -typedef void (*nvnCommandBufferBindVertexStreamStateFunction)(NVNcommandBuffer*, int, - const NVNvertexStreamState*); -typedef void (*nvnCommandBufferBindProgramFunction)(NVNcommandBuffer*, const NVNprogram*, int); -typedef void (*nvnCommandBufferBindVertexBufferFunction)(NVNcommandBuffer*, int, NVNbufferAddress, - size_t); -typedef void (*nvnCommandBufferBindVertexBuffersFunction)(NVNcommandBuffer*, int, int, - const NVNbufferRange*); -typedef void (*nvnCommandBufferBindUniformBufferFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNbufferAddress, size_t); -typedef void (*nvnCommandBufferBindUniformBuffersFunction)(NVNcommandBuffer*, NVNshaderStage, int, - int, const NVNbufferRange*); -typedef void (*nvnCommandBufferBindTransformFeedbackBufferFunction)(NVNcommandBuffer*, int, - NVNbufferAddress, size_t); -typedef void (*nvnCommandBufferBindTransformFeedbackBuffersFunction)(NVNcommandBuffer*, int, int, - const NVNbufferRange*); -typedef void (*nvnCommandBufferBindStorageBufferFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNbufferAddress, size_t); -typedef void (*nvnCommandBufferBindStorageBuffersFunction)(NVNcommandBuffer*, NVNshaderStage, int, - int, const NVNbufferRange*); -typedef void (*nvnCommandBufferBindTextureFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNtextureHandle); -typedef void (*nvnCommandBufferBindTexturesFunction)(NVNcommandBuffer*, NVNshaderStage, int, int, - const NVNtextureHandle*); -typedef void (*nvnCommandBufferBindImageFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNimageHandle); -typedef void (*nvnCommandBufferBindImagesFunction)(NVNcommandBuffer*, NVNshaderStage, int, int, - const NVNimageHandle*); -typedef void (*nvnCommandBufferSetPatchSizeFunction)(NVNcommandBuffer*, int); -typedef void (*nvnCommandBufferSetInnerTessellationLevelsFunction)(NVNcommandBuffer*, const float*); -typedef void (*nvnCommandBufferSetOuterTessellationLevelsFunction)(NVNcommandBuffer*, const float*); -typedef void (*nvnCommandBufferSetPrimitiveRestartFunction)(NVNcommandBuffer*, bool, int); -typedef void (*nvnCommandBufferBeginTransformFeedbackFunction)(NVNcommandBuffer*, NVNbufferAddress); -typedef void (*nvnCommandBufferEndTransformFeedbackFunction)(NVNcommandBuffer*, NVNbufferAddress); -typedef void (*nvnCommandBufferPauseTransformFeedbackFunction)(NVNcommandBuffer*, NVNbufferAddress); -typedef void (*nvnCommandBufferResumeTransformFeedbackFunction)(NVNcommandBuffer*, - NVNbufferAddress); -typedef void (*nvnCommandBufferDrawTransformFeedbackFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNbufferAddress); -typedef void (*nvnCommandBufferDrawArraysFunction)(NVNcommandBuffer*, NVNdrawPrimitive, int, int); -typedef void (*nvnCommandBufferDrawElementsFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNindexType, int, NVNbufferAddress); -typedef void (*nvnCommandBufferDrawElementsBaseVertexFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNindexType, int, NVNbufferAddress, - int); -typedef void (*nvnCommandBufferDrawArraysInstancedFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - int, int, int, int); -typedef void (*nvnCommandBufferDrawElementsInstancedFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNindexType, int, NVNbufferAddress, - int, int, int); -typedef void (*nvnCommandBufferDrawArraysIndirectFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNbufferAddress); -typedef void (*nvnCommandBufferDrawElementsIndirectFunction)(NVNcommandBuffer*, NVNdrawPrimitive, - NVNindexType, NVNbufferAddress, - NVNbufferAddress); -typedef void (*nvnCommandBufferMultiDrawArraysIndirectCountFunction)( - NVNcommandBuffer*, NVNdrawPrimitive, NVNbufferAddress, NVNbufferAddress, int, ptrdiff_t); -typedef void (*nvnCommandBufferMultiDrawElementsIndirectCountFunction)( - NVNcommandBuffer*, NVNdrawPrimitive, NVNindexType, NVNbufferAddress, NVNbufferAddress, - NVNbufferAddress, int, ptrdiff_t); -typedef void (*nvnCommandBufferClearColorFunction)(NVNcommandBuffer*, int, const float*, int); -typedef void (*nvnCommandBufferClearColoriFunction)(NVNcommandBuffer*, int, const int*, int); -typedef void (*nvnCommandBufferClearColoruiFunction)(NVNcommandBuffer*, int, const uint32_t*, int); -typedef void (*nvnCommandBufferClearDepthStencilFunction)(NVNcommandBuffer*, float, bool, int, int); -typedef void (*nvnCommandBufferDispatchComputeFunction)(NVNcommandBuffer*, int, int, int); -typedef void (*nvnCommandBufferDispatchComputeIndirectFunction)(NVNcommandBuffer*, - NVNbufferAddress); -typedef void (*nvnCommandBufferSetViewportFunction)(NVNcommandBuffer*, int, int, int, int); -typedef void (*nvnCommandBufferSetViewportsFunction)(NVNcommandBuffer*, int, int, const float*); -typedef void (*nvnCommandBufferSetViewportSwizzlesFunction)(NVNcommandBuffer*, int, int, - const NVNviewportSwizzle*); -typedef void (*nvnCommandBufferSetScissorFunction)(NVNcommandBuffer*, int, int, int, int); -typedef void (*nvnCommandBufferSetScissorsFunction)(NVNcommandBuffer*, int, int, const int*); -typedef void (*nvnCommandBufferSetDepthRangeFunction)(NVNcommandBuffer*, float, float); -typedef void (*nvnCommandBufferSetDepthBoundsFunction)(NVNcommandBuffer*, bool, float, float); -typedef void (*nvnCommandBufferSetDepthRangesFunction)(NVNcommandBuffer*, int, int, const float*); -typedef void (*nvnCommandBufferSetTiledCacheActionFunction)(NVNcommandBuffer*, NVNtiledCacheAction); -typedef void (*nvnCommandBufferSetTiledCacheTileSizeFunction)(NVNcommandBuffer*, int, int); -typedef void (*nvnCommandBufferBindSeparateTextureFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNseparateTextureHandle); -typedef void (*nvnCommandBufferBindSeparateSamplerFunction)(NVNcommandBuffer*, NVNshaderStage, int, - NVNseparateSamplerHandle); -typedef void (*nvnCommandBufferBindSeparateTexturesFunction)(NVNcommandBuffer*, NVNshaderStage, int, - int, const NVNseparateTextureHandle*); -typedef void (*nvnCommandBufferBindSeparateSamplersFunction)(NVNcommandBuffer*, NVNshaderStage, int, - int, const NVNseparateSamplerHandle*); -typedef void (*nvnCommandBufferSetStencilValueMaskFunction)(NVNcommandBuffer*, NVNface, int); -typedef void (*nvnCommandBufferSetStencilMaskFunction)(NVNcommandBuffer*, NVNface, int); -typedef void (*nvnCommandBufferSetStencilRefFunction)(NVNcommandBuffer*, NVNface, int); -typedef void (*nvnCommandBufferSetBlendColorFunction)(NVNcommandBuffer*, const float*); -typedef void (*nvnCommandBufferSetPointSizeFunction)(NVNcommandBuffer*, float); -typedef void (*nvnCommandBufferSetLineWidthFunction)(NVNcommandBuffer*, float); -typedef void (*nvnCommandBufferSetPolygonOffsetClampFunction)(NVNcommandBuffer*, float, float, - float); -typedef void (*nvnCommandBufferSetAlphaRefFunction)(NVNcommandBuffer*, float); -typedef void (*nvnCommandBufferSetSampleMaskFunction)(NVNcommandBuffer*, int); -typedef void (*nvnCommandBufferSetRasterizerDiscardFunction)(NVNcommandBuffer*, bool); -typedef void (*nvnCommandBufferSetDepthClampFunction)(NVNcommandBuffer*, bool); -typedef void (*nvnCommandBufferSetConservativeRasterEnableFunction)(NVNcommandBuffer*, bool); -typedef void (*nvnCommandBufferSetConservativeRasterDilateFunction)(NVNcommandBuffer*, float); -typedef void (*nvnCommandBufferSetSubpixelPrecisionBiasFunction)(NVNcommandBuffer*, int, int); -typedef void (*nvnCommandBufferCopyBufferToTextureFunction)(NVNcommandBuffer*, NVNbufferAddress, - const NVNtexture*, - const NVNtextureView*, - const NVNcopyRegion*, int); -typedef void (*nvnCommandBufferCopyTextureToBufferFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtextureView*, - const NVNcopyRegion*, NVNbufferAddress, - int); -typedef void (*nvnCommandBufferCopyTextureToTextureFunction)( - NVNcommandBuffer*, const NVNtexture*, const NVNtextureView*, const NVNcopyRegion*, - const NVNtexture*, const NVNtextureView*, const NVNcopyRegion*, int); -typedef void (*nvnCommandBufferCopyBufferToBufferFunction)(NVNcommandBuffer*, NVNbufferAddress, - NVNbufferAddress, size_t, int); -typedef void (*nvnCommandBufferClearBufferFunction)(NVNcommandBuffer*, NVNbufferAddress, size_t, - uint32_t); -typedef void (*nvnCommandBufferClearTextureFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtextureView*, const NVNcopyRegion*, - const float*, int); -typedef void (*nvnCommandBufferClearTextureiFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtextureView*, const NVNcopyRegion*, - const int*, int); -typedef void (*nvnCommandBufferClearTextureuiFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtextureView*, const NVNcopyRegion*, - const uint32_t*, int); -typedef void (*nvnCommandBufferUpdateUniformBufferFunction)(NVNcommandBuffer*, NVNbufferAddress, - size_t, ptrdiff_t, size_t, const void*); -typedef void (*nvnCommandBufferReportCounterFunction)(NVNcommandBuffer*, NVNcounterType, - NVNbufferAddress); -typedef void (*nvnCommandBufferResetCounterFunction)(NVNcommandBuffer*, NVNcounterType); -typedef void (*nvnCommandBufferReportValueFunction)(NVNcommandBuffer*, uint32_t, NVNbufferAddress); -typedef void (*nvnCommandBufferSetRenderEnableFunction)(NVNcommandBuffer*, bool); -typedef void (*nvnCommandBufferSetRenderEnableConditionalFunction)(NVNcommandBuffer*, - NVNconditionalRenderMode, - NVNbufferAddress); -typedef void (*nvnCommandBufferSetRenderTargetsFunction)(NVNcommandBuffer*, int, - const NVNtexture* const*, - const NVNtextureView* const*, - const NVNtexture*, const NVNtextureView*); -typedef void (*nvnCommandBufferDiscardColorFunction)(NVNcommandBuffer*, int); -typedef void (*nvnCommandBufferDiscardDepthStencilFunction)(NVNcommandBuffer*); -typedef void (*nvnCommandBufferDownsampleFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtexture*); -typedef void (*nvnCommandBufferTiledDownsampleFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtexture*); -typedef void (*nvnCommandBufferDownsampleTextureViewFunction)(NVNcommandBuffer*, const NVNtexture*, - const NVNtextureView*, - const NVNtexture*, - const NVNtextureView*); -typedef void (*nvnCommandBufferTiledDownsampleTextureViewFunction)(NVNcommandBuffer*, - const NVNtexture*, - const NVNtextureView*, - const NVNtexture*, - const NVNtextureView*); -typedef void (*nvnCommandBufferBarrierFunction)(NVNcommandBuffer*, int); -typedef void (*nvnCommandBufferWaitSyncFunction)(NVNcommandBuffer*, const NVNsync*); -typedef void (*nvnCommandBufferFenceSyncFunction)(NVNcommandBuffer*, NVNsync*, NVNsyncCondition, - int); -typedef void (*nvnCommandBufferSetTexturePoolFunction)(NVNcommandBuffer*, const NVNtexturePool*); -typedef void (*nvnCommandBufferSetSamplerPoolFunction)(NVNcommandBuffer*, const NVNsamplerPool*); -typedef void (*nvnCommandBufferSetShaderScratchMemoryFunction)(NVNcommandBuffer*, - const NVNmemoryPool*, ptrdiff_t, - size_t); -typedef void (*nvnCommandBufferSaveZCullDataFunction)(NVNcommandBuffer*, NVNbufferAddress, size_t); -typedef void (*nvnCommandBufferRestoreZCullDataFunction)(NVNcommandBuffer*, NVNbufferAddress, - size_t); -typedef void (*nvnCommandBufferSetCopyRowStrideFunction)(NVNcommandBuffer*, ptrdiff_t); -typedef void (*nvnCommandBufferSetCopyImageStrideFunction)(NVNcommandBuffer*, ptrdiff_t); -typedef ptrdiff_t (*nvnCommandBufferGetCopyRowStrideFunction)(const NVNcommandBuffer*); -typedef ptrdiff_t (*nvnCommandBufferGetCopyImageStrideFunction)(const NVNcommandBuffer*); -typedef void (*nvnCommandBufferDrawTextureFunction)(NVNcommandBuffer*, NVNtextureHandle, - const NVNdrawTextureRegion*, - const NVNdrawTextureRegion*); -typedef bool (*nvnProgramSetSubroutineLinkageFunction)(NVNprogram*, int, - const NVNsubroutineLinkageMapPtr*); -typedef void (*nvnCommandBufferSetProgramSubroutinesFunction)(NVNcommandBuffer*, NVNprogram*, - NVNshaderStage, const int, const int, - const int*); -typedef void (*nvnCommandBufferBindCoverageModulationTableFunction)(NVNcommandBuffer*, - const float*); -typedef void (*nvnCommandBufferResolveDepthBufferFunction)(NVNcommandBuffer*); -typedef void (*nvnCommandBufferPushDebugGroupStaticFunction)(NVNcommandBuffer*, uint32_t, - const char*); -typedef void (*nvnCommandBufferPushDebugGroupDynamicFunction)(NVNcommandBuffer*, uint32_t, - const char*); -typedef void (*nvnCommandBufferPushDebugGroupFunction)(NVNcommandBuffer*, uint32_t, const char*); -typedef void (*nvnCommandBufferPopDebugGroupFunction)(NVNcommandBuffer*); -typedef void (*nvnCommandBufferPopDebugGroupIdFunction)(NVNcommandBuffer*, uint32_t); -typedef void (*nvnCommandBufferInsertDebugMarkerStaticFunction)(NVNcommandBuffer*, uint32_t, - const char*); -typedef void (*nvnCommandBufferInsertDebugMarkerDynamicFunction)(NVNcommandBuffer*, uint32_t, - const char*); -typedef void (*nvnCommandBufferInsertDebugMarkerFunction)(NVNcommandBuffer*, uint32_t, const char*); -typedef NVNcommandBufferMemoryCallback (*nvnCommandBufferGetMemoryCallbackFunction)( - const NVNcommandBuffer*); -typedef void (*nvnCommandBufferGetMemoryCallbackDataFunction)(const NVNcommandBuffer*); -typedef bool (*nvnCommandBufferIsRecordingFunction)(const NVNcommandBuffer*); -typedef bool (*nvnSyncInitializeFunction)(NVNsync*, NVNdevice*); -typedef void (*nvnSyncFinalizeFunction)(NVNsync*); -typedef void (*nvnSyncSetDebugLabelFunction)(NVNsync*, const char*); -typedef void (*nvnQueueFenceSyncFunction)(NVNqueue*, NVNsync*, NVNsyncCondition, int); -typedef NVNsyncWaitResult (*nvnSyncWaitFunction)(const NVNsync*, uint64_t); -typedef bool (*nvnQueueWaitSyncFunction)(NVNqueue*, const NVNsync*); -typedef void (*nvnEventBuilderSetDefaultsFunction)(NVNeventBuilder*); -typedef void (*nvnEventBuilderSetStorageFunction)(NVNeventBuilder*, const NVNmemoryPool*, int64_t); -typedef bool (*nvnEventInitializeFunction)(NVNevent*, const NVNeventBuilder*); -typedef void (*nvnEventFinalizeFunction)(NVNevent*); -typedef uint32_t (*nvnEventGetValueFunction)(const NVNevent*); -typedef void (*nvnEventSignalFunction)(NVNevent*, NVNeventSignalMode, uint32_t); -typedef void (*nvnCommandBufferWaitEventFunction)(NVNcommandBuffer*, const NVNevent*, - NVNeventWaitMode, uint32_t); -typedef void (*nvnCommandBufferSignalEventFunction)(NVNcommandBuffer*, const NVNevent*, - NVNeventSignalMode, NVNeventSignalLocation, int, - uint32_t); - -// Function pointer definitions -extern nvnDeviceBuilderSetDefaultsFunction pfnc_nvnDeviceBuilderSetDefaults; -extern nvnDeviceBuilderSetFlagsFunction pfnc_nvnDeviceBuilderSetFlags; -extern nvnDeviceInitializeFunction pfnc_nvnDeviceInitialize; -extern nvnDeviceFinalizeFunction pfnc_nvnDeviceFinalize; -extern nvnDeviceSetDebugLabelFunction pfnc_nvnDeviceSetDebugLabel; -extern nvnDeviceGetProcAddressFunction pfnc_nvnDeviceGetProcAddress; -extern nvnDeviceGetIntegerFunction pfnc_nvnDeviceGetInteger; -extern nvnDeviceGetCurrentTimestampInNanosecondsFunction - pfnc_nvnDeviceGetCurrentTimestampInNanoseconds; -extern nvnDeviceSetIntermediateShaderCacheFunction pfnc_nvnDeviceSetIntermediateShaderCache; -extern nvnDeviceGetTextureHandleFunction pfnc_nvnDeviceGetTextureHandle; -extern nvnDeviceGetTexelFetchHandleFunction pfnc_nvnDeviceGetTexelFetchHandle; -extern nvnDeviceGetImageHandleFunction pfnc_nvnDeviceGetImageHandle; -extern nvnDeviceInstallDebugCallbackFunction pfnc_nvnDeviceInstallDebugCallback; -extern nvnDeviceGenerateDebugDomainIdFunction pfnc_nvnDeviceGenerateDebugDomainId; -extern nvnDeviceSetWindowOriginModeFunction pfnc_nvnDeviceSetWindowOriginMode; -extern nvnDeviceSetDepthModeFunction pfnc_nvnDeviceSetDepthMode; -extern nvnDeviceRegisterFastClearColorFunction pfnc_nvnDeviceRegisterFastClearColor; -extern nvnDeviceRegisterFastClearColoriFunction pfnc_nvnDeviceRegisterFastClearColori; -extern nvnDeviceRegisterFastClearColoruiFunction pfnc_nvnDeviceRegisterFastClearColorui; -extern nvnDeviceRegisterFastClearDepthFunction pfnc_nvnDeviceRegisterFastClearDepth; -extern nvnDeviceGetWindowOriginModeFunction pfnc_nvnDeviceGetWindowOriginMode; -extern nvnDeviceGetDepthModeFunction pfnc_nvnDeviceGetDepthMode; -extern nvnDeviceGetTimestampInNanosecondsFunction pfnc_nvnDeviceGetTimestampInNanoseconds; -extern nvnDeviceApplyDeferredFinalizesFunction pfnc_nvnDeviceApplyDeferredFinalizes; -extern nvnDeviceFinalizeCommandHandleFunction pfnc_nvnDeviceFinalizeCommandHandle; -extern nvnDeviceWalkDebugDatabaseFunction pfnc_nvnDeviceWalkDebugDatabase; -extern nvnDeviceGetSeparateTextureHandleFunction pfnc_nvnDeviceGetSeparateTextureHandle; -extern nvnDeviceGetSeparateSamplerHandleFunction pfnc_nvnDeviceGetSeparateSamplerHandle; -extern nvnDeviceIsExternalDebuggerAttachedFunction pfnc_nvnDeviceIsExternalDebuggerAttached; -extern nvnQueueGetErrorFunction pfnc_nvnQueueGetError; -extern nvnQueueGetTotalCommandMemoryUsedFunction pfnc_nvnQueueGetTotalCommandMemoryUsed; -extern nvnQueueGetTotalControlMemoryUsedFunction pfnc_nvnQueueGetTotalControlMemoryUsed; -extern nvnQueueGetTotalComputeMemoryUsedFunction pfnc_nvnQueueGetTotalComputeMemoryUsed; -extern nvnQueueResetMemoryUsageCountsFunction pfnc_nvnQueueResetMemoryUsageCounts; -extern nvnQueueBuilderSetDeviceFunction pfnc_nvnQueueBuilderSetDevice; -extern nvnQueueBuilderSetDefaultsFunction pfnc_nvnQueueBuilderSetDefaults; -extern nvnQueueBuilderSetFlagsFunction pfnc_nvnQueueBuilderSetFlags; -extern nvnQueueBuilderSetCommandMemorySizeFunction pfnc_nvnQueueBuilderSetCommandMemorySize; -extern nvnQueueBuilderSetComputeMemorySizeFunction pfnc_nvnQueueBuilderSetComputeMemorySize; -extern nvnQueueBuilderSetControlMemorySizeFunction pfnc_nvnQueueBuilderSetControlMemorySize; -extern nvnQueueBuilderGetQueueMemorySizeFunction pfnc_nvnQueueBuilderGetQueueMemorySize; -extern nvnQueueBuilderSetQueueMemoryFunction pfnc_nvnQueueBuilderSetQueueMemory; -extern nvnQueueBuilderSetCommandFlushThresholdFunction pfnc_nvnQueueBuilderSetCommandFlushThreshold; -extern nvnQueueInitializeFunction pfnc_nvnQueueInitialize; -extern nvnQueueFinalizeFunction pfnc_nvnQueueFinalize; -extern nvnQueueSetDebugLabelFunction pfnc_nvnQueueSetDebugLabel; -extern nvnQueueSubmitCommandsFunction pfnc_nvnQueueSubmitCommands; -extern nvnQueueFlushFunction pfnc_nvnQueueFlush; -extern nvnQueueFinishFunction pfnc_nvnQueueFinish; -extern nvnQueuePresentTextureFunction pfnc_nvnQueuePresentTexture; -extern nvnQueueAcquireTextureFunction pfnc_nvnQueueAcquireTexture; -extern nvnWindowBuilderSetDeviceFunction pfnc_nvnWindowBuilderSetDevice; -extern nvnWindowBuilderSetDefaultsFunction pfnc_nvnWindowBuilderSetDefaults; -extern nvnWindowBuilderSetNativeWindowFunction pfnc_nvnWindowBuilderSetNativeWindow; -extern nvnWindowBuilderSetTexturesFunction pfnc_nvnWindowBuilderSetTextures; -extern nvnWindowBuilderSetPresentIntervalFunction pfnc_nvnWindowBuilderSetPresentInterval; -extern nvnWindowBuilderGetNativeWindowFunction pfnc_nvnWindowBuilderGetNativeWindow; -extern nvnWindowBuilderGetPresentIntervalFunction pfnc_nvnWindowBuilderGetPresentInterval; -extern nvnWindowInitializeFunction pfnc_nvnWindowInitialize; -extern nvnWindowFinalizeFunction pfnc_nvnWindowFinalize; -extern nvnWindowSetDebugLabelFunction pfnc_nvnWindowSetDebugLabel; -extern nvnWindowAcquireTextureFunction pfnc_nvnWindowAcquireTexture; -extern nvnWindowGetNativeWindowFunction pfnc_nvnWindowGetNativeWindow; -extern nvnWindowGetPresentIntervalFunction pfnc_nvnWindowGetPresentInterval; -extern nvnWindowSetPresentIntervalFunction pfnc_nvnWindowSetPresentInterval; -extern nvnWindowSetCropFunction pfnc_nvnWindowSetCrop; -extern nvnWindowGetCropFunction pfnc_nvnWindowGetCrop; -extern nvnProgramInitializeFunction pfnc_nvnProgramInitialize; -extern nvnProgramFinalizeFunction pfnc_nvnProgramFinalize; -extern nvnProgramSetDebugLabelFunction pfnc_nvnProgramSetDebugLabel; -extern nvnProgramSetShadersFunction pfnc_nvnProgramSetShaders; -extern nvnMemoryPoolBuilderSetDeviceFunction pfnc_nvnMemoryPoolBuilderSetDevice; -extern nvnMemoryPoolBuilderSetDefaultsFunction pfnc_nvnMemoryPoolBuilderSetDefaults; -extern nvnMemoryPoolBuilderSetStorageFunction pfnc_nvnMemoryPoolBuilderSetStorage; -extern nvnMemoryPoolBuilderSetFlagsFunction pfnc_nvnMemoryPoolBuilderSetFlags; -extern nvnMemoryPoolBuilderGetMemoryFunction pfnc_nvnMemoryPoolBuilderGetMemory; -extern nvnMemoryPoolBuilderGetSizeFunction pfnc_nvnMemoryPoolBuilderGetSize; -extern nvnMemoryPoolBuilderGetFlagsFunction pfnc_nvnMemoryPoolBuilderGetFlags; -extern nvnMemoryPoolInitializeFunction pfnc_nvnMemoryPoolInitialize; -extern nvnMemoryPoolSetDebugLabelFunction pfnc_nvnMemoryPoolSetDebugLabel; -extern nvnMemoryPoolFinalizeFunction pfnc_nvnMemoryPoolFinalize; -extern nvnMemoryPoolMapFunction pfnc_nvnMemoryPoolMap; -extern nvnMemoryPoolFlushMappedRangeFunction pfnc_nvnMemoryPoolFlushMappedRange; -extern nvnMemoryPoolInvalidateMappedRangeFunction pfnc_nvnMemoryPoolInvalidateMappedRange; -extern nvnMemoryPoolGetBufferAddressFunction pfnc_nvnMemoryPoolGetBufferAddress; -extern nvnMemoryPoolMapVirtualFunction pfnc_nvnMemoryPoolMapVirtual; -extern nvnMemoryPoolGetSizeFunction pfnc_nvnMemoryPoolGetSize; -extern nvnMemoryPoolGetFlagsFunction pfnc_nvnMemoryPoolGetFlags; -extern nvnTexturePoolInitializeFunction pfnc_nvnTexturePoolInitialize; -extern nvnTexturePoolSetDebugLabelFunction pfnc_nvnTexturePoolSetDebugLabel; -extern nvnTexturePoolFinalizeFunction pfnc_nvnTexturePoolFinalize; -extern nvnTexturePoolRegisterTextureFunction pfnc_nvnTexturePoolRegisterTexture; -extern nvnTexturePoolRegisterImageFunction pfnc_nvnTexturePoolRegisterImage; -extern nvnTexturePoolGetMemoryPoolFunction pfnc_nvnTexturePoolGetMemoryPool; -extern nvnTexturePoolGetMemoryOffsetFunction pfnc_nvnTexturePoolGetMemoryOffset; -extern nvnTexturePoolGetSizeFunction pfnc_nvnTexturePoolGetSize; -extern nvnSamplerPoolInitializeFunction pfnc_nvnSamplerPoolInitialize; -extern nvnSamplerPoolSetDebugLabelFunction pfnc_nvnSamplerPoolSetDebugLabel; -extern nvnSamplerPoolFinalizeFunction pfnc_nvnSamplerPoolFinalize; -extern nvnSamplerPoolRegisterSamplerFunction pfnc_nvnSamplerPoolRegisterSampler; -extern nvnSamplerPoolRegisterSamplerBuilderFunction pfnc_nvnSamplerPoolRegisterSamplerBuilder; -extern nvnSamplerPoolGetMemoryPoolFunction pfnc_nvnSamplerPoolGetMemoryPool; -extern nvnSamplerPoolGetMemoryOffsetFunction pfnc_nvnSamplerPoolGetMemoryOffset; -extern nvnSamplerPoolGetSizeFunction pfnc_nvnSamplerPoolGetSize; -extern nvnBufferBuilderSetDeviceFunction pfnc_nvnBufferBuilderSetDevice; -extern nvnBufferBuilderSetDefaultsFunction pfnc_nvnBufferBuilderSetDefaults; -extern nvnBufferBuilderSetStorageFunction pfnc_nvnBufferBuilderSetStorage; -extern nvnBufferBuilderGetMemoryPoolFunction pfnc_nvnBufferBuilderGetMemoryPool; -extern nvnBufferBuilderGetMemoryOffsetFunction pfnc_nvnBufferBuilderGetMemoryOffset; -extern nvnBufferBuilderGetSizeFunction pfnc_nvnBufferBuilderGetSize; -extern nvnBufferInitializeFunction pfnc_nvnBufferInitialize; -extern nvnBufferSetDebugLabelFunction pfnc_nvnBufferSetDebugLabel; -extern nvnBufferFinalizeFunction pfnc_nvnBufferFinalize; -extern nvnBufferMapFunction pfnc_nvnBufferMap; -extern nvnBufferGetAddressFunction pfnc_nvnBufferGetAddress; -extern nvnBufferFlushMappedRangeFunction pfnc_nvnBufferFlushMappedRange; -extern nvnBufferInvalidateMappedRangeFunction pfnc_nvnBufferInvalidateMappedRange; -extern nvnBufferGetMemoryPoolFunction pfnc_nvnBufferGetMemoryPool; -extern nvnBufferGetMemoryOffsetFunction pfnc_nvnBufferGetMemoryOffset; -extern nvnBufferGetSizeFunction pfnc_nvnBufferGetSize; -extern nvnBufferGetDebugIDFunction pfnc_nvnBufferGetDebugID; -extern nvnTextureBuilderSetDeviceFunction pfnc_nvnTextureBuilderSetDevice; -extern nvnTextureBuilderSetDefaultsFunction pfnc_nvnTextureBuilderSetDefaults; -extern nvnTextureBuilderSetFlagsFunction pfnc_nvnTextureBuilderSetFlags; -extern nvnTextureBuilderSetTargetFunction pfnc_nvnTextureBuilderSetTarget; -extern nvnTextureBuilderSetWidthFunction pfnc_nvnTextureBuilderSetWidth; -extern nvnTextureBuilderSetHeightFunction pfnc_nvnTextureBuilderSetHeight; -extern nvnTextureBuilderSetDepthFunction pfnc_nvnTextureBuilderSetDepth; -extern nvnTextureBuilderSetSize1DFunction pfnc_nvnTextureBuilderSetSize1D; -extern nvnTextureBuilderSetSize2DFunction pfnc_nvnTextureBuilderSetSize2D; -extern nvnTextureBuilderSetSize3DFunction pfnc_nvnTextureBuilderSetSize3D; -extern nvnTextureBuilderSetLevelsFunction pfnc_nvnTextureBuilderSetLevels; -extern nvnTextureBuilderSetFormatFunction pfnc_nvnTextureBuilderSetFormat; -extern nvnTextureBuilderSetSamplesFunction pfnc_nvnTextureBuilderSetSamples; -extern nvnTextureBuilderSetSwizzleFunction pfnc_nvnTextureBuilderSetSwizzle; -extern nvnTextureBuilderSetDepthStencilModeFunction pfnc_nvnTextureBuilderSetDepthStencilMode; -extern nvnTextureBuilderGetStorageSizeFunction pfnc_nvnTextureBuilderGetStorageSize; -extern nvnTextureBuilderGetStorageAlignmentFunction pfnc_nvnTextureBuilderGetStorageAlignment; -extern nvnTextureBuilderSetStorageFunction pfnc_nvnTextureBuilderSetStorage; -extern nvnTextureBuilderSetPackagedTextureDataFunction pfnc_nvnTextureBuilderSetPackagedTextureData; -extern nvnTextureBuilderSetPackagedTextureLayoutFunction - pfnc_nvnTextureBuilderSetPackagedTextureLayout; -extern nvnTextureBuilderSetStrideFunction pfnc_nvnTextureBuilderSetStride; -extern nvnTextureBuilderSetGLTextureNameFunction pfnc_nvnTextureBuilderSetGLTextureName; -extern nvnTextureBuilderGetStorageClassFunction pfnc_nvnTextureBuilderGetStorageClass; -extern nvnTextureBuilderGetFlagsFunction pfnc_nvnTextureBuilderGetFlags; -extern nvnTextureBuilderGetTargetFunction pfnc_nvnTextureBuilderGetTarget; -extern nvnTextureBuilderGetWidthFunction pfnc_nvnTextureBuilderGetWidth; -extern nvnTextureBuilderGetHeightFunction pfnc_nvnTextureBuilderGetHeight; -extern nvnTextureBuilderGetDepthFunction pfnc_nvnTextureBuilderGetDepth; -extern nvnTextureBuilderGetLevelsFunction pfnc_nvnTextureBuilderGetLevels; -extern nvnTextureBuilderGetFormatFunction pfnc_nvnTextureBuilderGetFormat; -extern nvnTextureBuilderGetSamplesFunction pfnc_nvnTextureBuilderGetSamples; -extern nvnTextureBuilderGetSwizzleFunction pfnc_nvnTextureBuilderGetSwizzle; -extern nvnTextureBuilderGetDepthStencilModeFunction pfnc_nvnTextureBuilderGetDepthStencilMode; -extern nvnTextureBuilderGetPackagedTextureDataFunction pfnc_nvnTextureBuilderGetPackagedTextureData; -extern nvnTextureBuilderGetStrideFunction pfnc_nvnTextureBuilderGetStride; -extern nvnTextureBuilderGetSparseTileLayoutFunction pfnc_nvnTextureBuilderGetSparseTileLayout; -extern nvnTextureBuilderGetGLTextureNameFunction pfnc_nvnTextureBuilderGetGLTextureName; -extern nvnTextureBuilderGetZCullStorageSizeFunction pfnc_nvnTextureBuilderGetZCullStorageSize; -extern nvnTextureBuilderGetMemoryPoolFunction pfnc_nvnTextureBuilderGetMemoryPool; -extern nvnTextureBuilderGetMemoryOffsetFunction pfnc_nvnTextureBuilderGetMemoryOffset; -extern nvnTextureViewSetDefaultsFunction pfnc_nvnTextureViewSetDefaults; -extern nvnTextureViewSetLevelsFunction pfnc_nvnTextureViewSetLevels; -extern nvnTextureViewSetLayersFunction pfnc_nvnTextureViewSetLayers; -extern nvnTextureViewSetFormatFunction pfnc_nvnTextureViewSetFormat; -extern nvnTextureViewSetSwizzleFunction pfnc_nvnTextureViewSetSwizzle; -extern nvnTextureViewSetDepthStencilModeFunction pfnc_nvnTextureViewSetDepthStencilMode; -extern nvnTextureViewSetTargetFunction pfnc_nvnTextureViewSetTarget; -extern nvnTextureViewGetLevelsFunction pfnc_nvnTextureViewGetLevels; -extern nvnTextureViewGetLayersFunction pfnc_nvnTextureViewGetLayers; -extern nvnTextureViewGetFormatFunction pfnc_nvnTextureViewGetFormat; -extern nvnTextureViewGetSwizzleFunction pfnc_nvnTextureViewGetSwizzle; -extern nvnTextureViewGetDepthStencilModeFunction pfnc_nvnTextureViewGetDepthStencilMode; -extern nvnTextureViewGetTargetFunction pfnc_nvnTextureViewGetTarget; -extern nvnTextureViewCompareFunction pfnc_nvnTextureViewCompare; -extern nvnTextureInitializeFunction pfnc_nvnTextureInitialize; -extern nvnTextureGetZCullStorageSizeFunction pfnc_nvnTextureGetZCullStorageSize; -extern nvnTextureFinalizeFunction pfnc_nvnTextureFinalize; -extern nvnTextureSetDebugLabelFunction pfnc_nvnTextureSetDebugLabel; -extern nvnTextureGetStorageClassFunction pfnc_nvnTextureGetStorageClass; -extern nvnTextureGetViewOffsetFunction pfnc_nvnTextureGetViewOffset; -extern nvnTextureGetFlagsFunction pfnc_nvnTextureGetFlags; -extern nvnTextureGetTargetFunction pfnc_nvnTextureGetTarget; -extern nvnTextureGetWidthFunction pfnc_nvnTextureGetWidth; -extern nvnTextureGetHeightFunction pfnc_nvnTextureGetHeight; -extern nvnTextureGetDepthFunction pfnc_nvnTextureGetDepth; -extern nvnTextureGetLevelsFunction pfnc_nvnTextureGetLevels; -extern nvnTextureGetFormatFunction pfnc_nvnTextureGetFormat; -extern nvnTextureGetSamplesFunction pfnc_nvnTextureGetSamples; -extern nvnTextureGetSwizzleFunction pfnc_nvnTextureGetSwizzle; -extern nvnTextureGetDepthStencilModeFunction pfnc_nvnTextureGetDepthStencilMode; -extern nvnTextureGetStrideFunction pfnc_nvnTextureGetStride; -extern nvnTextureGetTextureAddressFunction pfnc_nvnTextureGetTextureAddress; -extern nvnTextureGetSparseTileLayoutFunction pfnc_nvnTextureGetSparseTileLayout; -extern nvnTextureWriteTexelsFunction pfnc_nvnTextureWriteTexels; -extern nvnTextureWriteTexelsStridedFunction pfnc_nvnTextureWriteTexelsStrided; -extern nvnTextureReadTexelsFunction pfnc_nvnTextureReadTexels; -extern nvnTextureReadTexelsStridedFunction pfnc_nvnTextureReadTexelsStrided; -extern nvnTextureFlushTexelsFunction pfnc_nvnTextureFlushTexels; -extern nvnTextureInvalidateTexelsFunction pfnc_nvnTextureInvalidateTexels; -extern nvnTextureGetMemoryPoolFunction pfnc_nvnTextureGetMemoryPool; -extern nvnTextureGetMemoryOffsetFunction pfnc_nvnTextureGetMemoryOffset; -extern nvnTextureGetStorageSizeFunction pfnc_nvnTextureGetStorageSize; -extern nvnTextureCompareFunction pfnc_nvnTextureCompare; -extern nvnTextureGetDebugIDFunction pfnc_nvnTextureGetDebugID; -extern nvnSamplerBuilderSetDeviceFunction pfnc_nvnSamplerBuilderSetDevice; -extern nvnSamplerBuilderSetDefaultsFunction pfnc_nvnSamplerBuilderSetDefaults; -extern nvnSamplerBuilderSetMinMagFilterFunction pfnc_nvnSamplerBuilderSetMinMagFilter; -extern nvnSamplerBuilderSetWrapModeFunction pfnc_nvnSamplerBuilderSetWrapMode; -extern nvnSamplerBuilderSetLodClampFunction pfnc_nvnSamplerBuilderSetLodClamp; -extern nvnSamplerBuilderSetLodBiasFunction pfnc_nvnSamplerBuilderSetLodBias; -extern nvnSamplerBuilderSetCompareFunction pfnc_nvnSamplerBuilderSetCompare; -extern nvnSamplerBuilderSetBorderColorFunction pfnc_nvnSamplerBuilderSetBorderColor; -extern nvnSamplerBuilderSetBorderColoriFunction pfnc_nvnSamplerBuilderSetBorderColori; -extern nvnSamplerBuilderSetBorderColoruiFunction pfnc_nvnSamplerBuilderSetBorderColorui; -extern nvnSamplerBuilderSetMaxAnisotropyFunction pfnc_nvnSamplerBuilderSetMaxAnisotropy; -extern nvnSamplerBuilderSetReductionFilterFunction pfnc_nvnSamplerBuilderSetReductionFilter; -extern nvnSamplerBuilderSetLodSnapFunction pfnc_nvnSamplerBuilderSetLodSnap; -extern nvnSamplerBuilderGetMinMagFilterFunction pfnc_nvnSamplerBuilderGetMinMagFilter; -extern nvnSamplerBuilderGetWrapModeFunction pfnc_nvnSamplerBuilderGetWrapMode; -extern nvnSamplerBuilderGetLodClampFunction pfnc_nvnSamplerBuilderGetLodClamp; -extern nvnSamplerBuilderGetLodBiasFunction pfnc_nvnSamplerBuilderGetLodBias; -extern nvnSamplerBuilderGetCompareFunction pfnc_nvnSamplerBuilderGetCompare; -extern nvnSamplerBuilderGetBorderColorFunction pfnc_nvnSamplerBuilderGetBorderColor; -extern nvnSamplerBuilderGetBorderColoriFunction pfnc_nvnSamplerBuilderGetBorderColori; -extern nvnSamplerBuilderGetBorderColoruiFunction pfnc_nvnSamplerBuilderGetBorderColorui; -extern nvnSamplerBuilderGetMaxAnisotropyFunction pfnc_nvnSamplerBuilderGetMaxAnisotropy; -extern nvnSamplerBuilderGetReductionFilterFunction pfnc_nvnSamplerBuilderGetReductionFilter; -extern nvnSamplerBuilderGetLodSnapFunction pfnc_nvnSamplerBuilderGetLodSnap; -extern nvnSamplerInitializeFunction pfnc_nvnSamplerInitialize; -extern nvnSamplerFinalizeFunction pfnc_nvnSamplerFinalize; -extern nvnSamplerSetDebugLabelFunction pfnc_nvnSamplerSetDebugLabel; -extern nvnSamplerGetMinMagFilterFunction pfnc_nvnSamplerGetMinMagFilter; -extern nvnSamplerGetWrapModeFunction pfnc_nvnSamplerGetWrapMode; -extern nvnSamplerGetLodClampFunction pfnc_nvnSamplerGetLodClamp; -extern nvnSamplerGetLodBiasFunction pfnc_nvnSamplerGetLodBias; -extern nvnSamplerGetCompareFunction pfnc_nvnSamplerGetCompare; -extern nvnSamplerGetBorderColorFunction pfnc_nvnSamplerGetBorderColor; -extern nvnSamplerGetBorderColoriFunction pfnc_nvnSamplerGetBorderColori; -extern nvnSamplerGetBorderColoruiFunction pfnc_nvnSamplerGetBorderColorui; -extern nvnSamplerGetMaxAnisotropyFunction pfnc_nvnSamplerGetMaxAnisotropy; -extern nvnSamplerGetReductionFilterFunction pfnc_nvnSamplerGetReductionFilter; -extern nvnSamplerCompareFunction pfnc_nvnSamplerCompare; -extern nvnSamplerGetDebugIDFunction pfnc_nvnSamplerGetDebugID; -extern nvnBlendStateSetDefaultsFunction pfnc_nvnBlendStateSetDefaults; -extern nvnBlendStateSetBlendTargetFunction pfnc_nvnBlendStateSetBlendTarget; -extern nvnBlendStateSetBlendFuncFunction pfnc_nvnBlendStateSetBlendFunc; -extern nvnBlendStateSetBlendEquationFunction pfnc_nvnBlendStateSetBlendEquation; -extern nvnBlendStateSetAdvancedModeFunction pfnc_nvnBlendStateSetAdvancedMode; -extern nvnBlendStateSetAdvancedOverlapFunction pfnc_nvnBlendStateSetAdvancedOverlap; -extern nvnBlendStateSetAdvancedPremultipliedSrcFunction - pfnc_nvnBlendStateSetAdvancedPremultipliedSrc; -extern nvnBlendStateSetAdvancedNormalizedDstFunction pfnc_nvnBlendStateSetAdvancedNormalizedDst; -extern nvnBlendStateGetBlendTargetFunction pfnc_nvnBlendStateGetBlendTarget; -extern nvnBlendStateGetBlendFuncFunction pfnc_nvnBlendStateGetBlendFunc; -extern nvnBlendStateGetBlendEquationFunction pfnc_nvnBlendStateGetBlendEquation; -extern nvnBlendStateGetAdvancedModeFunction pfnc_nvnBlendStateGetAdvancedMode; -extern nvnBlendStateGetAdvancedOverlapFunction pfnc_nvnBlendStateGetAdvancedOverlap; -extern nvnBlendStateGetAdvancedPremultipliedSrcFunction - pfnc_nvnBlendStateGetAdvancedPremultipliedSrc; -extern nvnBlendStateGetAdvancedNormalizedDstFunction pfnc_nvnBlendStateGetAdvancedNormalizedDst; -extern nvnColorStateSetDefaultsFunction pfnc_nvnColorStateSetDefaults; -extern nvnColorStateSetBlendEnableFunction pfnc_nvnColorStateSetBlendEnable; -extern nvnColorStateSetLogicOpFunction pfnc_nvnColorStateSetLogicOp; -extern nvnColorStateSetAlphaTestFunction pfnc_nvnColorStateSetAlphaTest; -extern nvnColorStateGetBlendEnableFunction pfnc_nvnColorStateGetBlendEnable; -extern nvnColorStateGetLogicOpFunction pfnc_nvnColorStateGetLogicOp; -extern nvnColorStateGetAlphaTestFunction pfnc_nvnColorStateGetAlphaTest; -extern nvnChannelMaskStateSetDefaultsFunction pfnc_nvnChannelMaskStateSetDefaults; -extern nvnChannelMaskStateSetChannelMaskFunction pfnc_nvnChannelMaskStateSetChannelMask; -extern nvnChannelMaskStateGetChannelMaskFunction pfnc_nvnChannelMaskStateGetChannelMask; -extern nvnMultisampleStateSetDefaultsFunction pfnc_nvnMultisampleStateSetDefaults; -extern nvnMultisampleStateSetMultisampleEnableFunction pfnc_nvnMultisampleStateSetMultisampleEnable; -extern nvnMultisampleStateSetSamplesFunction pfnc_nvnMultisampleStateSetSamples; -extern nvnMultisampleStateSetAlphaToCoverageEnableFunction - pfnc_nvnMultisampleStateSetAlphaToCoverageEnable; -extern nvnMultisampleStateSetAlphaToCoverageDitherFunction - pfnc_nvnMultisampleStateSetAlphaToCoverageDither; -extern nvnMultisampleStateGetMultisampleEnableFunction pfnc_nvnMultisampleStateGetMultisampleEnable; -extern nvnMultisampleStateGetSamplesFunction pfnc_nvnMultisampleStateGetSamples; -extern nvnMultisampleStateGetAlphaToCoverageEnableFunction - pfnc_nvnMultisampleStateGetAlphaToCoverageEnable; -extern nvnMultisampleStateGetAlphaToCoverageDitherFunction - pfnc_nvnMultisampleStateGetAlphaToCoverageDither; -extern nvnMultisampleStateSetRasterSamplesFunction pfnc_nvnMultisampleStateSetRasterSamples; -extern nvnMultisampleStateGetRasterSamplesFunction pfnc_nvnMultisampleStateGetRasterSamples; -extern nvnMultisampleStateSetCoverageModulationModeFunction - pfnc_nvnMultisampleStateSetCoverageModulationMode; -extern nvnMultisampleStateGetCoverageModulationModeFunction - pfnc_nvnMultisampleStateGetCoverageModulationMode; -extern nvnMultisampleStateSetCoverageToColorEnableFunction - pfnc_nvnMultisampleStateSetCoverageToColorEnable; -extern nvnMultisampleStateGetCoverageToColorEnableFunction - pfnc_nvnMultisampleStateGetCoverageToColorEnable; -extern nvnMultisampleStateSetCoverageToColorOutputFunction - pfnc_nvnMultisampleStateSetCoverageToColorOutput; -extern nvnMultisampleStateGetCoverageToColorOutputFunction - pfnc_nvnMultisampleStateGetCoverageToColorOutput; -extern nvnMultisampleStateSetSampleLocationsEnableFunction - pfnc_nvnMultisampleStateSetSampleLocationsEnable; -extern nvnMultisampleStateGetSampleLocationsEnableFunction - pfnc_nvnMultisampleStateGetSampleLocationsEnable; -extern nvnMultisampleStateGetSampleLocationsGridFunction - pfnc_nvnMultisampleStateGetSampleLocationsGrid; -extern nvnMultisampleStateSetSampleLocationsGridEnableFunction - pfnc_nvnMultisampleStateSetSampleLocationsGridEnable; -extern nvnMultisampleStateGetSampleLocationsGridEnableFunction - pfnc_nvnMultisampleStateGetSampleLocationsGridEnable; -extern nvnMultisampleStateSetSampleLocationsFunction pfnc_nvnMultisampleStateSetSampleLocations; -extern nvnPolygonStateSetDefaultsFunction pfnc_nvnPolygonStateSetDefaults; -extern nvnPolygonStateSetCullFaceFunction pfnc_nvnPolygonStateSetCullFace; -extern nvnPolygonStateSetFrontFaceFunction pfnc_nvnPolygonStateSetFrontFace; -extern nvnPolygonStateSetPolygonModeFunction pfnc_nvnPolygonStateSetPolygonMode; -extern nvnPolygonStateSetPolygonOffsetEnablesFunction pfnc_nvnPolygonStateSetPolygonOffsetEnables; -extern nvnPolygonStateGetCullFaceFunction pfnc_nvnPolygonStateGetCullFace; -extern nvnPolygonStateGetFrontFaceFunction pfnc_nvnPolygonStateGetFrontFace; -extern nvnPolygonStateGetPolygonModeFunction pfnc_nvnPolygonStateGetPolygonMode; -extern nvnPolygonStateGetPolygonOffsetEnablesFunction pfnc_nvnPolygonStateGetPolygonOffsetEnables; -extern nvnDepthStencilStateSetDefaultsFunction pfnc_nvnDepthStencilStateSetDefaults; -extern nvnDepthStencilStateSetDepthTestEnableFunction pfnc_nvnDepthStencilStateSetDepthTestEnable; -extern nvnDepthStencilStateSetDepthWriteEnableFunction pfnc_nvnDepthStencilStateSetDepthWriteEnable; -extern nvnDepthStencilStateSetDepthFuncFunction pfnc_nvnDepthStencilStateSetDepthFunc; -extern nvnDepthStencilStateSetStencilTestEnableFunction - pfnc_nvnDepthStencilStateSetStencilTestEnable; -extern nvnDepthStencilStateSetStencilFuncFunction pfnc_nvnDepthStencilStateSetStencilFunc; -extern nvnDepthStencilStateSetStencilOpFunction pfnc_nvnDepthStencilStateSetStencilOp; -extern nvnDepthStencilStateGetDepthTestEnableFunction pfnc_nvnDepthStencilStateGetDepthTestEnable; -extern nvnDepthStencilStateGetDepthWriteEnableFunction pfnc_nvnDepthStencilStateGetDepthWriteEnable; -extern nvnDepthStencilStateGetDepthFuncFunction pfnc_nvnDepthStencilStateGetDepthFunc; -extern nvnDepthStencilStateGetStencilTestEnableFunction - pfnc_nvnDepthStencilStateGetStencilTestEnable; -extern nvnDepthStencilStateGetStencilFuncFunction pfnc_nvnDepthStencilStateGetStencilFunc; -extern nvnDepthStencilStateGetStencilOpFunction pfnc_nvnDepthStencilStateGetStencilOp; -extern nvnVertexAttribStateSetDefaultsFunction pfnc_nvnVertexAttribStateSetDefaults; -extern nvnVertexAttribStateSetFormatFunction pfnc_nvnVertexAttribStateSetFormat; -extern nvnVertexAttribStateSetStreamIndexFunction pfnc_nvnVertexAttribStateSetStreamIndex; -extern nvnVertexAttribStateGetFormatFunction pfnc_nvnVertexAttribStateGetFormat; -extern nvnVertexAttribStateGetStreamIndexFunction pfnc_nvnVertexAttribStateGetStreamIndex; -extern nvnVertexStreamStateSetDefaultsFunction pfnc_nvnVertexStreamStateSetDefaults; -extern nvnVertexStreamStateSetStrideFunction pfnc_nvnVertexStreamStateSetStride; -extern nvnVertexStreamStateSetDivisorFunction pfnc_nvnVertexStreamStateSetDivisor; -extern nvnVertexStreamStateGetStrideFunction pfnc_nvnVertexStreamStateGetStride; -extern nvnVertexStreamStateGetDivisorFunction pfnc_nvnVertexStreamStateGetDivisor; -extern nvnCommandBufferInitializeFunction pfnc_nvnCommandBufferInitialize; -extern nvnCommandBufferFinalizeFunction pfnc_nvnCommandBufferFinalize; -extern nvnCommandBufferSetDebugLabelFunction pfnc_nvnCommandBufferSetDebugLabel; -extern nvnCommandBufferSetMemoryCallbackFunction pfnc_nvnCommandBufferSetMemoryCallback; -extern nvnCommandBufferSetMemoryCallbackDataFunction pfnc_nvnCommandBufferSetMemoryCallbackData; -extern nvnCommandBufferAddCommandMemoryFunction pfnc_nvnCommandBufferAddCommandMemory; -extern nvnCommandBufferAddControlMemoryFunction pfnc_nvnCommandBufferAddControlMemory; -extern nvnCommandBufferGetCommandMemorySizeFunction pfnc_nvnCommandBufferGetCommandMemorySize; -extern nvnCommandBufferGetCommandMemoryUsedFunction pfnc_nvnCommandBufferGetCommandMemoryUsed; -extern nvnCommandBufferGetCommandMemoryFreeFunction pfnc_nvnCommandBufferGetCommandMemoryFree; -extern nvnCommandBufferGetControlMemorySizeFunction pfnc_nvnCommandBufferGetControlMemorySize; -extern nvnCommandBufferGetControlMemoryUsedFunction pfnc_nvnCommandBufferGetControlMemoryUsed; -extern nvnCommandBufferGetControlMemoryFreeFunction pfnc_nvnCommandBufferGetControlMemoryFree; -extern nvnCommandBufferBeginRecordingFunction pfnc_nvnCommandBufferBeginRecording; -extern nvnCommandBufferEndRecordingFunction pfnc_nvnCommandBufferEndRecording; -extern nvnCommandBufferCallCommandsFunction pfnc_nvnCommandBufferCallCommands; -extern nvnCommandBufferCopyCommandsFunction pfnc_nvnCommandBufferCopyCommands; -extern nvnCommandBufferBindBlendStateFunction pfnc_nvnCommandBufferBindBlendState; -extern nvnCommandBufferBindChannelMaskStateFunction pfnc_nvnCommandBufferBindChannelMaskState; -extern nvnCommandBufferBindColorStateFunction pfnc_nvnCommandBufferBindColorState; -extern nvnCommandBufferBindMultisampleStateFunction pfnc_nvnCommandBufferBindMultisampleState; -extern nvnCommandBufferBindPolygonStateFunction pfnc_nvnCommandBufferBindPolygonState; -extern nvnCommandBufferBindDepthStencilStateFunction pfnc_nvnCommandBufferBindDepthStencilState; -extern nvnCommandBufferBindVertexAttribStateFunction pfnc_nvnCommandBufferBindVertexAttribState; -extern nvnCommandBufferBindVertexStreamStateFunction pfnc_nvnCommandBufferBindVertexStreamState; -extern nvnCommandBufferBindProgramFunction pfnc_nvnCommandBufferBindProgram; -extern nvnCommandBufferBindVertexBufferFunction pfnc_nvnCommandBufferBindVertexBuffer; -extern nvnCommandBufferBindVertexBuffersFunction pfnc_nvnCommandBufferBindVertexBuffers; -extern nvnCommandBufferBindUniformBufferFunction pfnc_nvnCommandBufferBindUniformBuffer; -extern nvnCommandBufferBindUniformBuffersFunction pfnc_nvnCommandBufferBindUniformBuffers; -extern nvnCommandBufferBindTransformFeedbackBufferFunction - pfnc_nvnCommandBufferBindTransformFeedbackBuffer; -extern nvnCommandBufferBindTransformFeedbackBuffersFunction - pfnc_nvnCommandBufferBindTransformFeedbackBuffers; -extern nvnCommandBufferBindStorageBufferFunction pfnc_nvnCommandBufferBindStorageBuffer; -extern nvnCommandBufferBindStorageBuffersFunction pfnc_nvnCommandBufferBindStorageBuffers; -extern nvnCommandBufferBindTextureFunction pfnc_nvnCommandBufferBindTexture; -extern nvnCommandBufferBindTexturesFunction pfnc_nvnCommandBufferBindTextures; -extern nvnCommandBufferBindImageFunction pfnc_nvnCommandBufferBindImage; -extern nvnCommandBufferBindImagesFunction pfnc_nvnCommandBufferBindImages; -extern nvnCommandBufferSetPatchSizeFunction pfnc_nvnCommandBufferSetPatchSize; -extern nvnCommandBufferSetInnerTessellationLevelsFunction - pfnc_nvnCommandBufferSetInnerTessellationLevels; -extern nvnCommandBufferSetOuterTessellationLevelsFunction - pfnc_nvnCommandBufferSetOuterTessellationLevels; -extern nvnCommandBufferSetPrimitiveRestartFunction pfnc_nvnCommandBufferSetPrimitiveRestart; -extern nvnCommandBufferBeginTransformFeedbackFunction pfnc_nvnCommandBufferBeginTransformFeedback; -extern nvnCommandBufferEndTransformFeedbackFunction pfnc_nvnCommandBufferEndTransformFeedback; -extern nvnCommandBufferPauseTransformFeedbackFunction pfnc_nvnCommandBufferPauseTransformFeedback; -extern nvnCommandBufferResumeTransformFeedbackFunction pfnc_nvnCommandBufferResumeTransformFeedback; -extern nvnCommandBufferDrawTransformFeedbackFunction pfnc_nvnCommandBufferDrawTransformFeedback; -extern nvnCommandBufferDrawArraysFunction pfnc_nvnCommandBufferDrawArrays; -extern nvnCommandBufferDrawElementsFunction pfnc_nvnCommandBufferDrawElements; -extern nvnCommandBufferDrawElementsBaseVertexFunction pfnc_nvnCommandBufferDrawElementsBaseVertex; -extern nvnCommandBufferDrawArraysInstancedFunction pfnc_nvnCommandBufferDrawArraysInstanced; -extern nvnCommandBufferDrawElementsInstancedFunction pfnc_nvnCommandBufferDrawElementsInstanced; -extern nvnCommandBufferDrawArraysIndirectFunction pfnc_nvnCommandBufferDrawArraysIndirect; -extern nvnCommandBufferDrawElementsIndirectFunction pfnc_nvnCommandBufferDrawElementsIndirect; -extern nvnCommandBufferMultiDrawArraysIndirectCountFunction - pfnc_nvnCommandBufferMultiDrawArraysIndirectCount; -extern nvnCommandBufferMultiDrawElementsIndirectCountFunction - pfnc_nvnCommandBufferMultiDrawElementsIndirectCount; -extern nvnCommandBufferClearColorFunction pfnc_nvnCommandBufferClearColor; -extern nvnCommandBufferClearColoriFunction pfnc_nvnCommandBufferClearColori; -extern nvnCommandBufferClearColoruiFunction pfnc_nvnCommandBufferClearColorui; -extern nvnCommandBufferClearDepthStencilFunction pfnc_nvnCommandBufferClearDepthStencil; -extern nvnCommandBufferDispatchComputeFunction pfnc_nvnCommandBufferDispatchCompute; -extern nvnCommandBufferDispatchComputeIndirectFunction pfnc_nvnCommandBufferDispatchComputeIndirect; -extern nvnCommandBufferSetViewportFunction pfnc_nvnCommandBufferSetViewport; -extern nvnCommandBufferSetViewportsFunction pfnc_nvnCommandBufferSetViewports; -extern nvnCommandBufferSetViewportSwizzlesFunction pfnc_nvnCommandBufferSetViewportSwizzles; -extern nvnCommandBufferSetScissorFunction pfnc_nvnCommandBufferSetScissor; -extern nvnCommandBufferSetScissorsFunction pfnc_nvnCommandBufferSetScissors; -extern nvnCommandBufferSetDepthRangeFunction pfnc_nvnCommandBufferSetDepthRange; -extern nvnCommandBufferSetDepthBoundsFunction pfnc_nvnCommandBufferSetDepthBounds; -extern nvnCommandBufferSetDepthRangesFunction pfnc_nvnCommandBufferSetDepthRanges; -extern nvnCommandBufferSetTiledCacheActionFunction pfnc_nvnCommandBufferSetTiledCacheAction; -extern nvnCommandBufferSetTiledCacheTileSizeFunction pfnc_nvnCommandBufferSetTiledCacheTileSize; -extern nvnCommandBufferBindSeparateTextureFunction pfnc_nvnCommandBufferBindSeparateTexture; -extern nvnCommandBufferBindSeparateSamplerFunction pfnc_nvnCommandBufferBindSeparateSampler; -extern nvnCommandBufferBindSeparateTexturesFunction pfnc_nvnCommandBufferBindSeparateTextures; -extern nvnCommandBufferBindSeparateSamplersFunction pfnc_nvnCommandBufferBindSeparateSamplers; -extern nvnCommandBufferSetStencilValueMaskFunction pfnc_nvnCommandBufferSetStencilValueMask; -extern nvnCommandBufferSetStencilMaskFunction pfnc_nvnCommandBufferSetStencilMask; -extern nvnCommandBufferSetStencilRefFunction pfnc_nvnCommandBufferSetStencilRef; -extern nvnCommandBufferSetBlendColorFunction pfnc_nvnCommandBufferSetBlendColor; -extern nvnCommandBufferSetPointSizeFunction pfnc_nvnCommandBufferSetPointSize; -extern nvnCommandBufferSetLineWidthFunction pfnc_nvnCommandBufferSetLineWidth; -extern nvnCommandBufferSetPolygonOffsetClampFunction pfnc_nvnCommandBufferSetPolygonOffsetClamp; -extern nvnCommandBufferSetAlphaRefFunction pfnc_nvnCommandBufferSetAlphaRef; -extern nvnCommandBufferSetSampleMaskFunction pfnc_nvnCommandBufferSetSampleMask; -extern nvnCommandBufferSetRasterizerDiscardFunction pfnc_nvnCommandBufferSetRasterizerDiscard; -extern nvnCommandBufferSetDepthClampFunction pfnc_nvnCommandBufferSetDepthClamp; -extern nvnCommandBufferSetConservativeRasterEnableFunction - pfnc_nvnCommandBufferSetConservativeRasterEnable; -extern nvnCommandBufferSetConservativeRasterDilateFunction - pfnc_nvnCommandBufferSetConservativeRasterDilate; -extern nvnCommandBufferSetSubpixelPrecisionBiasFunction - pfnc_nvnCommandBufferSetSubpixelPrecisionBias; -extern nvnCommandBufferCopyBufferToTextureFunction pfnc_nvnCommandBufferCopyBufferToTexture; -extern nvnCommandBufferCopyTextureToBufferFunction pfnc_nvnCommandBufferCopyTextureToBuffer; -extern nvnCommandBufferCopyTextureToTextureFunction pfnc_nvnCommandBufferCopyTextureToTexture; -extern nvnCommandBufferCopyBufferToBufferFunction pfnc_nvnCommandBufferCopyBufferToBuffer; -extern nvnCommandBufferClearBufferFunction pfnc_nvnCommandBufferClearBuffer; -extern nvnCommandBufferClearTextureFunction pfnc_nvnCommandBufferClearTexture; -extern nvnCommandBufferClearTextureiFunction pfnc_nvnCommandBufferClearTexturei; -extern nvnCommandBufferClearTextureuiFunction pfnc_nvnCommandBufferClearTextureui; -extern nvnCommandBufferUpdateUniformBufferFunction pfnc_nvnCommandBufferUpdateUniformBuffer; -extern nvnCommandBufferReportCounterFunction pfnc_nvnCommandBufferReportCounter; -extern nvnCommandBufferResetCounterFunction pfnc_nvnCommandBufferResetCounter; -extern nvnCommandBufferReportValueFunction pfnc_nvnCommandBufferReportValue; -extern nvnCommandBufferSetRenderEnableFunction pfnc_nvnCommandBufferSetRenderEnable; -extern nvnCommandBufferSetRenderEnableConditionalFunction - pfnc_nvnCommandBufferSetRenderEnableConditional; -extern nvnCommandBufferSetRenderTargetsFunction pfnc_nvnCommandBufferSetRenderTargets; -extern nvnCommandBufferDiscardColorFunction pfnc_nvnCommandBufferDiscardColor; -extern nvnCommandBufferDiscardDepthStencilFunction pfnc_nvnCommandBufferDiscardDepthStencil; -extern nvnCommandBufferDownsampleFunction pfnc_nvnCommandBufferDownsample; -extern nvnCommandBufferTiledDownsampleFunction pfnc_nvnCommandBufferTiledDownsample; -extern nvnCommandBufferDownsampleTextureViewFunction pfnc_nvnCommandBufferDownsampleTextureView; -extern nvnCommandBufferTiledDownsampleTextureViewFunction - pfnc_nvnCommandBufferTiledDownsampleTextureView; -extern nvnCommandBufferBarrierFunction pfnc_nvnCommandBufferBarrier; -extern nvnCommandBufferWaitSyncFunction pfnc_nvnCommandBufferWaitSync; -extern nvnCommandBufferFenceSyncFunction pfnc_nvnCommandBufferFenceSync; -extern nvnCommandBufferSetTexturePoolFunction pfnc_nvnCommandBufferSetTexturePool; -extern nvnCommandBufferSetSamplerPoolFunction pfnc_nvnCommandBufferSetSamplerPool; -extern nvnCommandBufferSetShaderScratchMemoryFunction pfnc_nvnCommandBufferSetShaderScratchMemory; -extern nvnCommandBufferSaveZCullDataFunction pfnc_nvnCommandBufferSaveZCullData; -extern nvnCommandBufferRestoreZCullDataFunction pfnc_nvnCommandBufferRestoreZCullData; -extern nvnCommandBufferSetCopyRowStrideFunction pfnc_nvnCommandBufferSetCopyRowStride; -extern nvnCommandBufferSetCopyImageStrideFunction pfnc_nvnCommandBufferSetCopyImageStride; -extern nvnCommandBufferGetCopyRowStrideFunction pfnc_nvnCommandBufferGetCopyRowStride; -extern nvnCommandBufferGetCopyImageStrideFunction pfnc_nvnCommandBufferGetCopyImageStride; -extern nvnCommandBufferDrawTextureFunction pfnc_nvnCommandBufferDrawTexture; -extern nvnProgramSetSubroutineLinkageFunction pfnc_nvnProgramSetSubroutineLinkage; -extern nvnCommandBufferSetProgramSubroutinesFunction pfnc_nvnCommandBufferSetProgramSubroutines; -extern nvnCommandBufferBindCoverageModulationTableFunction - pfnc_nvnCommandBufferBindCoverageModulationTable; -extern nvnCommandBufferResolveDepthBufferFunction pfnc_nvnCommandBufferResolveDepthBuffer; -extern nvnCommandBufferPushDebugGroupStaticFunction pfnc_nvnCommandBufferPushDebugGroupStatic; -extern nvnCommandBufferPushDebugGroupDynamicFunction pfnc_nvnCommandBufferPushDebugGroupDynamic; -extern nvnCommandBufferPushDebugGroupFunction pfnc_nvnCommandBufferPushDebugGroup; -extern nvnCommandBufferPopDebugGroupFunction pfnc_nvnCommandBufferPopDebugGroup; -extern nvnCommandBufferPopDebugGroupIdFunction pfnc_nvnCommandBufferPopDebugGroupId; -extern nvnCommandBufferInsertDebugMarkerStaticFunction pfnc_nvnCommandBufferInsertDebugMarkerStatic; -extern nvnCommandBufferInsertDebugMarkerDynamicFunction - pfnc_nvnCommandBufferInsertDebugMarkerDynamic; -extern nvnCommandBufferInsertDebugMarkerFunction pfnc_nvnCommandBufferInsertDebugMarker; -extern nvnCommandBufferGetMemoryCallbackFunction pfnc_nvnCommandBufferGetMemoryCallback; -extern nvnCommandBufferGetMemoryCallbackDataFunction pfnc_nvnCommandBufferGetMemoryCallbackData; -extern nvnCommandBufferIsRecordingFunction pfnc_nvnCommandBufferIsRecording; -extern nvnSyncInitializeFunction pfnc_nvnSyncInitialize; -extern nvnSyncFinalizeFunction pfnc_nvnSyncFinalize; -extern nvnSyncSetDebugLabelFunction pfnc_nvnSyncSetDebugLabel; -extern nvnQueueFenceSyncFunction pfnc_nvnQueueFenceSync; -extern nvnSyncWaitFunction pfnc_nvnSyncWait; -extern nvnQueueWaitSyncFunction pfnc_nvnQueueWaitSync; -extern nvnEventBuilderSetDefaultsFunction pfnc_nvnEventBuilderSetDefaults; -extern nvnEventBuilderSetStorageFunction pfnc_nvnEventBuilderSetStorage; -extern nvnEventInitializeFunction pfnc_nvnEventInitialize; -extern nvnEventFinalizeFunction pfnc_nvnEventFinalize; -extern nvnEventGetValueFunction pfnc_nvnEventGetValue; -extern nvnEventSignalFunction pfnc_nvnEventSignal; -extern nvnCommandBufferWaitEventFunction pfnc_nvnCommandBufferWaitEvent; -extern nvnCommandBufferSignalEventFunction pfnc_nvnCommandBufferSignalEvent; - -// Function mappings -#define nvnDeviceBuilderSetDefaults pfnc_nvnDeviceBuilderSetDefaults -#define nvnDeviceBuilderSetFlags pfnc_nvnDeviceBuilderSetFlags -#define nvnDeviceInitialize pfnc_nvnDeviceInitialize -#define nvnDeviceFinalize pfnc_nvnDeviceFinalize -#define nvnDeviceSetDebugLabel pfnc_nvnDeviceSetDebugLabel -#define nvnDeviceGetProcAddress pfnc_nvnDeviceGetProcAddress -#define nvnDeviceGetInteger pfnc_nvnDeviceGetInteger -#define nvnDeviceGetCurrentTimestampInNanoseconds pfnc_nvnDeviceGetCurrentTimestampInNanoseconds -#define nvnDeviceSetIntermediateShaderCache pfnc_nvnDeviceSetIntermediateShaderCache -#define nvnDeviceGetTextureHandle pfnc_nvnDeviceGetTextureHandle -#define nvnDeviceGetTexelFetchHandle pfnc_nvnDeviceGetTexelFetchHandle -#define nvnDeviceGetImageHandle pfnc_nvnDeviceGetImageHandle -#define nvnDeviceInstallDebugCallback pfnc_nvnDeviceInstallDebugCallback -#define nvnDeviceGenerateDebugDomainId pfnc_nvnDeviceGenerateDebugDomainId -#define nvnDeviceSetWindowOriginMode pfnc_nvnDeviceSetWindowOriginMode -#define nvnDeviceSetDepthMode pfnc_nvnDeviceSetDepthMode -#define nvnDeviceRegisterFastClearColor pfnc_nvnDeviceRegisterFastClearColor -#define nvnDeviceRegisterFastClearColori pfnc_nvnDeviceRegisterFastClearColori -#define nvnDeviceRegisterFastClearColorui pfnc_nvnDeviceRegisterFastClearColorui -#define nvnDeviceRegisterFastClearDepth pfnc_nvnDeviceRegisterFastClearDepth -#define nvnDeviceGetWindowOriginMode pfnc_nvnDeviceGetWindowOriginMode -#define nvnDeviceGetDepthMode pfnc_nvnDeviceGetDepthMode -#define nvnDeviceGetTimestampInNanoseconds pfnc_nvnDeviceGetTimestampInNanoseconds -#define nvnDeviceApplyDeferredFinalizes pfnc_nvnDeviceApplyDeferredFinalizes -#define nvnDeviceFinalizeCommandHandle pfnc_nvnDeviceFinalizeCommandHandle -#define nvnDeviceWalkDebugDatabase pfnc_nvnDeviceWalkDebugDatabase -#define nvnDeviceGetSeparateTextureHandle pfnc_nvnDeviceGetSeparateTextureHandle -#define nvnDeviceGetSeparateSamplerHandle pfnc_nvnDeviceGetSeparateSamplerHandle -#define nvnDeviceIsExternalDebuggerAttached pfnc_nvnDeviceIsExternalDebuggerAttached -#define nvnQueueGetError pfnc_nvnQueueGetError -#define nvnQueueGetTotalCommandMemoryUsed pfnc_nvnQueueGetTotalCommandMemoryUsed -#define nvnQueueGetTotalControlMemoryUsed pfnc_nvnQueueGetTotalControlMemoryUsed -#define nvnQueueGetTotalComputeMemoryUsed pfnc_nvnQueueGetTotalComputeMemoryUsed -#define nvnQueueResetMemoryUsageCounts pfnc_nvnQueueResetMemoryUsageCounts -#define nvnQueueBuilderSetDevice pfnc_nvnQueueBuilderSetDevice -#define nvnQueueBuilderSetDefaults pfnc_nvnQueueBuilderSetDefaults -#define nvnQueueBuilderSetFlags pfnc_nvnQueueBuilderSetFlags -#define nvnQueueBuilderSetCommandMemorySize pfnc_nvnQueueBuilderSetCommandMemorySize -#define nvnQueueBuilderSetComputeMemorySize pfnc_nvnQueueBuilderSetComputeMemorySize -#define nvnQueueBuilderSetControlMemorySize pfnc_nvnQueueBuilderSetControlMemorySize -#define nvnQueueBuilderGetQueueMemorySize pfnc_nvnQueueBuilderGetQueueMemorySize -#define nvnQueueBuilderSetQueueMemory pfnc_nvnQueueBuilderSetQueueMemory -#define nvnQueueBuilderSetCommandFlushThreshold pfnc_nvnQueueBuilderSetCommandFlushThreshold -#define nvnQueueInitialize pfnc_nvnQueueInitialize -#define nvnQueueFinalize pfnc_nvnQueueFinalize -#define nvnQueueSetDebugLabel pfnc_nvnQueueSetDebugLabel -#define nvnQueueSubmitCommands pfnc_nvnQueueSubmitCommands -#define nvnQueueFlush pfnc_nvnQueueFlush -#define nvnQueueFinish pfnc_nvnQueueFinish -#define nvnQueuePresentTexture pfnc_nvnQueuePresentTexture -#define nvnQueueAcquireTexture pfnc_nvnQueueAcquireTexture -#define nvnWindowBuilderSetDevice pfnc_nvnWindowBuilderSetDevice -#define nvnWindowBuilderSetDefaults pfnc_nvnWindowBuilderSetDefaults -#define nvnWindowBuilderSetNativeWindow pfnc_nvnWindowBuilderSetNativeWindow -#define nvnWindowBuilderSetTextures pfnc_nvnWindowBuilderSetTextures -#define nvnWindowBuilderSetPresentInterval pfnc_nvnWindowBuilderSetPresentInterval -#define nvnWindowBuilderGetNativeWindow pfnc_nvnWindowBuilderGetNativeWindow -#define nvnWindowBuilderGetPresentInterval pfnc_nvnWindowBuilderGetPresentInterval -#define nvnWindowInitialize pfnc_nvnWindowInitialize -#define nvnWindowFinalize pfnc_nvnWindowFinalize -#define nvnWindowSetDebugLabel pfnc_nvnWindowSetDebugLabel -#define nvnWindowAcquireTexture pfnc_nvnWindowAcquireTexture -#define nvnWindowGetNativeWindow pfnc_nvnWindowGetNativeWindow -#define nvnWindowGetPresentInterval pfnc_nvnWindowGetPresentInterval -#define nvnWindowSetPresentInterval pfnc_nvnWindowSetPresentInterval -#define nvnWindowSetCrop pfnc_nvnWindowSetCrop -#define nvnWindowGetCrop pfnc_nvnWindowGetCrop -#define nvnProgramInitialize pfnc_nvnProgramInitialize -#define nvnProgramFinalize pfnc_nvnProgramFinalize -#define nvnProgramSetDebugLabel pfnc_nvnProgramSetDebugLabel -#define nvnProgramSetShaders pfnc_nvnProgramSetShaders -#define nvnMemoryPoolBuilderSetDevice pfnc_nvnMemoryPoolBuilderSetDevice -#define nvnMemoryPoolBuilderSetDefaults pfnc_nvnMemoryPoolBuilderSetDefaults -#define nvnMemoryPoolBuilderSetStorage pfnc_nvnMemoryPoolBuilderSetStorage -#define nvnMemoryPoolBuilderSetFlags pfnc_nvnMemoryPoolBuilderSetFlags -#define nvnMemoryPoolBuilderGetMemory pfnc_nvnMemoryPoolBuilderGetMemory -#define nvnMemoryPoolBuilderGetSize pfnc_nvnMemoryPoolBuilderGetSize -#define nvnMemoryPoolBuilderGetFlags pfnc_nvnMemoryPoolBuilderGetFlags -#define nvnMemoryPoolInitialize pfnc_nvnMemoryPoolInitialize -#define nvnMemoryPoolSetDebugLabel pfnc_nvnMemoryPoolSetDebugLabel -#define nvnMemoryPoolFinalize pfnc_nvnMemoryPoolFinalize -#define nvnMemoryPoolMap pfnc_nvnMemoryPoolMap -#define nvnMemoryPoolFlushMappedRange pfnc_nvnMemoryPoolFlushMappedRange -#define nvnMemoryPoolInvalidateMappedRange pfnc_nvnMemoryPoolInvalidateMappedRange -#define nvnMemoryPoolGetBufferAddress pfnc_nvnMemoryPoolGetBufferAddress -#define nvnMemoryPoolMapVirtual pfnc_nvnMemoryPoolMapVirtual -#define nvnMemoryPoolGetSize pfnc_nvnMemoryPoolGetSize -#define nvnMemoryPoolGetFlags pfnc_nvnMemoryPoolGetFlags -#define nvnTexturePoolInitialize pfnc_nvnTexturePoolInitialize -#define nvnTexturePoolSetDebugLabel pfnc_nvnTexturePoolSetDebugLabel -#define nvnTexturePoolFinalize pfnc_nvnTexturePoolFinalize -#define nvnTexturePoolRegisterTexture pfnc_nvnTexturePoolRegisterTexture -#define nvnTexturePoolRegisterImage pfnc_nvnTexturePoolRegisterImage -#define nvnTexturePoolGetMemoryPool pfnc_nvnTexturePoolGetMemoryPool -#define nvnTexturePoolGetMemoryOffset pfnc_nvnTexturePoolGetMemoryOffset -#define nvnTexturePoolGetSize pfnc_nvnTexturePoolGetSize -#define nvnSamplerPoolInitialize pfnc_nvnSamplerPoolInitialize -#define nvnSamplerPoolSetDebugLabel pfnc_nvnSamplerPoolSetDebugLabel -#define nvnSamplerPoolFinalize pfnc_nvnSamplerPoolFinalize -#define nvnSamplerPoolRegisterSampler pfnc_nvnSamplerPoolRegisterSampler -#define nvnSamplerPoolRegisterSamplerBuilder pfnc_nvnSamplerPoolRegisterSamplerBuilder -#define nvnSamplerPoolGetMemoryPool pfnc_nvnSamplerPoolGetMemoryPool -#define nvnSamplerPoolGetMemoryOffset pfnc_nvnSamplerPoolGetMemoryOffset -#define nvnSamplerPoolGetSize pfnc_nvnSamplerPoolGetSize -#define nvnBufferBuilderSetDevice pfnc_nvnBufferBuilderSetDevice -#define nvnBufferBuilderSetDefaults pfnc_nvnBufferBuilderSetDefaults -#define nvnBufferBuilderSetStorage pfnc_nvnBufferBuilderSetStorage -#define nvnBufferBuilderGetMemoryPool pfnc_nvnBufferBuilderGetMemoryPool -#define nvnBufferBuilderGetMemoryOffset pfnc_nvnBufferBuilderGetMemoryOffset -#define nvnBufferBuilderGetSize pfnc_nvnBufferBuilderGetSize -#define nvnBufferInitialize pfnc_nvnBufferInitialize -#define nvnBufferSetDebugLabel pfnc_nvnBufferSetDebugLabel -#define nvnBufferFinalize pfnc_nvnBufferFinalize -#define nvnBufferMap pfnc_nvnBufferMap -#define nvnBufferGetAddress pfnc_nvnBufferGetAddress -#define nvnBufferFlushMappedRange pfnc_nvnBufferFlushMappedRange -#define nvnBufferInvalidateMappedRange pfnc_nvnBufferInvalidateMappedRange -#define nvnBufferGetMemoryPool pfnc_nvnBufferGetMemoryPool -#define nvnBufferGetMemoryOffset pfnc_nvnBufferGetMemoryOffset -#define nvnBufferGetSize pfnc_nvnBufferGetSize -#define nvnBufferGetDebugID pfnc_nvnBufferGetDebugID -#define nvnTextureBuilderSetDevice pfnc_nvnTextureBuilderSetDevice -#define nvnTextureBuilderSetDefaults pfnc_nvnTextureBuilderSetDefaults -#define nvnTextureBuilderSetFlags pfnc_nvnTextureBuilderSetFlags -#define nvnTextureBuilderSetTarget pfnc_nvnTextureBuilderSetTarget -#define nvnTextureBuilderSetWidth pfnc_nvnTextureBuilderSetWidth -#define nvnTextureBuilderSetHeight pfnc_nvnTextureBuilderSetHeight -#define nvnTextureBuilderSetDepth pfnc_nvnTextureBuilderSetDepth -#define nvnTextureBuilderSetSize1D pfnc_nvnTextureBuilderSetSize1D -#define nvnTextureBuilderSetSize2D pfnc_nvnTextureBuilderSetSize2D -#define nvnTextureBuilderSetSize3D pfnc_nvnTextureBuilderSetSize3D -#define nvnTextureBuilderSetLevels pfnc_nvnTextureBuilderSetLevels -#define nvnTextureBuilderSetFormat pfnc_nvnTextureBuilderSetFormat -#define nvnTextureBuilderSetSamples pfnc_nvnTextureBuilderSetSamples -#define nvnTextureBuilderSetSwizzle pfnc_nvnTextureBuilderSetSwizzle -#define nvnTextureBuilderSetDepthStencilMode pfnc_nvnTextureBuilderSetDepthStencilMode -#define nvnTextureBuilderGetStorageSize pfnc_nvnTextureBuilderGetStorageSize -#define nvnTextureBuilderGetStorageAlignment pfnc_nvnTextureBuilderGetStorageAlignment -#define nvnTextureBuilderSetStorage pfnc_nvnTextureBuilderSetStorage -#define nvnTextureBuilderSetPackagedTextureData pfnc_nvnTextureBuilderSetPackagedTextureData -#define nvnTextureBuilderSetPackagedTextureLayout pfnc_nvnTextureBuilderSetPackagedTextureLayout -#define nvnTextureBuilderSetStride pfnc_nvnTextureBuilderSetStride -#define nvnTextureBuilderSetGLTextureName pfnc_nvnTextureBuilderSetGLTextureName -#define nvnTextureBuilderGetStorageClass pfnc_nvnTextureBuilderGetStorageClass -#define nvnTextureBuilderGetFlags pfnc_nvnTextureBuilderGetFlags -#define nvnTextureBuilderGetTarget pfnc_nvnTextureBuilderGetTarget -#define nvnTextureBuilderGetWidth pfnc_nvnTextureBuilderGetWidth -#define nvnTextureBuilderGetHeight pfnc_nvnTextureBuilderGetHeight -#define nvnTextureBuilderGetDepth pfnc_nvnTextureBuilderGetDepth -#define nvnTextureBuilderGetLevels pfnc_nvnTextureBuilderGetLevels -#define nvnTextureBuilderGetFormat pfnc_nvnTextureBuilderGetFormat -#define nvnTextureBuilderGetSamples pfnc_nvnTextureBuilderGetSamples -#define nvnTextureBuilderGetSwizzle pfnc_nvnTextureBuilderGetSwizzle -#define nvnTextureBuilderGetDepthStencilMode pfnc_nvnTextureBuilderGetDepthStencilMode -#define nvnTextureBuilderGetPackagedTextureData pfnc_nvnTextureBuilderGetPackagedTextureData -#define nvnTextureBuilderGetStride pfnc_nvnTextureBuilderGetStride -#define nvnTextureBuilderGetSparseTileLayout pfnc_nvnTextureBuilderGetSparseTileLayout -#define nvnTextureBuilderGetGLTextureName pfnc_nvnTextureBuilderGetGLTextureName -#define nvnTextureBuilderGetZCullStorageSize pfnc_nvnTextureBuilderGetZCullStorageSize -#define nvnTextureBuilderGetMemoryPool pfnc_nvnTextureBuilderGetMemoryPool -#define nvnTextureBuilderGetMemoryOffset pfnc_nvnTextureBuilderGetMemoryOffset -#define nvnTextureViewSetDefaults pfnc_nvnTextureViewSetDefaults -#define nvnTextureViewSetLevels pfnc_nvnTextureViewSetLevels -#define nvnTextureViewSetLayers pfnc_nvnTextureViewSetLayers -#define nvnTextureViewSetFormat pfnc_nvnTextureViewSetFormat -#define nvnTextureViewSetSwizzle pfnc_nvnTextureViewSetSwizzle -#define nvnTextureViewSetDepthStencilMode pfnc_nvnTextureViewSetDepthStencilMode -#define nvnTextureViewSetTarget pfnc_nvnTextureViewSetTarget -#define nvnTextureViewGetLevels pfnc_nvnTextureViewGetLevels -#define nvnTextureViewGetLayers pfnc_nvnTextureViewGetLayers -#define nvnTextureViewGetFormat pfnc_nvnTextureViewGetFormat -#define nvnTextureViewGetSwizzle pfnc_nvnTextureViewGetSwizzle -#define nvnTextureViewGetDepthStencilMode pfnc_nvnTextureViewGetDepthStencilMode -#define nvnTextureViewGetTarget pfnc_nvnTextureViewGetTarget -#define nvnTextureViewCompare pfnc_nvnTextureViewCompare -#define nvnTextureInitialize pfnc_nvnTextureInitialize -#define nvnTextureGetZCullStorageSize pfnc_nvnTextureGetZCullStorageSize -#define nvnTextureFinalize pfnc_nvnTextureFinalize -#define nvnTextureSetDebugLabel pfnc_nvnTextureSetDebugLabel -#define nvnTextureGetStorageClass pfnc_nvnTextureGetStorageClass -#define nvnTextureGetViewOffset pfnc_nvnTextureGetViewOffset -#define nvnTextureGetFlags pfnc_nvnTextureGetFlags -#define nvnTextureGetTarget pfnc_nvnTextureGetTarget -#define nvnTextureGetWidth pfnc_nvnTextureGetWidth -#define nvnTextureGetHeight pfnc_nvnTextureGetHeight -#define nvnTextureGetDepth pfnc_nvnTextureGetDepth -#define nvnTextureGetLevels pfnc_nvnTextureGetLevels -#define nvnTextureGetFormat pfnc_nvnTextureGetFormat -#define nvnTextureGetSamples pfnc_nvnTextureGetSamples -#define nvnTextureGetSwizzle pfnc_nvnTextureGetSwizzle -#define nvnTextureGetDepthStencilMode pfnc_nvnTextureGetDepthStencilMode -#define nvnTextureGetStride pfnc_nvnTextureGetStride -#define nvnTextureGetTextureAddress pfnc_nvnTextureGetTextureAddress -#define nvnTextureGetSparseTileLayout pfnc_nvnTextureGetSparseTileLayout -#define nvnTextureWriteTexels pfnc_nvnTextureWriteTexels -#define nvnTextureWriteTexelsStrided pfnc_nvnTextureWriteTexelsStrided -#define nvnTextureReadTexels pfnc_nvnTextureReadTexels -#define nvnTextureReadTexelsStrided pfnc_nvnTextureReadTexelsStrided -#define nvnTextureFlushTexels pfnc_nvnTextureFlushTexels -#define nvnTextureInvalidateTexels pfnc_nvnTextureInvalidateTexels -#define nvnTextureGetMemoryPool pfnc_nvnTextureGetMemoryPool -#define nvnTextureGetMemoryOffset pfnc_nvnTextureGetMemoryOffset -#define nvnTextureGetStorageSize pfnc_nvnTextureGetStorageSize -#define nvnTextureCompare pfnc_nvnTextureCompare -#define nvnTextureGetDebugID pfnc_nvnTextureGetDebugID -#define nvnSamplerBuilderSetDevice pfnc_nvnSamplerBuilderSetDevice -#define nvnSamplerBuilderSetDefaults pfnc_nvnSamplerBuilderSetDefaults -#define nvnSamplerBuilderSetMinMagFilter pfnc_nvnSamplerBuilderSetMinMagFilter -#define nvnSamplerBuilderSetWrapMode pfnc_nvnSamplerBuilderSetWrapMode -#define nvnSamplerBuilderSetLodClamp pfnc_nvnSamplerBuilderSetLodClamp -#define nvnSamplerBuilderSetLodBias pfnc_nvnSamplerBuilderSetLodBias -#define nvnSamplerBuilderSetCompare pfnc_nvnSamplerBuilderSetCompare -#define nvnSamplerBuilderSetBorderColor pfnc_nvnSamplerBuilderSetBorderColor -#define nvnSamplerBuilderSetBorderColori pfnc_nvnSamplerBuilderSetBorderColori -#define nvnSamplerBuilderSetBorderColorui pfnc_nvnSamplerBuilderSetBorderColorui -#define nvnSamplerBuilderSetMaxAnisotropy pfnc_nvnSamplerBuilderSetMaxAnisotropy -#define nvnSamplerBuilderSetReductionFilter pfnc_nvnSamplerBuilderSetReductionFilter -#define nvnSamplerBuilderSetLodSnap pfnc_nvnSamplerBuilderSetLodSnap -#define nvnSamplerBuilderGetMinMagFilter pfnc_nvnSamplerBuilderGetMinMagFilter -#define nvnSamplerBuilderGetWrapMode pfnc_nvnSamplerBuilderGetWrapMode -#define nvnSamplerBuilderGetLodClamp pfnc_nvnSamplerBuilderGetLodClamp -#define nvnSamplerBuilderGetLodBias pfnc_nvnSamplerBuilderGetLodBias -#define nvnSamplerBuilderGetCompare pfnc_nvnSamplerBuilderGetCompare -#define nvnSamplerBuilderGetBorderColor pfnc_nvnSamplerBuilderGetBorderColor -#define nvnSamplerBuilderGetBorderColori pfnc_nvnSamplerBuilderGetBorderColori -#define nvnSamplerBuilderGetBorderColorui pfnc_nvnSamplerBuilderGetBorderColorui -#define nvnSamplerBuilderGetMaxAnisotropy pfnc_nvnSamplerBuilderGetMaxAnisotropy -#define nvnSamplerBuilderGetReductionFilter pfnc_nvnSamplerBuilderGetReductionFilter -#define nvnSamplerBuilderGetLodSnap pfnc_nvnSamplerBuilderGetLodSnap -#define nvnSamplerInitialize pfnc_nvnSamplerInitialize -#define nvnSamplerFinalize pfnc_nvnSamplerFinalize -#define nvnSamplerSetDebugLabel pfnc_nvnSamplerSetDebugLabel -#define nvnSamplerGetMinMagFilter pfnc_nvnSamplerGetMinMagFilter -#define nvnSamplerGetWrapMode pfnc_nvnSamplerGetWrapMode -#define nvnSamplerGetLodClamp pfnc_nvnSamplerGetLodClamp -#define nvnSamplerGetLodBias pfnc_nvnSamplerGetLodBias -#define nvnSamplerGetCompare pfnc_nvnSamplerGetCompare -#define nvnSamplerGetBorderColor pfnc_nvnSamplerGetBorderColor -#define nvnSamplerGetBorderColori pfnc_nvnSamplerGetBorderColori -#define nvnSamplerGetBorderColorui pfnc_nvnSamplerGetBorderColorui -#define nvnSamplerGetMaxAnisotropy pfnc_nvnSamplerGetMaxAnisotropy -#define nvnSamplerGetReductionFilter pfnc_nvnSamplerGetReductionFilter -#define nvnSamplerCompare pfnc_nvnSamplerCompare -#define nvnSamplerGetDebugID pfnc_nvnSamplerGetDebugID -#define nvnBlendStateSetDefaults pfnc_nvnBlendStateSetDefaults -#define nvnBlendStateSetBlendTarget pfnc_nvnBlendStateSetBlendTarget -#define nvnBlendStateSetBlendFunc pfnc_nvnBlendStateSetBlendFunc -#define nvnBlendStateSetBlendEquation pfnc_nvnBlendStateSetBlendEquation -#define nvnBlendStateSetAdvancedMode pfnc_nvnBlendStateSetAdvancedMode -#define nvnBlendStateSetAdvancedOverlap pfnc_nvnBlendStateSetAdvancedOverlap -#define nvnBlendStateSetAdvancedPremultipliedSrc pfnc_nvnBlendStateSetAdvancedPremultipliedSrc -#define nvnBlendStateSetAdvancedNormalizedDst pfnc_nvnBlendStateSetAdvancedNormalizedDst -#define nvnBlendStateGetBlendTarget pfnc_nvnBlendStateGetBlendTarget -#define nvnBlendStateGetBlendFunc pfnc_nvnBlendStateGetBlendFunc -#define nvnBlendStateGetBlendEquation pfnc_nvnBlendStateGetBlendEquation -#define nvnBlendStateGetAdvancedMode pfnc_nvnBlendStateGetAdvancedMode -#define nvnBlendStateGetAdvancedOverlap pfnc_nvnBlendStateGetAdvancedOverlap -#define nvnBlendStateGetAdvancedPremultipliedSrc pfnc_nvnBlendStateGetAdvancedPremultipliedSrc -#define nvnBlendStateGetAdvancedNormalizedDst pfnc_nvnBlendStateGetAdvancedNormalizedDst -#define nvnColorStateSetDefaults pfnc_nvnColorStateSetDefaults -#define nvnColorStateSetBlendEnable pfnc_nvnColorStateSetBlendEnable -#define nvnColorStateSetLogicOp pfnc_nvnColorStateSetLogicOp -#define nvnColorStateSetAlphaTest pfnc_nvnColorStateSetAlphaTest -#define nvnColorStateGetBlendEnable pfnc_nvnColorStateGetBlendEnable -#define nvnColorStateGetLogicOp pfnc_nvnColorStateGetLogicOp -#define nvnColorStateGetAlphaTest pfnc_nvnColorStateGetAlphaTest -#define nvnChannelMaskStateSetDefaults pfnc_nvnChannelMaskStateSetDefaults -#define nvnChannelMaskStateSetChannelMask pfnc_nvnChannelMaskStateSetChannelMask -#define nvnChannelMaskStateGetChannelMask pfnc_nvnChannelMaskStateGetChannelMask -#define nvnMultisampleStateSetDefaults pfnc_nvnMultisampleStateSetDefaults -#define nvnMultisampleStateSetMultisampleEnable pfnc_nvnMultisampleStateSetMultisampleEnable -#define nvnMultisampleStateSetSamples pfnc_nvnMultisampleStateSetSamples -#define nvnMultisampleStateSetAlphaToCoverageEnable pfnc_nvnMultisampleStateSetAlphaToCoverageEnable -#define nvnMultisampleStateSetAlphaToCoverageDither pfnc_nvnMultisampleStateSetAlphaToCoverageDither -#define nvnMultisampleStateGetMultisampleEnable pfnc_nvnMultisampleStateGetMultisampleEnable -#define nvnMultisampleStateGetSamples pfnc_nvnMultisampleStateGetSamples -#define nvnMultisampleStateGetAlphaToCoverageEnable pfnc_nvnMultisampleStateGetAlphaToCoverageEnable -#define nvnMultisampleStateGetAlphaToCoverageDither pfnc_nvnMultisampleStateGetAlphaToCoverageDither -#define nvnMultisampleStateSetRasterSamples pfnc_nvnMultisampleStateSetRasterSamples -#define nvnMultisampleStateGetRasterSamples pfnc_nvnMultisampleStateGetRasterSamples -#define nvnMultisampleStateSetCoverageModulationMode \ - pfnc_nvnMultisampleStateSetCoverageModulationMode -#define nvnMultisampleStateGetCoverageModulationMode \ - pfnc_nvnMultisampleStateGetCoverageModulationMode -#define nvnMultisampleStateSetCoverageToColorEnable pfnc_nvnMultisampleStateSetCoverageToColorEnable -#define nvnMultisampleStateGetCoverageToColorEnable pfnc_nvnMultisampleStateGetCoverageToColorEnable -#define nvnMultisampleStateSetCoverageToColorOutput pfnc_nvnMultisampleStateSetCoverageToColorOutput -#define nvnMultisampleStateGetCoverageToColorOutput pfnc_nvnMultisampleStateGetCoverageToColorOutput -#define nvnMultisampleStateSetSampleLocationsEnable pfnc_nvnMultisampleStateSetSampleLocationsEnable -#define nvnMultisampleStateGetSampleLocationsEnable pfnc_nvnMultisampleStateGetSampleLocationsEnable -#define nvnMultisampleStateGetSampleLocationsGrid pfnc_nvnMultisampleStateGetSampleLocationsGrid -#define nvnMultisampleStateSetSampleLocationsGridEnable \ - pfnc_nvnMultisampleStateSetSampleLocationsGridEnable -#define nvnMultisampleStateGetSampleLocationsGridEnable \ - pfnc_nvnMultisampleStateGetSampleLocationsGridEnable -#define nvnMultisampleStateSetSampleLocations pfnc_nvnMultisampleStateSetSampleLocations -#define nvnPolygonStateSetDefaults pfnc_nvnPolygonStateSetDefaults -#define nvnPolygonStateSetCullFace pfnc_nvnPolygonStateSetCullFace -#define nvnPolygonStateSetFrontFace pfnc_nvnPolygonStateSetFrontFace -#define nvnPolygonStateSetPolygonMode pfnc_nvnPolygonStateSetPolygonMode -#define nvnPolygonStateSetPolygonOffsetEnables pfnc_nvnPolygonStateSetPolygonOffsetEnables -#define nvnPolygonStateGetCullFace pfnc_nvnPolygonStateGetCullFace -#define nvnPolygonStateGetFrontFace pfnc_nvnPolygonStateGetFrontFace -#define nvnPolygonStateGetPolygonMode pfnc_nvnPolygonStateGetPolygonMode -#define nvnPolygonStateGetPolygonOffsetEnables pfnc_nvnPolygonStateGetPolygonOffsetEnables -#define nvnDepthStencilStateSetDefaults pfnc_nvnDepthStencilStateSetDefaults -#define nvnDepthStencilStateSetDepthTestEnable pfnc_nvnDepthStencilStateSetDepthTestEnable -#define nvnDepthStencilStateSetDepthWriteEnable pfnc_nvnDepthStencilStateSetDepthWriteEnable -#define nvnDepthStencilStateSetDepthFunc pfnc_nvnDepthStencilStateSetDepthFunc -#define nvnDepthStencilStateSetStencilTestEnable pfnc_nvnDepthStencilStateSetStencilTestEnable -#define nvnDepthStencilStateSetStencilFunc pfnc_nvnDepthStencilStateSetStencilFunc -#define nvnDepthStencilStateSetStencilOp pfnc_nvnDepthStencilStateSetStencilOp -#define nvnDepthStencilStateGetDepthTestEnable pfnc_nvnDepthStencilStateGetDepthTestEnable -#define nvnDepthStencilStateGetDepthWriteEnable pfnc_nvnDepthStencilStateGetDepthWriteEnable -#define nvnDepthStencilStateGetDepthFunc pfnc_nvnDepthStencilStateGetDepthFunc -#define nvnDepthStencilStateGetStencilTestEnable pfnc_nvnDepthStencilStateGetStencilTestEnable -#define nvnDepthStencilStateGetStencilFunc pfnc_nvnDepthStencilStateGetStencilFunc -#define nvnDepthStencilStateGetStencilOp pfnc_nvnDepthStencilStateGetStencilOp -#define nvnVertexAttribStateSetDefaults pfnc_nvnVertexAttribStateSetDefaults -#define nvnVertexAttribStateSetFormat pfnc_nvnVertexAttribStateSetFormat -#define nvnVertexAttribStateSetStreamIndex pfnc_nvnVertexAttribStateSetStreamIndex -#define nvnVertexAttribStateGetFormat pfnc_nvnVertexAttribStateGetFormat -#define nvnVertexAttribStateGetStreamIndex pfnc_nvnVertexAttribStateGetStreamIndex -#define nvnVertexStreamStateSetDefaults pfnc_nvnVertexStreamStateSetDefaults -#define nvnVertexStreamStateSetStride pfnc_nvnVertexStreamStateSetStride -#define nvnVertexStreamStateSetDivisor pfnc_nvnVertexStreamStateSetDivisor -#define nvnVertexStreamStateGetStride pfnc_nvnVertexStreamStateGetStride -#define nvnVertexStreamStateGetDivisor pfnc_nvnVertexStreamStateGetDivisor -#define nvnCommandBufferInitialize pfnc_nvnCommandBufferInitialize -#define nvnCommandBufferFinalize pfnc_nvnCommandBufferFinalize -#define nvnCommandBufferSetDebugLabel pfnc_nvnCommandBufferSetDebugLabel -#define nvnCommandBufferSetMemoryCallback pfnc_nvnCommandBufferSetMemoryCallback -#define nvnCommandBufferSetMemoryCallbackData pfnc_nvnCommandBufferSetMemoryCallbackData -#define nvnCommandBufferAddCommandMemory pfnc_nvnCommandBufferAddCommandMemory -#define nvnCommandBufferAddControlMemory pfnc_nvnCommandBufferAddControlMemory -#define nvnCommandBufferGetCommandMemorySize pfnc_nvnCommandBufferGetCommandMemorySize -#define nvnCommandBufferGetCommandMemoryUsed pfnc_nvnCommandBufferGetCommandMemoryUsed -#define nvnCommandBufferGetCommandMemoryFree pfnc_nvnCommandBufferGetCommandMemoryFree -#define nvnCommandBufferGetControlMemorySize pfnc_nvnCommandBufferGetControlMemorySize -#define nvnCommandBufferGetControlMemoryUsed pfnc_nvnCommandBufferGetControlMemoryUsed -#define nvnCommandBufferGetControlMemoryFree pfnc_nvnCommandBufferGetControlMemoryFree -#define nvnCommandBufferBeginRecording pfnc_nvnCommandBufferBeginRecording -#define nvnCommandBufferEndRecording pfnc_nvnCommandBufferEndRecording -#define nvnCommandBufferCallCommands pfnc_nvnCommandBufferCallCommands -#define nvnCommandBufferCopyCommands pfnc_nvnCommandBufferCopyCommands -#define nvnCommandBufferBindBlendState pfnc_nvnCommandBufferBindBlendState -#define nvnCommandBufferBindChannelMaskState pfnc_nvnCommandBufferBindChannelMaskState -#define nvnCommandBufferBindColorState pfnc_nvnCommandBufferBindColorState -#define nvnCommandBufferBindMultisampleState pfnc_nvnCommandBufferBindMultisampleState -#define nvnCommandBufferBindPolygonState pfnc_nvnCommandBufferBindPolygonState -#define nvnCommandBufferBindDepthStencilState pfnc_nvnCommandBufferBindDepthStencilState -#define nvnCommandBufferBindVertexAttribState pfnc_nvnCommandBufferBindVertexAttribState -#define nvnCommandBufferBindVertexStreamState pfnc_nvnCommandBufferBindVertexStreamState -#define nvnCommandBufferBindProgram pfnc_nvnCommandBufferBindProgram -#define nvnCommandBufferBindVertexBuffer pfnc_nvnCommandBufferBindVertexBuffer -#define nvnCommandBufferBindVertexBuffers pfnc_nvnCommandBufferBindVertexBuffers -#define nvnCommandBufferBindUniformBuffer pfnc_nvnCommandBufferBindUniformBuffer -#define nvnCommandBufferBindUniformBuffers pfnc_nvnCommandBufferBindUniformBuffers -#define nvnCommandBufferBindTransformFeedbackBuffer pfnc_nvnCommandBufferBindTransformFeedbackBuffer -#define nvnCommandBufferBindTransformFeedbackBuffers \ - pfnc_nvnCommandBufferBindTransformFeedbackBuffers -#define nvnCommandBufferBindStorageBuffer pfnc_nvnCommandBufferBindStorageBuffer -#define nvnCommandBufferBindStorageBuffers pfnc_nvnCommandBufferBindStorageBuffers -#define nvnCommandBufferBindTexture pfnc_nvnCommandBufferBindTexture -#define nvnCommandBufferBindTextures pfnc_nvnCommandBufferBindTextures -#define nvnCommandBufferBindImage pfnc_nvnCommandBufferBindImage -#define nvnCommandBufferBindImages pfnc_nvnCommandBufferBindImages -#define nvnCommandBufferSetPatchSize pfnc_nvnCommandBufferSetPatchSize -#define nvnCommandBufferSetInnerTessellationLevels pfnc_nvnCommandBufferSetInnerTessellationLevels -#define nvnCommandBufferSetOuterTessellationLevels pfnc_nvnCommandBufferSetOuterTessellationLevels -#define nvnCommandBufferSetPrimitiveRestart pfnc_nvnCommandBufferSetPrimitiveRestart -#define nvnCommandBufferBeginTransformFeedback pfnc_nvnCommandBufferBeginTransformFeedback -#define nvnCommandBufferEndTransformFeedback pfnc_nvnCommandBufferEndTransformFeedback -#define nvnCommandBufferPauseTransformFeedback pfnc_nvnCommandBufferPauseTransformFeedback -#define nvnCommandBufferResumeTransformFeedback pfnc_nvnCommandBufferResumeTransformFeedback -#define nvnCommandBufferDrawTransformFeedback pfnc_nvnCommandBufferDrawTransformFeedback -#define nvnCommandBufferDrawArrays pfnc_nvnCommandBufferDrawArrays -#define nvnCommandBufferDrawElements pfnc_nvnCommandBufferDrawElements -#define nvnCommandBufferDrawElementsBaseVertex pfnc_nvnCommandBufferDrawElementsBaseVertex -#define nvnCommandBufferDrawArraysInstanced pfnc_nvnCommandBufferDrawArraysInstanced -#define nvnCommandBufferDrawElementsInstanced pfnc_nvnCommandBufferDrawElementsInstanced -#define nvnCommandBufferDrawArraysIndirect pfnc_nvnCommandBufferDrawArraysIndirect -#define nvnCommandBufferDrawElementsIndirect pfnc_nvnCommandBufferDrawElementsIndirect -#define nvnCommandBufferMultiDrawArraysIndirectCount \ - pfnc_nvnCommandBufferMultiDrawArraysIndirectCount -#define nvnCommandBufferMultiDrawElementsIndirectCount \ - pfnc_nvnCommandBufferMultiDrawElementsIndirectCount -#define nvnCommandBufferClearColor pfnc_nvnCommandBufferClearColor -#define nvnCommandBufferClearColori pfnc_nvnCommandBufferClearColori -#define nvnCommandBufferClearColorui pfnc_nvnCommandBufferClearColorui -#define nvnCommandBufferClearDepthStencil pfnc_nvnCommandBufferClearDepthStencil -#define nvnCommandBufferDispatchCompute pfnc_nvnCommandBufferDispatchCompute -#define nvnCommandBufferDispatchComputeIndirect pfnc_nvnCommandBufferDispatchComputeIndirect -#define nvnCommandBufferSetViewport pfnc_nvnCommandBufferSetViewport -#define nvnCommandBufferSetViewports pfnc_nvnCommandBufferSetViewports -#define nvnCommandBufferSetViewportSwizzles pfnc_nvnCommandBufferSetViewportSwizzles -#define nvnCommandBufferSetScissor pfnc_nvnCommandBufferSetScissor -#define nvnCommandBufferSetScissors pfnc_nvnCommandBufferSetScissors -#define nvnCommandBufferSetDepthRange pfnc_nvnCommandBufferSetDepthRange -#define nvnCommandBufferSetDepthBounds pfnc_nvnCommandBufferSetDepthBounds -#define nvnCommandBufferSetDepthRanges pfnc_nvnCommandBufferSetDepthRanges -#define nvnCommandBufferSetTiledCacheAction pfnc_nvnCommandBufferSetTiledCacheAction -#define nvnCommandBufferSetTiledCacheTileSize pfnc_nvnCommandBufferSetTiledCacheTileSize -#define nvnCommandBufferBindSeparateTexture pfnc_nvnCommandBufferBindSeparateTexture -#define nvnCommandBufferBindSeparateSampler pfnc_nvnCommandBufferBindSeparateSampler -#define nvnCommandBufferBindSeparateTextures pfnc_nvnCommandBufferBindSeparateTextures -#define nvnCommandBufferBindSeparateSamplers pfnc_nvnCommandBufferBindSeparateSamplers -#define nvnCommandBufferSetStencilValueMask pfnc_nvnCommandBufferSetStencilValueMask -#define nvnCommandBufferSetStencilMask pfnc_nvnCommandBufferSetStencilMask -#define nvnCommandBufferSetStencilRef pfnc_nvnCommandBufferSetStencilRef -#define nvnCommandBufferSetBlendColor pfnc_nvnCommandBufferSetBlendColor -#define nvnCommandBufferSetPointSize pfnc_nvnCommandBufferSetPointSize -#define nvnCommandBufferSetLineWidth pfnc_nvnCommandBufferSetLineWidth -#define nvnCommandBufferSetPolygonOffsetClamp pfnc_nvnCommandBufferSetPolygonOffsetClamp -#define nvnCommandBufferSetAlphaRef pfnc_nvnCommandBufferSetAlphaRef -#define nvnCommandBufferSetSampleMask pfnc_nvnCommandBufferSetSampleMask -#define nvnCommandBufferSetRasterizerDiscard pfnc_nvnCommandBufferSetRasterizerDiscard -#define nvnCommandBufferSetDepthClamp pfnc_nvnCommandBufferSetDepthClamp -#define nvnCommandBufferSetConservativeRasterEnable pfnc_nvnCommandBufferSetConservativeRasterEnable -#define nvnCommandBufferSetConservativeRasterDilate pfnc_nvnCommandBufferSetConservativeRasterDilate -#define nvnCommandBufferSetSubpixelPrecisionBias pfnc_nvnCommandBufferSetSubpixelPrecisionBias -#define nvnCommandBufferCopyBufferToTexture pfnc_nvnCommandBufferCopyBufferToTexture -#define nvnCommandBufferCopyTextureToBuffer pfnc_nvnCommandBufferCopyTextureToBuffer -#define nvnCommandBufferCopyTextureToTexture pfnc_nvnCommandBufferCopyTextureToTexture -#define nvnCommandBufferCopyBufferToBuffer pfnc_nvnCommandBufferCopyBufferToBuffer -#define nvnCommandBufferClearBuffer pfnc_nvnCommandBufferClearBuffer -#define nvnCommandBufferClearTexture pfnc_nvnCommandBufferClearTexture -#define nvnCommandBufferClearTexturei pfnc_nvnCommandBufferClearTexturei -#define nvnCommandBufferClearTextureui pfnc_nvnCommandBufferClearTextureui -#define nvnCommandBufferUpdateUniformBuffer pfnc_nvnCommandBufferUpdateUniformBuffer -#define nvnCommandBufferReportCounter pfnc_nvnCommandBufferReportCounter -#define nvnCommandBufferResetCounter pfnc_nvnCommandBufferResetCounter -#define nvnCommandBufferReportValue pfnc_nvnCommandBufferReportValue -#define nvnCommandBufferSetRenderEnable pfnc_nvnCommandBufferSetRenderEnable -#define nvnCommandBufferSetRenderEnableConditional pfnc_nvnCommandBufferSetRenderEnableConditional -#define nvnCommandBufferSetRenderTargets pfnc_nvnCommandBufferSetRenderTargets -#define nvnCommandBufferDiscardColor pfnc_nvnCommandBufferDiscardColor -#define nvnCommandBufferDiscardDepthStencil pfnc_nvnCommandBufferDiscardDepthStencil -#define nvnCommandBufferDownsample pfnc_nvnCommandBufferDownsample -#define nvnCommandBufferTiledDownsample pfnc_nvnCommandBufferTiledDownsample -#define nvnCommandBufferDownsampleTextureView pfnc_nvnCommandBufferDownsampleTextureView -#define nvnCommandBufferTiledDownsampleTextureView pfnc_nvnCommandBufferTiledDownsampleTextureView -#define nvnCommandBufferBarrier pfnc_nvnCommandBufferBarrier -#define nvnCommandBufferWaitSync pfnc_nvnCommandBufferWaitSync -#define nvnCommandBufferFenceSync pfnc_nvnCommandBufferFenceSync -#define nvnCommandBufferSetTexturePool pfnc_nvnCommandBufferSetTexturePool -#define nvnCommandBufferSetSamplerPool pfnc_nvnCommandBufferSetSamplerPool -#define nvnCommandBufferSetShaderScratchMemory pfnc_nvnCommandBufferSetShaderScratchMemory -#define nvnCommandBufferSaveZCullData pfnc_nvnCommandBufferSaveZCullData -#define nvnCommandBufferRestoreZCullData pfnc_nvnCommandBufferRestoreZCullData -#define nvnCommandBufferSetCopyRowStride pfnc_nvnCommandBufferSetCopyRowStride -#define nvnCommandBufferSetCopyImageStride pfnc_nvnCommandBufferSetCopyImageStride -#define nvnCommandBufferGetCopyRowStride pfnc_nvnCommandBufferGetCopyRowStride -#define nvnCommandBufferGetCopyImageStride pfnc_nvnCommandBufferGetCopyImageStride -#define nvnCommandBufferDrawTexture pfnc_nvnCommandBufferDrawTexture -#define nvnProgramSetSubroutineLinkage pfnc_nvnProgramSetSubroutineLinkage -#define nvnCommandBufferSetProgramSubroutines pfnc_nvnCommandBufferSetProgramSubroutines -#define nvnCommandBufferBindCoverageModulationTable pfnc_nvnCommandBufferBindCoverageModulationTable -#define nvnCommandBufferResolveDepthBuffer pfnc_nvnCommandBufferResolveDepthBuffer -#define nvnCommandBufferPushDebugGroupStatic pfnc_nvnCommandBufferPushDebugGroupStatic -#define nvnCommandBufferPushDebugGroupDynamic pfnc_nvnCommandBufferPushDebugGroupDynamic -#define nvnCommandBufferPushDebugGroup pfnc_nvnCommandBufferPushDebugGroup -#define nvnCommandBufferPopDebugGroup pfnc_nvnCommandBufferPopDebugGroup -#define nvnCommandBufferPopDebugGroupId pfnc_nvnCommandBufferPopDebugGroupId -#define nvnCommandBufferInsertDebugMarkerStatic pfnc_nvnCommandBufferInsertDebugMarkerStatic -#define nvnCommandBufferInsertDebugMarkerDynamic pfnc_nvnCommandBufferInsertDebugMarkerDynamic -#define nvnCommandBufferInsertDebugMarker pfnc_nvnCommandBufferInsertDebugMarker -#define nvnCommandBufferGetMemoryCallback pfnc_nvnCommandBufferGetMemoryCallback -#define nvnCommandBufferGetMemoryCallbackData pfnc_nvnCommandBufferGetMemoryCallbackData -#define nvnCommandBufferIsRecording pfnc_nvnCommandBufferIsRecording -#define nvnSyncInitialize pfnc_nvnSyncInitialize -#define nvnSyncFinalize pfnc_nvnSyncFinalize -#define nvnSyncSetDebugLabel pfnc_nvnSyncSetDebugLabel -#define nvnQueueFenceSync pfnc_nvnQueueFenceSync -#define nvnSyncWait pfnc_nvnSyncWait -#define nvnQueueWaitSync pfnc_nvnQueueWaitSync -#define nvnEventBuilderSetDefaults pfnc_nvnEventBuilderSetDefaults -#define nvnEventBuilderSetStorage pfnc_nvnEventBuilderSetStorage -#define nvnEventInitialize pfnc_nvnEventInitialize -#define nvnEventFinalize pfnc_nvnEventFinalize -#define nvnEventGetValue pfnc_nvnEventGetValue -#define nvnEventSignal pfnc_nvnEventSignal -#define nvnCommandBufferWaitEvent pfnc_nvnCommandBufferWaitEvent -#define nvnCommandBufferSignalEvent pfnc_nvnCommandBufferSignalEvent - -#ifdef __cplusplus -} -#endif diff --git a/src_remove/lib/nnheaders/include/nvn/nvn_types.h b/src_remove/lib/nnheaders/include/nvn/nvn_types.h deleted file mode 100644 index c8cc8f6..0000000 --- a/src_remove/lib/nnheaders/include/nvn/nvn_types.h +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * Copyright (c) 2020 h1k421 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -// NVN types reconstructed from Darksiders II DWARF information. -// NOTE: This only includes enums and structs used for NVN 53.105 but might contain more elements -// than expected (as Darksiders II uses a newer version of NVN). -// TODO: Include the extra information from the version used on Darksiders II for completeness. - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef uint64_t NVNtextureHandle; -typedef uint64_t NVNimageHandle; -typedef uint64_t NVNcommandHandle; -typedef uint64_t NVNbufferAddress; -typedef uint64_t NVNtextureAddress; -typedef int NVNdebugDomainId; -typedef int NVNstorageClass; -typedef void* NVNsubroutineLinkageMapPtr; -typedef void* NVNnativeWindow; - -typedef struct { - char details[0x3000]; -} NVNdevice; - -typedef struct { - char details[0x40]; -} NVNdeviceBuilder; - -typedef struct { - // TODO: reverse and define this as it looks like it's not an opaque type. - char dummy[1]; -} NVNtextureSparseTileLayout; - -typedef struct { - // TODO: reverse and define this as it looks like it's not an opaque type. - char dummy[1]; -} NVNdrawTextureRegion; - -typedef struct { - char details[0x18]; -} NVNmultisampleState; - -typedef struct { - char details[0x8]; -} NVNdepthStencilState; - -typedef struct { - char details[0x4]; -} NVNchannelMaskState; - -typedef struct { - char details[0x4]; -} NVNpolygonState; - -typedef struct { - NVNbufferAddress address; - uint64_t size; -} NVNbufferRange; - -typedef struct { - unsigned char details[4]; -} NVNcolorState; - -typedef struct { - uint64_t counter; - uint64_t timestamp; -} NVNcounterData; - -typedef struct { - uint64_t value; -} NVNseparateTextureHandle; - -typedef struct { - uint64_t value; -} NVNseparateSamplerHandle; - -typedef struct { - char details[0x2000]; -} NVNqueue; - -typedef struct { - // TODO: reverse and define this as it looks like it's not an opaque type. - char dummy[1]; -} NVNqueueErrorInfo; - -typedef struct { - char details[0x40]; -} NVNqueueBuilder; - -typedef struct { - char details[384]; -} NVNwindow; - -typedef struct { - char details[0xC0]; -} NVNtexture; - -typedef struct { - char details[0x28]; -} NVNtextureView; - -typedef struct { - char details[0xA0]; -} NVNcommandBuffer; - -typedef struct { - char details[0x40]; -} NVNsync; - -typedef struct { - int x; - int y; - int width; - int height; -} NVNrectangle; - -typedef struct { - char details[0xC0]; -} NVNprogram; - -typedef struct { - NVNbufferAddress data; - const void* control; -} NVNshaderData; - -typedef struct { - char details[0x100]; -} NVNmemoryPool; - -typedef struct { - char details[0x20]; -} NVNtexturePool; - -typedef struct { - char details[0x20]; -} NVNsamplerPool; - -typedef struct { - char details[0x8]; -} NVNblendState; - -typedef struct { - char details[0x4]; -} NVNvertexAttribState; - -typedef struct { - char details[0x4]; -} NVNvertexStreamState; - -typedef struct { - char details[0x40]; -} NVNmemoryPoolBuilder; - -typedef struct { - // TODO: reverse and define this as it looks like it's not an opaque type. - char dummy[1]; -} NVNmappingRequest; - -typedef struct { - char details[0x60]; -} NVNsamplerBuilder; - -typedef struct { - char details[0x30]; -} NVNsampler; - -typedef struct { - char details[0x40]; -} NVNbufferBuilder; - -typedef struct { - char details[0x30]; -} NVNbuffer; - -typedef struct { - char details[0x40]; -} NVNevent; - -typedef struct { - char details[0x20]; -} NVNeventBuilder; - -typedef struct { - int xoffset; - int yoffset; - int zoffset; - int width; - int height; - int depth; -} NVNcopyRegion; - -typedef struct { - char details[0x40]; -} NVNwindowBuilder; - -typedef struct { - char details[0x80]; -} NVNtextureBuilder; - -typedef struct { - unsigned char layout[8]; -} NVNpackagedTextureLayout; - -typedef enum { - NVN_DEVICE_INFO_API_MAJOR_VERSION = 0x0, - NVN_DEVICE_INFO_API_MINOR_VERSION = 0x1, - NVN_DEVICE_INFO_UNIFORM_BUFFER_BINDINGS_PER_STAGE = 0x2, - NVN_DEVICE_INFO_MAX_UNIFORM_BUFFER_SIZE = 0x3, - NVN_DEVICE_INFO_UNIFORM_BUFFER_ALIGNMENT = 0x4, - NVN_DEVICE_INFO_COLOR_BUFFER_BINDINGS = 0x5, - NVN_DEVICE_INFO_VERTEX_BUFFER_BINDINGS = 0x6, - NVN_DEVICE_INFO_TRANSFORM_FEEDBACK_BUFFER_BINDINGS = 0x7, - NVN_DEVICE_INFO_SHADER_STORAGE_BUFFER_BINDINGS_PER_STAGE = 0x8, - NVN_DEVICE_INFO_TEXTURE_BINDINGS_PER_STAGE = 0x9, - NVN_DEVICE_INFO_COUNTER_ALIGNMENT = 0xA, - NVN_DEVICE_INFO_TRANSFORM_FEEDBACK_BUFFER_ALIGNMENT = 0xB, - NVN_DEVICE_INFO_TRANSFORM_FEEDBACK_CONTROL_ALIGNMENT = 0xC, - NVN_DEVICE_INFO_INDIRECT_DRAW_ALIGNMENT = 0xD, - NVN_DEVICE_INFO_VERTEX_ATTRIBUTES = 0xE, - NVN_DEVICE_INFO_TEXTURE_DESCRIPTOR_SIZE = 0xF, - NVN_DEVICE_INFO_SAMPLER_DESCRIPTOR_SIZE = 0x10, - NVN_DEVICE_INFO_RESERVED_TEXTURE_DESCRIPTORS = 0x11, - NVN_DEVICE_INFO_RESERVED_SAMPLER_DESCRIPTORS = 0x12, - NVN_DEVICE_INFO_COMMAND_BUFFER_COMMAND_ALIGNMENT = 0x13, - NVN_DEVICE_INFO_COMMAND_BUFFER_CONTROL_ALIGNMENT = 0x14, - NVN_DEVICE_INFO_COMMAND_BUFFER_MIN_COMMAND_SIZE = 0x15, - NVN_DEVICE_INFO_COMMAND_BUFFER_MIN_CONTROL_SIZE = 0x16, - NVN_DEVICE_INFO_SHADER_SCRATCH_MEMORY_SCALE_FACTOR_MINIMUM = 0x17, - NVN_DEVICE_INFO_SHADER_SCRATCH_MEMORY_SCALE_FACTOR_RECOMMENDED = 0x18, - NVN_DEVICE_INFO_SHADER_SCRATCH_MEMORY_ALIGNMENT = 0x19, - NVN_DEVICE_INFO_SHADER_SCRATCH_MEMORY_GRANULARITY = 0x1A, - NVN_DEVICE_INFO_MAX_TEXTURE_ANISOTROPY = 0x1B, - NVN_DEVICE_INFO_MAX_COMPUTE_WORK_GROUP_SIZE_X = 0x1C, - NVN_DEVICE_INFO_MAX_COMPUTE_WORK_GROUP_SIZE_Y = 0x1D, - NVN_DEVICE_INFO_MAX_COMPUTE_WORK_GROUP_SIZE_Z = 0x1E, - NVN_DEVICE_INFO_MAX_COMPUTE_WORK_GROUP_SIZE_THREADS = 0x1F, - NVN_DEVICE_INFO_MAX_COMPUTE_DISPATCH_WORK_GROUPS_X = 0x20, - NVN_DEVICE_INFO_MAX_COMPUTE_DISPATCH_WORK_GROUPS_Y = 0x21, - NVN_DEVICE_INFO_MAX_COMPUTE_DISPATCH_WORK_GROUPS_Z = 0x22, - NVN_DEVICE_INFO_IMAGE_BINDINGS_PER_STAGE = 0x23, - NVN_DEVICE_INFO_MAX_TEXTURE_POOL_SIZE = 0x24, - NVN_DEVICE_INFO_MAX_SAMPLER_POOL_SIZE = 0x25, - NVN_DEVICE_INFO_MAX_VIEWPORTS = 0x26, - NVN_DEVICE_INFO_MEMPOOL_TEXTURE_OBJECT_PAGE_ALIGNMENT = 0x27, - NVN_DEVICE_INFO_SUPPORTS_MIN_MAX_FILTERING = 0x28, - NVN_DEVICE_INFO_SUPPORTS_STENCIL8_FORMAT = 0x29, - NVN_DEVICE_INFO_SUPPORTS_ASTC_FORMATS = 0x2A, - NVN_DEVICE_INFO_L2_SIZE = 0x2B, - NVN_DEVICE_INFO_MAX_TEXTURE_LEVELS = 0x2C, - NVN_DEVICE_INFO_MAX_TEXTURE_LAYERS = 0x2D, - NVN_DEVICE_INFO_GLSLC_MAX_SUPPORTED_GPU_CODE_MAJOR_VERSION = 0x2E, - NVN_DEVICE_INFO_GLSLC_MIN_SUPPORTED_GPU_CODE_MAJOR_VERSION = 0x2F, - NVN_DEVICE_INFO_GLSLC_MAX_SUPPORTED_GPU_CODE_MINOR_VERSION = 0x30, - NVN_DEVICE_INFO_GLSLC_MIN_SUPPORTED_GPU_CODE_MINOR_VERSION = 0x31, - NVN_DEVICE_INFO_SUPPORTS_CONSERVATIVE_RASTER = 0x32, - NVN_DEVICE_INFO_SUBPIXEL_BITS = 0x33, - NVN_DEVICE_INFO_MAX_SUBPIXEL_BIAS_BITS = 0x34, - NVN_DEVICE_INFO_INDIRECT_DISPATCH_ALIGNMENT = 0x35, - NVN_DEVICE_INFO_ZCULL_SAVE_RESTORE_ALIGNMENT = 0x36, - NVN_DEVICE_INFO_SHADER_SCRATCH_MEMORY_COMPUTE_SCALE_FACTOR_MINIMUM = 0x37, - NVN_DEVICE_INFO_LINEAR_TEXTURE_STRIDE_ALIGNMENT = 0x38, - NVN_DEVICE_INFO_LINEAR_RENDER_TARGET_STRIDE_ALIGNMENT = 0x39, - NVN_DEVICE_INFO_MEMORY_POOL_PAGE_SIZE = 0x3A, - NVN_DEVICE_INFO_SUPPORTS_ZERO_FROM_UNMAPPED_VIRTUAL_POOL_PAGES = 0x3B, - NVN_DEVICE_INFO_UNIFORM_BUFFER_UPDATE_ALIGNMENT = 0x3C, - NVN_DEVICE_INFO_MAX_TEXTURE_SIZE = 0x3D, - NVN_DEVICE_INFO_MAX_BUFFER_TEXTURE_SIZE = 0x3E, - NVN_DEVICE_INFO_MAX_3D_TEXTURE_SIZE = 0x3F, - NVN_DEVICE_INFO_MAX_CUBE_MAP_TEXTURE_SIZE = 0x40, - NVN_DEVICE_INFO_MAX_RECTANGLE_TEXTURE_SIZE = 0x41, - NVN_DEVICE_INFO_SUPPORTS_PASSTHROUGH_GEOMETRY_SHADERS = 0x42, - NVN_DEVICE_INFO_SUPPORTS_VIEWPORT_SWIZZLE = 0x43, - NVN_DEVICE_INFO_SUPPORTS_SPARSE_TILED_PACKAGED_TEXTURES = 0x44, - NVN_DEVICE_INFO_SUPPORTS_ADVANCED_BLEND_MODES = 0x45, - NVN_DEVICE_INFO_MAX_PRESENT_INTERVAL = 0x46, - NVN_DEVICE_INFO_SUPPORTS_DRAW_TEXTURE = 0x47, - NVN_DEVICE_INFO_SUPPORTS_TARGET_INDEPENDENT_RASTERIZATION = 0x48, - NVN_DEVICE_INFO_SUPPORTS_FRAGMENT_COVERAGE_TO_COLOR = 0x49, - NVN_DEVICE_INFO_SUPPORTS_POST_DEPTH_COVERAGE = 0x4A, - NVN_DEVICE_INFO_SUPPORTS_IMAGES_USING_TEXTURE_HANDLES = 0x4B, - NVN_DEVICE_INFO_SUPPORTS_SAMPLE_LOCATIONS = 0x4C, - NVN_DEVICE_INFO_MAX_SAMPLE_LOCATION_TABLE_ENTRIES = 0x4D, - NVN_DEVICE_INFO_SHADER_CODE_MEMORY_POOL_PADDING_SIZE = 0x4E, - NVN_DEVICE_INFO_MAX_PATCH_SIZE = 0x4F, - NVN_DEVICE_INFO_QUEUE_COMMAND_MEMORY_GRANULARITY = 0x50, - NVN_DEVICE_INFO_QUEUE_COMMAND_MEMORY_MIN_SIZE = 0x51, - NVN_DEVICE_INFO_QUEUE_COMMAND_MEMORY_DEFAULT_SIZE = 0x52, - NVN_DEVICE_INFO_QUEUE_COMPUTE_MEMORY_GRANULARITY = 0x53, - NVN_DEVICE_INFO_QUEUE_COMPUTE_MEMORY_MIN_SIZE = 0x54, - NVN_DEVICE_INFO_QUEUE_COMPUTE_MEMORY_DEFAULT_SIZE = 0x55, - NVN_DEVICE_INFO_QUEUE_COMMAND_MEMORY_MIN_FLUSH_THRESHOLD = 0x56, - NVN_DEVICE_INFO_SUPPORTS_FRAGMENT_SHADER_INTERLOCK = 0x57, - NVN_DEVICE_INFO_MAX_TEXTURES_PER_WINDOW = 0x58, - NVN_DEVICE_INFO_MIN_TEXTURES_PER_WINDOW = 0x59, - NVN_DEVICE_INFO_SUPPORTS_DEBUG_LAYER = 0x5A, - NVN_DEVICE_INFO_QUEUE_CONTROL_MEMORY_MIN_SIZE = 0x5B, - NVN_DEVICE_INFO_QUEUE_CONTROL_MEMORY_DEFAULT_SIZE = 0x5C, - NVN_DEVICE_INFO_QUEUE_CONTROL_MEMORY_GRANULARITY = 0x5D, - NVN_DEVICE_INFO_SEPARATE_TEXTURE_BINDINGS_PER_STAGE = 0x5E, - NVN_DEVICE_INFO_SEPARATE_SAMPLER_BINDINGS_PER_STAGE = 0x5F, - NVN_DEVICE_INFO_DEBUG_GROUPS_MAX_DOMAIN_ID = 0x60, - NVN_DEVICE_INFO_EVENTS_SUPPORT_REDUCTION_OPERATIONS = 0x61, - - NVN_DEVICE_INFO_LARGE = 0x7FFFFFFF -} NVNdeviceInfo; - -typedef enum { - NVN_DEVICE_FLAG_DEBUG_ENABLE = 0x1, - NVN_DEVICE_FLAG_DEBUG_SKIP_CALLS_ON_ERROR = 0x2, - NVN_DEVICE_FLAG_DEBUG_DRAW_VALIDATION = 0x4, - NVN_DEVICE_FLAG_DEFERRED_FINALIZE = 0x8, - NVN_DEVICE_FLAG_DEBUG_DRAW_VALIDATION_HEAVY = 0x10, - NVN_DEVICE_FLAG_DEBUG_ENABLE_LEVEL_0 = 0x20, - NVN_DEVICE_FLAG_DEBUG_ENABLE_LEVEL_1 = 0x40, - NVN_DEVICE_FLAG_DEBUG_ENABLE_LEVEL_2 = 0x1, - NVN_DEVICE_FLAG_DEBUG_ENABLE_LEVEL_3 = 0x4, - NVN_DEVICE_FLAG_DEBUG_ENABLE_LEVEL_4 = 0x10, - NVN_DEVICE_FLAG_DEFERRED_FIRMWARE_MEMORY_RECLAIM = 0x80, - NVN_DEVICE_FLAG_ENABLE_SEPARATE_SAMPLER_TEXTURE_SUPPORT = 0x100, - - NVN_DEVICE_FLAG_LARGE = 0x7FFFFFFF -} NVNdeviceFlagBits; - -typedef enum { - NVN_DEBUG_CALLBACK_SOURCE_API = 0x0, - - NVN_DEBUG_CALLBACK_SOURCE_LARGE = 0x7FFFFFFF -} NVNdebugCallbackSource; - -typedef enum { - NVN_DEBUG_CALLBACK_TYPE_API_ERROR = 0x0, - NVN_DEBUG_CALLBACK_TYPE_API_WARNING = 0x1, - - NVN_DEBUG_CALLBACK_TYPE_LARGE = 0x7FFFFFFF -} NVNdebugCallbackType; - -typedef enum { - NVN_DEBUG_CALLBACK_SEVERITY_HIGH = 0x0, - NVN_DEBUG_CALLBACK_SEVERITY_MEDIUM = 0x1, - NVN_DEBUG_CALLBACK_SEVERITY_LOW = 0x2, - NVN_DEBUG_CALLBACK_SEVERITY_NOTIFICATION = 0x3, - - NVN_DEBUG_CALLBACK_SEVERITY_LARGE = 0x7FFFFFFF -} NVNdebugCallbackSeverity; - -typedef enum { - NVN_WINDOW_ORIGIN_MODE_LOWER_LEFT = 0x0, - NVN_WINDOW_ORIGIN_MODE_UPPER_LEFT = 0x1, - - NVN_WINDOW_ORIGIN_MODE_LARGE = 0x7FFFFFFF -} NVNwindowOriginMode; - -typedef enum { - NVN_DEPTH_MODE_NEAR_IS_MINUS_W = 0x0, - NVN_DEPTH_MODE_NEAR_IS_ZERO = 0x1, - - NVN_DEPTH_MODE_LARGE = 0x7FFFFFFF -} NVNdepthMode; - -typedef enum { - NVN_FORMAT_NONE = 0x0, - NVN_FORMAT_R8 = 0x1, - NVN_FORMAT_R8SN = 0x2, - NVN_FORMAT_R8UI = 0x3, - NVN_FORMAT_R8I = 0x4, - NVN_FORMAT_R16F = 0x5, - NVN_FORMAT_R16 = 0x6, - NVN_FORMAT_R16SN = 0x7, - NVN_FORMAT_R16UI = 0x8, - NVN_FORMAT_R16I = 0x9, - NVN_FORMAT_R32F = 0xA, - NVN_FORMAT_R32UI = 0xB, - NVN_FORMAT_R32I = 0xC, - NVN_FORMAT_RG8 = 0xD, - NVN_FORMAT_RG8SN = 0xE, - NVN_FORMAT_RG8UI = 0xF, - NVN_FORMAT_RG8I = 0x10, - NVN_FORMAT_RG16F = 0x11, - NVN_FORMAT_RG16 = 0x12, - NVN_FORMAT_RG16SN = 0x13, - NVN_FORMAT_RG16UI = 0x14, - NVN_FORMAT_RG16I = 0x15, - NVN_FORMAT_RG32F = 0x16, - NVN_FORMAT_RG32UI = 0x17, - NVN_FORMAT_RG32I = 0x18, - NVN_FORMAT_RGB8 = 0x19, - NVN_FORMAT_RGB8SN = 0x1A, - NVN_FORMAT_RGB8UI = 0x1B, - NVN_FORMAT_RGB8I = 0x1C, - NVN_FORMAT_RGB16F = 0x1D, - NVN_FORMAT_RGB16 = 0x1E, - NVN_FORMAT_RGB16SN = 0x1F, - NVN_FORMAT_RGB16UI = 0x20, - NVN_FORMAT_RGB16I = 0x21, - NVN_FORMAT_RGB32F = 0x22, - NVN_FORMAT_RGB32UI = 0x23, - NVN_FORMAT_RGB32I = 0x24, - NVN_FORMAT_RGBA8 = 0x25, - NVN_FORMAT_RGBA8SN = 0x26, - NVN_FORMAT_RGBA8UI = 0x27, - NVN_FORMAT_RGBA8I = 0x28, - NVN_FORMAT_RGBA16F = 0x29, - NVN_FORMAT_RGBA16 = 0x2A, - NVN_FORMAT_RGBA16SN = 0x2B, - NVN_FORMAT_RGBA16UI = 0x2C, - NVN_FORMAT_RGBA16I = 0x2D, - NVN_FORMAT_RGBA32F = 0x2E, - NVN_FORMAT_RGBA32UI = 0x2F, - NVN_FORMAT_RGBA32I = 0x30, - NVN_FORMAT_STENCIL8 = 0x31, - NVN_FORMAT_DEPTH16 = 0x32, - NVN_FORMAT_DEPTH24 = 0x33, - NVN_FORMAT_DEPTH32F = 0x34, - NVN_FORMAT_DEPTH24_STENCIL8 = 0x35, - NVN_FORMAT_DEPTH32F_STENCIL8 = 0x36, - NVN_FORMAT_RGBX8_SRGB = 0x37, - NVN_FORMAT_RGBA8_SRGB = 0x38, - NVN_FORMAT_RGBA4 = 0x39, - NVN_FORMAT_RGB5 = 0x3A, - NVN_FORMAT_RGB5A1 = 0x3B, - NVN_FORMAT_RGB565 = 0x3C, - NVN_FORMAT_RGB10A2 = 0x3D, - NVN_FORMAT_RGB10A2UI = 0x3E, - NVN_FORMAT_R11G11B10F = 0x3F, - NVN_FORMAT_RGB9E5F = 0x40, - NVN_FORMAT_RGB_DXT1 = 0x41, - NVN_FORMAT_RGBA_DXT1 = 0x42, - NVN_FORMAT_RGBA_DXT3 = 0x43, - NVN_FORMAT_RGBA_DXT5 = 0x44, - NVN_FORMAT_RGB_DXT1_SRGB = 0x45, - NVN_FORMAT_RGBA_DXT1_SRGB = 0x46, - NVN_FORMAT_RGBA_DXT3_SRGB = 0x47, - NVN_FORMAT_RGBA_DXT5_SRGB = 0x48, - NVN_FORMAT_RGTC1_UNORM = 0x49, - NVN_FORMAT_RGTC1_SNORM = 0x4A, - NVN_FORMAT_RGTC2_UNORM = 0x4B, - NVN_FORMAT_RGTC2_SNORM = 0x4C, - NVN_FORMAT_BPTC_UNORM = 0x4D, - NVN_FORMAT_BPTC_UNORM_SRGB = 0x4E, - NVN_FORMAT_BPTC_SFLOAT = 0x4F, - NVN_FORMAT_BPTC_UFLOAT = 0x50, - NVN_FORMAT_R8_UI2F = 0x51, - NVN_FORMAT_R8_I2F = 0x52, - NVN_FORMAT_R16_UI2F = 0x53, - NVN_FORMAT_R16_I2F = 0x54, - NVN_FORMAT_R32_UI2F = 0x55, - NVN_FORMAT_R32_I2F = 0x56, - NVN_FORMAT_RG8_UI2F = 0x57, - NVN_FORMAT_RG8_I2F = 0x58, - NVN_FORMAT_RG16_UI2F = 0x59, - NVN_FORMAT_RG16_I2F = 0x5A, - NVN_FORMAT_RG32_UI2F = 0x5B, - NVN_FORMAT_RG32_I2F = 0x5C, - NVN_FORMAT_RGB8_UI2F = 0x5D, - NVN_FORMAT_RGB8_I2F = 0x5E, - NVN_FORMAT_RGB16_UI2F = 0x5F, - NVN_FORMAT_RGB16_I2F = 0x60, - NVN_FORMAT_RGB32_UI2F = 0x61, - NVN_FORMAT_RGB32_I2F = 0x62, - NVN_FORMAT_RGBA8_UI2F = 0x63, - NVN_FORMAT_RGBA8_I2F = 0x64, - NVN_FORMAT_RGBA16_UI2F = 0x65, - NVN_FORMAT_RGBA16_I2F = 0x66, - NVN_FORMAT_RGBA32_UI2F = 0x67, - NVN_FORMAT_RGBA32_I2F = 0x68, - NVN_FORMAT_RGB10A2SN = 0x69, - NVN_FORMAT_RGB10A2I = 0x6A, - NVN_FORMAT_RGB10A2_UI2F = 0x6B, - NVN_FORMAT_RGB10A2_I2F = 0x6C, - NVN_FORMAT_RGBX8 = 0x6D, - NVN_FORMAT_RGBX8SN = 0x6E, - NVN_FORMAT_RGBX8UI = 0x6F, - NVN_FORMAT_RGBX8I = 0x70, - NVN_FORMAT_RGBX16F = 0x71, - NVN_FORMAT_RGBX16 = 0x72, - NVN_FORMAT_RGBX16SN = 0x73, - NVN_FORMAT_RGBX16UI = 0x74, - NVN_FORMAT_RGBX16I = 0x75, - NVN_FORMAT_RGBX32F = 0x76, - NVN_FORMAT_RGBX32UI = 0x77, - NVN_FORMAT_RGBX32I = 0x78, - NVN_FORMAT_RGBA_ASTC_4x4 = 0x79, - NVN_FORMAT_RGBA_ASTC_5x4 = 0x7A, - NVN_FORMAT_RGBA_ASTC_5x5 = 0x7B, - NVN_FORMAT_RGBA_ASTC_6x5 = 0x7C, - NVN_FORMAT_RGBA_ASTC_6x6 = 0x7D, - NVN_FORMAT_RGBA_ASTC_8x5 = 0x7E, - NVN_FORMAT_RGBA_ASTC_8x6 = 0x7F, - NVN_FORMAT_RGBA_ASTC_8x8 = 0x80, - NVN_FORMAT_RGBA_ASTC_10x5 = 0x81, - NVN_FORMAT_RGBA_ASTC_10x6 = 0x82, - NVN_FORMAT_RGBA_ASTC_10x8 = 0x83, - NVN_FORMAT_RGBA_ASTC_10x10 = 0x84, - NVN_FORMAT_RGBA_ASTC_12x10 = 0x85, - NVN_FORMAT_RGBA_ASTC_12x12 = 0x86, - NVN_FORMAT_RGBA_ASTC_4x4_SRGB = 0x87, - NVN_FORMAT_RGBA_ASTC_5x4_SRGB = 0x88, - NVN_FORMAT_RGBA_ASTC_5x5_SRGB = 0x89, - NVN_FORMAT_RGBA_ASTC_6x5_SRGB = 0x8A, - NVN_FORMAT_RGBA_ASTC_6x6_SRGB = 0x8B, - NVN_FORMAT_RGBA_ASTC_8x5_SRGB = 0x8C, - NVN_FORMAT_RGBA_ASTC_8x6_SRGB = 0x8D, - NVN_FORMAT_RGBA_ASTC_8x8_SRGB = 0x8E, - NVN_FORMAT_RGBA_ASTC_10x5_SRGB = 0x8F, - NVN_FORMAT_RGBA_ASTC_10x6_SRGB = 0x90, - NVN_FORMAT_RGBA_ASTC_10x8_SRGB = 0x91, - NVN_FORMAT_RGBA_ASTC_10x10_SRGB = 0x92, - NVN_FORMAT_RGBA_ASTC_12x10_SRGB = 0x93, - NVN_FORMAT_RGBA_ASTC_12x12_SRGB = 0x94, - NVN_FORMAT_BGR565 = 0x95, - NVN_FORMAT_BGR5 = 0x96, - NVN_FORMAT_BGR5A1 = 0x97, - NVN_FORMAT_A1BGR5 = 0x98, - NVN_FORMAT_BGRX8 = 0x99, - NVN_FORMAT_BGRA8 = 0x9A, - NVN_FORMAT_BGRX8_SRGB = 0x9B, - NVN_FORMAT_BGRA8_SRGB = 0x9C, - - NVN_FORMAT_LARGE = 0x7FFFFFFF -} NVNformat; - -typedef enum { - NVN_DEBUG_OBJECT_TYPE_WINDOW = 0x0, - NVN_DEBUG_OBJECT_TYPE_QUEUE = 0x1, - NVN_DEBUG_OBJECT_TYPE_COMMAND_BUFFER = 0x2, - NVN_DEBUG_OBJECT_TYPE_MEMORY_POOL = 0x3, - NVN_DEBUG_OBJECT_TYPE_SYNC = 0x7, - NVN_DEBUG_OBJECT_TYPE_PROGRAM = 0x9, - NVN_DEBUG_OBJECT_TYPE_TEXTURE_POOL = 0xA, - NVN_DEBUG_OBJECT_TYPE_SAMPLER_POOL = 0xB, - - NVN_DEBUG_OBJECT_TYPE_LARGE = 0x7FFFFFFF -} NVNdebugObjectType; - -typedef enum { - NVN_QUEUE_GET_ERROR_RESULT_GPU_NO_ERROR = 0x0, - NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_UNKNOWN = 0x1, - NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_MMU_FAULT = 0x2, - NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_PBDMA_EXCEPTION = 0x3, - NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_ENGINE_EXCEPTION = 0x4, - NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_TIMEOUT = 0x5, - - NVN_QUEUE_GET_ERROR_RESULT_LARGE = 0x7FFFFFFF -} NVNqueueGetErrorResult; - -typedef enum { - NVN_QUEUE_BUILDER_FLAGS_NONE = 0x0, - NVN_QUEUE_BUILDER_FLAGS_NO_FRAGMENT_INTERLOCK = 0x1, - NVN_QUEUE_BUILDER_FLAGS_NO_ZCULL = 0x2, - - NVN_QUEUE_BUILDER_FLAGS_LARGE = 0x7FFFFFFF -} NVNqueueBuilderFlags; - -typedef enum { - NVN_QUEUE_ACQUIRE_TEXTURE_RESULT_SUCCESS = 0x0, - NVN_QUEUE_ACQUIRE_TEXTURE_RESULT_NATIVE_ERROR = 0x1, - - NVN_QUEUE_ACQUIRE_TEXTURE_RESULT_LARGE = 0x7FFFFFFF -} NVNqueueAcquireTextureResult; - -typedef enum { - NVN_WINDOW_ACQUIRE_TEXTURE_RESULT_SUCCESS = 0x0, - NVN_WINDOW_ACQUIRE_TEXTURE_RESULT_NATIVE_ERROR = 0x1, - - NVN_WINDOW_ACQUIRE_TEXTURE_RESULT_LARGE = 0x7FFFFFFF -} NVNwindowAcquireTextureResult; - -typedef enum { - NVN_MEMORY_POOL_FLAGS_CPU_NO_ACCESS = 0x1, - NVN_MEMORY_POOL_FLAGS_CPU_UNCACHED = 0x2, - NVN_MEMORY_POOL_FLAGS_CPU_CACHED = 0x4, - NVN_MEMORY_POOL_FLAGS_GPU_NO_ACCESS = 0x8, - NVN_MEMORY_POOL_FLAGS_GPU_UNCACHED = 0x10, - NVN_MEMORY_POOL_FLAGS_GPU_CACHED = 0x20, - NVN_MEMORY_POOL_FLAGS_SHADER_CODE = 0x40, - NVN_MEMORY_POOL_FLAGS_COMPRESSIBLE = 0x80, - NVN_MEMORY_POOL_FLAGS_PHYSICAL = 0x100, - NVN_MEMORY_POOL_FLAGS_VIRTUAL = 0x200, - - NVN_MEMORY_POOL_FLAGS_LARGE = 0x7FFFFFFF -} NVNmemoryPoolFlags; - -typedef enum { - NVN_TEXTURE_SWIZZLE_ZERO = 0x0, - NVN_TEXTURE_SWIZZLE_ONE = 0x1, - NVN_TEXTURE_SWIZZLE_R = 0x2, - NVN_TEXTURE_SWIZZLE_G = 0x3, - NVN_TEXTURE_SWIZZLE_B = 0x4, - NVN_TEXTURE_SWIZZLE_A = 0x5, - - NVN_TEXTURE_SWIZZLE_LARGE = 0x7FFFFFFF -} NVNtextureSwizzle; - -typedef enum { - NVN_SHADER_STAGE_VERTEX = 0x0, - NVN_SHADER_STAGE_FRAGMENT = 0x1, - NVN_SHADER_STAGE_GEOMETRY = 0x2, - NVN_SHADER_STAGE_TESS_CONTROL = 0x3, - NVN_SHADER_STAGE_TESS_EVALUATION = 0x4, - NVN_SHADER_STAGE_COMPUTE = 0x5, - - NVN_SHADER_STAGE_LARGE = 0x7FFFFFFF -} NVNshaderStage; - -typedef enum { - NVN_EVENT_WAIT_MODE_EQUAL = 0x0, - NVN_EVENT_WAIT_MODE_GEQUAL_WRAP = 0x1, - - NVN_EVENT_WAIT_MODE_LARGE = 0x7FFFFFFF -} NVNeventWaitMode; - -typedef enum { - NVN_EVENT_SIGNAL_MODE_WRITE = 0x0, - NVN_EVENT_SIGNAL_MODE_ADD = 0x1, - - NVN_EVENT_SIGNAL_MODE_LARGE = 0x7FFFFFFF -} NVNeventSignalMode; - -typedef enum { - NVN_EVENT_SIGNAL_LOCATION_TOP = 0x0, - NVN_EVENT_SIGNAL_LOCATION_VERTEX_PIPE = 0x1, - NVN_EVENT_SIGNAL_LOCATION_BOTTOM = 0x2, - - NVN_EVENT_SIGNAL_LOCATION_LARGE = 0x7FFFFFFF -} NVNeventSignalLocation; - -typedef enum { - NVN_SYNC_CONDITION_ALL_GPU_COMMANDS_COMPLETE = 0x0, - NVN_SYNC_CONDITION_GRAPHICS_WORLD_SPACE_COMPLETE = 0x1, - - NVN_SYNC_CONDITION_LARGE = 0x7FFFFFFF -} NVNsyncCondition; - -typedef enum { - NVN_COUNTER_TYPE_TIMESTAMP = 0x0, - NVN_COUNTER_TYPE_SAMPLES_PASSED = 0x1, - NVN_COUNTER_TYPE_INPUT_VERTICES = 0x2, - NVN_COUNTER_TYPE_INPUT_PRIMITIVES = 0x3, - NVN_COUNTER_TYPE_VERTEX_SHADER_INVOCATIONS = 0x4, - NVN_COUNTER_TYPE_TESS_CONTROL_SHADER_INVOCATIONS = 0x5, - NVN_COUNTER_TYPE_TESS_EVALUATION_SHADER_INVOCATIONS = 0x6, - NVN_COUNTER_TYPE_GEOMETRY_SHADER_INVOCATIONS = 0x7, - NVN_COUNTER_TYPE_FRAGMENT_SHADER_INVOCATIONS = 0x8, - NVN_COUNTER_TYPE_TESS_EVALUATION_SHADER_PRIMITIVES = 0x9, - NVN_COUNTER_TYPE_GEOMETRY_SHADER_PRIMITIVES = 0xA, - NVN_COUNTER_TYPE_CLIPPER_INPUT_PRIMITIVES = 0xB, - NVN_COUNTER_TYPE_CLIPPER_OUTPUT_PRIMITIVES = 0xC, - NVN_COUNTER_TYPE_PRIMITIVES_GENERATED = 0xD, - NVN_COUNTER_TYPE_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0xE, - NVN_COUNTER_TYPE_ZCULL_STATS = 0xF, - NVN_COUNTER_TYPE_TIMESTAMP_TOP = 0x10, - - NVN_COUNTER_TYPE_LARGE = 0x7FFFFFFF -} NVNcounterType; - -typedef enum { - NVN_FACE_NONE = 0x0, - NVN_FACE_FRONT = 0x1, - NVN_FACE_BACK = 0x2, - NVN_FACE_FRONT_AND_BACK = 0x3, - - NVN_FACE_LARGE = 0x7FFFFFFF -} NVNface; - -typedef enum { - NVN_COMMAND_BUFFER_MEMORY_EVENT_OUT_OF_COMMAND_MEMORY = 0x0, - NVN_COMMAND_BUFFER_MEMORY_EVENT_OUT_OF_CONTROL_MEMORY = 0x1, - - NVN_COMMAND_BUFFER_MEMORY_EVENT_LARGE = 0x7FFFFFFF -} NVNcommandBufferMemoryEvent; - -typedef enum { - NVN_DRAW_PRIMITIVE_POINTS = 0x0, - NVN_DRAW_PRIMITIVE_LINES = 0x1, - NVN_DRAW_PRIMITIVE_LINE_LOOP = 0x2, - NVN_DRAW_PRIMITIVE_LINE_STRIP = 0x3, - NVN_DRAW_PRIMITIVE_TRIANGLES = 0x4, - NVN_DRAW_PRIMITIVE_TRIANGLE_STRIP = 0x5, - NVN_DRAW_PRIMITIVE_TRIANGLE_FAN = 0x6, - NVN_DRAW_PRIMITIVE_QUADS = 0x7, - NVN_DRAW_PRIMITIVE_QUAD_STRIP = 0x8, - NVN_DRAW_PRIMITIVE_POLYGON = 0x9, - NVN_DRAW_PRIMITIVE_LINES_ADJACENCY = 0xA, - NVN_DRAW_PRIMITIVE_LINE_STRIP_ADJACENCY = 0xB, - NVN_DRAW_PRIMITIVE_TRIANGLES_ADJACENCY = 0xC, - NVN_DRAW_PRIMITIVE_TRIANGLE_STRIP_ADJACENCY = 0xD, - NVN_DRAW_PRIMITIVE_PATCHES = 0xE, - - NVN_DRAW_PRIMITIVE_LARGE = 0x7FFFFFFF -} NVNdrawPrimitive; - -typedef enum { - NVN_INDEX_TYPE_UNSIGNED_BYTE = 0x0, - NVN_INDEX_TYPE_UNSIGNED_SHORT = 0x1, - NVN_INDEX_TYPE_UNSIGNED_INT = 0x2, - - NVN_INDEX_TYPE_LARGE = 0x7FFFFFFF -} NVNindexType; - -typedef enum { - NVN_TEXTURE_FLAGS_DISPLAY = 0x1, - NVN_TEXTURE_FLAGS_VIDEO_DECODE = 0x2, - NVN_TEXTURE_FLAGS_IMAGE = 0x4, - NVN_TEXTURE_FLAGS_COMPRESSIBLE = 0x8, - NVN_TEXTURE_FLAGS_LINEAR = 0x10, - NVN_TEXTURE_FLAGS_SPARSE = 0x20, - NVN_TEXTURE_FLAGS_LINEAR_RENDER_TARGET = 0x40, - NVN_TEXTURE_FLAGS_ADAPTIVE_ZCULL = 0x80, - NVN_TEXTURE_FLAGS_DEPTH16_PREFER_FAST_CLEAR = 0x100, - NVN_TEXTURE_FLAGS_MINIMAL_LAYOUT = 0x200, - NVN_TEXTURE_FLAGS_ZCULL_SUPPORT_STENCIL = 0x400, - - NVN_TEXTURE_FLAGS_LARGE = 0x7FFFFFFF -} NVNtextureFlags; - -typedef enum { - NVN_TEXTURE_TARGET_1D = 0x0, - NVN_TEXTURE_TARGET_2D = 0x1, - NVN_TEXTURE_TARGET_3D = 0x2, - NVN_TEXTURE_TARGET_1D_ARRAY = 0x3, - NVN_TEXTURE_TARGET_2D_ARRAY = 0x4, - NVN_TEXTURE_TARGET_2D_MULTISAMPLE = 0x5, - NVN_TEXTURE_TARGET_2D_MULTISAMPLE_ARRAY = 0x6, - NVN_TEXTURE_TARGET_RECTANGLE = 0x7, - NVN_TEXTURE_TARGET_CUBEMAP = 0x8, - NVN_TEXTURE_TARGET_CUBEMAP_ARRAY = 0x9, - NVN_TEXTURE_TARGET_BUFFER = 0xA, - - NVN_TEXTURE_TARGET_LARGE = 0x7FFFFFFF -} NVNtextureTarget; - -typedef enum { - NVN_TEXTURE_DEPTH_STENCIL_MODE_DEPTH = 0x0, - NVN_TEXTURE_DEPTH_STENCIL_MODE_STENCIL = 0x1, - - NVN_TEXTURE_DEPTH_STENCIL_MODE_LARGE = 0x7FFFFFFF -} NVNtextureDepthStencilMode; - -typedef enum { - NVN_LOGIC_OP_CLEAR = 0x0, - NVN_LOGIC_OP_AND = 0x1, - NVN_LOGIC_OP_AND_REVERSE = 0x2, - NVN_LOGIC_OP_COPY = 0x3, - NVN_LOGIC_OP_AND_INVERTED = 0x4, - NVN_LOGIC_OP_NOOP = 0x5, - NVN_LOGIC_OP_XOR = 0x6, - NVN_LOGIC_OP_OR = 0x7, - NVN_LOGIC_OP_NOR = 0x8, - NVN_LOGIC_OP_EQUIV = 0x9, - NVN_LOGIC_OP_INVERT = 0xA, - NVN_LOGIC_OP_OR_REVERSE = 0xB, - NVN_LOGIC_OP_COPY_INVERTED = 0xC, - NVN_LOGIC_OP_OR_INVERTED = 0xD, - NVN_LOGIC_OP_NAND = 0xE, - NVN_LOGIC_OP_SET = 0xF, - - NVN_LOGIC_OP_LARGE = 0x7FFFFFFF -} NVNlogicOp; - -typedef enum { - NVN_ALPHA_FUNC_NEVER = 0x1, - NVN_ALPHA_FUNC_LESS = 0x2, - NVN_ALPHA_FUNC_EQUAL = 0x3, - NVN_ALPHA_FUNC_LEQUAL = 0x4, - NVN_ALPHA_FUNC_GREATER = 0x5, - NVN_ALPHA_FUNC_NOTEQUAL = 0x6, - NVN_ALPHA_FUNC_GEQUAL = 0x7, - NVN_ALPHA_FUNC_ALWAYS = 0x8, - - NVN_ALPHA_FUNC_LARGE = 0x7FFFFFFF -} NVNalphaFunc; - -typedef enum { - NVN_BLEND_ADVANCED_MODE_NONE = 0x0, - NVN_BLEND_ADVANCED_MODE_ZERO = 0x5, - NVN_BLEND_ADVANCED_MODE_SRC = 0x6, - NVN_BLEND_ADVANCED_MODE_DST = 0x7, - NVN_BLEND_ADVANCED_MODE_SRC_OVER = 0x8, - NVN_BLEND_ADVANCED_MODE_DST_OVER = 0x9, - NVN_BLEND_ADVANCED_MODE_SRC_IN = 0xA, - NVN_BLEND_ADVANCED_MODE_DST_IN = 0xB, - NVN_BLEND_ADVANCED_MODE_SRC_OUT = 0xC, - NVN_BLEND_ADVANCED_MODE_DST_OUT = 0xD, - NVN_BLEND_ADVANCED_MODE_SRC_ATOP = 0xE, - NVN_BLEND_ADVANCED_MODE_DST_ATOP = 0xF, - NVN_BLEND_ADVANCED_MODE_XOR = 0x10, - NVN_BLEND_ADVANCED_MODE_PLUS = 0x11, - NVN_BLEND_ADVANCED_MODE_PLUS_CLAMPED = 0x12, - NVN_BLEND_ADVANCED_MODE_PLUS_CLAMPED_ALPHA = 0x13, - NVN_BLEND_ADVANCED_MODE_PLUS_DARKER = 0x14, - NVN_BLEND_ADVANCED_MODE_MULTIPLY = 0x15, - NVN_BLEND_ADVANCED_MODE_SCREEN = 0x16, - NVN_BLEND_ADVANCED_MODE_OVERLAY = 0x17, - NVN_BLEND_ADVANCED_MODE_DARKEN = 0x18, - NVN_BLEND_ADVANCED_MODE_LIGHTEN = 0x19, - NVN_BLEND_ADVANCED_MODE_COLORDODGE = 0x1A, - NVN_BLEND_ADVANCED_MODE_COLORBURN = 0x1B, - NVN_BLEND_ADVANCED_MODE_HARDLIGHT = 0x1C, - NVN_BLEND_ADVANCED_MODE_SOFTLIGHT = 0x1D, - NVN_BLEND_ADVANCED_MODE_DIFFERENCE = 0x1E, - NVN_BLEND_ADVANCED_MODE_MINUS = 0x1F, - NVN_BLEND_ADVANCED_MODE_MINUS_CLAMPED = 0x20, - NVN_BLEND_ADVANCED_MODE_EXCLUSION = 0x21, - NVN_BLEND_ADVANCED_MODE_CONTRAST = 0x22, - NVN_BLEND_ADVANCED_MODE_INVERT = 0x23, - NVN_BLEND_ADVANCED_MODE_INVERT_RGB = 0x24, - NVN_BLEND_ADVANCED_MODE_INVERT_OVG = 0x25, - NVN_BLEND_ADVANCED_MODE_LINEARDODGE = 0x26, - NVN_BLEND_ADVANCED_MODE_LINEARBURN = 0x27, - NVN_BLEND_ADVANCED_MODE_VIVIDLIGHT = 0x28, - NVN_BLEND_ADVANCED_MODE_LINEARLIGHT = 0x29, - NVN_BLEND_ADVANCED_MODE_PINLIGHT = 0x2A, - NVN_BLEND_ADVANCED_MODE_HARDMIX = 0x2B, - NVN_BLEND_ADVANCED_MODE_RED = 0x2C, - NVN_BLEND_ADVANCED_MODE_GREEN = 0x2D, - NVN_BLEND_ADVANCED_MODE_BLUE = 0x2E, - NVN_BLEND_ADVANCED_MODE_HSL_HUE = 0x2F, - NVN_BLEND_ADVANCED_MODE_HSL_SATURATION = 0x30, - NVN_BLEND_ADVANCED_MODE_HSL_COLOR = 0x31, - NVN_BLEND_ADVANCED_MODE_HSL_LUMINOSITY = 0x32, - - NVN_BLEND_ADVANCED_MODE_LARGE = 0x7FFFFFFF -} NVNblendAdvancedMode; - -typedef enum { - NVN_MIN_FILTER_NEAREST = 0x0, - NVN_MIN_FILTER_LINEAR = 0x1, - NVN_MIN_FILTER_NEAREST_MIPMAP_NEAREST = 0x2, - NVN_MIN_FILTER_LINEAR_MIPMAP_NEAREST = 0x3, - NVN_MIN_FILTER_NEAREST_MIPMAP_LINEAR = 0x4, - NVN_MIN_FILTER_LINEAR_MIPMAP_LINEAR = 0x5, - - NVN_MIN_FILTER_LARGE = 0x7FFFFFFF -} NVNminFilter; - -typedef enum { - NVN_MAG_FILTER_NEAREST = 0x0, - NVN_MAG_FILTER_LINEAR = 0x1, - - NVN_MAG_FILTER_LARGE = 0x7FFFFFFF -} NVNmagFilter; - -typedef enum { - NVN_WRAP_MODE_CLAMP = 0x0, - NVN_WRAP_MODE_REPEAT = 0x1, - NVN_WRAP_MODE_MIRROR_CLAMP = 0x2, - NVN_WRAP_MODE_MIRROR_CLAMP_TO_EDGE = 0x3, - NVN_WRAP_MODE_MIRROR_CLAMP_TO_BORDER = 0x4, - NVN_WRAP_MODE_CLAMP_TO_BORDER = 0x5, - NVN_WRAP_MODE_MIRRORED_REPEAT = 0x6, - NVN_WRAP_MODE_CLAMP_TO_EDGE = 0x7, - - NVN_WRAP_MODE_LARGE = 0x7FFFFFFF -} NVNwrapMode; - -typedef enum { - NVN_COMPARE_MODE_NONE = 0x0, - NVN_COMPARE_MODE_COMPARE_R_TO_TEXTURE = 0x1, - - NVN_COMPARE_MODE_LARGE = 0x7FFFFFFF -} NVNcompareMode; - -typedef enum { - NVN_COMPARE_FUNC_NEVER = 0x1, - NVN_COMPARE_FUNC_LESS = 0x2, - NVN_COMPARE_FUNC_EQUAL = 0x3, - NVN_COMPARE_FUNC_LEQUAL = 0x4, - NVN_COMPARE_FUNC_GREATER = 0x5, - NVN_COMPARE_FUNC_NOTEQUAL = 0x6, - NVN_COMPARE_FUNC_GEQUAL = 0x7, - NVN_COMPARE_FUNC_ALWAYS = 0x8, - - NVN_COMPARE_FUNC_LARGE = 0x7FFFFFFF -} NVNcompareFunc; - -typedef enum { - NVN_SAMPLER_REDUCTION_AVERAGE = 0x0, - NVN_SAMPLER_REDUCTION_MIN = 0x1, - NVN_SAMPLER_REDUCTION_MAX = 0x2, - - NVN_SAMPLER_REDUCTION_LARGE = 0x7FFFFFFF -} NVNsamplerReduction; - -typedef enum { - NVN_BLEND_FUNC_ZERO = 0x1, - NVN_BLEND_FUNC_ONE = 0x2, - NVN_BLEND_FUNC_SRC_COLOR = 0x3, - NVN_BLEND_FUNC_ONE_MINUS_SRC_COLOR = 0x4, - NVN_BLEND_FUNC_SRC_ALPHA = 0x5, - NVN_BLEND_FUNC_ONE_MINUS_SRC_ALPHA = 0x6, - NVN_BLEND_FUNC_DST_ALPHA = 0x7, - NVN_BLEND_FUNC_ONE_MINUS_DST_ALPHA = 0x8, - NVN_BLEND_FUNC_DST_COLOR = 0x9, - NVN_BLEND_FUNC_ONE_MINUS_DST_COLOR = 0xA, - NVN_BLEND_FUNC_SRC_ALPHA_SATURATE = 0xB, - NVN_BLEND_FUNC_SRC1_COLOR = 0x10, - NVN_BLEND_FUNC_ONE_MINUS_SRC1_COLOR = 0x11, - NVN_BLEND_FUNC_SRC1_ALPHA = 0x12, - NVN_BLEND_FUNC_ONE_MINUS_SRC1_ALPHA = 0x13, - NVN_BLEND_FUNC_CONSTANT_COLOR = 0x61, - NVN_BLEND_FUNC_ONE_MINUS_CONSTANT_COLOR = 0x62, - NVN_BLEND_FUNC_CONSTANT_ALPHA = 0x63, - NVN_BLEND_FUNC_ONE_MINUS_CONSTANT_ALPHA = 0x64, - - NVN_BLEND_FUNC_LARGE = 0x7FFFFFFF -} NVNblendFunc; - -typedef enum { - NVN_BLEND_EQUATION_ADD = 0x1, - NVN_BLEND_EQUATION_SUB = 0x2, - NVN_BLEND_EQUATION_REVERSE_SUB = 0x3, - NVN_BLEND_EQUATION_MIN = 0x4, - NVN_BLEND_EQUATION_MAX = 0x5, - - NVN_BLEND_EQUATION_LARGE = 0x7FFFFFFF -} NVNblendEquation; - -typedef enum { - NVN_BLEND_ADVANCED_OVERLAP_UNCORRELATED = 0x0, - NVN_BLEND_ADVANCED_OVERLAP_DISJOINT = 0x1, - NVN_BLEND_ADVANCED_OVERLAP_CONJOINT = 0x2, - - NVN_BLEND_ADVANCED_OVERLAP_LARGE = 0x7FFFFFFF -} NVNblendAdvancedOverlap; - -typedef enum { - NVN_COVERAGE_MODULATION_MODE_NONE = 0x0, - NVN_COVERAGE_MODULATION_MODE_RGB = 0x1, - NVN_COVERAGE_MODULATION_MODE_ALPHA = 0x2, - NVN_COVERAGE_MODULATION_MODE_RGBA = 0x3, - - NVN_COVERAGE_MODULATION_MODE_LARGE = 0x7FFFFFFF -} NVNcoverageModulationMode; - -typedef enum { - NVN_DEPTH_FUNC_NEVER = 0x1, - NVN_DEPTH_FUNC_LESS = 0x2, - NVN_DEPTH_FUNC_EQUAL = 0x3, - NVN_DEPTH_FUNC_LEQUAL = 0x4, - NVN_DEPTH_FUNC_GREATER = 0x5, - NVN_DEPTH_FUNC_NOTEQUAL = 0x6, - NVN_DEPTH_FUNC_GEQUAL = 0x7, - NVN_DEPTH_FUNC_ALWAYS = 0x8, - - NVN_DEPTH_FUNC_LARGE = 0x7FFFFFFF -} NVNdepthFunc; - -typedef enum { - NVN_STENCIL_FUNC_NEVER = 0x1, - NVN_STENCIL_FUNC_LESS = 0x2, - NVN_STENCIL_FUNC_EQUAL = 0x3, - NVN_STENCIL_FUNC_LEQUAL = 0x4, - NVN_STENCIL_FUNC_GREATER = 0x5, - NVN_STENCIL_FUNC_NOTEQUAL = 0x6, - NVN_STENCIL_FUNC_GEQUAL = 0x7, - NVN_STENCIL_FUNC_ALWAYS = 0x8, - - NVN_STENCIL_FUNC_LARGE = 0x7FFFFFFF -} NVNstencilFunc; - -typedef enum { - NVN_STENCIL_OP_KEEP = 0x1, - NVN_STENCIL_OP_ZERO = 0x2, - NVN_STENCIL_OP_REPLACE = 0x3, - NVN_STENCIL_OP_INCR = 0x4, - NVN_STENCIL_OP_DECR = 0x5, - NVN_STENCIL_OP_INVERT = 0x6, - NVN_STENCIL_OP_INCR_WRAP = 0x7, - NVN_STENCIL_OP_DECR_WRAP = 0x8, - - NVN_STENCIL_OP_LARGE = 0x7FFFFFFF -} NVNstencilOp; - -typedef enum { - NVN_FRONT_FACE_CW = 0x0, - NVN_FRONT_FACE_CCW = 0x1, - - NVN_FRONT_FACE_LARGE = 0x7FFFFFFF -} NVNfrontFace; - -typedef enum { - NVN_SYNC_WAIT_RESULT_ALREADY_SIGNALED = 0x0, - NVN_SYNC_WAIT_RESULT_CONDITION_SATISFIED = 0x1, - NVN_SYNC_WAIT_RESULT_TIMEOUT_EXPIRED = 0x2, - NVN_SYNC_WAIT_RESULT_FAILED = 0x3, - - NVN_SYNC_WAIT_RESULT_LARGE = 0x7FFFFFFF -} NVNsyncWaitResult; - -typedef enum { - NVN_POLYGON_OFFSET_ENABLE_NONE = 0x0, - NVN_POLYGON_OFFSET_ENABLE_POINT = 0x1, - NVN_POLYGON_OFFSET_ENABLE_LINE = 0x2, - NVN_POLYGON_OFFSET_ENABLE_FILL = 0x4, - - NVN_POLYGON_OFFSET_ENABLE_LARGE = 0x7FFFFFFF -} NVNpolygonOffsetEnable; - -typedef enum { - NVN_POLYGON_MODE_POINT = 0x0, - NVN_POLYGON_MODE_LINE = 0x1, - NVN_POLYGON_MODE_FILL = 0x2, - - NVN_POLYGON_MODE_LARGE = 0x7FFFFFFF -} NVNpolygonMode; - -typedef enum { - NVN_VIEWPORT_SWIZZLE_POSITIVE_X = 0x0, - NVN_VIEWPORT_SWIZZLE_NEGATIVE_X = 0x1, - NVN_VIEWPORT_SWIZZLE_POSITIVE_Y = 0x2, - NVN_VIEWPORT_SWIZZLE_NEGATIVE_Y = 0x3, - NVN_VIEWPORT_SWIZZLE_POSITIVE_Z = 0x4, - NVN_VIEWPORT_SWIZZLE_NEGATIVE_Z = 0x5, - NVN_VIEWPORT_SWIZZLE_POSITIVE_W = 0x6, - NVN_VIEWPORT_SWIZZLE_NEGATIVE_W = 0x7, - - NVN_VIEWPORT_SWIZZLE_LARGE = 0x7FFFFFFF -} NVNviewportSwizzle; - -typedef enum { - NVN_TILED_CACHE_ACTION_ENABLE = 0x1, - NVN_TILED_CACHE_ACTION_DISABLE = 0x2, - NVN_TILED_CACHE_ACTION_FLUSH = 0x3, - NVN_TILED_CACHE_ACTION_FLUSH_NO_TILING = 0x4, - NVN_TILED_CACHE_ACTION_ENABLE_RENDER_TARGET_BINNING = 0x5, - NVN_TILED_CACHE_ACTION_DISABLE_RENDER_TARGET_BINNING = 0x6, - - NVN_TILED_CACHE_ACTION_LARGE = 0x7FFFFFFF -} NVNtiledCacheAction; - -typedef enum { - NVN_CONDITIONAL_RENDER_MODE_RENDER_IF_EQUAL = 0x0, - NVN_CONDITIONAL_RENDER_MODE_RENDER_IF_NOT_EQUAL = 0x1, - - NVN_CONDITIONAL_RENDER_MODE_LARGE = 0x7FFFFFFF -} NVNconditionalRenderMode; - -typedef void (*NVNdummyProc)(void); -typedef void (*NVNcommandBufferMemoryCallback)(NVNcommandBuffer*, NVNcommandBufferMemoryEvent, - size_t, void*); -typedef void (*NVNdebugCallback)(NVNdebugCallbackSource source, NVNdebugCallbackType type, int id, - NVNdebugCallbackSeverity severity, const unsigned char* message, - void* user); -typedef void (*NVNwalkDebugDatabaseCallback)(void*, void*); - -#ifdef __cplusplus -} -#endif diff --git a/src_remove/lib/nnheaders/include/vapours/results.hpp b/src_remove/lib/nnheaders/include/vapours/results.hpp deleted file mode 100644 index f4533dd..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -/* Utilities. */ -#include - -/* Official. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Unofficial. */ -#include diff --git a/src_remove/lib/nnheaders/include/vapours/results/cal_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/cal_results.hpp deleted file mode 100644 index e465e8f..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/cal_results.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::cal { - - R_DEFINE_NAMESPACE_RESULT_MODULE(198); - - R_DEFINE_ERROR_RESULT(CalibrationDataCrcError, 101); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/capsrv_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/capsrv_results.hpp deleted file mode 100644 index 102dad3..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/capsrv_results.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2018-2019 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include - -namespace ams::capsrv { - - R_DEFINE_NAMESPACE_RESULT_MODULE(206); - - R_DEFINE_ERROR_RANGE(AlbumError, 2, 99); - R_DEFINE_ERROR_RESULT(AlbumWorkMemoryError, 3); - - R_DEFINE_ERROR_RESULT(AlbumAlreadyOpened, 7); - R_DEFINE_ERROR_RESULT(AlbumOutOfRange, 8); - - R_DEFINE_ERROR_RANGE(AlbumInvalidFileId, 10, 19); - R_DEFINE_ERROR_RESULT(AlbumInvalidApplicationId, 11); - R_DEFINE_ERROR_RESULT(AlbumInvalidTimestamp, 12); - R_DEFINE_ERROR_RESULT(AlbumInvalidStorage, 13); - R_DEFINE_ERROR_RESULT(AlbumInvalidFileContents, 14); - - R_DEFINE_ERROR_RESULT(AlbumIsNotMounted, 21); - R_DEFINE_ERROR_RESULT(AlbumIsFull, 22); - R_DEFINE_ERROR_RESULT(AlbumFileNotFound, 23); - R_DEFINE_ERROR_RESULT(AlbumInvalidFileData, 24); - R_DEFINE_ERROR_RESULT(AlbumFileCountLimit, 25); - R_DEFINE_ERROR_RESULT(AlbumFileNoThumbnail, 26); - - R_DEFINE_ERROR_RESULT(AlbumReadBufferShortage, 30); - - R_DEFINE_ERROR_RANGE(AlbumFileSystemError, 90, 99); - R_DEFINE_ERROR_RANGE(AlbumAccessCorrupted, 94, 96); - R_DEFINE_ERROR_RESULT(AlbumDestinationAccessCorrupted, 96); - - R_DEFINE_ERROR_RANGE(ControlError, 800, 899); - R_DEFINE_ERROR_RESULT(ControlResourceLimit, 820); - R_DEFINE_ERROR_RESULT(ControlNotOpened, 822); - - R_DEFINE_ERROR_RESULT(NotSupported, 1023); - - R_DEFINE_ERROR_RANGE(InternalError, 1024, 2047); - R_DEFINE_ERROR_RESULT(InternalJpegEncoderError, 1210); - R_DEFINE_ERROR_RESULT(InternalJpegWorkMemoryShortage, 1212); - - R_DEFINE_ERROR_RANGE(InternalFileDataVerificationError, 1300, 1399); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationEmptyFileData, 1301); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationExifExtractionFailed, 1302); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationExifAnalyzationFailed, 1303); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationDateTimeExtractionFailed, 1304); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInvalidDateTimeLength, 1305); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInconsistentDateTime, 1306); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationMakerNoteExtractionFailed, 1307); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInconsistentApplicationId, 1308); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInconsistentSignature, 1309); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationUnsupportedOrientation, 1310); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInvalidDataDimension, 1311); - R_DEFINE_ERROR_RESULT(InternalFileDataVerificationInconsistentOrientation, 1312); - - R_DEFINE_ERROR_RANGE(InternalAlbumLimitationError, 1400, 1499); - R_DEFINE_ERROR_RESULT(InternalAlbumLimitationFileCountLimit, 1401); - - R_DEFINE_ERROR_RANGE(InternalSignatureError, 1500, 1599); - R_DEFINE_ERROR_RESULT(InternalSignatureExifExtractionFailed, 1501); - R_DEFINE_ERROR_RESULT(InternalSignatureMakerNoteExtractionFailed, 1502); - - R_DEFINE_ERROR_RANGE(InternalAlbumSessionError, 1700, 1799); - R_DEFINE_ERROR_RESULT(InternalAlbumLimitationSessionCountLimit, 1701); - - R_DEFINE_ERROR_RANGE(InternalAlbumTemporaryFileError, 1900, 1999); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileCountLimit, 1901); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileCreateError, 1902); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileCreateRetryCountLimit, 1903); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileOpenError, 1904); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileGetFileSizeError, 1905); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileSetFileSizeError, 1906); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileReadFileError, 1907); - R_DEFINE_ERROR_RESULT(InternalAlbumTemporaryFileWriteFileError, 1908); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/creport_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/creport_results.hpp deleted file mode 100644 index 6a924b6..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/creport_results.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::creport { - - R_DEFINE_NAMESPACE_RESULT_MODULE(168); - - R_DEFINE_ERROR_RESULT(UndefinedInstruction, 0); - R_DEFINE_ERROR_RESULT(InstructionAbort, 1); - R_DEFINE_ERROR_RESULT(DataAbort, 2); - R_DEFINE_ERROR_RESULT(AlignmentFault, 3); - R_DEFINE_ERROR_RESULT(DebuggerAttached, 4); - R_DEFINE_ERROR_RESULT(BreakPoint, 5); - R_DEFINE_ERROR_RESULT(UserBreak, 6); - R_DEFINE_ERROR_RESULT(DebuggerBreak, 7); - R_DEFINE_ERROR_RESULT(UndefinedSystemCall, 8); - R_DEFINE_ERROR_RESULT(MemorySystemError, 9); - - R_DEFINE_ERROR_RESULT(IncompleteReport, 99); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/debug_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/debug_results.hpp deleted file mode 100644 index da2ed64..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/debug_results.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::dbg { - - R_DEFINE_NAMESPACE_RESULT_MODULE(183); - - R_DEFINE_ERROR_RESULT(CannotDebug, 1); - R_DEFINE_ERROR_RESULT(AlreadyAttached, 2); - R_DEFINE_ERROR_RESULT(Cancelled, 3); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/dmnt_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/dmnt_results.hpp deleted file mode 100644 index 95e2ed3..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/dmnt_results.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::dmnt { - - R_DEFINE_NAMESPACE_RESULT_MODULE(13); - - R_DEFINE_ERROR_RESULT(Unknown, 1); - R_DEFINE_ERROR_RESULT(DebuggingDisabled, 2); - - /* Atmosphere extension. */ - namespace cheat { - - R_DEFINE_ABSTRACT_ERROR_RANGE(CheatError, 6500, 6599); - R_DEFINE_ERROR_RESULT(CheatNotAttached, 6500); - R_DEFINE_ERROR_RESULT(CheatNullBuffer, 6501); - R_DEFINE_ERROR_RESULT(CheatInvalidBuffer, 6502); - R_DEFINE_ERROR_RESULT(CheatUnknownId, 6503); - R_DEFINE_ERROR_RESULT(CheatOutOfResource, 6504); - R_DEFINE_ERROR_RESULT(CheatInvalid, 6505); - R_DEFINE_ERROR_RESULT(CheatCannotDisable, 6506); - - R_DEFINE_ABSTRACT_ERROR_RANGE(FrozenAddressError, 6600, 6699); - R_DEFINE_ERROR_RESULT(FrozenAddressInvalidWidth, 6600); - R_DEFINE_ERROR_RESULT(FrozenAddressAlreadyExists, 6601); - R_DEFINE_ERROR_RESULT(FrozenAddressNotFound, 6602); - R_DEFINE_ERROR_RESULT(FrozenAddressOutOfResource, 6603); - - R_DEFINE_ABSTRACT_ERROR_RANGE(VirtualMachineError, 6700, 6799); - R_DEFINE_ERROR_RESULT(VirtualMachineInvalidConditionDepth, 6700); - - } - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/erpt_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/erpt_results.hpp deleted file mode 100644 index 4993474..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/erpt_results.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::erpt { - - R_DEFINE_NAMESPACE_RESULT_MODULE(147); - - R_DEFINE_ERROR_RESULT(NotInitialized, 1); - R_DEFINE_ERROR_RESULT(AlreadyInitialized, 2); - R_DEFINE_ERROR_RESULT(OutOfArraySpace, 3); - R_DEFINE_ERROR_RESULT(OutOfFieldSpace, 4); - R_DEFINE_ERROR_RESULT(OutOfMemory, 5); - R_DEFINE_ERROR_RESULT(InvalidArgument, 7); - R_DEFINE_ERROR_RESULT(NotFound, 8); - R_DEFINE_ERROR_RESULT(FieldCategoryMismatch, 9); - R_DEFINE_ERROR_RESULT(FieldTypeMismatch, 10); - R_DEFINE_ERROR_RESULT(AlreadyExists, 11); - R_DEFINE_ERROR_RESULT(CorruptJournal, 12); - R_DEFINE_ERROR_RESULT(CategoryNotFound, 13); - R_DEFINE_ERROR_RESULT(RequiredContextMissing, 14); - R_DEFINE_ERROR_RESULT(RequiredFieldMissing, 15); - R_DEFINE_ERROR_RESULT(FormatterError, 16); - R_DEFINE_ERROR_RESULT(InvalidPowerState, 17); - R_DEFINE_ERROR_RESULT(ArrayFieldTooLarge, 18); - R_DEFINE_ERROR_RESULT(AlreadyOwned, 19); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/err_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/err_results.hpp deleted file mode 100644 index 9aa60c0..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/err_results.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::err { - - R_DEFINE_NAMESPACE_RESULT_MODULE(162); - - R_DEFINE_ERROR_RESULT(ApplicationAborted, 1); - R_DEFINE_ERROR_RESULT(SystemModuleAborted, 2); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/exosphere_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/exosphere_results.hpp deleted file mode 100644 index c89c5d1..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/exosphere_results.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::exosphere { - - /* Please note: These results are all custom, and not official. */ - R_DEFINE_NAMESPACE_RESULT_MODULE(444); - - - /* Result 1-1000 reserved for Atmosphere. */ - R_DEFINE_ERROR_RESULT(NotPresent, 1); - R_DEFINE_ERROR_RESULT(VersionMismatch, 2); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/fatal_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/fatal_results.hpp deleted file mode 100644 index 27105d8..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/fatal_results.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::fatal { - - R_DEFINE_NAMESPACE_RESULT_MODULE(163); - - R_DEFINE_ERROR_RESULT(AllocationFailed, 1); - R_DEFINE_ERROR_RESULT(NullGraphicsBuffer, 2); - R_DEFINE_ERROR_RESULT(AlreadyThrown, 3); - R_DEFINE_ERROR_RESULT(TooManyEvents, 4); - R_DEFINE_ERROR_RESULT(InRepairWithoutVolHeld, 5); - R_DEFINE_ERROR_RESULT(InRepairWithoutTimeReviserCartridge, 6); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/fs_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/fs_results.hpp deleted file mode 100644 index 5128fb6..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/fs_results.hpp +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::fs { - - R_DEFINE_NAMESPACE_RESULT_MODULE(2); - - R_DEFINE_ERROR_RANGE(HandledByAllProcess, 0, 999); - R_DEFINE_ERROR_RESULT(PathNotFound, 1); - R_DEFINE_ERROR_RESULT(PathAlreadyExists, 2); - - R_DEFINE_ERROR_RESULT(TargetLocked, 7); - R_DEFINE_ERROR_RESULT(DirectoryNotEmpty, 8); - - R_DEFINE_ERROR_RANGE (NotEnoughFreeSpace, 30, 45); - R_DEFINE_ERROR_RANGE(NotEnoughFreeSpaceBis, 34, 38); - R_DEFINE_ERROR_RESULT(NotEnoughFreeSpaceBisCalibration, 35); - R_DEFINE_ERROR_RESULT(NotEnoughFreeSpaceBisSafe, 36); - R_DEFINE_ERROR_RESULT(NotEnoughFreeSpaceBisUser, 37); - R_DEFINE_ERROR_RESULT(NotEnoughFreeSpaceBisSystem, 38); - R_DEFINE_ERROR_RESULT(NotEnoughFreeSpaceSdCard, 39); - - R_DEFINE_ERROR_RESULT(UnsupportedSdkVersion, 50); - - R_DEFINE_ERROR_RESULT(MountNameAlreadyExists, 60); - - R_DEFINE_ERROR_RANGE(HandledBySystemProcess, 1000, 2999); - R_DEFINE_ERROR_RESULT(PartitionNotFound, 1001); - R_DEFINE_ERROR_RESULT(TargetNotFound, 1002); - - R_DEFINE_ERROR_RANGE(SdCardAccessFailed, 2000, 2499); - R_DEFINE_ERROR_RESULT(SdCardNotPresent, 2001); - - R_DEFINE_ERROR_RANGE(GameCardAccessFailed, 2500, 2999); - - R_DEFINE_ERROR_RESULT(NotImplemented, 3001); - R_DEFINE_ERROR_RESULT(UnsupportedVersion, 3002); - R_DEFINE_ERROR_RESULT(OutOfRange, 3005); - - R_DEFINE_ERROR_RESULT(SystemPartitionNotReady, 3100); - - R_DEFINE_ERROR_RANGE(AllocationFailure, 3200, 3499); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemAccessorA, 3211); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemAccessorB, 3212); - R_DEFINE_ERROR_RESULT(AllocationFailureInApplicationA, 3213); - R_DEFINE_ERROR_RESULT(AllocationFailureInBisA, 3215); - R_DEFINE_ERROR_RESULT(AllocationFailureInBisB, 3216); - R_DEFINE_ERROR_RESULT(AllocationFailureInBisC, 3217); - R_DEFINE_ERROR_RESULT(AllocationFailureInCodeA, 3218); - R_DEFINE_ERROR_RESULT(AllocationFailureInContentA, 3219); - R_DEFINE_ERROR_RESULT(AllocationFailureInContentStorageA, 3220); - R_DEFINE_ERROR_RESULT(AllocationFailureInContentStorageB, 3221); - R_DEFINE_ERROR_RESULT(AllocationFailureInDataA, 3222); - R_DEFINE_ERROR_RESULT(AllocationFailureInDataB, 3223); - R_DEFINE_ERROR_RESULT(AllocationFailureInDeviceSaveDataA, 3224); - R_DEFINE_ERROR_RESULT(AllocationFailureInGameCardA, 3225); - R_DEFINE_ERROR_RESULT(AllocationFailureInGameCardB, 3226); - R_DEFINE_ERROR_RESULT(AllocationFailureInGameCardC, 3227); - R_DEFINE_ERROR_RESULT(AllocationFailureInGameCardD, 3228); - R_DEFINE_ERROR_RESULT(AllocationFailureInImageDirectoryA, 3232); - R_DEFINE_ERROR_RESULT(AllocationFailureInSdCardA, 3244); - R_DEFINE_ERROR_RESULT(AllocationFailureInSdCardB, 3245); - R_DEFINE_ERROR_RESULT(AllocationFailureInSystemSaveDataA, 3246); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemA, 3247); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemB, 3248); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemC, 3249); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemProxyCoreImplD, 3256); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemProxyCoreImplE, 3257); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemCreatorA, 3280); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFileSystemCreatorA, 3281); - R_DEFINE_ERROR_RESULT(AllocationFailureInStorageOnNcaCreatorA, 3288); - R_DEFINE_ERROR_RESULT(AllocationFailureInStorageOnNcaCreatorB, 3289); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemBuddyHeapA, 3294); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemBufferManagerA, 3295); - R_DEFINE_ERROR_RESULT(AllocationFailureInBlockCacheBufferedStorageA, 3296); - R_DEFINE_ERROR_RESULT(AllocationFailureInBlockCacheBufferedStorageB, 3297); - R_DEFINE_ERROR_RESULT(AllocationFailureInIntegrityVerificationStorageA, 3304); - R_DEFINE_ERROR_RESULT(AllocationFailureInIntegrityVerificationStorageB, 3305); - R_DEFINE_ERROR_RESULT(AllocationFailureInDirectorySaveDataFileSystem, 3321); - R_DEFINE_ERROR_RESULT(AllocationFailureInNcaFileSystemDriverI, 3341); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemA, 3347); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemB, 3348); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemC, 3349); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemMetaA, 3350); - R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemMetaB, 3351); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemD, 3352); - R_DEFINE_ERROR_RESULT(AllocationFailureInSubDirectoryFileSystem, 3355); - R_DEFINE_ERROR_RESULT(AllocationFailureInNcaReaderA, 3363); - R_DEFINE_ERROR_RESULT(AllocationFailureInRegisterA, 3365); - R_DEFINE_ERROR_RESULT(AllocationFailureInRegisterB, 3366); - R_DEFINE_ERROR_RESULT(AllocationFailureInPathNormalizer, 3367); - R_DEFINE_ERROR_RESULT(AllocationFailureInDbmRomKeyValueStorage, 3375); - R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemE, 3377); - R_DEFINE_ERROR_RESULT(AllocationFailureInReadOnlyFileSystemA, 3386); - R_DEFINE_ERROR_RESULT(AllocationFailureInAesCtrCounterExtendedStorageA, 3399); - R_DEFINE_ERROR_RESULT(AllocationFailureInAesCtrCounterExtendedStorageB, 3400); - R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemInterfaceAdapter, 3407); - R_DEFINE_ERROR_RESULT(AllocationFailureInBufferedStorageA, 3411); - R_DEFINE_ERROR_RESULT(AllocationFailureInIntegrityRomFsStorageA, 3412); - R_DEFINE_ERROR_RESULT(AllocationFailureInNew, 3420); - R_DEFINE_ERROR_RESULT(AllocationFailureInMakeUnique, 3422); - R_DEFINE_ERROR_RESULT(AllocationFailureInAllocateShared, 3423); - R_DEFINE_ERROR_RESULT(AllocationFailurePooledBufferNotEnoughSize, 3424); - - R_DEFINE_ERROR_RANGE(Internal, 3000, 7999); - R_DEFINE_ERROR_RANGE(MmcAccessFailed, 3500, 3999); - - R_DEFINE_ERROR_RANGE(DataCorrupted, 4000, 4999); - R_DEFINE_ERROR_RANGE(RomCorrupted, 4001, 4299); - R_DEFINE_ERROR_RESULT(UnsupportedRomVersion, 4002); - - R_DEFINE_ERROR_RANGE(AesCtrCounterExtendedStorageCorrupted, 4011, 4019); - R_DEFINE_ERROR_RESULT(InvalidAesCtrCounterExtendedEntryOffset, 4012); - R_DEFINE_ERROR_RESULT(InvalidAesCtrCounterExtendedTableSize, 4013); - R_DEFINE_ERROR_RESULT(InvalidAesCtrCounterExtendedGeneration, 4014); - R_DEFINE_ERROR_RESULT(InvalidAesCtrCounterExtendedOffset, 4015); - - R_DEFINE_ERROR_RANGE(IndirectStorageCorrupted, 4021, 4029); - R_DEFINE_ERROR_RESULT(InvalidIndirectEntryOffset, 4022); - R_DEFINE_ERROR_RESULT(InvalidIndirectEntryStorageIndex, 4023); - R_DEFINE_ERROR_RESULT(InvalidIndirectStorageSize, 4024); - R_DEFINE_ERROR_RESULT(InvalidIndirectVirtualOffset, 4025); - R_DEFINE_ERROR_RESULT(InvalidIndirectPhysicalOffset, 4026); - R_DEFINE_ERROR_RESULT(InvalidIndirectStorageIndex, 4027); - - R_DEFINE_ERROR_RANGE(BucketTreeCorrupted, 4031, 4039); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeSignature, 4032); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeEntryCount, 4033); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeNodeEntryCount, 4034); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeNodeOffset, 4035); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeEntryOffset, 4036); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeEntrySetOffset, 4037); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeNodeIndex, 4038); - R_DEFINE_ERROR_RESULT(InvalidBucketTreeVirtualOffset, 4039); - - R_DEFINE_ERROR_RANGE(RomNcaCorrupted, 4041, 4139); - R_DEFINE_ERROR_RANGE(RomNcaFileSystemCorrupted, 4051, 4069); - R_DEFINE_ERROR_RESULT(InvalidRomNcaFileSystemType, 4052); - R_DEFINE_ERROR_RESULT(InvalidRomAcidFileSize, 4053); - R_DEFINE_ERROR_RESULT(InvalidRomAcidSize, 4054); - R_DEFINE_ERROR_RESULT(InvalidRomAcid, 4055); - R_DEFINE_ERROR_RESULT(RomAcidVerificationFailed, 4056); - R_DEFINE_ERROR_RESULT(InvalidRomNcaSignature, 4057); - R_DEFINE_ERROR_RESULT(RomNcaHeaderSignature1VerificationFailed, 4058); - R_DEFINE_ERROR_RESULT(RomNcaHeaderSignature2VerificationFailed, 4059); - R_DEFINE_ERROR_RESULT(RomNcaFsHeaderHashVerificationFailed, 4060); - R_DEFINE_ERROR_RESULT(InvalidRomNcaKeyIndex, 4061); - R_DEFINE_ERROR_RESULT(InvalidRomNcaFsHeaderHashType, 4062); - R_DEFINE_ERROR_RESULT(InvalidRomNcaFsHeaderEncryptionType, 4063); - - R_DEFINE_ERROR_RANGE(RomNcaHierarchicalSha256StorageCorrupted, 4071, 4079); - R_DEFINE_ERROR_RESULT(InvalidRomHierarchicalSha256BlockSize, 4072); - R_DEFINE_ERROR_RESULT(InvalidRomHierarchicalSha256LayerCount, 4073); - R_DEFINE_ERROR_RESULT(RomHierarchicalSha256BaseStorageTooLarge, 4074); - R_DEFINE_ERROR_RESULT(RomHierarchicalSha256HashVerificationFailed, 4075); - - R_DEFINE_ERROR_RANGE(RomIntegrityVerificationStorageCorrupted, 4141, 4179); - R_DEFINE_ERROR_RESULT(IncorrectRomIntegrityVerificationMagic, 4142); - R_DEFINE_ERROR_RESULT(InvalidRomZeroHash, 4143); - R_DEFINE_ERROR_RESULT(RomNonRealDataVerificationFailed, 4144); - R_DEFINE_ERROR_RESULT(InvalidRomHierarchicalIntegrityVerificationLayerCount, 4145); - - R_DEFINE_ERROR_RANGE(RomRealDataVerificationFailed, 4151, 4159); - R_DEFINE_ERROR_RESULT(ClearedRomRealDataVerificationFailed, 4152); - R_DEFINE_ERROR_RESULT(UnclearedRomRealDataVerificationFailed, 4153); - - R_DEFINE_ERROR_RANGE(RomPartitionFileSystemCorrupted, 4181, 4199); - R_DEFINE_ERROR_RESULT(InvalidRomSha256PartitionHashTarget, 4182); - R_DEFINE_ERROR_RESULT(RomSha256PartitionHashVerificationFailed, 4183); - R_DEFINE_ERROR_RESULT(RomPartitionSignatureVerificationFailed, 4184); - R_DEFINE_ERROR_RESULT(RomSha256PartitionSignatureVerificationFailed, 4185); - R_DEFINE_ERROR_RESULT(InvalidRomPartitionEntryOffset, 4186); - R_DEFINE_ERROR_RESULT(InvalidRomSha256PartitionMetaDataSize, 4187); - - R_DEFINE_ERROR_RANGE(RomBuiltInStorageCorrupted, 4201, 4219); - R_DEFINE_ERROR_RESULT(RomGptHeaderVerificationFailed, 4202); - - R_DEFINE_ERROR_RANGE(RomHostFileSystemCorrupted, 4241, 4259); - R_DEFINE_ERROR_RESULT(RomHostEntryCorrupted, 4242); - R_DEFINE_ERROR_RESULT(RomHostFileDataCorrupted, 4243); - R_DEFINE_ERROR_RESULT(RomHostFileCorrupted, 4244); - R_DEFINE_ERROR_RESULT(InvalidRomHostHandle, 4245); - - R_DEFINE_ERROR_RANGE(RomDatabaseCorrupted, 4261, 4279); - R_DEFINE_ERROR_RESULT(InvalidRomAllocationTableBlock, 4262); - R_DEFINE_ERROR_RESULT(InvalidRomKeyValueListElementIndex, 4263); - - R_DEFINE_ERROR_RANGE(SaveDataCorrupted, 4301, 4499); - R_DEFINE_ERROR_RANGE(NcaCorrupted, 4501, 4599); - R_DEFINE_ERROR_RESULT(NcaBaseStorageOutOfRangeA, 4508); - R_DEFINE_ERROR_RESULT(NcaBaseStorageOutOfRangeB, 4509); - - R_DEFINE_ERROR_RANGE(NcaFileSystemCorrupted, 4511, 4529); - R_DEFINE_ERROR_RESULT(InvalidNcaFileSystemType, 4512); - R_DEFINE_ERROR_RESULT(InvalidAcidFileSize, 4513); - R_DEFINE_ERROR_RESULT(InvalidAcidSize, 4514); - R_DEFINE_ERROR_RESULT(InvalidAcid, 4515); - R_DEFINE_ERROR_RESULT(AcidVerificationFailed, 4516); - R_DEFINE_ERROR_RESULT(InvalidNcaSignature, 4517); - R_DEFINE_ERROR_RESULT(NcaHeaderSignature1VerificationFailed, 4518); - R_DEFINE_ERROR_RESULT(NcaHeaderSignature2VerificationFailed, 4519); - R_DEFINE_ERROR_RESULT(NcaFsHeaderHashVerificationFailed, 4520); - R_DEFINE_ERROR_RESULT(InvalidNcaKeyIndex, 4521); - R_DEFINE_ERROR_RESULT(InvalidNcaFsHeaderHashType, 4522); - R_DEFINE_ERROR_RESULT(InvalidNcaFsHeaderEncryptionType, 4523); - R_DEFINE_ERROR_RESULT(InvalidNcaPatchInfoIndirectSize, 4524); - R_DEFINE_ERROR_RESULT(InvalidNcaPatchInfoAesCtrExSize, 4525); - R_DEFINE_ERROR_RESULT(InvalidNcaPatchInfoAesCtrExOffset, 4526); - R_DEFINE_ERROR_RESULT(InvalidNcaId, 4527); - R_DEFINE_ERROR_RESULT(InvalidNcaHeader, 4528); - R_DEFINE_ERROR_RESULT(InvalidNcaFsHeader, 4529); - - R_DEFINE_ERROR_RANGE(NcaHierarchicalSha256StorageCorrupted, 4531, 4539); - R_DEFINE_ERROR_RESULT(InvalidHierarchicalSha256BlockSize, 4532); - R_DEFINE_ERROR_RESULT(InvalidHierarchicalSha256LayerCount, 4533); - R_DEFINE_ERROR_RESULT(HierarchicalSha256BaseStorageTooLarge, 4534); - R_DEFINE_ERROR_RESULT(HierarchicalSha256HashVerificationFailed, 4535); - - /* TODO: Range? */ - R_DEFINE_ERROR_RESULT(InvalidNcaHeader1SignatureKeyGeneration, 4543); - - R_DEFINE_ERROR_RANGE(IntegrityVerificationStorageCorrupted, 4601, 4639); - R_DEFINE_ERROR_RESULT(IncorrectIntegrityVerificationMagic, 4602); - R_DEFINE_ERROR_RESULT(InvalidZeroHash, 4603); - R_DEFINE_ERROR_RESULT(NonRealDataVerificationFailed, 4604); - R_DEFINE_ERROR_RESULT(InvalidHierarchicalIntegrityVerificationLayerCount, 4605); - - R_DEFINE_ERROR_RANGE(RealDataVerificationFailed, 4611, 4619); - R_DEFINE_ERROR_RESULT(ClearedRealDataVerificationFailed, 4612); - R_DEFINE_ERROR_RESULT(UnclearedRealDataVerificationFailed, 4613); - - R_DEFINE_ERROR_RANGE(PartitionFileSystemCorrupted, 4641, 4659); - R_DEFINE_ERROR_RESULT(InvalidSha256PartitionHashTarget, 4642); - R_DEFINE_ERROR_RESULT(Sha256PartitionHashVerificationFailed, 4643); - R_DEFINE_ERROR_RESULT(PartitionSignatureVerificationFailed, 4644); - R_DEFINE_ERROR_RESULT(Sha256PartitionSignatureVerificationFailed, 4645); - R_DEFINE_ERROR_RESULT(InvalidPartitionEntryOffset, 4646); - R_DEFINE_ERROR_RESULT(InvalidSha256PartitionMetaDataSize, 4647); - - R_DEFINE_ERROR_RANGE(BuiltInStorageCorrupted, 4661, 4679); - R_DEFINE_ERROR_RESULT(GptHeaderVerificationFailed, 4662); - - R_DEFINE_ERROR_RANGE(FatFileSystemCorrupted, 4681, 4699); - - R_DEFINE_ERROR_RANGE(HostFileSystemCorrupted, 4701, 4719); - R_DEFINE_ERROR_RESULT(HostEntryCorrupted, 4702); - R_DEFINE_ERROR_RESULT(HostFileDataCorrupted, 4703); - R_DEFINE_ERROR_RESULT(HostFileCorrupted, 4704); - R_DEFINE_ERROR_RESULT(InvalidHostHandle, 4705); - - R_DEFINE_ERROR_RANGE(DatabaseCorrupted, 4721, 4739); - R_DEFINE_ERROR_RESULT(InvalidAllocationTableBlock, 4722); - R_DEFINE_ERROR_RESULT(InvalidKeyValueListElementIndex, 4723); - - R_DEFINE_ERROR_RANGE(AesXtsFileSystemCorrupted, 4741, 4759); - R_DEFINE_ERROR_RANGE(SaveDataTransferDataCorrupted, 4761, 4769); - R_DEFINE_ERROR_RANGE(SignedSystemPartitionDataCorrupted, 4771, 4779); - - R_DEFINE_ERROR_RESULT(GameCardLogoDataCorrupted, 4781); - - R_DEFINE_ERROR_RANGE(Unexpected, 5000, 5999); - R_DEFINE_ERROR_RESULT(UnexpectedInAesCtrStorageA, 5315); - R_DEFINE_ERROR_RESULT(UnexpectedInAesXtsStorageA, 5316); - R_DEFINE_ERROR_RESULT(UnexpectedInFindFileSystemA, 5319); - - R_DEFINE_ERROR_RANGE(PreconditionViolation, 6000, 6499); - R_DEFINE_ERROR_RANGE(InvalidArgument, 6001, 6199); - R_DEFINE_ERROR_RANGE(InvalidPath, 6002, 6029); - R_DEFINE_ERROR_RESULT(TooLongPath, 6003); - R_DEFINE_ERROR_RESULT(InvalidCharacter, 6004); - R_DEFINE_ERROR_RESULT(InvalidPathFormat, 6005); - R_DEFINE_ERROR_RESULT(DirectoryUnobtainable, 6006); - R_DEFINE_ERROR_RESULT(NotNormalized, 6007); - - R_DEFINE_ERROR_RANGE(InvalidPathForOperation, 6030, 6059); - R_DEFINE_ERROR_RESULT(DirectoryNotDeletable, 6031); - R_DEFINE_ERROR_RESULT(DirectoryNotRenamable, 6032); - R_DEFINE_ERROR_RESULT(IncompatiblePath, 6033); - R_DEFINE_ERROR_RESULT(RenameToOtherFileSystem, 6034); - - R_DEFINE_ERROR_RESULT(InvalidOffset, 6061); - R_DEFINE_ERROR_RESULT(InvalidSize, 6062); - R_DEFINE_ERROR_RESULT(NullptrArgument, 6063); - R_DEFINE_ERROR_RESULT(InvalidAlignment, 6064); - R_DEFINE_ERROR_RESULT(InvalidMountName, 6065); - - R_DEFINE_ERROR_RESULT(ExtensionSizeTooLarge, 6066); - R_DEFINE_ERROR_RESULT(ExtensionSizeInvalid, 6067); - - R_DEFINE_ERROR_RESULT(InvalidOpenMode, 6072); - - R_DEFINE_ERROR_RANGE(InvalidEnumValue, 6080, 6099); - R_DEFINE_ERROR_RESULT(InvalidSaveDataState, 6081); - R_DEFINE_ERROR_RESULT(InvalidSaveDataSpaceId, 6082); - - R_DEFINE_ERROR_RANGE(InvalidOperationForOpenMode, 6200, 6299); - R_DEFINE_ERROR_RESULT(FileExtensionWithoutOpenModeAllowAppend, 6201); - R_DEFINE_ERROR_RESULT(ReadNotPermitted, 6202); - R_DEFINE_ERROR_RESULT(WriteNotPermitted, 6203); - - R_DEFINE_ERROR_RANGE(UnsupportedOperation, 6300, 6399); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInSubStorageA, 6302); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInSubStorageB, 6303); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInMemoryStorageA, 6304); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInMemoryStorageB, 6305); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInFileStorageA, 6306); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInFileStorageB, 6307); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInSwitchStorageA, 6308); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrCounterExtendedStorageA, 6310); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrCounterExtendedStorageB, 6311); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrCounterExtendedStorageC, 6312); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrStorageExternalA, 6313); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrStorageExternalB, 6314); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInAesCtrStorageA, 6315); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInHierarchicalIntegrityVerificationStorageA, 6316); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInHierarchicalIntegrityVerificationStorageB, 6317); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIntegrityVerificationStorageA, 6318); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIntegrityVerificationStorageB, 6319); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIntegrityVerificationStorageC, 6320); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInBlockCacheBufferedStorageA, 6321); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInBlockCacheBufferedStorageB, 6322); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInBlockCacheBufferedStorageC, 6323); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIndirectStorageA, 6324); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIndirectStorageB, 6325); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIndirectStorageC, 6326); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInZeroStorageA, 6327); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInZeroStorageB, 6328); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInHierarchicalSha256StorageA, 6329); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyBlockCacheStorageA, 6330); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyBlockCacheStorageB, 6331); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInIntegrityRomFsStorageA , 6332); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInFileServiceObjectAdapterA, 6362); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemA, 6364); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemB, 6365); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemC, 6366); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileA, 6367); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileB, 6368); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyFileSystemTemplateA, 6369); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyFileSystemTemplateB, 6370); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyFileSystemTemplateC, 6371); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyFileA, 6372); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInReadOnlyFileB, 6373); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInPartitionFileSystemA, 6374); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInPartitionFileSystemB, 6375); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInPartitionFileA, 6376); - R_DEFINE_ERROR_RESULT(UnsupportedOperationInPartitionFileB, 6377); - - R_DEFINE_ERROR_RANGE(PermissionDenied, 6400, 6449); - - R_DEFINE_ERROR_RESULT(NeedFlush, 6454); - R_DEFINE_ERROR_RESULT(FileNotClosed, 6455); - R_DEFINE_ERROR_RESULT(DirectoryNotClosed, 6456); - R_DEFINE_ERROR_RESULT(WriteModeFileNotClosed, 6457); - R_DEFINE_ERROR_RESULT(AllocatorAlreadyRegistered, 6458); - R_DEFINE_ERROR_RESULT(DefaultAllocatorUsed, 6459); - R_DEFINE_ERROR_RESULT(AllocatorAlignmentViolation, 6461); - R_DEFINE_ERROR_RESULT(UserNotExist, 6465); - - R_DEFINE_ERROR_RANGE(NotFound, 6600, 6699); - - R_DEFINE_ERROR_RANGE(OutOfResource, 6700, 6799); - R_DEFINE_ERROR_RESULT(BufferAllocationFailed, 6705); - R_DEFINE_ERROR_RESULT(MappingTableFull, 6706); - R_DEFINE_ERROR_RESULT(OpenCountLimit, 6709); - - R_DEFINE_ERROR_RANGE(MappingFailed, 6800, 6899); - R_DEFINE_ERROR_RESULT(MapFull, 6811); - - R_DEFINE_ERROR_RANGE(BadState, 6900, 6999); - R_DEFINE_ERROR_RESULT(NotInitialized, 6902); - R_DEFINE_ERROR_RESULT(NotMounted, 6905); - - - R_DEFINE_ERROR_RANGE(DbmNotFound, 7901, 7904); - R_DEFINE_ERROR_RESULT(DbmKeyNotFound, 7902); - R_DEFINE_ERROR_RESULT(DbmFileNotFound, 7903); - R_DEFINE_ERROR_RESULT(DbmDirectoryNotFound, 7904); - - R_DEFINE_ERROR_RESULT(DbmAlreadyExists, 7906); - R_DEFINE_ERROR_RESULT(DbmKeyFull, 7907); - R_DEFINE_ERROR_RESULT(DbmDirectoryEntryFull, 7908); - R_DEFINE_ERROR_RESULT(DbmFileEntryFull, 7909); - - R_DEFINE_ERROR_RANGE(DbmFindFinished, 7910, 7912); - R_DEFINE_ERROR_RESULT(DbmFindKeyFinished, 7911); - R_DEFINE_ERROR_RESULT(DbmIterationFinished, 7912); - - R_DEFINE_ERROR_RESULT(DbmInvalidOperation, 7914); - R_DEFINE_ERROR_RESULT(DbmInvalidPathFormat, 7915); - R_DEFINE_ERROR_RESULT(DbmDirectoryNameTooLong, 7916); - R_DEFINE_ERROR_RESULT(DbmFileNameTooLong, 7917); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/hipc_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/hipc_results.hpp deleted file mode 100644 index dec237e..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/hipc_results.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::sf::hipc { - - R_DEFINE_NAMESPACE_RESULT_MODULE(11); - - R_DEFINE_ABSTRACT_ERROR_RANGE(OutOfResource, 100, 299); - R_DEFINE_ERROR_RESULT(OutOfSessionMemory, 102); - R_DEFINE_ERROR_RANGE (OutOfSessions, 131, 139); - R_DEFINE_ERROR_RESULT(PointerBufferTooSmall, 141); - - R_DEFINE_ERROR_RESULT(OutOfDomains, 200); - - R_DEFINE_ERROR_RESULT(SessionClosed, 301); - - R_DEFINE_ERROR_RESULT(InvalidRequestSize, 402); - R_DEFINE_ERROR_RESULT(UnknownCommandType, 403); - - R_DEFINE_ERROR_RESULT(InvalidCmifRequest, 420); - - R_DEFINE_ERROR_RESULT(TargetNotDomain, 491); - R_DEFINE_ERROR_RESULT(DomainObjectNotFound, 492); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/i2c_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/i2c_results.hpp deleted file mode 100644 index 62cb26e..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/i2c_results.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::i2c { - - R_DEFINE_NAMESPACE_RESULT_MODULE(101); - - R_DEFINE_ERROR_RESULT(NoAck, 1); - R_DEFINE_ERROR_RESULT(BusBusy, 2); - R_DEFINE_ERROR_RESULT(FullCommandList, 3); - R_DEFINE_ERROR_RESULT(TimedOut, 4); - R_DEFINE_ERROR_RESULT(UnknownDevice, 5); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/kvdb_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/kvdb_results.hpp deleted file mode 100644 index ba6731b..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/kvdb_results.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::kvdb { - - R_DEFINE_NAMESPACE_RESULT_MODULE(20); - - R_DEFINE_ERROR_RESULT(OutOfKeyResource, 1); - R_DEFINE_ERROR_RESULT(KeyNotFound, 2); - R_DEFINE_ERROR_RESULT(AllocationFailed, 4); - R_DEFINE_ERROR_RESULT(InvalidKeyValue, 5); - R_DEFINE_ERROR_RESULT(BufferInsufficient, 6); - - R_DEFINE_ERROR_RESULT(InvalidFilesystemState, 8); - R_DEFINE_ERROR_RESULT(NotCreated, 9); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/loader_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/loader_results.hpp deleted file mode 100644 index 1ffa7ae..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/loader_results.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::ldr { - - R_DEFINE_NAMESPACE_RESULT_MODULE(9); - - R_DEFINE_ERROR_RESULT(TooLongArgument, 1); - R_DEFINE_ERROR_RESULT(TooManyArguments, 2); - R_DEFINE_ERROR_RESULT(TooLargeMeta, 3); - R_DEFINE_ERROR_RESULT(InvalidMeta, 4); - R_DEFINE_ERROR_RESULT(InvalidNso, 5); - R_DEFINE_ERROR_RESULT(InvalidPath, 6); - R_DEFINE_ERROR_RESULT(TooManyProcesses, 7); - R_DEFINE_ERROR_RESULT(NotPinned, 8); - R_DEFINE_ERROR_RESULT(InvalidProgramId, 9); - R_DEFINE_ERROR_RESULT(InvalidVersion, 10); - R_DEFINE_ERROR_RESULT(InvalidAcidSignature, 11); - R_DEFINE_ERROR_RESULT(InvalidNcaSignature, 12); - - R_DEFINE_ERROR_RESULT(InsufficientAddressSpace, 51); - R_DEFINE_ERROR_RESULT(InvalidNro, 52); - R_DEFINE_ERROR_RESULT(InvalidNrr, 53); - R_DEFINE_ERROR_RESULT(InvalidSignature, 54); - R_DEFINE_ERROR_RESULT(InsufficientNroRegistrations, 55); - R_DEFINE_ERROR_RESULT(InsufficientNrrRegistrations, 56); - R_DEFINE_ERROR_RESULT(NroAlreadyLoaded, 57); - - R_DEFINE_ERROR_RESULT(InvalidAddress, 81); - R_DEFINE_ERROR_RESULT(InvalidSize, 82); - R_DEFINE_ERROR_RESULT(NotLoaded, 84); - R_DEFINE_ERROR_RESULT(NotRegistered, 85); - R_DEFINE_ERROR_RESULT(InvalidSession, 86); - R_DEFINE_ERROR_RESULT(InvalidProcess, 87); - - R_DEFINE_ERROR_RESULT(UnknownCapability, 100); - R_DEFINE_ERROR_RESULT(InvalidCapabilityKernelFlags, 103); - R_DEFINE_ERROR_RESULT(InvalidCapabilitySyscallMask, 104); - R_DEFINE_ERROR_RESULT(InvalidCapabilityMapRange, 106); - R_DEFINE_ERROR_RESULT(InvalidCapabilityMapPage, 107); - R_DEFINE_ERROR_RESULT(InvalidCapabilityInterruptPair, 111); - R_DEFINE_ERROR_RESULT(InvalidCapabilityApplicationType, 113); - R_DEFINE_ERROR_RESULT(InvalidCapabilityKernelVersion, 114); - R_DEFINE_ERROR_RESULT(InvalidCapabilityHandleTable, 115); - R_DEFINE_ERROR_RESULT(InvalidCapabilityDebugFlags, 116); - - R_DEFINE_ERROR_RESULT(InternalError, 200); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/lr_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/lr_results.hpp deleted file mode 100644 index 7458730..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/lr_results.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::lr { - - R_DEFINE_NAMESPACE_RESULT_MODULE(8); - - R_DEFINE_ERROR_RESULT(ProgramNotFound, 2); - R_DEFINE_ERROR_RESULT(DataNotFound, 3); - R_DEFINE_ERROR_RESULT(UnknownStorageId, 4); - R_DEFINE_ERROR_RESULT(HtmlDocumentNotFound, 6); - R_DEFINE_ERROR_RESULT(AddOnContentNotFound, 7); - R_DEFINE_ERROR_RESULT(ControlNotFound, 8); - R_DEFINE_ERROR_RESULT(LegalInformationNotFound, 9); - R_DEFINE_ERROR_RESULT(DebugProgramNotFound, 10); - - R_DEFINE_ERROR_RESULT(TooManyRegisteredPaths, 90); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/ncm_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/ncm_results.hpp deleted file mode 100644 index a1885b3..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/ncm_results.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::ncm { - - R_DEFINE_NAMESPACE_RESULT_MODULE(5); - - R_DEFINE_ERROR_RESULT(InvalidContentStorageBase, 1); - R_DEFINE_ERROR_RESULT(PlaceHolderAlreadyExists, 2); - R_DEFINE_ERROR_RESULT(PlaceHolderNotFound, 3); - R_DEFINE_ERROR_RESULT(ContentAlreadyExists, 4); - R_DEFINE_ERROR_RESULT(ContentNotFound, 5); - R_DEFINE_ERROR_RESULT(ContentMetaNotFound, 7); - R_DEFINE_ERROR_RESULT(AllocationFailed, 8); - R_DEFINE_ERROR_RESULT(UnknownStorage, 12); - - R_DEFINE_ERROR_RESULT(InvalidContentStorage, 100); - R_DEFINE_ERROR_RESULT(InvalidContentMetaDatabase, 110); - R_DEFINE_ERROR_RESULT(InvalidPackageFormat, 130); - R_DEFINE_ERROR_RESULT(InvalidContentHash, 140); - - R_DEFINE_ERROR_RESULT(InvalidInstallTaskState, 160); - R_DEFINE_ERROR_RESULT(InvalidPlaceHolderFile, 170); - R_DEFINE_ERROR_RESULT(BufferInsufficient, 180); - R_DEFINE_ERROR_RESULT(WriteToReadOnlyContentStorage, 190); - R_DEFINE_ERROR_RESULT(NotEnoughInstallSpace, 200); - R_DEFINE_ERROR_RESULT(SystemUpdateNotFoundInPackage, 210); - R_DEFINE_ERROR_RESULT(ContentInfoNotFound, 220); - R_DEFINE_ERROR_RESULT(DeltaNotFound, 237); - R_DEFINE_ERROR_RESULT(InvalidContentMetaKey, 240); - R_DEFINE_ERROR_RESULT(IgnorableInstallTicketFailure, 280); - - R_DEFINE_ERROR_RESULT(ContentStorageBaseNotFound, 310); - R_DEFINE_ERROR_RESULT(ListPartiallyNotCommitted, 330); - R_DEFINE_ERROR_RESULT(UnexpectedContentMetaPrepared, 360); - R_DEFINE_ERROR_RESULT(InvalidFirmwareVariation, 380); - - R_DEFINE_ERROR_RANGE(ContentStorageNotActive, 250, 258); - R_DEFINE_ERROR_RESULT(GameCardContentStorageNotActive, 251); - R_DEFINE_ERROR_RESULT(BuiltInSystemContentStorageNotActive, 252); - R_DEFINE_ERROR_RESULT(BuiltInUserContentStorageNotActive, 253); - R_DEFINE_ERROR_RESULT(SdCardContentStorageNotActive, 254); - R_DEFINE_ERROR_RESULT(UnknownContentStorageNotActive, 258); - - R_DEFINE_ERROR_RANGE(ContentMetaDatabaseNotActive, 260, 268); - R_DEFINE_ERROR_RESULT(GameCardContentMetaDatabaseNotActive, 261); - R_DEFINE_ERROR_RESULT(BuiltInSystemContentMetaDatabaseNotActive, 262); - R_DEFINE_ERROR_RESULT(BuiltInUserContentMetaDatabaseNotActive, 263); - R_DEFINE_ERROR_RESULT(SdCardContentMetaDatabaseNotActive, 264); - R_DEFINE_ERROR_RESULT(UnknownContentMetaDatabaseNotActive, 268); - - R_DEFINE_ERROR_RANGE(InstallTaskCancelled, 290, 299); - R_DEFINE_ERROR_RESULT(CreatePlaceHolderCancelled, 291); - R_DEFINE_ERROR_RESULT(WritePlaceHolderCancelled, 292); - - R_DEFINE_ERROR_RANGE(InvalidArgument, 8181, 8191); - R_DEFINE_ERROR_RESULT(InvalidOffset, 8182); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/nim_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/nim_results.hpp deleted file mode 100644 index c060772..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/nim_results.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::nim { - - R_DEFINE_NAMESPACE_RESULT_MODULE(137); - - R_DEFINE_ERROR_RESULT(HttpConnectionCanceled, 70); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/ns_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/ns_results.hpp deleted file mode 100644 index 32f9542..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/ns_results.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::ns { - - R_DEFINE_NAMESPACE_RESULT_MODULE(16); - - R_DEFINE_ERROR_RESULT(Canceled, 90); - R_DEFINE_ERROR_RESULT(OutOfMaxRunningTask, 110); - R_DEFINE_ERROR_RESULT(CardUpdateNotSetup, 270); - R_DEFINE_ERROR_RESULT(CardUpdateNotPrepared, 280); - R_DEFINE_ERROR_RESULT(CardUpdateAlreadySetup, 290); - R_DEFINE_ERROR_RESULT(PrepareCardUpdateAlreadyRequested, 460); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/os_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/os_results.hpp deleted file mode 100644 index 05479e2..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/os_results.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::os { - - R_DEFINE_NAMESPACE_RESULT_MODULE(3); - - R_DEFINE_ERROR_RESULT(Busy, 4); - - R_DEFINE_ERROR_RESULT(OutOfMemory, 8); - R_DEFINE_ERROR_RESULT(OutOfResource, 9); - - R_DEFINE_ERROR_RESULT(OutOfVirtualAddressSpace, 12); - R_DEFINE_ERROR_RESULT(ResourceLimit, 13); - - R_DEFINE_ERROR_RESULT(OutOfHandles, 500); - R_DEFINE_ERROR_RESULT(InvalidHandle, 501); - R_DEFINE_ERROR_RESULT(InvalidCurrentMemoryState, 502); - R_DEFINE_ERROR_RESULT(InvalidTransferMemoryState, 503); - R_DEFINE_ERROR_RESULT(InvalidTransferMemorySize, 504); - R_DEFINE_ERROR_RESULT(OutOfTransferMemory, 505); - R_DEFINE_ERROR_RESULT(OutOfAddressSpace, 506); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/pgl_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/pgl_results.hpp deleted file mode 100644 index 93e4eb1..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/pgl_results.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::pgl { - - R_DEFINE_NAMESPACE_RESULT_MODULE(228); - - R_DEFINE_ERROR_RESULT(NotAvailable, 2); - R_DEFINE_ERROR_RESULT(ApplicationNotRunning, 3); - R_DEFINE_ERROR_RESULT(BufferNotEnough, 4); - R_DEFINE_ERROR_RESULT(ApplicationContentNotFound, 5); - R_DEFINE_ERROR_RESULT(ContentMetaNotFound, 6); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/pm_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/pm_results.hpp deleted file mode 100644 index 84d7dfc..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/pm_results.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::pm { - - R_DEFINE_NAMESPACE_RESULT_MODULE(15); - - R_DEFINE_ERROR_RESULT(ProcessNotFound, 1); - R_DEFINE_ERROR_RESULT(AlreadyStarted, 2); - R_DEFINE_ERROR_RESULT(NotTerminated, 3); - R_DEFINE_ERROR_RESULT(DebugHookInUse, 4); - R_DEFINE_ERROR_RESULT(ApplicationRunning, 5); - R_DEFINE_ERROR_RESULT(InvalidSize, 6); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/psc_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/psc_results.hpp deleted file mode 100644 index 883e1b3..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/psc_results.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::psc { - - R_DEFINE_NAMESPACE_RESULT_MODULE(138); - - R_DEFINE_ERROR_RESULT(AlreadyInitialized, 2); - R_DEFINE_ERROR_RESULT(NotInitialized, 3); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/results_common.hpp b/src_remove/lib/nnheaders/include/vapours/results/results_common.hpp deleted file mode 100644 index fe0b716..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/results_common.hpp +++ /dev/null @@ -1,196 +0,0 @@ -#pragma once -#include -#include -#include - -namespace nn { - - namespace result::detail { - - class ResultTraits { - public: - using BaseType = std::uint32_t; - static const BaseType SuccessValue = BaseType(); - static const int ModuleBits = 9; - static const int DescriptionBits = 13; - static const int ReservedBits = 10; - static_assert(ModuleBits + DescriptionBits + ReservedBits == sizeof(BaseType) * CHAR_BIT, "ModuleBits + DescriptionBits + ReservedBits == sizeof(BaseType) * CHAR_BIT"); - private: - static BaseType GetBitsValue(BaseType v, int ofs, int num) noexcept { - return (v >> ofs) & ~(~BaseType() << num); - } - public: - template - struct MakeInnerValueStatic : public std::integral_constant { - static_assert(M < (1 << ModuleBits), "Invalid Module"); - static_assert(D < (1 << DescriptionBits), "Invalid Description"); - }; - - static BaseType MakeInnerValue(int m, int d) noexcept { - return (static_cast(m) << 0) | (static_cast(d) << ModuleBits); - } - - static BaseType GetModuleFromValue(BaseType value) noexcept { - return GetBitsValue(value, 0, ModuleBits); - } - - static BaseType GetDescriptionFromValue(BaseType value) noexcept { - return GetBitsValue(value, ModuleBits, DescriptionBits); - } - }; - - /* Use CRTP for Results. */ - template - class ResultBase { - public: - using BaseType = typename ResultTraits::BaseType; - static const BaseType SuccessValue = ResultTraits::SuccessValue; - - int GetModule() const noexcept { - return static_cast(ResultTraits::GetModuleFromValue(static_cast(*this).GetInnerValueForDebug())); - } - - int GetDescription() const noexcept { - return static_cast(ResultTraits::GetDescriptionFromValue(static_cast(*this).GetInnerValueForDebug())); - } - }; - - class ResultInternalAccessor; - - } - - class ResultSuccess; - - class Result : public result::detail::ResultBase { - friend class result::detail::ResultInternalAccessor; - private: - using Base = typename result::detail::ResultBase; - private: - BaseType m_value; - private: - explicit Result(BaseType v) noexcept : m_value(v) { /* ... */ } - public: - Result() noexcept { /* ... */ } - - BaseType GetInnerValueForDebug() const noexcept { return m_value; } - - bool IsSuccess() const noexcept { return m_value == SuccessValue; } - bool IsFailure() const noexcept { return !IsSuccess(); } - - operator ResultSuccess() const noexcept; - static bool CanAccept(Result result) noexcept; - - int GetModule() const noexcept { return Base::GetModule(); } - int GetDescription() const noexcept { return Base::GetDescription(); } - }; - static_assert(sizeof(Result) == sizeof(result::detail::ResultTraits::BaseType), "sizeof(Result) == sizeof(detail::ResultTraits::BaseType)"); - static_assert(std::is_trivially_destructible::value, "std::is_trivially_destructible::value"); - - inline bool Result::CanAccept(Result result) noexcept { - (void)(result); - return true; - } - - namespace result::detail { - - class ResultInternalAccessor { - public: - static Result ConstructResult(ResultTraits::BaseType v) noexcept { return Result(v); } - }; - - inline Result ConstructResult(ResultTraits::BaseType v) noexcept { return ResultInternalAccessor::ConstructResult(v); } - - } - - class ResultSuccess : public result::detail::ResultBase { - public: - using Base = typename result::detail::ResultBase; - public: - operator Result() const noexcept { return result::detail::ConstructResult(SuccessValue); } - - BaseType GetInnerValueForDebug() const noexcept { return SuccessValue; } - - bool IsSuccess() const noexcept { return true; } - - static bool CanAccept(Result result) noexcept { return result.IsSuccess(); } - - int GetModule() const noexcept { return Base::GetModule(); } - int GetDescription() const noexcept { return Base::GetDescription(); } - }; - - namespace result::detail { - - __attribute__((noreturn)) void OnUnhandledResult(Result result) noexcept; - - } - - inline Result::operator ResultSuccess() const noexcept { - if (!ResultSuccess::CanAccept(*this)) { - result::detail::OnUnhandledResult(*this); - } - return ResultSuccess(); - } - - namespace result::detail { - - template - class ErrorResultBase : public ResultBase> { - private: - using Base = ResultBase>; - public: - static constexpr int Module = Module_; - static constexpr int Description = Description_; - static constexpr typename Base::BaseType InnerValue = ResultTraits::MakeInnerValueStatic::value; - static_assert(InnerValue != Base::SuccessValue, "InnerValue != Base::SuccessValue"); - public: - operator Result() const noexcept { return ConstructResult(InnerValue); } - operator ResultSuccess() const noexcept { OnUnhandledResult(*this); } - - bool IsSuccess() const noexcept { return false; } - - typename Base::BaseType GetInnerValueForDebug() const noexcept { return InnerValue; } - }; - - template - class ErrorRange { - public: - static const int Module = Module_; - static const int DescriptionStart = DescStart; - static const int DescriptionEnd = DescEnd; - static_assert(DescriptionStart < DescriptionEnd, "DescriptionStart < DescriptionEnd"); - public: - static bool Includes(Result result) noexcept { - return result.GetModule() == Module && DescriptionStart <= result.GetDescription() && result.GetDescription() < DescriptionEnd; - } - - friend bool operator <=(Result result, ErrorRange) noexcept { - return Includes(result); - } - }; - - } - -} - -/* Macros for defining new results. */ -#define R_DEFINE_NAMESPACE_RESULT_MODULE(value) namespace detail::result { using ResultModuleId = std::integral_constant; } -#define R_CURRENT_NAMESPACE_RESULT_MODULE detail::result::ResultModuleId::value -#define R_NAMESPACE_MODULE_ID(nmspc) nmspc::R_CURRENT_NAMESPACE_RESULT_MODULE - -#define R_DEFINE_ERROR_RESULT_IMPL(name, desc_start, desc_end) \ - class Result##name : \ - public ::nn::result::detail::ErrorResultBase, \ - public ::nn::result::detail::ErrorRange \ - {} - -#define R_DEFINE_ABSTRACT_ERROR_RESULT_IMPL(name, desc_start, desc_end) \ - class Result##name : \ - public ::nn::result::detail::ErrorRange \ - {} - - -#define R_DEFINE_ERROR_RESULT(name, desc) R_DEFINE_ERROR_RESULT_IMPL(name, desc, desc) -#define R_DEFINE_ERROR_RANGE(name, start, end) R_DEFINE_ERROR_RESULT_IMPL(name, start, end) - -#define R_DEFINE_ABSTRACT_ERROR_RESULT(name, desc) R_DEFINE_ABSTRACT_ERROR_RESULT_IMPL(name, desc, desc) -#define R_DEFINE_ABSTRACT_ERROR_RANGE(name, start, end) R_DEFINE_ABSTRACT_ERROR_RESULT_IMPL(name, start, end) diff --git a/src_remove/lib/nnheaders/include/vapours/results/ro_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/ro_results.hpp deleted file mode 100644 index fc4dbe1..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/ro_results.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::ro { - - R_DEFINE_NAMESPACE_RESULT_MODULE(22); - - R_DEFINE_ERROR_RANGE(RoError, 1, 1023); - R_DEFINE_ERROR_RESULT(OutOfAddressSpace, 2); - R_DEFINE_ERROR_RESULT(AlreadyLoaded, 3); - R_DEFINE_ERROR_RESULT(InvalidNro, 4); - - R_DEFINE_ERROR_RESULT(InvalidNrr, 6); - R_DEFINE_ERROR_RESULT(TooManyNro, 7); - R_DEFINE_ERROR_RESULT(TooManyNrr, 8); - R_DEFINE_ERROR_RESULT(NotAuthorized, 9); - R_DEFINE_ERROR_RESULT(InvalidNrrType, 10); - - R_DEFINE_ERROR_RESULT(InternalError, 1023); - - R_DEFINE_ERROR_RESULT(InvalidAddress, 1025); - R_DEFINE_ERROR_RESULT(InvalidSize, 1026); - - R_DEFINE_ERROR_RESULT(NotLoaded, 1028); - R_DEFINE_ERROR_RESULT(NotRegistered, 1029); - R_DEFINE_ERROR_RESULT(InvalidSession, 1030); - R_DEFINE_ERROR_RESULT(InvalidProcess, 1031); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/settings_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/settings_results.hpp deleted file mode 100644 index e704371..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/settings_results.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::settings { - - R_DEFINE_NAMESPACE_RESULT_MODULE(105); - - R_DEFINE_ERROR_RESULT(SettingsItemNotFound, 11); - - R_DEFINE_ERROR_RANGE(InternalError, 100, 149); - R_DEFINE_ERROR_RESULT(SettingsItemKeyAllocationFailed, 101); - R_DEFINE_ERROR_RESULT(SettingsItemValueAllocationFailed, 102); - - R_DEFINE_ERROR_RANGE(InvalidArgument, 200, 399); - R_DEFINE_ERROR_RESULT(SettingsNameNull, 201); - R_DEFINE_ERROR_RESULT(SettingsItemKeyNull, 202); - R_DEFINE_ERROR_RESULT(SettingsItemValueNull, 203); - R_DEFINE_ERROR_RESULT(SettingsItemKeyBufferNull, 204); - R_DEFINE_ERROR_RESULT(SettingsItemValueBufferNull, 205); - - R_DEFINE_ERROR_RESULT(SettingsNameEmpty, 221); - R_DEFINE_ERROR_RESULT(SettingsItemKeyEmpty, 222); - - R_DEFINE_ERROR_RESULT(SettingsNameTooLong, 241); - R_DEFINE_ERROR_RESULT(SettingsItemKeyTooLong, 242); - - R_DEFINE_ERROR_RESULT(SettingsNameInvalidFormat, 261); - R_DEFINE_ERROR_RESULT(SettingsItemKeyInvalidFormat, 262); - R_DEFINE_ERROR_RESULT(SettingsItemValueInvalidFormat, 263); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/sf_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/sf_results.hpp deleted file mode 100644 index 516cb24..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/sf_results.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::sf { - - R_DEFINE_NAMESPACE_RESULT_MODULE(10); - - R_DEFINE_ERROR_RESULT(NotSupported, 1); - R_DEFINE_ERROR_RESULT(PreconditionViolation, 3); - - namespace cmif { - - R_DEFINE_ERROR_RESULT(InvalidHeaderSize, 202); - R_DEFINE_ERROR_RESULT(InvalidInHeader, 211); - R_DEFINE_ERROR_RESULT(UnknownCommandId, 221); - R_DEFINE_ERROR_RESULT(InvalidOutRawSize, 232); - R_DEFINE_ERROR_RESULT(InvalidNumInObjects, 235); - R_DEFINE_ERROR_RESULT(InvalidNumOutObjects, 236); - R_DEFINE_ERROR_RESULT(InvalidInObject, 239); - - R_DEFINE_ERROR_RESULT(TargetNotFound, 261); - - R_DEFINE_ERROR_RESULT(OutOfDomainEntries, 301); - - } - - namespace impl { - - R_DEFINE_ABSTRACT_ERROR_RANGE(RequestContextChanged, 800, 899); - R_DEFINE_ABSTRACT_ERROR_RANGE(RequestInvalidated, 801, 809); - R_DEFINE_ERROR_RESULT(RequestInvalidatedByUser, 802); - - } - - R_DEFINE_ABSTRACT_ERROR_RANGE(RequestDeferred, 811, 819); - R_DEFINE_ERROR_RESULT(RequestDeferredByUser, 812); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/sm_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/sm_results.hpp deleted file mode 100644 index 45d9349..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/sm_results.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::sm { - - R_DEFINE_NAMESPACE_RESULT_MODULE(21); - - R_DEFINE_ERROR_RESULT(OutOfProcesses, 1); - R_DEFINE_ERROR_RESULT(InvalidClient, 2); - R_DEFINE_ERROR_RESULT(OutOfSessions, 3); - R_DEFINE_ERROR_RESULT(AlreadyRegistered, 4); - R_DEFINE_ERROR_RESULT(OutOfServices, 5); - R_DEFINE_ERROR_RESULT(InvalidServiceName, 6); - R_DEFINE_ERROR_RESULT(NotRegistered, 7); - R_DEFINE_ERROR_RESULT(NotAllowed, 8); - R_DEFINE_ERROR_RESULT(TooLargeAccessControl, 9); - - /* Results 1000-2000 used as extension for Atmosphere Mitm. */ - namespace mitm { - - R_DEFINE_ERROR_RESULT(ShouldForwardToSession, 1000); - R_DEFINE_ERROR_RESULT(ProcessNotAssociated, 1100); - - } - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/spl_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/spl_results.hpp deleted file mode 100644 index f8d857e..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/spl_results.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::spl { - - R_DEFINE_NAMESPACE_RESULT_MODULE(26); - - R_DEFINE_ERROR_RANGE(SecureMonitorError, 0, 99); - R_DEFINE_ERROR_RESULT(SecureMonitorNotImplemented, 1); - R_DEFINE_ERROR_RESULT(SecureMonitorInvalidArgument, 2); - R_DEFINE_ERROR_RESULT(SecureMonitorBusy, 3); - R_DEFINE_ERROR_RESULT(SecureMonitorNoAsyncOperation, 4); - R_DEFINE_ERROR_RESULT(SecureMonitorInvalidAsyncOperation, 5); - R_DEFINE_ERROR_RESULT(SecureMonitorNotPermitted, 6); - R_DEFINE_ERROR_RESULT(SecureMonitorNotInitialized, 7); - - R_DEFINE_ERROR_RESULT(InvalidSize, 100); - R_DEFINE_ERROR_RESULT(UnknownSecureMonitorError, 101); - R_DEFINE_ERROR_RESULT(DecryptionFailed, 102); - - R_DEFINE_ERROR_RESULT(OutOfKeySlots, 104); - R_DEFINE_ERROR_RESULT(InvalidKeySlot, 105); - R_DEFINE_ERROR_RESULT(BootReasonAlreadySet, 106); - R_DEFINE_ERROR_RESULT(BootReasonNotSet, 107); - R_DEFINE_ERROR_RESULT(InvalidArgument, 108); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/svc_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/svc_results.hpp deleted file mode 100644 index e73beb8..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/svc_results.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::svc { - - R_DEFINE_NAMESPACE_RESULT_MODULE(1); - - R_DEFINE_ERROR_RESULT(OutOfSessions, 7); - - R_DEFINE_ERROR_RESULT(InvalidArgument, 14); - - R_DEFINE_ERROR_RESULT(NotImplemented, 33); - - R_DEFINE_ERROR_RESULT(StopProcessingException, 54); - - R_DEFINE_ERROR_RESULT(NoSynchronizationObject, 57); - - R_DEFINE_ERROR_RESULT(TerminationRequested, 59); - - R_DEFINE_ERROR_RESULT(NoEvent, 70); - - R_DEFINE_ERROR_RESULT(InvalidSize, 101); - R_DEFINE_ERROR_RESULT(InvalidAddress, 102); - R_DEFINE_ERROR_RESULT(OutOfResource, 103); - R_DEFINE_ERROR_RESULT(OutOfMemory, 104); - R_DEFINE_ERROR_RESULT(OutOfHandles, 105); - R_DEFINE_ERROR_RESULT(InvalidCurrentMemory, 106); - - R_DEFINE_ERROR_RESULT(InvalidNewMemoryPermission, 108); - - R_DEFINE_ERROR_RESULT(InvalidMemoryRegion, 110); - - R_DEFINE_ERROR_RESULT(InvalidPriority, 112); - R_DEFINE_ERROR_RESULT(InvalidCoreId, 113); - R_DEFINE_ERROR_RESULT(InvalidHandle, 114); - R_DEFINE_ERROR_RESULT(InvalidPointer, 115); - R_DEFINE_ERROR_RESULT(InvalidCombination, 116); - R_DEFINE_ERROR_RESULT(TimedOut, 117); - R_DEFINE_ERROR_RESULT(Cancelled, 118); - R_DEFINE_ERROR_RESULT(OutOfRange, 119); - R_DEFINE_ERROR_RESULT(InvalidEnumValue, 120); - R_DEFINE_ERROR_RESULT(NotFound, 121); - R_DEFINE_ERROR_RESULT(Busy, 122); - R_DEFINE_ERROR_RESULT(SessionClosed, 123); - R_DEFINE_ERROR_RESULT(NotHandled, 124); - R_DEFINE_ERROR_RESULT(InvalidState, 125); - R_DEFINE_ERROR_RESULT(ReservedUsed, 126); - R_DEFINE_ERROR_RESULT(NotSupported, 127); - R_DEFINE_ERROR_RESULT(Debug, 128); - R_DEFINE_ERROR_RESULT(NoThread, 129); - R_DEFINE_ERROR_RESULT(UnknownThread, 130); - R_DEFINE_ERROR_RESULT(PortClosed, 131); - R_DEFINE_ERROR_RESULT(LimitReached, 132); - R_DEFINE_ERROR_RESULT(InvalidMemoryPool, 133); - - R_DEFINE_ERROR_RESULT(ReceiveListBroken, 258); - R_DEFINE_ERROR_RESULT(OutOfAddressSpace, 259); - R_DEFINE_ERROR_RESULT(MessageTooLarge, 260); - - R_DEFINE_ERROR_RESULT(InvalidProcessId, 517); - R_DEFINE_ERROR_RESULT(InvalidThreadId, 518); - R_DEFINE_ERROR_RESULT(InvalidId, 519); - R_DEFINE_ERROR_RESULT(ProcessTerminated, 520); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/time_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/time_results.hpp deleted file mode 100644 index f82e055..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/time_results.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::time { - - R_DEFINE_NAMESPACE_RESULT_MODULE(116); - - R_DEFINE_ERROR_RESULT(NotInitialized, 0); - - R_DEFINE_ERROR_RESULT(NotComparable, 200); - R_DEFINE_ERROR_RESULT(Overflowed, 201); - - R_DEFINE_ABSTRACT_ERROR_RANGE(InvalidArgument, 900, 919); - R_DEFINE_ERROR_RESULT(InvalidPointer, 901); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/updater_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/updater_results.hpp deleted file mode 100644 index ec0f0fd..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/updater_results.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::updater { - - R_DEFINE_NAMESPACE_RESULT_MODULE(158); - - R_DEFINE_ERROR_RESULT(BootImagePackageNotFound, 2); - R_DEFINE_ERROR_RESULT(InvalidBootImagePackage, 3); - R_DEFINE_ERROR_RESULT(TooSmallWorkBuffer, 4); - R_DEFINE_ERROR_RESULT(NotAlignedWorkBuffer, 5); - R_DEFINE_ERROR_RESULT(NeedsRepairBootImages, 6); - -} diff --git a/src_remove/lib/nnheaders/include/vapours/results/vi_results.hpp b/src_remove/lib/nnheaders/include/vapours/results/vi_results.hpp deleted file mode 100644 index 833bdd5..0000000 --- a/src_remove/lib/nnheaders/include/vapours/results/vi_results.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2018-2020 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include - -namespace ams::vi { - - R_DEFINE_NAMESPACE_RESULT_MODULE(114); - - R_DEFINE_ERROR_RESULT(OperationFailed, 1); - R_DEFINE_ERROR_RESULT(NotSupported, 6); - R_DEFINE_ERROR_RESULT(NotFound, 7); - -} diff --git a/src_remove/lib/sead/include/basis/seadNew.h b/src_remove/lib/sead/include/basis/seadNew.h deleted file mode 100644 index c5b66a0..0000000 --- a/src_remove/lib/sead/include/basis/seadNew.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef SEAD_NEW_H_ -#define SEAD_NEW_H_ - -#include -#include - -#include - -namespace sead -{ -class Heap; - -void AllocFailAssert(Heap* heap, size_t size, u32 alignment); - -#ifndef SEAD_DEBUG -inline void AllocFailAssert(Heap*, size_t, u32) {} -#endif -} // namespace sead - -void* operator new(size_t size); -void* operator new[](size_t size); -void* operator new(size_t size, const std::nothrow_t&) noexcept; -void* operator new[](size_t size, const std::nothrow_t&) noexcept; - -void* operator new(size_t size, s32 alignment); -void* operator new[](size_t size, s32 alignment); -void* operator new(size_t size, s32 alignment, const std::nothrow_t&) noexcept; -void* operator new[](size_t size, s32 alignment, const std::nothrow_t&) noexcept; - -void* operator new(size_t size, sead::Heap* heap, const std::nothrow_t&) noexcept; -void* operator new[](size_t size, sead::Heap* heap, const std::nothrow_t&) noexcept; - -void* operator new(size_t size, sead::Heap* heap, s32 alignment = sizeof(void*)); -void* operator new[](size_t size, sead::Heap* heap, s32 alignment = sizeof(void*)); -void* operator new(size_t size, sead::Heap* heap, s32 alignment, const std::nothrow_t&) noexcept; -void* operator new[](size_t size, sead::Heap* heap, s32 alignment, const std::nothrow_t&) noexcept; - -void operator delete(void* ptr) noexcept; -void operator delete[](void* ptr) noexcept; -void operator delete(void* ptr, const std::nothrow_t&) noexcept; -void operator delete[](void* ptr, const std::nothrow_t&) noexcept; - -void operator delete(void* ptr, s32); -void operator delete[](void* ptr, s32); -void operator delete(void* ptr, s32, const std::nothrow_t&) noexcept; -void operator delete[](void* ptr, s32, const std::nothrow_t&) noexcept; - -void operator delete(void* ptr, sead::Heap*, const std::nothrow_t&) noexcept; -void operator delete[](void* ptr, sead::Heap*, const std::nothrow_t&) noexcept; - -void operator delete(void* ptr, sead::Heap*, s32); -void operator delete[](void* ptr, sead::Heap*, s32); -void operator delete(void* ptr, sead::Heap*, s32, const std::nothrow_t&) noexcept; -void operator delete[](void* ptr, sead::Heap*, s32, const std::nothrow_t&) noexcept; - -namespace sead -{ -inline u8* AllocBuffer(size_t size, Heap* heap, s32 alignment) -{ - u8* buffer = new (heap, alignment, std::nothrow) u8[size]; - if (buffer) - return buffer; - -#ifdef SEAD_DEBUG - sead::AllocFailAssert(heap, size, alignment); -#endif - return nullptr; -} -} // namespace sead -#endif // SEAD_NEW_H_ diff --git a/src_remove/lib/sead/include/basis/seadRawPrint.h b/src_remove/lib/sead/include/basis/seadRawPrint.h deleted file mode 100644 index 979f969..0000000 --- a/src_remove/lib/sead/include/basis/seadRawPrint.h +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once - -#include - -#include - -#ifdef SEAD_DEBUG -#define SEAD_ASSERT_MSG(condition, message, ...) \ - do \ - { \ - if (!(condition)) \ - sead::system::HaltWithDetail(__FILE__, __LINE__, message, ##__VA_ARGS__); \ - } while (0) -#define SEAD_ASSERT(condition) \ - do \ - { \ - if (!(condition)) \ - sead::system::HaltWithDetailNoFormat(__FILE__, __LINE__, #condition); \ - } while (0) -#define SEAD_WARN(message, ...) \ - do \ - sead::system::Warning(__FILE__, __LINE__, message, ##__VA_ARGS__); \ - while (0) -#define SEAD_DEBUG_PRINT(format, ...) \ - do \ - sead::system::Print(format, ##__VA_ARGS__); \ - while (0) -#else -#define SEAD_ASSERT_MSG(condition, message, ...) \ - do \ - { \ - if (false) \ - { \ - static_cast(condition); \ - sead::system::detail::CheckFormat(message, ##__VA_ARGS__); \ - } \ - } while (0) -#define SEAD_ASSERT(condition) \ - do \ - { \ - if (false) \ - static_cast(condition); \ - } while (0) -#define SEAD_WARN(message, ...) \ - do \ - { \ - if (false) \ - sead::system::detail::CheckFormat(message, ##__VA_ARGS__); \ - } while (0) -#define SEAD_DEBUG_PRINT(format, ...) \ - do \ - { \ - if (false) \ - sead::system::detail::CheckFormat(format, ##__VA_ARGS__); \ - } while (0) -#endif - -namespace sead -{ -namespace system -{ -namespace detail -{ -// Dummy function whose only purpose is to trigger a format string check. -#ifdef __GNUC__ -[[maybe_unused]] [[gnu::format(printf, 1, 2)]] -#endif -inline void -CheckFormat(const char*, ...) -{ -} -} // namespace detail - -void Halt(); -#ifdef __GNUC__ -[[gnu::format(printf, 3, 4)]] -#endif -void HaltWithDetail(const char* file, int line, const char* msg, ...); -void HaltWithDetailNoFormat(const char* file, int line, const char* msg); -void DebugBreak(); - -#ifdef __GNUC__ -[[gnu::format(printf, 1, 2)]] -#endif -void Print(const char* format, ...); -void PrintV(const char* format, std::va_list); -void PrintString(const char* format, s32); - -#ifdef __GNUC__ -[[gnu::format(printf, 3, 4)]] -#endif -void Warning(const char* file, int line, const char* msg, ...); -void SetWarningEnable(bool enable); -} // namespace system -} // namespace sead diff --git a/src_remove/lib/sead/include/basis/seadTypes.h b/src_remove/lib/sead/include/basis/seadTypes.h deleted file mode 100644 index f007d62..0000000 --- a/src_remove/lib/sead/include/basis/seadTypes.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SEAD_TYPES_H_ -#define SEAD_TYPES_H_ - -#ifdef cafe -#include -#else -#include -#include - -using u8 = std::uint8_t; -using u16 = std::uint16_t; -using u32 = std::uint32_t; -using u64 = std::uint64_t; - -using s8 = std::int8_t; -using s16 = std::int16_t; -using s32 = std::int32_t; -using s64 = std::int64_t; - -using f32 = float; -using f64 = double; - -using char16 = char16_t; -using size_t = std::size_t; -#endif - -#endif // SEAD_NEW_H_ diff --git a/src_remove/lib/sead/include/codec/seadBase64.h b/src_remove/lib/sead/include/codec/seadBase64.h deleted file mode 100644 index 83acda5..0000000 --- a/src_remove/lib/sead/include/codec/seadBase64.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace sead -{ -class Base64 -{ -public: - static void encode(char* dst, const void* src, size_t length, bool url_safe); - static bool decode(void* dst, size_t dst_size, const char* src, size_t src_size, - size_t* decoded_size); -}; -} // namespace sead diff --git a/src_remove/lib/sead/include/codec/seadHashCRC16.h b/src_remove/lib/sead/include/codec/seadHashCRC16.h deleted file mode 100644 index cc1b006..0000000 --- a/src_remove/lib/sead/include/codec/seadHashCRC16.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include - -namespace sead -{ -class HashCRC16 -{ -public: - struct Context - { - u32 hash = 0; - }; - - static u32 calcHash(const void* ptr, u32 size); - static u32 calcHashWithContext(Context* context, const void* ptr, u32 size); - - static u32 calcStringHash(const char* str); - static u32 calcStringHash(const SafeString& str) { return calcStringHash(str.cstr()); } - static u32 calcStringHashWithContext(Context* context, const char* str); - static u32 calcStringHashWithContext(Context* context, const SafeString& str) - { - return calcStringHashWithContext(context, str.cstr()); - } - - static void initialize(); - -private: - static u16 sTable[256]; - static bool sInitialized; -}; -} // namespace sead diff --git a/src_remove/lib/sead/include/codec/seadHashCRC32.h b/src_remove/lib/sead/include/codec/seadHashCRC32.h deleted file mode 100644 index 1f2675b..0000000 --- a/src_remove/lib/sead/include/codec/seadHashCRC32.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include - -namespace sead -{ -class HashCRC32 -{ -public: - struct Context - { - u32 hash = -1; - }; - - static u32 calcHash(const void* ptr, u32 size); - static u32 calcHashWithContext(Context* context, const void* ptr, u32 size); - - static u32 calcStringHash(const char* str); - static u32 calcStringHash(const SafeString& str) { return calcStringHash(str.cstr()); } - static u32 calcStringHashWithContext(Context* context, const char* str); - static u32 calcStringHashWithContext(Context* context, const SafeString& str) - { - return calcStringHashWithContext(context, str.cstr()); - } - - static void initialize(); - -private: - static u32 sTable[256]; - static bool sInitialized; -}; -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadBuffer.h b/src_remove/lib/sead/include/container/seadBuffer.h deleted file mode 100644 index eb058e6..0000000 --- a/src_remove/lib/sead/include/container/seadBuffer.h +++ /dev/null @@ -1,442 +0,0 @@ -#ifndef SEAD_BUFFER_H_ -#define SEAD_BUFFER_H_ - -#include -#include - -#include -#include -#include -#include -#include - -namespace sead -{ -class Heap; - -template -class Buffer -{ -public: - Buffer() : mSize(0), mBuffer(NULL) {} - Buffer(s32 size, T* buffer) : mSize(size), mBuffer(buffer) {} - template - Buffer(T (&array)[N]) : Buffer(N, array) - { - } - - Buffer(const Buffer& other) { *this = other; } - - Buffer& operator=(const Buffer& other) - { - mSize = other.mSize; - mBuffer = other.mBuffer; - return *this; - } - - class iterator - { - public: - explicit iterator(T* buffer, s32 index = 0) : mIndex(index), mBuffer(buffer) {} - bool operator==(const iterator& rhs) const - { - return mIndex == rhs.mIndex && mBuffer == rhs.mBuffer; - } - bool operator!=(const iterator& rhs) const { return !operator==(rhs); } - iterator& operator++() - { - ++mIndex; - return *this; - } - T& operator*() const { return mBuffer[mIndex]; } - T* operator->() const { return &mBuffer[mIndex]; } - s32 getIndex() const { return mIndex; } - - private: - s32 mIndex; - T* mBuffer; - }; - - class constIterator - { - public: - explicit constIterator(const T* buffer, s32 index = 0) : mIndex(index), mBuffer(buffer) {} - bool operator==(const constIterator& rhs) const - { - return mIndex == rhs.mIndex && mBuffer == rhs.mBuffer; - } - bool operator!=(const constIterator& rhs) const { return !operator==(rhs); } - constIterator& operator++() - { - ++mIndex; - return *this; - } - const T& operator*() const { return mBuffer[mIndex]; } - const T* operator->() const { return &mBuffer[mIndex]; } - s32 getIndex() const { return mIndex; } - - private: - s32 mIndex; - const T* mBuffer; - }; - - iterator begin() { return iterator(mBuffer); } - iterator begin(s32 idx) - { - if (u32(size()) < u32(idx)) - { - SEAD_ASSERT_MSG(false, "range over [0,%d] : %d", size(), idx); - return end(); - } - return iterator(mBuffer, idx); - } - - constIterator begin() const { return constIterator(mBuffer); } - constIterator begin(s32 idx) const - { - if (u32(size()) < u32(idx)) - { - SEAD_ASSERT_MSG(false, "range over [0,%d] : %d", size(), idx); - return end(); - } - return constIterator(mBuffer, idx); - } - - iterator end() { return iterator(mBuffer, mSize); } - constIterator end() const { return constIterator(mBuffer, mSize); } - - class reverseIterator - { - public: - explicit reverseIterator(T* buffer, s32 index = 0) : mIndex(index), mBuffer(buffer) {} - bool operator==(const reverseIterator& rhs) const { return mIndex == rhs.mIndex; } - bool operator!=(const reverseIterator& rhs) const { return !operator==(rhs); } - reverseIterator& operator++() - { - --mIndex; - return *this; - } - T& operator*() const { return mBuffer[mIndex]; } - T* operator->() const { return &mBuffer[mIndex]; } - s32 getIndex() const { return mIndex; } - - private: - s32 mIndex; - T* mBuffer; - }; - - reverseIterator rbegin() { return reverseIterator(mBuffer, mSize - 1); } - reverseIterator rbegin(s32 index) { return reverseIterator(mBuffer, index); } - reverseIterator rend() { return reverseIterator(mBuffer, -1); } - - void allocBuffer(s32 size, s32 alignment) - { - SEAD_ASSERT(mBuffer == nullptr); - if (size > 0) - { - T* buffer = new (alignment) T[size]; - if (buffer) - { - mSize = size; - mBuffer = buffer; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - } - } - else - { - SEAD_ASSERT_MSG(false, "size[%d] must be larger than zero", size); - } - } - - void allocBuffer(s32 size, Heap* heap, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mBuffer == nullptr); - if (size > 0) - { - T* buffer = new (heap, alignment) T[size]; - if (buffer) - { - mSize = size; - mBuffer = buffer; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - } - } - else - { - SEAD_ASSERT_MSG(false, "size[%d] must be larger than zero", size); - } - } - - bool tryAllocBuffer(s32 size, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mBuffer == nullptr); - if (size > 0) - { - T* buffer = new (alignment, std::nothrow) T[size]; - if (buffer) - { - mSize = size; - mBuffer = buffer; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - return true; - } - return false; - } - SEAD_ASSERT_MSG(false, "size[%d] must be larger than zero", size); - return false; - } - - bool tryAllocBuffer(s32 size, Heap* heap, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mBuffer == nullptr); - if (size > 0) - { - T* buffer = new (heap, alignment, std::nothrow) T[size]; - if (buffer) - { - mSize = size; - mBuffer = buffer; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - return true; - } - return false; - } - SEAD_ASSERT_MSG(false, "size[%d] must be larger than zero", size); - return false; - } - - inline bool allocBufferAssert(s32 size, Heap* heap, s32 alignment = sizeof(void*)) - { - if (tryAllocBuffer(size, heap, alignment)) - return true; - AllocFailAssert(heap, sizeof(T) * size, alignment); - return false; - } - - void freeBuffer() - { - if (mBuffer) - { - delete[] mBuffer; - mBuffer = nullptr; - mSize = 0; - } - } - - void setBuffer(s32 size, T* bufferptr) - { - if (size < 1) - { - SEAD_ASSERT_MSG(false, "size[%d] must be larger than zero", size); - return; - } - if (!bufferptr) - { - SEAD_ASSERT_MSG(false, "bufferptr is null"); - return; - } - mSize = size; - mBuffer = bufferptr; - } - - bool isBufferReady() const { return mBuffer != nullptr; } - - bool isIndexValid(s32 idx) const { return u32(idx) < u32(mSize); } - - T& operator()(s32 idx) { return *unsafeGet(idx); } - const T& operator()(s32 idx) const { return *unsafeGet(idx); } - - T& operator[](s32 idx) - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d]", idx, mSize); - return mBuffer[0]; - } - return mBuffer[idx]; - } - - const T& operator[](s32 idx) const - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d]", idx, mSize); - return mBuffer[0]; - } - return mBuffer[idx]; - } - - T* get(s32 idx) - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d]", idx, mSize); - return nullptr; - } - return &mBuffer[idx]; - } - - const T* get(s32 idx) const - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d]", idx, mSize); - return nullptr; - } - return &mBuffer[idx]; - } - - T* unsafeGet(s32 idx) - { - SEAD_ASSERT_MSG(u32(idx) < u32(mSize), "index exceeded [%d/%d]", idx, mSize); - return &mBuffer[idx]; - } - const T* unsafeGet(s32 idx) const - { - SEAD_ASSERT_MSG(u32(idx) < u32(mSize), "index exceeded [%d/%d]", idx, mSize); - return &mBuffer[idx]; - } - - T& front() { return mBuffer[0]; } - const T& front() const { return mBuffer[0]; } - - T& back() { return mBuffer[mSize - 1]; } - const T& back() const { return mBuffer[mSize - 1]; } - - s32 size() const { return mSize; } - s32 getSize() const { return mSize; } - - T* getBufferPtr() { return mBuffer; } - const T* getBufferPtr() const { return mBuffer; } - - u32 getByteSize() const { return mSize * sizeof(T); } - - void fill(const T& v) - { - for (s32 i = 0; i < mSize; ++i) - mBuffer[i] = v; - } - - using CompareCallback = s32 (*)(const T* lhs, const T* rhs); - - s32 binarySearch(const T& item) const { return binarySearch(item, compareT); } - - s32 binarySearch(const T& item, CompareCallback cmp) const - { - if (mSize == 0) - return -1; - - s32 a = 0; - s32 b = mSize - 1; - while (a < b) - { - const s32 m = (a + b) / 2; - const s32 c = cmp(&mBuffer[m], &item); - if (c == 0) - return m; - if (c < 0) - a = m + 1; - else - b = m; - } - - if (cmp(&mBuffer[a], &item) == 0) - return a; - - return -1; - } - - template - s32 binarySearch(const Key& key, s32 (*cmp)(const T& item, const Key& key)) const - { - if (mSize == 0) - return -1; - - s32 a = 0; - s32 b = mSize - 1; - while (a < b) - { - const s32 m = (a + b) / 2; - const s32 c = cmp(mBuffer[m], key); - if (c == 0) - return m; - if (c < 0) - a = m + 1; - else - b = m; - } - - if (cmp(mBuffer[a], key) == 0) - return a; - - return -1; - } - - template - s32 binarySearchC(CustomCompareCallback cmp) const - { - if (mSize == 0) - return -1; - - s32 a = 0; - s32 b = mSize - 1; - while (a < b) - { - const s32 m = (a + b) / 2; - const s32 c = cmp(mBuffer[m]); - if (c == 0) - return m; - if (c < 0) - a = m + 1; - else - b = m; - } - - if (cmp(mBuffer[a]) == 0) - return a; - - return -1; - } - - /// Sort elements with indices in [start_idx .. end_idx] using heapsort. - void heapSort(s32 start_idx, s32 end_idx) - { - if (start_idx >= mSize || end_idx >= mSize || end_idx - start_idx < 1) - return; - // FIXME: Nintendo implemented heap sort manually without using - std::make_heap(mBuffer + start_idx, mBuffer + end_idx); - std::sort_heap(mBuffer + start_idx, mBuffer + end_idx); - } - - /// Sort elements with indices in [start_idx .. end_idx] using heapsort. - void heapSort(s32 start_idx, s32 end_idx, CompareCallback cmp) - { - if (start_idx >= mSize || end_idx >= mSize || end_idx - start_idx < 1) - return; - // FIXME: Nintendo implemented heap sort manually without using - const auto cmp_ = [cmp](const T& a, const T& b) { return cmp(&a, &b) < 0; }; - std::make_heap(mBuffer + start_idx, mBuffer + end_idx, cmp_); - std::sort_heap(mBuffer + start_idx, mBuffer + end_idx, cmp_); - } - -protected: - static s32 compareT(const T* lhs, const T* rhs) - { - if (*lhs < *rhs) - return -1; - if (*rhs < *lhs) - return 1; - return 0; - } - - s32 mSize; - T* mBuffer; -}; - -} // namespace sead - -#endif // SEAD_BUFFER_H_ diff --git a/src_remove/lib/sead/include/container/seadFreeList.h b/src_remove/lib/sead/include/container/seadFreeList.h deleted file mode 100644 index 93e2368..0000000 --- a/src_remove/lib/sead/include/container/seadFreeList.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include - -#include "basis/seadRawPrint.h" -#include "basis/seadTypes.h" - -namespace sead -{ -class FreeList -{ -public: - void setWork(void* work, s32 elem_size, s32 num); - void reset(); - - void* alloc(); - void free(void* ptr); - - void* getFree() const { return mFree; } - void* work() const { return mWork; } - - static const size_t cPtrSize = sizeof(void*); - -private: - struct Node - { - Node* nextFree; - }; - - Node* mFree = nullptr; - void* mWork = nullptr; -}; - -inline void FreeList::setWork(void* work, s32 elem_size, s32 num) -{ - SEAD_ASSERT(work); - SEAD_ASSERT(elem_size > 0 && elem_size % cPtrSize == 0); - SEAD_ASSERT(num > 0); - - const s32 idx_multiplier = elem_size / cPtrSize; - void** const ptrs = new (work) void*[num * idx_multiplier]; - - mFree = new (work) Node; - - // Create the linked list. - for (s32 i = 0; i < num - 1; ++i) - new (&ptrs[i * idx_multiplier]) Node{new (&ptrs[(i + 1) * idx_multiplier]) Node}; - - new (&ptrs[(num - 1) * idx_multiplier]) Node{nullptr}; - - mWork = work; -} - -inline void FreeList::reset() -{ - mFree = nullptr; - mWork = nullptr; -} - -inline void* FreeList::alloc() -{ - if (!mFree) - return nullptr; - - void* ptr = mFree; - mFree = mFree->nextFree; - return ptr; -} - -inline void FreeList::free(void* ptr) -{ - mFree = new (ptr) Node{mFree}; -} -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadListImpl.h b/src_remove/lib/sead/include/container/seadListImpl.h deleted file mode 100644 index 4791252..0000000 --- a/src_remove/lib/sead/include/container/seadListImpl.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef SEAD_LIST_IMPL_H_ -#define SEAD_LIST_IMPL_H_ - -#include - -namespace sead -{ -class Random; - -class ListNode -{ -public: - ListNode* next() const { return mNext; } - ListNode* prev() const { return mPrev; } - bool isLinked() const { return mNext || mPrev; } - -private: - friend class ListImpl; - - void init_() { *this = {}; } - void insertBack_(ListNode* node); - void insertFront_(ListNode* node); - void erase_(); - - ListNode* mPrev = nullptr; - ListNode* mNext = nullptr; -}; - -class ListImpl -{ -public: - __attribute__((always_inline)) ListImpl() : mStartEnd(), mCount(0) - { - mStartEnd.mNext = &mStartEnd; - mStartEnd.mPrev = &mStartEnd; - } - - bool isEmpty() const { return mCount == 0; } - s32 size() const { return mCount; } -// BOTW-sAVE-STATE hack - void setSize(s32 size) { mCount = size; } - s32 sizeSlow() const { - s32 size = 0; - ListNode* ptr = mStartEnd.mNext; - while(ptr && ptr != &mStartEnd){ - ptr = ptr->mNext; - size++; - } - return size; - } - - void reverse(); - void shuffle(); - void shuffle(Random* random); - bool checkLinks() const; - -protected: - using CompareCallbackImpl = int (*)(const void*, const void*); - - template - void sort(s32 offset, const ComparePredicate& cmp) - { - this->mergeSort(offset, cmp); - } - - template - void mergeSort(s32 offset, const ComparePredicate& cmp) - { - this->mergeSortImpl_(mStartEnd.mNext, mStartEnd.mPrev, size(), offset, - cmp); - } - - void pushBack(ListNode* item) - { - mStartEnd.insertFront_(item); - ++mCount; - } - - void pushFront(ListNode* item) - { - mStartEnd.insertBack_(item); - ++mCount; - } - - ListNode* popBack(); - ListNode* popFront(); - - void insertBefore(ListNode* node, ListNode* node_to_insert) - { - node->insertFront_(node_to_insert); - ++mCount; - } - - void insertAfter(ListNode* node, ListNode* node_to_insert) - { - node->insertBack_(node_to_insert); - ++mCount; - } - - void erase(ListNode* item) - { - item->erase_(); - --mCount; - } - - ListNode* front() const { return mCount >= 1 ? mStartEnd.mNext : nullptr; } - ListNode* back() const { return mCount >= 1 ? mStartEnd.mPrev : nullptr; } - ListNode* nth(int n) const; - s32 indexOf(const ListNode*) const; - - void swap(ListNode* n1, ListNode* n2); - void moveAfter(ListNode* basis, ListNode* n); - void moveBefore(ListNode* basis, ListNode* n); - - ListNode* find(const void* ptr, s32 offset, CompareCallbackImpl cmp) const; - void uniq(s32 offset, CompareCallbackImpl cmp); - - void clear(); - - // FIXME: this should take an rvalue reference for predicate. - template - static void mergeSortImpl_(ListNode* front, ListNode* back, s32 num, s32 offset, - const ComparePredicate& predicate); - -protected: - ListNode mStartEnd; - s32 mCount; -}; - -} // namespace sead - -#endif // SEAD_LIST_IMPL_H_ diff --git a/src_remove/lib/sead/include/container/seadObjArray.h b/src_remove/lib/sead/include/container/seadObjArray.h deleted file mode 100644 index f93ac24..0000000 --- a/src_remove/lib/sead/include/container/seadObjArray.h +++ /dev/null @@ -1,267 +0,0 @@ -#pragma once - -#include -#include "basis/seadNew.h" -#include "basis/seadRawPrint.h" -#include "container/seadFreeList.h" -#include "container/seadPtrArray.h" - -namespace sead -{ -/// An ObjArray is a container that allocates elements using a FreeList and also keeps an array of -/// pointers for fast access to each element. -template -class ObjArray : public PtrArrayImpl -{ -public: - ObjArray() = default; - ObjArray(s32 max_num, void* buf) { setBuffer(max_num, buf); } - - void allocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mPtrs == nullptr); - - if (capacity < 1) - { - SEAD_ASSERT_MSG(false, "capacity[%d] must be larger than zero", capacity); - return; - } - - setBuffer(capacity, - new (heap, alignment, std::nothrow) u8[calculateWorkBufferSize(capacity)]); - } - - bool tryAllocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mPtrs == nullptr); - - if (capacity < 1) - { - SEAD_ASSERT_MSG(false, "capacity[%d] must be larger than zero", capacity); - return false; - } - - auto* buf = new (heap, alignment, std::nothrow) u8[calculateWorkBufferSize(capacity)]; - if (!buf) - return false; - - setBuffer(capacity, buf); - return true; - } - - void setBuffer(s32 max_num, void* buf) - { - if (!buf) - { - SEAD_ASSERT_MSG(false, "buf is null"); - return; - } - - mFreeList.setWork(buf, ElementSize, max_num); - PtrArrayImpl::setBuffer(max_num, reinterpret_cast(buf) + ElementSize * max_num); - } - - void freeBuffer() - { - if (!isBufferReady()) - return; - - clear(); - - if (mFreeList.work()) - delete[] static_cast(mFreeList.work()); - - mFreeList.reset(); - mPtrs = nullptr; - mPtrNumMax = 0; - } - - T* at(s32 pos) const { return static_cast(PtrArrayImpl::at(pos)); } - T* unsafeAt(s32 pos) const { return static_cast(PtrArrayImpl::unsafeAt(pos)); } - T* operator()(s32 pos) const { return unsafeAt(pos); } - T* operator[](s32 pos) const { return at(pos); } - - // XXX: Does this use at()? - T* front() const { return at(0); } - T* back() const { return at(mPtrNum - 1); } - - void pushBack(const T& item) - { - if (isFull()) - SEAD_ASSERT_MSG(false, "buffer full."); - else - PtrArrayImpl::pushBack(alloc(item)); - } - - template - T* emplaceBack(Args&&... args) - { - if (isFull()) - { - SEAD_ASSERT_MSG(false, "buffer full."); - return nullptr; - } - T* item = new (mFreeList.alloc()) T(std::forward(args)...); - PtrArrayImpl::pushBack(item); - return item; - } - - void insert(s32 pos, const T& item) { PtrArrayImpl::insert(pos, alloc(item)); } - - void clear() - { - for (s32 i = 0; i < mPtrNum; ++i) - { - auto* ptr = unsafeAt(i); - ptr->~T(); - mFreeList.free(ptr); - } - mPtrNum = 0; - } - - using CompareCallback = s32 (*)(const T*, const T*); - - void sort() { sort(compareT); } - void sort(CompareCallback cmp) { PtrArrayImpl::sort_(cmp); } - void heapSort() { heapSort(compareT); } - void heapSort(CompareCallback cmp) { PtrArrayImpl::heapSort_(cmp); } - - bool equal(const ObjArray& other, CompareCallback cmp) const - { - return PtrArrayImpl::equal(other, cmp); - } - - s32 compare(const ObjArray& other, CompareCallback cmp) const - { - return PtrArrayImpl::compare(other, cmp); - } - - T* find(const T* ptr) const - { - return PtrArrayImpl::find(ptr, - [](const void* a, const void* b) { return a == b ? 0 : -1; }); - } - T* find(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::find(ptr, cmp); } - s32 search(const T* ptr) const - { - return PtrArrayImpl::search(ptr, - [](const void* a, const void* b) { return a == b ? 0 : -1; }); - } - s32 search(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::search(ptr, cmp); } - s32 binarySearch(const T* ptr) const { return PtrArrayImpl::binarySearch(ptr, compareT); } - s32 binarySearch(const T* ptr, CompareCallback cmp) const - { - return PtrArrayImpl::binarySearch(ptr, cmp); - } - - bool operator==(const ObjArray& other) const { return equal(other, compareT); } - bool operator!=(const ObjArray& other) const { return !(*this == other); } - bool operator<(const ObjArray& other) const { return compare(other) < 0; } - bool operator<=(const ObjArray& other) const { return compare(other) <= 0; } - bool operator>(const ObjArray& other) const { return compare(other) > 0; } - bool operator>=(const ObjArray& other) const { return compare(other) >= 0; } - - void uniq() { PtrArrayImpl::uniq(compareT); } - void uniq(CompareCallback cmp) { PtrArrayImpl::uniq(cmp); } - - class iterator - { - public: - iterator(T* const* pptr) : mPPtr{pptr} {} - bool operator==(const iterator& other) const { return mPPtr == other.mPPtr; } - bool operator!=(const iterator& other) const { return !(*this == other); } - iterator& operator++() - { - ++mPPtr; - return *this; - } - T& operator*() const { return **mPPtr; } - T* operator->() const { return *mPPtr; } - - private: - T* const* mPPtr; - }; - - iterator begin() const { return iterator(data()); } - iterator end() const { return iterator(data() + mPtrNum); } - - class constIterator - { - public: - constIterator(const T* const* pptr) : mPPtr{pptr} {} - bool operator==(const constIterator& other) const { return mPPtr == other.mPPtr; } - bool operator!=(const constIterator& other) const { return !(*this == other); } - constIterator& operator++() - { - ++mPPtr; - return *this; - } - const T& operator*() const { return **mPPtr; } - const T* operator->() const { return *mPPtr; } - - private: - const T* const* mPPtr; - }; - - constIterator constBegin() const { return constIterator(data()); } - constIterator constEnd() const { return constIterator(data() + mPtrNum); } - - T** data() const { return reinterpret_cast(mPtrs); } - -private: - union Node - { - void* next_node; - T elem; - }; - -public: - static constexpr size_t ElementSize = sizeof(Node); - - static constexpr size_t calculateWorkBufferSize(size_t n) - { - return n * (ElementSize + sizeof(T*)); - } - -protected: - T* alloc(const T& item) - { - void* storage = mFreeList.alloc(); - if (!storage) - return nullptr; - return new (storage) T(item); - } - - static int compareT(const void* a_, const void* b_) - { - const T* a = static_cast(a_); - const T* b = static_cast(b_); - if (*a < *b) - return -1; - if (*b < *a) - return 1; - return 0; - } - - sead::FreeList mFreeList; -}; - -template -class FixedObjArray : public ObjArray -{ -public: - FixedObjArray() : ObjArray(N, &mWork) {} - - // These do not make sense for a *fixed* array. - void setBuffer(s32 ptrNumMax, void* buf) = delete; - void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - void freeBuffer() = delete; - -private: - std::aligned_storage_t::calculateWorkBufferSize(N), - std::max(alignof(T), alignof(T*))> - mWork; -}; - -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadObjList.h b/src_remove/lib/sead/include/container/seadObjList.h deleted file mode 100644 index 5c48716..0000000 --- a/src_remove/lib/sead/include/container/seadObjList.h +++ /dev/null @@ -1,245 +0,0 @@ -#pragma once - -#include -#include "basis/seadNew.h" -#include "basis/seadRawPrint.h" -#include "basis/seadTypes.h" -#include "container/seadFreeList.h" -#include "container/seadListImpl.h" -#include "prim/seadPtrUtil.h" - -namespace sead -{ -template -class ObjList : public ListImpl -{ -public: - ObjList() = default; - ObjList(s32 max_num, void* buf) { setBuffer(max_num, buf); } - - void allocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - if (capacity < 1) - return; - - setBuffer(capacity, - new (heap, alignment, std::nothrow) u8[calculateWorkBufferSize(capacity)]); - } - - bool tryAllocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - if (capacity < 1) - return false; - - auto* buf = new (heap, alignment, std::nothrow) u8[calculateWorkBufferSize(capacity)]; - if (!buf) - return false; - - setBuffer(capacity, buf); - return true; - } - - void setBuffer(s32 max_num, void* buf) - { - if (!buf) - { - SEAD_ASSERT_MSG(false, "buf is null"); - return; - } - - mFreeList.setWork(buf, ElementSize, max_num); - mMaxNum = max_num; - } - - void freeBuffer() - { - if (!isBufferReady()) - return; - - clear(); - - if (mFreeList.work()) - delete[] static_cast(mFreeList.work()); - - mMaxNum = 0; - mFreeList.reset(); - } - - bool isBufferReady() const { return mFreeList.work() != nullptr; } - - bool isFull() const { return size() >= mMaxNum; } - - T* front() const { return listNodeToObjWithNullCheck(ListImpl::front()); } - T* back() const { return listNodeToObjWithNullCheck(ListImpl::back()); } - - T popBack() - { - auto* item = back(); - if (!item) - return {}; - - T copy = *item; - erase(item); - return copy; - } - - T popFront() - { - auto* item = front(); - if (!item) - return {}; - - T copy = *item; - erase(item); - return copy; - } - - template - T* emplaceBack(Args&&... args) - { - if (isFull()) - { - SEAD_ASSERT_MSG(false, "buffer full."); - return nullptr; - } - Node* item = new (mFreeList.alloc()) Node{{std::forward(args)...}, {}}; - ListImpl::pushBack(&item->node); - return &item->item; - } - - void erase(T* item) - { - ListImpl::erase(objToListNode(item)); - item->~T(); - mFreeList.free(item); - } - - void clear() - { - ListNode* node = mStartEnd.next(); - while (node != &mStartEnd) - { - // Fetch the next pointer before erasing the item from the linked list. - ListNode* next = node->next(); - ListImpl::erase(node); - - auto* item = listNodeToObj(node); - item->~T(); - mFreeList.free(item); - - node = next; - } - } - - T* prev(const T* obj) const - { - ListNode* prev_node = objToListNode(obj)->prev(); - if (prev_node == &mStartEnd) - return nullptr; - return listNodeToObj(prev_node); - } - - T* next(const T* obj) const - { - ListNode* next_node = objToListNode(obj)->next(); - if (next_node == &mStartEnd) - return nullptr; - return listNodeToObj(next_node); - } - - T* nth(s32 n) const { return listNodeToObjWithNullCheck(ListImpl::nth(n)); } - - s32 indexOf(const T* obj) const { return ListImpl::indexOf(objToListNode(obj)); } - - bool isNodeLinked(const T* obj) const { return objToListNode(obj)->isLinked(); } - - class iterator - { - public: - explicit iterator(T* ptr) : mPtr{ptr} {} - bool operator==(const iterator& other) const { return mPtr == other.mPtr; } - bool operator!=(const iterator& other) const { return !operator==(other); } - iterator& operator++() - { - constexpr auto offset = Node::getListNodeOffset(); - auto* node = static_cast(PtrUtil::addOffset(mPtr, offset))->next(); - mPtr = static_cast(PtrUtil::addOffset(node, -offset)); - return *this; - } - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - - private: - T* mPtr; - }; - - iterator begin() const { return iterator(listNodeToObj(mStartEnd.next())); } - iterator end() const { return iterator(listNodeToObj(const_cast(&mStartEnd))); } - iterator begin(T* ptr) const { return iterator(ptr); } - - static constexpr size_t calculateWorkBufferSize(size_t n) { return n * ElementSize; } - -private: - struct Node - { - static constexpr auto getListNodeOffset() { return offsetof(Node, node); } - T item; - ListNode node; - }; - static_assert(offsetof(Node, item) == 0, "item must be at offset 0 in Node"); - - ListNode* objToListNode(T* obj) const - { - return static_cast(PtrUtil::addOffset(obj, Node::getListNodeOffset())); - } - - const ListNode* objToListNode(const T* obj) const - { - return static_cast(PtrUtil::addOffset(obj, Node::getListNodeOffset())); - } - - T* listNodeToObj(ListNode* node) const - { - return static_cast(PtrUtil::addOffset(node, -Node::getListNodeOffset())); - } - - const T* listNodeToObj(const ListNode* node) const - { - return static_cast(PtrUtil::addOffset(node, -Node::getListNodeOffset())); - } - - T* listNodeToObjWithNullCheck(ListNode* node) const - { - return node ? listNodeToObj(node) : nullptr; - } - - const T* listNodeToObjWithNullCheck(const ListNode* node) const - { - return node ? listNodeToObj(node) : nullptr; - } - - static constexpr size_t ElementSize = std::max(sizeof(Node), FreeList::cPtrSize); - - sead::FreeList mFreeList; - s32 mMaxNum = 0; -}; - -template -class FixedObjList : public ObjList -{ -public: - FixedObjList() : ObjList(N, &mWork) {} - - // These do not make sense for a *fixed* array. - void setBuffer(s32 ptrNumMax, void* buf) = delete; - void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - void freeBuffer() = delete; - -private: - std::aligned_storage_t::calculateWorkBufferSize(N), - std::max(alignof(T), alignof(T*))> - mWork; -}; - -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadOffsetList.h b/src_remove/lib/sead/include/container/seadOffsetList.h deleted file mode 100644 index 76ec2cb..0000000 --- a/src_remove/lib/sead/include/container/seadOffsetList.h +++ /dev/null @@ -1,219 +0,0 @@ -#ifndef SEAD_OFFSET_LIST_H_ -#define SEAD_OFFSET_LIST_H_ - -#include -#include -#include -#include - -namespace sead -{ -template -class OffsetList : public ListImpl -{ -public: - OffsetList() = default; - - void initOffset(s32 offset) { mOffset = offset; } - - void clear() { ListImpl::clear(); } - - void pushBack(T* item) - { - SEAD_ASSERT(mOffset >= 0); - ListImpl::pushBack(objToListNode(item)); - } - - void pushFront(T* item) - { - SEAD_ASSERT(mOffset >= 0); - ListImpl::pushFront(objToListNode(item)); - } - - T* popBack() { return listNodeToObjWithNullCheck(ListImpl::popBack()); } - - T* popFront() { return listNodeToObjWithNullCheck(ListImpl::popFront()); } - - void insertBefore(const T* obj, T* obj_to_insert) - { - ListImpl::insertBefore(const_cast(objToListNode(obj)), - objToListNode(obj_to_insert)); - } - void insertAfter(const T* obj, T* obj_to_insert) - { - ListImpl::insertAfter(const_cast(objToListNode(obj)), - objToListNode(obj_to_insert)); - } - - void erase(T* item) { ListImpl::erase(objToListNode(item)); } - - T* front() const { return listNodeToObjWithNullCheck(ListImpl::front()); } - - T* back() const { return listNodeToObjWithNullCheck(ListImpl::back()); } - - T* prev(const T* obj) const - { - ListNode* prev_node = objToListNode(obj)->prev(); - if (prev_node == &mStartEnd) - return nullptr; - return listNodeToObj(prev_node); - } - - T* next(const T* obj) const - { - ListNode* next_node = objToListNode(obj)->next(); - if (next_node == &mStartEnd) - return nullptr; - return listNodeToObj(next_node); - } - - T* nth(s32 n) const { return listNodeToObjWithNullCheck(ListImpl::nth(n)); } - - s32 indexOf(const T* obj) const { return ListImpl::indexOf(objToListNode(obj)); } - - bool isNodeLinked(const T* obj) const { return objToListNode(obj)->isLinked(); } - - void swap(T* obj1, T* obj2) { ListImpl::swap(objToListNode(obj1), objToListNode(obj2)); } - void moveAfter(T* basis, T* obj) - { - ListImpl::moveAfter(objToListNode(basis), objToListNode(obj)); - } - void moveBefore(T* basis, T* obj) - { - ListImpl::moveBefore(objToListNode(basis), objToListNode(obj)); - } - - using CompareCallback = int (*)(const T*, const T*); - - void sort() { sort(compareT); } - void sort(CompareCallback cmp) { ListImpl::sort(mOffset, cmp); } - void mergeSort() { mergeSort(compareT); } - void mergeSort(CompareCallback cmp) { ListImpl::mergeSort(mOffset, cmp); } - - T* find(const T* obj) const { return find(obj, compareT); } - T* find(const T* obj, CompareCallback cmp) const - { - return listNodeToObj(ListImpl::find(obj, mOffset, cmp)); - } - - void uniq() { uniq(compareT); } - void uniq(CompareCallback cmp) { ListImpl::uniq(mOffset, cmp); } - - class iterator - { - public: - iterator(T* ptr, s32 offset) : mPtr{ptr}, mOffset{offset} {} - bool operator==(const iterator& other) const { return mPtr == other.mPtr; } - bool operator!=(const iterator& other) const { return !(*this == other); } - iterator& operator++() - { - ListNode* node = static_cast(PtrUtil::addOffset(mPtr, mOffset))->next(); - mPtr = static_cast(PtrUtil::addOffset(node, -mOffset)); - return *this; - } - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - - private: - T* mPtr; - s32 mOffset; - }; - - iterator begin() const { return iterator(listNodeToObj(mStartEnd.next()), mOffset); } - iterator end() const - { - return iterator(listNodeToObj(const_cast(&mStartEnd)), mOffset); - } - iterator begin(T* ptr) const { return iterator(ptr, mOffset); } - - class robustIterator - { - public: - robustIterator(T* ptr, s32 offset) - : mPtr{ptr}, mNextNode(static_cast(PtrUtil::addOffset(ptr, offset))->next()), - mOffset{offset} - { - } - bool operator==(const robustIterator& other) const { return mPtr == other.mPtr; } - bool operator!=(const robustIterator& other) const { return !operator==(other); } - robustIterator& operator++() - { - mPtr = static_cast(PtrUtil::addOffset(mNextNode, -mOffset)); - mNextNode = mNextNode->next(); - return *this; - } - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - - private: - T* mPtr; - ListNode* mNextNode; - s32 mOffset; - }; - - robustIterator robustBegin() const - { - return robustIterator(listNodeToObj(mStartEnd.next()), mOffset); - } - - robustIterator robustEnd() const - { - return robustIterator(listNodeToObj(const_cast(&mStartEnd)), mOffset); - } - - robustIterator robustBegin(T* ptr) const { return robustIterator(ptr, mOffset); } - - struct RobustRange - { - auto begin() const { return mList.robustBegin(); } - auto end() const { return mList.robustEnd(); } - const OffsetList& mList; - }; - RobustRange robustRange() const { return {*this}; } - -protected: - static int compareT(const T* lhs, const T* rhs) - { - if (lhs < rhs) - return -1; - if (lhs > rhs) - return 1; - return 0; - } - - ListNode* objToListNode(T* obj) const - { - return static_cast(PtrUtil::addOffset(obj, mOffset)); - } - - const ListNode* objToListNode(const T* obj) const - { - return static_cast(PtrUtil::addOffset(obj, mOffset)); - } - - T* listNodeToObj(ListNode* node) const - { - return static_cast(PtrUtil::addOffset(node, -mOffset)); - } - - const T* listNodeToObj(const ListNode* node) const - { - return static_cast(PtrUtil::addOffset(node, -mOffset)); - } - - T* listNodeToObjWithNullCheck(ListNode* node) const - { - return node ? listNodeToObj(node) : nullptr; - } - - const T* listNodeToObjWithNullCheck(const ListNode* node) const - { - return node ? listNodeToObj(node) : nullptr; - } - - s32 mOffset = -1; -}; - -} // namespace sead - -#endif // SEAD_OFFSET_LIST_H_ diff --git a/src_remove/lib/sead/include/container/seadOrderedSet.h b/src_remove/lib/sead/include/container/seadOrderedSet.h deleted file mode 100644 index 7093648..0000000 --- a/src_remove/lib/sead/include/container/seadOrderedSet.h +++ /dev/null @@ -1,189 +0,0 @@ -#pragma once - -#include "container/seadTreeMap.h" - -namespace sead -{ -/// Requires Value to have operator< defined -/// This can be specialized, but all specializations must define `compare` as follows. -template -struct OrderedSetItemImpl -{ - OrderedSetItemImpl() = default; - // NOLINTNEXTLINE(google-explicit-constructor) - OrderedSetItemImpl(const Value& value_) : value(value_) {} - OrderedSetItemImpl& operator=(const Value& value_) - { - value = value_; - return *this; - } - - /// Returns -1 if this->value < rhs, 0 if this->value = rhs and 1 if this->value > rhs. - s32 compare(const OrderedSetItemImpl& rhs) const - { - if (value < rhs.value) - return -1; - if (rhs.value < value) - return 1; - return 0; - } - - Value value; -}; - -/// This is essentially std::set. Values are stored in a red-black tree in an order -/// determined by the partial order defined for Value (via operator<). -template -class OrderedSet : public TreeMapImpl> -{ -public: - using MapImpl = TreeMapImpl>; - class Node : public MapImpl::Node - { - public: - Node(OrderedSet* set, const Value& value) : mSet(set) { this->mKey = value; } - - void erase_() override; - - // Values cannot be modified. - const Value& value() const { return this->key().value; } - - private: - friend class OrderedSet; - OrderedSet* mSet; - }; - - /// Clears the set and frees the allocated buffer (if needed). - /// Should only be used if the buffer was allocated using allocBuffer. - void finalize() - { - clear(); - freeBuffer(); - } - - bool allocBuffer(s32 node_max, Heap* heap, s32 alignment = sizeof(void*)); - void setBuffer(s32 node_max, void* buffer); - /// Should only be used if the buffer was allocated using allocBuffer. - void freeBuffer(); - - const Value* insert(const Value& value); - void clear(); - - Node* find(const Value& value) const; - - // Callable must have the signature Value& - template - void forEach(const Callable& delegate) const; - - Node* startIterating() const { return static_cast(MapImpl::startIterating()); } - Node* nextNode(Node* node) const { return static_cast(MapImpl::nextNode(node)); } - -private: - void eraseNodeForClear_(typename MapImpl::Node* node); - - FreeList mFreeList; - s32 mSize = 0; - s32 mCapacity = 0; -}; - -template -inline bool OrderedSet::allocBuffer(s32 node_max, Heap* heap, s32 alignment) -{ - SEAD_ASSERT(mFreeList.work() == nullptr); - if (node_max <= 0) - { - SEAD_ASSERT_MSG(false, "node_max[%d] must be larger than zero", node_max); - AllocFailAssert(heap, node_max * sizeof(Node), alignment); - } - - void* work = AllocBuffer(node_max * sizeof(Node), heap, alignment); - if (!work) - return false; - setBuffer(node_max, work); - return true; -} - -template -inline void OrderedSet::setBuffer(s32 node_max, void* buffer) -{ - mCapacity = node_max; - mFreeList.setWork(buffer, sizeof(Node), node_max); -} - -template -inline void OrderedSet::freeBuffer() -{ - void* buffer = mFreeList.work(); - if (!buffer) - return; - - mSize = 0; - MapImpl::clear(); - ::operator delete[](buffer); - mCapacity = 0; - mFreeList.reset(); -} - -template -inline const Value* OrderedSet::insert(const Value& value) -{ - if (mSize >= mCapacity) - { - if (Node* node = find(value)) - { - node->mKey = value; - return &node->value(); - } - SEAD_ASSERT_MSG(false, "map is full."); - return nullptr; - } - - Node* node = new (mFreeList.alloc()) Node(this, value); - ++mSize; - MapImpl::insert(node); - return &node->value(); -} - -template -inline void OrderedSet::clear() -{ - Delegate1, typename MapImpl::Node*> delegate(this, - &OrderedSet::eraseNodeForClear_); - MapImpl::forEach(delegate); - mSize = 0; - MapImpl::clear(); -} - -template -inline typename OrderedSet::Node* OrderedSet::find(const Value& value) const -{ - return static_cast(MapImpl::find(value)); -} - -template -template -inline void OrderedSet::forEach(const Callable& delegate) const -{ - MapImpl::forEach([&delegate](auto* base_node) { - auto* node = static_cast(base_node); - delegate(node->value()); - }); -} - -template -inline void OrderedSet::eraseNodeForClear_(typename MapImpl::Node* node) -{ - // Note: Nintendo does not call the destructor, which is dangerous... - mFreeList.free(node); -} - -template -inline void OrderedSet::Node::erase_() -{ - OrderedSet* const map = mSet; - void* const this_ = this; - // Note: Nintendo does not call the destructor, which is dangerous... - map->mFreeList.free(this_); - --map->mSize; -} -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadPtrArray.h b/src_remove/lib/sead/include/container/seadPtrArray.h deleted file mode 100644 index f597dfe..0000000 --- a/src_remove/lib/sead/include/container/seadPtrArray.h +++ /dev/null @@ -1,377 +0,0 @@ -#ifndef SEAD_PTR_ARRAY_H_ -#define SEAD_PTR_ARRAY_H_ - -#include -#include -#include -#include -#include - -namespace sead -{ -class Heap; -class Random; - -class PtrArrayImpl -{ -public: - PtrArrayImpl() = default; - PtrArrayImpl(s32 ptrNumMax, void* buf) { setBuffer(ptrNumMax, buf); } - - void setBuffer(s32 ptrNumMax, void* buf); - void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)); - bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)); - void freeBuffer(); - bool isBufferReady() const { return mPtrs != nullptr; } - - bool isEmpty() const { return mPtrNum == 0; } - bool isFull() const { return mPtrNum >= mPtrNumMax; } - - s32 size() const { return mPtrNum; } - s32 capacity() const { return mPtrNumMax; } - - void erase(s32 position) { erase(position, 1); } - void erase(s32 position, s32 count); - void clear() { mPtrNum = 0; } - - // TODO - void resize(s32 size); - // TODO - void unsafeResize(s32 size); - - void swap(s32 pos1, s32 pos2) - { - auto* ptr = mPtrs[pos1]; - mPtrs[pos1] = mPtrs[pos2]; - mPtrs[pos2] = ptr; - } - void reverse(); - void shuffle() - { - Random random; - shuffle(&random); - } - void shuffle(Random* random); - -protected: - using CompareCallbackImpl = int (*)(const void* a, const void* b); - - void* at(s32 idx) const - { - if (u32(mPtrNum) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d]", idx, mPtrNum); - return nullptr; - } - return mPtrs[idx]; - } - - void* unsafeAt(s32 idx) const { return mPtrs[idx]; } - - // XXX: should this use at()? - void* front() const { return mPtrs[0]; } - void* back() const { return mPtrs[mPtrNum - 1]; } - - void pushBack(void* ptr) - { - if (isFull()) - { - SEAD_ASSERT_MSG(false, "list is full."); - return; - } - // Simplest insert case, so this is implemented directly without using insert(). - mPtrs[mPtrNum] = ptr; - ++mPtrNum; - } - - void pushFront(void* ptr) { insert(0, ptr); } - - void* popBack() { return isEmpty() ? nullptr : mPtrs[--mPtrNum]; } - - void* popFront() - { - if (isEmpty()) - return nullptr; - - void* result = mPtrs[0]; - erase(0); - return result; - } - - void replace(s32 idx, void* ptr) { mPtrs[idx] = ptr; } - - void* find(const void* ptr, CompareCallbackImpl cmp) const - { - for (s32 i = 0; i < mPtrNum; ++i) - { - if (cmp(mPtrs[i], ptr) == 0) - return mPtrs[i]; - } - return nullptr; - } - - s32 search(const void* ptr, CompareCallbackImpl cmp) const - { - for (s32 i = 0; i < mPtrNum; ++i) - { - if (cmp(mPtrs[i], ptr) == 0) - return i; - } - return -1; - } - - bool equal(const PtrArrayImpl& other, CompareCallbackImpl cmp) const - { - if (mPtrNum != other.mPtrNum) - return false; - - for (s32 i = 0; i < mPtrNum; ++i) - { - if (cmp(mPtrs[i], other.mPtrs[i]) != 0) - return false; - } - return true; - } - - s32 indexOf(const void* ptr) const - { - for (s32 i = 0; i < mPtrNum; ++i) - { - if (mPtrs[i] == ptr) - return i; - } - return -1; - } - - void createVacancy(s32 pos, s32 count) - { - if (mPtrNum <= pos) - return; - - MemUtil::copyOverlap(mPtrs + pos + count, mPtrs + pos, - s32(sizeof(void*)) * (mPtrNum - pos)); - } - - void insert(s32 idx, void* ptr); - void insertArray(s32 idx, void* array, s32 array_length, s32 elem_size); - bool checkInsert(s32 idx, s32 num); - - template - void sort_(Compare cmp) - { - // Note: Nintendo did not use - std::sort(mPtrs, mPtrs + size(), [&](const void* a, const void* b) { - return cmp(static_cast(a), static_cast(b)) < 0; - }); - } - - template - void heapSort_(Compare cmp) - { - // Note: Nintendo did not use - const auto less_cmp = [&](const void* a, const void* b) { - return cmp(static_cast(a), static_cast(b)) < 0; - }; - std::make_heap(mPtrs, mPtrs + size(), less_cmp); - std::sort_heap(mPtrs, mPtrs + size(), less_cmp); - } - - void heapSort(CompareCallbackImpl cmp); - - s32 compare(const PtrArrayImpl& other, CompareCallbackImpl cmp) const; - void uniq(CompareCallbackImpl cmp); - - s32 binarySearch(const void* ptr, CompareCallbackImpl cmp) const - { - if (mPtrNum == 0) - return -1; - - s32 a = 0; - s32 b = mPtrNum - 1; - while (a < b) - { - const s32 m = (a + b) / 2; - const s32 c = cmp(mPtrs[m], ptr); - if (c == 0) - return m; - if (c < 0) - a = m + 1; - else - b = m; - } - - if (cmp(mPtrs[a], ptr) == 0) - return a; - - return -1; - } - - s32 mPtrNum = 0; - s32 mPtrNumMax = 0; - void** mPtrs = nullptr; -}; - -template -class PtrArray : public PtrArrayImpl -{ -public: - PtrArray() = default; - PtrArray(s32 ptrNumMax, T** buf) : PtrArrayImpl(ptrNumMax, buf) {} - - T* at(s32 pos) const { return static_cast(PtrArrayImpl::at(pos)); } - T* unsafeAt(s32 pos) const { return static_cast(PtrArrayImpl::unsafeAt(pos)); } - T* operator()(s32 pos) const { return unsafeAt(pos); } - T* operator[](s32 pos) const { return at(pos); } - - // XXX: Does this use at()? - T* front() const { return at(0); } - T* back() const { return at(mPtrNum - 1); } - - void pushBack(T* ptr) { PtrArrayImpl::pushBack(constCast(ptr)); } - void pushFront(T* ptr) { PtrArrayImpl::pushFront(constCast(ptr)); } - - T* popBack() { return static_cast(PtrArrayImpl::popBack()); } - T* popFront() { return static_cast(PtrArrayImpl::popFront()); } - - void insert(s32 pos, T* ptr) { PtrArrayImpl::insert(pos, constCast(ptr)); } - void insert(s32 pos, T* array, s32 count) - { - // XXX: is this right? - PtrArrayImpl::insertArray(pos, constCast(array), count, sizeof(T)); - } - void replace(s32 pos, T* ptr) { PtrArrayImpl::replace(pos, constCast(ptr)); } - - s32 indexOf(const T* ptr) const { return PtrArrayImpl::indexOf(ptr); } - - using CompareCallback = s32 (*)(const T*, const T*); - - void sort() { sort(compareT); } - void sort(CompareCallback cmp) { PtrArrayImpl::sort_(cmp); } - void heapSort() { heapSort(compareT); } - void heapSort(CompareCallback cmp) { PtrArrayImpl::heapSort_(cmp); } - - bool equal(const PtrArray& other, CompareCallback cmp) const - { - return PtrArrayImpl::equal(other, cmp); - } - - s32 compare(const PtrArray& other, CompareCallback cmp) const - { - return PtrArrayImpl::compare(other, cmp); - } - - T* find(const T* ptr) const - { - return PtrArrayImpl::find(ptr, - [](const void* a, const void* b) { return a == b ? 0 : -1; }); - } - T* find(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::find(ptr, cmp); } - s32 search(const T* ptr) const - { - return PtrArrayImpl::search(ptr, - [](const void* a, const void* b) { return a == b ? 0 : -1; }); - } - s32 search(const T* ptr, CompareCallback cmp) const { return PtrArrayImpl::search(ptr, cmp); } - s32 binarySearch(const T* ptr) const { return PtrArrayImpl::binarySearch(ptr, compareT); } - s32 binarySearch(const T* ptr, CompareCallback cmp) const - { - return PtrArrayImpl::binarySearch(ptr, cmp); - } - - bool operator==(const PtrArray& other) const { return equal(other, compareT); } - bool operator!=(const PtrArray& other) const { return !(*this == other); } - bool operator<(const PtrArray& other) const { return compare(other) < 0; } - bool operator<=(const PtrArray& other) const { return compare(other) <= 0; } - bool operator>(const PtrArray& other) const { return compare(other) > 0; } - bool operator>=(const PtrArray& other) const { return compare(other) >= 0; } - - void uniq() { PtrArrayImpl::uniq(compareT); } - void uniq(CompareCallback cmp) { PtrArrayImpl::uniq(cmp); } - - class iterator - { - public: - iterator(T* const* pptr) : mPPtr{pptr} {} - bool operator==(const iterator& other) const { return mPPtr == other.mPPtr; } - bool operator!=(const iterator& other) const { return !(*this == other); } - iterator& operator++() - { - ++mPPtr; - return *this; - } - T& operator*() const { return **mPPtr; } - T* operator->() const { return *mPPtr; } - - private: - T* const* mPPtr; - }; - - iterator begin() const { return iterator(data()); } - iterator end() const { return iterator(data() + mPtrNum); } - - class constIterator - { - public: - constIterator(const T* const* pptr) : mPPtr{pptr} {} - bool operator==(const constIterator& other) const { return mPPtr == other.mPPtr; } - bool operator!=(const constIterator& other) const { return !(*this == other); } - constIterator& operator++() - { - ++mPPtr; - return *this; - } - const T& operator*() const { return **mPPtr; } - const T* operator->() const { return *mPPtr; } - - private: - const T* const* mPPtr; - }; - - constIterator constBegin() const { return constIterator(data()); } - constIterator constEnd() const { return constIterator(data() + mPtrNum); } - - T** data() const { return reinterpret_cast(mPtrs); } - T** dataBegin() const { return data(); } - T** dataEnd() const { return data() + mPtrNum; } - -protected: - static void* constCast(const T* ptr) - { - // Unfortunately, we need to cast away const because several PtrArrayImpl functions - // only take void* even though the pointed-to object isn't actually modified. - return static_cast(const_cast*>(ptr)); - } - - static int compareT(const void* a_, const void* b_) - { - const T* a = static_cast(a_); - const T* b = static_cast(b_); - if (*a < *b) - return -1; - if (*b < *a) - return 1; - return 0; - } -}; - -template -class FixedPtrArray : public PtrArray -{ -public: - FixedPtrArray() : PtrArray(N, mWork) {} - - // These do not make sense for a *fixed* array. - void setBuffer(s32 ptrNumMax, void* buf) = delete; - void allocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - bool tryAllocBuffer(s32 ptrNumMax, Heap* heap, s32 alignment = sizeof(void*)) = delete; - void freeBuffer() = delete; - -private: - // Nintendo uses an untyped u8[N*sizeof(void*)] buffer. That is undefined behavior, - // so we will not do that. - T* mWork[N]; -}; - -} // namespace sead - -#endif // SEAD_PTR_ARRAY_H_ diff --git a/src_remove/lib/sead/include/container/seadRingBuffer.h b/src_remove/lib/sead/include/container/seadRingBuffer.h deleted file mode 100644 index ff9c08f..0000000 --- a/src_remove/lib/sead/include/container/seadRingBuffer.h +++ /dev/null @@ -1,337 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include -#include -#include - -namespace sead -{ -class Heap; - -template -class RingBuffer -{ -public: - RingBuffer() = default; - RingBuffer(s32 capacity, T* buffer) { setBuffer(capacity, buffer); } - template - explicit RingBuffer(T (&array)[N]) : RingBuffer(N, array) - { - } - - class iterator - { - public: - explicit iterator(RingBuffer* buffer, s32 index = 0) : mIndex(index), mBuffer(buffer) {} - bool operator==(const iterator& rhs) const - { - return mIndex == rhs.mIndex && mBuffer == rhs.mBuffer; - } - bool operator!=(const iterator& rhs) const { return !operator==(rhs); } - iterator& operator++() - { - ++mIndex; - return *this; - } - T& operator*() const { return buffer()(mIndex); } - T* operator->() const { return &buffer()(mIndex); } - s32 getIndex() const { return mIndex; } - - private: - RingBuffer& buffer() const { return *mBuffer; } - - s32 mIndex; - RingBuffer* mBuffer; - }; - - class constIterator - { - public: - explicit constIterator(const RingBuffer* buffer, s32 index = 0) - : mIndex(index), mBuffer(buffer) - { - } - bool operator==(const constIterator& rhs) const - { - return mIndex == rhs.mIndex && mBuffer == rhs.mBuffer; - } - bool operator!=(const constIterator& rhs) const { return !operator==(rhs); } - constIterator& operator++() - { - ++mIndex; - return *this; - } - const T& operator*() const { return buffer()(mIndex); } - const T* operator->() const { return &buffer()(mIndex); } - s32 getIndex() const { return mIndex; } - - private: - const RingBuffer& buffer() const { return *mBuffer; } - - s32 mIndex; - const RingBuffer* mBuffer; - }; - - iterator begin() { return iterator(this); } - constIterator begin() const { return constIterator(this); } - iterator begin(s32 start_idx) { return iterator(this, wrapIndex(start_idx)); } - constIterator begin(s32 start_idx) const { return constIterator(this, wrapIndex(start_idx)); } - iterator end() { return iterator(this, mSize); } - constIterator end() const { return constIterator(this, mSize); } - - void allocBuffer(s32 capacity, s32 alignment) { void(tryAllocBuffer(capacity, alignment)); } - - void allocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - static_cast(tryAllocBuffer(capacity, heap, alignment)); - } - - bool tryAllocBuffer(s32 capacity, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mBuffer == nullptr); - if (capacity > 0) - { - T* buffer = new (alignment, std::nothrow) T[capacity]; - if (buffer) - { - mBuffer = buffer; - mHead = mSize = 0; - mCapacity = capacity; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - return true; - } - return false; - } - SEAD_ASSERT_MSG(false, "numMax[%d] must be larger than zero", capacity); - return false; - } - - bool tryAllocBuffer(s32 capacity, Heap* heap, s32 alignment = sizeof(void*)) - { - SEAD_ASSERT(mBuffer == nullptr); - if (capacity > 0) - { - T* buffer = new (heap, alignment, std::nothrow) T[capacity]; - if (buffer) - { - mBuffer = buffer; - mHead = mSize = 0; - mCapacity = capacity; - SEAD_ASSERT_MSG(PtrUtil::isAlignedPow2(mBuffer, sead::Mathi::abs(alignment)), - "don't set alignment for a class with destructor"); - return true; - } - return false; - } - SEAD_ASSERT_MSG(false, "numMax[%d] must be larger than zero", capacity); - return false; - } - - void allocBufferAssert(s32 size, Heap* heap, s32 alignment = sizeof(void*)) - { - if (!tryAllocBuffer(size, heap, alignment)) - AllocFailAssert(heap, sizeof(T) * size, alignment); - } - - void freeBuffer() - { - if (mBuffer) - { - delete[] mBuffer; - mBuffer = nullptr; - mCapacity = 0; - mHead = 0; - mSize = 0; - } - } - - void setBuffer(s32 capacity, T* bufferptr) - { - if (capacity < 1) - { - SEAD_ASSERT_MSG(false, "numMax[%d] must be larger than zero", capacity); - return; - } - if (!bufferptr) - { - SEAD_ASSERT_MSG(false, "bufferptr is null"); - return; - } - mBuffer = bufferptr; - mHead = mSize = 0; - mCapacity = capacity; - } - - bool isBufferReady() const { return mBuffer != nullptr; } - - T& operator[](s32 idx) - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d/%d]", idx, mSize, mCapacity); - return mBuffer[0]; - } - return *unsafeGet(idx); - } - - const T& operator[](s32 idx) const - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d/%d]", idx, mSize, mCapacity); - return mBuffer[0]; - } - return *unsafeGet(idx); - } - - T* get(s32 idx) - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d/%d]", idx, mSize, mCapacity); - return nullptr; - } - return unsafeGet(idx); - } - - const T* get(s32 idx) const - { - if (u32(mSize) <= u32(idx)) - { - SEAD_ASSERT_MSG(false, "index exceeded [%d/%d/%d]", idx, mSize, mCapacity); - return nullptr; - } - - return unsafeGet(idx); - } - - T& operator()(s32 idx) { return *unsafeGet(idx); } - const T& operator()(s32 idx) const { return *unsafeGet(idx); } - - T* unsafeGet(s32 idx) { return &mBuffer[calcRealIdx(idx)]; } - const T* unsafeGet(s32 idx) const { return &mBuffer[calcRealIdx(idx)]; } - - T& front() { return *unsafeGet(0); } - const T& front() const { return *unsafeGet(0); } - - T& back() - { - if (mSize < 1) - { - SEAD_ASSERT_MSG(false, "no element"); - return mBuffer[0]; - } - return *unsafeGet(mSize - 1); - } - - const T& back() const - { - if (mSize < 1) - { - SEAD_ASSERT_MSG(false, "no element"); - return mBuffer[0]; - } - return *unsafeGet(mSize - 1); - } - - s32 capacity() const { return mCapacity; } - s32 size() const { return mSize; } - - bool empty() const { return mSize == 0; } - explicit operator bool() const { return !empty(); } - - T* data() { return mBuffer; } - const T* data() const { return mBuffer; } - - void forcePushBack(const T& item) - { - if (mSize < mCapacity) - { - pushBack(item); - return; - } - - if (mSize >= 1) - popFront(); - pushBack(item); - } - - bool pushBack(const T& item) - { - if (mSize >= mCapacity) - return false; - *unsafeGet(mSize++) = item; - return true; - } - - void forcePushBackwards(const T& item, u32 offset = 1) - { - mHead = (mHead < 1 ? mCapacity : mHead) - offset; - ++mSize; - *unsafeGet(0) = item; - } - - bool pushBackwards(const T& item) - { - if (mSize >= mCapacity) - return false; - forcePushBackwards(item); - return true; - } - - T popFront() - { - if (mSize >= 1) - { - T item = *unsafeGet(0); - mHead = mHead + 1 < mCapacity ? mHead + 1 : 0; - --mSize; - return item; - } - SEAD_ASSERT_MSG(false, "no element"); - return {}; - } - - void clear() { mHead = mSize = 0; } - -protected: - s32 calcRealIdx(s32 idx) const - { - s32 real_idx = mHead + idx; - if (real_idx >= mCapacity) - real_idx -= mCapacity; - return real_idx; - } - - s32 wrapIndex(s32 idx) const { return u32(idx) > u32(mSize) ? 0 : idx; } - - T* mBuffer = nullptr; - s32 mCapacity = 0; - s32 mHead = 0; - s32 mSize = 0; -}; - -template -class FixedRingBuffer : public RingBuffer -{ -public: - FixedRingBuffer() { RingBuffer::setBuffer(N, mData); } - - void allocBuffer(s32 capacity, s32 alignment) = delete; - void allocBuffer(s32 capacity, Heap* heap, s32 alignment) = delete; - bool tryAllocBuffer(s32 capacity, s32 alignment) = delete; - bool tryAllocBuffer(s32 capacity, Heap* heap, s32 alignment) = delete; - void allocBufferAssert(s32 size, Heap* heap, s32 alignment) = delete; - void freeBuffer() = delete; - void setBuffer(s32 capacity, T* bufferptr) = delete; - -private: - T mData[N]; -}; -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadSafeArray.h b/src_remove/lib/sead/include/container/seadSafeArray.h deleted file mode 100644 index 2de1d8e..0000000 --- a/src_remove/lib/sead/include/container/seadSafeArray.h +++ /dev/null @@ -1,158 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace sead -{ -/// A lightweight std::array like wrapper for a C style array. -template -class SafeArray -{ -public: - T mBuffer[N]; - - T& operator[](s32 idx) - { - if (u32(idx) < N) - return mBuffer[idx]; -#ifdef MATCHING_HACK_NX_CLANG - // Force __LINE__ to be an odd number that cannot be encoded as an immediate for ORR. - // Otherwise, LLVM's register coalescer can get rid of too many register copies, - // which messes up register allocation. -#line 44 -#endif - SEAD_ASSERT_MSG(false, "range over [0, %d) : %d", N, idx); - return mBuffer[0]; - } - - const T& operator[](s32 idx) const - { - if (u32(idx) < N) - return mBuffer[idx]; -#ifdef MATCHING_HACK_NX_CLANG - // Force __LINE__ to be an even number that can be encoded as an immediate for ORR. - // Otherwise, LLVM's register coalescer can fail to get rid of some register copies, - // which messes up register allocation. -#line 59 -#endif - SEAD_ASSERT_MSG(false, "range over [0, %d) : %d", N, idx); - return mBuffer[0]; - } - - T& operator()(s32 idx) { return mBuffer[idx]; } - const T& operator()(s32 idx) const { return mBuffer[idx]; } - - T& front() { return mBuffer[0]; } - const T& front() const { return mBuffer[0]; } - T& back() { return mBuffer[N - 1]; } - const T& back() const { return mBuffer[N - 1]; } - - int size() const { return N; } - u32 getByteSize() const { return N * sizeof(T); } - - T* getBufferPtr() { return mBuffer; } - const T* getBufferPtr() const { return mBuffer; } - - void fill(const T& value) - { - for (s32 i = 0; i < N; ++i) - mBuffer[i] = value; - } - - class iterator - { - public: - iterator(T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {} - bool operator==(const iterator& rhs) const - { - return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx; - } - bool operator!=(const iterator& rhs) const { return !(*this == rhs); } - iterator& operator++() - { - ++mIdx; - return *this; - } - iterator& operator--() - { - --mIdx; - return *this; - } - T* operator->() const { return &mBuffer[mIdx]; } - T& operator*() const { return mBuffer[mIdx]; } - - private: - T* mBuffer; - s32 mIdx; - }; - - iterator begin() { return iterator(mBuffer, 0); } - iterator end() { return iterator(mBuffer, N); } - - class constIterator - { - public: - constIterator(const T* buffer, s32 idx) : mBuffer(buffer), mIdx(idx) {} - bool operator==(const constIterator& rhs) const - { - return mBuffer == rhs.mBuffer && mIdx == rhs.mIdx; - } - bool operator!=(const constIterator& rhs) const { return !(*this == rhs); } - constIterator& operator++() - { - ++mIdx; - return *this; - } - constIterator& operator--() - { - --mIdx; - return *this; - } - const T* operator->() const { return &mBuffer[mIdx]; } - const T& operator*() const { return mBuffer[mIdx]; } - - private: - const T* mBuffer; - s32 mIdx; - }; - - constIterator constBegin() const { return constIterator(mBuffer, 0); } - constIterator constEnd() const { return constIterator(mBuffer, N); } - - constIterator begin() const { return constIterator(mBuffer, 0); } - constIterator end() const { return constIterator(mBuffer, N); } -}; - -namespace detail -{ -// From https://en.cppreference.com/w/cpp/container/array/to_array -template -constexpr SafeArray, N> to_array_impl(T (&a)[N], std::index_sequence) -{ - return {{a[I]...}}; -} - -template -constexpr SafeArray, N> to_array_impl(T(&&a)[N], std::index_sequence) -{ - return {{std::move(a[I])...}}; -} -} // namespace detail - -// Implementation of C++20 std::to_array for sead::SafeArray. -template -constexpr sead::SafeArray, N> toArray(T (&a)[N]) -{ - return detail::to_array_impl(a, std::make_index_sequence{}); -} - -// Implementation of C++20 std::to_array for sead::SafeArray. -template -constexpr sead::SafeArray, N> toArray(T(&&a)[N]) -{ - return detail::to_array_impl(std::move(a), std::make_index_sequence{}); -} -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadStrTreeMap.h b/src_remove/lib/sead/include/container/seadStrTreeMap.h deleted file mode 100644 index e74ac80..0000000 --- a/src_remove/lib/sead/include/container/seadStrTreeMap.h +++ /dev/null @@ -1,171 +0,0 @@ -#pragma once - -#include "basis/seadTypes.h" -#include "container/seadFreeList.h" -#include "container/seadTreeMap.h" -#include "prim/seadDelegate.h" -#include "prim/seadSafeString.h" - -namespace sead -{ -/// Sorted associative container with fixed-length string keys. -/// This is essentially std::map -template -class StrTreeMap : public TreeMapImpl -{ -public: - using MapImpl = TreeMapImpl; - class Node : public MapImpl::Node - { - public: - Node(StrTreeMap* map, const SafeString& key, const Value& value) : mValue(value), mMap(map) - { - BufferedSafeString buffer(mKeyData, MaxKeyLength + 1); - buffer.copy(key); - this->mKey = buffer; - } - - void erase_() override; - - Value& value() { return mValue; } - const Value& value() const { return mValue; } - - private: - friend class StrTreeMap; - - Value mValue; - StrTreeMap* mMap; - char mKeyData[MaxKeyLength + 1]; - }; - - ~StrTreeMap(); - - void allocBuffer(s32 node_max, Heap* heap, s32 alignment = sizeof(void*)); - void setBuffer(s32 node_max, void* buffer); - void freeBuffer(); - - Value* insert(const SafeString& key, const Value& value); - void clear(); - - Node* find(const SafeString& key) const; - - // Callable must have the signature Key&, Value& - template - void forEach(const Callable& delegate) const; - -private: - void eraseNodeForClear_(typename MapImpl::Node* node); - - FreeList mFreeList; - s32 mSize = 0; - s32 mCapacity = 0; -}; - -template -inline void StrTreeMap::Node::erase_() -{ - StrTreeMap* const map = mMap; - void* const this_ = this; - // Note: Nintendo does not call the destructor, which is dangerous... - map->mFreeList.free(this_); - --map->mSize; -} - -template -inline StrTreeMap::~StrTreeMap() -{ - void* work = mFreeList.work(); - if (!work) - return; - - clear(); - freeBuffer(); -} - -template -inline void StrTreeMap::allocBuffer(s32 node_max, Heap* heap, s32 alignment) -{ - SEAD_ASSERT(mFreeList.work() == nullptr); - if (node_max <= 0) - { - SEAD_ASSERT_MSG(false, "node_max[%d] must be larger than zero", node_max); - AllocFailAssert(heap, node_max * sizeof(Node), alignment); - } - - void* work = AllocBuffer(node_max * sizeof(Node), heap, alignment); - if (work) - setBuffer(node_max, work); -} - -template -inline void StrTreeMap::setBuffer(s32 node_max, void* buffer) -{ - mCapacity = node_max; - mFreeList.setWork(buffer, sizeof(Node), node_max); -} - -template -inline void StrTreeMap::freeBuffer() -{ - void* buffer = mFreeList.work(); - if (!buffer) - return; - - ::operator delete[](buffer); - mCapacity = 0; - mFreeList.reset(); -} - -template -inline Value* StrTreeMap::insert(const SafeString& key, const Value& value) -{ - if (mSize >= mCapacity) - { - if (Node* node = find(key)) - { - node->value() = value; - return &node->value(); - } - SEAD_ASSERT_MSG(false, "map is full."); - return nullptr; - } - - Node* node = new (mFreeList.alloc()) Node(this, key, value); - ++mSize; - MapImpl::insert(node); - return &node->value(); -} - -template -inline void StrTreeMap::clear() -{ - Delegate1, typename MapImpl::Node*> delegate( - this, &StrTreeMap::eraseNodeForClear_); - MapImpl::forEach(delegate); - mSize = 0; - MapImpl::clear(); -} - -template -inline typename StrTreeMap::Node* StrTreeMap::find(const SafeString& key) const -{ - return static_cast(MapImpl::find(key)); -} - -template -template -inline void StrTreeMap::forEach(const Callable& delegate) const -{ - MapImpl::forEach([&delegate](auto* base_node) { - auto* node = static_cast(base_node); - delegate(node->key(), node->value()); - }); -} - -template -inline void StrTreeMap::eraseNodeForClear_(typename MapImpl::Node* node) -{ - // Note: Nintendo does not call the destructor, which is dangerous... - mFreeList.free(node); -} -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadTList.h b/src_remove/lib/sead/include/container/seadTList.h deleted file mode 100644 index 0dbf908..0000000 --- a/src_remove/lib/sead/include/container/seadTList.h +++ /dev/null @@ -1,206 +0,0 @@ -#ifndef SEAD_TLIST_H_ -#define SEAD_TLIST_H_ - -#include - -namespace sead -{ -template -class TListNode; - -template -class TList : public ListImpl -{ -public: - using CompareCallback = int (*)(const T*, const T*); - - TList() : ListImpl() {} - - void pushBack(TListNode* item) - { - item->erase(); - item->mList = this; - ListImpl::pushBack(item); - } - - void pushFront(TListNode* item) - { - item->erase(); - item->mList = this; - ListImpl::pushFront(item); - } - - TListNode* popBack() { return static_cast*>(ListImpl::popBack()); } - TListNode* popFront() { return static_cast*>(ListImpl::popFront()); } - - void insertBefore(TListNode* node, TListNode* node_to_insert) - { - ListImpl::insertBefore(node, node_to_insert); - } - - void insertAfter(TListNode* node, TListNode* node_to_insert) - { - ListImpl::insertAfter(node, node_to_insert); - } - - void erase(TListNode* item) - { - if (!item->mList) - return; - item->mList = nullptr; - ListImpl::erase(item); - } - - TListNode* front() const { return static_cast*>(ListImpl::front()); } - TListNode* back() const { return static_cast*>(ListImpl::back()); } - TListNode* nth(int n) const { return static_cast*>(ListImpl::nth(n)); } - s32 indexOf(const TListNode* node) const { return ListImpl::indexOf(node); } - - void swap(TListNode* n1, TListNode* n2) { ListImpl::swap(n1, n2); } - void moveAfter(TListNode* basis, TListNode* n) { ListImpl::moveAfter(basis, n); } - void moveBefore(TListNode* basis, TListNode* n) { ListImpl::moveBefore(basis, n); } - - void sort(s32 offset, CompareCallback cmp) { ListImpl::sort(offset, cmp); } - void mergeSort(s32 offset, CompareCallback cmp) { ListImpl::mergeSort(offset, cmp); } - - TListNode* find(const void* ptr, s32 offset, CompareCallback cmp) const - { - return static_cast*>(ListImpl::find(ptr, offset, cmp)); - } - void uniq(s32 offset, CompareCallback cmp) { ListImpl::uniq(offset, cmp); } - void clear() { ListImpl::clear(); } - - TListNode* prev(const TListNode* node) const - { - auto prev_node = static_cast*>(node->prev()); - if (prev_node == &mStartEnd) - return nullptr; - return prev_node; - } - - TListNode* next(const TListNode* node) const - { - auto next_node = static_cast*>(node->next()); - if (next_node == &mStartEnd) - return nullptr; - return next_node; - } - - class iterator - { - public: - iterator(TListNode* ptr) : mPtr(ptr) {} - - iterator& operator++() - { - mPtr = static_cast*>(mPtr->next()); - return *this; - } - - iterator& operator--() - { - mPtr = static_cast*>(mPtr->prev()); - return *this; - } - - T& operator*() const { return mPtr->mData; } - T* operator->() const { return &mPtr->mData; } - - friend bool operator==(iterator it1, iterator it2) { return it1.mPtr == it2.mPtr; } - friend bool operator!=(iterator it1, iterator it2) { return !(it1 == it2); } - - private: - TListNode* mPtr; - }; - - iterator begin() const { return iterator(static_cast*>(mStartEnd.next())); } - - iterator end() const - { - return iterator(static_cast*>(const_cast(&mStartEnd))); - } - - class robustIterator - { - public: - robustIterator(TListNode* ptr) : mPtr(ptr) - { - mPtrNext = static_cast*>(mPtr->next()); - } - - robustIterator& operator++() - { - mPtr = mPtrNext; - mPtrNext = static_cast*>(mPtrNext->next()); - return *this; - } - - T& operator*() const { return mPtr->mData; } - T* operator->() const { return &mPtr->mData; } - - friend bool operator==(robustIterator it1, robustIterator it2) - { - return it1.mPtr == it2.mPtr; - } - friend bool operator!=(robustIterator it1, robustIterator it2) { return !(it1 == it2); } - - private: - TListNode* mPtr; - TListNode* mPtrNext; - }; - - robustIterator robustBegin() const - { - return robustIterator(static_cast*>(mStartEnd.next())); - } - - robustIterator robustEnd() const - { - return robustIterator(static_cast*>(const_cast(&mStartEnd))); - } - - struct RobustRange - { - auto begin() const { return mList.robustBegin(); } - auto end() const { return mList.robustEnd(); } - const TList& mList; - }; - RobustRange robustRange() const { return {*this}; } - -private: - static int compareT(const T* a, const T* b) - { - if (*a < *b) - return -1; - if (*a > *b) - return 1; - return 0; - } -}; - -template -class TListNode : public ListNode -{ -public: - TListNode() : ListNode() - { - mData = nullptr; - mList = NULL; - } - - TListNode(T data) : ListNode(), mData(data), mList(nullptr) {} - - void erase() - { - TList* list = mList; - if (list != NULL) - list->erase(this); - } - - T mData; - TList* mList; -}; - -} // namespace sead - -#endif // SEAD_TLIST_H_ diff --git a/src_remove/lib/sead/include/container/seadTreeMap.h b/src_remove/lib/sead/include/container/seadTreeMap.h deleted file mode 100644 index c6d7c77..0000000 --- a/src_remove/lib/sead/include/container/seadTreeMap.h +++ /dev/null @@ -1,584 +0,0 @@ -#pragma once - -#include "basis/seadRawPrint.h" -#include "container/seadFreeList.h" -#include "prim/seadBitUtil.h" -#include "prim/seadDelegate.h" -#include "prim/seadSafeString.h" - -namespace sead -{ -template -class TreeMapNode; - -/// Sorted associative container, implemented using a left-leaning red-black tree. -/// For an explanation of the algorithm, see https://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf -template -class TreeMapImpl -{ -public: - using Node = TreeMapNode; - - void insert(Node* node); - void erase(const Key& key); - void clear(); - - Node* find(const Key& key) const { return find(mRoot, key); } - - template - void forEach(const Callable& callable) const - { - if (mRoot) - forEach(mRoot, callable); - } - - Node* startIterating() const - { - if (!mRoot) - return nullptr; - return startIterating(mRoot); - } - - Node* nextNode(Node* node) const - { - if (!node) - return nullptr; - - // If there is a right child node, explore that branch first. - if (node->mRight) - { - node->mRight->setParent(node); - return startIterating(node->mRight); - } - - // Otherwise, walk back up to the node P from which we reached this node - // by following P's left child pointer. - while (auto* const parent = node->getParent()) - { - if (parent->mLeft == node) - return parent; - node = parent; - } - return nullptr; - } - -protected: - /// Returns the left most child of a given node, marking each node with its parent - /// along the way. - static Node* startIterating(Node* node) - { - while (node->mLeft) - { - node->mLeft->setParent(node); - node = node->mLeft; - } - return node; - } - - Node* insert(Node* root, Node* node); - Node* erase(Node* root, const Key& key); - Node* find(Node* root, const Key& key) const; - - static inline Node* rotateLeft(Node* node); - static inline Node* rotateRight(Node* node); - static inline Node* moveRedLeft(Node* node); - static inline Node* moveRedRight(Node* node); - static Node* findMin(Node* node); - static Node* eraseMin(Node* node); - static inline Node* fixUp(Node* node); - static bool isRed(const Node* node) { return node && node->isRed(); } - static inline void flipColors(Node* node); - - template - static void forEach(Node* start, const Callable& callable); - - Node* mRoot = nullptr; -}; - -/// Requires Key to have a compare() member function, which returns -1 if lhs < rhs, 0 if lhs = rhs -/// and 1 if lhs > rhs. -template -class TreeMapNode -{ -public: - TreeMapNode() - { - mLeft = mRight = nullptr; - mColorAndPtr = 0; - } - - virtual ~TreeMapNode() = default; - virtual void erase_() = 0; - - const Key& key() const { return mKey; } - -protected: - friend class TreeMapImpl; - - enum class Color - { - Red = 0, - Black = 1, - }; - - void flipColor() { BitUtil::bitCastWrite(mColorAndPtr ^ 1u, &mColorAndPtr); } - void setColor(Color color) { mColorAndPtr = uintptr_t(color); } - - void setParent(TreeMapNode* parent) { mColorAndPtr = (mColorAndPtr & 1) | uintptr_t(parent); } - /// @warning Only valid if setParent has been called! - TreeMapNode* getParent() const { return reinterpret_cast(mColorAndPtr & ~1); } - - bool isRed() const { return (mColorAndPtr & 1u) == bool(Color::Red); } - - TreeMapNode* mLeft; - TreeMapNode* mRight; - uintptr_t mColorAndPtr; - Key mKey; -}; - -/// Requires Key to have operator< defined -/// This can be specialized, but all specializations must define `compare` and `key` as follows. -template -struct TreeMapKeyImpl -{ - TreeMapKeyImpl() = default; - TreeMapKeyImpl(const Key& key_) : key(key_) {} - TreeMapKeyImpl& operator=(const Key& key_) - { - key = key_; - return *this; - } - - /// Returns -1 if mKey < rhs, 0 if mKey = rhs and 1 if mKey > rhs. - s32 compare(const TreeMapKeyImpl& rhs) const - { - if (key < rhs.key) - return -1; - if (rhs.key < key) - return 1; - return 0; - } - - Key key; -}; - -/// Sorted associative container. -/// This is essentially std::map -template -class TreeMap : public TreeMapImpl> -{ -public: - using MapImpl = TreeMapImpl>; - class Node : public MapImpl::Node - { - public: - Node(TreeMap* map, const Key& key, const Value& value) : mValue(value), mMap(map) - { - this->mKey = key; - } - - void erase_() override; - - Value& value() { return mValue; } - const Value& value() const { return mValue; } - - private: - friend class TreeMap; - - Value mValue; - TreeMap* mMap; - }; - - ~TreeMap(); - - void allocBuffer(s32 node_max, Heap* heap, s32 alignment = sizeof(void*)); - void setBuffer(s32 node_max, void* buffer); - void freeBuffer(); - - Value* insert(const Key& key, const Value& value); - void clear(); - - Node* find(const Key& key) const; - - // Callable must have the signature Key&, Value& - template - void forEach(const Callable& delegate) const; - - Node* startIterating() const { return static_cast(MapImpl::startIterating()); } - Node* nextNode(Node* node) const { return static_cast(MapImpl::nextNode(node)); } - -private: - void eraseNodeForClear_(typename MapImpl::Node* node); - - FreeList mFreeList; - s32 mSize = 0; - s32 mCapacity = 0; -}; - -template -class IntrusiveTreeMap : public TreeMapImpl -{ -public: - using MapImpl = TreeMapImpl; - - Node* find(const Key& key) const { return static_cast(MapImpl::find(key)); } - - // Callable must have the signature Node* - template - void forEach(const Callable& delegate) const - { - MapImpl::forEach([delegate](auto* base_node) { - auto* node = static_cast(base_node); - delegate(node); - }); - } - - Node* startIterating() const { return static_cast(MapImpl::startIterating()); } - Node* nextNode(Node* node) const { return static_cast(MapImpl::nextNode(node)); } -}; - -template -inline void TreeMapImpl::insert(Node* node) -{ - mRoot = insert(mRoot, node); - mRoot->setColor(Node::Color::Black); -} - -template -inline TreeMapNode* TreeMapImpl::insert(Node* root, Node* node) -{ - if (!root) - { - node->mLeft = node->mRight = nullptr; - node->setColor(Node::Color::Red); - return node; - } - - const s32 cmp = node->key().compare(root->key()); - - if (cmp < 0) - { - root->mLeft = insert(root->mLeft, node); - } - else if (cmp > 0) - { - root->mRight = insert(root->mRight, node); - } - else if (root != node) - { - node->mRight = root->mRight; - node->mLeft = root->mLeft; - node->mColorAndPtr = root->mColorAndPtr; - root->erase_(); - root = node; - } - - if (isRed(root->mRight) && !isRed(root->mLeft)) - root = rotateLeft(root); - - if (isRed(root->mLeft) && isRed(root->mLeft->mLeft)) - root = rotateRight(root); - - if (isRed(root->mLeft) && isRed(root->mRight)) - flipColors(root); - - return root; -} - -template -inline void TreeMapImpl::erase(const Key& key) -{ - mRoot = erase(mRoot, key); - if (mRoot) - mRoot->setColor(Node::Color::Black); -} - -template -inline TreeMapNode* TreeMapImpl::erase(Node* root, const Key& key) -{ - if (key.compare(root->key()) < 0) - { - if (!isRed(root->mLeft) && !isRed(root->mLeft->mLeft)) - root = moveRedLeft(root); - root->mLeft = erase(root->mLeft, key); - } - else - { - if (isRed(root->mLeft)) - root = rotateRight(root); - - if (key.compare(root->key()) == 0 && !root->mRight) - { - root->erase_(); - return nullptr; - } - - if (!isRed(root->mRight) && !isRed(root->mRight->mLeft)) - root = moveRedRight(root); - - if (key.compare(root->key()) == 0) - { - Node* const min_node = findMin(root->mRight); - - Node* target = root->mRight; - if (root->mRight) - target = find(root->mRight, min_node->key()); - - target->mRight = eraseMin(root->mRight); - target->mLeft = root->mLeft; - target->mColorAndPtr = root->mColorAndPtr; - root->erase_(); - root = target; - } - else - { - root->mRight = erase(root->mRight, key); - } - } - return fixUp(root); -} - -template -inline void TreeMapImpl::clear() -{ - mRoot = nullptr; -} - -template -inline TreeMapNode* TreeMapImpl::find(Node* root, const Key& key) const -{ - Node* node = root; - while (node) - { - const s32 cmp = key.compare(node->key()); - if (cmp < 0) - node = node->mLeft; - else if (cmp > 0) - node = node->mRight; - else - return node; - } - - return nullptr; -} - -template -template -inline void TreeMapImpl::forEach(Node* start, const Callable& callable) -{ - Node* i = start; - do - { - Node* node = i; - if (i->mLeft) - forEach(i->mLeft, callable); - i = i->mRight; - callable(node); - } while (i); -} - -template -inline TreeMapNode* TreeMapImpl::rotateLeft(Node* node) -{ - TreeMapNode* j = node->mRight; - node->mRight = j->mLeft; - j->mLeft = node; - j->mColorAndPtr = node->mColorAndPtr; - node->setColor(Node::Color::Red); - return j; -} - -template -inline TreeMapNode* TreeMapImpl::rotateRight(Node* node) -{ - TreeMapNode* j = node->mLeft; - node->mLeft = j->mRight; - j->mRight = node; - j->mColorAndPtr = node->mColorAndPtr; - node->setColor(Node::Color::Red); - return j; -} - -// NON_MATCHING: this version matches the LLRB tree implementation and is better optimized; -// there is a useless store to node->mRight in the original version -template -inline TreeMapNode* TreeMapImpl::moveRedLeft(Node* node) -{ - flipColors(node); - if (isRed(node->mRight->mLeft)) - { - node->mRight = rotateRight(node->mRight); - node = rotateLeft(node); - flipColors(node); - } - return node; -} - -template -inline TreeMapNode* TreeMapImpl::moveRedRight(Node* node) -{ - flipColors(node); - if (isRed(node->mLeft->mLeft)) - { - node = rotateRight(node); - flipColors(node); - } - return node; -} - -template -inline TreeMapNode* TreeMapImpl::findMin(Node* node) -{ - while (node->mLeft) - node = node->mLeft; - return node; -} - -// NON_MATCHING: this version matches the LLRB tree implementation and is better optimized -template -inline TreeMapNode* TreeMapImpl::eraseMin(Node* node) -{ - if (!node->mLeft) - return nullptr; - - if (!isRed(node->mLeft) && !isRed(node->mLeft->mLeft)) - node = moveRedLeft(node); - - node->mLeft = eraseMin(node->mLeft); -#ifdef MATCHING_HACK_NX_CLANG - asm(""); -#endif - return fixUp(node); -} - -template -inline TreeMapNode* TreeMapImpl::fixUp(Node* node) -{ - if (isRed(node->mRight)) - node = rotateLeft(node); - - if (isRed(node->mLeft) && isRed(node->mLeft->mLeft)) - node = rotateRight(node); - - if (isRed(node->mLeft) && isRed(node->mRight)) - flipColors(node); - - return node; -} - -template -inline void TreeMapImpl::flipColors(Node* node) -{ - node->flipColor(); - node->mLeft->flipColor(); - node->mRight->flipColor(); -} - -template -inline void TreeMap::Node::erase_() -{ - TreeMap* const map = mMap; - void* const this_ = this; - // Note: Nintendo does not call the destructor, which is dangerous... - map->mFreeList.free(this_); - --map->mSize; -} - -template -inline TreeMap::~TreeMap() -{ - void* work = mFreeList.work(); - if (!work) - return; - - clear(); - freeBuffer(); -} - -template -inline void TreeMap::allocBuffer(s32 node_max, Heap* heap, s32 alignment) -{ - SEAD_ASSERT(mFreeList.work() == nullptr); - if (node_max <= 0) - { - SEAD_ASSERT_MSG(false, "node_max[%d] must be larger than zero", node_max); - AllocFailAssert(heap, node_max * sizeof(Node), alignment); - } - - void* work = AllocBuffer(node_max * sizeof(Node), heap, alignment); - if (work) - setBuffer(node_max, work); -} - -template -inline void TreeMap::setBuffer(s32 node_max, void* buffer) -{ - mCapacity = node_max; - mFreeList.setWork(buffer, sizeof(Node), node_max); -} - -template -inline void TreeMap::freeBuffer() -{ - void* buffer = mFreeList.work(); - if (!buffer) - return; - - ::operator delete[](buffer); - mCapacity = 0; - mFreeList.reset(); -} - -template -inline Value* TreeMap::insert(const Key& key, const Value& value) -{ - if (mSize >= mCapacity) - { - if (Node* node = find(key)) - { - node->value() = value; - return &node->value(); - } - SEAD_ASSERT_MSG(false, "map is full."); - return nullptr; - } - - Node* node = new (mFreeList.alloc()) Node(this, key, value); - ++mSize; - MapImpl::insert(node); - return &node->value(); -} - -template -inline void TreeMap::clear() -{ - Delegate1, typename MapImpl::Node*> delegate(this, - &TreeMap::eraseNodeForClear_); - MapImpl::forEach(delegate); - mSize = 0; - MapImpl::clear(); -} - -template -inline typename TreeMap::Node* TreeMap::find(const Key& key) const -{ - return static_cast(MapImpl::find(key)); -} - -template -template -inline void TreeMap::forEach(const Callable& delegate) const -{ - MapImpl::forEach([&delegate](auto* base_node) { - auto* node = static_cast(base_node); - delegate(node->key(), node->value()); - }); -} - -template -inline void TreeMap::eraseNodeForClear_(typename MapImpl::Node* node) -{ - // Note: Nintendo does not call the destructor, which is dangerous... - mFreeList.free(node); -} -} // namespace sead diff --git a/src_remove/lib/sead/include/container/seadTreeNode.h b/src_remove/lib/sead/include/container/seadTreeNode.h deleted file mode 100644 index 1233dcf..0000000 --- a/src_remove/lib/sead/include/container/seadTreeNode.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef SEAD_TREENODE_H_ -#define SEAD_TREENODE_H_ - -#include - -namespace sead -{ -class TreeNode -{ -public: - TreeNode(); - - void clearLinks(); - s32 countChildren() const; - void detachAll(); - void detachSubTree(); - TreeNode* findRoot(); - const TreeNode* findRoot() const; - void insertAfterSelf(TreeNode* node); - void insertBeforeSelf(TreeNode* node); - void pushBackChild(TreeNode* node); - void pushBackSibling(TreeNode* node); - void pushFrontChild(TreeNode* node); - -protected: - void clearChildLinksRecursively_(); - - TreeNode* mParent; - TreeNode* mChild; - TreeNode* mNext; - TreeNode* mPrev; -}; - -template -class TTreeNode : public TreeNode -{ -public: - TTreeNode() = default; - explicit TTreeNode(T data) : mData(data) {} - - T& value() { return mData; } - const T& value() const { return mData; } - - TTreeNode* parent() const { return static_cast(mParent); } - TTreeNode* child() const { return static_cast(mChild); } - TTreeNode* next() const { return static_cast(mNext); } - TTreeNode* prev() const { return static_cast(mPrev); } - TTreeNode* findRoot() { return static_cast(TreeNode::findRoot()); } - const TTreeNode* findRoot() const { return static_cast(TreeNode::findRoot()); } - void insertAfterSelf(TTreeNode* node) { TreeNode::insertAfterSelf(node); } - void insertBeforeSelf(TTreeNode* node) { TreeNode::insertBeforeSelf(node); } - void pushBackChild(TTreeNode* node) { TreeNode::pushBackChild(node); } - void pushBackSibling(TTreeNode* node) { TreeNode::pushBackSibling(node); } - void pushFrontChild(TTreeNode* node) { TreeNode::pushFrontChild(node); } - - // TODO: probably iterators - -protected: - T mData; -}; - -} // namespace sead - -#endif // SEAD_TREENODE_H_ diff --git a/src_remove/lib/sead/include/controller/cafe/seadCafeDRCControllerCafe.h b/src_remove/lib/sead/include/controller/cafe/seadCafeDRCControllerCafe.h deleted file mode 100644 index 6a1261f..0000000 --- a/src_remove/lib/sead/include/controller/cafe/seadCafeDRCControllerCafe.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef SEAD_CAFE_DRC_CONTROLLER_CAFE_H_ -#define SEAD_CAFE_DRC_CONTROLLER_CAFE_H_ - -#include - -namespace sead { - -class CafeDRCController : public Controller -{ - SEAD_RTTI_OVERRIDE(CafeDRCController, Controller) - -public: - struct TouchPanelInfo - { - TouchPanelInfo() - : pointer(cInvalidPointer) - , flags(0) - { - } - - Vector2f pointer; - BitFlag32 flags; - }; - static_assert(sizeof(TouchPanelInfo) == 0xC, "sead::CafeDRCController::TouchPanelInfo size mismatch"); - -public: - CafeDRCController(ControllerMgr* mgr); - virtual ~CafeDRCController() { } - - virtual bool isConnected() const { return mIsConnected; } - - void setTouchPanelSamplingUseNum(u32 num); - -private: - virtual void calcImpl_(); - - static void updateTouchPanelInfo_(TouchPanelInfo* tp_info, bool tp_touch_on, f32 x, f32 y); - - bool mIsConnected; - u32 mTouchPanelSamplingUseNum; - u32 mTimeout; - u32 mCurrentTouchPanel; - TouchPanelInfo mTouchPanelInfos[3]; -}; -static_assert(sizeof(CafeDRCController) == 0x190, "sead::CafeDRCController size mismatch"); - -} // namespace sead - -#endif // SEAD_CAFE_DRC_CONTROLLER_CAFE_H_ diff --git a/src_remove/lib/sead/include/controller/cafe/seadCafeDRCPatternRumbleAddonCafe.h b/src_remove/lib/sead/include/controller/cafe/seadCafeDRCPatternRumbleAddonCafe.h deleted file mode 100644 index 9b70a11..0000000 --- a/src_remove/lib/sead/include/controller/cafe/seadCafeDRCPatternRumbleAddonCafe.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SEAD_CAFE_DRC_PATTERN_RUMBLE_ADDON_CAFE_H_ -#define SEAD_CAFE_DRC_PATTERN_RUMBLE_ADDON_CAFE_H_ - -#include -#include