#include "..\..\lib\vp2k.h"
#include "..\..\lib\vp2k_lcd.h"

void main(void)
{
    unsigned cursor_x = 0,cursor_y =0;
    int quit =0;
    int key;

    InitLib();
    LCD_Init();

    LCD_PutsAt(0,0,"Press F6 to quit",0);
    LCD_Hline(0,127,14,1);
    LCD_Hline(0,127,15,1);
    LCD_UpdateGraphic();
    cursor_x = 0;
    cursor_y = 1;
    LCD_Gotoxy(cursor_x,cursor_y);
    LCD_SetCursor(1);
    LCD_BlinkCursor(1);

    while(!quit)
    {
        LCD_DisplayCursor();
        if(IsKey())
        {
            key = ReadKey();
            LCD_Putch((uchar)key,0);
            cursor_x++;
            if(cursor_x > 15)
            {
                cursor_x =0;
                cursor_y++;
                if(cursor_y > 3) cursor_y =1;
            }
            LCD_Gotoxy(cursor_x,cursor_y);
        }
        if(key == F6_KEY) quit = 1;
    }
    StopOutWave1();
}
