/[gxemul]/trunk/src/devices/dev_fb.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_fb.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Mon Oct 8 16:18:51 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 25  Line 25 
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   *   *
# Line 65  Line 65 
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  */
# Line 388  void update_framebuffer(struct vfb_data Line 388  void update_framebuffer(struct vfb_data
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);
# Line 435  void update_framebuffer(struct vfb_data Line 435  void update_framebuffer(struct vfb_data
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);
# Line 521  void update_framebuffer(struct vfb_data Line 521  void update_framebuffer(struct vfb_data
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);
# Line 936  int dev_fb_access(struct cpu *cpu, struc Line 936  int dev_fb_access(struct cpu *cpu, struc
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.
# Line 1056  struct vfb_data *dev_fb_init(struct mach Line 1056  struct vfb_data *dev_fb_init(struct mach
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);

Legend:
Removed from v.14  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26