;---------------------------------------
;draw routine by BRUSH/ELYSIUM'92
;This is my old hires line routine. It
;works on standard 16x16 char field.
;In the contemporary world it's nothing
;special, but in '92 it was the fastest
;routine around (checked :0)
;The setup code is kind of long and
;could use a little speed and clean up.
;Also the inner loop is not state-of-the
;-art anymore.
;but:
;1. this stuff actualy works (was used
;here and there in the past)
;2. may be a good starting point for
;someone who wishes to use/improve it.
;Just credit me if you'll learn some-
;thing from it.
;---------------------------------------
;x1,y1 - starting point
;x2,y2 - end point
;bank - what vic char bank to use
;uses $0a zero page bytes
;---------------------------------------

x1       = $60 ;coordinate x of begining
y1       = $61 ;---------- y --------.
x2       = $62 ;---------- x of end.
y2       = $63 ;---------- y -----.
dx       = $64 ;x1-x2
dy       = $65 ;y1-y2
aea      = $66 ;LSB of screen address.
aeb      = $67 ;MSB ------- " -------.
bank     = $68 ;in what bank we paint
count    = $69 ;dot counter

         *= $1000

;---------------------------------------
draw     lda x2    ;compare if x1>x2
         sec
         sbc x1
         bcc x1wx2 ;jump if yes
         sta dx
;---------------------------------------
x1mx2    lda y2    ;compare if y1>y2
         sec
         sbc y1
         bcc y1wy21;jump if yes
;---------------------------------------
y1my2    sta dy  ;computing dy
         cmp dx    ;compare if dx>dy
         bcc dxwdy ;jump if yes
         bne dxmdy ;angle not 45 deg
;---------------------------------------
         jmp draw9
;---------------------------------------
dxmdy    jmp draw2;plot the line
;---------------------------------------
dxwdy    jmp draw1;plot the line
;---------------------------------------
y1wy21   eor #$ff ;calculting dy
         adc #$01
         sta dy
         cmp dx    ;compare if dx>dy
         bcc dxwdy1;jump if yes
         bne jupsa3;angle not 45 deg
;---------------------------------------
         jmp drawc
;---------------------------------------
jupsa3   jmp draw7
;---------------------------------------
dxwdy1   jmp draw8
;---------------------------------------
x1wx2    eor #$ff
         adc #$01
         sta dx
         lda y2   ;compare if y1>y2
         sec
         sbc y1
         bcc y1wy2 ;jump if yes
;---------------------------------------
         sta dy
         cmp dx    ;compare if dx>dy
         bcc dxwdy2;jump if yes
         bne jupsa1;angle not 45deg
;---------------------------------------
         jmp drawa
;---------------------------------------
jupsa1   jmp draw3
;---------------------------------------
dxwdy2   jmp draw4
;---------------------------------------
y1wy2    eor #$ff  ;calculating dy
         adc #$01
         sta dy
         cmp dx    ;compare if dx>dy
         bcc dxwdy3;jump if yes
         bne jupsa2;angle 45 deg
;---------------------------------------
         jmp drawb
;---------------------------------------
jupsa2   jmp draw6
;---------------------------------------
dxwdy3   jmp draw5
;---------------------------------------
;the actual drawing subroutines
;---------------------------------------

exit6    rts
draw1    lda x2
         sec
         sbc x1
         sta count
         bne nie1
         inc count
nie1     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tab4,x
         sta e0u+1
         lda tab5,x
         sta e0u+2
         lda dx
e0u      jmp $1000
eu1      tax
eua      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exit6
         txa
         sbc dy
         bpl eu2
         adc dx
         iny
eu2      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exit6
         txa
         sbc dy
         bpl eu3
         adc dx
         iny
eu3      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exit6
         txa
         sbc dy
         bpl eu4
         adc dx
         iny
eu4      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exit61
         txa
         sbc dy
         bpl eu5
         adc dx
         iny
