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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0/] [or1ksim/] [peripheral/] [fb.c] - Diff between revs 766 and 799

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

Rev 766 Rev 799
Line 20... Line 20...
#include <stdio.h>
#include <stdio.h>
#include "sim-config.h"
#include "sim-config.h"
#include "abstract.h"
#include "abstract.h"
#include "fb.h"
#include "fb.h"
 
 
 
#define FB_WRAP (512*1024)
 
 
static unsigned long pal[256];
static unsigned long pal[256];
static int fb_ctrl = 0;
static int fb_ctrl = 0;
static int fb_pic = 0;
static int fb_pic = 0;
static int fb_cycles = 0;
static int fb_cycles = 0;
static unsigned long fb_addr = 0;
static unsigned long fb_addr = 0;
Line 134... Line 136...
  if (config.sim.verbose) printf ("(%i,%i)", sx, sy);
  if (config.sim.verbose) printf ("(%i,%i)", sx, sy);
  /* Data is stored upside down */
  /* Data is stored upside down */
  for (y = sy - 1; y >= 0; y--) {
  for (y = sy - 1; y >= 0; y--) {
    int align = (4 - sx) % 4;
    int align = (4 - sx) % 4;
    int zero = CNV32(0);
    int zero = CNV32(0);
 
    int add;
    while (align < 0) align += 4;
    while (align < 0) align += 4;
    for (x = 0; x < sx; x++)
    for (x = 0; x < sx; x++) {
      fputc (evalsim_mem8 (fb_addr + y * sx + x), fo);
      add = (fb_addr & ~(FB_WRAP - 1)) | ((fb_addr + y * sx + x) & (FB_WRAP - 1));
 
      fputc (evalsim_mem8 (add), fo);
 
    }
    if (align && !fwrite (&zero, align, 1, fo)) return 1;
    if (align && !fwrite (&zero, align, 1, fo)) return 1;
  }
  }
 
 
  if (config.sim.verbose) printf ("DONE\n");
  if (config.sim.verbose) printf ("DONE\n");
  fclose (fo);
  fclose (fo);

powered by: WebSVN 2.1.0

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