
#include <display.h>
#include <keyboard_syscalls.h>
#include <SYSTEM_syscalls.h>
#include <keyboard.hpp>
//
void main(void) {
	int x = 1;
	int y = 1;
	int color = 0;
	int mode = 0;
	int key;
	int iContinue = 1;

	char* heart = "    ";
	heart[2] = 0xE5;
	heart[3] = 0xE2;
	Bdisp_AllCr_VRAM();

	while (iContinue) {
		Bdisp_AllCr_VRAM();
		PrintXY(x, y, heart, mode, color);
		switch (key) {
			case KEY_CTRL_EXIT:
				iContinue = 0;
				break;
			case KEY_CTRL_UP:
				y = y == 1 ? 8 : y-1;
				break;
			case KEY_CTRL_DOWN:
				y = y == 8 ? 1 : y+1;
				break;
			case KEY_CTRL_LEFT:
				x = x == 0 ? 21 : x-1;
				break;
			case KEY_CTRL_RIGHT:
				x = x == 21 ? x=1 : x+1;
				break;
			case KEY_CHAR_PLUS:
				color = color == 7 ? 0 : color+1;
				break;
			case KEY_CHAR_MINUS:
				color = color == 0 ? 7 : color-1;
				break;
			case KEY_CHAR_MULT:
				mode = !mode;
				break;
			case KEY_CHAR_DIV:
				mode = !mode;
				break;
		}
	}

	return;
}




