billr@saab.CNA.TEK.COM (Bill Randle) (02/12/91)
Submitted-by: routley@tle.ENET.DEC.COM (Kevin Routley) Posting-number: Volume 12, Issue 34 Archive-name: larn/Patch3 Patch-To: larn: Volume 11, Issue 84-95 Environment: Unix, VMS, MS-DOS, termcap [Adds support for OS/2. -br] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: patches03 # Wrapped by billr@saab on Mon Feb 11 10:30:15 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patches03' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches03'\" else echo shar: Extracting \"'patches03'\" \(11296 characters\) sed "s/^X//" >'patches03' <<'END_OF_FILE' X*** patchlevel_orig.h Sun Feb 10 19:31:54 1991 X--- patchlevel.h Sun Feb 10 19:31:50 1991 X*************** X*** 1 **** X! #define PATCHLEVEL 2 X--- 1 ---- X! #define PATCHLEVEL 3 X*** PATCHLOG_orig Sun Feb 10 19:32:01 1991 X--- PATCHLOG Sun Feb 10 19:31:57 1991 X*************** X*** 1,3 **** X--- 1,10 ---- X+ Patch3 X+ ====== X+ X+ Courtesy of Scott Robins (scottr@scottr.dec.com). Modifications and new X+ files that allow Larn 12.2 to be compiled for OS/2 using Microsoft C. Some X+ of the changes may be applicable to MS-DOS Microsoft C as well. X+ X Patch2 X ====== X X*** header_orig.h Sun Feb 10 19:22:54 1991 X--- header.h Sun Feb 10 19:22:47 1991 X*************** X*** 508,515 **** X--- 508,520 ---- X # define KNOWHERE 0x2 X # define KNOWALL (HAVESEEN | KNOWHERE) X # ifdef DGK_MSDOS X+ #ifdef OS2LARN X+ #define PATHLEN 256 X+ # define DIRLEN 256 X+ #else X # define PATHLEN 80 X # define DIRLEN 64 X+ #endif X extern char larndir[]; X extern int raw_io, DECRainbow, keypad, ramlevels, cursorset; X extern unsigned char cursorstart, cursorend; X*** main_orig.c Sun Feb 10 19:23:22 1991 X--- main.c Sun Feb 10 19:23:08 1991 X*************** X*** 434,445 **** X else X viewflag=0; X X! if (hit3flag) flushall(); X hitflag=hit3flag=0; nomove=1; X bot_linex(); /* update bottom line */ X while (nomove) X { X! if (hit3flag) flushall(); X nomove=0; parse(); X } /* get commands and make moves */ X regen(); /* regenerate hp and spells */ X--- 434,455 ---- X else X viewflag=0; X X! if (hit3flag) X! #ifdef OS2LARN X! flushallkbd(); X! #else X! flushall(); X! #endif X hitflag=hit3flag=0; nomove=1; X bot_linex(); /* update bottom line */ X while (nomove) X { X! if (hit3flag) X! #ifdef OS2LARN X! flushallkbd(); X! #else X! flushall(); X! #endif X nomove=0; parse(); X } /* get commands and make moves */ X regen(); /* regenerate hp and spells */ X*** /dev/null Sun Feb 10 19:26:01 1991 X--- makefile.os2 Sun Feb 10 19:23:25 1991 X*************** X*** 0 **** X--- 1,128 ---- X+ # X+ # This is a makefile for OS/2 LARN V12.2 X+ # X+ # This is written for MSC V6.00; it assumes NMAKE. X+ # X+ # This could probably build a DOS larn also, if the definition X+ # of OS2LARN was removed from the cc command. X+ # X+ X+ OBJ = obj\ X+ CDEFS = -DOS2LARN -DDGK -DMSDOS -DSYSV -DDGK_MSDOS -DNOVARARGS X+ cc = cl $(CDEFS) -nologo -Zi -c -AL -Fo$(OBJ) X+ X+ OBJS = $(OBJ)action.obj $(OBJ)bill.obj \ X+ $(OBJ)config.obj $(OBJ)create.obj \ X+ $(OBJ)data.obj $(OBJ)diag.obj \ X+ $(OBJ)display.obj $(OBJ)fgetlr.obj \ X+ $(OBJ)fortune.obj $(OBJ)global.obj \ X+ $(OBJ)help.obj $(OBJ)io.obj \ X+ $(OBJ)main.obj $(OBJ)monster.obj \ X+ $(OBJ)moreobj.obj $(OBJ)movem.obj \ X+ $(OBJ)msdos.obj $(OBJ)nap.obj \ X+ $(OBJ)object.obj $(OBJ)regen.obj \ X+ $(OBJ)savelev.obj $(OBJ)scores.obj \ X+ $(OBJ)signal.obj $(OBJ)spells.obj \ X+ $(OBJ)spheres.obj $(OBJ)store.obj \ X+ $(OBJ)tgetent.obj $(OBJ)tgetstr.obj \ X+ $(OBJ)tgoto.obj $(OBJ)tputs.obj \ X+ $(OBJ)tok.obj $(OBJ)vms.obj X+ X+ larn.exe : $(OBJS) X+ link /CODEVIEW @os2larn.lnk X+ X+ $(OBJ)action.obj : action.c X+ $(cc) action.c X+ X+ $(OBJ)bill.obj : bill.c X+ $(cc) bill.c X+ X+ $(OBJ)config.obj : config.c X+ $(cc) config.c X+ X+ $(OBJ)create.obj : create.c X+ $(cc) create.c X+ X+ $(OBJ)data.obj : data.c X+ $(cc) data.c X+ X+ $(OBJ)diag.obj : diag.c X+ $(cc) diag.c X+ X+ $(OBJ)display.obj : display.c X+ $(cc) display.c X+ X+ $(OBJ)fgetlr.obj : fgetlr.c X+ $(cc) fgetlr.c X+ X+ $(OBJ)fortune.obj : fortune.c X+ $(cc) fortune.c X+ X+ $(OBJ)global.obj : global.c X+ $(cc) global.c X+ X+ $(OBJ)help.obj : help.c X+ $(cc) help.c X+ X+ $(OBJ)io.obj : io.c X+ $(cc) io.c X+ X+ $(OBJ)main.obj : main.c X+ $(cc) main.c X+ X+ $(OBJ)monster.obj : monster.c X+ $(cc) monster.c X+ X+ $(OBJ)moreobj.obj : moreobj.c X+ $(cc) moreobj.c X+ X+ $(OBJ)movem.obj : movem.c X+ $(cc) movem.c X+ X+ $(OBJ)msdos.obj : msdos.c X+ $(cc) msdos.c X+ X+ $(OBJ)nap.obj : nap.c X+ $(cc) nap.c X+ X+ $(OBJ)object.obj : object.c X+ $(cc) object.c X+ X+ $(OBJ)regen.obj : regen.c X+ $(cc) regen.c X+ X+ $(OBJ)savelev.obj : savelev.c X+ $(cc) savelev.c X+ X+ $(OBJ)scores.obj : scores.c X+ $(cc) scores.c X+ X+ $(OBJ)signal.obj : signal.c X+ $(cc) signal.c X+ X+ $(OBJ)spells.obj : spells.c X+ $(cc) spells.c X+ X+ $(OBJ)spheres.obj : spheres.c X+ $(cc) spheres.c X+ X+ $(OBJ)store.obj : store.c X+ $(cc) store.c X+ X+ $(OBJ)tgetent.obj : tgetent.c X+ $(cc) tgetent.c X+ X+ $(OBJ)tgetstr.obj : tgetstr.c X+ $(cc) tgetstr.c X+ X+ $(OBJ)tgoto.obj : tgoto.c X+ $(cc) tgoto.c X+ X+ $(OBJ)tputs.obj : tputs.c X+ $(cc) tputs.c X+ X+ $(OBJ)tok.obj : tok.c X+ $(cc) tok.c X+ X+ $(OBJ)vms.obj : vms.c X+ $(cc) vms.c X*** monster_orig.c Sun Feb 10 19:23:41 1991 X--- monster.c Sun Feb 10 19:23:33 1991 X*************** X*** 345,357 **** X--- 345,365 ---- X tmp = 0; X if (monster[mster].attack>0) X if (((dam + bias + 8) > c[AC]) || (rnd((int)((c[AC]>0)?c[AC]:1))==1)) X+ #ifdef OS2LARN X+ { if (spattack(monster[mster].attack,x,y)) { flushallkbd(); return; } X+ #else X { if (spattack(monster[mster].attack,x,y)) { flushall(); return; } X+ #endif X tmp = 1; bias -= 2; cursors(); } X if (((dam + bias) > c[AC]) || (rnd((int)((c[AC]>0)?c[AC]:1))==1)) X { X lprintf("\n The %s hit you ",lastmonst); tmp = 1; X if ((dam -= c[AC]) < 0) dam=0; X+ #ifdef OS2LARN X+ if (dam > 0) { losehp(dam); bottomhp(); flushallkbd(); } X+ #else X if (dam > 0) { losehp(dam); bottomhp(); flushall(); } X+ #endif X } X if (tmp == 0) lprintf("\n The %s missed ",lastmonst); X } X*** msdos_orig.c Sun Feb 10 19:23:52 1991 X--- msdos.c Sun Feb 10 19:23:46 1991 X*************** X*** 1,4 **** X--- 1,8 ---- X # ifdef MSDOS X+ #ifdef OS2LARN X+ #define INCL_BASE X+ #include <os2.h> X+ #endif X # include <stdio.h> X # include <process.h> X # include <dos.h> X*************** X*** 45,56 **** X--- 49,73 ---- X X /* BIOSgetch gets keys directly with a BIOS call. X */ X+ #ifdef OS2LARN X+ # define SHIFT (RIGHTSHIFT | LEFTSHIFT) X+ #else X # define SHIFT (0x1 | 0x2) X+ #endif X # define KEYBRD_BIOS 0x16 X X static char X BIOSgetch() { X unsigned char scan, shift, ch; X+ X+ #ifdef OS2LARN X+ KBDKEYINFO kbd; X+ X+ KbdCharIn(&kbd,IO_WAIT,(HKBD) 0); X+ ch = kbd.chChar; X+ scan = kbd.chScan; X+ shift = kbd.fsState; X+ #else X union REGS regs; X X /* Get scan code. X*************** X*** 66,71 **** X--- 83,89 ---- X int86(KEYBRD_BIOS, ®s, ®s); X shift = regs.h.al; X X+ #endif X /* If scan code is for the keypad, translate it. X */ X if (iskeypad(scan)) { X*************** X*** 109,114 **** X--- 127,135 ---- X ioctl(handle, mode, setvalue) X unsigned setvalue; X { X+ #ifdef OS2LARN X+ /* not sure if any of this is usefull */ X+ #else X union REGS regs; X X regs.h.ah = IOCTL; X*************** X*** 118,123 **** X--- 139,145 ---- X regs.h.dh = 0; /* Zero out dh */ X intdos(®s, ®s); X return (regs.x.dx); X+ #endif X } X X int rawio; X*************** X*** 400,405 **** X--- 422,465 ---- X # define BIOSVIDEO 0x10 X setcursor() X { X+ #ifdef OS2LARN X+ USHORT rc; X+ VIOCURSORINFO curinfo; X+ X+ /* X+ I have no idea what this is for... X+ however, the DOS version (TurboC) has it, so I do too. X+ */ X+ if (cursorset == 0) X+ return; X+ X+ /* Save the cursor type in 'ocursorstart' and 'ocursorend'. */ X+ X+ rc = VioGetCurType((PVIOCURSORINFO) &curinfo, (HVIO) NULL); X+ if (rc != 0) X+ { X+ /* errors don't happen. */ X+ } X+ X+ ocursorstart = curinfo.yStart; X+ ocursorend = curinfo.cEnd; X+ X+ /* X+ set the cursor type according to global variables X+ 'cursorstart' and 'cursorend'. X+ */ X+ curinfo.cEnd = cursorend; X+ curinfo.yStart = cursorstart; X+ curinfo.cx = 0; /* default width, 1 char */ X+ curinfo.attr = 0; /* 'Normal' attribute */ X+ X+ rc = VioSetCurType((PVIOCURSORINFO) &curinfo, (HVIO) NULL); X+ if (rc != 0) X+ { X+ /* errors don't happen. */ X+ } X+ X+ #else X union REGS regs; X X if (cursorset == 0) X*************** X*** 416,421 **** X--- 476,482 ---- X regs.h.ch = cursorstart; X regs.h.cl = cursorend; X int86(BIOSVIDEO, ®s, ®s); X+ #endif X } X X /* Restore the old cursor upon exit X*************** X*** 422,427 **** X--- 483,501 ---- X */ X resetcursor() X { X+ #ifdef OS2LARN X+ VIOCURSORINFO curinfo; X+ X+ if (cursorset == 0) X+ return; X+ X+ curinfo.cEnd = ocursorend; X+ curinfo.yStart = ocursorstart; X+ curinfo.cx = 0; /* default width, 1 char */ X+ curinfo.attr = 0; /* 'Normal' attribute */ X+ X+ VioSetCurType((PVIOCURSORINFO) &curinfo, (HVIO) NULL); X+ #else X union REGS regs; X X if (cursorset == 0) X*************** X*** 431,435 **** X--- 505,510 ---- X regs.h.ch = ocursorstart; X regs.h.cl = ocursorend; X int86(BIOSVIDEO, ®s, ®s); X+ #endif X } X # endif /* MSDOS */ X*** nap_orig.c Sun Feb 10 19:24:00 1991 X--- nap.c Sun Feb 10 19:23:56 1991 X*************** X*** 8,13 **** X--- 8,17 ---- X #include <sys/types.h> X #ifdef SYSV X # ifdef MSDOS X+ #ifdef OS2LARN X+ #define INCL_BASE X+ #include <os2.h> X+ #endif X # include <dos.h> X # else X # include <sys/times.h> X*************** X*** 44,49 **** X--- 48,62 ---- X unsigned long X dosgetms() X { X+ #ifdef OS2LARN X+ DATETIME dt; X+ DosGetDateTime(&dt); X+ X+ /* return hundreths of seconds */ X+ return ( 360000L * dt.hours + X+ 6000L * dt.minutes + X+ 100L * dt.seconds + dt.hundredths ); X+ #else X union REGS regs; X X regs.h.ah = 0x2C; X*************** X*** 54,59 **** X--- 67,73 ---- X return ( 360000L * regs.h.ch + X 6000L * regs.h.cl + X 100L * regs.h.dh + regs.h.dl ); X+ #endif X } X X napms(time) X*** /dev/null Sun Feb 10 19:25:39 1991 X--- os2larn.def Sun Feb 10 19:24:03 1991 X*************** X*** 0 **** X--- 1,3 ---- X+ NAME LARN WINDOWCOMPAT LONGNAMES X+ X+ DESCRIPTION 'LARN for OS/2 V 12.2 MSC 6.00' X*** /dev/null Sun Feb 10 19:25:49 1991 X--- os2larn.lnk Sun Feb 10 19:24:07 1991 X*************** X*** 0 **** X--- 1,35 ---- X+ obj\action.obj+ X+ obj\bill.obj+ X+ obj\config.obj+ X+ obj\create.obj+ X+ obj\data.obj+ X+ obj\diag.obj+ X+ obj\display.obj+ X+ obj\fgetlr.obj+ X+ obj\fortune.obj+ X+ obj\global.obj+ X+ obj\help.obj+ X+ obj\io.obj+ X+ obj\main.obj+ X+ obj\monster.obj+ X+ obj\moreobj.obj+ X+ obj\movem.obj+ X+ obj\msdos.obj+ X+ obj\nap.obj+ X+ obj\object.obj+ X+ obj\regen.obj+ X+ obj\savelev.obj+ X+ obj\scores.obj+ X+ obj\signal.obj+ X+ obj\spells.obj+ X+ obj\spheres.obj+ X+ obj\store.obj+ X+ obj\tgetent.obj+ X+ obj\tgetstr.obj+ X+ obj\tgoto.obj+ X+ obj\tputs.obj+ X+ obj\tok.obj+ X+ obj\vms.obj X+ larn122.exe X+ larn122.map/map /line,, X+ os2larn.def X*** tok_orig.c Sun Feb 10 19:24:17 1991 X--- tok.c Sun Feb 10 19:24:12 1991 X*************** X*** 66,72 **** X--- 66,76 ---- X lprcat("\nDone\n"); X showplayer(); X lflush(); X+ # ifdef OS2LARN X+ flushallkbd(); /* Kill any stored key strokes */ X+ # else X flushall(); /* Kill any stored key strokes */ X+ # endif X #else X #ifdef VMS X savegame(ckpfile); X*************** X*** 160,166 **** X--- 164,174 ---- X /* X * flushall() Function to flush all type-ahead in the input buffer X */ X+ #ifdef OS2LARN X+ flushall() X+ #else X flushall() X+ #endif X { X # ifdef MSDOS X while (kbhit()) X X END_OF_FILE if test 11296 -ne `wc -c <'patches03'`; then echo shar: \"'patches03'\" unpacked with wrong size! fi # end of 'patches03' fi echo shar: End of shell archive. exit 0