home *** CD-ROM | disk | FTP | other *** search
- Here are the diffs to the mgr/src subdirectory. I haven't provided Makefile
- diffs, because I ended up makeing a lot of strange changes ("Makefile" and my
- "make" didn't seem to be compatible, so I just hacked out everything that
- didn't work right and did it by hand). The only substantial difference was
- that I used BLITDIR=atari instead of BLITDIR=port.
-
- *** src/orig/copyright.c Sun Aug 5 13:56:54 1990
- --- src/copyright.c Thu Sep 27 20:38:18 1990
- ***************
- *** 16,21 ****
- --- 16,24 ----
- #include <sys/signal.h>
- #include "bitmap.h"
- #include "copyright.h"
- + #ifdef atarist
- + extern void _do_fly();
- + #endif
-
- #define SSIZE 3 /* star size */
-
- ***************
- *** 43,48 ****
- --- 46,52 ----
- BITMAP *notice = &cr;
- int x = (BIT_WIDE(where)-BIT_WIDE(notice))/2;
- int y = BIT_HIGH(where)/2;
- +
- int high = BIT_HIGH(logo[0]);
- int wide = BIT_WIDE(logo[0]);
- int mask = 1; /* select mask (1 == kbd) */
- ***************
- *** 50,55 ****
- --- 54,65 ----
- register int i;
- char c;
-
- + #ifdef atarist
- + /* make sure as much as possible fits on the screen */
- + if (y < high + BIT_HIGH(notice)) {
- + y = BIT_HIGH(where) - BIT_HIGH(notice);
- + }
- + #endif
- c1.x1 = x - SSIZE;
- c1.y1 = y - SSIZE;
- c1.x2 = BIT_WIDE(notice) + x;
- ***************
- *** 71,79 ****
-
- /* kick off stars */
-
- if ((pid=fork()) == 0) /* child */
- fly(where,c1,c2);
- ! else {
- for(i=0;select(32,&mask,0,0,&delay) <= 0;i++,mask=1)
- bit_blit(where,x,y,wide,high,
- BIT_SRC|GETCOLOR(BG_COLOR),
- --- 81,93 ----
-
- /* kick off stars */
-
- + #ifdef atarist
- + pid = tfork(_do_fly, where);
- + #else
- if ((pid=fork()) == 0) /* child */
- fly(where,c1,c2);
- ! else {
- ! #endif
- for(i=0;select(32,&mask,0,0,&delay) <= 0;i++,mask=1)
- bit_blit(where,x,y,wide,high,
- BIT_SRC|GETCOLOR(BG_COLOR),
- ***************
- *** 81,92 ****
- --- 95,157 ----
- read(0,&c,1);
- kill(pid,SIGTERM);
- while(wait(0)!=pid);
- + #ifndef atarist
- }
- + #endif
- }
-
- /* star trek effect */
-
- + #ifdef atarist
- + /*
- + * routines to fork off a thread to do the star flying
- + */
- +
- + #include <osbind.h>
- + #include <basepage.h>
- +
- + #define STKSIZE 8192L
- +
- + void
- + _start_thread(b)
- + BASEPAGE *b;
- + {
- + void (*func)();
- + long arg;
- +
- + func = (void (*)())b->p_dbase;
- + arg = b->p_dlen;
- + func(arg);
- + Pterm0();
- + }
- +
- + int
- + tfork(func, arg)
- + void (*func)();
- + long arg;
- + {
- + BASEPAGE *b;
- + int pid;
- +
- + b = (BASEPAGE *)Pexec(PE_CBASEPAGE, 0L, "", 0L);
- + Mshrink(b, STKSIZE);
- + b->p_tbase = (char *)_start_thread;
- + b->p_dbase = (char *)func;
- + b->p_dlen = arg;
- + pid = Pexec(104, 0L, b, 0L);
- + return pid;
- + }
- +
- + void
- + _do_fly(where)
- + BITMAP *where;
- + {
- + fly(where, c1, c2);
- + }
-
- + #undef Random
- + #endif /* atarist */
- +
- /*
- * porter.c Steve Hawley 4/3/87
- * rehacked 5/18/1988 for extra speed.
- ***************
- *** 131,137 ****
- stp->y = Random();
- stp->z = (Random() % MAXZ) + 1;
- stp->color = Random() % 23;
- ! if (stp->color == BG_COLOR)
- stp->color++;
-
- } while(project(where,stp->x, stp->y, stp->z, stp->color, ON,clip1,clip2)); /* on screen? */
- --- 196,202 ----
- stp->y = Random();
- stp->z = (Random() % MAXZ) + 1;
- stp->color = Random() % 23;
- ! if (stp->color == BG_COLOR)
- stp->color++;
-
- } while(project(where,stp->x, stp->y, stp->z, stp->color, ON,clip1,clip2)); /* on screen? */
- ***************
- *** 146,154 ****
- stp->y = Random();
- stp->z = MAXZ;
- }
- ! else { /* rotate universe */
- ! cordic(&stp->x,&stp->y,SCALE,COUNT);
- ! }
- if (project(where,stp->x, stp->y, stp->z, stp->color, ON,clip1,clip2)) {
- /* if projection is off screen, get a new position */
- stp->x = Random();
- --- 211,219 ----
- stp->y = Random();
- stp->z = MAXZ;
- }
- ! else { /* rotate universe */
- ! cordic(&stp->x,&stp->y,SCALE,COUNT);
- ! }
- if (project(where,stp->x, stp->y, stp->z, stp->color, ON,clip1,clip2)) {
- /* if projection is off screen, get a new position */
- stp->x = Random();
- ***************
- *** 243,245 ****
- --- 308,311 ----
- *x = tempx;
- *y = tempy;
- }
- +
- *** src/orig/cut.c Mon Sep 10 12:07:10 1990
- --- src/cut.c Mon Sep 10 23:28:38 1990
- ***************
- *** 190,197 ****
- --- 190,202 ----
- break;
- }
- *pntr = '\0';
- + #ifndef atarist
- + /* sigh -- these were allocated with fixed data, so freeing them causes
- + big problems on the atari
- + */
- bit_destroy(check);
- bit_destroy(glyph);
- + #endif
-
- /* put text into snarf buffer */
-
- *** src/orig/defines.h Sun Aug 5 13:55:44 1990
- --- src/defines.h Mon Sep 17 01:28:58 1990
- ***************
- *** 41,49 ****
- --- 41,56 ----
- #define SCREEN_DEV "/dev/bwtwo0" /* where to find the frame buffer */
- #endif
- #define MOUSE_DEV "/dev/mouse" /* where to find the mouse */
- +
- #define TERMNAME "mgr" /* name of termcap entry */
- +
- + #ifdef atarist
- + #define STARTFILE "mgr.rc"
- + #else
- #define STARTFILE ".mgrc" /* name of mgr startup file */
- #define HOST "win " /* name of host for utmp file */
- + #endif
- +
- #ifndef FONTDIR
- # define FONTDIR "/usr/mgr/font" /* where to find the fonts */
- #endif
- *** src/orig/defs.h Mon Apr 3 09:09:46 1989
- --- src/defs.h Mon Sep 10 12:23:10 1990
- ***************
- *** 23,31 ****
- #ifdef DEBUG
- extern char debug_level[];
- char *index();
- #define dprintf(x) \
- if (debug && index(debug_level,'x')) fprintf
- ! #endif
-
- /* macros -- for speed */
-
- --- 23,36 ----
- #ifdef DEBUG
- extern char debug_level[];
- char *index();
- + # ifdef __STDC__
- #define dprintf(x) \
- + if (debug && index(debug_level,(#x)[0])) fprintf
- + # else
- + #define dprintf(x) \
- if (debug && index(debug_level,'x')) fprintf
- ! # endif
- ! #endif /* DEBUG */
-
- /* macros -- for speed */
-
- *** src/orig/destroy.c Sun Aug 5 13:55:56 1990
- --- src/destroy.c Thu Sep 27 20:38:30 1990
- ***************
- *** 35,41 ****
- --- 35,45 ----
- register WINDOW *win;
- {
- int i;
- + #ifdef atarist
- + int status;
- + #else
- union wait status;
- + #endif
-
- if (win == (WINDOW *) 0)
- return(-1);
- ***************
- *** 63,68 ****
- --- 67,75 ----
- #ifdef DEBUG
- dprintf(d)(stderr,"%s: destroy main %s\r\n",W(tty),W(alt)?"ALT":"");
- #endif
- + #ifdef atarist
- + if (W(pid) > 1)
- + #endif
- killpg(W(pid),SIGHUP);
-
- if (geteuid() < 1) {
- ***************
- *** 87,97 ****
- --- 94,112 ----
- dprintf(d)(stderr,"waiting for ..."); fflush(stderr);
- #endif
- if (W(pid) > 1) {
- + #ifdef atarist
- + wait(&status);
- + if ( (status & 0177) == 0177 ) {
- + kill(W(pid), SIGCONT);
- + wait(&status);
- + }
- + #else
- i = wait3(&status,WNOHANG,0L);
- if (i == 0) { /* start it so it can die */
- kill(W(pid),SIGCONT);
- wait(&status);
- }
- + #endif
- }
- #ifdef DEBUG
- dprintf(d)(stderr," %d\r\n",i);
- *** src/orig/do_button.c Sun Aug 5 13:56:00 1990
- --- src/do_button.c Thu Sep 27 20:39:36 1990
- ***************
- *** 253,258 ****
- --- 253,261 ----
- /* fix pttys */
- if (geteuid() < 2)
- for(win=active;win != (WINDOW *) 0;win=W(next)) {
- + #ifdef atarist
- + if (W(pid) > 1)
- + #endif
- killpg(W(pid),SIGHUP);
- chmod(W(tty),0666);
- chown(W(tty),0,0);
- *** src/orig/down_load.c Sun Aug 5 13:56:04 1990
- --- src/down_load.c Tue Sep 11 16:57:06 1990
- ***************
- *** 172,177 ****
- --- 172,181 ----
-
- if (c == '/' || (c == '.' && W(snarf)[1]=='/'))
- strcpy(filename,W(snarf));
- + #ifdef atarist
- + else if (c == '\\' || (c && W(snarf)[1] == ':'))
- + strcpy(filename,W(snarf));
- + #endif
- else
- sprintf(filename,"%s/%s",icon_dir,W(snarf));
-
- ***************
- *** 239,246 ****
- --- 243,252 ----
- #ifdef DEBUG
- dprintf(y)(stderr,"saving bitmap %d x %d on %s (%d)\n",BIT_WIDE(b),BIT_HIGH(b),W(snarf),fileno(fp));
- #endif
- + #ifndef atarist
- if (exists<0) /* file just created */
- fchown(fileno(fp),getuid(),getgid());
- + #endif
- bitmapwrite( fp, b, get_bm_type() );
- fclose(fp);
- #ifdef DEBUG
- *** src/orig/get_menu.c Sun Sep 9 11:52:20 1990
- --- src/get_menu.c Sun Sep 23 20:37:26 1990
- ***************
- *** 64,70 ****
- --- 64,75 ----
- #define HIGH (font->head.high+2)
-
- extern BITMAP mouse_bull, mouse_bull2;
- + #ifdef atarist
- + static unsigned int save_bits[BLIP];
- + #else
- static unsigned short save_bits[BLIP];
- + #endif
- +
- static bit_static(track,BLIP,BLIP,save_bits,DEPTH);
-
- /* allocate space for and initialize menu */
- ***************
- *** 279,285 ****
- --- 284,294 ----
- done++;
- }
-
- + #ifdef atarist
- + x_position = BETWEEN(1, x_position, BIT_WIDE(inside) - 1);
- + #else
- x_position = BETWEEN(BLIP/2, x_position, BIT_WIDE(inside) - BLIP/2);
- + #endif
-
- TRACKON(inside,x_position,y_position); /* on */
-
- *** src/orig/getshell.c Sun Aug 5 13:56:14 1990
- --- src/getshell.c Thu Sep 27 20:40:08 1990
- ***************
- *** 19,28 ****
- #include "bitmap.h"
- #include "defs.h"
-
- #define SHELL "/bin/sh"
- -
- static char line[] = {"/dev/ptypX"};
- static int pty_index=5; /* better hit rate than 0 */
- extern char **environ;
-
- /* get a pty line */
- --- 19,36 ----
- #include "bitmap.h"
- #include "defs.h"
-
- + #ifdef atarist
- + #include <osbind.h>
- + #include <mintbind.h>
- + #define SHELL "init.prg"
- + static char line[] = {"Q:\\ttyp.XX"};
- + static int pty_index = 0;
- + #else
- #define SHELL "/bin/sh"
- static char line[] = {"/dev/ptypX"};
- static int pty_index=5; /* better hit rate than 0 */
- + #endif
- +
- extern char **environ;
-
- /* get a pty line */
- ***************
- *** 33,45 ****
- --- 41,60 ----
- register int i;
- int fd;
-
- + #ifndef atarist
- line[5] = 'p';
- + #endif
- +
- for(line[8]='p';line[8]<'r';line[8]+= 1)
- for (i=1;i<=16;i++) {
- line[9]="0123456789abcdef"[(pty_index+i)%16];
- + #ifdef atarist
- + if ((fd = Fcreate(line, FA_SYSTEM|FA_HIDDEN)) >= 0) {
- + #else
- if ((fd = open(line,2)) >= 0) {
- /* pty_index = (pty_index+i)%16; temp */
- line[5] = 't';
- + #endif
- return(fd);
- }
- }
- ***************
- *** 49,55 ****
- --- 64,74 ----
- int getatty()
- {
- int fd;
- +
- + #ifndef atarist
- line[5]='t';
- + #endif
- +
- fd=open(line,2);
- if (fd<0) {
- sleep(3);
- ***************
- *** 106,112 ****
- --- 125,133 ----
- if ((pid=fork()) > 0) {
- /* parent side of fork */
- char buff[2];
- + #ifndef atarist
- read(*file,buff,sizeof(buff)); /* wait for slave side to open */
- + #endif
- #ifdef DEBUG
- dprintf(s)(stderr,"EXEC done, slave side open\r\n ");
- #endif
- ***************
- *** 146,151 ****
- --- 167,173 ----
-
- for(i=0;i<tty_slots;i++) if (i != fd) close(i);
-
- + #ifndef atarist
- /* set the uid-0 stuff up */
-
- if (geteuid() < 1) {
- ***************
- *** 163,172 ****
- --- 185,202 ----
- close(fd);
- dup(i);
- dup(i);
- + #else
- + Fforce(-1, fd);
- + Fforce(0, fd);
- + Fforce(1, fd);
- + Fforce(2, fd);
- + Fclose(fd);
- + #endif
-
- setpgrp(group,group);
- ioctl(0,TIOCSPGRP,&group);
-
- + #ifndef atarist
- adjust_mode(NTTYDISC,ECHO|CRMOD|EVENP|ODDP);
- restore_modes(0);
-
- ***************
- *** 176,181 ****
- --- 206,212 ----
- add_utmp(0,sprintf(who,"%s%c",HOST,line[9]));
- #endif
-
- + #endif /* atarist */
- /* start the command */
-
- #ifdef DEBUG
- ***************
- *** 185,191 ****
- --- 216,224 ----
- do_env("TERM=",TERMNAME);
- do_env("TERMCAP=","");
-
- + #ifndef atarist
- write(2,"\n",1); /* tell master that slave side is open */
- + #endif
- execve(name,argv,environ);
- _exit(1);
- }
- ***************
- *** 201,212 ****
- --- 234,258 ----
-
- if ((*file=getapty()) < 0)
- return((char *) 0);
- + #ifndef atarist
- ioctl(*file,TIOCREMOTE,0); /* I dunno */
- + #endif
- return(line);
- }
-
- /* get a complete path name from command */
-
- + #ifdef atarist
- + char *
- + get_path(name)
- + char *name;
- + {
- + char *getenv(), *findfile();
- + static char *extensions[] = { "ttp", "prg", "tos", 0 };
- +
- + return findfile(name, getenv("PATH"), extensions);
- + }
- + #else
- static char path[512];
- static char start[512];
-
- ***************
- *** 239,244 ****
- --- 285,291 ----
- return((char *) 0);
- }
- }
- + #endif /* atarist */
-
- /* change an environment variable */
-
- *** src/orig/kbd.c Sun Aug 5 13:56:20 1990
- --- src/kbd.c Thu Sep 27 20:40:32 1990
- ***************
- *** 12,17 ****
- --- 12,21 ----
-
- #include <stdio.h>
- #include <sys/signal.h>
- + #ifdef atarist
- + #include <osbind.h>
- + #endif
- +
- #include "bitmap.h"
- #include "defs.h"
- #ifdef sun
- ***************
- *** 65,70 ****
- --- 69,77 ----
-
- write( 2, "\007", 1 );
- */
- + #ifdef atarist
- + Bconout(2, 7);
- + #endif
- }
-
- #ifdef BELL
- *** src/orig/mgr.c Tue Apr 24 09:28:06 1990
- --- src/mgr.c Thu Sep 27 20:36:50 1990
- ***************
- *** 14,20 ****
- --- 14,30 ----
-
- #include "bitmap.h"
- #include <stdio.h>
- + #ifdef atarist
- + #include <osbind.h>
- + #include <signal.h>
- + #include <time.h>
- +
- + long _stksize = 32*1024L;
- + extern int __mint;
- + #else
- #include <sys/signal.h>
- + #endif
- +
- #ifdef sun
- #include <sys/time.h>
- #endif
- ***************
- *** 29,35 ****
- #endif
- #define POLL(poll) (poll&mask ? &set_poll : (struct timeval *) 0)
-
- ! #ifdef sun
- struct timeval set_poll = {
- (long) 0, (long) POLL_INT
- }; /* set select to poll */
- --- 39,45 ----
- #endif
- #define POLL(poll) (poll&mask ? &set_poll : (struct timeval *) 0)
-
- ! #if defined(sun) || defined(atarist)
- struct timeval set_poll = {
- (long) 0, (long) POLL_INT
- }; /* set select to poll */
- ***************
- *** 56,72 ****
- char *screen_dev = SCREEN_DEV; /* name of frame buffer */
- char *default_font = (char * )0; /* default font */
- char *rindex(), *getenv(), *ttyname();
- char *term = getenv("TERM"); /* place to put terminal name */
- #ifdef SHRINK
- BITMAP *prime;
- #endif
-
- SETMOUSEICON(&mouse_arrow);
- ! timestamp(); /* initialize the timestamp */
-
- /* process arguments */
-
- sprintf(start_file,"%s/%s",getenv("HOME"),STARTFILE);
- while(--argc > 0) {
- argv++;
- #ifdef DEBUG
- --- 66,105 ----
- char *screen_dev = SCREEN_DEV; /* name of frame buffer */
- char *default_font = (char * )0; /* default font */
- char *rindex(), *getenv(), *ttyname();
- + #ifdef atarist
- + char *term;
- + #else
- char *term = getenv("TERM"); /* place to put terminal name */
- + #endif
- #ifdef SHRINK
- BITMAP *prime;
- #endif
-
- + #ifdef atarist
- + _binmode(1);
- + if (__mint < 6) {
- + fprintf(stderr, "MGR requires MiNT version 0.6 or higher\n");
- + exit(2);
- + }
- + printf("\033E\033f"); /* clear screen, turn off cursor */
- + fflush(stdout);
- + #endif
- +
- SETMOUSEICON(&mouse_arrow);
- ! timestamp(); /* initialize the timestamp */
-
- /* process arguments */
-
- + #ifdef atarist
- + term = getenv("MGRFONT"); if (term) font_dir = term;
- + term = getenv("MGRICON"); if (term) icon_dir = term;
- + term = getenv("HOME"); if (!term) term = "";
- + sprintf(start_file, "%s/%s", term, STARTFILE);
- + term = getenv("TERM");
- + #else
- sprintf(start_file,"%s/%s",getenv("HOME"),STARTFILE);
- + #endif
- +
- while(--argc > 0) {
- argv++;
- #ifdef DEBUG
- ***************
- *** 157,162 ****
- --- 190,196 ----
- /* free all unused fd's */
-
- count = getdtablesize();
- +
- for(i=3;i<count;i++)
- close(i);
-
- ***************
- *** 227,233 ****
- --- 261,271 ----
- break;
- case SIGILL: /* <= 3.0 abort gererates this one */
- case SIGCONT:
- + #ifdef atarist
- + case SIGABRT:
- + #else
- case SIGIOT: /* 3.2 abort generates this (gee thanks, SUN!) */
- + #endif
- case SIGQUIT:
- break;
- case SIGTTIN:
- ***************
- *** 300,306 ****
- dprintf(l)(stderr,"select: mask=0x%x poll=0x%x 0x%x got\r\n",
- mask,poll,reads);
- #endif
- ! #ifdef sun
- if (select(32,&reads,0,0,POLL(poll)) <0) {
- #ifdef DEBUG
- dprintf(l)(stderr,"select failed %d->%d\r\n",
- --- 338,344 ----
- dprintf(l)(stderr,"select: mask=0x%x poll=0x%x 0x%x got\r\n",
- mask,poll,reads);
- #endif
- ! #if defined(sun) || defined(atarist)
- if (select(32,&reads,0,0,POLL(poll)) <0) {
- #ifdef DEBUG
- dprintf(l)(stderr,"select failed %d->%d\r\n",
- ***************
- *** 329,342 ****
- /* process keyboard input */
-
- if (reads&1 && active && !(ACTIVE(flags)&W_NOINPUT)) {
- read(0,&c,1);
- ! #ifdef BUCKEY
- if ( (ACTIVE(flags)&W_NOBUCKEY) || !do_buckey(c) )
- write(ACTIVE(to_fd),&c,1);
- ! #else
- write(ACTIVE(to_fd),&c,1);
- ! #endif
- ! if (ACTIVE(flags)&W_DUPKEY && c==ACTIVE(dup))
- write(ACTIVE(to_fd),&c,1);
- continue;
- }
- --- 367,390 ----
- /* process keyboard input */
-
- if (reads&1 && active && !(ACTIVE(flags)&W_NOINPUT)) {
- + #ifdef atarist
- + # ifdef BUCKEY
- + if ( kbd_getch(&c) || (ACTIVE(flags)&W_NOBUCKEY) || !do_buckey(c) )
- + write(ACTIVE(to_fd),&c,1);
- + # else
- + kbd_getch(&c);
- + write(ACTIVE(to_fd),&c,1);
- + # endif
- + #else
- read(0,&c,1);
- ! # ifdef BUCKEY
- if ( (ACTIVE(flags)&W_NOBUCKEY) || !do_buckey(c) )
- write(ACTIVE(to_fd),&c,1);
- ! # else
- write(ACTIVE(to_fd),&c,1);
- ! # endif
- ! #endif /* atarist */
- ! if (ACTIVE(flags)&W_DUPKEY && c==ACTIVE(dup))
- write(ACTIVE(to_fd),&c,1);
- continue;
- }
- ***************
- *** 498,503 ****
- --- 546,563 ----
- int
- timestamp()
- {
- + #ifdef atarist
- + static long offset = 0;
- +
- + if (offset == 0) {
- + offset = clock();
- + return 0;
- + }
- + else {
- + return (clock() - offset)/2; /* clock is 200 HZ */
- + }
- + }
- + #else
- static long offset = 0;
- struct timeval timeval;
-
- ***************
- *** 511,513 ****
- --- 571,646 ----
- return((timeval.tv_sec - offset) * 100 + timeval.tv_usec / 10000);
- }
- }
- + #endif /* atarist */
- +
- + #ifdef atarist
- + /* routine for reading the keyboard -- returns 1 if the key should be
- + passed directly to the application, 0 if it might be a buckey key
- + (i.e. if the ALT key was depressed)
- + */
- + #include <osbind.h>
- +
- + #define MAXSCAN 0x39
- +
- + /* table for normal (unshifted) keys */
- + char normtab[MAXSCAN + 1] = {
- + 0, '\033', '1', '2', '3', '4', '5', '6', /* 0 - 0x7 */
- + '7', '8', '9', '0', '-', '=', '\010', '\011', /* 0x8 - 0xf */
- + 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', /* 0x10 - 0x17 */
- + 'o', 'p', '[', ']', '\r', 0, 'a', 's', /* 0x18 - 0x1f */
- + 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 0x20 - 0x27 */
- + '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', /* 0x28 - 0x2f */
- + 'b', 'n', 'm', ',', '.', '/', 0, 0, /* 0x30 - 0x37 */
- + 0, ' ' }; /* 0x38 - 0x39 */
- +
- + /* table for shifted keys */
- + char shfttab[MAXSCAN + 1] = {
- + 0, '\033', '!', '@', '#', '$', '%', '^', /* 0 - 0x7 */
- + '&', '*', '(', ')', '_', '+', '\010', '\011', /* 0x8 - 0xf */
- + 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', /* 0x10 - 0x17 */
- + 'O', 'P', '{', '}', '\r', 0, 'A', 'S', /* 0x18 - 0x1f */
- + 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 0x20 - 0x27 */
- + '"', '~', 0, '|', 'Z', 'X', 'C', 'V', /* 0x28 - 0x2f */
- + 'B', 'N', 'M', '<', '>', '?', 0, 0, /* 0x30 - 0x37 */
- + 0, ' ' }; /* 0x38 - 0x39 */
- +
- +
- + #define _SHFT 0x3
- + #define _CTRL 0x4
- + #define _ALT 0x8
- +
- + int
- + kbd_getch(c)
- + char *c;
- + {
- + long r;
- + int scan, key, shft;
- +
- + r = Crawio(0xff);
- + key = r & 0xff;
- + shft = Kbshift(-1);
- + if (key == 0) {
- + scan = (r & 0x00ff0000) >> 16;
- + if (scan >= 0x78 && scan <= 0x83) {
- + /* compensate for TOS's silly ALT key remapping */
- + scan = scan - 0x76;
- + }
- + if ( (scan <= MAXSCAN) && (shft & _ALT) ) {
- + if (shft & _CTRL)
- + key = shfttab[scan] & 0x1f;
- + else if (shft & _SHFT)
- + key = shfttab[scan];
- + else
- + key = normtab[scan];
- + }
- + }
- + if (shft & _ALT) {
- + *c = key | 0x80;
- + return 0; /* might be buckey */
- + }
- + else {
- + *c = key;
- + return 1; /* not buckey */
- + }
- + }
- + #endif /* atarist */
- *** src/orig/set_mode.c Tue Apr 24 09:37:32 1990
- --- src/set_mode.c Sat Aug 11 22:24:24 1990
- ***************
- *** 28,36 ****
- --- 28,40 ----
- int set_mouseio(file)
- int file; /* file descriptor */
- {
- + #ifdef atarist
- + return 0;
- + #else
- set_mode(file,RAW,ECHO,B1200);
- fcntl(file,F_SETFL,fcntl(file,F_GETFL,0)|FNDELAY); /* for 4.1 */
- return(ioctl(file,TIOCEXCL,0));
- + #endif
- }
-
- /* reset input tty modes */
- ***************
- *** 69,77 ****
- --- 73,85 ----
- {
- int tty;
-
- + #ifdef atarist
- + close(-1);
- + #else
- tty = open("/dev/tty",2);
- ioctl(tty,TIOCNOTTY,0);
- close(tty);
- + #endif
- }
-
- /*********************************************************************/
- ***************
- *** 89,109 ****
- --- 97,121 ----
- save_modes(fd)
- int fd; /* fd to save tty modes from */
- {
- + #ifndef atarist
- ioctl(fd,TIOCGETD,&t_ldisc);
- ioctl(fd,TIOCGETP,&t_sgttyb);
- ioctl(fd,TIOCGETC,&t_tchars);
- ioctl(fd,TIOCGLTC,&t_ltchars);
- ioctl(fd,TIOCLGET,&t_lflags);
- + #endif
- }
-
- restore_modes(fd)
- int fd;
- {
- + #ifndef atarist
- ioctl(fd,TIOCSETD,&t_ldisc);
- ioctl(fd,TIOCSETP,&t_sgttyb);
- ioctl(fd,TIOCSETC,&t_tchars);
- ioctl(fd,TIOCSLTC,&t_ltchars);
- ioctl(fd,TIOCLSET,&t_lflags);
- + #endif
- }
-
- adjust_mode(disc,flags)
- ***************
- *** 110,115 ****
- --- 122,129 ----
- int flags; /* flags */
- int disc; /* line disc */
- {
- + #ifndef atarist
- t_ldisc=disc;
- t_sgttyb.sg_flags = flags;
- + #endif
- }
- *** src/orig/sigdata.c Sun Aug 5 13:56:36 1990
- --- src/sigdata.c Sat Aug 11 01:23:48 1990
- ***************
- *** 12,17 ****
- --- 12,18 ----
-
- #include <stdio.h>
-
- + #ifndef atarist
- /* signal names, descriptions (for debugging) */
-
- struct signame {
- ***************
- *** 62,64 ****
- --- 63,78 ----
- fflush(stderr);
- abort();
- }
- + #else /* atarist */
- + int
- + catch(sig)
- + int sig;
- + {
- + extern char *sys_siglist[];
- +
- + _quit();
- + fprintf(stderr, "got a %s\r\n", sys_siglist[sig]);
- + fflush(stderr);
- + abort();
- + }
- + #endif /* atarist */
- *** src/orig/subs.c Fri Jun 9 09:02:40 1989
- --- src/subs.c Thu Sep 27 20:41:08 1990
- ***************
- *** 446,456 ****
- --- 446,458 ----
- sleep(1); /* wait for CONT signal */
- signal(SIGTSTP, catch);
-
- + #ifndef atarist
- if (set_kbd(1) != 0) { /* reopen kbd (as 0) */
- _quit();
- fprintf(stderr,"Sorry, Can't reopen kbd\n");
- exit(1);
- }
- + #endif
- mouse = mouse_reopen();
- set_tty(0);
- bell_on(); /* this resets the keyboard! */
- ***************
- *** 654,659 ****
- --- 656,664 ----
- system(command)
- char *command;
- {
- + #ifdef atarist
- + char *shell;
- + #endif
- int status, pid, w;
- register int (*istat)(), (*qstat)();
-
- ***************
- *** 668,677 ****
- --- 673,691 ----
- setreuid(uid,uid);
- setregid(gid,gid);
-
- + #ifdef atarist
- + uid = open("V:\\NULL", 0);
- + dup2(uid, 0);
- + close(uid);
- + shell = getenv("SHELL");
- + if (!shell) shell = "ksh";
- + execlp(shell, shell, "-c", command, 0);
- + #else
- close(0);
- open("/dev/null",0);
-
- execl("/bin/sh", "sh", "-c", command, 0);
- + #endif
- _exit(127);
- }
- istat = signal(SIGINT, SIG_IGN);
- *** src/orig/utmp.c Sun Aug 5 13:56:42 1990
- --- src/utmp.c Sat Sep 8 01:42:48 1990
- ***************
- *** 12,17 ****
- --- 12,18 ----
-
- /* manage utmp file */
-
- + #ifndef atarist
- #include <pwd.h>
- #include <utmp.h>
- #include <sys/file.h>
- ***************
- *** 24,29 ****
- --- 25,31 ----
- static struct utmp entry, save_entry;
- static char zap[sizeof(entry)];
- static int save_slot;
- + #endif
-
- /* remove an entry from utmp file */
-
- ***************
- *** 78,83 ****
- --- 80,86 ----
- char *host;
- int flag;
- {
- + #ifndef atarist
- char *ttyname(), *rindex();
- long time();
- struct passwd *getpwuid();
- ***************
- *** 113,118 ****
- --- 116,122 ----
- return(tty);
- }
- return(-1);
- + #endif /* atarist */
- }
-
- /* remove utmp entry service routine */
- ***************
- *** 122,127 ****
- --- 126,132 ----
- char *line;
- int flag;
- {
- + #ifndef atarist
- int tty;
- int fd;
- FILE *file;
- ***************
- *** 160,163 ****
- --- 165,169 ----
- return(tty);
- }
- return(-1);
- + #endif /* atarist */
- }
- *** src/orig/Write.c Sun Aug 5 13:55:48 1990
- --- src/Write.c Tue Sep 11 05:03:12 1990
- ***************
- *** 20,25 ****
- --- 20,47 ----
-
- extern errno;
-
- + #ifdef atarist
- +
- + int
- + Write(fd,buff,len)
- + register int fd, len;
- + register char *buff;
- + {
- + register int count = 0;
- + register int r;
- +
- + while (count < len) {
- + r = write(fd, buff+count, len - count);
- + if (r < 0)
- + break;
- + else
- + count += r;
- + }
- + return count;
- + }
- +
- + #else
- +
- int
- Write(fd,buff,len)
- register int fd, len;
- ***************
- *** 44,46 ****
- --- 66,69 ----
- }
- return(count);
- }
- + #endif /* atarist */
- *** src/orig/write_ok.c Sun Aug 5 13:56:48 1990
- --- src/write_ok.c Tue Sep 18 19:35:40 1990
- ***************
- *** 68,75 ****
- --- 68,79 ----
- char *name; /* file to check mode for */
- int mask; /* these bits must be turned off */
- {
- + #ifdef atarist
- + return 1; /* security? we don't need no steenking security :-( */
- + #else
- struct stat buff;
- if (stat(name,&buff) < 0)
- return(0);
- return((buff.st_mode&mask) == 0);
- + #endif
- }
-