eu5      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exit61
         txa
         sbc dy
         bpl eu6
         adc dx
         iny
eu6      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exit61
         txa
         sbc dy
         bpl eu7
         adc dx
         iny
eu7      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exit61
         txa
         sbc dy
         bpl eu8
         adc dx
         iny
eu8      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exit61
         txa
         sbc dy
         bpl eu9
         adc dx
         iny
eu9      tax
         lda aea
         clc
         adc #$80
         sta aea
         bcc eub
         inc aeb
eub      jmp eua
exit61   rts

;---------------------------------------

exit41   rts
draw2    lda y2
         cmp y1
         bne nie2
         inc y2
nie2     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabm,x
         sta cuc+1
         lda tabn,x
         sta cuc+2
         lda dy
cuc      jmp $1000
cu1      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit41
         txa
         sbc dx
         bpl cu1
         adc dy
cu2      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit41
         txa
         sbc dx
         bpl cu2
         adc dy
cu3      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu3
         adc dy
cu4      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu4
         adc dy
cu5      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu5
         adc dy
cu6      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu6
         adc dy
cu7      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu7
         adc dy
cu8      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit4
         txa
         sbc dx
         bpl cu8
         adc dy
         tax
         lda aea
         clc
         adc #$80
         sta aea
         bcc cu9
         inc aeb
cu9      jmp cu1+1
exit4    rts

;---------------------------------------

exit31   rts
draw3    lda y2
         cmp y1
         bne nie3
         inc y2
nie3     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabo,x
         sta buc+1
         lda tabp,x
         sta buc+2
         lda dy
buc      jmp $1000
bu1      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit31
         txa
         sbc dx
         bpl bu1
         adc dy
bu2      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit31
         txa
         sbc dx
         bpl bu2
         adc dy
bu3      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu3
         adc dy
bu4      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu4
         adc dy
bu5      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu5
         adc dy
bu6      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu6
         adc dy
bu7      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu7
         adc dy
bu8      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         iny
         cpy y2
         beq exit3
         txa
         sbc dx
         bpl bu8
         adc dy
         tax
         lda aea
         sec
         sbc #$80
         sta aea
         bcs bu9
         dec aeb
bu9      jmp bu1+1
exit3    rts

;---------------------------------------

exit7    rts
draw4    lda x1
         sec
         sbc x2
         sta count
         bne nie4
         inc count
nie4     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tab6,x
         sta f0u+1
         lda tab7,x
         sta f0u+2
         lda dx
f0u      jmp $1000
fu1      tax
fua      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exit7
         txa
         sbc dy
         bpl fu2
         adc dx
         iny
fu2      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exit7
         txa
         sbc dy
         bpl fu3
         adc dx
         iny
fu3      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exit7
         txa
         sbc dy
         bpl fu4
         adc dx
         iny
fu4      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exit71
         txa
         sbc dy
         bpl fu5
         adc dx
         iny
fu5      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exit71
         txa
         sbc dy
         bpl fu6
         adc dx
         iny
fu6      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exit71
         txa
         sbc dy
         bpl fu7
         adc dx
         iny
fu7      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exit71
         txa
         sbc dy
         bpl fu8
         adc dx
         iny
fu8      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exit71
         txa
         sbc dy
         bpl fu9
         adc dx
         iny
fu9      tax
         lda aea
         sec
         sbc #$80
         sta aea
         bcs fub
         dec aeb
fub      jmp fua
exit71   rts

;---------------------------------------

exit9    rts
draw5    lda x1
         sec
         sbc x2
         sta count
         bne nie5
         inc count
nie5     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tab8,x
         sta g0u+1
         lda tab9,x
         sta g0u+2
         lda dx
g0u      jmp $1000
gu1      tax
gua      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exit9
         txa
         sbc dy
         bpl gu2
         adc dx
         dey
gu2      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exit9
         txa
         sbc dy
         bpl gu3
         adc dx
         dey
