From 9cb0b70308bcdbba4eef67c98712a427d951cb88 Mon Sep 17 00:00:00 2001 From: jaby Date: Sun, 11 Sep 2022 10:17:02 +0200 Subject: [PATCH] Added named colors --- include/PSX/GPU/GPU_Types.hpp | 20 ++++++++++++++++++++ src/Library/src/BootLoader/gpu_boot.cpp | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/PSX/GPU/GPU_Types.hpp b/include/PSX/GPU/GPU_Types.hpp index c5e55128..d662b1d6 100644 --- a/include/PSX/GPU/GPU_Types.hpp +++ b/include/PSX/GPU/GPU_Types.hpp @@ -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 diff --git a/src/Library/src/BootLoader/gpu_boot.cpp b/src/Library/src/BootLoader/gpu_boot.cpp index 3ec2479d..811ace67 100644 --- a/src/Library/src/BootLoader/gpu_boot.cpp +++ b/src/Library/src/BootLoader/gpu_boot.cpp @@ -2,6 +2,8 @@ #include 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)); } } \ No newline at end of file