gagebair Posted January 11, 2022 Share Posted January 11, 2022 I want to place my player 0 sprite in the very center of the screen AND have it be stationary. So far, I've been able to center it vertically, but from what I've been reading, it seems like it is impossible to place a static player 0 sprite centered horizontally without having it move first, due to only being able to place sprites every 15 color clocks. Is there anyway at all to do what I want to do? Any help at all would be greatly appreciated! Quote Link to comment Share on other sites More sharing options...
+Bruce-Robert Pocock Posted January 11, 2022 Share Posted January 11, 2022 Check out a tutorial on sprite positioning. You can only gross-position to about every 15 pixels using RESP0, then you fine-position using HMP0 and HMOVE. That's usually one of the first chapters in any Atari 2600 tutorial series, including the ones pinned in this forum. 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 11, 2022 Share Posted January 11, 2022 For something stationary you can set the gross-position to every 3rd pixel, which might be close enough. If the RESP0 ends on cycle 46 you'll end up with player0 at X position 75. Truly centered would be X position 76. I set the score positions in Medieval Mayhem by doing RESP0 and RESP1 on the same scanline. I don't use HMOVE, just use the course 3-pixel positioning as is. sta ENAM0 ; 3 turn off missile 0 sta ENAM1 ; 3 6 turn off missle 1 lda #%100 ; 2 8 set both players to 2 copies far sta NUSIZ0 ; 3 11 so we can display score sta NUSIZ1 ; 3 14 lda #>Digits ; 2 16 +----- sta Score1+1 ; 3 19 | reset score high pointers sta Score2+1 ; 3 22 | as they're used as Temp Variables sta Score3+1 ; 3 25 | during the rest of the program sta Score4+1 ; 3 28 +----- sta RESP0 ; 3 31 <---------- set player0 X = 30 nop ; 2 33 nop ; 2 35 nop ; 2 37 sta RESP1 ; 3 40 <---------- set player1 X = 57 ScoreKernel sta WSYNC lda #ShieldColor1 ; 2 sta COLUP0 ; 3 5 lda (Score1),y ; 5 10 sta GRP0 ; 3 13 lda #ShieldColor4 ; 2 15 sta COLUP1 ; 3 18 lda (Score4),y ; 5 23 sta GRP1 ; 3 26 lda #ShieldColor2 ; 2 28 nop nop nop sta COLUP0 ; 3 31 lda (Score2),y ; 5 36 sta GRP0 ; 3 39 lda #ShieldColor3 ; 2 41 sta COLUP1 ; 3 44 lda (Score3),y ; 5 49 sta GRP1 ; 3 52 dey bpl ScoreKernel This is from my Early HMOVE demo, the cycle and X columns tell you the resulting position of the object. Cycle position.pdf 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 11, 2022 Share Posted January 11, 2022 You might also find my tutorial to be useful: 1 1 Quote Link to comment Share on other sites More sharing options...
Sohl Posted January 12, 2022 Share Posted January 12, 2022 (edited) Typically, if you only have one object that will be drawn with P0, you would do the write to RESP0 to set the position (and HMOVE, if desired for fine-tuning position) during the VBlank period before the visible screen generation done in the Kernel code. If you have multiple things to be drawn with P0, you would need to use RESP0 (and perhaps HMOVE) for each subsequent object during the Kernel code after the prior P0 object is drawn. Edited January 12, 2022 by Sohl clarity of wording Quote Link to comment Share on other sites More sharing options...
SvOlli Posted January 12, 2022 Share Posted January 12, 2022 If you want to set a sprite on a 3 colorclock cycle, I can offer this routine: https://www.pagetable.com/?p=669 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.