/[gxemul]/trunk/src/devices/dev_sgi_gbe.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_sgi_gbe.c

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

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_sgi_gbe.c,v 1.35 2006/12/30 13:30:59 debug Exp $   *  $Id: dev_sgi_gbe.c,v 1.37 2007/06/15 19:57:34 debug Exp $
29     *
30     *  COMMENT: SGI "gbe", graphics controller + framebuffer
31   *   *
  *  SGI "gbe", graphics controller. Framebuffer.  
32   *  Loosely inspired by Linux code.   *  Loosely inspired by Linux code.
33   */   */
34    
# Line 83  struct sgi_gbe_data { Line 84  struct sgi_gbe_data {
84   *  These numbers (when << 16 bits) are pointers to the tiles. Tiles are   *  These numbers (when << 16 bits) are pointers to the tiles. Tiles are
85   *  512x128 in 8-bit mode, 256x128 in 16-bit mode, and 128x128 in 32-bit mode.   *  512x128 in 8-bit mode, 256x128 in 16-bit mode, and 128x128 in 32-bit mode.
86   */   */
87  void dev_sgi_gbe_tick(struct cpu *cpu, void *extra)  DEVICE_TICK(sgi_gbe)
88  {  {
89          struct sgi_gbe_data *d = extra;          struct sgi_gbe_data *d = extra;
90          int tile_nr = 0, on_screen = 1, xbase = 0, ybase = 0;          int tile_nr = 0, on_screen = 1, xbase = 0, ybase = 0;
# Line 204  for (i=0; i<pixels_per_line * d->bitdept Line 205  for (i=0; i<pixels_per_line * d->bitdept
205  }  }
206    
207    
 /*  
  *  dev_sgi_gbe_access():  
  */  
208  DEVICE_ACCESS(sgi_gbe)  DEVICE_ACCESS(sgi_gbe)
209  {  {
210          struct sgi_gbe_data *d = extra;          struct sgi_gbe_data *d = extra;
# Line 413  odata = random();      /*  testhack for the i Line 411  odata = random();      /*  testhack for the i
411  }  }
412    
413    
 /*  
  *  dev_sgi_gbe_init():  
  */  
414  void dev_sgi_gbe_init(struct machine *machine, struct memory *mem,  void dev_sgi_gbe_init(struct machine *machine, struct memory *mem,
415          uint64_t baseaddr)          uint64_t baseaddr)
416  {  {
417          struct sgi_gbe_data *d;          struct sgi_gbe_data *d;
418    
419          d = malloc(sizeof(struct sgi_gbe_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct sgi_gbe_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
420          memset(d, 0, sizeof(struct sgi_gbe_data));          memset(d, 0, sizeof(struct sgi_gbe_data));
421    
422          /*  640x480 for Linux:  */          /*  640x480 for Linux:  */
# Line 443  void dev_sgi_gbe_init(struct machine *ma Line 434  void dev_sgi_gbe_init(struct machine *ma
434    
435          memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH,          memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH,
436              dev_sgi_gbe_access, d, DM_DEFAULT, NULL);              dev_sgi_gbe_access, d, DM_DEFAULT, NULL);
437          machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18, 0.0);          machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18);
438  }  }
439    

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26