From: John Tsiombikas Date: Wed, 14 Sep 2022 21:48:46 +0000 (+0300) Subject: xor not right X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=c4e4cf9bda70eed128e224e914b8abf6ae334a5d;hp=71180a72d4e205696eb3b0f6db03a56c65a845b5;p=a2gs_xortest xor not right --- diff --git a/xortest.s b/xortest.s index b876059..ce89274 100644 --- a/xortest.s +++ b/xortest.s @@ -16,7 +16,7 @@ fillrest stal $e19d00,x inx inx - cpx #$300 + cpx #$100 bne fillrest lda #$0000 @@ -38,23 +38,29 @@ cmap pha bne cmap YVAL = 0 -COLIDX = 1 +TMPVAL = 1 sep #$20 ; accum 8bit ldx #0 ; fb index stz YVAL -yloop lda YVAL - and #$f - sta COLIDX +yloop ldy #0000 ; column/2 on Y reg +xloop tya asl + and #$0f + sta TMPVAL ; save first pixel X coordinate + inc ; increment by 1 for the next pixel + eor YVAL + asl ; move next pixel value to high nibble asl asl asl - ora COLIDX - ldy #160 ; 160 bytes across -xloop stal FB_BASE,x + ora TMPVAL ; first pixel X -> low nibble + eor YVAL + + stal FB_BASE, x ; write the pixel pair inx - dey + iny + cpy #160 bne xloop inc YVAL lda YVAL