0707070000020006361006440001460001440000010047730351467570000000500000000003Size80 0707070000020006461007770001460001440000010051400351467763700001000000001604InstallNAME=FATBIT FOLDER=/u/$LOGNAME/Filecabinet/SRC if [ -d $FOLDER ] then message -i "A new folder called $NAME will be created in your Filecabinet/SRC folder. The source code and final executable will be placed in this folder for your use.\n\nTouch to continue." else message -i "A folder called SRC is being created in your Filecabinet. A second folder called SRC/$NAME will then be created to hold the source code and executable for your use.\n\nTouch to continue." mkdir $FOLDER chown $LOGNAME $FOLDER fi mkdir ${FOLDER}/$NAME chown $LOGNAME ${FOLDER}/$NAME DEST=${FOLDER}/$NAME for i in `ls *.c Makefile testit fatbit README` do ln $i ${DEST}/$i chown $LOGNAME ${DEST}/$i done message -i "OK - everything is in Filecabinet/SRC/${NAME}.\n\nThere is a makefile and a README file along with the executable.\n\nThe executable is called "fatbit".\n\nTouch to continue." 0707070000020006311006440001460001440000010004340351466773600001000000001221array.c/* array ARRAY contains a picture 48 pixels wide and 19 pixels high. for wrastop calls use srcwidth = 6, width = 48, and height = 19. */ static unsigned short ARRAY[57] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0000, 0x0000, 0x1000, 0x0000, 0xfffc, 0x3fff, 0x0000, 0xfffc, 0x3fff, 0x0000, 0x1800, 0x1000, 0x0000, 0x1800, 0x0800, 0x0000, 0x1800, 0x0000, 0x0004, 0x1800, 0x0000, 0x0008, 0x9800, 0xfde7, 0x001f, 0x9800, 0x2024, 0x0008, 0x9800, 0x2024, 0x0004, 0x9800, 0x21e7, 0x0000, 0x9800, 0x2100, 0x0000, 0x9800, 0x2100, 0x0000, 0x9800, 0x210f, 0x0000, 0x0000, 0x0100, 0x0000, 0xfff8, 0x01ff, 0x0000, 0x0000, 0x0000, 0x0000 }; 0707070000020006331006440001460001440000010004360351466773600001100000001632dobits.c#include #include extern unsigned short patblack[]; extern unsigned short patwhite[]; extern int wp; struct umdata um; extern int OFFSET,HORBITS,VERBITS,ROWS,COLMS; dobits(wn,button,x,y) int wn,button,x,y; { unsigned short *pattern; int flags; int xnew,ynew; int xras,yras; if(button==MBUTM) pattern=patblack; else pattern=patwhite; xras=x/HORBITS; xnew=xras*HORBITS+1; yras=y/VERBITS; ynew=yras*VERBITS+1; if(button) { wrastop(wn,0,0,0,0,0,0,xnew,ynew,HORBITS-1,VERBITS-1,SRCPAT,DSTSRC,pattern); /* change the pixel in the real image in upper left */ wrastop(wp,0,0,0,0,0,0,xras,yras,1,1,SRCPAT,DSTSRC,pattern); } if(button) flags=MSDOWN|MSUP|MSOUT; else flags=MSDOWN; resetmouse(wn,xnew,ynew,flags); } resetmouse(wn,xnew,ynew,flags) int wn,xnew,ynew,flags; { um.um_flags = flags; um.um_x = xnew; um.um_y = ynew; um.um_w = HORBITS; um.um_h = VERBITS; wsetmouse (wn, &um); } 0707070000020006521007550001460001440000010050210351466775500000700000031546fatbitR30D D( .text  .data D@.bss D D(.lib l l/< lN1X OQ./HJf/H#0Nsetpgrp1Dsetuid1Jsetgid1Pshmctl1Vshmget1\shmat1bshmdt1hsignal1nstat1tstty1zfstat1stime1swrite1sync1syslocal1time1times1ulimit1umask1umount1uname1unlink1ustat1utime1wait1write1abort1abs1atof1clock1crypt1setkey1encrypt1ctermid1 ctime1localtim1gmtime1asctime1"tzset1(cuserid1.ecvt14fcvt1:gcvt1@fclose1Ffflush1Lfopen1Rfreopen1Xfdopen1^fread1dfwrite1jfrexp1pldexp1vmodf1|fseek1rewind1ftell1ftw1fgetc1getw1getcwd1getenv1getgrent1getgrgid1getgrnam1setgrent1endgrent1getlogin1getopt1getpass1getpw1getpwent1getpwuid1getpwnam1setpwent1endpwent1gets1getchar1 fgets1getutent1getutid1getutlin1$pututlin1*setutent10endutent16utmpname1<malloc1Bfree1Hrealloc1Ncalloc1Tcfree1Zmemccpy1`memchr1fmemcmp1lmemcpy1rmemset1xmktemp1~monitor1perror1popen1pclose1printf1fprintf1sprintf1fputc1putw1putpwent1puts1putchar1fputs1scanf1fscanf1sscanf1setbuf1sleep1ssignal1gsignal1strcat1strncat1strcmp1strncmp1strcpy1strncpy1strlen1 strchr1&strrchr1,strpbrk12strspn18strcspn1>strtok1Dstrtol1Jatol1Patoi1Vswab1\system1btmpfile1htmpnam1ntempnam1tttyname1zisatty1ttyslot1ungetc1_filbuf1_flsbuf1lmul__1lmul1ldiv__1ldiv1lrem__1lrem1aldiv1almul1alrem1ulmul1uldiv__1uldiv1ulrem__1ulrem1qsort1l3tol1ltol31tgetflag1tgetent1 tgetstr1tgetnum1tgoto1tputs1"form1(menu1.message14setattr1:pb_open1@adf_gtxc1Fadf_gtwr1Lpb_gets1Rpb_check1Xpb_weof1^pb_seek1dpb_puts1jpb_name1ppb_empty1vpb_gbuf1|adf_gtto1wrefresh1track1wcreate1initscr1cbreak1attroff1nl1attron1flushinp1noecho1inch1getch1savetty1resetty1echo1nocbreak1nonl1wdelete1wprexec1wpostwai1wgetc1kcodemap1keypad1 wsigintr1wind1wsigcatc1winit1$wsetbuf1*iswind10wexit16endwin1<wgetpos1Bwgoto1Hwinstr1Nwreadmou1Twsetmous1Zwgetmous1`wnl1fwndelay1lwprompt1rwguser1xwcmd1~wslk1wlabel1wuser1wprintf1printw1wputc1wputs1wrastop1wselect1wgetsel1wsetstat1wgetstat1setty1fixterm1physclr1resetter1setterm1getterm1baudrate1parselin1slkcol1setjmp1longjmp1afmulf1afdivf1afaddf1_cvfd1 _cvif1&fltused1,syment12fmul18fdiv1>fadd1Dfsub1J_cvdf1P_cvdi1V_cvid1\_cvfi1bafadd1hafsub1nafsubf1tafmul1zexhelp1tolower1wicon1wicoff1toupper1l64a1a64l1_bufsync1setuname1auldiv1eprintf1dbsub__1dbadd__1dbdiv__1dbmul__1ltodb__1dbtol__1dbtofl__1fltodb__1ltofl__1fltol__1ultodb__1ultofl__1aulmul1 afdiv1dbtst__1fltst__1plock1"dial1(callout1.undial14drand481:erand481@lrand481Fmrand481Lsrand481Rjrand481Xseed481^lcong481drand1jsrand1p_startmain<_end lOFFSET DHORBITS HVERBITS LROWS PCOLMS Tgridon clearitzstartupJdobits0makecprowp Xgridum \resetmouZ_etext etext _edata Dedata Dend l0707070000020006351006440001460001440000010004410351466773700000700000001057grid.c#include int OFFSET,HORBITS,VERBITS,ROWS,COLMS; extern unsigned short patblack[]; extern unsigned short patwhite[]; extern int box; grid(wn) int wn; { register int i; unsigned short *pattern; pattern = patwhite; for ( i=0;i<=COLMS;i++) wrastop(wn,0,0,0,0,(HORBITS*i)+OFFSET,1,(HORBITS*i)+OFFSET,1,1,(VERBITS*ROWS)-1,SRCPAT,DSTSRC,pattern); for ( i=0;i<=ROWS;i++) wrastop(wn,0,0,0,0,OFFSET+1,(VERBITS*i),OFFSET+1,(VERBITS*i),(HORBITS*COLMS)-1,1,SRCPAT,DSTSRC,pattern); wprompt(wn,"Left or Right button fills in, middle button erases"); } 0707070000020006421006440001460001440000010050010351467554100000700000002541README Welcome to the fatbit editor .... a combination programming tool and programming example hacked together by Fred Hicinbothem in June of 1985. The fatbit editor is used to create a static array which can be used in your C programs to incorporate pictures into your application. With some enhancement it could be used for font or icon creation as well. The tool is used as follows: 1. execute fatbit 2. pick a grid size and use the mouse to light or erase pixels until you have a picture you like. 3. use the MAKE C-PROG labelled key to create a file in the current directory called array.c 4. exit fatbit 5. edit the array.c file to name the ARRAY whatever you please (for use in your program) 6. stick the array.c file into your application and use the data array as you please with wrastops or the like (note the file testit.c which is provided as an example) As of this date I have not experimented with the use of fatbit for icon or font creation but the concepts are identical - maybe some energetic programmer will define some SLKs for MAKE ICON or MAKE FONT. Also, another enhancement would be to load existing "pictures" into the fatbit editor for modification. In the meantime, if you have a development set, enjoy playing with it. If you don't, this is probably a fairly useless tool. Questions, bugs, enhancements to mtuxn!4341fah 0707070000020006371006440001460001440000010004440351466774000000700000001611main.c#include extern int wp; int OFFSET,HORBITS,VERBITS,ROWS,COLMS; char gridon=0; extern unsigned short patblack[]; main(argc,argv) int argc; char *argv[]; { int wn; int key; int mousex, mousey, mouseb, mouser; int mouse; wn=startup(); while (1) { key = wgetc(wn); switch(key) { case Mouse: wreadmouse(wn,&mousex,&mousey,&mouseb,&mouser); if(gridon) { mouse=1; dobits(wn,mouseb,mousex,mousey); } break; case F1: HORBITS=9; COLMS=54; VERBITS=6; ROWS=40; clearit(wn,wp); grid(wn); gridon=1; break; case F2: makecprog(wn); break; case F7: clearit(wn,wp); gridon=0; break; case F8: HORBITS=3; COLMS=162; VERBITS=3; ROWS=80; clearit(wn,wp); grid(wn); gridon=1; break; case Exit: exit(0); } } } clearit(wn,wp) int wn,wp; { wrastop(wp,0,0,0,0,0,0,0,0,162,84,SRCPAT,DSTSRC,patblack); wrastop(wn,0,0,0,0,0,0,0,0,486,240,SRCPAT,DSTSRC,patblack); } 0707070000020006511006440001460001440000010050030351467334500001100000000366Makefileinclude $(MAKEINC)/Makepre.h OBJ=main.o grid.o startup.o dobits.o makecprog.o all: $(OBJ) $(LD) $(LDFLAGS) $(SHAREDLIB) $(OBJ) -o fatbit testit: testit.o $(LD) $(LDFLAGS) $(SHAREDLIB) testit.o -o testit include $(MAKEINC)/Makepost.h 0707070000020006411006440001460001440000010047700351466774200001400000004547makecprog.c#include #include extern int OFFSET,HORBITS,VERBITS,ROWS,COLMS; extern unsigned short patwhite[]; extern int wp; makecprog(wn) int wn; { char *filename; unsigned short ARRAY[960]; int mousex, mousey, mouseb, mouser; int xfirst, yfirst, xnew, ynew; int xsecond, ysecond; int lim; int ii,jj; char *fd, *fopen(); int shorts,width,height; int key; wprompt(wn,"Use left mouse key to highlight upper left pixel of array."); while (1) { key = wgetc(wn); switch(key) { case Mouse: wreadmouse(wn,&mousex,&mousey,&mouseb,&mouser); goto program1; case Cancl: case Exit: return(0); default: break; } } program1: xfirst=mousex/HORBITS; yfirst=mousey/VERBITS; xnew=xfirst*HORBITS+1; ynew=yfirst*VERBITS+1; wrastop(wn,0,0,0,0,0,0,xnew,ynew,HORBITS-1,VERBITS-1,SRCPAT,DSTSRC,patwhite); wprompt(wn,"Use left mouse key to highlight lower right pixel of array."); while (1) { key = wgetc(wn); switch(key) { case Mouse: wreadmouse(wn,&mousex,&mousey,&mouseb,&mouser); goto program2; case Cancl: case Exit: return(0); default: break; } } program2: xsecond=mousex/HORBITS; ysecond=mousey/VERBITS; xnew=xsecond*HORBITS+1; ynew=ysecond*VERBITS+1; wrastop(wn,0,0,0,0,0,0,xnew,ynew,HORBITS-1,VERBITS-1,SRCPAT,DSTSRC,patwhite); /* we now have the upper left and lower right corners - since the array must be 16*N pixels (bits) wide - we compute that */ shorts=(xsecond-xfirst)/16 + 1; /* number of shorts wide */ width=shorts*16; height=ysecond-yfirst+1; /* put the chosen segment into the ARRAY array */ wrastop(wp,0,0,ARRAY,shorts*2,xfirst,yfirst,0,0,width,height,SRCSRC,DSTSRC,0); wprompt(wn,""); /* open the file and stick the program in there */ filename="array.c"; fd=fopen(filename,"a"); fprintf(fd,"/* array ARRAY contains a picture %d pixels wide and %d pixels high.\n for wrastop calls use srcwidth = %d, width = %d, and height = %d. */\n",width,height,shorts*2,width,height); fprintf(fd,"static unsigned short ARRAY[%d] = { \n",height*shorts); for (ii=0;ii /dev/null 2>&1 0707070000020006441006440001460001440000010047770351466774400001200000002170startup.c#include struct umdata um; int wp; startup() { int wn; int i; struct uwdata uw; /* Make sure we're on a bitmap display! */ if ( ioctl(1,WIOCGETD, &uw) != 0 ) { fprintf(2,"You must run the fatbit artist on a bitmap display\n"); exit(1); } /* Dump stdin, stdout, stderr, open a new window, dup to all three. */ close(0); close(1); close(2); wn = open("/dev/window",2); dup(wn); /* dup to 1 */ dup(wn); /* dup to 2 */ winit(); keypad(0,1); wn = wcreate(1,0,20,54,BORDCANCEL); wp = wcreate(14,58,7,18,BORDCANCEL); wselect(wn); wputs(wp,"[=1C"); wputs(wn,"[=1C"); wlabel(wn,"Experimental Fatbit Artist"); wuser(wn,"Fatbit Artist"); wprompt(wn,"Choose an action from among the function keys ....."); wuser(wp,"Fatbit Image"); wlabel(wp,"Real Image"); wprompt(wp,"THIS IS THE ACTUAL IMAGE "); um.um_flags = MSDOWN; um.um_x = 0; um.um_y = 0; um.um_w = 1; um.um_h = 1; wsetmouse (wn, &um); wslk(wn,0," 48x40 MAKE CLEAR 160x80 " ," GRID C-CODE GRID GRID ",0); return(wn); } 0707070000020006341006440001460001440000010047760351467604700000500000000105NameFATBIT - Picture creation programming tool - 07/85 - from THE STORE! 0707070000020007031007770001460001440000010051120351467757300001100000000043MAKEcpiocat Files | cpio -ocBv > FATBIT+IN 0707070000020006431007550001460001440000010004420351467645200001100000000044MAKEflopcat Files | cpio -ocBv > /dev/fp021 0707070000020006471007550001460001440000010050040351466774700000700000022574testitR396 ( .text( .data @.bss .lib /< N1X OQ./HJf/H#0Nsetpgrp1Dsetuid1Jsetgid1Pshmctl1Vshmget1\shmat1bshmdt1hsignal1nstat1tstty1zfstat1stime1swrite1sync1syslocal1time1times1ulimit1umask1umount1uname1unlink1ustat1utime1wait1write1abort1abs1atof1clock1crypt1setkey1encrypt1ctermid1 ctime1localtim1gmtime1asctime1"tzset1(cuserid1.ecvt14fcvt1:gcvt1@fclose1Ffflush1Lfopen1Rfreopen1Xfdopen1^fread1dfwrite1jfrexp1pldexp1vmodf1|fseek1rewind1ftell1ftw1fgetc1getw1getcwd1getenv1getgrent1getgrgid1getgrnam1setgrent1endgrent1getlogin1getopt1getpass1getpw1getpwent1getpwuid1getpwnam1setpwent1endpwent1gets1getchar1 fgets1getutent1getutid1getutlin1$pututlin1*setutent10endutent16utmpname1<malloc1Bfree1Hrealloc1Ncalloc1Tcfree1Zmemccpy1`memchr1fmemcmp1lmemcpy1rmemset1xmktemp1~monitor1perror1popen1pclose1printf1fprintf1sprintf1fputc1putw1putpwent1puts1putchar1fputs1scanf1fscanf1sscanf1setbuf1sleep1ssignal1gsignal1strcat1strncat1strcmp1strncmp1strcpy1strncpy1strlen1 strchr1&strrchr1,strpbrk12strspn18strcspn1>strtok1Dstrtol1Jatol1Patoi1Vswab1\system1btmpfile1htmpnam1ntempnam1tttyname1zisatty1ttyslot1ungetc1_filbuf1_flsbuf1lmul__1lmul1ldiv__1ldiv1lrem__1lrem1aldiv1almul1alrem1ulmul1uldiv__1uldiv1ulrem__1ulrem1qsort1l3tol1ltol31tgetflag1tgetent1 tgetstr1tgetnum1tgoto1tputs1"form1(menu1.message14setattr1:pb_open1@adf_gtxc1Fadf_gtwr1Lpb_gets1Rpb_check1Xpb_weof1^pb_seek1dpb_puts1jpb_name1ppb_empty1vpb_gbuf1|adf_gtto1wrefresh1track1wcreate1initscr1cbreak1attroff1nl1attron1flushinp1noecho1inch1getch1savetty1resetty1echo1nocbreak1nonl1wdelete1wprexec1wpostwai1wgetc1kcodemap1keypad1 wsigintr1wind1wsigcatc1winit1$wsetbuf1*iswind10wexit16endwin1<wgetpos1Bwgoto1Hwinstr1Nwreadmou1Twsetmous1Zwgetmous1`wnl1fwndelay1lwprompt1rwguser1xwcmd1~wslk1wlabel1wuser1wprintf1printw1wputc1wputs1wrastop1wselect1wgetsel1wsetstat1wgetstat1setty1fixterm1physclr1resetter1setterm1getterm1baudrate1parselin1slkcol1setjmp1longjmp1afmulf1afdivf1afaddf1_cvfd1 _cvif1&fltused1,syment12fmul18fdiv1>fadd1Dfsub1J_cvdf1P_cvdi1V_cvid1\_cvfi1bafadd1hafsub1nafsubf1tafmul1zexhelp1tolower1wicon1wicoff1toupper1l64a1a64l1_bufsync1setuname1auldiv1eprintf1dbsub__1dbadd__1dbdiv__1dbmul__1ltodb__1dbtol__1dbtofl__1fltodb__1ltofl__1fltol__1ultodb__1ultofl__1aulmul1 afdiv1dbtst__1fltst__1plock1"dial1(callout1.undial14drand481:erand481@lrand481Fmrand481Lsrand481Rjrand481Xseed481^lcong481drand1jsrand1p_startmain<_end _etext(etext(_edata edata end 0707070000020006501006440001460001440000010050160351466775100001100000002123testit.c/* array ARRAY contains a picture 48 pixels wide and 19 pixels high. for wrastop calls use srcwidth = 6, width = 48, and height = 19. */ static unsigned short ARRAY[57] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0000, 0x0000, 0x1000, 0x0000, 0xfffc, 0x3fff, 0x0000, 0xfffc, 0x3fff, 0x0000, 0x1800, 0x1000, 0x0000, 0x1800, 0x0800, 0x0000, 0x1800, 0x0000, 0x0004, 0x1800, 0x0000, 0x0008, 0x9800, 0xfde7, 0x001f, 0x9800, 0x2024, 0x0008, 0x9800, 0x2024, 0x0004, 0x9800, 0x21e7, 0x0000, 0x9800, 0x2100, 0x0000, 0x9800, 0x2100, 0x0000, 0x9800, 0x210f, 0x0000, 0x0000, 0x0100, 0x0000, 0xfff8, 0x01ff, 0x0000, 0x0000, 0x0000, 0x0000 }; #include main() { int srcwidth,width,height,wn; int i; /* The following parameters depend on the size of ARRAY */ srcwidth=6; width=48; height=19; /* close(0);close(1);close(2); wn=open("/dev/window",2); dup(wn);dup(wn); */ winit(); wn=wcreate(10,10,12,50,0); for (i=0;i