All pastes #743080 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-20 02:14 UTC
rendered paste body
#define COLUMNS 240
#define ROWS    128
#define BYTES_PER_ROW  (COLUMNS / 8)

void copy_bytes(char *dst, char *src, int num)
{
	int i;

	for (i = 0; i < num; i++)
		dst[i] = src[i];
}

void scroll_up(int cols, int rows)
{
	int i;

	for (i = 0; i < rows - 1; i++)
	    copy_bytes(i * BYTE_PER_ROW, (i + 1) * BYTES_PER_ROW, cols / 8);

}

/* example */
scroll_up(160, 100);