Atari personal computer (videos)

Questions?

Feel free to Ask a Question at the bottom of this page. I will respond as soon as I can. You are welcome to post anything related to programming, site improvement, or anything else.

Atari Basic Commercial

The Atari home computer was a legend for that time. These short commericals demonstrated the next step up from the Atari 2600. The Atari home computer crossed barriers on many levels and showed an amazing feat of engineering in one package. To truly understand this marvelous system you must have been there. The arcades were popular in those days and filled with all types of Atari hits like Donkey Kong, Asteroids, Missile Command, Frogger, Centipede, and so on. It will forever be remembered as one of the first pioneer gaming systems of it's time.

Atari Basic Maze Game

I came across this video recently on YouTube. This is a great example of a maze building algorithm for the Atari home computer. It was creating using Graphics Mode 5, which has 3 colors; well technically it has 4 if you count the black background.

Upon closer examination of the code, I can see that the author utilized arrays to track where the cursor is moving and can determine when it hits a wall. It is actually only 19 lines long (10-150). Not bad at all.

Atari Basic Player Missile Graphics

Be sure to check out this new video to learn how Player Missile Graphics are created on the Atari home computer. A Player Missile Graphic is a character that moves independent over background objects without erasing anything. I attempted to break it down by showing how to draw your own PMG, how to calculate the rows, what they look like in a game (such as the Donkey Kong example), how they are defined in memory addresses, and finally the code is revealed.

Atari Basic Advanced Game Design

This section explains how to create an advanced game using Atari Basic 800/XL/XE that takes advantage of a redefined character set. For easier reference I have created a listing of the code first Then the program is explained after that.

