Introduction
A long time ago, a greedy man by the name of Captain Burrowgold Dungsmith hoarded his riches into the caves by the sea. The crumbling network of tunnels has long since been forgotten but, daring as always, you set about rediscovering the lost treasure.
You must collect a number of gold nuggets on each screen but once you start doing this the unsupported rocks will start to cave in. Fortunately, past explorers have left blocks of dynamite which you may collect to blast through sealed-off sections.
But watch out! If you blow up any gold in the process, you won't have enough to complete the level. There are four challenging caves to puzzle out. If you become stuck, ESCAPE quits the game.
Game Controls
A - Left, S - Right, P - Up, L - Down, CTRL - Blast, ESCAPE - Quit Game
Technical Info
The main program, "G.GOLD1", assembles the machine code and loads in the characters and map data. "G.CHARS" is loaded into page &C, and contains both the sprites and user-defined graphics characters, so characters 250-255 are peeked out and defined for the benefit of BBC Master owners.
Machine Code Subroutines
addgo | Adds BCD number in A to number of gold pieces collected. Note that to subtract, use &99 for -1, &98 for -1 etc. in BCD maths |
addsc | Adds BCD number in A to score value and prints it under "SCORE" on the screen |
addtnt | Adds BCD number in A to number of dynamite sticks held |
border | Prints fancy border around playing area. |
cavein | If the character below the rock (see 'rock') is unsupported, a zero is written at ('dx','dy2') and one (=rock character) is written at ('dx','dy2'+1) |
expld | Animated explosions around miner. Decreases TNT by 1. 'fltop' and 'flbot' are tables of the user-defined chars for the top and bottom of each puff of smoke. 'frame' is an index into this data. 'eptx' and 'epty' contain the text co-ordinates of the four positions around the miner. 'eppos' is an index into this data. For each 'frame' the current puff shape is plotted four times, once at each of the four positions. The fifth frame is a blank space (CHR$32) only plotted if the explosion occured within the map |
initc | Initialises current cave by storing number of gold pieces to be collected in 'golv', resetting TNT counter, and setting miner's co-ordinates to top left of screen |
keys | Checks keyboard and moves miner in relevant direction. If 'scan' returns with the N flag set, the key in question was pressed |
mksound | Makes a sound. Sound number in A, which is then multiplied by 8 to index into 'sounds'. X and Y set to point to this sound before a call to OSWORD 7 |
move | Adds direction number in X and Y (e.g. X=-1, Y=0 for moving left) to 'xpos' and 'ypos' and stores in 'ox' and 'oy'. The miner is allowed to move if next character is gold or TNT |
prints | Prints sprite, given the sprite number in A. Calculates screen address given the text co-ordinates in X and Y, using the 8-times table, and character row address table |
prnum | Prints number (BCD) in A. Note fancy effect of printing the letter O in place of zero! |
readm | Reads map at co-ordinates in X and Y registers. If X or Y are -1 or 32, this is off the map, so 'readm' exits with A=5. One byte of screen data holds information about four characters, i.e. 2 bits per character. Caves are 32x32 chars, or 8x32 bytes, big. The correct byte to retrieve from the map is that at offset Y%*8 + X% DIV4. The correct two bits to retrieve are those at (X% DIV4) AND 3 EOR 3 |
rock | The map is constantly scanned, from bottom right to top left, for rock blocks. If one is found, 'fall' is set so that next time the rock will start to fall if unsupported |
scan | Scans keyboard. On entry, A contains internal key number, which is then EORed with &80 before calling OSBYTE &79. X=&FF (negative) if the key was pressed |
update | Redraws map from current miner's position. Note that the true co-ordinates of the miner are ('xpos'+3,'ypos'+3) but the top left co-ordinates of the window position on the map are ('xpos','ypos') |
writem | Writes item in A to map. See 'readm' for more details |
Machine Code Variables
bords | Start address of decorative border sprites |
cave | Current cave number |
fall | Cave-in flag. If scanning routine (see 'rock') finds a rock then 'fall' is set so that next time round the rock can "cave in" if not supported underneath |
quit | Contains 0 if game in progress, -1 if all gold in current cave collected, 1 if ESCAPE pressed |
xpos,ypos | Miner's co-ordinates |
xtab | 8-times table, a list of the address offsets of columns along the screen |
ytab | List of addresses of the start of each character row down the Mode 5 screen |