From 69a84952bae5fe1626d7f16dcef398104888d11e Mon Sep 17 00:00:00 2001 From: jaby Date: Mon, 3 Oct 2022 15:40:46 +0200 Subject: [PATCH] Separate between Display and Screen --- include/PSX/GPU/GPU.hpp | 2 ++ src/Library/include/GPU/GPU.hpp | 6 +++--- src/Library/src/BootLoader/gpu_boot.cpp | 2 +- src/Library/src/GPU/GPU.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/PSX/GPU/GPU.hpp b/include/PSX/GPU/GPU.hpp index d92fec84..b752ecaf 100644 --- a/include/PSX/GPU/GPU.hpp +++ b/include/PSX/GPU/GPU.hpp @@ -27,7 +27,9 @@ namespace GPU { static void disable() { GP1.write(Command::GP1::SetDisplayState(DisplayState::Off)); } + } + namespace Screen { void set_offset(uint16_t x, uint16_t y); } } diff --git a/src/Library/include/GPU/GPU.hpp b/src/Library/include/GPU/GPU.hpp index 4d0c5216..b010005b 100644 --- a/src/Library/include/GPU/GPU.hpp +++ b/src/Library/include/GPU/GPU.hpp @@ -5,7 +5,7 @@ #include namespace GPU { - namespace Display { + namespace Screen { struct Mode { enum struct TVEncoding { NTSC = 0, @@ -45,12 +45,12 @@ namespace GPU { static constexpr uint16_t FirstVisiblePixelV = 0xA3; GP1.write(Command::GP1::DisplayMode(Mode::PAL())); - GPU::Display::set_offset(FirstVisiblePixelH, FirstVisiblePixelV); + GPU::Screen::set_offset(FirstVisiblePixelH, FirstVisiblePixelV); #else static constexpr uint16_t FirstVisiblePixelV = 0x88; GP1.write(Command::GP1::DisplayMode(Mode::NTSC())); - GPU::Display::set_offset(FirstVisiblePixelH, FirstVisiblePixelV); + GPU::Screen::set_offset(FirstVisiblePixelH, FirstVisiblePixelV); #endif } } diff --git a/src/Library/src/BootLoader/gpu_boot.cpp b/src/Library/src/BootLoader/gpu_boot.cpp index a9579868..3cfe70d6 100644 --- a/src/Library/src/BootLoader/gpu_boot.cpp +++ b/src/Library/src/BootLoader/gpu_boot.cpp @@ -17,7 +17,7 @@ namespace GPU { void setup() { GP1.write(Command::GP1::Reset()); - Display::configurate(); + Screen::configurate(); quick_fill_fast(Color24::Black(), PositionU16(0, 0), SizeU16(640, 480)); } diff --git a/src/Library/src/GPU/GPU.cpp b/src/Library/src/GPU/GPU.cpp index 8a995be3..2ee8d735 100644 --- a/src/Library/src/GPU/GPU.cpp +++ b/src/Library/src/GPU/GPU.cpp @@ -1,7 +1,7 @@ #include namespace GPU { - namespace Display { + namespace Screen { #ifdef JABYENGINE_PAL static constexpr uint16_t ScanlinesV = 288; #else