Jump to content
IGNORED

BASIC Questions: How do I turn off the screen saver function in Atari BASIC? Also translation help


Recommended Posts

I've been taking an online class, and since everyone else has setup their little backgrounds, I decided to put some of my vintage computers in mine running some looping BASIC programs on a green phosphor CRT. Obviously, since the classes run for a few hours, I don't want anything too static (screen burn, also boring), so I've been "translating" some, shall we say screen savers" in BASIC for several of my computers.  I really want my Atari 800 in that mix!  It's just looks awesome, and has quickly become one of my favorite 8-bit computers.  

 

However, I've run into a little issue.  When left unattended for more than a few minutes, the computer goes into a screen saver mode of its own.  Ironically, this puts more strain on the CRT than the little monochrome dancing lines or looping sine wave programs that I've been using.  As such, I was wondering if there was a way to turn that off?

 

Second: Also I've been running into some issues translating this BASIC program into Atari BASIC.  What am I doing wrong?

 

20 DIM B1(50) : DIM B2(50)

30 DIM B3(50) : DIM B4(50)

50 ? “LINE SPACING”; : INPUT S

60 ? “TAIL LENGTH”; : INPUT L

80 D1=0 : D2=1 : D3=0 : D4=1

90 A1=0 : A2=0

100 A3=50 : A4=100

110 C=1

120 CC=0

130 P=0

140 E=1

150 GR. 24: SE. 2,0,1

151 COLOR 1

170 GOSUB 260

180 PLOT A1,A2 : DRAWTO A3,A4

185 COLOR 0

190 B1(P)=A1 : B2(P)=A2 : B3(P)=A3 : B4(P)=A4

200 P=P+1 : IF P=L THEN P=0

210 PLOT B1(E),B2(E): DRAWTO B3(E),B4(E)

220 E=E+1 : IF E=L THEN E=0

230 CC=CC+1 : IF CC<>5 THEN GOTO 170

240 CC=0 : C=C+1 : IF C=4 THEN C=1

250 GOTO 170

260 IF D1=0 THEN IF A1<=S THEN D1=1 : A1=1 : GOTO 300

270 IF D1=0 THEN A1=A1-S : GOTO 300

280 IF A1+S>=319 THEN D1=0 : A1=318 : GOTO 300

290 A1=A1+S

300 IF D2=0 THEN IF A2<=S THEN D2=1 : A2=1 : GOTO 340

310 IF D2=0 THEN A2=A2-S : GOTO 340

320 IF A2+S>=191 THEN D2=0 : A2=190 : GOTO 340

330 A2=A2+S

340 IF D3=0 THEN IF A3<=S THEN D3=1 : A3=1 : GOTO 380

350 IF D3=0 THEN A3=A3-S : GOTO 380

360 IF A3+S>=319 THEN D3=0 : A3=318 : GOTO 380

370 A3=A3+S

380 IF D4=0 THEN IF A4<=S THEN D4=1 : A4=1 : RETURN

390 IF D4=0 THEN A4=A4-S : RETURN

400 IF A4+S>=191 THEN D4=0 : A4=190 : RETURN

410 A4=A4+S

420 RETURN

Edited by DistantStar001
Link to comment
Share on other sites

1 hour ago, DistantStar001 said:

Second: Also I've been running into some issues translating this BASIC program into Atari BASIC.  What am I doing wrong?

You are trying to print to a channel, however you haven't open channel 1 yet, line 40 is trying to print

A$ although A$ is empty, just comment out line 40 and the program will run ..... until the next error :)

the PLOT/DRAW routine is failing due to some strange values in the arrays.

 

For example B3(1) has the value 4.70136312E+15 which is one of the DRAWTO values.

Both PLOT and DRAWTO cannot exceed the screen boundaries

 

You are using GRAPHICS 8+16 hi-res mode, so the limits are for X 320-1 (319) first point is zero, so 0 to 319

limit for Y is 192-1 (191) again first point 0 so 0 to 191

 

Not looked into the calculations, but you must cater for the screen limits

  • Like 1
Link to comment
Share on other sites

I also tried the program with not much success.  With Atari Basic arrays you need to initialize the values to 0 otherwise they can potentially have random values which can screw later calculations.

But I did that and it made no difference.

We'd probably need to see the original program to work out what's wrong.

  • Like 1
Link to comment
Share on other sites

There's certainly something wrong with the logic , this is a list of values that are trying to be PLOT'd/DRAW'n

effectively PLOT X,Y DRAWTO X,Y

The values seem ok to start with, but soon start increasing beyond the screen max

 

Also as @Rybags says, you're using uninitialized arrays

 

EDIT: Maybe not, beyond MAX, bit more investigation :) :) :)

 

 

45 176 94 71
38 169 87 64
31 162 80 57
24 155 73 50
1 4 46 104
5 8 42 108
9 12 38 112
13 16 34 116
17 20 30 120
21 24 26 124
25 28 22 128
29 32 18 132
33 36 14 136
37 40 10 140
41 44 6 144
45 48 2 148
49 52 1 152
53 56 5 156
57 60 9 160
61 64 13 164
65 68 17 168
69 72 21 172
73 76 25 176
77 80 29 180
81 84 33 184
85 88 37 188
89 92 41 190
93 96 45 186
97 100 49 182
101 104 53 178
105 108 57 174
109 112 61 170
113 116 65 166
117 120 69 162
121 124 73 158
125 128 77 154
129 132 81 150
133 136 85 146
137 140 89 142
141 144 93 138
145 148 97 134
149 152 101 130
153 156 105 126
157 160 109 122
161 164 113 118
165 168 117 114
169 172 121 110
173 176 125 106
177 180 129 102
181 184 133 98
185 188 137 94
189 190 141 90
193 186 145 86
197 182 149 82
201 178 153 78
205 174 157 74
209 170 161 70
213 166 165 66
217 162 169 62
221 158 173 58
225 154 177 54
229 150 181 50
233 146 185 46
237 142 189 42
241 138 193 38
245 134 197 34
249 130 201 30
253 126 205 26
257 122 209 22
261 118 213 18
265 114 217 14
269 110 221 10
273 106 225 6
277 102 229 2
281 98 233 1
285 94 237 5
289 90 241 9
293 86 245 13
297 82 249 17
301 78 253 21
 

