Skip to content

Instantly share code, notes, and snippets.

@nurpax
Created April 16, 2018 12:46
Show Gist options
  • Save nurpax/321db65e5021e727bc98ef9ccd951c24 to your computer and use it in GitHub Desktop.
Save nurpax/321db65e5021e727bc98ef9ccd951c24 to your computer and use it in GitHub Desktop.
//----------------------------------------------------------
.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