Subject: Re: [stella] If it's not one thing it's another. From: emooney@xxxxxxxxxxxxxxxx (Erik Mooney) Date: Thu, 04 Sep 1997 06:12:13 GMT |
>vertb LDX #$00 ;vertical blank > LDA #$02 > STA WSYNC > STA WSYNC > STA WSYNC > STA VSYNC > STA WSYNC > STA WSYNC ;Didn't know I could do an HMOVE here, but I'm > STA HMOVE ;doing HMOVE here to avoid the black line on screen > LDA #$2C ;is this causing my problems? I dunno. But I don't Shouldn't be. You can position and HMOVE your sprite anytime, and it will stay where it's put till you move it again. > STA TIM64T ;think so because when I remove the vertical > LDA #$00 ;movement routines everything works fine. > STA CXCLR > LDA #$C0 ;reset the number of vertical lines. > STA VERTLIN > LDA #$1B ;reset the number of sprite lines. > STA GP0SIZE > STA WSYNC > STA VSYNC You're gonna hit yourself ;) Look at that last STA VSYNC... you're writing $1B to VSYNC. $1B has bit 1 set, so you're leaving VSYNC active while the 2600 tries to draw the screen, and that doesn't work. >load LDX BLOCK > LDA playf0,X > STA PF0 > LDA playf1,X > STA PF1 > LDA playf2,X > STA PF2 > >grfx1 DEC VERTLIN ;Checking to see if it's time to draw a sprite yet. > LDA VERTLIN > CMP VERTPOS > BMI sprite1 > >grfx2 STA WSYNC ;If not then draw then scanline > DEC BLKSIZE ;next line of block > BEQ newblk ;or is it time for a new block? > JMP grfx1 ;get ready for next scanline > >sprite1 LDX GP0SIZE > BEQ nosprt ;See if we're finished drawing the sprite. > LDA p0data,x ;If not then load the sprite data. > STA GP0 > DEC GP0SIZE ;get set up for next sprite line > JMP grfx2 ;go draw current scanline > >nosprt LDA #$00 ;if we're finished with the sprite then > STA GP0 ;just fill the sprite with zeros. > JMP grfx2 ;then draw the scanline. > >newblk LDA BLOCK ;check to see if we've finished drawing the screen > BEQ clear > DEC BLOCK ;get ready for the next playfield block > LDA #$08 > STA BLKSIZE > JMP load I count a maximum of 85 cycles between WSYNCs here. Recall that the 2600 only has 76 cycles. The screen will end up taking one too many scanlines in a few spots (anytime it updates both the playfield and player on the same line.) -- Archives updated once/day at http://www.biglist.com/lists/stella/archives/ Unsubscribing and other info at http://www.biglist.com/lists/stella/stella.html
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[stella] If it's not one thing it's, crackers | Thread | [stella] dasm macros, Piero Cavina |
[stella] If it's not one thing it's, crackers | Date | [stella] dasm macros, Piero Cavina |
Month |