
//[i] color english_UL,
LOAD ModuleLib system\language\english_UL.txt,

ST7920_12864_ram
[
	public link io []
	
	command io -> io,
	command =
	LOAD CurrentDir command.txt,
	
	//=============================================
	//[i] function OS_init,
	public V OS_init:
		//ִʼ
		command OS_init,
	
		//תıģʽ
		command send_command 0x30,
		command send_command 0x30,
		command send_command 0x0c,
		command send_command 0x01,
		command send_command 0x06,
	
		//תͼģʽ
		command send_command 0x34,
		command send_command 0x36,
	end.
	
	//=============================================
	//[i] function fill_data,
	public V fill_data (N8 DATA):
		N8 addr = 0x80,
		repeat 32 times,
			command send_command addr,
			command send_command 0x80,
			repeat 32 times,
				command send_data DATA,
				...
			addr + 1,
			...
	end.
	
	//=============================================
	// (x,y) дһ
	//[i] function write_word,
	public V write_word (N8 x) (N8 y) (N16 data):
		//ת
		if y >= 32,
			y - 32,
			x + 8.
		command send_command (0x80 + y),
		command send_command (0x80 + x),
		command send_data (data 8(N8)), //ȷ͸ֽ
		command send_data (data 0(N8)), //ٷ͵ֽ
	end.
	
	//=============================================
	//ȡ (x,y) һ(˫ֽ)
	//[i] function read_word,
	public N16 read_word (N8 x) (N8 y):
		//ת
		if y >= 32,
			y - 32,
			x + 8.
		command send_command (0x80 + y),
		command send_command (0x80 + x),
		N16 word,
		word 0(N8) = command read_data, //һҪնһΣֽ
		word 8(N8) = command read_data, //ȶֽ
		word 0(N8) = command read_data, //ٶֽ
		return word,
	end.
]






















