Jump to content
IGNORED

BASIC Bitmap Fun


ClausB

Recommended Posts

Bitmap graphics modes show bits as pixels. GR. 4 and 6 two-color modes use one bit per pixel, so it's fun to use them as windows into the Atari's memory.

 

Type:

GR.6

B=PEEK(560)+256*PEEK(561)+4

POKE B,0:POKE B+1,0

 

Now you see the first 1.5K of RAM. See the timers in page 0 ticking away. See the stack in page 1 flickering. See system variables change as you type something. Plug in a joystick and watch bits change when you move it.

 

Type:

POKE B+1,208

 

Now you see the Atari's special hardware registers. GTIA, POKEY, PIA, ANTIC. See POKEY timers and random number generator. Type keys and watch bits change. Move the stick and see PIA change. Watch the fire button bit in GTIA and the light pen register in ANTIC.

 

Run this program and watch all the memory scroll by. Line 30 skips blank RAM. Change it if you like. Lines 60-85 print the page number in hex. If you prefer decimal just print A or H. Change line 1 to GR.4:S=10 if you want bigger bits. Have fun.

 

IMG_20200625_081533.jpg

Edited by ClausB
  • Like 14
  • Thanks 2
Link to comment
Share on other sites

  • 3 weeks later...

Cool.  Anyone have any other short (10 lines or less)  Basic programs that do something interesting graphically?  Way way back in the early 80s I had some very short Basic programs typed in and saved on cassette that did things like this,  or that plotted out various mathematical functions.  Used to like to watch these type of things when I was bored. 

 

Link to comment
Share on other sites

Hi!

2 hours ago, Fierodoug5 said:

Keep them coming, love these fun little programs!

This is a FastBasic sample, just one line:

DI.S(33)B.:DA.R()B.=0,2,0,1,1,2,0:DA.C()B.=32,111,20,32:S(15)=1:P.752,1:R.:N=0:FORI=1 TO31:Q=S(I-1):PUTC(Q):S(I-1)=N:N=R(Q+S(I)+S(I+1)):N.:?:U.KEY()

 

 

  • Like 3
Link to comment
Share on other sites

Translation of DMSC's into Atari BASIC

 

10 DATA 0,32,2,111,0,20,1,32,1,0,2,0,0,0
20 DIM S(33),R(9),C(9)
30 FOR I=0 to 6:READ A,B:R(I)=A:C(I)=B:NEXT I
40 S(15)=1:POKE 752,1:N=0
50 FOR I=1 TO 31
60 Q=S(I-1):? CHR$(C(Q));:S(I-1)=N:N=R(Q+S(I)+S(I+1))
70 NEXT I:?:GOTO 50

 

  • Like 4
Link to comment
Share on other sites

And here it is another FastBasic sample:

gr.7:c.1:da.sx()=1,1,-1,-1:da.sy()=1,-1,-1,1:x=100:y=36:d=1:for i=0 to 2047
d=(1+d+2*(0=i&(1+i exor(i-1))))&3:x=x+sx(d):y=y+sy(d):plot x,y:next:get i

Have Fun!

 

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

12 hours ago, Preppie said:

Translation of DMSC's into Atari BASIC

 


10 DATA 0,32,2,111,0,20,1,32,1,0,2,0,0,0
20 DIM S(33),R(9),C(9)
30 FOR I=0 to 6:READ A,B:R(I)=A:C(I)=B:NEXT I
40 S(15)=1:POKE 752,1:N=0
50 FOR I=1 TO 31
60 Q=S(I-1):? CHR$(C(Q));:S(I-1)=N:N=R(Q+S(I)+S(I+1))
70 NEXT I:?:GOTO 50

 

at least in Altirra Basic and AltirraOS (on atari800 emulator) we also need to:


35 FOR I=0 to 32:S(I)=0:NEXT I

 

Neat!

 

Something less sophisticated...

 

 

 

atari000.png

Link to comment
Share on other sites

Awesome! and the best part - I no longer have to sit and copy from Antic Magazine the code by hand.. I just copy and paste!

 

 

2010 DIM X$(60):X$=".....all the apps destroyed..mission terminated...alien takeover"

2020 DIM A$(LEN(X$)),C$(LEN(X$)):A$=X$

2030 POSITION 0,4:? #6;A$(1,20):C$=A$(2) :C$(LEN(C$)+1)=A$:A$=C$

2040 FOR I=1 TO 30:NEXT I:SOUND RND(0)*3,RND(0)*255,10,RND(0)*8:IF PEEK(53279)<>6 THEN 2030

2050 FOR N=0 TO 3:SOUND N,0,0,0:NEXT N:GOTO 1060

 

image.thumb.png.9eb883a21a5135c29d3396773f5310f6.png

Edited by RobVWA
CODE
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...