mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2024-09-27 20:56:05 +00:00
a5d0172d82
SANE does not have built in operations for this, but all the values are exactly representable in the SANE extended format, so we just do the conversion ourselves based on the definition of the extended format.
242 lines
2.7 KiB
Plaintext
242 lines
2.7 KiB
Plaintext
macro
|
|
&l move4 &m1,&m2
|
|
lclb &yistwo
|
|
&l ~setm
|
|
~lda &m1
|
|
~sta &m2
|
|
~lda.h &m1
|
|
~sta.h &m2
|
|
~restm
|
|
mend
|
|
macro
|
|
&l ~lda &op
|
|
lclc &c
|
|
&c amid "&op",1,1
|
|
aif "&c"<>"{",.b
|
|
&c amid "&op",l:&op,1
|
|
aif "&c"="}",.a
|
|
mnote "Missing closing '}'",2
|
|
&op setc &op}
|
|
.a
|
|
&op amid "&op",2,l:&op-2
|
|
&op setc (&op)
|
|
.b
|
|
&l lda &op
|
|
mend
|
|
macro
|
|
&l ~lda.h &op
|
|
&l anop
|
|
lclc &c
|
|
&c amid "&op",1,1
|
|
aif "&c"="[",.b
|
|
aif "&c"<>"{",.d
|
|
&c amid "&op",l:&op,1
|
|
aif "&c"="}",.a
|
|
mnote "Missing closing '}'",2
|
|
&op setc &op}
|
|
.a
|
|
&op amid "&op",2,l:&op-2
|
|
&op setc (&op)
|
|
.b
|
|
aif &yistwo,.c
|
|
&yistwo setb 1
|
|
ldy #2
|
|
.c
|
|
&op setc "&op,y"
|
|
lda &op
|
|
mexit
|
|
.d
|
|
aif "&c"<>"#",.e
|
|
&op amid "&op",2,l:&op-1
|
|
&op setc "#^&op"
|
|
lda &op
|
|
mexit
|
|
.e
|
|
lda 2+&op
|
|
mend
|
|
macro
|
|
&l ~restm
|
|
&l anop
|
|
aif (&~la+&~li)=2,.i
|
|
sep #32*(.not.&~la)+16*(.not.&~li)
|
|
aif &~la,.h
|
|
longa off
|
|
.h
|
|
aif &~li,.i
|
|
longi off
|
|
.i
|
|
mend
|
|
macro
|
|
&l ~setm
|
|
&l anop
|
|
aif c:&~la,.b
|
|
gblb &~la
|
|
gblb &~li
|
|
.b
|
|
&~la setb s:longa
|
|
&~li setb s:longi
|
|
aif s:longa.and.s:longi,.a
|
|
rep #32*(.not.&~la)+16*(.not.&~li)
|
|
longa on
|
|
longi on
|
|
.a
|
|
mend
|
|
macro
|
|
&l ~sta &op
|
|
lclc &c
|
|
&c amid "&op",1,1
|
|
aif "&c"<>"{",.b
|
|
&c amid "&op",l:&op,1
|
|
aif "&c"="}",.a
|
|
mnote "Missing closing '}'",2
|
|
&op setc &op}
|
|
.a
|
|
&op amid "&op",2,l:&op-2
|
|
&op setc (&op)
|
|
.b
|
|
&l sta &op
|
|
mend
|
|
macro
|
|
&l ~sta.h &op
|
|
&l anop
|
|
lclc &c
|
|
&c amid "&op",1,1
|
|
aif "&c"="[",.b
|
|
aif "&c"<>"{",.d
|
|
&c amid "&op",l:&op,1
|
|
aif "&c"="}",.a
|
|
mnote "Missing closing '}'",2
|
|
&op setc &op}
|
|
.a
|
|
&op amid "&op",2,l:&op-2
|
|
&op setc (&op)
|
|
.b
|
|
aif &yistwo,.c
|
|
&yistwo setb 1
|
|
ldy #2
|
|
.c
|
|
&op setc "&op,y"
|
|
sta &op
|
|
mexit
|
|
.d
|
|
sta 2+&op
|
|
mend
|
|
macro
|
|
&l sub8 &n1,&n2,&n3
|
|
&l ~setm
|
|
ph8 &n1
|
|
ph8 &n2
|
|
jsl ~sub8
|
|
aif c:&n3,.a
|
|
pl8 &n1
|
|
ago .b
|
|
.a
|
|
pl8 &n3
|
|
.b
|
|
~restm
|
|
mend
|
|
macro
|
|
&l ph8 &n1
|
|
lclc &c
|
|
&l anop
|
|
&c amid &n1,1,1
|
|
aif s:longa=1,.a
|
|
rep #%00100000
|
|
.a
|
|
aif "&c"="#",.d
|
|
aif "&c"="[",.b
|
|
aif "&c"<>"{",.c
|
|
&c amid &n1,l:&n1,1
|
|
aif "&c"<>"}",.g
|
|
&n1 amid &n1,2,l:&n1-2
|
|
&n1 setc (&n1)
|
|
.b
|
|
ldy #6
|
|
~&SYSCNT lda &n1,y
|
|
pha
|
|
dey
|
|
dey
|
|
bpl ~&SYSCNT
|
|
ago .e
|
|
.c
|
|
ldx #6
|
|
~&SYSCNT lda &n1,x
|
|
pha
|
|
dex
|
|
dex
|
|
bpl ~&SYSCNT
|
|
ago .e
|
|
.d
|
|
&n1 amid &n1,2,l:&n1-1
|
|
bra ~b&SYSCNT
|
|
~a&SYSCNT dc i8"&n1"
|
|
~b&SYSCNT ldx #6
|
|
~c&SYSCNT lda ~a&SYSCNT,x
|
|
pha
|
|
dex
|
|
dex
|
|
bpl ~c&SYSCNT
|
|
.e
|
|
aif s:longa=1,.f
|
|
sep #%00100000
|
|
.f
|
|
mexit
|
|
.g
|
|
mnote "Missing closing '}'",16
|
|
mend
|
|
macro
|
|
&l pl8 &n1
|
|
lclc &c
|
|
&l anop
|
|
aif s:longa=1,.a
|
|
rep #%00100000
|
|
.a
|
|
&c amid &n1,1,1
|
|
aif "&c"<>"{",.b
|
|
&c amid &n1,l:&n1,1
|
|
aif "&c"<>"}",.f
|
|
&n1 amid &n1,2,l:&n1-2
|
|
pla
|
|
sta (&n1)
|
|
ldy #2
|
|
pla
|
|
sta (&n1),y
|
|
ldy #4
|
|
pla
|
|
sta (&n1),y
|
|
ldy #6
|
|
pla
|
|
sta (&n1),y
|
|
ago .d
|
|
.b
|
|
aif "&c"<>"[",.c
|
|
pla
|
|
sta &n1
|
|
ldy #2
|
|
pla
|
|
sta &n1,y
|
|
ldy #4
|
|
pla
|
|
sta &n1,y
|
|
ldy #6
|
|
pla
|
|
sta &n1,y
|
|
ago .d
|
|
.c
|
|
pla
|
|
sta &n1
|
|
pla
|
|
sta &n1+2
|
|
pla
|
|
sta &n1+4
|
|
pla
|
|
sta &n1+6
|
|
.d
|
|
aif s:longa=1,.e
|
|
sep #%00100000
|
|
.e
|
|
mexit
|
|
.f
|
|
mnote "Missing closing '}'",16
|
|
mend
|