Jump to content
IGNORED

Atari 800 vs C64


Sharky

Recommended Posts

Wow! That overhead racing must of been a challenge. I doubt Ill be much good in programming that on any machine.

 

Is that main racing you control a "sprite". A rarely ever made any of my "sprites" of my own because its so complicated and time-comsuming.

I guess it was easiler on Atari.

 

But the best programs Ive ever created was sort of Text adventures but ill ended running out of memory before I got too far into them because obviously my program listing was too spread out and too basic and too many $'s linked to variables, when it could of been programmed more compacted to save unnessary use of memory.

Link to comment
Share on other sites

The thing that threw a lot of people as that all string variables ($) needed to be DIMensioned first. The advantage is that you could make the strings as large as you wanted (to contain stuff like players and missiles)...making substring routines a breeze.

 

How about this one...

DIM A$(2048):A$=CHR$(0):A$(2048)=A$:A$(2)=A$

That would create a 2k block zeroed out ready for use in a P/M routine ;)

 

Basic Graphics modes were :

0 = the editor, 40x24 characters

1 = double-width multicolor characters, 20x24

2 = double-height, double-width multicolor characters, 20x12

3 = 4-color lo res., 40x24

4 = 2-color lo res., 80x48

5 = 4-color med. res., 80x48

6 = 2-color med. res., 160x96

7 = 4-color hi res., 160x96

8 = 1 color hi res., 320x192

9 = 8-color GTIA, 160x192

10 = 16-color GTIA, 160x192

11 = 16-lum GTIA, 160x192

 

Adding 16 to the number would remove the text window in all modes, and 32 would not clear the screen (so you could pop the window on and off when needed).

And you could use Antic to unlock other modes and mixtures of modes

Link to comment
Share on other sites

When I first started making programs, they were much like yours.  Little stories where the user enters a number of verbs, nouns, and things...and it dumps them into the story.  Good time-killer, even if you have company :)

 

Yes thats was my type of programming! And make real funny stories like "Favorite colour?", "Whats your Brothers Name?", "Favourite Food?", etc, etc then make a werid story at the end of it all !

 

Classic! I wish I had kept em!

:D :(

 

Did the Apple II have a built in basic? Im not sure because I used to have to use them at school and I wasnt allow to program on them.

 

On the VIC20 I ran out of memory im my first program! :evil:

 

You all just reminded me of something that I totally forgot about. I actually wrote a program based on the old madlib books I used to have as a kid. You know the ones, where you ask someone for a proper noun, or a verb, etc and then it would print out the story.

Link to comment
Share on other sites

Well for a black background on the 800:

 

setcolor 2,0,0

 

For sound

 

sound 1,10,10,10

 

Not to shabby

 

I forgot about the $ stuf or whatever but this should work:

 

10 PRINT"Press Any Key"

20 INPUT A$

30 IF A$="" THEN GOTO 50

40 GOTO 10

50 PRINT A$

 

If you wanted really big text you could change graphics modes:

 

5 GR. 2

10 PRINT"Press Any Key"

20 INPUT A$

30 IF A$="" THEN GOTO 50

40 GOTO 10

50 PRINT #6:A$

 

The input would be at the bottom and the output would be in the 800's big blocky text mode up top.

 

Theres prob a few bugs in there but thats the gist :)

 

Actually your "press any key" program wouldn't work unless the person pressed "enter". The best way to get a keypress was to use the keyboard handler.

 

Open #1,4,0,"K:"

Get #1,A

 

#1 being the channel, 4 being for input, I don't think the 0 is used but it's required, "K:" is for keyboard handler.

 

Or something like that... It's been tooooo looong.

Link to comment
Share on other sites

The thing that threw a lot of people as that all string variables ($) needed to be DIMensioned first.  The advantage is that you could make the strings as large as you wanted (to contain stuff like players and missiles)...making substring routines a breeze.

 

How about this one...

DIM A$(2048):A$=CHR$(0):A$(2048)=A$:A$(2)=A$

That would create a 2k block zeroed out ready for use in a P/M routine ;)

 

Basic Graphics modes were :

0 = the editor, 40x24 characters

1 = double-width multicolor characters, 20x24

2 = double-height, double-width multicolor characters, 20x12

3 = 4-color lo res., 40x24

4 = 2-color lo res., 80x48

5 = 4-color med. res., 80x48

6 = 2-color med. res., 160x96

7 = 4-color hi res., 160x96

8 = 1 color hi res., 320x192

9 = 8-color GTIA, 160x192

10 = 16-color GTIA, 160x192

11 = 16-lum GTIA, 160x192

 

