/[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 11 by dpavlin, Mon Oct 8 16:18:27 2007 UTC revision 12 by dpavlin, Mon Oct 8 16:18:38 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_fb.c,v 1.99 2005/06/26 13:49:06 debug Exp $   *  $Id: dev_fb.c,v 1.106 2005/08/14 11:14:38 debug Exp $
29   *     *  
30   *  Generic framebuffer device.   *  Generic framebuffer device.
31   *   *
# Line 65  Line 65 
65  #endif  #endif
66    
67    
68  #define FB_TICK_SHIFT           18  #define FB_TICK_SHIFT           19
   
 #define LOGO_XSIZE              256  
 #define LOGO_YSIZE              256  
 #define LOGO_BOTTOM_MARGIN      60  
 /*  This must be a 256*256 pixels P4 ppm:  */  
 #include "fb_logo.c"  
 unsigned char *fb_logo = fb_logo_ppm + 11;  
69    
70    
71  /*  #define FB_DEBUG  */  /*  #define FB_DEBUG  */
# Line 480  void update_framebuffer(struct vfb_data Line 473  void update_framebuffer(struct vfb_data
473                  return;                  return;
474          }          }
475    
476          /*  scaledown != 1:  */          /*  scaledown > 1:  */
477    
478          scaledown = d->vfb_scaledown;          scaledown = d->vfb_scaledown;
479          scaledownXscaledown = scaledown * scaledown;          scaledownXscaledown = scaledown * scaledown;
# Line 623  void dev_fb_tick(struct cpu *cpu, void * Line 616  void dev_fb_tick(struct cpu *cpu, void *
616          if (!cpu->machine->use_x11)          if (!cpu->machine->use_x11)
617                  return;                  return;
618    
 #ifdef BINTRANS  
619          do {          do {
620                  uint64_t low = -1, high;                  uint64_t high, low = (uint64_t)(int64_t) -1;
621                  int x, y;                  int x, y;
622    
623                  memory_device_bintrans_access(cpu, cpu->mem,                  memory_device_dyntrans_access(cpu, cpu->mem,
624                      extra, &low, &high);                      extra, &low, &high);
625                  if ((int64_t)low == -1)                  if ((int64_t)low == -1)
626                          break;                          break;
# Line 689  void dev_fb_tick(struct cpu *cpu, void * Line 681  void dev_fb_tick(struct cpu *cpu, void *
681                          d->update_x2 = d->xsize-1;                          d->update_x2 = d->xsize-1;
682                  }                  }
683          } while (0);          } while (0);
 #endif  
684    
685  #ifdef WITH_X11  #ifdef WITH_X11
686          /*  Do we need to redraw the cursor?  */          /*  Do we need to redraw the cursor?  */
# Line 928  int dev_fb_access(struct cpu *cpu, struc Line 919  int dev_fb_access(struct cpu *cpu, struc
919   */   */
920  struct vfb_data *dev_fb_init(struct machine *machine, struct memory *mem,  struct vfb_data *dev_fb_init(struct machine *machine, struct memory *mem,
921          uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize,          uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize,
922          int xsize, int ysize, int bit_depth, char *name, int logo)          int xsize, int ysize, int bit_depth, char *name)
923  {  {
924          struct vfb_data *d;          struct vfb_data *d;
925          size_t size, nlen;          size_t size, nlen;
926          int x, y, flags;          int flags;
927          char title[400];          char title[400];
928          char *name2;          char *name2;
929    
# Line 1016  struct vfb_data *dev_fb_init(struct mach Line 1007  struct vfb_data *dev_fb_init(struct mach
1007          d->update_x2 = d->update_y2 = -1;          d->update_x2 = d->update_y2 = -1;
1008    
1009    
         /*  A nice bootup logo:  */  
         if (logo) {  
                 int logo_bottom_margin = LOGO_BOTTOM_MARGIN;  
   
                 d->update_x1 = 0;  
                 d->update_x2 = LOGO_XSIZE-1;  
                 d->update_y1 = d->visible_ysize-LOGO_YSIZE-logo_bottom_margin;  
                 d->update_y2 = d->visible_ysize-logo_bottom_margin;  
                 for (y=0; y<LOGO_YSIZE; y++)  
                         for (x=0; x<LOGO_XSIZE; x++) {  
                                 int s, a = ((y + d->visible_ysize - LOGO_YSIZE  
                                     - logo_bottom_margin)*d->xsize + x)  
                                     * d->bit_depth / 8;  
                                 int b = fb_logo[(y*LOGO_XSIZE+x) / 8] &  
                                     (128 >> (x&7));  
                                 for (s=0; s<d->bit_depth / 8; s++)  
                                         if (a+s >= 0 && a+s < size)  
                                                 d->framebuffer[a+s] = b? 0:255;  
                         }  
         }  
   
1010          /*  Don't set the title to include the size of the framebuffer for          /*  Don't set the title to include the size of the framebuffer for
1011              VGA, since then the resolution might change during runtime.  */              VGA, since then the resolution might change during runtime.  */
1012          if (strcmp(name, "VGA") == 0)          if (strcmp(name, "VGA") == 0)
# Line 1064  struct vfb_data *dev_fb_init(struct mach Line 1034  struct vfb_data *dev_fb_init(struct mach
1034    
1035          flags = MEM_DEFAULT;          flags = MEM_DEFAULT;
1036          if ((baseaddr & 0xfff) == 0)          if ((baseaddr & 0xfff) == 0)
1037                  flags = MEM_BINTRANS_OK | MEM_BINTRANS_WRITE_OK;                  flags = MEM_DYNTRANS_OK | MEM_DYNTRANS_WRITE_OK;
1038    
1039          flags |= MEM_READING_HAS_NO_SIDE_EFFECTS;          flags |= MEM_READING_HAS_NO_SIDE_EFFECTS;
1040    

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26