Classic Computer Magazine Archive COMPUTE! ISSUE 88 / SEPTEMBER 1987 / PAGE 8

An Atari Adventure

I own an Atari 800XL, and I am trying to make an adventure game. What I want to do is use the ENTER command to load in different parts of the game from disk, depending on where the player goes. Every time I use ENTER, the program stops running. How can I make it continue?

Ken Wright

The solution to your problem is to use the forced-read mode. This mode lets your computer press its own RETURN key. To turn forced-read mode on, execute a POKE 842,13. To turn it off, use POKE 842,12. The idea is to print all the necessary commands to the screen, home the cursor, perform the POKE, and stop the program. The last command on the screen should be POKE 842,12 to stop forced-read mode. In your case, you would want to expand the line to read

POKE 842, 12 : CONT

This will cause your program to pick up where it left off.

When you're printing commands to the screen, remember to allow room for the READY that BASIC puts on the screen after it executes each command. Also, since the display can be confusing to people playing the game, you may want to include SETCOLOR statements that make the letters on the screen invisible while the computer is in forced-read mode.

Here's a program that demonstrates the use of forced-read mode.

5 REM DEMO OF FORCED READ MODE. NOTICE THAT THE VALUES OF ALL VARIABLES ARE PRESERVED.
10	A = 5 : B = 10
20	PRINT "{CLEAR} {3 DOWN}
	PRINT "; CHR $ (34) ; "TEST" ; CHR $ (34)
30	PRINT "{3 DOWN} POKE 842, 12 : CONT"
40	POKE 842, 13 : POSITION 0, 0 : STOP
50	PRINT "{CLEAR}" ; A, B