/[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 4 by dpavlin, Mon Oct 8 16:18:00 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_sgi_gbe.c,v 1.21 2005/02/11 09:29:48 debug Exp $   *  $Id: dev_sgi_gbe.c,v 1.26 2005/08/16 05:37:12 debug Exp $
29   *   *
30   *  SGI "gbe", graphics controller. Framebuffer.   *  SGI "gbe", graphics controller. Framebuffer.
31   *  Loosely inspired by Linux code.   *  Loosely inspired by Linux code.
# Line 47  Line 47 
47  #define FAKE_GBE_FB_ADDRESS     0x38000000  #define FAKE_GBE_FB_ADDRESS     0x38000000
48    
49  #define GBE_DEBUG  #define GBE_DEBUG
50    /*  #define debug fatal  */
51    
52    /* #define MTE_TEST */
53    
54  #define GBE_DEFAULT_XRES                640  #define GBE_DEFAULT_XRES                640
55  #define GBE_DEFAULT_YRES                480  #define GBE_DEFAULT_YRES                480
# Line 87  void dev_sgi_gbe_tick(struct cpu *cpu, v Line 90  void dev_sgi_gbe_tick(struct cpu *cpu, v
90          unsigned char tileptr_buf[sizeof(uint16_t)];          unsigned char tileptr_buf[sizeof(uint16_t)];
91          uint64_t tileptr, tiletable;          uint64_t tileptr, tiletable;
92          int lines_to_copy, pixels_per_line, y;          int lines_to_copy, pixels_per_line, y;
93          unsigned char buf[16384];               /*  must be power of 2, at most 65536  */          unsigned char buf[16384];       /*  must be power of 2, at most 65536 */
94          int copy_len, copy_offset;          int copy_len, copy_offset;
95          uint64_t old_fb_offset = 0;          uint64_t old_fb_offset = 0;
96          int tweaked = 1;          int tweaked = 1;
97    
98    #ifdef MTE_TEST
99    return;
100    #endif
101    
102          /*  debug("[ sgi_gbe: dev_sgi_gbe_tick() ]\n");  */          /*  debug("[ sgi_gbe: dev_sgi_gbe_tick() ]\n");  */
103    
104          tiletable = (d->frm_control & 0xfffffe00);          tiletable = (d->frm_control & 0xfffffe00);
105          if (tiletable == 0)          if (tiletable == 0)
106                  on_screen = 0;                  on_screen = 0;
107    /*
108    tweaked = 0;
109    */
110          while (on_screen) {          while (on_screen) {
111                  /*  Get pointer to a tile:  */                  /*  Get pointer to a tile:  */
112                  cpu->memory_rw(cpu, cpu->mem, tiletable +                  cpu->memory_rw(cpu, cpu->mem, tiletable +
# Line 155  void dev_sgi_gbe_tick(struct cpu *cpu, v Line 164  void dev_sgi_gbe_tick(struct cpu *cpu, v
164                                  cpu->memory_rw(cpu, cpu->mem, tileptr + 512 * y,                                  cpu->memory_rw(cpu, cpu->mem, tileptr + 512 * y,
165                                      buf, pixels_per_line * d->bitdepth / 8,                                      buf, pixels_per_line * d->bitdepth / 8,
166                                      MEM_READ, NO_EXCEPTIONS | PHYSICAL);                                      MEM_READ, NO_EXCEPTIONS | PHYSICAL);
167    #if 0
168    {
169    int i;
170    for (i=0; i<pixels_per_line * d->bitdepth / 8; i++)
171            buf[i] ^= (random() & 0x20);
172    }
173    #endif
174                                  dev_fb_access(cpu, cpu->mem, ((ybase + y) *                                  dev_fb_access(cpu, cpu->mem, ((ybase + y) *
175                                      d->xres + xbase) * d->bitdepth / 8,                                      d->xres + xbase) * d->bitdepth / 8,
176                                      buf, pixels_per_line * d->bitdepth / 8,                                      buf, pixels_per_line * d->bitdepth / 8,
# Line 387  void dev_sgi_gbe_init(struct machine *ma Line 402  void dev_sgi_gbe_init(struct machine *ma
402          d->xres = GBE_DEFAULT_XRES;          d->xres = GBE_DEFAULT_XRES;
403          d->yres = GBE_DEFAULT_YRES;          d->yres = GBE_DEFAULT_YRES;
404          d->bitdepth = 8;          d->bitdepth = 8;
405    #if 0
406          d->control = 0x20aa000;         /*  or 0x00000001?  */          d->control = 0x20aa000;         /*  or 0x00000001?  */
407    #endif
408          d->fb_data = dev_fb_init(machine, mem, FAKE_GBE_FB_ADDRESS,          d->fb_data = dev_fb_init(machine, mem, FAKE_GBE_FB_ADDRESS,
409              VFB_GENERIC, d->xres, d->yres, d->xres, d->yres, 8, "SGI GBE", 0);              VFB_GENERIC, d->xres, d->yres, d->xres, d->yres, 8, "SGI GBE");
410          set_grayscale_palette(d->fb_data, 256);          set_grayscale_palette(d->fb_data, 256);
411    
412          memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH,          memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH,

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

  ViewVC Help
Powered by ViewVC 1.1.26