Home » Archimedes archive » Micro User » MU 1991-08.adf » PD-Stuff » Demos/!Dance/!RunImage
Demos/!Dance/!RunImage
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
| Tape/disk: | Home » Archimedes archive » Micro User » MU 1991-08.adf » PD-Stuff |
| Filename: | Demos/!Dance/!RunImage |
| Read OK: | ✔ |
| File size: | 2988 bytes |
| Load address: | 0000 |
| Exec address: | 0000 |
File contents
50REM><Dance$Dir>.!RunImage
100REM
150REM The Dancer Program
200REM By Lee McGinty 1990
250REM
300REM This App -
350REM By -
400REM Written -
450PROCinitialise
500ON ERROR PROCerror(REPORT$+" ("+STR$ERL+")",ERR,3):GOTO 800
550SYS"Wimp_Initialise",2*100,!task%,program$
650PROCloadtemplates
700menu$="02Dancer|[info%]Info|Quit|"
750dummy%=FNcreatemenu(menublock%,menuind%,menu$)
770SYS"OS_GetEnv" TO command$
780IF INSTR(command$,"-file ") THEN PROCloadfile(MID$(command$,INSTR(command$,"-file ")+6))
800REPEAT
850SYS"Wimp_Poll",0,block1 TO event%
900CASE event% OF
950WHEN 0:REM null reason code
960IF dancing% THEN PROCnextframe
1000WHEN 1:REM redraw window
1020PROCredraw
1050WHEN 2:REM Open window
1100IF !block1=newbackdrop% THEN
1150PROCscreensize
1200block1!4=0:block1!8=bottom%
1250block1!12=right%:block1!16=top%
1300SYS"Wimp_SetExtent",!block1,(block1+4)
1350ENDIF
1400SYS"Wimp_OpenWindow",,block1
1425PROCupdate
1450WHEN 3:REM Close window
1500SYS"Wimp_CloseWindow",,block1
1550WHEN 4:REM Pointer entering window
1600WHEN 5:REM Pointer leaving window
1650WHEN 6:REM Mouse click
1700PROCmouseclick(block1)
1750WHEN 7:REM User drag box
1800WHEN 8:REM Key Pressed
1850WHEN 9:REM Menu selection
1900PROCdecodemenu
1950WHEN 10:REM Scroll request
2000WHEN 11:REM Lose caret
2050WHEN 12:REM Gain caret
2100WHEN 17,18,19:REM message
2150PROCreceive(block1)
2200ENDCASE
2250UNTIL quit
2300SYS"Wimp_CloseDown"
2350END
2400DEFPROCinitialise
2450lefthandside%=-2
2500righthandside%=-1
2550DIM task% 5:$task%="TASK"
2600DIM block1 256,block2 256,block3 256
2650DIM area% 256
2670indsize%=1024
2700DIM templateblock% 1024,tempindirect% indsize%
2710block1!60=0
2750DIM menublock% 1024,menuind% 1024
2800quit=FALSE
2850program$="Dancer"
2900purpose$="Icon bar dancer"
2950author$="� 1991 Lee McGinty"
3000version$="1.0 (1-May-1991)"
3050noframes%=1024
3100nomoves%=256
3150DIM frameposx%(noframes%-1,12)
3200DIM frameposy%(noframes%-1,12)
3250DIM movename$(nomoves%)
3300DIM movestart%(nomoves%)
3350DIM moveend%(nomoves%)
3400DIM framemove%(nomoves%)
3450DIM frameinbet%(nomoves%)
3455DIM spritearea% 3072
3460PROCscreensize
3470mancolour%=7:REM Black
3500dancing%=FALSE
3510dancerx%=right%/2
3520spritearea%!0=3072
3530spritearea%!8=16
3540SYS"OS_SpriteOp",9+256,spritearea%
3550SYS"OS_SpriteOp",10+256,spritearea%,"<Dance$Dir>.Sprites"
3555SYS"OS_SpriteOp",24+256,spritearea%,"man" TO ,,saddr%
3556SYS"OS_SpriteOp",40+256,spritearea%,"man" TO ,,,width%,height%
3557width%=width%*2:height%=height%*4
3558scale=0.75
3560ENDPROC
3600DEFPROCloadtemplates
3650SYS"Wimp_OpenTemplate",,"<Dance$Dir>.Templates"
3700SYS"Wimp_LoadTemplate",,templateblock%,tempindirect%,tempindirect%+indsize%,-1,"info",0 TO ,,nextind%
3750SYS"Wimp_CreateWindow",,templateblock% TO info%
3800$(FNiconaddr(info%,15))=version$
3850$(FNiconaddr(info%,2))=program$
3900$(FNiconaddr(info%,9))=purpose$
3950$(FNiconaddr(info%,12))=author$
4000SYS"Wimp_CloseTemplate"
4050block1!4=0
4100block1!8=bottom%
4150block1!12=right%
4200block1!16=top%
4250block1!20=0
4300block1!24=0:REM ### = top% in DD
4350block1!28=-2
4400block1!32=&8C0
4450block1!36=&4040407
4500block1!40=0
4550block1!44=0
4600block1!48=bottom%
4650block1!52=right%
4700block1!56=top%
4705block1!60=0
4706block1!64=0
4720block1!68=spritearea%
4750FOR byte%=68 TO 91
4800block1!byte%=0
4850NEXT
4900SYS"Wimp_CreateWindow",,(block1+4) TO newbackdrop%
4950block1!0=newbackdrop%
5000SYS"Wimp_OpenWindow",,block1
5050ENDPROC
5100DEFFNiconaddr(handle,icon)
5150!block1=handle:block1!4=icon
5200SYS"Wimp_GetIconState",,block1
5250=block1!28
5300DEFPROCerror(error$,err,flags%)
5350!block2=err:$(block2+4)=error$:?(block2+4+LENerror$)=0
5400SYS"Wimp_ReportError",block2,flags%,program$ TO ,buttons%
5450IF buttons%=1 THEN ENDPROC
5460SYS"Wimp_CloseDown"
5470END
5500DEFPROCreceive(block)
5550LOCAL message%
5600message%=block!16
5650CASE message% OF
5700WHEN 0:quit=TRUE
5750WHEN 1:
5800IF block!40=&258 THEN
5850$(block+44)="<Wimp$Scrap>"
5900block?56=0
5950block!12=block!8
6000block!16=2
6050block!36=-1
6100block!0=60
6150SYS"Wimp_SendMessage",17,block,block!4
6200ENDIF
6250WHEN 3,5:REM there is some data to load
6300IF block!40=&258 THEN
6350file$=FNstring(block+44)
6400PROCloadfile(file$)
6450IF block!12<>0 THEN *DELETE <Wimp$Scrap>
6500block!12=block!8
6550block!16=4
6600SYS"Wimp_SendMessage",17,block,block!4
6650ENDIF
6700ENDCASE
6750ENDPROC
6800DEFFNcreatemenu(mb%,ind%,t$)
6850IF RIGHT$(t$,1)<>"|" THEN t$+="|"
6900LOCAL new$,ptr%,shade%,tick%,dotted%,submenu%,writable%
6950LOCAL indirected%,g%,numofitems%
7000numofitems%=VALLEFT$(t$,2):t$=MID$(t$,3)
7050nextmenu%=mb%+28+24*numofitems%
7100$mb%=LEFT$(t$,INSTR(t$,"|")-1):t$=MID$(t$,INSTR(t$,"|")+1)
7150mb%?12=7
7200mb%?13=2
7250mb%?14=7
7300mb%?15=0
7350mb%!16=(LEN$mb%*16)+8
7400mb%!20=44
7450mb%!24=0
7500ptr%=mb%+28
7550REPEAT:shade%=0:tick%=0:dotted%=0:writable%=0:submenu%=-1
7600IF LEFT$(t$,1)="{" THEN t$=EVAL(MID$(t$,2,INSTR(t$,"}")-2))
7650IFLEFT$(t$,1)="#" tick%=1:t$=MID$(t$,2)
7700IFLEFT$(t$,1)="[" THEN
7750t$=MID$(t$,2):new$=LEFT$(t$,INSTR(t$,"]")-1)
7800IF INSTR(new$,"%") THEN submenu%=EVALnew$ ELSE new$=EVALnew$:submenu%=FNcreatemenu(nextmenu%,ind%,new$)
7850t$=MID$(t$,INSTR(t$,"]")+1)
7900ENDIF
7950IFLEFT$(t$,1)="." t$=MID$(t$,2)
8000IFLEFT$(t$,1)="*" shade%=&400000:t$=MID$(t$,2)
8050IFLEFT$(t$,1)=":" dotted%=2:t$=MID$(t$,2)
8100IFLEFT$(t$,1)="^" writable%=4:t$=MID$(t$,2)
8150g%=INSTR(t$,"|")
8200IF writable% THEN
8250i%=INSTR(t$,","):ptr%!12=EVALLEFT$(t$,i%-1):t$=MID$(t$,i%+1)
8300ptr%!16=-1
8350ptr%!20=EVALLEFT$(t$,INSTR(t$,"|")-1)
8400mb%!16=FNgreater(mb%!16,4+16*ptr%!20)
8450ELSE
8500IF g%-1>12 THEN
8550!(ptr%+12)=ind%
8600$ind%=LEFT$(t$,g%-1):ind%+=g%
8650!(ptr%+16)=0
8700!(ptr%+20)=g%
8750indirected%=1
8800ELSE
8850indirected%=FALSE
8900$(ptr%+12)=LEFT$(t$,g%-1)
8950ENDIF
9000mb%!16=FNgreater(mb%!16,g%*16-8)
9050ENDIF
9100t$=MID$(t$,g%+1)
9150!ptr%=tick% OR dotted% OR writable% OR (&80 AND (t$=""))
9200ptr%!4=submenu%
9250ptr%!8=&10021 OR shade% OR writable%<<6 OR 0<<28 OR 7<<24 OR indirected%<<8
9300ptr%+=24
9350UNTILt$=""
9400=mb%
9450DEF FNgreater(a%,b%):IF a%>b% =a% ELSE =b%
9500DEFPROCmouseclick(block)
9550LOCAL buttons%,window%,icon%
9600buttons%=block!8
9650window%=block!12
9700icon%=block!16
9750CASE window% OF
9800WHEN newbackdrop%:
9850x%=block!0:y%=block!4
9860IF buttons%=2 THEN
9900SYS"Wimp_CreateMenu",,menublock%,x%-64,y%
9920ENDIF
9950ENDCASE
10000ENDPROC
10050DEFPROCdecodemenu
10100LOCAL buttons%
10150SYS"Wimp_GetPointerInfo",,block2
10200buttons%=block2!8
10250SYS"Wimp_DecodeMenu",,menublock%,block1,block2
10300CASE $block2 OF
10350WHEN "Quit":
10400quit=TRUE
10450ENDCASE
10500IF buttons%=1 THEN SYS"Wimp_CreateMenu",,menublock%,0,0
10550ENDPROC
10600DEF PROCscreensize
10650!block2=4:block2!4=5
10700block2!8=11:block2!12=12
10750block2!16=-1
10800SYS "OS_ReadVduVariables",block2,block2
10850xs%=!block2:ys%=block2!4
10900right%=(block2!8+1)<<xs%:top%=(block2!12+1)<<ys%
10950bottom%=136
11000ENDPROC
11050DEFFNstring(mem%)
11100LOCALS$
11150S$="":REPEAT:
11200S$+=CHR$(?mem%)
11250mem%+=1
11300UNTIL?mem%=0
11350=S$
11400DEFPROCloadfile(filename$)
11450LOCAL ERROR
11500ON ERROR LOCAL PROCerror("Cannot Load File: "+REPORT$,0,1):CLOSE#C%:RESTORE ERROR:ENDPROC
11550lastframe%=0
11600C%=OPENINfilename$
11650version%=BGET#C%
11700IF version%<100 THEN ERROR 0,"Dance file too old"
11750nomovesindance%=(BGET#C%)-1
11800FOR move%=1 TO nomovesindance%
11850name$=""
11900FOR byte%=0 TO 12
11950name$+=CHR$(BGET#C%)
12000NEXT
12050movename$(move%)=name$
12100noframesindance%=BGET#C%
12150FOR nextframe%=lastframe% TO lastframe%+noframesindance%-1
12200REM Read in points
12250FOR pos%=1 TO 12
12300frameposx%(nextframe%,pos%)=(BGET#C%)*scale
12350frameposy%(nextframe%,pos%)=(BGET#C%)*scale
12400NEXT
12420frameinbet%(nextframe%)=BGET#C%
12450framemove%(nextframe%)=BGET#C%
12460IF framemove%(nextframe%)>128 THEN framemove%(nextframe%)=-(256-framemove%(nextframe%))
12510IF frameinbet%(nextframe%)=0 THEN frameinbet%(nextframe%)=5
12550NEXT
12600movestart%(move%)=lastframe%
12650moveend%(move%)=lastframe%+noframesindance%-1
12655lastframe%+=noframesindance%
12700NEXT
12710CLOSE#C%
12750RESTORE ERROR
12800PROCsetupdance
12850ENDPROC
12900DEFPROCdrawman(x%,y%,fromframe%,toframe%,fraction)
13000PROCline(3,2)
13050PROCline(2,1)
13100PROCline(1,4)
13150PROCline(4,5)
13200PROCline(1,6)
13250PROCline(6,7)
13300PROCline(7,8)
13350PROCline(8,9)
13400PROCline(6,10)
13450PROCline(10,11)
13500PROCline(11,12)
13550REM Calc pos of centre of head
13600x1%=(frameposx%(toframe%,1)-frameposx%(fromframe%,1))*fraction+frameposx%(fromframe%,1)
13650y1%=(frameposy%(toframe%,1)-frameposy%(fromframe%,1))*fraction+frameposy%(fromframe%,1)
13700x2%=(frameposx%(toframe%,6)-frameposx%(fromframe%,6))*fraction+frameposx%(fromframe%,6)
13750y2%=(frameposy%(toframe%,6)-frameposy%(fromframe%,6))*fraction+frameposy%(fromframe%,6)
13800IF x1%=x2% AND y1%=y2% THEN
13850factor=0
13900ELSE
13950factor=16/(SQR((x1%-x2%)^2+(y1%-y2%)^2))
14000ENDIF
14050headx%=x1%+(x1%-x2%)*factor
14100heady%=y1%+(y1%-y2%)*factor
14150CIRCLE headx%+x%,heady%+y%,16*scale
14200ENDPROC
14250DEFPROCline(point1%,point2%)
14300LOCAL x1%,x2%,x3%,x4%,y1%,y2%,y3%,y4%
14350x1%=frameposx%(fromframe%,point1%)
14400x2%=frameposx%(toframe%,point1%)
14450x3%=frameposx%(fromframe%,point2%)
14500x4%=frameposx%(toframe%,point2%)
14550y1%=frameposy%(fromframe%,point1%)
14600y2%=frameposy%(toframe%,point1%)
14650y3%=frameposy%(fromframe%,point2%)
14700y4%=frameposy%(toframe%,point2%)
14750MOVE (x2%-x1%)*fraction+x%+x1%,(y2%-y1%)*fraction+y%+y1%
14800DRAW (x4%-x3%)*fraction+x%+x3%,(y4%-y3%)*fraction+y%+y3%
14850ENDPROC
15000DEFPROCman(fromframe%,toframe%,fraction)
15010SYS"OS_SpriteOp",60+256,spritearea%,"man",0 TO r0,r1,r2,r3
15021GCOL4+128
15030CLG
15041GCOLmancolour%
15050PROCdrawman(8,0,fromframe%,toframe%,fraction)
15060SYS"OS_SpriteOp",r0,r1,r2,r3
15065PROCupdate
15070ENDPROC
15080
15100DEFPROCnextframe
15110inbet%+=1
15120IF inbet%<>inbettotal% THEN
15130PROCman(currentframe%,nextframe%,inbet%/inbettotal%)
15135dancerx%+=(framemove%(currentframe%))*4
15136PROCposition
15140ELSE
15150IF nextframe%>=moveend%(currentmove%) THEN
15160currentmove%=RND(nomovesindance%)
15170inbet%=0
15180currentframe%=nextframe%
15185inbettotal%=frameinbet%(currentframe%)
15190nextframe%=movestart%(currentmove%)
15195dancerx%+=(framemove%(currentframe%))*4
15197PROCposition
15200PROCman(currentframe%,nextframe%,inbet%/inbettotal%)
15210ELSE
15220currentframe%=nextframe%
15230nextframe%+=1
15240PROCman(currentframe%,nextframe%,0)
15250inbet%=0
15255inbettotal%=frameinbet%(currentframe%)
15257dancerx%+=(framemove%(currentframe%))*4
15258PROCposition
15260ENDIF
15270ENDIF
15280ENDPROC
15290
15300DEFPROCsetupdance
15310dancing%=TRUE
15320currentmove%=RND(nomovesindance%)
15330currentframe%=movestart%(currentmove%)
15340PROCman(currentframe%,currentframe%,0)
15350inbet%=0
15360inbettotal%=frameinbet%(currentframe%)
15370nextframe%=currentframe%+1
15375dancerx%=right%/2
15377SYS"Wimp_ForceRedraw",newbackdrop%,0,136,right%,top%
15380ENDPROC
15390
15400DEF PROCredraw
15420IF !block1=newbackdrop% THEN
15430SYS"Wimp_RedrawWindow",,block1 TO more%
15440WHILE more%
15445IF FNintersection(dancerx%,136,dancerx%+width%,136+height%,block1!28,block1!32,block1!36,block1!40) THEN
15450PROCPlotIcon(dancerx%)
15455ENDIF
15470SYS "Wimp_GetRectangle",,block1 TO more%
15480 ENDWHILE
15490ELSE
15502ENDIF
15505ENDPROC
15510DEF PROCPlotIcon(xpos%)
15520!block2=xpos%:block2!4=136
15530block2!8=xpos%+width%:block2!12=136+height%
15540block2!16=%100000010:block2!20=saddr%
15542block2!24=spritearea%:block2!28=0
15550SYS"Wimp_PlotIcon",,block2
15560ENDPROC
16500DEFPROCposition
16510IF dancerx%>=right%-width% THEN dancerx%=right%-width%
16520IF dancerx%<0 THEN dancerx%=0
16530ENDPROC
17000DEFFNintersection(x1%,y1%,x2%,y2%,x3%,y3%,x4%,y4%)
17010xd%=x3%-x1%:yd%=y3%-y1%
17020IF xd%>0 THEN IF xd%>(x2%-x1%) THEN =FALSE
17030IF xd%<0 THEN IF ABS(xd%)>(x4%-x3%) THEN =FALSE
17040IF yd%>0 THEN IF yd%>(y2%-y1%) THEN =FALSE
17050IF yd%<0 THEN IF ABS(yd%)>(y4%-y3%) THEN =FALSE
17060=TRUE
18000DEFPROCupdate
18010!block3=newbackdrop%
18020block3!4=dancerx%:block3!8=136:block3!12=dancerx%+width%
18025block3!16=136+height%
18030SYS &400C9,,block3 TO more%
18040WHILE more%
18050IF FNintersection(dancerx%,136,dancerx%+width%,136+height%,block3!28,block3!32,block3!36,block3!40) THEN
18060PROCPlotIcon(dancerx%)
18070ENDIF
18080SYS &400CA,,block3 TO more%
18090ENDWHILE
18100ENDPROC
2�><Dance$Dir>.!RunImage
d�
�� The Dancer Program
�� By Lee McGinty 1990
��
,� This App -
^
� By -
�� Written -
��initialise
�)� � �error(�$+" ("+Þ+")",�,3):� �T`C
&-ș"Wimp_Initialise",2*100,!task%,program$
��loadtemplates
�&menu$="02Dancer|[info%]Info|Quit|"
�1dummy%=�createmenu(menublock%,menuind%,menu$)
ș"OS_GetEnv" � command$
G� �command$,"-file ") � �loadfile(�command$,�command$,"-file ")+6))
�
R#ș"Wimp_Poll",0,block1 � event%
�Ȏ event% �
�� 0:� null reason code
�� dancing% � �nextframe
�� 1:� redraw window
��redraw
� 2:� Open window
L� !block1=newbackdrop% �
~�screensize
�block1!4=0:block1!8=bottom%
�#block1!12=right%:block1!16=top%
)ș"Wimp_SetExtent",!block1,(block1+4)
F�
xș"Wimp_OpenWindow",,block1
��update
�� 3:� Close window
� ș"Wimp_CloseWindow",,block1
!� 4:� Pointer entering window
@ � 5:� Pointer leaving window
r� 6:� Mouse click
��mouseclick(block1)
�� 7:� User drag box
� 8:� Key Pressed
:� 9:� Menu selection
l�decodemenu
�� 10:� Scroll request
�� 11:� Lose caret
� 12:� Gain caret
4� 17,18,19:� message
f�receive(block1)
��
�
� quit
�ș"Wimp_CloseDown"
.�
`��initialise
�lefthandside%=-2
�righthandside%=-1
�� task% 5:$task%="TASK"
(&� block1 256,block2 256,block3 256
Z� area% 256
nindsize%=1024
�0� templateblock% 1024,tempindirect% indsize%
�block1!60=0
�#� menublock% 1024,menuind% 1024
�
quit=�
"program$="Dancer"
Tpurpose$="Icon bar dancer"
� author$="� 1991 Lee McGinty"
�version$="1.0 (1-May-1991)"
�noframes%=1024
nomoves%=256
N � frameposx%(noframes%-1,12)
� � frameposy%(noframes%-1,12)
�� movename$(nomoves%)
�� movestart%(nomoves%)
� moveend%(nomoves%)
H� framemove%(nomoves%)
z� frameinbet%(nomoves%)
� spritearea% 3072
��screensize
�mancolour%=7:� Black
�dancing%=�
�dancerx%=right%/2
�spritearea%!0=3072
�spritearea%!8=16
�%ș"OS_SpriteOp",9+256,spritearea%
�<ș"OS_SpriteOp",10+256,spritearea%,"<Dance$Dir>.Sprites"
�7ș"OS_SpriteOp",24+256,spritearea%,"man" � ,,saddr%
�@ș"OS_SpriteOp",40+256,spritearea%,"man" � ,,,width%,height%
�%width%=width%*2:height%=height%*4
�scale=0.75
��
��loadtemplates
B2ș"Wimp_OpenTemplate",,"<Dance$Dir>.Templates"
tgș"Wimp_LoadTemplate",,templateblock%,tempindirect%,tempindirect%+indsize%,-1,"info",0 � ,,nextind%
�1ș"Wimp_CreateWindow",,templateblock% � info%
�#$(�iconaddr(info%,15))=version$
"$(�iconaddr(info%,2))=program$
<"$(�iconaddr(info%,9))=purpose$
n"$(�iconaddr(info%,12))=author$
�ș"Wimp_CloseTemplate"
�block1!4=0
block1!8=bottom%
6block1!12=right%
hblock1!16=top%
�block1!20=0
�"block1!24=0:� ### = top% in DD
�block1!28=-2
0block1!32=&8C0
bblock1!36=&4040407
�block1!40=0
�block1!44=0
�block1!48=bottom%
*block1!52=right%
\block1!56=top%
ablock1!60=0
bblock1!64=0
pblock1!68=spritearea%
�� byte%=68 � 91
�block1!byte%=0
��
$4ș"Wimp_CreateWindow",,(block1+4) � newbackdrop%
Vblock1!0=newbackdrop%
�ș"Wimp_OpenWindow",,block1
��
�ݤiconaddr(handle,icon)
!block1=handle:block1!4=icon
P!ș"Wimp_GetIconState",,block1
�=block1!28
���error(error$,err,flags%)
�8!block2=err:$(block2+4)=error$:?(block2+4+�error$)=0
;ș"Wimp_ReportError",block2,flags%,program$ � ,buttons%
J� buttons%=1 � �
Tș"Wimp_CloseDown"
^�
|��receive(block)
�� message%
�message%=block!16
Ȏ message% �
D� 0:quit=�
v� 1:
�� block!40=&258 �
�$(block+44)="<Wimp$Scrap>"
block?56=0
>block!12=block!8
pblock!16=2
�block!36=-1
�block!0=60
)ș"Wimp_SendMessage",17,block,block!4
8�
j&� 3,5:� there is some data to load
�� block!40=&258 �
�file$=�string(block+44)
�loadfile(file$)
2(� block!12<>0 � *DELETE <Wimp$Scrap>
dblock!12=block!8
�block!16=4
�)ș"Wimp_SendMessage",17,block,block!4
��
,�
^�
�ݤcreatemenu(mb%,ind%,t$)
�� �t$,1)<>"|" � t$+="|"
�7� new$,ptr%,shade%,tick%,dotted%,submenu%,writable%
& � indirected%,g%,numofitems%
X!numofitems%=��t$,2):t$=�t$,3)
�#nextmenu%=mb%+28+24*numofitems%
�+$mb%=�t$,�t$,"|")-1):t$=�t$,�t$,"|")+1)
�mb%?12=7
mb%?13=2
Rmb%?14=7
�mb%?15=0
�mb%!16=(�$mb%*16)+8
�
mb%!20=44
mb%!24=0
Lptr%=mb%+28
~8�:shade%=0:tick%=0:dotted%=0:writable%=0:submenu%=-1
�*� �t$,1)="{" � t$=�(�t$,2,�t$,"}")-2))
�!�t$,1)="#" tick%=1:t$=�t$,2)
�t$,1)="[" �
F"t$=�t$,2):new$=�t$,�t$,"]")-1)
xX� �new$,"%") � submenu%=�new$ � new$=�new$:submenu%=�createmenu(nextmenu%,ind%,new$)
�t$=�t$,�t$,"]")+1)
��
�t$,1)="." t$=�t$,2)
@(�t$,1)="*" shade%=&400000:t$=�t$,2)
r#�t$,1)=":" dotted%=2:t$=�t$,2)
�%�t$,1)="^" writable%=4:t$=�t$,2)
�g%=�t$,"|")
� writable% �
:/i%=�t$,","):ptr%!12=��t$,i%-1):t$=�t$,i%+1)
lptr%!16=-1
�ptr%!20=��t$,�t$,"|")-1)
�(mb%!16=�greater(mb%!16,4+16*ptr%!20)
!�
!4� g%-1>12 �
!f!(ptr%+12)=ind%
!�$ind%=�t$,g%-1):ind%+=g%
!�!(ptr%+16)=0
!�!(ptr%+20)=g%
".indirected%=1
"`�
"�indirected%=�
"�$(ptr%+12)=�t$,g%-1)
"��
#(#mb%!16=�greater(mb%!16,g%*16-8)
#Z�
#�t$=�t$,g%+1)
#�7!ptr%=tick% � dotted% � writable% � (&80 � (t$=""))
#�ptr%!4=submenu%
$"Jptr%!8=&10021 � shade% � writable%<<6 � 0<<28 � 7<<24 � indirected%<<8
$Tptr%+=24
$�
�t$=""
$�=mb%
$�'� �greater(a%,b%):� a%>b% =a% � =b%
%��mouseclick(block)
%N� buttons%,window%,icon%
%�buttons%=block!8
%�window%=block!12
%�icon%=block!16
&Ȏ window% �
&H� newbackdrop%:
&zx%=block!0:y%=block!4
&�� buttons%=2 �
&�,ș"Wimp_CreateMenu",,menublock%,x%-64,y%
&��
&��
'�
'B��decodemenu
't� buttons%
'�#ș"Wimp_GetPointerInfo",,block2
'�buttons%=block2!8
(
1ș"Wimp_DecodeMenu",,menublock%,block1,block2
(<Ȏ $block2 �
(n
� "Quit":
(�
quit=�
(��
)6� buttons%=1 � ș"Wimp_CreateMenu",,menublock%,0,0
)6�
)h� �screensize
)�!block2=4:block2!4=5
)�block2!8=11:block2!12=12
)�block2!16=-1
*0*ș "OS_ReadVduVariables",block2,block2
*bxs%=!block2:ys%=block2!4
*�4right%=(block2!8+1)<<xs%:top%=(block2!12+1)<<ys%
*�bottom%=136
*��
+*ݤstring(mem%)
+\�S$
+�S$="":�:
+�S$+=�(?mem%)
+�mem%+=1
,$�?mem%=0
,V=S$
,���loadfile(filename$)
,�� �
,�8� � � �error("Cannot Load File: "+�$,0,1):�#C%:� �:�
-lastframe%=0
-PC%=�filename$
-�version%=�#C%
-�-� version%<100 � � 0,"Dance file too old"
-�nomovesindance%=(�#C%)-1
.� move%=1 � nomovesindance%
.Jname$=""
.|� byte%=0 � 12
.�name$+=�(�#C%)
.��
/movename$(move%)=name$
/Dnoframesindance%=�#C%
/v;� nextframe%=lastframe% � lastframe%+noframesindance%-1
/�� Read in points
/�� pos%=1 � 12
0,frameposx%(nextframe%,pos%)=(�#C%)*scale
0>,frameposy%(nextframe%,pos%)=(�#C%)*scale
0p�
0� frameinbet%(nextframe%)=�#C%
0�framemove%(nextframe%)=�#C%
0�W� framemove%(nextframe%)>128 � framemove%(nextframe%)=-(256-framemove%(nextframe%))
0�;� frameinbet%(nextframe%)=0 � frameinbet%(nextframe%)=5
1�
18 movestart%(move%)=lastframe%
1j1moveend%(move%)=lastframe%+noframesindance%-1
1o lastframe%+=noframesindance%
1��
1��#C%
1�� �
2 �setupdance
22�
2d1��drawman(x%,y%,fromframe%,toframe%,fraction)
2��line(3,2)
2��line(2,1)
3,�line(1,4)
3^�line(4,5)
3��line(1,6)
3��line(6,7)
3��line(7,8)
4&�line(8,9)
4X�line(6,10)
4��line(10,11)
4��line(11,12)
4� � Calc pos of centre of head
5 [x1%=(frameposx%(toframe%,1)-frameposx%(fromframe%,1))*fraction+frameposx%(fromframe%,1)
5R[y1%=(frameposy%(toframe%,1)-frameposy%(fromframe%,1))*fraction+frameposy%(fromframe%,1)
5�[x2%=(frameposx%(toframe%,6)-frameposx%(fromframe%,6))*fraction+frameposx%(fromframe%,6)
5�[y2%=(frameposy%(toframe%,6)-frameposy%(fromframe%,6))*fraction+frameposy%(fromframe%,6)
5�� x1%=x2% � y1%=y2% �
6factor=0
6L�
6~*factor=16/(�((x1%-x2%)^2+(y1%-y2%)^2))
6��
6�headx%=x1%+(x1%-x2%)*factor
7heady%=y1%+(y1%-y2%)*factor
7F#ȏ headx%+x%,heady%+y%,16*scale
7x�
7���line(point1%,point2%)
7�%� x1%,x2%,x3%,x4%,y1%,y2%,y3%,y4%
8&x1%=frameposx%(fromframe%,point1%)
8@$x2%=frameposx%(toframe%,point1%)
8r&x3%=frameposx%(fromframe%,point2%)
8�$x4%=frameposx%(toframe%,point2%)
8�&y1%=frameposy%(fromframe%,point1%)
9$y2%=frameposy%(toframe%,point1%)
9:&y3%=frameposy%(fromframe%,point2%)
9l$y4%=frameposy%(toframe%,point2%)
9�9� (x2%-x1%)*fraction+x%+x1%,(y2%-y1%)*fraction+y%+y1%
9�9� (x4%-x3%)*fraction+x%+x3%,(y4%-y3%)*fraction+y%+y3%
:�
:�'��man(fromframe%,toframe%,fraction)
:�<ș"OS_SpriteOp",60+256,spritearea%,"man",0 � r0,r1,r2,r3
:�
�4+128
:��
:��mancolour%
:�.�drawman(8,0,fromframe%,toframe%,fraction)
:�ș"OS_SpriteOp",r0,r1,r2,r3
:��update
:��
:�
:���nextframe
;
inbet%+=1
;� inbet%<>inbettotal% �
;5�man(currentframe%,nextframe%,inbet%/inbettotal%)
;+dancerx%+=(framemove%(currentframe%))*4
;
�position
;$�
;.*� nextframe%>=moveend%(currentmove%) �
;8#currentmove%=�(nomovesindance%)
;Binbet%=0
;Lcurrentframe%=nextframe%
;Q*inbettotal%=frameinbet%(currentframe%)
;V'nextframe%=movestart%(currentmove%)
;[+dancerx%+=(framemove%(currentframe%))*4
;]
�position
;`5�man(currentframe%,nextframe%,inbet%/inbettotal%)
;j�
;tcurrentframe%=nextframe%
;~nextframe%+=1
;�$�man(currentframe%,nextframe%,0)
;�inbet%=0
;�*inbettotal%=frameinbet%(currentframe%)
;�+dancerx%+=(framemove%(currentframe%))*4
;�
�position
;��
;��
;��
;�
;���setupdance
;�dancing%=�
;�#currentmove%=�(nomovesindance%)
;�*currentframe%=movestart%(currentmove%)
;�'�man(currentframe%,currentframe%,0)
;�inbet%=0
<