10 REM GAME STARTER 20 REM GM3.BAS, GAME1.LST, GAME1.BAS 30 REM 7/15/07 40 DIM M$(100),CH$(100),R$(13),G$(100) 65 GOSUB 2902:GRAPHICS 1:POKE 756,BEGIN/256 70 POKE 708,152:POKE 709,250:POKE 710,52:POKE 711,36 76 COLOR 8+160:PLOT 13,15 80 REM 100 POSITION 1,1:? #6;"SCORE:";SC 102 DL=PEEK(560)+PEEK(561)*256:REM POKE DL+6,2:POKE DL+7,7:POKE DL+28,6:POKEDL+29,6:POKEDL+30,6 103 TX=PEEK(660)+PEEK(661)*256+1 105 DIM P(10) 126 GOSUB 1900 127 X=6:Y=5:RM=1 130 ST=PEEK(632):TR=PEEK(644) 131 PX=X:PY=Y 132 COLOR 4+32:PLOT X,Y 133 IF ST<15 THEN COLOR 32:PLOT X,Y 134 IF TR>0 THEN 140 135 REM 136 IF ST=7 THEN GOSUB 1020 137 IF ST=11 THEN GOSUB 1100 140 IF ST=7 THEN X=X+1:SAFE=0 150 IF ST=11 THEN X=X-1:SAFE=0 160 IF ST=13 THEN Y=Y+1:SAFE=0 165 IF ST=14 AND TR<1 AND BYLAD THEN COLOR 32:PLOT X,Y:Y=Y-3:X=X+1:COLOR 32:PLOT X,Y:PX=X:PY=Y 170 IF ST=14 AND NOT (BYLAD) THEN Y=Y-1:SAFE=0 175 IF Y<3 THEN Y=3 180 LOCATE X,Y,CL:IF CL=170 AND NOT (BYLAD) THEN X=PX:Y=PY 185 LOCATE X,Y+1,C2 186 LOCATE X,Y-1,C3 187 LOCATE X,Y+1,C4 190 IF CL=168 THEN GOSUB 1000 195 IF C3<>1 THEN BYLAD=0 200 IF C3=1 THEN BYLAD=1 205 IF C4=1 AND ST=13 THEN COLOR 32:PLOT X,Y:Y=Y+2:COLOR 32:PLOT X,Y:PX=X:PY=Y 210 IF X=18 THEN RM=RM+1:GOSUB 2930 212 IF X<1 THEN RM=RM-1:GOSUB 2930:IF RM<1 THEN RM=1 215 IF C2=32 AND NOT (SAFE) THEN GOSUB 800 300 GOTO 130 800 PX=X:PY=Y:FOR A=0 TO 19 801 LOCATE X,Y+A+1,CC:IF CC=170 THEN SAFE=1:X=PX:Y=A+Y:RETURN 802 COLOR 36:PLOT X,Y+A 805 FOR S=1 TO 10:NEXT S 810 COLOR 32:PLOT X,Y+A 820 NEXT A 900 RETURN 910 A=0:PX=X:PY=Y:FOR A=Y TO Y-1 STEP -1 920 LOCATE X,A-1,CC 925 COLOR 36:PLOT X,A 930 FOR S=1 TO 10:NEXT S 940 COLOR 32:PLOT X,A 950 IF CC=138 THEN X=PX:Y=PY:RETURN 960 NEXT A 990 RETURN 1000 M$="You take the object into possession" 1010 IF CL=168 THEN GOSUB 5000 1020 REM SHOOT RIGHT 1025 PX=X:PY=Y:COLOR 36:PLOT X,Y 1028 FOR A=X+1 TO X+20 1030 LOCATE A,Y,CC:IF CC=170 THEN X=PX-1:Y=PY:RETURN 1040 COLOR 13:PLOT A,Y 1050 FOR S=1 TO 10:NEXT S 1060 COLOR 32:PLOT A,Y 1080 NEXT A 1090 RETURN 1100 REM SHOOT LEFT 1110 PX=X:PY=Y:COLOR 36:PLOT X,Y 1120 FOR A=X-1 TO X-20 STEP -1 1130 LOCATE A,Y,CC:IF CC=170 THEN X=PX+1:Y=PY:RETURN 1140 COLOR 13:PLOT A,Y 1150 FOR S=1 TO 10:NEXT S 1160 COLOR 32:PLOT A,Y 1170 NEXT A 1890 RETURN 1900 RESTORE 2000 1905 POSITION 0,0:GOTO 2000 1910 READ M$:IF M$="{control-P}" THEN RETURN 1920 FOR X=1 TO 20 1930 REM 1940 G$=M$(X,X) 1948 IF G$="{escape escape}" THEN Y=Y+1 1950 IF G$="*" THEN COLOR 138:PLOT X-1,Y 1955 IF G$="+" THEN COLOR 2:PLOT X-1,Y 1956 IF G$="-" THEN COLOR 1:PLOT X-1,Y 1960 NEXT X 1970 NEXT A 1975 ? #6;"{clear}" 2000 ? #6;"{inverse}**** ***********" 2010 ? #6;"{inverse}* *" 2020 ? #6;"{inverse}* *" 2030 ? #6;"{inverse}**************** *" 2040 ? #6;"{inverse}* *" 2050 ? #6;"{inverse}* *" 2060 ? #6;"{inverse}* **************" 2070 ? #6;"{inverse}* *" 2080 ? #6;"{inverse}* *" 2090 ? #6;"{inverse}**************** *" 2100 ? #6;"{inverse}* * *" 2110 ? #6;"{inverse}* * *" 2120 ? #6;"{inverse}**************** *" 2130 ? #6;"{inverse}* * *" 2140 ? #6;"{inverse}* + * *" 2150 ? #6;"{inverse}* * *" 2160 ? #6;"{inverse}*** {ctrl-A}*********** *" 2170 ? #6;"{inverse}* {ctrl-A} " 2180 ? #6;"{inverse}* " 2190 ? #6;"{inverse}*******************" 2200 DATA **************** *{escape escape} 2210 DATA {ctrl-P} 2900 RETURN 2901 REM REDEFINE CHARS 2902 RESTORE 2904 2903 FOR I=1 TO 32:READ A:CH$(I)=CHR$(A):NEXT I 2904 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,162,4,160,0 2905 DATA 177,203,145,205,136,208,249,230,204,230,206,202,208,240,96 2906 POKE 106,PEEK(106)-5:GRAPHICS 0:BEGIN=(PEEK(106)+1)*256:POKE 756,BEGIN/256 2907 A=USR(ADR(CH$),57344,BEGIN) 2908 RESTORE 2915 2909 REM 2910 READ A:IF A=-1 THEN RETURN 2911 FOR I=0 TO 7 2912 READ B:POKE BEGIN+A*8+I,B 2913 NEXT I 2914 GOTO 2910 2915 DATA 1,129,129,255,129,129,255,129,129 2916 DATA 2,3,5,9,16,16,16,16,0 2917 DATA 3,3,6,6,7,6,14,17,0 2918 DATA 4,136,126,29,28,20,35,64,0 2919 DATA 5,24,56,120,8,8,8,0,0 2920 DATA 6,56,56,124,124,254,16,16,0 2921 DATA 7,36,36,24,24,36,36,4,0 2922 DATA 8,120,254,248,254,62,31,255,0 2923 DATA 9,63,255,248,126,154,240,63,0 2924 DATA 10,255,66,255,66,255,66,255,0 2925 DATA 11,192,96,96,224,96,112,136,0 2926 DATA -1 2930 IF RM=1 THEN M=17:GOSUB 1975 2940 IF RM=2 THEN X=1:GOSUB 2995 2990 RETURN 2995 ? #6;"{clear}" 3000 ? #6;"{inverse}**** ***********" 3010 ? #6;"{inverse}* *" 3020 ? #6;"{inverse}* *" 3030 ? #6;"{inverse}**************** *" 3040 ? #6;"{inverse}* *" 3050 ? #6;"{inverse}* *" 3060 ? #6;"{inverse}*******************" 3070 ? #6;"{inverse}* *" 3080 ? #6;"{inverse}* *" 3090 ? #6;"{inverse}**************** *" 3100 ? #6;"{inverse}* * *" 3110 ? #6;"{inverse}* * *" 3120 ? #6;"{inverse}********{ctrl-A}**********" 3130 ? #6;"{inverse}* *{ctrl-A)* * *" 3140 ? #6;"{inverse}* *{ctrl-A}* * *" 3150 ? #6;"{inverse}* *{ctrl-A}* * *" 3160 ? #6;"{inverse}********{ctrl-A}******* *" 3170 ? #6;"{inverse} {ctrl-A} *" 3180 ? #6;"{inverse} *" 3190 ? #6;"{inverse}*******************" 4010 RETURN 5000 FOR I=1 TO LEN(M$) 5010 G=ASC(M$(I,I)) 5020 IF G=32 THEN I=I+1 5030 POKE TX+I,ASC(M$(IK,I)) 5040 NEXT I 9000 RETURN