Adding 16 to the number would remove the text window in all modes, and 32 would not clear the screen (so you could pop the window on and off when needed).

And you could use Antic to unlock other modes and mixtures of modes

 

I remember the DIM statements in program books but never made use of them myself. (I never knew what it meant).

My "adventures" listing were terrible slow code

KEY$="KEY", OPEN$="OPEN", GET$="KEY", LAMP$="LAMP" and so fourth and so fourth. (Almost ever adventure assigned to a $ and if a command wasnt assigned It would simply put "I DONT UNDERSTAND." No wonder y I would soon run out of memory after running the program.

Obviously your program needed spare memory for running as well and not just for holding on to your program listing.

 

Well that DIM Statement you typed above looks like the way to map out your RAM better. And obviously this would of had to be put as the start of your program as this A$ you assign to DIM (never knew it meant Dimension or i say AREA or Spare Area) would be all blank zeros 2K and ready for you to touch only.

I guess the best way to work this out is use AtariWinPlus in basic and experiment it myself and look at other advanced basic listing to understand this was really done.

Link to comment
Share on other sites

And the GET statement works a bit different if you use it alone in Atari Basic...the program halts and waits for a keypress. Therefore, you should use PEEK location 764 to check if a key is being pressed before executing the GET instruction (it is = 255 if no key is being pressed).

 

@Goochman

There are two ways of accomplishing using the string variables to hold the P/M objects. One involves POKEing to the variable table to change the address of where the variables appear in memory (which I can't seem to remember right now)...and an easier to remember method of making a temp variable to take up the slack...like this...

 

10 DIM TEMP1$(1)

 

20 DIM TEMP2$(ADR(TEMP1$)-1024*INT(ADR(TEMP1$)/1024))

 

30 DIM PMBASE$(384),MISSILE$(128),PLAYER0$(128),PLAYER1$(128),PLAYER2$(128),PLAYER3$(128)

 

40 PMBASE$(1)=CHR$(0):PMBASE$(384)=PMBASE$:PMBASE$(2)=PMBASE$

 

50 MISSILE$=PMBASE$:PLAYER0$=PMBASE$:PLAYER1$=PMBASE$:PLAYER2$=PMBASE$:PLAYER3$=PMBASE$

 

60 POKE 54279, ADR(PMBASE$)/256: POKE 53277, 3: POKE 559,46

 

Line 20 evens up memory to the nearest block by checking the address of the first temp variable's contents. You would need to use 2048 in place of the 1024's if you want to use single-line DMA.

Line 30 dimensions the strings that you need for the players and missiles. Since you always have a scrap area at PMBASE, you can use that area for redefined characters or to hold the player shapes.

Line 40 quickly zeros the area in PMBASE...and line 50 passes that to all the P/M area.

Line 60 tells Antic where your P/M graphics is, enables them, and sets the resolution to double (where each pixel = two scanlines)

Now that it's set up, you can simply do stuff like this...

PLAYER0$(Y, Y+6)="(bytes)"

...instead of having to POKE them into memory. It's really speedy :)

Use POKE 53248,X to put player0 on the screen...use any value 0-255 for X. The player object can move around the screen without disturbing any graphics already there.

Link to comment
Share on other sites

What's more is that you can set up the PMBASE area to hold sprite definitions. So if the first 7 bytes hold a spaceship, you can...

PLAYER0$(Y,Y+6)=PMBASE$(1,7)

 

@Sharky

Atari Basic requires you to dimension all string variables. Where other basics would give you an array of 10 string variables (usually with a maximum length of 255 characters) with the statement DIM A$(10), Atari would give you one string variable with a length of 10 characters. Numeric arrays i.e. DIM A(10) work the same as in other basics, though.

Link to comment
Share on other sites

Anyone knows the "Turbo BASIC" ? This was released in a German magazine in 1985 or 86 and was far better than ATARI BASIC , was used for many programs.

 

The "Keypress"-problem was easy to solve here - just write GET X , and the computer waits until you press a key.

 

And then X has the number of the key pressed.

 

Another advantage of Turbo BASIC is,that it has more free RAM with a disk-drive (34000+ bytes) and is faster.

 

it´s easy to find today.

 

Thimo

Link to comment
Share on other sites

Never used it.

 

But you can free up ALL the memory normally occupied by Dos by using the NODOS routines. You can store those on cassette with the LIST"C:" command and ENTER"C:" them into memory when needed :) So you can use it's loader to get your program off a disk, and then erase the NODOS lines before running it.

The drawback is that NODOS doesn't use any of the Dos tables (like the directory and the allocation table)...so you can only store 1 file per disk.

 

NODOS listing here:

http://www.atariage.com/forums/viewtopic.php?t=3444

Link to comment
Share on other sites

Another cool thing that you can do with strings is have the display list point to a string area. That way, you no longer have to PRINT things to the screen...you can just change the string itself :)

