0707070000020071551006440001450001440000010716420402316767000000500000000003Size50 0707070000020071571006440001450001440000010541700402316601400000700000003710README NOTES TO ACCOMPANY ENGINE DEMONSTRATION In the engine demo, the ascii arrays are ViFONT produced images. We use more meaningful pointers to illustrate basic pointer manipulation for those would-be, or should we say "could-be" developers. The program uses the lowest user-level raster operation call - IOCTL(2) {see window(7)}. Since each of the 4 frames has the same size, we only need to set most of the urdata information once. Effectively, the only change that is necessary is the address of where the image to be drawn is coming from. All of the ascii arrays are 70 pixels wide, by 50 pixels high, by 10 characters per row. If you are new to UNIX PC graphics, you will have to pay particular attention to the "character per row" specification. This is required by all raster operations (except window to window {if they are one in the same}). Somewhere deep inside the UNIX PC kernel lies the raster operation vectored to on ioctl(WIOCRASTOP). Inside this routine, you can be assured that the 68010 is set up to do a character transfer using loop mode (one of its fastest instructions). In this "loop mode", the 68010 MUST know how many characters are going to be transferred. A bad specification here is the most common cause of a PANIC, which we are sure everyone wants to avoid. We use a simple routine, which serves the purpose in every case where the pixel width of an image is known, but the characters per row, or "cpr", is not. We hope you will find this useful. int tocpr(width) int width; { int cpr; cpr = width / 8; /* How many characters? */ if(width % 8) cpr++; /* Any left over? */ if(cpr % 2) cpr++; /* Do we have even ushorts? */ return(cpr); } Please address all comments to: Amperfax Corporation 1928 N.E. 154th Street N.M.B., FL 33162 (305) 944-1477 0707070000020071671007550000000000000000010507260402317020300000700000010540engineR L | `@ .text| .data `@.bss ` `.lib ~ ~NV l:. N1. 0N1. PN1. wN1p.N1x n .N1V-@JlB n .N1V-@JlB.p/N1nX. N1. N1././< N1P. %N1-| -| -| x-| lB fBy jBy lBy n3 d3 p3 rB9 xB9 yB z3F t32 vB`# `. `/<W p/N1P.N# `. `/<W p/N1P.Nj# `. `/<W p/N1P.NB# `. `/<W p/N1P.NR .찮mRN"N^NuNVB`R .mN^NuNV. YN1. aN1p.N1xN^Nu/< ~N1X OQ./HJf/H#0N/N1x0<N@Engine Animation Demonstration Usage: engine [frames] [delay] frame values: 4, 8, 16, 32,... delay values: 0=too fast 20000=nice 40000=good [=1C Engine Animation Demonstration Number of frames = %d / Delay between frames = %d  Press [shift][Del] to exit anytime. [=0C We hope you enjoyed this demonstration. ??>>>>>>>>8ʁ@ @#888#㸎88##㸎88#CA#A0Ad"]wu]u"7d"/Un"7`"o""o#ɷ l#p#s#?#>p#?p#>7>C#7G+C70PcG#7!"7T A5H!@/0BU@/@@@@@ ??>>>>>>>>8+@ @#㸎8#㸎88##㸎88#A88#A0Ad"]wu]u"뷮Kn"%R:`"/`"o"ɷ"7o#7l#p+>p##p>#?p#>7>C#7G#C50kG#75"7*A7H!@/BA @/@@@@@ ??>>>>>>>>8@ @#88#㸎88##㸎88#A8C#A0Ad"]wu]u"$n*U7o" "o"l"ɷ`#7`#p#p#?#s>#?p#>7>C#7G#C7pcG#7!"7Q A7Z@/5BA@/@@@@@ ??>>>>>>>>8@ @#8+㸎88##㸎88#88A#A0Ad"]wu]u"Kn"7:Re"7o""o"/l#ɷ,`#p#p>##>s#?p#>7>C#7G#k70cG#7!"7 AV7H!@/0BA@/@@@@@ 0707070000020071531006440001450001440000010542000402316601600001100000005755engine.c/************************************************************** * ENGINE.C - ViFONT ANIMATION DEMONSTRATION * * CONTRIBUTED TO AT&T BY THE AMPERFAX CORPORATION * **************************************************************/ #include #include #include main(argc,argv) int argc; char *argv[]; { extern goodbye(); extern unsigned short ascii32[],ascii33[],ascii34[],ascii35[]; unsigned short *intake,*compression,*power,*exhaust; static struct urdata picture; int x,d,f; if(argc < 3) { printf("\33[2J\33[H\33[4mEngine Animation Demonstration\33[0m\n\n"); printf("Usage: engine [frames] [delay]\n"); printf(" frame values: 4, 8, 16, 32,...\n"); printf(" delay values: 0=too fast 20000=nice 40000=good\n"); exit(0); } f = atoi(argv[1]); /* Get number of frames */ if(f < 0) f=0; d = atoi(argv[2]); /* Get number for delay */ if(d < 0) d=0; /* Note to new developers: The UNIX PC counts argc from 1 to ...n, but argv[?] is counted from 0 {program name} ....n */ signal(SIGINT,goodbye); /* Set DEL vector for quit */ printf("\33[=1C\33[2J\33[H"); /* Cursor Off - Clear Screen */ printf("\t \33[4mEngine Animation Demonstration\33[0m\n\n"); printf("\tNumber of frames = %d / Delay between frames = %d\n\n",f,d); printf("\t \33[7m Press [shift][Del] to exit anytime. \33[0m"); intake = ascii32; /* This isn't necessary-aids readability*/ compression = ascii33; power = ascii34; exhaust = ascii35; picture.ur_dstbase = 0; /* Tell ioctl we are using this window */ picture.ur_dstwidth= 0; picture.ur_srcx = 0; /* Start taking the image from p(0,0) */ picture.ur_srcy = 0; picture.ur_srcwidth= 10; /* All images are 10 chars/row */ picture.ur_dstx = 250; /* Somewhere near middle of UNIX window */ picture.ur_dsty = 150; picture.ur_srcop = SRCSRC; /* Load the original source image only */ picture.ur_dstop = DSTSRC; /* Draw the original source image only */ picture.ur_pattern = 0; /* Not using any pattern here */ picture.ur_width = 70; /* All images are 70 pixels wide */ picture.ur_height = 50; /* All images are 50 pixels high */ for(x=0; x /usr/bin engine.c --> ${HOME}/Filecabinet/ENGINE/SRC frames.c --> ${HOME}/Filecabinet/ENGINE/SRC Makefile --> ${HOME}/Filecabinet/ENGINE/SRC README --> ${HOME}Filecabinet/ENGINE/DOC " mkdir ${HOME}/Filecabinet/ENGINE mkdir ${HOME}/Filecabinet/ENGINE/SRC mkdir ${HOME}/Filecabinet/ENGINE/DOC mv engine /usr/bin mv engine.c ${HOME}/Filecabinet/ENGINE/SRC mv frames.c ${HOME}/Filecabinet/ENGINE/SRC mv Makefile ${HOME}/Filecabinet/ENGINE/SRC mv README ${HOME}/Filecabinet/ENGINE/DOC 0707070000020071631006440001450001440000010543030402320172600000700000000503Remove rm /usr/bin/engine rm ${HOME}/Filecabinet/ENGINE/SRC/engine.c rm ${HOME}/Filecabinet/ENGINE/SRC/frames.c rm ${HOME}/Filecabinet/ENGINE/SRC/Makefile rm ${HOME}/Filecabinet/ENGINE/DOC/README rmdir ${HOME}/Filecabinet/ENGINE/SRC rmdir ${HOME}/Filecabinet/ENGINE/DOC rmdir ${HOME}/Filecabinet/ENGINE 0707070000020071661006440001450001440000010543300402317005300001100000000162Makefileall: cc -Oc engine.c frames.c ld engine.o frames.o /lib/crt0s.o /lib/shlib.ifile strip a.out mv a.out engine 0707070000020071541007740000000000000000010661720402317036400001100000000043MAKEcpiocat Files | cpio -ocBv > ENGINE+IN 0707070000020071741007740000000000000000010661730402317034200001100000000061MAKEflopcat Files | cpio -ocBv > /dev/rfp021 dismount -f 0707070000020071741007740000000000000000010661730402317034200001300000000000TRAILER!!!xd647, 0x0023, 0x6b37, 0x0630, 0x1063, 0xd047, 0x0023, 0xd537, 0x0410, 0x0821, 0x1fc2, 0x0022, 0xaa37, 0x8411, 0x0420, 0x0041, 0x001c, 0x5637, 0x4821, 0x8210, 0x0040, 0x0000, 0xac2f, 0x3042, 0x4108, 0x0040, 0x0000, 0xd81c, 0xffff, 0x2fff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x1fff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x0fff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x07ff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x03ff, 0x0040, 0x0000, 0x001c, 0xffff, 0x01ff, 0x0020, 0x0000, 0x000c, 0x0000, 0xfff0, 0x001f, 0x0000 }; 0707070000020071511006440001450001440000010542730402317046000000600000000162Files./Size ./README ./engine ./engine.c ./frames.c ./Files ./Name ./Install ./Remove ./Makefile ./MAKEcpio ./MAKEflop 0707070000020071611006440001450001440000010542770402316661300000500000000052NameEngine Animation Demo V1.0 via THE STORE 0707070000020071621006440001450001440000010543010402316763400001000000001041Install echo " engine --> /usr/bin engine.c --> ${HOME}/Filecabinet/ENGINE/SRC frames.c --> ${HOME}/Filecabinet/ENGINE/SRC Makefile --> ${HOME}/Filecabinet/ENGINE/SRC README --> ${HOME}Filecabinet/ENGINE/DOC " mkdir ${HOME}/Filecabinet/ENGINE mkdir ${HOME}/Filecabinet/ENGINE/SRC mkdir ${HOME}/Filecabinet/ENGINE/DOC mv engine /usr/bin mv engine.c ${HOME}/Filecabinet/ENGINE/SRC mv frames.c ${HOME}/Filecabinet/ENGINE/SRC mv Makefile ${HOME}/Filecabinet/ENGINE/SRC mv README ${HOME}/Filecabinet/ENGINE/DOC 0707070000020071631006440001450001440000010543030402320172600000700000000503Remove rm /usr/bin/engine rm ${HOME}/Filecabinet/ENGINE/SRC/engine.c rm ${HOME}/Filecabinet/ENGINE/SRC/frames.c rm ${HOME}/Filecabinet/ENGINE/SRC/Makefile rm ${HOME}/Filecabinet/ENGINE/DOC/README rmdir ${HOME}/Filecabinet/ENGINE/SRC rmdir ${HOME}/Filecabinet/ENGINE/DOC rmdir ${HOME}/Filecabinet/ENGINE 0707070000020071661006440001450001440000010543300402317005300001100000000162Makefileall: cc -Oc engine.c frames.c ld engine.o frames.o /lib/crt0s.o /lib/shlib.ifile strip a.out mv a.out engine 0707070000020071541007740000000000000000010661720402317036400001100000000043MAKEcpiocat Files | cpio -ocBv > ENGINE+IN 0707070000020071741007740000000000000000010661730402317034200001100000000061MAKEflopcat Files | cpio -ocBv > /dev/rfp021 dismount -f 0707070000020071741007740000000000000000010661730402317034200001300000000000TRAILER!!!xd647, 0x0023, 0x6b37, 0x0630, 0x1063, 0xd047, 0x0023, 0xd537, 0x0410, 0x0821, 0x1fc2, 0x0022, 0xaa37, 0x8411, 0x0420, 0x0041, 0x001c, 0x5637, 0x4821, 0x8210, 0x0040, 0x0000, 0xac2f, 0x3042, 0x4108, 0x0040, 0x0000, 0xd81c, 0xffff, 0x2fff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x1fff, 0x0040, 0x0000, 0xfffc, 0xffff, 0x0fff,