Game Screenshots

Here is an image taken from my YouTube channel of what the game screens look like.

Atari Basic Game

Atari Basic Game

How the Atari Basic 800 game works

The game is unfinished, but shows how to easily create your own redefined characters and get a player moving in a standard maze setting. This was common back in the days, which I got the idea from ANTIC magazine.

ANTIC began their publishing service somewhere around 1982. They published many articles on people's game submissions which often used redefined character sets.

Atari Basic Game

ANTIC game: Air Raid 2000

Here is a screenshot of a popular Basic game created for the November 1983 issue of ANTIC that used a redefined character set to create the graphics seen here.

Atari Basic Game

Playing the game

You move around using a joystick in port 1 and control a stationary character. When you hold the joystick to the left or right and press the fire button, a bullet shoots in that direction. The game also has built in gravity that occurs when you walk off a ledge. You can also move up the ladders. Finally there are 2 games screens. To see the other maze just get to the bottom of the screen and exit out the hole in the right hand corner. You will then see the second screen of the maze. Have fun!

The Atari Basic code

10 REM GAME STARTER

20 REM GM3.BAS, GAME1.LST, GAME1.BAS

30 REM 7/15/07

40 DIM M$(100),CH$(100),R$(13),G$(10)

The first few lines are just used as comments (REM). On line 40 the program initialization begins. The DIM stands for "dimension". They are used here to declare several "strings" that will be filled with character data later in the program.

The M$ is used for the "maze" data. This is later used to draw the maze on the Graphics screen.

The CH$ is used to hold a small machine language program that speeds up the program with a fast execution of redefined characters. Normally just using Basic when redefining a character set will slow down the loading of the program.

The RH$ is currently unused in this example.

The G$ creates a copy of the M$ later in the program to redraw character data.

65 GOSUB 2902:GRAPHICS 1:POKE 756,BEGIN/256

