diff --git a/reactos/drivers/base/bootvid/arm/bootvid.c b/reactos/drivers/base/bootvid/arm/bootvid.c
new file mode 100644
index 00000000000..55335ce5e6f
--- /dev/null
+++ b/reactos/drivers/base/bootvid/arm/bootvid.c
@@ -0,0 +1,144 @@
+#include "precomp.h"
+#define NDEBUG
+#include "debug.h"
+
+/* PRIVATE FUNCTIONS *********************************************************/
+
+/* PUBLIC FUNCTIONS **********************************************************/
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+VidInitialize(IN BOOLEAN SetMode)
+{
+ DPRINT1("bv-arm\n");
+ UNIMPLEMENTED;
+ while (TRUE);
+ return FALSE;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidResetDisplay(IN BOOLEAN HalReset)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+ULONG
+NTAPI
+VidSetTextColor(ULONG Color)
+{
+ UNIMPLEMENTED;
+ return 0;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidDisplayStringXY(PUCHAR String,
+ ULONG Left,
+ ULONG Top,
+ BOOLEAN Transparent)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidSetScrollRegion(ULONG x1,
+ ULONG y1,
+ ULONG x2,
+ ULONG y2)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidCleanUp(VOID)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidBufferToScreenBlt(IN PUCHAR Buffer,
+ IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Width,
+ IN ULONG Height,
+ IN ULONG Delta)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidDisplayString(PUCHAR String)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidBitBlt(PUCHAR Buffer,
+ ULONG Left,
+ ULONG Top)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidScreenToBufferBlt(PUCHAR Buffer,
+ ULONG Left,
+ ULONG Top,
+ ULONG Width,
+ ULONG Height,
+ ULONG Delta)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidSolidColorFill(IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Right,
+ IN ULONG Bottom,
+ IN UCHAR Color)
+{
+ UNIMPLEMENTED;
+}
+
diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild
index 7786661d538..454f750c73f 100644
--- a/reactos/drivers/base/bootvid/bootvid.rbuild
+++ b/reactos/drivers/base/bootvid/bootvid.rbuild
@@ -6,9 +6,18 @@
.
ntoskrnl
hal
- bootvid.c
- bootdata.c
- vga.c
+
+
+ bootvid.c
+ bootdata.c
+ vga.c
+
+
+
+
+ bootvid.c
+
+
bootvid.rc
- precomp.h
+ precomp.h
\ No newline at end of file
diff --git a/reactos/drivers/base/bootvid/bootdata.c b/reactos/drivers/base/bootvid/i386/bootdata.c
similarity index 98%
rename from reactos/drivers/base/bootvid/bootdata.c
rename to reactos/drivers/base/bootvid/i386/bootdata.c
index 0de8717db9b..5087a8a1fa2 100644
--- a/reactos/drivers/base/bootvid/bootdata.c
+++ b/reactos/drivers/base/bootvid/i386/bootdata.c
@@ -1,309 +1,309 @@
-#include "precomp.h"
-
-USHORT AT_Initialization[] =
-{
- 0x10 | CMD_STREAM_READ, // Major Command = 0x10. Minor Command = 0x08.
- 0x3DA, // Index Status 1 Register Port Address
-
- //
- // This Stream performs a USHORT Array Indexed Write at port 0x3C0
- //
- 0x20 | 0x01, // Major Command = 0x20. Minor Command = 0x01.
- 0x3C0, // Attribute Controller Data Register
- 0x10, // Loop Count = 16 (Number of Pallette Entries)
- 0x0, // Index to select (Index = 0, palettes)
- 0x00, // Palette 0
- 0x01, // Palette 1
- 0x02, // Palette 2
- 0x03, // Palette 3
- 0x04, // Palette 4
- 0x05, // Palette 5
- 0x06, // Palette 6
- 0x07, // Palette 7
- 0x08, // Palette 8
- 0x09, // Palette 9
- 0x0A, // Palette 10
- 0x0B, // Palette 11
- 0x0C, // Palette 12
- 0x0D, // Palette 13
- 0x0E, // Palette 14
- 0x0F, // Palette 15
-
- //
- // This Stream performs a UCHAR READ of port 0x3DA
- //
- 0x10 | CMD_STREAM_READ, // Major Command = 0x10. Minor Command = 0x08.
- 0x3DA, // Index Status 1 Register Port Address
-
- //
- // This Stream performs a UCHAR WRITE of value 0x20 at port 0x3C0
- //
- 0x10 | CMD_STREAM_WRITE, // Major Command = 0x10. Minor Command = 0x00.
- 0x3C0, // Attribute Controller Data Register
- 0x20, // Set Palette Address Source
-
- //
- // End of Stream Marker
- //
- 0x0 // End of command stream
-};
-
-UCHAR FontData[256 * 13] =
-{
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 0
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 13
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 26
- 0x18, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 39
- 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
- 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
- 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
- 0x10, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 91
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, // 104
- 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
- 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 130
- 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 143
- 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 156
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, // 169
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 182
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 195
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 208
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 221
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 234
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 247
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 260
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 273
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 286
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 299
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 312
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 325
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 338
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 351
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 364
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 377
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 390
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 403
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 416
- 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 429
- 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 442
- 0x00, 0x14, 0x14, 0x14, 0x7F, 0x28, 0xFE, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, // 455
- 0x10, 0x3C, 0x50, 0x50, 0x70, 0x38, 0x1C, 0x14, 0x14, 0x78, 0x10, 0x00, 0x00, // 468
- 0x00, 0x61, 0x92, 0x94, 0x68, 0x18, 0x16, 0x29, 0x49, 0x86, 0x00, 0x00, 0x00, // 481
- 0x00, 0x18, 0x24, 0x24, 0x38, 0x71, 0x89, 0x8E, 0xC6, 0x7E, 0x00, 0x00, 0x00, // 494
- 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 507
- 0x06, 0x08, 0x10, 0x30, 0x20, 0x20, 0x20, 0x20, 0x30, 0x10, 0x08, 0x06, 0x00, // 520
- 0x60, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x10, 0x60, 0x00, // 533
- 0x00, 0x10, 0x52, 0x24, 0x3C, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 546
- 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 559
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, // 572
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 585
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, // 598
- 0x01, 0x02, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, // 611
- 0x00, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x3C, 0x00, 0x00, 0x00, // 624
- 0x00, 0x30, 0xD0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, // 637
- 0x00, 0x78, 0x04, 0x04, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, // 650
- 0x00, 0x78, 0x04, 0x04, 0x08, 0x30, 0x0C, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 663
- 0x00, 0x08, 0x18, 0x28, 0x28, 0x48, 0x88, 0xFC, 0x08, 0x08, 0x00, 0x00, 0x00, // 676
- 0x00, 0x3C, 0x20, 0x20, 0x38, 0x04, 0x04, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, // 689
- 0x00, 0x1C, 0x20, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, // 702
- 0x00, 0x7E, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x00, 0x00, 0x00, // 715
- 0x00, 0x3C, 0x42, 0x42, 0x24, 0x3C, 0x46, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 728
- 0x00, 0x38, 0x44, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x04, 0x38, 0x00, 0x00, 0x00, // 741
- 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, // 754
- 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, // 767
- 0x00, 0x00, 0x00, 0x02, 0x0C, 0x10, 0x60, 0x10, 0x0C, 0x02, 0x00, 0x00, 0x00, // 780
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // 793
- 0x00, 0x00, 0x00, 0x40, 0x30, 0x08, 0x06, 0x08, 0x30, 0x40, 0x00, 0x00, 0x00, // 806
- 0x00, 0x7C, 0x42, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 819
- 0x00, 0x3C, 0x62, 0xDE, 0xB2, 0xA2, 0xA6, 0x9B, 0x44, 0x3C, 0x00, 0x00, 0x00, // 832
- 0x00, 0x00, 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 845
- 0x00, 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x42, 0x42, 0x42, 0x7C, 0x00, 0x00, 0x00, // 858
- 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x3E, 0x00, 0x00, 0x00, // 871
- 0x00, 0x00, 0x78, 0x44, 0x42, 0x42, 0x42, 0x42, 0x44, 0x78, 0x00, 0x00, 0x00, // 884
- 0x00, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 897
- 0x00, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 910
- 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x8E, 0x82, 0x42, 0x3E, 0x00, 0x00, 0x00, // 923
- 0x00, 0x00, 0x42, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 936
- 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7C, 0x00, 0x00, 0x00, // 949
- 0x00, 0x00, 0x3C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 962
- 0x00, 0x00, 0x42, 0x44, 0x48, 0x70, 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, // 975
- 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 988
- 0x00, 0x00, 0xC6, 0xC6, 0xAA, 0xAA, 0xAA, 0x92, 0x82, 0x82, 0x00, 0x00, 0x00, // 1001
- 0x00, 0x00, 0x42, 0x62, 0x52, 0x52, 0x4A, 0x4A, 0x46, 0x42, 0x00, 0x00, 0x00, // 1014
- 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 1027
- 0x00, 0x00, 0x7C, 0x42, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 1040
- 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x06, 0x03, 0x00, // 1053
- 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, // 1066
- 0x00, 0x00, 0x3E, 0x40, 0x40, 0x38, 0x04, 0x02, 0x02, 0x7C, 0x00, 0x00, 0x00, // 1079
- 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 1092
- 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1105
- 0x00, 0x00, 0x81, 0x42, 0x42, 0x44, 0x24, 0x28, 0x38, 0x10, 0x00, 0x00, 0x00, // 1118
- 0x00, 0x00, 0x81, 0x81, 0x92, 0x5A, 0x5A, 0x6A, 0x66, 0x24, 0x00, 0x00, 0x00, // 1131
- 0x00, 0x00, 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81, 0x00, 0x00, 0x00, // 1144
- 0x00, 0x00, 0x82, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 1157
- 0x00, 0x00, 0xFE, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0xFE, 0x00, 0x00, 0x00, // 1170
- 0x1E, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1E, 0x00, // 1183
- 0x80, 0x40, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x02, 0x02, 0x01, 0x00, // 1196
- 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x78, 0x00, // 1209
- 0x00, 0x08, 0x08, 0x18, 0x14, 0x24, 0x24, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, // 1222
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, // 1235
- 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 1248
- 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1261
- 0x40, 0x40, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x62, 0x5C, 0x00, 0x00, 0x00, // 1274
- 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x40, 0x40, 0x20, 0x1E, 0x00, 0x00, 0x00, // 1287
- 0x02, 0x02, 0x02, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1300
- 0x00, 0x00, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1313
- 0x1E, 0x20, 0x20, 0xFE, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 1326
- 0x00, 0x00, 0x00, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x02, 0x3C, // 1339
- 0x40, 0x40, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 1352
- 0x18, 0x18, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1365
- 0x18, 0x18, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x70, // 1378
- 0x40, 0x40, 0x40, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, // 1391
- 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1404
- 0x00, 0x00, 0x00, 0xB6, 0xDA, 0x92, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, // 1417
- 0x00, 0x00, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 1430
- 0x00, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1443
- 0x00, 0x00, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x62, 0x5C, 0x40, 0x40, 0x40, // 1456
- 0x00, 0x00, 0x00, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x02, 0x02, // 1469
- 0x00, 0x00, 0x00, 0x5C, 0x64, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 1482
- 0x00, 0x00, 0x00, 0x3C, 0x40, 0x60, 0x18, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 1495
- 0x00, 0x00, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, 0x00, // 1508
- 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1521
- 0x00, 0x00, 0x00, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, // 1534
- 0x00, 0x00, 0x00, 0x81, 0x91, 0x5A, 0x5A, 0x6A, 0x24, 0x24, 0x00, 0x00, 0x00, // 1547
- 0x00, 0x00, 0x00, 0x42, 0x24, 0x18, 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, 0x00, // 1560
- 0x00, 0x00, 0x00, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x10, 0x30, 0xE0, // 1573
- 0x00, 0x00, 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, 0x00, 0x00, // 1586
- 0x1C, 0x10, 0x10, 0x10, 0x10, 0x60, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, // 1599
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // 1612
- 0x30, 0x08, 0x08, 0x08, 0x08, 0x06, 0x08, 0x08, 0x08, 0x08, 0x08, 0x30, 0x00, // 1625
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, // 1638
- 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 1651
- 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x3E, 0x04, 0x02, 0x06, // 1664
- 0x00, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1677
- 0x08, 0x10, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1690
- 0x18, 0x24, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1703
- 0x00, 0x24, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1716
- 0x10, 0x08, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1729
- 0x10, 0x28, 0x10, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1742
- 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x40, 0x40, 0x20, 0x1E, 0x08, 0x04, 0x0C, // 1755
- 0x18, 0x24, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1768
- 0x00, 0x12, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1781
- 0x10, 0x08, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1794
- 0x00, 0x24, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1807
- 0x18, 0x24, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1820
- 0x10, 0x08, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1833
- 0x24, 0x00, 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 1846
- 0x10, 0x28, 0x10, 0x28, 0x28, 0x24, 0x44, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 1859
- 0x08, 0x10, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 1872
- 0x00, 0x00, 0x00, 0xFC, 0x12, 0x12, 0x7E, 0x90, 0x90, 0x6E, 0x00, 0x00, 0x00, // 1885
- 0x00, 0x00, 0x0F, 0x18, 0x18, 0x28, 0x2E, 0x78, 0x48, 0x8F, 0x00, 0x00, 0x00, // 1898
- 0x18, 0x24, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1911
- 0x00, 0x24, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1924
- 0x20, 0x10, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1937
- 0x18, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1950
- 0x20, 0x10, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1963
- 0x00, 0x24, 0x00, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x10, 0x30, 0xE0, // 1976
- 0x24, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 1989
- 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 2002
- 0x00, 0x08, 0x1C, 0x28, 0x48, 0x48, 0x48, 0x68, 0x1C, 0x08, 0x00, 0x00, 0x00, // 2015
- 0x00, 0x0E, 0x10, 0x10, 0x10, 0x38, 0x10, 0x10, 0x20, 0x3E, 0x00, 0x00, 0x00, // 2028
- 0x00, 0x81, 0x42, 0x24, 0x18, 0x7C, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, // 2041
- 0x00, 0xE0, 0x90, 0x90, 0xE0, 0x96, 0xBC, 0x94, 0x92, 0x9E, 0x00, 0x00, 0x00, // 2054
- 0x0E, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xE0, // 2067
- 0x08, 0x10, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 2080
- 0x08, 0x10, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 2093
- 0x08, 0x10, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 2106
- 0x08, 0x10, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 2119
- 0x14, 0x28, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 2132
- 0x14, 0x28, 0x42, 0x62, 0x52, 0x52, 0x4A, 0x4A, 0x46, 0x42, 0x00, 0x00, 0x00, // 2145
- 0x00, 0x78, 0x08, 0x38, 0x48, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2158
- 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2171
- 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x42, 0x3E, 0x00, // 2184
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // 2197
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 2210
- 0x00, 0xC4, 0x48, 0x48, 0x50, 0x37, 0x21, 0x43, 0x44, 0x87, 0x00, 0x00, 0x00, // 2223
- 0x00, 0xC4, 0x48, 0x48, 0x50, 0x22, 0x26, 0x4A, 0x4F, 0x82, 0x00, 0x00, 0x00, // 2236
- 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // 2249
- 0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x48, 0x24, 0x12, 0x00, 0x00, 0x00, 0x00, // 2262
- 0x00, 0x00, 0x00, 0x00, 0x48, 0x24, 0x12, 0x24, 0x48, 0x00, 0x00, 0x00, 0x00, // 2275
- 0x94, 0x00, 0x00, 0x94, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x94, 0x00, 0x00, // 2288
- 0x49, 0x94, 0x00, 0x49, 0x94, 0x49, 0x00, 0x94, 0x49, 0x94, 0x49, 0x00, 0x94, // 2301
- 0xFF, 0x94, 0x94, 0xFF, 0x94, 0xFF, 0x94, 0x94, 0xFF, 0x94, 0xFF, 0x94, 0x94, // 2314
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2327
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2340
- 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, // 2353
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2366
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2379
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, // 2392
- 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, // 2405
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2418
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, // 2431
- 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, // 2444
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2457
- 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // 2470
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2483
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2496
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2509
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2522
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2535
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2548
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2561
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, // 2574
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2587
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, // 2600
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, // 2613
- 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2626
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, // 2639
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, // 2652
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2665
- 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, // 2678
- 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2691
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2704
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, // 2717
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2730
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2743
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, // 2756
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, // 2769
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2782
- 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2795
- 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, // 2808
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2821
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2834
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 2847
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 2860
- 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, // 2873
- 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, // 2886
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2899
- 0x00, 0x00, 0x00, 0x31, 0x49, 0x86, 0x84, 0x84, 0x8A, 0x71, 0x00, 0x00, 0x00, // 2912
- 0x38, 0x48, 0x48, 0x50, 0x50, 0x58, 0x44, 0x42, 0x42, 0x5C, 0x00, 0x00, 0x00, // 2925
- 0x00, 0x00, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 2938
- 0x00, 0x00, 0x00, 0x7F, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, // 2951
- 0x00, 0x00, 0xFF, 0x40, 0x20, 0x10, 0x10, 0x20, 0x40, 0xFF, 0x00, 0x00, 0x00, // 2964
- 0x00, 0x00, 0x00, 0x7F, 0x84, 0x84, 0x84, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, // 2977
- 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x5A, 0x40, 0x40, 0x40, // 2990
- 0x00, 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 3003
- 0x00, 0x00, 0x10, 0x7C, 0x92, 0x92, 0x92, 0x92, 0x7C, 0x10, 0x00, 0x00, 0x00, // 3016
- 0x00, 0x00, 0x38, 0x44, 0x82, 0xBA, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 3029
- 0x00, 0x00, 0x7C, 0xC6, 0x82, 0x82, 0x82, 0x84, 0x44, 0xEE, 0x00, 0x00, 0x00, // 3042
- 0x38, 0x40, 0x60, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 3055
- 0x00, 0x00, 0x00, 0x00, 0x66, 0x99, 0x99, 0x99, 0x66, 0x00, 0x00, 0x00, 0x00, // 3068
- 0x10, 0x10, 0x10, 0x7C, 0x92, 0x91, 0x91, 0x91, 0x92, 0x7C, 0x10, 0x10, 0x10, // 3081
- 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x7C, 0x40, 0x60, 0x1E, 0x00, 0x00, 0x00, // 3094
- 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, // 3107
- 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // 3120
- 0x00, 0x00, 0x00, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x00, 0xFE, 0x00, 0x00, 0x00, // 3133
- 0x00, 0x00, 0x40, 0x30, 0x08, 0x06, 0x08, 0x30, 0x40, 0x00, 0x7E, 0x00, 0x00, // 3146
- 0x00, 0x00, 0x02, 0x0C, 0x10, 0x60, 0x10, 0x0C, 0x02, 0x00, 0x7E, 0x00, 0x00, // 3159
- 0x0C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 3172
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x60, // 3185
- 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 3198
- 0x00, 0x00, 0x00, 0x00, 0x72, 0x4E, 0x00, 0x72, 0x4E, 0x00, 0x00, 0x00, 0x00, // 3211
- 0x00, 0x10, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3224
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 3237
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 3250
- 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0xC4, 0x28, 0x28, 0x18, 0x10, 0x00, // 3263
- 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3276
- 0x00, 0x3C, 0x04, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3289
- 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 3302
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // 3315
-};
+#include "precomp.h"
+
+USHORT AT_Initialization[] =
+{
+ 0x10 | CMD_STREAM_READ, // Major Command = 0x10. Minor Command = 0x08.
+ 0x3DA, // Index Status 1 Register Port Address
+
+ //
+ // This Stream performs a USHORT Array Indexed Write at port 0x3C0
+ //
+ 0x20 | 0x01, // Major Command = 0x20. Minor Command = 0x01.
+ 0x3C0, // Attribute Controller Data Register
+ 0x10, // Loop Count = 16 (Number of Pallette Entries)
+ 0x0, // Index to select (Index = 0, palettes)
+ 0x00, // Palette 0
+ 0x01, // Palette 1
+ 0x02, // Palette 2
+ 0x03, // Palette 3
+ 0x04, // Palette 4
+ 0x05, // Palette 5
+ 0x06, // Palette 6
+ 0x07, // Palette 7
+ 0x08, // Palette 8
+ 0x09, // Palette 9
+ 0x0A, // Palette 10
+ 0x0B, // Palette 11
+ 0x0C, // Palette 12
+ 0x0D, // Palette 13
+ 0x0E, // Palette 14
+ 0x0F, // Palette 15
+
+ //
+ // This Stream performs a UCHAR READ of port 0x3DA
+ //
+ 0x10 | CMD_STREAM_READ, // Major Command = 0x10. Minor Command = 0x08.
+ 0x3DA, // Index Status 1 Register Port Address
+
+ //
+ // This Stream performs a UCHAR WRITE of value 0x20 at port 0x3C0
+ //
+ 0x10 | CMD_STREAM_WRITE, // Major Command = 0x10. Minor Command = 0x00.
+ 0x3C0, // Attribute Controller Data Register
+ 0x20, // Set Palette Address Source
+
+ //
+ // End of Stream Marker
+ //
+ 0x0 // End of command stream
+};
+
+UCHAR FontData[256 * 13] =
+{
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 0
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 13
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 26
+ 0x18, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 39
+ 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+ 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+ 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+ 0x10, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 91
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, // 104
+ 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
+ 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 130
+ 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 143
+ 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 156
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, // 169
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 182
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 195
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 208
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 221
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 234
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 247
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 260
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 273
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 286
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 299
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 312
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 325
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 338
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 351
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 364
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 377
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 390
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 403
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 416
+ 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 429
+ 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 442
+ 0x00, 0x14, 0x14, 0x14, 0x7F, 0x28, 0xFE, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, // 455
+ 0x10, 0x3C, 0x50, 0x50, 0x70, 0x38, 0x1C, 0x14, 0x14, 0x78, 0x10, 0x00, 0x00, // 468
+ 0x00, 0x61, 0x92, 0x94, 0x68, 0x18, 0x16, 0x29, 0x49, 0x86, 0x00, 0x00, 0x00, // 481
+ 0x00, 0x18, 0x24, 0x24, 0x38, 0x71, 0x89, 0x8E, 0xC6, 0x7E, 0x00, 0x00, 0x00, // 494
+ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 507
+ 0x06, 0x08, 0x10, 0x30, 0x20, 0x20, 0x20, 0x20, 0x30, 0x10, 0x08, 0x06, 0x00, // 520
+ 0x60, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x10, 0x60, 0x00, // 533
+ 0x00, 0x10, 0x52, 0x24, 0x3C, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 546
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 559
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, // 572
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 585
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, // 598
+ 0x01, 0x02, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, // 611
+ 0x00, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x3C, 0x00, 0x00, 0x00, // 624
+ 0x00, 0x30, 0xD0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, // 637
+ 0x00, 0x78, 0x04, 0x04, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, // 650
+ 0x00, 0x78, 0x04, 0x04, 0x08, 0x30, 0x0C, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 663
+ 0x00, 0x08, 0x18, 0x28, 0x28, 0x48, 0x88, 0xFC, 0x08, 0x08, 0x00, 0x00, 0x00, // 676
+ 0x00, 0x3C, 0x20, 0x20, 0x38, 0x04, 0x04, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, // 689
+ 0x00, 0x1C, 0x20, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, // 702
+ 0x00, 0x7E, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x00, 0x00, 0x00, // 715
+ 0x00, 0x3C, 0x42, 0x42, 0x24, 0x3C, 0x46, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 728
+ 0x00, 0x38, 0x44, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x04, 0x38, 0x00, 0x00, 0x00, // 741
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, // 754
+ 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, // 767
+ 0x00, 0x00, 0x00, 0x02, 0x0C, 0x10, 0x60, 0x10, 0x0C, 0x02, 0x00, 0x00, 0x00, // 780
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // 793
+ 0x00, 0x00, 0x00, 0x40, 0x30, 0x08, 0x06, 0x08, 0x30, 0x40, 0x00, 0x00, 0x00, // 806
+ 0x00, 0x7C, 0x42, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 819
+ 0x00, 0x3C, 0x62, 0xDE, 0xB2, 0xA2, 0xA6, 0x9B, 0x44, 0x3C, 0x00, 0x00, 0x00, // 832
+ 0x00, 0x00, 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 845
+ 0x00, 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x42, 0x42, 0x42, 0x7C, 0x00, 0x00, 0x00, // 858
+ 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x3E, 0x00, 0x00, 0x00, // 871
+ 0x00, 0x00, 0x78, 0x44, 0x42, 0x42, 0x42, 0x42, 0x44, 0x78, 0x00, 0x00, 0x00, // 884
+ 0x00, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 897
+ 0x00, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 910
+ 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x8E, 0x82, 0x42, 0x3E, 0x00, 0x00, 0x00, // 923
+ 0x00, 0x00, 0x42, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 936
+ 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7C, 0x00, 0x00, 0x00, // 949
+ 0x00, 0x00, 0x3C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 962
+ 0x00, 0x00, 0x42, 0x44, 0x48, 0x70, 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, // 975
+ 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 988
+ 0x00, 0x00, 0xC6, 0xC6, 0xAA, 0xAA, 0xAA, 0x92, 0x82, 0x82, 0x00, 0x00, 0x00, // 1001
+ 0x00, 0x00, 0x42, 0x62, 0x52, 0x52, 0x4A, 0x4A, 0x46, 0x42, 0x00, 0x00, 0x00, // 1014
+ 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 1027
+ 0x00, 0x00, 0x7C, 0x42, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 1040
+ 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x06, 0x03, 0x00, // 1053
+ 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, // 1066
+ 0x00, 0x00, 0x3E, 0x40, 0x40, 0x38, 0x04, 0x02, 0x02, 0x7C, 0x00, 0x00, 0x00, // 1079
+ 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 1092
+ 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1105
+ 0x00, 0x00, 0x81, 0x42, 0x42, 0x44, 0x24, 0x28, 0x38, 0x10, 0x00, 0x00, 0x00, // 1118
+ 0x00, 0x00, 0x81, 0x81, 0x92, 0x5A, 0x5A, 0x6A, 0x66, 0x24, 0x00, 0x00, 0x00, // 1131
+ 0x00, 0x00, 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81, 0x00, 0x00, 0x00, // 1144
+ 0x00, 0x00, 0x82, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 1157
+ 0x00, 0x00, 0xFE, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0xFE, 0x00, 0x00, 0x00, // 1170
+ 0x1E, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1E, 0x00, // 1183
+ 0x80, 0x40, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x02, 0x02, 0x01, 0x00, // 1196
+ 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x78, 0x00, // 1209
+ 0x00, 0x08, 0x08, 0x18, 0x14, 0x24, 0x24, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, // 1222
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, // 1235
+ 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 1248
+ 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1261
+ 0x40, 0x40, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x62, 0x5C, 0x00, 0x00, 0x00, // 1274
+ 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x40, 0x40, 0x20, 0x1E, 0x00, 0x00, 0x00, // 1287
+ 0x02, 0x02, 0x02, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1300
+ 0x00, 0x00, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1313
+ 0x1E, 0x20, 0x20, 0xFE, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 1326
+ 0x00, 0x00, 0x00, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x02, 0x3C, // 1339
+ 0x40, 0x40, 0x40, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 1352
+ 0x18, 0x18, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1365
+ 0x18, 0x18, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x70, // 1378
+ 0x40, 0x40, 0x40, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, // 1391
+ 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1404
+ 0x00, 0x00, 0x00, 0xB6, 0xDA, 0x92, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, // 1417
+ 0x00, 0x00, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 1430
+ 0x00, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1443
+ 0x00, 0x00, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x62, 0x5C, 0x40, 0x40, 0x40, // 1456
+ 0x00, 0x00, 0x00, 0x3A, 0x46, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x02, 0x02, 0x02, // 1469
+ 0x00, 0x00, 0x00, 0x5C, 0x64, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 1482
+ 0x00, 0x00, 0x00, 0x3C, 0x40, 0x60, 0x18, 0x04, 0x04, 0x78, 0x00, 0x00, 0x00, // 1495
+ 0x00, 0x00, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, 0x00, // 1508
+ 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1521
+ 0x00, 0x00, 0x00, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, // 1534
+ 0x00, 0x00, 0x00, 0x81, 0x91, 0x5A, 0x5A, 0x6A, 0x24, 0x24, 0x00, 0x00, 0x00, // 1547
+ 0x00, 0x00, 0x00, 0x42, 0x24, 0x18, 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, 0x00, // 1560
+ 0x00, 0x00, 0x00, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x10, 0x30, 0xE0, // 1573
+ 0x00, 0x00, 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, 0x00, 0x00, // 1586
+ 0x1C, 0x10, 0x10, 0x10, 0x10, 0x60, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, // 1599
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // 1612
+ 0x30, 0x08, 0x08, 0x08, 0x08, 0x06, 0x08, 0x08, 0x08, 0x08, 0x08, 0x30, 0x00, // 1625
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, // 1638
+ 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 1651
+ 0x00, 0x00, 0x3E, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x3E, 0x04, 0x02, 0x06, // 1664
+ 0x00, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1677
+ 0x08, 0x10, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1690
+ 0x18, 0x24, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1703
+ 0x00, 0x24, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1716
+ 0x10, 0x08, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1729
+ 0x10, 0x28, 0x10, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 1742
+ 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x40, 0x40, 0x20, 0x1E, 0x08, 0x04, 0x0C, // 1755
+ 0x18, 0x24, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1768
+ 0x00, 0x12, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1781
+ 0x10, 0x08, 0x00, 0x3C, 0x22, 0x42, 0x7E, 0x40, 0x40, 0x3E, 0x00, 0x00, 0x00, // 1794
+ 0x00, 0x24, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1807
+ 0x18, 0x24, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1820
+ 0x10, 0x08, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 1833
+ 0x24, 0x00, 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 1846
+ 0x10, 0x28, 0x10, 0x28, 0x28, 0x24, 0x44, 0x7E, 0x42, 0x81, 0x00, 0x00, 0x00, // 1859
+ 0x08, 0x10, 0x7E, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, // 1872
+ 0x00, 0x00, 0x00, 0xFC, 0x12, 0x12, 0x7E, 0x90, 0x90, 0x6E, 0x00, 0x00, 0x00, // 1885
+ 0x00, 0x00, 0x0F, 0x18, 0x18, 0x28, 0x2E, 0x78, 0x48, 0x8F, 0x00, 0x00, 0x00, // 1898
+ 0x18, 0x24, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1911
+ 0x00, 0x24, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1924
+ 0x20, 0x10, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 1937
+ 0x18, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1950
+ 0x20, 0x10, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 1963
+ 0x00, 0x24, 0x00, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x10, 0x30, 0xE0, // 1976
+ 0x24, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 1989
+ 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 2002
+ 0x00, 0x08, 0x1C, 0x28, 0x48, 0x48, 0x48, 0x68, 0x1C, 0x08, 0x00, 0x00, 0x00, // 2015
+ 0x00, 0x0E, 0x10, 0x10, 0x10, 0x38, 0x10, 0x10, 0x20, 0x3E, 0x00, 0x00, 0x00, // 2028
+ 0x00, 0x81, 0x42, 0x24, 0x18, 0x7C, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, // 2041
+ 0x00, 0xE0, 0x90, 0x90, 0xE0, 0x96, 0xBC, 0x94, 0x92, 0x9E, 0x00, 0x00, 0x00, // 2054
+ 0x0E, 0x10, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xE0, // 2067
+ 0x08, 0x10, 0x00, 0x38, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3E, 0x00, 0x00, 0x00, // 2080
+ 0x08, 0x10, 0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, // 2093
+ 0x08, 0x10, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 2106
+ 0x08, 0x10, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x00, 0x00, 0x00, // 2119
+ 0x14, 0x28, 0x00, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, // 2132
+ 0x14, 0x28, 0x42, 0x62, 0x52, 0x52, 0x4A, 0x4A, 0x46, 0x42, 0x00, 0x00, 0x00, // 2145
+ 0x00, 0x78, 0x08, 0x38, 0x48, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2158
+ 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2171
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x42, 0x3E, 0x00, // 2184
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // 2197
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 2210
+ 0x00, 0xC4, 0x48, 0x48, 0x50, 0x37, 0x21, 0x43, 0x44, 0x87, 0x00, 0x00, 0x00, // 2223
+ 0x00, 0xC4, 0x48, 0x48, 0x50, 0x22, 0x26, 0x4A, 0x4F, 0x82, 0x00, 0x00, 0x00, // 2236
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // 2249
+ 0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x48, 0x24, 0x12, 0x00, 0x00, 0x00, 0x00, // 2262
+ 0x00, 0x00, 0x00, 0x00, 0x48, 0x24, 0x12, 0x24, 0x48, 0x00, 0x00, 0x00, 0x00, // 2275
+ 0x94, 0x00, 0x00, 0x94, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x94, 0x00, 0x00, // 2288
+ 0x49, 0x94, 0x00, 0x49, 0x94, 0x49, 0x00, 0x94, 0x49, 0x94, 0x49, 0x00, 0x94, // 2301
+ 0xFF, 0x94, 0x94, 0xFF, 0x94, 0xFF, 0x94, 0x94, 0xFF, 0x94, 0xFF, 0x94, 0x94, // 2314
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2327
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2340
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, // 2353
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2366
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2379
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, // 2392
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, // 2405
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2418
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x14, 0x14, 0x14, // 2431
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, // 2444
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2457
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // 2470
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2483
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2496
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2509
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2522
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2535
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2548
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2561
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, // 2574
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2587
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, // 2600
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, // 2613
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2626
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, // 2639
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0x14, 0x14, 0x14, // 2652
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2665
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, // 2678
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 2691
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2704
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, // 2717
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2730
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2743
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, // 2756
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, // 2769
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2782
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // 2795
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, // 2808
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2821
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 2834
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 2847
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 2860
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, // 2873
+ 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, // 2886
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2899
+ 0x00, 0x00, 0x00, 0x31, 0x49, 0x86, 0x84, 0x84, 0x8A, 0x71, 0x00, 0x00, 0x00, // 2912
+ 0x38, 0x48, 0x48, 0x50, 0x50, 0x58, 0x44, 0x42, 0x42, 0x5C, 0x00, 0x00, 0x00, // 2925
+ 0x00, 0x00, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 2938
+ 0x00, 0x00, 0x00, 0x7F, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, // 2951
+ 0x00, 0x00, 0xFF, 0x40, 0x20, 0x10, 0x10, 0x20, 0x40, 0xFF, 0x00, 0x00, 0x00, // 2964
+ 0x00, 0x00, 0x00, 0x7F, 0x84, 0x84, 0x84, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, // 2977
+ 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x5A, 0x40, 0x40, 0x40, // 2990
+ 0x00, 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // 3003
+ 0x00, 0x00, 0x10, 0x7C, 0x92, 0x92, 0x92, 0x92, 0x7C, 0x10, 0x00, 0x00, 0x00, // 3016
+ 0x00, 0x00, 0x38, 0x44, 0x82, 0xBA, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, // 3029
+ 0x00, 0x00, 0x7C, 0xC6, 0x82, 0x82, 0x82, 0x84, 0x44, 0xEE, 0x00, 0x00, 0x00, // 3042
+ 0x38, 0x40, 0x60, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x00, // 3055
+ 0x00, 0x00, 0x00, 0x00, 0x66, 0x99, 0x99, 0x99, 0x66, 0x00, 0x00, 0x00, 0x00, // 3068
+ 0x10, 0x10, 0x10, 0x7C, 0x92, 0x91, 0x91, 0x91, 0x92, 0x7C, 0x10, 0x10, 0x10, // 3081
+ 0x00, 0x00, 0x00, 0x1E, 0x20, 0x40, 0x7C, 0x40, 0x60, 0x1E, 0x00, 0x00, 0x00, // 3094
+ 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, // 3107
+ 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // 3120
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x00, 0xFE, 0x00, 0x00, 0x00, // 3133
+ 0x00, 0x00, 0x40, 0x30, 0x08, 0x06, 0x08, 0x30, 0x40, 0x00, 0x7E, 0x00, 0x00, // 3146
+ 0x00, 0x00, 0x02, 0x0C, 0x10, 0x60, 0x10, 0x0C, 0x02, 0x00, 0x7E, 0x00, 0x00, // 3159
+ 0x0C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 3172
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x60, // 3185
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // 3198
+ 0x00, 0x00, 0x00, 0x00, 0x72, 0x4E, 0x00, 0x72, 0x4E, 0x00, 0x00, 0x00, 0x00, // 3211
+ 0x00, 0x10, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3224
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 3237
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 3250
+ 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0xC4, 0x28, 0x28, 0x18, 0x10, 0x00, // 3263
+ 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3276
+ 0x00, 0x3C, 0x04, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3289
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 3302
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // 3315
+};
diff --git a/reactos/drivers/base/bootvid/bootvid.c b/reactos/drivers/base/bootvid/i386/bootvid.c
similarity index 100%
rename from reactos/drivers/base/bootvid/bootvid.c
rename to reactos/drivers/base/bootvid/i386/bootvid.c
diff --git a/reactos/drivers/base/bootvid/vga.c b/reactos/drivers/base/bootvid/i386/vga.c
similarity index 96%
rename from reactos/drivers/base/bootvid/vga.c
rename to reactos/drivers/base/bootvid/i386/vga.c
index a3433ef13f7..83405ee13a9 100644
--- a/reactos/drivers/base/bootvid/vga.c
+++ b/reactos/drivers/base/bootvid/i386/vga.c
@@ -1,1274 +1,1274 @@
-#include "precomp.h"
-
-/* GLOBALS *******************************************************************/
-
-ULONG ScrollRegion[4] =
-{
- 0,
- 0,
- 640 - 1,
- 480 - 1
-};
-UCHAR lMaskTable[8] =
-{
- (1 << 8) - (1 << 0),
- (1 << 7) - (1 << 0),
- (1 << 6) - (1 << 0),
- (1 << 5) - (1 << 0),
- (1 << 4) - (1 << 0),
- (1 << 3) - (1 << 0),
- (1 << 2) - (1 << 0),
- (1 << 1) - (1 << 0)
-};
-UCHAR rMaskTable[8] =
-{
- (1 << 7),
- (1 << 7)+ (1 << 6),
- (1 << 7)+ (1 << 6) + (1 << 5),
- (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4),
- (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3),
- (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2),
- (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1),
- (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1) +
- (1 << 0),
-};
-UCHAR PixelMask[8] =
-{
- (1 << 7),
- (1 << 6),
- (1 << 5),
- (1 << 4),
- (1 << 3),
- (1 << 2),
- (1 << 1),
- (1 << 0),
-};
-ULONG lookup[16] =
-{
- 0x0000,
- 0x0100,
- 0x1000,
- 0x1100,
- 0x0001,
- 0x0101,
- 0x1001,
- 0x1101,
- 0x0010,
- 0x0110,
- 0x1010,
- 0x1110,
- 0x0011,
- 0x0111,
- 0x1011,
- 0x1111,
-};
-
-ULONG TextColor = 0xF;
-ULONG curr_x = 0;
-ULONG curr_y = 0;
-BOOLEAN NextLine = FALSE;
-ULONG_PTR VgaRegisterBase = 0;
-ULONG_PTR VgaBase = 0;
-
-/* PRIVATE FUNCTIONS *********************************************************/
-
-VOID
-NTAPI
-ReadWriteMode(UCHAR Mode)
-{
- UCHAR Value;
-
- /* Switch to graphics mode register */
- WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CE, 5);
-
- /* Get the current register value, minus the current mode */
- Value = READ_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF) & 0xF4;
-
- /* Set the new mode */
- WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF, Mode | Value);
-}
-
-VOID
-NTAPI
-__outpb(IN ULONG Port,
- IN ULONG Value)
-{
- /* Write to the VGA Register */
- WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + Port, (UCHAR)Value);
-}
-
-VOID
-NTAPI
-__outpw(IN ULONG Port,
- IN ULONG Value)
-{
- /* Write to the VGA Register */
- WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + Port), (USHORT)Value);
-}
-
-VOID
-NTAPI
-SetPixel(IN ULONG Left,
- IN ULONG Top,
- IN UCHAR Color)
-{
- PUCHAR PixelPosition;
-
- /* Calculate the pixel position. */
- PixelPosition = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80);
-
- /* Switch to mode 10 */
- ReadWriteMode(10);
-
- /* Clear the 4 planes (we're already in unchained mode here) */
- __outpw(0x3C4, 0xF02);
-
- /* Select the color don't care register */
- __outpw(0x3CE, 7);
-
- /* Select the bitmask register and write the mask */
- __outpw(0x3CE, (PixelMask[Left & 7] << 8) | 8);
-
- /* Read the current pixel value and add our color */
- WRITE_REGISTER_UCHAR(PixelPosition,
- READ_REGISTER_UCHAR(PixelPosition) & Color);
-}
-
-VOID
-NTAPI
-DisplayCharacter(CHAR Character,
- ULONG Left,
- ULONG Top,
- ULONG TextColor,
- ULONG BackTextColor)
-{
- PUCHAR FontChar;
- ULONG i, j, XOffset;
-
- /* Get the font line for this character */
- FontChar = &FontData[Character * 13 - Top];
-
- /* Loop each pixel height */
- i = 13;
- do
- {
- /* Loop each pixel width */
- j = 128;
- XOffset = Left;
- do
- {
- /* Check if we should draw this pixel */
- if (FontChar[Top] & (UCHAR)j)
- {
- /* We do, use the given Text Color */
- SetPixel(XOffset, Top, (UCHAR)TextColor);
- }
- else if (BackTextColor < 16)
- {
- /* This is a background pixel. We're drawing it unless it's */
- /* transparent. */
- SetPixel(XOffset, Top, (UCHAR)BackTextColor);
- }
-
- /* Increase X Offset */
- XOffset++;
- } while (j >>= 1);
-
- /* Move to the next Y ordinate */
- Top++;
- } while (--i);
-}
-
-VOID
-NTAPI
-DisplayStringXY(PUCHAR String,
- ULONG Left,
- ULONG Top,
- ULONG TextColor,
- ULONG BackColor)
-{
- /* Loop every character */
- while (*String)
- {
- /* Display a character */
- DisplayCharacter(*String, Left, Top, TextColor, BackColor);
-
- /* Move to next character and next position */
- String++;
- Left += 8;
- }
-}
-
-VOID
-NTAPI
-SetPaletteEntryRGB(IN ULONG Id,
- IN ULONG Rgb)
-{
- PCHAR Colors = (PCHAR)&Rgb;
-
- /* Set the palette index */
- __outpb(0x3C8, (UCHAR)Id);
-
- /* Set RGB colors */
- __outpb(0x3C9, Colors[2] >> 2);
- __outpb(0x3C9, Colors[1] >> 2);
- __outpb(0x3C9, Colors[0] >> 2);
-}
-
-VOID
-NTAPI
-InitPaletteWithTable(IN PULONG Table,
- IN ULONG Count)
-{
- ULONG i;
- PULONG Entry = Table;
-
- /* Loop every entry */
- for (i = 0; i < Count; i++, Entry++)
- {
- /* Set the entry */
- SetPaletteEntryRGB(i, *Entry);
- }
-}
-
-VOID
-NTAPI
-SetPaletteEntry(IN ULONG Id,
- IN ULONG PaletteEntry)
-{
- /* Set the palette index */
- __outpb(0x3C8, (UCHAR)Id);
-
- /* Set RGB colors */
- __outpb(0x3C9, PaletteEntry & 0xFF);
- __outpb(0x3C9, (PaletteEntry >>= 8) & 0xFF);
- __outpb(0x3C9, (PaletteEntry >> 8) & 0xFF);
-}
-
-VOID
-NTAPI
-InitializePalette(VOID)
-{
- ULONG PaletteEntry[16] = {0,
- 0x20,
- 0x2000,
- 0x2020,
- 0x200000,
- 0x200020,
- 0x202000,
- 0x202020,
- 0x303030,
- 0x3F,
- 0x3F00,
- 0x3F3F,
- 0x3F0000,
- 0x3F003F,
- 0x3F3F00,
- 0x3F3F3F};
- ULONG i;
-
- /* Loop all the entries and set their palettes */
- for (i = 0; i < 16; i++) SetPaletteEntry(i, PaletteEntry[i]);
-}
-
-VOID
-NTAPI
-VgaScroll(ULONG Scroll)
-{
- ULONG Top;
- ULONG SourceOffset, DestOffset;
- ULONG Offset;
- ULONG i, j;
-
- /* Set memory positions of the scroll */
- SourceOffset = VgaBase + (ScrollRegion[1] * 80) + (ScrollRegion[0] >> 3);
- DestOffset = SourceOffset + (Scroll * 80);
-
- /* Clear the 4 planes */
- __outpw(0x3C4, 0xF02);
-
- /* Set the bitmask to 0xFF for all 4 planes */
- __outpw(0x3CE, 0xFF08);
-
- /* Set Mode 1 */
- ReadWriteMode(1);
-
- /* Save top and check if it's above the bottom */
- Top = ScrollRegion[1];
- if (Top > ScrollRegion[3]) return;
-
- /* Start loop */
- do
- {
- /* Set number of bytes to loop and start offset */
- Offset = ScrollRegion[0] >> 3;
- j = SourceOffset;
-
- /* Check if this is part of the scroll region */
- if (Offset <= (ScrollRegion[2] >> 3))
- {
- /* Update position */
- i = DestOffset - SourceOffset;
-
- /* Loop the X axis */
- do
- {
- /* Write value in the new position so that we can do the scroll */
- WRITE_REGISTER_UCHAR((PUCHAR)j,
- READ_REGISTER_UCHAR((PUCHAR)j + i));
-
- /* Move to the next memory location to write to */
- j++;
-
- /* Move to the next byte in the region */
- Offset++;
-
- /* Make sure we don't go past the scroll region */
- } while (Offset <= (ScrollRegion[2] >> 3));
- }
-
- /* Move to the next line */
- SourceOffset += 80;
- DestOffset += 80;
-
- /* Increase top */
- Top++;
-
- /* Make sure we don't go past the scroll region */
- } while (Top <= ScrollRegion[3]);
-}
-
-VOID
-NTAPI
-PreserveRow(IN ULONG CurrentTop,
- IN ULONG TopDelta,
- IN BOOLEAN Direction)
-{
- PUCHAR Position1, Position2;
- ULONG Count;
-
- /* Clear the 4 planes */
- __outpw(0x3C4, 0xF02);
-
- /* Set the bitmask to 0xFF for all 4 planes */
- __outpw(0x3CE, 0xFF08);
-
- /* Set Mode 1 */
- ReadWriteMode(1);
-
- /* Check which way we're preserving */
- if (Direction)
- {
- /* Calculate the position in memory for the row */
- Position1 = (PUCHAR)VgaBase + CurrentTop * 80;
- Position2 = (PUCHAR)VgaBase + 0x9600;
- }
- else
- {
- /* Calculate the position in memory for the row */
- Position1 = (PUCHAR)VgaBase + 0x9600;
- Position2 = (PUCHAR)VgaBase + CurrentTop * 80;
- }
-
- /* Set the count and make sure it's above 0 */
- Count = TopDelta * 80;
- if (Count)
- {
- /* Loop every pixel */
- do
- {
- /* Write the data back on the other position */
- WRITE_REGISTER_UCHAR(Position1, READ_REGISTER_UCHAR(Position2));
-
- /* Increase both positions */
- Position2++;
- Position1++;
- } while (--Count);
- }
-}
-
-VOID
-NTAPI
-BitBlt(IN ULONG Left,
- IN ULONG Top,
- IN ULONG Width,
- IN ULONG Height,
- IN PUCHAR Buffer,
- IN ULONG BitsPerPixel,
- IN ULONG Delta)
-{
- ULONG LeftAnd, LeftShifted, LeftPlusOne, LeftPos;
- ULONG lMask, rMask;
- UCHAR NotlMask;
- ULONG Distance;
- ULONG DistanceMinusLeftBpp;
- ULONG SomeYesNoFlag, SomeYesNoFlag2;
- PUCHAR PixelPosition, m;
- PUCHAR i, k;
- ULONG j;
- ULONG x;
- ULONG Plane;
- UCHAR LeftArray[84];
- PUCHAR CurrentLeft;
- PUCHAR l;
- ULONG LoopCount;
- UCHAR pMask, PlaneShift;
- BOOLEAN Odd;
- UCHAR Value;
-
- /* Check if the buffer isn't 4bpp */
- if (BitsPerPixel != 4)
- {
- /* FIXME: TODO */
- DbgPrint("Unhandled BitBlt\n"
- "%lxx%lx @ (%lx,%lx)\n"
- "Bits Per Pixel %lx\n"
- "Buffer: %p. Delta: %lx\n",
- Width,
- Height,
- Left,
- Top,
- BitsPerPixel,
- Buffer,
- Delta);
- return;
- }
-
- /* Get the masks and other values */
- LeftAnd = Left & 0x7;
- lMask = lMaskTable[LeftAnd];
- Distance = Width + Left;
- rMask = rMaskTable[(Distance - 1) & 0x7];
- Left >>= 3;
-
- /* Set some values */
- SomeYesNoFlag = FALSE;
- SomeYesNoFlag2 = FALSE;
- Distance = (Distance - 1) >> 3;
- DistanceMinusLeftBpp = Distance - Left;
-
- /* Check if the distance is equal to the left position and add the masks */
- if (Left == Distance) lMask += rMask;
-
- /* Check if there's no distance offset */
- if (DistanceMinusLeftBpp)
- {
- /* Set the first flag on */
- SomeYesNoFlag = TRUE;
-
- /* Decrease offset and check if we still have one */
- if (--DistanceMinusLeftBpp)
- {
- /* Still have a distance offset */
- SomeYesNoFlag2 = TRUE;
- }
- }
-
- /* Calculate initial pixel position */
- PixelPosition = (PUCHAR)VgaBase + (Top * 80) + Left;
-
- /* Set loop buffer variable */
- i = Buffer;
-
- /* Switch to mode 0 */
- ReadWriteMode(0);
-
- /* Leave now if the height is 0 */
- if (Height <= 0) return;
-
- /* Set more weird values */
- CurrentLeft = &LeftArray[Left];
- NotlMask = ~(UCHAR)lMask;
- LeftPlusOne = Left + 1;
- LeftShifted = (lMask << 8) | 8;
- j = Height;
-
- /* Start the height loop */
- do
- {
- /* Start the plane loop */
- Plane = 0;
- do
- {
- /* Clear the current value */
- *CurrentLeft = 0;
- LoopCount = 0;
-
- /* Set the buffer loop variable for this loop */
- k = i;
-
- /* Calculate plane shift and pixel mask */
- PlaneShift = 1 << Plane;
- pMask = PixelMask[LeftAnd];
-
- /* Check if we have a width */
- if (Width > 0)
- {
- /* Loop it */
- l = CurrentLeft;
- x = Width;
- do
- {
- /* Check if we're odd and increase the loop count */
- Odd = LoopCount & 1 ? TRUE : FALSE;
- LoopCount++;
- if (Odd)
- {
- /* Check for the plane shift */
- if (*k & PlaneShift)
- {
- /* Write the pixel mask */
- *l |= pMask;
- }
-
- /* Increase buffer position */
- k++;
- }
- else
- {
- /* Check for plane shift */
- if ((*k >> 4) & PlaneShift)
- {
- /* Write the pixel mask */
- *l |= pMask;
- }
- }
-
- /* Shift the pixel mask */
- pMask >>= 1;
- if (!pMask)
- {
- /* Move to the next current left position and clear it */
- l++;
- *l = 0;
-
- /* Set the pixel mask to 0x80 */
- pMask = 0x80;
- }
- } while (--x);
- }
-
- /* Set the plane value */
- __outpw(0x3C4, (1 << (Plane + 8) | 2));
-
- /* Select the bitmask register and write the mask */
- __outpw(0x3CE, (USHORT)LeftShifted);
-
- /* Read the current Pixel value */
- Value = READ_REGISTER_UCHAR(PixelPosition);
-
- /* Add our mask */
- Value = (Value & NotlMask) | *CurrentLeft;
-
- /* Set current left for the loop, and write new pixel value */
- LeftPos = LeftPlusOne;
- WRITE_REGISTER_UCHAR(PixelPosition, Value);
-
- /* Set loop pixel position and check if we should loop */
- m = PixelPosition + 1;
- if (SomeYesNoFlag2)
- {
- /* Set the bitmask to 0xFF for all 4 planes */
- __outpw(0x3CE, 0xFF08);
-
- /* Check if we have any distance left */
- if (DistanceMinusLeftBpp > 0)
- {
- /* Start looping it */
- x = DistanceMinusLeftBpp;
- do
- {
- /* Write the value */
- WRITE_REGISTER_UCHAR(m, LeftArray[LeftPos]);
-
- /* Go to the next position */
- m++;
- LeftPos++;
- } while (--x);
- }
- }
-
- /* Check if the first flag is on */
- if (SomeYesNoFlag)
- {
- /* Set the mask value */
- __outpw(0x3CE, (rMask << 8) | 8);
-
- /* Read the current Pixel value */
- Value = READ_REGISTER_UCHAR(m);
-
- /* Add our mask */
- Value = (Value & ~(UCHAR)rMask) | LeftArray[LeftPos];
-
- /* Set current left for the loop, and write new pixel value */
- WRITE_REGISTER_UCHAR(m, Value);
- }
- } while (++Plane < 4);
-
- /* Update pixel position, buffer and height */
- PixelPosition += 80;
- i += Delta;
- } while (--j);
-}
-
-VOID
-NTAPI
-RleBitBlt(IN ULONG Left,
- IN ULONG Top,
- IN ULONG Width,
- IN ULONG Height,
- IN PUCHAR Buffer)
-{
- ULONG YDelta;
- ULONG x;
- ULONG RleValue, NewRleValue;
- ULONG Color, Color2;
- ULONG i, j;
- ULONG Code;
-
- /* Set Y height and current X value and start loop */
- YDelta = Top + Height - 1;
- x = Left;
- for (;;)
- {
- /* Get the current value and advance in the buffer */
- RleValue = *Buffer;
- Buffer++;
- if (RleValue)
- {
- /* Check if we've gone past the edge */
- if ((x + RleValue) > (Width + Left))
- {
- /* Fixeup the pixel value */
- RleValue = Left - x + Width;
- }
-
- /* Get the new value */
- NewRleValue = *Buffer;
-
- /* Get the two colors */
- Color = NewRleValue >> 4;
- Color2 = NewRleValue & 0xF;
-
- /* Increase buffer positition */
- Buffer++;
-
- /* Check if we need to do a fill */
- if (Color == Color2)
- {
- /* Do a fill and continue the loop */
- RleValue += x;
- VidSolidColorFill(x, YDelta, RleValue - 1, YDelta, (UCHAR)Color);
- x = RleValue;
- continue;
- }
-
- /* Check if the pixel value is 1 or below */
- if (RleValue > 1)
- {
- /* Set loop variables */
- i = (RleValue - 2) / 2 + 1;
- do
- {
- /* Set the pixels */
- SetPixel(x, YDelta, (UCHAR)Color);
- x++;
- SetPixel(x, YDelta, (UCHAR)Color2);
- x++;
-
- /* Decrease pixel value */
- RleValue -= 2;
- } while (--i);
- }
-
- /* Check if there is any value at all */
- if (RleValue)
- {
- /* Set the pixel and increase posititon */
- SetPixel(x, YDelta, (UCHAR)Color);
- x++;
- }
-
- /* Start over */
- continue;
- }
-
- /* Get the current pixel value */
- RleValue = *Buffer;
- Code = RleValue;
- switch (Code)
- {
- /* Case 0 */
- case 0:
-
- /* Set new x value, decrease distance and restart */
- x = Left;
- YDelta--;
- Buffer++;
- continue;
-
- /* Case 1 */
- case 1:
-
- /* Done */
- return;
-
- /* Case 2 */
- case 2:
-
- /* Set new x value, decrease distance and restart */
- Buffer++;
- x += *Buffer;
- Buffer++;
- YDelta -= *Buffer;
- Buffer++;
- continue;
-
- /* Other values */
- default:
-
- Buffer++;
- break;
- }
-
- /* Check if we've gone past the edge */
- if ((x + RleValue) > (Width + Left))
- {
- /* Set fixed up loop count */
- i = RleValue - Left - Width + x;
-
- /* Fixup pixel value */
- RleValue -= i;
- }
- else
- {
- /* Clear loop count */
- i = 0;
- }
-
- /* Check the value now */
- if (RleValue > 1)
- {
- /* Set loop variables */
- j = (RleValue - 2) / 2 + 1;
- do
- {
- /* Get the new value */
- NewRleValue = *Buffer;
-
- /* Get the two colors */
- Color = NewRleValue >> 4;
- Color2 = NewRleValue & 0xF;
-
- /* Increase buffer position */
- Buffer++;
-
- /* Set the pixels */
- SetPixel(x, YDelta, (UCHAR)Color);
- x++;
- SetPixel(x, YDelta, (UCHAR)Color2);
- x++;
-
- /* Decrease pixel value */
- RleValue -= 2;
- } while (--j);
- }
-
- /* Check if there is any value at all */
- if (RleValue)
- {
- /* Set the pixel and increase position */
- Color = *Buffer >> 4;
- Buffer++;
- SetPixel(x, YDelta, (UCHAR)Color);
- x++;
- i--;
- }
-
- /* Check loop count now */
- if ((LONG)i > 0)
- {
- /* Decrease it */
- i--;
-
- /* Set new position */
- Buffer = Buffer + (i / 2) + 1;
- }
-
- /* Check if we need to increase the buffer */
- if ((ULONG_PTR)Buffer & 1) Buffer++;
- }
-}
-
-/* PUBLIC FUNCTIONS **********************************************************/
-
-/*
- * @implemented
- */
-ULONG
-NTAPI
-VidSetTextColor(ULONG Color)
-{
- ULONG OldColor;
-
- /* Save the old color and set the new one */
- OldColor = TextColor;
- TextColor = Color;
- return OldColor;
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidDisplayStringXY(PUCHAR String,
- ULONG Left,
- ULONG Top,
- BOOLEAN Transparent)
-{
- ULONG BackColor;
-
- /* If the caller wanted transparent, then send the special value (16), else */
- /* use our default and call the helper routine. */
- BackColor = (Transparent) ? 16 : 14;
- DisplayStringXY(String, Left, Top, 12, BackColor);
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidSetScrollRegion(ULONG x1,
- ULONG y1,
- ULONG x2,
- ULONG y2)
-{
- /* Assert alignment */
- ASSERT((x1 & 0x7) == 0);
- ASSERT((x2 & 0x7) == 7);
-
- /* Set Scroll Region */
- ScrollRegion[0] = x1;
- ScrollRegion[1] = y1;
- ScrollRegion[2] = x2;
- ScrollRegion[3] = y2;
-
- /* Set current X and Y */
- curr_x = x1;
- curr_y = y1;
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidCleanUp(VOID)
-{
- /* Select bit mask register */
- WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CE, 8);
-
- /* Clear it */
- WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF, 255);
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidBufferToScreenBlt(IN PUCHAR Buffer,
- IN ULONG Left,
- IN ULONG Top,
- IN ULONG Width,
- IN ULONG Height,
- IN ULONG Delta)
-{
- /* Make sure we have a width and height */
- if (!(Width) || !(Height)) return;
-
- /* Call the helper function */
- BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidDisplayString(PUCHAR String)
-{
- ULONG TopDelta = 14;
-
- /* Start looping the string */
- while (*String)
- {
- /* Treat new-line separately */
- if (*String == '\n')
- {
- /* Modify Y position */
- curr_y += TopDelta;
- if (curr_y >= ScrollRegion[3])
- {
- /* Scroll the view */
- VgaScroll(TopDelta);
- curr_y -= TopDelta;
-
- /* Preserve row */
- PreserveRow(curr_y, TopDelta, TRUE);
- }
-
- /* Update current X */
- curr_x = ScrollRegion[0];
-
- /* Preseve the current row */
- PreserveRow(curr_y, TopDelta, FALSE);
- }
- else if (*String == '\r')
- {
- /* Update current X */
- curr_x = ScrollRegion[0];
-
- /* Check if we're being followed by a new line */
- if (String[1] != '\n') NextLine = TRUE;
- }
- else
- {
- /* Check if we had a \n\r last time */
- if (NextLine)
- {
- /* We did, preserve the current row */
- PreserveRow(curr_y, TopDelta, TRUE);
- NextLine = FALSE;
- }
-
- /* Display this character */
- DisplayCharacter(*String, curr_x, curr_y, TextColor, 16);
- curr_x += 8;
-
- /* Check if we should scroll */
- if (curr_x > ScrollRegion[2])
- {
- /* Update Y position and check if we should scroll it */
- curr_y += TopDelta;
- if (curr_y > ScrollRegion[3])
- {
- /* Do the scroll */
- VgaScroll(TopDelta);
- curr_y -= TopDelta;
-
- /* Save the row */
- PreserveRow(curr_y, TopDelta, TRUE);
- }
-
- /* Update X */
- curr_x = ScrollRegion[0];
- }
- }
-
- /* Get the next character */
- String++;
- }
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidBitBlt(PUCHAR Buffer,
- ULONG Left,
- ULONG Top)
-{
- PBITMAPINFOHEADER BitmapInfoHeader;
- LONG Delta;
- PUCHAR BitmapOffset;
-
- /* Get the Bitmap Header */
- BitmapInfoHeader = (PBITMAPINFOHEADER)Buffer;
-
- /* Initialize the palette */
- InitPaletteWithTable((PULONG)(Buffer + BitmapInfoHeader->biSize),
- (BitmapInfoHeader->biClrUsed) ?
- BitmapInfoHeader->biClrUsed : 16);
-
- /* Make sure we can support this bitmap */
- ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
-
- /* Calculate the delta and align it on 32-bytes, then calculate the actual */
- /* start of the bitmap data. */
- Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
- Delta >>= 3;
- Delta &= ~3;
- BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + 16 * sizeof(ULONG);
-
- /* Check the compression of the bitmap */
- if (BitmapInfoHeader->biCompression == 2)
- {
- /* Make sure we have a width and a height */
- if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
- {
- /* We can use RLE Bit Blt */
- RleBitBlt(Left,
- Top,
- BitmapInfoHeader->biWidth,
- BitmapInfoHeader->biHeight,
- BitmapOffset);
- }
- }
- else
- {
- /* Check if the height is negative */
- if (BitmapInfoHeader->biHeight < 0)
- {
- /* Make it positive in the header */
- BitmapInfoHeader->biHeight *= -1;
- }
- else
- {
- /* Update buffer offset */
- BitmapOffset += ((BitmapInfoHeader->biHeight -1) * Delta);
- Delta *= -1;
- }
-
- /* Make sure we have a width and a height */
- if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
- {
- /* Do the BitBlt */
- BitBlt(Left,
- Top,
- BitmapInfoHeader->biWidth,
- BitmapInfoHeader->biHeight,
- BitmapOffset,
- BitmapInfoHeader->biBitCount,
- Delta);
- }
- }
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidScreenToBufferBlt(PUCHAR Buffer,
- ULONG Left,
- ULONG Top,
- ULONG Width,
- ULONG Height,
- ULONG Delta)
-{
- ULONG Plane;
- ULONG XDistance;
- ULONG LeftDelta, RightDelta;
- ULONG PixelOffset;
- PUCHAR PixelPosition;
- PUCHAR k, i;
- PULONG m;
- UCHAR Value, Value2;
- UCHAR a;
- ULONG b;
- ULONG x, y;
-
- /* Calculate total distance to copy on X */
- XDistance = Left + Width - 1;
-
- /* Start at plane 0 */
- Plane = 0;
-
- /* Calculate the 8-byte left and right deltas */
- LeftDelta = Left & 7;
- RightDelta = 8 - LeftDelta;
-
- /* Clear the destination buffer */
- RtlZeroMemory(Buffer, Delta * Height);
-
- /* Calculate the pixel offset and convert the X distance into byte form */
- PixelOffset = Top * 80 + (Left >> 3);
- XDistance >>= 3;
-
- /* Loop the 4 planes */
- do
- {
- /* Set the current pixel position and reset buffer loop variable */
- PixelPosition = (PUCHAR)VgaBase + PixelOffset;
- i = Buffer;
-
- /* Set Mode 0 */
- ReadWriteMode(0);
-
- /* Set the current plane */
- __outpw(0x3CE, (Plane << 8) | 4);
-
- /* Make sure we have a height */
- if (Height > 0)
- {
- /* Start the outer Y loop */
- y = Height;
- do
- {
- /* Read the current value */
- m = (PULONG)i;
- Value = READ_REGISTER_UCHAR(PixelPosition);
-
- /* Set Pixel Position loop variable */
- k = PixelPosition + 1;
-
- /* Check if we're still within bounds */
- if (Left <= XDistance)
- {
- /* Start X Inner loop */
- x = (XDistance - Left) + 1;
- do
- {
- /* Read the current value */
- Value2 = READ_REGISTER_UCHAR(k);
-
- /* Increase pixel position */
- k++;
-
- /* Do the blt */
- a = Value2 >> (UCHAR)RightDelta;
- a |= Value << (UCHAR)LeftDelta;
- b = lookup[a & 0xF];
- a >>= 4;
- b <<= 16;
- b |= lookup[a];
-
- /* Save new value to buffer */
- *m |= (b << Plane);
-
- /* Move to next destination location */
- m++;
-
- /* Write new value */
- Value = Value2;
- } while (--x);
- }
-
- /* Update pixel position */
- PixelPosition += 80;
- i += Delta;
- } while (--y);
- }
- } while (++Plane < 4);
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidSolidColorFill(IN ULONG Left,
- IN ULONG Top,
- IN ULONG Right,
- IN ULONG Bottom,
- IN UCHAR Color)
-{
- ULONG rMask, lMask;
- ULONG LeftOffset, RightOffset, Distance;
- PUCHAR Offset;
- ULONG i, j;
-
- /* Get the left and right masks, shifts, and delta */
- LeftOffset = Left >> 3;
- lMask = (lMaskTable[Left & 0x7] << 8) | 8;
- RightOffset = Right >> 3;
- rMask = (rMaskTable[Right & 0x7] << 8) | 8;
- Distance = RightOffset - LeftOffset;
-
- /* If there is no distance, then combine the right and left masks */
- if (!Distance) lMask &= rMask;
-
- /* Switch to mode 10 */
- ReadWriteMode(10);
-
- /* Clear the 4 planes (we're already in unchained mode here) */
- __outpw(0x3C4, 0xF02);
-
- /* Select the color don't care register */
- __outpw(0x3CE, 7);
-
- /* Calculate pixel position for the read */
- Offset = VgaBase + (Top * 80) + (PUCHAR)LeftOffset;
-
- /* Select the bitmask register and write the mask */
- __outpw(0x3CE, (USHORT)lMask);
-
- /* Check if the top coord is below the bottom one */
- if (Top <= Bottom)
- {
- /* Start looping each line */
- i = (Bottom - Top) + 1;
- do
- {
- /* Read the previous value and add our color */
- WRITE_REGISTER_UCHAR(Offset, READ_REGISTER_UCHAR(Offset) & Color);
-
- /* Move to the next line */
- Offset += 80;
- } while (--i);
- }
-
- /* Check if we have a delta */
- if (Distance)
- {
- /* Calculate new pixel position */
- Offset = VgaBase + (Top * 80) + (PUCHAR)RightOffset;
- Distance--;
-
- /* Select the bitmask register and write the mask */
- __outpw(0x3CE, (USHORT)rMask);
-
- /* Check if the top coord is below the bottom one */
- if (Top <= Bottom)
- {
- /* Start looping each line */
- i = (Bottom - Top) + 1;
- do
- {
- /* Read the previous value and add our color */
- WRITE_REGISTER_UCHAR(Offset,
- READ_REGISTER_UCHAR(Offset) & Color);
-
- /* Move to the next line */
- Offset += 80;
- } while (--i);
- }
-
- /* Check if we still have a delta */
- if (Distance)
- {
- /* Calculate new pixel position */
- Offset = VgaBase + (Top * 80) + (PUCHAR)(LeftOffset + 1);
-
- /* Set the bitmask to 0xFF for all 4 planes */
- __outpw(0x3CE, 0xFF08);
-
- /* Check if the top coord is below the bottom one */
- if (Top <= Bottom)
- {
- /* Start looping each line */
- i = (Bottom - Top) + 1;
- do
- {
- /* Loop the shift delta */
- if (Distance > 0)
- {
- for (j = Distance; j; Offset++, j--)
- {
- /* Write the color */
- WRITE_REGISTER_UCHAR(Offset, Color);
- }
- }
-
- /* Update position in memory */
- Offset += (80 - Distance);
- } while (--i);
- }
- }
- }
-}
-
+#include "precomp.h"
+
+/* GLOBALS *******************************************************************/
+
+ULONG ScrollRegion[4] =
+{
+ 0,
+ 0,
+ 640 - 1,
+ 480 - 1
+};
+UCHAR lMaskTable[8] =
+{
+ (1 << 8) - (1 << 0),
+ (1 << 7) - (1 << 0),
+ (1 << 6) - (1 << 0),
+ (1 << 5) - (1 << 0),
+ (1 << 4) - (1 << 0),
+ (1 << 3) - (1 << 0),
+ (1 << 2) - (1 << 0),
+ (1 << 1) - (1 << 0)
+};
+UCHAR rMaskTable[8] =
+{
+ (1 << 7),
+ (1 << 7)+ (1 << 6),
+ (1 << 7)+ (1 << 6) + (1 << 5),
+ (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4),
+ (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3),
+ (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2),
+ (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1),
+ (1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1) +
+ (1 << 0),
+};
+UCHAR PixelMask[8] =
+{
+ (1 << 7),
+ (1 << 6),
+ (1 << 5),
+ (1 << 4),
+ (1 << 3),
+ (1 << 2),
+ (1 << 1),
+ (1 << 0),
+};
+ULONG lookup[16] =
+{
+ 0x0000,
+ 0x0100,
+ 0x1000,
+ 0x1100,
+ 0x0001,
+ 0x0101,
+ 0x1001,
+ 0x1101,
+ 0x0010,
+ 0x0110,
+ 0x1010,
+ 0x1110,
+ 0x0011,
+ 0x0111,
+ 0x1011,
+ 0x1111,
+};
+
+ULONG TextColor = 0xF;
+ULONG curr_x = 0;
+ULONG curr_y = 0;
+BOOLEAN NextLine = FALSE;
+ULONG_PTR VgaRegisterBase = 0;
+ULONG_PTR VgaBase = 0;
+
+/* PRIVATE FUNCTIONS *********************************************************/
+
+VOID
+NTAPI
+ReadWriteMode(UCHAR Mode)
+{
+ UCHAR Value;
+
+ /* Switch to graphics mode register */
+ WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CE, 5);
+
+ /* Get the current register value, minus the current mode */
+ Value = READ_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF) & 0xF4;
+
+ /* Set the new mode */
+ WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF, Mode | Value);
+}
+
+VOID
+NTAPI
+__outpb(IN ULONG Port,
+ IN ULONG Value)
+{
+ /* Write to the VGA Register */
+ WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + Port, (UCHAR)Value);
+}
+
+VOID
+NTAPI
+__outpw(IN ULONG Port,
+ IN ULONG Value)
+{
+ /* Write to the VGA Register */
+ WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + Port), (USHORT)Value);
+}
+
+VOID
+NTAPI
+SetPixel(IN ULONG Left,
+ IN ULONG Top,
+ IN UCHAR Color)
+{
+ PUCHAR PixelPosition;
+
+ /* Calculate the pixel position. */
+ PixelPosition = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80);
+
+ /* Switch to mode 10 */
+ ReadWriteMode(10);
+
+ /* Clear the 4 planes (we're already in unchained mode here) */
+ __outpw(0x3C4, 0xF02);
+
+ /* Select the color don't care register */
+ __outpw(0x3CE, 7);
+
+ /* Select the bitmask register and write the mask */
+ __outpw(0x3CE, (PixelMask[Left & 7] << 8) | 8);
+
+ /* Read the current pixel value and add our color */
+ WRITE_REGISTER_UCHAR(PixelPosition,
+ READ_REGISTER_UCHAR(PixelPosition) & Color);
+}
+
+VOID
+NTAPI
+DisplayCharacter(CHAR Character,
+ ULONG Left,
+ ULONG Top,
+ ULONG TextColor,
+ ULONG BackTextColor)
+{
+ PUCHAR FontChar;
+ ULONG i, j, XOffset;
+
+ /* Get the font line for this character */
+ FontChar = &FontData[Character * 13 - Top];
+
+ /* Loop each pixel height */
+ i = 13;
+ do
+ {
+ /* Loop each pixel width */
+ j = 128;
+ XOffset = Left;
+ do
+ {
+ /* Check if we should draw this pixel */
+ if (FontChar[Top] & (UCHAR)j)
+ {
+ /* We do, use the given Text Color */
+ SetPixel(XOffset, Top, (UCHAR)TextColor);
+ }
+ else if (BackTextColor < 16)
+ {
+ /* This is a background pixel. We're drawing it unless it's */
+ /* transparent. */
+ SetPixel(XOffset, Top, (UCHAR)BackTextColor);
+ }
+
+ /* Increase X Offset */
+ XOffset++;
+ } while (j >>= 1);
+
+ /* Move to the next Y ordinate */
+ Top++;
+ } while (--i);
+}
+
+VOID
+NTAPI
+DisplayStringXY(PUCHAR String,
+ ULONG Left,
+ ULONG Top,
+ ULONG TextColor,
+ ULONG BackColor)
+{
+ /* Loop every character */
+ while (*String)
+ {
+ /* Display a character */
+ DisplayCharacter(*String, Left, Top, TextColor, BackColor);
+
+ /* Move to next character and next position */
+ String++;
+ Left += 8;
+ }
+}
+
+VOID
+NTAPI
+SetPaletteEntryRGB(IN ULONG Id,
+ IN ULONG Rgb)
+{
+ PCHAR Colors = (PCHAR)&Rgb;
+
+ /* Set the palette index */
+ __outpb(0x3C8, (UCHAR)Id);
+
+ /* Set RGB colors */
+ __outpb(0x3C9, Colors[2] >> 2);
+ __outpb(0x3C9, Colors[1] >> 2);
+ __outpb(0x3C9, Colors[0] >> 2);
+}
+
+VOID
+NTAPI
+InitPaletteWithTable(IN PULONG Table,
+ IN ULONG Count)
+{
+ ULONG i;
+ PULONG Entry = Table;
+
+ /* Loop every entry */
+ for (i = 0; i < Count; i++, Entry++)
+ {
+ /* Set the entry */
+ SetPaletteEntryRGB(i, *Entry);
+ }
+}
+
+VOID
+NTAPI
+SetPaletteEntry(IN ULONG Id,
+ IN ULONG PaletteEntry)
+{
+ /* Set the palette index */
+ __outpb(0x3C8, (UCHAR)Id);
+
+ /* Set RGB colors */
+ __outpb(0x3C9, PaletteEntry & 0xFF);
+ __outpb(0x3C9, (PaletteEntry >>= 8) & 0xFF);
+ __outpb(0x3C9, (PaletteEntry >> 8) & 0xFF);
+}
+
+VOID
+NTAPI
+InitializePalette(VOID)
+{
+ ULONG PaletteEntry[16] = {0,
+ 0x20,
+ 0x2000,
+ 0x2020,
+ 0x200000,
+ 0x200020,
+ 0x202000,
+ 0x202020,
+ 0x303030,
+ 0x3F,
+ 0x3F00,
+ 0x3F3F,
+ 0x3F0000,
+ 0x3F003F,
+ 0x3F3F00,
+ 0x3F3F3F};
+ ULONG i;
+
+ /* Loop all the entries and set their palettes */
+ for (i = 0; i < 16; i++) SetPaletteEntry(i, PaletteEntry[i]);
+}
+
+VOID
+NTAPI
+VgaScroll(ULONG Scroll)
+{
+ ULONG Top;
+ ULONG SourceOffset, DestOffset;
+ ULONG Offset;
+ ULONG i, j;
+
+ /* Set memory positions of the scroll */
+ SourceOffset = VgaBase + (ScrollRegion[1] * 80) + (ScrollRegion[0] >> 3);
+ DestOffset = SourceOffset + (Scroll * 80);
+
+ /* Clear the 4 planes */
+ __outpw(0x3C4, 0xF02);
+
+ /* Set the bitmask to 0xFF for all 4 planes */
+ __outpw(0x3CE, 0xFF08);
+
+ /* Set Mode 1 */
+ ReadWriteMode(1);
+
+ /* Save top and check if it's above the bottom */
+ Top = ScrollRegion[1];
+ if (Top > ScrollRegion[3]) return;
+
+ /* Start loop */
+ do
+ {
+ /* Set number of bytes to loop and start offset */
+ Offset = ScrollRegion[0] >> 3;
+ j = SourceOffset;
+
+ /* Check if this is part of the scroll region */
+ if (Offset <= (ScrollRegion[2] >> 3))
+ {
+ /* Update position */
+ i = DestOffset - SourceOffset;
+
+ /* Loop the X axis */
+ do
+ {
+ /* Write value in the new position so that we can do the scroll */
+ WRITE_REGISTER_UCHAR((PUCHAR)j,
+ READ_REGISTER_UCHAR((PUCHAR)j + i));
+
+ /* Move to the next memory location to write to */
+ j++;
+
+ /* Move to the next byte in the region */
+ Offset++;
+
+ /* Make sure we don't go past the scroll region */
+ } while (Offset <= (ScrollRegion[2] >> 3));
+ }
+
+ /* Move to the next line */
+ SourceOffset += 80;
+ DestOffset += 80;
+
+ /* Increase top */
+ Top++;
+
+ /* Make sure we don't go past the scroll region */
+ } while (Top <= ScrollRegion[3]);
+}
+
+VOID
+NTAPI
+PreserveRow(IN ULONG CurrentTop,
+ IN ULONG TopDelta,
+ IN BOOLEAN Direction)
+{
+ PUCHAR Position1, Position2;
+ ULONG Count;
+
+ /* Clear the 4 planes */
+ __outpw(0x3C4, 0xF02);
+
+ /* Set the bitmask to 0xFF for all 4 planes */
+ __outpw(0x3CE, 0xFF08);
+
+ /* Set Mode 1 */
+ ReadWriteMode(1);
+
+ /* Check which way we're preserving */
+ if (Direction)
+ {
+ /* Calculate the position in memory for the row */
+ Position1 = (PUCHAR)VgaBase + CurrentTop * 80;
+ Position2 = (PUCHAR)VgaBase + 0x9600;
+ }
+ else
+ {
+ /* Calculate the position in memory for the row */
+ Position1 = (PUCHAR)VgaBase + 0x9600;
+ Position2 = (PUCHAR)VgaBase + CurrentTop * 80;
+ }
+
+ /* Set the count and make sure it's above 0 */
+ Count = TopDelta * 80;
+ if (Count)
+ {
+ /* Loop every pixel */
+ do
+ {
+ /* Write the data back on the other position */
+ WRITE_REGISTER_UCHAR(Position1, READ_REGISTER_UCHAR(Position2));
+
+ /* Increase both positions */
+ Position2++;
+ Position1++;
+ } while (--Count);
+ }
+}
+
+VOID
+NTAPI
+BitBlt(IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Width,
+ IN ULONG Height,
+ IN PUCHAR Buffer,
+ IN ULONG BitsPerPixel,
+ IN ULONG Delta)
+{
+ ULONG LeftAnd, LeftShifted, LeftPlusOne, LeftPos;
+ ULONG lMask, rMask;
+ UCHAR NotlMask;
+ ULONG Distance;
+ ULONG DistanceMinusLeftBpp;
+ ULONG SomeYesNoFlag, SomeYesNoFlag2;
+ PUCHAR PixelPosition, m;
+ PUCHAR i, k;
+ ULONG j;
+ ULONG x;
+ ULONG Plane;
+ UCHAR LeftArray[84];
+ PUCHAR CurrentLeft;
+ PUCHAR l;
+ ULONG LoopCount;
+ UCHAR pMask, PlaneShift;
+ BOOLEAN Odd;
+ UCHAR Value;
+
+ /* Check if the buffer isn't 4bpp */
+ if (BitsPerPixel != 4)
+ {
+ /* FIXME: TODO */
+ DbgPrint("Unhandled BitBlt\n"
+ "%lxx%lx @ (%lx,%lx)\n"
+ "Bits Per Pixel %lx\n"
+ "Buffer: %p. Delta: %lx\n",
+ Width,
+ Height,
+ Left,
+ Top,
+ BitsPerPixel,
+ Buffer,
+ Delta);
+ return;
+ }
+
+ /* Get the masks and other values */
+ LeftAnd = Left & 0x7;
+ lMask = lMaskTable[LeftAnd];
+ Distance = Width + Left;
+ rMask = rMaskTable[(Distance - 1) & 0x7];
+ Left >>= 3;
+
+ /* Set some values */
+ SomeYesNoFlag = FALSE;
+ SomeYesNoFlag2 = FALSE;
+ Distance = (Distance - 1) >> 3;
+ DistanceMinusLeftBpp = Distance - Left;
+
+ /* Check if the distance is equal to the left position and add the masks */
+ if (Left == Distance) lMask += rMask;
+
+ /* Check if there's no distance offset */
+ if (DistanceMinusLeftBpp)
+ {
+ /* Set the first flag on */
+ SomeYesNoFlag = TRUE;
+
+ /* Decrease offset and check if we still have one */
+ if (--DistanceMinusLeftBpp)
+ {
+ /* Still have a distance offset */
+ SomeYesNoFlag2 = TRUE;
+ }
+ }
+
+ /* Calculate initial pixel position */
+ PixelPosition = (PUCHAR)VgaBase + (Top * 80) + Left;
+
+ /* Set loop buffer variable */
+ i = Buffer;
+
+ /* Switch to mode 0 */
+ ReadWriteMode(0);
+
+ /* Leave now if the height is 0 */
+ if (Height <= 0) return;
+
+ /* Set more weird values */
+ CurrentLeft = &LeftArray[Left];
+ NotlMask = ~(UCHAR)lMask;
+ LeftPlusOne = Left + 1;
+ LeftShifted = (lMask << 8) | 8;
+ j = Height;
+
+ /* Start the height loop */
+ do
+ {
+ /* Start the plane loop */
+ Plane = 0;
+ do
+ {
+ /* Clear the current value */
+ *CurrentLeft = 0;
+ LoopCount = 0;
+
+ /* Set the buffer loop variable for this loop */
+ k = i;
+
+ /* Calculate plane shift and pixel mask */
+ PlaneShift = 1 << Plane;
+ pMask = PixelMask[LeftAnd];
+
+ /* Check if we have a width */
+ if (Width > 0)
+ {
+ /* Loop it */
+ l = CurrentLeft;
+ x = Width;
+ do
+ {
+ /* Check if we're odd and increase the loop count */
+ Odd = LoopCount & 1 ? TRUE : FALSE;
+ LoopCount++;
+ if (Odd)
+ {
+ /* Check for the plane shift */
+ if (*k & PlaneShift)
+ {
+ /* Write the pixel mask */
+ *l |= pMask;
+ }
+
+ /* Increase buffer position */
+ k++;
+ }
+ else
+ {
+ /* Check for plane shift */
+ if ((*k >> 4) & PlaneShift)
+ {
+ /* Write the pixel mask */
+ *l |= pMask;
+ }
+ }
+
+ /* Shift the pixel mask */
+ pMask >>= 1;
+ if (!pMask)
+ {
+ /* Move to the next current left position and clear it */
+ l++;
+ *l = 0;
+
+ /* Set the pixel mask to 0x80 */
+ pMask = 0x80;
+ }
+ } while (--x);
+ }
+
+ /* Set the plane value */
+ __outpw(0x3C4, (1 << (Plane + 8) | 2));
+
+ /* Select the bitmask register and write the mask */
+ __outpw(0x3CE, (USHORT)LeftShifted);
+
+ /* Read the current Pixel value */
+ Value = READ_REGISTER_UCHAR(PixelPosition);
+
+ /* Add our mask */
+ Value = (Value & NotlMask) | *CurrentLeft;
+
+ /* Set current left for the loop, and write new pixel value */
+ LeftPos = LeftPlusOne;
+ WRITE_REGISTER_UCHAR(PixelPosition, Value);
+
+ /* Set loop pixel position and check if we should loop */
+ m = PixelPosition + 1;
+ if (SomeYesNoFlag2)
+ {
+ /* Set the bitmask to 0xFF for all 4 planes */
+ __outpw(0x3CE, 0xFF08);
+
+ /* Check if we have any distance left */
+ if (DistanceMinusLeftBpp > 0)
+ {
+ /* Start looping it */
+ x = DistanceMinusLeftBpp;
+ do
+ {
+ /* Write the value */
+ WRITE_REGISTER_UCHAR(m, LeftArray[LeftPos]);
+
+ /* Go to the next position */
+ m++;
+ LeftPos++;
+ } while (--x);
+ }
+ }
+
+ /* Check if the first flag is on */
+ if (SomeYesNoFlag)
+ {
+ /* Set the mask value */
+ __outpw(0x3CE, (rMask << 8) | 8);
+
+ /* Read the current Pixel value */
+ Value = READ_REGISTER_UCHAR(m);
+
+ /* Add our mask */
+ Value = (Value & ~(UCHAR)rMask) | LeftArray[LeftPos];
+
+ /* Set current left for the loop, and write new pixel value */
+ WRITE_REGISTER_UCHAR(m, Value);
+ }
+ } while (++Plane < 4);
+
+ /* Update pixel position, buffer and height */
+ PixelPosition += 80;
+ i += Delta;
+ } while (--j);
+}
+
+VOID
+NTAPI
+RleBitBlt(IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Width,
+ IN ULONG Height,
+ IN PUCHAR Buffer)
+{
+ ULONG YDelta;
+ ULONG x;
+ ULONG RleValue, NewRleValue;
+ ULONG Color, Color2;
+ ULONG i, j;
+ ULONG Code;
+
+ /* Set Y height and current X value and start loop */
+ YDelta = Top + Height - 1;
+ x = Left;
+ for (;;)
+ {
+ /* Get the current value and advance in the buffer */
+ RleValue = *Buffer;
+ Buffer++;
+ if (RleValue)
+ {
+ /* Check if we've gone past the edge */
+ if ((x + RleValue) > (Width + Left))
+ {
+ /* Fixeup the pixel value */
+ RleValue = Left - x + Width;
+ }
+
+ /* Get the new value */
+ NewRleValue = *Buffer;
+
+ /* Get the two colors */
+ Color = NewRleValue >> 4;
+ Color2 = NewRleValue & 0xF;
+
+ /* Increase buffer positition */
+ Buffer++;
+
+ /* Check if we need to do a fill */
+ if (Color == Color2)
+ {
+ /* Do a fill and continue the loop */
+ RleValue += x;
+ VidSolidColorFill(x, YDelta, RleValue - 1, YDelta, (UCHAR)Color);
+ x = RleValue;
+ continue;
+ }
+
+ /* Check if the pixel value is 1 or below */
+ if (RleValue > 1)
+ {
+ /* Set loop variables */
+ i = (RleValue - 2) / 2 + 1;
+ do
+ {
+ /* Set the pixels */
+ SetPixel(x, YDelta, (UCHAR)Color);
+ x++;
+ SetPixel(x, YDelta, (UCHAR)Color2);
+ x++;
+
+ /* Decrease pixel value */
+ RleValue -= 2;
+ } while (--i);
+ }
+
+ /* Check if there is any value at all */
+ if (RleValue)
+ {
+ /* Set the pixel and increase posititon */
+ SetPixel(x, YDelta, (UCHAR)Color);
+ x++;
+ }
+
+ /* Start over */
+ continue;
+ }
+
+ /* Get the current pixel value */
+ RleValue = *Buffer;
+ Code = RleValue;
+ switch (Code)
+ {
+ /* Case 0 */
+ case 0:
+
+ /* Set new x value, decrease distance and restart */
+ x = Left;
+ YDelta--;
+ Buffer++;
+ continue;
+
+ /* Case 1 */
+ case 1:
+
+ /* Done */
+ return;
+
+ /* Case 2 */
+ case 2:
+
+ /* Set new x value, decrease distance and restart */
+ Buffer++;
+ x += *Buffer;
+ Buffer++;
+ YDelta -= *Buffer;
+ Buffer++;
+ continue;
+
+ /* Other values */
+ default:
+
+ Buffer++;
+ break;
+ }
+
+ /* Check if we've gone past the edge */
+ if ((x + RleValue) > (Width + Left))
+ {
+ /* Set fixed up loop count */
+ i = RleValue - Left - Width + x;
+
+ /* Fixup pixel value */
+ RleValue -= i;
+ }
+ else
+ {
+ /* Clear loop count */
+ i = 0;
+ }
+
+ /* Check the value now */
+ if (RleValue > 1)
+ {
+ /* Set loop variables */
+ j = (RleValue - 2) / 2 + 1;
+ do
+ {
+ /* Get the new value */
+ NewRleValue = *Buffer;
+
+ /* Get the two colors */
+ Color = NewRleValue >> 4;
+ Color2 = NewRleValue & 0xF;
+
+ /* Increase buffer position */
+ Buffer++;
+
+ /* Set the pixels */
+ SetPixel(x, YDelta, (UCHAR)Color);
+ x++;
+ SetPixel(x, YDelta, (UCHAR)Color2);
+ x++;
+
+ /* Decrease pixel value */
+ RleValue -= 2;
+ } while (--j);
+ }
+
+ /* Check if there is any value at all */
+ if (RleValue)
+ {
+ /* Set the pixel and increase position */
+ Color = *Buffer >> 4;
+ Buffer++;
+ SetPixel(x, YDelta, (UCHAR)Color);
+ x++;
+ i--;
+ }
+
+ /* Check loop count now */
+ if ((LONG)i > 0)
+ {
+ /* Decrease it */
+ i--;
+
+ /* Set new position */
+ Buffer = Buffer + (i / 2) + 1;
+ }
+
+ /* Check if we need to increase the buffer */
+ if ((ULONG_PTR)Buffer & 1) Buffer++;
+ }
+}
+
+/* PUBLIC FUNCTIONS **********************************************************/
+
+/*
+ * @implemented
+ */
+ULONG
+NTAPI
+VidSetTextColor(ULONG Color)
+{
+ ULONG OldColor;
+
+ /* Save the old color and set the new one */
+ OldColor = TextColor;
+ TextColor = Color;
+ return OldColor;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidDisplayStringXY(PUCHAR String,
+ ULONG Left,
+ ULONG Top,
+ BOOLEAN Transparent)
+{
+ ULONG BackColor;
+
+ /* If the caller wanted transparent, then send the special value (16), else */
+ /* use our default and call the helper routine. */
+ BackColor = (Transparent) ? 16 : 14;
+ DisplayStringXY(String, Left, Top, 12, BackColor);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidSetScrollRegion(ULONG x1,
+ ULONG y1,
+ ULONG x2,
+ ULONG y2)
+{
+ /* Assert alignment */
+ ASSERT((x1 & 0x7) == 0);
+ ASSERT((x2 & 0x7) == 7);
+
+ /* Set Scroll Region */
+ ScrollRegion[0] = x1;
+ ScrollRegion[1] = y1;
+ ScrollRegion[2] = x2;
+ ScrollRegion[3] = y2;
+
+ /* Set current X and Y */
+ curr_x = x1;
+ curr_y = y1;
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidCleanUp(VOID)
+{
+ /* Select bit mask register */
+ WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CE, 8);
+
+ /* Clear it */
+ WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + 0x3CF, 255);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidBufferToScreenBlt(IN PUCHAR Buffer,
+ IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Width,
+ IN ULONG Height,
+ IN ULONG Delta)
+{
+ /* Make sure we have a width and height */
+ if (!(Width) || !(Height)) return;
+
+ /* Call the helper function */
+ BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidDisplayString(PUCHAR String)
+{
+ ULONG TopDelta = 14;
+
+ /* Start looping the string */
+ while (*String)
+ {
+ /* Treat new-line separately */
+ if (*String == '\n')
+ {
+ /* Modify Y position */
+ curr_y += TopDelta;
+ if (curr_y >= ScrollRegion[3])
+ {
+ /* Scroll the view */
+ VgaScroll(TopDelta);
+ curr_y -= TopDelta;
+
+ /* Preserve row */
+ PreserveRow(curr_y, TopDelta, TRUE);
+ }
+
+ /* Update current X */
+ curr_x = ScrollRegion[0];
+
+ /* Preseve the current row */
+ PreserveRow(curr_y, TopDelta, FALSE);
+ }
+ else if (*String == '\r')
+ {
+ /* Update current X */
+ curr_x = ScrollRegion[0];
+
+ /* Check if we're being followed by a new line */
+ if (String[1] != '\n') NextLine = TRUE;
+ }
+ else
+ {
+ /* Check if we had a \n\r last time */
+ if (NextLine)
+ {
+ /* We did, preserve the current row */
+ PreserveRow(curr_y, TopDelta, TRUE);
+ NextLine = FALSE;
+ }
+
+ /* Display this character */
+ DisplayCharacter(*String, curr_x, curr_y, TextColor, 16);
+ curr_x += 8;
+
+ /* Check if we should scroll */
+ if (curr_x > ScrollRegion[2])
+ {
+ /* Update Y position and check if we should scroll it */
+ curr_y += TopDelta;
+ if (curr_y > ScrollRegion[3])
+ {
+ /* Do the scroll */
+ VgaScroll(TopDelta);
+ curr_y -= TopDelta;
+
+ /* Save the row */
+ PreserveRow(curr_y, TopDelta, TRUE);
+ }
+
+ /* Update X */
+ curr_x = ScrollRegion[0];
+ }
+ }
+
+ /* Get the next character */
+ String++;
+ }
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidBitBlt(PUCHAR Buffer,
+ ULONG Left,
+ ULONG Top)
+{
+ PBITMAPINFOHEADER BitmapInfoHeader;
+ LONG Delta;
+ PUCHAR BitmapOffset;
+
+ /* Get the Bitmap Header */
+ BitmapInfoHeader = (PBITMAPINFOHEADER)Buffer;
+
+ /* Initialize the palette */
+ InitPaletteWithTable((PULONG)(Buffer + BitmapInfoHeader->biSize),
+ (BitmapInfoHeader->biClrUsed) ?
+ BitmapInfoHeader->biClrUsed : 16);
+
+ /* Make sure we can support this bitmap */
+ ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
+
+ /* Calculate the delta and align it on 32-bytes, then calculate the actual */
+ /* start of the bitmap data. */
+ Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
+ Delta >>= 3;
+ Delta &= ~3;
+ BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + 16 * sizeof(ULONG);
+
+ /* Check the compression of the bitmap */
+ if (BitmapInfoHeader->biCompression == 2)
+ {
+ /* Make sure we have a width and a height */
+ if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
+ {
+ /* We can use RLE Bit Blt */
+ RleBitBlt(Left,
+ Top,
+ BitmapInfoHeader->biWidth,
+ BitmapInfoHeader->biHeight,
+ BitmapOffset);
+ }
+ }
+ else
+ {
+ /* Check if the height is negative */
+ if (BitmapInfoHeader->biHeight < 0)
+ {
+ /* Make it positive in the header */
+ BitmapInfoHeader->biHeight *= -1;
+ }
+ else
+ {
+ /* Update buffer offset */
+ BitmapOffset += ((BitmapInfoHeader->biHeight -1) * Delta);
+ Delta *= -1;
+ }
+
+ /* Make sure we have a width and a height */
+ if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
+ {
+ /* Do the BitBlt */
+ BitBlt(Left,
+ Top,
+ BitmapInfoHeader->biWidth,
+ BitmapInfoHeader->biHeight,
+ BitmapOffset,
+ BitmapInfoHeader->biBitCount,
+ Delta);
+ }
+ }
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidScreenToBufferBlt(PUCHAR Buffer,
+ ULONG Left,
+ ULONG Top,
+ ULONG Width,
+ ULONG Height,
+ ULONG Delta)
+{
+ ULONG Plane;
+ ULONG XDistance;
+ ULONG LeftDelta, RightDelta;
+ ULONG PixelOffset;
+ PUCHAR PixelPosition;
+ PUCHAR k, i;
+ PULONG m;
+ UCHAR Value, Value2;
+ UCHAR a;
+ ULONG b;
+ ULONG x, y;
+
+ /* Calculate total distance to copy on X */
+ XDistance = Left + Width - 1;
+
+ /* Start at plane 0 */
+ Plane = 0;
+
+ /* Calculate the 8-byte left and right deltas */
+ LeftDelta = Left & 7;
+ RightDelta = 8 - LeftDelta;
+
+ /* Clear the destination buffer */
+ RtlZeroMemory(Buffer, Delta * Height);
+
+ /* Calculate the pixel offset and convert the X distance into byte form */
+ PixelOffset = Top * 80 + (Left >> 3);
+ XDistance >>= 3;
+
+ /* Loop the 4 planes */
+ do
+ {
+ /* Set the current pixel position and reset buffer loop variable */
+ PixelPosition = (PUCHAR)VgaBase + PixelOffset;
+ i = Buffer;
+
+ /* Set Mode 0 */
+ ReadWriteMode(0);
+
+ /* Set the current plane */
+ __outpw(0x3CE, (Plane << 8) | 4);
+
+ /* Make sure we have a height */
+ if (Height > 0)
+ {
+ /* Start the outer Y loop */
+ y = Height;
+ do
+ {
+ /* Read the current value */
+ m = (PULONG)i;
+ Value = READ_REGISTER_UCHAR(PixelPosition);
+
+ /* Set Pixel Position loop variable */
+ k = PixelPosition + 1;
+
+ /* Check if we're still within bounds */
+ if (Left <= XDistance)
+ {
+ /* Start X Inner loop */
+ x = (XDistance - Left) + 1;
+ do
+ {
+ /* Read the current value */
+ Value2 = READ_REGISTER_UCHAR(k);
+
+ /* Increase pixel position */
+ k++;
+
+ /* Do the blt */
+ a = Value2 >> (UCHAR)RightDelta;
+ a |= Value << (UCHAR)LeftDelta;
+ b = lookup[a & 0xF];
+ a >>= 4;
+ b <<= 16;
+ b |= lookup[a];
+
+ /* Save new value to buffer */
+ *m |= (b << Plane);
+
+ /* Move to next destination location */
+ m++;
+
+ /* Write new value */
+ Value = Value2;
+ } while (--x);
+ }
+
+ /* Update pixel position */
+ PixelPosition += 80;
+ i += Delta;
+ } while (--y);
+ }
+ } while (++Plane < 4);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+VidSolidColorFill(IN ULONG Left,
+ IN ULONG Top,
+ IN ULONG Right,
+ IN ULONG Bottom,
+ IN UCHAR Color)
+{
+ ULONG rMask, lMask;
+ ULONG LeftOffset, RightOffset, Distance;
+ PUCHAR Offset;
+ ULONG i, j;
+
+ /* Get the left and right masks, shifts, and delta */
+ LeftOffset = Left >> 3;
+ lMask = (lMaskTable[Left & 0x7] << 8) | 8;
+ RightOffset = Right >> 3;
+ rMask = (rMaskTable[Right & 0x7] << 8) | 8;
+ Distance = RightOffset - LeftOffset;
+
+ /* If there is no distance, then combine the right and left masks */
+ if (!Distance) lMask &= rMask;
+
+ /* Switch to mode 10 */
+ ReadWriteMode(10);
+
+ /* Clear the 4 planes (we're already in unchained mode here) */
+ __outpw(0x3C4, 0xF02);
+
+ /* Select the color don't care register */
+ __outpw(0x3CE, 7);
+
+ /* Calculate pixel position for the read */
+ Offset = VgaBase + (Top * 80) + (PUCHAR)LeftOffset;
+
+ /* Select the bitmask register and write the mask */
+ __outpw(0x3CE, (USHORT)lMask);
+
+ /* Check if the top coord is below the bottom one */
+ if (Top <= Bottom)
+ {
+ /* Start looping each line */
+ i = (Bottom - Top) + 1;
+ do
+ {
+ /* Read the previous value and add our color */
+ WRITE_REGISTER_UCHAR(Offset, READ_REGISTER_UCHAR(Offset) & Color);
+
+ /* Move to the next line */
+ Offset += 80;
+ } while (--i);
+ }
+
+ /* Check if we have a delta */
+ if (Distance)
+ {
+ /* Calculate new pixel position */
+ Offset = VgaBase + (Top * 80) + (PUCHAR)RightOffset;
+ Distance--;
+
+ /* Select the bitmask register and write the mask */
+ __outpw(0x3CE, (USHORT)rMask);
+
+ /* Check if the top coord is below the bottom one */
+ if (Top <= Bottom)
+ {
+ /* Start looping each line */
+ i = (Bottom - Top) + 1;
+ do
+ {
+ /* Read the previous value and add our color */
+ WRITE_REGISTER_UCHAR(Offset,
+ READ_REGISTER_UCHAR(Offset) & Color);
+
+ /* Move to the next line */
+ Offset += 80;
+ } while (--i);
+ }
+
+ /* Check if we still have a delta */
+ if (Distance)
+ {
+ /* Calculate new pixel position */
+ Offset = VgaBase + (Top * 80) + (PUCHAR)(LeftOffset + 1);
+
+ /* Set the bitmask to 0xFF for all 4 planes */
+ __outpw(0x3CE, 0xFF08);
+
+ /* Check if the top coord is below the bottom one */
+ if (Top <= Bottom)
+ {
+ /* Start looping each line */
+ i = (Bottom - Top) + 1;
+ do
+ {
+ /* Loop the shift delta */
+ if (Distance > 0)
+ {
+ for (j = Distance; j; Offset++, j--)
+ {
+ /* Write the color */
+ WRITE_REGISTER_UCHAR(Offset, Color);
+ }
+ }
+
+ /* Update position in memory */
+ Offset += (80 - Distance);
+ } while (--i);
+ }
+ }
+ }
+}
+
diff --git a/reactos/hal/halarm/generic/hal.c b/reactos/hal/halarm/generic/hal.c
index 5c2a960ae07..e060cefa814 100644
--- a/reactos/hal/halarm/generic/hal.c
+++ b/reactos/hal/halarm/generic/hal.c
@@ -672,9 +672,6 @@ HalInitSystem(IN ULONG BootPhase,
// Switch to real clock interrupt
//
PCR->InterruptRoutine[CLOCK2_LEVEL] = HalpClockInterrupt;
-
- UNIMPLEMENTED;
- while (TRUE);
}
//