コード例 #1
0
ファイル: video.c プロジェクト: GYGit/reactos
VOID
NTAPI
LlbVideoDrawChar(IN UCHAR c,
                 IN PUSHORT Buffer,
                 IN USHORT Color,
                 IN USHORT BackColor)
{
    PCHAR Pixels;
    CHAR Line;
    ULONG y, ScreenWidth;
    LONG x;

    /* Get screen width */
    ScreenWidth = LlbHwGetScreenWidth();
    Pixels = LlbHwBootFont + c * FONT_HEIGHT;

    /* Loop y pixels */
    for (y = 0; y < FONT_HEIGHT; y++)
    {
        /* Loop x pixels */
        Line = *Pixels++;
        for (x = 7; x >= 0; x--)
        {
            /* Draw either a character or background pixel */
            Buffer[x] = (Line & 1) ? Color : BackColor;
            Line >>= 1;
        }
        
        /* Next line */
        Buffer += ScreenWidth;
    }
}
コード例 #2
0
ファイル: fw.c プロジェクト: HBelusca/NasuTek-Odyssey
VOID
LlbFwVideoGetDisplaySize(OUT PULONG Width,
                         OUT PULONG Height,
                         OUT PULONG Depth)
{
    /* Query static settings */
    *Width = LlbHwGetScreenWidth() / 8;
    *Height = LlbHwGetScreenHeight() / 16;
    
    /* Depth is always 16 bpp */
    *Depth = 16;
}
コード例 #3
0
ファイル: video.c プロジェクト: GYGit/reactos
VOID
NTAPI
LlbVideoPutChar(IN UCHAR c)
{
    ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
    
    /* Backcolor on this machine */
#ifdef BLUE_SCREEN
      BackColor = LlbHwVideoCreateColor(14, 0, 82);
#else
      BackColor = LlbHwVideoCreateColor(0, 0, 0);
#endif
    
    /* Amount of characters in a line */
    ScreenWidth = LlbHwGetScreenWidth();
    CharsPerLine = ScreenWidth / 8;

    /* Handle new line and scrolling */
    if (c == '\n')
    {
        /* Move a line down */
        ScreenCursor += CharsPerLine - (ScreenCursor % CharsPerLine);
    
        /* FIXME: Scrolling */
    }
    else
    {
        /* Calculate character position from pixel position */
        cy = (ScreenCursor / CharsPerLine) * FONT_HEIGHT;
        cx = (ScreenCursor % CharsPerLine) * 8;

        /* Draw the character and increment the cursor */
        LlbVideoDrawChar(c,
                         (PUSHORT)LlbHwGetFrameBuffer() + ScreenWidth * cy + cx,
                         0xFFFF,
                         BackColor);
        ScreenCursor++;
    }
}
コード例 #4
0
ファイル: video.c プロジェクト: GYGit/reactos
VOID
NTAPI
LlbVideoClearScreen(IN BOOLEAN OsLoader)
{
    ULONG ScreenSize, p;
    ULONG BackColor;
    PUSHORT VideoBuffer;
    
    /* Get frame buffer and reset cursor position */
    VideoBuffer = LlbHwGetFrameBuffer();
    ScreenCursor = 0;
    
    /* Backcolor on this machine */
    if (OsLoader)
    {
        /* Black */
        BackColor = 0;
    }
    else
    {
        /* Deep blue */
#ifdef BLUE_SCREEN
        BackColor = LlbHwVideoCreateColor(14, 0, 82);
#else
        BackColor = LlbHwVideoCreateColor(0, 0, 0);
#endif
        BackColor = (BackColor << 16) | BackColor;
    }
    
    /* Screen size on this machine */
    ScreenSize = LlbHwGetScreenWidth() * LlbHwGetScreenHeight();
    
    /* Clear the screen with the given color */
    for (p = 0; p < ScreenSize * 2; p += 4)
    {
        *(PULONG)((PCHAR)VideoBuffer + p) = BackColor;
    }
}
コード例 #5
0
ファイル: fw.c プロジェクト: HBelusca/NasuTek-Odyssey
VOID
LlbFwVideoPutChar(IN INT c,
                  IN UCHAR Attr,
                  IN ULONG X,
                  IN ULONG Y)
{
    ULONG Color, BackColor;
    PUSHORT Buffer;
    
    /* Convert EGA index to color used by hardware */
    Color = LlbHwVideoCreateColor(ColorPalette[Attr & 0xF][0],
                                  ColorPalette[Attr & 0xF][1],
                                  ColorPalette[Attr & 0xF][2]);
    BackColor = LlbHwVideoCreateColor(ColorPalette[Attr >> 4][0],
                                      ColorPalette[Attr >> 4][1],
                                      ColorPalette[Attr >> 4][2]);
                                      
    /* Compute buffer address */
    Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
                                      
    /* Draw it */
    LlbVideoDrawChar(c, Buffer, Color, BackColor);
}