--- title: "Diagonal Movement" type: "article" slug: "diagonal-movement" url: "http://localhost/article/diagonal-movement/" markdown_url: "http://localhost/article/diagonal-movement.md" published_at: "2026-10-22T13:43:43+00:00" modified_at: "2026-10-22T13:46:40+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "If you have always wanted a joystick for your Sinclair, but were a little intimidated about making hardware modifications, the article -\"Adding a Joystick to the Timex-Sinclair 1000\" by James Stephens, SYNC, Vol 3, No 4 Jul/Aug 1983, page 52 is for you. It shows a simple inexpensive way to add an atari type joystick.The…" post_tag: - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Gary Cole" slug: "gary-cole" taxonomy: "indiv" url: "http://localhost/indiv/gary-cole/" publication_r: id: 14989 title: "Sincus News" type: "periodical" url: "http://localhost/periodical/sincus-news/" authors: "Gary Cole" authors_r: - name: "Gary Cole" slug: "gary-cole" taxonomy: "indiv" url: "http://localhost/indiv/gary-cole/" volume: "1" issue: "9" issues_articles: - id: 72169 title: "SINCUS v1 n9" type: "issue" url: "http://localhost/issue/sincus-v1-n9/" pages: "2" pubdate: "October 1983" archive_link: false --- # Diagonal Movement If you have always wanted a joystick for your Sinclair, but were a little intimidated about making hardware modifications, the article -“[Adding a Joystick to the Timex-Sinclair 1000](http://localhost/article/adding-a-joystick-to-the-timex-sinclair-1000/)” by [James Stephens](http://localhost/indiv/jim-stephens/), SYNC, Vol 3, No 4 Jul/Aug 1983, page 52 is for you. It shows a simple inexpensive way to add an atari type joystick.The only catch is that the program listed in the article provides only for up-down and left – right movement – it will not do the diagonals. The following program uses the system variable LAST K instead of the function INKEY$. LAST-K (PEEK 16421 + 256 * PEEK 16422), provides a useful value even with two or more keys simultaneously depressed, exactly what we need for diagonals. The program is a little slow as it stands, but it maybe compiled (using Bob Beach’s compiler), without changes. The resulting machine code is surprisingly fast. ### The program listing: ``` 001 SLOW 005 LET X = 20 007 LET Y = 20 010 LET A = PEEK 16422 015 LET B = PEEK 16421 020 IF A = 255 THEN GOTO 10 040 IF A <> 223 THEN GOTO 80 050 IF B <> 239 THEN GOTO 60 052 LET Y = Y - 1 056 GOTO 500 060 IF B <> 247 THEN GOTO 70 062 LET X = X - 1 066 GOTO 500 070 LET X = X - 1 072 LET Y = Y - 1 076 GOTO 500 080 IF A <> 239 THEN GOTO 100 085 LET Y = Y + 1 090 GOTO 500 100 IF A <> 247 THEN GOTO 130 110 LET X = X + 1 120 GOTO 500 130 IF A <> 207 THEN GOTO 170 140 LET X = X - 1 150 LET Y = Y + 1 160 GOTO 500 170 IF A <> 215 THEN GOTO 210 180 LET X = X + 1 190 LET Y = Y - 1 200 GOTO 500 210 IF A <> 231 THEN GOTO 290 220 LET X = X - 1 230 LET Y = Y + 1 240 GOTO 500 290 IF A <> 253 THEN GOTO 10 300 RETURN 500 IF X > 63 THEN LET X = 63 510 IF X < 0 THEN LET X = 0 520 IF Y > 43 THEN LET Y = 43 530 IF Y < 0 THEN LET Y = 0 570 PLOT X,Y 600 GOTO 10 ``` enter the program and RUN – use the ” magic arrow ” keys, 5, 6, 7, 8 to move the dot around- try pressing two keys in combination.