static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) { u16 eattr = mda_convert_attr(c->vc_scrl_erase_char); if (!lines) return 0; if (lines > c->vc_rows) /* maximum realistic size */ lines = c->vc_rows; switch (dir) { case SM_UP: scr_memmovew(MDA_ADDR(0,t), MDA_ADDR(0,t+lines), (b-t-lines)*mda_num_columns*2); scr_memsetw(MDA_ADDR(0,b-lines), eattr, lines*mda_num_columns*2); break; case SM_DOWN: scr_memmovew(MDA_ADDR(0,t+lines), MDA_ADDR(0,t), (b-t-lines)*mda_num_columns*2); scr_memsetw(MDA_ADDR(0,t), eattr, lines*mda_num_columns*2); break; } return 0; }
static bool mdacon_scroll(struct vc_data *c, unsigned int t, unsigned int b, enum con_scroll dir, unsigned int lines) { u16 eattr = mda_convert_attr(c->vc_video_erase_char); if (!lines) return false; if (lines > c->vc_rows) /* maximum realistic size */ lines = c->vc_rows; switch (dir) { case SM_UP: scr_memmovew(mda_addr(0, t), mda_addr(0, t + lines), (b-t-lines)*mda_num_columns*2); scr_memsetw(mda_addr(0, b - lines), eattr, lines*mda_num_columns*2); break; case SM_DOWN: scr_memmovew(mda_addr(0, t + lines), mda_addr(0, t), (b-t-lines)*mda_num_columns*2); scr_memsetw(mda_addr(0, t), eattr, lines*mda_num_columns*2); break; } return false; }
static void mdacon_putcs(struct vc_data *c, const unsigned short *s, int count, int y, int x) { u16 *dest = MDA_ADDR(x, y); for (; count > 0; count--) { scr_writew(mda_convert_attr(scr_readw(s++)), dest++); } }
static void mdacon_clear(struct vc_data *c, int y, int x, int height, int width) { u16 *dest = MDA_ADDR(x, y); u16 eattr = mda_convert_attr(c->vc_video_erase_char); if (width <= 0 || height <= 0) return; if (x==0 && width==mda_num_columns) { scr_memsetw(dest, eattr, height*width*2); } else { for (; height > 0; height--, dest+=mda_num_columns) scr_memsetw(dest, eattr, width*2); } }
static int mdacon_blank(struct vc_data *c, int blank, int mode_switch) { if (mda_type == TYPE_MDA) { if (blank) scr_memsetw((void *)mda_vram_base, mda_convert_attr(c->vc_video_erase_char), c->vc_screenbuf_size); /* Tell console.c that it has to restore the screen itself */ return 1; } else { if (blank) outb_p(0x00, mda_mode_port); /* disable video */ else outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, mda_mode_port); return 0; } }
static void mdacon_putc(struct vc_data *c, int ch, int y, int x) { scr_writew(mda_convert_attr(ch), MDA_ADDR(x, y)); }