This part will jump to line 2902, which we'll go over later. Then it sets Atari Basic in Graphics mode 1. Finally it POKEs the "high-byte address" into memory location 756. Memory location 756 (CHBAS) is known as the Character Base Register. It is uses to point to a altered character set in memory.

Determine the game colors

70 POKE 708,152:POKE 709,250:POKE 710,52:POKE 711,36

The first location 708 is known as Color register zero. Here we are changing the color of our character to a light blue. The second location 709 changes the ladder to white. Location 710 is used to change the color of the text window to yellow. The last location 711 is used to change the color of an object.

76 COLOR 8+160:PLOT 13,15

Here we position the game object on the screen.

Print the game score and initialize variables

80 REM

100 POSITION 1,1:? #6;"SCORE:";SC

Print the word "SCORE" and the total score to the Graphics mode 1 screen. The #6 is used to print to the screen. Otherwise it will only print in the text window.

102 DL=PEEK(560)+PEEK(561)*256

Set the starting address of the display list. It is also known as a "pointer" or "reference" to a memory area.

103 TX=PEEK(660)+PEEK(611)*256

Get the address of the upper left corner of the text window in Graphics 1.

105 DIM P(10)

Define an array of 10 elements. Currently this is unused in this game.

126 GOSUB 1900

Go the subroutine at line 1900. This will be explained later.

127 X=6:Y=5:RM=1

Here we define the starting position of our player's horizontal (X) and vertical (Y) positions. So the player starts at 6 rows from the left and 5 rows down from the top.

The main game loop

130 ST=PEEK(632):TR=PEEK(644)

Create a variable to keep track of which position the joystick was moved into (location 632). The second variable TR is used to keep track of when the fire button has been pressed.

131 PX=X:PY=Y

The PX=X will save the player's X positon. The PY=Y will save the player's Y position.

132 COLOR 4+32:PLOT X,Y

Position our player on the screen at PLOT 6,5.

133 IF ST<15 THEN COLOR 32:PLOT X,Y

If the player has moved the joystick then erase the previous character data to create animation.

The fire button was pressed

134 IF TR>0 THEN 140

If the fire button was pressed (location PEEK<>0 - not equal or greater than zero) then the program jumps to line 140.

135 REM

The joystick routine

136 IF ST=7 THEN GOSUB 1020

If the player has moved the joystick to the right then jump to the subroutine at line 1020.

137 IF ST=11 THEN GOSUB 1100

If the player has moved the joystick to the left then jump to the subroutine at line 1100.

140 IF ST=7 THEN X=X+1:SAFE=0

If the player has moved the joystick to the right then increase the horizontal position by one and set the variable SAFE equal to zero. The variable SAFE is used to be certain the player has not fallen off the ledge. If SAFE is set to any number greater than zero then the player will begin falling.

150 IF ST=11 THEN X=X-1:SAFE=0

If the player has moved the joystick to the left then decrease the horizontal position by one and set the variable SAFE equal to zero.

160 IF ST=13 THEN Y=Y+1:SAFE=0

If the player has moved the joystick down then increase the vertital position by one and set the variable SAFE equal to zero.

170 IF ST=14 AND TR<1 AND BYLAD THEN COLOR 32:PLOT X,Y: Y=Y-3:X=X+1:PX=X:PY=Y

If the player has moved the joystick up and the fire button was pressed and the player collided with the ladder then erase the player (COLOR 32:PLOT X,Y), decrease the player's vertical (Y) position by 1, increase the player's horizontal (X) position by 1, and save the player's X and Y position.

This means the player is going up a ladder and immediately moves to the right at the top.

175 IF Y<3 THEN Y=3

When moving up make sure the player does not walk off the top of the screen.

The collision routine

180 LOCATE X,Y,CL:IF CL=170 AND NOT (BYLAD) THEN X=PX:Y=PY

The player has collided with a wall. Do not allow the player to pass through the walls.

185 LOCATE X,Y+1,C2

Check if the player is going down a ladder.

186 LOCATE X,Y-1,C3

Check if the player is going up a ladder.

187 LOCATE X,Y+1,C4

Check if the player is descending a ladder.

190 IF CL=168 THEN GOSUB 1000

Check if the player touched the game object (CL=168) and then jump to the subroutine on line 1000.

195 IF C3<>1 THEN BYLAD=0

The player is not going up the ladder so keep the variable BYLAD "by the ladder" reset to zero.

