Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Atari Basic programming example

Loading...

Sign in or sign up now!
9,936
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 28, 2009

A couple Atari Basic programming examples.

The second design is created by having a constant offset, and repeatedly adding it to the X and Y axes. I explain how it's done below.

Lines 25 and 27 create a right border for the design.

On the Atari the X axis runs across the top of the screen from left to right. The Y axis goes from the top to the bottom of the screen.

Line 30 sets up a loop for a variable "I" that increments it (adds to it) by 5 rather than by 1.

A loop in Basic is a construct (a way of working) where a variable starts with an initial value (in this case 0). Then a set of "bracketed" instructions is executed (another way of explaining it is it's a set of instructions that are designated to be run repeatedly). These instructions may or may not use the loop variable. Then an additive offset is applied to the loop variable (in this case what happens to I is "Take the value of I, whatever it is, and add 5 to it"). Then the same set of designated instructions is executed again. This repeats until the end value for the loop variable is reached. In this case the end value is 135.

Lines 40 and 50 create the left side of the design, beginning each line on the left side (the X-coordinate=0 (and stays constant), the Y-coordinate uses the loop variable, which increases by 5 as it goes) and drawing a straight line to the bottom of it (where the X-coordinate uses the loop variable, which increases by 5 as it goes, and the Y-coordinate=135 (and stays constant)).

So on the left side it goes:

plot 0,0:drawto 0,135
plot 0,5:drawto 5,135
plot 0,10:drawto 10,135
etc.

Line 60 changes the tone of the sound you hear as the loop progresses.

Lines 70 and 80 do the same design along the right side by beginning each line on the top (where the X-coordinate uses the loop variable, which increases by 5 as it goes, and the Y-coordinate=0 (stays constant)) and drawing a straight line to the right side of it (where the X-coordinate=135 (stays constant), and the Y-coordinate uses the loop variable, which increases by 5 as it goes).

So on the right side it goes:

plot 0,0:drawto 135,0
plot 0,5:drawto 135,5
plot 0,10:drawto 135,10
etc.

Line 90 "brackets" the instructions in the for-loop.

Line 100 turns the sound off.

The cool thing is what gets created in the middle! Kind of looks like an "eye", doesn't it?

From what I understand there's some cool math concepts going on here which probably have something to do with calculus (tangents on a curve), but I'm embarrassed to say that I wouldn't really know how to explain it at this point. This is just a computer form of something we used to do by hand on graph paper for extra credit when I was in 5th grade. In fact we did it often enough that our teacher eventually said, "Alright! No more extra credit!" It was getting too easy.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (mmille10)

  • Sadly its easier to write graphics and sound programs this way than to do it in a C++ environment. In the case of sound you don't get to do tones off the bat. only wav files. Graphics is doable but slow with what i was using anyways. DirectX is a nightmare.

  • @NiTRoGLLYCERiN

    I've had experience with both (more advanced) console graphics and windowed graphics env's. I think what you're complaining about may be more due to the windowed env., because the app. model you're given makes it complicated. I wrote some 3D wireframe graphics in a console env. in C many years ago, and it wasn't that bad. It was almost as straightforward as this.

    Too bad about DirectX. I thought they had improved it a lot with Ver. 9 & 10. Maybe just in .Net though.

  • @NiTRoGLLYCERiN

    As for the sound, yeah. The old Atari had a synthesizer chip, so it could generate its own tones. Computers like the C-64 and the TI-99/4A had this setup as well. On Windows the sound hardware is just a DAC. You can model sound waves in software. I've seen apps. that do it. They just feed digital data to the hardware to generate tones, emulating what a synthesizer chip would do.

  • I no longer own a computer which I can program myself (I used to have a Sinclair Spectrum). Other than actually buying an old computer, is there any where on the net that I can program in Basic, just for fun? I'd really like to get back into it again. Great video btw.

  • @CelticReject

    BTW, if you want to get nostalgic, there are 8-bit emulators available for Windows, Mac, and Linux that you can download and install for free. They just run as regular apps. on your OS. You could probably find a Spectrum emulator if you wanted one. :) I used an emulator to create this video. Glad you liked it.

  • @mmille10 For the Spectrum, Spectaculator (10 on a 1-10 scale) is the best but it's shareware/1 month trial. (I bought it/$30). Nearly as good are ZXSpin & EmuZwin (9 & 8 respectively) followed by several dozen more assorted Spec Emus of varying quality. Emulators are awesome aren't they? BTW mmille10, are you using Atari800Win+? If so, ever try/use the Kaillera netpla option? I'm looking for people to play Atari 8-bit online but I can't find anybody. Let me know if you're interested?

  • @gjc82071

    Yes, I was using Atari800WinPlus here. In my version there was a built-in option, as I recall, for playing multiplayer, emulating people plugged into the joystick ports. I never tried it. I don't think I'd be that interested in trying it now. I've used emulators mainly for reminiscing, not for regular use.

see all

All Comments (46)

Sign In or Sign Up now to post a comment!
  • It's funny...I did a lot of Vic 20, c64 and apple programming back in the day but I forgot how archaic it was. I kept waiting for you to put semicolons at the end of your lines!

  • i was watching old atari ad, mah crazy man!

  • @mmille10 Yeah i hear ya. The Atari POKEY chip actually had 4 4-bit DACs if you used them that way. 15 years ago i could write a program to play raw digital sample files i downloaded from a bulletin board on a atari. Then i figured out how to write a program to sample and playback audio at the same time even. And then i made a program that generated sine wave sound and you could change the frequency.

  • @mmille10 Direct Draw version 8 or earlier is all i wanted to use and i could work from the demos supplied with the SDK. The problem was i couldn't change the graphics mode among other things. I experimented with OpenGL too at one time.

  • @CelticReject

    For me, Freebasic is probably the best you can get for free.

  • @CelticReject get a emulator such as dosbox

  • COOL :)

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more