- use build in data types

git-svn-id: http://moon:8086/svn/mips@35 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2015-05-28 19:19:01 +00:00
parent 3263f9d79c
commit a655e1c5d9
54 changed files with 1551 additions and 1583 deletions
+117 -117
View File
@@ -16,23 +16,23 @@ gpio_if_t gpio_if;
box_t box;
gfx_t gfx;
UINT32 color_cycle[12] = {0x000000FF, 0x00808080, 0x0000FFFF, 0x00808080, 0x0000FF00, 0x00808080, 0x00FFFF00, 0x00808080, 0x00FF0000, 0x00808080, 0x00FF00FF, 0x00808080};
uint32_t color_cycle[12] = {0x000000FF, 0x00808080, 0x0000FFFF, 0x00808080, 0x0000FF00, 0x00808080, 0x00FFFF00, 0x00808080, 0x00FF0000, 0x00808080, 0x00FF00FF, 0x00808080};
volatile UINT32 _g_blitter_rdy;
volatile UINT32 _g_blit_count;
volatile uint32_t _g_blitter_rdy;
volatile uint32_t _g_blit_count;
void ISR_blitter_FIN(void)
{
UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_ADDR;
UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST_ADDR;
UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
UINT32 volatile *pVGA_const_color = (UINT32*)SYS_VGA_BLIT_COLOR;
UINT32 volatile *pGPIO = (UINT32*)SYS_GPIO_0_DATA;
static UINT32 color;
uint32_t volatile *pVGA_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_ADDR;
uint32_t volatile *pVGA_dst = (uint32_t*)SYS_VGA_BLIT_DST_ADDR;
uint32_t volatile *pVGA_dimx_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_DIMX;
uint32_t volatile *pVGA_dimx_dst = (uint32_t*)SYS_VGA_BLIT_DST_DIMX;
uint32_t volatile *pVGA_nx = (uint32_t*)SYS_VGA_BLIT_NX;
uint32_t volatile *pVGA_ny = (uint32_t*)SYS_VGA_BLIT_NY;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_moffs_0 = (uint32_t*)SYS_VGA_FB_FRONT;
uint32_t volatile *pVGA_const_color = (uint32_t*)SYS_VGA_BLIT_COLOR;
uint32_t volatile *pGPIO = (uint32_t*)SYS_GPIO_0_DATA;
static uint32_t color;
// Ack
if(_g_blit_count)
@@ -59,17 +59,17 @@ void ISR_blitter_FIN(void)
void ISR_blitter_EMPTY(void)
{
UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_ADDR;
UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST_ADDR;
UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
UINT32 volatile *pVGA_const_color = (UINT32*)SYS_VGA_BLIT_COLOR;
UINT32 volatile *pGPIO = (UINT32*)SYS_GPIO_0_DATA;
static UINT32 color;
uint32_t volatile *pVGA_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_ADDR;
uint32_t volatile *pVGA_dst = (uint32_t*)SYS_VGA_BLIT_DST_ADDR;
uint32_t volatile *pVGA_dimx_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_DIMX;
uint32_t volatile *pVGA_dimx_dst = (uint32_t*)SYS_VGA_BLIT_DST_DIMX;
uint32_t volatile *pVGA_nx = (uint32_t*)SYS_VGA_BLIT_NX;
uint32_t volatile *pVGA_ny = (uint32_t*)SYS_VGA_BLIT_NY;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_moffs_0 = (uint32_t*)SYS_VGA_FB_FRONT;
uint32_t volatile *pVGA_const_color = (uint32_t*)SYS_VGA_BLIT_COLOR;
uint32_t volatile *pGPIO = (uint32_t*)SYS_GPIO_0_DATA;
static uint32_t color;
// Ack
if(_g_blit_count)
@@ -95,22 +95,22 @@ void ISR_blitter_EMPTY(void)
}
void BlitWaitStillActive(void);
void BlitConstColor(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x, UINT32 pos_y, UINT32 size_x, UINT32 size_y, UINT32 color);
void Blit(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x_src, UINT32 pos_y_src, UINT32 pos_x_dst, UINT32 pos_y_dst, UINT32 size_x, UINT32 size_y);
void BlitConstColor(uint32_t fb_addr, uint32_t dim_x, uint32_t pos_x, uint32_t pos_y, uint32_t size_x, uint32_t size_y, uint32_t color);
void Blit(uint32_t fb_addr, uint32_t dim_x, uint32_t pos_x_src, uint32_t pos_y_src, uint32_t pos_x_dst, uint32_t pos_y_dst, uint32_t size_x, uint32_t size_y);
// -------------------------------------------------------------
void LoadPic(UINT64 *pScreen, UINT32 screen_nx, UINT32 screen_ny, UINT32 *pImage, UINT32 image_nx, UINT32 image_ny, UINT32 image_scale_x, UINT32 image_scale_y)
void LoadPic(uint64_t *pScreen, uint32_t screen_nx, uint32_t screen_ny, uint32_t *pImage, uint32_t image_nx, uint32_t image_ny, uint32_t image_scale_x, uint32_t image_scale_y)
{
UINT32 off_x, off_y;
UINT32 i, j, black;
UINT32 *pScr, *pImg;
uint32_t off_x, off_y;
uint32_t i, j, black;
uint32_t *pScr, *pImg;
off_x = (screen_nx-(image_scale_x*image_nx))/2;
off_y = (screen_ny-(image_scale_y*image_ny))/2;
black = 0;
pScr = (UINT32*)pScreen;
pScr = (uint32_t*)pScreen;
for (i=0; i < screen_nx*screen_ny; i += 8)
{
__gfx_block_set_8(pScr, 0);
@@ -120,7 +120,7 @@ void LoadPic(UINT64 *pScreen, UINT32 screen_nx, UINT32 screen_ny, UINT32 *pImage
if (!pImage)
return;
pScr = ((UINT32*)pScreen) + screen_nx*off_y + off_x;
pScr = ((uint32_t*)pScreen) + screen_nx*off_y + off_x;
pImg = pImage;
for (i=0; i < image_ny*image_nx; i += 8)
@@ -131,19 +131,19 @@ void LoadPic(UINT64 *pScreen, UINT32 screen_nx, UINT32 screen_ny, UINT32 *pImage
}
/*
UINT32 off_x, off_y;
UINT32 i;
UINT32 *pScr;
uint32_t off_x, off_y;
uint32_t i;
uint32_t *pScr;
off_x = (screen_nx-(image_scale_x*image_nx))/2;
off_y = (screen_ny-(image_scale_y*image_ny))/2;
memset(pScreen, 0, screen_nx*screen_ny*sizeof(UINT32));
pScr = ((UINT32*)pScreen) + screen_nx*off_y + off_x;
memset(pScreen, 0, screen_nx*screen_ny*sizeof(uint32_t));
pScr = ((uint32_t*)pScreen) + screen_nx*off_y + off_x;
for (i=0; i < image_ny; i++)
{
memcpy(pScr, &pImage[i*image_nx], image_nx*sizeof(UINT32));
memcpy(pScr, &pImage[i*image_nx], image_nx*sizeof(uint32_t));
pScr += screen_nx;
}
*/
@@ -152,37 +152,37 @@ void LoadPic(UINT64 *pScreen, UINT32 screen_nx, UINT32 screen_ny, UINT32 *pImage
int main (void)
{
int result, i, j, cnt, size, num_runs;
UINT32 volatile *pUART_baud = (UINT32*)SYS_UART_BAUD;
UINT32 volatile *pUART_stat = (UINT32*)SYS_UART_STAT;
UINT32 volatile *pGPIO = (UINT32*)SYS_GPIO_0_DATA;
UINT32 volatile *pReg_usec = (UINT32*)SYS_TIMER_USEC;
UINT32 volatile *pReg_sec = (UINT32*)SYS_TIMER_SEC;
UINT32 volatile *pSSRAM = (UINT32*)SYS_SSRAM_IO;
UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
UINT32 volatile *pTim1_cnt = (UINT32*)SYS_ITIM1_CNT;
UINT32 volatile *pTim1_cmp = (UINT32*)SYS_ITIM1_CMP;
UINT32 volatile *pVGA_cgcol = (UINT32*)SYS_VGA_CGCOL;
UINT32 volatile *pFlashPicture = (UINT32*)(SYS_FLASH_MEM + 0x00600000);
uint32_t volatile *pUART_baud = (uint32_t*)SYS_UART_BAUD;
uint32_t volatile *pUART_stat = (uint32_t*)SYS_UART_STAT;
uint32_t volatile *pGPIO = (uint32_t*)SYS_GPIO_0_DATA;
uint32_t volatile *pReg_usec = (uint32_t*)SYS_TIMER_USEC;
uint32_t volatile *pReg_sec = (uint32_t*)SYS_TIMER_SEC;
uint32_t volatile *pSSRAM = (uint32_t*)SYS_SSRAM_IO;
uint32_t volatile *pTim_ctrl = (uint32_t*)SYS_ITIM_CTRL;
uint32_t volatile *pTim_stat = (uint32_t*)SYS_ITIM_STAT;
uint32_t volatile *pTim0_cnt = (uint32_t*)SYS_ITIM0_CNT;
uint32_t volatile *pTim0_cmp = (uint32_t*)SYS_ITIM0_CMP;
uint32_t volatile *pTim1_cnt = (uint32_t*)SYS_ITIM1_CNT;
uint32_t volatile *pTim1_cmp = (uint32_t*)SYS_ITIM1_CMP;
uint32_t volatile *pVGA_cgcol = (uint32_t*)SYS_VGA_CGCOL;
uint32_t volatile *pFlashPicture = (uint32_t*)(SYS_FLASH_MEM + 0x00600000);
UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_ADDR;
UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST_ADDR;
UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
UINT32 volatile *pVGA_const_color = (UINT32*)SYS_VGA_BLIT_COLOR;
uint32_t volatile *pVGA_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_ADDR;
uint32_t volatile *pVGA_dst = (uint32_t*)SYS_VGA_BLIT_DST_ADDR;
uint32_t volatile *pVGA_dimx_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_DIMX;
uint32_t volatile *pVGA_dimx_dst = (uint32_t*)SYS_VGA_BLIT_DST_DIMX;
uint32_t volatile *pVGA_nx = (uint32_t*)SYS_VGA_BLIT_NX;
uint32_t volatile *pVGA_ny = (uint32_t*)SYS_VGA_BLIT_NY;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_moffs_0 = (uint32_t*)SYS_VGA_FB_FRONT;
uint32_t volatile *pVGA_const_color = (uint32_t*)SYS_VGA_BLIT_COLOR;
UINT32 screen_res_x, screen_res_y, screen_fps;
UINT32 pos, posx, posy, xoff, yoff, color;
UINT64 *pBuf64_0, *pBuf64_1;
uint32_t screen_res_x, screen_res_y, screen_fps;
uint32_t pos, posx, posy, xoff, yoff, color;
uint64_t *pBuf64_0, *pBuf64_1;
time_t curr_date;
struct tm *pDate, date;
UINT32 start, end;
uint32_t start, end;
char sel[80];
struct timeval time_sec;
@@ -233,7 +233,7 @@ int main (void)
*pVGA_nx = box.w;
*pVGA_ny = box.h;
*pVGA_ctrl |= SYS_VGA_BIT_BLIT_OP_CONSTCOL;
*pVGA_dst = (UINT32)*pVGA_moffs_0 + 4*(5 + 800*5);// + 4*((UINT32)rand()%800 + 800*((UINT32)rand()%600));
*pVGA_dst = (uint32_t)*pVGA_moffs_0 + 4*(5 + 800*5);// + 4*((uint32_t)rand()%800 + 800*((uint32_t)rand()%600));
color = 0;
start = clock();
@@ -317,28 +317,28 @@ int main (void)
xoff = 100;
yoff = 0;
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff+i, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
box_create(&box, 63-2*i, 63-2*i);
xoff = 100;
yoff = 100;
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff+i, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
xoff = 100;
yoff = 200;
box_create(&box, 65-2*i, 65-2*i);
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff+i, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((UINT32)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+100+i, yoff+i, box.w, box.h, color);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+201+i, yoff+i, box.w, box.h, color);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+300+i, yoff+i, box.w, box.h);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff+i, yoff+i, xoff+401+i, yoff+i, box.w, box.h);
}
GFX_frame(&gfx, GFX_FRAME_SYNC);
@@ -351,8 +351,8 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+65, 64, 64);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+65+65, 64, 64);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+65, 64, 64);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+65+65, 64, 64);
xoff = 81;
yoff = 300;
@@ -362,8 +362,8 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+65, 64, 64);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+65+65, 64, 64);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+65, 64, 64);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+65+65, 64, 64);
xoff = 160;
yoff = 300;
@@ -373,8 +373,8 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+64, 63, 63);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+64+64, 63, 63);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+64, 63, 63);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+64+64, 63, 63);
xoff = 241;
yoff = 300;
@@ -384,8 +384,8 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+64, 63, 63);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+64+64, 63, 63);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+64, 63, 63);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+64+64, 63, 63);
xoff = 320;
yoff = 300;
@@ -395,8 +395,8 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+66, 65, 65);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+66+66, 65, 65);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+66, 65, 65);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+66+66, 65, 65);
xoff = 401;
yoff = 300;
@@ -406,21 +406,21 @@ int main (void)
color = color_cycle[i%12];
GFX_box_draw_direct(&gfx, &box, xoff+i, yoff, color);
}
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+66, 65, 65);
Blit((UINT32)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+66+66, 65, 65);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff, yoff+66, 65, 65);
Blit((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, xoff+1, yoff+66+66, 65, 65);
xoff = 10;
yoff = 500;
box_create(&box, 64, 1);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+1, yoff+2, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+1, yoff+2, box.w, box.h, 0xFFFFFFFF);
xoff = 80;
yoff = 500;
box_create(&box, 1, 64);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+10, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((UINT32)*pVGA_moffs_0, 800, xoff+21, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+10, yoff, box.w, box.h, 0xFFFFFFFF);
BlitConstColor((uint32_t)*pVGA_moffs_0, 800, xoff+21, yoff, box.w, box.h, 0xFFFFFFFF);
size++;
if (size > 256)
@@ -429,18 +429,18 @@ int main (void)
}
}
void BlitConstColor(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x, UINT32 pos_y, UINT32 size_x, UINT32 size_y, UINT32 color)
void BlitConstColor(uint32_t fb_addr, uint32_t dim_x, uint32_t pos_x, uint32_t pos_y, uint32_t size_x, uint32_t size_y, uint32_t color)
{
UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_ADDR;
UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST_ADDR;
UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
UINT32 volatile *pVGA_const_color = (UINT32*)SYS_VGA_BLIT_COLOR;
uint32_t volatile *pVGA_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_ADDR;
uint32_t volatile *pVGA_dst = (uint32_t*)SYS_VGA_BLIT_DST_ADDR;
uint32_t volatile *pVGA_dimx_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_DIMX;
uint32_t volatile *pVGA_dimx_dst = (uint32_t*)SYS_VGA_BLIT_DST_DIMX;
uint32_t volatile *pVGA_nx = (uint32_t*)SYS_VGA_BLIT_NX;
uint32_t volatile *pVGA_ny = (uint32_t*)SYS_VGA_BLIT_NY;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_moffs_0 = (uint32_t*)SYS_VGA_FB_FRONT;
uint32_t volatile *pVGA_const_color = (uint32_t*)SYS_VGA_BLIT_COLOR;
// fprintf(stdout, "BlitConstColor to (%d,%d), size (%d,%d) ...", pos_x, pos_y, size_x, size_y);
@@ -457,18 +457,18 @@ void BlitConstColor(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x, UINT32 pos_y, UI
// fprintf(stdout, "done\n");
}
void Blit(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x_src, UINT32 pos_y_src, UINT32 pos_x_dst, UINT32 pos_y_dst, UINT32 size_x, UINT32 size_y)
void Blit(uint32_t fb_addr, uint32_t dim_x, uint32_t pos_x_src, uint32_t pos_y_src, uint32_t pos_x_dst, uint32_t pos_y_dst, uint32_t size_x, uint32_t size_y)
{
UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_ADDR;
UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST_ADDR;
UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
UINT32 volatile *pVGA_const_color = (UINT32*)SYS_VGA_BLIT_COLOR;
uint32_t volatile *pVGA_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_ADDR;
uint32_t volatile *pVGA_dst = (uint32_t*)SYS_VGA_BLIT_DST_ADDR;
uint32_t volatile *pVGA_dimx_src0 = (uint32_t*)SYS_VGA_BLIT_SRC0_DIMX;
uint32_t volatile *pVGA_dimx_dst = (uint32_t*)SYS_VGA_BLIT_DST_DIMX;
uint32_t volatile *pVGA_nx = (uint32_t*)SYS_VGA_BLIT_NX;
uint32_t volatile *pVGA_ny = (uint32_t*)SYS_VGA_BLIT_NY;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_moffs_0 = (uint32_t*)SYS_VGA_FB_FRONT;
uint32_t volatile *pVGA_const_color = (uint32_t*)SYS_VGA_BLIT_COLOR;
// fprintf(stdout, "Blit from (%d,%d) to (%d,%d), size (%d,%d) ...", pos_x_src, pos_y_src, pos_x_dst, pos_y_dst, size_x, size_y);
@@ -490,7 +490,7 @@ void Blit(UINT32 fb_addr, UINT32 dim_x, UINT32 pos_x_src, UINT32 pos_y_src, UINT
void BlitWaitStillActive(void)
{
UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
uint32_t volatile *pVGA_ctrl = (uint32_t*)SYS_VGA_CTRL;
while (*pVGA_ctrl & SYS_VGA_BIT_BLIT_ACTIVE);
}