/[gxemul]/trunk/src/devices/dev_sfb.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_sfb.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 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_sfb.c,v 1.6 2005/02/18 07:22:30 debug Exp $   *  $Id: dev_sfb.c,v 1.9 2006/01/01 13:17:17 debug Exp $
29   *     *  
30   *  SFB TURBOchannel framebuffer.   *  SFB TURBOchannel framebuffer.
31   *   *
# Line 67  struct sfb_data { Line 67  struct sfb_data {
67  /*  /*
68   *  dev_sfb_access():   *  dev_sfb_access():
69   */   */
70  int dev_sfb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,  DEVICE_ACCESS(sfb)
         unsigned char *data, size_t len, int writeflag, void *extra)  
71  {  {
72          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
73          struct sfb_data *d = extra;          struct sfb_data *d = extra;
74    
75          idata = memory_readmax64(cpu, data, len);          if (writeflag == MEM_WRITE)
76                    idata = memory_readmax64(cpu, data, len);
77    
78          if (writeflag==MEM_READ) {          if (writeflag==MEM_READ) {
79                  odata = d->reg[(relative_addr >> 2) & (N_SFB_REGS - 1)];                  odata = d->reg[(relative_addr >> 2) & (N_SFB_REGS - 1)];
# Line 113  void dev_sfb_init(struct machine *machin Line 113  void dev_sfb_init(struct machine *machin
113          d->reg[(SFB_VVERTICAL - SFB_ASIC_OFFSET) / 4]   = SFB_YSIZE;          d->reg[(SFB_VVERTICAL - SFB_ASIC_OFFSET) / 4]   = SFB_YSIZE;
114    
115          memory_device_register(mem, "sfb", baseaddr, SFB_REG_SIZE,          memory_device_register(mem, "sfb", baseaddr, SFB_REG_SIZE,
116              dev_sfb_access, d, MEM_DEFAULT, NULL);              dev_sfb_access, d, DM_DEFAULT, NULL);
117  }  }
118    

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

  ViewVC Help
Powered by ViewVC 1.1.26