/* show.c sh1.bat = cl /AL show.c vimage3 graphlib show [name*] [palname] */ #include #include #include "nomouse.h" #include "font.h" #include #include #define MAX_NUM 200 #define S_SIZE 40 #define BUFF 240 #define RED 241 #define ORANGE 242 #define YELLOW 243 #define GREEN 244 #define CYAN 245 #define BLUE 246 #define MAGENTA 247 #define BROWN 248 #define D_CYAN 249 #define WHITE 250 #define BLACK 251 #define D_GREY 252 #define M_GREY 253 #define L_GREY 254 #define D_GREEN 255 int ScreenXs=640,ScreenYs=480; long Delay; struct Color { unsigned char r, g, b; }Lut[256]; VideoType='X'; struct board { int row,col,color; }B_Id; struct file_id { char name[S_SIZE]; long size; unsigned date,time; }; extern struct file_id GF_File[MAX_NUM]; extern int GF_Order[MAX_NUM]; unsigned char Buffer1[120][320],Buffer2[120][320]; unsigned char BarBuffer[18][640]; int D_Grey,Black,M_Grey,L_Grey,White; int VGA_Color[16][3]= { {105, 90, 75}, /* 240 BUFF */ {255, 0, 0}, /* 241 RED */ {255,128, 0}, /* 242 ORANGE */ {191,192, 0}, /* 243 YELLOW */ { 0,191, 0}, /* 244 GREEN */ { 0,191,191}, /* 245 CYAN */ { 0, 0,255}, /* 246 BLUE */ {191, 0,191}, /* 247 MAGENTA */ { 96, 28, 14}, /* 248 BROWN */ { 0, 91, 91}, /* 249 D_CYAN */ {255,255,255}, /* 250 WHITE */ { 0, 0, 0}, /* 251 BLACK */ { 70, 70, 70}, /* 252 D_GREY */ {127,127,127}, /* 253 M_GREY */ {191,191,191}, /* 254 L_GREY */ { 0,128, 0} /* 255 D_GREEN */ }; int Auto=0; int Text=0,I1,I2,I3,I4; int Quick=0; char HdrText[16][46]; int Script; int plotrow(int plane,int x1,int x2,int y,unsigned char *buffer); long set_time(long delay); main(int argc,char *argv[]) { int i,j,k,r,c,j2; long li; int num_files,time=0; char string[100],ans; FILE *fp; unsigned char val[2]; long offset; int row,col,num,x1,x2,y1,row2; int txc,tyc,txs=12*7,tys=15,end; unsigned int size=38400; int quick=0; Delay=set_time((long)10000)/10; printf("Delay = %ld\n",Delay); if(argc==2) strcpy(string,argv[1]); else Auto=1; for(;;) { if(Auto==1) { Quick=0; if(get_file_name("*.shw",string)<0) { if(time==0) { printf( "\n\n\n No '.shw' files or none chosen.\n\n"); printf( " Program 'show' displays a sequence of quarter screen images all\n"); printf( " of which use the same palette (or color look up table). Before\n"); printf( " you can use this program you must run program 'showprep' which\n"); printf( " reads a series of '.dat' files. The format for running\n"); printf( " 'showprep' is as follows:\n"); printf("\n"); printf( " 1. showprep name*\n"); printf( " or \n"); printf( " 2. showprep name???\n"); printf("\n"); printf( " or \n"); printf( " 3. showprep /script name.spt\n"); printf("\n"); printf( "The name must contain wild cards (option 1&2) to identify a series of '.dat'\n"); printf( "files. The files will be processed in alphabetical order (except option 3)\n"); printf("\n"); } exit(0); } } time+=1; for(k=0;k0) { ans=getch(); if(ans==27) { video_off(); if(Auto==0) exit(0); else { end=1; break; } } else if(ans=='s') { if(quick==0) Delay*=2; else quick=0; } else if(ans=='f') { if(Delay>1) Delay/=2; else if(quick==0) { quick=1; paint_box(0,D_GREY,BarBuffer,txc,tyc,txs,tys); } } else getch(); } if(end==1) break; if(quick==0) { paint_box(0,D_GREY,BarBuffer,txc,tyc,txs,tys); plot_font_h(L_GREY,txc+2,tyc+2,string,2,Font); } for(i=0;i0) { delay=3000*delay; delay/=dt; } return(delay); } /********************************************************************** ** ** ** **********************************************************************/ int video_off() { SetVideoMode(0); } /************************************************************************** ** ** ** ************************************************************************* */ int video_on() { int i,row; i=GetVideoBoardID(); if(i==0) VideoType='E'; else if(i==1&&(VideoType=='X'||VideoType=='Y')) VideoType='V'; if(VideoType=='X') { row=SetVideoMode(480,&B_Id); if(B_Id.color==256&&B_Id.row==480) { ScreenXs=640; ScreenYs=480; } else if(B_Id.color==256&&B_Id.row==400) VideoType='Y'; else VideoType='V'; } if(VideoType=='Y') { row=SetVideoMode(400,&B_Id); if(B_Id.row<400) VideoType='V'; else { ScreenXs=640; ScreenYs=row; } } if(VideoType=='V') { row=SetVideoMode(0x12,&B_Id); if(B_Id.row!=480||row!=480||B_Id.color!=16||B_Id.col!=640) VideoType='E'; else { ScreenXs=640; ScreenYs=480; } } if(VideoType=='S') { row=SetVideoMode(0x13,&B_Id); if(B_Id.row!=200) { SetVideoMode(0,&B_Id); printf("Could not boot color board.\n"); exit(0); } ScreenXs=320; ScreenYs=200; } if(VideoType=='E') { row=SetVideoMode(0x10,&B_Id); if(B_Id.row!=350||row<350||B_Id.col!=640) { SetVideoMode(0,&B_Id); printf("Could not boot color board.\n"); exit(0); } ScreenXs=640; ScreenYs=350; } if(B_Id.row<0) { SetVideoMode(0,&B_Id); printf("Could not boot board -- row = %d\n\n",row); exit(0); } } /********************************************************************** ** ** ** **********************************************************************/ int set_lut() {}