200 IF C3=1 THEN BYLAD=1

The player has touched the ladder so set the variable BYLAD equal to one. This is known as a "flag" which means an action occured. If a flag is set to any value between 1-32767 then an action occured. If the flag is zero to set then that action has not yet happened.

205 IF C4=1 AND ST=13 THEN COLOR 32:PLOT X,Y:Y=Y+2:COLOR 32: PLOT X,Y:PX=X:PY=Y

If the player is going down the ladder and the joystick is moved down (ST=13) then erase the player's position (COLOR 32:PLOT X,Y), increase the player's vertical position by 1, erase the old position, and remember the new X and Y positions.

Player moves to a new room

210 IF X=18 THEN RM=RM+1:GOSUB 2930

If the player has moved all the way to the right at the bottom of the screen then increase the room variable RM by 1 and go to the subroutine at line 2930. This is used to keep track of which room the player is currently in.

212 IF X<1 THEN RM=RM-1:GOSUB 2930:IF RM<1 THEN RM=1

If the player has moved all the way to the left at the bottom of the screen then decrease the room variable RM by 1 and go to the subroutine at line 2930. Finally make sure that the variable RM does not fall below one. This is used in case the player tries to move to a room lower than 1.

Check for more collisions

215 IF C2=32 AND NOT (SAFE) THEN GOSUB 800

If the player is not going down a ladder and has fallen off the ledge then go to the subroutine at line 800 (which creates the falling animation).

300 GOTO 130

Go back to line 130 to keep the program in a loop, otherwise it will end.

Player has fallen off a ledge

800 PX=X:PY=Y:FOR A=0 TO 19

Save the player's X and Y position. Then begin the start of the falling loop.

801 LOCATE X,Y+A+1,CC:IF CC=170 THEN SAFE=1:X=PX:Y=A+Y: RETURN

Check if the player has reached a new level after falling. If the player has reached a lower level then set the variable SAFE=1. Then save the player's X position and new Y position.

802 COLOR 36:PLOT X,Y+A

Position the player as he falls.

805 FOR S=1 TO 10:NEXT S

Slow down the falling animation.

940 COLOR 32:PLOT X,A

Erase the player's position as he falls.

950 IF CC=138 THEN X=PX:Y=PY:RETURN

If the player has reached the bottom then save the new X and Y positions. Then RETURN back to the last GOSUB 800 routine.

960 NEXT A

Get the next FOR loop value found in variable A.

990 RETURN

Exit the subroutine.

Player has found the game object

1000 M$="You take the object into possession"

1010 IF CL=168 THEN GOSUB 5000

Player is shooting to the right

1020 REM SHOOT RIGHT

1025 PX=X:PY=Y:COLOR 36:PLOT X,Y

Save position X and Y. Then position the player again.

1028 FOR A=X+1 TO X+20

Increment through the FOR loop starting at the player's position plus one and move up to 20 positions. This allows the bullet to travel all the way across the screen.

1030 LOCATE A,Y,CC:IF CC=170 THEN X=PX+1:Y=PY:RETURN

Check if the player's bullet has hit a wall. If it has then save the player's bullet X and Y position (PX and PY).

1040 COLOR 13:PLOT A,Y

Position the bullet on the screen.

1050 FOR S=1 TO 10:NEXT S

Slow down the firing motion.

1060 COLOR 32:PLOT A,Y

Erase the bullet position.

1080 NEXT A

Complete the FOR loop.

1090 RETURN

Exit the subroutine.

Player is shooting to the left

1100 REM SHOOT LEFT

1110 PX=X:PY=Y:COLOR 36:PLOT X,Y

Save position X and Y. Then position the player again.

1120 FOR A=X+1 TO X+20

Increment through the FOR loop starting at the player's position plus one and move up to 20 positions. This allows the bullet to travel all the way across the screen.

1130 LOCATE A,Y,CC:IF CC=170 THEN X=PX+1:Y=PY:RETURN

Check if the player's bullet has hit a wall. If it has then save the player's bullet X and Y position (PX and PY).

1140 COLOR 13:PLOT A,Y

Position the bullet on the screen.

1150 FOR S=1 TO 10:NEXT S

Slow down the firing motion.

1160 COLOR 32:PLOT A,Y

