From caaa70b39496a351679492ea537b85686b0efd9b Mon Sep 17 00:00:00 2001 From: Yogev Ezra Date: Sat, 29 Jan 2011 17:39:35 +0000 Subject: [PATCH] Add 'cubeline', 'cubetext' and 'gears' source code to SVN. git-svn-id: svn://kolibrios.org@1789 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/demos/cubeline/trunk/Makefile | 15 + programs/demos/cubeline/trunk/ProcessTab.h | 24 ++ programs/demos/cubeline/trunk/SysCall.h | 188 +++++++++ programs/demos/cubeline/trunk/fps.cpp | 46 +++ programs/demos/cubeline/trunk/main.cpp | 251 ++++++++++++ programs/demos/cubetext/trunk/Makefile | 15 + programs/demos/cubetext/trunk/ProcessTab.h | 24 ++ programs/demos/cubetext/trunk/SysCall.h | 188 +++++++++ programs/demos/cubetext/trunk/bmp.cpp | 442 +++++++++++++++++++++ programs/demos/cubetext/trunk/bmp.h | 142 +++++++ programs/demos/cubetext/trunk/fps.cpp | 47 +++ programs/demos/cubetext/trunk/logio.bmp | Bin 0 -> 39774 bytes programs/demos/cubetext/trunk/main.cpp | 223 +++++++++++ programs/demos/cubetext/trunk/readme.txt | 1 + programs/demos/gears/trunk/Makefile | 15 + programs/demos/gears/trunk/ProcessTab.h | 24 ++ programs/demos/gears/trunk/SysCall.h | 188 +++++++++ programs/demos/gears/trunk/fps.cpp | 46 +++ programs/demos/gears/trunk/main.cpp | 345 ++++++++++++++++ 19 files changed, 2224 insertions(+) create mode 100644 programs/demos/cubeline/trunk/Makefile create mode 100644 programs/demos/cubeline/trunk/ProcessTab.h create mode 100644 programs/demos/cubeline/trunk/SysCall.h create mode 100644 programs/demos/cubeline/trunk/fps.cpp create mode 100644 programs/demos/cubeline/trunk/main.cpp create mode 100644 programs/demos/cubetext/trunk/Makefile create mode 100644 programs/demos/cubetext/trunk/ProcessTab.h create mode 100644 programs/demos/cubetext/trunk/SysCall.h create mode 100644 programs/demos/cubetext/trunk/bmp.cpp create mode 100644 programs/demos/cubetext/trunk/bmp.h create mode 100644 programs/demos/cubetext/trunk/fps.cpp create mode 100644 programs/demos/cubetext/trunk/logio.bmp create mode 100644 programs/demos/cubetext/trunk/main.cpp create mode 100644 programs/demos/cubetext/trunk/readme.txt create mode 100644 programs/demos/gears/trunk/Makefile create mode 100644 programs/demos/gears/trunk/ProcessTab.h create mode 100644 programs/demos/gears/trunk/SysCall.h create mode 100644 programs/demos/gears/trunk/fps.cpp create mode 100644 programs/demos/gears/trunk/main.cpp diff --git a/programs/demos/cubeline/trunk/Makefile b/programs/demos/cubeline/trunk/Makefile new file mode 100644 index 0000000000..3faf4a467d --- /dev/null +++ b/programs/demos/cubeline/trunk/Makefile @@ -0,0 +1,15 @@ +OUTFILE = cubeline + +SRCS = main.cpp fps.cpp + +OBJS = $(SRCS:.cpp=.o) + +CPPFLAGS = -I$(TINYGL)\include -O2 + +LIBR = TinyGL m +LIBS = $(addprefix -l,$(LIBR)) -L$(TINYGL)\lib + +all: $(OUTFILE) + objcopy $(OUTFILE) -O binary + +include $(MENUETDEV)/makefiles/Makefile_for_cpp_program diff --git a/programs/demos/cubeline/trunk/ProcessTab.h b/programs/demos/cubeline/trunk/ProcessTab.h new file mode 100644 index 0000000000..320a6dbb5e --- /dev/null +++ b/programs/demos/cubeline/trunk/ProcessTab.h @@ -0,0 +1,24 @@ + +struct process_table_entry_ +{ + __u32 cpu_usage __attribute__((packed)); + __u16 pos_in_windowing_stack __attribute__((packed)); + __u16 win_stack_val_at_ecx __attribute__((packed)); + __u16 rez1 __attribute__((packed)); + char name[11] __attribute__((packed)); + __u8 rez2 __attribute__((packed)); + __u32 memstart __attribute__((packed)); + __u32 memused __attribute__((packed)); + __u32 pid __attribute__((packed)); + __u32 winx_start,winy_start __attribute__((packed)); + __u32 winx_size,winy_size __attribute__((packed)); + __u8 slot __attribute__((packed)); + __u8 rez3 __attribute__((packed)); + __u32 clarx_start,clary_start __attribute__((packed)); + __u32 clarx_size,clary_size __attribute__((packed)); + __u8 win_condition __attribute__((packed)); + __u8 buf[955] __attribute__((packed)); +} __attribute__((packed)); + +#define TYPEWIN(D,C,B,A,Y,RR,GG,BB) (D<<31)|(C<<30)|(B<<29)|(A<<28)|(Y<<24)|\ +(RR<<16)|(GG<<8)|BB diff --git a/programs/demos/cubeline/trunk/SysCall.h b/programs/demos/cubeline/trunk/SysCall.h new file mode 100644 index 0000000000..ac4ad32eec --- /dev/null +++ b/programs/demos/cubeline/trunk/SysCall.h @@ -0,0 +1,188 @@ +#ifndef __cplusplus + +//"inline" функции для вызова системных функций Kolibri в C - в имени функции кол-во параметров +//SysCall# (номер_системной_функции, параметры,...) + +static inline int SysCall1 (int EAX__) __attribute__((always_inline)); +static inline int SysCall2 (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + +static inline int SysCall1 (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall2 (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#else + +//"inline" функции для вызова системных функций Kolibri в C++ +//SysCall(номер_системной_функции, параметры,...) + +static inline int SysCall (int EAX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + + +static inline int SysCall (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#endif diff --git a/programs/demos/cubeline/trunk/fps.cpp b/programs/demos/cubeline/trunk/fps.cpp new file mode 100644 index 0000000000..7bdc1fdb1f --- /dev/null +++ b/programs/demos/cubeline/trunk/fps.cpp @@ -0,0 +1,46 @@ +#include +#include "SysCall.h" + +/******************************************************************************* +ФУНКЦИЯ ОПРЕДЕЛЕНИЯ FPS +x,y - координаты вывода FPS на окно +возвращает время в сотых долях секунды затрачиваемое на 1 цикл +*/ + +int time1=0; +int time2=0; +int fps1=0; +int timerend=0; + +int Fps (long x, long y)//функция определения FPS +{ + int tr; + + time1 = SysCall(26,9);//определяем время прошедшее момента запуска системы + + if (timerend==0) + { + time2=time1; + timerend=time1; + } + + tr = time1 - timerend; + + if ((time1 - time2) < 100)//если прошло менее 1 секунды + { //увеличиваем счетчик fps + fps1++; + } + else + { + //выводим число fps + SysCall(13,(x<<16)+23,(y<<16)+7,0x00555555); //НАРИСОВАТЬ ПОЛОСУ + SysCall(47,4<<16,fps1,(x<<16)+y,0xfafafa);//ВЫВЕСТИ В ОКНО ПРИЛОЖЕНИЯ ЧИСЛО + fps1=0; + time2=time1; + } + + timerend=time1; + +return tr; +} +//****************************************************************************** diff --git a/programs/demos/cubeline/trunk/main.cpp b/programs/demos/cubeline/trunk/main.cpp new file mode 100644 index 0000000000..f664a3c88e --- /dev/null +++ b/programs/demos/cubeline/trunk/main.cpp @@ -0,0 +1,251 @@ +/* +Пример взят из набора примеров к компилятору XS Compiler + +iadn +http://www.iadn.narod.ru +iadn@bk.ru +*/ + +#include +#include +#include //TinyGL + +#include "SysCall.h" +#include "ProcessTab.h" + + +int Fps (long x, long y); +extern "C"{ +void app_main(void); +} + +struct { + int x,y; + int dx,dy; + } win; + +#define CUBE_STEP 0.1 + +#define KEY_ESC 1 +#define KEY_F 33 + +char *title1 = "TinyGL in KolibriOS"; +char *title2 = "F full screen"; +char *title3 = "ESC - exit"; +char *fps = "FPS:"; + +unsigned char FullScreen = 0; +unsigned char skin = 3; + +float angle; +process_table_entry_* pri; +KOSGLContext cgl; + +void draw_cube() +{ + float x,y,z; + glBegin(GL_LINES); + + for(y=-0.5;y<=0.5;y+=CUBE_STEP) + { + // the front + glColor3f(0,y+0.5,0); + glVertex3f(-0.5,y,-0.5); + glColor3f(1,y+0.5,0); + glVertex3f(0.5,y,-0.5); + + // the back + glColor3f(0,y+0.5,1); + glVertex3f(-0.5,y,0.5); + glColor3f(1,y+0.5,1); + glVertex3f(0.5,y,0.5); + + //right side + glColor3f(1,y+0.5,0); + glVertex3f(0.5,y,-0.5); + glColor3f(1,y+0.5,1); + glVertex3f(0.5,y,0.5); + + //left side + glColor3f(0,y+0.5,0); + glVertex3f(-0.5,y,-0.5); + glColor3f(0,y+0.5,1); + glVertex3f(-0.5,y,0.5); + } + + for(x=-0.5;x<=0.5;x+=CUBE_STEP) + { + // the front + glColor3f(x+0.5,1,0); + glVertex3f(x,0.5,-0.5); + glColor3f(x+0.5,0,0); + glVertex3f(x,-0.5,-0.5); + + // the back + glColor3f(x+0.5,1,1); + glVertex3f(x,0.5,0.5); + glColor3f(x+0.5,0,1); + glVertex3f(x,-0.5,0.5); + + // the top + glColor3f(x+0.5,1,0); + glVertex3f(x,0.5,-0.5); + glColor3f(x+0.5,1,1); + glVertex3f(x,0.5,0.5); + + // the bottom + glColor3f(x+0.5,0,0); + glVertex3f(x,-0.5,-0.5); + glColor3f(x+0.5,0,1); + glVertex3f(x,-0.5,0.5); + } + + for(z=-0.5;z<=0.5;z+=CUBE_STEP) + { + // the top + glColor3f(0,1,z+0.5); + glVertex3f(-0.5,0.5,z); + glColor3f(1,1,z+0.5); + glVertex3f(0.5,0.5,z); + + // the bottom + glColor3f(0,0,z+0.5); + glVertex3f(-0.5,-0.5,z); + glColor3f(1,0,z+0.5); + glVertex3f(0.5,-0.5,z); + + // right side + glColor3f(1,1,z+0.5); + glVertex3f(0.5,0.5,z); + glColor3f(1,0,z+0.5); + glVertex3f(0.5,-0.5,z); + + // left side + glColor3f(0,1,z+0.5); + glVertex3f(-0.5,0.5,z); + glColor3f(0,0,z+0.5); + glVertex3f(-0.5,-0.5,z); + } + + glEnd(); +} + +void DrawGL() +{ + glLoadIdentity(); // устанавливаем еденичную матрицу + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glTranslatef(0.0, 0.0, -3.0); + glRotatef(angle, 1.0, 0.0, 0.0); + glRotatef(2.0*angle, 0.0, 1.0, 0.0); + glRotatef(3.0*angle, 0.0, 0.0, 1.0); + + draw_cube(); + + kosglSwapBuffers(); + } + +void reshape() +{ + __menuet__get_process_table((process_table_entry*)pri,-1); + glViewport(0, 0, pri->winx_size, pri->winy_size-20); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0, (GLfloat)pri->winx_size/pri->winy_size, 1.0, 300.0); + glMatrixMode(GL_MODELVIEW); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); +} + +void disabletgl() +{ + kosglDestroyContext(cgl); + delete pri; +} + +void Title() +{ + __menuet__write_text(300,8,0x10ffffff,fps,strlen(fps)); + __menuet__write_text(8,8,0x10ffffff,title1,strlen(title1)); + __menuet__write_text(180,8,0x00ffffff,title2,strlen(title2)); + __menuet__write_text(600,8,0x00ffffff,title3,strlen(title3)); +} + +void draw_window(void) +{ + // start redraw + __menuet__window_redraw(1); + // define&draw window + __menuet__define_window(win.x,win.y,win.dx,win.dy,TYPEWIN(0,0,0,1,skin,0,0,0),0,0); + // end redraw + __menuet__window_redraw(2); + // display string + Title(); +} + +void app_main(void) +{ + + win.x = 100; + win.y = 100; + win.dx = 400; + win.dy = 400; + + draw_window(); + + cgl = kosglCreateContext( 0, 0); + kosglMakeCurrent( 0, 20, win.dx, win.dy-20, cgl); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glClearDepth(1.0); + glEnable( GL_CULL_FACE ); + glEnable(GL_DEPTH_TEST); + + pri=new process_table_entry_; + SysCall(66,1,1); + + reshape(); + +do{ + + if (angle < 360.0) angle += 0.001 + 0.1*Fps (330,8); + else angle = 0.0; + + DrawGL(); + + switch(__menuet__check_for_event()) + { + case 1: draw_window(); + reshape(); + break; + + case 2: + switch(__menuet__getkey()){ + + case KEY_F: + if(!FullScreen){ + skin=0; + SysCall(67,0,0,SysCall(14)>>16,SysCall(14)&0xffff); + draw_window(); + reshape(); + FullScreen = 1; + } + else{ + skin=3; + draw_window(); + SysCall(67,win.x,win.y,win.dx,win.dy); + reshape(); + FullScreen = 0; + }; + break; + + case KEY_ESC: disabletgl(); + return;} + break; + + case 3: disabletgl(); + return; + } +}while(1); +} diff --git a/programs/demos/cubetext/trunk/Makefile b/programs/demos/cubetext/trunk/Makefile new file mode 100644 index 0000000000..724ec6b2f7 --- /dev/null +++ b/programs/demos/cubetext/trunk/Makefile @@ -0,0 +1,15 @@ +OUTFILE = cubetext + +SRCS = main.cpp fps.cpp bmp.cpp + +OBJS = $(SRCS:.cpp=.o) + +CPPFLAGS = -I$(TINYGL)\include -O2 + +LIBR = TinyGL m +LIBS = $(addprefix -l,$(LIBR)) -L$(TINYGL)\lib + +all: $(OUTFILE) + objcopy $(OUTFILE) -O binary + +include $(MENUETDEV)/makefiles/Makefile_for_cpp_program diff --git a/programs/demos/cubetext/trunk/ProcessTab.h b/programs/demos/cubetext/trunk/ProcessTab.h new file mode 100644 index 0000000000..320a6dbb5e --- /dev/null +++ b/programs/demos/cubetext/trunk/ProcessTab.h @@ -0,0 +1,24 @@ + +struct process_table_entry_ +{ + __u32 cpu_usage __attribute__((packed)); + __u16 pos_in_windowing_stack __attribute__((packed)); + __u16 win_stack_val_at_ecx __attribute__((packed)); + __u16 rez1 __attribute__((packed)); + char name[11] __attribute__((packed)); + __u8 rez2 __attribute__((packed)); + __u32 memstart __attribute__((packed)); + __u32 memused __attribute__((packed)); + __u32 pid __attribute__((packed)); + __u32 winx_start,winy_start __attribute__((packed)); + __u32 winx_size,winy_size __attribute__((packed)); + __u8 slot __attribute__((packed)); + __u8 rez3 __attribute__((packed)); + __u32 clarx_start,clary_start __attribute__((packed)); + __u32 clarx_size,clary_size __attribute__((packed)); + __u8 win_condition __attribute__((packed)); + __u8 buf[955] __attribute__((packed)); +} __attribute__((packed)); + +#define TYPEWIN(D,C,B,A,Y,RR,GG,BB) (D<<31)|(C<<30)|(B<<29)|(A<<28)|(Y<<24)|\ +(RR<<16)|(GG<<8)|BB diff --git a/programs/demos/cubetext/trunk/SysCall.h b/programs/demos/cubetext/trunk/SysCall.h new file mode 100644 index 0000000000..ac4ad32eec --- /dev/null +++ b/programs/demos/cubetext/trunk/SysCall.h @@ -0,0 +1,188 @@ +#ifndef __cplusplus + +//"inline" функции для вызова системных функций Kolibri в C - в имени функции кол-во параметров +//SysCall# (номер_системной_функции, параметры,...) + +static inline int SysCall1 (int EAX__) __attribute__((always_inline)); +static inline int SysCall2 (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + +static inline int SysCall1 (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall2 (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#else + +//"inline" функции для вызова системных функций Kolibri в C++ +//SysCall(номер_системной_функции, параметры,...) + +static inline int SysCall (int EAX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + + +static inline int SysCall (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#endif diff --git a/programs/demos/cubetext/trunk/bmp.cpp b/programs/demos/cubetext/trunk/bmp.cpp new file mode 100644 index 0000000000..985471ffff --- /dev/null +++ b/programs/demos/cubetext/trunk/bmp.cpp @@ -0,0 +1,442 @@ +// +// bmp.cpp - source file / freeware +// +// David Henry - tfc_duke@hotmail.com +// + + +#include "bmp.h" +#include + +#include + +extern "C"{ +long filelength(int fhandle); +} + +// -------------------------------------------------- +// LoadFileBMP() - load a Windows/OS2 BITMAP image +// [.bmp]. +// +// parameters : +// - filename [in] : image source file +// - pixels [out] : 32 bits rgb image data +// - width [out] : image width in pixels +// - height [out] : image height in pixels +// - flipvert [in] : flip vertically +// +// return value : +// - -1 : no image data +// - 0 : failure +// - 1 : success +// +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// accepted image formats : +// # RGB 1-4-8-24-32 bits WINDOWS - OS/2 +// # RLE 4-8 bits WINDOWS +// -------------------------------------------------- + +int LoadFileBMP( const char *filename, unsigned char **pixels, int *width, int *height, bool flipvert ) +{ + FILE *file; // file stream + BITMAPFILEHEADER *bmfh; // bitmap file header + BITMAPINFOHEADER *bmih; // bitmap info header (windows) + BITMAPCOREHEADER *bmch; // bitmap core header (os/2) + RGBTRIPLE *os2_palette; // pointer to the color palette os/2 + RGBQUAD *win_palette; // pointer to the color palette windows + char *buffer; // buffer storing the entire file + unsigned char *ptr; // pointer to pixels data + int bitCount; // number of bits per pixel + int compression; // compression type (rgb/rle) + int row, col, i; // temporary variables + int w, h; // width, height + + + + ///////////////////////////////////////////////////// + // read the entire file in the buffer + + file = fopen(filename,"rb"); + + if( !file) + return 0; + + long flen = filelength(fileno(file)); + + buffer = new char[ flen + 1 ]; + int rd = fread(buffer, flen, 1, file); + char *pBuff = buffer; + + fclose(file); + + ///////////////////////////////////////////////////// + + + // read the header + bmfh = (BITMAPFILEHEADER *)pBuff; + pBuff += sizeof( BITMAPFILEHEADER ); + + // verify that it's a BITMAP file + if( bmfh->bfType != BITMAP_ID ) + { + delete [] buffer; + return 0; + } + + + bmch = (BITMAPCOREHEADER *)pBuff; + bmih = (BITMAPINFOHEADER *)pBuff; + + + if( (bmih->biCompression < 0) || (bmih->biCompression > 3) ) + { + // OS/2 style + pBuff += sizeof( BITMAPCOREHEADER ); + + bitCount = bmch->bcBitCount; + compression = BI_OS2; + + w = bmch->bcWidth; + h = bmch->bcHeight; + } + else + { + // WINDOWS style + pBuff += sizeof( BITMAPINFOHEADER ); + + bitCount = bmih->biBitCount; + compression = bmih->biCompression; + + w = bmih->biWidth; + h = bmih->biHeight; + } + + + if( width ) + *width = w; + + if( height ) + *height = h; + + + if( !pixels ) + { + delete [] buffer; + return (-1); + } + + + ///////////////////////////////////////////////////// + // read the palette + + if( bitCount <= 8 ) + { + // 24 and 32 bits images are not paletted + + // ajust the palette pointer to the memory in the buffer + os2_palette = (RGBTRIPLE *)pBuff; + win_palette = (RGBQUAD *)pBuff; + + // [number of colors in the palette] * [size of one pixel] + pBuff += (1 << bitCount) * (bitCount >> 3) * sizeof( unsigned char ); + } + + ///////////////////////////////////////////////////// + + + // allocate memory to store pixel data + *pixels = new unsigned char[ w * h * 3 ]; + ptr = &(*pixels)[0]; + + + // move the pixel data pointer to the begening of bitmap data + pBuff = buffer + (bmfh->bfOffBits * sizeof( char )); + + + ///////////////////////////////////////////////////// + // read pixel data following the image compression + // type and the number of bits per pixels + ///////////////////////////////////////////////////// + + switch( compression ) + { + case BI_OS2: + case BI_RGB: + { + for( row = h - 1; row >= 0; row-- ) + { + if( flipvert ) + ptr = &(*pixels)[ row * w * 3 ]; + + switch( bitCount ) + { + case 1: + { +// RGB 1 BITS + for( col = 0; col < (int)(w / 8); col++ ) + { + // read the current pixel + unsigned char color = *((unsigned char *)(pBuff++)); + + for( i = 7; i >= 0; i--, ptr += 3 ) + { + // convert indexed pixel (1 bit) into rgb (32 bits) pixel + int clrIdx = ((color & (1< 0); + + if( compression == BI_OS2 ) + { + ptr[2] = os2_palette[ clrIdx ].rgbtRed; + ptr[1] = os2_palette[ clrIdx ].rgbtGreen; + ptr[0] = os2_palette[ clrIdx ].rgbtBlue; + } + else + { + ptr[2] = win_palette[ clrIdx ].rgbRed; + ptr[1] = win_palette[ clrIdx ].rgbGreen; + ptr[0] = win_palette[ clrIdx ].rgbBlue; + } + } + } + + break; + } + + case 4: + { +// RGB 4 BITS + for( col = 0; col < (int)(w / 2); col++, ptr += 6 ) + { + // read the current pixel + unsigned char color = *((unsigned char *)(pBuff++)); + + // convert indexed pixel (4 bits) into rgb (32 bits) pixel + int clrIdx; + + if( compression == BI_OS2 ) + { + clrIdx = (color >> 4); + ptr[2] = os2_palette[ clrIdx ].rgbtRed; + ptr[1] = os2_palette[ clrIdx ].rgbtGreen; + ptr[0] = os2_palette[ clrIdx ].rgbtBlue; + + clrIdx = (color & 0x0F); + ptr[6] = os2_palette[ clrIdx ].rgbtRed; + ptr[5] = os2_palette[ clrIdx ].rgbtGreen; + ptr[4] = os2_palette[ clrIdx ].rgbtBlue; + + } + else + { + clrIdx = (color >> 4); + ptr[2] = win_palette[ clrIdx ].rgbRed; + ptr[1] = win_palette[ clrIdx ].rgbGreen; + ptr[0] = win_palette[ clrIdx ].rgbBlue; + + clrIdx = (color & 0x0F); + ptr[6] = win_palette[ clrIdx ].rgbRed; + ptr[5] = win_palette[ clrIdx ].rgbGreen; + ptr[4] = win_palette[ clrIdx ].rgbBlue; + } + } + + break; + } + + case 8: + { +// RGB 8 BITS + for( col = 0; col < w; col++, ptr += 3 ) + { + // read the current pixel + unsigned char color = *((unsigned char *)(pBuff++)); + + // convert indexed pixel (8 bits) into rgb (32 bits) pixel + if( compression == BI_OS2 ) + { + ptr[2] = os2_palette[ color ].rgbtRed; + ptr[1] = os2_palette[ color ].rgbtGreen; + ptr[0] = os2_palette[ color ].rgbtBlue; + } + else + { + ptr[2] = win_palette[ color ].rgbRed; + ptr[1] = win_palette[ color ].rgbGreen; + ptr[0] = win_palette[ color ].rgbBlue; + } + } + + break; + } + + case 24: + { +// RGB 24 BITS + for( col = 0; col < w; col++, ptr += 3 ) + { + // convert bgr pixel (24 bits) into rgb (32 bits) pixel + RGBTRIPLE *pix = (RGBTRIPLE *)pBuff; + pBuff += sizeof( RGBTRIPLE ); + + ptr[2] = pix->rgbtRed; + ptr[1] = pix->rgbtGreen; + ptr[0] = pix->rgbtBlue; + } + + break; + } + + case 32: + { +// RGB 32 BITS + for( col = 0; col < w; col++, ptr += 3 ) + { + // // convert bgr pixel (32 bits) into rgb (32 bits) pixel + RGBQUAD *pix = (RGBQUAD *)pBuff; + pBuff += sizeof( RGBQUAD ); + + ptr[2] = pix->rgbRed; + ptr[1] = pix->rgbGreen; + ptr[0] = pix->rgbBlue; + + } + + break; + } + } + } + + break; + } + + case BI_RLE8: + { +// RLE 8 BITS + for( row = h - 1; row >= 0; row-- ) + { + if( flipvert ) + ptr = &(*pixels)[ row * w * 3 ]; + + for( col = 0; col < w; /* nothing */ ) + { + // get one packet (2 bytes) + unsigned char byte1 = *((unsigned char *)(pBuff++)); + unsigned char byte2 = *((unsigned char *)(pBuff++)); + + + if( byte1 == RLE_COMMAND ) + { + // absolute encoding + for( i = 0; i < byte2; i++, ptr += 3, col++ ) + { + // read the current pixel + unsigned char color = *((unsigned char *)(pBuff++)); + + // convert indexed pixel (8 bits) into rgb (32 bits) pixel + ptr[2] = win_palette[ color ].rgbRed; + ptr[1] = win_palette[ color ].rgbGreen; + ptr[0] = win_palette[ color ].rgbBlue; + } + + if( (byte2 % 2) == 1 ) + pBuff++; + } + else + { + // read next pixels + for( i = 0; i < byte1; i++, ptr += 3, col++ ) + { + // convert indexed pixel (8 bits) into rgb (32 bits) pixel + ptr[2] = win_palette[ byte2 ].rgbRed; + ptr[1] = win_palette[ byte2 ].rgbGreen; + ptr[0] = win_palette[ byte2 ].rgbBlue; + } + } + } + } + + break; + } + + case BI_RLE4: + { +// RLE 4 BITS + unsigned char color; + int bytesRead = 0; // number of bytes read + + for( row = h - 1; row >= 0; row-- ) + { + if( flipvert ) + ptr = &(*pixels)[ row * w * 3 ]; + + for( col = 0; col < w; /* nothing */ ) + { + // get one packet (2 bytes) + unsigned char byte1 = *((unsigned char *)(pBuff++)); + unsigned char byte2 = *((unsigned char *)(pBuff++)); + + bytesRead += 2; + + + if( byte1 == RLE_COMMAND ) + { + // absolute encoding + unsigned char databyte; + + for( i = 0; i < byte2; i++, ptr += 3, col++ ) + { + if( (i % 2) == 0 ) + { + // read the current pixel + databyte = *((unsigned char *)(pBuff++)); + bytesRead++; + + color = (databyte >> 4); // 4 first bits + } + else + { + color = (databyte & 0x0F); // 4 last bits + } + + // convert indexed pixel (4 bits) into rgb (32 bits) pixel + ptr[2] = win_palette[ color ].rgbRed; + ptr[1] = win_palette[ color ].rgbGreen; + ptr[0] = win_palette[ color ].rgbBlue; + } + + while( (bytesRead % 2) != 0 ) + { + pBuff++; + bytesRead++; + } + } + else + { + // read next pixels + for( i = 0; i < byte1; i++, ptr += 3, col++ ) + { + if( (i % 2) == 0 ) + color = (byte2 >> 4); // 4 first bits + else + color = (byte2 & 0x0F); // 4 last bits + + // convert indexed pixel (4 bits) into rgb (32 bits) pixel + ptr[2] = win_palette[ color ].rgbRed; + ptr[1] = win_palette[ color ].rgbGreen; + ptr[0] = win_palette[ color ].rgbBlue; + } + } + } + } + + break; + } + } + + + // free buffer memory + delete [] buffer; + + + // return success + return 1; +} diff --git a/programs/demos/cubetext/trunk/bmp.h b/programs/demos/cubetext/trunk/bmp.h new file mode 100644 index 0000000000..6a713390b0 --- /dev/null +++ b/programs/demos/cubetext/trunk/bmp.h @@ -0,0 +1,142 @@ +// +// bmp.h - header file / freeware +// +// David Henry - tfc_duke@hotmail.com +// + +#ifndef __BITMAP_H_ +#define __BITMAP_H_ + + + +// magic number "BM" +#define BITMAP_ID ('B' + ('M'<<8)) + + + +// header byte type for RLE +#define RLE_COMMAND 0 +#define RLE_ENDOFLINE 0 +#define RLE_ENDOFBITMAP 1 +#define RLE_DELTA 2 + +#define BI_OS2 -1 + + +// compression type +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 + + + +#pragma warning( disable : 4103 ) + + + +// -------------------------------------------- +// tagBITMAPFILEHEADER - bitmap file header. +// -------------------------------------------- + +#pragma pack(2) + +typedef struct tagBITMAPFILEHEADER // bmfh +{ + unsigned short bfType; // magic number "BM" + unsigned int bfSize; // file size + unsigned short bfReserved1; // reserved + unsigned short bfReserved2; // reserved + unsigned int bfOffBits; // offset to bitmap data + +} BITMAPFILEHEADER, *PBITMAPFILEHEADER; + +#pragma pack(4) + + + +// -------------------------------------------- +// tagBITMAPCOREHEADER - bitmap core header. +// -------------------------------------------- + +typedef struct tagBITMAPCOREHEADER // bmch +{ + unsigned int bcSize; // size of the structure + unsigned short bcWidth; // image width + unsigned short bcHeight; // image height + unsigned short bcPlanes; // must be equal to 1 + unsigned short bcBitCount; // number of bits per pixel + +} BITMAPCOREHEADER, *PBITMAPCOREHEADER; + + + +// -------------------------------------------- +// tagRGBTRIPLE - 24 bits pixel +// -------------------------------------------- + +typedef struct tagRGBTRIPLE // rgbt +{ + unsigned char rgbtBlue; // blue + unsigned char rgbtGreen; // green + unsigned char rgbtRed; // red + +} RGBTRIPLE, *PRGBTRIPLE; + + + +// -------------------------------------------- +// tagRGBQUAD - 32 bits pixel +// -------------------------------------------- + +typedef struct tagRGBQUAD // rgbt +{ + unsigned char rgbBlue; // blue + unsigned char rgbGreen; // green + unsigned char rgbRed; // red + unsigned char rgbReserved; // reserved + +} RGBQUAD, *PRGBQUAD; + + + +// -------------------------------------------- +// tagBITMAPCOREINFO - bitmap core info. +// -------------------------------------------- + +typedef struct tagBITMAPCOREINFO // bmci +{ + BITMAPCOREHEADER bmciHeader; // size of the structure + RGBTRIPLE bcmiColors[1]; // color palette + +} BITMAPCOREINFO, *PBITMAPCOREINFO; + + +// -------------------------------------------- +// BITMAPFILEHEADER - bitmap info header. +// -------------------------------------------- + +typedef struct tagBITMAPINFOHEADER +{ + unsigned int biSize; // size of the structure + int biWidth; // image width + int biHeight; // image height + unsigned short biPlanes; // must be equal to 1 + unsigned short biBitCount; // number of bits per pixel + unsigned int biCompression; // compression type + unsigned int biSizeImage; // size of data bitmap + int biXPelsPerMeter; // number of pixels per meter on the X axis + int biYPelsPerMeter; // number of pixels per meter on the Y axis + unsigned int biClrUsed; // number of colors used + unsigned int biClrImportant; // number of important colors + +} BITMAPINFOHEADER, *PBITMAPINFOHEADER; + + + +// prototype +int LoadFileBMP( const char *filename, unsigned char **pixels, int *width, int *height, bool flipvert ); + + + +#endif // __BITMAP_H_ diff --git a/programs/demos/cubetext/trunk/fps.cpp b/programs/demos/cubetext/trunk/fps.cpp new file mode 100644 index 0000000000..190f61f50e --- /dev/null +++ b/programs/demos/cubetext/trunk/fps.cpp @@ -0,0 +1,47 @@ +#include +#include "SysCall.h" + +/******************************************************************************* +ФУНКЦИЯ ОПРЕДЕЛЕНИЯ FPS +x,y - координаты вывода FPS на окно +возвращает время в сотых долях секунды затрачиваемое на 1 цикл + +*/ + +int time1=0; +int time2=0; +int fps1=0; +int timerend=0; + +int Fps (long x, long y)//функция определения FPS +{ + int tr; + + time1 = SysCall(26,9);//определяем время прошедшее момента запуска системы + + if (timerend==0) + { + time2=time1; + timerend=time1; + } + + tr = time1 - timerend; + + if ((time1 - time2) < 100)//если прошло менее 1 секунды + { //увеличиваем счетчик fps + fps1++; + } + else + { + //выводим число fps + SysCall(13,(x<<16)+23,(y<<16)+7,0x00555555); //НАРИСОВАТЬ ПОЛОСУ + SysCall(47,4<<16,fps1,(x<<16)+y,0xfafafa);//ВЫВЕСТИ В ОКНО ПРИЛОЖЕНИЯ ЧИСЛО + fps1=0; + time2=time1; + } + + timerend=time1; + +return tr; +} +//****************************************************************************** diff --git a/programs/demos/cubetext/trunk/logio.bmp b/programs/demos/cubetext/trunk/logio.bmp new file mode 100644 index 0000000000000000000000000000000000000000..62547a9cf178539a4aee666647c6adc6a9639e2d GIT binary patch literal 39774 zcmbTf4|tp9c`tmw&-1>LEju;|Ay#V1B@TaPs50tiRKrLF=TE&#k-Dl4m>AkEl?%;$ zilRjQJA9cG#pvcK!@B2Kz=l=h@@8|8{&Kp&Q_DZ%>(O17xpx?gj0NwGWFVQQ1 z`}g$TJHMa}ZV$b2{$DA$?_0EI&(~-w^OxlKi(~Zkp-1RbpWH|{edb2G)fc3PZu}g5 z&wnr77k`}YyX$sxe(ptb4Q{80{_$Vv^wKij{G&7U*Jnz!R9~jP+is^VUpzuD|6P?D z%_jZccMEjxwSSkE1JNk?7|A21Wy@&P;?4SYXR{B4} z5xVWh&rRB(di`fKHS;X}_V4{G?fmkCwEHj9 z^!NYmH5&f?J#^-8amIgiKmGpR12lW&&uNEe4~+!hr2P;4G2Qj2kJHn$FVSPkC+VGE z{DSWJ+6Y~D-KS_5e%4j_SGsB7X8N=LyqnZooov7LFZ9BH{W*R8p1rhi?hX3XZ+?ch zettLQzH>J{_H>s1Gi2bpZ8!FGo(_EOOJwMcR9Rjjp=( zI{N3iAJdn=@l*QS_m=4(Wa%2&L;qBL7kdxWcSHBkZQt2X562#%UC|i1d~ve>w|^wx z=iT&`yOXqco111{e4A#zU!>T*_t4R!e@=fo^*_kJdpG&EevZBq{~zSL=6d@2AAX1K zzVr9!%-_6B|Mt_L(AHbG(&ig)qFs0IrMu3*iM{Wn@BQH)(BPN%)9&q`r&nJ2ue9fL zJ8A2e57J*gHBB$S_Bw6Z_9gn>_nxFN+i%mqHQuNC@-qG1KQGYkJ9g7GXa9-1uDYH+ z_l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os/cubetext/trunk/main.cpp new file mode 100644 index 0000000000..313e3cd171 --- /dev/null +++ b/programs/demos/cubetext/trunk/main.cpp @@ -0,0 +1,223 @@ +/* +iadn +http://www.iadn.narod.ru +iadn@bk.ru +*/ +#include +#include //TinyGL +#include + +#include "SysCall.h" +#include "ProcessTab.h" +#include "bmp.h" + + +int Fps (long x, long y); +extern "C"{ +void app_main(void); +} + +struct { + int x,y; + int dx,dy; + } win; + +#define KEY_ESC 1 +#define KEY_F 33 + +char *title1 = "TinyGL in KolibriOS"; +char *title2 = "F full screen"; +char *title3 = "ESC - exit"; +char *fps = "FPS:"; + +unsigned char FullScreen = 0; +unsigned char skin = 3; + +static GLuint* TexObj; + +float angle = 0.0; +process_table_entry_* pri; +KOSGLContext cgl; + +struct V3{ + float v1; + float v2; + float v3; + } ptrv[8] = {{-1.0,1.0,1.0}, + {-1.0,-1.0,1.0}, + {1.0,-1.0,1.0}, + {1.0,1.0,1.0}, + {-1.0,1.0,-1.0}, + {-1.0,-1.0,-1.0}, + {1.0,-1.0,-1.0}, + {1.0,1.0,-1.0}}; + +struct T2{ + float t1; + float t2; + } ptrt[4] = { + {0.0, 0.0}, + {1.0, 0.0}, + {1.0, 1.0}, + {0.0, 1.0} + }; + +void DrawQUADS(V3* ptr, int iv1, int iv2, int iv3, int iv4, T2* ptrt, int it1, int it2, int it3, int it4) +{ + glBegin(GL_QUADS); + glTexCoord2fv((float*)&ptrt[it1]); + glVertex3fv((float*)&ptr[iv1]); + glTexCoord2fv((float*)&ptrt[it2]); + glVertex3fv((float*)&ptr[iv2]); + glTexCoord2fv((float*)&ptrt[it3]); + glVertex3fv((float*)&ptr[iv3]); + glTexCoord2fv((float*)&ptrt[it4]); + glVertex3fv((float*)&ptr[iv4]); + glEnd(); +} +void DrawGL() +{ + glLoadIdentity(); // устанавливаем еденичную матрицу + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glTranslatef(0.0, 0.0, -6.0); + glRotatef(angle, 1.0, 0.0, 0.0); + glRotatef(2.0*angle, 0.0, 1.0, 0.0); + glRotatef(3.0*angle, 0.0, 0.0, 1.0); + + DrawQUADS((V3*)&ptrv,0,1,2,3,(T2*)&ptrt,3,0,1,2); + DrawQUADS((V3*)&ptrv,0,3,7,4,(T2*)&ptrt,1,2,3,0); + DrawQUADS((V3*)&ptrv,4,7,6,5,(T2*)&ptrt,2,3,0,1); + DrawQUADS((V3*)&ptrv,5,6,2,1,(T2*)&ptrt,3,0,1,2); + DrawQUADS((V3*)&ptrv,7,3,2,6,(T2*)&ptrt,3,0,1,2); + DrawQUADS((V3*)&ptrv,5,1,0,4,(T2*)&ptrt,3,0,1,2); + + kosglSwapBuffers(); + } + +void reshape() +{ + __menuet__get_process_table((process_table_entry*)pri,-1); + glViewport(0, 0, pri->winx_size, pri->winy_size-20); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(50.0, (GLfloat)pri->winx_size/pri->winy_size, 1.0, 300.0); + glMatrixMode(GL_MODELVIEW); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); +} + +void disabletgl() +{ + kosglDestroyContext(cgl); + delete pri; +} + +void Title() +{ + __menuet__write_text(300,8,0x10ffffff,fps,strlen(fps)); + __menuet__write_text(8,8,0x10ffffff,title1,strlen(title1)); + __menuet__write_text(180,8,0x00ffffff,title2,strlen(title2)); + __menuet__write_text(600,8,0x00ffffff,title3,strlen(title3)); +} + +void draw_window(void) +{ + // start redraw + __menuet__window_redraw(1); + // define&draw window + __menuet__define_window(win.x,win.y,win.dx,win.dy,TYPEWIN(0,0,0,1,skin,0,0,0),0,0); + // end redraw + __menuet__window_redraw(2); + // display string + Title(); +} + +void app_main(void) +{ + + win.x = 100; + win.y = 100; + win.dx = 400; + win.dy = 400; + + draw_window(); + + cgl = kosglCreateContext( 0, 0); + kosglMakeCurrent( 0, 20, win.dx, win.dy-20, cgl); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glClearDepth(1.0); + glEnable( GL_CULL_FACE ); + glEnable(GL_DEPTH_TEST); + + + int width, height; + unsigned char* texture; + LoadFileBMP( "./logio.bmp", &texture, &width, &height, false ); + + /* Setup texturing */ + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + /* generate texture object IDs */ + glGenTextures(1, TexObj); + glBindTexture(GL_TEXTURE_2D, *TexObj); + glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glBindTexture(GL_TEXTURE_2D, *TexObj); + glEnable(GL_TEXTURE_2D); + + pri=new process_table_entry_; + SysCall(66,1,1); + + reshape(); + +do{ + + angle += 0.001 + 0.1*Fps (330,8); + + DrawGL(); + + switch(__menuet__check_for_event()) + { + case 1: draw_window(); + reshape(); + break; + + case 2: + switch(__menuet__getkey()){ + + case KEY_F: + if(!FullScreen){ + skin=0; + SysCall(67,0,0,SysCall(14)>>16,SysCall(14)&0xffff); + draw_window(); + reshape(); + FullScreen = 1; + } + else{ + skin=3; + draw_window(); + SysCall(67,win.x,win.y,win.dx,win.dy); + reshape(); + FullScreen = 0; + }; + break; + + case KEY_ESC: disabletgl(); + return;} + break; + + case 3: disabletgl(); + return; + } +}while(1); +} + + diff --git a/programs/demos/cubetext/trunk/readme.txt b/programs/demos/cubetext/trunk/readme.txt new file mode 100644 index 0000000000..a3dba7ca76 --- /dev/null +++ b/programs/demos/cubetext/trunk/readme.txt @@ -0,0 +1 @@ +Лого KolibriOS - Lrz \ No newline at end of file diff --git a/programs/demos/gears/trunk/Makefile b/programs/demos/gears/trunk/Makefile new file mode 100644 index 0000000000..24ff09664f --- /dev/null +++ b/programs/demos/gears/trunk/Makefile @@ -0,0 +1,15 @@ +OUTFILE = gears + +SRCS = main.cpp fps.cpp + +OBJS = $(SRCS:.cpp=.o) + +CPPFLAGS = -I$(TINYGL)\include -O2 + +LIBR = TinyGL m +LIBS = $(addprefix -l,$(LIBR)) -L$(TINYGL)\lib + +all: $(OUTFILE) + objcopy $(OUTFILE) -O binary + +include $(MENUETDEV)/makefiles/Makefile_for_cpp_program diff --git a/programs/demos/gears/trunk/ProcessTab.h b/programs/demos/gears/trunk/ProcessTab.h new file mode 100644 index 0000000000..320a6dbb5e --- /dev/null +++ b/programs/demos/gears/trunk/ProcessTab.h @@ -0,0 +1,24 @@ + +struct process_table_entry_ +{ + __u32 cpu_usage __attribute__((packed)); + __u16 pos_in_windowing_stack __attribute__((packed)); + __u16 win_stack_val_at_ecx __attribute__((packed)); + __u16 rez1 __attribute__((packed)); + char name[11] __attribute__((packed)); + __u8 rez2 __attribute__((packed)); + __u32 memstart __attribute__((packed)); + __u32 memused __attribute__((packed)); + __u32 pid __attribute__((packed)); + __u32 winx_start,winy_start __attribute__((packed)); + __u32 winx_size,winy_size __attribute__((packed)); + __u8 slot __attribute__((packed)); + __u8 rez3 __attribute__((packed)); + __u32 clarx_start,clary_start __attribute__((packed)); + __u32 clarx_size,clary_size __attribute__((packed)); + __u8 win_condition __attribute__((packed)); + __u8 buf[955] __attribute__((packed)); +} __attribute__((packed)); + +#define TYPEWIN(D,C,B,A,Y,RR,GG,BB) (D<<31)|(C<<30)|(B<<29)|(A<<28)|(Y<<24)|\ +(RR<<16)|(GG<<8)|BB diff --git a/programs/demos/gears/trunk/SysCall.h b/programs/demos/gears/trunk/SysCall.h new file mode 100644 index 0000000000..ac4ad32eec --- /dev/null +++ b/programs/demos/gears/trunk/SysCall.h @@ -0,0 +1,188 @@ +#ifndef __cplusplus + +//"inline" функции для вызова системных функций Kolibri в C - в имени функции кол-во параметров +//SysCall# (номер_системной_функции, параметры,...) + +static inline int SysCall1 (int EAX__) __attribute__((always_inline)); +static inline int SysCall2 (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + +static inline int SysCall1 (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall2 (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall3 (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall4 (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall5 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall6 (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#else + +//"inline" функции для вызова системных функций Kolibri в C++ +//SysCall(номер_системной_функции, параметры,...) + +static inline int SysCall (int EAX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) __attribute__((always_inline)); +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) __attribute__((always_inline)); + + + +static inline int SysCall (int EAX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + + +static inline int SysCall (int EAX__, int EBX__, int ECX__, int EDX__, int ESI__, int EDI__) +{ + asm volatile(""::"a"(EAX__)); + asm volatile(""::"b"(EBX__)); + asm volatile(""::"c"(ECX__)); + asm volatile(""::"d"(EDX__)); + asm volatile(""::"S"(ESI__)); + asm volatile(""::"D"(EDI__)); + asm volatile("int $0x40"); + + register int res; + asm volatile("":"=a"(res):); + return res; +} + +#endif diff --git a/programs/demos/gears/trunk/fps.cpp b/programs/demos/gears/trunk/fps.cpp new file mode 100644 index 0000000000..c86ded1bfd --- /dev/null +++ b/programs/demos/gears/trunk/fps.cpp @@ -0,0 +1,46 @@ +#include "SysCall.h" + +/******************************************************************************* +ФУНКЦИЯ ОПРЕДЕЛЕНИЯ FPS +x,y - координаты вывода FPS на окно +возвращает время в сотых долях секунды затрачиваемое на 1 цикл + +*/ + +int time1=0; +int time2=0; +int fps1=0; +int timerend=0; + +int Fps (long x, long y)//функция определения FPS +{ + int tr; + + time1 = SysCall(26,9);//определяем время прошедшее момента запуска системы + + if (timerend==0) + { + time2=time1; + timerend=time1; + } + + tr = time1 - timerend; + + if ((time1 - time2) < 100)//если прошло менее 1 секунды + { //увеличиваем счетчик fps + fps1++; + } + else + { + //выводим число fps + SysCall(13,(x<<16)+23,(y<<16)+7,0x00555555); //НАРИСОВАТЬ ПОЛОСУ + SysCall(47,4<<16,fps1,(x<<16)+y,0xfafafa);//ВЫВЕСТИ В ОКНО ПРИЛОЖЕНИЯ ЧИСЛО + fps1=0; + time2=time1; + } + + timerend=time1; + +return tr; +} +//****************************************************************************** diff --git a/programs/demos/gears/trunk/main.cpp b/programs/demos/gears/trunk/main.cpp new file mode 100644 index 0000000000..5694d99744 --- /dev/null +++ b/programs/demos/gears/trunk/main.cpp @@ -0,0 +1,345 @@ +/* +Пример взят из набора примеров библиотеки Mesa + +iadn +http://www.iadn.narod.ru +iadn@bk.ru +*/ + +/* + * 3-D gear wheels. This program is in the public domain. + * + * Brian Paul + */ + +#include +#include //TinyGL +#include +#include + +#include "SysCall.h" +#include "ProcessTab.h" + +int Fps (long x, long y); +extern "C"{ +void app_main(void); +} + +struct { + int x,y; + int dx,dy; + } win; + +#define KEY_ESC 1 +#define KEY_F 33 + +char *title1 = "TinyGL in KolibriOS"; +char *title2 = "F full screen"; +char *title3 = "ESC - exit"; +char *fps = "FPS:"; + +unsigned char FullScreen = 0; +unsigned char skin = 3; + +process_table_entry_* pri; +KOSGLContext cgl; + +static GLfloat view_rotx=20.0, view_roty=30.0, view_rotz=0.0; +static GLint gear1, gear2, gear3; +static GLfloat angle = 0.0; + +static GLuint limit; +static GLuint count = 1; + +/* + * Draw a gear wheel. You'll probably want to call this function when + * building a display list since we do a lot of trig here. + * + * Input: inner_radius - radius of hole at center + * outer_radius - radius at center of teeth + * width - width of gear + * teeth - number of teeth + * tooth_depth - depth of tooth + */ +static void gear( GLfloat inner_radius, GLfloat outer_radius, GLfloat width, + GLint teeth, GLfloat tooth_depth ) +{ + GLint i; + GLfloat r0, r1, r2; + GLfloat angle, da; + GLfloat u, v, len; + + r0 = inner_radius; + r1 = outer_radius - tooth_depth/2.0; + r2 = outer_radius + tooth_depth/2.0; + + da = 2.0*M_PI / teeth / 4.0; + + glShadeModel( GL_FLAT ); + + glNormal3f( 0.0, 0.0, 1.0 ); + + /* draw front face */ + glBegin( GL_QUAD_STRIP ); + for (i=0;i<=teeth;i++) { + angle = i * 2.0*M_PI / teeth; + glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); + glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 ); + glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); + glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 ); + } + glEnd(); + + /* draw front sides of teeth */ + glBegin( GL_QUADS ); + da = 2.0*M_PI / teeth / 4.0; + for (i=0;iwinx_size, pri->winy_size-20); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0, (GLfloat)pri->winx_size/pri->winy_size, 1.0, 60.0); + glTranslatef( 0.0, 0.0, 20.0 ); + glMatrixMode(GL_MODELVIEW); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); +} + +void disabletgl() +{ + kosglDestroyContext(cgl); + delete pri; +} + +void Title() +{ + __menuet__write_text(300,8,0x10ffffff,fps,strlen(fps)); + __menuet__write_text(8,8,0x10ffffff,title1,strlen(title1)); + __menuet__write_text(180,8,0x00ffffff,title2,strlen(title2)); + __menuet__write_text(600,8,0x00ffffff,title3,strlen(title3)); +} + +void draw_window(void) +{ + // start redraw + __menuet__window_redraw(1); + // define&draw window + __menuet__define_window(win.x,win.y,win.dx,win.dy,TYPEWIN(0,0,0,1,skin,0,0,0),0,0); + // end redraw + __menuet__window_redraw(2); + // display string + Title(); +} + +void app_main(void) +{ + + win.x = 100; + win.y = 100; + win.dx = 400; + win.dy = 400; + + draw_window(); + + cgl = kosglCreateContext( 0, 0); + kosglMakeCurrent( 0, 20, win.dx, win.dy-20, cgl); + + init(); + + pri=new process_table_entry_; + SysCall(66,1,1); + + reshape(); + +do{ + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + glRotatef( view_rotx, 1.0, 0.0, 0.0 ); + glRotatef( view_roty, 0.0, 1.0, 0.0 ); + glRotatef( view_rotz, 0.0, 0.0, 1.0 ); + + glPushMatrix(); + glTranslatef( -2.0, -2.0, 0.0 ); + glRotatef( angle, 0.0, 0.0, 1.0 ); + glCallList(gear1); + glPopMatrix(); + + glPushMatrix(); + glTranslatef( 4.1, -2.0, 0.0 ); + glRotatef( -2.0*angle-9.0, 0.0, 0.0, 1.0 ); + glCallList(gear2); + glPopMatrix(); + + glPushMatrix(); + glTranslatef( -2.1, 4.2, 0.0 ); + glRotatef( -2.0*angle-25.0, 0.0, 0.0, 1.0 ); + glCallList(gear3); + glPopMatrix(); + + glPopMatrix(); + + kosglSwapBuffers(); + + angle += 0.01 + 0.3* Fps (330,8); + + switch(SysCall(11)) + { + case 1: draw_window(); + reshape(); + break; + + case 2: + switch(__menuet__getkey()){ + + case KEY_F: + if(!FullScreen){ + skin=0; + SysCall(67,0,0,SysCall(14)>>16,SysCall(14)&0xffff); + draw_window(); + reshape(); + FullScreen = 1; + } + else{ + skin=3; + draw_window(); + SysCall(67,win.x,win.y,win.dx,win.dy); + reshape(); + FullScreen = 0; + }; + break; + + case KEY_ESC: disabletgl(); + return;} + break; + + case 3: disabletgl(); + return; + } +}while(1); +}