nstool/lib/libctr/include/nn/ctr/prog_id.h

88 lines
2.8 KiB
C
Raw Normal View History

#pragma once
#include <fnd/types.h>
namespace nn
{
namespace ctr
{
namespace prog_id
{
static const uint64_t kDeviceGroupMask = 0xffff000000000000;
static const uint64_t kDeviceGroupShift = 48;
static const uint64_t kCategoryMask = 0x0000ffff00000000;
static const uint64_t kCategoryShift = 32;
static const uint64_t kUniqueIdMask = 0x00000000ffffff00;
static const uint64_t kUniqueIdShift = 8;
static const uint64_t kVariationMask = 0x00000000000000ff;
static const uint64_t kVariationShift = 0;
enum DeviceGroup
{
DEVICE_TWL = 0x0003,
DEVICE_CTR = 0x0004,
DEVICE_CAFE = 0x0005,
};
enum CategoryFlags
{
CATEGORY_FLAG_NORMAL = 0,
CATEGORY_FLAG_DLP_CHILD = _BIT(0),
CATEGORY_FLAG_DEMO = _BIT(1),
CATEGORY_FLAG_CONTENTS = _BIT(0) | _BIT(1),
CATEGORY_FLAG_ADD_ON_CONTENTS = _BIT(2),
CATEGORY_FLAG_PATCH = _BIT(1) | _BIT(2),
CATEGORY_FLAG_NOT_EXECUTABLE = _BIT(3),
CATEGORY_FLAG_SYSTEM = _BIT(4),
CATEGORY_FLAG_REQUIRE_BATCH_UPDATE = _BIT(5),
CATEGORY_FLAG_NOT_REQUIRE_USER_APPROVAL = _BIT(6),
CATEGORY_FLAG_NOT_REQUIRE_RIGHT_FOR_MOUNT = _BIT(7),
CATEGORY_FLAG_CAN_SKIP_CONVERT_JUMP_ID = _BIT(8),
CATEGORY_FLAG_TWL_LEGACY = _BIT(15),
};
enum CategoryType
{
CATEGORY_APPLICATION = (CATEGORY_FLAG_NORMAL),
CATEGORY_DLP_CHILD = (CATEGORY_FLAG_DLP_CHILD),
CATEGORY_DEMO = (CATEGORY_FLAG_DEMO),
CATEGORY_CONTENTS = (CATEGORY_FLAG_CONTENTS),
CATEGORY_PATCH = (CATEGORY_FLAG_PATCH |
CATEGORY_FLAG_NOT_EXECUTABLE),
CATEGORY_ADD_ON_CONTENTS = (CATEGORY_FLAG_ADD_ON_CONTENTS |
CATEGORY_FLAG_NOT_EXECUTABLE |
CATEGORY_FLAG_NOT_REQUIRE_RIGHT_FOR_MOUNT),
CATEGORY_FIRMWARE = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_NOT_EXECUTABLE |
CATEGORY_FLAG_REQUIRE_BATCH_UPDATE |
CATEGORY_FLAG_CAN_SKIP_CONVERT_JUMP_ID),
CATEGORY_MODULE = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_REQUIRE_BATCH_UPDATE |
CATEGORY_FLAG_CAN_SKIP_CONVERT_JUMP_ID),
CATEGORY_APPLET = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_REQUIRE_BATCH_UPDATE),
CATEGORY_SYSTEM_APPLICATION = (CATEGORY_FLAG_SYSTEM),
CATEGORY_SYSTEM_CONTENT = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_CONTENTS |
CATEGORY_FLAG_NOT_EXECUTABLE),
CATEGORY_SHARED_CONTENT = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_CONTENTS |
CATEGORY_FLAG_NOT_EXECUTABLE |
CATEGORY_FLAG_NOT_REQUIRE_RIGHT_FOR_MOUNT),
CATEGORY_AUTO_UPDATE_CONTENT = (CATEGORY_FLAG_SYSTEM |
CATEGORY_FLAG_CONTENTS |
CATEGORY_FLAG_NOT_EXECUTABLE |
CATEGORY_FLAG_NOT_REQUIRE_RIGHT_FOR_MOUNT |
CATEGORY_FLAG_NOT_REQUIRE_USER_APPROVAL),
};
enum DeviceMask
{
ID_MASK = _BIT(28) - 1,
ID_MASK_CTR = 0, // 3DS
ID_MASK_CAFE = _BIT(28), // WiiU
ID_MASK_SNAKE = _BIT(29) // n3DS
};
}
}
}