The PGOL language
SYSTEM 1 and game PROM
Presentation of the system and the programming language used is this pinballs.
Introduction
The pinballs of the SYSTEM 1 series used a revolutionary CPU board at the time, whose principle was to separate the "standard" functions common to all machines , from specific functions for a particular model. The CPU Board was equipped with a game PROM, different for each pinball and could be programmed using an advanced language called PGOL (Pinball Game Oriented Language).
This invention is the subject of a patent filed in Canada under reference 1-141-861.
The basic functions (display, management of credits, tilt, test/bookeeping mode, etc...) are managed by an operating system programmed at factory inside PPS-4 circuits (spiders). This part cannot be modified and is identical for all SYSTEM 1 pinball machines. The game however, PROM is editable. It has an area of 1 K x 4-bits programmable PGOL to customize the operation of Pinball.
This system was developed by Rockwell for Gottlieb, very probably on an ASSEMULATOR:
This module was the standard equipment of development for Rockwell PPS-4-processor based systems:
Be careful: the patent contain a few errors and should therefore not be regarded as a technical reference.
Structure and addressing of the game PROM
Its capacity is only 1024 x 4 bits, it is fully programmed in PGOL and contains also a standardized parameters area. There is no checksum to ensure the integrity of the content of the PROM, nor signature to identify the version. The address space ranges from $100 to $4FF (i.e. an offset of $100 compared to the internal address of the component).
The technique used is that of an event-driven programming. Each contact triggers execution of treatment to a specific address, except for the first five (service contacts):
SW10 - $120 | SW20 - $140 | SW30 - $160 | SW40 - $180 | SW50 - $1A0 | SW60 - $1C0 | SW70 - $1E0 |
SW11 - $124 | SW21 - $144 | SW31 - $164 | SW41 - $184 | SW51 - $1A4 | SW61 - $1C4 | SW71 - $1E4 |
SW12 - $128 | SW22 - $148 | SW32 - $168 | SW42 - $188 | SW52 - $1A8 | SW62 - $1C8 | SW72 - $1E8 |
SW13 - $12C | SW23 - $14C | SW33 - $16C | SW43 - $18C | SW53 - $1AC | SW63 - $1CC | SW73 - $1EC |
SW14 - $130 | SW24 - $150 | SW34 - $170 | SW44 - $190 | SW54 - $1B0 | SW64 - $1D0 | SW74 - $1F0 |
Two addresses are also reserved at the beginning of the PROM:
- $100 - Executed at the start of a ball.
- $104 - Executed at the end of a ball.
The first is used to initialize elements initially, for example, to light the lamps in corridors. The second allows to treat loss of the ball, for example, to carry out the decounting of the bonus at the end of game.
Configuration
The space area $108 to $10B is used to customize the behaviour of the pinball, they are common to all SYSTEM 1:
- $108 - ?
- $109 - ?
- $10A - ?
- $10B - Max players (from 1 to 4, usually set to 4, but set to 1 on Asteroid Annie).
The PGOL language
This is a very simple interpreted language which the instructions are coded on 4 bits. There are only 16 instructions, each potentially beings followed by parameters, encoded on 4, 8, or 12 bits.
Some instructions are conditional and are executed only if the "control bit" is set to 1. This 'control bit' is initialized to 1 by default before the treatment of a contact. It is then positioned by certain instructions, for example, test the state of a lamp or a target.
The STOP instruction ('C' opcode) ends the current treatment. It is used at the end of a contact, to tell the operating system to wait for the next contact.
The DELAY ('F' opcode) instruction causes a delay of 150 ms. It can also be used to fill unused areas (FILL).
The GOTO ('E' opcode) and CGOTO instructions ('3' opcode), are followed by the address of branch (from $100 to $4FF), 3 x 4 bits.
Be careful: as you can see, the above table is wrong. Indeed, following a GOTO addresses are well on 3 x 4 bits (not 2 x 4 bits as listed in this table). Similarly, in practice, scores can only be as added (while the patent indicates that they may also be subtracted).
Example of PGOL program
Here is the listing of the code used for the cleopatra (#409):
In this listing, the first column corresponds to the memory address ($100 to $4FF). The following four (W1 W2 W2 W4) to the words of 4 bits, depending on the size of the instructions. Then come the line no., labels (or * for comments) and text instruction.
Language PGOL appears has first sight relatively abscond, although it is actually very simple. This is due to the technical limitations at the time it was written and it would be today possible to write it in a much readable way. Indeed, the names of label were limited to 4 characters, just as the parameters passed to the instructions, which makes the listing not very comprehensible.
For the parameters (instructions of test and positioning), a simple coding was used.
- The first character indicates the state which must be tested or positioned:
- T for True (or lit for the lamps)
- F for False (or extinct for the lamps)
- Le second character indicates what must be tested or positioned:
- L for Lamp (for the commended lamps by the CPU)
- F for Flag (internal indicators)
- S for Solenoid (coil, relay or xylophone)
- The last two characters indicates the n° of lamp, flag or solenoid involved.
Some examples: TL30 to light the lamp n°30, FL30 to extinguish it, TS8 to activate solenoid 8, FF20 to set the indicator n° 20 to zero.
Some instructions use a confusing name in addition, for example COPY which is not other than a TEST.
Coding of the parameters
The instructions COPY, SET and OR use the same format for the parameters (2 X 4 bits). These instructions can also beings used cascades about it in order to carry out operations logical (AND/OR). For example, to test if a group of lamps is lit.
With SYSTEM 1, it is possible to manage:
- 8 solenoids (knocker, outhole, xylophone, targets banks...)
- 36 lamps
The number of lamps is reduced to 36 because of the driver board, but the CPU board is originaly designed to drive up to 44. It would be even possible with some modifications to increase this number up to 64.
It is also possible to position/test indicators (flags) in order to memorize certain sequences, such as for example, to keep trace of the passage of the ball in the corridors. These flags 36 are free of use. One can also use certain special indicators, as for example the flag 38 which indicates the 3/5 balls configuration.
Structure of the parameters:
- 1 bit to indicate the status (0 = false, 1 = true) to set or test
- 1 bit to indicate the type of object (0 = flag or solenoid, 1 = lamp)
- the remaining 6 bits are the n° of the flag, solenoid or lamp
Encoding for lamps (2nd bit = 1):
The first two bits are those of less significant weight. They use a little unusual, but logical classification. This classification starts to 1 (01) and finishes to 4 (00). Thus the binary correspondence with sequence 1, 2, 3, 4 is “01”, “10”, “11” and “00”. The other four bits are those of highest weight and correspond to a group number, which starts also at 1. For example, the lamp L1 will be coded xx01 00001, lamp L4 will be encoded xx00 0001. The L33 lamp will be coded xx01 1001 and the L36 lamp will be encoded xx00 1001.
Encoding for flags and solenoids (2nd bit = 0):
The encoding is similar to that used for lamps, with the difference that the flags use the 0 to B groups and solenoids C and D groups. The F1 flag will be coded xx01 0000, F36 flag will be coded xx00 1000. The 8 solenoids are in the C and D groups, the S1 will be thus encoded xx01 1100 and the S8 will be coded xx00 1101.
Scores
Contrary to what is stated in the patent, scores can only be added and not subtracted. The SCORE statement parameters are encoded as follows:
- 1 bit to indicate the mode (always at 1 for addition)
- 3 bits to indicate the multiplier
- 4 bits to indicate the value
The score is added with: value * multiplier. It's possible to used values from 0 to 15 and to choose the following multipliers:
- 0 0 0 ---> 100,000 points
- 0 0 1 ---> 10,000 points
- 0 1 0 ---> 1,000 points
- 0 1 1 ---> 100 points
- 1 0 0 ---> 10 points
- 1 0 1 ---> 1 point
The zero value is nosense because the score will not change. The multipliers 1 1 0 and 1 1 1 should not be used, while they seems working (0.5 point and 0.25 point).
It is possible to encode certain scores in two ways, e.g. 1000 points can be encoded "1000 x 1" or "100 x 10". In the first case the counting will be instant, in the second case it will be progressive.
The flags
These binary indicators have several functions: some are free of use, others are used for to read the configuration, others still start actions when they are positioned.
The group of ten indicators F11 to F20 can also be shifted towards the left with the instruction RFLG, so for example managing animations of bonus, corridors, etc…
- F1...F3  ---> Free
- F4 ---> Give SPECIAL if set to ON
- F5...F10 ---> Free
- F11...F20 ---> Free (reserved for rotations)
- F21 ---> Give EXTRA BALL if set to ON
- F22...F36 ---> Free
- F37 ---> ?
- F38 ---> Configuration: 3/5 balls mode [ON = 3 balls]
- F39 ---> Configuration: 3/5 balls mode [ON = 5 balls]
- F40 ---> ?
- F41...F44 ---> Free
- F45 ---> Configuration: 3/5 balls mode [ON = 3 balls] (like F38)
- F46 ---> Configuration: match feature [ON = match is activated]
- F47 ---> Configuration: game mode [ON = replay, OFF = extra-ball]
- F48 ---> Configuration: tilt effect [ON = ball only, OFF = game]
One can note that certain flags make dual employment (F38, F39 and F45).
The positioning of F21 to ON gives the extra-ball, the lamp L4 (same player shot again) is automatically lighted.
The positioning of F4 to ON gives the spécial, the knocker S2 is automatically activated. According to the configuration, a ball or an additional credit (within the limit of the configured maximum number) is gained.
The index register
It is a simple counter on 4 bits which can be use with discretion (for example for loops). It is set to zero at the beginning of each ball.
Only three operations are possible with this counter:
- Increase the counter with the instruction INCR
- Decrease the counter with the instruction DECR
- Test the value of the counter with the instruction REQL
The bonus
Its principle of operation rests on the use of ten reserved lamps (L23 to L32). Each lamp light and switch-off successively according to the evolution of the bonus. There is no restoring between each ball, it is advisable to correctly countdown the bonus in the routine envisaged for this purpose (in $104).
Two operations are possible for the bonus:
- Increase the bonus with the instruction RBUP
- Decrease the bonus with the instruction RBDN
The first lamp (L23) is not lit at the beginning, then when the bonus is incremented, the following lamp (L24) ignites. If the system of the bonus is used, it is thus necessary to manually light the first lamp (L23) at the beginning of game. On the other hand, when the bonus is decreased, this lamp ignites normally when one passes by again of L24 to L23.
At the time of the calculation of end of ball, the only means of knowing if one arrived at the end is to test the state of the L23 lamp. If this lamp is lit, then one is at the end of the calculation.
Comments and hints
As seen for the cleopatra, the first instruction to the address $100 is executed at initialization (new ball). There is a GOTO INIT (to the address $415), where we place a number of variables. Similarly at the end of ball, the instruction at address $104 is GOTO BONUS (to the address $26B), where we are going to the bonus count.
In some pinball, the positioning of the contacts in the matrix is wisely chooses to optimize programming. For example, to target banks, treatment is cascaded using the control bit (via the TOGL and FLAG instructions) in order to then use a common sequence.
We have written some tools to facilitate study and development in the PGOL language, that you can find on this page.