/[gxemul]/trunk/src/devices/dev_bt459.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_bt459.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_bt459.c,v 1.67 2006/12/30 13:30:57 debug Exp $   *  $Id: dev_bt459.c,v 1.70 2007/06/15 18:44:19 debug Exp $
29   *     *  
30   *  Brooktree 459 vdac, used by TURBOchannel graphics cards.   *  COMMENT: Brooktree BT459, used by TURBOchannel graphics cards
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 145  static void bt459_update_X_cursor(struct Line 145  static void bt459_update_X_cursor(struct
145           */           */
146    
147  #ifdef WITH_X11  #ifdef WITH_X11
148          if (cpu->machine->use_x11 && d->vfb_data->fb_window != NULL) {          if (cpu->machine->x11_md.in_use && d->vfb_data->fb_window != NULL) {
149                  for (y=0; y<=ymax; y++) {                  for (y=0; y<=ymax; y++) {
150                          for (x=0; x<=xmax; x+=4) {                          for (x=0; x<=xmax; x+=4) {
151                                  struct fb_window *win = d->vfb_data->fb_window;                                  struct fb_window *win = d->vfb_data->fb_window;
# Line 284  DEVICE_TICK(bt459) Line 284  DEVICE_TICK(bt459)
284    
285  DEVICE_ACCESS(bt459_irq)  DEVICE_ACCESS(bt459_irq)
286  {  {
287          struct bt459_data *d = (struct bt459_data *) extra;          struct bt459_data *d = extra;
288          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
289    
290          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 305  DEVICE_ACCESS(bt459_irq) Line 305  DEVICE_ACCESS(bt459_irq)
305  }  }
306    
307    
 /*  
  *  dev_bt459_access():  
  */  
308  DEVICE_ACCESS(bt459)  DEVICE_ACCESS(bt459)
309  {  {
310          struct bt459_data *d = (struct bt459_data *) extra;          struct bt459_data *d = extra;
311          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
312          int btaddr, old_cursor_on = d->cursor_on, modified;          int btaddr, old_cursor_on = d->cursor_on, modified;
313    
# Line 528  void dev_bt459_init(struct machine *mach Line 525  void dev_bt459_init(struct machine *mach
525          uint64_t baseaddr, uint64_t baseaddr_irq, struct vfb_data *vfb_data,          uint64_t baseaddr, uint64_t baseaddr_irq, struct vfb_data *vfb_data,
526          int planes, char *irq_path, int type)          int planes, char *irq_path, int type)
527  {  {
528          struct bt459_data *d = malloc(sizeof(struct bt459_data));          struct bt459_data *d;
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
529    
530            CHECK_ALLOCATION(d = malloc(sizeof(struct bt459_data)));
531          memset(d, 0, sizeof(struct bt459_data));          memset(d, 0, sizeof(struct bt459_data));
532    
533          INTERRUPT_CONNECT(irq_path, d->irq);          INTERRUPT_CONNECT(irq_path, d->irq);
# Line 584  void dev_bt459_init(struct machine *mach Line 578  void dev_bt459_init(struct machine *mach
578                      dev_bt459_irq_access, (void *)d, DM_DEFAULT, NULL);                      dev_bt459_irq_access, (void *)d, DM_DEFAULT, NULL);
579    
580          machine_add_tickfunction(machine, dev_bt459_tick, d,          machine_add_tickfunction(machine, dev_bt459_tick, d,
581              BT459_TICK_SHIFT, 0.0);              BT459_TICK_SHIFT);
582  }  }
583    

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

  ViewVC Help
Powered by ViewVC 1.1.26