Dec 122017
 
Generic source code to help you build an online program for virtually ANY BBS, including Opus, RBBS, SL, WWIV, 2am, dozens more. TP source code.
File BOI120.ZIP from The Programmer’s Corner in
Category BBS Files
Generic source code to help you build an online program for virtually ANY BBS, including Opus, RBBS, SL, WWIV, 2am, dozens more. TP source code.
File Name File Size Zip Size Zip Type
BOI120.DOC 19827 6155 deflated
BOIREG.DOC 2090 932 deflated
DOCUMENT.ZIP 12043 11584 deflated
HILO.PAS 7260 2153 deflated
READTHIS.1ST 1590 870 deflated
UNITS.ZIP 27240 26474 deflated

Download File BOI120.ZIP Here

Contents of the BOI120.DOC file


BOI Reference Manual 1.20 12/15/90


BBS Onliner Interface 1.20
(C) 1990 Andrew J. Mead
All Rights Reserved.

Contact:
POB 1155
Chapel Hill, NC 27514-1155
or
1:151/223.36 FidoNet
#[email protected] WWIVnet

Turbo Pascal and TP are registered trademarks of Borland International.
Quick Basic and QB are registered trademarks MicroSoft Incorporated.


Sections in order of Appearance
Initial Statement
ShareWare Liscense Agreement
Registration Cost
Technical Support
Registration Agreement
UNIT BIODECL
UNIT GETCMBBS
UNIT IOLIB
UNIT ASYNC
UNIT IOSUPP
UNIT SUPPORT
BOI Documentation Files
Future Enhancements
Implementation Discussion


Initial Statement
I would like to see the command line switches used by this interface
become a standard for BBS online doors. Since the BBS programmers
are not creating a standard drop file very quickly, we door programmers
will need to make do. If you are not a Turbo Pascal programmer, I
still ask that you consider implementing my command line switching
system.

The UNIT sections of this document detail the functionality of each
procedure and function contained in each unit. Unit BIODECL is
pretty much self explanatory, and looking at it directly is the
best way to get information on it.


ShareWare Liscence Agreement
This package is ShareWare. If you use this package, please send me
money. Feel free to use the ideas and code from this package, but
if you use the interface itself to any extent, place the following
on the opening or copyright screen.

BBS Onliner Interface version 1.20
(C) 1990 Andrew J. Mead
All Rights Reserved.
Contact: POB 1155 Chapel Hill, NC 27514-1155

If you alter the code, put your revision number AFTER the '1.20'
ie (version 1.20 revision 1.0). I will maintain, and steadily
update the interface. If you have any ideas, suggestions, or
improvements, please send them to me. There is plenty of room for
improvement in the interface.


Registration Costs
If you use the interface, I ask that you pay a royalty of $1U.S.
per registration. If the door you release has a registration fee
of less than $10, I waive this request. The money recieved from
the BOI will be set aside to pay for distribution of later versions
and my phone bill. If you register, I will make every effort to
make sure that you recieve every upgrade. The registration fee
for the BOI is $35.00 U.S. (and is credited against any future
royalties). There will be a Turbo C version of the interface
available in 1991. See BOIREG.DOC for registration form.


Technical Support
I am always willing to offer support. I can be reached at #[email protected]
on the WWIVnet and 1:151/223.36 on the FidoNet. A support conference
on both systems may become available if demanded. Please be specific
with your questions, and include any details you have. If someone
out there would like to help with the technical support, let me know.


UNIT BIODECL
See BIODECL.PAS for documentation. This Unit is merely a
clearing house for public variables and constants. This is used
by every other unit and the door program itself.

UNIT GETCMBBS

Uses
Dos
BOIDecl

Procedure
GetCommand

Procedure GETCOMMAND(infofile, inhof, logfile : pathstr;
gamename, version : string; programset : charset);

infofile - name of the doors documentation file.
inhof - default name for text hall of fame (can be '').
logfile - name of error log.
gamename - name of the door.
version - door version number (string).
programset - set of door defined command line arguments. Must
be in ['+','-','=','[',']','.']. These arguments are to
be processed by the door itself.

