Add BootImage to second DisplayBuffer during boot
This commit is contained in:
parent
169c53e434
commit
60049cc9e5
|
@ -92,11 +92,26 @@ namespace JabyEngine {
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Area {
|
||||
Position<T> position;
|
||||
Size<T> size;
|
||||
|
||||
constexpr Area() = default;
|
||||
constexpr Area(Position<T> position, Size<T> size) : position(position), size(size) {
|
||||
}
|
||||
constexpr Area(T position_x, T position_y, T size_width, T size_height) : position{position_x, position_y}, size{size_width, size_height} {
|
||||
}
|
||||
};
|
||||
|
||||
typedef Position<int16_t> PositionI16;
|
||||
typedef Position<uint16_t> PositionU16;
|
||||
|
||||
typedef Size<int16_t> SizeI16;
|
||||
typedef Size<uint16_t> SizeU16;
|
||||
|
||||
typedef Area<int16_t> AreaI16;
|
||||
typedef Area<uint16_t> AreaU16;
|
||||
}
|
||||
}
|
||||
#endif //!__JABYENGINE_GPU_TYPES_HPP__
|
|
@ -106,6 +106,10 @@ namespace JabyEngine {
|
|||
return {(0x02 << 24) | color.raw()};
|
||||
}
|
||||
|
||||
static constexpr GP0_t VRAM2VRAM_Blitting() {
|
||||
return {(0b100u << 29)};
|
||||
}
|
||||
|
||||
static constexpr GP0_t CPU2VRAM_Blitting() {
|
||||
return {(0b101u << 29)};
|
||||
}
|
||||
|
|
|
@ -31,10 +31,17 @@ namespace JabyEngine {
|
|||
GPU_IO::GP0 = GPU_IO::Command::DrawAreaBottomRight((x + Display::Width), (y + Display::Height));
|
||||
}
|
||||
|
||||
static void quick_fill_fast(const Color24& color, const PositionU16& pos, const SizeU16& size) {
|
||||
static void copy_vram_to_vram(const AreaU16& dst, const PositionU16& src) {
|
||||
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);
|
||||
}
|
||||
|
||||
static void quick_fill_fast(const Color24& color, const AreaU16& area) {
|
||||
GPU_IO::GP0 = GPU_IO::Command::QuickFill(color);
|
||||
GPU_IO::GP0 = GPU_IO::Command::TopLeftPosition(pos.x, pos.y);
|
||||
GPU_IO::GP0 = GPU_IO::Command::WidthHeight(size.width, size.height);
|
||||
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);
|
||||
}
|
||||
|
||||
static void reset_cmd_buffer() {
|
||||
|
|
|
@ -58,6 +58,9 @@ namespace JabyEngine {
|
|||
auto state = FileProcessor::create(&__boot_loader_end, SimpleTIM(32, 0, 0, 0));
|
||||
state.process(bytes_ready);
|
||||
|
||||
// Duplicate DisplayBuffer content
|
||||
internal::copy_vram_to_vram({PositionU16(0, Display::Height), SizeU16(Display::Width, Display::Height)}, PositionU16(0, 0));
|
||||
|
||||
Display::enable();
|
||||
}
|
||||
|
||||
|
@ -67,7 +70,7 @@ namespace JabyEngine {
|
|||
internal::Display::exchange_buffer_and_display();
|
||||
|
||||
GPU::internal::wait_ready_for_CMD();
|
||||
GPU::internal::quick_fill_fast(Color24::Black(), PositionU16(32, 0), SizeU16(Display::Width, Display::Height));
|
||||
GPU::internal::quick_fill_fast(Color24::Black(), {PositionU16(32, 0), SizeU16(Display::Width, Display::Height)});
|
||||
|
||||
__syscall_EnterCriticalSection();
|
||||
__syscall_SysEnqIntRP(VblankIrq, &::JabyEngine::GPU::internal::callback);
|
||||
|
|
Loading…
Reference in New Issue