The Bally Arcade provides several routines to display alphanumeric information. This section provides details about the standard and small character sets, loading alternate fonts, and the options common to all alphanumeric display routines.
The Bally Arcade system font uses a subset of the standard ASCII table along with a few extended options (see ASCII representation below). The following example displays the full standard system font characters 20H–63H (including the leading space character) using a STRDIS call:
The following register/argument combinations are used by all of the alphanumeric display routines.
Register C contains the options byte formatted as shown below:
The Enlarge Factor specifies if the character is to be enlarged in size. The table below defines the possible values for this parameter.
Enlarge Factor | Size Multiple | Enlarged Size of Single Pixel |
---|---|---|
00 | 1 | 1×1 |
01 | 2 | 2×2 |
10 | 4 | 4×4 |
11 | 8 | 8×8 |
XOR/OR WRITE causes the character to be ORed/XORed with the data 'beneath' it. These writes are performed through Magic memory.
ON/OFF COLOR specifies the pixel values to translate the one-bit-per-pixel character patterns into. (All characters are stored as one-bit-per-pixel, but are written two-bits-per-pixel via the Expander.) For example, the value 1101 specifies that the foreground character color is 11, and the background color is 01.
In the examples above, the colored pixels visible at the bottom of the screen display the contents of scratchpad RAM. They are left visible to show string display limits. Strings that overlap scratchpad RAM can overwrite the stack and cause program crashes.
The x- (E) and y-coordinate (D) give the address of the upper left-hand corner where the first character will appear. Upon return, these registers are updated to give the address of the character to the right (or below if no more space exists on the line), simplifying the composition of complex messages.
However, be aware that placing a character whose frame extends beyond the right edge of the screen and has no room to wrap to the next line will cause the character to wrap to the left edge on the same line. This is especially important when using the expansion option, since wrapped characters will overwrite other characters.
In the example above, the system attempts to display the string '012' with the 8x Enlarge Factor set. However, the character '2' is too large to fit on the line, so its right edge wraps to the left side of the display, overwriting a portion of the '0' numeral.
Register IX contains the Alternate Font Descriptor. It is required only if an alternate font is referenced in the system routine call (i.e., pre-loading IX with the alternate font address). Each character must be stored in one-bit per pixel format.
The format of the alternate font descriptor is illustrated below:
The font base character defines the first ASCII character code in the alternate font. Codes $80–$FF are reserved for this purpose. The frame size describes the rectilinear area that encloses the character and its margin, while the x- and y-sizes describe the height and width of the characters themselves. Finally, the font pattern table is a 16-bit address pointer to the user-defined patterns.
The standard system font, for example, has 5×7-pixel characters within an 8×8-pixel frame, leaving a three-pixel margin on the right and a one-pixel margin on the bottom. The font's base ASCII character is 20H.
In the illustration above, the alternating black and grey boxes outline the 8×8 character frames; the red pixels display eight character patterns in the system font. Note that most characters push against the upper and left borders of the frame in order to leave margins to the right and bottom. Some thinner characters like the numeral 1 have additional padding on either side.
A built-in small (3×5-pixel) character set is displayed using this facility. A word in the system dope vector (FNTSML) points at a standard alternate font descriptor for this character set (located at $020D), as seen in the code snippet below:
; --- FNTSML: FoNT descriptor for SMaLl font ; L020D: SMLFNT: DB $A0 ; FonT BASE character DB $04 ; FonT Frame X Size width DB $06 ; FonT Frame Y Size height DB $01 ; FonT X size of char in BYTEs DB $05 ; FonT Y SIZe height in bits DW SMLCHR ; FonT Pattern Table address
The small font includes numerals 0–9, a colon (:), and a bullet icon used in Gunfight.
Testing shows that base character starts at B0H instead of A0H?
Gunfight uses FNTSML for its upper HUD, including the bullet icons.
Combining character enlargement, positioning, and foreground/background colors can create interesting visual variations:
Bally Arcade games routinely mix multiple character options and fonts:
ASCII character codes represent all strings, with the following extensions:
The following table specifies which registers are loaded for a given code as well as the order in which the new register data follows.
Code (hex) | Registers | Code (hex) | Registers |
---|---|---|---|
64 | C | 72 | IX,D |
65 | E,C | 73 | IX,E,D |
66 | D,C | 74 | IX,C |
67 | E,D,C | 75 | IX,E,C |
68 | NONE | 76 | IX,D,C |
69 | E | 77 | IX,E,D,C |
6A | D | 78 | IX |
6B | E,D | 79 | IX,E |
6C | C | 7A | IX,D |
6D | E,C | 7B | IX,E,D |
6E | D,C | 7C | IX,C |
6F | E,D,C | 7D | IX,E,C |
70 | IX | 7E | IX,D,C |
71 | IX,E | 7F | IX,E,D,C |
In the following example, inline ASCII control codes are used to alter the characters within the startup menu. In the first screen, the string address points to the string stored at MENNAM:
MENNAM: DB "DISPLAY TEST", 0
In the second screen, control code 64H sends new display options to register C. In this example, each byte following the control code alters the foreground/background text colors and/or the text enlargement scale.
MENNAM: DB "D",$64,$0B,"I",$64,$46,"S",$64,$0C,"P",$64,$01,"LAY TEST", 0
[NM:31–3, 38]