Jump to content
IGNORED

In Atari BASIC, how can I figure out what a DATA statement is doing?


Recommended Posts

Good Day Atarians,

 

In my quest to learn BASIC, I am understanding many commands and their use, but I am puzzled at how to know what a DATA statement's DATA represents. In this joystick drawing program example below, (from the COMPUTE! first book of Atari Graphics), the DATA statement is a mystery to me. It has 22 values, which number doesn't correspond to anything I can think of.

 

Is there a way to read the DATA and understand what it is? At least in the case below.

 

 

10 GRAPHICS 11:DIM SX(15),SY(15):FOR K=5 TO 15:READ X,Y:SX(K)=X:SY(K)=Y :NEXT K:X=40:Y=96:COLOR 1

20 PLOT X,Y:X=X+SX(STICK(O)):x=X+(X<O)-(X>79):Y=Y+SY(STICK(O)):Y=Y+(Y<0)-(Y>191):IF STRIG(O) THEN 20
30 C=C+1-15*(C=15):COLOR C:GOTO 20:DATA 1,1,1,-1,1,0,0,0,-1,1,-1,-1,-1, 0,0,0,0,1,0,-1,0,0
Thank you very much.
KB
  • Like 1
Link to comment
Share on other sites

DATA values are just data values nothing more. It's up to you what ever you want to represent with it. It can be data for PMG objects, data for assembler routine used with USR etc.

 

In this case the DATA values are just deltaX,deltaY pair which is added to current X,Y position according to joystick read value from register (value 5-15 therefore the READ from DATA stores in arrays SX,SY from index 5 up). For example the first two values are 1,1 so it means it will add 1 to X and 1 to Y which should be joystick right-down and if you look at corresponding values for STICK register, you will find that right-down is value 5 - as the first index where the DATAs are loaded.

Edited by MaPa
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...