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

Subversion Repositories or1k_old

[/] [or1k_old/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [fb.c] - Diff between revs 867 and 884

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

Rev 867 Rev 884
Line 54... Line 54...
    default:
    default:
      a -= FB_PAL;
      a -= FB_PAL;
      a /= 4;
      a /= 4;
      if (a < 0 || a >= 256) {
      if (a < 0 || a >= 256) {
        fprintf (stderr, "Write out of palette buffer (0x%08x)!\n", addr);
        fprintf (stderr, "Write out of palette buffer (0x%08x)!\n", addr);
        cont_run = 0;
        runtime.sim.cont_run = 0;
      } else pal[a] = value;
      } else pal[a] = value;
      break;
      break;
  }
  }
}
}
 
 
Line 76... Line 76...
    default:
    default:
      a -= FB_PAL;
      a -= FB_PAL;
      a /= 4;
      a /= 4;
      if (a < 0 || a >= 256) {
      if (a < 0 || a >= 256) {
        fprintf (stderr, "Read out of palette buffer (0x%08x)!\n", addr);
        fprintf (stderr, "Read out of palette buffer (0x%08x)!\n", addr);
        cont_run = 0;
        runtime.sim.cont_run = 0;
        return 0;
        return 0;
      } else return pal[a];
      } else return pal[a];
  }
  }
}
}
 
 
Line 256... Line 256...
      sprintf (temp, "%s%04i.bmp", &config.fb.filename[0], fb_pic);
      sprintf (temp, "%s%04i.bmp", &config.fb.filename[0], fb_pic);
      if (fb_ctrl & 2) fb_dump_image24 (temp);
      if (fb_ctrl & 2) fb_dump_image24 (temp);
      else fb_dump_image8 (temp);
      else fb_dump_image8 (temp);
      fb_pic++;
      fb_pic++;
    }
    }
    SCHED_ADD(fb_job, 0, cycles + config.fb.refresh_rate - config.fb.refresh_rate / REFRESH_DIVIDER);
    SCHED_ADD(fb_job, 0, runtime.sim.cycles + config.fb.refresh_rate - config.fb.refresh_rate / REFRESH_DIVIDER);
    fb_in_refresh = 0;
    fb_in_refresh = 0;
  } else {
  } else {
    fb_refresh_count++;
    fb_refresh_count++;
    SCHED_ADD(fb_job, 1, cycles + config.fb.refresh_rate / REFRESH_DIVIDER);
    SCHED_ADD(fb_job, 1, runtime.sim.cycles + config.fb.refresh_rate / REFRESH_DIVIDER);
 
 
  }
  }
}
}
 
 
/* Reset all VGAs */
/* Reset all VGAs */
Line 280... Line 280...
    for (i = 0; i < 256; i++)
    for (i = 0; i < 256; i++)
      pal[i] = (i << 16) | (i << 8) | (i << 0);
      pal[i] = (i << 16) | (i << 8) | (i << 0);
 
 
    if (config.fb.baseaddr)
    if (config.fb.baseaddr)
      register_memoryarea(config.fb.baseaddr, FB_PAL + 256*4, 4, fb_read32, fb_write32);
      register_memoryarea(config.fb.baseaddr, FB_PAL + 256*4, 4, fb_read32, fb_write32);
    SCHED_ADD(fb_job, 0, cycles + config.fb.refresh_rate);
    SCHED_ADD(fb_job, 0, runtime.sim.cycles + config.fb.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.