home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
education
/
a
/
easyknit
/
KnitConv
/
!KnitConv
/
!RunImage
(
.txt
)
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
RISC OS BBC BASIC V Source
|
1997-01-23
|
45.1 KB
|
2,054 lines
!RunImage for !KnitConv
A&J Muir 1997
,version$= "V1.05c 24th October 1996"
&000406C2:
$+" at line ";
&000406C2:
exit%=
&000400DD
reason%
titleopen%=
&000400E1,mask%,block%,tittime%
reason%
&000400C7,mask%,block%
reason%
reason%
&000400C6,,block%
17,18:
&00000008,6,block%+44
,255,"Data transfer failed: Receiver died"
&000406C0
ilist%=2
proclist%=3
jaclist%=3
sprlist%=6
block% 4500, imenu% 28+ilist%*24, processmenu% 28+proclist%*24, jacmenu% 28+jaclist%*24, spritemenu% 28+sprlist%*24
menuindsize%=200
menuind% menuindsize%: $menuind%="":menuindfree%=menuind%+12
carb% 24
name% 12, transform% 32, pal16% 128, wimppal% 68
opt$(3), jac$(3), res$(3), col$(3)
2E!block%=2: block%!4=3: block%!8=9: block%!12=10: block%!16=&400C0
31block%!20=&400C1: block%!24=&502: block%!28=0
&000400C0,310,&4B534154,"KnitConv",block%
&000406C2:
state_file$="Result"
sprite_file$="Sprite"
exit%=
wimp_setistate%=&400CD
ct_setgcol%=&40743
wimp_setcol%=&400E6
opt%=-1
textdispvar%=0
jactype%=0
restype%=0
coltype%=2
coltable%=0
nametable%=0
paltable%=0
sourcespr%=0
draw%=0
colorder%=0
scrarea%=0
transtable%=0
symbstore%=0
symbpoint%=0
symbsize%=0
descinfobuff%=0
descbuff%=0
extradescinfobuff%=0
extradescbuff%=0
edmul%=1
eddiv%=1
yarncol%=-1
mainopen%=
titleopen%=
colpicopen%=
helpon%=
bertyfile%=
infobuff%=0
helpbuff%=0
mask%=&1830
&00000042
tittime%
tittime%+=600
opt$(0)="Remove picture."
opt$(1)="Make sprite"
opt$(2)="Double Jacquard, "
jac$(0)="Standard type."
jac$(1)="Elongated type."
jac$(2)="Jigsaw type."
res$(0)=", low res"
res$(1)=", high res"
res$(2)=", incl picture."
col$(2)=", 16 cols"
col$(3)=", 256 cols"
appsize%=
-&8000
heap%=0
&00000051
page%
k(-1,5)<>
k(-1,4)
l;toolspr%=
j("<KnitConv$Dir>.Resources.Sprites.Buttons")
m=titlespr%=
j("<KnitConv$Dir>.Resources.Sprites.TitleSpr")
o=toolspr%=
j("<KnitConv$Dir>.Resources.Sprites.Buttons22")
p?titlespr%=
j("<KnitConv$Dir>.Resources.Sprites.TitleSpr22")
&000400D9,,"<KnitConv$Dir>.Resources.Templates"
indsize%=0: i%=0
$name%="*"
&000400DB,,0,,,-1,name%,i%
,,size%,,,,i%
indsize%+=size%
i%=0
windowind% indsize%
info%=
i("Info",0)
main%=
i("Main",toolspr%)
report%=
i("Report",0)
zoom%=
i("Zoom",0)
#titlewin%=
i("Title",titlespr%)
colpic%=
i("ColPic",0)
#colpane%=
i("ColPane",toolspr%)
$infoversion%=version$
ab(titlewin%)
+in%=
("<KnitConv$Dir>.Resources.Pal16")
&0000000C,4,in%,pal16%,128
ob(imenu%,1)
ob(processmenu%,2)
ob(jacmenu%,3)
ob(spritemenu%,4)
8$option%="Please choose a conversion process > > >"
mb(main%,4,0,0)
$titleversion%=version$
$zoommul%="1"
$zoomdiv%="1"
mb(main%,1,1<<22,1<<22)
mb(main%,2,3<<24,15<<24)
mb(main%,3,1<<22,1<<22)
mb(main%,7,1<<24,15<<24)
tb(1)
block%!0=-1
block%!4=0:block%!8=0
block%!12=68:block%!16=68
block%!20=&301A
!$(block%+24)="!KnitConv"+
&000400C2,,block%
&000406C1
key%,icon%,whan%,processed%
whan%=block%!0
icon%=block%!4
key%=block%!24
processed%=
whan%
zoom%
icon%
key%
&18E,&18A,&18F,&19A,13
processed%=
icon%=1
"block%!0=zoom%: block%!4=icon%
&000400CE,,block%
p(zoom%,icon%,
$(block%!28))
key%<>&1CC
processed%=
key%
&18E,&18A,&18F,&19A
processed%=
icon%=0
"block%!0=zoom%: block%!4=icon%
&000400CE,,block%
p(zoom%,icon%,
$(block%!28))
&000400D4,0,-1
processed%=
key%<>&1CC
processed%=
processed%
&000400DC,key%
button%,window%,icon%,mx%,my%,x%,y%,r%
mx%=block%!0
my%=block%!4
button%=block%!8
window%=block%!12
icon%=block%!16
titleopen%=
button%=2
window%
-2:
rb(imenu%,block%!0-64,140+1*44)
main%:
icon%
rb(processmenu%,mx%,my%)
window%
ab(main%)
colpane%
yarncol%<>-1
mb(colpane%,yarncol%*3+1,0<<21,1<<21)
icon%
yarncol%=icon%/3
yarncol%=(icon%-2)/3
mb(colpane%,yarncol%*3+1,1<<21,1<<21)
report%
r(report%)
p(carb%,carb%!4,carb%!20)
z(w%,h%)
0,0,w%,h%
colpic%
icon%
yarncol%=-1
gb("Choose a background colour")
r(colpic%)
mb(main%,1,0<<22,1<<22)
mb(main%,2,7<<24,15<<24)
mb(main%,3,0<<22,1<<22)
tb(3)
&000400D2,main%,1,-1,-1,-1,
$(savepath%)
r(colpic%)
main%
icon%
(button%
&50)>0
button%=&10
adjust%=
adjust%=
$savespr%,8),icon%,main%)
button%=4
rb(processmenu%,mx%+32,my%-44)
helpon%=
&00041500,,"<KnitConv$Dir>.Resources.Messages"
,,len%
infobuff%=
a(16)
helpbuff%=
a(len%)
&00041501,infobuff%,"<KnitConv$Dir>.Resources.Messages",helpbuff%
helpon%=
&00042681,x%,block%,4500
task%=!(block%+4+x%*16)
r%=-1
:r%+=1:
task%?r%<32
task%?r%=13
x%+=1
(block%+4+x%*16>y%)
$task%="Help"
$task%<>"Help"
*Filer_Run Resources:$.Apps.!Help
&00041504,infobuff%
infobuff%=
d(infobuff%)
helpbuff%=
d(helpbuff%)
helpon%=
zoom%
icon%
ea(zoom%,0,999,1,button%,1)
ea(zoom%,0,999,1,button%,-1)
ea(zoom%,1,999,1,button%,1)
ea(zoom%,1,999,1,button%,-1)
sel%,subsel%,button%,mx%,my%
+"sel%=!block%: subsel%=block%!4
&000400CF,,block%
mx%=!block%: my%=block%!4
button%=block%!8
xa(menuopen%)
menuopen%
imenu%
sel%
rb(info%,mx%,my%)
processmenu%
opt%<>-1
yb(processmenu%,opt%)
opt%=sel%
ub(processmenu%,opt%)
$option%=opt$(opt%)
mb(main%,4,0,0)
mb(main%,7,7<<24,15<<24)
tb(2)
sel%
pb(1)
h(spritemenu%,0)=0
h(spritemenu%,1)=0
ub(spritemenu%,0)
h(spritemenu%,2)=0
h(spritemenu%,3)=0
ub(spritemenu%,2)
subsel%
yb(spritemenu%,0)
yb(spritemenu%,1)
restype%=subsel%
ub(spritemenu%,restype%)
yb(spritemenu%,2)
yb(spritemenu%,3)
coltype%=subsel%
ub(spritemenu%,coltype%)
xb(spritemenu%,subsel%)
$option%+=res$(restype%)
$option%+=col$(coltype%)
h(spritemenu%,4)=
$option%+=res$(2)
mb(main%,4,0,0)
pb(2)
jactype%<>0
yb(jacmenu%,jactype%) : jactype%=0
h(jacmenu%,0)=0
ub(jacmenu%,0)
subsel%<>-1
yb(jacmenu%,jactype%)
jactype%=subsel%
ub(jacmenu%,jactype%)
$option%+=jac$(jactype%)
mb(main%,4,0,0)
pb(1)
button%=1
rb(menuopen%,0,0)
more%,wx%,wy%,w%,h%,xx%,row%,stitch%,rh%,sw%
minx%,miny%,maxx%,maxy%,sminx%,smaxx%,sminy%,smaxy%,min%,max%,x%,y%
xc%,yc%,r%,g%,b%,rgb%,col%,column%
minrow%,maxrow%,minsqr%,maxsqr%,min%,max%,i%,xl%,xh%,yl%,yh%
scalex,scaley,scl%,num%,ymove%,xmove%
&000400C8,,block%
more%
more%
block%!0
colpane%
wx%=block%!4-block%!20
wy%=block%!16-block%!24
minx%=block%!28-wx%
maxx%=block%!36-wx%
miny%=block%!32-wy%+22
maxy%=block%!40-wy%+22
min%=miny%/76
max%=maxy%/76
max%+=1
max%>0
max%=0
min%<-(maxcol%)
min%=-(maxcol%)
minx%<90
i%=min%
max%
ct_setgcol%,paltable%!(-i%*4)
22+wx%,(i%-1)*76-24+10+wy%,66,60
&000400CA,,block%
more%
tb(var%)
var%
$disptext%=""
H$disptext%="Please choose a conversion process from the pop-up menu"
:$disptext%="Drag in the file you wish to convert ...."
P$disptext%="Name the new file then drag its icon to a directory window ...."
6$disptext%="Processing the file .... Please wait."
textdispvar%=var%
mb(main%,8,0,0)
exit%=
han%,len%,counter%,icon%
block%!16
block%!40
&0F0
opt% =-1
gb("Please choose a process before loading a file.")
counter%=block%+44
?counter%<>0
counter%+=1:
?counter%=13
na($(block%+44))
h(jacmenu%,2)=
manner%=2
gb("Grid only or Grid and picture type file required")
yarncol%=0
found%=
$(nametable%+yarncol%*13)="Background"
found%=
$(nametable%+yarncol%*13)="background"
found%=
$(nametable%+yarncol%*13)="BackGround"
found%=
$(nametable%+yarncol%*13)="Bkgnd"
found%=
$(nametable%+yarncol%*13)="BkGnd"
found%=
$(nametable%+yarncol%*13)="bkgnd"
found%=
$(nametable%+yarncol%*13)="background"
found%=
$(nametable%+yarncol%*13)="BackGround"
found%=
$(nametable%+yarncol%*13)="Main"
found%=
$(nametable%+yarncol%*13)="main"
found%=
yarncol%+=1
yarncol%>maxcol%
found%=
found%=
yarncol%-=1
mb(main%,1,0<<22,1<<22)
mb(main%,2,7<<24,15<<24)
mb(main%,3,0<<22,1<<22)
tb(3)
&000400D2,main%,1,-1,-1,-1,
$(savepath%)
yarncol%=-1 :
bb(colpic%)
mb(main%,1,0<<22,1<<22)
mb(main%,2,7<<24,15<<24)
mb(main%,3,0<<22,1<<22)
tb(3)
&000400D2,main%,1,-1,-1,-1,
$(savepath%)
han%=block%!20
&00000023,"KnitConv$Dir",block%+512,256,0,0
,,len%
block%?(512+len%)=13
#han%,"Run "+$(block%+512)
9,&400C1
&502
helpon%=
block%!40=block%!32
han%=block%!32
icon%=block%!36
da(han%,icon%)
na(file$)
&000406C0
(file$)
#in%,tension_sq_width$,tension_sq_height$
#in%,tension_sq_stitches$,tension_sq_rows$
#in%,tdset$
#in%,conv_rows$,ans_conv_rows$
#in%,conv_stitches$,ans_conv_stitches$
#in%,manner%
#in%,unitmenu%
#in%,grows$,gstitches$
#in%,gheight$,gwidth$
#in%,textdispvar%
#in%,main37%
#in%,main0%
#in%,mastergrey%
#in%,patstore1$,patstore2$
#in%,patstore3$,patstore4$
#in%,patstore5%
#in%,sclmul$,scldiv$
#in%,coltableon%,coltablesize%
coltableon%=1
!coltable%=
a(coltablesize%+8)
&0000000C,4,in%,coltable%,coltablesize%
coltable%=0
coltablesize%=0
#in%,nametableon%, nametablesize%
nametableon%=1
!nametable%=
a(nametablesize%)
&0000000C,4,in%,nametable%,nametablesize%
nametable%=0
nametablesize%=0
#in%,paltableon%, paltablesize%
paltableon%=1
paltable%=
a(paltablesize%)
&0000000C,4,in%,paltable%,paltablesize%
paltable%=0
paltablesize%=0
#in%,pictype$
pictype$
"sprite"
#in%,spritelen%,spritename$,spriteon%
sourcespr%=
a(spritelen%)
&0000000C,4,in%,sourcespr%,spritelen%
&0000002E,&10D,sourcespr%,block%,&100,1
,,,name_len%
block%?name_len%=13
sprite$=$block%
sarealen%=!sourcespr%
&0000002E,&118,sourcespr%,sprite$
,,sourceaddr%
&0000002E,&228,sourcespr%,sourceaddr%
,,,spx%,spy%,,mode%
k(mode%,4)
k(mode%,5)
spx%=spx%<<xe%
spy%=spy%<<ye%
"draw"
#in%,drawlen%
draw%=
a(drawlen%)
&0000000C,4,in%,draw%,drawlen%
drawx%=draw%!32-draw%!24
drawy%=draw%!36-draw%!28
drawxoffset%=draw%!24
drawyoffset%=draw%!28
spx%=drawx%>>8
spy%=drawy%>>8
#in%,gridlinecol%
#in%,gridcol%
#in%,backcol%
#in%,maxcol%
#in%,rulerbcol%
#in%,rulerfcol%
#in%,pagerulers%
#in%,manner%
&000406C1
jb(file$)
out%
out%=
(file$)
#out%,tension_sq_width$,tension_sq_height$
#out%,tension_sq_stitches$,tension_sq_rows$
#out%,tdset$
#out%,conv_rows$,ans_conv_rows$
#out%,conv_stitches$,ans_conv_stitches$
#out%,manner%
#out%,unitmenu%
#out%,grows$,gstitches$
#out%,gheight$,gwidth$
#out%,textdispvar%
#out%,main37%
#out%,main0%
#out%,mastergrey%
#out%,patstore1$,patstore2$
#out%,patstore3$,patstore4$
#out%,patstore5%
#out%,sclmul$,scldiv$
coltable%<>0
#out%,1,coltablesize%
&0000000C,2,out%,coltable%,coltablesize%
#out%,0,0
nametable%<>0
manner%<>2
#out%,1,nametablesize%
&0000000C,2,out%,nametable%,nametablesize%
#out%,0,0
paltable%<>0
#out%,1,paltablesize%
&0000000C,2,out%,paltable%, paltablesize%
#out%,0,0
#out%,pictype$
pictype$
"sprite"
#out%,spritelen%,spritename$,spriteon%
&0000000C,2,out%,sourcespr%,spritelen%
"draw"
#out%,drawlen%
&0000000C,2,out%,draw%,drawlen%
#out%,gridlinecol%
#out%,gridcol%
#out%,backcol%
#out%,maxcol%
#out%,rulerbcol%
#out%,rulerfcol%
#out%,pagerulers%
#out%,manner%
#out%
("SetType "+file$+" 0F0")
&000406C1
pb(type%)
type%
$savespr%="Sfile_0F0"
mb(main%,3,0,0)
ftype%=&0F0
fsize%=99
$savepath%="Result"
mb(main%,1,0,0)
$savespr%="Sfile_FF9"
mb(main%,3,0,0)
ftype%=&FF9
fsize%=99
$savepath%="Sprite"
mb(main%,1,0,0)
$savepath%,".")
ib($savepath%)
gb("To save, drag the icon to a directory viewer")
ib(fname$)
item%
tb(4)
&000406C3,1
opt%
sb(fname$)
sa(fname$)
ja(fname$)
&000406C1
&00042401
&000400CF,,block%
block%!20=block%!12
block%!24=block%!16
block%!28=block%!0
block%!32=block%!4
block%!36=fsize%
block%!0=64:block%!12=0
block%!16=1:block%!40=ftype%
$(block%+44)=
f($savepath%)
&000400E7,17,block%,block%!20,block%!24
block%!12=block%!8
block%!16=4
&000400E7,17,block%,block%!4
g(name$)
name$,".")
name$=
name$,
name$,".")+1)
=name$
f(name$)
name$,".")
name$=
name$,
name$,".")+1)
=name$+
b%,a%,word%,fullname$
fullname$=""
word%=0
508
4:block%!(512+word%)=block%!word%:
word%
b%=block%?(44+a%)
b%<>0
fullname$+=
a%+=1
b%=block%?(44+a%)
ib(fullname$)
word%=0
508
4:block%!word%=block%!(512+word%):
word%
block%!12=block%!8
block%!16=3:!block%=256
&000400E7,18,block%,block%!20,block%!24
F!block%=main%:block%!4=3:
&000400CE,,block%: savespr%=block%!32
!titleversion%=
e(titlewin%,6)
infoversion%=
e(info%,4)
rep%=
e(report%,1)
savepath%=
e(main%,1)
option%=
e(main%,4)
disptext% =
e(main%,8)
zoommul%=
e(zoom%,0)
zoomdiv%=
e(zoom%,1)
=!block%=main%:
&000400CC,,block%: maintitle%=block%!76
e(whan%,icon%)
"block%!0=whan%: block%!4=icon%
&000400CE,,block%
=block%!28
xef%,yef%,size%
xef%=
k(-1,4)
yef%=
k(-1,5)
!xpix%=1<<xef%: xpix2%=2<<xef%
!ypix%=1<<yef%: ypix2%=2<<yef%
mb(whan%,icon%,e%,c%)
%block%!900=whan%:block%!904=icon%
block%!908=e%:block%!912=c%
wimp_setistate%,,block%+900
k(mode%,var%)
result%
&00000035,mode%,var%
,,result%
=result%
p(whan%,icon%,index%)
&000400D2,whan%,icon%,-1,-1,-1,index%
&000400D3,,carb%
answer%
!block%=
.$(block%+4)=
$+" (Error code "+
)+")"+
&000400DF,block%,3,"KnitConv"
,answer%
answer%=2
&000400DD:
r(whan%)
whan%
main%
mainopen%=
colpic%
colpicopen%=
!block%=colpane%
&000400C6,,block%
!block%=whan%
&000400C6,,block%
gb(report$)
w%,h%
$rep%=report$
&000400D3,,carb%
ab(report%)
&000400D2,report%,-1,0,0,0,0
&000400E0,,block%
w%=block%!12-block%!4
h%=block%!16-block%!8
block%!4+w%/2,block%!8+h%/2
block%!4,block%!8,w%-xpix%,h%-ypix%
kb(message$)
block%!12=block%!8
block%!16=&503
$(block%+20)=message$
!block%=256
&000400E7,17,block%,block%!4
w(sprite$,icon%,whan%)
ox%,oy%
!block%=whan%
&000400CB,,block%
ox%=block%!4-block%!20
oy%=block%!16-block%!24
block%!4=icon%
&000400CE,,block%
block%!8=ox%+block%!8
block%!12=oy%+block%!12
block%!16=ox%+block%!16
block%!20=oy%+block%!20
&00042400,%11000101,1,sprite$,block%+8
fontdata%=
a(&100)
f%=fontdata%
fontdata%+252
4:!f%=0:
f%=0
fontdata%?f%>0
fontdata%?f%-=1
&00040082,f%
fontdata%=
d(fontdata%)
lb(block%,minx%,miny%,maxx%,maxy%)
block%! 0=minx%
block%! 4=miny%
block%! 8=maxx%
block%!12=maxy%
xp%,yp%
&00000035,-1,4
,,xp%
&00000035,-1,5
,,yp%
&00000035,-1,11
,,x%
&00000035,-1,12
,,y%
x%=(x%+1)<<xp%
y%=(y%+1)<<yp%
aa(block%,
x%=block%!8-block%!0
y%=block%!12-block%!4
ab(hand%)
x%,y%,wx%,wy%
!block%=hand%
&000400CB,,block%
z(x%,y%)
aa(block%+4,wx%,wy%)
x%=x%>>1
y%=y%>>1
wx%=wx%>>1
wy%=wy%>>1
lb(block%+4,x%-wx%,y%-wy%,x%+wx%,y%+wy%)
block%!28=-1
&000400C5,,block%
bb(handle%)
block%!0=handle%
handle%
main%
mainopen%=
&000400CB,,block%
block%!28=-1
colpic%
colpicopen%=
&000400CB,,block%
block%!28=-1
&000400CB,,block%
&000400C5,,block%
!block%=colpic%
colpicopen%=
block%!100=colpane%
&000400CB,,block%+100
block%!104=block%!4+42
block%!112=block%!104+362
block%!116=block%!16-90
block%!108=block%!116-360
block%!128=block%!28
&000400C5,,block%+100
block%!28=colpane%
&000400C5,,block%
&000400C5,,block%
i%,colour%,maxicon%,space%
space%=block%+3000
!space%=colpane%
&000400CC,,space%
#space%!(4+44)=-(124+maxcol%*76)
space%!(4+44)>-300
space%!(4+44)=-300
&000400D7,colpane%,space%+44
i%=0
%block%!(1004+i%)=space%!(4+88+i%)
i%=0
(block%!(1044+i%)=space%!(4+88+32+i%)
i%=0
(block%!(1084+i%)=space%!(4+88+64+i%)
maxicon%=(space%!(4+84))
block%!(2000)=colpane%
maxicon%>-1
block%!(2000+4)=maxicon%
&000400C4,,block%+2000
maxicon%-=1
Dblock%!1000=colpane%: block%!1040=colpane%: block%!1080=colpane%
colour%=0
colour%<=maxcol%
&000400C2,,block%+1000
&000400C2,,block%+1040
%block%!1104=nametable%+colour%*13
&000400C2,,block%+1080
$block%!1008-=76: block%!1016-=76
$block%!1048-=76: block%!1056-=76
$block%!1088-=76: block%!1096-=76
colour%+=1
i%=0
maxcol%
mb(colpane%,i%*3+1,0<<21,1<<21)
ea(whan%,icon%,max%,min%,button%,inc%)
var%,index%
"block%!0=whan%: block%!4=icon%
&000400CE,,block%
:var%=
($(block%!28))-(button%=4)*inc%+(button%=1)*inc%
var%>max%
var%=max%:
var%<min%
var%=min%:
$(block%!28)=
(var%)
block%!8=0: block%!12=0
&000400CD,,block%
carb%!0=whan%
carb%!4=icon%
index%=carb%!20
index%>
(var%))
index%=
(var%))
p(whan%,icon%,index%)
block%!1000=titlewin%
&000400C3,,block%+1000
titlewin%=0:mask%=mask%
titlespr%=
d(titlespr%)
titleopen%=
titleopen%=
i(ident$,sprites%)
whan%
$name%=ident$
&000400DB,,block%,windowind%,windowind%+indsize%,fontdata%,name%,0
,,windowind%
sprites%<>0
block%!64=sprites%
&000400C1,,block%
whan%
=whan%
da(han%,icon%)
ptr%,len%,text$,i%,item%,tok$
han%
main%
tok$="main"
icon%
report%: tok$="report": icon%=-1
info%: tok$="info": icon%=-1
zoom%: tok$="zoom": icon%=-1
-2: tok$="ibar": icon%=-1
titlewin%: tok$="titlewin": icon%=-1
colpic%,colpane%
tok$="colpic"
icon%<>1
icon%=-1
&000400F4,0,block%+800
'sel%=block%!800: subsel%=block%!804
subsubsel%=block%!808
icon%=sel%
menuopen%
imenu%
tok$="imenu"
processmenu%
tok$="processmenu"
sel%
subsel%
0,1,2,3,4,5 : tok$="spritemenu": icon%=subsel%
subsel%
0,1,2 : tok$="jacmenu": icon%=subsel%
icon%<>-1
tok$=tok$+
(icon%)
&00041502,infobuff%,tok$,0
,,ptr%,len%
text$=""
i%=0
len%-1
text$+=
(ptr%?i%)
kb(text$)
ob(menu%,menunum%)
num%,width%,ptr%,i%,item$
Menu#,1
KnitConv
&00,info%,Info
&80,-1,Quit
Menu#,2
Processes
&00,-1,Remove picture
&00,spritemenu%,Make sprite
&80,jacmenu%,Double Jacquard
Menu#,3
Jacquard
&00,-1,Standard
&00,-1,Elongated
&80,-1,Jigsaw
Menu#,4
Sprite
&00,-1,Low res
&00,-1,High res
&00,-1,16 Colours
&02,-1,256 Colours
&00,-1,Include picture
&80,zoom%,Scale
item$
item$="Menu#"
num%
num%=menunum%
$menu%
width%=(
($menu%)-2)*16
?-menu%!12=&00070207:menu%!20=44:menu%!24=0
ptr%=menu%+28
!ptr%:
ptr%!4
ptr%!8=&7000021:
item$
(item$)+1)*16>width%
width%=(
(item$)+1)*16
(item$)<12
$(ptr%+12)=item$
ptr%!8=&7000121
IGptr%!12=menuindfree%: $menuindfree%=item$: menuindfree%+=
(item$)+1
J(ptr%!16=menuind%: ptr%!20=
(item$)+1
menuindfree%>menuind%+menuindsize%
0,"Increase menuindsize% (in PROCinit)"
ptr%+=24
(!(ptr%-24)
&80)<>0
menu%!16=width%
rb(menu%,mx%,my%)
menuopen%=menu%
menuopen%
processmenu% :
db(mx%,my%)
mx%+=2
my%+=44
&000400D4,,menu%,mx%,my%
xb(menu%,item%)
_9?(menu%+28+item%*24)=(?(menu%+28+item%*24)
ub(menu%,item%)
c1?(menu%+28+item%*24)=?(menu%+28+item%*24)
yb(menu%,item%)
g9?(menu%+28+item%*24)=(?(menu%+28+item%*24)
xa(except%)
var%
except%
var%=0
ilist%
yb(imenu%,var%)
var%
var%=0
proclist%
yb(processmenu%,var%)
var%
var%=0
jaclist%
yb(jacmenu%,var%)
var%
var%=0
sprlist%
yb(spritemenu%,var%)
var%
imenu%
var%=0
proclist%
yb(processmenu%,var%)
var%
var%=0
jaclist%
yb(jacmenu%,var%)
var%
var%=0
sprlist%
yb(spritemenu%,var%)
var%
processmenu%
var%=0
ilist%
yb(imenu%,var%)
var%
var%=0
jaclist%
yb(jacmenu%,var%)
var%
jacmenu%
var%=0
ilist%
yb(imenu%,var%)
var%
var%=0
proclist%
yb(processmenu%,var%)
var%
var%=0
sprlist%
yb(spritemenu%,var%)
var%
spritemenu%
var%=0
ilist%
yb(imenu%,var%)
var%
var%=0
proclist%
yb(processmenu%,var%)
var%
var%=0
jaclist%
yb(jacmenu%,var%)
var%
wb(menu%,item%)
??(menu%+38+item%*24)=(?(menu%+38+item%*24)
0<<6)
1<<6
qb(menu%,item%,shade%)
D?(menu%+38+item%*24)=(?(menu%+38+item%*24)
1<<6)
shade%<<6
h(menu%,item%)
"=(?(menu%+28+item%*24)
1)<>0
mx%,
my%)
c%,ox%,oy%,vaminx%,vamaxy%,miny%,maxx%
scrollxoffset%,scrollyoffset%
c%=block%+800
c%!0=main%
&000400CB,,c%
vaminx%=c%!4
vamaxy%=c%!16
scrollxoffset%=c%!20
scrollyoffset%=c%!24
ox%=vaminx%-scrollxoffset%
oy%=vamaxy%-scrollyoffset%
c%!0=main%
c%!4=5
&000400CE,,c%
miny%=c%!12
maxx%=c%!16
mx%=ox%+maxx%
my%=oy%+miny%
j(a$)
a%,l%,s%
#a%+4
a(l%)
!s%=l%
&0000002E,&10A,s%,a$
a(size%)
errflag%=0
heap%=0
nb(size%+16)
errflag%
&0002001D,1,heap%
,,free%
free%<size%
ca(size%,1)
errflag%
&0002001D,2,heap%,,size%
,,ptr%
errflag%
=ptr%
d(ptr%)
&0002001D,3,heap%,ptr%
size%,x%,s%
&0002001D,1,heap%
,,size%
size%=(size%
page%)*page%
size%
&0002001D,5,heap%,,-size%
,,,s%;flag%
flag%
x%=(s%
page%)*page%
s%-x%
&0002001D,5,heap%,,s%-x%
x%=size%
&000400EC,appsize%-x%,-1
appsize%-=x%:heapsize%-=x%
ptr%,size%)
flag%
errflag%=0:
&0002001D,4,heap%,ptr%,size%
,,ptr%;flag%
flag%
ca(page%,1)
(flag%
1)=0
errflag%=
errflag%
size%<0
ca(mem%,x%)
new%
&000400EC,appsize%+mem%,-1
new%
new%<appsize%+mem%
errflag%=
&000400EC,appsize%,-1
1<<30,"Not enough memory"
&0002001D,5,heap%,,new%-appsize%
heapsize%=new%+&8000-
appsize%=new%
nb(initsize%)
ca(initsize%,0)
errflag%
heap%=
&0002001D,0,heap%,,heapsize%
v(line%,mess$,var)
mess$=
mess$,14)
var$=
(var)
u(line%,mess$+
(mess$)-
(var$)," ")+var$)
u(line%,mess$)
&00000024,"db$mess","XX"
&00000024,"db$mess"+
(line%),mess$
n(berty$)
berty%
bertyfile%=
&berty%=
("<KnitConv$Dir>.^.Berty")
#berty%
("SetType<KnitConv$Dir>.^.Berty Text")
bertyfile%=
"&berty%=
("<KnitConv$Dir>.^.Berty")
#berty%=
#berty%
#berty%,""
#berty%,berty$
#berty%
'%*Filer_Run <KnitConv$Dir>.^.Berty
sb(fname$)
manner%
grows$=ans_conv_rows$
.!gstitches$=ans_conv_stitches$
ans_conv_rows$="0"
ans_conv_stitches$="0"
conv_rows$="0.0"
conv_stitches$="0.0"
3=gheight$=
(tension_sq_height$))/(
(tension_sq_rows$)))
4?gwidth$=
(tension_sq_width$))/(
(tension_sq_stitches$)))
tension_sq_width$="0.0"
tension_sq_height$="0.0"
tension_sq_stitches$="0"
tension_sq_rows$="0"
textdispvar%=6
main37%=0
mastergrey%=4
pictype$="none"
manner%=0
jb(fname$)
gb("There is no picture to remove from this file")
sa(fname$)
wx%,wy%,ninx%,maxx%,miny%,maxy%,sminx%,smaxx%,sminy%,smaxy%
xc%,yc%,extrawidth%,scraddr%,savsize%,savarea%,r0%,r1%,r2%,r3%
sw%,rh%,y%,x%,xx%,w%,col%,yl%,yh%,xl%,xh%,min%,max%,row%,stitch%
scl%,nummin%,nummax%,num%,xmove%,ymove%,symb%
K wx%=0
wy%=scrheight%
minx%=0: maxx%=scrwidth%
miny%=0: maxy%=scrheight%
sminx%=0
smaxx%=gridwidth%
sminy%=0
smaxy%=gridheight%
xc%=wx%+rulesize%
yc%=wy%-editht%+rulesize%
UBextrawidth%=4-(scrwidth%
4):
extrawidth%=4
extrawidth%=0
V3scrsize%=(scrwidth%+extrawidth%)*scrheight%+200
scrarea%=
a(scrsize%)
!scrarea%=scrsize%
scrarea%!8=16
&0000002E,256+9,scrarea%
scrmode%=12
scrmode%=20
palflag%=1
palflag%=0
&0000002E,256+15,scrarea%,"screen",palflag%,scrwidth%,scrheight%,scrmode%
&0000002E,&118,scrarea%,"screen"
,,scraddr%
scrmode%=12
scrmode%=20
i%=0
124
!(scraddr%+44+i%)=pal16%!i%
&0000002E,512+62,scrarea%,scraddr%
,,,savsize%
savarea%=
a(savsize%)
savarea%!0=0
&0000002E,512+60,scrarea%,scraddr%,savarea%
r0%,r1%,r2%,r3%
&000406C2:
&0000002E,r0%,r1%,r2%,r3%:
scrmode%=12
scrmode%=15
23,17,7,%10,8;8;0,0
23,17,7,%10,8;16;0,0
ct_setgcol%,
l(backcol%),,,1<<7
spriteon%=
pictype$
"sprite"
block%!100=xc%<<8
r(block%!104=(yc%+gridheight%*rht%)<<8
s'block%!108=(xc%+gridwidth%*stw%)<<8
t(block%!112=(yc%+gridheight%*rht%)<<8
u'block%!116=(xc%+gridwidth%*stw%)<<8
block%!120=yc%<<8
block%!124=xc%<<8
block%!128=yc%<<8
&0000002E,&238,sourcespr%,sourceaddr%,1,0,0,block%+100,transtable%
"draw"
|,scalex=(((gridwidth%*stw%)<<8)/(drawx%))
}/scaley=(((gridheight%*rht%)<<8)/(drawy%-1))
transform%!0 =scalex*65536
transform%!4 =0
transform%!8 =0
transform%!12=scaley*65536
.transform%!16=(xc%<<8)-drawxoffset%*scalex
.transform%!20=(yc%<<8)-drawyoffset%*scaley
&00045540,0,draw%,drawlen%,transform%,0
manner%
sw%=stw%+xpix2%*(gridon%=
rh%=rht%+ypix2%*(gridon%=
y%=yc%-ypix%*(gridon%=
xx%=xc%-xpix%*(gridon%=
w%=sminx%
smaxx%-1:x%=xx%+w%*stw%
h%=sminy%
smaxy%-1:col%=coltable%?(h%*gridwidth%+w%):
showmask%col%=col%
(col%
192)=0
ct_setgcol%,paltable%!((col%
63)*4):
x%,y%+h%*rht%,sw%,rh%
&000406C4,((80*w%)
gridwidth%)
ct_setgcol%,
l(gridcol%)
,yl%=yc%+sminy%*rht%: yh%=yc%+smaxy%*rht%
x%=sminx%
smaxx%
xc%+x%*stw%,yl%
xc%+x%*stw%,yh%
&000406C4,84
,xl%=xc%+sminx%*stw%: xh%=xc%+smaxx%*stw%
y%=sminy%
smaxy%
xl%,yc%+y%*rht%
xh%,yc%+y%*rht%
&000406C4,88
ct_setgcol%,
l(forecol%)
min%=0
max%=gridheight%
min%=min%
max%=max%
row%=min%
max%
x%=xc%
y%=yc%+row%*rht%*10+16
x%+(16*(row%>0))+(16*(row%>9))-40,y%
;row%*10
x%-20,y%-16
x%,y%-16
row%
&000406C4,92
max%=gridheight%
min%=0
min%=min%
max%=max%
row%=min%
max%
x%=xc%+24+gridwidth%*stw%
y%=row%*rht%*10+yc%+16
x%,y%
;row%*10
x%-4,y%-16
x%-24,y%-16
row%
&000406C4,96
max%=gridwidth%
min%=0
min%=min%
max%=max%
stitch%=min%
max%
x%=xc%+stitch%*stw%*10
y%=yc%-24
x%+(16*(stitch%>0))+(8*(stitch%>9)),y%
;stitch%*10
x%,y%+4
x%,y%+20
stitch%
&000406C4,99
max%=gridwidth%
min%=0
min%=min%
max%=max%
stitch%=min%
max%
x%=xc%+stitch%*stw%*10
y%=yc%+gridheight%*rht%
x%+(16*(stitch%>0))+(8*(stitch%>9)),y%+44
;stitch%*10
x%,y%
x%,y%+16
stitch%
scl%=(stw%-30)/2
nummin%=sminx%-1
nummax%=smaxx%+1
nummin%-=nummin%
nummin%<0
nummin%=0
nummax%>gridwidth%
nummax%=gridwidth%
x%=nummin%
nummax%
2=0
x%<=gridwidth%/2
num%=gridwidth%/2-x%
num%
2=1
num%-=1 : xmove%=stw%
xmove%=0
ct_setgcol%,
l(forecol%)
num%
12=0
ct_setgcol%,
l(11)
ct_setgcol%,
l(gridcol%)
num%=0
xc%+(gridwidth%/2)*stw%-8,yc%-4
;num%
xc%+(gridwidth%/2)*stw%-8,yc%+gridheight%*rht%+32
;num%
num%<10
xmove%+=8
xc%+x%*stw%+xmove%+scl%,yc%-4
;num%
xc%+x%*stw%+xmove%+scl%,yc%+gridheight%*rht%+32
;num%
num%=x%-gridwidth%/2
num%
2=1
num%-=1 : xmove%=stw%
xmove%=0
num%
12=0
ct_setgcol%,
l(11)
ct_setgcol%,
l(gridcol%)
num%<10
xmove%-=8
xc%+(x%-1)*stw%-xmove%+scl%,yc%-4
num%<>0
;num%
xc%+(x%-1)*stw%-xmove%+scl%,yc%+gridheight%*rht%+32
num%<>0
;num%
nummin%=sminy%-1
nummax%=smaxy%+1
nummin%-=nummin%
nummax%+=nummax%
nummin%<0
nummin%=0
nummax%>gridheight%
nummax%=gridheight%
y%=nummin%
nummax%
y%=0
ymove%=12
ymove%=-scl%
y%<10
xmove%=16
xmove%=0
y%>99
xmove%=-16
10=0
ct_setgcol%,
l(11)
ct_setgcol%,
l(gridcol%)
xc%-36+xmove%,yc%+y%*rht%-2+ymove%
xc%+gridwidth%*stw%+4,yc%+y%*rht%-2+ymove%
ct_setgcol%,
l(gridcol%)
,yl%=yc%+sminy%*rht%: yh%=yc%+smaxy%*rht%
x%=sminx%
smaxx%
(gridwidth%/2-x%)
12=0
ct_setgcol%,
l(11)
ct_setgcol%,
l(gridcol%)
xc%+x%*stw%,yl%
xc%+x%*stw%,yh%
,xl%=xc%+sminx%*stw%: xh%=xc%+smaxx%*stw%
y%=sminy%
smaxy%
10=0
ct_setgcol%,
l(11)
ct_setgcol%,
l(gridcol%)
xl%,yc%+y%*rht%
xh%,yc%+y%*rht%
%'transform%!0 =(edmul%/eddiv%)*65536
transform%!4 =0
transform%!8 =0
('transform%!12=(edmul%/eddiv%)*65536
y%=yc%-ypix%*(gridon%=
xx%=xc%-xpix%*(gridon%=
w%=sminx%
smaxx%-1:x%=xx%+w%*stw%:transform%!16=x%<<8:
h%=sminy%
smaxy%-1:symb%=coltable%?(h%*gridwidth%+w%)
(symb%
128)=0
-!transform%!20=(y%+h%*rht%)<<8
&00045540,0,symbpoint%!(symb%*4),symbsize%!(symb%*4),transform%,0
&0000002E,r0%,r1%,r2%,r3%
&0000002E,256+12,scrarea%,fname$
l(wimpcol%)
wimpcol%
0: rgb%=&FFFFFF00
1: rgb%=&DDDDDD00
2: rgb%=&BBBBBB00
3: rgb%=&99999900
4: rgb%=&77777700
5: rgb%=&55555500
6: rgb%=&33333300
7: rgb%=&00000000
8: rgb%=&99440000
9: rgb%=&00EEEE00
10:rgb%=&00CC0000
11:rgb%=&0000DD00
12:rgb%=&BBEEEE00
13:rgb%=&00885500
14:rgb%=&00BBFF00
15:rgb%=&FFBB0000
J =rgb%
wimppal%!0= &FFFFFF00
wimppal%!4= &DDDDDD00
wimppal%!8= &BBBBBB00
wimppal%!12= &99999900
wimppal%!16= &77777700
wimppal%!20= &55555500
wimppal%!24= &33333300
wimppal%!28= &00000000
wimppal%!32= &99440000
wimppal%!36= &00EEEE00
wimppal%!40= &00CC0000
wimppal%!44= &0000DD00
wimppal%!48= &BBEEEE00
wimppal%!52= &00885500
wimppal%!56= &00BBFF00
wimppal%!60= &FFBB0000
coltable%<>0
coltable%=
d(coltable%)
nametable%<>0
nametable%=
d(nametable%)
paltable%<>0
paltable%=
d(paltable%)
sourcespr%<>0
sourcespr%=
d(sourcespr%)
draw%<>0
draw%=
d(draw%)
scrarea%<>0
scrarea%=
d(scrarea%)
transtable%<>0
transtable%=
d(transtable%)
symbstore%<>0
symbstore%=
d(symbstore%)
symbpoint%<>0
symbpoint%=
d(symbpoint%)
symbsize%<>0
symbsize%=
d(symbsize%)
descinfobuff%<>0
descinfobuff%=
d(descinfobuff%)
descbuff%<>0
descbuff%=
d(descbuff%)
extradescinfobuff%<>0
extradescinfobuff%=
d(extradescinfobuff%)
extradescbuff%<>0
extradescbuff%=
d(extradescbuff%)
colorder%<>0
colorder%=
d(colorder%)
o(jactype%=0 : restype%=0 : coltype%=2
&000400D2,-1,-1
mb(main%,1,1<<22,1<<22)
mb(main%,2,3<<24,15<<24)
mb(main%,3,1<<22,1<<22)
mb(main%,7,1<<24,15<<24)
opt%=-1
y8$option%="Please choose a conversion process > > >"
mb(main%,4,0,0)
tb(1)
xa(-1)
(tension_sq_stitches$)<>0
stitch_width=
(tension_sq_width$)/
(tension_sq_stitches$)
stitch_width=0
(tension_sq_rows$)<>0
row_height=
(tension_sq_height$)/
(tension_sq_rows$)
row_height=0
manner%
stitchwidth=
gwidth$)
rowht=
gheight$)
stitchwidth%=
(stitchwidth)
rowht%=
(rowht)
gridwidth%=
gstitches$
gridheight%=
grows$
spriteon%=
"gridwidth%=
ans_conv_stitches$
gridheight%=
ans_conv_rows$
stitchwidth=
b(stitch_width)
rowht=
b(row_height)
stitchwidth%=
(stitchwidth)
rowht%=
(rowht)
spriteon%=
h(spritemenu%,4)
gridwidth%=
gstitches$
gridheight%=
grows$
rowht%=30
stitchwidth%=30
rowht=30: rht%=30
stitchwidth=30: stw%=30
spriteon%=
edmul%=
$zoommul%
eddiv%=
$zoomdiv%
/stitchwidth%=
((stitchwidth*edmul%)/eddiv%)
#rowht%=
((rowht*edmul%)/eddiv%)
stw%=stitchwidth%
rht%=rowht%
gridon%=
showmask%=
rulesize%=80
tbarht%=00
backcol%
4,5,6,7,8,10,11,13
forecol%=0
forecol%=7
rht%=rowht%
stw%=stitchwidth%
manner%=2
h(spritemenu%,0)=
h(spritemenu%,2)
scrmode%=12
scrmode%=15
h(spritemenu%,2)
scrmode%=20
scrmode%=21
xef%=
k(scrmode%,4)
yef%=
k(scrmode%,5)
!xpix%=1<<xef%: xpix2%=2<<xef%
!ypix%=1<<yef%: ypix2%=2<<yef%
9scrwidth%=(gridwidth%*stitchwidth%+2*rulesize%)>>xef%
5scrheight%=(gridheight%*rowht%+2*rulesize%)>>yef%
editht%=scrheight%
pictype$="sprite"
scrmode%=12
scrmode%=20
palpoint%=wimppal%
palpoint%=0
&00040740,sourcespr%,sourceaddr%,scrmode%,palpoint%,0,1,0,0
,,,,size%
transtable%=
a(size%)
&00040740,sourcespr%,sourceaddr%,scrmode%,palpoint%,transtable%,1,0,0
b(cm)
factor
unitmenu%=
factor=180
factor=70.866
=cm*factor
i%,c%,size%,num%,oldi%,ptr%,pochle%,extrasymb%,extrasize%,extranum%,extrai%,flags%
&00000029,28,"<KnitConv$Dir>.Resources.Symbols.*"
,,size%,num%
&00000029,28,"<KnitConv$Dir>.Resources.Symbols.Describe"
,,i%
num%-=1
&00020029,28,"<KnitConv$Dir>.^.Symbols.*"
,,extrasize%,extranum%;flags%
(flags%
1)=1
extrasize%=0:extranum%=0
extrasymb%=
extrasymb%=
&00020029,28,"<KnitConv$Dir>.^.Symbols.Describe"
,,extrai%;flags%
(flags%
1)=1
extrai%=0
extranum%-=1:
extranum%<0
extranum%=0
symbmax%=num%+extranum%-1
i%+=extrai%
&symbstore%=
a(size%+extrasize%-i%)
%symbpoint%=
a((num%+extranum%)*4)
$symbsize%=
a((num%+extranum%)*4)
nametable%<>0
nametable%=
d(nametable%)
&nametable%=
a((num%+extranum%)*11)
&0000000C,9,"<KnitConv$Dir>.Resources.Symbols",block%,num%+1,0,3000,"*"
!i%=0 : oldi%=block%:pochle%=0
c%=0
num%
block%?i%<>0
i%+=1
block%?i%=13
$(oldi%)="Describe"
pochle%=1
*$(nametable%+(c%-pochle%)*11)=$(oldi%)
i%+=1
oldi%=block%+i%
c%=0: pochle%=0
i%=0
num%-1
Apath$="<KnitConv$Dir>.Resources.Symbols."+$(nametable%+i%*11)
&00000008,&FF,path$,symbstore%+c%,0
,,,,size%
#symbpoint%!(i%*4)=symbstore%+c%
symbsize%!(i%*4)=size%
c%+=size%
extrasymb%=
ptr%=c%
&0000000C,9,"<KnitConv$Dir>.^.Symbols",block%,extranum%+1,0,3000,"*"
!i%=0 : oldi%=block%:pochle%=0
c%=num%
num%+extranum%
block%?i%<>0
i%+=1
block%?i%=13
$(oldi%)="Describe"
pochle%=1
*$(nametable%+(c%-pochle%)*11)=$(oldi%)
i%+=1
oldi%=block%+i%
c%=ptr%: pochle%=0
i%=num%
num%+extranum%-1
9path$="<KnitConv$Dir>.^.Symbols."+$(nametable%+i%*11)
&00000008,&FF,path$,symbstore%+c%,0
,,,,size%
#symbpoint%!(i%*4)=symbstore%+c%
symbsize%!(i%*4)=size%
c%+=size%
ja(fname$)
colnum%,toprow%,blank%,line%,stitch%,ntablesize%,ntable%,newrow%,newrows%
colorder%,nextcol%,colsfound%,col%,newline%,dups%,bigtable%,i%,oldrow%,row%
manner%=2
gb("Sorry, the make jacquard process only works with 'Grid only' or 'Grid & picture' EasyKnit files.")
h(jacmenu%,2)=
colnum%=
toprow%=0
blank%=
line%=gridheight%-1
stitch%=0
?(coltable%+line%*gridwidth%+stitch%)<128
blank%=
stitch%+=1
stitch%=gridwidth%
blank%=
line%-=1
line%=-1
blank%=
toprow%=line%+2
2*ntablesize%=gridwidth%*toprow%*colnum%
3#ntablesize%=ntablesize%*double%
ntable%=
a(ntablesize%)
colorder%=
a(colnum%)
col%=0
colnum%-1
colorder%?col%=255
col%
line%=0
nextcol%=0
colsfound%=0
stitch%=0
?.col%=?(coltable%+line%*gridwidth%+stitch%)
col% < 128
col%=col%
found%=
colorder%?i%<>255
colorder%?i%=col%
found%=
F i%+=1
found%=
colorder%?i%=col%: colsfound%+=1
stitch%+=1
stitch%= gridwidth%
colsfound%=colnum%
line%+=1
line%=toprow%
colsfound%=colnum%
tot%=toprow%*gridwidth%
done%=0
line%=0
toprow%-1
stitch%= 0
gridwidth%-1
newline%=0
colnum%-1
coltable%?(line%*gridwidth%+stitch%)=colorder%?newline%
TV?(ntable%+line%*gridwidth%*colnum%+newline%*gridwidth%+stitch%)=colorder%?newline%
VG?(ntable%+line%*gridwidth%*colnum%+newline%*gridwidth%+stitch%)=128
newline%
done%+=1
&000406C4,((100*done%)
tot%)
stitch%
line%
double%=2
oldrow%=(toprow%*colnum%)
newrow%=oldrow%*2
tot%=newrow%*gridwidth%
done%=0
row%=newrow%-1
oldrow%-=1
stitch%=0
gridwidth%-1
eJntable%?(row%*gridwidth%+stitch%)=ntable%?(oldrow%*gridwidth%+stitch%)
fNntable%?((row%-1)*gridwidth%+stitch%)=ntable%?(oldrow%*gridwidth%+stitch%)
done%+=1
&000406C4,((100*done%)
tot%)
stitch%
row%
l$newrows%=toprow%*colnum%*double%
newrows%<36
o.dups%=36
(newrows%)-(36
(newrows%)<>0)
p+bigtable%=
a(newrows%*gridwidth%*dups%)
q"tot%=dups%*newrows%*gridwidth%
done%=0
i%=0
dups%-1
stitch%=0
newrows%*gridwidth%
u>bigtable%?(i%*newrows%*gridwidth%+stitch%)=ntable%?stitch%
done%+=1
&000406C4,((100*done%)
tot%)
stitch%
ntable%=
d(ntable%)
ntable%=bigtable%
toprow%=toprow%*dups%
})ntablesize%=newrows%*gridwidth%*dups%
coltable%=
d(coltable%)
coltable%=ntable%
coltablesize%=ntablesize%
%grows$=
(toprow%*colnum%*double%)
manner%=1
9gheight$=
(tension_sq_height$)/
(tension_sq_rows$))
;gwidth$=
(tension_sq_width$)/
(tension_sq_stitches$))
!gstitches$=ans_conv_stitches$
tension_sq_width$="0.0"
tension_sq_height$="0.0"
tension_sq_stitches$="0"
tension_sq_rows$="0"
ans_conv_rows$="0"
ans_conv_stitches$="0"
conv_rows$="0.0"
conv_stitches$="0.0"
textdispvar%=6
main37%=0
main0%=0
mastergrey%=4
pictype$="none"
spriteon%=
manner%=0
sclmul$="1"
scldiv$="1"
jb(fname$)
num%,i%,col%
num%=0
i%=block%
block%+maxcol%
?i%=0
i%=0
gridwidth%*gridheight%-1
col%=(coltable%?i%)
block%?col%=1
i%=block%
block%+maxcol%
?i%<>0
num%+=1
=num%
(tension_sq_stitches$)<>0
stitch_width=
(tension_sq_width$)/
(tension_sq_stitches$)
stitch_width=0
(tension_sq_rows$)<>0
row_height=
(tension_sq_height$)/
(tension_sq_rows$)
row_height=0
manner%
stitchwidth=
gwidth$)
rowht=
gheight$)
stitchwidth%=
(stitchwidth)
rowht%=
(rowht)
gridwidth%=
gstitches$
gridheight%=
grows$
"gridwidth%=
ans_conv_stitches$
gridheight%=
ans_conv_rows$
stitchwidth=
b(stitch_width)
rowht=
b(row_height)
stitchwidth%=
(stitchwidth)
rowht%=
(rowht)
h(jacmenu%,0)=
double%=2
double%=1
found%, jigtable%, nrows%, row%, stitch%, nstitches%, col%, i%, jigrow%, blank%, line%
dups%, bigtable%
manner%
0 : nrows%=
(grows$) : nstitches%=
(gstitches$)
1 : nrows%=
(ans_conv_rows$) : nstitches%=
(ans_conv_stitches$)
blank%=
line%=nrows%-1
stitch%=0
?(coltable%+line%*nstitches%+stitch%)<128
blank%=
stitch%+=1
stitch%=nstitches%
blank%=
line%-=1
line%=-1
blank%=
nrows%=line%+1
(nrows%
2)<>1
gb("There is an odd number of rows in the pattern you have dragged in. Jigsaw patterns can only be made from a pattern with an even number of rows.")
3jigtable%=
a((maxcol%+1)*(nrows%+1)*nstitches%)
jigrow%=0
row%=0
nrows%-1
col%=0
maxcol%+1 : block%?col%=255 :
col%
stitch%=0
2*nstitches%-1
,col%=coltable%?(row%*nstitches%+stitch%)
i%=-1
i%+=1
block%?i%=255
block%?i%=col%
i%>maxcol%
block%?i%=255
block%?i%=col%
stitch%
stitch%=0
nstitches%-1
coltable%?(row%*nstitches%+stitch%)=yarncol%
jigtable%?(jigrow%*nstitches%+stitch%)=yarncol%
jigtable%?(jigrow%*nstitches%+stitch%)=128
stitch%
jigrow%+=1
block%?i%<>255
col%=block%?i%
col%<>yarncol%
stitch%=0
nstitches%-1
coltable%?(row%*nstitches%+stitch%)=col%
jigtable%?(jigrow%*nstitches%+stitch%)=col%
jigtable%?(jigrow%*nstitches%+stitch%)=128
stitch%
jigrow%+=1
stitch%=0
nstitches%-1
coltable%?((row%+1)*nstitches%+stitch%)=col%
jigtable%?(jigrow%*nstitches%+stitch%)=col%
jigtable%?(jigrow%*nstitches%+stitch%)=128
stitch%
jigrow%+=1
i%+=1
stitch%=0
nstitches%-1
coltable%?((row%+1)*nstitches%+stitch%)=yarncol%
jigtable%?(jigrow%*nstitches%+stitch%)=yarncol%
jigtable%?(jigrow%*nstitches%+stitch%)=128
stitch%
jigrow%+=1
row%
jigrow%<36
,dups%=36
(jigrow%)-(36
(jigrow%)<>0)
6bigtable%=
a(jigrow%*nstitches%*(maxcol%+1)*dups%)
i%=0
dups%-1
stitch%=0
jigrow%*nstitches%
?bigtable%?(i%*jigrow%*nstitches%+stitch%)=jigtable%?stitch%
stitch%
jigtable%=
d(jigtable%)
jigtable%=bigtable%
jigrow%=jigrow%*dups%
coltable%=
d(coltable%)
coltable%=jigtable%
$coltablesize%=nstitches%*jigrow%
grows$=
(jigrow%)
manner%=1
9gheight$=
(tension_sq_height$)/
(tension_sq_rows$))
;gwidth$=
(tension_sq_width$)/
(tension_sq_stitches$))
!gstitches$=ans_conv_stitches$
tension_sq_width$="0.0"
tension_sq_height$="0.0"
tension_sq_stitches$="0"
tension_sq_rows$="0"
ans_conv_rows$="0"
ans_conv_stitches$="0"
conv_rows$="0.0"
conv_stitches$="0.0"
textdispvar%=6
main37%=0
main0%=0
mastergrey%=4
pictype$="none"
spriteon%=
manner%=0
sclmul$="1"
scldiv$="1"
jb(fname$)