Erase the bullet position.

1170 NEXT A

Complete the FOR loop.

1890 RETURN

Exit the subroutine.

1900 RESTORE 2000

This line will recall the DATA pointer to line 2000. This is used when you have multiple READS in code and want to fix the program at a certain DATA pointer location.

1905 POSITION 0,0:GOTO 2000

Position the cursor at location 0,0 and GOTO line 2000.

Draw the first screen

1910 READ M$:IF M$="{ctrl-P}" THEN RETURN

Read through the DATA statements. If the variable M$ has found a place that contains the data character {ctrl-P} then exit the subroutine.

1920 FOR X=1 TO 20

Loop through the second maze data (1 to 20).

1930 REM

1940 G$=M$(X,X)

Save the variable of M$ into G$

1948 IF G$="{escape escape}" THEN Y=Y+1

If the character in the maze finds an {escape} then Y will increase by 1 each time.

1950 IF G$="*" THEN COLOR 138:PLOT X-1,Y

If G$ finds an asterisk then draw a wall character on the Graphics 1 screen.

1955 IF G$="+" THEN COLOR 2:PLOT X-1,Y

If G$ finds a plus character then draw an object.

1956 IF G$="-" THEN COLOR 1:PLOT X-1,Y

If G$ finds a minus character then draw an object.

1960 NEXT X

1970 NEXT A

Finish the X and A loops.

1975 ? #6;"{clear}" 2000 ? #6;"{inverse}**** ***********" 2010 ? #6;"{inverse}* *" 2020 ? #6;"{inverse}* *" 2030 ? #6;"{inverse}**************** *" 2040 ? #6;"{inverse}* *" 2050 ? #6;"{inverse}* *" 2060 ? #6;"{inverse}* **************" 2070 ? #6;"{inverse}* *" 2080 ? #6;"{inverse}* *" 2090 ? #6;"{inverse}**************** *" 2100 ? #6;"{inverse}* * *" 2110 ? #6;"{inverse}* * *" 2120 ? #6;"{inverse}**************** *" 2130 ? #6;"{inverse}* * *" 2140 ? #6;"{inverse}* + * *" 2150 ? #6;"{inverse}* * *" 2160 ? #6;"{inverse}*** {ctrl-A}*********** *" 2170 ? #6;"{inverse}* {ctrl-A} " 2180 ? #6;"{inverse}* " 2190 ? #6;"{inverse}*******************" 2200 DATA **************** *{escape escape} 2210 DATA {ctrl-P} 2900 RETURN

Redefine the Atari Basic character set

2901 REM REDEFINE CHARS

2902 RESTORE 2904

Restore line 2904 to the DATA pointer.

2903 FOR I=1 TO 32:READ A:CH$(I)=CHR$(A):NEXT I

Begin a loop to hold the machine language data that does a fast move of the character set data.

2904 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205, 162,4,160

2905 DATA 177,203,145,205,136,208,249,230,204,230,206,202,208, 240,96

2906 POKE 106,PEEK(106)-5:GRAPHICS 0:BEGIN=(PEEK(106)+1)*256):POKE 756,BEGIN/256

Reserve 5 pages of memory for the character set. This moves memory to prevent overriding data for Player Missile Graphics. It is known as moving RAMTOP (location 106) and POKE this into Character Base Register (memory location 756).

2907 A=USR(ADR(CH$),57344,BEGIN)

Execute the machine language subroutine to move the character set.

Machine Language routine to move the character set

The following below are the DATA statements disassembled as Assembly Language. The line A=USR(ADR(CH$),57344,BEGIN) stores the hi/low bytes in memory locations 203 AND 205. The program will move 4 pages of memory with LDX #4. Each time 256 pages are completed, the new address pointer is reset with location 204 and 206. The BNE START will keep accessing a new page of memory beyond 256 bytes to ensure all of the character set data is moved from ROM to RAM. In Atari Basic this would like look FOR I=57344 TO 57344+768:POKE I,PEEK(BEGIN+I):NEXT I


PLA
PLA
STA 204
PLA
STA 203
PLA
STA 206
PLA
STA 205
LOOP LDX #4
START LDY #0
LP LDA (203),Y ;location 57344
STA (205),Y    ;BEGIN - new location of char set data
DEY
BNE LP         ;keep reading in all 256 bytes
INC 204        ;increment high byte
INC 206        ;increment high byte
DEX
BNE START      ;make sure all of ROM is moved to RAM
RTS

