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.110 2005/11/13 00:14:08 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 |
* |
* |
65 |
#endif |
#endif |
66 |
|
|
67 |
|
|
68 |
#define FB_TICK_SHIFT 19 |
#define FB_TICK_SHIFT 18 |
69 |
|
|
70 |
|
|
71 |
/* #define FB_DEBUG */ |
/* #define FB_DEBUG */ |
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. |
1056 |
} |
} |
1057 |
snprintf(name2, nlen, "fb [%s]", name); |
snprintf(name2, nlen, "fb [%s]", name); |
1058 |
|
|
1059 |
flags = MEM_DEFAULT; |
flags = DM_DEFAULT; |
1060 |
if ((baseaddr & 0xfff) == 0) |
if ((baseaddr & 0xfff) == 0) |
1061 |
flags = MEM_DYNTRANS_OK | MEM_DYNTRANS_WRITE_OK; |
flags = DM_DYNTRANS_OK | DM_DYNTRANS_WRITE_OK; |
1062 |
|
|
1063 |
flags |= MEM_READING_HAS_NO_SIDE_EFFECTS; |
flags |= DM_READS_HAVE_NO_SIDE_EFFECTS; |
1064 |
|
|
1065 |
memory_device_register(mem, name2, baseaddr, size, dev_fb_access, |
memory_device_register(mem, name2, baseaddr, size, dev_fb_access, |
1066 |
d, flags, d->framebuffer); |
d, flags, d->framebuffer); |