GetCommand is the front-end of the interface. it reads the
BBS dropfile, and initializes the communications settings.


UNIT IOLIB

Uses
Dos

Functions
Exist GetTimer IntStr
KeyPressed LeftTime Max
Min PadStr PortKeyPressed
ReadKey ReadPortKey RealStr
Valid WhereX WhereY

Procedures
ClearBuffers ClrPortEol ClrPortScr
Delay DoTimeOut EndPort
GetString GotoPortXY PortBackground
PortColor PortColumnOne PortWindow
ResetPortXY SendString SetPort
SetPortXY TextPortColor TimerSet

Procedure CLEARBUFFERS
ClearBuffers empties both the host keyboard and the port input
buffers. This procedure is helpful in controlling 'Type-ahead'
problems. With a 1k port input buffer, the remote user could
inadvertently lean a key putting hundreds of key-strokes into the
buffer.

Procedure CLRPORTSCR ANSI
ClearPortScr sends the ANSI code to clear the defined screen
window (PortWindow). If there is a remote user, the current
status line will be written on line 25 on the host screen.
This replaces TPs CRT ClrScr.

Procedure CLRPORTEOL ANSI
ClearPortEol sends the ANSI code to clear the current line from
the current cursor position to the right edge of the screen.

Procedure DELAY(ms : Word) BIOS
This procedure is identical to the one in TPs CRT Unit. ms
is the approxiamate time of CPU delay in milliseconds (993 per
second).

Procedure DOTIMEOUT(ringbell : boolean)
This procedure is called upon modem or user inactivity time-out.
There should be no reason for the door itself to call this procedure.
ringbell tells it to echo a bell to the remote user (if communications
still exist).

Procedure ENDPORT
EndPort should be the last line of your door program. This procedure
disables the BIO Async routines, and restores the previously
installed routines. This procedure should be called before
the program ends, especially during abnormal termination, so that
the BBSs communication routines are re-established. See SetPort.

Function EXIST(thisfile : pathstr) : boolean
Exists tells whether or not ThisFile exists or not. Should be used
in conjunction with Valid. This is a public domain function.

Procedure GETSTRING(var gstr : string)
GetString returns all characters input locally and from remote upto
the next carriage return. This is a 'dumb' procedure, and will not
reject any characters. See ReadKey and ReadPortKey.

Function GETTIMER(var basetime : longint; val : word) : boolean
basetime - clockticks since midnight (18.2 per second)
val - number of seconds

GetTimer returns true if val seconds have passed since basetime.
You must use SetTimer to initialize basetime. These two procedures
can be used for many purposes including benchmarks and user
inactivity timeouts. See SetTimer.

Procedure GOTOPORTXY(x,y : byte) ANSI
GotoPortXY uses ANSI codes to position the cursor. Replaces
TPs CRT GotoXY.

Function INTSTR(val : longint; isize : byte) : string
val - ennumerated value to convert to a string
isize - size of string

IntStr returns a string of an integer value. Best utilized by
SendString for formatted (left or right justified) output.
See SendString, PadStr, RealStr.

Function KEYPRESSED : Boolean
KeyPressed replaces TPs CRT KeyPressed. It returns true if
there is a key waiting in the local keyboard buffer. You should
use PortKeyPressed for general use.

Function LEFTTIME : integer
LeftTime returns the users current time remaining in minutes.

Function MAX (a,b : word) : word
Max returns the greater of a and b.

Function MIN (a,b : word) : word
Min returns the lesser of a and b.

Function PADSTR(pstr : string; psize : byte) : string
pstr - input string
psize - size of string

PadStr returns a right-justified string. (pstr right-justified
to psize characters). PadStr should be used with SendString for
formatted output. See SendString, IntStr, RealStr.

Procedure PORTBACKGROUND(color: byte) ANSI
PortBackground sends the ANSI color codes to change the background
color. Use the predefined color constants for this command.
This procedure replaces TPs CRT TextBackground. See PortColor.

