Created
April 16, 2018 12:46
-
-
Save nurpax/321db65e5021e727bc98ef9ccd951c24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------- | |
.macro drawboard(screen,colorbuf) { | |
.const tsetbits = $62 | |
.const tbits = $63 | |
.const col = $64 | |
lda #BLACK | |
sta col | |
lda #WHITE | |
sta col+1 | |
.for (var y = 0; y < 16; y++) { | |
lda setbit+y | |
sta tsetbits | |
lda bits+y | |
sta tbits | |
ldx bitwidth | |
stx tmpx | |
xloop: | |
lda tbits | |
and #1 | |
tax | |
lda (col), x | |
lsr tsetbits | |
bcc notset | |
lda #DARK_GRAY // background | |
notset: | |
lsr tbits | |
ldx tmpx | |
sta colorbuf+[(y+1)*40], x | |
dec tmpx | |
bne xloop | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment