Setup DisplayArea

This commit is contained in:
Jaby
2022-10-03 16:23:35 +02:00
parent 3ee0ba72b2
commit 051ae637f1
4 changed files with 19 additions and 4 deletions

View File

@@ -8,9 +8,16 @@ namespace GPU {
static constexpr uint16_t ScanlinesV = 240;
#endif //JABYENGINE_PAL
#ifndef USE_NO$PSX
void set_offset(uint16_t x, uint16_t y) {
GP1.write(Command::GP1::HorizontalDisplayRange((x << 3), (x + Display::Width) << 3));
GP1.write(Command::GP1::VerticalDisplayRange(y, y + Display::Height));
}
#else
void set_offset(uint16_t x, uint16_t y) {
GP1.write(Command::GP1::HorizontalDisplayRange(x, (x + Display::Width*8)));
GP1.write(Command::GP1::VerticalDisplayRange(y - (ScanlinesV/2), y + (ScanlinesV/2)));
}
#endif //USE_NO$PSX
}
}