本文整理汇总了C++中scr_readw函数的典型用法代码示例。如果您正苦于以下问题:C++ scr_readw函数的具体用法?C++ scr_readw怎么用?C++ scr_readw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scr_readw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: promcon_start
static int
promcon_start(struct vc_data *conp, char *b)
{
unsigned short *s = (unsigned short *)
(conp->vc_origin + py * conp->vc_size_row + (px << 1));
u16 cs;
cs = scr_readw(s);
if (px == pw) {
unsigned short *t = s - 1;
u16 ct = scr_readw(t);
if (inverted(cs) && inverted(ct))
return sprintf(b, "\b\033[7m%c\b\033[@%c\033[m", cs,
ct);
else if (inverted(cs))
return sprintf(b, "\b\033[7m%c\033[m\b\033[@%c", cs,
ct);
else if (inverted(ct))
return sprintf(b, "\b%c\b\033[@\033[7m%c\033[m", cs,
ct);
else
return sprintf(b, "\b%c\b\033[@%c", cs, ct);
}
if (inverted(cs))
return sprintf(b, "\033[7m%c\033[m\b", cs);
else
return sprintf(b, "%c\b", cs);
}
示例2: fbcon_mfb_putcs
void fbcon_mfb_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *dest, *dest0, *cdat;
u_int rows, bold, revs, underl;
u8 d;
u16 c;
dest0 = p->screen_base+yy*fontheight(p)*p->next_line+xx;
bold = attr_bold(p,scr_readw(s));
revs = attr_reverse(p,scr_readw(s));
underl = attr_underline(p,scr_readw(s));
while (count--) {
c = scr_readw(s++) & p->charmask;
dest = dest0++;
cdat = p->fontdata+c*fontheight(p);
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = *cdat++;
if (underl && !rows)
d = 0xff;
else if (bold)
d |= d>>1;
if (revs)
d = ~d;
*dest = d;
}
}
}
示例3: promcon_end
static int
promcon_end(struct vc_data *conp, char *b)
{
unsigned short *s = (unsigned short *)
(conp->vc_origin + py * conp->vc_size_row + (px << 1));
char *p = b;
u16 cs;
b += sprintf(b, "\033[%d;%dH", py + 1, px + 1);
cs = scr_readw(s);
if (px == pw) {
unsigned short *t = s - 1;
u16 ct = scr_readw(t);
if (inverted(cs) && inverted(ct))
b += sprintf(b, "\b%c\b\033[@\033[7m%c\033[m", cs, ct);
else if (inverted(cs))
b += sprintf(b, "\b%c\b\033[@%c", cs, ct);
else if (inverted(ct))
b += sprintf(b, "\b\033[7m%c\b\033[@%c\033[m", cs, ct);
else
b += sprintf(b, "\b\033[7m%c\033[m\b\033[@%c", cs, ct);
return b - p;
}
if (inverted(cs))
b += sprintf(b, "%c\b", cs);
else
b += sprintf(b, "\033[7m%c\033[m\b", cs);
return b - p;
}
示例4: sticon_putcs
static void sticon_putcs(struct vc_data *conp, const unsigned short *s,
int count, int ypos, int xpos)
{
int redraw_cursor = 0;
if (vga_is_gfx || console_blanked)
return;
if (conp->vc_mode != KD_TEXT)
return;
#if 0
if ((p->cursor_y == ypos) && (xpos <= p->cursor_x) &&
(p->cursor_x < (xpos + count))) {
cursor_undrawn();
redraw_cursor = 1;
}
#endif
while (count--) {
sti_putc(sticon_sti, scr_readw(s++), ypos, xpos++);
}
if (redraw_cursor)
vbl_cursor_cnt = CURSOR_DRAW_DELAY;
}
示例5: bit_putcs_aligned
static inline void bit_putcs_aligned(struct vc_data *vc, struct fb_info *info,
const u16 *s, u32 attr, u32 cnt,
u32 d_pitch, u32 s_pitch, u32 cellsize,
struct fb_image *image, u8 *buf, u8 *dst)
{
u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
u32 idx = vc->vc_font.width >> 3;
u8 *src;
while (cnt--) {
src = vc->vc_font.data + (scr_readw(s++)&
charmask)*cellsize;
if (attr) {
update_attr(buf, src, attr, vc);
src = buf;
}
if (likely(idx == 1))
__fb_pad_aligned_buffer(dst, d_pitch, src, idx,
image->height);
else
fb_pad_aligned_buffer(dst, d_pitch, src, idx,
image->height);
dst += s_pitch;
}
info->fbops->fb_imageblit(info, image);
}
示例6: bit_putcs_unaligned
static inline void bit_putcs_unaligned(struct vc_data *vc,
struct fb_info *info, const u16 *s,
u32 attr, u32 cnt, u32 d_pitch,
u32 s_pitch, u32 cellsize,
struct fb_image *image, u8 *buf,
u8 *dst)
{
u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
u32 shift_low = 0, mod = vc->vc_font.width % 8;
u32 shift_high = 8;
u32 idx = vc->vc_font.width >> 3;
u8 *src;
while (cnt--) {
src = vc->vc_font.data + (scr_readw(s++)&
charmask)*cellsize;
if (attr) {
update_attr(buf, src, attr, vc);
src = buf;
}
fb_pad_unaligned_buffer(dst, d_pitch, src, idx,
image->height, shift_high,
shift_low, mod);
shift_low += mod;
dst += (shift_low >= 8) ? s_pitch : s_pitch - 1;
shift_low &= 7;
shift_high = 8 - shift_low;
}
info->fbops->fb_imageblit(info, image);
}
示例7: promcon_repaint_line
static unsigned short *
promcon_repaint_line(unsigned short *s, unsigned char *buf, unsigned char **bp)
{
int cnt = pw + 1;
int attr = -1;
unsigned char *b = *bp;
while (cnt--) {
u16 c = scr_readw(s);
if (attr != inverted(c)) {
attr = inverted(c);
if (attr) {
strcpy (b, "\033[7m");
b += 4;
} else {
strcpy (b, "\033[m");
b += 3;
}
}
*b++ = c;
s++;
if (b - buf >= 224) {
promcon_puts(buf, b - buf);
b = buf;
}
}
*bp = b;
return s;
}
示例8: mdacon_invert_region
static void mdacon_invert_region(struct vc_data *c, u16 *p, int count)
{
for (; count > 0; count--) {
scr_writew(scr_readw(p) ^ 0x0800, p);
p++;
}
}
示例9: fbcon_sti_putcs
static void fbcon_sti_putcs(struct vc_data *conp,
struct display *p,
const unsigned short *s,
int count, int yy, int xx)
{
u8 *dest, *dest0, *cdat;
u_int rows, bold, revs, underl;
u8 d;
u16 c;
if(((unsigned)xx > 200) || ((unsigned) yy > 200)) {
printk("refusing to putcs %p %p %p %d %d %d (%p)\n",
conp, p, s, count, yy, xx, __builtin_return_address(0));
return;
}
dest0 = p->screen_base+yy*fontheight(p)*p->next_line+xx;
if(((u32)dest0&0xf0000000)!=0xf0000000) {
printk("refusing to putcs %p %p %p %d %d %d (%p) %p = %p + %d * %d * %ld + %d\n",
conp, p, s, count, yy, xx, __builtin_return_address(0),
dest0, p->screen_base, yy, fontheight(p), p->next_line,
xx);
return;
}
c = scr_readw(s);
bold = attr_bold(p, c);
revs = attr_reverse(p, c);
underl = attr_underline(p, c);
while (count--) {
c = scr_readw(s++) & p->charmask;
dest = dest0++;
cdat = p->fontdata+c*fontheight(p);
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = *cdat++;
if (0 && underl && !rows)
d = 0xff;
else if (0 && bold)
d |= d>>1;
if (revs)
d = ~d;
writeb_hp (d, dest);
}
}
}
示例10: mdacon_putcs
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++);
}
}
示例11: fbcon_riva32_putcs
static void fbcon_riva32_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy,
int xx)
{
u16 c;
u32 fgx,bgx;
xx *= fontwidth(p);
yy *= fontheight(p);
c = scr_readw(s);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
while (count--) {
c = scr_readw(s++);
fbcon_riva_writechr(conp, p, c, fgx, bgx, yy, xx);
xx += fontwidth(p);
}
}
示例12: fbcon_riva16_putcs
static void fbcon_riva16_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy,
int xx)
{
u16 c;
u32 fgx,bgx;
xx *= fontwidth(p);
yy *= fontheight(p);
c = scr_readw(s);
fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
if (p->var.green.length == 6)
convert_bgcolor_16(&bgx);
while (count--) {
c = scr_readw(s++);
fbcon_riva_writechr(conp, p, c, fgx, bgx, yy, xx);
xx += fontwidth(p);
}
}
示例13: fbcon_ega_planes_putcs
/* 28.50 in my test */
void fbcon_ega_planes_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{
int fg = attr_fgcol(p,scr_readw(s));
int bg = attr_bgcol(p,scr_readw(s));
char *where;
int n;
setmode(2);
setop(0);
selectmask();
setmask(0xff);
where = p->screen_base + xx + yy * p->line_length * fontheight(p);
writeb(bg, where);
rmb();
readb(where); /* fill latches */
wmb();
selectmask();
for (n = 0; n < count; n++) {
int c = scr_readw(s++) & p->charmask;
u8 *cdat = p->fontdata + c * fontheight(p);
u8 *end = cdat + fontheight(p);
while (cdat < end) {
outb(*cdat++, GRAPHICS_DATA_REG);
wmb();
writeb(fg, where);
where += p->line_length;
}
where += 1 - p->line_length * fontheight(p);
}
wmb();
}
示例14: tile_putcs
static void tile_putcs(struct vc_data *vc, struct fb_info *info,
const unsigned short *s, int count, int yy, int xx,
int fg, int bg)
{
struct fb_tileblit blit;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int size = sizeof(u32) * count, i;
blit.sx = xx;
blit.sy = yy;
blit.width = count;
blit.height = 1;
blit.fg = fg;
blit.bg = bg;
blit.length = count;
blit.indices = (u32 *) fb_get_buffer_offset(info, &info->pixmap, size);
for (i = 0; i < count; i++)
blit.indices[i] = (u32)(scr_readw(s++) & charmask);
info->tileops->fb_tileblit(info, &blit);
}
示例15: bit_putcs
static void bit_putcs(struct vc_data *vc, struct fb_info *info,
const unsigned short *s, int count, int yy, int xx,
int fg, int bg)
{
struct fb_image image;
u32 width = DIV_ROUND_UP(vc->vc_font.width, 8);
u32 cellsize = width * vc->vc_font.height;
u32 maxcnt = info->pixmap.size/cellsize;
u32 scan_align = info->pixmap.scan_align - 1;
u32 buf_align = info->pixmap.buf_align - 1;
u32 mod = vc->vc_font.width % 8, cnt, pitch, size;
u32 attribute = get_attribute(info, scr_readw(s));
u8 *dst, *buf = NULL;
image.fg_color = fg;
image.bg_color = bg;
image.dx = xx * vc->vc_font.width;
image.dy = yy * vc->vc_font.height;
image.height = vc->vc_font.height;
image.depth = 1;
if (attribute) {
buf = kmalloc(cellsize, GFP_KERNEL);
if (!buf)
return;
}
while (count) {
if (count > maxcnt)
cnt = maxcnt;
else
cnt = count;
image.width = vc->vc_font.width * cnt;
pitch = DIV_ROUND_UP(image.width, 8) + scan_align;
pitch &= ~scan_align;
size = pitch * image.height + buf_align;
size &= ~buf_align;
dst = fb_get_buffer_offset(info, &info->pixmap, size);
image.data = dst;
if (!mod)
bit_putcs_aligned(vc, info, s, attribute, cnt, pitch,
width, cellsize, &image, buf, dst);
else
bit_putcs_unaligned(vc, info, s, attribute, cnt,
pitch, width, cellsize, &image,
buf, dst);
image.dx += cnt * vc->vc_font.width;
count -= cnt;
s += cnt;
}
/* buf is always NULL except when in monochrome mode, so in this case
it's a gain to check buf against NULL even though kfree() handles
NULL pointers just fine */
if (unlikely(buf))
kfree(buf);
}