Overlay files

From Color 64 BBS Wiki

Programming Features - Generic Overlay Files

For the programmer, Color 64 also includes generic skeleton overlays which can be used to write online games and modules:


The √bbs.xxx Module

The program "√bbs.xxx" has all the routines that "√bbs.ov3" has in it, except it doesn't have any "spare" command routines. You can use this for modules that would regularly have a spare command of their own, but that you might want to install as a non-system overlay.


The XXX Small Module

The file called "xxx small" is for use with games and modules that are to be loaded by the Mod Menu program. This program is stripped of everything but 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/modules that start at line 28000 or above):

  • First, delete the old overlay file out of the game (lines 0-27999) if necessary.
  • Next, merge in "xxx small". Remember to change line 1 to reflect the filename for resaving purposes.
  • Next, enter line 5 as follows:
5 gosubXXXXX:gosub489:.dr$+"√bbs.ov2*",dv
XXXXX is the line number that needs to 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 you need to make one other change. In line 481 change the "H=1" to H=12, H=13, or H=14 to use AUX 1, AUX 2, or AUX 3, respectively.

Now the game/module is ready to load from the Mod Menu. Line 5 ensures that control will return to the Mod Menu when the game/module ends. Any game or module accessed through the Mod Menu MUST return to the Mod Menu so that a "variable kill" to be activated. Many modules add extra variables and arrays to memory that won't even be used until the module is loaded again. Mod Menu takes care of this by removing these 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 other "permanent" information. These variables will be lost unless they are created before the game is played. If you wish, you can set these variables to 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 with which you can 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 BBS system.

Line 10500 to 10550 of the overlay is where the user parameters are set. Set the different variables in this line range to values that would be helpful during the 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 just drops through to this line after the √bbs.parms file has been read in. If your program does not regularly start at this line (i.e. the game starts at line 30000) then you can simply put a GOTO command at line 11000 to go to the appropriate line number.

The ML shell will need to be installed before you can run a program with this module, so you will need to use an off-line program after shutting down the BBS system or you need to 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 have to reboot the BBS to test the program again. Simply RUN it and it will restart.


The XXX Message Editor Module

Some games/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". Here are all the routines and their entry points:

  • Line 1205 - This displays the message "Message Maker" and asks for a device number, drive, command, and filename for editing. This is usually for Sysop/CoSysop modules only.
  • Line 1215 - This routine prints "opening <filename>...". The filename should be put in the variable FI$ before calling this routine. The currently selected drive is used. The program then proceeds with the next routine. Use this routine when the user needs to see which file is being opened.
  • Line 1220 - This attempts to open a file (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, then the routine drops into the message editor to edit a new message. Use this routine for modules which edit existing files (such as a Trivia module that allows the Trivia sysop to edit questions, etc.).
  • Line 1270 - This jumps right into the message editor. The message is stored with the filename FI$ and is stored on 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 has all 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