gu3      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exit9
         txa
         sbc dy
         bpl gu4
         adc dx
         dey
gu4      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exit91
         txa
         sbc dy
         bpl gu5
         adc dx
         dey
gu5      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exit91
         txa
         sbc dy
         bpl gu6
         adc dx
         dey
gu6      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exit91
         txa
         sbc dy
         bpl gu7
         adc dx
         dey
gu7      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exit91
         txa
         sbc dy
         bpl gu8
         adc dx
         dey
gu8      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exit91
         txa
         sbc dy
         bpl gu9
         adc dx
         dey
gu9      tax
         lda aea
         sec
         sbc #$80
         sta aea
         bcs gub
         dec aeb
gub      jmp gua
exit91   rts

;---------------------------------------

exit21   rts
draw6    lda y2
         cmp y1
         bne nie6
         dec y2
nie6     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabq,x
         sta auc+1
         lda tabr,x
         sta auc+2
         lda dy
auc      jmp $1000
au1      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit21
         txa
         sbc dx
         bpl au1
         adc dy
au2      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit21
         txa
         sbc dx
         bpl au2
         adc dy
au3      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au3
         adc dy
au4      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au4
         adc dy
au5      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au5
         adc dy
au6      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au6
         adc dy
au7      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au7
         adc dy
au8      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit2
         txa
         sbc dx
         bpl au8
         adc dy
         tax
         lda aea
         sec
         sbc #$80
         sta aea
         bcs au9
         dec aeb
au9      jmp au1+1
exit2    rts

;---------------------------------------

exit11   rts
draw7    lda y2
         cmp y1
         bne nie7
         dec y2
nie7     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabk,x
         sta tuc+1
         lda tabl,x
         sta tuc+2
         lda dy
tuc      jmp $1000
tu1      tax
         lda #$80
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit11
         txa
         sbc dx
         bpl tu1
         adc dy
tu2      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit11
         txa
         sbc dx
         bpl tu2
         adc dy
tu3      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu3
         adc dy
tu4      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu4
         adc dy
tu5      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu5
         adc dy
tu6      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu6
         adc dy
tu7      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu7
         adc dy
tu8      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         dey
         cpy y2
         beq exit1
         txa
         sbc dx
         bpl tu8
         adc dy
         tax
         lda aea
         clc
         adc #$80
         sta aea
         bcc tu9
         inc aeb
tu9      jmp tu1+1
exit1    rts

;---------------------------------------

exit5    rts
draw8    lda x2
         sec
         sbc x1
         sta count
         bne nie8
         inc count
nie8     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda taba,x
         sta d0u+1
         lda tabb,x
         sta d0u+2
         lda dx
d0u      jmp $1000
du1      tax
dua      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exit5
         txa
         sbc dy
         bpl du2
         adc dx
         dey
du2      tax
         lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exit5
         txa
         sbc dy
         bpl du3
         adc dx
         dey
du3      tax
         lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exit5
         txa
         sbc dy
         bpl du4
         adc dx
         dey
du4      tax
         lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exit51
         txa
         sbc dy
         bpl du5
         adc dx
         dey
du5      tax
         lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exit51
         txa
         sbc dy
         bpl du6
         adc dx
         dey
du6      tax
         lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exit51
         txa
         sbc dy
         bpl du7
         adc dx
         dey
du7      tax
         lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exit51
         txa
         sbc dy
         bpl du8
         adc dx
         dey
du8      tax
         lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exit51
         txa
         sbc dy
         bpl du9
         adc dx
         dey
du9      tax
         lda aea
         clc
         adc #$80
         sta aea
         bcc dub
         inc aeb
dub      jmp dua
exit51   rts

;---------------------------------------

exita    rts
draw9    lda x2
         sec
         sbc x1
         sta count
         bne nie9
         inc count
nie9     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabc,x
         sta h0u+1
         lda tabd,x
         sta h0u+2
h0u      jmp $1000
hu1      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exita
         iny
hu2      lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exita
         iny
