Start configurating GPU
This commit is contained in:
@@ -153,17 +153,20 @@ public:
|
||||
}
|
||||
|
||||
// For easier constructing
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const BitRange<T>& range, T value) {
|
||||
template<typename S>
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const BitRange<S>& range, T value) {
|
||||
this->set_value(value, range);
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const BitRangeValue<T>& value) {
|
||||
template<typename S>
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const BitRangeValue<S>& value) {
|
||||
this->set_value(value.value, {value.begin, value.length});
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const Bit<T>& bit) {
|
||||
template<typename S>
|
||||
constexpr __always_inline ComplexBitMap<T>& set(const Bit<S>& bit) {
|
||||
this->set_bit(bit.value);
|
||||
return *this;
|
||||
}
|
||||
|
@@ -11,22 +11,27 @@ namespace GPU {
|
||||
B_add_F_Quarter = 3,
|
||||
};
|
||||
|
||||
enum struct DisplayAreaColorDepth {
|
||||
$15bit = 0,
|
||||
$24bit = 1,
|
||||
};
|
||||
|
||||
enum struct TexturePageColor {
|
||||
_4bit = 0,
|
||||
_8bit = 1,
|
||||
_15bit = 2,
|
||||
$4bit = 0,
|
||||
$8bit = 1,
|
||||
$15bit = 2,
|
||||
};
|
||||
|
||||
enum struct HorizontalResolution {
|
||||
_256 = 0,
|
||||
_320 = 1,
|
||||
_512 = 2,
|
||||
_640 = 3,
|
||||
$256 = 0,
|
||||
$320 = 1,
|
||||
$512 = 2,
|
||||
$640 = 3,
|
||||
};
|
||||
|
||||
enum struct VerticalResolution {
|
||||
_240 = 0,
|
||||
_480 = 1
|
||||
$240 = 0,
|
||||
$480 = 1
|
||||
};
|
||||
|
||||
enum struct DMADirection {
|
||||
@@ -84,6 +89,10 @@ namespace GPU {
|
||||
static constexpr GP1 DMADirection(DMADirection dir) {
|
||||
return ComplexBitMap{construct_cmd(0x04, static_cast<uint32_t>(dir))};
|
||||
}
|
||||
|
||||
static constexpr GP1 DisplayMode(uint32_t mode) {
|
||||
return ComplexBitMap{construct_cmd(0x08, mode)};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -97,7 +106,7 @@ namespace GPU {
|
||||
static constexpr auto InterruptRequest = Bit<uint32_t>(24);
|
||||
static constexpr auto DisplayDisabled = Bit<uint32_t>(23);
|
||||
static constexpr auto VerticalInterlaceOn = Bit<uint32_t>(22);
|
||||
static constexpr auto DisplayAreaColorDepth24bit = Bit<uint32_t>(21);
|
||||
static constexpr auto DisplayAreaColorDepth = BitRange<GPU::DisplayAreaColorDepth>::from_to(21, 21);
|
||||
static constexpr auto VideoModePal = Bit<uint32_t>(20);
|
||||
static constexpr auto VerticalResolutionValue = BitRange<VerticalResolution>::from_to(19, 19);
|
||||
static constexpr auto HorizontalResolutionValue = BitRange<HorizontalResolution>::from_to(17, 18);
|
||||
|
Reference in New Issue
Block a user