This commit is contained in:
¥IGA 2025-04-27 17:35:36 +01:00 committed by GitHub
commit 9a2319cc48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 297 additions and 297 deletions

View file

@ -84,7 +84,7 @@ if (MACOS_BUNDLE)
set(MACOSX_BUNDLE_BUNDLE_NAME "Cemu")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2024 Cemu Project")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2025 Cemu Project")
set(MACOSX_BUNDLE_CATEGORY "public.app-category.games")
set(MACOSX_MINIMUM_SYSTEM_VERSION "12.0")

View file

@ -158,7 +158,7 @@ void LoadMainExecutable()
}
currentUpdatedApplicationHash = generateHashFromRawRPXData(rpxData, rpxSize);
// determine if this file is an ELF
const uint8 elfHeaderMagic[9] = { 0x7F,0x45,0x4C,0x46,0x01,0x02,0x01,0x00,0x00 };
constexpr uint8 elfHeaderMagic[9] = { 0x7F,0x45,0x4C,0x46,0x01,0x02,0x01,0x00,0x00 };
if (rpxSize >= 10 && memcmp(rpxData, elfHeaderMagic, sizeof(elfHeaderMagic)) == 0)
{
// ELF

View file

@ -14,7 +14,7 @@ class GameProfile
friend class GameProfileWindow;
public:
static const uint32 kThreadQuantumDefault = 45000;
static constexpr uint32 kThreadQuantumDefault = 45000;
bool Load(uint64_t title_id);
void Save(uint64_t title_id);

View file

@ -223,7 +223,7 @@ void GraphicPack2::ParseCemuhookPatchesTxtInternal(MemStreamReader& patchesStrea
AddPatchGroup(currentGroup);
}
static inline uint32 INVALID_ORIGIN = 0xFFFFFFFF;
static constexpr inline uint32 INVALID_ORIGIN = 0xFFFFFFFF;
bool GraphicPack2::ParseCemuPatchesTxtInternal(MemStreamReader& patchesStream)
{

View file

@ -9,10 +9,10 @@
#include <limits>
#include <array>
const int ieee_double_e_bits = 11; // exponent bits
const int ieee_double_m_bits = 52; // mantissa bits
constexpr int ieee_double_e_bits = 11; // exponent bits
constexpr int ieee_double_m_bits = 52; // mantissa bits
const int espresso_frsqrte_i_bits = 5; // index bits (the highest bit is the LSB of the exponent)
constexpr int espresso_frsqrte_i_bits = 5; // index bits (the highest bit is the LSB of the exponent)
typedef struct
{
@ -89,8 +89,8 @@ ATTR_MS_ABI double frsqrte_espresso(double input)
return *(double*)&x;
}
const int espresso_fres_i_bits = 5; // index bits
const int espresso_fres_s_bits = 10; // step multiplier bits
constexpr int espresso_fres_i_bits = 5; // index bits
constexpr int espresso_fres_s_bits = 10; // step multiplier bits
typedef struct
{

View file

@ -34,7 +34,7 @@ static inline bool ppc_carry_3(uint32 a, uint32 b, uint32 c)
#define PPC_getBits(__value, __index, __bitCount) ((__value>>(31-__index))&((1<<__bitCount)-1))
const static float LD_SCALE[] = {
constexpr static float LD_SCALE[] = {
1.000000f, 0.500000f, 0.250000f, 0.125000f, 0.062500f, 0.031250f, 0.015625f,
0.007813f, 0.003906f, 0.001953f, 0.000977f, 0.000488f, 0.000244f, 0.000122f,
0.000061f, 0.000031f, 0.000015f, 0.000008f, 0.000004f, 0.000002f, 0.000001f,
@ -46,7 +46,7 @@ const static float LD_SCALE[] = {
8192.000000f, 4096.000000f, 2048.000000f, 1024.000000f, 512.000000f, 256.000000f, 128.000000f, 64.000000f, 32.000000f,
16.000000f, 8.000000f, 4.000000f, 2.000000f };
const static float ST_SCALE[] = {
constexpr static float ST_SCALE[] = {
1.000000f, 2.000000f, 4.000000f, 8.000000f,
16.000000f, 32.000000f, 64.000000f, 128.000000f,
256.000000f, 512.000000f, 1024.000000f, 2048.000000f,

View file

@ -306,7 +306,7 @@ RunAtCemuBoot _loadPipelineCompressionDictionary([]()
Latte::UnitTestPipelineSerialization();
});
const uint8 s_regDataDict[] = // 0x5AD2 Uncompressed: 0x1B800
constexpr uint8 s_regDataDict[] = // 0x5AD2 Uncompressed: 0x1B800
{
0x28, 0xB5, 0x2F, 0xFD, 0xA4, 0x00, 0xB8, 0x01, 0x00, 0x15, 0xD6, 0x02,
0xFA, 0x09, 0x2B, 0xA7, 0x4C, 0x10, 0x10, 0x4A, 0xE9, 0xB4, 0x06, 0xCA,

View file

@ -697,10 +697,10 @@ private:
static uint64 hashPage(uint8* mem)
{
static const uint64 k0 = 0x55F23EAD;
static const uint64 k1 = 0x185FDC6D;
static const uint64 k2 = 0xF7431F49;
static const uint64 k3 = 0xA4C7AE9D;
static constexpr uint64 k0 = 0x55F23EAD;
static constexpr uint64 k1 = 0x185FDC6D;
static constexpr uint64 k2 = 0xF7431F49;
static constexpr uint64 k3 = 0xA4C7AE9D;
cemu_assert_debug((CACHE_PAGE_SIZE % 32) == 0);
const uint64* ptr = (const uint64*)mem;

View file

@ -465,14 +465,14 @@ LatteCMDPtr LatteCP_itWaitRegMem(LatteCMDPtr cmd, uint32 nWords)
uint32* fencePtr = (uint32*)memory_getPointerFromPhysicalOffset(physAddr);
const uint32 GPU7_WAIT_MEM_OP_ALWAYS = 0;
const uint32 GPU7_WAIT_MEM_OP_LESS = 1;
const uint32 GPU7_WAIT_MEM_OP_LEQUAL = 2;
const uint32 GPU7_WAIT_MEM_OP_EQUAL = 3;
const uint32 GPU7_WAIT_MEM_OP_NOTEQUAL = 4;
const uint32 GPU7_WAIT_MEM_OP_GEQUAL = 5;
const uint32 GPU7_WAIT_MEM_OP_GREATER = 6;
const uint32 GPU7_WAIT_MEM_OP_NEVER = 7;
constexpr uint32 GPU7_WAIT_MEM_OP_ALWAYS = 0;
constexpr uint32 GPU7_WAIT_MEM_OP_LESS = 1;
constexpr uint32 GPU7_WAIT_MEM_OP_LEQUAL = 2;
constexpr uint32 GPU7_WAIT_MEM_OP_EQUAL = 3;
constexpr uint32 GPU7_WAIT_MEM_OP_NOTEQUAL = 4;
constexpr uint32 GPU7_WAIT_MEM_OP_GEQUAL = 5;
constexpr uint32 GPU7_WAIT_MEM_OP_GREATER = 6;
constexpr uint32 GPU7_WAIT_MEM_OP_NEVER = 7;
LatteCP_signalEnterWait();

View file

@ -64,9 +64,9 @@ struct OverlayList
: text(std::move(text)), width(width) {}
};
const auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
constexpr auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
const float kBackgroundAlpha = 0.65f;
constexpr float kBackgroundAlpha = 0.65f;
void LatteOverlay_renderOverlay(ImVec2& position, ImVec2& pivot, sint32 direction, float fontSize, bool pad)
{
auto& config = GetConfig();

View file

@ -395,7 +395,7 @@ bool LatteMRT::GetActiveDepthBufferMask(const LatteContextRegister& lcr)
return depthBufferMask;
}
const uint32 _colorBufferFormatBits[] =
constexpr uint32 _colorBufferFormatBits[] =
{
0, // 0
0x200, // 1

View file

@ -281,14 +281,14 @@ void LatteShaderCache_finish()
uint32 LatteShaderCache_getShaderCacheExtraVersion(uint64 titleId)
{
// encode the titleId in the version to prevent users from swapping caches between titles
const uint32 cacheFileVersion = 1;
constexpr uint32 cacheFileVersion = 1;
uint32 extraVersion = ((uint32)(titleId >> 32) + ((uint32)titleId) * 3) + cacheFileVersion + 0xe97af1ad;
return extraVersion;
}
uint32 LatteShaderCache_getPipelineCacheExtraVersion(uint64 titleId)
{
const uint32 cacheFileVersion = 1;
constexpr uint32 cacheFileVersion = 1;
uint32 extraVersion = ((uint32)(titleId >> 32) + ((uint32)titleId) * 3) + cacheFileVersion;
return extraVersion;
}
@ -296,7 +296,7 @@ uint32 LatteShaderCache_getPipelineCacheExtraVersion(uint64 titleId)
void LatteShaderCache_drawBackgroundImage(ImTextureID texture, int width, int height)
{
// clear framebuffers and clean up
const auto kPopupFlags =
constexpr auto kPopupFlags =
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoBringToFrontOnFocus;
@ -492,8 +492,8 @@ void LatteShaderCache_Load()
void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateFunc, bool isPipelines)
{
const auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_AlwaysAutoResize;
const auto textColor = 0xFF888888;
constexpr auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_AlwaysAutoResize;
constexpr auto textColor = 0xFF888888;
auto lastFrameUpdate = tick_cached();

View file

@ -311,7 +311,7 @@ namespace Latte
inline uint32 GetFormatBits(const Latte::E_HWSURFFMT hwFmt)
{
const uint8 sBitsTable[0x40] = {
constexpr uint8 sBitsTable[0x40] = {
0x00,0x08,0x08,0x00,0x00,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,
0x20,0x20,0x00,0x20,0x00,0x00,0x20,0x00,

View file

@ -34,7 +34,7 @@ namespace LatteAddrLib
BAD_SIZE_FIELD = 6,
};
const uint32 m_configFlags = (1 << 29);
constexpr uint32 m_configFlags = (1 << 29);
uint32 GetSliceComputingFlags()
{

View file

@ -3,16 +3,16 @@
namespace LatteAddrLib
{
static const uint32 m_banks = 4;
static const uint32 m_banksBitcount = 2;
static const uint32 m_pipes = 2;
static const uint32 m_pipesBitcount = 1;
static const uint32 m_pipeInterleaveBytes = 256;
static const uint32 m_pipeInterleaveBytesBitcount = 8;
static const uint32 m_rowSize = 2048;
static const uint32 m_swapSize = 256;
static const uint32 m_splitSize = 2048;
static const uint32 m_chipFamily = 2;
static constexpr uint32 m_banks = 4;
static constexpr uint32 m_banksBitcount = 2;
static constexpr uint32 m_pipes = 2;
static constexpr uint32 m_pipesBitcount = 1;
static constexpr uint32 m_pipeInterleaveBytes = 256;
static constexpr uint32 m_pipeInterleaveBytesBitcount = 8;
static constexpr uint32 m_rowSize = 2048;
static constexpr uint32 m_swapSize = 256;
static constexpr uint32 m_splitSize = 2048;
static constexpr uint32 m_chipFamily = 2;
union AddrSurfaceFlags
{

View file

@ -17,7 +17,7 @@ namespace LatteAddrLib
}
#endif
static const uint32 bankSwapOrder[] = { 0, 1, 3, 2 };
static constexpr uint32 bankSwapOrder[] = { 0, 1, 3, 2 };
uint32 _GetMicroTileType(bool isDepth)
{

View file

@ -51,7 +51,7 @@ struct LatteDecompilerShaderResourceMapping
std::fill(uniformBuffersBindingPoint, uniformBuffersBindingPoint + LATTE_NUM_MAX_UNIFORM_BUFFERS, -1);
std::fill(attributeMapping, attributeMapping + LATTE_NUM_MAX_ATTRIBUTE_LOCATIONS, -1);
}
static const sint8 UNUSED_BINDING = -1;
static constexpr sint8 UNUSED_BINDING = -1;
// most of this is for Vulkan
sint8 setIndex{};
// texture

View file

@ -36,7 +36,7 @@ namespace CemuGL
#include "config/ActiveSettings.h"
#include "config/LaunchSettings.h"
static const int TEXBUFFER_SIZE = 1024 * 1024 * 32; // 32MB
static constexpr int TEXBUFFER_SIZE = 1024 * 1024 * 32; // 32MB
struct
{
@ -56,7 +56,7 @@ struct
GLuint clearFBO;
}glRendererState;
static const GLenum glDepthFuncTable[] =
static constexpr GLenum glDepthFuncTable[] =
{
GL_NEVER,
GL_LESS,
@ -68,7 +68,7 @@ static const GLenum glDepthFuncTable[] =
GL_ALWAYS
};
static const GLenum glAlphaTestFunc[] =
static constexpr GLenum glAlphaTestFunc[] =
{
GL_NEVER,
GL_LESS,
@ -728,7 +728,7 @@ void OpenGLRenderer::renderstate_setAlwaysWriteDepth()
prevDepthFunc = Latte::LATTE_DB_DEPTH_CONTROL::E_ZFUNC::ALWAYS;
}
static const GLuint table_glBlendSrcDst[] =
static constexpr GLuint table_glBlendSrcDst[] =
{
/* 0x00 */ GL_ZERO,
/* 0x01 */ GL_ONE,
@ -776,7 +776,7 @@ static GLuint GetGLBlendFactor(Latte::LATTE_CB_BLENDN_CONTROL::E_BLENDFACTOR ble
return table_glBlendSrcDst[blendFactorU];
}
static const GLuint table_glBlendCombine[] =
static constexpr GLuint table_glBlendCombine[] =
{
GL_FUNC_ADD,
GL_FUNC_SUBTRACT,

View file

@ -126,7 +126,7 @@ VKRObjectTextureView* LatteTextureViewVk::CreateView(uint32 gpuSamplerSwizzle)
viewInfo.subresourceRange.layerCount = this->numSlice;
}
static const VkComponentSwizzle swizzle[] =
static constexpr VkComponentSwizzle swizzle[] =
{
VK_COMPONENT_SWIZZLE_R,
VK_COMPONENT_SWIZZLE_G,

View file

@ -28,7 +28,7 @@ private:
// each texture view holds one Vulkan image view per swizzle mask. Image views are only instantiated when requested via GetViewRGBA/GetSamplerView
// since a large majority of texture views will only have 1 or 2 instantiated image views, we use a small fixed-size cache
// and only allocate the larger map (m_fallbackCache) if necessary
inline static const uint32 CACHE_EMPTY_ENTRY = 0xFFFFFFFF;
inline static constexpr uint32 CACHE_EMPTY_ENTRY = 0xFFFFFFFF;
uint32 m_smallCacheSwizzle0 = { CACHE_EMPTY_ENTRY };
uint32 m_smallCacheSwizzle1 = { CACHE_EMPTY_ENTRY };

View file

@ -133,7 +133,7 @@ public:
if (m_threadsActive.exchange(true))
return;
// create thread pool
const uint32 threadCount = 2;
constexpr uint32 threadCount = 2;
for (uint32 i = 0; i < threadCount; ++i)
s_threads.emplace_back(&_ShaderVkThreadPool::CompilerThreadFunc, this);
}

View file

@ -253,7 +253,7 @@ static VkBlendOp GetVkBlendOp(Latte::LATTE_CB_BLENDN_CONTROL::E_COMBINEFUNC comb
static VkBlendFactor GetVkBlendFactor(Latte::LATTE_CB_BLENDN_CONTROL::E_BLENDFACTOR factor)
{
const VkBlendFactor factors[] =
constexpr VkBlendFactor factors[] =
{
/* 0x00 */ VK_BLEND_FACTOR_ZERO,
/* 0x01 */ VK_BLEND_FACTOR_ONE,
@ -774,7 +774,7 @@ void PipelineCompiler::InitDepthStencilState()
depthStencilState.depthTestEnable = depthEnable ? VK_TRUE : VK_FALSE;
depthStencilState.depthWriteEnable = depthWriteEnable ? VK_TRUE : VK_FALSE;
static const VkCompareOp vkDepthCompareTable[8] =
static constexpr VkCompareOp vkDepthCompareTable[8] =
{
VK_COMPARE_OP_NEVER,
VK_COMPARE_OP_LESS,
@ -811,7 +811,7 @@ void PipelineCompiler::InitDepthStencilState()
uint32 stencilWriteMaskBack = LatteGPUState.contextNew.DB_STENCILREFMASK_BF.get_STENCILWRITEMASK_B();
uint32 stencilRefBack = LatteGPUState.contextNew.DB_STENCILREFMASK_BF.get_STENCILREF_B();
static const VkStencilOp stencilOpTable[8] = {
static constexpr VkStencilOp stencilOpTable[8] = {
VK_STENCIL_OP_KEEP,
VK_STENCIL_OP_ZERO,
VK_STENCIL_OP_REPLACE,

View file

@ -1076,7 +1076,7 @@ void VulkanRenderer::HandleScreenshotRequest(LatteTextureView* texView, bool pad
SaveScreenshot(rgb_data, width, height, !padView);
}
static const float kQueuePriority = 1.0f;
static constexpr float kQueuePriority = 1.0f;
std::vector<VkDeviceQueueCreateInfo> VulkanRenderer::CreateQueueCreateInfos(const std::set<sint32>& uniqueQueueFamilies) const
{
@ -2007,7 +2007,7 @@ void VulkanRenderer::SubmitCommandBuffer(VkSemaphore signalSemaphore, VkSemaphor
// wait for previous command buffer semaphore
VkSemaphore prevSem = GetLastSubmittedCmdBufferSemaphore();
const VkPipelineStageFlags semWaitStageMask[2] = { VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT };
constexpr VkPipelineStageFlags semWaitStageMask[2] = { VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT };
VkSemaphore waitSemArray[2];
submitInfo.waitSemaphoreCount = 0;
if (m_numSubmittedCmdBuffers > 0)
@ -3519,7 +3519,7 @@ LatteTextureReadbackInfo* VulkanRenderer::texture_createReadback(LatteTextureVie
const uint32 linearImageSize = result->GetImageSize();
const uint32 uploadSize = (linearImageSize == 0) ? memRequirements.size : linearImageSize;
const uint32 uploadAlignment = 256; // todo - use Vk optimalBufferCopyOffsetAlignment
constexpr uint32 uploadAlignment = 256; // todo - use Vk optimalBufferCopyOffsetAlignment
m_textureReadbackBufferWriteIndex = (m_textureReadbackBufferWriteIndex + uploadAlignment - 1) & ~(uploadAlignment - 1);
if ((m_textureReadbackBufferWriteIndex + uploadSize + 256) > TEXTURE_READBACK_SIZE)

View file

@ -55,10 +55,10 @@ private:
namespace VulkanRendererConst
{
static const inline int SHADER_STAGE_INDEX_VERTEX = 0;
static const inline int SHADER_STAGE_INDEX_FRAGMENT = 1;
static const inline int SHADER_STAGE_INDEX_GEOMETRY = 2;
static const inline int SHADER_STAGE_INDEX_COUNT = 3;
static constexpr inline int SHADER_STAGE_INDEX_VERTEX = 0;
static constexpr inline int SHADER_STAGE_INDEX_FRAGMENT = 1;
static constexpr inline int SHADER_STAGE_INDEX_GEOMETRY = 2;
static constexpr inline int SHADER_STAGE_INDEX_COUNT = 3;
};
class PipelineInfo
@ -128,11 +128,11 @@ class VulkanRenderer : public Renderer
using VSync = SwapchainInfoVk::VSync;
static const inline int UNIFORMVAR_RINGBUFFER_SIZE = 1024 * 1024 * 16; // 16MB
static constexpr inline int UNIFORMVAR_RINGBUFFER_SIZE = 1024 * 1024 * 16; // 16MB
static const inline int TEXTURE_READBACK_SIZE = 32 * 1024 * 1024; // 32 MB
static constexpr inline int TEXTURE_READBACK_SIZE = 32 * 1024 * 1024; // 32 MB
static const inline int OCCLUSION_QUERY_POOL_SIZE = 1024;
static constexpr inline int OCCLUSION_QUERY_POOL_SIZE = 1024;
public:

View file

@ -802,7 +802,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
auto filterZ = samplerWords->WORD0.get_Z_FILTER();
// todo: z-filter for texture array samplers is customizable for GPU7 but OpenGL/Vulkan doesn't expose this functionality?
static const VkSamplerAddressMode s_vkClampTable[] = {
static constexpr VkSamplerAddressMode s_vkClampTable[] = {
VK_SAMPLER_ADDRESS_MODE_REPEAT, // WRAP
VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, // MIRROR
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // CLAMP_LAST_TEXEL
@ -841,7 +841,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
// depth compare
uint8 depthCompareMode = shader->textureUsesDepthCompare[relative_textureUnit] ? 1 : 0;
static const VkCompareOp s_vkCompareOps[]
static constexpr VkCompareOp s_vkCompareOps[]
{
VK_COMPARE_OP_NEVER,
VK_COMPARE_OP_LESS,

View file

@ -168,11 +168,11 @@ uint32 iosuAct_getAccountIdOfCurrentAccount()
// IOSU act API interface
static const auto ACTResult_Ok = 0;
static const auto ACTResult_InvalidValue = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_ACT, 0x12F00); // 0xC0712F00
static const auto ACTResult_OutOfRange = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_ACT, 0x12D80); // 0xC0712D80
static const auto ACTResult_AccountDoesNotExist = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_ACT, NN_ACT_RESULT_ACCOUNT_DOES_NOT_EXIST); // 0xA071F480
static const auto ACTResult_NotANetworkAccount = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_ACT, 0x1FE80); // 0xA071FE80
static constexpr auto ACTResult_Ok = 0;
static constexpr auto ACTResult_InvalidValue = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_ACT, 0x12F00); // 0xC0712F00
static constexpr auto ACTResult_OutOfRange = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_ACT, 0x12D80); // 0xC0712D80
static constexpr auto ACTResult_AccountDoesNotExist = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_ACT, NN_ACT_RESULT_ACCOUNT_DOES_NOT_EXIST); // 0xA071F480
static constexpr auto ACTResult_NotANetworkAccount = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_ACT, 0x1FE80); // 0xA071FE80
nnResult ServerActErrorCodeToNNResult(NAPI::ACT_ERROR_CODE ec)
{

View file

@ -77,25 +77,25 @@ namespace iosu
struct TaskSetting
{
static const uint32 kBossCode = 0x7C0;
static const uint32 kBossCodeLen = 0x20;
static constexpr uint32 kBossCode = 0x7C0;
static constexpr uint32 kBossCodeLen = 0x20;
static const uint32 kURL = 0x48;
static const uint32 kURLLen = 0x100;
static constexpr uint32 kURL = 0x48;
static constexpr uint32 kURLLen = 0x100;
static const uint32 kClientCert = 0x41;
static const uint32 kCACert = 0x188;
static constexpr uint32 kClientCert = 0x41;
static constexpr uint32 kCACert = 0x188;
static const uint32 kServiceToken = 0x590;
static const uint32 kServiceTokenLen = 0x200;
static constexpr uint32 kServiceToken = 0x590;
static constexpr uint32 kServiceTokenLen = 0x200;
static const uint32 kDirectorySizeLimit = 0x7F0;
static const uint32 kDirectoryName = 0x7C8;
static const uint32 kDirectoryNameLen = 0x8;
static constexpr uint32 kDirectorySizeLimit = 0x7F0;
static constexpr uint32 kDirectoryName = 0x7C8;
static constexpr uint32 kDirectoryNameLen = 0x8;
static const uint32 kFileName = 0x7D0;
static const uint32 kNbdlFileName = 0x7F8;
static const uint32 kFileNameLen = 0x20;
static constexpr uint32 kFileName = 0x7D0;
static constexpr uint32 kNbdlFileName = 0x7F8;
static constexpr uint32 kFileNameLen = 0x20;
std::array<uint8, 0x1000> settings;
uint32be taskType; // +0x1000
@ -419,7 +419,7 @@ namespace iosu
return true;
}
const uint64 kTimeStampConvertSeconds = 946684800ULL;
constexpr uint64 kTimeStampConvertSeconds = 946684800ULL;
BossStorageFadEntry* boss_storage_fad_find_entry(BossStorageFadFile& fad_file, uint32 data_id)
{
for (auto& entry : fad_file.entries)

View file

@ -466,7 +466,7 @@ struct
const int id;
const wchar_t name[256];
const wchar_t key[256];
} const g_certificates[] = {
} constexpr g_certificates[] = {
// NINTENDO CLIENT CERTS
{ 1, L"ccerts/WIIU_COMMON_1_CERT.der", L"ccerts/WIIU_COMMON_1_RSA_KEY.aes" },
{ 3, L"ccerts/WIIU_ACCOUNT_1_CERT.der", L"ccerts/WIIU_ACCOUNT_1_RSA_KEY.aes" },

View file

@ -331,10 +331,10 @@ namespace iosu
};
static_assert(sizeof(SelfPlayingGame) == 0x10);
static const auto FPResult_Ok = 0;
static const auto FPResult_InvalidIPCParam = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_FP, 0x680);
static const auto FPResult_RequestFailed = BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_FP, 0); // figure out proper error code
static const auto FPResult_Aborted = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_FP, 0x3480);
static constexpr auto FPResult_Ok = 0;
static constexpr auto FPResult_InvalidIPCParam = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_FP, 0x680);
static constexpr auto FPResult_RequestFailed = BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_FP, 0); // figure out proper error code
static constexpr auto FPResult_Aborted = BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_FP, 0x3480);
class FPDService : public iosu::nn::IPCSimpleService
{

View file

@ -206,13 +206,13 @@ namespace iosu
};
static_assert(sizeof(FPDPreference) == 4);
static const int RELATIONSHIP_INVALID = 0;
static const int RELATIONSHIP_FRIENDREQUEST_OUT = 1;
static const int RELATIONSHIP_FRIENDREQUEST_IN = 2;
static const int RELATIONSHIP_FRIEND = 3;
static constexpr int RELATIONSHIP_INVALID = 0;
static constexpr int RELATIONSHIP_FRIENDREQUEST_OUT = 1;
static constexpr int RELATIONSHIP_FRIENDREQUEST_IN = 2;
static constexpr int RELATIONSHIP_FRIEND = 3;
static const int GAMEMODE_MAX_MESSAGE_LENGTH = 0x80; // limit includes null-terminator character, so only 0x7F actual characters can be used
static const int MY_COMMENT_LENGTH = 0x12;
static constexpr int GAMEMODE_MAX_MESSAGE_LENGTH = 0x80; // limit includes null-terminator character, so only 0x7F actual characters can be used
static constexpr int MY_COMMENT_LENGTH = 0x12;
enum class FPD_REQUEST_ID
{

View file

@ -1435,7 +1435,7 @@ void RPLLoader_BeginCemuhookCRC(RPLModule* rpl)
}
// init patches CRC
rpl->patchCRC = 0;
static const uint8 rplMagic[4] = { 0x7F, 'R', 'P', 'X' };
static constexpr uint8 rplMagic[4] = { 0x7F, 'R', 'P', 'X' };
rpl->patchCRC = crc32_calc(rpl->patchCRC, rplMagic, sizeof(rplMagic));
sint32 sectionCount = rpl->rplHeader.sectionTableEntryCount;
rpl->patchCRC = crc32_calc(rpl->patchCRC, &sectionCount, sizeof(sectionCount));

View file

@ -1,6 +1,6 @@
// font 'More Perfect DOS VGA' 20pts
const uint8 osscreenBitmapFont[] =
constexpr uint8 osscreenBitmapFont[] =
{
// @0 '!' (14 pixels wide)
0x00, 0x00, //

View file

@ -69,7 +69,7 @@ namespace coreinit
}
inline const uint64 DAY_BIAS_2000 = 0xB2575;
inline constexpr uint64 DAY_BIAS_2000 = 0xB2575;
uint64 OSCalendarTimeToTicks(OSCalendarTime_t *calendar)
{

View file

@ -25,7 +25,7 @@ namespace erreula
TextTwoButton = 3
};
static const sint32 FADE_TIME = 80;
static constexpr sint32 FADE_TIME = 80;
enum class ErrEulaState : uint32
{
@ -375,7 +375,7 @@ namespace erreula
if (!font)
return;
const auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
constexpr auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
auto& io = ImGui::GetIO();
ImVec2 position = { io.DisplaySize.x / 2.0f, io.DisplaySize.y / 2.0f };

View file

@ -370,10 +370,10 @@ namespace H264
H264DEC_STATUS H264DECSetParam(H264Context* ctx, uint32 paramId, void* paramValue)
{
const uint32 PARAMID_FPTR_OUTPUT = 0x1;
const uint32 PARAMID_OUTPUT_PER_FRAME = 0x20000002;
const uint32 PARAMID_USER_MEMORY = 0x70000001;
const uint32 PARAMID_UKN = 0x20000030;
constexpr uint32 PARAMID_FPTR_OUTPUT = 0x1;
constexpr uint32 PARAMID_OUTPUT_PER_FRAME = 0x20000002;
constexpr uint32 PARAMID_USER_MEMORY = 0x70000001;
constexpr uint32 PARAMID_UKN = 0x20000030;
if (paramId == PARAMID_FPTR_OUTPUT)
{

View file

@ -961,7 +961,7 @@ sint32 h264GetUnitLength(h264ParserState_t* h264ParserState, uint8* data, uint32
return -1;
}
static const unsigned char h264_default_4x4_Intra[16] =
static constexpr unsigned char h264_default_4x4_Intra[16] =
{
6, 13, 13, 20,
20, 20, 28, 28,
@ -969,7 +969,7 @@ static const unsigned char h264_default_4x4_Intra[16] =
32, 37, 37, 42
};
static const unsigned char h264_default_4x4_Inter[16] =
static constexpr unsigned char h264_default_4x4_Inter[16] =
{
10, 14, 14, 20,
20, 20, 24, 24,
@ -977,7 +977,7 @@ static const unsigned char h264_default_4x4_Inter[16] =
27, 30, 30, 34
};
static const unsigned char h264_default_8x8_Intra[64] =
static constexpr unsigned char h264_default_8x8_Intra[64] =
{
6, 10, 10, 13, 11, 13, 16, 16,
16, 16, 18, 18, 18, 18, 18, 23,
@ -989,7 +989,7 @@ static const unsigned char h264_default_8x8_Intra[64] =
36, 36, 38, 38, 38, 40, 40, 42
};
static const unsigned char h264_default_8x8_Inter[64] =
static constexpr unsigned char h264_default_8x8_Inter[64] =
{
9, 13, 13, 15, 13, 15, 17, 17,
17, 17, 19, 19, 19, 19, 19, 21,

View file

@ -15,7 +15,7 @@ enum class MIC_RESULT
#define MIC_SAMPLERATE 32000
const int MIC_SAMPLES_PER_3MS_32KHZ = (96); // 32000*3/1000
constexpr int MIC_SAMPLES_PER_3MS_32KHZ = (96); // 32000*3/1000
enum class MIC_STATUS_FLAGS : uint32
{
@ -436,7 +436,7 @@ void mic_updateOnAXFrame()
}
else
{
const sint32 micSampleCount = 32000 / 32;
constexpr sint32 micSampleCount = 32000 / 32;
sint16 micSampleData[micSampleCount];
auto controller = InputManager::instance().get_vpad_controller(drcIndex);

View file

@ -99,7 +99,7 @@ void nnAcExport_GetAssignedAddress(PPCInterpreter_t* hCPU)
*ipAddrOut = localIp;
const uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
constexpr uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
osLib_returnFromFunction(hCPU, nnResultCode);
}
@ -115,7 +115,7 @@ void nnAcExport_GetAssignedSubnet(PPCInterpreter_t* hCPU)
*subnetMaskOut = subnetMask;
const uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
constexpr uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
osLib_returnFromFunction(hCPU, nnResultCode);
}
@ -128,7 +128,7 @@ void nnAcExport_ACGetAssignedAddress(PPCInterpreter_t* hCPU)
_GetLocalIPAndSubnetMask(localIp, subnetMask);
*ipAddrOut = localIp;
const uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
constexpr uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
osLib_returnFromFunction(hCPU, nnResultCode);
}
@ -205,7 +205,7 @@ namespace nn_ac
nnResult GetConnectResult(uint32be* connectResult)
{
const uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
constexpr uint32 nnResultCode = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_AC, 0);
if (connectResult)
*connectResult = nnResultCode;
return nnResultCode;

View file

@ -29,7 +29,7 @@ namespace act
return (simpleAddressId>>24)&0xFF;
}
const uint8 ACT_SLOT_CURRENT = 0xFE;
constexpr uint8 ACT_SLOT_CURRENT = 0xFE;
}
}

View file

@ -266,25 +266,25 @@ bossBufferVector->buffer = (uint8*)bossRequest;
struct TaskSetting
{
static const uint32 kBossCode = 0x7C0;
static const uint32 kBossCodeLen = 0x20;
static constexpr uint32 kBossCode = 0x7C0;
static constexpr uint32 kBossCodeLen = 0x20;
static const uint32 kDirectorySizeLimit = 0x7F0;
static const uint32 kDirectoryName = 0x7E0;
static const uint32 kDirectoryNameLen = 0x8;
static constexpr uint32 kDirectorySizeLimit = 0x7F0;
static constexpr uint32 kDirectoryName = 0x7E0;
static constexpr uint32 kDirectoryNameLen = 0x8;
//static const uint32 kFileName = 0x7F8;
static const uint32 kNbdlFileName = 0x7F8;
static const uint32 kFileNameLen = 0x20;
static constexpr uint32 kNbdlFileName = 0x7F8;
static constexpr uint32 kFileNameLen = 0x20;
static const uint32 kURL = 0x48;
static const uint32 kURLLen = 0x100;
static constexpr uint32 kURL = 0x48;
static constexpr uint32 kURLLen = 0x100;
static const uint32 kClientCert = 0x41;
static const uint32 kCACert = 0x188;
static constexpr uint32 kClientCert = 0x41;
static constexpr uint32 kCACert = 0x188;
static const uint32 kServiceToken = 0x590;
static const uint32 kServiceTokenLen = 0x200;
static constexpr uint32 kServiceToken = 0x590;
static constexpr uint32 kServiceTokenLen = 0x200;
uint8 settings[0x1000];
MEMPTR<void> vTablePtr; // +0x1000

View file

@ -13,10 +13,10 @@ namespace nn
{
namespace fp
{
static const auto FPResult_OkZero = 0;
static const auto FPResult_Ok = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_FP, 0);
static const auto FPResult_InvalidIPCParam = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_FP, 0x680);
static const auto FPResult_RequestFailed = BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_FP, 0); // figure out proper error code
static constexpr auto FPResult_OkZero = 0;
static constexpr auto FPResult_Ok = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_FP, 0);
static constexpr auto FPResult_InvalidIPCParam = BUILD_NN_RESULT(NN_RESULT_LEVEL_LVL6, NN_RESULT_MODULE_NN_FP, 0x680);
static constexpr auto FPResult_RequestFailed = BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_FP, 0); // figure out proper error code
struct
{

View file

@ -13,11 +13,11 @@ namespace nn
class DownloadedCommunityData
{
public:
static const inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static const inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static const inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static const inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
static const inline uint32 FLAG_HAS_MII_DATA = (1 << 4);
static constexpr inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static constexpr inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static constexpr inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static constexpr inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
static constexpr inline uint32 FLAG_HAS_MII_DATA = (1 << 4);
DownloadedCommunityData()
{
@ -276,11 +276,11 @@ namespace nn
class DownloadCommunityDataListParam
{
public:
static const inline uint32 FLAG_FILTER_FAVORITES = (1 << 0);
static const inline uint32 FLAG_FILTER_OFFICIALS = (1 << 1);
static const inline uint32 FLAG_FILTER_OWNED = (1 << 2);
static const inline uint32 FLAG_QUERY_MII_DATA = (1 << 3);
static const inline uint32 FLAG_QUERY_ICON_DATA = (1 << 4);
static constexpr inline uint32 FLAG_FILTER_FAVORITES = (1 << 0);
static constexpr inline uint32 FLAG_FILTER_OFFICIALS = (1 << 1);
static constexpr inline uint32 FLAG_FILTER_OWNED = (1 << 2);
static constexpr inline uint32 FLAG_QUERY_MII_DATA = (1 << 3);
static constexpr inline uint32 FLAG_QUERY_ICON_DATA = (1 << 4);
DownloadCommunityDataListParam()
{

View file

@ -15,7 +15,7 @@ namespace nn
class InitializeParam
{
public:
static const inline uint32 FLAG_OFFLINE_MODE = (1 << 0);
static constexpr inline uint32 FLAG_OFFLINE_MODE = (1 << 0);
InitializeParam()
{

View file

@ -65,7 +65,7 @@ namespace nn
void TryLoadCompressedMemoImage(DownloadedPostData& downloadedPostData)
{
const unsigned char tgaHeader_320x120_32BPP[] = {0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x1,0x78,0x0,0x20,0x8};
constexpr unsigned char tgaHeader_320x120_32BPP[] = {0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x1,0x78,0x0,0x20,0x8};
std::string memoImageFilename = fmt::format("memo/{}", (char*)downloadedPostData.downloadedDataBase.postId);
std::vector<uint8> bitmaskCompressedImg;
if (!LoadOfflineDBFile(memoImageFilename.c_str(), bitmaskCompressedImg))

View file

@ -12,10 +12,10 @@ namespace nn
class UploadedCommunityData
{
public:
static const inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static const inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static const inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static const inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
static constexpr inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static constexpr inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static constexpr inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static constexpr inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
UploadedCommunityData()
{
@ -243,7 +243,7 @@ namespace nn
class UploadCommunityDataParam
{
public:
static const inline uint32 FLAG_DELETION = (1 << 0);
static constexpr inline uint32 FLAG_DELETION = (1 << 0);
UploadCommunityDataParam()
{

View file

@ -12,10 +12,10 @@ namespace nn
class UploadedFavoriteToCommunityData
{
public:
static const inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static const inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static const inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static const inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
static constexpr inline uint32 FLAG_HAS_TITLE_TEXT = (1 << 0);
static constexpr inline uint32 FLAG_HAS_DESC_TEXT = (1 << 1);
static constexpr inline uint32 FLAG_HAS_APP_DATA = (1 << 2);
static constexpr inline uint32 FLAG_HAS_ICON_DATA = (1 << 3);
UploadedFavoriteToCommunityData()
{
@ -243,7 +243,7 @@ namespace nn
{
public:
static const inline uint32 FLAG_DELETION = (1 << 0);
static constexpr inline uint32 FLAG_DELETION = (1 << 0);
UploadFavoriteToCommunityDataParam()
{

View file

@ -501,7 +501,7 @@ namespace nsyshid::backend::libusb
ClaimAllInterfaces(i);
}
const unsigned int timeout = 50;
constexpr unsigned int timeout = 50;
int actualLength = 0;
int ret = 0;
do

View file

@ -498,7 +498,7 @@ namespace nsyshid
uint16 SkylanderUSB::SkylanderCRC16(uint16 initValue, const uint8* buffer, uint32 size)
{
const unsigned short CRC_CCITT_TABLE[256] = {0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273,
constexpr unsigned short CRC_CCITT_TABLE[256] = {0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273,
0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, 0x8528,
0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, 0x48C4, 0x58E5, 0x6886,
0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, 0xDBFD, 0xCBDC, 0xFBBF,

View file

@ -73,7 +73,7 @@ namespace nsyshid
return _lastGeneratedHidHandle;
}
const int HID_MAX_NUM_DEVICES = 128;
constexpr int HID_MAX_NUM_DEVICES = 128;
SysAllocator<HID_t, HID_MAX_NUM_DEVICES> HIDPool;
std::queue<size_t> HIDPoolIndexQueue;
@ -119,8 +119,8 @@ namespace nsyshid
HIDPoolIndexQueue.push(index);
}
const int HID_CALLBACK_DETACH = 0;
const int HID_CALLBACK_ATTACH = 1;
constexpr int HID_CALLBACK_DETACH = 0;
constexpr int HID_CALLBACK_ATTACH = 1;
uint32 DoAttachCallback(HIDClient_t* hidClient, const std::shared_ptr<Device>& device)
{

View file

@ -8,23 +8,23 @@ struct PPCInterpreter_t;
namespace snd_core
{
// sndcore2 - AX init param config
const int AX_RENDERER_FREQ_32KHZ = 0;
const int AX_RENDERER_FREQ_48KHZ = 1;
const int AX_FRAMELENGTH_3MS = 0;
constexpr int AX_RENDERER_FREQ_32KHZ = 0;
constexpr int AX_RENDERER_FREQ_48KHZ = 1;
constexpr int AX_FRAMELENGTH_3MS = 0;
const int AX_SAMPLES_PER_3MS_48KHZ = (144); // 48000*3/1000
const int AX_SAMPLES_PER_3MS_32KHZ = (96); // 32000*3/1000
const int AX_SAMPLES_MAX = AX_SAMPLES_PER_3MS_48KHZ; // the maximum amount of samples in a single frame
constexpr int AX_SAMPLES_PER_3MS_48KHZ = (144); // 48000*3/1000
constexpr int AX_SAMPLES_PER_3MS_32KHZ = (96); // 32000*3/1000
constexpr int AX_SAMPLES_MAX = AX_SAMPLES_PER_3MS_48KHZ; // the maximum amount of samples in a single frame
const int AX_DEV_TV = 0;
const int AX_DEV_DRC = 1;
const int AX_DEV_RMT = 2;
const int AX_DEV_COUNT = 3;
constexpr int AX_DEV_TV = 0;
constexpr int AX_DEV_DRC = 1;
constexpr int AX_DEV_RMT = 2;
constexpr int AX_DEV_COUNT = 3;
const int AX_UPSAMPLE_STAGE_BEFORE_FINALMIX = 0;
const int AX_UPSAMPLE_STAGE_AFTER_FINALMIX = 1;
constexpr int AX_UPSAMPLE_STAGE_BEFORE_FINALMIX = 0;
constexpr int AX_UPSAMPLE_STAGE_AFTER_FINALMIX = 1;
const int AX_PIPELINE_SINGLE = 0;
constexpr int AX_PIPELINE_SINGLE = 0;
struct AXINITPARAM
{
@ -34,48 +34,48 @@ namespace snd_core
};
// maximum number of supported channels per device
const int AX_TV_CHANNEL_COUNT = 6;
const int AX_DRC_CHANNEL_COUNT = 4;
const int AX_RMT_CHANNEL_COUNT = 1;
constexpr int AX_TV_CHANNEL_COUNT = 6;
constexpr int AX_DRC_CHANNEL_COUNT = 4;
constexpr int AX_RMT_CHANNEL_COUNT = 1;
const int AX_APP_FRAME_CALLBACK_MAX = 64;
constexpr int AX_APP_FRAME_CALLBACK_MAX = 64;
const int AX_MODE_STEREO = 0;
const int AX_MODE_SURROUND = 1;
const int AX_MODE_DPL2 = 2;
const int AX_MODE_6CH = 3;
const int AX_MODE_MONO = 5;
constexpr int AX_MODE_STEREO = 0;
constexpr int AX_MODE_SURROUND = 1;
constexpr int AX_MODE_DPL2 = 2;
constexpr int AX_MODE_6CH = 3;
constexpr int AX_MODE_MONO = 5;
const int AX_PRIORITY_MAX = 32;
const int AX_PRIORITY_FREE = 0;
const int AX_PRIORITY_NODROP = 31;
const int AX_PRIORITY_LOWEST = 1;
const int AX_MAX_VOICES = 96;
constexpr int AX_PRIORITY_MAX = 32;
constexpr int AX_PRIORITY_FREE = 0;
constexpr int AX_PRIORITY_NODROP = 31;
constexpr int AX_PRIORITY_LOWEST = 1;
constexpr int AX_MAX_VOICES = 96;
const int AX_AUX_BUS_COUNT = 3;
const int AX_MAX_NUM_BUS = 4;
constexpr int AX_AUX_BUS_COUNT = 3;
constexpr int AX_MAX_NUM_BUS = 4;
const int AX_FORMAT_ADPCM = 0x0;
const int AX_FORMAT_PCM16 = 0xA;
const int AX_FORMAT_PCM8 = 0x19;
constexpr int AX_FORMAT_ADPCM = 0x0;
constexpr int AX_FORMAT_PCM16 = 0xA;
constexpr int AX_FORMAT_PCM8 = 0x19;
const int AX_LPF_OFF = 0x0;
constexpr int AX_LPF_OFF = 0x0;
const int AX_BIQUAD_OFF = 0x0;
constexpr int AX_BIQUAD_OFF = 0x0;
const int AX_SRC_TYPE_NONE = 0x0;
const int AX_SRC_TYPE_LINEAR = 0x1;
const int AX_SRC_TYPE_LOWPASS1 = 0x2;
const int AX_SRC_TYPE_LOWPASS2 = 0x3;
const int AX_SRC_TYPE_LOWPASS3 = 0x4;
constexpr int AX_SRC_TYPE_NONE = 0x0;
constexpr int AX_SRC_TYPE_LINEAR = 0x1;
constexpr int AX_SRC_TYPE_LOWPASS1 = 0x2;
constexpr int AX_SRC_TYPE_LOWPASS2 = 0x3;
constexpr int AX_SRC_TYPE_LOWPASS3 = 0x4;
const int AX_FILTER_MODE_TAP = 0x0;
const int AX_FILTER_MODE_LINEAR = 0x1;
const int AX_FILTER_MODE_NONE = 0x2;
constexpr int AX_FILTER_MODE_TAP = 0x0;
constexpr int AX_FILTER_MODE_LINEAR = 0x1;
constexpr int AX_FILTER_MODE_NONE = 0x2;
const int AX_FILTER_LOWPASS_8K = 0x0;
const int AX_FILTER_LOWPASS_12K = 0x1;
const int AX_FILTER_LOWPASS_16K = 0x2;
constexpr int AX_FILTER_LOWPASS_8K = 0x0;
constexpr int AX_FILTER_LOWPASS_12K = 0x1;
constexpr int AX_FILTER_LOWPASS_16K = 0x2;
void loadExports();
bool isInitialized();
@ -314,9 +314,9 @@ namespace snd_core
// AXMix
// mixer select constants (for AXSetDefaultMixerSelect / AXGetDefaultMixerSelect)
const int AX_MIXER_SELECT_DSP = (0);
const int AX_MIXER_SELECT_PPC = (1);
const int AX_MIXER_SELECT_BOTH = (2);
constexpr int AX_MIXER_SELECT_DSP = (0);
constexpr int AX_MIXER_SELECT_PPC = (1);
constexpr int AX_MIXER_SELECT_BOTH = (2);
void AXMix_Init();
void AXSetDefaultMixerSelect(uint32 mixerSelect);

View file

@ -4,7 +4,7 @@
namespace snd_core
{
const int AX_AUX_FRAME_COUNT = 2;
constexpr int AX_AUX_FRAME_COUNT = 2;
// old (deprecated) style AUX callbacks
MPTR __AXOldAuxDRCCallbackFunc[AX_AUX_BUS_COUNT * 2];

View file

@ -18,31 +18,31 @@ namespace snd_core
extern sndGeneric_t sndGeneric;
const uint32 AX_SYNCFLAG_SRCFILTER = 0x1; // Voice src type (AXSetVoiceSrcType)
const uint32 AX_SYNCFLAG_DEVICEMIXMASK = 0x2; // Voice mix related (AXSetVoiceDeviceMix)
const uint32 AX_SYNCFLAG_PLAYBACKSTATE = 0x4; // Voice play state (AXSetVoiceState)
const uint32 AX_SYNCFLAG_VOICETYPE = 0x8; // Voice type (AXSetVoiceType)
const uint32 AX_SYNCFLAG_DEVICEMIX = 0x10; // Voice mix related (AXSetVoiceDeviceMix)
const uint32 AX_SYNCFLAG_ITD20 = 0x20; // Voice initial time delay (AXSetVoiceItdOn)
const uint32 AX_SYNCFLAG_ITD40 = 0x40; // Voice initial time delay (AXSetVoiceItdOn, AXSetVoiceItdTarget)
const uint32 AX_SYNCFLAG_VE = 0x100; // Voice ve (AXSetVoiceVe)
const uint32 AX_SYNCFLAG_VEDELTA = 0x200; // Voice ve delta (AXSetVoiceVeDelta)
const uint32 AX_SYNCFLAG_OFFSETS = 0x400; // Voice offset data (AXSetVoiceOffsets)
const uint32 AX_SYNCFLAG_LOOPFLAG = 0x800; // Voice loop flag (AXSetVoiceLoop)
const uint32 AX_SYNCFLAG_LOOPOFFSET = 0x1000; // Voice loop offset (AXSetVoiceLoopOffset)
const uint32 AX_SYNCFLAG_ENDOFFSET = 0x2000; // Voice end offset (AXSetVoiceEndOffset)
const uint32 AX_SYNCFLAG_CURRENTOFFSET = 0x4000; // Voice current offset (AXSetVoiceCurrentOffset)
const uint32 AX_SYNCFLAG_ADPCMDATA = 0x8000; // Voice adpcm data (AXSetVoiceAdpcm)
const uint32 AX_SYNCFLAG_SRCDATA = 0x10000; // Voice src + src ratio (AXSetVoiceSrc)
const uint32 AX_SYNCFLAG_SRCRATIO = 0x20000; // Voice src ratio (AXSetVoiceSrcRatio)
const uint32 AX_SYNCFLAG_ADPCMLOOP = 0x40000; // Voice adpcm loop (AXSetVoiceAdpcmLoop)
const uint32 AX_SYNCFLAG_LPFDATA = 0x80000; // Voice lpf (AXSetVoiceLpf)
const uint32 AX_SYNCFLAG_LPFCOEF = 0x100000; // Voice lpf coef (AXSetVoiceLpfCoefs)
const uint32 AX_SYNCFLAG_BIQUADDATA = 0x200000; // Voice biquad (AXSetVoiceBiquad)
const uint32 AX_SYNCFLAG_BIQUADCOEF = 0x400000; // Voice biquad coef (AXSetVoiceBiquadCoefs)
const uint32 AX_SYNCFLAG_VOICEREMOTEON = 0x800000; // ??? (AXSetVoiceRmtOn?)
const uint32 AX_SYNCFLAG_4000000 = 0x4000000; // ???
const uint32 AX_SYNCFLAG_8000000 = 0x8000000; // ???
constexpr uint32 AX_SYNCFLAG_SRCFILTER = 0x1; // Voice src type (AXSetVoiceSrcType)
constexpr uint32 AX_SYNCFLAG_DEVICEMIXMASK = 0x2; // Voice mix related (AXSetVoiceDeviceMix)
constexpr uint32 AX_SYNCFLAG_PLAYBACKSTATE = 0x4; // Voice play state (AXSetVoiceState)
constexpr uint32 AX_SYNCFLAG_VOICETYPE = 0x8; // Voice type (AXSetVoiceType)
constexpr uint32 AX_SYNCFLAG_DEVICEMIX = 0x10; // Voice mix related (AXSetVoiceDeviceMix)
constexpr uint32 AX_SYNCFLAG_ITD20 = 0x20; // Voice initial time delay (AXSetVoiceItdOn)
constexpr uint32 AX_SYNCFLAG_ITD40 = 0x40; // Voice initial time delay (AXSetVoiceItdOn, AXSetVoiceItdTarget)
constexpr uint32 AX_SYNCFLAG_VE = 0x100; // Voice ve (AXSetVoiceVe)
constexpr uint32 AX_SYNCFLAG_VEDELTA = 0x200; // Voice ve delta (AXSetVoiceVeDelta)
constexpr uint32 AX_SYNCFLAG_OFFSETS = 0x400; // Voice offset data (AXSetVoiceOffsets)
constexpr uint32 AX_SYNCFLAG_LOOPFLAG = 0x800; // Voice loop flag (AXSetVoiceLoop)
constexpr uint32 AX_SYNCFLAG_LOOPOFFSET = 0x1000; // Voice loop offset (AXSetVoiceLoopOffset)
constexpr uint32 AX_SYNCFLAG_ENDOFFSET = 0x2000; // Voice end offset (AXSetVoiceEndOffset)
constexpr uint32 AX_SYNCFLAG_CURRENTOFFSET = 0x4000; // Voice current offset (AXSetVoiceCurrentOffset)
constexpr uint32 AX_SYNCFLAG_ADPCMDATA = 0x8000; // Voice adpcm data (AXSetVoiceAdpcm)
constexpr uint32 AX_SYNCFLAG_SRCDATA = 0x10000; // Voice src + src ratio (AXSetVoiceSrc)
constexpr uint32 AX_SYNCFLAG_SRCRATIO = 0x20000; // Voice src ratio (AXSetVoiceSrcRatio)
constexpr uint32 AX_SYNCFLAG_ADPCMLOOP = 0x40000; // Voice adpcm loop (AXSetVoiceAdpcmLoop)
constexpr uint32 AX_SYNCFLAG_LPFDATA = 0x80000; // Voice lpf (AXSetVoiceLpf)
constexpr uint32 AX_SYNCFLAG_LPFCOEF = 0x100000; // Voice lpf coef (AXSetVoiceLpfCoefs)
constexpr uint32 AX_SYNCFLAG_BIQUADDATA = 0x200000; // Voice biquad (AXSetVoiceBiquad)
constexpr uint32 AX_SYNCFLAG_BIQUADCOEF = 0x400000; // Voice biquad coef (AXSetVoiceBiquadCoefs)
constexpr uint32 AX_SYNCFLAG_VOICEREMOTEON = 0x800000; // ??? (AXSetVoiceRmtOn?)
constexpr uint32 AX_SYNCFLAG_4000000 = 0x4000000; // ???
constexpr uint32 AX_SYNCFLAG_8000000 = 0x8000000; // ???
struct axADPCMInternal_t
{
@ -95,7 +95,7 @@ namespace snd_core
}
};
const int AX_BUS_COUNT = 4;
constexpr int AX_BUS_COUNT = 4;
struct AXVPBInternal_t
{

View file

@ -362,7 +362,7 @@ void swkbd_render(bool mainWindow)
if (!font || !textFont)
return;
const auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
constexpr auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
ImGui::PushStyleColor(ImGuiCol_WindowBg, 0);

View file

@ -2,9 +2,9 @@
#include "nexTypes.h"
#include<mutex>
const int NEX_PROTOCOL_AUTHENTICATION = 0xA;
const int NEX_PROTOCOL_SECURE = 0xB;
const int NEX_PROTOCOL_FRIENDS_WIIU = 0x66;
constexpr int NEX_PROTOCOL_AUTHENTICATION = 0xA;
constexpr int NEX_PROTOCOL_SECURE = 0xB;
constexpr int NEX_PROTOCOL_FRIENDS_WIIU = 0x66;
class nexService;
@ -69,12 +69,12 @@ private:
}protocolHandler_t;
public:
static const int STATE_CONNECTING = 0;
static const int STATE_CONNECTED = 1;
static const int STATE_DISCONNECTED = 2;
static constexpr int STATE_CONNECTING = 0;
static constexpr int STATE_CONNECTED = 1;
static constexpr int STATE_DISCONNECTED = 2;
static const unsigned int ERR_TIMEOUT = (0xFFFFFFFF);
static const unsigned int ERR_NO_CONNECTION = (0xFFFFFFFE);
static constexpr unsigned int ERR_TIMEOUT = (0xFFFFFFFF);
static constexpr unsigned int ERR_NO_CONNECTION = (0xFFFFFFFE);
nexService(prudpClient* con);
nexService(uint32 ip, uint16 port, const char* accessKey);

View file

@ -3,12 +3,12 @@
#include "nexFriends.h"
#include "Cafe/CafeSystem.h"
static const int NOTIFICATION_SRV_FRIEND_OFFLINE = 0x0A; // the opposite event (friend online) is notified via _PRESENCE_CHANGE
static const int NOTIFICATION_SRV_FRIEND_PRESENCE_CHANGE = 0x18;
static constexpr int NOTIFICATION_SRV_FRIEND_OFFLINE = 0x0A; // the opposite event (friend online) is notified via _PRESENCE_CHANGE
static constexpr int NOTIFICATION_SRV_FRIEND_PRESENCE_CHANGE = 0x18;
static const int NOTIFICATION_SRV_FRIEND_REMOVED = 0x1A; // also used to indicate that an incoming friend request was canceled
static const int NOTIFICATION_SRV_FRIEND_REQUEST_INCOMING = 0x1B; // someone sent a friend request to us
static const int NOTIFICATION_SRV_FRIEND_ADDED = 0x1E; // not sent when friend request is accepted locally
static constexpr int NOTIFICATION_SRV_FRIEND_REMOVED = 0x1A; // also used to indicate that an incoming friend request was canceled
static constexpr int NOTIFICATION_SRV_FRIEND_REQUEST_INCOMING = 0x1B; // someone sent a friend request to us
static constexpr int NOTIFICATION_SRV_FRIEND_ADDED = 0x1E; // not sent when friend request is accepted locally
void NexFriends::processServerNotification_friendOffline(uint32 pid)
{

View file

@ -513,10 +513,10 @@ class NexFriends
public:
using RpcErrorCode = int; // replace with enum class later
static const int ERR_NONE = 0;
static const int ERR_RPC_FAILED = 1;
static const int ERR_UNEXPECTED_RESULT = 2;
static const int ERR_NOT_CONNECTED = 3;
static constexpr int ERR_NONE = 0;
static constexpr int ERR_RPC_FAILED = 1;
static constexpr int ERR_UNEXPECTED_RESULT = 2;
static constexpr int ERR_NOT_CONNECTED = 3;
enum NOTIFICATION_TYPE
{

View file

@ -47,20 +47,20 @@ struct prudpAuthServerInfo
class prudpPacket
{
public:
static const int PACKET_RAW_SIZE_MAX = 500;
static constexpr int PACKET_RAW_SIZE_MAX = 500;
static const int TYPE_SYN = 0;
static const int TYPE_CON = 1;
static const int TYPE_DATA = 2;
static const int TYPE_DISCONNECT = 3;
static const int TYPE_PING = 4;
static constexpr int TYPE_SYN = 0;
static constexpr int TYPE_CON = 1;
static constexpr int TYPE_DATA = 2;
static constexpr int TYPE_DISCONNECT = 3;
static constexpr int TYPE_PING = 4;
static const int STREAM_TYPE_SECURE = 0xA;
static constexpr int STREAM_TYPE_SECURE = 0xA;
static const int FLAG_ACK = 0x1;
static const int FLAG_RELIABLE = 0x2; // if this flag is set, increase sequenceId
static const int FLAG_NEED_ACK = 0x4;
static const int FLAG_HAS_SIZE = 0x8;
static constexpr int FLAG_ACK = 0x1;
static constexpr int FLAG_RELIABLE = 0x2; // if this flag is set, increase sequenceId
static constexpr int FLAG_NEED_ACK = 0x4;
static constexpr int FLAG_HAS_SIZE = 0x8;
static sint32 calculateSizeFromPacketData(uint8* data, sint32 length);

View file

@ -62,7 +62,7 @@ public:
}
private:
static const uint32 kStaticMemOffset = 64;
static constexpr uint32 kStaticMemOffset = 64;
T* m_ptr;
sint32 m_modified_size;

View file

@ -562,9 +562,9 @@ fastfloat_really_inline void write_u64(uint8_t *chars, uint64_t val) {
// credit @aqrit
fastfloat_really_inline uint32_t parse_eight_digits_unrolled(uint64_t val) {
const uint64_t mask = 0x000000FF000000FF;
const uint64_t mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
const uint64_t mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
constexpr uint64_t mask = 0x000000FF000000FF;
constexpr uint64_t mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
constexpr uint64_t mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
val -= 0x3030303030303030;
val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
@ -2276,9 +2276,9 @@ fastfloat_really_inline void write_u64(uint8_t *chars, uint64_t val) {
// credit @aqrit
fastfloat_really_inline uint32_t parse_eight_digits_unrolled(uint64_t val) {
const uint64_t mask = 0x000000FF000000FF;
const uint64_t mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
const uint64_t mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
constexpr uint64_t mask = 0x000000FF000000FF;
constexpr uint64_t mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
constexpr uint64_t mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
val -= 0x3030303030303030;
val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;

View file

@ -55,7 +55,7 @@ private:
uint32_t m_offset = 0;
bool m_data_written = false;
static const uint32 kBufferCount = 4;
static constexpr uint32 kBufferCount = 4;
std::array<HANDLE, kBufferCount> m_notify_event{};
mutable std::shared_mutex m_mutex;

View file

@ -16,7 +16,7 @@
#include <system_error>
// guid from mmdeviceapi.h
static const GUID DEVINTERFACE_AUDIO_RENDER_GUID = { 0xe6327cad, 0xdcec, 0x4949, 0xae, 0x8a, 0x99, 0x1e, 0x97, 0x6a, 0x79, 0xd2 };
static constexpr GUID DEVINTERFACE_AUDIO_RENDER_GUID = { 0xe6327cad, 0xdcec, 0x4949, 0xae, 0x8a, 0x99, 0x1e, 0x97, 0x6a, 0x79, 0xd2 };
#pragma comment(lib, "wbemuuid.lib")

View file

@ -144,7 +144,7 @@ AudioDebuggerWindow::AudioDebuggerWindow(wxFrame& parent)
wxFrame::SetBackgroundColour(*wxWHITE);
// start refresh timer
static const int INTERVAL = 100; // milliseconds
static constexpr int INTERVAL = 100; // milliseconds
refreshTimer = new wxTimer(this, REFRESH_TIMER_ID);
refreshTimer->Start(INTERVAL);
}

View file

@ -6,7 +6,7 @@
#include "Common/GLInclude/GLInclude.h"
#include <wx/glcanvas.h> // this includes GL/gl.h, avoid using this in a header because it would contaminate our own OpenGL definitions (GLInclude)
static const int g_gl_attribute_list[] =
static constexpr int g_gl_attribute_list[] =
{
WX_GL_RGBA,
WX_GL_DOUBLEBUFFER,

View file

@ -134,7 +134,7 @@ void PairingDialog::WorkerThread()
const std::wstring wiimoteName = L"Nintendo RVL-CNT-01";
const std::wstring wiiUProControllerName = L"Nintendo RVL-CNT-01-UC";
const GUID bthHidGuid = {0x00001124, 0x0000, 0x1000, {0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}};
constexpr GUID bthHidGuid = {0x00001124, 0x0000, 0x1000, {0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}};
const BLUETOOTH_FIND_RADIO_PARAMS radioFindParams =
{

View file

@ -9,10 +9,10 @@
#include "gui/helpers/wxHelpers.h"
#include "gui/components/wxInputDraw.h"
const ProController::ButtonId g_kFirstColumnItems[] = { ProController::kButtonId_A, ProController::kButtonId_B, ProController::kButtonId_X, ProController::kButtonId_Y, ProController::kButtonId_L, ProController::kButtonId_R, ProController::kButtonId_ZL, ProController::kButtonId_ZR, ProController::kButtonId_Plus, ProController::kButtonId_Minus };
const ProController::ButtonId g_kSecondColumnItems[] = { ProController::kButtonId_StickL, ProController::kButtonId_StickL_Up, ProController::kButtonId_StickL_Down, ProController::kButtonId_StickL_Left, ProController::kButtonId_StickL_Right };
const ProController::ButtonId g_kThirdColumnItems[] = { ProController::kButtonId_StickR, ProController::kButtonId_StickR_Up, ProController::kButtonId_StickR_Down, ProController::kButtonId_StickR_Left, ProController::kButtonId_StickR_Right };
const ProController::ButtonId g_kFourthRowItems[] = { ProController::kButtonId_Up, ProController::kButtonId_Down, ProController::kButtonId_Left, ProController::kButtonId_Right };
constexpr ProController::ButtonId g_kFirstColumnItems[] = { ProController::kButtonId_A, ProController::kButtonId_B, ProController::kButtonId_X, ProController::kButtonId_Y, ProController::kButtonId_L, ProController::kButtonId_R, ProController::kButtonId_ZL, ProController::kButtonId_ZR, ProController::kButtonId_Plus, ProController::kButtonId_Minus };
constexpr ProController::ButtonId g_kSecondColumnItems[] = { ProController::kButtonId_StickL, ProController::kButtonId_StickL_Up, ProController::kButtonId_StickL_Down, ProController::kButtonId_StickL_Left, ProController::kButtonId_StickL_Right };
constexpr ProController::ButtonId g_kThirdColumnItems[] = { ProController::kButtonId_StickR, ProController::kButtonId_StickR_Up, ProController::kButtonId_StickR_Down, ProController::kButtonId_StickR_Left, ProController::kButtonId_StickR_Right };
constexpr ProController::ButtonId g_kFourthRowItems[] = { ProController::kButtonId_Up, ProController::kButtonId_Down, ProController::kButtonId_Left, ProController::kButtonId_Right };
ProControllerInputPanel::ProControllerInputPanel(wxWindow* parent)

View file

@ -135,7 +135,7 @@ void main()
gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1);
}
*/
static uint32_t __glsl_shader_vert_spv[] =
static constexpr uint32_t __glsl_shader_vert_spv[] =
{
0x07230203,0x00010000,0x00080001,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
@ -192,7 +192,7 @@ void main()
fColor = In.Color * texture(sTexture, In.UV.st);
}
*/
static uint32_t __glsl_shader_frag_spv[] =
static constexpr uint32_t __glsl_shader_frag_spv[] =
{
0x07230203,0x00010000,0x00080001,0x0000001e,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,