914 lines
67 KiB
C

#include <lcrash/driver/vga.h>
#include <lcrash/driver/cap/textdisplay.h>
#include <lcrash/util.h>
#include <lcrash/mm/kmalloc.h>
#define _(X, Y, A, B, C, D, E, F, G, H) \
[X][Y] = A, [X + 1][Y] = B, [X + 2][Y] = C, [X + 3][Y] = D, [X + 4][Y] = E, [X + 5][Y] = F, [X + 6][Y] = G, [X + 7][Y] = H,
// Font uh yeah its a font yeah B)
u8 VgaFont[256][32] = {
_(0x00, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x00, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x08, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x10, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x18, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x2, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x3, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x4, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x5, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x6, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x7, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x8, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0x9, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xa, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xb, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xd, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xe, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x20, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x28, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x28, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x28, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001100)
_(0x28, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001100)
_(0x28, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001100)
_(0x28, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001100)
_(0x28, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001100)
_(0x28, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000)
_(0x28, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000)
_(0x28, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000)
_(0x28, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000)
_(0x28, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11000000)
_(0x28, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b11000000)
_(0x28, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b11000000)
_(0x28, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b01100000, 0b11000000)
_(0x28, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b01100000, 0b11000000)
_(0x30, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x30, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x5, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x6, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xd, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xe, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x38, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x40, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x40, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x40, 0x2, 0b00000000, 0b00110000, 0b11111000, 0b11111100, 0b11111000, 0b11111100, 0b11111100, 0b01111100)
_(0x40, 0x3, 0b00000000, 0b01111000, 0b11111000, 0b11111100, 0b11111100, 0b11111100, 0b11111100, 0b11111100)
_(0x40, 0x4, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11000000)
_(0x40, 0x5, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11000000)
_(0x40, 0x6, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11000000)
_(0x40, 0x7, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11000000)
_(0x40, 0x8, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11000000)
_(0x40, 0x9, 0b00000000, 0b11111100, 0b11111000, 0b11000000, 0b11001100, 0b11111100, 0b11111100, 0b11011100)
_(0x40, 0xa, 0b00000000, 0b11111100, 0b11111000, 0b11000000, 0b11001100, 0b11111100, 0b11111100, 0b11011100)
_(0x40, 0xb, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11001100)
_(0x40, 0xc, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11001100)
_(0x40, 0xd, 0b00000000, 0b11001100, 0b11001100, 0b11000000, 0b11001100, 0b11000000, 0b11000000, 0b11001100)
_(0x40, 0xe, 0b00000000, 0b11001100, 0b11111100, 0b11111100, 0b11111100, 0b11111100, 0b11000000, 0b11111100)
_(0x40, 0xf, 0b00000000, 0b11001100, 0b11111000, 0b11111100, 0b11111000, 0b11111100, 0b11000000, 0b01111000)
_(0x48, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x48, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x48, 0x2, 0b11001100, 0b11111100, 0b00001100, 0b11001100, 0b11000000, 0b11000110, 0b11000110, 0b11111100)
_(0x48, 0x3, 0b11001100, 0b11111100, 0b00001100, 0b11001100, 0b11000000, 0b11000110, 0b11000110, 0b11111100)
_(0x48, 0x4, 0b11001100, 0b00110000, 0b00001100, 0b11001100, 0b11000000, 0b11101110, 0b11000110, 0b11001100)
_(0x48, 0x5, 0b11001100, 0b00110000, 0b00001100, 0b11011000, 0b11000000, 0b11101110, 0b11000110, 0b11001100)
_(0x48, 0x6, 0b11001100, 0b00110000, 0b00001100, 0b11011000, 0b11000000, 0b11111110, 0b11000110, 0b11001100)
_(0x48, 0x7, 0b11001100, 0b00110000, 0b00001100, 0b11011000, 0b11000000, 0b11010110, 0b11110110, 0b11001100)
_(0x48, 0x8, 0b11001100, 0b00110000, 0b00001100, 0b11100000, 0b11000000, 0b11010110, 0b11110110, 0b11001100)
_(0x48, 0x9, 0b11111100, 0b00110000, 0b00001100, 0b11110000, 0b11000000, 0b11000110, 0b11110110, 0b11001100)
_(0x48, 0xa, 0b11111100, 0b00110000, 0b00001100, 0b11011000, 0b11000000, 0b11000110, 0b11011110, 0b11001100)
_(0x48, 0xb, 0b11001100, 0b00110000, 0b00001100, 0b11011000, 0b11000000, 0b11000110, 0b11011110, 0b11001100)
_(0x48, 0xc, 0b11001100, 0b00110000, 0b11001100, 0b11011000, 0b11000000, 0b11000110, 0b11011110, 0b11001100)
_(0x48, 0xd, 0b11001100, 0b00110000, 0b11001100, 0b11001100, 0b11000000, 0b11000110, 0b11001110, 0b11001100)
_(0x48, 0xe, 0b11001100, 0b11111100, 0b11111100, 0b11001100, 0b11111100, 0b11000110, 0b11001110, 0b11111100)
_(0x48, 0xf, 0b11001100, 0b11111100, 0b01111000, 0b11001100, 0b01111100, 0b11000110, 0b11001110, 0b11111100)
_(0x50, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x50, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x50, 0x2, 0b11111100, 0b01111000, 0b11111000, 0b01111000, 0b11111100, 0b11001100, 0b11001100, 0b11000110)
_(0x50, 0x3, 0b11111100, 0b11111100, 0b11001100, 0b11111100, 0b11111100, 0b11001100, 0b11001100, 0b11000110)
_(0x50, 0x4, 0b11001100, 0b11001100, 0b11001100, 0b11000000, 0b00110000, 0b11001100, 0b11001100, 0b11000110)
_(0x50, 0x5, 0b11001100, 0b11001100, 0b11001100, 0b11000000, 0b00110000, 0b11001100, 0b11001100, 0b11000110)
_(0x50, 0x6, 0b11001100, 0b11001100, 0b11001100, 0b11000000, 0b00110000, 0b11001100, 0b11001100, 0b11000110)
_(0x50, 0x7, 0b11001100, 0b11001100, 0b11001100, 0b11000000, 0b00110000, 0b11001100, 0b01001000, 0b11000110)
_(0x50, 0x8, 0b11001100, 0b11001100, 0b11001100, 0b11111000, 0b00110000, 0b11001100, 0b01001000, 0b11000110)
_(0x50, 0x9, 0b11111100, 0b11001100, 0b11111100, 0b01111100, 0b00110000, 0b11001100, 0b01001000, 0b11000110)
_(0x50, 0xa, 0b11111100, 0b11001100, 0b11111000, 0b00001100, 0b00110000, 0b11001100, 0b01111000, 0b11000110)
_(0x50, 0xb, 0b11000000, 0b11101100, 0b11011000, 0b00001100, 0b00110000, 0b11001100, 0b01111000, 0b11010110)
_(0x50, 0xc, 0b11000000, 0b11111100, 0b11011000, 0b00001100, 0b00110000, 0b11001100, 0b00110000, 0b11010110)
_(0x50, 0xd, 0b11000000, 0b01111000, 0b11001100, 0b00001100, 0b00110000, 0b11001100, 0b00110000, 0b11010110)
_(0x50, 0xe, 0b11000000, 0b00011100, 0b11001100, 0b11111100, 0b00110000, 0b11111100, 0b00110000, 0b11111110)
_(0x50, 0xf, 0b11000000, 0b00001100, 0b11001100, 0b01111000, 0b00110000, 0b11111100, 0b00110000, 0b01101100)
_(0x58, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x2, 0b11001100, 0b11001100, 0b11111100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x3, 0b11001100, 0b11001100, 0b11111100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x4, 0b11001100, 0b11001100, 0b00001100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x5, 0b01111000, 0b11001100, 0b00001100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x6, 0b01111000, 0b01111000, 0b00011000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x7, 0b01111000, 0b01111000, 0b00011000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x8, 0b00110000, 0b01111000, 0b00011000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0x9, 0b00110000, 0b01111000, 0b00110000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xa, 0b01111000, 0b00110000, 0b00110000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xb, 0b01111000, 0b00110000, 0b00110000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xc, 0b01111000, 0b00110000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xd, 0b11001100, 0b00110000, 0b01100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xe, 0b11001100, 0b00110000, 0b11111100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x58, 0xf, 0b11001100, 0b00110000, 0b11111100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x1, 0b11100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x2, 0b11110000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x3, 0b01111000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x4, 0b00111000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x60, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x68, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x70, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x78, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x80, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x88, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x90, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0x98, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xa8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xb8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xc8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xd8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xe8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf0, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x0, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x1, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x2, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x3, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x4, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x5, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x6, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x7, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x8, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0x9, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xa, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xb, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xc, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xd, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xe, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
_(0xf8, 0xf, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000)
};
// -- Device prototype --
struct VgaSBDevice {
// Ports
u16 MiscOutputRegisterReadPort;
u16 MiscOutputRegisterWritePort;
u16 GraphicsRegisterIndexPort;
u16 GraphicsRegisterDataPort;
u16 AttributeRegisterIndexPort;
u16 AttributeRegisterDataPort;
u16 CrtRegisterIndexPort;
u16 CrtRegisterDataPort;
u16 SequencerRegisterIndexPort;
u16 SequencerRegisterDataPort;
u16 DacWritePort;
u16 DacReadPort;
u16 DacDataPort;
volatile c8* Plane0;
};
void VgaSBDeviceTMDC_I_TweakGenericRegister(u8 Read, u8 Write, u8 Value, u8 Mask) {
u8 Reg = PortRead8(Read);
Reg &= ~Mask;
Reg |= Value & Mask;
PortWrite8(Write, Reg);
}
void VgaSBDeviceTMDC_I_WriteGraphicsRegister(struct SysbusDevice* Device, u8 Index, u8 Value) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->GraphicsRegisterIndexPort, Index);
PortWrite8(Data->GraphicsRegisterDataPort, Value);
return;
}
u8 VgaSBDeviceTMDC_I_ReadGraphicsRegister(struct SysbusDevice* Device, u8 Index) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->GraphicsRegisterIndexPort, Index);
return PortRead8(Data->GraphicsRegisterDataPort);
}
void VgaSBDeviceTMDC_I_TweakGraphicsRegister(struct SysbusDevice* Device, u8 Index, u8 Value, u8 Mask) {
u8 Reg = VgaSBDeviceTMDC_I_ReadGraphicsRegister(Device, Index);
Reg &= ~Mask;
Reg |= Value & Mask;
VgaSBDeviceTMDC_I_WriteGraphicsRegister(Device, Index, Reg);
}
void VgaSBDeviceTMDC_I_WriteInternalPalette(struct SysbusDevice* Device, u8 Index, u8 Value) {
struct VgaSBDevice* Data = Device->DeviceData;
// bit 5 being set to 0 makes the attribute register fetch info from
// the internal palette, it's a really strange design but i suppose it
// makes sense since you don't want to use too many io ports, it also
// has the same address and data ports
PortWrite8(Data->AttributeRegisterIndexPort, (Index & 0x1f));
PortWrite8(Data->AttributeRegisterIndexPort, Value);
return;
}
u8 VgaSBDeviceTMDC_I_ReadInternalPalette(struct SysbusDevice* Device, u8 Index) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->AttributeRegisterIndexPort, (Index & 0x1f));
return PortRead8(Data->AttributeRegisterDataPort);
}
void VgaSBDeviceTMDC_I_WriteAttributeRegister(struct SysbusDevice* Device, u8 Index, u8 Value) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->AttributeRegisterIndexPort, (Index & 0x1f) | 0x20);
PortWrite8(Data->AttributeRegisterIndexPort, Value);
return;
}
u8 VgaSBDeviceTMDC_I_ReadAttributeRegister(struct SysbusDevice* Device, u8 Index) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->AttributeRegisterIndexPort, (Index & 0x1f) | 0x20);
return PortRead8(Data->AttributeRegisterDataPort);
}
void VgaSBDeviceTMDC_I_TweakAttributeRegister(struct SysbusDevice* Device, u8 Index, u8 Value, u8 Mask) {
u8 Reg = VgaSBDeviceTMDC_I_ReadAttributeRegister(Device, Index);
Reg &= ~Mask;
Reg |= Value & Mask;
VgaSBDeviceTMDC_I_WriteAttributeRegister(Device, Index, Reg);
}
void VgaSBDeviceTMDC_I_WriteCrtRegister(struct SysbusDevice* Device, u8 Index, u8 Value) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->CrtRegisterIndexPort, Index);
PortWrite8(Data->CrtRegisterDataPort, Value);
return;
}
u8 VgaSBDeviceTMDC_I_ReadCrtRegister(struct SysbusDevice* Device, u8 Index) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->CrtRegisterIndexPort, Index);
return PortRead8(Data->CrtRegisterDataPort);
}
void VgaSBDeviceTMDC_I_TweakCrtRegister(struct SysbusDevice* Device, u8 Index, u8 Value, u8 Mask) {
u8 Reg = VgaSBDeviceTMDC_I_ReadCrtRegister(Device, Index);
Reg &= ~Mask;
Reg |= Value & Mask;
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, Index, Reg);
}
void VgaSBDeviceTMDC_I_WriteSequencerRegister(struct SysbusDevice* Device, u8 Index, u8 Value) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->SequencerRegisterIndexPort, Index);
PortWrite8(Data->SequencerRegisterDataPort, Value);
return;
}
u8 VgaSBDeviceTMDC_I_ReadSequencerRegister(struct SysbusDevice* Device, u8 Index) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->SequencerRegisterIndexPort, Index);
return PortRead8(Data->SequencerRegisterDataPort);
}
void VgaSBDeviceTMDC_I_TweakSequencerRegister(struct SysbusDevice* Device, u8 Index, u8 Value, u8 Mask) {
u8 Reg = VgaSBDeviceTMDC_I_ReadSequencerRegister(Device, Index);
Reg &= ~Mask;
Reg |= Value & Mask;
VgaSBDeviceTMDC_I_WriteSequencerRegister(Device, Index, Reg);
}
void VgaSBDeviceTMDC_I_WriteDacColor(struct SysbusDevice* Device, u8 Color, u8 Red, u8 Green, u8 Blue) {
struct VgaSBDevice* Data = Device->DeviceData;
PortWrite8(Data->DacWritePort, Color);
PortWrite8(Data->DacDataPort, Red >> 2);
PortWrite8(Data->DacDataPort, Green >> 2);
PortWrite8(Data->DacDataPort, Blue >> 2);
}
s32 VgaSBDeviceTMDC_Enable(struct SysbusDevice* Device) {
return 0;
}
void VgaSBDeviceTMDC_Reset_RealStub(void*) {
return;
}
s32 VgaSBDeviceTMDC_Reset(struct SysbusDevice* Device) {
struct VgaSBDevice* Data = Device->DeviceData;
// Enable display buffer
VgaSBDeviceTMDC_I_TweakGenericRegister(Data->MiscOutputRegisterReadPort, Data->MiscOutputRegisterWritePort, 0x02, 0x02);
// Disable monochrome adapter compatibility (move ports to expected locations)
VgaSBDeviceTMDC_I_TweakGenericRegister(Data->MiscOutputRegisterReadPort, Data->MiscOutputRegisterWritePort, 0x01, 0x01);
// Switch the graphics controller into alphanumeric mode and map VRAM to 0xA0000-0xBFFFF
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x06, 0x00 | 0x00, 0x01 | 0x0c);
// Unprotect CRT registers
VgaSBDeviceTMDC_I_TweakCrtRegister(Device, 0x11, 0x00, 0x80);
// Set character height to uh... 16
VgaSBDeviceTMDC_I_TweakCrtRegister(Device, 0x09, 0x0f, 0x1f);
// Character width can be like uhm... 8
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x01, 0x01, 0x01);
// Lets go with 80 characters per line
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, 0x01, 80 - 1);
// How about 25 columns... a classic! everything supports it.
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, 0x12, (16 * 25) & 0xff);
VgaSBDeviceTMDC_I_TweakCrtRegister(Device, 0x07, ((16 * 25) & 0x100) ? 2 : 0, 0x42);
// Each line is 80 bytes long, 80 / 2...
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, 0x13, 40);
// Clear upper bits from DAC value
VgaSBDeviceTMDC_I_TweakAttributeRegister(Device, 0x14, 0x00, 0x0f);
// Lets enable every color plane, i can't find any documentation on what it does but i suppose it enables the RGB values
VgaSBDeviceTMDC_I_WriteAttributeRegister(Device, 0x12, 0xf);
// Colors
//VgaSBDeviceTMDC_I_WriteDacColor(Device, 16, 0, 0, 0);
// Set overscan color to 16
VgaSBDeviceTMDC_I_WriteAttributeRegister(Device, 0x11, 0);
// Unlock memory planes 0, 1 and 2
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x02, 0x07, 0x0f);
// Select font 0 for charsets A and B
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x03, 0x00, 0x3f);
// Disable odd-even mode
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x04, 0x04, 0x04);
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x05, 0x00, 0x10);
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x06, 0x00, 0x02);
// Select write mode 0
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x05, 0x00, 0x03);
// Derive data from memory
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x00, 0x00, 0x0f);
// Don't rotate data
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x03, 0x00, 0x07);
// Don't do any transformations on the data
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x03, 0x00, 0x18);
// Bitmask
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x08, 0xff, 0xff);
// Only write to plane 2
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x02, 0x04, 0x0f);
// Load font 0
for (int i = 0; i < 256; i++) {
for (int j = 0; j < 32; j++) {
Data->Plane0[i * 32 + j] = VgaFont[i][j];
}
}
// Only write to plane 0 and 1
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x02, 0x03, 0x0f);
// Map VRAM to 0xB8000-0xBFFFF
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x06, 0x0c, 0x0c);
// Set VRAM start address to start of VRAM
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, 0x0D, 0);
VgaSBDeviceTMDC_I_WriteCrtRegister(Device, 0x0C, 0);
// Ensure chain mode is off
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x04, 0x08, 0x00);
// Enable odd/even mode
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x05, 0x10, 0x10);
VgaSBDeviceTMDC_I_TweakGraphicsRegister(Device, 0x06, 0x02, 0x02);
VgaSBDeviceTMDC_I_TweakSequencerRegister(Device, 0x04, 0x00, 0x04);
return 0;
}
s32 VgaSBDeviceTMDC_GetPaletteSize(struct SysbusDevice* Device) {
return 15;
}
s32 VgaSBDeviceTMDC_SetPaletteColor(struct SysbusDevice* Device, u32 ID, u8 Red, u8 Green, u8 Blue) {
if (ID >= 16) return -1;
VgaSBDeviceTMDC_I_WriteDacColor(Device, ID, Red, Green, Blue);
VgaSBDeviceTMDC_I_WriteInternalPalette(Device, ID, ID);
VgaSBDeviceTMDC_I_WriteAttributeRegister(Device, 0x12, 0xf);
return 0;
}
s32 VgaSBDeviceTMDC_SetCharacter(struct SysbusDevice* Device, u32 Row, u32 Col, c8 Char, u32 FG, u32 BG) {
if (Row > 25 || Col > 80) return -1;
struct VgaSBDevice* Data = Device->DeviceData;
Data->Plane0[0x18000 + (Row * 80 + Col) * 2 ] = Char;
Data->Plane0[0x18000 + (Row * 80 + Col) * 2 + 1] = ((FG & 0xf) << 4) | (BG & 0xf);
return 0;
}
struct TextModeDisplayCapability VgaSBDeviceTextModeDisplayCapability = {
.Enable = VgaSBDeviceTMDC_Enable,
.Reset = VgaSBDeviceTMDC_Reset,
.GetPaletteSize = VgaSBDeviceTMDC_GetPaletteSize,
.SetPaletteColor = VgaSBDeviceTMDC_SetPaletteColor,
.SetCharacter = VgaSBDeviceTMDC_SetCharacter
};
struct SysbusDeviceDescription* VgaSBDevice = 0;
s32 VgaSBDevice_Create(struct SysbusDevice* Device, void* Data) {
struct VgaSBDevice* UData = KernelHeapAlloc(sizeof(struct VgaSBDevice), 1, KHA_ZERO);
UData->MiscOutputRegisterReadPort = 0x03cc;
UData->MiscOutputRegisterWritePort= 0x03c2;
UData->GraphicsRegisterIndexPort = 0x03ce;
UData->GraphicsRegisterDataPort = 0x03cf;
UData->AttributeRegisterIndexPort = 0x03c0;
UData->AttributeRegisterDataPort = 0x03c1;
UData->CrtRegisterIndexPort = 0x03d4;
UData->CrtRegisterDataPort = 0x03d5;
UData->SequencerRegisterIndexPort = 0x03c4;
UData->SequencerRegisterDataPort = 0x03c5;
UData->DacWritePort = 0x03c8;
UData->DacReadPort = 0x03c7;
UData->DacDataPort = 0x03c9;
UData->Plane0 = (c8*)0xa0000;
Device->DeviceData = UData;
return 0;
}
s32 VgaSBDevice_Delete(struct SysbusDevice* Device) {
KernelHeapFree(Device->DeviceData);
return 0;
}
void* VgaSBDevice_GetCapability(struct SysbusDevice* Device, struct SysbusDeviceCapability* Capability) {
if (Capability == TextModeDisplayCapabilityGetCapability()) {
return &VgaSBDeviceTextModeDisplayCapability;
} else return 0;
}
// -- Device creation/destruction --
bool VgaInitialized = false;
bool VgaIsInitialized() { return VgaInitialized; }
void VgaInitialize() {
if (!TextModeDisplayCapabilityIsInitialized()) {
TextModeDisplayCapabilityInitialize();
}
VgaSBDevice = SysbusCreateDeviceDescription();
VgaSBDevice->DeviceName = "VGA Compatible Device";
VgaSBDevice->CreateDevice = VgaSBDevice_Create;
VgaSBDevice->DeleteDevice = VgaSBDevice_Delete;
VgaSBDevice->GetCapability = VgaSBDevice_GetCapability;
VgaInitialized = true;
}
struct SysbusDevice* VgaCreateDevice(struct SysbusDevice* Parent) {
return SysbusCreateDevice(VgaSBDevice, Parent, NULL);
}
void VgaDeleteDevice(struct SysbusDevice* Device) {
SysbusDeleteDevice(Device);
}