h0trod Posted June 13, 2020 Share Posted June 13, 2020 (edited) Is anybody aware of any games or sample code that uses "two copies medium" with both players interwoven (as in the six digit score routine) to generate four sprites on a line and assign each of those sprites chosen colors? (See my cribbage squares thread for what I'm trying to do.) My attempts so far have failed and if someone else has managed to do it I'd love to try to figure out their code. If it's just impossible, that's worth knowing too! (I guess I did have the crazy thought that since I only have two possible colors in my case, I could have sixteen different display routines, one for every combination from red red red red to black black black black, and save 12 cycles worth of memory access for color lookups every scanline.. maybe that would give me just enough time, but it seems.. drastic.) Thanks. Edited June 13, 2020 by h0trod crazy thought Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 13, 2020 Share Posted June 13, 2020 If you load up the registers and make use of VDELPx, I think there's enough time to do this. I'll whip up a quick example shortly. Quote Link to comment Share on other sites More sharing options...
eshu Posted June 13, 2020 Share Posted June 13, 2020 do you actually mean medium copies or close copies - the demo in the cribbage squares looks like it's 4 copies next to each other, e.g. P0 and P1 both set to two close. If you only want red and black, it is better to set the P0 and P1 to background colour and draw inverted sprites over BG and PF with e.g. BG set to red and PF to black - I hope that makes sense.... Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 13, 2020 Share Posted June 13, 2020 Yeah; there's enough time to do the updates if it's medium copies, but I don't think there is for close copies. Quote Link to comment Share on other sites More sharing options...
h0trod Posted June 13, 2020 Author Share Posted June 13, 2020 (edited) 1 hour ago, eshu said: do you actually mean medium copies or close copies - the demo in the cribbage squares looks like it's 4 copies next to each other, e.g. P0 and P1 both set to two close. If you only want red and black, it is better to set the P0 and P1 to background colour and draw inverted sprites over BG and PF with e.g. BG set to red and PF to black - I hope that makes sense.... The most recent screenshot in the Cribbage thread is two players medium, but interwoven: P0__P1__P0__P1 I think @Karl G is suggesting: P0____P0____P1____P1 which would give more time, but in terms of how far spread apart the cards are would (I think) be the same as I was getting with two players wide interwoven: P0____P1____P0____P1 (as in this screenshot:) @Karl G, if I am misunderstanding you, please let me know. It sounds like my best chance at getting cards close together and having control over Red/Black is the approach you suggest here and @RevEng suggested in the other thread - making the sprites themselves all white, and using the black background for a black card and setting a red playfield under the sprite for a red card. Thanks! Edited June 13, 2020 by h0trod Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 13, 2020 Share Posted June 13, 2020 No, I meant medium spacing, as in your first example. I didn't see that @RevEng had a suggestion that was useful for this specific case where we are only worried about two possible colors, but I was answering the general question asked in this topic. I think there's enough time for 4 different graphics with 4 different colors with medium spacing interwoven here, and I'm working on a quick demo, in case it's useful for anyone. Quote Link to comment Share on other sites More sharing options...
h0trod Posted June 13, 2020 Author Share Posted June 13, 2020 1 minute ago, Karl G said: No, I meant medium spacing, as in your first example. I didn't see that @RevEng had a suggestion that was useful for this specific case where we are only worried about two possible colors, but I was answering the general question asked in this topic. I think there's enough time for 4 different graphics with 4 different colors with medium spacing interwoven here, and I'm working on a quick demo, in case it's useful for anyone. Thank you Karl, I would love to see that! Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 13, 2020 Share Posted June 13, 2020 Here's some sample code that does this - each of the 4 sprites are set randomly to one of 8 possible sprites, each of which has its own color. I didn't end up using VDELPx afterall. I've attached the source. Here's the kernel code that displays the 4 sprites: lda Color1 sta COLUP0 lda Color2 sta COLUP1 ldy SpritePos SpriteLoop sta WSYNC ; 3 (0) lda (Sprite1Ptr),y ; 5 (5) sta GRP0 ; 3 (8) lda (Sprite2Ptr),y ; 5 (13) sta GRP1 ; 3 (16) lda (Sprite3Ptr),y ; 5 (21) tax ; 2 (23*) lda (Sprite4Ptr),y ; 5 (28) ldy Color3 ; 3 (31) dec SpritePos ; 5 (36) sleep 3 ; 3 (39) stx GRP0 ; 3 (42) sty COLUP0 ; 3 (45) ldy Color4 ; 3 (48) sta GRP1 ; 3 (51) sty COLUP1 ; 3 (54) lda Color1 ; 3 (57) ldx Color2 ; 3 (60) sta COLUP0 ; 3 (63) stx COLUP1 ; 3 (66) ldy SpritePos ; 3 (69) bpl SpriteLoop ; 2/3 (71/72) lda #0 sta GRP0 sta GRP1 4sprite.asm 4 Quote Link to comment Share on other sites More sharing options...
h0trod Posted June 13, 2020 Author Share Posted June 13, 2020 39 minutes ago, Karl G said: Here's some sample code that does this - each of the 4 sprites are set randomly to one of 8 possible sprites, each of which has its own color. I didn't end up using VDELPx afterall. Amazing. Thank you! 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 13, 2020 Share Posted June 13, 2020 6 minutes ago, h0trod said: Amazing. Thank you! No problem. It was a fun challenge. 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.