Try this...

 

10 GRAPHICS 0: DIM SCR$(960)

20 SCR$=CHR$(0): SCR$(960)=SCR$: SCR$(2)=SCR$

30 DL=PEEK(560)+256*PEEK(561)

40 HI=INT(ADR(SCR$)/256)

50 LO=ADR(SCR$)-HI*256

60 POKE 559,0

70 POKE DL+4,LO: POKE DL+5,HI

80 POKE 88,LO: POKE89,HI

90 POKE 559,34

 

That trick might need a bit of fudging if the address of SCR$ happens to cross a 4k boundry (which Antic will not allow)

Link to comment
Share on other sites

You ever wanna lock an 8-bit up HARD, try this:

GR.2

DIM A$(FRE(0));

 

Then press RESET. Snarf.

 

Yoiks, I haven't done any serious programming on the beasts since the last version of Flickerterm.

 

Im trying to but I getting an error 9 on your DIM statement.

 

Whats going on :| ?

Link to comment
Share on other sites

If I ever wanna see how many unused memory is in my system when im programming i type

 

PRINT FRE(0)

 

Just compare the Atari Basic with the C64 Basic on Cold starts.

 

Atari has 37902 Free

 

and C64 has -26627

 

So if im right, Atari has more Basic memory. :)

Link to comment
Share on other sites

@Nukey Shay - You surely know advanced basic well with those listings. Im half lost here :?

 

But I see what your getting at...

 

Im just experiment right now and seeing what tricks I can do... :wink:

 

BTW.. just curiuos does Atari 8bits have a Clock in it because C64 does but the thing is its not battery backed-up.

 

I use PRINT TI$ for c64 and it will give me something like that 0000803.

You can set the clock to real-time you lose your clock if u decide to switch off. :(

Link to comment
Share on other sites

Try this...

 

10 GRAPHICS 0: DIM SCR$(960)

20 SCR$=CHR$(0): SCR$(960)=SCR$: SCR$(2)=SCR$

30 DL=PEEK(560)+256*PEEK(561)

40 HI=INT(ADR(SCR$)/256)

50 LO=ADR(SCR$)-HI*256

60 POKE 559,0

70 POKE DL+4,LO: POKE DL+5,HI

80 POKE 88,LO: POKE89,HI

90 POKE 559,34

 

Im typing in your program now... Umm is this GRAPHICS 0 on Line 10 really nesscessary because your always on Graphics 0 as default from Cold Start.

Link to comment
Share on other sites

Not really, I suppose...just force of habit :D

BTW when the program finishes, you might not notice anything different. Type SCR$(921,930)="0123456789" with no line number afterward...that kinda demonstrates how the characters you use are different between PRINT statements and PEEK's ;)

 

No TI$ in Atari Basic...but zero page does have a timer. It can be read at locations 18, 19 , and 20. Zero page 20 is updated every 1/60th of a second, and when it rolls over location 19 is bumped up (when 19 rolls over, 18 is bumped up). There's a program around someplace that uses a display-list interrupt to change 18 and 19 into hours and minutes someplace...

Link to comment
Share on other sites

:? Every-time I try LIST in Nukey Shay Program, it keep saying ERROR 15 after my LIST Command.

 

I think The Atari Basic Emulator is behaving funny, because after running the program all werid things and some junk is coming up :|

post-2969-1049242828_thumb.png

Link to comment
Share on other sites

Whoa! It when back to normal to a while, I type RUN then READY came up then typed

 

SCR$(921,930)="0123456789" then hit ENTER/RETURN

 

It wouldnt be your programs fault because Goochman was saying in the other that most of his Basic Programs crashed on AtariWinPlus.

 

Its looks like AtariWinPlus isnt as compatible as I first thought. :(

 

But I try again and im sure it will work

post-2969-1049244988_thumb.png

Link to comment
Share on other sites

No...she typed it correct.  Maybe the emu does have some problem with string handling.  More likely my program is just junk :lol:

 

BTW you can POKE 82,0 to get more out of your screen ;)

POKE 710,0 gives you a nice dark screen too.

 

Oh :ponder: , I did have my setting on 320K Rambo, could that of been a problem since your using POKEs ? :|

 

Umm I can always try out my DOS Atari 800 Emulator somewhere is see if its emulates Basic better. Cause I know a Real Atari 8bit does not behave like that... :|

 

I just tried your POKE and got more out of the screen (Cool Poke i never knew that! :) ) still same problem. :(

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...