Switch to subrepos

git subrepo clone https://github.com/open-ead/sead lib/sead

subrepo:
  subdir:   "lib/sead"
  merged:   "1b66e825d"
upstream:
  origin:   "https://github.com/open-ead/sead"
  branch:   "master"
  commit:   "1b66e825d"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK

subrepo:
  subdir:   "lib/NintendoSDK"
  merged:   "9ee21399f"
upstream:
  origin:   "https://github.com/open-ead/nnheaders"
  branch:   "master"
  commit:   "9ee21399f"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/agl lib/agl

subrepo:
  subdir:   "lib/agl"
  merged:   "7c063271b"
upstream:
  origin:   "https://github.com/open-ead/agl"
  branch:   "master"
  commit:   "7c063271b"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow

subrepo:
  subdir:   "lib/EventFlow"
  merged:   "c35d21b34"
upstream:
  origin:   "https://github.com/open-ead/EventFlow"
  branch:   "master"
  commit:   "c35d21b34"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
This commit is contained in:
Léo Lam
2022-03-21 19:25:20 +01:00
parent ffcc7f659e
commit 18c60323a9
457 changed files with 52182 additions and 16 deletions
+57
View File
@@ -0,0 +1,57 @@
/**
* @file account.h
* @brief Account service implementation.
*/
#pragma once
#include <nn/os.h>
#include <nn/types.h>
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
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include <nn/types.h>
namespace nn::aoc {
int ListAddOnContent(int*, int, int);
} // namespace nn::aoc
@@ -0,0 +1,37 @@
/**
* @file SoundArchivePlayer.h
* @brief Basic sound player from a sound archive.
*/
#pragma once
#include <nn/atk/detail/AdvancedWaveSoundRuntime.h>
#include <nn/atk/detail/SequenceSoundRuntime.h>
#include <nn/atk/detail/SoundArchiveManager.h>
#include <nn/atk/detail/StreamSoundRuntime.h>
#include <nn/atk/detail/WaveSoundRuntime.h>
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
@@ -0,0 +1,25 @@
/**
* @file SoundDataManager.h
* @brief Sound data management implementation.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,56 @@
/**
* @file SoundPlayer.h
* @brief Sound player.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,28 @@
/**
* @file AdvancedWaveSoundRuntime.h
* @brief Runtime wave sound api.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,137 @@
/**
* @file BasicSound.h
* @brief A basic sound.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,37 @@
/**
* @file SequenceSoundRuntime.h
* @brief Sequenced Sound Runtime Info
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,42 @@
/**
* @file SoundArchiveManager.h
* @brief Sound archive manager implementation.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,22 @@
/**
* @file StreamSoundRuntime.h
* @brief Stream sound runtime information.
*/
#pragma once
#include <nn/types.h>
namespace nn {
namespace atk {
namespace detail {
class StreamSoundRuntime {
public:
StreamSoundRuntime();
~StreamSoundRuntime();
u8 _0[0xB0];
};
}; // namespace detail
}; // namespace atk
}; // namespace nn
@@ -0,0 +1,29 @@
/**
* @file WaveSoundRuntime.h
* @brief Wave sound runtime info.
*/
#pragma once
#include <nn/types.h>
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
+344
View File
@@ -0,0 +1,344 @@
/**
* @file audio.h
* @brief Audio implementation.
*/
#pragma once
#include <nn/os.h>
#include <nn/types.h>
namespace nn {
namespace audio {
// Common audio
struct AudioDeviceName {
char raw_name[0x100];
};
static_assert(sizeof(AudioDeviceName) == 0x100);
void AcquireAudioDeviceSwitchNotification(nn::os::SystemEvent* event);
s32 ListAudioDeviceName(nn::audio::AudioDeviceName* buffer, s32 bufferCount);
Result SetAudioDeviceOutputVolume(nn::audio::AudioDeviceName const* device, float volume);
u32 GetActiveChannelCount();
struct AudioRendererConfig {
u64* _0;
u64* _8;
u64* _10;
u64* _18;
u64* _20;
u64* _28;
u64* _30;
u64* _38;
u64* _40;
u64* _48;
u64* _50;
};
enum AudioRendererRenderingDevice : u32 {
AudioRendererRenderingDevice_Cpu,
AudioRendererRenderingDevice_Dsp
};
enum AudioRendererExecutionMode : u32 {
AudioRendererExecutionMode_Manual,
AudioRendererExecutionMode_Auto,
};
enum SampleFormat : u32 {
SampleFormat_Invalid,
SampleFormat_PcmInt8,
SampleFormat_PcmInt16,
SampleFormat_PcmInt24,
SampleFormat_PcmInt32,
SampleFormat_PcmFloat,
SampleFormat_Adpcm,
};
enum MemoryPoolState : u32 {
MemoryPoolState_Invalid,
MemoryPoolState_New,
MemoryPoolState_RequestDetach,
MemoryPoolState_Detached,
MemoryPoolState_RequestAttach,
MemoryPoolState_Attached,
MemoryPoolState_Released,
};
struct AudioRendererParameter {
u32 sampleRate;
u32 sampleCount;
u32 mixBufferCount;
u32 subMixCount;
u32 voiceCount;
u32 sinkCount;
u32 effectCount;
u32 performanceFrameCount;
bool isVoiceDropEnabled;
u32 splitterCount;
u32 splitterSendChannelCount;
AudioRendererRenderingDevice renderingDevice;
AudioRendererExecutionMode executionMode;
u32 _34;
u32 revision;
};
static_assert(sizeof(AudioRendererParameter) == 0x3C);
struct BiquadFilterParameter {
bool enabled;
s16 numerator[3];
s16 denominator[2];
};
static_assert(sizeof(BiquadFilterParameter) == 0xC);
struct WaveBuffer {
void* buffer;
size_t bufferSize;
s32 startSampleOffset;
s32 endSampleOffset;
bool shouldLoop;
bool isEndOfStream;
void* context;
size_t contextSize;
};
static_assert(sizeof(WaveBuffer) == 0x30);
struct AudioRendererHandle {
u64* _0;
u64* _8;
};
struct MemoryPoolType {
u64* _0;
};
struct CircularBufferSinkType {
u64* _0;
};
struct AuxType {
u64* _0;
};
struct DelayType {
u64* _0;
};
struct FinalMixType {
u64* _0;
};
struct SubMixType {
u64* _0;
};
struct VoiceType {
u64* _0;
enum PlayState : u32 {
PlayState_Start,
PlayState_Stop,
PlayState_Pause,
};
};
struct DeviceSinkType {
u64* _0;
};
// Audio Renderer base APIs
void InitializeAudioRendererParameter(nn::audio::AudioRendererParameter* inParameter);
bool IsValidAudioRendererParameter(nn::audio::AudioRendererParameter const& inParameter);
size_t GetAudioRendererWorkBufferSize(nn::audio::AudioRendererParameter const& inParameter);
size_t GetAudioRendererConfigWorkBufferSize(nn::audio::AudioRendererParameter const& inParameter);
Result InitializeAudioRendererConfig(nn::audio::AudioRendererConfig* outConfig,
nn::audio::AudioRendererParameter const& inParameter,
void* buffer, size_t bufferSize);
Result OpenAudioRenderer(nn::audio::AudioRendererHandle* outHandle,
nn::audio::AudioRendererParameter const& inParameter, void* workBuffer,
size_t workBufferSize);
void CloseAudioRenderer(nn::audio::AudioRendererHandle handle);
Result StartAudioRenderer(nn::audio::AudioRendererHandle handle);
Result StopAudioRenderer(nn::audio::AudioRendererHandle handle);
Result RequestUpdateAudioRenderer(nn::audio::AudioRendererHandle handle,
nn::audio::AudioRendererConfig const* config);
// Audio Renderer MemoryPool APIs
bool IsMemoryPoolAttached(nn::audio::MemoryPoolType const* pool);
bool RequestAttachMemoryPool(nn::audio::MemoryPoolType* pool);
bool RequestDetachMemoryPool(nn::audio::MemoryPoolType* pool);
bool AcquireMemoryPool(nn::audio::AudioRendererConfig* config, nn::audio::MemoryPoolType* outPool,
void* address, size_t size);
void ReleaseMemoryPool(nn::audio::AudioRendererConfig* config, nn::audio::MemoryPoolType* pool);
void* GetMemoryPoolAddress(nn::audio::MemoryPoolType const* pool);
size_t GetMemoryPoolSize(nn::audio::MemoryPoolType const* pool);
MemoryPoolState GetMemoryPoolState(nn::audio::MemoryPoolType const* pool);
// Audio Renderer Effect APIs
void SetDelayInputOutput(nn::audio::DelayType* delay, s8 const* input, s8 const* output, s32 count);
void* RemoveDelay(nn::audio::AudioRendererConfig* config, nn::audio::DelayType* delay,
nn::audio::FinalMixType* mix);
void* RemoveDelay(nn::audio::AudioRendererConfig* config, nn::audio::DelayType* delay,
nn::audio::SubMixType* mix);
bool IsDelayRemovable(nn::audio::DelayType* delay);
size_t GetRequiredBufferSizeForAuxSendReturnBuffer(nn::audio::AudioRendererParameter const* config,
s32 mixBufferFrameCount, s32 channelCount);
Result AddAux(nn::audio::AudioRendererConfig* config, nn::audio::AuxType* aux,
nn::audio::FinalMixType* mix, void* sendBuffer, void* returnBuffer,
size_t bufferSize);
Result AddAux(nn::audio::AudioRendererConfig* config, nn::audio::AuxType* aux,
nn::audio::SubMixType* mix, void* sendBuffer, void* returnBuffer, size_t bufferSize);
void RemoveAux(nn::audio::AudioRendererConfig* config, nn::audio::AuxType* aux,
nn::audio::FinalMixType* mix);
void RemoveAux(nn::audio::AudioRendererConfig* config, nn::audio::AuxType* aux,
nn::audio::SubMixType* mix);
void SetAuxEnabled(nn::audio::AuxType* aux, bool enable);
void SetAuxInputOutput(nn::audio::AuxType* aux, s8 const* input, s8 const* output, s32 count);
bool IsAuxRemovable(nn::audio::AuxType* aux);
s32 GetAuxSampleCount(nn::audio::AuxType const* aux);
s32 GetAuxSampleRate(nn::audio::AuxType const* aux);
s32 ReadAuxSendBuffer(nn::audio::AuxType* aux, s32* buffer, s32 count);
s32 WriteAuxReturnBuffer(nn::audio::AuxType* aux, s32 const* buffer, s32 count);
// Audio Renderer Performance APIs
size_t
GetRequiredBufferSizeForPerformanceFrames(nn::audio::AudioRendererParameter const& inParameter);
void* SetPerformanceFrameBuffer(nn::audio::AudioRendererConfig* config, void* buffer,
size_t bufferSize);
enum PerformanceEntryType : u8 {
PerformanceEntryType_Invalid,
PerformanceEntryType_Voice,
PerformanceEntryType_SubMix,
PerformanceEntryType_FinalMix,
PerformanceEntryType_Sink
};
struct PerformanceEntry {
s32 nodeId;
s32 startTime;
s32 processingTime;
PerformanceEntryType entryType;
};
static_assert(sizeof(PerformanceEntry) == 0x10);
enum PerformanceDetailType : u8 {
PerformanceDetailType_Unknown,
PerformanceDetailType_PcmInt16,
PerformanceDetailType_Adpcm,
PerformanceDetailType_VolumeRamp,
PerformanceDetailType_BiquadFilter,
PerformanceDetailType_Mix,
PerformanceDetailType_Delay,
PerformanceDetailType_Aux,
PerformanceDetailType_Reverb,
PerformanceDetailType_Reverb3d,
PerformanceDetailType_PcmFloat
};
struct PerformanceDetail {
s32 nodeId;
s32 startTime;
s32 processingTime;
PerformanceDetailType detailType;
PerformanceEntryType entryType;
};
static_assert(sizeof(PerformanceDetail) == 0x10);
class PerformanceInfo {
public:
PerformanceInfo();
~PerformanceInfo();
bool SetBuffer(void const* buffer, size_t bufferSize);
bool MoveToNextFrame();
s32 GetTotalProcessingTime();
PerformanceEntry GetEntries(s32* count);
PerformanceDetail GetDetails(s32* count);
private:
void* buffer;
size_t bufferSize;
void* header;
PerformanceEntry* entries;
PerformanceDetail* details;
};
static_assert(sizeof(PerformanceInfo) == 0x28);
// Audio Renderer Sink APIs
Result AddDeviceSink(nn::audio::AudioRendererConfig* config, nn::audio::DeviceSinkType* sink,
nn::audio::FinalMixType* mix, s8 const* input, s32 inputCount,
char const* deviceName);
void RemoveDeviceSink(nn::audio::AudioRendererConfig* config, nn::audio::DeviceSinkType* sink,
nn::audio::FinalMixType* mix);
u32 GetSinkNodeId(nn::audio::DeviceSinkType const* sink);
Result AddCircularBufferSink(nn::audio::AudioRendererConfig* config,
nn::audio::CircularBufferSinkType* sink, nn::audio::FinalMixType* mix,
s8 const* input, s32 inputCount, void* buffer, size_t bufferSize,
nn::audio::SampleFormat sampleFormat);
void RemoveCircularBufferSink(nn::audio::AudioRendererConfig* config,
nn::audio::CircularBufferSinkType* sink,
nn::audio::FinalMixType* mix);
size_t ReadCircularBufferSink(nn::audio::CircularBufferSinkType* sink, void* buffer,
size_t buffer_size);
u32 GetSinkNodeId(nn::audio::CircularBufferSinkType const* sink);
size_t
GetRequiredBufferSizeForCircularBufferSink(nn::audio::AudioRendererParameter const* inParameter,
s32 inputCount, s32 frameCount,
nn::audio::SampleFormat sampleFormat);
// Audio Renderer Mix APIs
bool AcquireFinalMix(nn::audio::AudioRendererConfig* config, nn::audio::FinalMixType* mix,
s32 bufferCount);
bool AcquireSubMix(nn::audio::AudioRendererConfig* config, nn::audio::SubMixType* mix,
s32 sampleRate, s32 bufferCount);
void ReleaseSubMix(nn::audio::AudioRendererConfig* config, nn::audio::SubMixType* mix);
void SetSubMixDestination(nn::audio::AudioRendererConfig* config, nn::audio::SubMixType* source,
nn::audio::FinalMixType* destination);
void SetSubMixDestination(nn::audio::AudioRendererConfig* config, nn::audio::SubMixType* source,
nn::audio::SubMixType* destination);
void SetSubMixMixVolume(nn::audio::SubMixType* source, nn::audio::FinalMixType* destination,
float volume, s32 sourceIndex, s32 destinationIndex);
void SetSubMixMixVolume(nn::audio::SubMixType* source, nn::audio::SubMixType* destination,
float volume, s32 sourceIndex, s32 destinationIndex);
u32 GetSubMixNodeId(nn::audio::SubMixType const* mix);
// Audio Renderer Voice APIs
Result AcquireVoiceSlot(nn::audio::AudioRendererConfig* config, nn::audio::VoiceType* voice,
s32 sampleRate, s32 channelCount, nn::audio::SampleFormat sampleFormat,
s32 priority, void const* buffer, size_t bufferSize);
void ReleaseVoiceSlot(nn::audio::AudioRendererConfig* config, nn::audio::VoiceType* voice);
bool IsVoiceValid(nn::audio::VoiceType const* voice);
bool IsVoiceDroppedFlagOn(nn::audio::VoiceType const* voice);
void ResetVoiceDroppedFlag(nn::audio::VoiceType* voice);
void SetVoiceDestination(nn::audio::AudioRendererConfig* config, nn::audio::VoiceType* voice,
nn::audio::FinalMixType* mix);
void SetVoiceDestination(nn::audio::AudioRendererConfig* config, nn::audio::VoiceType* voice,
nn::audio::SubMixType* mix);
void SetVoiceVolume(nn::audio::VoiceType* config, float volume);
void SetVoicePitch(nn::audio::VoiceType* config, float pitch);
void SetVoicePlayState(nn::audio::VoiceType* voice, nn::audio::VoiceType::PlayState state);
void SetVoicePriority(nn::audio::VoiceType* voice, s32 priority);
void SetVoiceBiquadFilterParameter(nn::audio::VoiceType* voice, s32 index,
nn::audio::BiquadFilterParameter const& biquadFilterParameter);
void SetVoiceMixVolume(nn::audio::VoiceType* voice, nn::audio::FinalMixType* mix, float volume,
int sourceIndex, int destinationIndex);
void SetVoiceMixVolume(nn::audio::VoiceType* voice, nn::audio::SubMixType* mix, float volume,
int sourceIndex, int destinationIndex);
nn::audio::VoiceType::PlayState GetVoicePlayState(nn::audio::VoiceType const* voice);
s32 GetVoicePriority(nn::audio::VoiceType const* voice);
u64 GetVoicePlayedSampleCount(nn::audio::VoiceType const* voice);
u32 GetVoiceNodeId(nn::audio::VoiceType const* voice);
bool AppendWaveBuffer(nn::audio::VoiceType* voice, nn::audio::WaveBuffer const* waveBuffer);
nn::audio::WaveBuffer* GetReleasedWaveBuffer(nn::audio::VoiceType* voice);
}; // namespace audio
}; // namespace nn
+112
View File
@@ -0,0 +1,112 @@
/**
* @file bcat.h
* @brief BCAT service implementation.
*/
#pragma once
#include <nn/os.h>
#include <nn/types.h>
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
+86
View File
@@ -0,0 +1,86 @@
/**
* @file crypto.h
* @brief Crypto service implementation.
*/
#pragma once
#include <nn/types.h>
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
+33
View File
@@ -0,0 +1,33 @@
/**
* @file diag.h
* @brief Module, logging, and symbol operations.
*/
#pragma once
#include <nn/types.h>
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
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <nn/settings.h>
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
+42
View File
@@ -0,0 +1,42 @@
/**
* @file friends.h
* @brief Friend implementation.
*/
#pragma once
#include <nn/account.h>
#include <nn/os.h>
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
+132
View File
@@ -0,0 +1,132 @@
/**
* @file fs.h
* @brief Filesystem implementation.
*/
#pragma once
#include <nn/account.h>
#include <nn/types.h>
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
@@ -0,0 +1,31 @@
#pragma once
#include <nn/types.h>
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
+75
View File
@@ -0,0 +1,75 @@
/**
* @file ResFile.h
* @brief Resource file for models.
*/
#pragma once
#include <nn/gfx/api.h>
#include <nn/gfx/memory.h>
#include <nn/types.h>
#include <nn/util.h>
namespace nn {
namespace gfx {
template <typename T>
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::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*);
void
Setup(nn::gfx::TDevice<nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*,
nn::gfx::TMemoryPool<nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*,
s64, u64);
void
Cleanup(nn::gfx::TDevice<nn::gfx::ApiVariation<nn::gfx::ApiType<4>, 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
@@ -0,0 +1,21 @@
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,12 @@
#pragma once
#include <nn/types.h>
namespace nn {
namespace g3d {
class ResLightAnim {
public:
s32 Bind(nn::g3d::BindFuncTable const&);
};
}; // namespace g3d
}; // namespace nn
@@ -0,0 +1,29 @@
/**
* @file ResMaterial.h
* @brief Resource material for models.
*/
#pragma once
#include <nn/types.h>
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::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<4>>>*);
void
Cleanup(nn::gfx::TDevice<nn::gfx::ApiVariation<nn::gfx::ApiType<8>, nn::gfx::ApiVersion<8>>>*);
void Reset();
void Reset(u32);
u8 _0[0xB4];
};
}; // namespace g3d
}; // namespace nn
@@ -0,0 +1,19 @@
/**
* @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
+32
View File
@@ -0,0 +1,32 @@
/**
* @file ResModel.h
* @brief Resource model.
*/
#pragma once
#include <nn/types.h>
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::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*);
void
Cleanup(nn::gfx::TDevice<nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*);
void Reset();
void Reset(u32);
nn::g3d::ResMaterial* FindMaterial(char const* materialName) const;
u8 _0[0x70];
};
}; // namespace g3d
}; // namespace nn
@@ -0,0 +1,41 @@
/**
* @file ResSceneAnim.h
* @brief Resource file for scene animations.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,15 @@
/**
* @file ResShapeAnim.h
* @brief Resource file for shape animations.
*/
#pragma once
namespace nn {
namespace g3d {
class ResShapeAnim {
public:
void Reset();
};
}; // namespace g3d
}; // namespace nn
@@ -0,0 +1,15 @@
/**
* @file ResSkeletalAnim.h
* @brief Resource file for skeletal animations.
*/
#pragma once
namespace nn {
namespace g3d {
class ResSkeletalAnim {
public:
void Reset();
};
}; // namespace g3d
}; // namespace nn
+22
View File
@@ -0,0 +1,22 @@
/**
* @file api.h
* @brief GFX API version and typing.
*/
#pragma once
namespace nn {
namespace gfx {
// passes both ApiType<4> and ApiVersion<8>
template <typename T, typename T2>
class ApiVariation {};
// usually passed as just a 4
template <int T>
class ApiType {};
// usually passed as just a 8
template <int T>
class ApiVersion {};
}; // namespace gfx
}; // namespace nn
+28
View File
@@ -0,0 +1,28 @@
/**
* @file buffer.h
* @brief GFX Buffers.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,55 @@
/**
* @file bufferimpl.h
* @brief Buffer implementation for GFX.
*/
#pragma once
namespace nn {
namespace gfx {
class GpuAddress;
class BufferInfo;
namespace detail {
template <typename T>
class MemoryPoolImpl;
template <typename T>
class DeviceImpl;
template <typename T>
class BufferImpl {
public:
BufferImpl();
~BufferImpl();
void Initialize(nn::gfx::detail::DeviceImpl<
nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*,
nn::gfx::BufferInfo const&,
nn::gfx::detail::MemoryPoolImpl<
nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*,
s64, u64);
void Finalize(nn::gfx::detail::DeviceImpl<
nn::gfx::ApiVariation<nn::gfx::ApiType<4>, 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 <typename T>
class CommandBufferImpl {
public:
CommandBufferImpl();
~CommandBufferImpl();
void Reset();
void Begin();
void End();
void Dispatch(s32, s32, s32);
};
}; // namespace detail
}; // namespace gfx
}; // namespace nn
@@ -0,0 +1,24 @@
/**
* @file deviceimpl.h
* @brief Device implementation for GFX.
*/
#pragma once
namespace nn {
namespace gfx {
class DeviceInfo;
namespace detail {
template <typename T>
class DeviceImpl {
public:
DeviceImpl();
~DeviceImpl();
void Initialize(nn::gfx::DeviceInfo const& deviceInfo);
void Finalize();
};
}; // namespace detail
}; // namespace gfx
}; // namespace nn
@@ -0,0 +1,41 @@
#pragma once
#include <nn/types.h>
namespace nn {
namespace gfx {
struct MemoryPoolInfo;
template <typename T>
struct DeviceImpl;
namespace detail {
class MemoryPoolData {
public:
void SetDefault();
s32 _0; // set to 0x88
s32 _4;
u64 _8;
};
template <typename T>
class MemoryPoolImpl {
public:
MemoryPoolImpl();
~MemoryPoolImpl();
void Initialize(nn::gfx::detail::DeviceImpl<
nn::gfx::ApiVariation<nn::gfx::ApiType<4>, nn::gfx::ApiVersion<8>>>*,
nn::gfx::MemoryPoolInfo const&);
void Finalize(nn::gfx::detail::DeviceImpl<
nn::gfx::ApiVariation<nn::gfx::ApiType<4>, 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
+20
View File
@@ -0,0 +1,20 @@
/**
* @file device.h
* @brief Device implementation for GFX.
*/
#pragma once
#include <nn/types.h>
namespace nn {
namespace gfx {
class DeviceInfo {
public:
u64 mInfo; // _0
};
template <typename T>
class TDevice {};
}; // namespace gfx
}; // namespace nn
+14
View File
@@ -0,0 +1,14 @@
/**
* @file memory.h
* @brief GFX Memory Pool.
*/
#pragma once
namespace nn {
namespace gfx {
// todo: finish me!
template <typename T>
class TMemoryPool {};
}; // namespace gfx
}; // namespace nn
+43
View File
@@ -0,0 +1,43 @@
/**
* @file hid.h
* @brief Functions that help process gamepad inputs.
*/
#pragma once
#include <nn/types.h>
#include <nn/util.h>
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
+50
View File
@@ -0,0 +1,50 @@
/**
* @file image.h
* @brief JPEG decoding library.
*/
#pragma once
#include <nn/types.h>
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
+21
View File
@@ -0,0 +1,21 @@
/**
* @file init.h
* @brief Initialization functions for OS related functions.
*/
#pragma once
#include <nn/mem.h>
#include <nn/types.h>
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
+30
View File
@@ -0,0 +1,30 @@
/**
* @file mem.h
* @brief Memory allocation functions.
*/
#pragma once
#include <nn/os.h>
#include <nn/types.h>
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
@@ -0,0 +1,30 @@
/**
* @file RootObject.h
* @brief RootObject for NEX.
*/
#pragma once
#include <nn/types.h>
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
+20
View File
@@ -0,0 +1,20 @@
/**
* @file auth.h
* @brief Authorization for DDL.
*/
#pragma once
#include <nn/nex/ddl.h>
namespace nn {
namespace nex {
class NintendoAuthenticationDDLDeclarations : public nn::nex::DDLDeclarations {
public:
virtual ~NintendoAuthenticationDDLDeclarations();
virtual void Init();
void Register();
};
}; // namespace nex
}; // namespace nn
+25
View File
@@ -0,0 +1,25 @@
/**
* @file buffer.h
* @brief NEX buffer implementation.
*/
#pragma once
#include <nn/types.h>
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
+33
View File
@@ -0,0 +1,33 @@
/**
* @file cache.h
* @brief NEX Cache Mangement.
*/
#pragma once
#include <nn/types.h>
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
+61
View File
@@ -0,0 +1,61 @@
/**
* @file checksum.h
* @brief NEX Checksum Implementation.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+111
View File
@@ -0,0 +1,111 @@
/**
* @file client.h
* @brief Client implementations for NEX.
*/
#pragma once
#include <nn/nex/system.h>
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
+21
View File
@@ -0,0 +1,21 @@
/**
* @file data.h
* @brief NEX Data.
*/
#pragma once
#include <nn/nex/RootObject.h>
namespace nn {
namespace nex {
class Data : public nn::nex::RootObject {
public:
Data();
virtual ~Data();
u8 _8;
};
}; // namespace nex
}; // namespace nn
+40
View File
@@ -0,0 +1,40 @@
/**
* @file ddl.h
* @brief DDL Declaration Implementation.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+21
View File
@@ -0,0 +1,21 @@
/**
* @file dynamic.h
* @brief NEX Dyamnic Runtime.
*/
#pragma once
#include <nn/nex/RootObject.h>
namespace nn {
namespace nex {
class DynamicRunTimeInterface : public nn::nex::RootObject {
public:
DynamicRunTimeInterface();
virtual ~DynamicRunTimeInterface();
u64* GetInstance();
};
}; // namespace nex
}; // namespace nn
@@ -0,0 +1,61 @@
/**
* @file encryption.h
* @brief NEX Encryption Algorithm.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+35
View File
@@ -0,0 +1,35 @@
/**
* @file hash.h
* @brief NEX Hash Implementation.
*/
#pragma once
#include <nn/crypto.h>
#include <nn/nex/RootObject.h>
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
+46
View File
@@ -0,0 +1,46 @@
/**
* @file instance.h
* @brief NEX Instance Controllers.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+39
View File
@@ -0,0 +1,39 @@
/**
* @file key.h
* @brief NEX Key Implementation.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+33
View File
@@ -0,0 +1,33 @@
/**
* @file plugin.h
* @brief Plugin interface for NEX.
*/
#pragma once
#include <nn/nex/RootObject.h>
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
+80
View File
@@ -0,0 +1,80 @@
/**
* @file psuedo.h
* @brief Psuedo variable implementation for NEX.
*/
#pragma once
#include <nn/nex/RootObject.h>
#include <nn/nex/instance.h>
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 <typename T>
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
@@ -0,0 +1,18 @@
/**
* @file reference.h
* @brief Reference implementations for NEX.
*/
#pragma once
#include <nn/nex/RootObject.h>
namespace nn {
namespace nex {
class RefCountedObject : public nn::nex::RootObject {
public:
virtual ~RefCountedObject();
u32 _8;
};
}; // namespace nex
}; // namespace nn
+73
View File
@@ -0,0 +1,73 @@
#pragma once
#include <arpa/inet.h> //FIXME requires proper musl-setup
#include <sys/socket.h>
#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
+47
View File
@@ -0,0 +1,47 @@
/**
* @file string.h
* @brief NEX String Implementation.
*/
#pragma once
#include <nn/nex/RootObject.h>
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 <typename T>
void Assign(T const*);
};
}; // namespace nex
}; // namespace nn
+66
View File
@@ -0,0 +1,66 @@
/**
* @file system.h
* @brief System state / component interface for NEX.
*/
#pragma once
#include <nn/nex/reference.h>
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
+49
View File
@@ -0,0 +1,49 @@
/**
* @file time.h
* @brief NEX Time Library.
*/
#pragma once
#include <nn/types.h>
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
+21
View File
@@ -0,0 +1,21 @@
/**
* @file nifm.h
* @brief Network inferface module.
*/
#pragma once
#include <nn/types.h>
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
+33
View File
@@ -0,0 +1,33 @@
/**
* @file nn.h
* @brief Barebones NN functions, such as init and nnMain.
*/
#pragma once
#include <nn/types.h>
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
+37
View File
@@ -0,0 +1,37 @@
/**
* @file oe.h
* @brief Extenstions to OS functions.
*/
#pragma once
#include <nn/settings.h>
#include <nn/types.h>
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
+272
View File
@@ -0,0 +1,272 @@
/**
* @file os.h
* @brief Operating System implementations.
*/
#pragma once
#include <type_traits>
#include <nn/time.h>
#include <nn/types.h>
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
+62
View File
@@ -0,0 +1,62 @@
#pragma once
#include <nn/types.h>
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
+115
View File
@@ -0,0 +1,115 @@
/**
* @file ro.h
* @brief Dynamic module API.
*/
#pragma once
#include <nn/types.h>
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
+31
View File
@@ -0,0 +1,31 @@
#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
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <nn/svc.h>
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
+29
View File
@@ -0,0 +1,29 @@
/**
* @file socket.h
* @brief Functions for opening sockets for wireless communication.
*/
#pragma once
#include <nn/types.h>
#include <sys/socket.h>
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
+26
View File
@@ -0,0 +1,26 @@
/**
* @file ssl.h
* @brief SSL implementation.
*/
#pragma once
#include <nn/types.h>
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
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include <nn/types.h>
namespace nn::svc {
struct Handle {
u32 handle;
Handle(u32 h) { handle = h; }
Handle() : Handle(0) {}
operator u32() const { return handle; }
};
} // namespace nn::svc
+82
View File
@@ -0,0 +1,82 @@
/**
* @file time.h
* @brief Time implementation.
*/
#pragma once
#include <nn/types.h>
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
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <vapours/results.hpp>
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;
+49
View File
@@ -0,0 +1,49 @@
/**
* @file Layout.h
* @brief UI Layout implementation.
*/
#pragma once
#include <nn/types.h>
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
@@ -0,0 +1,29 @@
/**
* @file Material.h
* @brief UI Material implementation.
*/
#pragma once
#include <nn/types.h>
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
+75
View File
@@ -0,0 +1,75 @@
/**
* @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
+29
View File
@@ -0,0 +1,29 @@
/**
* @file Parts.h
* @brief Layout parts.
*/
#pragma once
#include <nn/ui2d/Pane.h>
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
@@ -0,0 +1,38 @@
/**
* @file TexCoordArray.h
* @brief Texture coordinate array implementation.
*/
#pragma once
#include <nn/types.h>
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
+60
View File
@@ -0,0 +1,60 @@
/**
* @file util.h
* @brief Helper functions for OS functionality.
*/
#pragma once
#include <nn/types.h>
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 <s32 size, typename T>
struct BitFlagSet {};
}; // namespace util
void ReferSymbol(void const*);
}; // namespace nn
+19
View File
@@ -0,0 +1,19 @@
/**
* @file Float2.h
* @brief Some odd float implementation that I don't understand yet...
*/
#pragma once
#include <nn/types.h>
namespace nn {
namespace util {
struct Float2 {
u64 _0;
u64 _8;
u64 _10;
u64 _18;
};
}; // namespace util
}; // namespace nn
+15
View File
@@ -0,0 +1,15 @@
/**
* @file Config.h
* @brief VFX configuration.
*/
#pragma once
namespace nn {
namespace vfx {
class Config {
public:
virtual ~Config();
};
}; // namespace vfx
}; // namespace nn
+17
View File
@@ -0,0 +1,17 @@
/**
* @file Heap.h
* @brief VFX heap implementation.
*/
#pragma once
#include <nn/types.h>
namespace nn {
namespace vfx {
class Heap {
public:
virtual ~Heap();
};
}; // namespace vfx
}; // namespace nn
+27
View File
@@ -0,0 +1,27 @@
/**
* @file System.h
* @brief VFX system implementation.
*/
#pragma once
#include <nn/types.h>
#include <nn/vfx/Config.h>
// 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
+40
View File
@@ -0,0 +1,40 @@
/**
* @file vi.h
* @brief Visual interface implementation.
*/
#pragma once
#include <nn/types.h>
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
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <cstddef>
namespace nv {
void SetGraphicsAllocator(void* (*allocator)(size_t, size_t, void*),
void (*deallocator)(void*, void*),
void* (*reallocator)(void*, size_t, void*), void* unk);
void SetGraphicsDevtoolsAllocator(void* (*allocator)(size_t, size_t, void*),
void (*deallocator)(void*, void*),
void* (*reallocator)(void*, size_t, void*), void* unk);
void InitializeGraphics(void* address, size_t size);
} // namespace nv
+6
View File
@@ -0,0 +1,6 @@
#pragma once
#include <nvn/nvn_api.h>
#include <nvn/nvn_types.h>
NVNdummyProc nvnBootstrapLoader(const char* name);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Utilities. */
#include <vapours/results/results_common.hpp>
/* Official. */
#include <vapours/results/cal_results.hpp>
#include <vapours/results/capsrv_results.hpp>
#include <vapours/results/creport_results.hpp>
#include <vapours/results/debug_results.hpp>
#include <vapours/results/dmnt_results.hpp>
#include <vapours/results/erpt_results.hpp>
#include <vapours/results/err_results.hpp>
#include <vapours/results/fatal_results.hpp>
#include <vapours/results/fs_results.hpp>
#include <vapours/results/hipc_results.hpp>
#include <vapours/results/i2c_results.hpp>
#include <vapours/results/kvdb_results.hpp>
#include <vapours/results/loader_results.hpp>
#include <vapours/results/lr_results.hpp>
#include <vapours/results/ncm_results.hpp>
#include <vapours/results/nim_results.hpp>
#include <vapours/results/ns_results.hpp>
#include <vapours/results/os_results.hpp>
#include <vapours/results/pgl_results.hpp>
#include <vapours/results/pm_results.hpp>
#include <vapours/results/psc_results.hpp>
#include <vapours/results/ro_results.hpp>
#include <vapours/results/settings_results.hpp>
#include <vapours/results/sf_results.hpp>
#include <vapours/results/sm_results.hpp>
#include <vapours/results/spl_results.hpp>
#include <vapours/results/svc_results.hpp>
#include <vapours/results/time_results.hpp>
#include <vapours/results/updater_results.hpp>
#include <vapours/results/vi_results.hpp>
/* Unofficial. */
#include <vapours/results/exosphere_results.hpp>
@@ -0,0 +1,26 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
namespace ams::cal {
R_DEFINE_NAMESPACE_RESULT_MODULE(198);
R_DEFINE_ERROR_RESULT(CalibrationDataCrcError, 101);
}
@@ -0,0 +1,92 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,37 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,28 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,50 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
}
@@ -0,0 +1,43 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,27 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
namespace ams::err {
R_DEFINE_NAMESPACE_RESULT_MODULE(162);
R_DEFINE_ERROR_RESULT(ApplicationAborted, 1);
R_DEFINE_ERROR_RESULT(SystemModuleAborted, 2);
}
@@ -0,0 +1,30 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,31 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,409 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,41 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}
@@ -0,0 +1,30 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours/results/results_common.hpp>
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);
}

Some files were not shown because too many files have changed in this diff Show More