Code:
#include "stdio.h"
#include "string.h"
#include "mesys.h"
#include "ogg/ogg.h"
#define FONT0 0
#define FONT1 0x10000000
#define BT_NORMAL 0
#define BT_DEL 0x80000000
#define BT_HIDE 0x40000000
#define BT_NOFRAME 0x20000000
char header[]={" -= OGG demo programm. Compiled whith TCC 0.9.23 halyavin port. Use libogg-1.1.2 =- "};
char sz_demo_start[]={"START"};
char sz_open_file[256];
char p_sz_open_file=0;
FILE *fogg;
void draw_window()
{
static int offs = 0;
static int fcolor = 0;
static int col = 0;
int i;
_msys_window_redraw(1);
_msys_draw_window(100, 100, 640, 480, 0xaabbcc, 2, 0x5080d0, 0, 0x5080d0);
_msys_write_text(6 - offs, 8, fcolor | FONT0, header, strlen(header));
_msys_draw_bar(1, 6, 5, 13, 0x05080d0);
_msys_draw_bar(274, 6, 26, 13, 0x05080d0);
_msys_make_button(640 - 16, 5, 12, 12, 1 | BT_NORMAL, 0x6688dd);
_msys_make_button(20, 25, 32, 12, 2 | BT_NORMAL, 0x6688dd);
_msys_write_text(21, 26, fcolor | FONT0, sz_demo_start, strlen(sz_demo_start));
_msys_write_text(40, 40, fcolor | FONT0, sz_open_file, strlen(sz_open_file));
_msys_window_redraw(2);
}
void ogg_demo(void)
{
}
int main(int argc, char **argv)
{
int id_button;
int id_key;
while(!0)
{
switch(_msys_wait_for_event_infinite())
{
case 2:
id_key=_msys_get_key();
if(id_key==8)
{
if(p_sz_open_file>0)
{
sz_open_file[p_sz_open_file]=0;
p_sz_open_file--;
}
}
if(id_key!=8)
{
if(p_sz_open_file<255)
{
sz_open_file[p_sz_open_file]=id_key;
p_sz_open_file++;
sz_open_file[p_sz_open_file]=0;
}
}
break;
case 3:
id_button=_msys_get_button_id();
if(id_button == 1) return 0;
if(id_button == 2) ogg_demo();
break;
default:
draw_window();
break;
}
}
}
люди вот ещё код, там используется получение букв с клавиатуры, и удаление на BackSpace, но почему-то, в емуляторе не работает. кроме того отсутствует NULL, а надпись NULL=(void*)0; вызывает ошибку