OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [vga.c] - Diff between revs 805 and 884

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 805 Rev 884
Line 48... Line 48...
    }
    }
  }
  }
 
 
  if (found < 0) {
  if (found < 0) {
    fprintf( stderr, "vga_write32( 0x%08lX ): Out of range\n", addr);
    fprintf( stderr, "vga_write32( 0x%08lX ): Out of range\n", addr);
    cont_run = 0;
    runtime.sim.cont_run = 0;
    return;
    return;
  }
  }
 
 
  addr -= config.vgas[found].baseaddr;
  addr -= config.vgas[found].baseaddr;
 
 
Line 69... Line 69...
        vga[found].palette[0][addr - VGA_CLUTA] = value & 0x00ffffff;
        vga[found].palette[0][addr - VGA_CLUTA] = value & 0x00ffffff;
      } else if (addr >= VGA_CLUTB) {
      } else if (addr >= VGA_CLUTB) {
        vga[found].palette[1][addr - VGA_CLUTB] = value & 0x00ffffff;
        vga[found].palette[1][addr - VGA_CLUTB] = value & 0x00ffffff;
      } else {
      } else {
        fprintf( stderr, "vga_write32( 0x%08lX, 0x%08lX ): Out of range\n", addr + config.vgas[found].baseaddr, value);
        fprintf( stderr, "vga_write32( 0x%08lX, 0x%08lX ): Out of range\n", addr + config.vgas[found].baseaddr, value);
        cont_run = 0;
        runtime.sim.cont_run = 0;
        return;
        return;
      }
      }
      break;
      break;
  }
  }
}
}
Line 91... Line 91...
    }
    }
  }
  }
 
 
  if (found < 0) {
  if (found < 0) {
    fprintf( stderr, "vga_read32( 0x%08lX ): Out of range\n", addr);
    fprintf( stderr, "vga_read32( 0x%08lX ): Out of range\n", addr);
    cont_run = 0;
    runtime.sim.cont_run = 0;
    return 0;
    return 0;
  }
  }
 
 
  addr -= config.vgas[found].baseaddr;
  addr -= config.vgas[found].baseaddr;
 
 
Line 112... Line 112...
        return vga[found].palette[0][addr - VGA_CLUTA];
        return vga[found].palette[0][addr - VGA_CLUTA];
      } else if (addr >= VGA_CLUTB) {
      } else if (addr >= VGA_CLUTB) {
        return vga[found].palette[1][addr - VGA_CLUTB];
        return vga[found].palette[1][addr - VGA_CLUTB];
      } else {
      } else {
        fprintf( stderr, "vga_read32( 0x%08lX ): Out of range\n", addr);
        fprintf( stderr, "vga_read32( 0x%08lX ): Out of range\n", addr);
        cont_run = 0;
        runtime.sim.cont_run = 0;
        return 0;
        return 0;
      }
      }
      break;
      break;
  }
  }
  return 0;
  return 0;
Line 222... Line 222...
  /* dump the image? */
  /* dump the image? */
  char temp[STR_SIZE];
  char temp[STR_SIZE];
  sprintf (temp, "%s%04i.bmp", config.vgas[param].filename, vga[param].pics++);
  sprintf (temp, "%s%04i.bmp", config.vgas[param].filename, vga[param].pics++);
  vga_dump_image (temp, param);
  vga_dump_image (temp, param);
 
 
  SCHED_ADD(vga_job, param, cycles + config.vgas[param].refresh_rate);
  SCHED_ADD(vga_job, param, runtime.sim.cycles + config.vgas[param].refresh_rate);
}
}
 
 
/* Reset all VGAs */
/* Reset all VGAs */
void vga_reset ()
void vga_reset ()
{
{
Line 247... Line 247...
    vga[i].pindex = 0;
    vga[i].pindex = 0;
    vga[i].vbindex = 0;
    vga[i].vbindex = 0;
 
 
    if (config.vgas[i].baseaddr)
    if (config.vgas[i].baseaddr)
      register_memoryarea(config.vgas[i].baseaddr, VGA_ADDR_SPACE, 4, vga_read32, vga_write32);
      register_memoryarea(config.vgas[i].baseaddr, VGA_ADDR_SPACE, 4, vga_read32, vga_write32);
    SCHED_ADD(vga_job, i, cycles + config.vgas[i].refresh_rate);
    SCHED_ADD(vga_job, i, runtime.sim.cycles + config.vgas[i].refresh_rate);
  }
  }
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.