Support obtaining PageOffset from SimpleTIM

This commit is contained in:
Jaby 2024-01-23 11:28:03 -05:00
parent 5218ad1c7a
commit d984890205
1 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,21 @@ namespace JabyEngine {
constexpr GPU::PositionU16 get_clut_position() const {
return GPU::PositionU16::create(SimpleTIM::get_clut_x(), SimpleTIM::get_clut_y());
}
constexpr GPU::PageOffset get_page_offset() const {
const auto tex_page = SimpleTIM::get_texture_position();
return GPU::PageOffset::create(tex_page.x&0x3F, tex_page.y);
}
constexpr GPU::PageOffset get_page_offset_clut8() const {
const auto page_offset = SimpleTIM::get_page_offset();
return GPU::PageOffset::create(page_offset.x*2, page_offset.y);
}
constexpr GPU::PageOffset get_page_offset_clut4() const {
const auto page_offset = SimpleTIM::get_page_offset();
return GPU::PageOffset::create(page_offset.x*4, page_offset.y);
}
};
struct CopyTo {