Added named colors

This commit is contained in:
jaby 2022-09-11 10:17:02 +02:00
parent a8f0bddc89
commit 9cb0b70308
2 changed files with 23 additions and 1 deletions

View File

@ -15,6 +15,26 @@ namespace GPU {
constexpr uint32_t raw() const {
return ((this->blue << 16) | (this->green << 8) | this->red);
}
static constexpr Color Black() {
return Color(0, 0, 0);
}
static constexpr Color White() {
return Color(0xFF, 0xFF, 0xFF);
}
static constexpr Color Red() {
return Color(0xFF, 0x0, 0x0);
}
static constexpr Color Green() {
return Color(0x0, 0x0, 0xFF);
}
static constexpr Color Blue() {
return Color(0x0, 0x0, 0xFF);
}
};
template<typename T>

View File

@ -2,6 +2,8 @@
#include <PSX/GPU/GPU.h>
namespace GPU {
void display_logo() {
Display::disable();
quick_fill_fast(Color(0x0, 0x80, 0x80), PositionU16(0, 0), SizeU16(640, 480));
@ -11,6 +13,6 @@ namespace GPU {
void setup() {
Port::GP1.write(Port::Command::GP1::Reset());
quick_fill_fast(Color(0x0, 0x0, 0x0), PositionU16(0, 0), SizeU16(640, 480));
quick_fill_fast(Color::Black(), PositionU16(0, 0), SizeU16(640, 480));
}
}