Jump to content
IGNORED

new to atari 800 development


Recommended Posts

3 things:

 

1: how hard is to poke the memory?

 

2: how do I use the sound command?

 

3: what is the shortest amount of code possible for a sprite?

 

that is all.

 

I am new to this

Are you wanting to use BASIC or Assembly?

 

1 - In BASIC, simple as POKE location, value
     To change the standard screen to purple, would be POKE 710,96
1 - In Assembler, 
     LDA #96
     STA 710
 
2 - In BASIC, SOUND channel, value, distortion, volume
      Channel 0-3
      Value 0-255
      Distortion 0-15
      Volume 0-15
      This assumes you use 4 voices each with 8-bit resolution.  You can combine 2 voices into a single channel and get 16-bit resolution for the frequency

 

For sprites, I don't have my memory map handy, but the steps are:

Set aside RAM, either 1k or 2k depending on double line vs single line resolution. NOTE:The RAM has to be "page aligned" and on a 1k boundary.

Set DMA to allow for players, missiles, or both

Distortion 0-15

Link to comment
Share on other sites

For sprites have a look at the many articles available on Atarimagazines. If you search for "Player Missile Graphics", as sprites are usually called in Atari land, you'll get lots of articles with example programs.

 

Alternatively you can use BASIC XL or BASIC XE which have built-in Sprite (Player/Missile) commands.

  • Like 1
Link to comment
Share on other sites

Keep in mind your code will have to include data for the sprite (aka. player). You can activate player-missile graphics with a couple lines of code in BASIC but it won't do anything without a bit more work.

BASIC example

1  RAMTOP=106:SDMCTL=559:PMBASE=54279:HPOSP0=53248:GRACTL=53277:PCOLR0=704
10 RESTORE :GRAPHICS 0:SETCOLOR 2,0,0
20 X=10:Y=48
45 REM == Set P/M RAM area
50 A=PEEK(RAMTOP)-8:POKE PMBASE,A
60 PMDATA=256*A:P0DATA=PMDATA+512+Y
105 REM == Clear P/M RAM ==
110 FOR I=PMDATA+512 TO PMDATA+640:POKE I,0:NEXT I
115 REM == Poke player data, color ==
120 FOR I=P0DATA TO P0DATA+7:READ A:POKE I,A:NEXT I
160 POKE PCOLR0,102
165 REM == Enable P/M graphics ==
170 POKE SDMCTL,46:POKE GRACTL,3
195 REM == Move ==
200 POKE HPOSP0,X
210 X=X+1:IF X>255 THEN X=0
320 GOTO 200
405 REM == Player Data ==
410 DATA 24,60,126,219,255,90,129,66

You can paste that into Altirra to try it out.

Edited by lightman
Link to comment
Share on other sites

I recommend using Altirra BASIC. It's going to make everything easier. Compare this example with the one from my previous post:

10 RESTORE :GRAPHICS 0:SETCOLOR 2,0,0
20 X=10:Y=48
25 REM == INIT P/M, CLEAR ==
30 PMGRAPHICS 2:PMCLR(0)
40 P0DATA=PMADR(0)+Y
45 REM == POKE DATA, SET COLOR ==
50 FOR I=P0DATA TO P0DATA+7:READ A:POKE I,A:NEXT I
60 PMCOLOR 0,6,7
65 REM == MOVE ==
70 PMMOVE 0,X
80 X=X+1:IF X>255 THEN X=0
90 GOTO 70
400 REM == PLAYER DATA ==
401 DATA 24,60,126,219,255,90,129,66
Edited by lightman
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Turbo-Basic XL is good too (and compilable).

 

Check out this example:

http://atariage.com/forums/topic/237969-turbo-basic-xl-hacks-or-improvements/?p=3265375

In the following post you can download code (the program autostarts).

 

The example displays two overlapping sprites that move in sync to get a third color.

If you don't need sync just remove lines 170 and 190 and add line 170 REM and you'll have faster movement.

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