Click Here To Go To The Your Computer Archive



Written By John Wilson


Cover Art
Click Here To Enlarge Loading Screen

Loading Screen
Click Here To Enlarge Opening Screen

Opening Screen
Click Here To Enlarge Screenshot

Game Screenshot

Freeway Frog

FREEWAY FROG by John Wilson

John Wilson, his BBC Micro and a frog provide hints on road safety

Freeway Frog is a game for the BBC Micro model B, based on the arcade game Frogger. The program has been tested and works with both the 0.1 and the 1.2 Operating Systems. It also works on a Model A fitted with 32K RAM. The program demonstrates how machine code can be used to generate multi-colour graphics quickly and easily. Before I go into how the program works, I will give a brief description of how to play the game.

Freeway Frog is a game for one player where you must lead your family of frogs safely across the multi-lane motorway dodging the traffic. You must also cross a treacherous and fast-moving river with many currents to catch your family unawares. Move your frogs across one at a time avoiding the ever-increasing traffic and river populated by many crocodiles and turtles.

Avoid the holes occupied by the hungry crocodiles. If you do not you will be invited to dinner! You collect points for getting a frog safely to its hole and bonus points for getting the whole family home. You can collect more points by jumping on any flies that appear, but make sure you are not caught by the snake. As the game progresses, more traffic takes to the road and more crocodiles populate the river.

Your family has one final enemy - the dreaded French Chef who will cut your legs off if you take too long. Therefore, keep an eye on your time. Once you reach the fourth phase, you are awarded a bonus frog to keep your family company.

To fit this program into the limited memory required some special program design and splitting the whole game into three separate programs. The first program is a short title page which loads the remaining programs higher up in memory. The second program assembles the machine code, creates the graphics characters and prints the instructions.

Although the game uses machine code, it should be possible to modify the program, or even convert it to another computer with a little work. To help anyone attempting this conversion, I give a brief description of what the main parts of each program do.

Anyone who has attempted to directly access the screen memory in high resolution graphics modes would have encountered a problem. In mode 2, each byte of screen memory holds the colours for two adjacent pixels, and is stored in a rather strange way. The logical colour numbers are split up into binary and stored in separate bits.

For example, a red pixel next to a green pixel would be stored as follows:

Logical Colour Decimal Binary
1 (Red) 1 0 0 0 1
2 (Green) 2  0 0 1 0
Memory Byte 6 00000110

The next problem encountered is the order in which the bytes are stored. Eight consecutive bytes of screen memory store the colour information for 16 pixels in a block two wide and eight deep. The next eight consecutive bytes of screen memory is a similar block of pixels adjacent to the previous block.

To make the graphics quicker and to get round the above problems, the simple machine code program is used. All this program does is to Poke consecutive bytes of screen memory, in order to make up a character. Another machine code program uses the Poke subroutine to delete, move and re-print all the graphics for the logs, cars, etc. This program is virtually instantaneous, allowing for high speed arcade-type action. Another machine code program tests for whether the frog has been hit by a car, or fallen into the water.

This program works by testing each pixel next to the frog and counting the pixels that have logical colours less than eight, excluding black. As all the dangerous obstacles of the program are made up from colours in the range 1 to 7, it is easy to tell whether the frog has strayed into something it should not have. Also, all the safe obstacles, such as the logs, swimming turtles and the crocodiles back, are defined using colours in the range 8 to 15.

The machine code is assembled into pages &900 and &A00, which are normally unused by the computer for most of the time. All the data required by the machine code is then stored into memory from page &D00 to page &1100. The program finally loads the last and final part of the game, after printing the instructions.

Game Controls

Z - Left, X - Right, : - Up, / - Down.
Or alternatively, you may define your own keys.