#include "stdio.h"
#include "stdlib.h"
#include "stdint.h"
#include "unistd.h"
#include "io.h"
#include "system.h"




#define tft_base (SDRAM_FB_BASE + SDRAM_FB_BASE / 2) // Where we want our frame buffers
#define  WIDTH 800
#define  HEIGHT 480


void fb_init(uint8_t *framebuffer, int width, int height, int color_depth) {
	IOWR(MASTER_RD_CTRL_BASE, 0, 0);	//رʾ
	IOWR(MASTER_RD_CTRL_BASE, 1, framebuffer);	//ַָ
	IOWR(MASTER_RD_CTRL_BASE, 2, width*height*color_depth/8);	//ָС
	IOWR(MASTER_RD_CTRL_BASE, 0, 0x2);	//ʾ
}

int main()
{
  printf("Hello from Nios II!\n");

  return 0;
}