hu3      lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exita
         iny
hu4      lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exita1
         iny
hu5      lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exita1
         iny
hu6      lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exita1
         iny
hu7      lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exita1
         iny
hu8      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exita1
         iny
         lda aea
         clc
         adc #$80
         sta aea
         bcc hub
         inc aeb
hub      jmp hu1
exita1   rts

;---------------------------------------

exitb    rts
drawa    lda x1
         sec
         sbc x2
         sta count
         bne niea
         inc count
niea     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabg,x
         sta i0u+1
         lda tabh,x
         sta i0u+2
i0u      jmp $1000
iu1      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb
         iny
iu2      lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb
         iny
iu3      lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb
         iny
iu4      lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb1
         iny
iu5      lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb1
         iny
iu6      lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb1
         iny
iu7      lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb1
         iny
iu8      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exitb1
         iny
iu9      lda aea
         sec
         sbc #$80
         sta aea
         bcs iub
         dec aeb
iub      jmp iu1
exitb1   rts

;---------------------------------------

exitc    rts
drawb    lda x1
         sec
         sbc x2
         sta count
         bne nieb
         inc count
nieb     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabi,x
         sta j0u+1
         lda tabj,x
         sta j0u+2
j0u      jmp $1000
ju1      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc
         dey
ju2      lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc
         dey
ju3      lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc
         dey
ju4      lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc1
         dey
ju5      lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc1
         dey
ju6      lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc1
         dey
ju7      lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc1
         dey
ju8      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exitc1
         dey
ju9      lda aea
         sec
         sbc #$80
         sta aea
         bcs jub
         dec aeb
jub      jmp ju1
exitc1   rts

;---------------------------------------

exitd    rts
drawc    lda x2
         sec
         sbc x1
         sta count
         bne niec
         inc count
niec     ldx x1
         ldy y1
         lda tab2,x
         sta aea
         lda tab1,x
         clc
         adc bank
         sta aeb
         txa
         and #$07
         tax
         lda tabe,x
         sta k0u+1
         lda tabf,x
         sta k0u+2
k0u      jmp $1000
ku1      lda #$80
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd
         dey
ku2      lda #$40
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd
         dey
ku3      lda #$20
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd
         dey
ku4      lda #$10
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd1
         dey
ku5      lda #$08
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd1
         dey
ku6      lda #$04
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd1
         dey
ku7      lda #$02
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd1
         dey
ku8      lda #$01
         ora (aea),y
         sta (aea),y
         dec count
         beq exitd1
         dey
         lda aea
         clc
         adc #$80
         sta aea
         bcc kub
         inc aeb
kub      jmp ku1
exitd1   rts

;---------------------------------------

tab1     .byte $20,$20,$20,$20
         .byte $20,$20,$20,$20
         .byte $20,$20,$20,$20
         .byte $20,$20,$20,$20
         .byte $21,$21,$21,$21
         .byte $21,$21,$21,$21
         .byte $21,$21,$21,$21
         .byte $21,$21,$21,$21
         .byte $22,$22,$22,$22
         .byte $22,$22,$22,$22
         .byte $22,$22,$22,$22
         .byte $22,$22,$22,$22
         .byte $23,$23,$23,$23
         .byte $23,$23,$23,$23
         .byte $23,$23,$23,$23
         .byte $23,$23,$23,$23
         .byte $24,$24,$24,$24
         .byte $24,$24,$24,$24
         .byte $24,$24,$24,$24
         .byte $24,$24,$24,$24
         .byte $25,$25,$25,$25
         .byte $25,$25,$25,$25
         .byte $25,$25,$25,$25
         .byte $25,$25,$25,$25
         .byte $26,$26,$26,$26
         .byte $26,$26,$26,$26
         .byte $26,$26,$26,$26
         .byte $26,$26,$26,$26
         .byte $27,$27,$27,$27
         .byte $27,$27,$27,$27
         .byte $27,$27,$27,$27
         .byte $27,$27,$27,$27

