URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 844 to Rev 845
- ↔ Reverse comparison
Rev 844 → Rev 845
/trunk/or1ksim/peripheral/fb.c
28,6 → 28,8
static unsigned long pal[256]; |
static int fb_ctrl = 0; |
static int fb_pic = 0; |
static int fb_in_refresh = 1; |
static int fb_refresh_count = 0; |
static unsigned long fb_addr = 0; |
|
static void change_buf_addr (unsigned long addr) |
40,7 → 42,7
{ |
int a = (addr - config.fb.baseaddr); |
switch (a) { |
case FB_CTRL: fb_ctrl = value; break; |
case FB_CTRL: fb_ctrl = value & 0x00000001; break; |
case FB_BUFADDR: change_buf_addr (value); break; |
default: |
a -= FB_PAL; |
58,7 → 60,9
{ |
int a = (addr - config.fb.baseaddr); |
switch (a) { |
case FB_CTRL: return fb_ctrl; break; |
case FB_CTRL: |
return fb_ctrl | (fb_in_refresh ? 2 : 0) | ((fb_refresh_count & 0xff) << 8); |
break; |
case FB_BUFADDR: return fb_addr; break; |
default: |
a -= FB_PAL; |
154,14 → 158,21
|
void fb_job (int param) |
{ |
/* dump the image? */ |
if (fb_ctrl) { |
char temp[STR_SIZE]; |
sprintf (temp, "%s%04i.bmp", &config.fb.filename[0], fb_pic); |
fb_dump_image (temp); |
fb_pic++; |
if (param) { |
/* dump the image? */ |
if (fb_ctrl) { |
char temp[STR_SIZE]; |
sprintf (temp, "%s%04i.bmp", &config.fb.filename[0], fb_pic); |
fb_dump_image (temp); |
fb_pic++; |
} |
SCHED_ADD(fb_job, 0, cycles + config.fb.refresh_rate - config.fb.refresh_rate / REFRESH_DIVIDER); |
fb_in_refresh = 0; |
} else { |
fb_refresh_count++; |
SCHED_ADD(fb_job, 1, cycles + config.fb.refresh_rate / REFRESH_DIVIDER); |
|
} |
SCHED_ADD(fb_job, 0, cycles + config.fb.refresh_rate); |
} |
|
/* Reset all VGAs */ |
/trunk/or1ksim/peripheral/fb.h
25,6 → 25,9
#define FB_SIZEX 640 |
#define FB_SIZEY 480 |
|
/* Relative amount of time spent in refresh */ |
#define REFRESH_DIVIDER 20 |
|
#define FB_CTRL 0x0000 |
#define FB_BUFADDR 0x0004 |
#define FB_PAL 0x0400 |