Introduce QuickFill
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef __JABYENGINE_GPU_IO_HPP__
|
||||
#define __JABYENGINE_GPU_IO_HPP__
|
||||
#include "IOPort.hpp"
|
||||
#include "../../GPU/GPU_Types.hpp"
|
||||
|
||||
namespace GPU {
|
||||
namespace Port {
|
||||
@@ -42,17 +43,29 @@ namespace GPU {
|
||||
};
|
||||
|
||||
namespace Command {
|
||||
static constexpr uint32_t construct_cmd(uint8_t cmd, uint32_t value) {
|
||||
return ((cmd << 24) | value);
|
||||
}
|
||||
|
||||
struct __no_align GP0 : public ComplexBitMap<uint32_t> {
|
||||
__io_port_inherit_complex_bit_map(GP0);
|
||||
|
||||
static constexpr GP0 QuickFill(Color color) {
|
||||
return {(0x02 << 24) | color.raw()};
|
||||
}
|
||||
|
||||
static constexpr GP0 TopLeftPosition(uint16_t x, uint16_t y) {
|
||||
return {(y << 16) | x};
|
||||
}
|
||||
|
||||
static constexpr GP0 WidthHeight(uint16_t w, uint16_t h) {
|
||||
return {(h << 16) | h};
|
||||
}
|
||||
};
|
||||
|
||||
struct __no_align GP1 : public ComplexBitMap<uint32_t> {
|
||||
__io_port_inherit_complex_bit_map(GP1);
|
||||
|
||||
static constexpr uint32_t construct_cmd(uint8_t cmd, uint32_t value) {
|
||||
return ((cmd << 24) | value);
|
||||
}
|
||||
|
||||
static constexpr GP1 Reset() {
|
||||
return {0};
|
||||
}
|
||||
|
Reference in New Issue
Block a user