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

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

revision 34 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_gs.c,v 1.22 2006/12/30 13:30:58 debug Exp $   *  $Id: dev_ps2_gs.c,v 1.23 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  Playstation 2 "graphics system".   *  COMMENT: PlayStation 2 graphics system
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 71  char *gs_reg_names[15] = { Line 71  char *gs_reg_names[15] = {
71          "PMODE", "SMODE1", "SMODE2", "SRFSH",          "PMODE", "SMODE1", "SMODE2", "SRFSH",
72          "SYNCH1", "SYNCH2", "SYNCV", "DISPFB1",          "SYNCH1", "SYNCH2", "SYNCV", "DISPFB1",
73          "DISPLAY1", "DISPFB2", "DISPLAY2", "EXTBUF",          "DISPLAY1", "DISPFB2", "DISPLAY2", "EXTBUF",
74          "EXTDATA", "EXTWRITE", "BGCOLOR"          "EXTDATA", "EXTWRITE", "BGCOLOR"  };
         };  
75    
76  #define GS_S_CSR_REG            0x100  #define GS_S_CSR_REG            0x100
77  #define GS_S_IMR_REG            0x101  #define GS_S_IMR_REG            0x101
# Line 84  char *gs_reg_high_names[4] = { Line 83  char *gs_reg_high_names[4] = {
83          };          };
84    
85    
 /*  
  *  dev_ps2_gs_access():  
  */  
86  DEVICE_ACCESS(ps2_gs)  DEVICE_ACCESS(ps2_gs)
87  {  {
88            struct gs_data *d = extra;
89          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
90          size_t i;          size_t i;
91          int regnr;          int regnr;
         struct gs_data *d = extra;  
92    
93          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
94                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);
# Line 148  DEVINIT(ps2_gs) Line 144  DEVINIT(ps2_gs)
144          struct gs_data *d;          struct gs_data *d;
145          char str[100];          char str[100];
146    
147          d = malloc(sizeof(struct gs_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct gs_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
148          memset(d, 0, sizeof(struct gs_data));          memset(d, 0, sizeof(struct gs_data));
149    
150          snprintf(str, sizeof(str) - 1, "ps2_gif addr=0x%llx",          snprintf(str, sizeof(str) - 1, "ps2_gif addr=0x%llx",

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

  ViewVC Help
Powered by ViewVC 1.1.26