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

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

revision 21 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2004-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-2006  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_px.c,v 1.30 2005/11/13 00:14:09 debug Exp $   *  $Id: dev_px.c,v 1.33 2006/01/01 13:17:17 debug Exp $
29   *     *  
30   *  TURBOchannel Pixelstamp graphics device.   *  TURBOchannel Pixelstamp graphics device.
31   *   *
# Line 143  uint32_t px_readword(struct cpu *cpu, un Line 143  uint32_t px_readword(struct cpu *cpu, un
143  void dev_px_dma(struct cpu *cpu, uint32_t sys_addr, struct px_data *d)  void dev_px_dma(struct cpu *cpu, uint32_t sys_addr, struct px_data *d)
144  {  {
145          unsigned char dma_buf[32768];          unsigned char dma_buf[32768];
146          int dma_len = sizeof(dma_buf);          size_t dma_len = sizeof(dma_buf);
147          int bytesperpixel;          int bytesperpixel;
148          uint32_t cmdword;          uint32_t cmdword;
149    
# Line 231  void dev_px_dma(struct cpu *cpu, uint32_ Line 231  void dev_px_dma(struct cpu *cpu, uint32_
231                  debug(",HS_EQUALS");                  debug(",HS_EQUALS");
232    
233          {          {
234                  int i;                  size_t i;
235                  for (i=0; i<dma_len; i++)                  for (i=0; i<dma_len; i++)
236                          debug(" %02x", dma_buf[i]);                          debug(" %02x", dma_buf[i]);
237          }          }
# Line 242  void dev_px_dma(struct cpu *cpu, uint32_ Line 242  void dev_px_dma(struct cpu *cpu, uint32_
242          /*  NetBSD and Ultrix copyspans  */          /*  NetBSD and Ultrix copyspans  */
243          if (cmdword == 0x405) {          if (cmdword == 0x405) {
244                  uint32_t nspans, lw;                  uint32_t nspans, lw;
245                  int spannr, ofs;                  uint32_t spannr, ofs;
246                  uint32_t span_len, span_src, span_dst;                  uint32_t span_len, span_src, span_dst;
247                  /*  unsigned char pixels[PX_XSIZE * 3];  */                  /*  unsigned char pixels[PX_XSIZE * 3];  */
248    
# Line 328  void dev_px_dma(struct cpu *cpu, uint32_ Line 328  void dev_px_dma(struct cpu *cpu, uint32_
328    
329                          d->vfb_data->update_x1 = 0; d->vfb_data->update_x2 =                          d->vfb_data->update_x1 = 0; d->vfb_data->update_x2 =
330                              PX_XSIZE-1;                              PX_XSIZE-1;
331                          if (span_dst < d->vfb_data->update_y1)                          if ((int32_t)span_dst < d->vfb_data->update_y1)
332                                  d->vfb_data->update_y1 = span_dst;                                  d->vfb_data->update_y1 = span_dst;
333                          if (span_dst > d->vfb_data->update_y2)                          if ((int32_t)span_dst > d->vfb_data->update_y2)
334                                  d->vfb_data->update_y2 = span_dst;                                  d->vfb_data->update_y2 = span_dst;
335                          if (span_src < d->vfb_data->update_y1)                          if ((int32_t)span_src < d->vfb_data->update_y1)
336                                  d->vfb_data->update_y1 = span_src;                                  d->vfb_data->update_y1 = span_src;
337                          if (span_src > d->vfb_data->update_y2)                          if ((int32_t)span_src > d->vfb_data->update_y2)
338                                  d->vfb_data->update_y2 = span_src;                                  d->vfb_data->update_y2 = span_src;
339                  }                  }
340          }          }
341    
342          /*  NetBSD and Ultrix erasecols/eraserows  */          /*  NetBSD and Ultrix erasecols/eraserows  */
343          if (cmdword == 0x411) {          if (cmdword == 0x411) {
344                  uint32_t v1, v2, lw, attr;                  uint32_t v1, v2, attr;
345                    int32_t lw;
346                  int x,y,x2,y2;                  int x,y,x2,y2;
347                  int fb_y;                  int fb_y;
348                  int bg_r, bg_g, bg_b;                  int bg_r, bg_g, bg_b;
# Line 560  void dev_px_dma(struct cpu *cpu, uint32_ Line 561  void dev_px_dma(struct cpu *cpu, uint32_
561  /*  /*
562   *  dev_px_access():   *  dev_px_access():
563   */   */
564  int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,  DEVICE_ACCESS(px)
         unsigned char *data, size_t len, int writeflag, void *extra)  
565  {  {
566          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
567          struct px_data *d = extra;          struct px_data *d = extra;
568          int i;          size_t i;
569    
570          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
571                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);

Legend:
Removed from v.21  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26