フレームバッファ 割り込みの実装

This commit is contained in:
2020-08-29 17:13:36 +09:00
parent 266f9bf4af
commit 6159cb9d27
18 changed files with 1003 additions and 0 deletions

17
fb.c Normal file
View File

@@ -0,0 +1,17 @@
#include "fb.h"
struct FrameBuffer buffer;
void FrameBuffer_init(
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) { // Initialize framebuffer struct
buffer.BaseAddress = gop->Mode->FrameBufferBase;
buffer.Size = gop->Mode->FrameBufferSize;
buffer.HorizontalRes = gop->Mode->Info->HorizontalResolution;
buffer.VerticalRes = gop->Mode->Info->VerticalResolution;
buffer.PixelFormat = gop->Mode->Info->PixelFormat;
}
void RGBtoPixel(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *pixel,
UINT32 RGB) { // 0xaaaaaa format RGB to BGR Pixel format
pixel->Blue = RGB & 0xff;
pixel->Green = (RGB >> 8) & 0xff;
pixel->Red = (RGB >> 16) & 0xff;
}