;============================================================================
;                BBS Express! Professional Bulletin Board System
;
;                Copyright (c) 1987 by Keith Ledbetter
;
;               This module contains all of the global definitions.
;
; Compiler: XASM/65 (tm) Cross Assembler (Orion Micro Systems)
;============================================================================



;               USERLOG file layout (0th header record)
;               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

u_version:      ds.b    1               ;database version number (in hex)
u_maxrecs:      ds.w    1               ;max records allocated for
u_recsinuse:    ds.w    1               ;records currently in use
u_hfiller:      ds.b    5       ;PRIVATE for future expansion



;               USERLOG file layout (data record)
;               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

u_buff:                                 ;read into here
u_inuse:        ds.b    1               ; 1 means this record is active
u_locked:       ds.b    1               ; 1 means this record is locked
u_newuser:      ds.b    1               ; 1 means this is a new user
u_handle:       ds.b    21              ;handle
u_name:         ds.b    21              ;real name
u_pword:        ds.b    16              ;password
u_addr:         ds.b    21              ;street address
u_cityst:       ds.b    23              ;city, state
u_zip:          ds.b    11              ;zip code
u_country:      ds.b    11              ;country
u_phone:        ds.b    13              ;phone number
u_age:          ds.b    1               ;age
u_cpu:          ds.b    16              ;computer type
u_lstcall:      ds.b    14              ;last time user called
u_tlcall:       ds.b    1               ;time limit per call
u_tlday:        ds.b    1               ;time limit per day
u_mintoday:     ds.b    1               ;minutes on today
u_lastread:     ds.w    1               ;last read message number
u_dlratio:      ds.b    1               ;download ratio (x:1)
u_downs:        ds.w    1               ;number of downloads done
u_ups:          ds.w    1               ;number of uploads done
u_msgp:         ds.w    1               ;number of messages posted
u_emsent:       ds.w    1               ;number of emails sent
u_totcalls:     ds.w    1               ;total calls made
u_vw:           ds.b    1               ;video width
u_flags:        ds.b    2               ; 16 individual flags
u_seclvl:       ds.b    4               ;security level (32 bits)
u_msgread:      ds.b    4               ;read messages?
u_msgpost:      ds.b    4               ;post messages?
u_msgedit:      ds.b    4               ;edit any message?
u_msgdel:       ds.b    4               ;delete any message?
u_msgprint:     ds.b    4               ;print any message?
u_sigread:      ds.b    4               ;access this SIG?
u_sigedit:      ds.b    4               ;edit descriptions?
u_sigdel:       ds.b    4               ;delete files?
u_qscan:        ds.b    4               ;marked bases flags.
u_lastmm:       ds.b    1               ;month
u_lastdd:       ds.b    1               ;day
u_lastyy:       ds.b    1               ;year
u_pagesize:     ds.b    1               ;page length
u_node:         ds.b    2               ; user node number! Private
u_expmm:        ds.b    1               ;expires mm
u_expdd:        ds.b    1               ;        dd
u_expyy:        ds.b    1               ;        yy
u_fill:         ds.b    17      ;PRIVATE just to be safe


;               temporary USERLOG file layout
;               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

t_buff:                                 ;read into here
t_inuse:        ds.b    1               ; 1 means this record is active
t_locked:       ds.b    1               ; 1 means this record is locked
t_newuser:      ds.b    1               ; 1 means this is a new user
t_handle:       ds.b    21              ;handle
t_name:         ds.b    21              ;real name
t_pword:        ds.b    16              ;password
t_addr:         ds.b    21              ;street address
t_cityst:       ds.b    23              ;city, state
t_zip:          ds.b    11              ;zip code
t_country:      ds.b    11              ;country
t_phone:        ds.b    13              ;phone number
t_age:          ds.b    1               ;age
t_cpu:          ds.b    16              ;computer type
t_lstcall:      ds.b    14              ;last time user called
t_tlcall:       ds.b    1               ;time limit per call
t_tlday:        ds.b    1               ;time limit per day
t_mintoday:     ds.b    1               ;minutes on today
t_lastread:     ds.w    1               ;last read message number
t_dlratio:      ds.b    1               ;download ratio (x:1)
t_downs:        ds.w    1               ;number of downloads done
t_ups:          ds.w    1               ;number of uploads done
t_msgp:         ds.w    1               ;number of messages posted
t_emsent:       ds.w    1               ;number of emails sent
t_totcalls:     ds.w    1               ;total calls made
t_vw:           ds.b    1               ;video width
t_flags:        ds.b    2               ; 16 individual flags
t_seclvl:       ds.b    4               ;security level (32 bits)
t_msgread:      ds.b    4               ;read messages?
t_msgpost:      ds.b    4               ;post messages?
t_msgedit:      ds.b    4               ;edit any message?
t_msgdel:       ds.b    4               ;delete any message?
t_msgprint:     ds.b    4               ;print any message?
t_sigread:      ds.b    4               ;access this SIG?
t_sigedit:      ds.b    4               ;edit descriptions?
t_sigdel:       ds.b    4               ;delete files?
t_qscan:        ds.b    4               ;marked bases flags.
t_lastmm:       ds.b    1               ;month
t_lastdd:       ds.b    1               ;day
t_lastyy:       ds.b    1               ;year
t_pagesize:     ds.b    1               ;page length
t_node:         ds.b    2               ; users node number private!
t_expmm:        ds.b    1               ;expires mm
t_expdd:        ds.b    1               ;        dd
t_expyy:        ds.b    1               ;        yy
t_fill:         ds.b    17      ;PRIVATE just to be safe



