- 時間撮記:
- 2013-12-12 下午03:10:49 (11 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Graphics/DevVGATmpl.h
r49884 r49887 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 56 56 #if DEPTH != 15 57 57 58 static inline void glue(vga_draw_glyph_line_, DEPTH)(uint8_t *d,59 int font_data,60 uint32_t xorcol,61 uint32_t bgcol,62 int dscan,63 int linesize)58 static inline void RT_CONCAT(vga_draw_glyph_line_, DEPTH)(uint8_t *d, 59 int font_data, 60 uint32_t xorcol, 61 uint32_t bgcol, 62 int dscan, 63 int linesize) 64 64 { 65 65 #if BPP == 1 … … 92 92 } 93 93 94 static void glue(vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize,95 const uint8_t *font_ptr, int h,96 uint32_t fgcol, uint32_t bgcol, int dscan)94 static void RT_CONCAT(vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize, 95 const uint8_t *font_ptr, int h, 96 uint32_t fgcol, uint32_t bgcol, int dscan) 97 97 { 98 98 uint32_t xorcol; … … 102 102 do { 103 103 font_data = font_ptr[0]; 104 glue(vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol, dscan, linesize);104 RT_CONCAT(vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol, dscan, linesize); 105 105 font_ptr += 4; 106 106 d += linesize << dscan; … … 108 108 } 109 109 110 static void glue(vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize,111 const uint8_t *font_ptr, int h,112 uint32_t fgcol, uint32_t bgcol, int dscan)110 static void RT_CONCAT(vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize, 111 const uint8_t *font_ptr, int h, 112 uint32_t fgcol, uint32_t bgcol, int dscan) 113 113 { 114 114 uint32_t xorcol; … … 118 118 do { 119 119 font_data = font_ptr[0]; 120 glue(vga_draw_glyph_line_, DEPTH)(d,121 expand4to8[font_data >> 4],122 xorcol, bgcol, dscan, linesize);123 glue(vga_draw_glyph_line_, DEPTH)(d + 8 * BPP,124 expand4to8[font_data & 0x0f],125 xorcol, bgcol, dscan, linesize);120 RT_CONCAT(vga_draw_glyph_line_, DEPTH)(d, 121 expand4to8[font_data >> 4], 122 xorcol, bgcol, dscan, linesize); 123 RT_CONCAT(vga_draw_glyph_line_, DEPTH)(d + 8 * BPP, 124 expand4to8[font_data & 0x0f], 125 xorcol, bgcol, dscan, linesize); 126 126 font_ptr += 4; 127 127 d += linesize << dscan; … … 129 129 } 130 130 131 static void glue(vga_draw_glyph9_, DEPTH)(uint8_t *d, int linesize,132 const uint8_t *font_ptr, int h,133 uint32_t fgcol, uint32_t bgcol, int dup9)131 static void RT_CONCAT(vga_draw_glyph9_, DEPTH)(uint8_t *d, int linesize, 132 const uint8_t *font_ptr, int h, 133 uint32_t fgcol, uint32_t bgcol, int dup9) 134 134 { 135 135 uint32_t xorcol, v; … … 140 140 font_data = font_ptr[0]; 141 141 #if BPP == 1 142 cpu_to_32wu((uint32_t *)d,(dmask16[(font_data >> 4)] & xorcol) ^ bgcol);142 ((uint32_t *)d)[0] = RT_H2LE_U32((dmask16[(font_data >> 4)] & xorcol) ^ bgcol); 143 143 v = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol; 144 cpu_to_32wu(((uint32_t *)d)+1,v);144 ((uint32_t *)d)[1] = RT_H2LE_U32(v); 145 145 if (dup9) 146 146 ((uint8_t *)d)[8] = v >> (24 * (1 - BIG)); … … 149 149 150 150 #elif BPP == 2 151 cpu_to_32wu(((uint32_t *)d)+0,(dmask4[(font_data >> 6)] & xorcol) ^ bgcol);152 cpu_to_32wu(((uint32_t *)d)+1,(dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol);153 cpu_to_32wu(((uint32_t *)d)+2,(dmask4[(font_data >> 2) & 3] & xorcol) ^ bgcol);151 ((uint32_t *)d)[0] = RT_H2LE_U32((dmask4[(font_data >> 6)] & xorcol) ^ bgcol); 152 ((uint32_t *)d)[1] = RT_H2LE_U32((dmask4[(font_data >> 4) & 3] & xorcol) ^ bgcol); 153 ((uint32_t *)d)[2] = RT_H2LE_U32((dmask4[(font_data >> 2) & 3] & xorcol) ^ bgcol); 154 154 v = (dmask4[(font_data >> 0) & 3] & xorcol) ^ bgcol; 155 cpu_to_32wu(((uint32_t *)d)+3,v);155 ((uint32_t *)d)[3] = RT_H2LE_U32(v); 156 156 if (dup9) 157 157 ((uint16_t *)d)[8] = v >> (16 * (1 - BIG)); … … 181 181 * 4 color mode 182 182 */ 183 static void glue(vga_draw_line2_, DEPTH)(VGAState *s1, uint8_t *d,184 const uint8_t *s, int width)183 static void RT_CONCAT(vga_draw_line2_, DEPTH)(VGAState *s1, uint8_t *d, 184 const uint8_t *s, int width) 185 185 { 186 186 uint32_t plane_mask, *palette, data, v, src_inc, dwb_mode; … … 225 225 * 4 color mode, dup2 horizontal 226 226 */ 227 static void glue(vga_draw_line2d2_, DEPTH)(VGAState *s1, uint8_t *d,228 const uint8_t *s, int width)227 static void RT_CONCAT(vga_draw_line2d2_, DEPTH)(VGAState *s1, uint8_t *d, 228 const uint8_t *s, int width) 229 229 { 230 230 uint32_t plane_mask, *palette, data, v, src_inc, dwb_mode; … … 260 260 * 16 color mode 261 261 */ 262 static void glue(vga_draw_line4_, DEPTH)(VGAState *s1, uint8_t *d,263 const uint8_t *s, int width)262 static void RT_CONCAT(vga_draw_line4_, DEPTH)(VGAState *s1, uint8_t *d, 263 const uint8_t *s, int width) 264 264 { 265 265 uint32_t plane_mask, data, v, *palette; … … 292 292 * 16 color mode, dup2 horizontal 293 293 */ 294 static void glue(vga_draw_line4d2_, DEPTH)(VGAState *s1, uint8_t *d,295 const uint8_t *s, int width)294 static void RT_CONCAT(vga_draw_line4d2_, DEPTH)(VGAState *s1, uint8_t *d, 295 const uint8_t *s, int width) 296 296 { 297 297 uint32_t plane_mask, data, v, *palette; … … 326 326 * XXX: add plane_mask support (never used in standard VGA modes) 327 327 */ 328 static void glue(vga_draw_line8d2_, DEPTH)(VGAState *s1, uint8_t *d,329 const uint8_t *s, int width)328 static void RT_CONCAT(vga_draw_line8d2_, DEPTH)(VGAState *s1, uint8_t *d, 329 const uint8_t *s, int width) 330 330 { 331 331 uint32_t *palette; … … 349 349 * XXX: add plane_mask support (never used in standard VGA modes) 350 350 */ 351 static void glue(vga_draw_line8_, DEPTH)(VGAState *s1, uint8_t *d,352 const uint8_t *s, int width)351 static void RT_CONCAT(vga_draw_line8_, DEPTH)(VGAState *s1, uint8_t *d, 352 const uint8_t *s, int width) 353 353 { 354 354 uint32_t *palette; … … 379 379 * 15 bit color 380 380 */ 381 static void glue(vga_draw_line15_, DEPTH)(VGAState *s1, uint8_t *d,382 const uint8_t *s, int width)381 static void RT_CONCAT(vga_draw_line15_, DEPTH)(VGAState *s1, uint8_t *d, 382 const uint8_t *s, int width) 383 383 { 384 384 #if DEPTH == 15 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) … … 390 390 w = width; 391 391 do { 392 v = lduw_raw((void *)s);392 v = s[0] | (s[1] << 8); 393 393 r = (v >> 7) & 0xf8; 394 394 g = (v >> 2) & 0xf8; 395 395 b = (v << 3) & 0xf8; 396 ((PIXEL_TYPE *)d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b);396 ((PIXEL_TYPE *)d)[0] = RT_CONCAT(rgb_to_pixel, DEPTH)(r, g, b); 397 397 s += 2; 398 398 d += BPP; … … 405 405 * 16 bit color 406 406 */ 407 static void glue(vga_draw_line16_, DEPTH)(VGAState *s1, uint8_t *d,408 const uint8_t *s, int width)407 static void RT_CONCAT(vga_draw_line16_, DEPTH)(VGAState *s1, uint8_t *d, 408 const uint8_t *s, int width) 409 409 { 410 410 #if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) … … 416 416 w = width; 417 417 do { 418 v = lduw_raw((void *)s);418 v = s[0] | (s[1] << 8); 419 419 r = (v >> 8) & 0xf8; 420 420 g = (v >> 3) & 0xfc; 421 421 b = (v << 3) & 0xf8; 422 ((PIXEL_TYPE *)d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b);422 ((PIXEL_TYPE *)d)[0] = RT_CONCAT(rgb_to_pixel, DEPTH)(r, g, b); 423 423 s += 2; 424 424 d += BPP; … … 431 431 * 24 bit color 432 432 */ 433 static void glue(vga_draw_line24_, DEPTH)(VGAState *s1, uint8_t *d,434 const uint8_t *s, int width)433 static void RT_CONCAT(vga_draw_line24_, DEPTH)(VGAState *s1, uint8_t *d, 434 const uint8_t *s, int width) 435 435 { 436 436 int w; … … 449 449 r = s[2]; 450 450 #endif 451 ((PIXEL_TYPE *)d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b);451 ((PIXEL_TYPE *)d)[0] = RT_CONCAT(rgb_to_pixel, DEPTH)(r, g, b); 452 452 s += 3; 453 453 d += BPP; … … 458 458 * 32 bit color 459 459 */ 460 static void glue(vga_draw_line32_, DEPTH)(VGAState *s1, uint8_t *d,461 const uint8_t *s, int width)460 static void RT_CONCAT(vga_draw_line32_, DEPTH)(VGAState *s1, uint8_t *d, 461 const uint8_t *s, int width) 462 462 { 463 463 #if DEPTH == 32 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) … … 478 478 r = s[2]; 479 479 #endif 480 ((PIXEL_TYPE *)d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b);480 ((PIXEL_TYPE *)d)[0] = RT_CONCAT(rgb_to_pixel, DEPTH)(r, g, b); 481 481 s += 4; 482 482 d += BPP; … … 491 491 static 492 492 #endif/* VBOX */ 493 void glue(vga_draw_cursor_line_, DEPTH)(uint8_t *d1,494 const uint8_t *src1,495 int poffset, int w,496 unsigned int color0,497 unsigned int color1,498 unsigned int color_xor)493 void RT_CONCAT(vga_draw_cursor_line_, DEPTH)(uint8_t *d1, 494 const uint8_t *src1, 495 int poffset, int w, 496 unsigned int color0, 497 unsigned int color1, 498 unsigned int color_xor) 499 499 { 500 500 const uint8_t *plane0, *plane1;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器