Edited by TGB1718
Link to comment
Share on other sites

The problem is the COLOR statement, you turn it on before the loop (GOTO 170)

and inside the loop, you only ever set it to zero (off)

So it draws a line, then set COLOR to 0 this removes part of the line and that's it.

 

If you change line 185 to COLOR 1 and run the program you can see the PLOT/DRAW works

but it's not clearing the "tails" you'll have to figure out where to set COLOR 1 and COLOR 0

to make it look right.

 

Also you need to put this in otherwise it prints some random lines due to the uninitialized arrays as we said before.

 

31 FOR I=0 TO 49:B1(I)=0:B2(I)=0:B3(I)=0:B4(I)=0:NEXT I

Link to comment
Share on other sites

Alright, it works! but not quite as expected/desired.  

 

Lines 90 and 100 are supposed to determine the length of the lines on the screen, at least they do on the Apple II, VIC-20, and BBC Micro, but on the Atari, the lines don't stay the same length growing and shrinking as the program runs.  I've noticed the same issue on the C4 with Super Expander.  Simon's BASIC and Extended Color BASIC do something similar but have other issues as well. 

 

The issue for the Atari is that, unlike the C64, the lines are favoring the right side of the screen and rarely make it to the left unless the lines have grown to the point where they extend all the way across the screen. I believe the issue can be resolved if I can constrain the lines to the same length but I'm not sure how to do that.

 

Here's the revised code:

 

20 DIM B1(50) : DIM B2(50)

30 DIM B3(50) : DIM B4(50)

31 FOR I=0 TO 49:B1(I)=0:B2(I)=0:B3(I)=0:B4(I)=0:NEXT I

50 ? “LINE SPACING”; : INPUT S

60 ? “TAIL LENGTH”; : INPUT L

80 D1=0 : D2=1 : D3=0 : D4=1

90 A1=0 : A2=0

100 A3=50 : A4=100

110 C=1

120 CC=0

130 P=0

140 E=1

150 GR. 24: SE. 2,0,1

170 GOSUB 260

180 COLOR 1 : PLOT A1,A2 : DRAWTO A3,A4

190 B1(P)=A1 : B2(P)=A2 : B3(P)=A3 : B4(P)=A4

200 P=P+1 : IF P=L THEN P=0

210 COLOR 0 : PLOT B1(E),B2(E): DRAWTO B3(E),B4(E)

220 E=E+1 : IF E=L THEN E=0

230 CC=CC+1 : IF CC<>5 THEN GOTO 170

240 CC=0 : C=C+1 : IF C=4 THEN C=1

250 GOTO 170

260 IF D1=0 THEN IF A1<=S THEN D1=1 : A1=1 : GOTO 300

270 IF D1=0 THEN A1=A1-S : GOTO 300

280 IF A1+S>=319 THEN D1=0 : A1=318 : GOTO 300

290 A1=A1+S

300 IF D2=0 THEN IF A2<=S THEN D2=1 : A2=1 : GOTO 340

310 IF D2=0 THEN A2=A2-S : GOTO 340

320 IF A2+S>=191 THEN D2=0 : A2=190 : GOTO 340

330 A2=A2+S

340 IF D3=0 THEN IF A3<=S THEN D3=1 : A3=1 : GOTO 380

350 IF D3=0 THEN A3=A3-S : GOTO 380

360 IF A3+S>=319 THEN D3=0 : A3=318 : GOTO 380

370 A3=A3+S

380 IF D4=0 THEN IF A4<=S THEN D4=1 : A4=1 : RETURN

390 IF D4=0 THEN A4=A4-S : RETURN

400 IF A4+S>=191 THEN D4=0 : A4=190 : RETURN

410 A4=A4+S

411 POKE 77,0

420 RETURN

 

Notes: COLOR statements are integrated into the PLOT/DRAWTO lines 180 and 210.  Also, the POKE statement was added to the loop at line 411.  I tried line 151, but soon learned that it needed to be with in the loop to be executed as needed.  I'm guessing that it could have been added anywhere in the loop between lines 260 and 420, but after 410 just felt right.

 

My thanks for all the help so far.

  • Like 1
Link to comment
Share on other sites

Hi!

14 hours ago, DistantStar001 said:

Alright, it works! but not quite as expected/desired.  

 

Lines 90 and 100 are supposed to determine the length of the lines on the screen, at least they do on the Apple II, VIC-20, and BBC Micro, but on the Atari, the lines don't stay the same length growing and shrinking as the program runs.  I've noticed the same issue on the C4 with Super Expander.  Simon's BASIC and Extended Color BASIC do something similar but have other issues as well. 

 

The issue for the Atari is that, unlike the C64, the lines are favoring the right side of the screen and rarely make it to the left unless the lines have grown to the point where they extend all the way across the screen. I believe the issue can be resolved if I can constrain the lines to the same length but I'm not sure how to do that.

I don't see it in the program you posted, lines don't grow and go to both sides of the screen. Here is a BAS file you can try: lines.bas

 

I also converted your program to FastBasic for a faster experience, attached is the source and compiled binary.

 

Have Fun!

 

 

 

 

lines2.xex lines2.fb

Edited by dmsc
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...