System Tracing
BBS.INIT
The following are breakdown of routines found in BBS.INIT - this is under construction.
bbs.init Overlay
Overview
The bbs.init overlay is the main startup and idle-state overlay for Color 64 BBS. It is the first overlay run when the BBS starts and remains active while the system is waiting for a caller.
This overlay is responsible for several core system functions, including:
- Loading system parameters
- Starting the BBS
- Managing the idle and waiting-for-call state
- Reading and updating user records
- Daily system maintenance
- Caller log file maintenance
- Scheduled network checks
- Program error handling
- Crash recovery
- Saving system data during shutdown
Routine Summary
| Lines | Function | Description |
|---|---|---|
| Overlay Control | ||
| 5-85 | Overlay Return Control | Uses the value of OV to determine which routine should run when control returns to bbs.init. |
| 89-104 | Overlay Selection | Builds the filename needed when another overlay must be loaded. |
| Input and Output | ||
| 105-160 | Character Input and Output | Performs character input, output, carrier detection, and carriage return handling. |
| 202-280 | Display Text File | Opens and displays a text file while checking for disk errors. |
| 300-380 | Read User Input | Reads a line of text from the caller or local keyboard. |
| 390-400 | Trim Input | Removes leading and trailing spaces from entered text. |
| Drive and Disk Control | ||
| 460-489 | Select Drive | Selects the configured device, drive, partition, or directory and processes any associated drive commands. |
| 505-580 | Disk Status | Reads the disk drive status and reports disk errors. |
| 710-795 | Get File Size | Returns the size of a file in Commodore disk blocks. |
| User File Control | ||
| 910-946 | Load User Record | Loads a user record from the user file. |
| 2710-2790 | Update User Record | Loads, updates, and saves another user's record during Sysop maintenance. |
| 9450 | Scratch Private User File | Deletes a private file associated with a user account. |
| Caller Log File Control | ||
| 8003-8010 | Buffer Caller Log | Adds text to the caller log buffer. |
| 8020-8031 | Write Caller Log | Writes buffered caller log data to disk. |
| 8032-8033 | Process Drive Commands | Processes drive commands associated with the caller log drive. |
| 8034-8035 | Find Command Channel | Locates or assigns a disk command channel for caller log operations. |
| 8036-8040 | Caller Log Error | Reports and records caller log disk errors. |
| 8100-8170 | Caller Log Utilities | Displays, manages, or scratches the caller log. |
| Time and System Maintenance | ||
| 1110-1180 | Read Clock and Date | Reads the current time and date and detects when a new day begins. |
| 10645-10647 | Regenerate Message Index Prompt | Prompts the Sysop during startup to optionally regenerate the message index by deleting the saved index file. |
| 10800-10820 | Load Message Index | Loads the saved message index during startup. If the index file is missing or cannot be opened, processing automatically branches to the regeneration routine. |
| 11210-11500 | Regenerate Message Index | Rebuilds the message index from the public message directory, sorts the results, and rebuilds the associated message information. |
| 1521-1525 | Remove Empty Message Base | Removes an unused message base entry. |
| 9810-9826 | Save Message Index | Saves the message index and related system variables. |
| 9991-9992 | Log Program Error | Records BASIC program errors for caller log entry during crash. |
| 9999 | System Shutdown | Saves system information, closes files, restores the environment, and shuts down the BBS. |
| BBS Entry Processing | ||
| 12950-12990 | Modem polling | Monitors the modem while the BBS is in the Wait For Caller state and detects incoming calls. |
| 13010-13060 | Network ops - NW1 | Calling OV 5 for NW1 |
| 13650-13695 | Logoff processing | Cleanup items for logoff |
| 13899 | Local Login from console | Invoked by pressing F1 on Sysop Menu at WFC |
| 13910-13930 | Login processing (initial) | Initial login processing for user |
| 18110-19099 | New User Processing | Processing for new user registration and creation |
| 18500 | Open Password File | |
| 19110-19120 | Invalid Sign-on Detected | Processing for invalid credentials |
| 19510-19595 | Present Membership List | Display membership list to user |
| File Area Support | ||
| 16010-16012 | Select File Directory | Selects the configured upload or download directory. |
| Maintenance Duties | ||
| 20010-22000 | User File/Password Manager | Editing of the User database (Password Maintenance) |
| 24005-24400 | Date & Time Modification | System Date and Time Edit by Sysop |
| 26210-26320 | Time Limits Reset routine | **resume** |
| Caller Log Maintenance | ||
| 28570-28590 | Check Caller Log Size | Checks the caller log size and performs maintenance when needed. |
| 28655 | Load ASCII Support | Loads the ASCII support module when required during caller log processing. |
bbs.msgs Overlay
Overview
The bbs.msgs overlay provides the primary public-message and private-mail functions of Color 64 BBS. It also contains the shared message editor and several supporting caller and SYSOP functions.
This overlay is responsible for several message-related functions, including:
- Reading and posting public messages
- Organizing messages by category and subject
- Editing, scratching, linking, and changing message categories
- Sending and reading private mail
- Holding, deleting, forwarding, and replying to private mail
- Sending feedback
- Displaying SYSOP News
- Displaying the membership list
- Providing SYSOP chat
- Processing commands while the overlay is active
Routine Summary
| Lines | Function | Description |
|---|---|---|
| Overlay Control | ||
| 1-106 | Overlay Return Control | Uses the value of OV to determine where processing begins when bbs.msgs is loaded or resumed. |
| 89-104 | Overlay Selection | Builds the filename needed when another Color 64 overlay must be loaded. |
| 9991-9999 | Error and BREAK Handling | Records the error or BREAK condition, closes open files, and returns control to bbs.init. |
| 13010-13525 | Main Command Processing | Accepts caller commands, checks access levels, runs local message functions, or loads another overlay. |
| 35651-35652 | Additional Overlay Selection | Loads bbs.games or bbs.profile when requested. |
| Input, Output, and File Control | ||
| 110-1180 | Shared System Routines | Provides keyboard input, text-file display, disk selection, disk-status handling, confirmation prompts, and date and time processing. |
| 60050-60051 | Open Sequential File | Opens a sequential file and optionally checks the resulting disk status. |
| Message Creation and Editing | ||
| 1260-1598 | Create and Store Message | Creates message headers and stores completed public messages, private mail, feedback, and forwarded mail. |
| 1300-2975 | Message Editor | Provides message entry, word wrap, listing, editing, insertion, deletion, MCI control, autosignatures, sending, and aborting. |
| 36000-36010 | Load Autosignature | Loads the current caller's saved signature for use in the message editor. |
| Public Message Control | ||
| 3005-3690 | Read Public Messages | Displays message categories, determines unread messages, follows subject chains, and processes message-reader commands. |
| 3900-3945 | Display Public Message | Reads and displays the message header, routing information, subject, and message body. |
| 4005-4095 | Scratch Public Message | Deletes an authorized public message and repairs the message index and subject links. |
| 4210-4298 | Change Message Category | Moves an authorized message to another accessible category and updates its filename and message-index entry. |
| 4510-4590 | Change Message Link | Removes a message from its current subject chain and links it to another subject. |
| 4610-4697 | Select Existing Subject | Allows a caller posting a message to browse existing subjects and add the new message as a reply. |
| 5010-5180 | Edit Public Message | Loads an authorized public message into the editor and stores the revision under its original message number. |
| 36500 | Message Ownership Error | Informs the caller that the selected message does not belong to them. |
| Post Office and Private Mail | ||
| 3710-3750 | Post Office Menu | Provides access to private mail, public-message posting, feedback, and the membership list. |
| 7010-7021 | Send Feedback | Sends feedback to the SYSOP or allows an authorized caller to select another private-mail recipient. |
| 9005-9450 | Read Private Mail | Scans the caller's mailbox and provides reread, delete, hold, forward, and autoreply functions. |
| 9500-9650 | Hold and Forward Mail | Rebuilds held mail, forwards private mail, and supports local carbon copies. |
| 12820-12885 | Select Mail Recipient | Resolves member names and numbers, verifies recipients, and routes local or network private mail. |
| Caller and SYSOP Functions | ||
| 8510-8560 | Display SYSOP News | Displays SYSOP News dated on or after the current caller's last-called date. |
| 12800-12816 | Temporary User Settings | Allows the local SYSOP to temporarily change the online caller's access level, time, transfer totals, or local/remote state. |
| 13600-13695 | Online Status and Connection Handling | Displays caller status, checks remaining time, processes shared input, and handles a lost connection. |
| 15915-15940 | Modem Response Handling | Sends modem commands and waits for the expected response. |
| 18500 | Open Password File | Opens the password file for member-name and member-number verification. |
| 19010-19099 | Logoff and Cleanup | Calculates remaining time, displays the logoff file, and removes temporary private-mail files. |
| 19510-19595 | Membership List | Displays the complete membership list or searches it using a caller-supplied pattern. |
| 35700-35932 | SYSOP Chat | Provides direct communication between the local SYSOP and the remote caller. |
| Logging and Session Events | ||
| 8003-8010 | Buffer Caller Log | Adds message-related activity to the caller log buffer. |
| 8020-8031 | Write Caller Log | Writes buffered caller log information to disk. |
| 8032-8040 | Caller Log Drive Handling | Processes drive commands and records nonfatal caller-log disk errors. |
| 35950 | Session Event Summary | Adds message and private-mail activity to the session event buffer. |