Add proper NTSC conversion values

This commit is contained in:
Jaby 2024-02-04 21:27:11 -05:00
parent 20e8e5d68c
commit 16cfcf42b2
3 changed files with 10 additions and 8 deletions

View File

@ -39,7 +39,7 @@ namespace JabyEngine {
GPU_IO::GP1.write(GPU_IO::Command::SetDisplayState(GPU_IO::DisplayState::Off));
}
static void set_offset(uint16_t x, uint16_t y);
static void set_offset(int16_t x, int16_t y);
};
static uint32_t update_id() {

View File

@ -15,9 +15,11 @@ namespace JabyEngine {
#ifdef JABYENGINE_PAL
static constexpr auto DisplayMode = GPU_IO::DisplayMode::PAL();
static constexpr uint16_t ScanlinesV = 288;
static constexpr auto DisplayRange = PositionI16::create(78, 35);
#else
static constexpr auto DisplayMode = GPU_IO::DisplayMode::NTSC();
static constexpr uint16_t ScanlinesV = 240;
static constexpr auto DisplayRange = PositionI16::create(76, 16);
#endif //JABYENGINE_PAL
static uint32_t exchange_buffer_and_display();

View File

@ -73,9 +73,9 @@ namespace JabyEngine {
}
}
void Display :: set_offset(uint16_t x, uint16_t y) {
x += 78;
y += 35;
void Display :: set_offset(int16_t x, int16_t y) {
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));