#include <clip.h>

unsigned char vbuff[DISP_X * DISP_Y];

int
main()
{
	int i;

	/* 一般的な初期化。 */
	pceLCDDispStart();
	pceAppSetProcPeriod(1);
	pceLCDSetBuffer(vbuff);

	if(stream_play(0, "sample.gsm", -1) != 0) return -1;
	atexit(stream_stop);

	i = 0;
	for(;;) {
		yield();
		if(pcePadGet() & TRG_SELECT) break;
		memset(vbuff, 0, sizeof vbuff);
		for(i = 0; i < 100; i++) {
			pceLCDLine(3, rand() % DISP_X, rand() % DISP_Y, rand() % DISP_X, rand() % DISP_Y);
		}
		pceLCDTrans();
	}

	return 0;
}

