Overlay files

From Color 64 BBS Wiki
Revision as of 14:59, 6 March 2026 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Programming Features - Generic Overlay Files

For programmers, Color 64 also includes generic skeleton overlays that can be used to write online games and modules.

The √bbs.xxx Module

The program "√bbs.xxx" includes all of the routines found in "√bbs.ov3", except that it does not contain any "spare" command routines. It can be used for modules that normally have a spare command of their own, but that you may want to install as a non-system overlay.

The XXX Small Module

The file called "xxx small" is intended for games and modules that are loaded by the Mod Menu program. This program is stripped down to only the essential routines that most games will need.

The procedure for setting up a new game for the Mod Menu is as follows for games or modules that start at line 28000 or above:

  • First, delete the old overlay portion of the game (lines 0-27999), if necessary.
  • Next, merge in "xxx small". Remember to change line 1 to reflect the filename for re-saving purposes.
  • Next, enter line 5 as follows:
5 GOSUBXXXXX:GOSUB489:.DR$+"√bbs.ov2*",DV
XXXXX is the line number that must be GOSUB'ed to start the game or module.
  • If you want the overlay to use one of the AUX file groups rather than the system files, then one additional change is needed. In line 481, change "H=1" to H=12, H=13, or H=14 to use AUX 1, AUX 2, or AUX 3, respectively.

The game or module is then ready to load from the Mod Menu. Line 5 ensures that control returns to the Mod Menu when the game or module ends. Any game or module accessed through the Mod Menu MUST return to the Mod Menu so that a "variable kill" can be activated.

Many modules add extra variables and arrays to memory that will not be used again until the module is loaded another time. Mod Menu handles this by removing those extra variables from memory when control is returned to the menu. This process is affectionately referred to as the "variable killer".

Note: Some games use variables to indicate how many times a user has played the game while online, or to store other "permanent" information. These variables will be lost unless they are created before the game is played. If desired, you can assign these variables a dummy value in the √bbs.init initialization routine so they will be preserved.

The XXX Off-Line Module

The included file "xxx ol" is a special module that allows you to write your own off-line programs separate from the BBS system. This makes it easier to test games or modifications without having to start the full BBS system.

Lines 10500 to 10550 of the overlay are where the user parameters are set. Set the different variables in this line range to values that will be useful during testing of your program. Consult the "Basic Variables" section for information on what each variable is used for.

The first line of your routine should be at line 11000, because the program drops through to this line after the √bbs.parms file has been read in. If your program does not normally start at this line, for example if the game starts at line 30000, then you can simply place a GOTO command at line 11000 to transfer control to the appropriate line number.

The ML shell must be installed before you can run a program with this module. This means you will need to use an off-line program after shutting down the BBS system, or run the "+shell" boot program.

While the program is running, you will be able to stop it just as you would the BBS program, but you will not need to reboot the BBS in order to test the program again. Simply RUN it and it will restart.

The XXX Message Editor Module

Some games or modules may use the text editor. The included file "xxx msg" is a self-contained message editor that can be merged into "xxx small" or "√bbs.xxx". The routines and their entry points are as follows:

  • Line 1205 - Displays the message "Message Maker" and asks for a device number, drive, command, and filename for editing. This is usually intended for Sysop or Co-Sysop modules only.
  • Line 1215 - Prints "opening <filename>...". The filename must be placed in the variable FI$ before calling this routine. The currently selected drive is used. The program then proceeds into the next routine. Use this routine when the user needs to see which file is being opened.
  • Line 1220 - Attempts to open a file, using the filename stored in FI$, for editing. No message indicating which file is being opened is printed. The currently selected drive is used. If the file does not exist, the routine drops into the message editor so a new message can be created. Use this routine for modules that edit existing files, such as a Trivia module that allows the Trivia Sysop to edit questions.
  • Line 1270 - Jumps directly into the message editor. The message is stored using the filename in FI$ and is written to the currently selected drive. Any existing file is scratched before the new file is saved. Use this routine when the user must create a new file from scratch.

This message editor includes all of the features of the editors built into the other modules, including the Help command and the Merge command, for those who have access.

Next Section: Miscellaenous Programming Notes

Programming Features