Jump to content
IGNORED

COMPUTER ATARI 800XL has hardware sprites?


Andrea

Recommended Posts

Sprites are called "Players and Missiles" or PM Graphics for short on the Atari.

 

They are a little strange compared to other computers sprite implementations:

Players are 8-bits wide and the full height of the screen,  missiles are 2-bits wide and also the full height of the screen.  All 4 missiles can be combined into an extra player.

 

You can easily change the horizontal position of the PM graphics, but for vertical movements you need to shift the data up or down.

 

One cool thing is you can use display list interupts to change the position of the PM graphics anywhere on the screen, creating a new set of independent sprites.   This is useful for say a split screen game

  • Like 5
Link to comment
Share on other sites

Here's a fairly simple BASIC program that puts a sprite on screen which can be moved with a joystick, the movement

is slow, but that's BASIC, if you want useful sprites, you need to use ASSEMBLER, but this may give you and idea on

how they need to be set up.

 

1 PMBASE=54279:SIZEM=53260
2 RAMTOP=106:HPOSM0=53252
3 SDMCTL=559:REM SHADOW DMACTL
4 GRACTL=53277
5 HPOSP0=53248:REM HORIZONTAL POSITION OF PO
6 PCOLR0=704:REM SHADOW OF PLAYER 0 COLOR
10 GRAPHICS 0:SETCOLOR 2,0,0:REM SET BACKGROUND COLOR TO BLACK
20 X=100:REM BASIC'S PLAYER HORIZONTAL POSITION
30 Y=48:REM BASIC'S PLAYER VERTICAL POSITION
40 A=PEEK(RAMTOP)-8:REM GET RAM 2K BELOW TOP OF RAM
50 POKE PMBASE,A:REM TELL ANTIC WHERE PM RAM IS
60 MYPMBASE=256*A:REM KEEP TRACK OF PM RAM ADDRESS
70 POKE SDMCTL,46:REM PM DMA 2-LINE
80 POKE GRACTL,3:POKE SIZEM,3
90 POKE HPOSP0,100:POKE HPOSM0,90
100 FOR I=MYPMBASE+384 TO MYPMBASE+640:REM THIS LOOP CLEARS PLAYER
110 POKE I,0
120 NEXT I
125 REM POKE MYPMBASE+384+90,3
130 FOR I=MYPMBASE+512+Y TO MYPMBASE+518+Y
140 READ A:REM THIS LOOP DRAWS THE PLAYER
150 POKE I,A
160 NEXT I
170 DATA 8,17,35,255,32,16,8
180 POKE PCOLR0,88:REM MAKE THE PLAYER PINK
190 A=STICK(0):REM READ JOYSTICK
200 IF A=15 THEN GOTO 190:REM IF INACTIVE, TRY AGAIN
210 IF A=11 THEN X=X-1:POKE HPOSP0,X:IF X=25 THEN X=213
220 IF A=7 THEN X=X+1:POKE HPOSP0,X:IF X=213 THEN X=25
230 IF A<>13 THEN GOTO 280
240 FOR I=8 TO 0 STEP -1
250 POKE MYPMBASE+512+Y+I,PEEK(MYPMBASE+511+Y+I)
260 NEXT I
270 Y=Y+1
280 IF A<>14 THEN GOTO 190
290 FOR I=0 TO 8
300 POKE MYPMBASE+511+Y+I,PEEK(MYPMBASE+512+Y+I)
310 NEXT I
320 Y=Y-1
330 GOTO 190

Link to comment
Share on other sites

FastBasic, and TurboBasic, can handle sprites fine using the MOVE command to shift data around.  Even standard Atari Basic can do it with a little trick where you point a string to the same area as the PMG and then shift the data using normal string commands.

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