From c4e4cf9bda70eed128e224e914b8abf6ae334a5d Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Thu, 15 Sep 2022 00:48:46 +0300 Subject: [PATCH] xor not right --- xortest.s | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) 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 -- 1.7.10.4