Procedure PORTCOLOR(acolor, bcolor : byte) ANSI
PortColor allows for color/monochrome screen control. If
DoColor (See Unit BOIDecl) is true then acolor is the foreground
color, otherwise bcolor is the foreground color. bcolor should
only be lightgray or white (with or without blink).
See TextPortColor, PortBackground.

Procedure PORTCOLUMNONE ANSI
This procedure places the current at the left edge of the screen.
Same as GotoXY(1,WhereX) using TPs CRT. See ResetPortXY, SetPortXY,
WhereX, WhereY.

Function PORTKEYPRESSED
This procedure replaces the KeyPressed routine from TPs CRT.
See KeyPressed, ReadPortKey, ReadKey.

Procedure PORTWINDOW(x1,y1,x2,y2 : byte)
Replaces TPs CRT Window(x1,y1,x2,y2). Not as complete. This
procedure will be upgraded greatly in the future.

Function READKEY : char BIOS
Reads next character from local keyboard buffer. This replaces
TPs CRT ReadKey. See ReadPortKey, CheckSecondKey (Unit IOSUPP).

Function READPORTKEY : char
ReadPortKey returns the next waiting character from either the
local keyboard buffer or the port input buffer. This should
be used instead of ReadKey. This behave like TPs ReadKey except
that extended codes are not pushed into the input buffer. They
are processed by CheckSecondKey (See Unit IOSupp). This function
should only be called when the program is ready to wait for user
input (it will timeout after 2 minutes), or the program knows a
key is waiting (PortKeyPressed = true).
See ReadKey, PortKeyPressed.

Function REALSTR(rval : real; rsize, rdec : byte) : string
rval - ennumerated value to convert to a string
rsize - size of string
rdec - number of decimal places in string

RealStr returns a string of a real value. Best utilized by
SendString for formatted (left or right justified) output.
See SendString, IntStr, PadStr.

Procedure RESETPORTXY ANSI
ResetPortXY uses ANSI control codes to place the cursor at
the position stored by the most recent call to SetPortXY.

Procedure SENDSTRING(outstr : string; docr : boolean)
outstr - string to be output
docr - send carriage return / linefeed

SendString is the main output function. Senstring replaces
TPs Write and Writeln (for non-file) output procedures.
See IntStr, PadStr, RealStr.

Procedure SETPORT { Initialize Async Communications }
SetPort initializes the BOI communications. This procedure should
be the one used to enable the Async routines. See EndPort.

Procedure SETPORTXY ANSI
SetPortXY uses ANSI control codes to store the current cursor
position, so that it can be restored after some other activity
(by ResetPortXY). You should use this procedure in your online
doors instead of using the methodology of (GotoXY, WhereX, etc.).
See ResetPortXY.

Procedure TEXTPORTCOLOR(color : byte) { set text attributes }
TextPortColor replaces TPs CRT TextColor procedure. It uses
ANSI commands to set the foreground color. A better version of
this procedure is PortColor. See PortColor, PortBackground.

Procedure TIMERSET(var basetime : longint)
TimerSet initializes basetime. It sets basetime to the number

of CPU clock ticks since midnight (18.2 per second).
See GetTimer.

Function VALID(thisfile : pathstr) : boolean;
Valid tells whether or not ThisFile is a valid Dos filename
exists or not. Should be used in conjunction with Exist.
This is a public domain function.

Function WHEREX : byte BIOS
Replaces TPs CRT WhereX. This procedure should not be used.
You should restructure your programs to use SetPortXY and
ResetPortXY. See WhereY.

Function WHEREY : byte BIOS
Replaces TPs CRT WhereY. This procedure should not be used.
You should restructure your programs to use SetPortXY and
ResetPortXY. See WhereX.


UNIT ASYNC

Functions
Carrier
CharReady
ReadBuffer

Procedures
AsyncInt ClearInBuffer DropCarrier
IntEnd IntInit SendChar
SetBufferSize

Procedure ASYNCINT : Interrupt IRQ
This is the engine of the communications routine. This
procedure should never be called directly.
See IntInit and IntEnd.

Function CARRIER : boolean
Carrier returns true if carrier is detected, dolocal is true,
or carrier detect override is in effect.

