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

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

revision 41 by dpavlin, Mon Oct 8 16:22:11 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_pvr.c,v 1.21 2007/04/28 09:19:52 debug Exp $   *  $Id: dev_pvr.c,v 1.24 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  PowerVR CLX2 (Graphics controller used in the Dreamcast). Implemented by   *  COMMENT: PowerVR CLX2 (graphics controller used in the Dreamcast)
31   *  reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and   *
32     *  Implemented by reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and
33   *  http://mc.pp.se/dc/pvr.html, source code of various demos and KalistOS,   *  http://mc.pp.se/dc/pvr.html, source code of various demos and KalistOS,
34   *  and doing a lot of guessing.   *  and doing a lot of guessing.
35   *   *
# Line 419  static void pvr_ta_command(struct cpu *c Line 420  static void pvr_ta_command(struct cpu *c
420    
421  DEVICE_ACCESS(pvr_ta)  DEVICE_ACCESS(pvr_ta)
422  {  {
423          struct pvr_data *d = (struct pvr_data *) extra;          struct pvr_data *d = extra;
424          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
425    
426          if (writeflag == MEM_WRITE) {          if (writeflag == MEM_WRITE) {
# Line 444  DEVICE_ACCESS(pvr_ta) Line 445  DEVICE_ACCESS(pvr_ta)
445    
446  DEVICE_ACCESS(pvr)  DEVICE_ACCESS(pvr)
447  {  {
448          struct pvr_data *d = (struct pvr_data *) extra;          struct pvr_data *d = extra;
449          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
450    
451          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 1174  DEVICE_ACCESS(pvr_vram) Line 1175  DEVICE_ACCESS(pvr_vram)
1175  DEVINIT(pvr)  DEVINIT(pvr)
1176  {  {
1177          struct machine *machine = devinit->machine;          struct machine *machine = devinit->machine;
1178          struct pvr_data *d = malloc(sizeof(struct pvr_data));          struct pvr_data *d;
1179          struct pvr_data_alt *d_alt = malloc(sizeof(struct pvr_data_alt));          struct pvr_data_alt *d_alt;
1180          if (d == NULL) {  
1181                  fprintf(stderr, "out of memory\n");          CHECK_ALLOCATION(d = malloc(sizeof(struct pvr_data)));
                 exit(1);  
         }  
1182          memset(d, 0, sizeof(struct pvr_data));          memset(d, 0, sizeof(struct pvr_data));
1183    
1184            CHECK_ALLOCATION(d_alt = malloc(sizeof(struct pvr_data_alt)));
1185          memset(d_alt, 0, sizeof(struct pvr_data_alt));          memset(d_alt, 0, sizeof(struct pvr_data_alt));
1186    
1187          d_alt->d = d;          d_alt->d = d;
# Line 1221  DEVINIT(pvr) Line 1222  DEVINIT(pvr)
1222          pvr_reset_ta(d);          pvr_reset_ta(d);
1223    
1224          machine_add_tickfunction(machine, dev_pvr_fb_tick, d,          machine_add_tickfunction(machine, dev_pvr_fb_tick, d,
1225              PVR_FB_TICK_SHIFT, 0.0);              PVR_FB_TICK_SHIFT);
1226    
1227          return 1;          return 1;
1228  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26