2600problems Posted February 12, 2017 Share Posted February 12, 2017 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 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted February 12, 2017 Share Posted February 12, 2017 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 Quote Link to comment Share on other sites More sharing options...
+slx Posted February 12, 2017 Share Posted February 12, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
lightman Posted February 12, 2017 Share Posted February 12, 2017 (edited) 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 February 12, 2017 by lightman Quote Link to comment Share on other sites More sharing options...
2600problems Posted February 13, 2017 Author Share Posted February 13, 2017 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 superman's got nothing on DK Quote Link to comment Share on other sites More sharing options...
2600problems Posted February 13, 2017 Author Share Posted February 13, 2017 by shortest amount of code, I meant in BASIC Quote Link to comment Share on other sites More sharing options...
lightman Posted February 13, 2017 Share Posted February 13, 2017 (edited) 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 February 13, 2017 by lightman 1 Quote Link to comment Share on other sites More sharing options...
2600problems Posted February 15, 2017 Author Share Posted February 15, 2017 lightman, i've run into a problem. line 30 produces an error Quote Link to comment Share on other sites More sharing options...
lightman Posted February 16, 2017 Share Posted February 16, 2017 (edited) lightman, i've run into a problem. line 30 produces an error Using which version of BASIC? This was written in Altirra BASIC (1.51) and won't work in Atari BASIC. I posted an Atari BASIC example (post #4) but Atari BASIC is going to be much slower. Edited February 16, 2017 by lightman Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted February 16, 2017 Share Posted February 16, 2017 Current version Altirra BASIC (1.52). Quote Link to comment Share on other sites More sharing options...
lightman Posted February 16, 2017 Share Posted February 16, 2017 Current version Altirra BASIC (1.52). Noted. Thanks. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted March 18, 2017 Share Posted March 18, 2017 (edited) FYI: There is a simple Atari BASIC Player/Missile programming example here: http://atariage.com/forums/topic/221650-valentines-day-programming-project/?p=2921214 Edited March 18, 2017 by kenjennings Quote Link to comment Share on other sites More sharing options...
+Philsan Posted March 18, 2017 Share Posted March 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.