vis_rec:        ds.b    256     ;PRIVATE holds the visitor record
new_rec:        ds.b    256     ;PRIVATE holds the new user record


;               Work Variables for logon sequence
;               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

w_handle:       ds.b    21      ;PRIVATE handle
w_name:         ds.b    21      ;PRIVATE real name
w_pword:        ds.b    16      ;PRIVATE password
w_cityst:       ds.b    23      ;PRIVATE city, state
w_age:          ds.b    1       ;PRIVATE age
w_lastread:     ds.w    1       ;PRIVATE last read message



;               SYSDATA file layout
;               ~~~~~~~~~~~~~~~~~~~

s_buff:         ds.b    0               ;read into here
s_version:      ds.b    1               ;version this file is (in hex)
s_himsg:        ds.w    1               ;system hi message counter
s_today:        ds.b    14              ;today's date
s_totcalls:     ds.w    1               ;total calls received
s_calltoday:    ds.w    1               ;total calls today
s_lcaller:      ds.b    21              ;last caller's name
s_fbmode:       ds.b    1               ;feedback mode
s_handles:      ds.b    1               ;allow use of handles?
s_maxbaud:      ds.b    1               ;max baud rate possible
s_minbaud:      ds.b    1               ;min baud rate
s_stbaud:       ds.b    1               ;baud rate to answer at
s_secpw:        ds.b    16              ;secondary password
s_ulogdr:       ds.b    1               ;drive USERLOG.DAT is on
s_help40dr:     ds.b    1               ;drive HELP40> subdirectory is on
s_help80dr:     ds.b    1               ;drive HELP80> subdirectory is on
s_cmddrive:     ds.b    1               ;drive COMMANDS> subdirectory is on
s_logdr:        ds.b    1               ;drive LOG> subdirectory is on
s_interface:    ds.b    1               ;0=850, 1=P:R:, $80=MIO
s_msgbdr:       ds.b    32              ;drives each message base is on
s_maincmds:     ds.b    420             ;(35*12) = key,seclvl,t/c,fname
s_usedesc:      ds.b    1               ;0 = don't use description files!
s_sigdr:        ds.b    32              ;
s_signames:     ds.b    672             ;(21*32)
s_brdname:      ds.b    40              ;board name for status line
s_syname:       ds.b    40              ;sysop's name for status line
s_foregnd:      ds.b    1               ;foreground color
s_backgnd:      ds.b    1               ;background color
s_border:       ds.b    1               ;border color
mux_active:                             ;1 = multi-chat on else 0
s_80col:        ds.b    1               ;1 = 80-col card installed
s_node:         ds.w    1               ;this system's node number
s_nodename:     ds.b    26              ;this system's node name
s_nodecity:     ds.b    26              ;this system's node city
s_atari:        ds.b    1               ;0 = allow only ATASCII callers
s_schedules:    ds.b    570             ;(30*19)  schedule table
s_datadr:       ds.b    1               ;drive >PRO>DATA> is on
s_uploadr:      ds.b    1               ;drive >PRO>UPLOADS> is on
s_netdr:        ds.b    1               ;drive >PRO>NETWORK> is on
s_end:          ds.b    0               ;end flag




;               Global variables NOT saved anywhere
;               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

