Mod-Menu
BBS Operation - Using the Mod Menu
Mod Menu 2.0
Color 64 v8.10a is defaulted to not use the Mod Menu functionality that came with versions 8.0 and 8.1; instead, it uses the AUX3 area for associated Games the Sysop chooses to use. However, you are not locked into this! You can still instead use the Mod Menu 2.0, particularly if you are moving your system from an existing 8.0/8.1 system where this was already in play.
Just remember that if you are using the games I supplied on the install disks, you will have to dig in the code and change your drive designation commands (like H=14:gosub460) to the appropriate area to support your use of Mod Menu.
Mod Menu was designed before the days of our "Super ML" upgrade. We noticed that it was very difficult to keep track of all the modules and games that we had running on the Sonic Temple, so we came up with the premise of the Mod Menu. Basically, this program does everything that all the menu programs do, except that the device numbers, drive numbers, file names, etc. are all stored in one file which can be edited online. Plus, features like counting game plays and setting individual module levels were added. And all of this with a sophisticated editor allowing you to easily keep track of up to 250 games and modules.
Note there is a distinction between a "game" and a "module" in this documentation.
- A game is a program overlay specifically used as a game for recreational purpose.
- A module is any program overlay (even a game).
In other words, the word "module" can be used as a generic term for any program overlay, while "game" refers specifically to a game overlay. Mod Menu handles game and non-game modules differently, as you will see in the documentation. Also, I have chosen the generic term "stat" to refer to the record of a module's statistics stored in the Mod Menu file (e.g. a "game stat" or a "module stat"). Here is a brief run-down of some of the more interesting features of Mod Menu:
- Can handle up to 250 modules. From the Mod Menu prompt, a user just types the number of the module and presses RETURN.
- Mod Menu makes excellent use of the Super Variable Killer feature of Color 64. This prevents memory waste.
- Non-game Modules can have a maximum level as well as a minimum level (to prevent higher access users from using a program such as an auto-validator).
- The variable OV can be set for each individual module, allowing you to run multiple games/utilities out of single programs.
You can also customize the very programming of Mod Menu to make your system unique:
- The prefix for all the mod menu support files (i.e. the "√mod" prefix) can be set by changing just one line, allowing you to run multiple Mod Menus. Also, the color used in the caller log for Mod Menu activity can be customized also.
- The default device, drive, and init command can be altered when adding new modules.
Installing the Mod Menu Files
The first thing you should do is make sure that the files "√mod edit menu" and "√mod sub menu" are already copied on to your System Files drive. These are the two help menus used in the Mod Stat Editor.
The first person to use Mod Menu must be the SYSOP (user number 2). All other users will get an error message indicating the parms are missing and the program will quit to the main prompt.
If the SYSOP does access Mod Menu first there will be an error message, but the program will ask if the SYSOP wants to set the main parameters. When the program is run for the first time, the module file will be created also. Here is the sequence of events: First, you will be asked if you wish to set the main parameters. If you answer "N", you will exit the mod menu. If you answer "Y", then the program will notify you that the module file is missing. When asked if you wish to create the module file, you can answer "N" to quit the mod menu, or "Y" to continue. The program will then ask you what you wish the maximum possible module number is to be. The file will be permanently alloted that number of slots to be used for module stats. Make sure you allow yourself enough room for expansion, for the program does not include a file expander utility.
If all goes well, the module file will be created (it may take some time if you chose a high maximum stat number). After this takes place, you will be allowed to set the main parameters. These are: The GAMES access level, the maximum number of plays per call, the credit cost per play, and the restrictions exempt level, defined in the table below:
| Main Parameters | Definition |
|---|---|
| Games Access Level | This is the minimum access level a user must have to play ANY game. |
| Maximum Number of Plays Per Call | This is the number of times a user can play a game. This does not mean each individual game can be played this many times, only if any game is played, the total number of plays left is decreased. |
| Credit Cost Per Play | The credit cost per play is the number of credits that will be subtracted from the user's download credits when he/she plays a game. If the user has zero credits or a negative number of credits, then the person will not be allowed to play any games.
Note: Setting either the maximum number of plays to zero or setting the credit cost per play to zero will disable that restriction for users. |
| Restriction Exempt Level | This is the minimum level at which a user is exempt from the above two restrictions. Setting this level to 10 means that no one is exempt from the restrictions. |
The Mod Stat Editor
After the main Mod Menu parameters are set, they will be saved, and you will be sent to the module menu prompt. From the main prompt, you can type '√' and press RETURN to enter the Mod Stat Editor. When you enter the editor for the first time, it must regenerate the module index, an index that is used to allow faster editing of the module stats.
The module stat editor has been greatly enhanced since the original module menu program. The modules are now stored by number rather than by key. This allows a greater number of stats to be accessed and increases the speed of the program. A stat's number can range from 1 to whatever the maximum number stored in the parms is (up to 250). Each stat can be either a normal module or a game module, and the information stored in a stat will vary depending on its type.
All stats contain the following information defined in the table below:
| Stat | Description |
|---|---|
| Description | A string of 1 to 20 characters that should be a good enough description of the module to be contained in a menu. |
| Module Device Number | The device number of the storage unit that the module will be loaded off of. |
| Module drive number | The logical drive number of the module's storage unit. |
| Drive Init Command | The initialization command of the module's storage unit. |
| OV number | The number that the variable OV will be set to before the module is loaded. At the beginning of the module, an ON OV GOSUB statement can access the appropriate routine.
In non-game modules the following information is also stored: |
| Minimum Access Level | The minimum level a user must have to access this module. |
| Maximum Access Level | The maximum access a user may have to access this module. This can be set to 10 to allow all users above the minimum to access the module. A user with an access level higher than this level will not be able to use the module.
In game modules there is no minimum or maximum level, but rather the number of plays for that game is stored instead. When you add a new game stat to the Mod Menu, the number of plays will be set to zero. |
Mod Stat Editor Commands
At most of the sub-prompts (such as the "add stat" command), you are allowed to enter "*" (the asterisk character) to select the next qualified stat for that function. Thus, for example, entering "*" at the "add stat" prompt would select the next empty stat. If you have set a high value for the maximum stat (such as 250), then there may be delays while the index is being searched for the next available stat. If there are no more qualified stats, then a message will be issued, and you will be returned to the editor prompt.
The table below defines the commands and their functions:
| Command | Definition |
|---|---|
| L:
List Modules |
Lists all the occupied stats, including the number, description, type, status, and (if applicable) levels. The type is indicated by the presence or absence of an asterisk "*". If one is present, the module is a game. The status is indicated by the presence or absence of an exclamation point "!". If one is present, then the module has been disabled. If the module is not a game, then the access level range is displayed. |
| V:
View Stats |
Allows you to view the information stored in the individual module’s stats. (note that at most prompts you can also enter '?' to get a listing of qualified stats) |
| D:
Disable Module |
This does not erase a stat, but just prevents any user from accessing the module. This can be used to shut a module down for repairs. |
| R:
Re-enable Module |
The opposite of the above function, allowing users to access the module again. |
| A:
Add New Module Stats |
Allows you to add a new module to the file. |
| E:
Edit Module Stats |
Allows you to edit an individual module's information. It also allows you to move stats to a different slot. |
| X:
Scratch Module Stats |
Permanently erases a module stat. If the data in a stat is corrupted, then you can choose not to view the information before you scratch the stat. After the stat is erased, its slot can be used for a new stat. |
| Z:
Zero Game Plays |
Allows you to set the number of plays to zero for individual games or for all of them. |
| S:
Enter the Editor Sub-Menu |
The sub menu is a collection of routines that are not used as often and can be more potentially dangerous than the standard functions. |
The table below lists the Editor’s Sub Menu functions below:
| Command | Definition |
|---|---|
| R:
Regenerate module index |
The module index is used for quick access of the individual stats by containing the following information for each stat: whether it is a game, if it is disabled or not, and if it contains anything or not. The information is stored in compressed binary form in the string g$(0). If you ever suspect that the index is not correct or get an INDEX INCORRECT error, then use the regenerate command. The index is stored on disk for use during editing. |
| S:
Set Main Parameters |
Allows you to alter the main parameters described in the installation section. |
| V:
View Parameters |
Gives you an overview of the module menu. It lists the main parms, then tallies up the different types of stats. It then asks you if you wish the number of total game plays to be tallied (as explained next) |
| T:
Tally Game Plays |
Allows you to see the total number of game plays for all games stored in the module file. If you use this command before [V]iewing game stats, then the percent ranking and comparison is printed below the game information. |
| C:
Create Level Menus |
This command allows you to create menus for all the access levels. This considers the minimum and maximum levels and the game level. If no one has any access for a level, then the menu file is just scratched. Program lines 5450 and 5460 allow you to subdivide the modules into categories -- the headers of which can appear in the menu. In each line you will see three comparisons of the variables i and ii:
Following these comparisions is a print#9 statement that will print the header of the division if any modules lie in that range. The program is currently set to print "Online Games:" as a header for modules 1 to 99. The program will print "Modules:" as a header for modules 100 to 199. Note that if no modules exist in these ranges, then the appropriate header will not be printed. Study these lines and you will be able to alter them to use your own headers or add new ones (just pay attention to the difference between the variables II and I). |
| R:
Reset Module File |
Allows you to erase all the stats and start from scratch. A backup file is made before the actual file is created though. |
Mod Menu Files
The table below lists the Mod Menu file names by their default names, so if you change the file name prefix variable g$(2) in line 2020 of the Mod Menu overlay, the file names will be different:
| Command | Description |
|---|---|
| √mod file | A relative file storing all the information and can range from about 5 to 125 blocks in size depending on the maximum stat number. |
| √mod index | Module index used in the stat editor. |
| √mod parms | The main parms for the module menu. |
| √mod menu <#> | Menu file for access level <#>; example: √mod index 1 for level 1 users |
| √mod index.bak | A temporary file created during the use of the editor. |
| √mod file.bak | Backup of the module file created when resetting the module file. |
Keeping these filenames in mind, you should not set the length of the filename prefix to more than 7 characters. Otherwise, you may get disk errors.
The following menu options can only be accessed by user number 2 (the SYSOP):
- Scratch Stats
- Zero All Game Plays
- Set Main Parms
- Reset Module File
Also remember that if you use the ON OV GOSUB in a module, the very next line must be the one that re-loads √bbs.ov2. Also, remember that a multi-overlay game usually requires OV to be set to 0 when loading the main overlay.
One note before continuing: There are some files with names that do not use the prefix set in line 2020 and are used in accordance with the mod stat editor. The fact that they do not use the prefix allows multiple Mod Menus to use the same help files. They are as follows:
- "√mod ed sysops"
- This file, if you wish to create it, should contain a list of user numbers for those you wish to have access to the mod stat editor.
- "√mod edit menu"
- This is a list of commands available in the mod stat editor and is displayed when '?' is entered from the editor prompt.
- "√mod sub menu"
- This is a list of commands available from the editor sub-menu.
Mod Menu Operation
Once a user selects the [*]Mod Menu command from the main prompt, the BBS program will display "Entering Mod Menu..." and they will be taken to the Mod Menu main prompt.
At the prompt will be displayed some information. Depending on the level of the user, the program may display the number of game plays left and/or the cost in credits per play. On the SYSOP's side, the name of the current caller and the current baud rate is displayed instead.
From the Mod Menu prompt, the user can do two things: The user can press "?" to see a menu of all modules they can use, or the user can type the number of the module to select it.
After a user selects a module, several things occur. First, if a module is a game, then the number of plays is updated. Then, regardless of the module type, the message "Loading <module name>..." will be displayed and the module will be loaded into memory using the stats entered in the module file.
Before a module is loaded, the BBS program sets up for a Variable-Kill. This means that when the module returns control to the "√bbs.ov2" program, which it must do, then all new variables added in the module program will be removed from memory. This ensures proper memory management of your BBS system.
Note that if you are running multiple Mod Menus, you should make sure that the module returns to the Mod Menu from which it was loaded. If this is not done, then users will get confused if they return to a different Mod Menu (with a different set of modules).
Customization
The Mod Menu program is already installed and ready to use in "√bbs.ov2" in the Color 64 package, but first you may wish to customize the program.
- Mod Menu Drive
- Line 2000 contains a GOSUB 481 which is the only drive selection GOSUB. This can be altered to choose a different drive to store the module menu files (e.g. h=12:gosub460 to use AUX 1).
- Mod Menu Files Prefix
- In line 2020, the variable g$(2) is set to the file prefix that is used for the entire program. Currently it is set as "√mod " (note the space included after the 'd'. This can be altered to allow you to run multiple Mod Menus on the same drive.
- Mod Menu Caller Log Activity
- Also in line 2020, the variable g$(6) is set as the color used in all the module menu caller-log activity. Currently is is set as light grey (C=8). This can be used to differentiate between multiple Mod Menu programs.
- Default Modules Drive Parameters
- Also, you can change the default module parameters used when adding a new module to the system:
- * You can set the default module device number by altering lines 3250 and 3260.
- * You can set the default drive number by altering lines 3280 and 3290.
- * You can set the default drive command by altering lines 3220 and 3330.
- * You can set the default OV number (explained later) by altering lines 3270 and 3280.
Creating Modules
Included in the Color 64 package is the program "xxx small". This small program is a skeleton overlay with just enough of the core BASIC code in it to allow modules to run. You can merge one of the many existing mods into this overlay to create a new module. Many of the existing modules may already have lines in the range 0 to 27999, which is the range of lines used by the xxx small overlay. If they do, then it may be necessary to remove the old routines from the module before merging in the new xxx small overlay. Because of this, if the module has any of its important main code in the line range of 0 to 27999, then it is possible you won't be able to use the following method to make it into a module that can be loaded from the Mod Menu. If you use just modules which have their code at lines 30000 or above, then you should not have any problems.
As you create each module, be sure to write down its description, device number, drive number, drive command, and filename for future use in filling the stat file. To do these modules you will need a good BASIC programming utility with a MERGE command, such as BAID 64. Here is how you alter each module:
- Merging in the XXX Overlay
- Load the program into memory and locate the section of code that GOSUBs the module program. This code is usually located at line 5 and has a GOSUB that executes the module program. It sometimes has a remark telling what the program does. Here is an example:
- 5 gosub32050:rem cardsharks!
- Write down this line number because you will be deleting this line. Now you need to ensure that the old XXX module is removed from the program. To do this, use a delete command to remove lines 0-27999 (this is why you cannot convert modules that have important lines in this range). Next, use a true-merge command to merge in the "xxx small" module.
- Editing the Module
- Next, you must modify or add two lines: lines 1 and 5. Line 1 is the line that you use for re-saving the overlay. Just edit it so that it uses the correct filename and device number. If you forget to edit this line, then you run the risk of resaving the modified program over your xxx small module. Be sure that you do not remove the REM from line 1. Line 5 is the line that will GOSUB the module routine. Type it in like this:
- 5 gosubXXXXX:gosub489:.dr$+"√bbs.ov2*",dv
- Use the line number that you wrote down in place of XXXXX. This line will GOSUB the game/module, then load √bbs.ov2 (the Mod Menu) so that a variable kill can take place.
- You can also modify the program to run several mods out of one program. To do this there are two methods:
- 1) You can use one of the many small menu programs available to add a menu to the module. Using this method, you would have only one stat in the mod file, which users could select to access your custom menu.
- 2) Another method involves taking advantage of setting the OV variable through the mod menu program. Line 5 in the module would be an ON/GOSUB command in this format:
- 5 onovgosubXXXXX,XXXXX,XXXXX
- Where XXXXX are the beginning Line numbers for each of the mods in the overlay.
- Then you would add line 6 to look like this:
- 6 gosub489:.dr$+"√bbs.ov2*",dv
- This is necessary so that the Mod Menu program will be reloaded when any of the small mods has ended.
- Next, you would add a separate mod stat to the mod file for each of the individual mods in the overlay. For each one, you would set the OV setting to 1, 2, 3, or whatever number corresponds to the position of the line number in the ON/GOSUB command in the module overlay. For example, if line 5 in the module looked like “5 onovgosub30000,31000 “, then you would set OV to 1 in the stat editor to use the mod at line 30000, and you would set OV to 2 to use the mod at line 31000. This method makes it look as if all the mods are separate although they are running out of a single overlay. For an example, see the sports picks module included with the Color 64 system.
- Once the changes are made, save the module program to disk. Again, be sure that you write down all the information for the module, including the OV setting if necessary. Writing the information down will reduce the amount of time it takes to add the mod stats to the Mod Menu file.
Next Section: Garbage Collection Routine