FOR THE MORE ADVENTUROUS Memory constraints limit the options to six teams. Those wishing to replace one nation with another (e.g., SRI LANKA) should use RATINGS.BAS to insert the touring party data and manually change the nation name and colours at the following lines of CRICKET2.BAS: Lines 3210-3220 Change nation name against the relevant team number (maximum 11 characters). Lines 3280-3330 One of these lines will contain your team. Change the name and put your new team colours against variables C11, C12 and C13. Lines 3350-3400 As for lines 3280-3330 except that the variables for your team colours are C21, C22 and C23. Using the team selection screen at the beginning of a new game as an example, the colour variables mentioned above control the following: C11 and C21 Central Background C12 and C22 Nation Name C13 and C23 Screen Border The author's daughter, incidentally, has replaced one team on her disk with the HOLDER HIGH all-stars, complete with school colours. This all-female team has under contract a star bowler by the name of Bessie. Bessie is the family dog. The author accepts that, despite this arrogant creature's distinguished pedigree, the cricketing purist might reasonably be expected to object, and with some vigour, to the sight of Imran Khan being dismissed for a duck by a Golden Retriever. COMPUTER CRICKET PROGRAM NOTES SCALAR VARIABLES B General utility BAT Batsman on strike (value in BAT1 if BAT1 on strike or value in BAT2 if Bat2 on strike) BAT1 Current batsman No. 1 (holds a number equivalent to this batsman's place in the batting order) BAT2 Current batsman No. 2 (holds a number equivalent to this batsman's place in the batting order) BOWL Current bowler (holds a number equivalent to bowler's place in the batting order) CB Cursor bottom limit on screen (used in joystick handler routine) CH Cursor horizontal position (used in joystick handler routine) CI Cursor increment value (used in joystick handler routine) CT Cursor top limit on screen (used in joystick handler routine) C11 Team 1 Colour No.1 C12 Team 1 Colour No.2 C13 Team 1 Colour No.3 C21 Team 2 Colour No.1 C22 Team 2 Colour No.2 C23 Team 3 Colour No.3 CHECK Toggled variable used by the joystick handler routine CURSOR Vertical position of cursor on screen. Relates this position to player identity etc. during joystick selection routine D General utility DLP Start address of modified display lit for scoreboards (data in this particular display list must be refreshed after scoreboard display) ESCLINE Program line to GOTO if ESCape key is pressed INNINGS Set to 1 when first team is batting and 2 when second team is batting L General utility (mainly FOR/NEXT loops) LL General utility (mainly nested FOR/NEXT loops) OUT Number of batsmen out so far OVERBALL Number of balls bowled this over so far OVERUNS Number of runs scored this over so far (if zero then end of over, bowlers maiden overs incremented) P General utility PARTRUN Current Partnership runs. Transferred to TEMPERF array when batsman is dismissed or when innings or game over PLAYDAT1 Program line where first selected nation's touring party data is located PLAYDAT2 Program line where second selected nation's touring party data is located PMBASE Player/Missile bit-map base address set to four pages below top of RAM (see RAMTOP) RAMTOP Top of RAM. (bumped back four pages in this program to accommodate and protect the Player/Missile bit-map) SWAP Toggled to swap the batsman on strike, i.e., to swap the values in BAT1 and BAT2 STRING VARIABLES BAR$ A string of horizontal line ATASCII graphics characters for general utility use BLINE$ A string of blanks for general utility use NATION1$ Identity of first nation selected to play NATION2$ Identity of second nation selected to play NATION$ Temporary way-station for NATION2$ when all team-related variables are swapped at innings and game end and sometimes after the toss PART$ Holds all names in touring party of selected team during team selection. At end-of-innings and end-of-game, holds the scrolling end-of-innings and end-of-game messages PLAYER$ Holds player's name temporarily be fore transfer to PARTS$ during team selection R$ Holds EOL character. Used to separate data items during save-game routine TEAM1$ Holds all data for one team TEAM2$ Holds all data for the other team TEMP$ Temporary way-station for TEAM2$ when all team-related variables are swapped at innings and game end and sometimes after the toss. Also used for various other utilitarian purposes. SUBSCRIPTED VARIABLES TEMPERF Array used to temporarily hold player rating data before transfer to TEAM1$ and TEAM2$ during team selection. After team selection, used to hold batting partnership data. THE TWO MAJOR STRING VARIABLES Two 740 character string variables hold all the data relevant to a particular team. These variables are TEAM1$ and TEAM2$. Both of these strings have the same internal sub-string organisation. The broad internal arrangement is as follows: 1-660 Data on individual players held in eleven 60-character substrings 661-663 Extras 664-665 Overs received 666-667 Wickets lost 668-670 Runs total 671-674 Run Rate 675-678 Run rate required 679 Flag set if team won the toss 680-720 Fall of wicket data 721-740 Run rate data (total runs accumulated every tenth over) The internal arrangement of each individual player's sub-string is as follows: 1-10 Name 11-13 'C' is placed here if caught out 14-23 Catcher's name placed here if caught out 11-23 'Stumped', 'LBW' or 'RUN OUT' placed here if these were the cause of dismissal 24-26 'B' placed here if bowled, caught or LBW 27-36 Bowler's name placed here if bowled, caught or LBW 38-40 Player's current total runs The above data on each player is the data printed to the scoreboard. 41-42 No. of fours scored 43-44 No. of sixes scored The two items above feature in the summary printout only. 45-47 Balls received The above item is used to calculate the player's batting strike rate for the summary printout. 48-49 Overs bowled 50-51 Maidens 52-54 Runs-off 55-56 Wickets taken The above items appear on the bowler-select screen and in the summary printout. The last two are also used to calculate the player's bowling average for the summary printout. 57 Player's batting rating 58 Player's bowling rating 59 Flag set when this player has batted 60 Flag set when this player has reached the half- and full-century PROGRAMS Computer Cricket comprises several programs, as follows: CRICKET.BAS pokes a machine language display list interrupt routine and modified display lists for the various screens to free RAM before loading CRICKET2.BAS, ENTERing PLAYERS.LST and running the lot. CRICKET2.BAS is the main program PLAYERS.LST contains the player names and rating data for all touring parties. This is kept separate from CRICKET2.BAS to facilitate user amendment of touring party data using the RATINGS.BAS utility program. CRICKET3.LST will be entered immediately after the team selection. This file contains the toss routine. It will not be entered if you choose the 'Load Old Game' option. CRICKET4.LST will be entered immediately after the toss routine (or immediately after selection of the 'Load Old Game' option if it is selected). This file contains the text data and associated subroutines accessed by the main game routine in the main program CRICKET2.BAS. CRICKET5.LST will be entered when the 'Print Summary' option is chosen at game's end. This file contains the print module. SAVEGAME.DAT contains the saved-game data. RATINGS.BAS is a utility program which facilitates the viewing of and, where desired, the modification of the touring party data in PLAYERS.LST. GENERAL NOTES Player/Missile graphics are used to create the borders for the scoreboard, bowler-select and team-select screens. Modified display lists and display list interrupts (DLIs) are used for all screens. The modified display lists are used on the scoreboard, bowler-select, team-select screens and main game screens to both modify the vertical screen architecture and call the display list interrupt routine. On other screens, the GRAPHICS O display list is modified to call the DLI routine only. The DLI routine is used to modify the value COLPF2 (Dec-53272, Hex-$DO18), the hardware colour register shadowed at COLOR2 (Dec-710, Hex-$2C6 or BASIC colour register 21. The DLI routine contains a four-element colour table. The modified display list for the scoreboards undergoes substantial modification during the game and has to be refreshed after each scoreboard display. The reason for this is that the basic modified display lit is further modified immediately before scoreboard displayed, to highlight in white, current and 'not-out' batsmen. Liberal use is made of ATARI's 'forced-read' mode (sometimes referred to as the 'RETURN' key mode) during various LOADs and ENTERs. This is to ensure continuation of program execution after the LOAD or ENTER. The text over which the cursor runs during these operations is actually on the screen; however, it is rendered invisible by the appropriate manipulation of the playfield colour registers. Seamless changes between the various screens are ensured through judicious use of Direct Memory Access(DMA) enable and disable, Non-maskable Interrupt enable and disable and Player/Missile enable and disable. Direct pokes to the playfield colour registers are used, rather than the BASIC SETCOLOUR, to speed up the process a trifle. In general, some areas of the program, particularly in the area of screen displays, text justification etc, are extravagantly wasteful of memory. However, the author considered that visually-interesting screen displays would be needed to compensate for the fact that the simulation accurately captures one key element of the game: at times, it can be pretty damn boring!