Change specific data in the character set

2908 RESTORE 2915

Restore line 2915 to the DATA pointer.

2909 REM

2910 READ A:IF A=-1 THEN RETURN

Read the specific ASCII characters that are going to be changed. (which represents the end of the data read).

2911 FOR I=0 TO 7

Read in 7 bytes for each character that is being redefined.

2912 READ B:POKE BEGIN+A*8+I,B

Read in all of the character data to redefine the letters.

2913 NEXT I

Get the next byte of each individual character set.

2914 GOTO 2910

Go to the subroutine at line 2910

2915 DATA 1,129,129,255,129,129,255,129,129
2916 DATA 2,3,5,9,16,16,16,16,0
2917 DATA 3,3,6,6,7,6,14,17,0
2918 DATA 4,136,126,29,28,20,35,64,0
2919 DATA 5,24,56,120,8,8,8,0,0
2920 DATA 6,56,56,124,124,254,16,16,0
2921 DATA 7,36,36,24,24,36,36,4,0
2922 DATA 8,120,254,248,254,62,31,255,0
2923 DATA 9,63,255,248,126,154,240,63,0
2924 DATA 10,255,66,255,66,255,66,255,0
2925 DATA 11,192,96,96,224,96,112,136,0
2926 DATA -1

2930 IF RM=1 THEN M=17:GOSUB 1975

If the player is in room 1 then set the variable M=17. Then go to subroutine 1975. This will redraw room 1 when RM=1.

2940 IF RM=2 THEN X=1:GOSUB 2995

If the player is in room 1 then set the variable M=17. Then go to subroutine 1975. This will redraw room 1 when RM=1.

2990 RETURN

Draw the second screen

2995 ? #6;"{clear}"
3000 ? #6;"{inverse}****    ***********"
3010 ? #6;"{inverse}*                 *"
3020 ? #6;"{inverse}*                 *"
3030 ? #6;"{inverse}****************  *"
3040 ? #6;"{inverse}*                 *"
3050 ? #6;"{inverse}*                 *"
3060 ? #6;"{inverse}*******************"
3070 ? #6;"{inverse}*                 *"
3080 ? #6;"{inverse}*                 *"
3090 ? #6;"{inverse}****************  *"
3100 ? #6;"{inverse}*    *            *"
3110 ? #6;"{inverse}*    *            *"
3120 ? #6;"{inverse}********{ctrl-A}**********"
3130 ? #6;"{inverse}*      *{ctrl-A)*     *  *"
3140 ? #6;"{inverse}*      *{ctrl-A}*     *  *"
3150 ? #6;"{inverse}*      *{ctrl-A}*     *  *"
3160 ? #6;"{inverse}********{ctrl-A}*******  *"
3170 ? #6;"{inverse}        {ctrl-A}         *"
3180 ? #6;"{inverse}                         *"
3190 ? #6;"{inverse}*******************"
4010 RETURN

Display the maze

5000 FOR I=1 TO LEN(M$)

Begin a loop to read in the maze data.

5010 G=ASC(M$(I,I))

Get the maze data in ASCII form.

5020 IF G=32 THEN I=I+1

If a space is found then increase the loop by 1.

POKE TX+I,ASC(M$(I,I))

Show the maze character data (found in M$) on the screen.

5040 NEXT I

Get the next byte.

RETURN

Finally return from the subroutine.

Watch the Game Tutorial here

YouTube

You can also leave feedback on my YouTube channel. Either click the YouTube button at the top of this page or you can visit that page here

Questions? Ask Here

I can imagine that people will have questions since programming and developing web sites is no small chore I can assure you. However I have programmed with computers since 1986 so I can usually get you some type of reasonable answer. Please be sure the question is regarding a language on this site such as C#, C++, Visual Basic.NET, ASP.NET, Java, etc. I will respond back as soon as I can. Also notice that a Comment can be left at the bottom of any page now. Just look for the section titled above that says Questions? Ask Here

Comment Box is loading comments...
Subscribe to the my newsletter
Privacy Notice: Programmer Mind will not compromise your privacy