diff --git a/CMakeLists.txt b/CMakeLists.txt index b879331f..215664c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,13 +79,9 @@ SET(BAD_SRCS src/chatter.c src/codeconv.c src/codetbl.c - src/doscomm.c - src/doskbd.c - src/dosmouse.c src/ejlisp.c src/imagefile2.c src/imagefile.c - src/kbdif.c src/lpdual.c src/lpkit.c src/lplexyy.c @@ -102,8 +98,6 @@ SET(BAD_SRCS src/rawrs232c.c src/rs232c.c src/truecolor.c - src/vesainit.c - src/vgainit.c ) SET(MAIKO_SRCS @@ -175,7 +169,6 @@ SET(MAIKO_SRCS src/miscn.c src/mkatom.c src/mkcell.c - src/mouseif.c src/mvs.c src/osmsg.c src/perrno.c @@ -280,12 +273,10 @@ SET(MAIKO_HDRS inc/initsoutdefs.h inc/inlineC.h inc/inln68k.h - inc/inlndos.h inc/inlnPS2.h inc/inlnSPARC.h inc/intcalldefs.h inc/iopage.h - inc/kbdif.h inc/kbdsubrsdefs.h inc/keyboard.h inc/keyeventdefs.h @@ -297,7 +288,6 @@ SET(MAIKO_HDRS inc/lisp2cdefs.h inc/lispemul.h inc/lispmap.h - inc/lispver1.h inc/lispver2.h inc/llcolordefs.h inc/lldsp.h diff --git a/bin/makefile-dos b/bin/makefile-dos deleted file mode 100644 index 2924429c..00000000 --- a/bin/makefile-dos +++ /dev/null @@ -1,614 +0,0 @@ -AFLAGS = /T -ARCHFILES = dosmouse.obj doskbd.obj vesafns.obj vesainit.obj vgainit.obj kbdif.obj - - -ADMINFILES = makefile mkvdate.c - -LPFILES = lpmain.obj lpread.obj lpsolve.obj lpwrite.obj lpdual.obj lptran.obj - -CFLAGS = -DDOS -DKBINT -DNOPIXRECT \ - -DNOVERSION -DLPSOLVE -g - -LDFLAGS = -g graphics.lib binmode.lib mouse.lib - -RM = del - -SRCFILES = conspage.c gcoflow.c shift.c dbgtool.c gcr.c gcrcell.c llstk.c gcscan.c loopsops.c storage.c allocmds.c dir.c gvar2.c lowlev1.c subr.c arith2.c lowlev2.c subr0374.c arith3.c doscomm.c hardrtn.c lsthandl.c sxhash.c arith4.c draw.c main.c testtool.c array.c dsk.c inet.c misc7.c timer.c array2.c dspif.c initdsp.c miscn.c typeof.c array3.c initkbd.c ubf1.c array4.c dspsubrs.c initsout.c mkatom.c ubf2.c array5.c eqf.c intcall.c mkcell.c ubf3.c array6.c ether.c mkvdate.c ufn.c atom.c findkey.c kbdsubrs.c mouseif.c ufs.c bbtsub.c foreign.c keyevent.c unixcomm.c bin.c fp.c binds.c asmbbt.c fvar.c mvs.c unwind.c bitblt.c gc.c uraid.c blt.c gc2.c kprint.c osmsg.c usrsubr.c byteswap.c gcarray.c perrno.c ldeboot.c ldeether.c uutils.c carcdr.c gccode.c rawcolor.c vars3.c gcfinal.c ldsout.c return.c vmemsave.c chardev.c gchtfind.c lineblt8.c rpc.c xc.c common.c gcmain3.c lisp2c.c rplcons.c z2.c xmkicon.c xbbt.c xinit.c xscroll.c xcursor.c xlspwin.c xrdopt.c xwinman.c dosmouse.c vesafns.asm vesainit.c vgainit.c kbdif.c dspsparc.il copyright launch.asm lpread.c lpsolve.c lpmain.c lpwrite.c lpdual.c lptran.c - -OFILES = conspage.obj gcoflow.obj shift.obj dbgtool.obj gcr.obj gcrcell.obj llstk.obj gcscan.obj loopsops.obj storage.obj allocmds.obj dir.obj gvar2.obj lowlev1.obj subr.obj arith2.obj lowlev2.obj subr0374.obj arith3.obj doscomm.obj hardrtn.obj lsthandl.obj sxhash.obj arith4.obj draw.obj main.obj testtool.obj array.obj dsk.obj inet.obj misc7.obj timer.obj array2.obj dspif.obj initdsp.obj miscn.obj typeof.obj array3.obj initkbd.obj ubf1.obj array4.obj dspsubrs.obj initsout.obj mkatom.obj ubf2.obj array5.obj eqf.obj intcall.obj mkcell.obj ubf3.obj array6.obj ether.obj ufn.obj atom.obj findkey.obj kbdsubrs.obj mouseif.obj ufs.obj bbtsub.obj foreign.obj keyevent.obj unixcomm.obj bin.obj fp.obj binds.obj fvar.obj mvs.obj unwind.obj bitblt.obj gc.obj uraid.obj blt.obj gc2.obj kprint.obj osmsg.obj usrsubr.obj byteswap.obj gcarray.obj perrno.obj uutils.obj carcdr.obj asmbbt.obj gccode.obj vars3.obj gcfinal.obj ldsout.obj return.obj vmemsave.obj chardev.obj gchtfind.obj lineblt8.obj rpc.obj xc.obj common.obj gcmain3.obj lisp2c.obj rplcons.obj z2.obj vdate.obj $(COLORFILES) $(ARCHFILES) $(LPFILES) - - -HFILES = address.h adr68k.h arith.h cell.h dbprint.h display.h dspif.h ifpage.h iopage.h lispemul.h lispmap.h lsptypes.h miscstat.h lspglob.h array.h bb.h bitblt.h debug.h devconf.h dspdata.h ether.h fast_dsp.h gcdata.h hdw_conf.h initatms.h inlinec.h keyboard.h lispver1.h lispver2.h lldsp.h locfile.h medleyfp.h mouseif.h my.h opcodes.h osmsg.h pilotbbt.h print.h return.h stack.h stream.h subrs.h timeout.h tos1defs.h tosfns.h tosret.h vmemsave.h xdefs.h xbitmaps.h xkeymap.h - - - -bigvm: - CFLAGS = $(CFLAGS) - make -f foot emul.exe - -emul.exe : $(OFILES) - @ echo $** > linkopts - @ echo $(CFLAGS) > copts - $(RM) vdate.c - $(CC) @copts @linkopts $(LDFLAGS) /e$@ - del linkopts - del copts - @ echo "Executable is now named '$@'" - -main.o : lispemul.h address.h lsptypes.h adr68k.h stack.h lspglob.h lispmap.h ifpage.h iopage.h return.h debug.h - - - - -.SUFFIXES .exe .lib .c .obj .c .asm .s .c - -medley.exe: launch.obj - TLINK launch,medley - -launch.obj: launch.asm - - # xc.obj: xc.s - # tasm /ml xc.s - # - #xc.s: xc.c - # rsh sparky (cd /users/nilsson/curr ; gcc-make $* ) - -vdate.obj : mkvdate.exe - mkvdate > vdate.c - $(CC) vdate.c -c $@ - -mkvdate.exe : ../src/mkvdate.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/mkvdate.c - del copts - -xc.obj : ../src/xc.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/xc.c -I ../inc -c $@ - del copts - -lpmain.obj : ../src/lpmain.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lpmain.c -I ../inc -c $@ - del copts - -lpsolve.obj : ../src/lpsolve.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lpsolve.c -I ../inc -c $@ - del copts - -lpread.obj : ../src/lpread.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lpread.c -I ../inc -c $@ - del copts - -lptran.obj : ../src/lptran.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lptran.c -I ../inc -c $@ - del copts - -lpdual.obj : ../src/lpdual.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lpdual.c -I ../inc -c $@ - del copts - -lpwrite.obj : ../src/lpwrite.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lpwrite.c -I ../inc -c $@ - del copts - - - -conspage.obj : ../src/conspage.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/conspage.c -I ../inc -c $@ - del copts - -dosmouse.obj : ../src/dosmouse.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dosmouse.c -I ../inc -c $@ - del copts - -doskbd.obj : ../src/doskbd.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/doskbd.c -I ../inc -c $@ - del copts - -vesafns.obj : ../src/vesafns.asm - tasm /ml ..\src\vesafns.asm - -vesainit.obj : ../src/vesainit.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/vesainit.c -I ../inc -c $@ - del copts - -vgainit.obj : ../src/vgainit.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/vgainit.c -I ../inc -c $@ - del copts - -kbdif.obj : ../src/kbdif.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/kbdif.c -I ../inc -c $@ - del copts - -gcoflow.obj : ../src/gcoflow.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcoflow.c -I ../inc -c $@ - del copts - -shift.obj : ../src/shift.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/shift.c -I ../inc -c $@ - del copts - -dbgtool.obj : ../src/dbgtool.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dbgtool.c -I ../inc -c $@ - del copts - -gcr.obj : ../src/gcr.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcr.c -I ../inc -c $@ - del copts - -gcrcell.obj : ../src/gcrcell.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcrcell.c -I ../inc -c $@ - del copts - -llstk.obj : ../src/llstk.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/llstk.c -I ../inc -c $@ - del copts - -gcscan.obj : ../src/gcscan.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcscan.c -I ../inc -c $@ - del copts - -loopsops.obj : ../src/loopsops.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/loopsops.c -I ../inc -c $@ - del copts - -storage.obj : ../src/storage.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/storage.c -I ../inc -c $@ - del copts - -allocmds.obj : ../src/allocmds.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/allocmds.c -I ../inc -c $@ - del copts - -dir.obj : ../src/dir.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dir.c -I ../inc -c $@ - del copts - -gvar2.obj : ../src/gvar2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gvar2.c -I ../inc -c $@ - del copts - -lowlev1.obj : ../src/lowlev1.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lowlev1.c -I ../inc -c $@ - del copts - -subr.obj : ../src/subr.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/subr.c -I ../inc -c $@ - del copts - -arith2.obj : ../src/arith2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/arith2.c -I ../inc -c $@ - del copts - -lowlev2.obj : ../src/lowlev2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lowlev2.c -I ../inc -c $@ - del copts - -subr0374.obj : ../src/subr0374.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/subr0374.c -I ../inc -c $@ - del copts - -arith3.obj : ../src/arith3.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/arith3.c -I ../inc -c $@ - del copts - -doscomm.obj : ../src/doscomm.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/doscomm.c -I ../inc -c $@ - del copts - -hardrtn.obj : ../src/hardrtn.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/hardrtn.c -I ../inc -c $@ - del copts - -lsthandl.obj : ../src/lsthandl.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lsthandl.c -I ../inc -c $@ -Le - del copts - -sxhash.obj : ../src/sxhash.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/sxhash.c -I ../inc -c $@ - del copts - -arith4.obj : ../src/arith4.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/arith4.c -I ../inc -c $@ - del copts - -draw.obj : ../src/draw.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/draw.c -I ../inc -c $@ - del copts - -main.obj : ../src/main.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/main.c -I ../inc -c $@ - del copts - -testtool.obj : ../src/testtool.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/testtool.c -I ../inc -c $@ - del copts - -array.obj : ../src/array.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array.c -I ../inc -c $@ - del copts - -dsk.obj : ../src/dsk.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dsk.c -I ../inc -c $@ - del copts - -inet.obj : ../src/inet.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/inet.c -I ../inc -c $@ - del copts - -misc7.obj : ../src/misc7.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/misc7.c -I ../inc -c $@ - del copts - -timer.obj : ../src/timer.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/timer.c -I ../inc -c $@ - del copts - -array2.obj : ../src/array2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array2.c -I ../inc -c $@ - del copts - -dspif.obj : ../src/dspif.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dspif.c -I ../inc -c $@ - del copts - -initdsp.obj : ../src/initdsp.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/initdsp.c -I ../inc -c $@ - del copts - -miscn.obj : ../src/miscn.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/miscn.c -I ../inc -c $@ - del copts - -typeof.obj : ../src/typeof.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/typeof.c -I ../inc -c $@ - del copts - -array3.obj : ../src/array3.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array3.c -I ../inc -c $@ - del copts - -initkbd.obj : ../src/initkbd.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/initkbd.c -I ../inc -c $@ - del copts - -ubf1.obj : ../src/ubf1.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ubf1.c -I ../inc -c $@ - del copts - -array4.obj : ../src/array4.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array4.c -I ../inc -c $@ - del copts - -dspsubrs.obj : ../src/dspsubrs.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/dspsubrs.c -I ../inc -c $@ - del copts - -initsout.obj : ../src/initsout.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/initsout.c -I ../inc -c $@ - del copts - -mkatom.obj : ../src/mkatom.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/mkatom.c -I ../inc -c $@ - del copts - -ubf2.obj : ../src/ubf2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ubf2.c -I ../inc -c $@ - del copts - -array5.obj : ../src/array5.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array5.c -I ../inc -c $@ - del copts - -eqf.obj : ../src/eqf.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/eqf.c -I ../inc -c $@ - del copts - -intcall.obj : ../src/intcall.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/intcall.c -I ../inc -c $@ - del copts - -mkcell.obj : ../src/mkcell.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/mkcell.c -I ../inc -c $@ - del copts - -ubf3.obj : ../src/ubf3.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ubf3.c -I ../inc -c $@ - del copts - -array6.obj : ../src/array6.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/array6.c -I ../inc -c $@ - del copts - -ether.obj : ../src/ether.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ether.c -I ../inc -c $@ - del copts - -ufn.obj : ../src/ufn.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ufn.c -I ../inc -c $@ - del copts - -atom.obj : ../src/atom.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/atom.c -I ../inc -c $@ - del copts - -findkey.obj : ../src/findkey.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/findkey.c -I ../inc -c $@ - del copts - -kbdsubrs.obj : ../src/kbdsubrs.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/kbdsubrs.c -I ../inc -c $@ - del copts - -mouseif.obj : ../src/mouseif.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/mouseif.c -I ../inc -c $@ - del copts - -ufs.obj : ../src/ufs.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ufs.c -I ../inc -c $@ - del copts - -bbtsub.obj : ../src/bbtsub.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/bbtsub.c -I ../inc -c $@ - del copts - -foreign.obj : ../src/foreign.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/foreign.c -I ../inc -c $@ - del copts - -keyevent.obj : ../src/keyevent.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/keyevent.c -I ../inc -c $@ - del copts - -unixcomm.obj : ../src/unixcomm.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/unixcomm.c -I ../inc -c $@ - del copts - -bin.obj : ../src/bin.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/bin.c -I ../inc -c $@ - del copts - -fp.obj : ../src/fp.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/fp.c -I ../inc -c $@ - del copts - -binds.obj : ../src/binds.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/binds.c -I ../inc -c $@ - del copts - -fvar.obj : ../src/fvar.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/fvar.c -I ../inc -c $@ - del copts - -mvs.obj : ../src/mvs.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/mvs.c -I ../inc -c $@ - del copts - -unwind.obj : ../src/unwind.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/unwind.c -I ../inc -c $@ - del copts - -bitblt.obj : ../src/bitblt.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/bitblt.c -I ../inc -c $@ - del copts - -gc.obj : ../src/gc.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gc.c -I ../inc -c $@ - del copts - -uraid.obj : ../src/uraid.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/uraid.c -I ../inc -c $@ - del copts - -blt.obj : ../src/blt.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/blt.c -I ../inc -c $@ - del copts - -gc2.obj : ../src/gc2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gc2.c -I ../inc -c $@ - del copts - -kprint.obj : ../src/kprint.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/kprint.c -I ../inc -c $@ - del copts - -osmsg.obj : ../src/osmsg.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/osmsg.c -I ../inc -c $@ - del copts - -usrsubr.obj : ../src/usrsubr.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/usrsubr.c -I ../inc -c $@ - del copts - -byteswap.obj : ../src/byteswap.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/byteswap.c -I ../inc -c $@ - del copts - -gcarray.obj : ../src/gcarray.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcarray.c -I ../inc -c $@ - del copts - -perrno.obj : ../src/perrno.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/perrno.c -I ../inc -c $@ - del copts - -uutils.obj : ../src/uutils.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/uutils.c -I ../inc -c $@ - del copts - -carcdr.obj : ../src/carcdr.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/carcdr.c -I ../inc -c $@ - del copts - -asmbbt.obj : ../src/asmbbt.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/asmbbt.c -I ../inc -c $@ - del copts - -gccode.obj : ../src/gccode.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gccode.c -I ../inc -c $@ - del copts - -vars3.obj : ../src/vars3.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/vars3.c -I ../inc -c $@ - del copts - -gcfinal.obj : ../src/gcfinal.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcfinal.c -I ../inc -c $@ - del copts - -ldsout.obj : ../src/ldsout.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/ldsout.c -I ../inc -c $@ - del copts - -return.obj : ../src/return.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/return.c -I ../inc -c $@ - del copts - -vmemsave.obj : ../src/vmemsave.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/vmemsave.c -I ../inc -c $@ - del copts - -chardev.obj : ../src/chardev.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/chardev.c -I ../inc -c $@ - del copts - -gchtfind.obj : ../src/gchtfind.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gchtfind.c -I ../inc -c $@ - del copts - -lineblt8.obj : ../src/lineblt8.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lineblt8.c -I ../inc -c $@ - del copts - -rpc.obj : ../src/rpc.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/rpc.c -I ../inc -c $@ - del copts - -common.obj : ../src/common.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/common.c -I ../inc -c $@ - del copts - -gcmain3.obj : ../src/gcmain3.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/gcmain3.c -I ../inc -c $@ - del copts - -lisp2c.obj : ../src/lisp2c.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/lisp2c.c -I ../inc -c $@ - del copts - -rplcons.obj : ../src/rplcons.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/rplcons.c -I ../inc -c $@ - del copts - -z2.obj : ../src/z2.c - @ echo $(CFLAGS) > copts - $(CC) @copts ../src/z2.c -I ../inc -c $@ - del copts - diff --git a/bin/makefile-tail b/bin/makefile-tail index dcff93bb..0c82973f 100644 --- a/bin/makefile-tail +++ b/bin/makefile-tail @@ -485,14 +485,6 @@ $(OBJECTDIR)dspif.o: $(SRCDIR)dspif.c $(REQUIRED-INCS) \ $(INCDIR)devif.h $(INCDIR)dspifdefs.h $(INCDIR)xinitdefs.h $(CC) $(RFLAGS) $(SRCDIR)dspif.c -o $(OBJECTDIR)dspif.o -$(OBJECTDIR)kbdif.o: $(SRCDIR)kbdif.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ - $(INCDIR)dbprint.h $(INCDIR)devif.h - $(CC) $(RFLAGS) $(SRCDIR)kbdif.c -o $(OBJECTDIR)kbdif.o - -$(OBJECTDIR)mouseif.o: $(SRCDIR)mouseif.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ - $(INCDIR)dbprint.h $(INCDIR)devif.h - $(CC) $(RFLAGS) $(SRCDIR)mouseif.c -o $(OBJECTDIR)mouseif.o - $(OBJECTDIR)ether.o: $(SRCDIR)ether.c $(REQUIRED-INCS) \ $(INCDIR)commondefs.h $(INCDIR)lispemul.h \ $(INCDIR)lispmap.h $(INCDIR)emlglob.h $(INCDIR)lsptypes.h $(INCDIR)lspglob.h \ diff --git a/inc/bitblt.h b/inc/bitblt.h index 1944b956..36a1bada 100644 --- a/inc/bitblt.h +++ b/inc/bitblt.h @@ -49,12 +49,7 @@ extern int DisplayRasterWidth; #define MOUSEYH ((int)*EmMouseY68K + YDELTA) -#ifdef DOS -#define HideCursor { (currentdsp->mouse_invisible)(currentdsp, IOPage68K); } -#define ShowCursor { (currentdsp->mouse_visible)(IOPage68K->dlmousex, \ - IOPage68K->dlmousey); } - -#elif defined(SUNDISPLAY) && defined(OLD_CURSOR) +#if defined(SUNDISPLAY) && defined(OLD_CURSOR) extern struct winlock DisplayLockArea; #define HideCursor \ ioctl( LispWindowFd, WINLOCKSCREEN, &DisplayLockArea) @@ -82,14 +77,7 @@ extern DLword *EmCursorX68K,*EmCursorY68K; /* Macro for locking and unlocking screen to prevent multiple updates */ -#ifdef DOS -#define LOCKSCREEN currentdsp->device.locked++; -#define UNLOCKSCREEN currentdsp->device.locked--; - -#else - #define LOCKSCREEN ScreenLocked = T; #define UNLOCKSCREEN ScreenLocked = NIL; -#endif /* DOS */ #endif /* BITBLT_H */ diff --git a/inc/devif.h b/inc/devif.h index 0d3f9bc2..bf42088f 100644 --- a/inc/devif.h +++ b/inc/devif.h @@ -154,19 +154,6 @@ typedef struct { DevRec device; PFV device_event; /* Event handler for the keyboard. */ -#ifdef DOS - u_char KeyMap[0x80]; /* The key translation table. Use the keycode you - get from the keyboard as an index. The value - gives the lispkeycode.*/ - unsigned char lastbyte; /* Last byte that we got from the keyboard. */ - unsigned int keyeventsize; /* The sizeof() one kbd event */ - unsigned int maxkeyevent; /* Offset to the end of the ringbuffer. */ - int eurokbd; /* Keep tabs of the euro-ness of the kbd */ - PFV prev_handler; /* The previous keyboard handler. - Keep this around - to restore when we exit Medley */ - int URaid; /* Put this in a better place later.. /jarl */ -#endif /* DOS */ } KbdInterfaceRec, *KbdInterface; @@ -221,20 +208,7 @@ typedef struct unsigned long oldstate; /* Keep the old state around */ unsigned long graphicsmode; /* Magic cookie used to set the state. */ unsigned long numberofbanks; -#ifdef DOS - unsigned long BytesPerLine; - unsigned long DisplayStartAddr; - unsigned long DisplaySegSize; - unsigned long DisplaySegMagnitude; - unsigned long LinesPerBank; - unsigned short LastLineLen[32]; /* length of last line fragment per bank */ - unsigned short LinesInBank[32]; /* True # of full lines in this bank */ - /* # of lines we can do with the full-line dumpline */ - /* for sure. */ - unsigned short LinesBeforeBank[32]; /* Scan lines before start of this bank. */ - - void (* SwitchBank)(); /* Method to switch the bank (see vesa standard) */ -#elif XWINDOW +#if XWINDOW char *identifier; int BitGravity; Display *display_id; diff --git a/inc/dirdefs.h b/inc/dirdefs.h index 763e2c58..5aa19a8f 100644 --- a/inc/dirdefs.h +++ b/inc/dirdefs.h @@ -1,9 +1,6 @@ #ifndef DIRDEFS_H #define DIRDEFS_H 1 #include "lispemul.h" /* for LispPTR */ -#ifdef DOS -int make_old_version(char *old, char *file); -#endif #ifdef FSDEBUG void print_finfo(FINFO *fp); #endif diff --git a/inc/display.h b/inc/display.h index 8f0191b2..a274ff3c 100755 --- a/inc/display.h +++ b/inc/display.h @@ -44,10 +44,6 @@ extern DLword *DISP_MAX_Address; #define DISPLAYBUFFER #endif /* XWINDOW */ -#ifdef DOS -#define DISPLAYBUFFER -#endif /* DOS */ - #ifdef DISPLAYBUFFER /************************************************************************/ /* */ diff --git a/inc/dskdefs.h b/inc/dskdefs.h index a868dcf0..8574ad5a 100644 --- a/inc/dskdefs.h +++ b/inc/dskdefs.h @@ -1,11 +1,7 @@ #ifndef DSKDEFS_H #define DSKDEFS_H 1 #include "lispemul.h" /* for LispPTR */ -#ifdef DOS -void separate_host(char *lfname, char *host, char *drive); -#else void separate_host(char *lfname, char *host); -#endif LispPTR COM_openfile(register LispPTR *args); LispPTR COM_closefile(register LispPTR *args); LispPTR DSK_getfilename(register LispPTR *args); diff --git a/inc/inlndos.h b/inc/inlndos.h deleted file mode 100755 index 78d1c4d8..00000000 --- a/inc/inlndos.h +++ /dev/null @@ -1,703 +0,0 @@ -/* $Id: inlndos.h,v 1.2 1999/01/03 02:06:05 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */ - - -/************************************************************************/ -/* */ -/* (C) Copyright 1991, 1992 Venue. All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -/************************************************************************/ -/* */ -/* I N L I N E P S 2 . H */ -/* */ -/* INLINE definitions for 386 machines, compiled with gcc. */ -/* */ -/* This file consists of 3 sections: */ -/* */ -/* inline static functions for use anywhere in Medley */ -/* (e.g., the byte-swapping functions) */ -/* */ -/* #defines and static inline functions for the dispatch */ -/* loop (e.g., IDIFFERENCE), relying on the register */ -/* conventions that hold in that part of the code */ -/* */ -/* #defines and static inline functions for other */ -/* specific files (e.g., the arithmetic functions, */ -/* free-variable lookup, etc.), relying on the register */ -/* conventions in the respective files. */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* R E G I S T E R C O N V E N T I O N S */ -/* */ -/* The following register conventions hold in the dispatch loop, */ -/* and are set up by register ... asm("...") decls in xc.c: */ -/* */ -/* esi pccache - the current PC */ -/* edi cspcache - the current lisp stack ptr. */ -/* ebx tscache - the top-of-stack item. */ -/* */ -/* */ -/* Register conventions within arithmetic functions in the files */ -/* arith2.c - arith4.c, etc.: */ -/* */ -/* esi first argument to the function */ -/* edi second argument to the function */ -/* */ -/************************************************************************/ - - -/************************************************************************/ -/* */ -/* G E N E R A L - P U R P O S E I N L I N E F U N C T I O N S */ -/* */ -/* These functions don't rely on register conventions. */ -/* */ -/************************************************************************/ - - -/************************************************************************/ -/* */ -/* */ -/* */ -/* */ -/* */ -/************************************************************************/ - - /* undefine these macros so we use the 386i inline code */ - -#undef Get_BYTE_PCMAC0 -#undef Get_BYTE_PCMAC1 -#undef Get_BYTE_PCMAC2 -#undef Get_BYTE_PCMAC3 - -#define Get_BYTE_PCMAC0 Get_BYTE_PCMAC0fn(pccache) -#define Get_BYTE_PCMAC1 Get_BYTE_PCMAC1fn(pccache) -#define Get_BYTE_PCMAC2 Get_BYTE_PCMAC2fn(pccache) -#define Get_BYTE_PCMAC3 Get_BYTE_PCMAC3fn(pccache) - -extern inline unsigned int Get_BYTE_PCMAC0fn (pccache) -unsigned int pccache; - { - register unsigned int word; - asm("lea %0,-1[%1] \n\ - xor %0,3 \n\ - movzx %0,BYTE PTR [%0] \n\ - " : "=r" (word) : "r" (pccache) ); - return(word); - } - -extern inline unsigned int Get_BYTE_PCMAC1fn (pccache) -unsigned int pccache; - { - register unsigned int word; - asm("lea %0,[%1] \n\ - xor %0,3 \n\ - movzx %0,BYTE PTR [%0] \n\ - " : "=r" (word) : "r" (pccache) ); - return(word); - } - -extern inline unsigned int Get_BYTE_PCMAC2fn (pccache) -unsigned int pccache; - { - register unsigned int word; - asm("lea %0,1[%1] \n\ - xor %0,3 \n\ - movzx %0,BYTE PTR [%0] \n\ - " : "=r" (word) : "r" (pccache) ); - return(word); - } - -extern inline unsigned int Get_BYTE_PCMAC3fn (pccache) -unsigned int pccache; - { - register unsigned int word; - asm("lea %0,2[%1] \n\ - xor %0,3 \n\ - movzx %0,BYTE PTR [%0] \n\ - " : "=r" (word) : "r" (pccache) ); - return(word); - } - - -#undef Get_DLword_PCMAC0 -#undef Get_DLword_PCMAC1 -#undef Get_DLword_PCMAC2 -#undef Get_DLword_PCMAC3 - - -#define Get_DLword_PCMAC0 Get_DLword_PCMAC0fn(pccache) -#define Get_DLword_PCMAC1 Get_DLword_PCMAC1fn(pccache) -#define Get_DLword_PCMAC2 Get_DLword_PCMAC2fn(pccache) -#define Get_DLword_PCMAC3 Get_DLword_PCMAC3fn(pccache) - -extern inline unsigned int Get_DLword_PCMAC0fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("mov edx,%1 \n\ - xor dl,3 \n\ - movzx eax, byte ptr [edx] \n\ - lea edx,-1[%1] \n\ - xor dl,3 \n\ - mov ah, byte ptr [edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - -extern inline unsigned int Get_DLword_PCMAC1fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,1[%1] \n\ - xor dl,3 \n\ - movzx eax, byte ptr [edx] \n\ - lea edx,[%1] \n\ - xor dl,3 \n\ - mov ah, byte ptr [edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - - -extern inline unsigned int Get_DLword_PCMAC2fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,2[%1] \n\ - xor dl,3 \n\ - movzx eax, byte ptr [edx] \n\ - lea edx,1[%1] \n\ - xor dl,3 \n\ - mov ah, byte ptr [edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - -extern inline unsigned int Get_DLword_PCMAC3fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,3[%1] \n\ - xor dl,3 \n\ - movzx eax, byte ptr [edx] \n\ - lea edx,2[%1] \n\ - xor dl,3 \n\ - mov ah, byte ptr [edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - - -#undef Get_Pointer_PCMAC0 -#undef Get_Pointer_PCMAC1 -#undef Get_Pointer_PCMAC2 - -#define Get_Pointer_PCMAC0 Get_Pointer_PCMAC0fn(pccache) -#define Get_Pointer_PCMAC1 Get_Pointer_PCMAC1fn(pccache) -#define Get_Pointer_PCMAC2 Get_Pointer_PCMAC2fn(pccache) - - -extern inline const unsigned int Get_Pointer_PCMAC0fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,-1[%1] \n\ - xor dl,3 \n\ - movzx eax,byte ptr [edx] \n\ - shl eax,16 \n\ - lea edx,1[%1] \n\ - xor dl,3 \n\ - mov al,[edx] \n\ - lea edx,[%1] \n\ - xor dl,3 \n\ - mov ah,[edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - -extern inline const unsigned int Get_Pointer_PCMAC1fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,[%1] \n\ - xor dl,3 \n\ - movzx eax,byte ptr [edx] \n\ - shl eax,16 \n\ - lea edx,2[%1] \n\ - xor dl,3 \n\ - mov al,[edx] \n\ - lea edx,1[%1] \n\ - xor dl,3 \n\ - mov ah,[edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - - -extern inline const unsigned int Get_Pointer_PCMAC2fn(pccache) -unsigned int pccache; - { - register unsigned int word asm("ax"); - asm("lea edx,1[%1] \n\ - xor dl,3 \n\ - movzx eax,byte ptr [edx] \n\ - shl eax,16 \n\ - lea edx,3[%1] \n\ - xor dl,3 \n\ - mov al,[edx] \n\ - lea edx,2[%1] \n\ - xor dl,3 \n\ - mov ah,[edx] \n\ - " : "=r" (word) : "r" (pccache) : "dx" ); - return(word); - } - - -#undef DIFFERENCE -#undef IDIFFERENCE - -#define DIFFERENCE { \ - fast_op_difference(POP_TOS_1); \ - fast1_dispatcher(); \ -diff_err: \ - asm volatile("diff_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_difference, GET_POPPED); \ - } - -extern inline void fast_op_difference(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne diff_err \n\ - rol eax,17 \n\ - sub al,7 \n\ - jne diff_err \n\ - sub eax,ebx \n\ - jo diff_err \n\ - ror eax,15 \n\ - or eax,917504 \n\ - mov ebx,eax \ - " : : "g" (value) : "ax" ); - - } - -#define IDIFFERENCE { \ - fast_op_idifference(POP_TOS_1); \ - fast1_dispatcher(); \ -idiff_err: \ - asm volatile("idiff_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_idifference, GET_POPPED); \ - } - -extern inline void fast_op_idifference(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne idiff_err \n\ - rol eax,17 \n\ - sub al,7 \n\ - jne idiff_err \n\ - sub eax,ebx \n\ - jo idiff_err \n\ - ror eax,15 \n\ - or eax,917504 \n\ - mov ebx,eax \ - " : : "g" (value) : "ax" ); - - } - - -#undef IDIFFERENCE_N -#define IDIFFERENCE_N(n) { \ - fast_op_idifferencen(n); \ - fast2_dispatcher(); \ -idiffn_err: \ - asm("idiffn_err2:"); \ - asm volatile("add ebx,eax ; undo the sub"); \ - asm("idiffn_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_CALL_1d(N_OP_idifferencen, n); \ - } - -extern inline void fast_op_idifferencen(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol eax,15 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne idiffn_err \n\ - sub ebx,eax \n\ - jo idiffn_err2 \n\ - ror ebx,15 \n\ - or ebx,917504 \n\ - " : : "g" (value) : "ax" ); - - } - -#undef PLUS2 -#undef IPLUS2 - -#define PLUS2 { \ - fast_op_plus(POP_TOS_1); \ - fast1_dispatcher(); \ -plus_err: \ - asm volatile("plus_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_plus2, GET_POPPED); \ - } -extern inline void fast_op_plus(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne plus_err \n\ - rol eax,15 \n\ - sub al,7 \n\ - jne plus_err \n\ - add eax,ebx \n\ - jo plus_err \n\ - ror eax,15 \n\ - or eax,917504 \n\ - mov ebx,eax \n\ - " : : "g" (value) : "ax" ); - - } - - -#define IPLUS2 { \ - fast_op_iplus(POP_TOS_1); \ - fast1_dispatcher(); \ -iplus_err: \ - asm volatile("iplus_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_iplus2, GET_POPPED); \ - } -extern inline void fast_op_iplus(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne iplus_err \n\ - rol eax,15 \n\ - sub al,7 \n\ - jne iplus_err \n\ - add eax,ebx \n\ - jo iplus_err \n\ - ror eax,15 \n\ - or eax,917504 \n\ - mov ebx,eax \n\ - " : : "g" (value) : "ax" ); - - } - - -#undef IPLUS_N -#define IPLUS_N(n) { \ - fast_op_iplusn(n); \ - fast2_dispatcher(); \ -iplusn_err: \ - asm("iplusn_err:"); \ - asm volatile("add bl,7"); \ - asm volatile("ror ebx,15"); \ - N_OP_CALL_1d(N_OP_iplusn, n); \ - } - -extern inline void fast_op_iplusn(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol eax,15 \n\ - rol ebx,15 \n\ - sub bl,7 \n\ - jne iplusn_err \n\ - add eax,ebx \n\ - jo iplusn_err \n\ - ror eax,15 \n\ - or eax,917504 \n\ - mov ebx,eax \n\ - " : : "g" (value) : "ax" ); - - } - - -#undef GREATERP -#define GREATERP { \ - fast_op_greaterp(POP_TOS_1); \ - fast1_dispatcher(); \ -greaterp_err: \ - asm("greaterp_err:"); \ - N_OP_POPPED_CALL_2(N_OP_greaterp, GET_POPPED); \ - } - -extern inline void fast_op_greaterp(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - mov edx,ebx \n\ - rol edx,15 \n\ - sub dl,7 \n\ - jne greaterp_err \n\ - rol eax,15 \n\ - sub al,7 \n\ - jne greaterp_err \n\ - xor ebx,ebx \n\ - cmp eax,edx \n\ - jle greater_no \n\ - mov ebx,76 \n\ -greater_no: " : : "g" (value) ); - - } - - -#undef IGREATERP -#define IGREATERP { \ - fast_op_igreaterp(POP_TOS_1); \ - fast1_dispatcher(); \ -igreaterp_err: \ - asm("igreaterp_err: "); \ - N_OP_POPPED_CALL_2(N_OP_igreaterp, GET_POPPED); \ - } - -extern inline void fast_op_igreaterp(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - mov edx,ebx \n\ - rol edx,15 \n\ - sub dl,7 \n\ - jne igreaterp_err \n\ - rol eax,15 \n\ - sub al,7 \n\ - jne igreaterp_err \n\ - xor ebx,ebx \n\ - cmp eax,edx \n\ - jle igreater_no \n\ - mov ebx,76 \n\ -igreater_no: " : : "g" (value) ); - - } - - -#undef LRSH8 -#define LRSH8 { \ - asm volatile("\ - mov eax,ebx \n\ - rol eax,16 \n\ - cmp ax,0eh \n\ - jne lrsh8_err \n\ - shr bx,8 \n\ - " : : : "ax" ); \ - fast1_dispatcher(); \ -lrsh8_err: \ - asm("lrsh8_err: "); \ - N_OP_CALL_1(N_OP_lrsh8); \ - } - -#undef LRSH1 -#define LRSH1 { \ - asm volatile("\ - mov eax,ebx \n\ - rol eax,16 \n\ - cmp ax,0eh \n\ - jne lrsh1_err \n\ - shr bx,1 \n\ - " : : : "ax" ); \ - fast1_dispatcher(); \ -lrsh1_err: \ - asm("lrsh1_err: "); \ - N_OP_CALL_1(N_OP_lrsh1); \ - } - -#undef LLSH8 -#define LLSH8 { \ - asm volatile("\ - mov eax,ebx \n\ - rol eax,16 \n\ - cmp ax,0eh \n\ - jne llsh8_err \n\ - or bh,bh \n\ - jne llsh8_err \n\ - shl bx,8 \n\ - " : : : "ax" ); \ - fast1_dispatcher(); \ -llsh8_err: \ - asm("llsh8_err: "); \ - N_OP_CALL_1(N_OP_llsh8); \ - } - -#undef LLSH1 -#define LLSH1 { \ - asm volatile("\ - mov eax,ebx \n\ - rol eax,16 \n\ - cmp ax,0eh \n\ - jne llsh1_err \n\ - test bh,80h \n\ - jne llsh1_err \n\ - shl bx,1 \n\ - " : : : "ax" ); \ - fast1_dispatcher(); \ -llsh1_err: \ - asm("llsh1_err: "); \ - N_OP_CALL_1(N_OP_llsh1); \ - } - - -#undef LOGOR -#define LOGOR { \ - fast_op_logor(POP_TOS_1); \ - fast1_dispatcher(); \ -logor_err: \ - asm("logor_err:"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_logor, GET_POPPED); \ - } - -extern inline void fast_op_logor(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - cmp bl,7 \n\ - jne logor_err \n\ - rol eax,15 \n\ - cmp al,7 \n\ - jne logor_err \n\ - or ebx,eax \n\ - ror ebx,15 \n\ - " : : "g" (value) : "ax" ); - - } - - -#undef LOGAND -#define LOGAND { \ - fast_op_logand(POP_TOS_1); \ - fast1_dispatcher(); \ -logand_err: \ - asm("logand_err: "); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_logand, GET_POPPED); \ - } - -extern inline void fast_op_logand(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - cmp bl,7 \n\ - jne logand_err \n\ - rol eax,15 \n\ - cmp al,7 \n\ - jne logand_err \n\ - and ebx,eax \n\ - ror ebx,15 \n\ - " : : "g" (value) : "ax" ); - - } - - -#undef LOGXOR -#define LOGXOR { \ - fast_op_logxor(POP_TOS_1); \ - fast1_dispatcher(); \ -logxor_err: \ - asm("logxor_err:"); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_logxor, GET_POPPED); \ - } - -extern inline void fast_op_logxor(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - cmp bl,7 \n\ - jne logxor_err \n\ - rol eax,15 \n\ - sub al,7 \n\ - jne logxor_err \n\ - xor ebx,eax \n\ - ror ebx,15 \n\ - " : : "g" (value) : "ax" ); - - } - - - -#undef N_OP_ADDBASE -#define N_OP_ADDBASE { \ - fast_op_addbase(POP_TOS_1); \ - fast1_dispatcher(); \ -addbase_err: \ - asm("addbase_err: "); \ - asm volatile("ror ebx,15"); \ - N_OP_POPPED_CALL_2(N_OP_addbase, GET_POPPED); \ - } -extern inline void fast_op_addbase(LispPTR value) - { - asm volatile("\ - mov eax,%0 \n\ - rol ebx,15 \n\ - cmp bl,7 \n\ - jne addbase_err \n\ - sar ebx,15 \n\ - and eax,0ffffffh \n\ - add ebx,eax \n\ - " : : "g" (value) : "ax" ); - - } - - - - -#undef N_OP_LOLOC -#define N_OP_LOLOC { \ - asm volatile(" \ - and %0,0ffffh \n\ - or %0,0e0000h" : "=r" (tscache) : "0" (tscache)); \ - nextop1; } - -#undef N_OP_HILOC -#define N_OP_HILOC { \ - asm volatile(" \ - shr %0,16 \n\ - and %0,0ffffh \n\ - or %0,0e0000h" : "=r" (tscache) : "0" (tscache)); \ - nextop1; } - -#undef N_OP_VAG2 -#define N_OP_VAG2 \ - { \ - asm(" sub edi,4"); \ - asm(" mov eax,[edi]"); \ - asm(" rol ebx,16"); \ - asm(" mov bx,ax"); \ - asm(" ror ebx,16"); \ - nextop1; } - diff --git a/inc/kbdif.h b/inc/kbdif.h deleted file mode 100644 index bfe3de4e..00000000 --- a/inc/kbdif.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef KBDIF_H -#define KBDIF_H 1 -/* $Id: kbdif.h,v 1.2 1999/01/03 02:06:06 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ -#include /* for u_char */ - -/* The Keyboard structure. */ - -typedef struct { - u_char KeyMap[0x80]; -#ifdef DOS - u_char lastbyte; - void (*prev_handler)(); -#endif /* DOS */ - void (* sync_device)(); /* Make reality and emulator coincide with each other */ - void (* enter_device)(); - void (* exit_device)(); - void (* device_event)(); - void (* before_raid)(); - void (* after_raid)(); - int lispkeycode; -#ifdef DOS - int device_active; - int device_locked; -#endif /* DOS */ -} KbdInterfaceRec, *KbdInterface; -#endif /* KBDIF_H */ diff --git a/inc/lispver1.h b/inc/lispver1.h deleted file mode 100644 index 9fa8664e..00000000 --- a/inc/lispver1.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef LISPVER1_H -#define LISPVER1_H 1 -/* $Id: lispver1.h,v 1.2 1999/01/03 02:06:08 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */ - -/* DOS version of LispVersionToUnixVersion */ -#define LispVersionToUnixVersion(pathname, ver) \ - { \ - \ - register char *cp; \ - register char *vp; \ - char ver_buf[VERSIONLEN]; \ - \ - cp = pathname; \ - vp = NULL; \ - while (*cp) \ - { \ - switch (*cp) \ - { \ - \ - case ';': \ - *cp = 0; \ - cp++; \ - vp = cp; \ - break; \ - \ - case '\'': \ - if (*(cp + 1) != 0) cp += 2; \ - else cp++; \ - break; \ - \ - default: \ - cp++; \ - break; \ - } \ - } \ - \ - if (vp) \ - { \ - NumericStringP(vp, YES, NO); \ - NO: *vp = 0; \ - YES: \ - if ((*vp)) ver = atoi(vp); \ - else ver = -1; \ - } \ - else ver = -1; \ - } -#endif /* LISPVER1_H */ diff --git a/inc/locfile.h b/inc/locfile.h index 615b1366..60f67ac9 100644 --- a/inc/locfile.h +++ b/inc/locfile.h @@ -312,16 +312,8 @@ extern DLword *Lisp_world; /* To access LispSysout area */ * They might be lost in the course of the conversion. * */ -#ifdef DOS - -/* DOS version of LispVersionToUnixVersion */ -/* * * * * This is done this way because DOS can't handle the non-DOS version -- */ -/* * * * * it gave "Too many characters in a character constant" errors! */ -#include "lispver1.h" -#else /* DOS */ /* NON-DOS version of the macro LispVersionToUnixVersion */ #include "lispver2.h" -#endif /* DOS */ /* @@ -501,13 +493,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */ (((varray)->version_no == LASTVERSIONARRAY)? 1 : 0) -#ifdef DOS -#define OnlyVersionlessP(varray) 0 -#else -#define OnlyVersionlessP(varray) \ +#define OnlyVersionlessP(varray) \ (((varray)->version_no == 0 && ((varray) + 1)->version_no == LASTVERSIONARRAY) ? \ 1 : 0) -#endif /* DOS */ /* An argument of AddDotNoExtension must be LispVersion convention */ /* Like "foo/fee.fee;3" or "/foo/foo;3" */ @@ -622,13 +610,6 @@ extern int errno; /* DRIVESEP = OS-specific drive separator character. */ /* (only used with DOS as of 3/93) */ /********************************************************/ -#ifdef DOS -#define DIRSEP '\\' -#define DIRSEPSTR "\\" -#define DRIVESEP ':' -#define UNIXDIRSEP '/' -#define MAXNAMLEN _MAX_PATH -#else #define DIRSEPSTR "/" #define DIRSEP '/' #define UNIXDIRSEP '/' @@ -636,6 +617,5 @@ extern int errno; #if !defined(MAXNAMLEN) #define MAXNAMLEN NAME_MAX #endif -#endif #endif /* LOCFILE_H */ diff --git a/inc/medleyfp.h b/inc/medleyfp.h index a6dc94bd..af206c4f 100644 --- a/inc/medleyfp.h +++ b/inc/medleyfp.h @@ -39,11 +39,6 @@ extern volatile sig_atomic_t FP_error; #define FPCLEAR FP_error = 0; #define FPTEST(result) FP_error -#elif defined(DOS) -#include -#define FPCLEAR -#define FPTEST(result) (_getrealerror() & ( I87_ZERO_DIVIDE | I87_OVERFLOW | I87_UNDERFLOW)) - #else #include #define FPCLEAR diff --git a/inc/ufsdefs.h b/inc/ufsdefs.h index ca95197a..08009686 100644 --- a/inc/ufsdefs.h +++ b/inc/ufsdefs.h @@ -5,11 +5,7 @@ LispPTR UFS_getfilename(LispPTR *args); LispPTR UFS_deletefile(LispPTR *args); LispPTR UFS_renamefile(LispPTR *args); LispPTR UFS_directorynamep(LispPTR *args); -#ifdef DOS -int unixpathname(char *src, char *dst, int versionp, int genp, char *drive, int *extlenptr, char *rawname); -#else int unixpathname(char *src, char *dst, int versionp, int genp); -#endif int lisppathname(char *fullname, char *lispname, int dirp, int versionp); int quote_fname(char *file); int quote_fname_ufs(char *file); diff --git a/inc/version.h b/inc/version.h index 869a2fa8..4f7a5f60 100644 --- a/inc/version.h +++ b/inc/version.h @@ -233,15 +233,7 @@ error Must specify RELEASE to build Medley. /* */ /********************************************************/ -#ifdef DOS -typedef unsigned char u_char; -typedef unsigned long u_int; -typedef unsigned short u_short; -#undef UNALIGNED_FETCH_OK -#define USHORT unsigned -#else #define USHORT unsigned short -#endif /* DOS */ /****************************************************************/ /* End of architecture-specific flag settings */ diff --git a/src/bbtsub.c b/src/bbtsub.c index 4a386744..93f65dc2 100644 --- a/src/bbtsub.c +++ b/src/bbtsub.c @@ -28,9 +28,7 @@ #include #ifdef XWINDOW -#ifndef DOS #include -#endif /* DOS */ #include #include #include @@ -101,7 +99,7 @@ extern int MonoOrColor; /* take care of cursor movement & hiding */ /* (during bitblts to screen) ourselves. */ /*******************************************/ -#if defined(SUNDISPLAY) || defined(DOS) +#if defined(SUNDISPLAY) #define REALCURSOR #else #undef REALCURSOR @@ -453,11 +451,7 @@ void bitbltsub(LispPTR *argv) { } do_it_now: -#ifdef DOS - currentdsp->device.locked++; -#else ScreenLocked = T; -#endif /* DOS */ #ifdef REALCURSOR displayflg |= n_new_cursorin(dstbase, dx, dty, w, h); @@ -489,23 +483,11 @@ void bitbltsub(LispPTR *argv) { XUNLOCK; #endif /* XWINDOW */ -#ifdef DOS - /* Copy the changed section of display bank to the frame buffer */ - if (in_display_segment(dstbase)) { - /* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */ - flush_display_region(dx, dty, w, h); - } -#endif /* DOS */ - #ifdef REALCURSOR if (displayflg) ShowCursor; #endif /* REALCURSOR */ -#ifdef DOS - currentdsp->device.locked--; -#else ScreenLocked = NIL; -#endif /* DOS */ } /* end of bitbltsub */ @@ -846,14 +828,6 @@ LispPTR bitblt_bitmap(LispPTR *args) { XUNLOCK; #endif /* XWINDOW */ -#ifdef DOS - /* Copy the changed section of display bank to the frame buffer */ - if (in_display_segment(dstbase)) { - /* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */ - flush_display_region(dlx, dty, width, height); - } -#endif /* DOS */ - #ifdef REALCURSOR if (displayflg) ShowCursor; #endif /* REALCURSOR */ @@ -1095,14 +1069,6 @@ LispPTR bitshade_bitmap(LispPTR *args) { XUNLOCK; #endif /* XWINDOW */ -#ifdef DOS - /* Copy the changed section of display bank to the frame buffer */ - if (in_display_segment(dstbase)) { - /* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */ - flush_display_region(left, dty, width, height); - } -#endif /* DOS */ - #ifdef REALCURSOR if (displayflg) ShowCursor; #endif /* REALCURSOR */ @@ -1227,10 +1193,6 @@ void bltchar(LispPTR *args) XUNLOCK; #endif /* XWINDOW */ -#ifdef DOS - if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); -#endif /* DOS */ - #ifdef REALCURSOR if (displayflg) ShowCursor; #endif /* REALCURSOR */ @@ -1321,10 +1283,6 @@ LispPTR bltchar(LispPTR *args) XUNLOCK; #endif /* XWINDOW */ -#ifdef DOS - if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); -#endif /* DOS */ - #ifdef REALCURSOR if (displayflg) ShowCursor; #endif /* REALCURSOR */ @@ -1535,9 +1493,6 @@ void newbltchar(LispPTR *args) { #ifdef XWINDOW if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); #endif /* XWINDOW */ -#ifdef DOS - if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); -#endif /* DOS */ #ifdef REALCURSOR if (displayflg) ShowCursor; @@ -1679,11 +1634,6 @@ LispPTR newbltchar(LispPTR *args) { flush_display_lineregion(left, dstbase, (right - left), pbt->pbtheight); #endif /* XWINDOW */ -#ifdef DOS - if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); - if (displayflg) ShowCursor; -#endif /* DOS */ - ScreenLocked = NIL; /****** OLD bltchar *****/ diff --git a/src/bitblt.c b/src/bitblt.c index a8843c23..394479d5 100644 --- a/src/bitblt.c +++ b/src/bitblt.c @@ -46,13 +46,6 @@ extern int kbd_for_makeinit; #endif -#ifdef DOS -#include "devif.h" -#include "iopage.h" -extern DspInterface currentdsp; -extern IOPAGE *IOPage68K; -#endif - extern int LispWindowFd; extern int ScreenLocked; @@ -73,7 +66,7 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos) { PILOTBBT *pbt; DLword *srcbase, *dstbase; -#if defined(SUNDISPLAY) || defined(DOS) +#if defined(SUNDISPLAY) int displayflg; #endif int sx, dx, w, h, srcbpl, dstbpl, backwardflg; @@ -105,13 +98,9 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos) sx = pbt->pbtsourcebit; backwardflg = pbt->pbtbackward; /* if displayflg != 0 then source or destination is DisplayBitMap */ -#ifdef DOS - currentdsp->device.locked++; -#else ScreenLocked = T; -#endif /* DOS */ -#if SUNDISPLAY || DOS +#if SUNDISPLAY displayflg = cursorin(pbt->pbtdesthi, (pbt->pbtdestlo + (dx >> 4)), w, h, backwardflg) || cursorin(pbt->pbtsourcehi, (pbt->pbtsourcelo + (sx >> 4)), w, h, backwardflg); #endif /* SUNDISPLAY */ @@ -129,10 +118,7 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos) #ifdef SUNDISPLAY if (displayflg) HideCursor; -#elif DOS - if (displayflg) (currentdsp->mouse_invisible)(currentdsp, IOPage68K); - ; -#endif /* SUNDISPLAY / DOS */ +#endif /* SUNDISPLAY */ new_bitblt_code @@ -145,20 +131,13 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos) if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h); #endif if (displayflg) ShowCursor; -#elif DOS - flush_display_lineregion(dx, dstbase, w, h); - if (displayflg) (currentdsp->mouse_visible)(IOPage68K->dlmousex, IOPage68K->dlmousey); -#endif /* SUNDISPLAY / DOS */ +#endif /* SUNDISPLAY */ #ifdef XWINDOW flush_display_lineregion(dx, dstbase, w, h); #endif /* XWINDOW */ -#ifdef DOS - currentdsp->device.locked--; -#else ScreenLocked = NIL; -#endif /* DOS */ return (pilot_bt_tbl); diff --git a/src/chardev.c b/src/chardev.c index 1860855e..bda45552 100644 --- a/src/chardev.c +++ b/src/chardev.c @@ -25,7 +25,6 @@ #include #include -#ifndef DOS #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" @@ -75,7 +73,6 @@ LispPTR CHAR_openfile(LispPTR *args) /* args[1] access */ /* args[2] errno */ { -#ifndef DOS register int fd; /* return value of open system call. */ register int flags; /* open system call's argument */ /* struct stat statbuf; */ @@ -106,7 +103,6 @@ LispPTR CHAR_openfile(LispPTR *args) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); return (GetSmallp(fd)); -#endif /* DOS */ } /************************************************************************/ @@ -127,7 +123,6 @@ LispPTR CHAR_closefile(LispPTR *args) /* args[0] fd */ /* args[1] errno */ { -#ifndef DOS register int fd; /* file descriptor */ register int rval; Lisp_errno = (int *)(Addr68k_from_LADDR(args[1])); @@ -148,7 +143,6 @@ LispPTR CHAR_closefile(LispPTR *args) return (NIL); } return (ATOM_T); -#endif /* DOS */ } /************************************************************************/ @@ -171,7 +165,6 @@ LispPTR CHAR_closefile(LispPTR *args) LispPTR CHAR_ioctl(LispPTR *args) { -#ifndef DOS int fd, request; void *data; register int rval; @@ -187,7 +180,6 @@ LispPTR CHAR_ioctl(LispPTR *args) return (NIL); } return (ATOM_T); -#endif /* DOS */ } /************************************************************************/ @@ -203,7 +195,6 @@ LispPTR CHAR_ioctl(LispPTR *args) LispPTR CHAR_bin(int fd, LispPTR errn) { -#ifndef DOS register int rval; unsigned char ch[4]; Lisp_errno = (int *)(Addr68k_from_LADDR(errn)); @@ -220,7 +211,6 @@ LispPTR CHAR_bin(int fd, LispPTR errn) return (NIL); } return (GetSmallp(ch[0])); -#endif /* DOS */ } /************************************************************************/ @@ -235,7 +225,6 @@ LispPTR CHAR_bin(int fd, LispPTR errn) LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn) { -#ifndef DOS register int rval; char buf[4]; Lisp_errno = (int *)(Addr68k_from_LADDR(errn)); @@ -254,7 +243,6 @@ LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn) return (NIL); } return (ATOM_T); -#endif /* DOS */ } /************************************************************************/ @@ -280,7 +268,6 @@ LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn) LispPTR CHAR_bins(LispPTR *args) { -#ifndef DOS register int fd, rval; char *buffer; int nbytes; @@ -305,7 +292,6 @@ LispPTR CHAR_bins(LispPTR *args) #endif /* BYTESWAP */ return (GetSmallp(rval)); -#endif /* DOS */ } /************************************************************************/ @@ -331,7 +317,6 @@ LispPTR CHAR_bins(LispPTR *args) LispPTR CHAR_bouts(LispPTR *args) { -#ifndef DOS register int fd, rval; char *buffer; int nbytes; @@ -359,5 +344,4 @@ LispPTR CHAR_bouts(LispPTR *args) return (NIL); } return (GetSmallp(rval)); -#endif /* DOS */ } diff --git a/src/common.c b/src/common.c index 486bccee..b3a18924 100644 --- a/src/common.c +++ b/src/common.c @@ -91,7 +91,6 @@ int error(const char *cp) { fflush(stdout); fflush(stderr); URaid_currentFX = URMAXFXNUM + 1; memset(URaid_FXarray, 0, URMAXFXNUM * 4); -#ifndef DOS { int stat = fcntl(fileno(stdin), F_GETFL, 0); if (stat != O_RDONLY && stat != O_RDWR) @@ -100,7 +99,6 @@ int error(const char *cp) { exit(0); } } -#endif /* DOS */ uraidloop: if (setjmp(BT_jumpbuf) == 1) goto uraidloop; if (setjmp(SD_jumpbuf) == 1) goto uraidloop; diff --git a/src/dbgtool.c b/src/dbgtool.c index 1cbb6910..1a38cd24 100644 --- a/src/dbgtool.c +++ b/src/dbgtool.c @@ -67,18 +67,6 @@ extern int URaid_ArrMAXIndex; int BT_lines; int BT_temp; jmp_buf BT_jumpbuf; -#ifdef DOS -#define BTMAXLINE 24 -/* DOS has a 25-line screen, and getchar discards ESC for some reason */ -#define BT_morep \ - if ((BT_temp != '!') && (++BT_lines > BTMAXLINE)) { \ - printf("Press Return(Esc & Ret to quit, ! don't stop):"); \ - BT_temp = getch(); \ - fflush(stdin); \ - BT_lines = 0; \ - if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \ - } -#else /* DOS */ #define BTMAXLINE 30 #define BT_morep \ if (++BT_lines > BTMAXLINE) { \ @@ -88,7 +76,6 @@ jmp_buf BT_jumpbuf; BT_lines = 0; \ if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \ } -#endif /* DOS */ /***************************************************************/ /* diff --git a/src/dir.c b/src/dir.c index 83aab14c..09a25cdd 100644 --- a/src/dir.c +++ b/src/dir.c @@ -18,16 +18,9 @@ #include #include -#ifndef DOS #include #include #include -#else /* DOS, now */ -#include -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEN _MAX_PATH -#define alarm(x) 1 -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" @@ -146,12 +139,6 @@ static int match_pattern(char *tp, char *pp) register char *tsp, *psp; register int inastr; -#ifdef DOS - /* % is not allowed in DOS names for Medley. */ - if (strchr(tp, '%')) return 0; - -#endif /* DOS */ - for (tsp = tp, psp = pp, inastr = 0;; tp++, pp++) { switch (*pp) { case '\0': return ((*tp == '\0') ? 1 : 0); @@ -191,29 +178,6 @@ static int match_pattern(char *tp, char *pp) } } -#ifdef DOS - -int make_old_version(char *old, char *file) -{ - int len = (int)strlen(file) - 1; - if (file[len] == DIRCHAR) return 0; - /* look up old versions of files for version # 0's */ - strcpy(old, file); - - if (old[len] == '.') - strcat(old, "%"); - else if ((len > 0) && old[len - 1] == '.') - strcat(old, "%"); - else if ((len > 1) && old[len - 2] == '.') - strcat(old, "%"); - else if ((len > 2) && old[len - 3] == '.') - old[len] = '%'; - else - strcat(old, ".%"); - return 1; -} -#endif /* DOS */ - /************************************************************************/ /******** E N D O F P A T T E R N - M A T C H I N G C O D E *******/ /************************************************************************/ @@ -447,167 +411,6 @@ static int get_finfo_id() { * of FINFO structures. */ -#ifdef DOS -static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) -{ - register struct direct *dp; - register FINFO *prevp; - register FINFO *nextp; - int n, len, rval, res, isslash = 0, drive = 0; - struct find_t dirp; - register struct passwd *pwd; - struct stat sbuf; - char namebuf[MAXPATHLEN]; - char fver[VERSIONLEN]; - char old[MAXNAMLEN]; - - /* The null directory has to be special cased */ - /* because adjacent \'s in the pathname don't match anything */ - if (dir[1] == DRIVESEP) drive = dir[0]; - - if (strcmp(dir, "\\") == 0) - isslash = 1; - else if (drive && (strcmp(dir + 2, "\\") == 0)) - isslash = 1; - - if (!isslash) - strcpy(namebuf, dir); /* Only add the dir if it's real */ - else if (drive) { - namebuf[0] = drive; - namebuf[1] = DRIVESEP; - namebuf[2] = '\0'; - } else - *namebuf = '\0'; - - strcat(namebuf, DIRSEPSTR); - strcat(namebuf, name); - - TIMEOUT(res = _dos_findfirst(namebuf, _A_NORMAL | _A_SUBDIR, &dirp)); - if (res < 0) { - *Lisp_errno = errno; - return (-1); - } - - for (nextp = prevp = (FINFO *)NULL, n = 0; res == 0; - S_TOUT(res = _dos_findnext(&dirp)), prevp = nextp) { - if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue; - MatchP(dirp.name, name, ver, match, unmatch); - unmatch: - continue; - match: - AllocFinfo(nextp); - if (nextp == (FINFO *)NULL) { - FreeFinfo(prevp); - *Lisp_errno = errno; - return (-1); - } - nextp->next = prevp; - if (isslash) { - if (drive) - sprintf(namebuf, "%c:\\%s", drive, dirp.name); - else - sprintf(namebuf, "\\%s", dirp.name); - } else - sprintf(namebuf, "%s\\%s", dir, dirp.name); - - TIMEOUT(rval = stat(namebuf, &sbuf)); - if (rval == -1 && errno != ENOENT) { - /* - * ENOENT error might be caused by missing symbolic - * link. We should ignore such error here. - */ - FreeFinfo(nextp); - *Lisp_errno = errno; - return (-1); - } - - strcpy(namebuf, dirp.name); - if (sbuf.st_mode & S_IFDIR) { - nextp->dirp = 1; - quote_dname(namebuf); - strcpy(nextp->lname, namebuf); - len = strlen(namebuf); - *(nextp->lname + len) = DIRCHAR; - *(nextp->lname + len + 1) = '\0'; - nextp->lname_len = len + 1; - } else { - /* All other types than directory. */ - nextp->dirp = 0; - strcat(namebuf, ".~1~"); - quote_fname(namebuf); - len = strlen(namebuf); - strcpy(nextp->lname, namebuf); - *(nextp->lname + len) = '\0'; - nextp->lname_len = len; - } - - strcpy(namebuf, dirp.name); - len = strlen(namebuf); - DOWNCASE(namebuf); - strcpy(nextp->no_ver_name, namebuf); - nextp->version = 1; - nextp->ino = sbuf.st_ino; - nextp->prop->length = (unsigned)sbuf.st_size; - nextp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime); - nextp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime); - nextp->prop->protect = (unsigned)sbuf.st_mode; - /* TIMEOUT(pwd = getpwuid(sbuf.st_uid)); - if (pwd == (struct passwd *)NULL) { - nextp->prop->au_len = 0; - } else { - len = strlen(pwd->pw_name); - strcpy(nextp->prop->author, pwd->pw_name); - *(nextp->prop->author + len) = '\0'; - nextp->prop->au_len = len; - } */ - n++; - } - - /***********************/ - /* Now go looking for version-0 entries */ - /***********************/ - - for (nextp = prevp; nextp; nextp = nextp->next) { - FINFO *newp; - - if (!make_old_version(old, nextp->no_ver_name)) continue; - - if (isslash) { - if (drive) - sprintf(namebuf, "%c:\\%s", drive, old); - else - sprintf(namebuf, "\\%s", old); - } else - sprintf(namebuf, "%s\\%s", dir, old); - TIMEOUT(rval = stat(namebuf, &sbuf)); - - if (rval == -1) continue; - - AllocFinfo(newp); - newp->next = prevp; - /* All other types than directory. */ - newp->dirp = 0; - sprintf(namebuf, "%s.~00~", nextp->no_ver_name); - quote_fname(namebuf); - len = strlen(namebuf); - strcpy(newp->lname, namebuf); - *(newp->lname + len) = '\0'; - newp->lname_len = len; - - strcpy(newp->no_ver_name, old); - newp->version = 0; - newp->ino = sbuf.st_ino; - newp->prop->length = (unsigned)sbuf.st_size; - newp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime); - newp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime); - newp->prop->protect = (unsigned)sbuf.st_mode; - n++; - prevp = newp; - } - if (n > 0) *finfo_buf = prevp; - return (n); -} -#else /* DOS */ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) { register struct dirent *dp; @@ -706,7 +509,6 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) if (n > 0) *finfo_buf = prevp; return (n); } -#endif /* DOS */ /* * Name: enum_dsk @@ -727,150 +529,6 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) * * Similar to enum_dsk_prop, but file properties are not stored. */ -#ifdef DOS -static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf) -{ - register struct direct *dp; - register FINFO *prevp; - register FINFO *nextp; - int n, len, rval, isslash = 0, drive = 0; - struct find_t dirp; - struct stat sbuf; - char namebuf[MAXPATHLEN]; - char fver[VERSIONLEN]; - char old[MAXPATHLEN]; - - /* The null directory has to be special cased */ - /* because adjacent \'s in the pathname don't match anything */ - if (dir[1] == DRIVESEP) drive = dir[0]; - - if (strcmp(dir, "\\") == 0) - isslash = 1; - else if (drive && (strcmp(dir + 2, "\\") == 0)) - isslash = 1; - - if (!isslash) - strcpy(namebuf, dir); /* Only add the dir if it's real */ - else if (drive) { - namebuf[0] = drive; - namebuf[1] = DRIVESEP; - namebuf[2] = '\0'; - } else - *namebuf = '\0'; - - strcat(namebuf, DIRSEPSTR); - strcat(namebuf, name); - - TIMEOUT(rval = _dos_findfirst(namebuf, _A_NORMAL | _A_SUBDIR, &dirp)); - if (rval != 0) { - *Lisp_errno = errno; - return (-1); - } - - for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0; - S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) { - if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue; - MatchP(dirp.name, name, ver, match, unmatch); - unmatch: - continue; - match: - AllocFinfo(nextp); - if (nextp == (FINFO *)NULL) { - FreeFinfo(prevp); - *Lisp_errno = errno; - return (-1); - } - nextp->next = prevp; - if (isslash) { - if (drive) - sprintf(namebuf, "%c:\\%s", drive, dirp.name); - else - sprintf(namebuf, "\\%s", dirp.name); - } else - sprintf(namebuf, "%s\\%s", dir, dirp.name); - TIMEOUT(rval = stat(namebuf, &sbuf)); - if (rval == -1 && errno != ENOENT) { - /* - * ENOENT error might be caused by missing symbolic - * link. We should ignore such error here. - */ - FreeFinfo(nextp); - *Lisp_errno = errno; - return (-1); - } - - strcpy(namebuf, dirp.name); /* moved from below 2/26/93 */ - if (sbuf.st_mode & S_IFDIR) { - nextp->dirp = 1; - quote_dname(namebuf); - strcpy(nextp->lname, namebuf); - len = strlen(namebuf); - *(nextp->lname + len) = DIRCHAR; - *(nextp->lname + len + 1) = '\0'; - nextp->lname_len = len + 1; - } else { - /* All other types than directory. */ - nextp->dirp = 0; - strcat(namebuf, ".~1~"); - quote_fname(namebuf); - len = strlen(namebuf); - strcpy(nextp->lname, namebuf); - *(nextp->lname + len) = '\0'; - nextp->lname_len = len; - } - - strcpy(namebuf, dirp.name); /* to get real versionless name */ - len = strlen(namebuf); - DOWNCASE(namebuf); - strcpy(nextp->no_ver_name, namebuf); - nextp->version = 1; - nextp->ino = sbuf.st_ino; - n++; - } - - /***********************/ - /* Now go looking for version-0 entries */ - /***********************/ - - for (nextp = prevp; nextp; nextp = nextp->next) { - FINFO *newp; - - if (!make_old_version(old, nextp->no_ver_name)) continue; - - if (isslash) { - if (drive) - sprintf(namebuf, "%c:\\%s", drive, old); - else - sprintf(namebuf, "\\%s", old); - } else - sprintf(namebuf, "%s\\%s", dir, old); - TIMEOUT(rval = stat(namebuf, &sbuf)); - - if (rval == -1) continue; - - AllocFinfo(newp); - newp->next = prevp; - /* All other types than directory. */ - newp->dirp = 0; - sprintf(namebuf, "%s.~00~", nextp->no_ver_name); - quote_fname(namebuf); - len = strlen(namebuf); - strcpy(newp->lname, namebuf); - *(newp->lname + len) = '\0'; - newp->lname_len = len; - - strcpy(newp->no_ver_name, old); - newp->version = 0; - newp->ino = sbuf.st_ino; - n++; - prevp = newp; - } - - if (n > 0) *finfo_buf = prevp; - return (n); -} - -#else /* DOS */ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf) { @@ -956,7 +614,6 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf) if (n > 0) *finfo_buf = prevp; return (n); } -#endif /* DOS */ /* * Name: enum_ufs_prop @@ -980,93 +637,6 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf) * File properties Lisp will need later are also stored in the result linked list * of FINFO structures. */ -#ifdef DOS -static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) -{ - register struct direct *dp; - register FINFO *prevp; - register FINFO *nextp; - int n, len, rval; - struct find_t dirp; - /* register struct passwd *pwd; -- From author support */ - struct stat sbuf; - char namebuf[MAXPATHLEN]; - - TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp)); - if (rval != 0) { - *Lisp_errno = errno; - return (-1); - } - - for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0; - S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) { - if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue; - MatchP_Case(dirp.name, name, ver, match, unmatch); - unmatch: - continue; - match: - AllocFinfo(nextp); - if (nextp == (FINFO *)NULL) { - FreeFinfo(prevp); - *Lisp_errno = errno; - return (-1); - } - nextp->next = prevp; - sprintf(namebuf, "%s\\%s", dir, dirp.name); - TIMEOUT(rval = stat(namebuf, &sbuf)); - if (rval == -1 && errno != ENOENT) { - /* - * ENOENT error might be caused by missing symbolic - * link. We should ignore such error here. - */ - FreeFinfo(nextp); - *Lisp_errno = errno; - return (-1); - } - - strcpy(namebuf, dirp.name); - if (sbuf.st_mode & S_IFDIR) { - nextp->dirp = 1; - quote_dname(namebuf); - strcpy(nextp->lname, namebuf); - len = strlen(namebuf); - *(nextp->lname + len) = DIRCHAR; - *(nextp->lname + len + 1) = '\0'; - nextp->lname_len = len + 1; - } else { - /* All other types than directory. */ - nextp->dirp = 0; - quote_fname_ufs(namebuf); - len = strlen(namebuf); - strcpy(nextp->lname, namebuf); - *(nextp->lname + len) = '\0'; - nextp->lname_len = len; - } - - strcpy(namebuf, dirp.name); - len = strlen(namebuf); - nextp->ino = sbuf.st_ino; - nextp->prop->length = (unsigned)sbuf.st_size; - nextp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime); - nextp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime); - nextp->prop->protect = (unsigned)sbuf.st_mode; - /* - TIMEOUT(pwd = getpwuid(sbuf.st_uid)); - if (pwd == (struct passwd *)NULL) { - nextp->prop->au_len = 0; - } else { - len = strlen(pwd->pw_name); - strcpy(nextp->prop->author, pwd->pw_name); - *(nextp->prop->author + len) = '\0'; - nextp->prop->au_len = len; - } - */ - n++; - } - if (n > 0) *finfo_buf = prevp; - return (n); -} -#else /* DOS */ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) { register struct dirent *dp; @@ -1159,7 +729,6 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) if (n > 0) *finfo_buf = prevp; return (n); } -#endif /* DOS */ /* * Name: enum_ufs @@ -1180,77 +749,6 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf) * * Similar to enum_ufs_prop, but file properties are not stored. */ -#ifdef DOS -static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf) -{ - register struct direct *dp; - register FINFO *prevp; - register FINFO *nextp; - int n, len, rval; - struct find_t dirp; - struct stat sbuf; - char namebuf[MAXPATHLEN]; - - TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp)); - if (rval != 0) { - *Lisp_errno = errno; - return (-1); - } - - for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0; - S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) { - if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue; - MatchP_Case(dirp.name, name, ver, match, unmatch); - unmatch: - continue; - match: - AllocFinfo(nextp); - if (nextp == (FINFO *)NULL) { - FreeFinfo(prevp); - *Lisp_errno = errno; - return (-1); - } - nextp->next = prevp; - sprintf(namebuf, "%s\\%s", dir, dirp.name); - TIMEOUT(rval = stat(namebuf, &sbuf)); - if (rval == -1 && errno != ENOENT) { - /* - * ENOENT error might be caused by missing symbolic - * link. We should ignore such error here. - */ - FreeFinfo(nextp); - *Lisp_errno = errno; - return (-1); - } - - strcpy(namebuf, dirp.name); - if (sbuf.st_mode & S_IFDIR) { - nextp->dirp = 1; - quote_dname(namebuf); - strcpy(nextp->lname, namebuf); - len = strlen(namebuf); - *(nextp->lname + len) = DIRCHAR; - *(nextp->lname + len + 1) = '\0'; - nextp->lname_len = len + 1; - } else { - /* All other types than directory. */ - nextp->dirp = 0; - quote_fname_ufs(namebuf); - len = strlen(namebuf); - strcpy(nextp->lname, namebuf); - *(nextp->lname + len) = '\0'; - nextp->lname_len = len; - } - - strcpy(namebuf, dirp.name); - len = strlen(namebuf); - nextp->ino = sbuf.st_ino; - n++; - } - if (n > 0) *finfo_buf = prevp; - return (n); -} -#else /* DOS */ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf) { register struct dirent *dp; @@ -1327,7 +825,6 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf) if (n > 0) *finfo_buf = prevp; return (n); } -#endif /* DOS*/ /* * Name: trim_finfo @@ -1349,7 +846,6 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf) static int trim_finfo(FINFO **fp) { -#ifndef DOS register FINFO *tp, *sp, *mp, *cp, *pp; register int num, pnum; int linkp; @@ -1448,16 +944,6 @@ static int trim_finfo(FINFO **fp) } } while (sp != (FINFO *)NULL); -#else /* DOS version */ - int num = 0; - FINFO *tp; - tp = *fp; - while (tp) { - num++; - tp = tp->next; - } -#endif /* DOS */ - return (num); } @@ -1845,10 +1331,8 @@ static int dsk_filecmp(FINFO **fp1, FINFO **fp2) if ((res = strcmp((*fp1)->no_ver_name, (*fp2)->no_ver_name)) != 0) return (res); if ((*fp1)->version == (*fp2)->version) return (0); -#ifndef DOS if ((v1 = (*fp1)->version) == 0) return (-1); if ((v2 = (*fp2)->version) == 0) return (1); -#endif /* DOS */ return ((v1 < v2) ? 1 : -1); } @@ -2029,9 +1513,6 @@ LispPTR COM_gen_files(register LispPTR *args) { char fbuf[MAXPATHLEN + 5], dir[MAXPATHLEN], pattern[MAXPATHLEN]; char host[MAXNAMLEN], name[MAXNAMLEN], ver[VERSIONLEN]; -#ifdef DOS - char drive[1]; -#endif int dskp, count, highestp, propp, fid, version; register char *cp; FINFO *fp; @@ -2053,11 +1534,7 @@ LispPTR COM_gen_files(register LispPTR *args) if (count > MAXPATHLEN + 5) FileNameTooLong((GetSmallp(-1))); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - separate_host(fbuf, host, drive); -#else separate_host(fbuf, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) @@ -2091,11 +1568,7 @@ LispPTR COM_gen_files(register LispPTR *args) * to do some trick here. */ -#ifdef DOS - if (!unixpathname(fbuf, pattern, 1, 1, drive, 0, 0)) { -#else if (!unixpathname(fbuf, pattern, 1, 1)) { -#endif /* DOS */ /* Yes, always dskp is on */ return (GetSmallp(-1)); } diff --git a/src/doscomm.c b/src/doscomm.c deleted file mode 100644 index 2de5b146..00000000 --- a/src/doscomm.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $Id: doscomm.c,v 1.3 1999/05/31 23:35:27 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -DOS_handlecomm(int args) {} diff --git a/src/doskbd.c b/src/doskbd.c deleted file mode 100644 index 5be1ead4..00000000 --- a/src/doskbd.c +++ /dev/null @@ -1,314 +0,0 @@ -/* $Id: doskbd.c,v 1.2 1999/01/03 02:06:55 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ -/************************************************************************/ -/* */ -/* D O S K E Y B O A R D H A N D L E R */ -/* */ -/* */ -/************************************************************************/ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -#include /* defines REGS & other structs */ -#include /* "#pragma interrupt" & '_chain_intr'*/ -#include -#include - -#include "lispemul.h" -#include "keyboard.h" -#include "keysym.h" -#include "devif.h" - -int nokbdflag = FALSE; -extern int eurokbd; -extern KbdInterface currentkbd; -extern MouseInterface currentmouse; -extern IOPAGE *IOPage68K; -extern IFPAGE *InterfacePage; -extern int KBDEventFlg; - -extern keybuffer *CTopKeyevent; - -extern LispPTR *LASTUSERACTION68k; -extern LispPTR *KEYBUFFERING68k; - -/************************************************/ -/* Keyboard-Interface Registers, Status Codes */ -/************************************************/ -#define KBD_COMMAND_PORT 0x64 /* I/O port commands go out on */ -#define KBD_ENABLE 0xAE -#define KBD_DISABLE 0xAD -#define KBD_RESET 0xF6 - -#define PORT_8042 0x60 /* Port scan codes come in on */ -#define KBD_SCAN_CODE_PORT 0x60 -#define KBD_resend 0xFE /* KBD asked for resend */ -#define KBD_ack 0xFA /* KBD ack's our command */ -#define KBD_echo_response 0xEE /* KBD responds to echo req */ -#define KBD_failure 0xFD /* Failure code */ -#define KBD_prefix 0xE0 /* Prefix for extended chars */ -#define KBD_pause_prefix 0xE1 /* Pause prefix?? */ -#define KBD_overflow 0x00 /* Overflow of some kind */ -#define KBD_overrun 0xFF /* KBD buffer overrun */ - -#define KBD_STATUS_PORT 0x64 /* Port KBD status comes in on */ -#define KBD_INP_FULL 0x02 /* input buffer full */ - -#define INTA00 0x20 /* The 8259 port, to reset irq */ -#define ENDOFINTERRUPT 0x20 - -#define PRTSC_KEY 0x37 /* Keyboard codes for extended chars */ -#define HOME_KEY 0x47 -#define UPARROW_KEY 0x48 -#define PGUP_KEY 0x49 -#define LEFTARROW_KEY 0x4b -#define RIGHTARROW_KEY 0x4d -#define END_KEY 0x4f -#define DOWNARROW_KEY 0x50 -#define PGDOWN_KEY 0x51 -#define INS_KEY 0x52 -#define DEL_KEY 0x53 - -/******************************************************/ -/* Tell the Interrupt-dispatch IC we're done, and */ -/* Tell the keyboard itself that we're ready again. */ -/* */ -/* (This process is critical to the proper function */ -/* of the handler, so let's do it once, correctly.) */ -/******************************************************/ -#define ENABLE_KBD \ - { \ - outp(INTA00, ENDOFINTERRUPT); \ - outp(KBD_COMMAND_PORT, KBD_ENABLE); /* Turn kbd on again. */ \ - } - -/************************************************************************/ -/* */ -/* K B D _ E V E N T */ -/* */ -/* Keyboard interrupt handler routine */ -/************************************************************************/ -extern DLword *DisplayRegion68k; - -#pragma interrupt(Kbd_event) - -void Kbd_event() { - _XSTACK *ebp; /* Real-mode handler stack frame */ - DLword w, r; - KBEVENT *kbevent; - unsigned char keycode, tmpkey; - - ebp = (_XSTACK *)_get_stk_frame(); /* Get stack frame address */ - ebp->opts |= _STK_NOINT; /* Bypass real-mode handler */ - - /*************************************************/ - /* First, get the scan code from the keyboard. */ - /* Handle exceptional conditions & errors, and */ - /* the extended-character prefix, 0xE0 */ - /* generated for, e.g., the INSERT key. */ - /*************************************************/ - - _disable(); /* prevent further interrupts from killing us */ - outp(KBD_COMMAND_PORT, KBD_DISABLE); /* Turn the kbd off. */ - do { tmpkey = inp(KBD_STATUS_PORT); } while (tmpkey & KBD_INP_FULL); - - /* Finite state machine that either returns or goes to label handle: */ - switch (tmpkey = inp(KBD_SCAN_CODE_PORT)) { - case KBD_overflow: /* Ignore these. */ - case KBD_pause_prefix: - case KBD_echo_response: - case KBD_ack: - case KBD_failure: - case KBD_resend: - case KBD_overrun: - ENABLE_KBD; - return; - break; - - case KBD_prefix: /* It's a prefix, so really use next char. */ - /* Remember that we saw the prefix: */ - currentkbd->lastbyte = tmpkey; - ENABLE_KBD; - return; - break; - - default: - tmpkey = inp(KBD_SCAN_CODE_PORT); - if (currentkbd->lastbyte == KBD_prefix) - switch (tmpkey) /* deal with prefixed characters */ - { - case 0x2A: /* by ignoring some (what are they??) */ - case 0xAA: - case 0xB6: - case 0x36: - ENABLE_KBD; - return; - break; - - default: /* and passing the rest thru as-is */ - currentkbd->lastbyte = tmpkey; /* Set the state. */ - goto handle; - break; - } - else { - currentkbd->lastbyte = tmpkey; /* Set the state. */ - goto handle; - } - } - - return; /* Don't have anything to handle yet, so just return */ - -/*****************************************************/ -/* Second, translate the scan code into a LISP key */ -/* transition, add it to the ring buffer, and set */ -/* the interrupt-request flags so lisp sees it. */ -/*****************************************************/ -handle: - /* The upflag is the eight bit in the char ie. upflag = currentkbd->lastbyte >> 7 */ - /* The event is the lower seven bits of the byte */ - - keycode = currentkbd->KeyMap[currentkbd->lastbyte & 0x7f]; - - if (keycode != 0xff) { - if (keycode < 64) { - PUTBASEBIT68K(&(IOPage68K->dlkbdad0), keycode, (currentkbd->lastbyte >> 7) & 1); - } else if (keycode >= 80) { - PUTBASEBIT68K(&(IOPage68K->dlkbdad0), keycode - 16, (currentkbd->lastbyte >> 7) & 1); - } else { - PUTBASEBIT68K(&(IOPage68K->dlutilin), (keycode & 0xf), (currentkbd->lastbyte >> 7) & 1); - PUTBASEBIT68K(&(InterfacePage->fakemousebits), (keycode & 0xf), - (currentkbd->lastbyte >> 7) & 1); - } - } - - /* In DOS we can't enter uraid inside an exception handler. */ - /* Uraid may touch a swapped out address and that dumps Medley */ - if (((IOPage68K->dlkbdad2 & 2113) == 0) || /* Ctrl-shift-NEXT */ - ((IOPage68K->dlkbdad2 & 2114) == 0)) { /* Ctrl-shift-DEL */ - currentkbd->URaid = TRUE; /* Tell the dispatch loop about it. */ - return; - } - - r = CTopKeyevent->ring.vectorindex.read; - w = CTopKeyevent->ring.vectorindex.write; - - if (r != w) { - kbevent = (KBEVENT *)((DLword *)CTopKeyevent + w); - /* Copy the Hardware bits. */ - kbevent->W0 = IOPage68K->dlkbdad0; - kbevent->W1 = IOPage68K->dlkbdad1; - kbevent->W2 = IOPage68K->dlkbdad2; - kbevent->W3 = IOPage68K->dlkbdad3; - kbevent->W4 = IOPage68K->dlkbdad4; - kbevent->W5 = IOPage68K->dlkbdad5; - kbevent->WU = IOPage68K->dlutilin; - - /* If queue was empty, update the read pointer */ - if (r == 0) CTopKeyevent->ring.vectorindex.read = w; - - /* Update the write pointer */ - if (w >= currentkbd->maxkeyevent) - CTopKeyevent->ring.vectorindex.write = MINKEYEVENT; - else - CTopKeyevent->ring.vectorindex.write += currentkbd->keyeventsize; - } - if (*KEYBUFFERING68k == NIL) *KEYBUFFERING68k = ATOM_T; - - KBDEventFlg++; - Irq_Stk_End = 0; - Irq_Stk_Check = 0; - - ENABLE_KBD; - return; -} - -extern u_char DOSLispKeyMap_101[]; - -/************************************************************************/ -/* */ -/* E X I T D O S K B D */ -/* */ -/* Turn off the DOS keyboard handler, and reinstall the */ -/* normal DOS handler. */ -/************************************************************************/ - -void ExitDosKbd(KbdInterface kbd) -{ - if (kbd->device.active == TRUE) { - kbd->device.active = FALSE; - - _dpmi_unlockregion((void *)¤tkbd, sizeof(currentkbd)); - _dpmi_unlockregion((void *)kbd, sizeof(*kbd)); - _dpmi_unlockregion((void *)&InterfacePage, sizeof(InterfacePage)); - _dpmi_unlockregion((void *)InterfacePage, sizeof(IFPAGE)); - _dpmi_unlockregion((void *)&IOPage68K, sizeof(IOPage68K)); - _dpmi_unlockregion((void *)IOPage68K, sizeof(IOPAGE)); - - _dpmi_unlockregion((void *)&CTopKeyevent, sizeof(CTopKeyevent)); - _dpmi_unlockregion((void *)CTopKeyevent, sizeof(*CTopKeyevent)); - - _dpmi_unlockregion((void *)&MachineState, sizeof(MachineState)); - _dpmi_unlockregion((void *)&KEYBUFFERING68k, sizeof(KEYBUFFERING68k)); - _dpmi_unlockregion((void *)&ExitDosKbd, 4096); - _dpmi_unlockregion((void *)&Kbd_event, 4096); - - _dos_setvect(0x09, kbd->prev_handler); /* unhook our handlr, install previous*/ - } -} - -/************************************************************************/ -/* */ -/* E N T E R D O S K B D */ -/* */ -/* Turn on the DOS keyboard device. */ -/* */ -/************************************************************************/ - -void EnterDosKbd(KbdInterface kbd) -{ - int i; - - if (kbd->device.active == FALSE) { - kbd->device.active = TRUE; - for (i = 0; i < 0x80; i++) kbd->KeyMap[i] = DOSLispKeyMap_101[i]; - - if (eurokbd) - kbd->keyeventsize = EUROKEYEVENTSIZE; - else - kbd->keyeventsize = NOEUROKEYEVENTSIZE; - kbd->eurokbd = eurokbd; - - /* Offset of the end of the ring buffer */ - kbd->maxkeyevent = (MINKEYEVENT + (NUMBEROFKEYEVENTS * kbd->keyeventsize)); - - _dpmi_lockregion((void *)¤tkbd, sizeof(currentkbd)); - _dpmi_lockregion((void *)kbd, sizeof(*kbd)); - _dpmi_lockregion((void *)&InterfacePage, sizeof(InterfacePage)); - _dpmi_lockregion((void *)InterfacePage, sizeof(IFPAGE)); - _dpmi_lockregion((void *)&IOPage68K, sizeof(IOPage68K)); - _dpmi_lockregion((void *)IOPage68K, sizeof(IOPAGE)); - _dpmi_lockregion((void *)&MachineState, sizeof(MachineState)); - - _dpmi_lockregion((void *)&CTopKeyevent, sizeof(CTopKeyevent)); - _dpmi_lockregion((void *)CTopKeyevent, sizeof(*CTopKeyevent)); - - _dpmi_lockregion((void *)&KEYBUFFERING68k, sizeof(KEYBUFFERING68k)); - _dpmi_lockregion((void *)&ExitDosKbd, 4096); - _dpmi_lockregion((void *)&Kbd_event, 4096); - - /* Don't hook in our handler if the user flagged he wants to run */ - /* without a kbd. */ - if (!nokbdflag) { - kbd->prev_handler = _dos_getvect(0x09); /* get addr of current 09 hndlr */ - _dos_setvect(0x09, kbd->device_event); /* hook our int handler to interrupt */ - } - } -} diff --git a/src/dosmouse.c b/src/dosmouse.c deleted file mode 100644 index 61520731..00000000 --- a/src/dosmouse.c +++ /dev/null @@ -1,624 +0,0 @@ -/* $Id: dosmouse.c,v 1.2 1999/01/03 02:06:56 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -#include /* Defines "#pragma interrupt" */ -#include /* _XSTACK struct definition */ -#include /* Defines REGS & other structs */ - -#include "lispemul.h" -#include "display.h" -#include "bb.h" - -#include "dbprint.h" -#include "devif.h" -#include "keyboard.h" -#include "ifpage.h" - -extern int eurokbd; -extern IOPAGE *IOPage68K; -extern MISCSTATS *MiscStats; -extern IFPAGE *InterfacePage; -extern int KBDEventFlg; -extern DspInterface currentdsp; -extern MouseInterface currentmouse; -extern KbdInterface currentkbd; - -extern keybuffer *CTopKeyevent; -extern DLword *DisplayRegion68k; -extern DLword *Lisp_world; - -extern LispPTR *KEYBOARDEVENTQUEUE68k; -extern LispPTR *KEYBUFFERING68k; -extern LispPTR *LASTUSERACTION68k; - -#define MOUSE_MV 0x01 /* Mouse movement occurred */ -#define LB_PRESS 0x02 /* Left button pressed */ -#define LB_OFF 0x04 /* Left button released */ -#define RB_PRESS 0x08 /* Right button pressed */ -#define RB_OFF 0x10 /* Right button released */ -#define CB_PRESS 0x20 /* Center button released */ -#define CB_OFF 0x40 /* Center button pressed */ - -#pragma interrupt(TwoButtonHandler) -#pragma interrupt(ThreeButtonHandler) -#pragma interrupt(ButtonTimer) -void ButtonTimer(); -void MouseButtonSignal(); - -void EnterDosMouse(MouseInterface mouse, DspInterface dsp) -{ - union REGS regs; - - probemouse(); - _dpmi_lockregion((void *)&MouseButtonSignal, 4096); - /* Set up the ringbuffer */ - if (eurokbd) - mouse->keyeventsize = EUROKEYEVENTSIZE; - else - mouse->keyeventsize = NOEUROKEYEVENTSIZE; - - mouse->eurokbd = eurokbd; - - /* Offset of the end of the ring buffer */ - mouse->maxkeyevent = (MINKEYEVENT + (NUMBEROFKEYEVENTS * mouse->keyeventsize)); - - /* Lock myself */ - _dpmi_lockregion((void *)mouse, sizeof(*mouse)); - _dpmi_lockregion((void *)¤tmouse, sizeof(currentmouse)); - - /* Lock the handler routines */ - _dpmi_lockregion((void *)mouse->Handler, 4096); - - if (mouse->Button.TwoButtonP) { _dpmi_lockregion((void *)&ButtonTimer, 4096); } - - /* Lock the structures used, both pointers to 'em & the whole structure. */ - _dpmi_lockregion((void *)&IOPage68K, sizeof(IOPage68K)); - _dpmi_lockregion((void *)IOPage68K, sizeof(IOPAGE)); - _dpmi_lockregion((void *)&InterfacePage, sizeof(InterfacePage)); - _dpmi_lockregion((void *)InterfacePage, sizeof(IFPAGE)); - _dpmi_lockregion((void *)&MiscStats, sizeof(MiscStats)); - _dpmi_lockregion((void *)MiscStats, sizeof(MISCSTATS)); - - /* Lock the flags */ - _dpmi_lockregion((void *)&KBDEventFlg, sizeof(KBDEventFlg)); - _dpmi_lockregion((void *)&MachineState, sizeof(MachineState)); - - /* Lock the pointers into the sysout */ - _dpmi_lockregion((void *)&KEYBUFFERING68k, sizeof(KEYBUFFERING68k)); - - /* Lock the regions of the sysout that the pointers points to */ - /* KEYBUFFERINF68k points to the value cell for a symbol */ - _dpmi_lockregion((void *)KEYBUFFERING68k, sizeof(LispPTR)); - - /* CTopKeyevent points to the ring-buffer of keyboard events */ - _dpmi_lockregion((void *)&CTopKeyevent, sizeof(CTopKeyevent)); - _dpmi_lockregion((void *)CTopKeyevent, sizeof(*CTopKeyevent)); - - /* Now Lock the lastuseraction machine. */ - /* _dpmi_lockregion(mouse->timestamp, sizeof(LispPTR)); */ /* Lisp_world itself */ - - regs.w.eax = 0x0001; /* Function 1 = turn on mouse cursor */ - int86(0x33, ®s, ®s); - regs.w.eax = 0x0002; /* Function 2 = hide mouse cursor */ - int86(0x33, ®s, ®s); - - regs.w.eax = 0x0C; /* Function 0C = set user-defined mouse handler */ - regs.w.ecx = LB_PRESS | LB_OFF | CB_PRESS | CB_OFF | RB_PRESS | RB_OFF | MOUSE_MV; - regs.w.edx = FP_OFF(*(mouse->Handler)); /* Address of our mouse handler routine */ - int86(0x33, ®s, ®s); /* Install our handler to process events */ - - if (regs.w.eax == 'MERR') - VESA_errorexit("Unable to install mouse handler - not enough low memory.\n", -1); - - regs.x.ax = 0x7; /* Set mouse horizontal range */ - regs.x.cx = 0x0; - regs.x.dx = (short)(dsp->Display.width - 1); - int86(0x33, ®s, ®s); - - regs.x.ax = 0x8; /* Set mouse vertical range */ - regs.x.cx = 0x0; - regs.x.dx = (short)(dsp->Display.height - 1); - int86(0x33, ®s, ®s); - - /* See if turning this off fixes the "mouse granularity" problem */ - /* Nope. It didn't. */ - regs.x.ax = 0xf; /* Set mickey per pixel range */ - regs.x.cx = 0x8; - regs.x.dx = 0x8; - int86(0x33, ®s, ®s); - - mouse->Button.NextHandler = _dos_getvect(0x1c); - _dos_setvect(0x1c, ButtonTimer); - - mouse->device.active = TRUE; -} - -void ExitDosMouse(MouseInterface mouse) -{ - if (mouse->device.active) { - /* Unlock myself */ - _dpmi_unlockregion((void *)mouse, sizeof(*mouse)); - _dpmi_unlockregion((void *)¤tmouse, sizeof(currentmouse)); - - /* Unlock the handler routines */ - _dpmi_unlockregion((void *)mouse->Handler, 4096); - _dpmi_unlockregion((void *)&ButtonTimer, 4096); - _dpmi_unlockregion((void *)&MouseButtonSignal, 4096); - - /* Unlock the structures used. */ - _dpmi_unlockregion((void *)&IOPage68K, sizeof(IOPage68K)); - _dpmi_unlockregion((void *)&InterfacePage, sizeof(InterfacePage)); - _dpmi_unlockregion((void *)&MiscStats, sizeof(MiscStats)); - - /* Unlock the flags */ - _dpmi_unlockregion((void *)&KBDEventFlg, sizeof(KBDEventFlg)); - _dpmi_unlockregion((void *)&MachineState, sizeof(MachineState)); - - /* Unlock the pointers into the sysout */ - _dpmi_unlockregion((void *)&KEYBUFFERING68k, sizeof(KEYBUFFERING68k)); - /* _dpmi_unlockregion((void *)&KEYBOARDEVENTQUEUE68k, sizeof(KEYBOARDEVENTQUEUE68k)); */ - - /* Unlock the regions of the sysout that the pointers points to */ - _dpmi_unlockregion((void *)KEYBUFFERING68k, sizeof(LispPTR)); - - _dpmi_unlockregion((void *)&CTopKeyevent, sizeof(CTopKeyevent)); - _dpmi_unlockregion((void *)CTopKeyevent, sizeof(*CTopKeyevent)); - - /* _dpmi_unlockregion(mouse->timestamp, sizeof(LispPTR)); */ - - _dos_setvect(0x1c, mouse->Button.NextHandler); - mouse->device.active = FALSE; - } -} - -void DosMouseAfterRaid(MouseInterface mouse, DspInterface dsp) -{ - union REGS regs; - - /* Screen mode changed. We have to reinit the ranges. */ - regs.x.ax = 0x7; /* Set mouse horizontal range */ - regs.x.cx = 0x0; - regs.x.dx = (short)(dsp->Display.width - 1); - int86(0x33, ®s, ®s); - - regs.x.ax = 0x8; /* Set mouse vertical range */ - regs.x.cx = 0x0; - regs.x.dx = (short)(dsp->Display.height - 1); - int86(0x33, ®s, ®s); - - mouse->device.active = TRUE; -} - -void DosMouseBeforeRaid(MouseInterface mouse, DspInterface dsp) -{ mouse->device.active = FALSE; } - -/***************************************************************/ -/* d o s _ c u r s o r _ i n v i s s i b l e */ -/* Since we only blit the cursor to the VESA/VGA displaybuffer */ -/* and not to the emulator displaybuffer we can make the cursor*/ -/* invisible just by updating the area under the cursor! */ -/***************************************************************/ -void dos_cursor_invisible(DspInterface dsp, IOPAGE *iop) - -{ (dsp->bitblt_to_screen)(dsp, DisplayRegion68k, iop->dlcursorx, iop->dlcursory, 16, 16); } - -/***************************************************************/ -/* d o s _ c u r s o r _ v i s s i b l e */ -/* blit the mouse to the display ... */ -/* The cursor should be blitted according to the following: */ -/* ((backgroundbm AND maskbm) OR ((NOT mask) OR cursorbm)) */ -/* ie. bltAND the mask to the background then bltOR the rest */ -/* */ -/* Hah!! this crappy machine doesn't have a mask!! /jarl */ -/* ie. use the inverted bitmap as a mask!!!! */ -/* */ -/* More to the point. The mask is the image inverted. (sigh..) */ -/* */ -/***************************************************************/ - -set_DOSmouseposition(DspInterface dsp, int x, int y) - -{ - union REGS regs; - - dsp->device.locked++; - currentmouse->device.active++; - -#ifdef NEVER - /* int 33h, case 0004, cx=col, dx = row */ - regs.w.eax = 4; /* Function 4 = move cursor */ - regs.w.ecx = x; - regs.w.edx = y; - int86(0x33, ®s, ®s); -#endif /* NEVER */ - - /* Actually move the cursor image */ - IOPage68K->dlmousex = x; - IOPage68K->dlmousey = y; - - /* *(currentmouse->timestamp) = MiscStats->secondstmp; */ - - (currentdsp->mouse_invisible)(currentdsp, IOPage68K); - currentmouse->Cursor.New.x = IOPage68K->dlcursorx = x; - currentmouse->Cursor.New.y = IOPage68K->dlcursory = y; - (currentdsp->mouse_visible)(x, y); - - dsp->device.locked--; - currentmouse->device.active--; -} - -void docopy(int newx, int newy) -{ - register DLword *srcbase, *dstbase; - static int sx, dx, w = 16, h = 16, srcbpl, dstbpl, backwardflg = 0; - static int src_comp = 0, op = 0, gray = 0, num_gray = 0, curr_gray_line = 0; - - srcbase = IOPage68K->dlcursorbitmap; - dstbase = DisplayRegion68k + (newy * currentdsp->Display.width / 16); - sx = 0; - dx = newx; - w = currentmouse->Cursor.Last.width; - h = currentmouse->Cursor.Last.height; - srcbpl = 16; - dstbpl = currentdsp->Display.width; - op = 2; /* OR-in */ - -#ifdef NEWBITBLT - bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, 2, 0, 0, 0); -#else - new_bitblt_code; -#endif /* NEWBITBLT */ -} - -dostaking_mouse_up(int newx, int newy) -{ - /* save hidden bitmap */ - - register DLword *srcbase, *dstbase; - static int sx, dx, w = 16, h = 16, srcbpl, dstbpl, backwardflg = 0; - static int src_comp = 0, op = 0, gray = 0, num_gray = 0, curr_gray_line = 0; - - /* newx and newy are hotspot coordinates. */ - /* newx -= currentmouse->Cursor.Hotspot.x; */ - /* newy -= ( 15 - currentmouse->Cursor.Hotspot.y); */ - - /* save image */ - srcbase = DisplayRegion68k + (newy * currentdsp->Display.width / 16); - dstbase = currentmouse->Cursor.Savebitmap; - sx = newx; - dx = 0; - - if (currentdsp->Display.width < (newx + 16)) { - currentmouse->Cursor.Last.width = w = currentdsp->Display.width - newx; - } else { - currentmouse->Cursor.Last.width = w = 16; - }; - - if (currentdsp->Display.height < (newy + 16)) { - currentmouse->Cursor.Last.height = h = currentdsp->Display.height - newy; - } else { - currentmouse->Cursor.Last.height = h = 16; - }; - - srcbpl = currentdsp->Display.width; - dstbpl = 16; - op = 0; /* replace */ - -#ifdef NEWBITBLT - bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, 0, gray, num_gray, - curr_gray_line); -#else - new_bitblt_code; -#endif /* NEWBITBLT */ - - /* Copy Cursor Image */ - docopy(newx, newy); - - currentmouse->Cursor.Last.x = newx; - currentmouse->Cursor.Last.y = newy; - - (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, currentmouse->Cursor.Last.x, - currentmouse->Cursor.Last.y, w, h); -} - -dostaking_mouse_down(DspInterface dsp, IOPAGE *iop) -{ - register DLword *srcbase, *dstbase; - static int sx, dx, w, h, srcbpl, dstbpl, backwardflg = 0; - static int src_comp = 0, op = 0, gray = 0, num_gray = 0, curr_gray_line = 0; - - /* restore saved image */ - srcbase = currentmouse->Cursor.Savebitmap; - dstbase = - DisplayRegion68k + ((currentmouse->Cursor.Last.y) * (dsp->Display.width / 16)); /* old y */ - sx = 0; - dx = currentmouse->Cursor.Last.x; /* old x */ - w = currentmouse->Cursor.Last.width; - h = currentmouse->Cursor.Last.height; - srcbpl = 16; - dstbpl = dsp->Display.width; - op = 0; - -#ifdef NEWBITBLT - bitblt(srcbase, dstbase, sx, dx, w, h, srcbpl, dstbpl, backwardflg, src_comp, 0, 0, 0, 0); -#else - new_bitblt_code; -#endif /* NEWBITBLT */ - - (dsp->bitblt_to_screen)(dsp, DisplayRegion68k, currentmouse->Cursor.Last.x, - currentmouse->Cursor.Last.y, w, h); -} - -/************************************************************************/ -/* */ -/* M o u s e B u t t o n S i g n a l */ -/* */ -/* Tell LISP about a mouse event by putting an entry on the ring buf- */ -/* fer of mouse/kbd events, with the new mouse-button state in it. */ -/* */ -/* */ -/************************************************************************/ - -void MouseButtonSignal(MouseInterface mouse) -{ - DLword w, r; - KBEVENT *kbevent; - - /* In the mouse device TRUE means button pressed */ - /* In the IOPage 0 means button pressed */ - /* Hence the ! in the lines below. */ - PUTBASEBIT68K(&(IOPage68K->dlutilin), MOUSE_LEFT, !mouse->Button.Left); - PUTBASEBIT68K(&(IOPage68K->dlutilin), MOUSE_MIDDLE, !mouse->Button.Middle); - PUTBASEBIT68K(&(IOPage68K->dlutilin), MOUSE_RIGHT, !mouse->Button.Right); - - r = CTopKeyevent->ring.vectorindex.read; - w = CTopKeyevent->ring.vectorindex.write; - - if (r != w) { - kbevent = (KBEVENT *)((DLword *)CTopKeyevent + w); - - /* Copy the Hardware bits. */ - kbevent->W0 = IOPage68K->dlkbdad0; - kbevent->W1 = IOPage68K->dlkbdad1; - kbevent->W2 = IOPage68K->dlkbdad2; - kbevent->W3 = IOPage68K->dlkbdad3; - kbevent->W4 = IOPage68K->dlkbdad4; - kbevent->W5 = IOPage68K->dlkbdad5; - kbevent->WU = IOPage68K->dlutilin; - - /* If queue was empty, update the read pointer */ - if (r == 0) CTopKeyevent->ring.vectorindex.read = w; - - /* Update the write pointer */ - if (w >= mouse->maxkeyevent) - CTopKeyevent->ring.vectorindex.write = MINKEYEVENT; - else - CTopKeyevent->ring.vectorindex.write += mouse->keyeventsize; - } - - if (*KEYBUFFERING68k == NIL) *KEYBUFFERING68k = ATOM_T; - - KBDEventFlg++; /* Signal the emulator to tell Lisp */ - Irq_Stk_Check = 0; - Irq_Stk_End = 0; -} - -/***************************************************************/ -/* B u t t o n T i m e r */ -/* This function is used with the mouse chording machinery. */ -/* This function is the timer interrupt handler. When a button */ -/* event happens we will wait to report it until the next */ -/* timeout happens. We will thus obtain the ``rubbery feeling''*/ -/* that proponents of chording so desire. */ -/***************************************************************/ -void ButtonTimer() { - if (currentmouse->Button.RunTimer) - if (currentmouse->Button.tick-- <= 0) { - currentmouse->Button.RunTimer = FALSE; /* Turn the timer off. */ - currentmouse->Button.Left |= currentmouse->Button.StateLeft; - currentmouse->Button.Right |= currentmouse->Button.StateRight; - - /* Mouse chording code. If at the end of the timeout - the left and right buttons are down we signal middle - button and bring the others up. */ - /* Are L & R down? */ - - if (currentmouse->Button.StateLeft && currentmouse->Button.StateRight) { - currentmouse->Button.Left = FALSE; - currentmouse->Button.Right = FALSE; - currentmouse->Button.Middle = TRUE; - } - - currentmouse->Button.StateLeft = FALSE; - currentmouse->Button.StateRight = FALSE; - - /* Did L & R go up after a simulated M */ - /* if((currentmouse->Button.Middle && - !(currentmouse->Button.StateLeft || - currentmouse->Button.StateRight))) - { - currentmouse->Button.Left = FALSE; - currentmouse->Button.Right = FALSE; - currentmouse->Button.Middle = FALSE; - } - */ - MouseButtonSignal(currentmouse); - } - _chain_intr(currentmouse->Button.NextHandler); -} - -/***************************************************************/ -/* T w o B u t t o n H a n d l e r */ -/* This function is the interrupt handler for the mouse. */ -/* This function sets the state of the mouse structure and */ -/* signals the dispatch loop to take care of the matter. This */ -/* awkward solution is due to the severe braindamage in DOS. */ -/***************************************************************/ -void TwoButtonHandler(void) { - _XSTACK *stk_ptr; - - /* First save the stack frame. */ - stk_ptr = (_XSTACK *)_get_stk_frame(); /* Get ptr to V86 _XSTACK frame */ - stk_ptr->opts |= _STK_NOINT; /* Bypass real-mode handler */ - - if (!currentmouse->device.active) return; - - if (stk_ptr->eax & LB_PRESS) - if (currentmouse->Button.RunTimer) /* Prior right-down seen... */ - { - currentmouse->Button.RunTimer = FALSE; - currentmouse->Button.FakeMiddle = TRUE; - currentmouse->Button.Middle = TRUE; - currentmouse->Button.StateLeft = TRUE; - MouseButtonSignal(currentmouse); - } else if (currentmouse->Button.Right) { - currentmouse->Button.Left = TRUE; - currentmouse->Button.StateLeft = TRUE; - MouseButtonSignal(currentmouse); - } else /* No other button down... */ - { - currentmouse->Button.StateLeft = TRUE; - currentmouse->Button.tick = currentmouse->Button.StartTime; - currentmouse->Button.RunTimer = TRUE; - } - if (stk_ptr->eax & LB_OFF) /* Left button released, and */ - if (currentmouse->Button.RunTimer) /* Timer had been running */ - { - currentmouse->Button.RunTimer = FALSE; - currentmouse->Button.Left = TRUE; - MouseButtonSignal(currentmouse); - currentmouse->Button.StateLeft = FALSE; - /* currentmouse->Button.Left = FALSE; - MouseButtonSignal(currentmouse); */ - } else /* timer wasn't running */ - { - currentmouse->Button.StateLeft = FALSE; - currentmouse->Button.Left = FALSE; - currentmouse->Button.FakeMiddle = FALSE; - currentmouse->Button.Middle = currentmouse->Button.StateMiddle; - MouseButtonSignal(currentmouse); - } - - if ((stk_ptr->eax & CB_PRESS) || (stk_ptr->eax & CB_OFF)) { - currentmouse->Button.Middle = - ((stk_ptr->eax & CB_PRESS) && TRUE) || currentmouse->Button.FakeMiddle; - currentmouse->Button.StateMiddle = (stk_ptr->eax & CB_PRESS) && TRUE; - currentmouse->Button.RunTimer = FALSE; - MouseButtonSignal(currentmouse); - } - - if (stk_ptr->eax & RB_PRESS) /* Right button pressed, and */ - if (currentmouse->Button.RunTimer) /* Timer was running... */ - { - currentmouse->Button.RunTimer = FALSE; - currentmouse->Button.FakeMiddle = TRUE; - currentmouse->Button.Middle = TRUE; - currentmouse->Button.StateRight = TRUE; - MouseButtonSignal(currentmouse); - } else if (currentmouse->Button.Left) { - currentmouse->Button.Right = TRUE; - currentmouse->Button.StateRight = TRUE; - MouseButtonSignal(currentmouse); - } else { - currentmouse->Button.StateRight = TRUE; - currentmouse->Button.tick = currentmouse->Button.StartTime; - currentmouse->Button.RunTimer = TRUE; - } - if (stk_ptr->eax & RB_OFF) /* Right button released */ - if (currentmouse->Button.RunTimer) /* Timer had been running */ - { - currentmouse->Button.RunTimer = FALSE; - currentmouse->Button.Right = TRUE; - MouseButtonSignal(currentmouse); - currentmouse->Button.StateRight = FALSE; - /* currentmouse->Button.Right = FALSE; - MouseButtonSignal(currentmouse); */ - } else { - currentmouse->Button.StateRight = FALSE; - currentmouse->Button.Right = FALSE; - currentmouse->Button.FakeMiddle = FALSE; - currentmouse->Button.Middle = currentmouse->Button.StateMiddle; - MouseButtonSignal(currentmouse); - } - - /* The dude moved the mouse. Set the chordstate NOW. */ - /* And turn the timer off. */ - if ((stk_ptr->eax & MOUSE_MV) && (!currentdsp->device.locked)) { - currentmouse->Button.RunTimer = FALSE; - - /* Are L & R down? */ - /* if(currentmouse->Button.StateLeft && currentmouse->Button.StateRight) - { - currentmouse->Button.Left = FALSE; - currentmouse->Button.Right = FALSE; - currentmouse->Button.Middle = TRUE; - } - */ - /* currentmouse->Cursor.New.x = (DLword)stk_ptr->ecx & 0xFFFF; - currentmouse->Cursor.New.y = (DLword)stk_ptr->edx & 0xFFFF; */ - currentmouse->Cursor.Moved = TRUE; - - if (currentmouse->Button.StateLeft && currentmouse->Button.StateRight) { - currentmouse->Button.Left = FALSE; - currentmouse->Button.Right = FALSE; - currentmouse->Button.Middle = TRUE; - } else { - currentmouse->Button.Left |= currentmouse->Button.StateLeft; - currentmouse->Button.Right |= currentmouse->Button.StateRight; - } - - currentmouse->Button.StateLeft = currentmouse->Button.StateRight = FALSE; - MouseButtonSignal(currentmouse); - } -} - -/***************************************************************/ -/* T h r e e B u t t o n H a n d l e r */ -/* This function is the interrupt handler for the mouse. */ -/* This function sets the state of the mouse structure and */ -/* signals the dispatch loop to take care of the matter. This */ -/* awkward solution is due to the severe braindamage in DOS. */ -/***************************************************************/ -void ThreeButtonHandler() - -{ - _XSTACK *stk_ptr; - unsigned long mouse_flags; - - /* First save the stack frame. */ - stk_ptr = (_XSTACK *)_get_stk_frame(); /* Get ptr to V86 _XSTACK frame */ - stk_ptr->opts |= _STK_NOINT; /* Bypass real-mode handler */ - - if (currentmouse->device.active) { - mouse_flags = stk_ptr->eax; /* Save event flags from mouse driver */ - - /* Decode the transition bits. */ - if (mouse_flags & LB_PRESS) currentmouse->Button.Left = TRUE; - if (mouse_flags & LB_OFF) currentmouse->Button.Left = FALSE; - - if (mouse_flags & CB_PRESS) currentmouse->Button.Middle = TRUE; - if (mouse_flags & CB_OFF) currentmouse->Button.Middle = FALSE; - - if (mouse_flags & RB_PRESS) currentmouse->Button.Right = TRUE; - if (mouse_flags & RB_OFF) currentmouse->Button.Right = FALSE; - - if ((!currentdsp->device.locked) && (mouse_flags & MOUSE_MV)) { - currentmouse->Cursor.Moved = TRUE; - Irq_Stk_Check = 0; - Irq_Stk_End = 0; - } - - if (mouse_flags & (LB_PRESS | LB_OFF | CB_PRESS | CB_OFF | RB_PRESS | RB_OFF)) - MouseButtonSignal(currentmouse); - } -} diff --git a/src/dsk.c b/src/dsk.c index d483429f..e0270416 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -19,21 +19,11 @@ #include #include -#ifndef DOS #include #include #include #include #include -#else /* DOS */ -#include -#include -#include -#include -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEM _MAX_PATH -#define alarm(x) 0 -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" @@ -85,30 +75,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile); static int get_old_new(char *dir, FileName *varray, char *afile, char *vfile); static int get_version_array(char *dir, char *file, FileName *varray, CurrentVArray *cache); -#ifdef DOS -static void separate_drive(char *lfname, char *drive) -{ - register char *cp; - - cp = lfname; - - /* Check if there's a drive specified. */ - - if (*(cp + 1) == DRIVESEP) { - *drive = *cp; /* copy the drive letter, if there is one */ - cp++; - cp++; /* Move to the real `<`/ */ - while (*cp) /* Move the rest to the left to cover. */ - { - *(cp - 2) = *cp; - cp++; - } - *(cp - 2) = '\0'; - } else - *drive = '\0'; /* no drive */ -} -#endif /* DOS */ - /* * Name: separate_host * @@ -131,11 +97,7 @@ static void separate_drive(char *lfname, char *drive) * */ -#ifdef DOS -void separate_host(char *lfname, char *host, char *drive) -#else void separate_host(char *lfname, char *host) -#endif /* DOS */ { register char *cp; register size_t diff; @@ -146,16 +108,6 @@ void separate_host(char *lfname, char *host) *host = '\0'; cp++; /* Now, *cp == '<' or drive letter. */ -#ifdef DOS - /* Check if there's a drive specified. */ - - if (*(cp + 1) == DRIVESEP) { - *drive = *cp; /* copy the drive letter, if there is one */ - cp++; - cp++; /* Move to the real `<`/ */ - } else - *drive = '\0'; /* no drive */ -#endif /* DOS */ if (*(cp + 1) == '\0') { /* Root directory is specified. */ @@ -164,9 +116,6 @@ void separate_host(char *lfname, char *host) } else { diff = cp - lfname; if (*cp == '<' || *cp == DIRSEP -#ifdef DOS - || *cp == UNIXDIRSEP -#endif /* DOS */ ) { /* * Skip the initial directory delimiter. @@ -224,11 +173,6 @@ LispPTR COM_openfile(register LispPTR *args) char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; register int fatp, dskp, rval, fd, link_check_flg, flags, *bufp; struct stat sbuf; -#ifdef DOS - char drive[1]; /* Drive designator */ - int extlen; /* length of the raw file extension */ - char rawname[MAXNAMLEN]; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[5])); @@ -245,11 +189,7 @@ LispPTR COM_openfile(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) @@ -263,11 +203,7 @@ LispPTR COM_openfile(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else unixpathname(lfname, file, dskp, 0); -#endif /* * Set up the flags argument for open system call. @@ -469,14 +405,6 @@ LispPTR COM_openfile(register LispPTR *args) * The subjective file has already existed. We don't need * to maintain a version. */ -#ifdef DOS - if (args[1] == RECOG_NEW) { - char old[MAXPATHLEN]; - make_old_version(old, file); - unlink(old); - rename(file, old); /* make old version */ - } -#endif /* DOS */ } } @@ -559,138 +487,6 @@ LispPTR COM_openfile(register LispPTR *args) LispPTR COM_closefile(register LispPTR *args) { -#ifdef DOS - - register int fd, dskp, rval; - time_t cdate; - char lfname[MAXPATHLEN + 5], host[MAXNAMLEN]; - char file[MAXPATHLEN], dir[MAXPATHLEN], name[MAXNAMLEN + 1]; - char ver[VERSIONLEN], drive[1]; - struct find_t dirp; - int dp; - struct stat sbuf; - ino_t ino; - int extlen; - char rawname[MAXNAMLEN]; - - ERRSETJMP(NIL); - Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); - - LispStringLength(args[0], rval, dskp); - - /* - * Because of the version number convention, Lisp pathname might - * be shorter than UNIX one. For THIN string, the difference - * is 2 bytes, for FAT string, 4 bytes. Add 1 byte for NULL - * terminating character. - */ - rval = dskp ? rval + 4 + 1 : rval + 2 + 1; - /* Add five for the host name field in Lisp format. */ - if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); - - LispStringToCString(args[0], lfname, MAXPATHLEN); - - separate_host(lfname, host, drive); - - UPCASE(host); - if (strcmp(host, "DSK") == 0) - dskp = 1; - else if (strcmp(host, "UNIX") == 0) - dskp = 0; - else - return (NIL); - - /* - * Convert a Lisp file name to UNIX one. If host is DSK, we also have to - * convert a version field. - */ - dskp ? unixpathname(lfname, file, 1, 0, drive, &extlen, rawname) - : unixpathname(lfname, file, 0, 0, drive, &extlen, rawname); - fd = LispNumToCInt(args[1]); - cdate = (time_t)LispNumToCInt(args[2]); - if (!dskp) { - TIMEOUT(rval = fstat(fd, &sbuf)); - if (rval == -1) { - *Lisp_errno = errno; - return (NIL); - } - } - - if (cdate == 0) { - /* Just close. */ - TIMEOUT(rval = close(fd)); - if (rval == -1) { - if (!dskp && errno == EPERM && (sbuf.st_mode & S_IFREG) == 0) { - /* - * On {UNIX} device, closing a special file we are not - * the owner of it. Although I don't think close fails - * because of EPERM, in honor of Medley 1.1 code, I put - * this segment here. - */ - return (ATOM_T); - } else { - *Lisp_errno = errno; - return (NIL); - } - } else { - return (ATOM_T); - } - } - - if (!unpack_filename(file, dir, name, ver, 1)) return (NIL); - - if (dskp) { - /* - * On {DSK}, we have to make sure dir is case sensitively existing - * directory. - */ - if (true_name(dir) != -1) return (NIL); - - /* - * There is a very troublesome problem here. The file name Lisp - * recognizes is not always the same as the name which COM_openfile - * used to open the file. Sometimes COM_openfile uses the versionless - * file name to open a file, although Lisp always recognizes with - * *versioned* file name. - * Thus, we compare i-node number of the requested file with ones of all - * of files on the directory. This is time spending implementation. - * More clean up work is needed. - */ - TIMEOUT(rval = fstat(fd, &sbuf)); - if (rval != 0) { - *Lisp_errno = errno; - return (NIL); - } - ino = sbuf.st_ino; - TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp)); - if (rval < 0) { - *Lisp_errno = errno; - return (NIL); - } - - for (; rval == 0; S_TOUT(rval = _dos_findnext(&dirp))) { - sprintf(file, "%s\\%s", dir, dirp.name); - } - } -#ifndef DOS /* effectively NEVER, since we're in an ifdef DOS */ - time[0].tv_sec = (long)sbuf.st_atime; - time[0].tv_usec = 0L; - time[1].tv_sec = (long)ToUnixTime(cdate); - time[1].tv_usec = 0L; -#endif /* DOS */ - TIMEOUT(rval = close(fd)); - if (rval == -1) { - *Lisp_errno = errno; - return (NIL); - } -#ifndef DOS - TIMEOUT(rval = utimes(file, time)); - if (rval != 0) { - *Lisp_errno = errno; - return (NIL); - } -#endif /* DOS, internal */ -#else /* UNIX version of CLOSEFILE */ register int fd, fatp, dskp, rval; time_t cdate; char lfname[MAXPATHLEN + 5], host[MAXNAMLEN]; @@ -823,8 +619,6 @@ LispPTR COM_closefile(register LispPTR *args) return (NIL); } -#endif /* DOS */ - return (ATOM_T); } @@ -863,10 +657,6 @@ LispPTR DSK_getfilename(register LispPTR *args) char dir[MAXPATHLEN]; char name[MAXNAMLEN]; char ver[VERSIONLEN]; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -883,20 +673,12 @@ LispPTR DSK_getfilename(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_drive(lfname, drive); -#endif - /* * Convert a Lisp file name to UNIX one. This is a DSK device method. * Thus we have to convert a version field too. Third argument for * unixpathname specifies it. */ -#ifdef DOS - if (unixpathname(lfname, file, 1, 0, drive, &extlen, rawname) == 0) return (NIL); -#else if (unixpathname(lfname, file, 1, 0) == 0) return (NIL); -#endif if (unpack_filename(file, dir, name, ver, 1) == 0) return (NIL); @@ -942,9 +724,6 @@ LispPTR DSK_getfilename(register LispPTR *args) strcpy(vname, aname); dirp = 1; } else { -#ifdef DOS - strcpy(vname, aname); -#endif dirp = 0; } } @@ -982,9 +761,6 @@ LispPTR DSK_getfilename(register LispPTR *args) strcpy(vname, aname); dirp = 1; } else { -#ifdef DOS - strcpy(vname, aname); -#endif dirp = 0; } } @@ -1094,16 +870,6 @@ LispPTR DSK_getfilename(register LispPTR *args) * format. We have to convert it back to Lisp format. The version field * have to be converted. The fourth argument for lisppathname specifies it. */ -#ifdef DOS - /* For DOS, have to assure we use the name asked for, not the */ - /* faked-up oversion-0 name, so reported names match. */ - { - char dver[VERSIONLEN]; - separate_version(vname, dver, 0); - ConcDirAndName(dir, name, aname); - ConcNameAndVersion(aname, dver, vname); - } -#endif /* DOS */ if (lisppathname(vname, lfname, dirp, (dirp ? 0 : 1)) == 0) return (NIL); @@ -1144,10 +910,6 @@ LispPTR DSK_deletefile(register LispPTR *args) char dir[MAXPATHLEN], ver[VERSIONLEN]; int rval, fatp; register FileName *varray; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[1])); @@ -1163,12 +925,7 @@ LispPTR DSK_deletefile(register LispPTR *args) if (rval > MAXPATHLEN) FileNameTooLong(NIL); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive); - unixpathname(fbuf, file, 1, 0, drive, &extlen, rawname); -#else unixpathname(fbuf, file, 1, 0); -#endif if (unpack_filename(file, dir, fbuf, ver, 1) == 0) return (NIL); if (get_version_array(dir, fbuf, VersionArray, &VArrayInfo) == 0) return (NIL); @@ -1292,11 +1049,6 @@ LispPTR DSK_renamefile(register LispPTR *args) int rval, fatp; register int need_maintain_flg; register FileName *varray; -#ifdef DOS - char drive1[1], drive2[1]; - int extlen1, extlen2; /* len of extension */ - char rawname1[MAXNAMLEN], rawname2[MAXNAMLEN]; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[2])); @@ -1316,20 +1068,10 @@ LispPTR DSK_renamefile(register LispPTR *args) if (rval > MAXPATHLEN) FileNameTooLong(NIL); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive1); - unixpathname(fbuf, src, 1, 0, drive1, &extlen1, rawname1); -#else /* DOS */ unixpathname(fbuf, src, 1, 0); -#endif /* DOS */ LispStringToCString(args[1], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive2); - unixpathname(fbuf, dst, 1, 0, drive2, &extlen2, rawname2); -#else /* DOS */ unixpathname(fbuf, dst, 1, 0); -#endif /* DOS */ if (unpack_filename(dst, dir, fbuf, ver, 1) == 0) return (NIL); /* @@ -1515,10 +1257,6 @@ LispPTR DSK_directorynamep(register LispPTR *args) char fullname[MAXPATHLEN]; register int len, fatp; register char *base; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[2])); @@ -1537,12 +1275,7 @@ LispPTR DSK_directorynamep(register LispPTR *args) LispStringToCString(args[0], dirname, MAXPATHLEN); /* Convert Xerox Lisp file naming convention to Unix one. */ -#ifdef DOS - separate_drive(dirname, drive); - if (unixpathname(dirname, fullname, 1, 0, drive, 0, 0) == 0) return (NIL); -#else /* DOS*/ if (unixpathname(dirname, fullname, 1, 0) == 0) return (NIL); -#endif /* DOS */ if (true_name(fullname) != -1) return (NIL); @@ -1598,18 +1331,12 @@ LispPTR COM_getfileinfo(register LispPTR *args) { register int dskp, rval; register unsigned *bufp; -#ifndef DOS register struct passwd *pwd; -#endif register char *base; char lfname[MAXPATHLEN + 5], file[MAXPATHLEN], host[MAXNAMLEN]; char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; struct stat sbuf; LispPTR laddr; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -1626,11 +1353,7 @@ LispPTR COM_getfileinfo(register LispPTR *args) if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif UPCASE(host); if (strcmp(host, "DSK") == 0) @@ -1644,11 +1367,7 @@ LispPTR COM_getfileinfo(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else /* DOS */ unixpathname(lfname, file, dskp, 0); -#endif /* DOS */ /* * The file name which has been passed from Lisp is sometimes different @@ -1701,7 +1420,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) return (ATOM_T); case AUTHOR: -#ifndef DOS TIMEOUT(pwd = getpwuid(sbuf.st_uid)); if (pwd == (struct passwd *)NULL) { /* @@ -1718,7 +1436,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) #else StrNCpyFromCToLisp(base, pwd->pw_name, rval); #endif /* BYTESWAP */ -#endif /* DOS */ return (GetSmallp(rval)); case ALL: @@ -1746,7 +1463,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) laddr = cdr(car(cdr(cdr(cdr(args[2]))))); bufp = (unsigned *)(Addr68k_from_LADDR(laddr)); *bufp = sbuf.st_mode; -#ifndef DOS TIMEOUT(pwd = getpwuid(sbuf.st_uid)); if (pwd == (struct passwd *)NULL) { return (GetSmallp(0)); } laddr = cdr(car(cdr(cdr(cdr(cdr(args[2])))))); @@ -1757,7 +1473,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) #else StrNCpyFromCToLisp(base, pwd->pw_name, rval); #endif /* BYTESWAP */ -#endif /* DOS */ return (GetSmallp(rval)); default: return (NIL); @@ -1799,12 +1514,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) char lfname[MAXPATHLEN + 5], file[MAXPATHLEN], host[MAXNAMLEN]; char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; struct stat sbuf; -#ifndef DOS struct timeval time[2]; -#else - char drive[1], rawname[MAXNAMLEN]; - int extlen; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -1822,11 +1532,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -1839,11 +1545,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else /* DOS */ unixpathname(lfname, file, dskp, 0); -#endif /* DOS */ /* * The file name which has been passed from Lisp is sometimes different @@ -1868,14 +1570,12 @@ LispPTR COM_setfileinfo(register LispPTR *args) *Lisp_errno = errno; return (NIL); } -#ifndef DOS date = LispNumToCInt(args[2]); time[0].tv_sec = (long)sbuf.st_atime; time[0].tv_usec = 0L; time[1].tv_sec = (long)ToUnixTime(date); time[1].tv_usec = 0L; TIMEOUT(rval = utimes(file, time)); -#endif /* DOS */ if (rval != 0) { *Lisp_errno = errno; return (NIL); @@ -2103,11 +1803,7 @@ LispPTR COM_truncatefile(register LispPTR *args) return (ATOM_T); } if ((off_t)length != sbuf.st_size) { -#ifdef DOS - TIMEOUT(rval = chsize(fd, (off_t)length)); -#else TIMEOUT(rval = ftruncate(fd, (off_t)length)); -#endif /* DOS */ if (rval != 0) { *Lisp_errno = errno; return (NIL); @@ -2117,9 +1813,7 @@ LispPTR COM_truncatefile(register LispPTR *args) * TRUNCATEFILE FDEV method is invoked from FORCEOUTPUT Lisp function. * Thus we have to sync the file state here. */ -#ifndef DOS TIMEOUT(rval = fsync(fd)); -#endif if (rval != 0) { *Lisp_errno = errno; @@ -2150,10 +1844,6 @@ LispPTR COM_changedir(register LispPTR *args) { register int dskp, rval; char lfname[MAXPATHLEN + 5], dir[MAXPATHLEN], host[MAXNAMLEN]; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = &Dummy_errno; @@ -2170,11 +1860,7 @@ LispPTR COM_changedir(register LispPTR *args) if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -2183,11 +1869,7 @@ LispPTR COM_changedir(register LispPTR *args) else return (NIL); -#ifdef DOS - if (!unixpathname(lfname, dir, 0, 0, drive, 0, 0)) return (NIL); -#else /* DOS */ if (!unixpathname(lfname, dir, 0, 0)) return (NIL); -#endif /* DOS */ if (dskp) { /* @@ -2199,15 +1881,6 @@ LispPTR COM_changedir(register LispPTR *args) TIMEOUT(rval = chdir(dir)); if (rval != 0) return (NIL); -#ifdef DOS - if (*drive) { - if (*drive <= 'Z') - rval = _chdrive(*drive - ('A' - 1)); - else - rval = _chdrive(*drive - ('a' - 1)); - if (rval != 0) return (NIL); - } -#endif /* DOS */ return (ATOM_T); } @@ -2250,12 +1923,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) register int dskp, rval, *buf; char lfname[MAXPATHLEN + 5], dir[MAXPATHLEN], host[MAXNAMLEN]; char name[MAXNAMLEN + 1], file[MAXPATHLEN], ver[VERSIONLEN]; -#ifdef DOS - char drive[2]; - struct diskfree_t sfsbuf; -#else struct statvfs sfsbuf; -#endif ERRSETJMP(NIL); Lisp_errno = &Dummy_errno; @@ -2270,11 +1938,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); buf = (int *)(Addr68k_from_LADDR(args[1])); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -2283,11 +1947,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) else return (NIL); -#ifdef DOS - if (!unixpathname(lfname, file, 0, 0, drive, 0, 0)) return (NIL); -#else /* DOS */ if (!unixpathname(lfname, file, 0, 0)) return (NIL); -#endif /* DOS */ if (!unpack_filename(file, dir, name, ver, 0)) return (NIL); @@ -2304,30 +1964,12 @@ LispPTR COM_getfreeblock(register LispPTR *args) * we check the available block size, using the directory on which the file * will be exist. */ -#ifdef DOS - /* For DOS, we have to use either the disk drive the file - will be on, or the default drive. */ - - if (drive[0]) { - drive[1] = 0; - UPCASE(drive); - if (_dos_getdiskfree((unsigned)drive[0] - (int)'@', &sfsbuf)) - return (NIL); /* call failed, so name is invalid */ - - *buf = sfsbuf.avail_clusters * sfsbuf.sectors_per_cluster * sfsbuf.bytes_per_sector; - } else { - if (_dos_getdiskfree(0, &sfsbuf)) return (NIL); /* call failed, so name is invalid */ - - *buf = sfsbuf.avail_clusters * sfsbuf.sectors_per_cluster * sfsbuf.bytes_per_sector; - } -#else TIMEOUT(rval = statvfs(dir, &sfsbuf)); if (rval != 0) { *Lisp_errno = errno; return (NIL); } *buf = sfsbuf.f_bavail; -#endif /* DOS */ return (ATOM_T); } @@ -2451,17 +2093,7 @@ int unpack_filename(char *file, char *dir, char *name, char *ver, int checkp) { register char *cp; -#ifdef DOS - if ((cp = (char *)max((UNSIGNED)strrchr(file, DIRSEP), (UNSIGNED)strrchr(file, UNIXDIRSEP))) == 0) - return (0); - - if (file[1] == DRIVESEP) { /* There's a drive spec; copy it and ignore it from here on. */ - *dir++ = *file++; - *dir++ = *file++; - } -#else /* DOS */ if ((cp = (char *)strrchr(file, UNIXDIRSEP)) == NULL) return (0); -#endif /* DOS */ if (cp == file) { /* File is on a root directory. */ @@ -2502,23 +2134,11 @@ int true_name(register char *path) { char dir[MAXPATHLEN]; char name[MAXNAMLEN]; -#ifdef DOS - char drive[1]; -#endif register char *sp, *cp; register int type, c; if (strcmp(path, "/") == 0) return (-1); -#ifdef DOS - if (*(path + 1) == DRIVESEP) { - drive[0] = *path; - dir[0] = drive[0]; /* but copy it to the working dir string */ - dir[1] = DRIVESEP; - dir[2] = '\0'; - cp = path + 3; /* skip the drive spec & 1st dir delimiter */ - } else { -#endif /* DOS */ *dir = '\0'; /* * locate_file does not accept the directory with * the trail delimiter. Thus, for the root @@ -2526,9 +2146,6 @@ int true_name(register char *path) * as directory. */ cp = path + 1; -#ifdef DOS - } -#endif /* DOS */ /* If all there was was the root /, succeed easily */ if (strcmp((cp - 1), DIRSEPSTR) == 0) return (-1); @@ -2589,24 +2206,6 @@ int true_name(register char *path) static int locate_file(char *dir, char *name) { -#ifdef DOS - char path[MAXPATHLEN]; - char nb1[MAXNAMLEN], nb2[MAXNAMLEN]; - register int type, len; - struct find_t dirp; - struct direct *dp; - - /* First of all, recognize as if. */ - sprintf(path, "%s\\%s", dir, name); - DIR_OR_FILE_P(path, type); - if (type != 0) { - strcpy(dir, path); - return (type); - } - - return (0); - -#else /* UNIX code follows */ char path[MAXPATHLEN]; char nb1[MAXNAMLEN], nb2[MAXNAMLEN]; @@ -2669,7 +2268,6 @@ static int locate_file(char *dir, char *name) } TIMEOUT(closedir(dirp)); return (0); -#endif /* DOS */ } /* @@ -2700,21 +2298,11 @@ static int make_directory(register char *dir) dp = dir_buf; cp = dir; -#ifdef DOS - if (DRIVESEP == *(cp + 1)) { - *dp++ - *cp++; /* copy the drive letter and colon */ - *dp++ = *cp++; - } -#endif /* DOS */ - *dp++ = DIRSEP; /* For a root directory. */ cp++; /* Skip a root directory in dir. */ for (;;) { switch (*cp) { -#ifdef DOS - case DIRSEP: -#endif case '/': case '\0': *dp = '\0'; @@ -2727,11 +2315,7 @@ static int make_directory(register char *dir) * existing or not. */ if (maked) { -#ifdef DOS - TIMEOUT(rval = mkdir(dir_buf)); -#else TIMEOUT(rval = mkdir(dir_buf, 0777)); -#endif /* DOS */ if (rval == -1) { *Lisp_errno = errno; return (0); @@ -2768,11 +2352,7 @@ static int make_directory(register char *dir) /* * Should handle other cases. (special file). */ -#ifdef DOS - TIMEOUT(rval = mkdir(dir_buf)); -#else TIMEOUT(rval = mkdir(dir_buf, 0777)); -#endif /* DOS */ if (rval == -1) { *Lisp_errno = errno; return (0); @@ -2815,18 +2395,6 @@ static int make_directory(register char *dir) * !OnlyVersionlessP(varray)). * */ -#ifdef DOS -#define FindHighestVersion(varray, mentry, max_no) \ - { \ - register FileName *centry; \ - for (centry = varray, max_no = -1; centry->version_no != LASTVERSIONARRAY; centry++) { \ - if (centry->version_no > max_no) { \ - max_no = centry->version_no; \ - mentry = centry; \ - } \ - } \ - } -#else #define FindHighestVersion(varray, mentry, max_no) \ { \ register FileName *centry; \ @@ -2837,7 +2405,6 @@ static int make_directory(register char *dir) } \ } \ } -#endif /* DOS */ /* * Name: FindLowestVersion @@ -2863,18 +2430,6 @@ static int make_directory(register char *dir) * !OnlyVersionlessP(varray)). * */ -#ifdef DOS -#define FindLowestVersion(varray, mentry, min_no) \ - { \ - register FileName *centry; \ - for (centry = varray, min_no = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \ - if (centry->version_no < min_no) { \ - min_no = centry->version_no; \ - mentry = centry; \ - } \ - } \ - } -#else #define FindLowestVersion(varray, mentry, min_no) \ { \ register FileName *centry; \ @@ -2885,7 +2440,6 @@ static int make_directory(register char *dir) } \ } \ } -#endif /* DOS */ /* * Name: FindSpecifiedVersion @@ -2939,119 +2493,12 @@ static int make_directory(register char *dir) /* Read thru DIR and gather all files that match FILE into */ /* VARRAY. DIR's case must match existing directory's, but */ /* FILE name matching is case-insensitive. For UNIX, the */ -/* versionless file is marked with a version# of 0; for DOS, */ -/* version 0 is the back-up copy of the file. */ +/* versionless file is marked with a version# of 0 */ /* */ /************************************************************************/ static int get_version_array(char *dir, char *file, FileName *varray, CurrentVArray *cache) { -#ifdef DOS - - char lcased_file[MAXPATHLEN]; - char old_file[MAXPATHLEN]; - char name[MAXNAMLEN]; - char ver[VERSIONLEN]; - register FileName *svarray; - struct find_t dirp; - register struct direct *dp; - register int rval, drive = 0, isslash = 0; - struct stat sbuf; - int res; - - /* - * First of all, prepare a lower cased file name for the case insensitive - * search. Also we have to separate file name from its version field. - */ - if (dir[1] == DRIVESEP) drive = dir[0]; - - if (strcmp(dir, "\\") == 0) - isslash = 1; - else if (drive && (strcmp(dir + 2, "\\") == 0)) - isslash = 1; - - if (!isslash) - strcpy(lcased_file, dir); /* Only add the dir if it's real */ - else if (drive) { - lcased_file[0] = drive; - lcased_file[1] = DRIVESEP; - lcased_file[2] = '\0'; - } else - *lcased_file = '\0'; - - /* strcpy(lcased_file, dir); removed when above code added 3/4/93 */ - strcat(lcased_file, DIRSEPSTR); - strcat(lcased_file, file); - separate_version(lcased_file, ver, 1); - DOWNCASE(lcased_file); - - /*************************************************/ - /* First, look up the backup version of the file */ - /*************************************************/ - - /* First, make the "backup-file-name" for this file */ - - make_old_version(old_file, lcased_file); - - svarray = varray; - - TIMEOUT(res = _dos_findfirst(old_file, _A_NORMAL | _A_SUBDIR, &dirp)); - if (res == 0) { - strcpy(name, dirp.name); - strcpy(svarray->name, name); - svarray->version_no = 0; - svarray++; - } - - /*******************************/ - /* Now look up the file itself */ - /*******************************/ - - TIMEOUT(res = _dos_findfirst(lcased_file, _A_NORMAL | _A_SUBDIR, &dirp)); - /* if (res != 0) - { - *Lisp_errno = errno; - return(0); - } - */ - for (; res == 0; S_TOUT(res = _dos_findnext(&dirp))) { - strcpy(name, dirp.name); - separate_version(name, ver, 1); - DOWNCASE(name); - - strcpy(svarray->name, dirp.name); - if (*ver == '\0') { - /* Versionless file */ - svarray->version_no = 1; - } else { - /* - * separator_version guarantees ver is a numeric - * string. - */ - svarray->version_no = atoi(ver); - } - svarray++; - } - - /* - * The last entry of varray is indicated by setting LASTVERSIONARRAY into - * version_no field. - */ - svarray->version_no = LASTVERSIONARRAY; - - /* - * If more than one files have been stored in varray, we store the name - * without version in the last marker entry. - */ - if (!NoFileP(varray)) { - strcpy(name, varray->name); - separate_version(name, ver, 1); - strcpy(svarray->name, name); - } - - return (1); - -#else /* UNIX version-array builder */ char lcased_file[MAXNAMLEN]; char name[MAXNAMLEN]; @@ -3153,7 +2600,6 @@ static int get_version_array(char *dir, char *file, FileName *varray, CurrentVAr */ TIMEOUT(closedir(dirp)); return (1); -#endif /* DOS */ } /* @@ -3214,7 +2660,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * If forcep, we link the versionless file to the version * 1 file. */ -#ifndef DOS get_versionless(varray, vless, dir); ConcNameAndVersion(vless, "1", fname); TIMEOUT(rval = link(vless, fname)); @@ -3222,7 +2667,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ } return (1); } @@ -3244,7 +2688,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The versionless file should have the same case name as the old * file. */ -#ifndef DOS strcpy(fname, entry->name); separate_version(fname, ver, 1); ConcDirAndName(dir, fname, vless); @@ -3253,7 +2696,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } @@ -3271,14 +2713,12 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The old file should have the same case name as the versionless * file. */ -#ifndef DOS ConcNameAndVersion(vless, ver, old_file); TIMEOUT(rval = link(vless, old_file)); if (rval == -1) { *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } @@ -3306,7 +2746,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The versionless file should have the same case name as the old * file. */ -#ifndef DOS strcpy(fname, entry->name); separate_version(fname, ver, 1); ConcDirAndName(dir, fname, vless); @@ -3315,7 +2754,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } } @@ -3345,9 +2783,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) static int get_versionless(FileName *varray, char *file, char *dir) { -#ifdef DOS - return (0); -#endif /* DOS */ if (NoFileP(varray)) return (0); while (varray->version_no != LASTVERSIONARRAY) { @@ -3904,14 +3339,12 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) strcpy(name, afile); separate_version(name, ver, 1); -#ifndef DOS if (NoFileP(varray)) { /* * If there is no file with such name, "new" file is always * recognized. */ if (*ver == '\0' || strcmp(ver, "1") == 0) -#endif /* DOS */ { /* * If version is not specified or 1 is specified, @@ -3922,7 +3355,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) ConcDirAndName(dir, name, afile); return (1); } -#ifndef DOS else { /* * A version other than 1 is specified. "New" file @@ -4143,7 +3575,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) } } } -#endif /* DOS */ } /* diff --git a/src/dspif.c b/src/dspif.c index 81605d82..1e73a8af 100644 --- a/src/dspif.c +++ b/src/dspif.c @@ -32,53 +32,17 @@ extern DspInterface X_init(DspInterface dsp, char *lispbitmap, int width_hint, i int depth_hint); #endif /* XWINDOW */ -#ifdef DOS -extern int dosdisplaymode; -#endif /* DOS */ - void make_dsp_instance(DspInterface dsp, char *lispbitmap, int width_hint, int height_hint, int depth_hint) { -#ifdef DOS - - TPRINT(("Enter make_dsp_instance, dosdisplaymode is: %d\n", dosdisplaymode)); - - if (depth_hint == 0) depth_hint = 1; - - switch (dosdisplaymode) { - case 1: VGA_init(dsp, 0, 0, 0, depth_hint); break; - case 0x102: - case 0x104: VESA_init(dsp, 0, 0, 0, depth_hint); break; - default: - if (VESA_p()) { - VESA_init(dsp, 0, 0, 0, depth_hint); - } else if (VGA_p()) { - VGA_init(dsp, 0, 0, 0, depth_hint); - } else { /* Can't set *ANY* video mode! */ - (void)fprintf(stderr, "No portable graphics mode supported by this host.\n"); - (void)fprintf(stderr, "\n-Expected VESA or VGA.\n"); - exit(1); - } - break; - } - -#elif XWINDOW +#if XWINDOW /* lispbitmap is 0 when we call X_init the first time. */ if (X_init(dsp, 0, LispDisplayRequestedWidth, LispDisplayRequestedHeight, depth_hint) == NULL) { fprintf(stderr, "Can't open display."); exit(-1); } -#endif /* DOS | XWINDOW */ +#endif /* XWINDOW */ } /* Now we know the maximum capabilities of the hardware. */ -#ifdef DOS -VESA_p() { - /* Magic. Do a vesa call to determine the current mode. */ - return (VESA_call(3, 0)); -} - -VGA_p() { return (TRUE); } -#endif /* DOS */ - /*********************************************************************/ /* */ /* G e n e r i c R e t u r n T */ @@ -107,16 +71,7 @@ void describedsp(DspInterface dsp) { printf("colors= %lu\n", dsp->colors); printf("graphicsmode= %lu\n", dsp->graphicsmode); printf("numberofbanks= %lu\n", dsp->numberofbanks); -#ifdef DOS - printf("BytesPerLine= %d\n", dsp->BytesPerLine); - printf("DisplayStartAddr= %d\n", dsp->DisplayStartAddr); -#endif /* DOS */ printf("bitblt_to_screen= %p\n", dsp->bitblt_to_screen); printf("cleardisplay= %p\n", dsp->cleardisplay); -#ifdef DOS - printf("mouse_visible= %d\n", dsp->mouse_visible); - printf("mouse_invisible= %d\n", dsp->mouse_invisible); - printf("\n"); -#endif /* DOS */ fflush(stdout); } diff --git a/src/ether.c b/src/ether.c index 6b377c03..d85003ff 100644 --- a/src/ether.c +++ b/src/ether.c @@ -21,7 +21,6 @@ #include #include #include -#ifndef DOS #include #include #include @@ -59,7 +58,6 @@ #include #endif #include -#endif /* DOS */ #endif /* MAIKO_ENABLE_ETHERNET */ #include "commondefs.h" diff --git a/src/inet.c b/src/inet.c index e400b870..e1d1d83e 100644 --- a/src/inet.c +++ b/src/inet.c @@ -14,7 +14,6 @@ #include #include /* for mem... fns */ -#ifndef DOS #include #include #include @@ -26,7 +25,6 @@ #include #include #include -#endif /* DOS */ #if (defined(OS5) || defined(__CYGWIN__)) && !defined(O_ASYNC) /* Cygwin and Solaris don't define O_ASYNC, yet still define FASYNC. */ @@ -78,7 +76,6 @@ fd_set LispIOFds; LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, LispPTR bufaddr, LispPTR maxlen) { -#ifndef DOS int sock, len, buflen, res; unsigned ures; char namestring[100]; @@ -335,5 +332,4 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li default: return (NIL); break; } -#endif /* DOS */ } diff --git a/src/initdsp.c b/src/initdsp.c index 742d11a6..e0b20ebb 100644 --- a/src/initdsp.c +++ b/src/initdsp.c @@ -60,15 +60,12 @@ #include "xcursordefs.h" #endif -#ifdef DOS -#define getpagesize() 512 -#endif /* DOS */ - -#if defined(XWINDOW) || defined(DOS) +#if defined(XWINDOW) #include "devif.h" DLword *DisplayRegion68k_end_addr; extern DspInterface currentdsp; -#endif /* DOS */ +int DisplayWidth8; +#endif /* XWINDOW */ /* from /usr/include/sun/fbio.h some machines don't have following def. */ #ifndef FBTYPE_SUNROP_COLOR @@ -225,11 +222,6 @@ void clear_display() { #endif /* SUNDISPLAY */ -#ifdef DOS - TPRINT(("Enter Clear_display\n")); - (currentdsp->cleardisplay)(currentdsp); - TPRINT(("Exit Clear_display\n")); -#endif /* DOS */ } #else /* COLOR */ @@ -338,7 +330,7 @@ void init_display2(DLword *display_addr, int display_max) displayheight = my_screen.fb_height; #endif /* SUNDISPLAY */ -#if (defined(XWINDOW) || defined(DOS)) +#if defined(XWINDOW) (currentdsp->device.enter)(currentdsp); displaywidth = currentdsp->Display.width; displayheight = currentdsp->Display.height; @@ -524,11 +516,7 @@ void init_display2(DLword *display_addr, int display_max) DBPRINT(("after mem_point\n")); #endif /* SUNDISPLAY */ -#ifdef DOS - (currentdsp->cleardisplay)(currentdsp); -#else /* DOS */ clear_display(); -#endif /* DOS */ DBPRINT(("after clear_display()\n")); @@ -589,12 +577,12 @@ void display_before_exit() { #endif /* SUNDISPLAY */ -#if defined(XWINDOW) || defined(DOS) +#if defined(XWINDOW) (currentdsp->device.exit)(currentdsp); -#endif /* DOS */ +#endif /* XWINDOW */ } -#if defined(DISPLAYBUFFER) || defined(DOS) +#if defined(DISPLAYBUFFER) /************************************************************************/ /* */ /* i n _ d i s p l a y _ s e g m e n t */ @@ -636,12 +624,7 @@ void flush_display_buffer() { (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, currentdsp->Visible.x, currentdsp->Visible.y, currentdsp->Visible.width, currentdsp->Visible.height); -#elif DOS - TPRINT(("Enter flush_display_buffer\n")); - (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, 0, 0, currentdsp->Display.width, - currentdsp->Display.height); - TPRINT(("Exit flush_display_buffer\n")); -#endif /* DOS */ +#endif /* XWINDOW */ } /************************************************************************/ @@ -670,11 +653,11 @@ void flush_display_region(int x, int y, int w, int h) #endif /* SUNDISPLAY */ -#if (defined(XWINDOW) || defined(DOS)) +#if defined(XWINDOW) TPRINT(("Enter flush_display_region x=%d, y=%d, w=%d, h=%d\n", x, y, w, h)); (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, x, y, w, h); TPRINT(("Exit flush_display_region\n")); -#endif /* DOS */ +#endif /* XWINDOW */ } #ifdef BYTESWAP void byte_swapped_displayregion(int x, int y, int w, int h) @@ -720,11 +703,11 @@ void flush_display_lineregion(UNSIGNED x, DLword *ybase, UNSIGNED w, UNSIGNED h) #endif /* SUNDISPLAY */ -#if (defined(XWINDOW) || defined(DOS)) +#if defined(XWINDOW) TPRINT(("Enter flush_display_lineregion x=%d, y=%d, w=%d, h=%d\n", x, y, w, h)); (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, x, y, w, h); TPRINT(("Exit flush_display_lineregion\n")); -#endif /* DOS */ +#endif /* XWINDOW */ } /************************************************************************/ @@ -753,9 +736,9 @@ void flush_display_ptrregion(DLword *ybase, UNSIGNED bitoffset, UNSIGNED w, UNSI #if (defined(SUNDISPLAY) && defined(DISPLAYBUFFER)) pr_rop(ColorDisplayPixrect, x, y, w, h, COPY_PIXRECT_TO_COLOR, DisplayRegionPixrect, x, y); -#elif (defined(XWINDOW) || defined(DOS)) +#elif defined(XWINDOW) TPRINT(("Enter flush_display_ptrregion\n x=%d, y=%d, w=%d, h=%d\n", x, y, w, h)); (currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, x, y, w, h); TPRINT(("Exit flush_display_ptrregion\n")); -#endif /* DOS */ +#endif /* SUNDISPLAY & DISPLAYBUFFER, XWINDOW */ } diff --git a/src/initkbd.c b/src/initkbd.c index b138f78d..2af77f9a 100644 --- a/src/initkbd.c +++ b/src/initkbd.c @@ -17,19 +17,8 @@ #include #include -#ifndef DOS #include #include -#endif /* DOS */ - -#ifdef DOS -#include /* "#pragma interrupt" & '_chain_intr'*/ -#include /* defines REGS & other structs */ -#include /* define NULL */ -#include -#include -#include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -70,12 +59,6 @@ extern DspInterface currentdsp; #endif /* XWINDOW */ -#ifdef DOS -#include "devif.h" -extern MouseInterface currentmouse; -extern KbdInterface currentkbd; -extern DspInterface currentdsp; -#endif /* DOS */ #ifdef SUNDISPLAY extern struct screen LispScreen; #endif /* SUNDISPLAY */ @@ -243,20 +226,7 @@ void init_keyboard(int flg) /* if 0 init else re-init */ #elif XWINDOW init_Xevent(currentdsp); -#elif DOS - if (flg == 0) { /* Install the handlers ONLY when we */ - /* init the kbd the init the kbd the */ - /* first time. */ - - /* turn on kbd */ - make_kbd_instance(currentkbd); - (currentkbd->device.enter)(currentkbd); - - /* turn on mouse */ - make_mouse_instance(currentmouse); - (currentmouse->device.enter)(currentmouse, currentdsp); - } -#endif /* XWINDOW DOS */ +#endif /* SUNDISPLAY, XWINDOW */ } /* ----------------------------------------------------------------*/ @@ -277,10 +247,7 @@ void device_before_exit() { } close(LispKbdFd); -#elif DOS - (currentmouse->device.exit)(currentmouse, currentdsp); - (currentkbd->device.exit)(currentkbd); -#endif /* SUNDISPLAY DOS*/ +#endif /* SUNDISPLAY */ display_before_exit(); } @@ -340,7 +307,7 @@ void seteventmask(struct inputmask *eventmask) #define KB_DEC3100 (9 + MIN_KEYTYPE) /* TODO: Can we remove this? */ #define KB_HP9000 (10 + MIN_KEYTYPE) /* TODO: Can we remove this? */ #define KB_X (11 + MIN_KEYTYPE) -#define KB_DOS (12 + MIN_KEYTYPE) +#define KB_DOS (12 + MIN_KEYTYPE) /* TODO: Can we remove this? */ /* KB_SUN4 not defined in older OS versions */ #ifndef KB_SUN4 @@ -498,8 +465,6 @@ void keyboardtype(int fd) if ((key = getenv("LDEKBDTYPE")) == 0) { #ifdef XWINDOW type = KB_X; -#elif DOS - type = KB_DOS; #elif SUNDISPLAY if (ioctl(fd, KIOCTYPE, &type) != 0) { error("keyboardtype:IOCTL(KIOCTYPE) fails (cont. w. type-3"); @@ -557,12 +522,6 @@ void keyboardtype(int fd) break; #endif /* XWINDOW */ -#ifdef DOS - case KB_DOS: - SUNLispKeyMap = DOSLispKeyMap_101; - InterfacePage->devconfig |= KB_SUN3 - MIN_KEYTYPE; /* 10 */ - break; -#endif /* DOS */ default: { char errmsg[200]; sprintf(errmsg, "Unsupported keyboard type: %d", type); diff --git a/src/initsout.c b/src/initsout.c index 31d6d80a..79a3af2f 100644 --- a/src/initsout.c +++ b/src/initsout.c @@ -22,9 +22,7 @@ #include #include -#ifndef DOS #include -#endif #include "hdw_conf.h" #include "lispemul.h" @@ -143,15 +141,12 @@ void init_ifpage(int sysout_size) { #endif /* BIGVM */ /* unfortunately, Lisp only looks at a 16 bit serial number */ -#ifndef DOS InterfacePage->serialnumber = 0xffff & gethostid(); -#endif /* DOS */ /* get user name and stuff into vmem; this is the VMEM buffer; This is a BCPL string -- it starts with a length count. C strings are null terminated instead */ InterfacePage->usernameaddr = 0; -#ifndef DOS { struct passwd *pwd; char *s; @@ -175,7 +170,6 @@ are null terminated instead */ } } -#endif /* DOS */ /* Days from Oct-13-87 12:00 It's Takeshi's birthday. */ /* MDate may be set by vdate.c, generated by mkvdate.c. */ diff --git a/src/kbdif.c b/src/kbdif.c deleted file mode 100644 index b9458bb5..00000000 --- a/src/kbdif.c +++ /dev/null @@ -1,39 +0,0 @@ -/* $Id: kbdif.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -/* * K Y E B O A R D I N T E R F A C E * */ - -#include "lispemul.h" -#include "dbprint.h" -#include "devif.h" - -KbdInterfaceRec curkbd; -KbdInterface currentkbd = &curkbd; - -#ifdef DOS -extern void Kbd_event(); -extern void EnterDosKbd(); -extern void ExitDosKbd(); -extern unsigned long GenericReturnT(); -#endif /* DOS */ - -void make_kbd_instance(KbdInterface kbd) { -#ifdef DOS - kbd->device_event = &Kbd_event; /* */ - kbd->device.enter = &EnterDosKbd; - kbd->device.exit = &ExitDosKbd; - kbd->device.before_raid = &ExitDosKbd; - kbd->device.after_raid = &EnterDosKbd; - kbd->device.active = FALSE; -#elif XWINDOW -#endif /* DOS or XWINDOW */ -} diff --git a/src/kbdsubrs.c b/src/kbdsubrs.c index 8f724c06..ca939199 100644 --- a/src/kbdsubrs.c +++ b/src/kbdsubrs.c @@ -12,15 +12,10 @@ #include #include -#ifdef DOS -#include -#include -#else #include #include #include #include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -37,16 +32,11 @@ #include "xwinmandefs.h" #endif -#ifdef DOS -#define PORT_A 0x60 +#if XWINDOW #include "devif.h" extern KbdInterface currentkbd; extern DspInterface currentdsp; -#elif XWINDOW -#include "devif.h" -extern KbdInterface currentkbd; -extern DspInterface currentdsp; -#endif /* DOS */ +#endif /* XWINDOW */ /**************************************************** * @@ -76,17 +66,13 @@ void KB_enable(LispPTR *args) /* args[0] : ON/OFF flag FD_SET(LispWindowFd, &LispReadFds); #elif XWINDOW enable_Xkeyboard(currentdsp); -#elif DOS - (currentkbd->device.enter)(currentkbd); -#endif /* DOS */ +#endif /* SUNDISPLAY, XWINDOW */ } else if (args[0] == NIL) { #ifdef SUNDISPLAY FD_CLR(LispWindowFd, &LispReadFds); #elif XWINDOW disable_Xkeyboard(currentdsp); -#elif DOS - (currentkbd->device.exit)(currentkbd); -#endif /* DOS */ +#endif /* SUNDISPLAY, XWINDOW */ } else { error("KB_enable: illegal arg \n"); printf("KB_enable: arg = %d\n", args[0]); @@ -106,10 +92,6 @@ struct timeval belltime ={ */ extern int LispKbdFd; -#ifdef DOS -int bell_status_word; -#endif /* DOS */ - void KB_beep(LispPTR *args) /* args[0] : ON/OFF flag * T -- ON * NIL -- OFF @@ -139,22 +121,7 @@ void KB_beep(LispPTR *args) /* args[0] : ON/OFF flag #elif XWINDOW if (args[0] == ATOM_T) beep_Xkeyboard(currentdsp); -#elif DOS - if (args[0] == ATOM_T) { - bell_status_word = inp(0x61); - outp(0x61, bell_status_word | 0x3); /* Turn on the speaker */ - /* Prepare timer by sending 10111100 to port 43. */ - outp(0x43, 0xb6); - - /* Divide input frequency by timer ticks per second and - * write (byte by byte) to timer. */ - outp(0x42, (char)(1193180L / (LispIntToCInt(args[1])))); - outp(0x42, (char)(1193180L / (LispIntToCInt(args[1])) >> 8)); - } else { - outp(0x61, bell_status_word & ~0x3); /* Turn off the speaker (with */ - /* bits 0 and 1). */ - } -#endif /* SUNDISPLAY, XWINDOW, DOS */ +#endif /* SUNDISPLAY, XWINDOW */ } /**************************************************** @@ -185,9 +152,4 @@ void KB_setmp(LispPTR *args) /* args[0] : MPCODE */ void KB_setled(LispPTR *args) { -#ifdef DOS - outp(PORT_A, (unsigned char)0xED); - outp(PORT_A, - (unsigned char)(((args[0] != NIL) << 2) | ((args[1] != NIL) << 1) | (args[2] != NIL))); -#endif /* DOS */ } diff --git a/src/keyevent.c b/src/keyevent.c index 0d0a2855..c47c11be 100644 --- a/src/keyevent.c +++ b/src/keyevent.c @@ -20,31 +20,17 @@ #include #include #include -#ifndef DOS #include #include #include #include -#else -#include -#endif /* DOS */ -#ifdef DOS - -#include /* Defines "#pragma interrupt" */ -#include /* Defines REGS & other structs */ -#include /* _XSTACK struct definition */ -#pragma interrupt(Mouse_hndlr) - -void Mouse_hndlr(void); /* Fields mouse events from driver */ - /* (during servicing of mouse interrupt) */ - -#elif SUNDISPLAY +#if SUNDISPLAY #include #include #include #include #include -#endif /* DOS */ +#endif /* SUNDISPLAY */ #include "lispemul.h" #include "lspglob.h" @@ -71,11 +57,11 @@ void Mouse_hndlr(void); /* Fields mouse events from driver */ #endif /* MAIKO_ENABLE_ETHERNET */ #include "dbprint.h" -#if (defined(DOS) || defined(XWINDOW)) +#if defined(XWINDOW) #include "devif.h" extern DspInterface currentdsp; extern IOPAGE *IOPage68K; -#endif /* DOS */ +#endif /* XWINDOW */ /* for contextsw */ #define AS_OPCODE 1 @@ -134,9 +120,7 @@ extern int ether_fd; extern DLword *DisplayRegion68k; -#ifndef DOS static struct timeval SelectTimeout = {0, 0}; -#endif /* DOS */ #ifdef XWINDOW extern volatile sig_atomic_t Event_Req; @@ -282,7 +266,6 @@ DLword ColorCursor_savebitmap[CURSORWIDTH / COLORPIXELS_IN_DLWORD * CURSORHEIGHT void getsignaldata(int sig) { -#ifndef DOS #ifdef SUNDISPLAY struct inputevent event; #endif /* SUNDISPLAY */ @@ -377,7 +360,6 @@ void getsignaldata(int sig) } } /* #endif */ -#endif /* DOS */ } /* end getsignaldata */ #ifdef SUNDISPLAY @@ -580,9 +562,6 @@ void taking_mouse_down() { static int sx, dx, w, h, srcbpl, dstbpl, backwardflg = 0; static int src_comp = 0, op = 0, gray = 0, num_gray = 0, curr_gray_line = 0; -#ifdef DOS - (currentdsp->mouse_invisible)(currentdsp, IOPage68K); -#else if (!DisplayInitialized) return; /* restore saved image */ @@ -599,7 +578,6 @@ void taking_mouse_down() { #ifdef DISPLAYBUFFER flush_display_region(dx, (LastCursorY), w, h); #endif /* DISPLAYBUFFER */ -#endif /* DOS */ } #else @@ -733,9 +711,6 @@ void copy_cursor(int newx, int newy) /* I'll make it MACRO */ void taking_mouse_up(int newx, int newy) { -#ifdef DOS - (currentdsp->mouse_visible)(newx, newy); -#else if (!DisplayInitialized) return; /* save hidden bitmap */ cursor_hidden_bitmap(newx, newy); @@ -745,7 +720,6 @@ void taking_mouse_up(int newx, int newy) #endif LastCursorX = newx; LastCursorY = newy; -#endif } /* store bitmap image inside rect. which specified by x,y */ diff --git a/src/launch.asm b/src/launch.asm deleted file mode 100644 index 36d2841f..00000000 --- a/src/launch.asm +++ /dev/null @@ -1,358 +0,0 @@ -;; # @(#) launch.asm Version 1.1 (12/29/94). Copyright Venue # -;************************************************************************ -;* * -;* l a u n c h . a s m * -;* * -;* This is the launcher for Medley on DOS. It: * -;* * -;* * Looks for and validates any -m memsize argument on the * -;* command line. Only values in the range 8 - 32 are allowed. * -;* * -;* * Loads the real Medley emulator, emul.exe, from the same * -;* directory that the launcher came from. * -;* * -;* * Sets the Intel DOS Extender's profile to the requested * -;* memory size + 3Mb (to allow for the emulator, internal * -;* data areas, etc.) * -;* * -;* * Set the termination address in the child process's PSP, * -;* so control returns to the launcher when Medley terminates. * -;* * -;* * Jumps to the emulator's start address. * -;* * -;* * Upon return, just terminates cleanly. * -;* * -;* [We could perhaps do some diagnosis here of error returns?] * -;* * -;* * -;* * -;************************************************************************ - -;************************************************************************/ -;* */ -;* (C) Copyright 1993, 1994 Venue. All Rights Reserved. */ -;* Manufactured in the United States of America. */ -;* */ -;************************************************************************/ - -.model small -.386p -.stack 100h -.data - align 8 - ;******************************************************** - ;* Parameter block for INT 214B, that loads medley.exe * - ;******************************************************** -envseg DW 0 ; environment (0 = copy mine) -cmdip DW ? ; command-line-tail pointer -cmdcs DW ? -fcb1 DD ? ; dummy first FCB to fill in -fcb2 DD ? ; " 2nd FCB, not here in DOS 4.01??? -stk DD ? ; SS:SP for emul.exe, filled in by loader -csip DD ? ; start addr for emul.exe, filled in by loader - - - -retad DD FAR PTR myret ; cs:ip return address, to put in - ; child PSP, so we get control back. - - - ;* Error messages, misc strings, and work areas* - align 8 -memval dd 0 -errstg DB 'ERROR: Couldn''t free excess storage.',13,10,'$' -noload db 'ERROR: Loading emulator failed: $' -loaded db 'LOAD SUCCESSFUL.',13,10,'$' -nominfo db 'ERROR: -m must be followed by a number 8 - 64.',13,10,'$' -badexe db 'ERROR: emul.exe is corrupted.',13,10,'$' -emulpath DB 'emul.exe',0 ; name of the real emulator. -mflag db '-m' ; to search for -m/-M in cmd line -mmflag db '-M' -profile db 'PRO' ; to find the DOS extender profile -cmdline db 128 dup (?) ; hold the cmd line tail for real emulator - - ;* Error-message table for failures loading emul.exe - align 2 -errtbl dw OFFSET ng0msg ; 0 = unknown failure - dw OFFSET ng1msg ; 1 = "invalid function" - dw OFFSET ng2msg ; 2 = file not found - dw OFFSET ng3msg ; 3 = path not found - dw OFFSET ng4msg ; 4 = too many open files - dw OFFSET ng5msg ; 5 = access denied - dw OFFSET ng0msg ; 6 = not possible error - dw OFFSET ng0msg ; 7 = not possible error - dw OFFSET ng8msg ; 8 = insufficient storage - dw OFFSET ng0msg ; 9 = not possible - dw OFFSET ngamsg ; A = bad environment - dw OFFSET ngbmsg ; B = bad format (corrupt .exe?)a - -ng0msg db 'Unknown problem',13,10,'$' -ng1msg db 'Invalid Function',13,10 - db 'Make sure you are running DOS 4.0 or later.',13,10,'$' -ng2msg db 'File not found.',13,10 - db 'CD to proper directory, or set PATH.',13,10,'$' -ng3msg db 'Path not found.',13,10 - db 'CD to proper directory, or set PATH.',13,10,'$' -ng4msg db 'Too many files open.',13,10 - db 'Shut down some TSRs that have file open?',13,10,'$' -ng5msg db 'Access denied.',13,10 - db 'Make sure of your access rights to emul.exe?',13,10,'$' -ng8msg db 'Not enough memory.',13,10 - db 'Shut down some TSR applications?',13,10,'$' -ngamsg db 'Environment corrupt.',13,10 - db 'Check using SET; You may need to re-boot.',13,10,'$' -ngbmsg db 'EXE file corrupted.',13,10,'$' - db 'You may need to restore from backup or re-install.',13,10,'$' -.code - - - -;************************************************************************ -;* * -;* M A C R O S * -;* * -;* prints Given a string ptr in DX, print it to the display. * -;* * -;* kill Exit cleanly, using INT 21/4C * -;* * -;************************************************************************ - -prints macro text - mov dx, OFFSET text - mov ah,9 - int 21h - endm - -kill macro - mov ah,4ch - int 21h - endm - - - -;************************************************************************ -;* * -;* M A I N E N T R Y * -;* * -;* * -;* * -;* * -;* * -;************************************************************************ - -PUBLIC main -main PROC NEAR - - mov ax,ds ; Save memory-block start for freeing - mov es,ax ; excess memory in a bit. - - mov ax,@data ; DS points to start of data segment - mov ds,ax - - mov cmdcs, ax ; Copy the command line for the emulator - mov cmdip, OFFSET cmdline - - mov di, OFFSET cmdline - mov cx,128 - mov bx,es - mov dx,ds - mov es,dx - mov ds,bx - mov si,80h - - rep - movsb - - mov es,bx ; Free the excess memory that DOS gives - mov ds,dx ; us (we need it for the emulator) - - mov ax,4a00h - mov bx,090h ; We only need 900h bytes for this program - int 21h - jnc freeok - - prints errstg ; Couldn't free spare space; punt. - kill - - ;************************************************ - ;* Search the command line for -m or -M * - ;************************************************ -freeok: - mov di,81h ; start of command line tail - mov si, OFFSET mflag - mov cx, 2 - - mov bx,81h - add bl,es:[80h] - -m1lp: call strcmp - je fndm - - add di, 1 - cmp di, bx - jl m1lp - - mov di,81h ; start of command line tail - mov si, OFFSET mmflag - -m2lp: call strcmp - je fndm - - add di, 1 - cmp di, bx - jl m2lp - - mov memval,02400000h ; memory value not set--use 35MB total. - jmp doload - -fndm: add di,2 ; Found "-m". Now look for a number - cmp di,bx ; (Make sure it's not end of line) - jnl nogoodm - -ok1: - mov edx, 0 ; Holds the memory-requirement value - mov ax,0 ; holds characters as we read - - ;************************************************ - ;* Skip over spaces/tabs before any number * - ;************************************************ -skiplp: - mov al, es:[di] - inc di - cmp al, 20h ; spaces - je skiplp - cmp al, 09h ; tabs - je skiplp - cmp di,bx ; make sure we're still in the string - jle cnvst ; Yup, we've got the first char, so enter - ; the conversion loop part-way down. - -nogoodm: - prints nominfo ; no arg to -m, or it's bad; Punt. - kill - - ;******************************************************** - ; Convert the numeric argument to -m; result in edx. * - ;******************************************************** -cnvlp: mov al,es:[di] - add di, 1 -cnvst: cmp al, 30h - jl endcnv - cmp al, 39h - jg endcnv - sub al, 30h - imul dx, 10 - add dx, ax - jmp cnvlp - -endcnv: - cmp edx,0 ; if still 0, no valid chars! - je nogoodm - cmp edx, 8 ; must be in the range [8, 32] - jl nogoodm - cmp edx,64 - jg nogoodm - - add edx, 3 ; add 3mb for data areas, etc, and - sal edx, 20 ; convert to megabytes - mov memval, edx ; save memory requested - - ;************************************************ - ;* Load the real emulator .EXE file, emul.exe * - ;************************************************ -doload: mov dx, OFFSET emulpath - mov ax, seg envseg - mov es, ax - mov bx, OFFSET envseg - mov ax,4b01h ; load-don't-start - int 21h - jnc loadok - - add ax,ax - mov si,ax - prints noload - mov bx,OFFSET errtbl - mov dx,ds:[bx+si] - mov ah,9 - int 21h - kill - -loadok: ; Load succeeded. - mov ah,51h ; get PSP address for child - int 21h - mov es, bx ; get segment for DI addressing - -; mov cx,128 ; copy the command line tail -; mov di,80h ; (which appears to be flaky in DOS 4) -; mov si, offset cmdline -; rep -; movsb - - mov eax,retad - mov dword ptr es:[+0ah], eax ; set up return address. - - cmp memval, 0 ; If no -m value given, just - je dorun ; go start the emulator. - - mov di,0 ; Search for the Intel Extender's PROFILE - mov si, OFFSET profile ; (see extender.h) - mov cx, 3 ; (length is 3 bytes) - -srchlp: call strcmp - je gotprof ; found the profile; fix it. - add di, 1 - cmp di, 2048 - jle srchlp - - prints badexe ; No extender profile, so the emulator - kill ; EXE must be corrupt. Punt. - -gotprof: - mov eax,memval ; Fill in the memory requirement. - mov es:[di+1bch], eax - -;******************************************************** -;* * -;* Set up the stack seg/pointer & start medley. * -;* * -;******************************************************** -dorun: lss sp,stk ; load stack SS & SP regs - mov ax, es ; copy PSP ptr to ax & ds, since some - mov bx, ds ; code expects it in both places. - mov fs,bx ; Also, copy DS to FS, so we still have - mov ds,ax ; a base for the indirect jump . . . - jmp fs:[csip] ; to start-of-medley. - -myret: kill ; we get back here, so quit gracefully. - -main endp - - - -;************************************************************************/ -;* */ -;* s t r c m p */ -;* */ -;* Compare [ds]di and es:[si] for (CX) characters. If the */ -;* strings are equal, the Zero flag is set when this returns. */ -;* */ -;* All registers are preserved. */ -;* */ -;************************************************************************/ - -strcmp proc near - cld - push di - push si - push cx - - repe - cmpsb - - pop cx - pop si - pop di - ret -strcmp endp - -END diff --git a/src/ldsout.c b/src/ldsout.c index 27e3bb96..697387d8 100644 --- a/src/ldsout.c +++ b/src/ldsout.c @@ -50,10 +50,10 @@ int Storage_expanded; /* T or NIL */ /* Load the sysout file into memory. */ /* */ /************************************************************************/ -#if defined(DOS) || defined(XWINDOW) +#if defined(XWINDOW) #include "devif.h" extern DspInterface currentdsp; -#endif /* DOS || XWINDOW */ +#endif /* XWINDOW */ /* sys_size is sysout size in megabytes */ int sysout_loader(const char *sysout_file_name, int sys_size) { @@ -153,16 +153,10 @@ int sysout_loader(const char *sysout_file_name, int sys_size) { "\nsysout loader: Error, secondary space in use. You can't specify size.\nProcess " "size = %d\nSys size = %d\n", ifpage.process_size, sys_size); -#ifdef DOS - /* Note that we have an initialized display by now. */ - /* Hence we have to observe the display protocol. */ - VESA_errorexit(tmp); -#else fprintf(stderr, "sysout_loader: You can't specify the process size.\n"); fprintf(stderr, "Because, secondary space is already used.\n"); fprintf(stderr, "(size is %d, you specified %d.)\n", ifpage.process_size, sys_size); exit(-1); -#endif /* DOS */ } /*Can use this sys_size as the process size */ /* The sys_size should be same as the previous one */ @@ -279,28 +273,6 @@ int sysout_loader(const char *sysout_file_name, int sys_size) { /* read sysout file to lispworld */ for (i = 0; i < (sysout_size / 2); i++) { -#ifdef DOS - /* Dial that floats from left to right on the top line of the */ - /* displaty. Dial shows % of sysout loaded by digits and */ - /* position. */ - int columns; - switch (currentdsp->graphicsmode) { - case 0x104: - columns = 120; /* 131 - 10 */ - break; - case 0x102: - columns = 69; /* 79 - 10 */ - break; - default: - columns = 69; /* 79 - 10 */ - break; - } - _settextposition((short)0, (short)0); - if ((i & 0xf) == 0) { - for (int j = 0; j < (columns * i) / (sysout_size >> 1); j++) putchar(' '); - printf("-=(%2d%%)=-\n", (100 * i) / (sysout_size >> 1)); - } -#endif /* DOS */ if (GETPAGEOK(fptovp, i) != 0177777) { if (lseek(sysout, i * BYTESPER_PAGE, SEEK_SET) == -1) { perror("sysout_loader: can't seek sysout file"); @@ -327,11 +299,11 @@ int sysout_loader(const char *sysout_file_name, int sys_size) { free(fptovp); DBPRINT(("sysout file is read completely.\n")); -#if (defined(DISPLAYBUFFER) || defined(XWINDOW) || defined(DOS)) +#if defined(DISPLAYBUFFER) || defined(XWINDOW) TPRINT(("Flushing display buffer...\n")); flush_display_buffer(); TPRINT(("After Flushing display buffer\n")); -#endif /* DISPLAYBUFFER || XWINDOW || DOS */ +#endif /* DISPLAYBUFFER || XWINDOW */ close(sysout); return (sys_size); diff --git a/src/lpsolve.c b/src/lpsolve.c index 21ff1d17..71e3b4c8 100644 --- a/src/lpsolve.c +++ b/src/lpsolve.c @@ -16,15 +16,8 @@ #include "lispemul.h" -#ifdef DOS -#include "devif.h" -#endif /* DOS */ - extern int KBDEventFlg; extern int *KEYBUFFERING68k; -#ifdef DOS -extern MouseInterface currentmouse; -#endif /* DOS */ /* Globals used by solver */ short JustInverted; @@ -942,10 +935,6 @@ int milpsolve(sstate *st, REAL *upbo, REAL *lowbo, short *sbasis, short *slower, return (TIMEOUT); /* Time out every 100 LP solves */ else if ((KBDEventFlg > 0) && *KEYBUFFERING68k == ATOM_T) return (TIMEOUT); /* Time out on key/mouse clicks */ -#ifdef DOS - else if (currentmouse->Cursor.Moved) - return (TIMEOUT); /* Time out if mouse moves in DOS */ -#endif /* DOS */ if (Break_bb) return (BREAK_BB); Level++; diff --git a/src/main.c b/src/main.c index 6c342a3d..bf47f0cd 100644 --- a/src/main.c +++ b/src/main.c @@ -25,15 +25,9 @@ #include #include -#ifndef DOS #include #include #include -#else /* DOS */ -#include -#define MAXPATHLEN 128 -#define R_OK 04 -#endif /* DOS */ #ifdef MAIKO_ENABLE_ETHERNET #if defined(USE_NIT) @@ -248,38 +242,15 @@ int sysout_size = 0; /* ditto */ int flushing = FALSE; /* see dbprint.h if set, all debug/trace printing will call fflush(stdout) after each printf */ -#if defined(DOS) || defined(XWINDOW) +#if defined(XWINDOW) #include "devif.h" extern DspInterface currentdsp; -#endif /* DOS || XWINDOW */ +#endif /* XWINDOW */ extern time_t MDate; extern int nokbdflag; extern int nomouseflag; -#ifdef DOS -extern void dispatch(); - -int dosdisplaymode = 0; -int twobuttonflag = FALSE; -int eurokbd = TRUE; /* Assume eurokbd by default. */ -const char *helpstring = - "\n\ -medley [sysout-name] [] ...\n\ -Where are:\n\ - sysout-name The filename of your sysout.(see manual.)\n\ - -m Virtual memory size in Mega Bytes(from 8 to 32)\n\ - -vga Use standard VGA 640x480 screen resolution\n\ - -vesa102 Use VESA 800x600 screen resolution\n\ - -vesa104 Use VESA 1024x768 screen resolution\n\ - -2button Force two button mouse handling\n\ - -3button Force three button mouse handling\n\ - -noeurokbd Force old style kbd handling (for 2.0 and earlier sysouts)\n\ - -eurokbd Force new style kbd handling (for 2.01 and later sysouts)\n\ - -nokbd Turn the kbd handling off (for debugging only)\n\ - -nomouse Turn the mouse handling off (for debugging only)\n\ - -info Print general info about the system\n\ - -help Print this message\n"; -#elif XWINDOW +#if XWINDOW const char *helpstring = "\n\ either setenv LDESRCESYSOUT or do:\n\ @@ -290,14 +261,14 @@ const char *helpstring = -bw The Medley screen borderwidth\n\ -g[eometry] ] The Medley screen geometry\n\ -sc[reen] x] The Medley screen geometry\n"; -#else /* not DOS, not XWINDOW */ +#else /* not XWINDOW */ const char *helpstring = "\n\ either setenv LDESRCESYSOUT or do:\n\ lde[ether] [sysout-name] []\n\ -info Print general info about the system\n\ -help Print this message\n"; -#endif /* DOS */ +#endif /* XWINDOW */ /************************************************************************/ /* */ @@ -360,11 +331,7 @@ int main(int argc, char *argv[]) strncpy(sysout_name, envname, MAXPATHLEN); } else if ((envname = getenv("LDESOURCESYSOUT")) != NULL) strncpy(sysout_name, envname, MAXPATHLEN); -#ifdef DOS - else if (!makepathname("lisp.vm", sysout_name) -#else else if (!makepathname("~/lisp.virtualmem", sysout_name) -#endif /* DOS */ || access(sysout_name, R_OK)) { fprintf(stderr, "Couldn't find a sysout to run;\n"); fprintf(stderr, "%s", helpstring); @@ -401,28 +368,6 @@ int main(int argc, char *argv[]) else if (!strcmp(argv[i], "-INIT")) { /*** init sysout, no packaged */ for_makeinit = 1; } -#ifdef DOS - else if ((strcmp(argv[i], "-vga") == 0) || (strcmp(argv[i], "-VGA") == 0)) { - dosdisplaymode = 1; - } else if ((strcmp(argv[i], "-vesa102") == 0) || (strcmp(argv[i], "-VESA102") == 0)) { - dosdisplaymode = 0x102; - } else if ((strcmp(argv[i], "-vesa104") == 0) || (strcmp(argv[i], "-VESA104") == 0)) { - dosdisplaymode = 0x104; - } else if ((strcmp(argv[i], "-2button") == 0) || (strcmp(argv[i], "-2BUTTON") == 0)) { - twobuttonflag = TRUE; - } else if ((strcmp(argv[i], "-3button") == 0) || (strcmp(argv[i], "-3BUTTON") == 0)) { - twobuttonflag = FALSE; - } else if ((strcmp(argv[i], "-noeurokbd") == 0) || (strcmp(argv[i], "-NOEUROKBD") == 0)) { - eurokbd = FALSE; - } else if ((strcmp(argv[i], "-eurokbd") == 0) || (strcmp(argv[i], "-EUROKBD") == 0)) { - eurokbd = TRUE; - } else if ((strcmp(argv[i], "-nokbd") == 0) || (strcmp(argv[i], "-NOKBD") == 0)) { - nokbdflag = TRUE; - } else if ((strcmp(argv[i], "-nomouse") == 0) || (strcmp(argv[i], "-NOMOUSE") == 0)) { - nomouseflag = TRUE; - } - -#endif /* DOS */ /* Can only do this under SUNOs, for now */ else if (!strcmp(argv[i], "-E")) { /**** ethernet info ****/ @@ -463,14 +408,10 @@ int main(int argc, char *argv[]) } /* Sanity checks. */ -#ifdef DOS - probemouse(); /* See if the mouse is connected. */ -#else if (getuid() != geteuid()) { fprintf(stderr, "Effective user is not real user. Setting euid to uid.\n"); seteuid(getuid()); } -#endif /* DOS */ FD_ZERO(&LispReadFds); @@ -478,9 +419,6 @@ int main(int argc, char *argv[]) init_ether(); /* modified by kiuchi Nov. 4 */ #endif /* MAIKO_ENABLE_ETHERNET */ -#ifdef DOS - init_host_filesystem(); -#else /* Fork Unix was called in kickstarter; if we forked, look up the */ /* pipe handles to the subprocess and set them up. */ @@ -488,11 +426,10 @@ int main(int argc, char *argv[]) { /* in case we're re-starting a savevm w/open ptys */ if (please_fork) fprintf(stderr, "Failed to find UNIXCOMM file handles; no processes\n"); } -#endif /* DOS */ -#if defined(DOS) || defined(XWINDOW) +#if defined(XWINDOW) make_dsp_instance(currentdsp, 0, 0, 0, 1); /* All defaults the first time */ -#endif /* DOS || XWINDOW */ +#endif /* XWINDOW */ /* Load sysout to VM space and returns real sysout_size(not 0) */ sysout_size = sysout_loader(sysout_name, sysout_size); @@ -527,13 +464,6 @@ int main(int argc, char *argv[]) JDS -- 1/18/90 also BITBLTSUB does it now. */ } -#ifdef DOS - _setrealmode(0x3f); /* Don't interrupt on FP overflows */ - _getrealerror(); - - tzset(); -#endif - #ifdef OS5 tzset(); #endif /* OS5 */ @@ -589,9 +519,6 @@ void start_lisp() { /* entering the bytecode dispatch loop; interrupts get */ /* unblocked here */ int_init(); -#ifdef DOS - _dpmi_lockregion((void *)&dispatch, 32768); -#endif /* DOS */ dispatch(); } @@ -638,18 +565,12 @@ int makepathname(char *src, char *dst) ERRSETJMP(0); if (*(base + 1) == '/') { /* path is "~/foo" */ -#ifdef DOS - pwd = 0; -#else TIMEOUT(pwd = getpwuid(getuid())); -#endif /* DOS */ if (pwd == NULL) { *Lisp_errno = errno; return (0); } -#ifndef DOS sprintf(dst, "%s%s", pwd->pw_dir, base + 1); -#endif return (1); } else { /* path is "~foo/" */ @@ -659,16 +580,12 @@ int makepathname(char *src, char *dst) len = (UNSIGNED)cp - (UNSIGNED)base - 1; strncpy(name, base + 1, len); name[len] = '\0'; -#ifndef DOS TIMEOUT(pwd = getpwnam(name)); -#endif /* DOS */ if (pwd == NULL) { *Lisp_errno = errno; return (0); } -#ifndef DOS sprintf(dst, "%s%s", pwd->pw_dir, cp); -#endif /* DOS */ return (1); } } diff --git a/src/misc7.c b/src/misc7.c index d596ce95..72a56908 100644 --- a/src/misc7.c +++ b/src/misc7.c @@ -12,9 +12,7 @@ /* misc7.c */ #include -#ifndef DOS #include -#endif /* DOS */ #include "lispemul.h" #include "lspglob.h" #include "adr68k.h" diff --git a/src/mkvdate.c b/src/mkvdate.c index 5790ff80..4a63a975 100644 --- a/src/mkvdate.c +++ b/src/mkvdate.c @@ -33,18 +33,8 @@ #include #include -#ifndef DOS #include -#endif /* DOS */ -#ifdef DOS -int main(void) { - long dtime; - time(&dtime); - printf("long MDate= %ld;\n", dtime); - return (0); -} -#else /* Version for every other Unix */ int main(void) { struct timeval time; @@ -60,4 +50,3 @@ int main(void) { return (0); } -#endif /* DOS */ diff --git a/src/mouseif.c b/src/mouseif.c deleted file mode 100644 index 099871f7..00000000 --- a/src/mouseif.c +++ /dev/null @@ -1,121 +0,0 @@ -/* $Id: mouseif.c,v 1.2 1999/01/03 02:07:26 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -/* * * * D O S M O U S E I N T E R F A C E * * * */ - -#include "version.h" - -#include "lispemul.h" -#include "dbprint.h" -#include "devif.h" - -MouseInterfaceRec curmouse; -MouseInterface currentmouse = &curmouse; - -#ifdef DOS -#include - -int nomouseflag = FALSE; -extern DLword *Lisp_world; -extern LispPTR *LASTUSERACTION68k; -extern int twobuttonflag; - -extern void EnterDosMouse(); -extern void ExitDosMouse(); -extern void DosMouseAfterRaid(); -extern void DosMouseBeforeRaid(); -extern unsigned long GenericReturnT(); -extern void ThreeButtonHandler(); -extern void TwoButtonHandler(); -#endif /* DOS */ - -#ifdef DOS -/*****************************************************************/ -/* p r o b e m o u s e */ -/* */ -/* Probe for mouse and return the number of buttons available. */ -/*****************************************************************/ -int probemouse() { - union REGS regs; - char c; - /*************************************************************************** - * Reset mouse driver, exit if no mouse driver present - ***************************************************************************/ - /* int 33h, case 0000, ax = drive installed, bx = # of buttons. */ - if (nomouseflag) { - return (666); /* return something, why not 666? */ - } else { - regs.w.eax = 0; /* Func 0 = Reset mouse, ret. button info */ - int86(0x33, ®s, ®s); - - if (regs.x.ax == 0x0000) VESA_errorexit("No mouse driver found.", -1); - return (regs.x.bx); - } -} -#endif - -void make_mouse_instance(MouseInterface mouse) -{ -#ifdef DOS - - int NumberOfButtons; - if (nomouseflag) { - mouse->device.enter = &GenericReturnT; - mouse->device.exit = &GenericReturnT; - mouse->device.before_raid = &GenericReturnT; - mouse->device.after_raid = &GenericReturnT; - mouse->device.active = FALSE; - NumberOfButtons = 3; - } else { - mouse->device.enter = &EnterDosMouse; - mouse->device.exit = &ExitDosMouse; - mouse->device.before_raid = &DosMouseBeforeRaid; - mouse->device.after_raid = &DosMouseAfterRaid; - mouse->device.active = FALSE; - NumberOfButtons = probemouse(); - } - mouse->Button.StartTime = 2; - - mouse->Cursor.Last.width = 16; - mouse->Cursor.Last.height = 16; - - if (nomouseflag == FALSE) { - if (twobuttonflag) { /* We force two button handling. */ - mouse->Handler = &TwoButtonHandler; - mouse->Button.TwoButtonP = TRUE; - } else /* Determine how many buttons we have. */ - switch (NumberOfButtons) { - case 0x0000: /* Other than 2 buttons, assume three */ - mouse->Button.TwoButtonP = FALSE; - mouse->Handler = &ThreeButtonHandler; - break; - case 0x0002: /* Two buttons. */ - mouse->Button.TwoButtonP = TRUE; - mouse->Handler = &TwoButtonHandler; - break; - case 0x0003: /* Three buttons. */ - mouse->Button.TwoButtonP = FALSE; - mouse->Handler = &ThreeButtonHandler; - break; - case 0xffff: /* Two buttons. */ - mouse->Button.TwoButtonP = TRUE; - mouse->Handler = &TwoButtonHandler; - break; - default: /* Strange case, assume three. */ - mouse->Button.TwoButtonP = FALSE; - mouse->Handler = &ThreeButtonHandler; - break; - } - } -/* mouse->timestamp = ((*LASTUSERACTION68k& 0xffffff) + Lisp_world); */ -#elif XWINDOW -#endif /* DOS or XWINDOW */ -} diff --git a/src/rpc.c b/src/rpc.c index d91875a4..b9fcbe1d 100644 --- a/src/rpc.c +++ b/src/rpc.c @@ -18,7 +18,6 @@ /* */ /************************************************************************/ -#ifndef DOS #include #include #include @@ -30,7 +29,6 @@ #include #include #include /* for memset/memcpy */ -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" #include "lsptypes.h" @@ -48,7 +46,6 @@ LispPTR rpc(LispPTR *args) { -#ifndef DOS /* Arguments are: args[0]:Destination Address; hostname or internet address are both supported. args[1]:Remote port for this program. @@ -194,5 +191,4 @@ LispPTR rpc(LispPTR *args) */ handle_error: return (NIL_PTR); -#endif /* DOS */ } diff --git a/src/subr.c b/src/subr.c index ad73f27c..766b8090 100644 --- a/src/subr.c +++ b/src/subr.c @@ -515,9 +515,7 @@ void OP_subrcall(int subr_no, int argnum) { /* Communications with Unix Subprocess */ case sb_UNIX_HANDLECOMM: POP_SUBR_ARGS; -#ifndef DOS TopOfStack = Unix_handlecomm(args); -#endif /* DOS */ break; /* diff --git a/src/timer.c b/src/timer.c index 7ae3132f..c89f716f 100644 --- a/src/timer.c +++ b/src/timer.c @@ -28,22 +28,8 @@ #include #include -#ifdef DOS -#include -#include /* "#pragma interrupt" & '_chain_intr'*/ -/****************************************************************************** -* Global variables -******************************************************************************/ -void (*prev_int_1c)(); /* keeps address of previous 1c handlr*/ - /* used for chaining & restore at exit*/ -#pragma interrupt(DOStimer) -void DOStimer(); - -unsigned long tick_count = 0; /* approx 18 ticks per sec */ -#else /* DOS */ #include #include -#endif /* DOS */ #if defined(USE_DLPI) #include @@ -104,18 +90,6 @@ static int gettime(int casep); /************************************************************************/ void update_miscstats() { -#ifdef DOS - struct dostime_t dtm; /* holds DOS time, so we can get .01 secs */ - _dos_gettime(&dtm); - - MiscStats->totaltime = (time(0) * 1000) + (10 * dtm.hsecond); - MiscStats->swapwaittime = 0; - MiscStats->pagefaults = 0; - MiscStats->swapwrites = 0; - MiscStats->diskiotime = 0; /* ?? not available ?? */ - MiscStats->diskops = 0; - MiscStats->secondstmp = MiscStats->secondsclock = (time(0) + UNIX_ALTO_TIME_DIFF); -#else struct timeval timev; struct rusage ru; @@ -132,7 +106,6 @@ void update_miscstats() { ; gettimeofday(&timev, NULL); MiscStats->secondstmp = MiscStats->secondsclock = (timev.tv_sec + UNIX_ALTO_TIME_DIFF); -#endif /* DOS */ } /************************************************************************/ @@ -197,20 +170,11 @@ LispPTR subr_gettime(LispPTR args[]) static int gettime(int casep) { -#ifdef DOS - struct dostime_t dtm; /* for hundredths of secs */ -#else struct timeval timev; -#endif /* DOS */ switch (casep) { case 0: /* elapsed time in alto milliseconds */ -#ifdef DOS - _dos_gettime(&dtm); - return ((time(0) + UNIX_ALTO_TIME_DIFF) * 1000) + (10 * dtm.hsecond); -#else /* DOS */ gettimeofday(&timev, NULL); return ((timev.tv_sec + UNIX_ALTO_TIME_DIFF) * 1000 + timev.tv_usec / 1000); -#endif /* DOS */ case 1: /* starting elapsed time in milliseconds */ return (MiscStats->starttime); @@ -221,20 +185,12 @@ static int gettime(int casep) case 3: /* total GC time in milliseconds */ return (MiscStats->gctime); case 4: /* current time of day in Alto format */ -#ifdef DOS - return (time(0) + UNIX_ALTO_TIME_DIFF); -#else gettimeofday(&timev, NULL); return (timev.tv_sec + UNIX_ALTO_TIME_DIFF); -#endif case 5: /* current time of day in Interlisp format */ -#ifdef DOS - return (time(0) + LISP_UNIX_TIME_DIFF); -#else gettimeofday(&timev, NULL); return (timev.tv_sec + LISP_UNIX_TIME_DIFF); -#endif case 6: return (98); /* this is wrong, only works in PST */ @@ -273,29 +229,10 @@ static int gettime(int casep) void subr_settime(LispPTR args[]) { -#ifdef DOS - struct dostime_t dostime; - struct dosdate_t dosday; - struct tm uxtime; - - uxtime = *localtime((time_t *)(*((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF)); - dostime.hsecond = 0; - dostime.second = uxtime.tm_sec; - dostime.minute = uxtime.tm_min; - dostime.hour = uxtime.tm_hour; - _dos_settime(&dostime); - - dosday.day = uxtime.tm_mday; - dosday.month = uxtime.tm_mon; - dosday.year = uxtime.tm_year; - dosday.dayofweek = uxtime.tm_wday; - _dos_setdate(&dosday); -#else struct timeval timev; timev.tv_sec = *((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF; timev.tv_usec = 0; settimeofday(&timev, NULL); -#endif } /* end subr_settime */ /************************************************************************/ @@ -332,19 +269,11 @@ void subr_copytimestats(LispPTR args[]) LispPTR N_OP_rclk(LispPTR tos) { unsigned int usec; -#ifdef DOS - struct dostime_t dtm; -#endif /* DOS */ -#ifdef DOS - _dos_gettime(&dtm); - usec = (time(0) * 1000000) + (10000 * dtm.hsecond); -#else struct timeval timev; gettimeofday(&timev, NULL); usec = (timev.tv_sec * 1000000UL) + timev.tv_usec; -#endif /* DOS */ *((unsigned int *)(Addr68k_from_LADDR(tos))) = usec; return (tos); } /* end N_OP_rclk */ @@ -364,13 +293,9 @@ LispPTR N_OP_rclk(LispPTR tos) /************************************************************************/ void update_timer() { -#ifdef DOS - MiscStats->secondstmp = MiscStats->secondsclock = time(0) + UNIX_ALTO_TIME_DIFF; -#else struct timeval timev; gettimeofday(&timev, NIL); MiscStats->secondstmp = MiscStats->secondsclock = (timev.tv_sec + UNIX_ALTO_TIME_DIFF); -#endif /* DOS */ } /************************************************************************/ @@ -443,24 +368,6 @@ static void int_timer_service(int sig) static void int_timer_init() { -#ifdef DOS - /****************************************************************************** - * All code and data touched during the processing of an interrupt should - * locked prior to receiving any interrupts. This prevents the Timer - * function from being swapped out during an interrupt. - ******************************************************************************/ - _dpmi_lockregion((void *)Irq_Stk_End, sizeof(Irq_Stk_End)); - _dpmi_lockregion((void *)Irq_Stk_Check, sizeof(Irq_Stk_Check)); - _dpmi_lockregion((void *)tick_count, sizeof(tick_count)); - _dpmi_lockregion((void *)&DOStimer, 4096); - _dpmi_lockregion((void *)prev_int_1c, sizeof(prev_int_1c)); - - /* Set up the DOS time handler. */ - prev_int_1c = _dos_getvect(0x1c); /* get addr of current 1c hndlr, */ - /* if any*/ - _dos_setvect(0x1c, DOStimer); /* hook our int handler to timer int */ - -#else struct itimerval timert; struct sigaction timer_action; @@ -478,7 +385,6 @@ static void int_timer_init() setitimer(ITIMER_VIRTUAL, &timert, NULL); DBPRINT(("Timer interval set to %d usec\n", timert.it_value.tv_usec)); -#endif /* DOS */ } /************************************************************************/ @@ -494,9 +400,7 @@ static void int_timer_init() void int_io_open(int fd) { -#ifdef DOS -/* would turn on DOS kbd signal handler here */ -#elif KBINT +#if KBINT DBPRINT(("int_io_opening %d\n", fd)); if (fcntl(fd, F_SETOWN, getpid()) == -1) { @@ -510,9 +414,7 @@ void int_io_open(int fd) void int_io_close(int fd) { -#ifdef DOS -/* Turn off signaller here */ -#elif KBINT +#if KBINT fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_ASYNC); #endif } @@ -529,7 +431,6 @@ void int_io_close(int fd) /************************************************************************/ static void int_io_init() { -#ifndef DOS struct sigaction io_action; io_action.sa_handler = getsignaldata; sigemptyset(&io_action.sa_mask); @@ -556,7 +457,6 @@ static void int_io_init() { return; } #endif /* USE_DLPI */ -#endif /* DOS */ } /************************************************************************/ @@ -572,9 +472,6 @@ static void int_io_init() { void int_block() { /* temporarily turn off interrupts */ -#ifdef DOS - _dos_setvect(0x1c, prev_int_1c); -#else /* DOS */ sigset_t signals; sigemptyset(&signals); sigaddset(&signals, SIGVTALRM); @@ -585,7 +482,6 @@ void int_block() { sigaddset(&signals, SIGFPE); #endif sigprocmask(SIG_BLOCK, &signals, NULL); -#endif /* DOS */ } /************************************************************************/ @@ -600,9 +496,6 @@ void int_block() { /************************************************************************/ void int_unblock() { -#ifdef DOS - _dos_setvect(0x1c, DOStimer); -#else /* DOS */ sigset_t signals; sigemptyset(&signals); sigaddset(&signals, SIGVTALRM); @@ -613,7 +506,6 @@ void int_unblock() { sigaddset(&signals, SIGFPE); #endif sigprocmask(SIG_UNBLOCK, &signals, NULL); -#endif /* DOS */ } #ifdef FLTINT @@ -773,7 +665,6 @@ and do a 'v' before trying anything else."; /* */ /************************************************************************/ static void int_panic_init() { -#ifndef DOS struct sigaction panic_action, ignore_action; panic_action.sa_sigaction = panicuraid; @@ -797,7 +688,6 @@ static void int_panic_init() { /* Ignore SIGPIPE */ sigaction(SIGPIPE, &ignore_action, NULL); -#endif DBPRINT(("Panic interrupts enabled\n")); } @@ -823,41 +713,3 @@ void int_init() { int_unblock(); /* Turn on interrupts */ } -#ifdef DOS -/****************************************************************************** -* DOStimer() -* -* The interrupt 0x1c handler. This routine must be declared using the -* '#pragma interrupt()' statement to ensure that all registers are preserved. -* It is also needed to ensure the proper functioning of '_chain_intr()'. -* -* The timer interrupt (normally) occurs 18.2 times per second. This routine -* waits one extra tick every 91 ticks (18.2*5). -* -* Before this interrupt was installed, 'prev_int_1c' was set to the current -* 0x1c interrupt. 'DOStimer()' chains to this interrupt using '_chain_intr()', -* rather than returning back to the caller. -* -* Note that as little as possible should be done within a timer interrupt, -* since further clock ticks are disabled until the interrupt returns. -******************************************************************************/ -void DOStimer() { - /* if (--tick_count == 0) { */ - Irq_Stk_Check = 0; - Irq_Stk_End = 0; - /* _dos_setvect(0x1c, prev_int_1c); - } else if (tick_count <= 0) { */ - /* I'm dead, uninstall me */ - /* _dos_setvect(0x1c, prev_int_1c); - tick_count = 0; - } */ - _chain_intr(prev_int_1c); /* call previous int 1c handlr, if any*/ - /* (pts to 'ret' if no prev installed)*/ -} - -void alarm(unsigned long sec) -{ - /* tick_count = sec * 18; - _dos_setvect(0x1c, DOStimer); */ -} -#endif /* DOS */ diff --git a/src/ufs.c b/src/ufs.c index 8ed0d3ba..7d5a2d96 100644 --- a/src/ufs.c +++ b/src/ufs.c @@ -19,21 +19,10 @@ #include #include -#ifndef DOS #include #include #include #include -#else /* DOS */ -#include -#include /* "#pragma interrupt" & '_chain_intr'*/ -#include -#include /* _XSTACK struct definition */ - -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEN _MAX_PATH -#define alarm(x) 1 -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" @@ -59,72 +48,9 @@ int Dummy_errno; /* If errno cell is not provided by Lisp, dummy_errno is used. /* Used to limit DOS filenames to 8.3 format */ -#ifdef DOS -#define NameValid extensionp ? (extlen < 3) : (namelen < 8) -#define CountNameChars \ - { extensionp ? extlen++ : namelen++; } - -#else /* Other file systems don't care */ #define NameValid 1 #define CountNameChars -#endif /* DOS */ - -#ifdef DOS - -void (*prev_int_24)(); /* keeps address of previous 24 handlr*/ -#pragma interrupt(Int24) - -/* - * Name: Int24 - * - * Description: Bypass the "Abort, Retry, Fail?" message that - * DOS issues. - * - */ -void Int24(void) { - unsigned deverr, errcode; - - union REGS regs; - _XSTACK *stk; - stk = (_XSTACK *)_get_stk_frame(); /* get ptr to the V86 _XSTACK frame */ - deverr = stk->eax; - - if ((deverr & 0x00008000) == 0) /* is a disk error */ - { - stk->eax = _HARDERR_FAIL; - stk->opts |= _STK_NOINT; /* set _STK_NOINT to prevent V86 call */ - _chain_intr(prev_int_24); /* call previous int 24 handlr, if any*/ - /* (pts to 'ret' if no prev installed)*/ - } -} - -/* - * Name: init_host_filesystem - * - * Description: Initialize the hosts filesystem by installing - * the "critical error handler". - */ -init_host_filesystem() { - prev_int_24 = _dos_getvect(0x24); /* get addr of current handler, if any */ - _dos_setvect(0x24, Int24); /* hook our int handler to interrupt */ - _dpmi_lockregion((void *)prev_int_24, sizeof(prev_int_24)); - _dpmi_lockregion((void *)&Int24, 4096); -} - -/* - * Name: exit_host_filesystem - * - * Description: Cleanup the filesystem specific patches. - * - */ -exit_host_filesystem() { - _dos_setvect(0x24, prev_int_24); /* unhook our handlr, install previous*/ - _dpmi_unlockregion((void *)prev_int_24, sizeof(prev_int_24)); - _dpmi_unlockregion((void *)&Int24, 4096); -} - -#endif /* DOS */ /* * Name: UFS_getfilename @@ -172,11 +98,7 @@ LispPTR UFS_getfilename(LispPTR *args) * Thus we don't need to convert a version field. Third argument for * unixpathname specifies it. */ -#ifdef DOS - if (unixpathname(lfname, file, 0, 0, 0, 0, 0) == 0) return (NIL); -#else if (unixpathname(lfname, file, 0, 0) == 0) return (NIL); -#endif /* DOS */ switch (args[1]) { case RECOG_OLD: @@ -254,11 +176,7 @@ LispPTR UFS_deletefile(LispPTR *args) LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - if (unixpathname(fbuf, file, 0, 0, 0, 0, 0) == 0) return (NIL); -#else if (unixpathname(fbuf, file, 0, 0) == 0) return (NIL); -#endif /* DOS */ /* * On UNIX device, all we have to do is just to unlink the file. @@ -312,17 +230,9 @@ LispPTR UFS_renamefile(LispPTR *args) if (len > MAXPATHLEN) FileNameTooLong(NIL); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - if (unixpathname(fbuf, src, 0, 0, 0, 0, 0) == 0) return (NIL); -#else if (unixpathname(fbuf, src, 0, 0) == 0) return (NIL); -#endif /* DOS */ LispStringToCString(args[1], fbuf, MAXPATHLEN); -#ifdef DOS - if (unixpathname(fbuf, dst, 0, 0, 0, 0, 0) == 0) return (NIL); -#else if (unixpathname(fbuf, dst, 0, 0) == 0) return (NIL); -#endif /* DOS */ TIMEOUT(rval = rename(src, dst)); if (rval == -1) { @@ -384,11 +294,7 @@ LispPTR UFS_directorynamep(LispPTR *args) LispStringToCString(args[0], dirname, MAXPATHLEN); /* Convert Xerox Lisp file naming convention to Unix one. */ -#ifdef DOS - if (unixpathname(dirname, fullname, 0, 0, 0, 0, 0) == 0) return (NIL); -#else if (unixpathname(dirname, fullname, 0, 0) == 0) return (NIL); -#endif /* DOS */ TIMEOUT(rval = stat(fullname, &sbuf)); if (rval == -1) { @@ -447,11 +353,7 @@ LispPTR UFS_directorynamep(LispPTR *args) * UNIX trail directory delimiter '/'. * */ -#ifdef DOS -int unixpathname(char *src, char *dst, int versionp, int genp, char *drive, int *extlenptr, char *rawname) -#else int unixpathname(char *src, char *dst, int versionp, int genp) -#endif /* DOS */ { register char *cp, *dp, *np; register int newdirflg; @@ -460,20 +362,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp) char ver1[VERSIONLEN], ver2[VERSIONLEN]; struct passwd *pwd; -#ifdef DOS - char *rp; - int namelen = 0, extlen = 0; /* lengths of name & extension */ - int extensionp = 0; /* T if we're in the extension */ - int version = 1; /* version # for this file */ -#endif /* DOS */ - /* If there's a drive letter, it and a colon come first */ -#ifdef DOS - if (drive && (*drive)) { - *dst++ = *drive; - *dst++ = DRIVESEP; - } -#endif /* DOS */ /* * The UNIX root directory is represented as "<" in Xerox Lisp generic @@ -492,11 +381,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp) * because the quotation mark which quotes the semicolon might be lost * in the course of the following conversion. */ -#ifdef DOS - if (versionp) LispVersionToUnixVersion(lfname, version) else version = -1; -#else if (versionp) LispVersionToUnixVersion(lfname); -#endif /* DOS */ cp = lfname; dp = dst; @@ -516,11 +401,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp) * user's current working directory. */ if (getcwd(dst, MAXPATHLEN) == 0) return (0); -#ifdef DOS - dp = max(strrchr(dst, '/'), strrchr(dst, DIRSEP)); -#else dp = strrchr(dst, '/'); -#endif /* DOS */ dp++; if (*(cp + 2) == '\0') @@ -532,10 +413,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) *dp++ = DIRSEP; } break; -#ifdef DOS - case '/': - case DIRSEP: -#endif case '>': /* ".>" means the user's current working directory. */ if (getcwd(dst, MAXPATHLEN) == 0) return (0); @@ -560,7 +437,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) break; } break; -#ifndef DOS case '~': if (*(cp + 1) == '>' || *(cp + 1) == '\0') { /* "~>" or "~" means the user's home directory. */ @@ -606,30 +482,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) } break; -#else - /* For DOS, ignore ~> or ~/ or ~ */ - case '~': - if (*(cp + 1) == '>' || *(cp + 1) == '\0') { - /* "~>" or "~" means the user's home directory. */ - - *dp++ = DIRSEP; - if (*(cp + 1) == '\0') - cp++; - else - cp += 2; - } else { - /* - * In this case, we assume some user's home directory - * is specified in the form "~username". - */ - for (++cp, np = name; *cp != '\0' && *cp != '>';) *np++ = *cp++; - *dp++ = DIRSEP; - - if (*cp == '>') cp++; - } - break; - -#endif /* DOS */ default: *dp++ = '/'; /* Insert the initial directory delimiter. */ break; @@ -725,9 +577,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) } } else { switch (*cp) { -#ifdef DOS - case '/': /* in DOS, must xlate / also. */ -#endif /* DOS */ case '>': /* * Xerox Lisp directory delimiter '>' is translated into @@ -737,10 +586,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) dp++; cp++; newdirflg = 1; /* Turn on the new directory flag. */ -#ifdef DOS - namelen = extlen = 0; - rp = dp; /* remember where raw filename starts */ -#endif /* DOS */ break; case '\'': @@ -751,21 +596,8 @@ int unixpathname(char *src, char *dst, int versionp, int genp) * So only we have to do is to skip the quotation mark * and copy the next character. */ -#ifdef DOS - if (NameValid) *dp++ = *(cp + 1); - CountNameChars; -#endif /* DOS */ cp += 2; break; -#ifdef DOS - case '.': /* start of extension, if not already */ - if (!extensionp) - *dp++ = *cp++; - else - cp++; - extensionp = 1; - break; -#endif /* DOS */ default: if (NameValid) *dp++ = *cp++; @@ -808,12 +640,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp) *(dp - 1) = '\0'; } } -#ifdef DOS - if (version >= 0) - sprintf(ver2, "%d", version); - else - *ver2 = '\0'; -#endif /* DOS */ ConcNameAndVersion(fbuf2, ver2, dst); } return (1); @@ -867,14 +693,6 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp) return (1); } -#ifdef DOS - /* Split off the drive, if there is one. */ - if (fullname[1] == DRIVESEP) { - *lispname++ = *fullname++; - *lispname++ = *fullname++; - } -#endif - if (!dirp) { /* * The characters which are dealt with specially (i.e. are quoted) @@ -945,16 +763,11 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp) switch (*cp) { case '>': case ';': -#ifndef DOS case '\'': -#endif /* DOS */ *dp++ = '\''; *dp++ = *cp++; break; -#ifdef DOS - case '/': -#endif case DIRSEP: *dp++ = '>'; cp++; @@ -996,12 +809,6 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp) i = 1; while (*cp) { switch (*cp) { -#ifdef DOS - case DIRSEP: - *dp++ = '/'; - cp++; - break; -#endif case '>': case ';': case '\'': diff --git a/src/unixcomm.c b/src/unixcomm.c index 437c66c7..17f420e9 100644 --- a/src/unixcomm.c +++ b/src/unixcomm.c @@ -6,9 +6,6 @@ Unix Interface Communications */ -/* Don't compile this at all under DOS. */ -#ifndef DOS - #ifndef _GNU_SOURCE #define _GNU_SOURCE /* Needed for ptsname on glibc systems. */ #endif @@ -929,4 +926,3 @@ void WriteLispStringToPipe(LispPTR lispstr) { write(UnixPipeOut, shcom, len); } -#endif /* DOS */ diff --git a/src/uraid.c b/src/uraid.c index f3a833a2..8f587db9 100644 --- a/src/uraid.c +++ b/src/uraid.c @@ -27,13 +27,11 @@ #include #include -#ifndef DOS #include #include #include #include #include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -89,19 +87,10 @@ extern int Win_security_p; #include "etherdefs.h" #endif -#ifdef DOS -#define vfork() printf("No forking around here.\n") -#endif /* DOS */ - -#if defined(DOS) || defined(XWINDOW) +#if defined(XWINDOW) #include "devif.h" extern DspInterface currentdsp; -#endif /* DOS || XWINDOW */ - -#ifdef DOS -extern MouseInterface currentmouse; -extern KbdInterface currentkbd; -#endif /* DOS */ +#endif /* XWINDOW */ #ifdef COLOR extern int MonoOrColor; @@ -137,7 +126,7 @@ x Xaddress [xnum] Hex-Dump xnum word(16-bits) starting at Xaddress @ litatom val Sets TOPVAL of litatom to Decimal-val < Xaddress val Sets the word(16-bits) at the address to val <> -e Exit to UNIX / DOS +e Exit to UNIX h Context switch to HARDRESET q Returns from URAID with NO-change <> @@ -175,41 +164,6 @@ DLword *HideColorDisp68k; extern int Inited_Color; #endif /* COLOR */ -#ifdef DOS -char *URaid_summary1 = - "\n-- Stack display commands\n\ -c\t\t\tChecks all user stack contents\n\ -f number\t\tDisplays stack frame for that frame number (decimal)\n\ -k type\t\t\tChanges the type of stack link following. (a|c)\n\ -l [type]\t\tBack Trace for specified type stack. (k|m|r|g|p|u|)\n\ -\t\t\tDisplay next frame.\n"; - -char *URaid_summary2 = - "\n-- Memory display commands\n\ -a litatom\t\tDisplays the top-level value of the litatom\n\ -B Xaddress\t\tPrint the contents of the arrayblock at that address.\n\ -d litatom\t\tDisplays the definition cell for the litatom\n\ -M\t\t\tDisplays TOS,CSP,PVAR,IVAR,PC\n\ -m func1 func2\t\tMOVD func1 to func2\n\ -O Xaddress\t\tDisplays the object with that address\n\ -t Xaddress\t\tDisplays the type of this object\n\ -p litatom\t\tDisplays the property list of the litatom\n\ -w\t\t\tDisplays the current function-name and PC\n\ -x Xaddress [xnum]\tHex-Dump xnum (16-bit) words starting at Xaddress\n\ -@ litatom val\t\tSets TOPVAL of litatom to Decimal-val\n\ -< Xaddress Xval\t\tSets the (16-bit) word at the address to Xval\n"; - -char *URaid_summary3 = - "\n-- Continue or exit commands\n\ -e\t\t\tExit to DOS\n\ -h\t\t\tDo a HARDRESET\n\ -q\t\t\tReturns from URAID with NO change\n\ -<>\ns\t\t\tInvoke Shell\n\ -v filename\t\tSave the virtual memory on the filename(Not Bootable)\n\ -( [num]\t\t\tSets Print level\n\ -!\t\t\tPrints the error message passed from the emulator\n\ -?\t\t\tDisplay this summary"; -#else char *URaid_summary = "---URAID command summary---\n\ \n-- Stack display commands\n\ @@ -241,7 +195,6 @@ v filename\t\tSaves the virtual memory on the filename (Not Bootable)\n\ ( [num]\t\t\tSets the print level\n\ !\t\t\tDisplays the error message passed from the emulator\n\ ?\t\t\tDisplays this summary"; -#endif /* DOS */ #define ADD_RANGEP(address) \ if (((address) < 0) || (POINTERMASK < (address))) { \ @@ -372,9 +325,7 @@ LispPTR uraid_commands() { int num, address, val; LispPTR index; DefCell *defcell68k; -#ifndef DOS int status; -#endif /* DOS */ if (URaid_argnum == -1) { /* disp next FX */ @@ -388,11 +339,6 @@ LispPTR uraid_commands() { } switch (URaid_comm) { /*** Displaying STACK stuff */ -#ifdef DOS - case '1': printf("%s\n", URaid_summary1); break; - case '2': printf("%s\n", URaid_summary2); break; - case '3': printf("%s\n", URaid_summary3); break; -#endif /* DOS */ case 'c': stack_check(0); break; case 'C': all_stack_dump(0, 0, T); break; case 'f': /**if((URaid_arg1[0] < '0') || (URaid_arg1[0] > '9')){ @@ -766,11 +712,7 @@ LispPTR uraid_commands() { fflush(stdin); break; case 'e': /* exit to UNIX */ -#ifdef DOS - printf("Exit to DOS?[confirm](Y or N)<"); -#else /* DOS */ printf("Exit to UNIX?[confirm](Y or N)<"); -#endif /* DOS */ { int c; c = getchar(); @@ -787,10 +729,8 @@ LispPTR uraid_commands() { default: break; } -#ifndef DOS (void)wait(&status); /* system("/bin/sh -i"); */ -#endif /* DOS */ return (T); /* break; */ case 'v': @@ -827,13 +767,7 @@ LispPTR uraid_commands() { printf("PrintLevel is set to %d.", num); break; case '?': -#ifdef DOS - printf( - " 1: <>\n 2: <>\n 3: <>\n"); -#else printf("%s\n", URaid_summary); -#endif /* DOS */ break; case '!': printf("Error message is: %s\n", URaid_errmess); break; @@ -994,14 +928,10 @@ int device_before_raid() { #endif /* SUNDISPLAY */ -#if defined(XWINDOW) || defined(DOS) +#if defined(XWINDOW) (currentdsp->cleardisplay)(currentdsp); (currentdsp->device.before_raid)(currentdsp); -#ifdef DOS - (currentmouse->device.before_raid)(currentmouse); - (currentkbd->device.before_raid)(currentkbd); -#endif /* DOS */ -#endif /* XWINDOW || DOS */ +#endif /* XWINDOW */ return (0); } @@ -1115,12 +1045,7 @@ int device_after_raid() { (currentdsp->device.after_raid)(currentdsp); FD_SET(ConnectionNumber(currentdsp->display_id), &LispReadFds); flush_display_buffer(); -#elif DOS - (currentdsp->device.after_raid)(currentdsp); - (currentmouse->device.after_raid)(currentmouse, currentdsp); - (currentkbd->device.after_raid)(currentkbd); - flush_display_buffer(); -#endif /* XWINDOW | DOS */ +#endif /* XWINDOW */ int_unblock(); *EmKbdAd068K = *EmRealUtilin68K = *EmKbdAd168K = *EmKbdAd268K = *EmKbdAd368K = *EmKbdAd468K = diff --git a/src/uutils.c b/src/uutils.c index 81196d2e..80b0ecc9 100644 --- a/src/uutils.c +++ b/src/uutils.c @@ -25,9 +25,7 @@ #include #include -#ifndef DOS #include -#endif #include "lispemul.h" #include "adr68k.h" @@ -115,9 +113,6 @@ int c_string_to_lisp_string(char *C, LispPTR Lisp) { register char *dp; for (i = 0, dp = C; i < length + 1; i++) { int ch = *dp++; -#ifdef DOS - if (ch == '\\') dp++; /* skip 2nd \ in \\ in C strings */ -#endif /* DOS */ GETBYTE(base++) = ch; } } @@ -149,12 +144,10 @@ LispPTR check_unix_password(LispPTR *args) { /************************************************************************/ LispPTR unix_username(LispPTR *args) { -#ifndef DOS struct passwd *pwd; if ((pwd = getpwuid(getuid())) == NULL) return NIL; if (c_string_to_lisp_string(pwd->pw_name, args[0])) return NIL; -#endif /* DOS */ return ATOM_T; } @@ -202,8 +195,6 @@ LispPTR unix_getparm(LispPTR *args) { if (strcmp(envname, "MACH") == 0) { #if defined(sparc) envvalue = "sparc"; -#elif defined(DOS) - envvalue = "386"; #elif defined(MAIKO_OS_MACOS) envvalue = "i386"; #else @@ -213,8 +204,6 @@ LispPTR unix_getparm(LispPTR *args) { } else if (strcmp(envname, "ARCH") == 0) { #if defined(sparc) envvalue = "sun4"; -#elif defined(DOS) - envvalue = "dos"; #elif defined(MAIKO_OS_MACOS) envvalue = "i386"; #else @@ -230,7 +219,6 @@ LispPTR unix_getparm(LispPTR *args) { envvalue = "DIRECT"; #endif } -#ifndef DOS else if (strcmp(envname, "HOSTNAME") == 0) { if (gethostname(result, sizeof result)) return NIL; envvalue = result; @@ -246,7 +234,6 @@ LispPTR unix_getparm(LispPTR *args) { snprintf(result, sizeof(result), "%lx", gethostid()); envvalue = result; } -#endif /* DOS */ else return NIL; @@ -280,12 +267,10 @@ LispPTR unix_getenv(LispPTR *args) { /************************************************************************/ LispPTR unix_fullname(LispPTR *args) { -#ifndef DOS struct passwd *pwd; if ((pwd = getpwuid(getuid())) == NULL) return NIL; if (c_string_to_lisp_string(pwd->pw_gecos, args[0])) return NIL; -#endif /* DOS */ return ATOM_T; } @@ -301,7 +286,6 @@ extern DLword *EmMouseX68K, *EmMouseY68K, *EmKbdAd068K, *EmRealUtilin68K, *EmUti extern DLword *EmKbdAd168K, *EmKbdAd268K, *EmKbdAd368K, *EmKbdAd468K, *EmKbdAd568K; LispPTR suspend_lisp(LispPTR *args) { -#ifndef DOS extern DLword *CTopKeyevent; extern LispPTR *KEYBUFFERING68k; @@ -355,6 +339,5 @@ LispPTR suspend_lisp(LispPTR *args) { ((RING *)CTopKeyevent)->write = MINKEYEVENT; else ((RING *)CTopKeyevent)->write = w + KEYEVENTSIZE; -#endif /* DOS, which doesn't support suspend-lisp */ return ATOM_T; } diff --git a/src/vesafns.asm b/src/vesafns.asm deleted file mode 100644 index da901cc1..00000000 --- a/src/vesafns.asm +++ /dev/null @@ -1,826 +0,0 @@ -;; # @(#) vesafns.asm Version 1.1 (12/29/94). Copyright Venue # - - - - -;************************************************************************/ -;* */ -;* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -;* All Rights Reserved. */ -;* Manufactured in the United States of America. */ -;* */ -;************************************************************************/ - -.386P -DATA SEGMENT USE32 - -;;; ****************************** -;;; DevRec is the ``SuperClass'' of devices. -;;; It is included at the top of all the device record. -;;; **IT IS IMPORTANT THAT YOU KEEP THIS RECORD IN SYNC -;;; WITH THE DspInterfaceRec DEFINED IN devif.h -;;; ****************************** - DevRec STRUC - active DD ? - locked DD ? - deventer DD ? - devexit DD ? - before_raid DD ? - after_raid DD ? - sync_device DD ? - DevRec ENDS - -;;; ****************************** -;;; MRegion is the generic region record. It is used for geometry -;;; calculations. -;;; ****************************** - MRegion STRUC - x DD ? - y DD ? - RegWidth DD ? - RegHeight DD ? - MRegion ENDS - -;;; ****************************** -;;; DspInterfaceRec is the record that represents the -;;; display interface. -;;; **IT IS IMPORTANT THAT YOU KEEP THIS RECORD IN SYNC -;;; WITH THE DspInterfaceRec DEFINED IN devif.h -;;; ****************************** - DspInterfaceRec STRUC - device DevRec <> - drawline DD ? - - cleardisplay DD ? - - get_color_map_entry DD ? - set_color_map_entry DD ? - available_colors DD ? - possible_colors DD ? - -;; get_color_map DD ? -;; set_color_map DD ? -;; make_color_map DD ? - - medley_to_native_bm DD ? - native_to_mdley_bm DD ? - - bitblit_to_screen DD ? - bitblit_from_screen DD ? - scroll_region DD ? - - mouse_invisible DD ? - mouse_visible DD ? - - Disp MRegion <> - bitsperpixel DD ? - colors DD ? - oldstate DD ? - graphicsstate DD ? - numberofbanks DD ? - - BytesPerLine DD ? - DisplayStartAddr DD ? - DisplaySegSize DD ? - DisplaySegMagnitude DD ? - LinesPerBank DD ? - SwitchBank DD ? - DspInterfaceRec ENDS - -;;; ****************************** -;;; IOPAGE good old iopage from medley... -;;; **IT IS IMPORTANT THAT YOU KEEP THIS RECORD IN SYNC -;;; WITH THE DspInterfaceRec DEFINED IN C. -;;; ****************************** - - IOPAGE STRUC - dummy0 DW 22o DUP (?) - dlfloppycmd DW ? - dlmaintpanel DW ? - dlprocessorcmd DW ? - dlttyportcmd DW ? - dlbeepcmd DW ? - newmousestate DW ? - dlrs232cputflag DW ? - dlrs232cmisccommand DW ? - dummy1b DW ? - dlrs232cgetflag DW ? - dummy1 DW 4o DUP (?) - dlfloppy DW ? - dummy1a DW ? - dummy2 DW ? - dlttyout DW ? - dummy3 DW ? - dlttyin DW ? - dlprocessor1 DW ? - dlprocessor2 DW ? - newmousex DW ? - dlprocessor0 DW ? - dlbeepfreq DW ? - newmousey DW ? - dlrs232cparametercsbhi DW ? - dlrs232cparametercsblo DW ? - dlrs232csetrs366status DW 2o DUP (?) - dlrs232cputcsblo DW ? - dlrs232csetrs366statusa DW ? - dlrs232cgetcsblo DW ? - dlrs232cputcsbhi DW ? - dlrs232cdevicestatus DW ? - dlrs232cgetcsbhi DW ? - dltodvalid DW ? - dlrs232cparameteroutcome DW ? - dltodhi DW ? - dltodlo DW ? - dlmousex DW ? - dltodlo2 DW ? - dlutilin DW ? - dlmousey DW ? - dlkbdad1 DW ? - dlkbdad0 DW ? - dlkbdad3 DW ? - dlkbdad2 DW ? - dlkbdad5 DW ? - dlkbdad4 DW ? - dllsepimagecsb DW 40o DUP (?) - dummy4a DW ? - dliophardwareconfig DW ? - dummy4 DW 12o DUP (?) - dlrs232cparametercsbhi_11 DW ? - dlrs232cparametercsblo_11 DW ? - dlrs232csetrs366status_11 DW 16o DUP (?) - dummy5 DW 74o DUP (?) - dlmagtape DW 4o DUP (?) - dlethernet DW 14o DUP (?) - dummy6 DW 36o DUP (?) - dldispinterrupt DW ? - dummy6a DW ? - dldispborder DW ? - dldispcontrol DW ? - dlcursory DW ? - dlcursorx DW ? - dlcursorbitmap DW 20o DUP (?) - IOPAGE ENDS - -DATA ENDS - -CODE SEGMENT USE32 -ASSUME DS:DATA -ASSUME CS:CODE - -DOBANK MACRO NUMBER - push eax - mov ax, NUMBER - mov dx, 3cdh - out dx, ax - pop eax - ENDM - -RET2C MACRO VALUE - mov eax,VALUE - leave - ret - ENDM - -;; ************************************************** -;; D o s c l e a r b a n k s -;; arg1: dsp (pointer to dsp struct) -;; -;; Fill banks with 0. -;; ************************************************** -dsp = 8 -bank = -8 -PUBLIC Dosclearbanks -Dosclearbanks PROC NEAR - enter 16,0 - push edx - push ecx - push edi - mov DWORD PTR bank[ebp], 0 - mov edx, dsp[ebp] - mov ecx, [edx.numberofbanks] - -clrbnk: push ecx - DOBANK bank[ebp] - add DWORD PTR bank[ebp], 1 - mov eax, 0 - mov edi, [edx.DisplayStartAddr] - mov ecx, [edx.DisplaySegSize] - rep stosd - - pop ecx - loop clrbnk - pop edi - pop ecx - pop edx - RET2C 0 -Dosclearbanks ENDP - - - -;; ************************************************** -;; D O S C u r s o r V i s s i b l e -;; arg1: dsp (pointer to dsp struct) -;; arg2: iop (pointer to IOPAGE struct -;; Medley's cursor has no meaningful mask. The mask -;; is just the invers of the map (sigh...). The function -;; f(bg, map, curs) = bg*mask + (not mask)*curs thus -;; collapses to bg*(not curs) + curs. Since the medley -;; bitmaps have the inverse meaning of the vesa bitmaps -;; (ie. they are pre inverted for your convenience!) -;; the expression turns out to be: -;; bg*curs + (not curs) -;; -;; The general idea here is that we blit the cursor -;; directly to the screen instead of to the displayregion. -;; this saves a whole bunch of time since taking the -;; mouse down is just a matter of updating the screen. -;; since this operation has to be done every charblt -;; we save bunches of time. /jarl -;; -;; Assumption: we can straddle at most two banks -;; ************************************************** -dsp = 8 -iop = 12 -PUBLIC DOSCursorVisible -DOSCursorVisible PROC NEAR - enter 32,0 - - push edx - push esi - push edi - push ebx - push ecx - mov edx, dsp[ebp] - mov esi, iop[ebp] - - ;; find the destiniation byte index - movzx eax, [esi.dlcursory] - imul eax, [edx.BytesPerLine] - movzx ebx, [esi.dlcursorx] - sar ebx, 3 ; Make it a byte address - add eax, ebx - mov edi, eax - ;; make the dest index be an address within bounds - and edi, [edx.DisplaySegSize] - or edi, [edx.DisplayStartAddr] - -setbnk: mov dx, 3cdh ; Set the bank - mov ax, 0 - out dx, ax - - add esi, dlcursorbitmap - mov ecx, 16 ; The curs height - -bltcur: lodsw ; cursorbitmap to ax - mov ax, 1010101010101010b - stosw - add edi, [edx.BytesPerLine] - - loop bltcur - - pop ecx - pop ebx - pop edi - pop esi - pop edx - - RET2C 0 -DOSCursorVisible ENDP - - -;; ************************************************** -;; ************************************************** -;; D o s b b t 1 -;; arg1: dsp (pointer to a dsp struct) -;; arg2: buffer (pointer to array of word) -;; arg3: left (dword) (in pixels) -;; arg4: top (dword) (in pixels) -;; arg5: swidth (dword) (in pixels) -;; arg6: height (dword) (in pixels) -;; -;; Bitblits the image stored in buffer to the display -;; buffer. Assumption: buffer and the displaybuffer -;; are equally large and thus left, top etc. pertains -;; to the same offsets. -;; -;; -;; C-CALL: void Dosbbt1( ... ); -;; RETURN: 0 in eax. should be ignored... -;; ************************************************** -dsp = 8 -buffer = 12 -left = 16 -top = 20 -swidth = 24 -height = 28 - -left32 = -8 -width32 = -12 -endptr = -16 -desttop = -20 -dstincr = -24 -srcincr = -28 - - -PUBLIC Dosbbt1 -Dosbbt1 PROC NEAR - ;;; ***************************** - ;;; Save the volatile environment - ;;; ***************************** - enter 32,0 - push ebx - push ecx - push edx - push esi - push edi - - mov edx, dsp[ebp] - - ;; Adjust the arguments to fit inside the display - ;; if left > displaywidth then exit - mov eax, [edx.Disp.RegWidth] - cmp left[ebp], eax - jg alldone - - ;; if 0 > (width + left) then exit - mov eax, left[ebp] - add eax, swidth[ebp] - cmp eax, 0 - jl alldone - - ;; if top > displayheight then exit - mov eax, [edx.Disp.RegHeight] - cmp top[ebp], eax - jg alldone - - ;; if 0 > (top + height) then exit - mov eax, top[ebp] - add eax, height[ebp] - cmp eax, 0 - jl alldone - - ;; if 0 > left then clipleft - mov eax, left[ebp] - cmp eax, 0 - jl clipleft - -tstwdt: ;; if (left + swidth) > displaywidth then clipwidth - mov eax, left[ebp] - add eax, swidth[ebp] - cmp eax, [edx.Disp.RegWidth] - jg clipwidth - -tsttop: ;; if 0 > top then cliptop - mov eax, top[ebp] - cmp eax, 0 - jl cliptop - -tsthit: ;; if (top + height) > displayheight then clipbottom - mov eax, top[ebp] - add eax, height[ebp] - cmp eax, [edx.Disp.RegHeight] - jg clipbtm - jmp startpoint - -clipleft: - mov DWORD PTR left[ebp], 0 - jmp tstwdt - -clipwidth: - mov eax, [edx.Disp.RegWidth] - sub eax, left[ebp] - mov swidth[ebp], eax - jmp tsttop - -cliptop: - mov DWORD PTR top[ebp], 0 - jmp tsthit - -clipbtm: - mov eax, [edx.Disp.RegHeight] - sub eax, top[ebp] - mov height[ebp], eax - - ;; Calculate byte offset into bitmap -startpoint: - mov eax, [edx.Disp.RegWidth] - imul eax, top[ebp] - add eax, left[ebp] - sar eax, 5 ; Make it a byte address on dword boundaries. - sal eax, 2 - - ;; Set dst and src start - mov edi, eax - mov esi, eax - add edi, [edx.DisplayStartAddr] - add esi, buffer[ebp] - - ;; Set dst and src incr - mov eax, left[ebp] - add eax, swidth[ebp] - add eax, 1fh - sar eax, 5 - mov ebx, left[ebp] - sar ebx, 5 - sub eax, ebx - mov width32[ebp], eax ; width32 is width in dwords - sal eax, 2 ; Make width32 a byteadr on dword boundaries. - mov ebx, [edx.Disp.RegWidth] - sar ebx, 3 - sub ebx, eax - - ;; {dst,src}incr is what to add to {esi,edi} to get to the new line - mov dstincr[ebp], ebx - mov srcincr[ebp], ebx - - ;;; ****************************** -Newline1: - mov ecx, width32[ebp] ; swidth into ecx - -Dumpline1: - lodsd ; Load eax and increment esi - xchg ah,al ; Swap low byte - rol eax,10h ; Get the high byte into position - xchg ah,al ; Swap again - not eax ; In medley 1=black 0=white, Hence invert. - stosd ; Store eax and increment edi - loop Dumpline1 - - ;; calc vals for src and dest for the next line. - add edi, dstincr[ebp] - add esi, srcincr[ebp] - - dec DWORD PTR height[ebp] - jg Newline1 - -alldone: - pop edi - pop esi - pop edx - pop ecx - pop ebx - - RET2C 0 -Dosbbt1 ENDP - - -;; ************************************************** -;; ************************************************** -;; D o s b b t 2 -;; arg1: dsp (pointer to a dsp struct) -;; arg2: buffer (pointer to array of word) -;; arg3: left (dword) (in pixels) -;; arg4: top (dword) (in pixels) -;; arg5: swidth (dword) (in pixels) -;; arg6: height (dword) (in pixels) -;; -;; FUNCTION: Monocrome bbt to a 4-plane displaybuffer. -;; -;; Bitblits the image stored in buffer to the display -;; buffer. ASSUMPTION: buffer and the displaybuffer -;; are equally large and thus left, top etc. pertains -;; to the same offsets. -;; -;; Medley has a packed bitmap structure. Dosbbt2 assumes -;; that we are operating in 4-plane mode. The medley -;; bitmap is blitted to the first plane of the display. -;; Thus the bitmap appears black and white. -;; -;; -;; C-CALL: void Dosbbt2( ... ); -;; RETURN: 0 in eax. should be ignored... -;; ************************************************** -dsp = 8 -buffer = 12 -left = 16 -top = 20 -swidth = 24 -height = 28 - -left32 = -8 -width32 = -12 -endptr = -16 -desttop = -20 -dstincr = -24 -srcincr = -28 -tmpheight = -32 -switchr = -36 - -PUBLIC Dosbbt2 -Dosbbt2 PROC NEAR - ;;; ***************************** - ;;; Save the volatile environment - ;;; ***************************** - enter 36,0 - push ebx - push ecx - push edx - push esi - push edi - - mov edx, dsp[ebp] - - ;; Adjust the arguments to fit inside the display - ;; if left > displaywidth then exit - mov eax, [edx.Disp.RegWidth] - cmp left[ebp], eax - jg allbye - - ;; if 0 > (width + left) then exit - mov eax, left[ebp] - add eax, swidth[ebp] - cmp eax, 0 - jl allbye - - ;; if top > displayheight then exit - mov eax, [edx.Disp.RegHeight] - cmp top[ebp], eax - jg allbye - - ;; if 0 > (top + height) then exit - mov eax, top[ebp] - add eax, height[ebp] - cmp eax, 0 - jl allbye - - ;; if 0 > left then clipleft - mov eax, left[ebp] - cmp eax, 0 - jl clipleft2 - -tstwdt2: ;; if (left + swidth) > displaywidth then clipwidth - mov eax, left[ebp] - add eax, swidth[ebp] - cmp eax, [edx.Disp.RegWidth] - jg clipwidth2 - -tsttop2: ;; if 0 > top then cliptop - mov eax, top[ebp] - cmp eax, 0 - jl cliptop2 - -tsthit2: ;; if (top + height) > displayheight then clipbottom - mov eax, top[ebp] - add eax, height[ebp] - cmp eax, [edx.Disp.RegHeight] - jg clipbtm2 - jmp startpt - -clipleft2: - mov DWORD PTR left[ebp], 0 - jmp tstwdt2 - -clipwidth2: - mov eax, [edx.Disp.RegWidth] - sub eax, left[ebp] - mov swidth[ebp], eax - jmp tsttop2 - -cliptop2: - mov DWORD PTR top[ebp], 0 - jmp tsthit2 - -clipbtm2: - mov eax, [edx.Disp.RegHeight] - sub eax, top[ebp] - mov height[ebp], eax - - ;; Calculate byte offset into bitmap -startpt: - mov eax, [edx.Disp.RegWidth] - imul eax, top[ebp] - add eax, left[ebp] - sar eax, 5 ; Make it a byte address on dword boundaries. - sal eax, 2 - - ;; Calculate which bank to start in. - push eax - push ecx - mov ecx, [edx.DisplaySegMagnitude] - sar eax, cl - mov DWORD PTR bank[ebp], eax - pop ecx - pop eax - - ;; Set dst and src start - mov edi, eax - mov esi, eax - add esi, buffer[ebp] - - ;; Set dst and src incr - mov eax, left[ebp] - add eax, swidth[ebp] - add eax, 1fh - sar eax, 5 - mov ebx, left[ebp] - sar ebx, 5 - sub eax, ebx - mov width32[ebp], eax ; width32 is width in dwords - sal eax, 2 ; Make width32 a byteadr on dword boundaries. - mov ebx, [edx.Disp.RegWidth] - sar ebx, 3 - sub ebx, eax - - ;; {dst,src}incr is what to add to {esi,edi} to get to the new line - mov dstincr[ebp], ebx - mov srcincr[ebp], ebx - - ;; Adjust top to be inside the startbank - push eax - mov eax, [edx.LinesPerBank] - dec eax - and DWORD PTR top[ebp], eax - pop eax - -Newbank2: - ;; Set the bank - ;; Use VESA int procedure to do this. - mov edx, DWORD PTR bank[ebp] - mov bx, 0 - mov ax,4f05h - int 10h - mov edx, dsp[ebp] ;Restore edx. - - - ;; Adjust dst to be within axxxxh - push eax - mov eax, [edx.DisplaySegSize] - dec eax - and edi, eax - add edi, [edx.DisplayStartAddr] - pop eax - - ;; XX - mov ebx, height[ebp] - mov eax, top[ebp] - add eax, ebx - cmp eax, [edx.LinesPerBank] - jle doit - - mov ebx, [edx.LinesPerBank] - sub ebx, top[ebp] - -doit: - mov DWORD PTR top[ebp], 0 - mov tmpheight[ebp], ebx - sub height[ebp], ebx - -Newline2: - mov ecx, width32[ebp] ; swidth into ecx - -Dumpline2: - lodsd ; Load eax and increment esi - xchg ah,al ; Swap low byte - rol eax,10h ; Get the high byte into position - xchg ah,al ; Swap again - not eax ; In medley 1=black 0=white, Hence invert. - stosd ; Store eax and increment edi - loop Dumpline2 - - ;; calc vals for src and dest for the next line. - add edi, dstincr[ebp] - add esi, srcincr[ebp] - dec DWORD PTR tmpheight[ebp] - jg Newline2 - - inc DWORD PTR bank[ebp] - - cmp DWORD PTR height[ebp], 0 - jg Newbank2 - -allbye: - pop edi - pop esi - pop edx - pop ecx - pop ebx - RET2C 0 -Dosbbt2 ENDP - -;; ************************************************** -;; ************************************************** -;; D o s b b t 3 -;; arg1: dsp (pointer to a dsp struct) -;; arg2: buffer (pointer to array of word) -;; arg3: left (dword) (in pixels) -;; arg4: top (dword) (in pixels) -;; arg5: swidth (dword) (in pixels) -;; arg6: height (dword) (in pixels) -;; -;; Bitblits the image stored in buffer to the display -;; buffer. ASSUMPTION: buffer and the displaybuffer -;; are equally large and thus left, top etc. pertains -;; to the same offsets. -;; -;; Medley has a packed bitmap structure. Dosbbt3 assumes -;; that we are operating in 4-plane mode. The medley -;; bitmap is blitted to the first plane of the display. -;; Thus the bitmap appears black and white. -;; -;; -;; C-CALL: void Dosbbt3( ... ); -;; RETURN: 0 in eax. should be ignored... -;; ************************************************** -dsp = 8 -buffer = 12 -left = 16 -top = 20 -swidth = 24 -height = 28 - -srcend = -8 - -PUBLIC Dosbbt3 -Dosbbt3 PROC NEAR - ;;; ***************************** - ;;; Save the volatile environment - ;;; ***************************** - enter 32,0 - push ebx - push ecx - push edx - push esi - push edi - - ;;; Set up the dsp in edx - mov edx, dsp[ebp] - - ;;; Adjust left to be a byte offset at a dword boundary - ;;; - Not needed. We shove bytes at byte boundaries - - ;;; Adjust width to be a byte offset at a dword boundary - ;;; - Not needed. We shove bytes at byte boundaries - - ;;; Calculate start index for src - mov eax, top[ebp] - imul eax, [edx.BytesPerLine] - add eax, left[ebp] - mov esi, eax - - ;;; Calculate start index for dst. - mov edi, eax - - ;;; Calculate end address for src - mov eax, top[ebp] - add eax, height[ebp] - imul eax, [edx.BytesPerLine] - add eax, buffer[ebp] - mov srcend[ebp], eax - - ;;; Calculate the dstincr, ie. what to add to dst to - ;;; get to the next line - mov eax, [edx.BytesPerLine] - sub eax, swidth[ebp] - mov dstincr[ebp], eax - - ;;; Calculate the srcincr, ie. what to add to src to - ;;; get to the next line - mov srcincr[ebp], eax - - ;;; Calculate the start address for the src - ;; We already know the byte index. Easy calculat'n - add esi, buffer[ebp] ;esi now points to src - -Newbank3: - ;; Set the bank - mov eax, esi ; 1. Calculate the index. - sub eax, buffer[ebp] - sar eax, 10h ; 2. Divide by "bytes-per-buffer" - ; WARNING! this implies buffersize. - mov dx, 3cdh - out dx, ax ; 3. Set the port. - mov edx, dsp[ebp] ; Reinstate edx - - ;; Adjust dst to be within the bank. - and edi, [edx.DisplaySegSize] - or edi, [edx.DisplayStartAddr] - -Newline3: - mov ecx, swidth[ebp] ; width into ecx - rep movsb ; Dump a line to the display - - ;; calc vals for src and dest for the next line. - add edi, dstincr[ebp] - add esi, srcincr[ebp] - - ;; End of block? - cmp esi, srcend[ebp] - jge QuitThis ; Yes, scram. - - ;; End of bank ? - cmp ax, 0 - jge Newline3 ; No. Blit a new line. - mov edi, esi ; Yes. Reload edi, - jmp Newbank3 ; and blit a new line. - -QuitThis: - pop edi - pop esi - pop edx - pop ecx - pop ebx - RET2C 0 -Dosbbt3 ENDP - -CODE ENDS -END diff --git a/src/vesainit.c b/src/vesainit.c deleted file mode 100644 index 5ad44efc..00000000 --- a/src/vesainit.c +++ /dev/null @@ -1,452 +0,0 @@ -/* $Id: vesainit.c,v 1.2 1999/01/03 02:07:44 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1992, 1993, 1994, 1995 Venue. All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -/************************************************************************/ -/* */ -/* V E S A I N I T . C */ -/* */ -/* Using VESA calls, initialize the (S)VGA for Medley's use. */ -/* */ -/************************************************************************/ - -#include /* #pragma interrupt & _get_stk_frame */ -#include -#include /* _XSTACK struct definition */ -#include -#include -#include -#include - -#include "dbprint.h" -#include "lispemul.h" -#include "devif.h" - -#define VESA 0x4f -#define SUCESS 0x00 -/* VESA functions */ -#define _DESCRIBEMODE 0x1 -#define _SETMODE 0x2 -#define _GETCURRENTMODE 0x3 - -/* VESA modevector indexes */ -#define _DISPLAYWIDTH 0x12 -#define _DISPLAYHEIGHT 0x14 -#define _COLORPLANES 0x18 -#define _BITSPERPIXEL 0x19 - -#define VESA_MODE_SUPPORTED_P(vector) ((((short *)vector)[0] & 1) ? TRUE : FALSE) -#define VESA_OPT_INFO_P(vector) ((((short *)vector)[0] & 2) ? TRUE : FALSE) -#define VESA_COLOR_MODE_P(vector) ((((short *)vector)[0] & 4) ? TRUE : FALSE) -#define VESA_GRAPHICS_MODE_P(vector) ((((short *)vector)[0] & 8) ? TRUE : FALSE) -#define VESA_SWITCH_BANK(vector) ((PFV)(((long *)vector)[3])) -#define VESA_DSP_SEGSIZE(vector) ((long)(0xffff & ((short *)vector)[3])) -#define VESA_DSP_STARTSEG_A(vector) ((long)(0xffff & ((short *)vector)[4])) -#define VESA_DSP_WIDTH(vector) ((long)(((short *)vector)[9])) -#define VESA_DSP_HEIGHT(vector) ((long)(((short *)vector)[10])) -#define VESA_DSP_COLORS(vector) ((long)(1 << (((char *)vector)[0x19]))) -#define VESA_DSP_BPP(vector) ((long)(((char *)vector)[0x19])) -#define VESA_DSP_NUM_OF_BANKS(vector) ((long)(((char *)vector)[0x1a])) -#define VESA_DSP_BANK_SIZE(vector) ((long)(((char *)vector)[0x1c])) - -#define MAKE_SEG(low_flat) ((FP_OFF(low_flat) & 0xfffffff0) >> 4) -#define MAKE_OFF(low_flat) (FP_OFF(low_flat & 0x0000000f)) - -#pragma interrupt(VESA_Intrpt_Hndlr) /* int 0x10 intercept */ - -extern DLword *DisplayRegion68k; -extern DLword *DisplayRegion68k_end_addr; -extern DspInterface currentdsp; -extern void docopy(); - -extern PFUL GenericReturnT(); -extern void GenericPanic(); -extern unsigned long VGA_not_color(); -extern void VGA_exit(); -extern unsigned long Dosbbt1(); -extern unsigned long Dosbbt2(); -extern unsigned long Dosbbt3(); -extern void Dosclearbanks(); -extern long DOSCursorVisible(); -extern long dos_cursor_invisible(); -extern int dostaking_mouse_down(); -extern int dostaking_mouse_up(); - -void VESA_Intrpt_Hndlr(void); -void *VESA_prev_hndlr; /* addr of previous 0x10 intercept */ - -extern int dosdisplaymode; - -/**************************************************************/ -/* V E S A _ c a l l */ -/* General utility function for doing a BIOS call to the VESA */ -/* bios. */ -/**************************************************************/ -int VESA_call(int class, int subfunc) -{ - union REGS inregs, outregs; - - inregs.h.ah = VESA; - inregs.h.al = class; - inregs.x.bx = subfunc; - int86(0x10, &inregs, &outregs); - return ((outregs.h.al == VESA) && (outregs.h.ah == SUCESS)); -} - -unsigned long set_DAC_color(LispPTR args[]) -{ - union REGS inregs, outregs; - - inregs.x.ax = 0x1010; - inregs.x.bx = (unsigned char)(args[0] & 0xff); - inregs.h.dh = (unsigned char)(args[1] & 0xff); - inregs.h.ch = (unsigned char)(args[2] & 0xff); - inregs.h.cl = (unsigned char)(args[3] & 0xff); - int86(0x10, &inregs, &outregs); -} - -/**************************************************************/ -/* V E S A _ c u r r e n t m o d e */ -/* Returns the current VESA mode for the display. */ -/* Modes defined to date are: */ -/* 0x100 640x400 & 256 colors (Not tested yet) */ -/* 0x101 640x480 & 256 colors */ - -/* 0x102 800x600 & 16 colors */ -/* 0x103 800x600 & 256 colors (Not tested yet) */ - -/* 0x104 1024x768 & 16 colors */ -/* 0x105 1024x768 & 256 colors (Not tested yet) */ - -/* 0x106 1280x1024 & 16 colors (Not tested yet) */ -/* 0x107 1280x1024 & 256 colors (Not tested yet) */ -/* */ -/**************************************************************/ -int VESA_currentmode() { - union REGS inregs, outregs; - - inregs.h.ah = VESA; - inregs.h.al = _GETCURRENTMODE; - inregs.x.bx = 0; - int86(0x10, &inregs, &outregs); - if ((outregs.h.al == VESA) && (outregs.h.ah == SUCESS)) { - return (outregs.x.bx); - } else { - return (FALSE); - } -} - -int VESA_setmode(int mode, int clearscreen) -{ - union REGS inregs, outregs; - - inregs.h.ah = VESA; - inregs.h.al = _SETMODE | ((clearscreen) ? 0x8000 : 0); - inregs.x.bx = mode; - int86(0x10, &inregs, &outregs); - return ((outregs.h.al == VESA) && (outregs.h.ah == SUCESS)); -} - -#define VESABUFLEN 256 -char VESAmodevector[VESABUFLEN]; -char *VESAmodebytes = VESAmodevector; - -/* VESA_describemode */ -int VESA_describemode(int mode) -{ - union REGS inregs, outregs; - int i; - unsigned buf; - - TPRINT(("Enter VESA_describemode\n")); - VESA_prev_hndlr = _dos_getvect(0x10); /* get current 10 intercept, if any */ - _dos_setvect(0x10, VESA_Intrpt_Hndlr); /* install our int 10 intercept */ - - if (_dos_allocmem(VESABUFLEN, &buf) != 0) return (-1); - - inregs.w.eax = 0x4f01; - inregs.w.ebx = buf; - inregs.w.ecx = mode; - int86(0x10, &inregs, &outregs); - - if (outregs.x.ax == VESA) { - for (i = 0; i < VESABUFLEN; i++) { VESAmodebytes[i] = ((char *)buf)[i]; } - } else { - return (-1); - } - - _dos_freemem(buf); /* release the buffer */ - _dos_setvect(0x10, VESA_prev_hndlr); /* re-install previous 10 intercept */ - TPRINT(("Exit VESA_describemode\n")); - return (0); -} - -void VESA_Intrpt_Hndlr(void) { - int inbuffer, func; - _XSTACK *stk_ptr; - - /* get ptr to _XSTACK - regs, etc */ - stk_ptr = (_XSTACK *)_get_stk_frame(); - - func = (unsigned short)stk_ptr->eax; /* get function */ - - if (((stk_ptr->flg & _FLAG_VM) == 0) /* process only if NOT virtual mode*/ - && (func == 0x4f01)) { /* AND only if func 4f */ - inbuffer = stk_ptr->ebx; /* get ebx as passed (flat addr) */ - stk_ptr->edi = MAKE_OFF(inbuffer); /* convert to seg:off form */ - stk_ptr->es = MAKE_SEG(inbuffer); /* service requires it in es:di */ - - ((PFV)VESA_prev_hndlr)(); /* call VESA getmode */ - } else { - _chain_intr(VESA_prev_hndlr); /* always best to chain to prev int*/ - } -} - -void VESA_beforeraid(DspInterface dsp) -{ - TPRINT(("Enter VESA_beforeraid\n")); - _setvideomode(_DEFAULTMODE); - _clearscreen(_GCLEARSCREEN); - TPRINT(("Exit VESA_beforeraid\n")); -} - -void VESA_afterraid(DspInterface dsp) -{ - TPRINT(("Enter VESA_afterraid\n")); - VESA_setmode(dsp->graphicsmode, TRUE); - TPRINT(("Exit VESA_afterraid\n")); -} - -void VESA_enter(DspInterface dsp) -{ - union REGS regs; - - TPRINT(("Enter VESA_enter\n")); - VESA_setmode(dsp->graphicsmode, TRUE); - if (!((VESA_describemode(dsp->graphicsmode) == 0))) { - _setvideomode(_DEFAULTMODE); - _clearscreen(_GCLEARSCREEN); - fprintf(stderr, "Can't set VESA mode %o.\n", dsp->graphicsmode); - exit(0); - } - /* Get the segaddr. An addr. is a seg shifted 4 bits! */ - dsp->DisplayStartAddr = VESA_DSP_STARTSEG_A(VESAmodebytes) << 4; - /* Get the size. */ - dsp->DisplaySegSize = (VESA_DSP_SEGSIZE(VESAmodebytes) << 10); - - /* How many bits in the segment addr. */ - switch (VESA_DSP_SEGSIZE(VESAmodebytes)) { - case 64: dsp->DisplaySegMagnitude = 0x10; break; - case 128: dsp->DisplaySegMagnitude = 0x11; break; - case 256: dsp->DisplaySegMagnitude = 0x12; break; - } - - dsp->SwitchBank = NULL; - - if (VESA_OPT_INFO_P(VESAmodebytes)) { - dsp->Display.width = VESA_DSP_WIDTH(VESAmodebytes); - dsp->Display.height = VESA_DSP_HEIGHT(VESAmodebytes); - } else { /* Drat! No optional info. Hardcode. */ - switch (dsp->graphicsmode) { - case 0x100: - dsp->Display.width = 640; - dsp->Display.height = 400; - break; - case 0x101: - dsp->Display.width = 640; - dsp->Display.height = 480; - break; - case 0x102: - case 0x103: - dsp->Display.width = 800; - dsp->Display.height = 600; - break; - case 0x104: - case 0x105: - dsp->Display.width = 1024; - dsp->Display.height = 768; - break; - case 0x106: - case 0x107: - dsp->Display.width = 1280; - dsp->Display.height = 1024; - break; - } - } - dsp->colors = VESA_DSP_COLORS(VESAmodebytes); - dsp->bitsperpixel = VESA_DSP_BPP(VESAmodebytes); - dsp->numberofbanks = VESA_DSP_NUM_OF_BANKS(VESAmodebytes); - - /* Assumption: 8 bits per pixel */ - dsp->LinesPerBank = 8 * (dsp->DisplaySegSize / dsp->Display.width); - - _dpmi_lockregion(¤tdsp, sizeof(currentdsp)); - _dpmi_lockregion(&DisplayRegion68k, sizeof(DisplayRegion68k)); - _dpmi_lockregion(DisplayRegion68k, 1600 * 1208 / 8); - - /* These are needed in the interrupt processing. Lock'em to prevent pagefaults. */ - _dpmi_lockregion(dsp, sizeof(*dsp)); - _dpmi_lockregion(dsp->bitblt_to_screen, 0x2000); - _dpmi_lockregion(dsp->mouse_invisible, 0x2000); - _dpmi_lockregion(dsp->mouse_visible, 0x2000); - _dpmi_lockregion((void *)&docopy, 0x2000); - - TPRINT(("Exit VESA_enter\n")); -} - -void VESA_exit(DspInterface dsp) -{ - TPRINT(("Enter VESA_exit\n")); - /* Unlock the following to avoid waste of mainmem. */ - _dpmi_unlockregion(¤tdsp, sizeof(currentdsp)); - _dpmi_unlockregion(&DisplayRegion68k, sizeof(DisplayRegion68k)); - _dpmi_unlockregion(DisplayRegion68k, 1600 * 1208 / 8); - - _dpmi_unlockregion(dsp->bitblt_to_screen, 0x2000); - _dpmi_unlockregion(dsp->mouse_invisible, 0x2000); - _dpmi_unlockregion(dsp->mouse_visible, 0x2000); - _dpmi_unlockregion((void *)&docopy, 0x2000); - _dpmi_unlockregion(dsp, sizeof(*dsp)); - - _setvideomode(_DEFAULTMODE); - _clearscreen(_GCLEARSCREEN); - TPRINT(("Exit VESA_exit\n")); -} - -VESA_errorexit(char *s, int errno) -{ - _setvideomode(_DEFAULTMODE); - _clearscreen(_GCLEARSCREEN); - fprintf(stderr, s); - fflush(stderr); - exit(errno); -} - -void tmpclearbanks(DspInterface dsp) -{ - TPRINT(("Enter tmpclearbanks\n")); - /* Dosclearbanks(dsp); */ - TPRINT(("Exit tmpclearbanks\n")); -} - -unsigned long tmpbbt(DspInterface dsp, char *buffer, long left, long top, long swidth, long height) -{ - TPRINT(("Enter tmpbbt\n")); - TPRINT(("Mode display is: %d\n", dsp->graphicsmode)); - TPRINT(("dsp->Display.width = %d\n", dsp->Display.width)); - TPRINT(("dsp->Display.height = %d\n", dsp->Display.height)); - TPRINT(("left = %d, top = %d, swidth = %d, height = %d\n", left, top, swidth, height)); - (Dosbbt3)(dsp, buffer, left, top, swidth, height); - TPRINT(("Exit tmpbbt\n")); -} - -void VESA_init(DspInterface dsp, char *lispbitmap, int width_hint, int height_hint, int depth_hint) -{ - TPRINT(("Enter VESA_init\n")); - /* Kludge. going away soon. */ - dsp->graphicsmode = dosdisplaymode; - - /* A graphics mode is requested. Test its validity */ - if (dsp->graphicsmode == 0) { - /* No mode requested. Find a suitable mode from hints. */ - switch (depth_hint) { - case 0: - case 1: - if ((VESA_describemode(0x104) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) - dsp->graphicsmode = 0x104; - else if ((VESA_describemode(0x102) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) - dsp->graphicsmode = 0x102; - else - VESA_errorexit("Displaymode not supported", -1); - break; - case 8: - if ((VESA_describemode(0x105) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) { - dsp->graphicsmode = 0x105; - } else if ((VESA_describemode(0x103) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) { - dsp->graphicsmode = 0x103; - } else if ((VESA_describemode(0x101) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) { - dsp->graphicsmode = 0x101; - } else if ((VESA_describemode(0x100) == 0) && (VESA_MODE_SUPPORTED_P(VESAmodevector))) { - dsp->graphicsmode = 0x100; - } else - VESA_errorexit("Displaymode not supported", -1); - break; - default: VESA_errorexit("Requested display depth not supported", -1); - } - } else if (!((VESA_describemode(dsp->graphicsmode) == 0) && - (VESA_MODE_SUPPORTED_P(VESAmodevector)))) { - VESA_errorexit("Can't find suitable VESA mode.\n", -1); - } - - switch (dsp->graphicsmode) { - case 0x100: - case 0x101: - dsp->BytesPerLine = 640; - dsp->bitblt_to_screen = &tmpbbt; - break; - case 0x102: - dsp->BytesPerLine = 100; - dsp->bitblt_to_screen = &Dosbbt1; - break; - case 0x103: - dsp->BytesPerLine = 800; - dsp->bitblt_to_screen = &tmpbbt; - break; - case 0x104: - dsp->BytesPerLine = 128; - dsp->bitblt_to_screen = &Dosbbt2; - break; - case 0x105: - dsp->BytesPerLine = 1024; - dsp->bitblt_to_screen = &tmpbbt; - break; - case 0x106: - dsp->BytesPerLine = 160; - dsp->bitblt_to_screen = &Dosbbt2; - break; - case 0x107: - dsp->BytesPerLine = 1280; - dsp->bitblt_to_screen = &tmpbbt; - break; - default: VESA_errorexit("Displaymode not supported", -1); - } - - TPRINT(("Mode display is: %d\n", dsp->graphicsmode)); - - dsp->device.locked = FALSE; - dsp->device.active = FALSE; - - dsp->device.enter = &VESA_enter; - dsp->device.exit = &VESA_exit; - - dsp->device.before_raid = &VESA_beforeraid; - dsp->device.after_raid = &VESA_afterraid; - - dsp->drawline = &GenericPanic; - - dsp->cleardisplay = &tmpclearbanks; - - dsp->get_color_map_entry = &VGA_not_color; - dsp->set_color_map_entry = &set_DAC_color; - dsp->available_colors = &VGA_not_color; - dsp->possible_colors = &VGA_not_color; - - dsp->medley_to_native_bm = (PFUL)&GenericPanic; - dsp->native_to_medley_bm = (PFUL)&GenericPanic; - - dsp->bitblt_from_screen = (PFUL)&GenericPanic; - dsp->scroll_region = (PFUL)&GenericPanic; - - dsp->mouse_invisible = (PFV)&dostaking_mouse_down; - dsp->mouse_visible = (PFV)&dostaking_mouse_up; - - TPRINT(("Exit VESA_init\n")); -} diff --git a/src/vgainit.c b/src/vgainit.c deleted file mode 100644 index b9824fac..00000000 --- a/src/vgainit.c +++ /dev/null @@ -1,147 +0,0 @@ -/* $Id: vgainit.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989, 1990, 1990, 1991, 1992, 1993, 1994, 1995 Venue. */ -/* All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -#include -#include -#include "lispemul.h" -#include "devif.h" - -extern unsigned long Dosbbt1(); -extern unsigned long Dosbbt2(); -extern int dostaking_mouse_down(); -extern int dostaking_mouse_up(); - -extern DLword *DisplayRegion68k; -extern DLword *DisplayRegion68k_end_addr; -extern DspInterface currentdsp; -extern void docopy(); - -extern void GenericPanic(); - -void VGA_setmax(DspInterface dsp) -{ - struct videoconfig vc; - - if (!_setvideomode(_MAXRESMODE)) { - fprintf(stderr, "Can't set graphics mode.\n"); - exit(1); - } - _getvideoconfig(&vc); - dsp->Display.width = vc.numxpixels; - dsp->Display.height = vc.numypixels; - dsp->bitsperpixel = vc.bitsperpixel; - dsp->colors = vc.numcolors; - - /* These are needed in the interrupt processing. Lock'em to prevent pagefaults. */ - _dpmi_lockregion(¤tdsp, sizeof(currentdsp)); - _dpmi_lockregion(&DisplayRegion68k, sizeof(DisplayRegion68k)); - _dpmi_lockregion(DisplayRegion68k, 1600 * 1208 / 8); - - /* These are needed in the interrupt processing. Lock'em to prevent pagefaults. */ - _dpmi_lockregion(dsp, sizeof(*dsp)); - _dpmi_lockregion(dsp->bitblt_to_screen, 0x2000); - _dpmi_lockregion(dsp->mouse_invisible, 0x2000); - _dpmi_lockregion(dsp->mouse_visible, 0x2000); - _dpmi_lockregion((void *)&docopy, 0x2000); -} - -void VGA_exit(DspInterface dsp) -{ - /* Unlock the following to avoid waste of mainmem. */ - _dpmi_unlockregion(¤tdsp, sizeof(currentdsp)); - _dpmi_unlockregion(&DisplayRegion68k, sizeof(DisplayRegion68k)); - _dpmi_unlockregion(DisplayRegion68k, 1600 * 1208 / 8); - - /* These are needed in the interrupt processing. Lock'em to prevent pagefaults. */ - _dpmi_unlockregion(dsp, sizeof(*dsp)); - _dpmi_unlockregion(dsp->bitblt_to_screen, 0x2000); - _dpmi_unlockregion(dsp->mouse_invisible, 0x2000); - _dpmi_unlockregion(dsp->mouse_visible, 0x2000); - _dpmi_unlockregion((void *)&docopy, 0x2000); - - _setvideomode(_DEFAULTMODE); - _clearscreen(_GCLEARSCREEN); -} - -unsigned long VGA_not_color(DspInterface dsp) -{ - printf("Colormode not set!\n"); - fflush(stdout); - return (0); -} - -unsigned long VGA_colornum(DspInterface dsp) -{ /* Return the number of available colors */ - return (1 << dsp->bitsperpixel); -} - -unsigned long VGA_possiblecolors(DspInterface dsp) -{ return (dsp->colors); } - -void VGA_mono_drawline(DspInterface dsp, unsigned long startX, unsigned long startY, unsigned long width, unsigned long height, - int function, unsigned long color, unsigned long thickness, int butt, - unsigned long clipX, unsigned long clipY, unsigned long clipWidth, unsigned long clipHeight, - LispPTR *dashing) -{ - _moveto_w(startX, startY); - _lineto_w(width, height); -} - -void VGA_color_drawline(DspInterface dsp, unsigned long startX, unsigned long startY, unsigned long width, unsigned long height, - int function, unsigned long color, unsigned long thickness, int butt, - unsigned long clipX, unsigned long clipY, unsigned long clipWidth, unsigned long clipHeight, - LispPTR *dashing) - -{} - -void VGA_cleardisplay(DspInterface dsp) -{ _clearscreen(_GCLEARSCREEN); } - -VGA_init(DspInterface dsp, char *lispbitmap, int width_hint, int height_hint, int depth_hint) -{ - struct videoconfig vc; - - dsp->device.enter = (PFV)&VGA_setmax; - dsp->device.exit = (PFV)&VGA_exit; - - dsp->device.before_raid = (PFV)&VGA_exit; - dsp->device.after_raid = (PFV)&VGA_setmax; - - dsp->drawline = (PFV)&VGA_mono_drawline; - - dsp->cleardisplay = (PFV)&VGA_cleardisplay; - - dsp->get_color_map_entry = (PFUL)&VGA_not_color; - dsp->set_color_map_entry = (PFUL)&VGA_not_color; - dsp->available_colors = (PFUL)&VGA_not_color; - dsp->possible_colors = (PFUL)&VGA_not_color; - - dsp->medley_to_native_bm = (PFUL)&GenericPanic; - dsp->native_to_medley_bm = (PFUL)&GenericPanic; - - dsp->bitblt_to_screen = (PFUL)&Dosbbt1; - dsp->bitblt_from_screen = (PFUL)&GenericPanic; - dsp->scroll_region = (PFUL)&GenericPanic; - - dsp->DisplayStartAddr = 0xa0000; - dsp->DisplaySegSize = 0x10000; /* 64K segments */ - dsp->DisplaySegMagnitude = 0x10; /* How many bits in the addr. */ - dsp->BytesPerLine = 80; - dsp->LinesPerBank = 512; - - dsp->mouse_invisible = (PFV)&dostaking_mouse_down; - dsp->mouse_visible = (PFV)&dostaking_mouse_up; - - dsp->device.locked = FALSE; - dsp->device.active = FALSE; -} diff --git a/src/vmemsave.c b/src/vmemsave.c index f6f2da6f..16dac78f 100644 --- a/src/vmemsave.c +++ b/src/vmemsave.c @@ -22,19 +22,11 @@ #include #include #include -#ifndef DOS #include #include #include #include #include -#else -#include -#include -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEN _MAX_PATH -#define alarm(x) 1 -#endif /* DOS */ #if defined(SUNDISPLAY) && defined(OLD_CURSOR) #include @@ -78,10 +70,6 @@ extern int LispWindowFd; extern struct pixrect *CursorBitMap, *InvisibleCursorBitMap; extern struct cursor CurrentCursor, InvisibleCursor; extern IFPAGE *InterfacePage; -#ifdef DOS -extern IOPAGE *IOPage68K; -extern DspInterface currentdsp; -#endif /* DOS */ #undef roundup #define roundup(a, b) ((((unsigned)(a) + (b)-1) / (b)) * (b)) @@ -151,12 +139,7 @@ LispPTR vmem_save0(LispPTR *args) { register char *def; char pathname[MAXPATHLEN], sysout[MAXPATHLEN], host[MAXNAMLEN]; -#ifdef DOS - char pwd[MAXNAMLEN]; - char drive[1]; -#else struct passwd *pwd; -#endif /* DOS */ Lisp_errno = &Dummy_errno; @@ -164,34 +147,19 @@ LispPTR vmem_save0(LispPTR *args) /* Check of lispstringP is safer for LispStringToCString */ LispStringToCString(args[0], pathname, MAXPATHLEN); separate_host(pathname, host); -#ifdef DOS - if (!unixpathname(pathname, sysout, 0, 0, drive, 0, 0)) return (BADFILENAME); -#else if (!unixpathname(pathname, sysout, 0, 0)) return (BADFILENAME); -#endif /* DOS */ return (vmem_save(sysout)); } else { if ((def = getenv("LDEDESTSYSOUT")) == 0) { -#ifdef DOS - if (getcwd(pwd, MAXNAMLEN) == NULL) return (FILETIMEOUT); - strcpy(sysout, pwd); - strcat(sysout, "/lisp.vm"); -#else pwd = getpwuid(getuid()); /* NEED TIMEOUT */ if (pwd == (struct passwd *)NULL) return (FILETIMEOUT); strcpy(sysout, pwd->pw_dir); strcat(sysout, "/lisp.virtualmem"); -#endif /* DOS */ } else { if (*def == '~' && (*(def + 1) == '/' || *(def + 1) == '\0')) { -#ifdef DOS - if (getcwd(pwd, MAXNAMLEN) == NULL) return (FILETIMEOUT); - strcpy(sysout, pwd); -#else pwd = getpwuid(getuid()); /* NEED TIMEOUT */ if (pwd == (struct passwd *)NULL) return (FILETIMEOUT); strcpy(sysout, pwd->pw_dir); -#endif /* DOS */ strcat(sysout, def + 1); } else { strcpy(sysout, def); @@ -322,13 +290,11 @@ LispPTR vmem_save(char *sysout_file_name) #ifdef SUNDISPLAY /* DLword *bmptr; */ #endif -#ifndef DOS extern int ScreenLocked; extern DLword *EmCursorX68K; extern DLword *EmCursorY68K; extern DLword NullCursor[]; extern DLword *EmCursorBitMap68K; -#endif /* DOS */ /* remove cursor image from screen */ @@ -342,12 +308,7 @@ LispPTR vmem_save(char *sysout_file_name) EmCursorBitMap68K= NullCursor;*/ #endif /* OLD_CURSOR */ -#elif DOS - /* For DOS, must also take the mouse cursor away (it's */ - /* written into the display-region bitmap). */ - currentdsp->device.locked++; - (currentdsp->mouse_invisible)(currentdsp, IOPage68K); -#endif /* SUNDISPLAY || DOS */ +#endif /* SUNDISPLAY */ /* set FPTOVP */ fptovp = FPtoVP + 1; @@ -363,12 +324,7 @@ LispPTR vmem_save(char *sysout_file_name) */ SETJMP(FILETIMEOUT); -#ifdef DOS - /* Bloddy 8 char filenames in dos ... /jarl */ - make_old_version(tempname, sysout_file_name); -#else /* DOS */ sprintf(tempname, "%s-temp", sysout_file_name); -#endif /* DOS */ /* Confirm protection of specified file by open/close */ @@ -525,11 +481,6 @@ LispPTR vmem_save(char *sysout_file_name) ScreenLocked = NIL; #endif /* OLD_CURSOR */ -#elif DOS - /* Must also put the mouse back. */ - (currentdsp->mouse_visible)(IOPage68K->dlmousex, IOPage68K->dlmousey); - currentdsp->device.locked--; - #endif /* SUNDISPLAY */ /*printf("vmem is saved completely.\n");*/ @@ -563,8 +514,5 @@ void lisp_finish() { /* if (UnixPID >= 0) kill(UnixPID, SIGKILL);*/ /* Then kill fork_Unix itself */ } device_before_exit(); -#ifdef DOS - exit_host_filesystem(); -#endif /* DOS */ exit(1); } diff --git a/src/xc.c b/src/xc.c index e1a5af4c..01d31cdc 100644 --- a/src/xc.c +++ b/src/xc.c @@ -24,13 +24,7 @@ #include #include -#ifdef DOS -#include /* Defines "#pragma interrupt" */ -#include /* _XSTACK struct definition */ -#include /* Defines REGS & other structs */ -#else /* DOS */ #include -#endif /* DOS */ #include "lispemul.h" #include "emlglob.h" @@ -100,15 +94,6 @@ #include "vars3defs.h" #include "z2defs.h" -#ifdef DOS -#include "iopage.h" -extern IOPAGE *IOPage68K; -#include "devif.h" -extern KbdInterface currentkbd; -extern DspInterface currentdsp; -extern MouseInterface currentmouse; -#endif /* DOS */ - typedef struct conspage ConsPage; typedef ByteCode *InstPtr; @@ -117,12 +102,7 @@ register InstPtr pccache asm("si"); register LispPTR *cspcache asm("di"); register LispPTR tscache asm("bx"); #include "inlnPS2.h" -#elif (DOS && OPDISP) -#include "inlndos.h" -register InstPtr pccache asm("si"); -register LispPTR *cspcache asm("di"); -register LispPTR tscache asm("bx"); -#endif /* DOS */ +#endif /* GCC386 */ /* This used to be here for including optimized dispatch * for SPARC, but it has some other things in it, so we @@ -210,11 +190,8 @@ void dispatch(void) { }; #endif -#if (DOS && OPDISP) -#else register LispPTR *cspcache; register LispPTR tscache; -#endif /* OP_FN_COMMON arguments */ @@ -1151,49 +1128,10 @@ op_ufn : { } } -#ifdef DOS - if (currentkbd->URaid == TRUE) { - currentkbd->URaid = NIL; - (currentkbd->device.exit)(currentkbd); /* Install the original handler */ - error("Call URaid by User Interrupt"); - } else if (currentmouse->Cursor.Moved) { - union REGS regs; - - currentdsp->device.locked++; - - /* Remove the mouse from the old place on the screen */ - (currentdsp->mouse_invisible)(currentdsp, IOPage68K); - - /* Find the new delta */ - regs.w.eax = 0x000B; /* Function 0xB = get delta mickeys */ - int86(0x33, ®s, ®s); - currentmouse->Cursor.New.x += (short)regs.w.ecx; - currentmouse->Cursor.New.y += (short)regs.w.edx; - - if (currentmouse->Cursor.New.x < 0) - currentmouse->Cursor.New.x = 0; - else if (currentmouse->Cursor.New.x > (currentdsp->Display.width - 1)) - currentmouse->Cursor.New.x = currentdsp->Display.width - 1; - - if (currentmouse->Cursor.New.y < 0) - currentmouse->Cursor.New.y = 0; - else if (currentmouse->Cursor.New.y > (currentdsp->Display.height - 1)) - currentmouse->Cursor.New.y = currentdsp->Display.height - 1; - - IOPage68K->dlmousex = IOPage68K->dlcursorx = currentmouse->Cursor.New.x; - IOPage68K->dlmousey = IOPage68K->dlcursory = currentmouse->Cursor.New.y; - - /* Paint the mouse back up on the screen on the new place */ - (currentdsp->mouse_visible)(currentmouse->Cursor.New.x, currentmouse->Cursor.New.y); - currentmouse->Cursor.Moved = FALSE; - currentdsp->device.locked--; - } -#else if (URaid_req == T) { URaid_req = NIL; error("Call URaid by User Interrupt"); } -#endif /* DOS */ else if ((KBDEventFlg > 0) && (*KEYBUFFERING68k == ATOM_T)) { *KEYBUFFERING68k = ATOM_STARTED; cause_interruptcall(DOBUFFEREDTRANSITION_index);