X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=xortest.s;h=9a32dc2f29d5392d10b84eecbe68b5bf1f07bcb0;hb=e4183cdb16f93005e6fe930ccd4613bae8a83e3b;hp=b876059c3bffbc4fab1555b514addbd88961535a;hpb=71180a72d4e205696eb3b0f6db03a56c65a845b5;p=a2gs_xortest diff --git a/xortest.s b/xortest.s index b876059..9a32dc2 100644 --- a/xortest.s +++ b/xortest.s @@ -1,5 +1,7 @@ org $800 +LARGE = 0 + REG_NEWVID = $c029 FB_BASE = $e12000 @@ -12,15 +14,15 @@ FB_BASE = $e12000 rep #$30 ; accum/index 16bit lda #$0000 ldx #$0000 -fillrest +fillrest ; @30f stal $e19d00,x inx inx - cpx #$300 + cpx #$100 bne fillrest lda #$0000 -cmap pha +cmap pha ; @31d sta 0 asl tax ; offset = i * 2 @@ -38,29 +40,53 @@ cmap pha bne cmap YVAL = 0 -COLIDX = 1 +TMPVAL = 1 +YNIB = 2 - sep #$20 ; accum 8bit - ldx #0 ; fb index + sep #$20 ; accum 8bit @337 + ldx #0000 ; fb index stz YVAL -yloop lda YVAL - and #$f - sta COLIDX +yloop ldy #0000 ; column/2 on Y reg @33e +xloop lda YVAL ; @341 + + DO LARGE + lsr + FIN + + and #$0f + sta YNIB + tya + + DO LARGE = 0 asl + inc ; increment X, next pixel on low nibble + FIN + + and #$0f + sta TMPVAL ; save first pixel X coordinate + + DO LARGE = 0 + dec ; decrement back for high nibble pixel + FIN + + eor YNIB + 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 YNIB + + stal FB_BASE, x ; write the pixel pair inx - dey + iny + cpy #160 bne xloop inc YVAL lda YVAL cmp #200 bne yloop -infloop bra infloop +infloop bra infloop ; @36d ; vi:ft=asm_ca65