--- title: "High Res Space Inv" id: 56688 type: "computer_media" slug: "high-res-space-inv" url: "http://localhost/computer_media/high-res-space-inv/" markdown_url: "http://localhost/computer_media/high-res-space-inv.md" published_at: "2024-09-22T23:31:42+00:00" modified_at: "2026-04-03T07:59:00+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/InvaderA.jpg" excerpt: "A machine-code-powered Space Invaders clone with custom UDG sprites, full alphanumeric bitmap fonts, joystick support, and a half-speed trainer mode loaded via SRAM." 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: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" genre: - name: "Arcade" slug: "arcade" taxonomy: "genre" url: "http://localhost/type/arcade/" - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Cassette" programmers: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" download_url: "https://archive.org/download/timex-sinclair-software-archive/High%20Res%20Space%20Inv%20%281987%29%28FRED%20NACHBAUR%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1987" images: - url: "http://localhost/wp-content/uploads/2024/09/InvaderA.jpg" - url: "http://localhost/wp-content/uploads/2024/09/InvaderB.jpg" media_type_tags: "Arcade, Game" --- # High Res Space Inv High Res Space Invaders is a Space Invaders arcade game that uses machine code stored in RAM (SRAM) starting at address 22016 to drive the main gameplay loop, with BASIC handling initialization, screen setup, and game-state management. The program loads custom UDG (user-defined graphic) character sets via LPRINT commands directed at the RAM expansion, defining invader sprites, a rocket/bullet, a mothership, and a full alphanumeric font in 8×8 pixel bitmaps. Gameplay supports either keyboard (1–5/6–0 to move, SHIFT to fire) or a Zebra joystick, selected at startup and stored via POKE 16417. A trainer mode running at half speed is toggled by pressing T before the invasion begins. The score is maintained across rounds using PEEK/POKE on addresses 16382–16383, and a bonus screen fires when a super-bonus condition is detected, seeding RAND with the accumulated score value. *** ## Program Analysis ### Program Structure The program is organized into several logical blocks across its line-number space: - **Lines 0–3:** REM statements containing embedded machine code and data used by the SRAM routines. Lines 0–3 are dense binary payloads; the actual code tokens visible are artifacts of the machine code bytes being interpreted as BASIC tokens. - **Lines 5–8:** Mode setting (`FAST`) and title/credits REM banners with block-graphic borders. - **Lines 10–17:** Input/joystick selection and SRAM readiness prompt. - **Lines 20–102:** UDG initialization via conditional `LPRINT` calls, sending hex bitmap strings to the SRAM hardware. - **Lines 105–180:** Cover screen setup, trainer-mode selection, and demo “patrol” launch. - **Lines 200–330:** Main game loop — three lives, calling `GOSUB 2000` for screen setup, then jumping into machine code at `USR 22016`. - **Lines 512–580:** Super-bonus handler with animated “SUPER BONUS” scroll, score reload, and jump to `USR 22021`. - **Lines 2000–2090:** Screen setup subroutine — clears display, draws the invader grid placeholders using block graphics, renders score and remaining lives, places shields and mothership UDGs. - **Lines 9000–9010:** SAVE and auto-restart. ### Machine Code Integration The core gameplay engine resides as machine code in SRAM, accessed at addresses `22016` and `22021` via `USR` calls. The BASIC program acts purely as a loader and shell; `GOTO USR 22016` (line 240) hands control entirely to the machine code for the duration of a game round. A secondary entry point at `USR 22021` (line 580) is used for the bonus-round continuation, suggesting the machine code supports multiple entry points for different game states. The address `HR=19400` (set at line 25) is used as a sentinel: `IF USR HR THEN ...` conditionally executes BASIC statements only when the SRAM module is active and the machine code at that address returns a non-zero value. This is the program’s way of detecting whether the hardware expansion is present and initialized, and it gates nearly every significant action including UDG loading, screen clearing, score display, and game-over presentation. UDG data is transferred to SRAM via `LPRINT` statements (lines 30–90) that send hex-encoded bitmap strings. The variable `U` used in these lines is a BASIC variable set by the machine code return value, acting as a channel identifier or address selector for the SRAM write routine. ### UDG and Sprite Design Eight complete sets of UDGs are defined, covering: - Multiple invader body shapes (lines 30–40), consistent with the classic three-row invader hierarchy. - Explosion, shield, and miscellaneous graphics (line 40). - Rocket and bullet sprites (line 50). - Mothership and its explosion/hit variants (line 60). - Custom numeric digits 0–9 (line 70). - Full alphabetic characters A–M and N–Z (lines 80–90), enabling the high-resolution score and message display without relying on the built-in character set. Each UDG is defined as 8 bytes (8×8 pixels) encoded as comma-separated hex pairs, giving clean 8-pixel-wide sprites suitable for the high-resolution display mode implied by the program title. ### Score and State Persistence The score is stored across subroutine calls and rounds using a two-byte value at addresses `16382`–`16383`, read and written with `PEEK`/`POKE`. Line 2040 constructs the display score string with: `LET F$="00000"+STR$ (PEEK 16382+256*PEEK 16383)` and then takes the rightmost 5 characters for zero-padded display. Lines 560–565 reload these addresses from `16434`–`16435` after the bonus screen, suggesting the machine code updates a secondary score register that BASIC then copies back. The trainer (half-speed) mode flag is stored via `LET S=(INKEY$ ="T")` — a Boolean expression yielding 1 or 0 — and passed to the machine code at line 170 via another conditional `LPRINT`. ### Key BASIC Idioms - `IF USR HR THEN ...` — used pervasively as a hardware-presence guard; the machine code at `HR` returns 0 (false) if SRAM is absent, suppressing all dependent actions. - `GOTO USR 22016` — transfers control permanently to machine code; the BASIC loop at lines 200–270 only resumes if the machine code returns normally (e.g., end-of-life). - `LET S=(INKEY$ ="T")` — Boolean assignment storing 1 or 0 directly into a numeric variable. - `RAND 1000+PEEK 16382+256*PEEK 16383` (line 550) — seeds the random number generator with the current score, used in bonus-round scoring. - The `S$` variable (line 20) is initialized to 32 tilde characters, used as a decorative separator line across the full 32-column display width. ### Screen Layout (GOSUB 2000) The setup subroutine at line 2000 builds the play field using `PRINT AT` with block graphic characters to lay out an invader grid skeleton, then places shield characters (`$:?`, `$\,,?`, `$\~~?`) and mothership graphics (`=\~~\~~\~~+`, `(\~~\~~\~~)`, `(:::)`) at fixed positions. The remaining lives are printed as `CHR$ 11+" "` repeated `L` times, where `L` counts down from 3 in the outer `FOR` loop. ### Game Flow Summary 1. Joystick/keyboard selection and SRAM check (lines 10–17). 2. UDG data upload to SRAM (lines 30–90). 3. Cover screen with point values, controls, and trainer option (lines 110–180). 4. Outer lives loop (`FOR L=3 TO 0 STEP -1`, lines 200–270); each iteration sets up the screen and launches machine code. 5. Game-over screen with P/Q prompt for replay or quit (lines 280–295). 6. Bonus handler as a separate entry path (lines 512–580), returning to machine code via `USR 22021`. ### Anomalies and Notes - Line 102 contains `IF USR HR THEN RUN` — if the SRAM check passes at that point during UDG loading, the program restarts entirely. This may be intentional as a reset-on-error guard. - Line 310 contains `IF USR HR THEN RETURN` following `STOP` — this is unreachable in normal flow unless jumped to directly by machine code, suggesting it serves as a machine-code callback exit point. - Lines 258–267 execute up to three `RAND` and `RAND 31` calls via the USR guard after each machine-code round, likely resetting RNG state used by the machine code. - The REM lines (0–3) contain what appears to be the actual machine code binary as embedded token data — a standard technique for storing binary payloads in BASIC programs that load them into RAM at startup. ## Source Code ``` 0 REM [C]█[1][9][8][7]█[S][M][C]##▘ ""LN RUN ##[P]#Y2 GOSUB #<>5▟▝TAN PRINT # RETURN,C▌LN [*]RNDINT / LET TAN 6-RNDLN #? FASTLN LN + LPRINT TAN LN [H]RND PRINT LN [4]RND7LN [H]RND# LET #TAN 7# RETURN#C▀ RETURN;""6-RNDTAN A ##▞▌ACS 9ACS =( IF ,,▘ 4,,TAN 7LN [T]RNDLN [4]RNDLN ,,INKEY$ ##ACS ZACS ZACS Z##STR$ LN STR$ RND LET J NEW▛W#TAN Y3[)]K▌LN [*]RNDINT (Y[Z][(]SQR LN [*]RNDINT 25 6AT ZA4##<▘ COPY*Q GOSUB [K]TAN NEXT Y▞# ( CLEARLEN LIST W4 CLEAR▞"" CLEARACS ##C▝▞[K])4 5 4##INKEY$ ▌ASN #INKEY$ ;# GOSUB ###[F] SCROLLE£RND ###) RUN ▙;Y2 GOSUB #Y PRINT ▘▛▝ CLEARACS ##CODE [P]▝LN [>]▝LN ##<>5GINKEY$ #[8]▝ CLEARACS #▚/▖ CLEARACS #LEN E£RND▘9 GOSUB PIF FOR 5 █;6#INKEY$ FOR GOSUB [K]LN F?<>5GINKEY$ TAN 7LN [T]RNDLN [4]RND##LN ▞INKEY$ VAL 7LN [H]RNDAT LN STR$ RND#TAN 2 COPY/▝2 STR$ 7LN [T]RNDLN ,,INKEY$ SGN GOSUB ##ZLN LET RND##?( CLEARACS .*PI▌4▝▞▒▛( CLEAR#TAN Y COPY/▘[J]MVAL Z CLEARACS #[:]7LN [T]RNDLN ,,INKEY$ # RETURN,4"7 GOSUB ##ZLN [T]RNDLN ,,INKEY$ ## GOSUB ##ZVAL #[)]-▘K▖ GOSUB #- COPY4▝- FAST##MSQR Z LET [(]2▘K▖ GOSUB #2 COPY4▝2 ##MINT Z#[W]S▞##- /▝2 GOSUB #SGN Z6PEEK Z#[B]3#A 6STR$ ZAT VAL Y[Z][(] PRINT UVAL Z# LET CLEARACS ##4▌LN SGN INKEY$ /▀LN ##UPEEK Z#▞ USTR$ Z##,,#MSTR$ Z GOSUB #SGN ZUUSR Z# GOSUB PIS▒#MSTR$ Z GOSUB #INT ZAT #▙##▄#5CHR$ ZOUUSR Z[Y]4[N] GOSUB ##ZTAN Y COPY/▘[J]MVAL Z7LN [T]RNDLN [4]RNDVAL 7LN [H]RND#I 6INT Z#6SGN ZAT Y▘ PRINT VAL VAL EINT Z GOSUB #SGN Z▞▌VAL ACS EACS .( IF [R] GOSUB #6INT Z GOSUB #SGN ZAT ACS GACS 1( IF ;6SGN Z GOSUB #INT ZAT #ACS <[~~]##ACS +[£]#Y[Z][(]S,, PRINT UVAL Z# LET LN SGN INKEY$ AT LET W RETURNASN S[O]TAN Y▘MINT ZLN COS RNDCOS LN [H]RNDMINT ZLN TAN RNDCOS 7LN [T]RNDLN [4]RND[S]S▀#INKEY$ #LN (INKEY$ #INKEY$ LN (INKEY$ #PI GOSUB #SQR Z[)]W PRINT 7LN [T]RND[S]K▀#INKEY$ # GOSUB #ABS Z[(]W4▘XSGN # GOSUB #USR ZUPEEK Z#USGN Z#[B]LN INPUT RND6CHR$ ZUABS Z#USGN Z#[B]LN INPUT RND6**Z£TAN LN +#4*UINT Z#5 4▘ /#J#7"#[L]4 RUN +4 INPUT TAN USTR$ ZECHR$ Z GOSUB #**Z6 AND Z GOSUB #>=Z PRINT FAST GOSUB # LPRINT C#UPEEK ZLN INKEY$ STR$ VAL #3ZACS <( IF AT ACS .*( CLS#SGN 7 FAST[B] GOSUB # LPRINT C▌#J#/ NEXT UABS ZLN INKEY$ Y,,[(]#VAL ,*ZACS 1( IF AT ACS +3( CLS>▘4 E>=Z,,6>=Z FOR E AND Z,,6 AND Z LET X4[A]5INT ZP4[?]TAN UUSR Z RETURN▒4▖,J/NOT UPEEK ZLN INKEY$ VAL ,3ZACS +( IF AT ACS 1*( CLS#UABS ZJ NEW▛C$#,VAL ?ACS 0( CLSAT ACS ▖( UNPLOT #/[E]E(RND#[T]COS RETURN█4▌LN [*]RNDINT ▘VAL LN PAUSE ,,AT FOR / GOTO PRINT SCROLL FAST:RND▟#LN ##7 FAST▞▌[J]#( CLEARSGN LPRINT LET TAN LN SCROLLRND#?( CLEARLN ##K▀Y▟>LN COS RNDTAB SQR #TAN LN SCROLLRND FASTAT LN 4+ FASTLN ##AT FAST##LN PLOT ;LN [~~]+ LPRINT / STEP LN SCROLLRND#▞ / SLOW###Y[Z][(]STR$ VAL PRINT LN SGN INKEY$ LET AT SGN TAN 2 COPY/▝2 STR$ LN C#SGN USTR$ Z#UPEEK Z5SGN Z PRINT FASTLN [D]#+C▞WLN [J]#/ RUN UUSR Z# LPRINT LET F FASTLN [D]#+C▞£LN [J]#/ RUN USTR$ Z# LPRINT UABS Z PRINT FASTLN [D]#+C▞XLN [J]#/ RUN UUSR Z# LPRINT LET 7LN [D]#+COS $LN [J]#/ SAVE LN 7?2"" CLEARACS ##C▝2[K]5 4[J]PEEK CLSLN #?ABS ▐▒<= CLS*K CLS-4▞▒#<= CLS3K CLS# NEW█PEEK CLSACS )( PAUSE 7+4 FOR <= CLS3K CLSLN ##/SGN 76-RNDLN #?LN [B]:##▘▘COS CLEARACS V#""( RAND $4 PLOT .#[N]4 INPUT TAN 7# RETURN#4,,LN OR #LN RUN #/L7# RETURN,C> RETURN;CG RETURN#C# RETURNAT C# RETURNTAB C#/# GOSUB #AT Z# NEW LIST LEN ( RETURNRNDCODE [O]#ATN [J]#/STR$ #LEN ▒#[J]# GOSUB #AT ZTAN ▞ COPY7# RETURN#COS RETURN,4▖Y▖/" RETURN;4VAL ▖# RETURN▀ASN SQR #M""Z/ STOP GOSUB #AT Z/SQR 7LN [T]RND## RETURN[T]ABS =INKEY$ # RETURNRNDABS "INKEY$ GOSUB #AT Z/[?]7LN [H]RND NEWZ GOSUB #AT Z[T]#K GOTO Y▒█#/ NEW6-RNDLN #? FAST CLEARACS ▘#CODE STR$ .LN SAVE < LPRINT FAST#[L]C£,VAL STR$ LN K#SGN AT <"/ LIST LPRINT /CODE RETURN""4▖Y"/U PRINT NEW# RETURNRNDK▛ LET CLEARACS ▘LEN /G CLEARACS ▘#C~~[J] CLEARACS ▘▚LN ##/▖ CLEARACS ▘LEN LET LN #,,~~ PRINT VAL NEW#LN ##AT ▀ LET RETURN█S LET CLEARACS ▘▚[J] GOSUB #AT Z PRINT YZ[)]>=[J]#LN RUN # LET VAL M<=Z[B]*[B]**- ACS >#5 2; FASTACS TLN STR$ RNDSGN U""Z RETURN▖ASN [=]# RETURN▝C# RETURN▘CFY▒ PRINT STR$ , PRINT U""Z[B]4"U<=ZACS #C▖ LET J/▘ LET #)4 ;SGN LET =AT ▌# RETURN COPYC▒USQR Z##[U]KATN USGN Z#UPEEK Z#USTR$ Z# FASTVAL Y[Z][(]2 LN SGN INKEY$ AT ▌ LPRINT H4 LIST 5INT ZP4[6]TAN 7# RETURN0K▌LN [*]RNDINT 1 RETURNGK RUN CHR$ 0TAN LN ▝##ACS 4ACS 4ACS 4ACS 4LN ▝#█#7# RETURN"#TAN 7# RETURN"TAB SQR #7#ACS #C▝CHR$ RND) 77 FAST▞▒A # FOR ;( CLEAR FOR 5 S; FOR LPRINT 7LN =#>4▌76-RNDTAN =Z#J NEW▛WM#RND) STOPZ GOSUB #**ZY▒ PRINT #>~~VAL #U#RND RETURN▌S)JLEN ,,[B]##: C:3ACS ;( CLS/▛#[J]ACS )*( CLS[Q]#7<#>#[Q]#FLN ##=Z) STOPZ▞▒VAL ,#7<,#LN ##F#<( POKE TAN ▞4[J]##ACS [W]>#<( RUN TAN E-RND# RETURN;C# RETURN#C▌LN [*]RNDINT + LPRINT 6-RND▘ TAN E-RND# RETURN THENC▌LN [*]RNDINT ) FAST7#)""#STR$ RETURN LLIST ASN ## RETURN SCROLLASN [:]RND RETURN LOAD ASN B# RETURN LIST ASN 3# RETURN PAUSE ASN ## RETURN PRINT ASN ## RETURN PLOT ASN [Y]INKEY$ RETURN RUN ASN ▟INKEY$ RETURN SAVE ASN [~~]# RETURN RAND ASN ## RETURN CLSASN ;INKEY$ RETURN UNPLOT ASN TAB INKEY$ RETURN CLEARASN ▗INKEY$ RETURN RETURNASN [*]RND RETURN COPYASN /# RETURN LPRINT 4[9]SGN )[J]#STR$ 7# RETURNXC##7# RETURN#C[<] RETURN;4 PLOT # RETURNAASN [▒]# RETURNBASN [B]INKEY$ RETURNCASN [B]PI RETURNDASN SCROLLINKEY$ RETURNIASN ## RETURNLASN [5]# RETURNPASN ## RETURNRASN [T]# RETURNS42F#7 RETURNDASN ## RETURNEASN ▞# RETURNMASN 8# RETURNPASN [1]# RETURNSASN ##/# RETURNTASN SQR # RETURNUASN F# RETURNW4UF#7 RETURNDASN ## RETURNLASN "# RETURNRASN ▟# RETURNUASN LEN #/57#7# RETURN#C; RETURN;4 PLOT # RETURNCASN [F]PI RETURNDASN FOR INKEY$ RETURNRASN [X]# RETURNTASN ###SQR # 1 REM FAST##▞▛ACS 5>=?#USR RETURN#Y▀X4 CLEAR GOSUB #▌TAB LLIST #ACS 5>=?#USR RETURN#TAN <= RETURNY,X4 CLEARPEEK COPYY>X4 CLEAR#7##>#<= RETURNYDX4 CLEARPEEK COPYY4X4 CLEARF7RTAN ▘ █VAL LN STEP #AT ▌TAB B#▀ GOSUB #LN STEP #LN ##$LN STEP # CLEAR FAST LET #:[E]LN STEP #LN ###LN STEP #LN ###LN STEP # CLEAR FAST LET ##LN STEP #7.#[N]4 PLOT TAN LN SCROLL▝76-RNDLN #? FASTLN SAVE < LPRINT 7#[K]C: RETURN5K~~# RETURNSCOS RETURNVCOS RETURNPCOS INT 0LN ## PRINT ##VAL ) ▝LN ##SGN LN 8# LET E=RND RETURNS4▛5 4##/( RETURNP4▌),,RND/▖ GOSUB #(RND GOSUB # FOR LN 8##▛▝<= RETURN*S CLS: £<= RETURN*K IF #LEN SCROLLACS #AT [J] GOSUB PIAT GOSUB PISGN C,,-▝LN ## LET LPRINT / TO 5WRND,[Y]4 LIST 7<"#[L]4 PRINT LET LPRINT RETURNS4,,5 4LN <>##▛▝ RETURNV4>E(RNDLN <>#FLN [1]=SGN LPRINT LN ▛▝##▞5,,RND/ GOTO 2 REM [6][4][-][C][O][L]█[P][R][I][N][T]## #[9]PI[9]▟#8PI COPY8PI[9]▟#PI88PI8WPI[9]▟#▟PI8WPI[9][;]#PI#[X] SCROLL COPY[X]8#▟#[X] SCROLL#[X]PI#WPI[9]▟#8PI8WPI[9][;]PIWPI▟W#[9]<=<=[9]#W COPY#[E]# COPY //W## COPY SCROLL#//W8#PI COPY▟▘▀▞?;Z# COPY[;] COPY# COPY[;] COPY# COPY█""# LIST [/] UNPLOT # COPY33XY## COPY SAVE SAVE #[W]#2 COPY (SSCSC##CSSSSS( ▀3#<= POKE COPY▟ "" SAVE I<=J COPY▟ # (#SS#( ▖▒(4RND█ ( ((4 ((4 KK S####S K#(((# S#▖SRND# #▖/▖#S ▒/C##▒ #RND#▖#S SRND###S #▖▒(44 S#S##S S##W▖S S##### ###### S#RNDRND#S ###### #RND#RNDRND# #RND#RNDRNDRND S#RND##S ###### S((((S /▒▒##K ###### RNDRNDRNDRNDRND# ###### ###### S####S ####RNDRND S####O ###### SRNDS▖#S #((((( #####S ####C( [4][E][E][E] INPUT [E] [4][E]##[E][E] [4][E]##PIPI▖ STEP IPI#[▒] INPUT FAST5[=]K; FOR LPRINT U<=Z NEW█UAT Z?▞▒VAL PRINT ,#CGS0 NEW LIST PRINT # NEW?# LET [K]#=S~~ACS BACS BACS BACS B/ATN NEW?/ REM 3 REM ▝▖▞ ▝▖▞ ▖▝▞ ▖▝▞ ▝ ▖▝▞▖▞ ▞▝▖▞ ▖▝ ▞,,▘ PRINT VAL STR$ #: ##ACS SACS ;ACS SACS ;ACS SACS ;▟#E£RND7,,;SGN AT LET TAN FASTLN 4## LPRINT TAN FASTSTR$ VAL PRINT Y▝K▞ULEN Z?Y▖ACS )M""ZACS 4ACS 4ACS 4 GOSUB #AT Z LET PRINT LN ## LET AT SGN LPRINT TAN LN RND#/USR 5 S FAST)[=]#▘ STEP ▘ GOSUB [K] LPRINT ) Y▘# GOSUB [K]TAN ACS COPYRLN ##ACS [Z] FASTSTR$ VAL PRINT /INT U NEXT ZW NEW▀M NEXT Z▛▛▛- #5 INPUT #;6 POKE ZTAN [B] PRINT LN "#[J]LN ###ACS ▌ACS ▌ACS ▌Y/[(]▛▛▛X#6#ZUSIN Z[B]UCOS Z?4▛£GGGG/▌$HHHHK▌▖9999 LET VAL S"ACS #C▀W/▘XLN RND#LN £PILN £# GOSUB ##ZLN [4]#AT TAN E#ZR PRINT /[Y]***- #5 Y;6**Z5 6>=ZTAN CLEARACS #EXP LN ##[J]MCOS ZMSIN Z-2▘▘ WLN ##Y▘MSIN Z#▘2 LN ##/ LLIST VAL STR$ LN [I]#VAL LN ▖#LN [V]▝GAT SGN 4=AT AT TAN LN ###I RETURN RUN 4▘H RETURN LOAD 4▘GU UNPLOT Z▐[B]C▛ RETURN3K▀M UNPLOT Z#MTAN Z[J]ACS £Z*MASN ZTAN ▞*2 :3LN ##K▝0#$ IF [E]#/ NEXT ▌ PAUSE [.]## GOSUB # PLOT ZY(M UNPLOT ZTAN U UNPLOT ZX#▞+[J]LN ##£Y"LN ##£[J]LN ##/[+]UTAN Z[B]COS GOSUB ##X PRINT Y▘MLEN ZU UNPLOT Z▙#▞+[J]LN ## LET U UNPLOT Z#C▘$Y"#[,,]#U CLEARZ#$▞ RETURN24<[J]LN ##£LN ##[J]£LN ## GOSUB #M CLEARZTAN S▌WM CLEARZTAN [B]C▖[J]LN ##£Y=LN ##£Y+###U CLEARZ#▞ RETURN2SQR WM CLEARZ[J]LN ##WMLEN ZY=LN [,,]#£W#[,,]##▖5 4### GOSUB [K]/[P]USIN Z[B]UCOS Z? GOSUB #)#K▌TAB 9#/#4#/~~ LN 4##[B]COS RETURN,,TAN ££# RETURN4K~~LN ##K PRINT GOSUB #)#TAN U(#W RETURN▒C=M(##- E POKE Z;#U RUN Z█#: COPY/USR Y▘MCOS ZU RUN ZWM RUN ZLEN ▌#Y▖: COPYM<#£# RETURN4K▛LN ##K PRINT /[W]U<#XC▖▌▌/ SLOW[J]MCOS ZWMSIN ZY▛/<$$ IF POKE #LN ##K RUN /[,]U(#X IF ?#M(##- E POKE Z;#U RUN Z█#:4/ AND Y▘MCOS ZU RUN ZWM RUN ZLEN ▌#Y▖:4M<#$ IF L#LN ##K RUN #[:]#U<#XC▖▌▌/ FAST[J]MCOS ZMSIN Z#[.]#U IF Z[B]""UASN Z[B]COS U UNPLOT Z#▞= GOSUB # IF ZY>### PRINT VAL STR$ FASTUORNDX CLEAR[Y]O4 IF LPRINT SGN AT LET TAN GOSUB # IF Z£$COS ▌ PAUSE [,,]#[J]#LN ### GOSUB # IF ZTAN GOSUB # IF Z▖LN 4## RETURN>C> RETURN"C:VAL [J]5 STOPZ▞(#7( UNPLOT AT /▖[J]LN ##▌LN 4##[B]4▌Y>### RETURNCOS GOSUB # SAVE ZTAN GOSUB # SAVE Z£$COS [J]MACS ZLN ##K▞MACS Z▖/ PRINT RETURN>ASN /# RETURN"4>Y,,LN ##YRNDLN ##X4 IF AT ▘ ▘TAN # RETURN+CHUACS Z[B]4▌[J]LN ##▖LN ##S IF RETURN>ASN /# RETURN"CSQR ## RETURN+ASN 4#Y<[B] GOSUB # SAVE ZLN ###[B]COS [J]LN ###4# Y COPYM NEXT ZLN [*]#[J]M(#LN [*]#5 COPY▝ CLEAR##6)#5 6SIN Z6 SAVE Z6 IF Z LN ##LN [I]#LN [Z]#LN ##LN ▚#LN RETURN#LN ##LN ▖#LN NOT #LN ##LN ▚#LN Q#LN ##U># RETURN=K~~U PLOT Z[B]4ATN ▘ ▝TAN U UNPLOT Z#▞+VAL #[9]# U5RND[B]4▖E9RNDTAN A RETURN<=1ACS #4▖I RUN /▞ACS #4▝I LOAD ACS #COS 9TAN 5 FAST 7 REM ▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜ ▌[S][P][A][C][E]█[I][N][V][A][D][E][R][S]█[-]█[S][R][A][M]▐ ▌BY FRED NACHBAUR 1987▐ ▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟ 8 REM [*][M][E][R][R][Y]█[C][H][R][I][S][T][M][A][S][*] FROM SILICON MOUNTAIN COMPUTERS 10 SLOW 11 PRINT "USE [K]EYBOARD OR [Z]EBRA JOYSTICK?" 12 LET S$=INKEY$ 13 IF S$<>"K" AND S$<>"Z" THEN GOTO 12 14 POKE 16417,S$="Z" 15 CLS 16 PRINT "BE SURE SRAM IS ENABLED BEFORE PROCEEDING....." 17 IF INKEY$ ="" THEN GOTO 17 20 LET S$="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 25 LET HR=19400 29 REM [I][N][V][A][D][E][R]█[U][D][G][S] 30 IF USR HR THEN LPRINT U;" ";"00,00,00,00,00,00,00,00,7E,A5,42,A5,81,7E,24,42,FF,24,42,A5,81,7E,42,24,24,42,24,3C,42,A5,81,7E,81,42,24,3C,42,A5,99,7E,42,C3,BD,E7,FF,BD,24,66,81,C3,BD,E7,C3,BD,42,66,3C,42,A5,81,5A,24,42,24,3C,42,A5,99,42,3C,42,81" 39 REM [O][T][H][E][R]█[U][D][G][S] 40 IF USR HR THEN LPRINT U;",,";"3C,5A,A5,DB,DB,A5,5A,3C,00,FF,55,AA,55,00,FF,00,18,18,3C,66,5A,FF,E7,C3,18,18,3C,24,7E,42,FF,81,01,03,06,0F,19,3F,66,FF,99,FF,66,FF,99,FF,66,FF,80,C0,60,F0,98,FC,66,FF,1F,1F,3D,3E,7D,78,FF,00,F8,F8,7C,BC,5E,1E,FF,00" 49 REM [R][O][C][K][E][T][/][B][U][L][L][E][T] 50 IF USR HR THEN LPRINT U;">";"10,38,38,28,38,28,7C,44,28,38,38,38,38,38,10,00" 59 REM [M][O][T][H][E][R][S][H][I][P]█[-][*][/] 60 IF USR HR THEN LPRINT U;"=";"00,03,1F,74,DB,F4,FF,81,00,C0,F8,2E,DB,2F,FF,81,00,00,00,7C,00,00,00,00,00,10,54,38,38,54,10,00,00,04,08,10,20,40,80,00" 69 REM [N][U][M][B][E][R][S] 70 IF USR HR THEN LPRINT U;"0";"00,38,4C,54,54,64,38,00,00,30,50,10,10,10,7C,00,00,38,44,04,38,40,7C,00,00,7C,04,18,04,44,38,00,00,08,18,28,48,7C,08,00,00,7C,40,78,04,44,38,00,00,38,40,78,44,44,38,00,00,7C,04,08,10,20,20,00,00,38,44,38,44,44,38,00,00,38,44,44,3C,04,38,00,00" 79 REM [A][L][P][H][A]█[A][-][M] 80 IF USR HR THEN LPRINT U;"A";"00,38,44,44,7C,44,44,00,00,78,44,78,44,44,78,00,00,38,44,40,40,44,38,00,00,70,48,44,44,48,70,00,00,7C,40,78,40,40,7C,00,00,7C,40,78,40,40,40,00,00,38,44,40,4C,44,38,00,00,44,44,7C,44,44,44,00,00,38,10,10,10,10,38,00,00,18,08,08,48,48,30,00,00,44,48,70,50,48,44,00,00,40,40,40,40,40,7C,00,00,44,6C,54,54,44,44,00,00" 89 REM [A][L][P][H][A]█[N][-][Z] 90 IF USR HR THEN LPRINT U;"N";"00,44,64,54,4C,44,44,00,00,38,44,44,44,44,38,00,00,78,44,44,78,40,40,00,00,38,44,44,54,48,34,00,00,78,44,44,78,48,44,00,00,38,40,38,04,44,38,00,00,7C,10,10,10,10,10,00,00,44,44,44,44,44,38,00,00,44,44,44,44,28,10,00,00,44,44,54,54,6C,44,00,00,44,28,10,28,44,44,00,00,44,44,28,10,10,10,00,00,7C,08,10,20,40,7C,00,00" 100 IF USR HR THEN CLS 102 IF USR HR THEN RUN 105 IF USR HR THEN RAND 107 POKE 16320,2 109 REM [C][O][V][E][R][-][S][C][R][E][E][N] 110 CLS 112 POKE 16418,0 115 PRINT AT 1,0;;;;S$,,"** S P A C E I N V A D E R S **",,S$ 120 PRINT ,,TAB 13;"POINTS",,,TAB 5;"< 3";TAB 22;"▒ 10";TAB 15;"£";TAB 5;"▞ 20";TAB 14;"$:?";TAB 22;"▖ 30";TAB 13;"(~~~~~~)";TAB 5;"▘ 40";TAB 22;"=+ 200" 125 PRINT ,,"1-5 MOVE LEFT --- MOVE RIGHT 6-0",,TAB 8;"SHIFT --- FIRE",,,,,"PRESS ANY KEY TO START INVASION<",,S$ 126 PRINT "1/2-SPEED TRAINER MODE - PRESS T" 128 IF USR HR THEN RAND 31 130 IF USR HR THEN LIST 136 POKE 16382,0 138 POKE 16383,0 139 REM ["][P][A][T][R][O][L]["]█[D][E][M][O] 140 IF USR HR THEN LPRINT SS;1 150 RAND USR 21024 160 LET S=(INKEY$ ="T") 170 IF USR HR THEN LPRINT SS;S 180 IF NOT USR HR THEN CLS 200 FOR L=3 TO 0 STEP -1 230 GOSUB 2000 239 REM [M][A][G][I][C]█[M][A][C][H][I][N][E][-][C][O][D][E] 240 GOTO USR 22016 256 CLS 258 FOR N=1 TO 3 260 IF USR HR THEN RAND 265 IF USR HR THEN RAND 31 267 NEXT N 270 NEXT L 279 REM [E][N][D]█[O][F]█[G][A][M][E] 280 IF USR HR THEN PRINT AT 80,0;;;;S$;"><><>< G A M E -- O V E R <><><>";S$;"-P- ---- PLAY AGAIN -Q- ---- END OFF ",,S$ 282 IF USR HR THEN PAUSE 4E4 285 IF INKEY$ ="Q" THEN GOTO 300 290 IF INKEY$ ="P" THEN RUN 295 GOTO 282 300 CLS 310 IF USR HR THEN RETURN 320 IF USR HR THEN CLS 330 STOP 512 IF USR HR THEN PRINT AT 0,0;;;; 520 FOR N=1 TO 43 530 IF USR HR THEN PRINT "-- SUPER -- BONUS "; 535 IF USR HR THEN RAND 31 540 NEXT N 545 CLS 550 RAND 1000+PEEK 16382+256*PEEK 16383 560 POKE 16382,PEEK 16434 565 POKE 16383,PEEK 16435 570 GOSUB 2000 580 GOTO USR 22021 2000 REM [S][E][T]█[U][P]█[S][C][R][E][E][N] 2005 IF USR HR THEN CLS 2010 POKE 16418,0 2030 PRINT AT 2,2;"▘ ▝ ▘ ▝ ▘ ▝ ▘ ▝ ▘";AT 4,2;"▀ ▖ ▀ ▖ ▀ ▖ ▀ ▖ ▀";AT 6,2;"▌ ▞ ▌ ▞ ▌ ▞ ▌ ▞ ▌";AT 8,2;"▛ ▒ ▛ ▒ ▛ ▒ ▛ ▒ ▛";AT 22,0;S$ 2040 LET F$="00000"+STR$ (PEEK 16382+256*PEEK 16383) 2050 PRINT F$(LEN F$-4 TO );TAB 26; 2060 FOR N=1 TO L 2065 PRINT (CHR$ 11+" "); 2070 NEXT N 2075 PRINT AT 18,5;"£";TAB 16;"£";TAB 26;"£";TAB 4;"$:?";TAB 15;"$,,?";TAB 25;"$~~?";TAB 3;"=~~~~~~+";TAB 14;"(~~~~~~)";TAB 24;"(:::)" 2080 POKE 16320,2 2085 IF USR HR THEN LLIST 2090 RETURN 9000 SAVE "INVADER[S]" 9010 RUN ```