flame Posted May 14, 2020 Share Posted May 14, 2020 (edited) Hey, does anyone have any suggestions on how best to mask parts of a sprite, to change a certain number of lines—instead of having a separate full sprite ? *ideally without doing this during the kernel lda (objectptr),y cpx #5 bcc .nomask and #%11110000 .nomask sta GRP1 I am doing this in the kernel though, and seems to work as intended, but wondering if there is another way. Edited May 14, 2020 by pvmpkin Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 14, 2020 Share Posted May 14, 2020 Use a byte of RAM: outside of kernel: cpx #5 bcc .nomask lda #%11110000 .byte $2c ; skips over the next LDA instruction .nomask: lda #%11111111 sta mask Kernel: lda (objectptr),y and mask sta GRP1 Quote Link to comment Share on other sites More sharing options...
flame Posted May 14, 2020 Author Share Posted May 14, 2020 (edited) brilliant, thank you. I've noticed this a few times: .byte $2c You indicate that it skips the next LDA instruction but I don't understand why that is used, the context of it. OH, I think I see it. It's a way of reusing the store instruction without changing the value right ? Edited May 14, 2020 by pvmpkin Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 14, 2020 Share Posted May 14, 2020 32 minutes ago, pvmpkin said: You indicate that it skips the next LDA instruction but I don't understand why that is used, the context of it. Check the comments in Step 4 - 2 Line Kernel of my 2600 tutorial, one of my replies goes into detail in how the .byte $2c trick works. 1 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.