Rebound from Your Computer magazine

Use this forum to submit new files for the download section of the archive. I will check each submission and upload it to the archive on a regular basis.
Post Reply
Alastair
Posts: 669
Joined: Fri Jul 18, 2008 11:33 pm

Rebound from Your Computer magazine

Post by Alastair »

Here is something a little different, a text file (.bas extension) that can be CLOADed into XRoar. The listing can be found in Your Computer magazine (April 1983, Vol. 3 No. 4, p. 64), see the Internet Archive or WoS (page 64 and page 65).

I have made a few changes to the program. Apart from the credit to Vincent Crockett and other information in lines 1-3, I have deleted from line 60 the expression "-(A1=31)" because it makes no sense to me and its deletion does not appear to affect the program. Also, the end of line 380 has been changed, the deleted poke produces a reversed solidus ('\') but on a Dragon you can obtain that symbol with Shift+Clear+Z (plus a few more characters other than Z, and in 64 mode Shift+Clear are all that are required), so it is not really cheating to put a '\' in the text file.

Update: I have replaced the original file with a new upload that has "-(A1=31)" reinstated in line 60, see Sarah's post below for the explanation.
Attachments
Rebound.zip
(1.24 KiB) Downloaded 276 times
Last edited by Alastair on Thu Oct 24, 2013 9:18 pm, edited 1 time in total.
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: Rebound from Your Computer magazine

Post by Sarah »

I suppose "-(A1=31)" will evaluate to 1 when A1 reaches 31 and 0 otherwise.

So it makes the right-hand border draw at X=63 instead of X=62 and therefore outlines the screen edge a little more neatly with the published expression.
Alastair
Posts: 669
Joined: Fri Jul 18, 2008 11:33 pm

Re: Rebound from Your Computer magazine

Post by Alastair »

Sarah wrote:I suppose "-(A1=31)" will evaluate to 1 when A1 reaches 31 and 0 otherwise.

So it makes the right-hand border draw at X=63 instead of X=62 and therefore outlines the screen edge a little more neatly with the published expression.
Interesting, I've just run a little test and you're right. You learn something every day :) .
User avatar
snarkhunter
Posts: 241
Joined: Fri Apr 03, 2009 7:16 pm
Location: France

Re: Rebound from Your Computer magazine

Post by snarkhunter »

Using logical expressions evaluation was quite a common thing, even in the early 80's!
For instance, when checking the general directions from joysticks in order to determine the new relative position of any object on screen.

IF A THEN... (where 'A' may actually be any variable or boolean expression)

If I remember well, I myself used this in the "Pixie!" code, but it can easily be extended to any logical expression.

... Just a few samples from the code in file "PIXIE.SYS":

4100 GOSUB3500:JK=PEEK(&HFF00)AND1:IFJK THEN4100ELSEEXEC&H8012:U=PEEK(&H15A):V=PEEK(&H15B):IFU>0ANDU<63ANDV>0ANDV<63THEN4210ELSEU=X+(X>0ANDU=0)-(X<255ANDU=63):V=Y+(Y>48ANDV=0)-(Y<143ANDV=63):GOSUB4500:X=U:Y=V:GOSUB4500
4110 JK=PEEK(&HFF00)AND1:IFJK=0THEN4110ELSE4100
4200 GOSUB3500:JK=PEEK(&HFF00)AND1:IFJK=0THEN4210ELSEEXEC&H8012:U=PEEK(&H15A):V=PEEK(&H15B):U=X+(X>0ANDU=0)-(X<255ANDU=63):V=Y+(Y>48ANDV=0)-(Y<143ANDV=63):GOSUB4500:X=U:Y=V:GOSUB4500:GOTO4200
4210 JK=PEEK(&HFF00)AND1:IFJK=0THEN4210


I believe this may become quite effective with smart interpreters/compilers that can identify such instructions and convert them into accurate low-level code.
Post Reply