All pastes #30514 Raw Edit

Anonymous

public text v1 · immutable
#30514 ·published 2005-11-23 06:01 UTC
rendered paste body
static void
print(char *str)
{
    char *dest = (char *)cur_pos;

    while(*str) {
        *dest++ = *str++;
        dest++;

        if(++x >= 80) {
            x = 0;
            ++y;
        }
    }

    mov_cur();
    return;
}


static inline void
mov_cur(void)
{
    calc_offset();

    outportb(CRTC_INDEX, 14);       /* MSB of offset to CRTC reg 14 */
    outportb(CRTC_DATA,  (char)cur_pos >> 8);
    outportb(CRTC_INDEX, 15);       /* LSB of offset to CRTC reg 15 */
    outportb(CRTC_DATA,  (char)cur_pos);

    return;
}