Function CHARREADY : char
CharReady returns true if the port input buffer is not empty.
See ReadBuffer.

Procedure DROPCARRIER
DropCarrier will tell the modem to hang up the phone. This
procedure should be used with extreme prejudice.

Procedure INTEND
IntEnd disengages AsyncInt and restores the previous communications
interrupt. This procedure should not be called directly. You
should use EndPort (See Unit IOLIB).
See IntInit, AsyncInt.

Procedure INTINIT
IntInit installs AsyncInt as the current communications interrupt
handler. This procedure should not be called directly. You
should use SetPort (See Unit IOLIB).
See IntEnd, AsyncInt, SetBufferSize.

Function READBUFFER : char
ReadBuffer returns the next character in the input buffer. This
should only be called after CharReady returns true.

Procedure SENDCHAR(outchar : char)
SendChar sends outchar to the communications port. This procedure
should not be called directly. See SendString (Unit IOLIB).

Procedure SETBUFFERSIZE(newsize : integer)
Changes size of circular input buffer. Default is 1024 characters.
This command will also clear the buffer.


UNIT IOSUPP

Procedure
CheckSecondKey

Procedure CHECKSECONDKEY(var cskey : char)
CheckSecondKey is used to interpret extended character codes
returned by the local keyboard. If the code is not processed,
$00 is returned. F-9, and F-10 have default values. You could
use this structure to implement more SysOp functions such as
ChatMode, add or subtract user time, etc... This procedure
is used only by ReadPortKey (see UNIT IOLIB).


UNIT SUPPORT

Var
playerpoints : longint;

Function
WriteCopy

Procedures
AbortGame
EndGame
LineWrite
QueryUser

Procedure ABORTGAME(limit : byte)
AbortGame can be called if the user's screen size is not large
for the game to be played.

Procedure ENDGAME(gamename,playstr,regstr,hoffile : string;
isreg,isvalid,iscash,gethigh : boolean)

gamename - name of the current door
playstr - gameplayer designation (Player,Trader,etc...)
regstr - name of BBS (registered only)
hoffile - path and name for Text Hall of Fame
isreg - registered game indicator
isvalid - player's score is eligible for Hall of Fame
iscash - player's score is in dollars (false : points)
gethigh - higher scores are better

EndGame is my standard Hall of Fame handling routine.

Procedure LINEWRITE(lstr : string; lcheck : boolean)
lstr - menu selection
lcheck - highlight selection indicator

LineWrite is one of my basic Line Menu procedures.

Procedure QUERYUSER;
QueryUser is used to select Color or Monochrome screens.
See PortColor (Unit IOLIB).

Function WRITECOPY(gamename,version,regnum,regstr,homestr : string;
isreg,ishome,askq : boolean) : boolean

gamename - name of current game
version - version of current game
regnum - regisration number of current game
regstr - name of BBS
homestr - name of at home version of game
isreg - registered game indicator
ishome - at home version of game exists indicator
askq - check for Instructions request indicator

WriteCopy writes the copyrights to the screen, and optionally
questions the user to whether or not they want instructions.


BOI Documentation Files
BBSInfo.Doc
This is a generic information file.

BBSNotes.Doc
This is the most complete of the documentation files, and I
recommend that it goes out with each door using a complete
and un-altered version of the BOI.

Register.Doc
This is the registration file I include with each of my doors.


Future Enhancements
The windowing routines will be enhanced in the next version.
ClrPortScr will be cognizant of the actual window dimensions.
WhereX and WhereY will be fully implemented.
Procedural definition of various limits (e.g. time-out) will
be added.
More specific character input routines will be added.
All good ideas submitted will be duly considered.
A Turbo C or Turbo C++ version will be available in 1991.
A Turbo Pascal 6.0 version will also be available in early 1991.


Implementation Discussion
This section will be greatly enhanced in the future. Enclosed
is a sample game that utilizes the base structure that I use
with all of my games. The game is Hi-Lo (HILO.PAS).

END BOI Reference Manual


 December 12, 2017  Add comments

Leave a Reply