From 54a426e7d11eb12a8c3710f3632b7084edf423fd Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 1 Feb 2024 12:46:54 +0100 Subject: See below. - Implement Framebuffer object. - Print Firmware name in NewBoot. Signed-off-by: Amlal El Mahrouss --- Private/Source/Framebuffer.cxx | 48 ++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'Private/Source/Framebuffer.cxx') diff --git a/Private/Source/Framebuffer.cxx b/Private/Source/Framebuffer.cxx index 251cdb93..3b8fa229 100644 --- a/Private/Source/Framebuffer.cxx +++ b/Private/Source/Framebuffer.cxx @@ -1,36 +1,34 @@ -/* - * ======================================================== - * - * HCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ +/* ------------------------------------------- -#include + Copyright Mahrouss Logic -namespace HCore { -Framebuffer::Framebuffer(HCore::Ref& addr) - : m_FrameBufferAddr(addr), m_Colour(FramebufferColorKind::RGB32) {} + File: Framebuffer.cxx + Purpose: EFI C++ library -Framebuffer::~Framebuffer() = default; + Revision History: -volatile UIntPtr* Framebuffer::operator[](const UIntPtr& width_and_height) { - if (m_FrameBufferAddr) - return reinterpret_cast( - m_FrameBufferAddr->m_Base + width_and_height); + 01/02/24: Added file (amlel) - return nullptr; -} +------------------------------------------- */ -Ref& Framebuffer::Leak() { return m_FrameBufferAddr; } +#include -Framebuffer::operator bool() { return m_FrameBufferAddr; } +using namespace HCore; -const FramebufferColorKind& Framebuffer::Color( - const FramebufferColorKind& colour) { - if (colour != FramebufferColorKind::INVALID) m_Colour = colour; +volatile UIntPtr *Framebuffer::operator[](const UIntPtr &width_and_height) { + return (UIntPtr *)(m_FrameBufferAddr->m_Base * width_and_height); +} + +const FramebufferColorKind &Framebuffer::Color( + const FramebufferColorKind &colour) { + if (m_Colour != FramebufferColorKind::INVALID && + colour != FramebufferColorKind::INVALID) { + m_Colour = colour; + } return m_Colour; } -} // namespace HCore + +Ref &Framebuffer::Leak() { + return this->m_FrameBufferAddr; +} -- cgit v1.2.3