--- title: "Mixed Game Bag III" id: 51920 type: "computer_media" slug: "mixed-game-bag-iii" url: "http://localhost/computer_media/mixed-game-bag-iii/" markdown_url: "http://localhost/computer_media/mixed-game-bag-iii.md" published_at: "2023-08-16T01:42:22+00:00" modified_at: "2026-04-04T20:17:51+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "Three complete arcade games in one package, each driven by machine code routines and packed with clever BASIC tricks for graphics, scoring, and input handling." 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: "Timex Computer Corporation" slug: "timex-computer-corporation" taxonomy: "post_tag" url: "http://localhost/tag/timex-computer-corporation/" - 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/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Cassette" download_url: "https://archive.org/download/timex-sinclair-software-archive/MixedGameBagIII (1983)(Timex)(US)(TS1000)(Cassette).zip" mediadate: "1983" producer_company: - id: 11401 title: "Timex Computer Corporation" type: "company" url: "http://localhost/company/timex-computer-corporation/" related_products: - id: 13333 title: "Mixed Game Bag III" type: "product" url: "http://localhost/product/mixed-game-bag-iii/" media_type_tags: "Game" --- Mixed Game Bag III is a collection of three arcade-style games — Blitz, Freeway Crossing, and Rats/Snake — packed into a single program listing with each game stored as a separate SAVE block. Each game uses machine code routines called via USR to handle the core gameplay logic, with BASIC handling display, scoring, and input. The Blitz game generates randomized city skylines using block graphic characters and string slicing, while Freeway Crossing uses SCROLL for vertical screen movement and tracks a high score across sessions using a variable. The Snake/Rats game boots directly into machine code via RAND USR, with BASIC only managing the play-again loop. *** ## Program Analysis ### Program Structure The listing contains three independent games, each with its own line 1 REM block containing embedded machine code or data, its own SAVE statement, and its own entry point. The three games are: 1. **Blitz** — a city-bombing game (lines 50–2020) 2. **Freeway Crossing** — a road-crossing game (lines 1–1100, second program block) 3. **Rats / Snake** — a snake-style game (lines 3–520, third block; lines 9–30, fourth block) Each game’s line 1 `REM` statement serves as a machine code store, a well-known technique for embedding binary routines in BASIC programs without using separate memory areas. ### Machine Code Usage All three games rely heavily on `USR` calls into machine code stored in the `REM` lines: - Blitz calls `USR VAL "17105"` at line 300 to run the main game loop, and `USR VAL "16514"` is polled indirectly via `PEEK` in Freeway Crossing. - Freeway Crossing uses `USR 16514` at line 38 to detect collisions, branching to line 500 on a nonzero return. - The Rats/Snake game at line 10 calls `RAND USR 16562`, handing almost all control to machine code; BASIC only manages the play-again prompt. - The `POKE VAL "16753",U` in Blitz (line 80) and `POKE VAL "17209",U` in Rats (line 82) write a user-supplied speed value directly into the machine code routine, providing a difficulty control. Using `VAL "number"` inside `POKE` and `USR` is a memory-saving idiom: storing the number as a string in a `VAL` expression avoids the five-byte floating-point constant that would otherwise be embedded in the BASIC line. ### Blitz — Key Techniques The city skyline in Blitz is generated procedurally at lines 100–160. The outer `FOR U` loop iterates across columns; for each column a random height `Z` is computed, and an inner `FOR Y` loop prints block graphic characters to build the building. Line 125–126 construct the bomb/explosion sprite string `A$` by slicing a master string of block graphic characters using `SGN PI + RND * CODE "£"` as the index, producing varied visual effects. - Line 152 conditionally prints a solid block (`"███"`) using the `AND RND]RND)▙RND▘,, GOSUB [K]TAN 5▙RNDO# RETURN4S£Q 7O5[,,]RNDP▘▘▘TAN ▘ TAN LN [V]▝Y LOAD [X]4C[W]C0Y TO [W]44U▜RND[R]C▖ RETURN▌S-5▄RNDO# RETURNVAL "1E3" THEN PRINT AT PEEK VAL "16515"+SGN PI,PEEK 16514;"▒,,~~" 820 PRINT AT INT RND,CODE "?";"SCORE ";U 2010 PAUSE CODE " COPY" 2020 GOTO CODE "W" 1 REM ▘▘ E:RND)5 # RETURN#C▝[R]"";# RETURN#C▝[R]"";# RETURN#C▝[R]"": TAN PPPPP 2 LET M=INT RND 5 PAUSE CODE " COPY" 9 LET P=CODE "3" 10 CLS 11 FOR G=INT RND TO CODE "+" 12 PRINT AT G,P;" " 13 NEXT G 15 LET F=CODE "▖" 20 LET G=SGN PI 34 LET R=CODE "?" 36 PRINT AT 20,31;" ";AT 21,31;" ";AT R,P; 38 LET D=USR 16514 41 IF D THEN GOTO VAL "500" 42 PRINT "Q";AT R+1,P;"[,,]";AT R+2,P;"▞" AND G=INT G AND INKEY$ <>"6" AND INKEY$ <>"7";"▌" AND G=INT G AND (INKEY$ ="6" OR INKEY$ ="7");"▐" AND G<>INT G 68 LET S=R 69 LET Q=P 70 IF NOT P THEN GOTO CODE " IF " 75 LET G=G+.5 105 LET W=1+RND*12+(15 AND (G=INT G)) 110 PRINT AT 19,W;"▐▒▌";AT 20,W;"▖[O]▗";AT 21,W;"▛[▒]▜" 111 LET P=P+(INKEY$ ="8" AND P<31)-(INKEY$ ="5" AND P>0) 112 LET R=R+(INKEY$ ="6" AND R<17)-(INKEY$ ="7" AND R>0) 115 PRINT AT S,Q;" ";AT S+1,Q;" ";AT S+2,Q;" " 120 SCROLL 122 SCROLL 130 GOTO 36 250 LET V=(100-INT G) AND G<100 255 PRINT AT R+CODE "▝",P;"▟";AT P,P;"** CONGRATULATIONS ** " 260 IF V>M THEN LET M=V 262 PRINT "█[S][C][O][R][E][:]";V;" " 264 PRINT " " 270 PRINT "█[H][I][G][H]█[S][C][O][R][E][:]";M;" " 290 GOTO PI 500 SCROLL 501 PRINT AT R,P;"▒[S]";TAB P;"[▒][P]";TAB P;"▒[L]";TAB P;"▗[A]";TAB P;"▖[T]";AT INT RND,INT RND; 510 LET V=INT RND 520 GOTO VAL "262" 990 SAVE "CROS[S]" 992 PRINT AT CODE "~~",INT RND;"█[F][R][E][E][W][A][Y]█[C][R][O][S][S][I][N][G]█" 1000 LET M=INT RND 1010 LET P=CODE "3" 1100 GOTO VAL "11" 1 REM E:RND#▞ TAN O[J]M[~~]RNDWM[,,]RND 7# RETURN COS FFY COPYM[,,]RND# RETURN COS 7)5 [J]M[,,]RNDXM[~~]RND[R] GOSUB ## RETURN COS [J]WM[~~]RND;;# RETURN COS [J]M["]RND▘ TAN ;>3#>=8(?▘3 VAL LN PRINT ▒# LPRINT PI REM UEXP RND5[,,]RND▚MEXP RNDUINT RND5[~~]RND▚MINT RNDLN RAND RNDTAN E£RND7- UEXP RND#;)5 GOSUB #UINT RNDW#;( CLEAR##TAN LN LPRINT RND6SQR RND RETURN ""Q▒TAN P# ▌[0] REM 1UEXP RND5[,,]RND[-]MEXP RNDUINT RND5[~~]RND[-]MINT RNDLN RAND RND#[$]RND1111Y=MINT RNDLN RAND RND[R]COS Y▘MINT RND▘ ▘TAN Y2MEXP RNDLN RAND RND[R]COS Y▘MEXP RND▘ ▘TAN Y▘MEXP RNDLN RAND RND[R]COS Y2MEXP RND▘ ▘TAN Y▘MINT RNDLN RAND RND[R]COS Y=MINT RND▘ ▘TAN 1█11ESQR RND# RETURN[,,]ASN #INKEY$ RETURN[(]ASN #INKEY$ RETURN[~~]ASN #INKEY$ ##INKEY$ LN [-]INKEY$ # RETURN▘COS Q▒TAN 1LN ##LN [7]#TAN [)][(]1# ▞[6] REM 2UORND NEW▘C▝Y COPY#U[,,]RND[R]C,,[J]M[,,]RND#M[~~]RNDTAN M[~~]RND#M[,,]RNDTAN 22222225ABS RND#[R]COS O#UORND#- 5▘ #▞▒ACS ZK▘;( RAND # RETURN▘SQR #COS INKEY$ 222222LN =INKEY$ #[L]""LN LIST INKEY$ ▘ TAN 22ESQR RND#▘▘▘ RETURN[,,]COS RETURN[~~]COS RETURN[(]COS RETURN[)]COS ▘ TAN 22UPEEK RND RETURN64(USTR$ RNDWMSTR$ RND RETURN+**Y▘MSTR$ RNDTAN USTR$ RNDXMSTR$ RND""Y=MSTR$ RNDTAN 22LN CHR$ RND#[R]INKEY$ LN [V]▝▘ # RETURN TO 4># RETURN RUN 4▌:5TAN RETURN LOAD "":6TAN RETURN LOAD 4,,# RETURN LOAD "":7TAN RETURN RUN ""# RETURN LOAD "":8TAN 3LN #PI#[R]C▀MPEEK RNDUPEEK RND▞ #TAN UPEEK RND RETURN84(UUSR RNDWMUSR RND RETURN3**Y▘MUSR RNDTAN RETURN54:UUSR RNDXMUSR RND""Y2MUSR RNDTAN #RNDPI)[Y]INKEY$ ▘▝ LN #"AT ▖# RETURN+ AND OR RNDTAN 4E£RND7- UUSR RND#;)5 GOSUB #USTR$ RNDW#;( CLEAR##TAN LN [8]PILN [P]PILN POKE PI[R]""Q█TAN 4LN Q#LN ?#C▖▘ TAN LN /PI##[R]C GOTO ▘▘▘TAN ▞▝:▞VAL LN [V]▝AT £4 SAVE ( POKE TAN 45ABS RNDQ[Z]7Q87Q?7Q?LN COS INKEY$ TAN ▘ COPYLN ##CY▘ ▘LN ##CQ▘ COPY LN ##CI▘▘ LN ##CA▘ TAN EEXP RND FAST#[,,]##█#6EXP RNDVAL LN RAND RNDAT LPRINT 6EXP RND RETURN[,,]COS RETURN[~~]COS RETURN[(]COS RETURN[)]TAN GOSUB #[,,]RNDTAN LN 2##[L]COS LN BPI#[L]4£LN CINKEY$ #[L]C*LN E#/ REM LN [G]INKEY$ #[L]C STEP LN WINKEY$ #[L]4 OR ▘▘▘TAN LN ###[L]4 SCROLL/ NEXT 2 GOTO EXP PI 3 SAVE "RAT[S]" 60 PRINT ,," SPEED? (1 TO 250)" 80 INPUT U 82 POKE VAL "17209",U 85 CLS 90 PRINT "[(][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,]" 130 PRINT AT CODE "+",SGN PI;"[~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][~~][)]" 500 LET U=USR VAL "16999" 510 PRINT AT INT RND,INT RND;"YOU" AND U;"I" AND NOT U;" WIN " 520 RUN 1 REM ▜RND########################################(6 >"[<]:(▞+VAL $LN PRINT ▒AT Y█NOT ( PRINT $4 LIST LN PRINT ▒Y0NOT NOT NOT Y COPYM[L]RND5[E]RND6▙RNDE£RND)1 ; FOR 5▜RND▞=#7#7 FAST##)) ;## LPRINT ( LIST E[K]RNDY▘[W]K▒▘# GOSUB PI6[K]RND#VAL LN [V]▝AT ( RAND ACS #C###8C#LN [X]▛#5[G]RNDCHR$ 5S# RETURN▖K#▞ #,,#- E▜RND:)[B] GOSUB PI;# RETURN█CA RETURN▒C6 RETURN▞C2 RETURN[$]C▝/# FASTE£RND777# RETURN94~~Y[-]M[L]RNDQ0F/ LET O LPRINT FASTE▙RND#7#Y█>)[F]RND##FF▘A GOSUB [S] LPRINT 6▜RNDE▜RND FAST5▜RND77Y▒ GOSUB #▙RND[B] FAST GOSUB PI LPRINT PRINT #7#7 LET C▀>/ LIST Y▞> LPRINT QO▘#▘E£RND,,FY[$] GOSUB [T]7 LLIST DIM INKEY$ )) ;# RETURN█C~~ RETURN▒CD RETURN▞C;/▝Q[$][B] GOSUB #Q█ FASTVAL ▘▜RNDE▙RND[B] GOSUB PIAT LPRINT COS /LN FASTE▙RNDFF6▙RND LPRINT /<>[B] GOSUB #/[W]E▜RNDUORND***[H] RETURN S< NEW?E£RND)▌ ;#▞ ,,# RETURN▞Q[$]COS # POKE RND 9 CLS 10 RAND USR 16562 11 CLS 12 PRINT "GO AGAIN ? Y/N" 13 INPUT Y$ 14 IF Y$="N" THEN STOP 15 GOTO 9 20 SAVE "SNAK[E]" 30 GOTO 9 ```