;---------------------------------------

tab2     .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80
         .byte $00,$00,$00,$00
         .byte $00,$00,$00,$00
         .byte $80,$80,$80,$80
         .byte $80,$80,$80,$80

;---------------------------------------

tab3     .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01
         .byte $80,$40,$20,$10
         .byte $08,$04,$02,$01

;---------------------------------------
tab4     .byte <eu1,<eu2,<eu3,<eu4
         .byte <eu5,<eu6,<eu7,<eu8
;---------------------------------------
tab5     .byte >eu1,>eu2,>eu3,>eu4
         .byte >eu5,>eu6,>eu7,>eu8
;---------------------------------------
tab6     .byte <fu8,<fu7,<fu6,<fu5
         .byte <fu4,<fu3,<fu2,<fu1
;---------------------------------------
tab7     .byte >fu8,>fu7,>fu6,>fu5
         .byte >fu4,>fu3,>fu2,>fu1
;---------------------------------------
tab8     .byte <gu8,<gu7,<gu6,<gu5
         .byte <gu4,<gu3,<gu2,<gu1
;---------------------------------------
tab9     .byte >gu8,>gu7,>gu6,>gu5
         .byte >gu4,>gu3,>gu2,>gu1
;---------------------------------------
taba     .byte <du1,<du2,<du3,<du4
         .byte <du5,<du6,<du7,<du8
;---------------------------------------
tabb     .byte >du1,>du2,>du3,>du4
         .byte >du5,>du6,>du7,>du8
;---------------------------------------
tabc     .byte <hu1,<hu2,<hu3,<hu4
         .byte <hu5,<hu6,<hu7,<hu8
;---------------------------------------
tabd     .byte >hu1,>hu2,>hu3,>hu4
         .byte >hu5,>hu6,>hu7,>hu8
;---------------------------------------
tabe     .byte <ku1,<ku2,<ku3,<ku4
         .byte <ku5,<ku6,<ku7,<ku8
;---------------------------------------
tabf     .byte >ku1,>ku2,>ku3,>ku4
         .byte >ku5,>ku6,>ku7,>ku8
;---------------------------------------
tabg     .byte <iu8,<iu7,<iu6,<iu5
         .byte <iu4,<iu3,<iu2,<iu1
;---------------------------------------
tabh     .byte >iu8,>iu7,>iu6,>iu5
         .byte >iu4,>iu3,>iu2,>iu1
;---------------------------------------
tabi     .byte <ju8,<ju7,<ju6,<ju5
         .byte <ju4,<ju3,<ju2,<ju1
;---------------------------------------
tabj     .byte >ju8,>ju7,>ju6,>ju5
         .byte >ju4,>ju3,>ju2,>ju1
;---------------------------------------
tabk     .byte <tu1,<tu2,<tu3,<tu4
         .byte <tu5,<tu6,<tu7,<tu8
;---------------------------------------
tabl     .byte >tu1,>tu2,>tu3,>tu4
         .byte >tu5,>tu6,>tu7,>tu8
;---------------------------------------
tabm     .byte <cu1,<cu2,<cu3,<cu4
         .byte <cu5,<cu6,<cu7,<cu8
;---------------------------------------
tabn     .byte >cu1,>cu2,>cu3,>cu4
         .byte >cu5,>cu6,>cu7,>cu8
;---------------------------------------
tabo     .byte <bu8,<bu7,<bu6,<bu5
         .byte <bu4,<bu3,<bu2,<bu1
;---------------------------------------
tabp     .byte >bu8,>bu7,>bu6,>bu5
         .byte >bu4,>bu3,>bu2,>bu1
;---------------------------------------
tabq     .byte <au8,<au7,<au6,<au5
         .byte <au4,<au3,<au2,<au1
;---------------------------------------
tabr     .byte >au8,>au7,>au6,>au5
         .byte >au4,>au3,>au2,>au1
;---------------------------------------

