Exemple #1
0
void fb_put(char c)
{
    uint32_t location = fb_position();

    if (c == 0x08 && s_fbx)
    {
        s_fbx--;
    }
    else if (c == '\r')
    {
        s_fbx = 0;
    }
    else if (c == '\n')
    {
        s_fbx = 0;
        s_fby++;
    }
    else if (c >= ' ')
    {
        FB[location] = c | s_attribute;
        s_fbx++;
    }

    if (s_fbx >= FB_COLUMNS)
    {
        s_fbx = 0;
        s_fby++;
    }
    fb_scroll();
    fb_move_cursor();
}
Exemple #2
0
static inline void fb_move_cursor()
{
    uint16_t location = fb_position();
    outb(FB_COMMAND_PORT, FB_HIGH_BYTE_COMMAND);
    outb(FB_DATA_PORT,    ((location >> 8) & 0x00ff));
    outb(FB_COMMAND_PORT, FB_LOW_BYTE_COMMAND);
    outb(FB_DATA_PORT,    location & 0x00ff);
}
Exemple #3
0
static void document_new_position( void )
{
    region_lay_tag  *top_reg;
    spacing_bu      top_pos;

    /* The value used for fb_position() should be the first line of text,
     * even if that is from a TITLE tag (top banners do not apply to TITLEP).
     * This handles documents starting with banners and text only.
     */

    if( sect_ban_top[page & 1] != NULL ) {
        top_reg = sect_ban_top[page & 1]->top_line;
        if( bin_driver->y_positive == 0x00 ) {
            top_pos = g_page_top_org - top_reg->reg_depth;
        } else {
            top_pos = g_page_top_org + top_reg->reg_depth;
        }
        g_cur_v_start = top_pos;
    } else {
        top_pos = g_page_top;
        if( bin_driver->y_positive == 0x00 ) {
            g_cur_v_start = g_page_top - wgml_fonts[0].line_height;
        } else {
            g_cur_v_start = g_page_top + wgml_fonts[0].line_height;
        }
    }
    g_cur_h_start = g_page_left_org;

    if( GlobalFlags.lastpass ) {
        if( ProcFlags.fb_position_done ) {
            fb_new_section( g_cur_v_start );
        } else {
            fb_position( g_cur_h_start, g_cur_v_start );
            ProcFlags.fb_position_done = true;
        }
    }
    g_cur_v_start = top_pos; // reset so first line positioning is correct
    return;
}