// Header File // Copyright (C) 2010 Danny Clark // Created 9/29/2010; 12:53:31 PM #ifndef DRAW_H_ #define DRAW_H_ #define xoff 15 //FOR TI-89 or TI-89 TITANIUM #define yoff 5 //FOR TI-89 or TI-89 TITANIUM //#define xoff 40 //FOR TI-92, TI-92 PLUS, or VOYAGE 200 //#define yoff 14 //FOR TI-92, TI-92 PLUS, or VOYAGE 200 void drawlevel(char cl[25][40], char ladders[25][40],char levelinfo[4], int onlad) { //RAW SPRITE DATA: unsigned short brickd[]={0xffc0,0x8040,0xbfc0,0xbfc0,0xffc0,0xffc0,0x0c00,0xfdc0,0xfdc0,0xffc0}; unsigned short brickl[]={0xffc0,0xffc0,0xc040,0xc040,0xffc0,0xffc0,0xffc0,0x0e00,0x0e00,0xffc0}; unsigned short blockd[]={0xffc0,0xffc0,0xffc0,0xe1c0,0xe1c0,0xe1c0,0xe1c0,0xffc0,0xffc0,0xffc0}; unsigned short blockl[]={0xffc0,0x8040,0x8040,0x9e40,0x9240,0x9240,0x9e40,0x8040,0x8040,0xffc0}; unsigned short guyleftd[]={0x3e00,0x1a00,0x1200,0x0c00,0x1e00,0x3f80,0x5200,0x1e00,0x1200,0x3600}; unsigned short guyleftl[]={0x3e00,0x1e00,0x1e00,0x0c00,0x1e00,0x3380,0x5e00,0x1e00,0x1200,0x3600}; unsigned short guyrightd[]={0x1f00,0x1600,0x1200,0x0c00,0x1e00,0x7f00,0x1280,0x1e00,0x1200,0x1b00}; unsigned short guyrightl[]={0x1f00,0x1e00,0x1e00,0x0c00,0x1e00,0x7300,0x1e80,0x1e00,0x1200,0x1b00}; unsigned short bombd[]={0x0e00,0x0800,0x1e00,0x3f00,0x7f80,0x7f80,0x7f80,0x7f80,0x3f00,0x1e00}; unsigned short bombl[]={0x0e00,0x0800,0x1e00,0x2100,0x4080,0x4080,0x4080,0x4080,0x2100,0x1e00}; unsigned short gbombd[]={0x0e00,0x0800,0x1e00,0x2100,0x4080,0x4080,0x4080,0x4080,0x2100,0x1e00}; unsigned short gbombl[]={0x0e00,0x0800,0x1e00,0x2100,0x4080,0x4080,0x4080,0x4080,0x2100,0x1e00}; unsigned short doord[]={0x0000,0x7f80,0x7f80,0x6180,0x6180,0x6180,0x6180,0x6180,0x6180,0x6180}; unsigned short doorl[]={0x0000,0x7f80,0x4080,0x5e80,0x5280,0x5280,0x5280,0x5280,0x5280,0x5280}; unsigned short ladderd[]={0x4080,0x7f80,0x7f80,0x4080,0x4080,0x4080,0x7f80,0x7f80,0x4080,0x4080}; unsigned short ladderl[]={0x7f80,0x7f80,0x4080,0x7f80,0x4080,0x7f80,0x7f80,0x4080,0x7f80,0x4080}; unsigned short guyladdard[]={0x5e80,0x7380,0x7380,0x4c80,0x5e80,0x5e80,0x7380,0x7f80,0x5280,0x5280}; unsigned short guyladdarl[]={0x7f80,0x7f80,0x5e80,0x7f80,0x5e80,0x7380,0x7f80,0x5e80,0x7f80,0x5280}; unsigned short pushd[]={0xffc0,0x8040,0xbf40,0xbf40,0xbf40,0xbf40,0xbf40,0xbf40,0x8040,0xffc0}; unsigned short pushl[]={0xffc0,0xffc0,0xdcc0,0xd2c0,0xdcc0,0xd0c0,0xd0c0,0xd0c0,0xffc0,0xffc0}; unsigned short spiked[]={0x2100,0x2100,0x5280,0x5280,0xffc0,0xffc0,0xffc0,0x87c0,0xf840,0xffc0}; unsigned short spikel[]={0x2100,0x2100,0x7380,0x7380,0x8c40,0x8c40,0xffc0,0xf840,0x87c0,0xffc0}; unsigned short metald[]={0xffc0,0x8c40,0x8c40,0x8c40,0xffc0,0xffc0,0x8c40,0x8c40,0x8c40,0xffc0}; unsigned short metall[]={0xffc0,0x8c40,0x8c40,0x8c40,0xffc0,0xffc0,0x8c40,0x8c40,0x8c40,0xffc0}; //unsigned short blank[]={0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}; int drawx=0,drawy=0,x,y,pic,pic2,dx,dy; void *ds,*ls; if(!(ds=malloc(LCD_SIZE))) { return; } if(!(ls=malloc(LCD_SIZE))) { free(ds); return; } if(!GrayOn()) { free(ds); free(ls); return; } memset(ls,0,LCD_SIZE); memset(ds,0,LCD_SIZE); drawx=levelinfo[0]-6; if(drawx<0) { drawx=0; } if(drawx+12>levelinfo[2]) { drawx=levelinfo[2]-12; } drawy=levelinfo[1]-4; if(drawy<0) { drawy=0; } if(drawy+9>levelinfo[3]) { drawy=levelinfo[3]-9; } dx=0,dy=0; for(x=drawx;x