From 503b95acc0117f2900dc7a4e1ada306f6461270a Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 22 Mar 2023 06:26:43 +0100 Subject: [PATCH] WutFace bug --- main.asm | 62 ++++++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/main.asm b/main.asm index 44549d3..d634147 100644 --- a/main.asm +++ b/main.asm @@ -133,21 +133,37 @@ Player1UpNotPressed ; Do 192 scanlines of colour-changing (our picture) ldx 0 +Picture + stx COLUBK ; ranbow effect on background + +PlayFieldStart ; set up PF to display a wall around the game field lda #%11111111 sta PF0 sta PF1 sta PF2 -Picture - stx COLUBK ; ranbow effect on background +Top8LinesWall + sta WSYNC + inx + cpx #8 ; line 8? + bne Top8LinesWall ; No? Another loop + + ; now we change the lines + lda #%00010000 ; PF0 is mirrored <--- direction, low 4 bits ignored + sta PF0 + lda #0 + sta PF1 + sta PF2 + ; again, we don't bother writing PF0-PF2 every scanline - they never change! + ldy #0 ; load y with 0, we use y to count sprite tables +MiddleLinesWall lda #1 ; load an odd number into a and FRAMECOUNT ; and it with framecount to see if even or odd frame count - ; only do sprites on odd frames 0 == even 1 == odd + ; only do sprites on even frames 0 == even 1 == odd cmp NULL beq SpriteDone - - ; sprite stuff 192 scanlines + ; sprite stuff SpriteStart cpx SPR1Y bcc SpriteReset @@ -162,7 +178,7 @@ SpriteStart sbc #15 bcs .divideby15 - sta RESP0 + sta RESP0,x lda TurtleSprite,y sta GRP0 ; modify sprite 0 shape @@ -174,27 +190,7 @@ SpriteReset lda #0 sta GRP0 SpriteDone - sta WSYNC - inx - cpx #192 - bne SpriteStart - -Top8LinesWall - sta WSYNC - inx - cpx #8 ; line 8? - bne Top8LinesWall ; No? Another loop - ; now we change the lines - lda #%00010000 ; PF0 is mirrored <--- direction, low 4 bits ignored - sta PF0 - lda #0 - sta PF1 - sta PF2 - - ; again, we don't bother writing PF0-PF2 every scanline - they never change! - ldy #0 ; load y with 0, we use y to count sprite tables -MiddleLinesWall ; push y to save for later sta WSYNC @@ -220,20 +216,20 @@ Bottom8LinesWall inx cpx #192 bne Bottom8LinesWall - +PlayFieldDone ; --------------- - lda #%01000010 - sta VBLANK ; end of screen - start blanking - - - - ; 30 scanlines of overscan + ; clear playfield first lda #0 sta PF0 sta PF1 sta PF2 + lda #%01000010 + sta VBLANK ; end of screen - start blanking + + ; 30 scanlines of overscan + ldx #0 Overscan sta WSYNC -- 2.30.2