wopr67 Posted January 8, 2022 Share Posted January 8, 2022 (edited) I am experimenting with sprites, and I have a simple two-line kernel. Every even-numbered scanline should show a solid red line (#255), while every odd-numbered scanline should show a dotted (#170) yellow line. I want to use GRP0 for both odd and even lines. Nothing I have tried works, and for the life of me, I can't figure out why. Here is my kernel: NextFrame VERTICAL_SYNC TIMER_SETUP 37 lda #$70 sta COLUBK lda #0 sta VDELP0 lda #0 sta GRP0 sta GRP1 TIMER_WAIT ldx #192 LVScan txa and #$01 beq .oddscan .evenscan lda #$48 ;red sta COLUP0 lda #255 sta GRP0 sta RESP0 jmp .join .oddscan lda #$1e ;yellow sta COLUP0 lda #170 sta GRP0 sta RESP0 .join sta WSYNC dex bne LVScan ; 30 lines of overscan TIMER_SETUP 32 lda #170 sta GRP0 TIMER_WAIT jmp NextFrame Any idea what the problem is? Thanks! Edited January 8, 2022 by wopr67 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 9, 2022 Share Posted January 9, 2022 I'm pretty sure the problem is the RESP0 in your kernel. Apart from special cases where you need to reposition an object mid-screen, you will want to have your object positioning code outside of the visible screen. 1 Quote Link to comment Share on other sites More sharing options...
+Dave C Posted January 10, 2022 Share Posted January 10, 2022 (edited) 18 hours ago, Karl G said: I'm pretty sure the problem is the RESP0 in your kernel. +1 . Writing to RESP0 has ... all kinds of tricky side effects. To keep things simple strobe RESP0 before you go into your display loop. This could be as simple as inserting WSYNC / SLEEP ... / sta RESP0 - before you go into LVScan. By changing the sleep value you'll be able to observe how strobing at different points sets the sprite to different horizontal positions. It is also super helpful to use stella in debug mode and step through frame by frame / line by line to observe what's happening on each scan line. Edited January 10, 2022 by Dave C 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.