Beispiel #1
0
void drawRect(u16 x, u16 y, u16 w, u16 h, u16 color) {
	int row = y;
	for(row = y; row < y+h; row++) /*iterate through all rows*/
	{
		DMA_MEMFILL3_SHRT(&(videoBuffer[OFFSET(row, x)]),&color,w);
	}
}
Beispiel #2
0
void DMALine(int r, int c, int w, byte clr) {
#ifndef _DEBUG
	volatile u16 color = clr << 8 | clr;
	if(r >= 0 && r < SCREEN_HEIGHT) {
		if(c < 0) {
			w += c;
			c = 0;
		}
		if((c+w) >= SCREEN_WIDTH) {
			w -= SCREEN_WIDTH - (w + c);
		}
		if(w > 0 && c & 1) {
			setPixel4(r, c++, clr);
			w--;
		}
		if(w > 0 && w & 1)
			setPixel4(r, (c+ (w--) -1), clr);
		if(w > 0) {
			DMA_MEMFILL3_SHRT(videoBuffer + OFFSET(r, c)/2,
				&color,
				w/2);
		}
	}
#else
	fprintf(debug,"DMALine(%d, %d, %d, %d)\n",
			r, c, w, clr);
#endif
}
Beispiel #3
0
void drawRectDMA(int row, int col, 
              int height, int width, u16 color ) {
#ifdef _DEBUG
	fprintf(debug,"drawRectDMA(%d, %d, %d, %d, %X\n",
		row, col, height, width, color);
#else
	int r;
	volatile u16 clr = color;
	u16 *dest;
//     init; test; increment    
	for(r = 0; r < height; ++r) {
		dest = videobuffer + OFFSET(row+r, col);
//		drawLine(row+r, col, width, color);
		DMA_MEMFILL3_SHRT(dest, &clr, width);
	}
#endif
}
Beispiel #4
0
void drawRectDMAMode4( int row, int col, 
				   int height, int width, int index ) {
#ifdef _DEBUG
	fprintf(debug,"drawRectDMAMode4(%d, %d, %d, %d, %d)\n",
		row, col, height, width, index);
#else
	int r;
	volatile u16 it = index | (index << 8);
	int offset;
//     init; test; increment    
	for(r = 0; r < height; ++r) {
	// DMA the correct line
	    offset = OFFSET(row + r, col)/2;
	    DMA_MEMFILL3_SHRT(videobuffer + offset,
			  &it, width/2);
	}
#endif
}