aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-04-10 15:24:40 +0300
committerJoursoir <chat@joursoir.net>2022-04-10 15:26:34 +0300
commit0c2bba19840f78fbea8da299ff30fa4f5d09e125 (patch)
treebaf586c29bddf895c26308729ad33aae545da966
parentbcba7e07c45ce08cec2079fe08c58c5e49d2ff66 (diff)
downloadumt-0c2bba19840f78fbea8da299ff30fa4f5d09e125.tar.gz
umt-0c2bba19840f78fbea8da299ff30fa4f5d09e125.tar.bz2
umt-0c2bba19840f78fbea8da299ff30fa4f5d09e125.zip
main: add the char drawing routine
-rw-r--r--UefiMonitorTest/UefiMonitorTest.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c
index 3eb7323..1b6e026 100644
--- a/UefiMonitorTest/UefiMonitorTest.c
+++ b/UefiMonitorTest/UefiMonitorTest.c
@@ -11,6 +11,7 @@
#include <Protocol/GraphicsOutput.h>
#include "UefiMonitorTest.h"
+#include "fonts/System-8x16.h"
#define SWAP(A, B, C) \
C = A; \
@@ -305,6 +306,35 @@ PutRect (
}
}
+/**
+ Draws a character to the screen
+
+ @retval VOID
+**/
+STATIC
+VOID
+DrawChar (
+ IN GRAPHICS_CONTEXT *Graphics,
+ IN UINTN X,
+ IN UINTN Y,
+ IN UINT32 Icolor,
+ IN CHAR16 Char
+ )
+{
+ UINTN Index;
+ UINTN l, c;
+
+ Index = Char * (SYSTEM8X16_FONT_WIDTH * SYSTEM8X16_FONT_HEIGHT) - (SYSTEM8X16_FONT_WIDTH * SYSTEM8X16_FONT_HEIGHT);
+ for (l = 0; l < SYSTEM8X16_FONT_HEIGHT; l++) {
+ for (c = 0; c < SYSTEM8X16_FONT_WIDTH; c++) {
+ if (gFontSystem8x16[Index] == 1) {
+ PUT_PUXEL (Graphics, (X + c), (Y + l), Icolor);
+ }
+ Index++;
+ }
+ }
+}
+
STATIC
EFI_STATUS
Run (