/[gxemul]/trunk/src/devices/dev_ps2_gif.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_ps2_gif.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_ps2_gif.c,v 1.34 2006/12/30 13:30:58 debug Exp $   *  $Id: dev_ps2_gif.c,v 1.35 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  Playstation 2 "gif" graphics device.   *  COMMENT: PlayStation 2 "gif" graphics device
31   *   *
32   *  TODO:  Convert dev_fb_access() accesses into direct framebuffer reads and   *  TODO:  Convert dev_fb_access() accesses into direct framebuffer reads and
33   *         writes, to improve performance.   *         writes, to improve performance.
# Line 73  void test_triangle(struct gif_data *d, Line 73  void test_triangle(struct gif_data *d,
73          int x2, int y2, int r2, int g2, int b2,          int x2, int y2, int r2, int g2, int b2,
74          int x3, int y3, int r3, int g3, int b3)          int x3, int y3, int r3, int g3, int b3)
75  {  {
76          unsigned char *line = malloc(d->xsize * d->bytes_per_pixel);          unsigned char *line;
77          int y, tmp, scale = 32768;          int y, tmp, scale = 32768;
78          int xofs, xlen, savedxlen, xdir, x;          int xofs, xlen, savedxlen, xdir, x;
79          int r, g, b;                    /*  scaled  */          int r, g, b;                    /*  scaled  */
# Line 87  void test_triangle(struct gif_data *d, Line 87  void test_triangle(struct gif_data *d,
87          int gpy12, gpy13, gpy23;          int gpy12, gpy13, gpy23;
88          int bpy12, bpy13, bpy23;          int bpy12, bpy13, bpy23;
89    
90            CHECK_ALLOCATION(line = malloc(d->xsize * d->bytes_per_pixel));
91    
92          if (y2 > y3) {          if (y2 > y3) {
93                  tmp = x2; x2 = x3; x3 = tmp;                  tmp = x2; x2 = x3; x3 = tmp;
94                  tmp = y2; y2 = y3; y3 = tmp;                  tmp = y2; y2 = y3; y3 = tmp;
# Line 204  void test_triangle(struct gif_data *d, Line 206  void test_triangle(struct gif_data *d,
206  }  }
207    
208    
 /*  
  *  dev_ps2_gif_access():  
  */  
209  DEVICE_ACCESS(ps2_gif)  DEVICE_ACCESS(ps2_gif)
210  {  {
211          unsigned int i;          unsigned int i;
# Line 403  DEVINIT(ps2_gif) Line 402  DEVINIT(ps2_gif)
402  {  {
403          struct gif_data *d;          struct gif_data *d;
404    
405          d = malloc(sizeof(struct gif_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct gif_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
406          memset(d, 0, sizeof(struct gif_data));          memset(d, 0, sizeof(struct gif_data));
407    
408          d->transparent_text = 0;          d->transparent_text = 0;

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

  ViewVC Help
Powered by ViewVC 1.1.26