25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_fb.c,v 1.107 2005/09/18 19:54:15 debug Exp $ |
* $Id: dev_fb.c,v 1.108 2005/10/20 22:49:07 debug Exp $ |
29 |
* |
* |
30 |
* Generic framebuffer device. |
* Generic framebuffer device. |
31 |
* |
* |
32 |
* DECstation VFB01 monochrome framebuffer, 1024x864 |
* DECstation VFB01 monochrome framebuffer, 1024x864 |
33 |
* DECstation VFB02 8-bit color framebuffer, 1024x864 |
* DECstation VFB02 8-bit color framebuffer, 1024x864 |
34 |
* DECstation Maxine, 1024x768 8-bit color |
* DECstation Maxine, 1024x768 8-bit color |
35 |
* HPCmips framebuffer |
* HPC (mips, arm, ..) framebuffer |
36 |
* Playstation 2 (24-bit color) |
* Playstation 2 (24-bit color) |
37 |
* generic (any resolution, several bit depths possible) |
* generic (any resolution, several bit depths possible) |
38 |
* |
* |
388 |
c = d->framebuffer[fb_addr >> 3]; |
c = d->framebuffer[fb_addr >> 3]; |
389 |
fb_addr &= 7; |
fb_addr &= 7; |
390 |
|
|
391 |
/* HPCmips is reverse: */ |
/* HPC is reverse: */ |
392 |
if (d->vfb_type == VFB_HPCMIPS) |
if (d->vfb_type == VFB_HPC) |
393 |
fb_addr = 8 - d->bit_depth - fb_addr; |
fb_addr = 8 - d->bit_depth - fb_addr; |
394 |
|
|
395 |
c = (c >> fb_addr) & ((1<<d->bit_depth) - 1); |
c = (c >> fb_addr) & ((1<<d->bit_depth) - 1); |
435 |
break; |
break; |
436 |
/* TODO: copy to the scaledown code below */ |
/* TODO: copy to the scaledown code below */ |
437 |
case 16: |
case 16: |
438 |
if (d->vfb_type == VFB_HPCMIPS) { |
if (d->vfb_type == VFB_HPC) { |
439 |
b = d->framebuffer[fb_addr] + |
b = d->framebuffer[fb_addr] + |
440 |
(d->framebuffer[fb_addr+1] |
(d->framebuffer[fb_addr+1] |
441 |
<< 8); |
<< 8); |
521 |
c = d->framebuffer[fb_addr >> 3]; |
c = d->framebuffer[fb_addr >> 3]; |
522 |
fb_addr &= 7; |
fb_addr &= 7; |
523 |
|
|
524 |
/* HPCmips is reverse: */ |
/* HPC is reverse: */ |
525 |
if (d->vfb_type == VFB_HPCMIPS) |
if (d->vfb_type == VFB_HPC) |
526 |
fb_addr = 8 - d->bit_depth - fb_addr; |
fb_addr = 8 - d->bit_depth - fb_addr; |
527 |
|
|
528 |
c = (c >> fb_addr) & ((1<<d->bit_depth) - 1); |
c = (c >> fb_addr) & ((1<<d->bit_depth) - 1); |
936 |
* |
* |
937 |
* VFB_DEC_VFB01, _VFB02, and VFB_DEC_MAXINE are DECstation specific. |
* VFB_DEC_VFB01, _VFB02, and VFB_DEC_MAXINE are DECstation specific. |
938 |
* |
* |
939 |
* If type is VFB_HPCMIPS, then color encoding differs from the generic case. |
* If type is VFB_HPC, then color encoding differs from the generic case. |
940 |
* |
* |
941 |
* If bit_depth = -15 (note the minus sign), then a special hack is used for |
* If bit_depth = -15 (note the minus sign), then a special hack is used for |
942 |
* the Playstation Portable's 5-bit R, 5-bit G, 5-bit B. |
* the Playstation Portable's 5-bit R, 5-bit G, 5-bit B. |