Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1313 → Rev 1312

/demos/trunk/kalm3d/kalm3d.c
18,7 → 18,7
 
#include <ll/i386/defs.h>
 
#include <drivers/glib.h>
#include <drivers/vga.h>
#include <drivers/pclab.h>
 
#include <math.h>
38,6 → 38,8
#define WIDTH 640
#define HEIGHT 480
#define BYTES_PP 2
#define INITSTR G640x480x64K
#define CARD SAVAGE
 
unsigned long int PERIOD_CARRELLO = 10000;
unsigned long int PERIOD_DISEGNA = 80000;
75,7 → 77,7
OSMesaDestroyContext(ctx);
free(buffers);
 
grx_close();
vga_setmode(TEXT,CARD);
 
sys_end();
 
306,7 → 308,7
sprintf(text,"Hard Task Draw PER:%6d us EX:%6d us",(int)PERIOD_DISEGNA,(int)disegna_TIME);
grx_text(text,10,15,rgb16(0,0,255),rgb16(255,255,255));
memcpy(vbuf,buffers,count);
copy_videomem_16to16(buffers,vbuf,count);
 
task_endcycle();
 
319,22 → 321,31
 
}
 
static void screen()
static void screen(int mode)
{
extern DWORD flbaddr;
vga_modeinfo *minf;
int mem;
/* graphic card Initialization */
if (grx_init() < 1) {
sys_abort(1);
vga_setmode(mode,CARD);
minf = vga_getmodeinfo(mode);
if(! (minf->flags & CAPABLE_LINEAR)){
vga_setmode(TEXT,CARD);
printk(KERN_INFO "The mode %d is not capable of linear\n",mode);
return;
}
if (grx_open(640, 480, 16) < 0) {
cprintf("GRX Err\n");
sys_abort(1);
vga_setpage(0);
if(vga_setlinearaddressing() == -1) {
vga_setmode(TEXT,CARD);
printk(KERN_INFO "Could not set linear addressing for mode %d\n",mode);
return;
}
vbuf = (unsigned char *)flbaddr;
mem = minf->linewidth*minf->height;
 
vbuf = vga_getgraphmem();
printk(KERN_INFO "Memory mapped to %08x. Mode = %d.\n",(int) vbuf,mode);
memset(vbuf,0,mem);
 
}
 
void waitenter() {
426,12 → 437,12
init_motor();
 
screen();
screen(INITSTR);
 
ctx = OSMesaCreateContext(OSMESA_RGB_565, NULL );
buffers = malloc(WIDTH * HEIGHT * 2);
 
buffers = malloc(WIDTH*HEIGHT*BYTES_PP);
 
grx_setbuffer(buffers, WIDTH, HEIGHT);
OSMesaMakeCurrent(ctx, buffers, GL_UNSIGNED_SHORT_5_6_5, WIDTH, HEIGHT);
init_gl();
/demos/trunk/kalm3d/makefile
12,5 → 12,5
include $(BASE)/config/example.mk
 
kalm3d:
make -f $(SUBMAKE) APP=kalm3d INIT= OTHEROBJS="initfile.o carrello.o" SHARKOPT="__OSMESA__ __PCLAB__ __OLDCHAR__ __GRX__"
make -f $(SUBMAKE) APP=kalm3d INIT= OTHEROBJS="initfile.o carrello.o" SHARKOPT="__OSMESA__ __PCLAB__ __OLDCHAR__ __SVGA__"