Recently Captain Hood of Black Flag BBS asked if I could throw together a quick door that could run under Oblivion/2 for displaying ANSI scrollers in a semi slowed down fashion. You see, back in the day the speed you saw an ANSI render was essentially that of your modem -- 9600bps for example.
Here are the steps I took if anyone out there in the world needs to write a 8086 16bit DOS application in Pascal :)
Note that these instructions are from from a Elementary OS Freya x86_64 box. YMMV.
sudo apt-get install nasm subversion
To cross compile FPC, you will need FPC. I used the .dep from Lazarus on Sourceforge (You should only need fpc2.6.4-*amd64.deb)
Build the 8086-msdos cross compiler
(This is covered more extensively in the FPC wiki)
- Checkout the FPC source from TRUNK:
svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
make clean all OS_TARGET=msdos CPU_TARGET=i8086 OPT="-CX -XXs" CROSSOPT=-WmSmall BINUTILSPREFIX= PP=/usr/bin/ppcx64
make crossinstall OS_SOURCE=linux CPU_SOURCE=i386 OS_TARGET=msdos CPU_TARGET=i8086 PP=compiler/ppcross8086 CROSSOPT=-WmSmall BINUTILSPREFIX= INSTALL_PREFIX=/home/<user>/<where>/fpc-i8086/snapshot/small OPT="-CX -XXs"
Be sure to replace the value of
INSTALL_PREFIX with an appropriate path!
Repeat steps #2 & #3 replacing
-WmSmallwith the various models you wish: Medium, Large, etc. See the FPC wiki for details.
fpc.cfgfile. The default location is /etc/fpc.cfg. Make the following changes:
#ifdef cpui8086 -CX -XX -XP #endif
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
#IFDEF CPUI8086 -Fu/home/<user>/<where>/fpc-i8086/snapshot/$fpcmemorymodel/lib/fpc/$fpcversion/units/$fpctarget -Fu/home/<user>/<where>/fpc-i8086/snapshot/$fpcmemorymodel/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/home/<user>/<where>/fpc-i8086/snapshot/$fpcmemorymodel/lib/fpc/$fpcversion/units/$fpctarget/rtl #ELSE -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl #ENDIF
There is a nice Pascal package for DOS FOSSIL support called Ele Communications Kit 1.2. You can find it on the BBS archive site. Search for ELECOM12.ZIP elsewhere.
I won't get into the details of the library itself -- there is an EXAMPLE.PAS that makes it fairly clear: Open a COM port that FOSSIL is bound to, do I/O, close it. Nothing fancy.
After you have written yourself a nice little FOSSIL aware piece of source, compile as such:
fpc-i8086/ppcross8086 -WmHuge -Fu./ELEC/ SOURCE.PAS
-WmHuge with the model of your choice. The cross compiler (
ppcross8086) is found under the path you specified with
INSTALL_PREFIX of course.
As for myself, I created something super simple called SLOWMO! It's now released under Acidic modding for giggles: