nstool/lib/libhac/include/nn/hac/MiscParamsEntry.h

50 lines
1.2 KiB
C
Raw Permalink Normal View History

#pragma once
#include <string>
#include <fnd/types.h>
2018-08-07 07:17:51 +00:00
#include <nn/hac/KernelCapabilityEntry.h>
2018-08-07 07:17:51 +00:00
namespace nn
{
namespace hac
{
class MiscParamsEntry
{
public:
MiscParamsEntry();
MiscParamsEntry(const KernelCapabilityEntry& kernel_cap);
2018-03-22 05:26:22 +00:00
MiscParamsEntry(byte_t program_type);
void operator=(const MiscParamsEntry& other);
bool operator==(const MiscParamsEntry& other) const;
bool operator!=(const MiscParamsEntry& other) const;
// kernel capability
const KernelCapabilityEntry& getKernelCapability() const;
void setKernelCapability(const KernelCapabilityEntry& kernel_cap);
// variables
2018-03-22 05:26:22 +00:00
byte_t getProgramType() const;
void setProgramType(byte_t type);
private:
const std::string kModuleName = "MISC_PARAMS_ENTRY";
static const kc::KernelCapId kCapId = kc::KC_MISC_PARAMS;
2018-03-22 05:26:22 +00:00
static const byte_t kValBits = 3;
static const byte_t kMaxProgramType = BIT(kValBits)-1;
KernelCapabilityEntry mCap;
2018-03-22 05:26:22 +00:00
byte_t mProgramType;
inline void updateCapField()
{
2018-03-22 05:26:22 +00:00
uint32_t field = mProgramType & kMaxProgramType;
mCap.setField(field);
}
inline void processCapField()
{
2018-03-22 05:26:22 +00:00
uint32_t field = mCap.getField();
mProgramType = field & kMaxProgramType;
}
};
2018-08-07 07:17:51 +00:00
}
}