--- title: "GTO" id: 57350 type: "computer_media" slug: "gto" url: "http://localhost/computer_media/gto/" markdown_url: "http://localhost/computer_media/gto.md" published_at: "2024-10-04T08:43:52+00:00" modified_at: "2026-04-03T07:58:34+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/198_GTO.png" excerpt: "A block-graphics GTO badge drawn entirely in BASIC, with animated letter-by-letter reveal, diagonal curved edges, and a mesh-fill interior — all without machine code." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Tony Willing" slug: "tony-willing" taxonomy: "indiv" url: "http://localhost/indiv/tony-willing/" genre: - name: "Demo" slug: "demo" taxonomy: "genre" url: "http://localhost/type/demo/" media_contents: - id: 56735 title: "Timex Sinclair Public Domain Library Tape 1004" type: "computer_media" url: "http://localhost/computer_media/timex-sinclair-public-domain-library-tape-1004/" media_type: "Program" programmers: - name: "Tony Willing" slug: "tony-willing" taxonomy: "indiv" url: "http://localhost/indiv/tony-willing/" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/09/198_GTO.png" media_type_tags: "Demo" --- This program renders a stylized “GTO” graphic on screen using block graphics characters and inverse video text. The image is built up in stages: first a diamond/oval outline is drawn using diagonal block graphic pairs (▖▝ and ▘▗) in nested FOR loops that shift the column variable to create slanted edges, then the interior is filled with checkerboard-pattern inverse spaces to suggest a grille or mesh. A border of inverse asterisks is drawn around the full screen perimeter via the GOSUB 2000 subroutine before the main graphic is rendered. The lettering “GTO” is spelled out with block graphics and solid-fill characters (▄▄ sequences), with each letter element revealed using a short delay loop at line 1000. *** ## Program Analysis ### Program Structure The program is organised into a main drawing sequence (lines 0–600), a short delay subroutine (lines 1000–1020), and a border-drawing subroutine (lines 2000–2120), followed by some unreachable utility lines (2130–2160). Execution begins at line 15 with a call to the border routine, then proceeds to draw the oval outline, fill the interior, add the “GTO” lettering with inter-step delays, and finish with credits and a POKE. ### Outline Drawing with Diagonal Block Graphics The oval/diamond outline of the badge is constructed in four quadrants using FOR loops that simultaneously advance the row (`F`) and adjust the column (`G`) by ±1 each iteration. Two block graphic pairs are used: - `▖▝` (`\.'\ '` — bottom-left + top-right quadrant blocks) for the left-leaning edges - `▘▗` (`\'\ .` — top-left + bottom-right quadrant blocks) for the right-leaning edges Lines 40–70 draw the upper-left diagonal (column decreasing), lines 90–120 draw the lower-left diagonal (column increasing), lines 140–170 draw the lower-right diagonal (column increasing), and lines 190–220 draw the upper-right diagonal (column decreasing). The top edge (line 20) is a straight row of `▄▄` blocks. ### Interior Fill Pattern The interior of the badge is filled with a checkerboard-like pattern of inverse spaces (`% %` — an inverse space followed by a normal space) using three nested groups of PRINT statements at lines 230–360. Each group covers a horizontal band and steps in increments of 4 columns (`STEP 4`), creating a regularly spaced dot-grid effect suggestive of a car grille. ### GTO Lettering The solid body of the badge is laid in at lines 370–430 using rows of `\##` (solid filled blocks, i.e. ██) bordered by `\,,` characters. The “GTO” letters are then cut out of this solid area by overprinting with a mix of block graphic characters and spaces at lines 450–550. Each letter segment is printed in sequence, with a call to the delay subroutine (GOSUB 1000) between each, producing a slow animated reveal: 1. Line 450: Top of G, T, O 2. Line 470: Middle body row 1 3. Line 490: Middle body row 2 4. Line 510: Bottom of G, T, O 5. Lines 530–540: Right side of O filled in ### Delay Subroutine The subroutine at lines 1000–1020 is a simple busy-wait loop iterating 20 times with an empty body (`FOR D=1 TO 20: NEXT D`). It is called six times during the lettering phase to pace the reveal. ### Border Subroutine The GOSUB 2000 routine draws a rectangular border of inverse asterisks (`%*`) around the full 31×21 screen perimeter by traversing all four sides in sequence: top (line 2010), right (line 2040), bottom (line 2070), left (line 2100). Each side uses its own FOR loop and `PRINT AT`. ### Credits and Termination Line 560 prints `AW/83` (author initials “Anthony Willing” and year 1983) in inverse video at the bottom-right, and line 580 prints `1966` in inverse video near the top — the year the Pontiac GTO was introduced. Line 590 executes `POKE 16384,74`, writing the value 74 (ASCII ‘J’) to the first byte of the display file, which on the Spectrum alters the top-left character cell. The program then halts with `STOP`. ### Unreachable Lines Lines 2130–2160 are never reached by normal execution flow: - Line 2130: `STOP` — redundant guard - Line 2140: `CLEAR` — utility line - Line 2150: `SAVE "1019%8"` — save command with an inverse character in the filename - Line 2160: `RUN` — auto-restart utility ### Notable Techniques and Anomalies - The diagonal outline technique — incrementing/decrementing both row and column in a single loop — is an efficient way to approximate curves using block graphics without lookup tables. - The `\##` sequences used for the solid badge body are block graphic characters that render as fully filled (██) cells, giving a high-contrast filled rectangle. - Using `GOSUB 1000` as a timed delay between drawing steps is a common BASIC animation idiom; the loop count of 20 is short enough to be barely perceptible. - The POKE to address 16384 is a minor cosmetic effect on the top-left display cell and does not affect program execution. - The `\,,` sequences appear throughout the badge border rows; these are not standard zmakebas block graphic escapes and may render as literal comma characters or as artefacts depending on the character set — possibly intended as a specific graphic character code. ## Source Code ``` 0 REM "GTO" GRAPHIC BY ANTHONY WILLING 10 REM "GTO" 15 GOSUB 2000 20 PRINT AT 3,10;"...................." 30 LET G=9 40 FOR F=4 TO 8 50 PRINT AT F,G;".'" 60 LET G=G-1 70 NEXT F 80 LET G=5 90 FOR F=9 TO 18 100 PRINT AT F,G;"'." 110 LET G=G+1 120 NEXT F 130 LET G=15 140 FOR F=18 TO 9 STEP -1 150 PRINT AT F,G;".'" 160 LET G=G+1 170 NEXT F 180 LET G=24 190 FOR F=8 TO 4 STEP -1 200 PRINT AT F,G;"'." 210 LET G=G-1 220 NEXT F 230 FOR S=8 TO 20 STEP 4 240 PRINT AT 9,S;"% % " 250 PRINT AT 10,S;"% % " 260 NEXT S 270 FOR S=10 TO 18 STEP 4 280 PRINT AT 11,S;"% % " 290 PRINT AT 12,S;"% % " 300 NEXT S 310 FOR S=12 TO 16 STEP 4 320 PRINT AT 13,S;"% % " 330 PRINT AT 14,S;"% % " 340 NEXT S 350 PRINT AT 15,14;"% % " 360 PRINT AT 16,14;"% % " 370 FOR H=11 TO 18 380 PRINT AT 4,H;",," 390 NEXT H 400 PRINT AT 5,9;",,####################,," 410 PRINT AT 6,8;",,########################,," 420 PRINT AT 7,7;",,############################,," 430 PRINT AT 8,6;",,################################,," 440 GOSUB 1000 450 PRINT AT 5,10;"~~~~~~,, ,,~~~~~~" 460 GOSUB 1000 470 PRINT AT 6,10;" ###### ## " 480 GOSUB 1000 490 PRINT AT 7,10;" ## ## ## " 500 GOSUB 1000 510 PRINT AT 8,10;",,,,,,##,,,,##,,,,,," 520 GOSUB 1000 530 PRINT AT 6,18;"##" 540 PRINT AT 7,18;"##" 550 GOSUB 1000 560 PRINT AT 19,24;"%A%W/83" 570 GOSUB 1000 580 PRINT AT 2,13;"%1%9%6%6" 590 POKE 16384,74 600 STOP 1000 FOR D=1 TO 20 1010 NEXT D 1020 RETURN 2000 FOR O=0 TO 30 2010 PRINT AT 0,O;"%*" 2020 NEXT O 2030 FOR D=1 TO 20 2040 PRINT AT D,30;"%*" 2050 NEXT D 2060 FOR U=30 TO 0 STEP -1 2070 PRINT AT 20,U;"%*" 2080 NEXT U 2090 FOR Q=20 TO 1 STEP -1 2100 PRINT AT Q,0;"%*" 2110 NEXT Q 2120 RETURN 2130 STOP 2140 CLEAR 2150 SAVE "1019%8" 2160 RUN ```