usernum:        ds.w    1               ;# of user currently logged on
ignore_modem:   ds.b    1               ;$80 means don't go to modem
bbs_active:     ds.b    1               ;$80 means someone is online
compl_logon:    ds.b    1               ;$80 means a complete logon was done
invoker:        ds.b    1               ;key that invoked external command
trans:          ds.b    1               ;0=atascii,1=ascii,2=ansi,3=mono,4=color
chat:           ds.b    1               ;0 = chat off, 1 = chat on
in_chat:        ds.b    1       ;PRIVATE currently in chat mode?
in_main:        ds.b    1       ;PRIVATE if $80, then in MAIN COMMAND area
from_kbd:       ds.b    1               ;was key from local sysop? (1 = yes)
rc:             ds.b    1               ;return code from scheduled event
baud:           ds.b    1               ;current baud rate
hide:           ds.b    1       ;PRIVATE  1 means echo '*' on input keys
aborted:        ds.b    1               ; 1 means user hit ^X or ^C
no_abort:       ds.b    1       ;PRIVATE  1 means they can't abort text file
fancy:          ds.b    1       ;PRIVATE  1 means do MENU and variable tags
nextmsg:        ds.b    1               ; 1 means user hit ^N
paged:          ds.b    1               ; 1 means user called for sysop
to_user:        ds.w    1       ;PRIVATE user to whom this email is being sent
free_time:      ds.w    1               ;subtracted from minutes_connected
echocnt:        ds.w    1       ;PRIVATE used to count characters output
n_feedback:     ds.b    1               ;new feedback?
n_uploads:      ds.b    1               ; uploads?
n_users:        ds.b    1               ; users?
z_secs:         ds.b    1       ;PRIVATE
c_secs:         ds.b    1       ;PRIVATE
m_secs:         ds.b    1       ;PRIVATE
jiffies:        ds.b    1       ;PRIVATE
seconds:        ds.b    1               ;
min_conn:       ds.b    1               ;minutes connected for current user
copyctr:        ds.b    1       ;PRIVATE used to toggle copyright messages
copynum:        ds.b    1       ;PRIVATE copyright msg counter
qin:            ds.b    1       ;PRIVATE queue head pointer
qout:           ds.b    1       ;PRIVATE queue tail pointer
bufoff:         ds.b    1               ;current position in input line
cur_date:       ds.b    15              ; Mon 13-May-87 + len_byte + $9B
cur_time:       ds.b    15              ; 11:00:00am    + len_byte + $9B
cur_month:      ds.b    1               ;1-12
cur_day:        ds.b    1               ;1-31
cur_year:       ds.b    1               ;1-99
cur_hour:       ds.b    1               ;0-23
cur_minute:     ds.b    1               ;0-59
cur_second:     ds.b    1               ;0-59
cur_weekday:    ds.b    1               ;0=sunday, 1=monday,...7=saturday
page0:          ds.b    12      ;PRIVATE holds page 0 when invoked from Action
con_date:       ds.b    15              ;date when this user connected
con_time:       ds.b    15              ; 11:00:00am    + len_byte + $9B
last_hour:      ds.b    1       ;PRIVATE  used to run event scheduler
hi_msglo:       ds.b    32      ;PRIVATE  32 hi message numbers (2 bytes each)
hi_msghi:       ds.b    32      ;PRIVATE
queue:          ds.b    64      ;PRIVATE input key queue
quefrom:        ds.b    64      ;PRIVATE 0=modem, 1=keyboard
DOSshell:       ds.b    9               ;for use by DOSSHELL.CMD only!
defdrive:       ds.b    1               ;for use by DOSSHELL.CMD only!
word:           ds.b    30              ;damn backward compatibility!    
parm_1:         ds.b    40              ;passed by DOSshell
parm_2:         ds.b    40              ;passed by DOSshell
in_str:         ds.b    80              ;
instr:          ds.b    80              ;
read_buff:      ds.b    512     ;PRIVATE generic read buffer
dl_tolerance:   ds.b    1               ;download time limit tolerance
BBS_major:      ds.b    1               ;Major version number (ie: $20)
BBS_minor:      ds.b    1               ;Minor version letter (ie: 'a')
ov_counter:     ds.b    1               ;current overlay we're on..
cmd_drives:     ds.b    8               ;where we'll search for commands
ov_drives:      ds.b    10              ;where we should put overlays    
data_drives:    ds.b    8               ;for programmer's benefit only
mycheck:        ds.b    5
multi_bbs:      ds.b    1
interm:         ds.b    1


I_VBI:		ds.b	2
I_DVBI:		ds.b	2
I_IRQ:		ds.b	2
I_KBI:		ds.b	2

n_help40:	ds.b	10
n_help80:	ds.b	10
