Separate between Display and Screen

This commit is contained in:
Jaby 2022-10-03 15:40:46 +02:00
parent 83c00992aa
commit 3ee0ba72b2
4 changed files with 7 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -5,7 +5,7 @@
#include <PSX/System/IOPorts/GPU_IO.hpp>
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
}
}

View File

@ -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));
}

View File

@ -1,7 +1,7 @@
#include <PSX/GPU/GPU.hpp>
namespace GPU {
namespace Display {
namespace Screen {
#ifdef JABYENGINE_PAL
static constexpr uint16_t ScanlinesV = 288;
#else