From c10b9ce9408fddf920f93b6d623468c82fbe9a7c Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 20 Mar 2024 23:24:27 -0500 Subject: [PATCH] Fix border slightly --- .../src/Overlay/ScreenCenter/screen_center.cpp | 1 - src/Library/src/GPU/gpu.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp b/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp index 7e47e2b8..cdfafcfc 100644 --- a/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp +++ b/examples/PoolBox/application/src/Overlay/ScreenCenter/screen_center.cpp @@ -6,7 +6,6 @@ #include #include -// TODO: The border is missing namespace ScreenCenter { using namespace JabyEngine; using GenericButton = Periphery::GenericController::Button; diff --git a/src/Library/src/GPU/gpu.cpp b/src/Library/src/GPU/gpu.cpp index 50494abe..0c02649e 100644 --- a/src/Library/src/GPU/gpu.cpp +++ b/src/Library/src/GPU/gpu.cpp @@ -87,11 +87,15 @@ namespace JabyEngine { } void Display :: set_offset(int16_t x, int16_t y) { + // Todo: Apply these in a better way or never? + static constexpr auto PS3_CorrectionX = 0; // 2 + static constexpr auto PS3_CorrectionY = 0; // 1 + x += internal::Display::DisplayRange.x; y += internal::Display::DisplayRange.y; - GPU_IO::GP1.write(GPU_IO::Command::HorizontalDisplayRange((x << 3), (x + Display::Width) << 3)); - GPU_IO::GP1.write(GPU_IO::Command::VerticalDisplayRange(y, y + Display::Height)); + GPU_IO::GP1.write(GPU_IO::Command::HorizontalDisplayRange((x << 3), (x + Display::Width + PS3_CorrectionX) << 3)); + GPU_IO::GP1.write(GPU_IO::Command::VerticalDisplayRange(y, y + Display::Height + PS3_CorrectionY)); } uint8_t swap_buffers_vsync(uint8_t syncs, bool clear_screen) {