Prepare for textured sprites; better integration of GPU types
This commit is contained in:
@@ -30,9 +30,9 @@ namespace JabyEngine {
|
||||
while(!GPU_IO::GPUSTAT.is_set(GPU_IO::GPUSTAT_t::GP0ReadyForCMD));
|
||||
}
|
||||
|
||||
static void set_draw_area(uint16_t x, uint16_t y) {
|
||||
const auto top_left = GPU_IO::Command::DrawAreaTopLeft(x, y);
|
||||
const auto bottom_right = GPU_IO::Command::DrawAreaBottomRight((x + Display::Width - 1), (y + Display::Height - 1));
|
||||
static void set_draw_area(const PositionU16& pos) {
|
||||
const auto top_left = GPU_IO::Command::DrawAreaTopLeft(pos);
|
||||
const auto bottom_right = GPU_IO::Command::DrawAreaBottomRight(pos.move((Display::Width - 1), (Display::Height - 1)));
|
||||
|
||||
wait_ready_for_CMD();
|
||||
GPU_IO::GP0 = top_left;
|
||||
@@ -43,21 +43,21 @@ namespace JabyEngine {
|
||||
static void copy_vram_to_vram(const AreaU16& dst, const PositionU16& src) {
|
||||
wait_ready_for_CMD();
|
||||
GPU_IO::GP0 = GPU_IO::Command::VRAM2VRAM_Blitting();
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(src.x, src.y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(dst.position.x, dst.position.y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(dst.size.width, dst.size.height);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(src);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(dst.position);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(dst.size);
|
||||
}
|
||||
|
||||
static void quick_fill_fast(const Color24& color, const AreaU16& area) {
|
||||
wait_ready_for_CMD();
|
||||
GPU_IO::GP0 = GPU_IO::Command::QuickFill(color);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(area.position.x, area.position.y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(area.size.width, area.size.height);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(area.position);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(area.size);
|
||||
}
|
||||
|
||||
static void set_draw_offset(int16_t x, int16_t y) {
|
||||
static void set_draw_offset(const PositionI16& offset) {
|
||||
wait_ready_for_CMD();
|
||||
GPU_IO::GP0 = GPU_IO::Command::SetDrawOffset(x, y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::SetDrawOffset(offset);
|
||||
}
|
||||
|
||||
static void reset_cmd_buffer() {
|
||||
@@ -86,8 +86,8 @@ namespace JabyEngine {
|
||||
static void set_dst(const PositionU16& position, const SizeU16& size) {
|
||||
wait_ready_for_CMD();
|
||||
GPU_IO::GP0 = GPU_IO::Command::CPU2VRAM_Blitting();
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(position.x, position.y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(size.width, size.height);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(position);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(size);
|
||||
}
|
||||
|
||||
static void start(uint16_t blockCount, uint16_t wordsPerBlock = 0x10) {
|
||||
|
||||
Reference in New Issue
Block a user