Fix border slightly

This commit is contained in:
Jaby 2024-03-20 23:24:27 -05:00
parent b55b6880a5
commit c10b9ce940
2 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,6 @@
#include <PSX/Timer/frame_timer.hpp>
#include <stdio.h>
// TODO: The border is missing
namespace ScreenCenter {
using namespace JabyEngine;
using GenericButton = Periphery::GenericController::Button;

View File

@ -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) {