Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199610.adf » Features » MikeC/!PUPe/RunPUPe

MikeC/!PUPe/RunPUPe

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199610.adf » Features
Filename: MikeC/!PUPe/RunPUPe
Read OK:
File size: 22F6 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM>Develop.!PUPe.!PUPe.RunPUPe
   20REM Pseudo User Port extended, using serial port handshaking lines
   30REM Version 1.0 By Mike Cook
   40REM All rights reserved
   50ON ERROR PROCerrorbox
   60
   70DIM taskid%4:$taskid%="TASK"
   80DIM PORT%(3), Pin$(2,7),PinN$(2,7),PinIO$(2,7),intmess% 20
   90intmess%!0=1:intmess%!4=2:intmess%!8=3:intmess%!12=&502:intmess%!16=0
  100SYS "Wimp_Initialise",300,!taskid%,"PUP extended",intmess% TO version%,taskhand%
  110DIM q% &300,qc% 80, Wn% &300,temp% 256,buffers% 512,menu% 128,SW% 256,cb% 18
  120DIM IsName% 256, Wmenu% 512,Smenu% 256,Imenu% 256, TextWarn% 100, ww% 256
  130SYS "Wimp_OpenTemplate",,"<PUPe$Dir>.Templates"
  140ON ERROR SYS "Wimp_CloseTemplate":PROCerrorbox
  150SYS "Wimp_LoadTemplate",,q%,temp%,temp%+256,-1,"Info",0
  160SYS "Wimp_CreateWindow",,q% TO info%
  170SYS "Wimp_LoadTemplate",,Wn%+4,SW%,SW%+256,-1,"Pallette",0
  180SYS "Wimp_CreateWindow",,Wn%+4 TO monW%
  190Wn%!0=monW%:Wn%!28=-1
  200
  210SYS "Wimp_LoadTemplate",,q%,ww%,ww%+256,-1,"Warning",0
  220q%!108=TextWarn%:q%!112=-1:q%!116=300
  230XQ%=q%!8-q%!0:YQ%=q%!12-q%!4
  240SYS "Wimp_CreateWindow",,q% TO warningW%
  250SYS "Wimp_CloseTemplate"
  260ref%=0
  270cpL%=0:cpR%=0
  280smpicon%=FNicon
  290wopen%=FALSE:warnOn%=FALSE
  300InWin%=FALSE
  310LX%=-1:LY%=-1
  320cr%=3:cb%=8
  330LED=FALSE
  340BiDi%=0
  350MiTime%=0
  360REM Enable the serial chip
  370SYS"OS_SerialOp",0,&87,&FFFFFF78
  380*FX2,2
  390
  400ON ERROR PROCerrorbox
  410PROC_UpP(2,0,1)
  420
  430PROCsetupmenu
  440
  450REPEAT
  460 SYS "Wimp_Poll",0,q% TO A%
  470  CASE A% OF
  480   WHEN 0:PROC_Null
  490   WHEN 1:PROC_doWindow
  500   WHEN 2:SYS"OS_ReadModeVariable",-1,3 TO ,,Ncolours%: SYS "Wimp_OpenWindow",,q%
  510   WHEN 3:PROC_close
  520   WHEN 4:InWin%=FALSE:LX%=-1:LY%=-1
  530   WHEN 5:InWin%=TRUE
  540   WHEN 6:PROC_do_click(q%)
  550   WHEN 7:
  560   WHEN 8:PROC_KeyPress
  570   WHEN 9:PROC_SORT_Menu
  580   WHEN 17,18:PROCreceive(q%)
  590   ENDCASE
  600 UNTIL FALSE
  610
  620END
  630DEF PROC_Null
  640LOCAL A%,B%,C%
  650IF TIME>MiTime% AND wopen% THEN
  660PROC_Trans(monW%)
  661FOR A%=1 TO 2
  670IF A%=2 THEN SYS"OS_SerialOp",0,0,&FFFFFFF7
  680B%=FN_HSr
  690IF B%<>PORT%(A%) THEN PORT%(A%)=B%:PROC_UpP(A%,PORT%(A%),1)
  700NEXT
  710SYS"OS_SerialOp",0,&8,&FFFFFFF7
  720MiTime%=TIME+20
  730ENDIF
  740ENDPROC
  750
  760DEF FN_HSr
  770LOCAL A%,B%
  780SYS"OS_SerialOp",0,0,&FFFFFFFF TO ,,A%
  790A%=((A%>>18) AND &F) EOR &4
  800SYS"OS_SerialOp",0,0,&FFFFFF7F
  810SYS"OS_SerialOp",0,0,&FFFFFFFF TO ,,B%
  820B%=((B%>>14) AND &F0) EOR &40
  830SYS"OS_SerialOp",0,&80,&FFFFFF7F
  840=A% OR B%
  850
  860
  870DEF FN_spath(n$)
  880WHILE INSTR(n$,".")
  890n$=RIGHT$(n$,LEN(n$)-1)
  900ENDWHILE
  910IF LEN(n$)>10 THEN n$=RIGHT$(n$,10)
  920=n$
  930
  940DEF PROC_GetName
  950LOCAL T%,A%,F$
  960F$="":fn$=""
  970q%!0=saveW%:q%!4=1
  980SYS "Wimp_GetIconState",,q%
  990T%=q%!28
 1000T%-=1
 1010REPEAT
 1020T%+=1
 1030F$=F$+CHR$(?T%)
 1040UNTIL ?T%=0
 1050fn$=MID$(F$,1,LEN(F$)-1)
 1060ENDPROC
 1070
 1080DEF PROC_SORT_Menu
 1090IF IconMenu% THEN
 1100IF !q%=1 THEN menu%!52=1:menu%!76=0: LED=FALSE :SYS"Wimp_ForceRedraw",monW%,0,-300,700,0
 1110IF !q%=2 THEN menu%!52=0:menu%!76=1:LED=TRUE :SYS"Wimp_ForceRedraw",monW%,0,-300,700,0
 1120IF !q%=3 THEN PROCdie
 1130ENDCASE
 1140ENDIF
 1150SYS"Wimp_GetPointerInfo",,q%
 1160IF q%!8=1 THEN SYS"Wimp_CreateMenu",,Wmenu%
 1170ENDPROC
 1180
 1190DEF PROC_close
 1200IF q%!0=monW% THEN SYS"Wimp_GetWindowInfo",,Wn%:wopen%=FALSE
 1210IF q%!0=warningW% THEN warnOn%=FALSE
 1220SYS "Wimp_CloseWindow",,q%
 1230ENDPROC
 1240
 1250DEF PROC_do_click(q%)
 1260i%=q%!16
 1270CASE q%!12 OF
 1280WHEN warningW%: q%!0=warningW% :PROC_close
 1290
 1300WHEN -2: REM Look first at Icon Bar Click
 1310        IF q%!16=smpicon% THEN
 1320        IF q%!8=2 THEN IconMenu%=TRUE: SYS"Wimp_CreateMenu",,menu%,q%!0-94,270
 1330        IF q%!8=4 THEN PROC_Open
 1340        ENDIF
 1350
 1360WHEN monW%:  
 1370              IF q%!8=4 THEN PROC_MonClick
 1380ENDCASE
 1390ENDPROC
 1400
 1410
 1420DEF PROC_MonClick
 1430LOCAL D%,V%,B%
 1440REM Do the action for a window click
 1450PROC_Dp
 1460IF cb%<8 AND cr%<3 THEN
 1470  CASE cr% OF
 1480  WHEN 2: PORT%(0)=PORT%(2) EOR 1<<(cb%)
 1490          MiTime%=0
 1500  ENDCASE
 1510ENDIF
 1520ENDPROC
 1530
 1540DEF PROC_Open
 1550SYS"OS_ReadModeVariable",-1,3 TO ,,Ncolours%
 1560REM OPEN UP WINDOW HERE
 1570IF wopen% THEN
 1580q%!0=monW%
 1590SYS"Wimp_GetWindowState",,q%
 1600  IF q%!28<>-1 THEN q%!28=-1: SYS "Wimp_OpenWindow",,q%
 1610ELSE
 1620SYS "Wimp_OpenWindow",,Wn%
 1630wopen%=TRUE
 1640ENDIF
 1650ENDPROC
 1660
 1670DEF PROC_doWindow
 1680  LOCAL A%,I%,L%
 1690
 1700   PROC_Trans(monW%)
 1710   SYS "Wimp_RedrawWindow",,q% TO flag%
 1720     WHILE flag%
 1730
 1740     PROC_Dmpw
 1750     SYS "Wimp_GetRectangle",,q% TO flag%
 1760     ENDWHILE
 1770  
 1780  ENDPROC
 1790
 1800DEF FNpointSq
 1810LOCAL X%,Y%,B%,R%
 1820PROC_Trans(monW%)
 1830MOUSE X%,Y%,B%
 1840R%=0
 1850IF (X%<(xo%+30) AND Y%<(yo%+30) ) THEN R%=1
 1860IF (X%>(xo%+246*xs%) AND Y%<(yo%+30) ) THEN R%=2
 1870=R%
 1880
 1890DEF PROC_Dmpw
 1900LOCAL A%,B%,V%
 1910PROC_Trans(monW%)
 1920
 1930FOR B%=1 TO 2
 1940FOR A%=0 TO 7
 1950V%=PORT%(B%) AND 1<<(7-A%)
 1960PROC_WS(A%,B%,V%)
 1970NEXT
 1980PROC_Hex(PORT%(B%),B%)
 1990NEXT
 2000VDU5
 2010FOR A%=0 TO 7
 2020MOVE xo%+52+A%*40,yo%+106
 2030PRINT;7-A%
 2040NEXT
 2050MOVE xo%+140,yo%+194
 2060PRINT"Input A"
 2070MOVE xo%+140,yo%+274
 2080PRINT"Input B"
 2090VDU4
 2100ENDPROC
 2110
 2120DEF PROC_Hex(V%,Y%)
 2130LOCAL v$
 2140Y%+=1
 2150IF LED THEN SYS"Wimp_SetColour",10 ELSE SYS"Wimp_SetColour",15
 2160IF Ncolours%<4 THEN GCOL 0,0
 2170
 2180RECTANGLEFILL xo%+380,yo1%+40*Y%,54,40
 2190SYS"Wimp_SetColour",7
 2200RECTANGLE xo%+ 380,yo1%+Y%*40,54,40
 2210VDU5
 2220MOVE xo%+384,yo1%+Y%*40+32
 2230IF V%<256 THEN v$=STR$~(V%) ELSE v$="XX"
 2240IF LEN(v$)=1 THEN v$="0"+v$
 2250PRINT"&";v$
 2260VDU4
 2270ENDPROC
 2280
 2290DEF PROC_WS(X%,Y%,V%)
 2300LOCAL S%
 2310S%=40
 2320yo1%=yo%+Y%*S%
 2330IF LED THEN
 2340SYS"Wimp_SetColour",7
 2350CIRCLEFILL 20+xo%+ S% + X%*S%,20+yo1%+S%+Y%*S%,16
 2360
 2370IF V%=0 AND Nw%=FALSE THEN SYS"Wimp_SetColour",4
 2380IF V%<>0 AND Nw%=FALSE THEN SYS"Wimp_SetColour",11
 2390IF Nw%=TRUE THEN SYS"Wimp_SetColour",7
 2400
 2410IF Ncolours%<4 AND V%=0 THEN GCOL 0,0
 2420CIRCLEFILL 20+xo%+S% + X%*S%,20+yo1%+S%+S%*Y%,10
 2430
 2440ELSE
 2450IF Ncolours%>15 THEN GCOL 0,45 ELSE SYS"Wimp_SetColour",0
 2460RECTANGLEFILL xo%+S% + X%*S%,yo1%+S%+S%*Y%,S%,S%
 2470SYS"Wimp_SetColour",7
 2480RECTANGLE xo%+ S% + X%*S%,yo1%+S%+Y%*S%,S%,S%
 2490VDU5
 2500MOVE xo%+S%+X%*S%+12,yo1%+S%*2+Y%*S%-8
 2510IF V%=0 AND Nw%=FALSE THEN PRINT"0"
 2520IF V%<>0 AND Nw%=FALSE THEN PRINT"1"
 2530IF Nw%=TRUE THEN PRINT"X"
 2540VDU4
 2550ENDIF
 2560ENDPROC
 2570
 2580DEF PROC_UpP(P%,V%,M%)
 2590LOCAL T%,A%,E%,Nw%
 2600  q%!0=monW%:q%!4=0:q%!8=-400:q%!12=680:q%!16=0
 2610  SYS"Wimp_UpdateWindow",,q% TO More%
 2620
 2630 WHILE More%
 2640
 2650  IF PORT%(1)>255 AND P%=1 THEN Nw%=TRUE ELSE Nw%=FALSE
 2660  FOR A%=0 TO 7
 2670  T%=V% AND 1<<(7-A%)
 2680  E%=PORT%(P%) AND 1<<(7-A%)
 2690  IF T%<>E% OR M%=1 THEN PROC_WS(A%,P%,T%)
 2700  NEXT
 2710  PROC_Hex(V%,P%)
 2720  
 2730  SYS"Wimp_GetRectangle",,q% TO More%
 2740 ENDWHILE
 2750
 2760ENDPROC
 2770
 2780DEF FN_Wr
 2790LOCAL TY%,R%
 2800 TY%=Y%-yo%
 2810 R%=3
 2820 IF TY%>=40 AND TY%<=80 THEN R%=0
 2830 IF TY%>=120 AND TY%<=160 THEN R%=1
 2840 IF TY%>=200 AND TY%<=240 THEN R%=2
 2850=R%
 2860DEF FN_Wb
 2870LOCAL B%
 2880B%=7-INT((X%-xo%)/40-1)
 2890IF B%>7 OR B%<0 THEN B%=8
 2900=B%
 2910
 2920DEF PROC_Dp
 2930LOCAL X%,Y%,B%,nr%,nb%
 2940MOUSE X%,Y%,B%
 2950IF X%<>LX% OR Y%<>LY% THEN
 2960 PROC_Trans(monW%)
 2970 nr%=FN_Wr : nb%=FN_Wb
 2980 IF nr%<>cr% OR nb%<>cb% THEN
 2990   cr%=nr%:cb%=nb%
 3000   ENDIF
 3010 LX%=X%:LY%=Y%
 3020ENDIF
 3030ENDPROC
 3040
 3050DEF PROC_Trans(wh%)
 3060!q%=wh%
 3070SYS "Wimp_GetWindowState",,q%
 3080xo%=q%!4-q%!20+8:yo%=q%!16-q%!24-290
 3090XO%=q%!4:YO%=q%!16
 3100ENDPROC
 3110
 3120DEFPROCsetupmenu
 3130LOCAL m%
 3140
 3150$menu%="PUPe"
 3160menu%?12=7
 3170menu%?13=2
 3180menu%?14=7
 3190menu%?15=0
 3200menu%!16=128
 3210menu%!20=40
 3220menu%!24=0
 3230m%=menu%+28
 3240m%!0=0
 3250m%!4=info%
 3260m%!8=(7<<24)OR %10001
 3270$(m%+12)="Info"
 3280
 3290m%+=24
 3300m%!0=1
 3310m%!4=0
 3320m%!8=(7<<24)OR %10001
 3330$(m%+12)="Binary"
 3340
 3350m%+=24
 3360m%!0=0
 3370m%!4=0
 3380m%!8=(7<<24)OR %10001
 3390$(m%+12)="LED"
 3400
 3410m%+=24
 3420m%!0=&80
 3430m%!4=0
 3440m%!8=(7<<24)OR %10001
 3450$(m%+12)="Quit"
 3460
 3470ENDPROC
 3480
 3490DEF PROCreceive(q%)
 3500LOCAL A%
 3510A%=q%!16
 3520CASE A% OF
 3530WHEN 0:PROCdie
 3540WHEN &502:   CASE TRUE OF
 3550             WHEN q%!32=-2 AND q%!36=smpicon%:mes$="This is the PUPe Monitor icon.|MObserve the signals on the serial port"
 3560             OTHERWISE:mes$=""
 3570             ENDCASE
 3580    IF mes$<>"" THEN
 3590    q%!12=q%!8
 3600    $(q%+20)=mes$+CHR$0
 3610    q%!0=(20+LENmes$+4)AND NOT 3
 3620    q%!16=&503
 3630    SYS "Wimp_SendMessage",18,q%,q%!4
 3640ENDCASE
 3650ENDPROC
 3660
 3670DEF PROC_Dack
 3680sendth%=q%!4
 3690myref%=q%!8
 3700SYS "Wimp_GetPointerInfo",,q%+8
 3710q%!28=q%!8
 3720q%!32=q%!12
 3730q%!0=(44+LENn$+4)AND NOT 3
 3740q%!12=myref%
 3750q%!16=4
 3760q%!36=-1
 3770q%!40=&FF9
 3780$(q%+44)=n$+CHR$0
 3790SYS "Wimp_SendMessage",17,q%,sendth%
 3800ENDIF
 3810ENDPROC
 3820
 3830DEFFNsget(x%)
 3840LOCAL x$
 3850WHILE ?x% x$+=CHR$(?x%):x%+=1:ENDWHILE
 3860=x$
 3870
 3880DEFFNicon
 3890q%!0=-1
 3900q%!4=0
 3910q%!8=10 : REM Y DIRECTION
 3920q%!12=70 : REM X DIRECTION
 3930q%!16=96
 3940q%!20=&2002
 3950$(q%+24)="!PUPe"
 3960SYS "Wimp_CreateIcon",,q% TO icon%
 3970=icon%
 3980
 3990DEF PROC_setupW(t$)
 4000!q%=warningW%:q%!4=200:q%!8=200:q%!12=200+XQ%:q%!16=200+YQ%:q%!20=0:q%!24=0:q%!28=-1
 4010$TextWarn%=t$
 4020TextWarn%?LEN(t$)=0
 4030VDU 7
 4040warnOn%=TRUE
 4050SYS "Wimp_OpenWindow",,q%
 4060ENDPROC
 4070
 4080DEF PROCerrorbox
 4090SYS "Wimp_DragBox",,-1
 4100!buffers%=ERR:$(buffers%+4)=REPORT$+" at line "+STR$ERL+CHR$0
 4110SYS "Wimp_ReportError",buffers%,1,"Port Monitor"
 4120PROCdie
 4130ENDPROC
 4140
 4150DEFPROCdie
 4160SYS "Wimp_CloseDown",taskhand%,!taskid%
 4170END
 4180ENDPROC
 4190
 4200DEF PROCdragicon(mousex%,mousey%,handle%,icon%)
 4210LOCAL bx%,by%,ix0%,iy0%,ix1%,iy1%
 4220PROCgetw(handle%)
 4230PROCgeti(handle%,icon%)
 4240!q%=handle%:q%!4=5
 4250q%!8=bx%+ix0%:q%!12=by%+iy0%:q%!16=bx%+ix1%:q%!20=by%+iy1%
 4260q%!24=q%!8-mousex%:q%!28=q%!12-mousey%
 4270SYS "Wimp_DragBox",,q%
 4280SFLAG%=TRUE
 4290ENDPROC
 4300
 4310DEF PROCgetw(handle%)
 4320!q%=handle%:SYS "Wimp_GetWindowState",,q%:PROCinfo(q%+4)
 4330ENDPROC
 4340DEF PROCgeti(h%,i%)
 4350!q%=h%:q%!4=i%:SYS "Wimp_GetIconState",,q%
 4360ix0%=q%!8:iy0%=q%!12:ix1%=q%!16:iy1%=q%!20
 4370iflags%=q%!24:idata%=q%+28
 4380ENDPROC
 4390
 4400DEF PROCinfo(p%)
 4410LOCAL x0%,y0%
 4420x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12
 4430scx%=p%!16:scy%=p%!20:bhandle%=p%!24:flags%=p%!28
 4440bx%=x0%-scx%:by%=y1%-scy%
 4450ENDPROC
 4460
 4470DEF PROC_KeyPress
 4480CASE q%!0 OF
 4490REM OTHERWISE: SYS"Wimp_ProcessKey",q%!24
 4500ENDCASE
 4510ENDPROC
 4520

!�>Develop.!PUPe.!PUPe.RunPUPe
D� Pseudo User Port extended, using serial port handshaking lines
� Version 1.0 By Mike Cook
(� All rights reserved
2� � �errorbox
<
F� taskid%4:$taskid%="TASK"
P<� PORT%(3), Pin$(2,7),PinN$(2,7),PinIO$(2,7),intmess% 20
ZIintmess%!0=1:intmess%!4=2:intmess%!8=3:intmess%!12=&502:intmess%!16=0
dRș "Wimp_Initialise",300,!taskid%,"PUP extended",intmess% � version%,taskhand%
nN� q% &300,qc% 80, Wn% &300,temp% 256,buffers% 512,menu% 128,SW% 256,cb% 18
xK� IsName% 256, Wmenu% 512,Smenu% 256,Imenu% 256, TextWarn% 100, ww% 256
�2ș "Wimp_OpenTemplate",,"<PUPe$Dir>.Templates"
�)� � ș "Wimp_CloseTemplate":�errorbox
�:ș "Wimp_LoadTemplate",,q%,temp%,temp%+256,-1,"Info",0
�&ș "Wimp_CreateWindow",,q% � info%
�=ș "Wimp_LoadTemplate",,Wn%+4,SW%,SW%+256,-1,"Pallette",0
�)ș "Wimp_CreateWindow",,Wn%+4 � monW%
�Wn%!0=monW%:Wn%!28=-1
�
�9ș "Wimp_LoadTemplate",,q%,ww%,ww%+256,-1,"Warning",0
�)q%!108=TextWarn%:q%!112=-1:q%!116=300
� XQ%=q%!8-q%!0:YQ%=q%!12-q%!4
�*ș "Wimp_CreateWindow",,q% � warningW%
�ș "Wimp_CloseTemplate"

ref%=0
cpL%=0:cpR%=0
smpicon%=�icon
"wopen%=�:warnOn%=�
,InWin%=�
6LX%=-1:LY%=-1
@cr%=3:cb%=8
J	LED=�
TBiDi%=0
^
MiTime%=0
h� Enable the serial chip
r#ș"OS_SerialOp",0,&87,&FFFFFF78
|
*FX2,2
�
�� � �errorbox
��_UpP(2,0,1)
�
��setupmenu
�
��
� ș "Wimp_Poll",0,q% � A%
�
  Ȏ A% �
�   � 0:�_Null
�   � 1:�_doWindow
�O   � 2:ș"OS_ReadModeVariable",-1,3 � ,,Ncolours%: ș "Wimp_OpenWindow",,q%
�   � 3:�_close
!   � 4:InWin%=�:LX%=-1:LY%=-1
   � 5:InWin%=�
   � 6:�_do_click(q%)
&   � 7:
0   � 8:�_KeyPress
:   � 9:�_SORT_Menu
D   � 17,18:�receive(q%)
N   �
X � �
b
l�
v� �_Null
�� A%,B%,C%
�� �>MiTime% � wopen% �
��_Trans(monW%)
�� A%=1 � 2
�*� A%=2 � ș"OS_SerialOp",0,0,&FFFFFFF7
�B%=�_HSr
�8� B%<>PORT%(A%) � PORT%(A%)=B%:�_UpP(A%,PORT%(A%),1)
��
�"ș"OS_SerialOp",0,&8,&FFFFFFF7
�MiTime%=�+20
��
��
�
�� �_HSr
� A%,B%
(ș"OS_SerialOp",0,0,&FFFFFFFF � ,,A%
A%=((A%>>18) � &F) � &4
 !ș"OS_SerialOp",0,0,&FFFFFF7F
*(ș"OS_SerialOp",0,0,&FFFFFFFF � ,,B%
4B%=((B%>>14) � &F0) � &40
>#ș"OS_SerialOp",0,&80,&FFFFFF7F
H=A% � B%
R
\
f� �_spath(n$)
pȕ �n$,".")
zn$=�n$,�(n$)-1)
��
�� �(n$)>10 � n$=�n$,10)
�=n$
�
�� �_GetName
�� T%,A%,F$
�F$="":fn$=""
�q%!0=saveW%:q%!4=1
�ș "Wimp_GetIconState",,q%
�T%=q%!28
�	T%-=1
��
�	T%+=1
F$=F$+�(?T%)
� ?T%=0
fn$=�F$,1,�(F$)-1)
$�
.
8� �_SORT_Menu
B� IconMenu% �
LS� !q%=1 � menu%!52=1:menu%!76=0: LED=� :ș"Wimp_ForceRedraw",monW%,0,-300,700,0
VR� !q%=2 � menu%!52=0:menu%!76=1:LED=� :ș"Wimp_ForceRedraw",monW%,0,-300,700,0
`� !q%=3 � �die
j�
t�
~ș"Wimp_GetPointerInfo",,q%
�*� q%!8=1 � ș"Wimp_CreateMenu",,Wmenu%
��
�
�
� �_close
�7� q%!0=monW% � ș"Wimp_GetWindowInfo",,Wn%:wopen%=�
� � q%!0=warningW% � warnOn%=�
�ș "Wimp_CloseWindow",,q%
��
�
�� �_do_click(q%)
�i%=q%!16
�Ȏ q%!12 �
(� warningW%: q%!0=warningW% :�_close


(� -2: � Look first at Icon Bar Click
        � q%!16=smpicon% �
(J        � q%!8=2 � IconMenu%=�: ș"Wimp_CreateMenu",,menu%,q%!0-94,270
2        � q%!8=4 � �_Open
<
        �
F
P� monW%:  
Z'              � q%!8=4 � �_MonClick
d�
n�
x
�
�� �_MonClick
�� D%,V%,B%
�&� Do the action for a window click
��_Dp
�� cb%<8 � cr%<3 �
�  Ȏ cr% �
�'  � 2: PORT%(0)=PORT%(2) � 1<<(cb%)
�          MiTime%=0
�  �
��
��
�
� �_Open
.ș"OS_ReadModeVariable",-1,3 � ,,Ncolours%
� OPEN UP WINDOW HERE
"� wopen% �
,q%!0=monW%
6ș"Wimp_GetWindowState",,q%
@6  � q%!28<>-1 � q%!28=-1: ș "Wimp_OpenWindow",,q%
J�
Tș "Wimp_OpenWindow",,Wn%
^wopen%=�
h�
r�
|
�� �_doWindow
�  � A%,I%,L%
�
�   �_Trans(monW%)
�)   ș "Wimp_RedrawWindow",,q% � flag%
�     ȕ flag%
�
�     �_Dmpw
�+     ș "Wimp_GetRectangle",,q% � flag%
�
     �
�  
�  �
�
� �pointSq
� X%,Y%,B%,R%
�_Trans(monW%)
&ȗ X%,Y%,B%
0R%=0
:)� (X%<(xo%+30) � Y%<(yo%+30) ) � R%=1
D.� (X%>(xo%+246*xs%) � Y%<(yo%+30) ) � R%=2
N=R%
X
b� �_Dmpw
l� A%,B%,V%
v�_Trans(monW%)
�
�� B%=1 � 2
�� A%=0 � 7
�V%=PORT%(B%) � 1<<(7-A%)
��_WS(A%,B%,V%)
��
��_Hex(PORT%(B%),B%)
��
��5
�� A%=0 � 7
�� xo%+52+A%*40,yo%+106
�
�;7-A%
��
� xo%+140,yo%+194
�"Input A"
� xo%+140,yo%+274
 �"Input B"
*�4
4�
>
H� �_Hex(V%,Y%)
R� v$
\	Y%+=1
f9� LED � ș"Wimp_SetColour",10 � ș"Wimp_SetColour",15
p� Ncolours%<4 � � 0,0
z
�!ȓȐ xo%+380,yo1%+40*Y%,54,40
�ș"Wimp_SetColour",7
� ȓ xo%+ 380,yo1%+Y%*40,54,40
��5
�� xo%+384,yo1%+Y%*40+32
�"� V%<256 � v$=�~(V%) � v$="XX"
�� �(v$)=1 � v$="0"+v$
��"&";v$
��4
��
�
�� �_WS(X%,Y%,V%)
�� S%
		S%=40
	yo1%=yo%+Y%*S%
	� LED �
	$ș"Wimp_SetColour",7
	./ȏȐ 20+xo%+ S% + X%*S%,20+yo1%+S%+Y%*S%,16
	8
	B)� V%=0 � Nw%=� � ș"Wimp_SetColour",4
	L+� V%<>0 � Nw%=� � ș"Wimp_SetColour",11
	V"� Nw%=� � ș"Wimp_SetColour",7
	`
	j � Ncolours%<4 � V%=0 � � 0,0
	t.ȏȐ 20+xo%+S% + X%*S%,20+yo1%+S%+S%*Y%,10
	~
	��
	�2� Ncolours%>15 � � 0,45 � ș"Wimp_SetColour",0
	�+ȓȐ xo%+S% + X%*S%,yo1%+S%+S%*Y%,S%,S%
	�ș"Wimp_SetColour",7
	�*ȓ xo%+ S% + X%*S%,yo1%+S%+Y%*S%,S%,S%
	��5
	�'� xo%+S%+X%*S%+12,yo1%+S%*2+Y%*S%-8
	�� V%=0 � Nw%=� � �"0"
	�� V%<>0 � Nw%=� � �"1"
	�� Nw%=� � �"X"
	��4
	��
�


� �_UpP(P%,V%,M%)
� T%,A%,E%,Nw%
(3  q%!0=monW%:q%!4=0:q%!8=-400:q%!12=680:q%!16=0
2'  ș"Wimp_UpdateWindow",,q% � More%
<
F
 ȕ More%
P
Z+  � PORT%(1)>255 � P%=1 � Nw%=� � Nw%=�
d  � A%=0 � 7
n  T%=V% � 1<<(7-A%)
x  E%=PORT%(P%) � 1<<(7-A%)
�&  � T%<>E% � M%=1 � �_WS(A%,P%,T%)
�  �
�  �_Hex(V%,P%)
�  
�'  ș"Wimp_GetRectangle",,q% � More%
� �
�
��
�
�
� �_Wr
�� TY%,R%
� TY%=Y%-yo%
�	 R%=3
 � TY%>=40 � TY%<=80 � R%=0
! � TY%>=120 � TY%<=160 � R%=1
! � TY%>=200 � TY%<=240 � R%=2
"=R%
,
� �_Wb
6� B%
@B%=7-�((X%-xo%)/40-1)
J� B%>7 � B%<0 � B%=8
T=B%
^
h
� �_Dp
r� X%,Y%,B%,nr%,nb%
|ȗ X%,Y%,B%
�� X%<>LX% � Y%<>LY% �
� �_Trans(monW%)
� nr%=�_Wr : nb%=�_Wb
� � nr%<>cr% � nb%<>cb% �
�   cr%=nr%:cb%=nb%
�   �
� LX%=X%:LY%=Y%
��
��
�
�� �_Trans(wh%)
�!q%=wh%
� ș "Wimp_GetWindowState",,q%
(xo%=q%!4-q%!20+8:yo%=q%!16-q%!24-290
XO%=q%!4:YO%=q%!16
�
&
0��setupmenu
:� m%
D
N$menu%="PUPe"
Xmenu%?12=7
bmenu%?13=2
lmenu%?14=7
vmenu%?15=0
�menu%!16=128
�menu%!20=40
�menu%!24=0
�m%=menu%+28
�
m%!0=0
�m%!4=info%
�m%!8=(7<<24)� %10001
�$(m%+12)="Info"
�
�
m%+=24
�
m%!0=1
�
m%!4=0
�m%!8=(7<<24)� %10001

$(m%+12)="Binary"




m%+=24

 
m%!0=0

*
m%!4=0

4m%!8=(7<<24)� %10001

>$(m%+12)="LED"

H

R
m%+=24

\m%!0=&80

f
m%!4=0

pm%!8=(7<<24)� %10001

z$(m%+12)="Quit"

�

��

�

�� �receive(q%)

�� A%

�A%=q%!16

�Ȏ A% �

�� 0:�die

�� &502:   Ȏ � �

�z             � q%!32=-2 � q%!36=smpicon%:mes$="This is the PUPe Monitor icon.|MObserve the signals on the serial port"

�             :mes$=""

�             �

�    � mes$<>"" �
    q%!12=q%!8
    $(q%+20)=mes$+�0
    q%!0=(20+�mes$+4)� � 3
$    q%!16=&503
.(    ș "Wimp_SendMessage",18,q%,q%!4
8�
B�
L
V� �_Dack
`sendth%=q%!4
jmyref%=q%!8
t"ș "Wimp_GetPointerInfo",,q%+8
~q%!28=q%!8
�q%!32=q%!12
�q%!0=(44+�n$+4)� � 3
�q%!12=myref%
�q%!16=4
�q%!36=-1
�q%!40=&FF9
�$(q%+44)=n$+�0
�'ș "Wimp_SendMessage",17,q%,sendth%
��
��
�
�ݤsget(x%)
� x$

ȕ ?x% x$+=�(?x%):x%+=1:�
=x$

(
ݤicon
2q%!0=-1
<
q%!4=0
Fq%!8=10 : � Y DIRECTION
Pq%!12=70 : � X DIRECTION
Zq%!16=96
dq%!20=&2002
n$(q%+24)="!PUPe"
x$ș "Wimp_CreateIcon",,q% � icon%
�
=icon%
�
�� �_setupW(t$)
�X!q%=warningW%:q%!4=200:q%!8=200:q%!12=200+XQ%:q%!16=200+YQ%:q%!20=0:q%!24=0:q%!28=-1
�$TextWarn%=t$
�TextWarn%?�(t$)=0
�� 7
�
warnOn%=�
�ș "Wimp_OpenWindow",,q%
��
�
�� �errorbox
�ș "Wimp_DragBox",,-1
2!buffers%=�:$(buffers%+4)=�$+" at line "+Þ+�0
3ș "Wimp_ReportError",buffers%,1,"Port Monitor"
�die
"�
,
6	��die
@*ș "Wimp_CloseDown",taskhand%,!taskid%
J�
T�
^
h.� �dragicon(mousex%,mousey%,handle%,icon%)
r!� bx%,by%,ix0%,iy0%,ix1%,iy1%
|�getw(handle%)
��geti(handle%,icon%)
�!q%=handle%:q%!4=5
�>q%!8=bx%+ix0%:q%!12=by%+iy0%:q%!16=bx%+ix1%:q%!20=by%+iy1%
�*q%!24=q%!8-mousex%:q%!28=q%!12-mousey%
�ș "Wimp_DragBox",,q%
�SFLAG%=�
��
�
�� �getw(handle%)
�8!q%=handle%:ș "Wimp_GetWindowState",,q%:�info(q%+4)
��
�� �geti(h%,i%)
�-!q%=h%:q%!4=i%:ș "Wimp_GetIconState",,q%
.ix0%=q%!8:iy0%=q%!12:ix1%=q%!16:iy1%=q%!20
iflags%=q%!24:idata%=q%+28
�
&
0� �info(p%)
:
� x0%,y0%
D'x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12
N5scx%=p%!16:scy%=p%!20:bhandle%=p%!24:flags%=p%!28
Xbx%=x0%-scx%:by%=y1%-scy%
b�
l
v� �_KeyPress
�
Ȏ q%!0 �
�+� OTHERWISE: SYS"Wimp_ProcessKey",q%!24
��
��
�
�
00000000  0d 00 0a 21 f4 3e 44 65  76 65 6c 6f 70 2e 21 50  |...!.>Develop.!P|
00000010  55 50 65 2e 21 50 55 50  65 2e 52 75 6e 50 55 50  |UPe.!PUPe.RunPUP|
00000020  65 0d 00 14 44 f4 20 50  73 65 75 64 6f 20 55 73  |e...D. Pseudo Us|
00000030  65 72 20 50 6f 72 74 20  65 78 74 65 6e 64 65 64  |er Port extended|
00000040  2c 20 75 73 69 6e 67 20  73 65 72 69 61 6c 20 70  |, using serial p|
00000050  6f 72 74 20 68 61 6e 64  73 68 61 6b 69 6e 67 20  |ort handshaking |
00000060  6c 69 6e 65 73 0d 00 1e  1e f4 20 56 65 72 73 69  |lines..... Versi|
00000070  6f 6e 20 31 2e 30 20 42  79 20 4d 69 6b 65 20 43  |on 1.0 By Mike C|
00000080  6f 6f 6b 0d 00 28 19 f4  20 41 6c 6c 20 72 69 67  |ook..(.. All rig|
00000090  68 74 73 20 72 65 73 65  72 76 65 64 0d 00 32 11  |hts reserved..2.|
000000a0  ee 20 85 20 f2 65 72 72  6f 72 62 6f 78 0d 00 3c  |. . .errorbox..<|
000000b0  04 0d 00 46 1e de 20 74  61 73 6b 69 64 25 34 3a  |...F.. taskid%4:|
000000c0  24 74 61 73 6b 69 64 25  3d 22 54 41 53 4b 22 0d  |$taskid%="TASK".|
000000d0  00 50 3c de 20 50 4f 52  54 25 28 33 29 2c 20 50  |.P<. PORT%(3), P|
000000e0  69 6e 24 28 32 2c 37 29  2c 50 69 6e 4e 24 28 32  |in$(2,7),PinN$(2|
000000f0  2c 37 29 2c 50 69 6e 49  4f 24 28 32 2c 37 29 2c  |,7),PinIO$(2,7),|
00000100  69 6e 74 6d 65 73 73 25  20 32 30 0d 00 5a 49 69  |intmess% 20..ZIi|
00000110  6e 74 6d 65 73 73 25 21  30 3d 31 3a 69 6e 74 6d  |ntmess%!0=1:intm|
00000120  65 73 73 25 21 34 3d 32  3a 69 6e 74 6d 65 73 73  |ess%!4=2:intmess|
00000130  25 21 38 3d 33 3a 69 6e  74 6d 65 73 73 25 21 31  |%!8=3:intmess%!1|
00000140  32 3d 26 35 30 32 3a 69  6e 74 6d 65 73 73 25 21  |2=&502:intmess%!|
00000150  31 36 3d 30 0d 00 64 52  c8 99 20 22 57 69 6d 70  |16=0..dR.. "Wimp|
00000160  5f 49 6e 69 74 69 61 6c  69 73 65 22 2c 33 30 30  |_Initialise",300|
00000170  2c 21 74 61 73 6b 69 64  25 2c 22 50 55 50 20 65  |,!taskid%,"PUP e|
00000180  78 74 65 6e 64 65 64 22  2c 69 6e 74 6d 65 73 73  |xtended",intmess|
00000190  25 20 b8 20 76 65 72 73  69 6f 6e 25 2c 74 61 73  |% . version%,tas|
000001a0  6b 68 61 6e 64 25 0d 00  6e 4e de 20 71 25 20 26  |khand%..nN. q% &|
000001b0  33 30 30 2c 71 63 25 20  38 30 2c 20 57 6e 25 20  |300,qc% 80, Wn% |
000001c0  26 33 30 30 2c 74 65 6d  70 25 20 32 35 36 2c 62  |&300,temp% 256,b|
000001d0  75 66 66 65 72 73 25 20  35 31 32 2c 6d 65 6e 75  |uffers% 512,menu|
000001e0  25 20 31 32 38 2c 53 57  25 20 32 35 36 2c 63 62  |% 128,SW% 256,cb|
000001f0  25 20 31 38 0d 00 78 4b  de 20 49 73 4e 61 6d 65  |% 18..xK. IsName|
00000200  25 20 32 35 36 2c 20 57  6d 65 6e 75 25 20 35 31  |% 256, Wmenu% 51|
00000210  32 2c 53 6d 65 6e 75 25  20 32 35 36 2c 49 6d 65  |2,Smenu% 256,Ime|
00000220  6e 75 25 20 32 35 36 2c  20 54 65 78 74 57 61 72  |nu% 256, TextWar|
00000230  6e 25 20 31 30 30 2c 20  77 77 25 20 32 35 36 0d  |n% 100, ww% 256.|
00000240  00 82 32 c8 99 20 22 57  69 6d 70 5f 4f 70 65 6e  |..2.. "Wimp_Open|
00000250  54 65 6d 70 6c 61 74 65  22 2c 2c 22 3c 50 55 50  |Template",,"<PUP|
00000260  65 24 44 69 72 3e 2e 54  65 6d 70 6c 61 74 65 73  |e$Dir>.Templates|
00000270  22 0d 00 8c 29 ee 20 85  20 c8 99 20 22 57 69 6d  |"...). . .. "Wim|
00000280  70 5f 43 6c 6f 73 65 54  65 6d 70 6c 61 74 65 22  |p_CloseTemplate"|
00000290  3a f2 65 72 72 6f 72 62  6f 78 0d 00 96 3a c8 99  |:.errorbox...:..|
000002a0  20 22 57 69 6d 70 5f 4c  6f 61 64 54 65 6d 70 6c  | "Wimp_LoadTempl|
000002b0  61 74 65 22 2c 2c 71 25  2c 74 65 6d 70 25 2c 74  |ate",,q%,temp%,t|
000002c0  65 6d 70 25 2b 32 35 36  2c 2d 31 2c 22 49 6e 66  |emp%+256,-1,"Inf|
000002d0  6f 22 2c 30 0d 00 a0 26  c8 99 20 22 57 69 6d 70  |o",0...&.. "Wimp|
000002e0  5f 43 72 65 61 74 65 57  69 6e 64 6f 77 22 2c 2c  |_CreateWindow",,|
000002f0  71 25 20 b8 20 69 6e 66  6f 25 0d 00 aa 3d c8 99  |q% . info%...=..|
00000300  20 22 57 69 6d 70 5f 4c  6f 61 64 54 65 6d 70 6c  | "Wimp_LoadTempl|
00000310  61 74 65 22 2c 2c 57 6e  25 2b 34 2c 53 57 25 2c  |ate",,Wn%+4,SW%,|
00000320  53 57 25 2b 32 35 36 2c  2d 31 2c 22 50 61 6c 6c  |SW%+256,-1,"Pall|
00000330  65 74 74 65 22 2c 30 0d  00 b4 29 c8 99 20 22 57  |ette",0...).. "W|
00000340  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
00000350  22 2c 2c 57 6e 25 2b 34  20 b8 20 6d 6f 6e 57 25  |",,Wn%+4 . monW%|
00000360  0d 00 be 19 57 6e 25 21  30 3d 6d 6f 6e 57 25 3a  |....Wn%!0=monW%:|
00000370  57 6e 25 21 32 38 3d 2d  31 0d 00 c8 04 0d 00 d2  |Wn%!28=-1.......|
00000380  39 c8 99 20 22 57 69 6d  70 5f 4c 6f 61 64 54 65  |9.. "Wimp_LoadTe|
00000390  6d 70 6c 61 74 65 22 2c  2c 71 25 2c 77 77 25 2c  |mplate",,q%,ww%,|
000003a0  77 77 25 2b 32 35 36 2c  2d 31 2c 22 57 61 72 6e  |ww%+256,-1,"Warn|
000003b0  69 6e 67 22 2c 30 0d 00  dc 29 71 25 21 31 30 38  |ing",0...)q%!108|
000003c0  3d 54 65 78 74 57 61 72  6e 25 3a 71 25 21 31 31  |=TextWarn%:q%!11|
000003d0  32 3d 2d 31 3a 71 25 21  31 31 36 3d 33 30 30 0d  |2=-1:q%!116=300.|
000003e0  00 e6 20 58 51 25 3d 71  25 21 38 2d 71 25 21 30  |.. XQ%=q%!8-q%!0|
000003f0  3a 59 51 25 3d 71 25 21  31 32 2d 71 25 21 34 0d  |:YQ%=q%!12-q%!4.|
00000400  00 f0 2a c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |..*.. "Wimp_Crea|
00000410  74 65 57 69 6e 64 6f 77  22 2c 2c 71 25 20 b8 20  |teWindow",,q% . |
00000420  77 61 72 6e 69 6e 67 57  25 0d 00 fa 1b c8 99 20  |warningW%...... |
00000430  22 57 69 6d 70 5f 43 6c  6f 73 65 54 65 6d 70 6c  |"Wimp_CloseTempl|
00000440  61 74 65 22 0d 01 04 0a  72 65 66 25 3d 30 0d 01  |ate"....ref%=0..|
00000450  0e 11 63 70 4c 25 3d 30  3a 63 70 52 25 3d 30 0d  |..cpL%=0:cpR%=0.|
00000460  01 18 12 73 6d 70 69 63  6f 6e 25 3d a4 69 63 6f  |...smpicon%=.ico|
00000470  6e 0d 01 22 16 77 6f 70  65 6e 25 3d a3 3a 77 61  |n..".wopen%=.:wa|
00000480  72 6e 4f 6e 25 3d a3 0d  01 2c 0c 49 6e 57 69 6e  |rnOn%=...,.InWin|
00000490  25 3d a3 0d 01 36 11 4c  58 25 3d 2d 31 3a 4c 59  |%=...6.LX%=-1:LY|
000004a0  25 3d 2d 31 0d 01 40 0f  63 72 25 3d 33 3a 63 62  |%=-1..@.cr%=3:cb|
000004b0  25 3d 38 0d 01 4a 09 4c  45 44 3d a3 0d 01 54 0b  |%=8..J.LED=...T.|
000004c0  42 69 44 69 25 3d 30 0d  01 5e 0d 4d 69 54 69 6d  |BiDi%=0..^.MiTim|
000004d0  65 25 3d 30 0d 01 68 1c  f4 20 45 6e 61 62 6c 65  |e%=0..h.. Enable|
000004e0  20 74 68 65 20 73 65 72  69 61 6c 20 63 68 69 70  | the serial chip|
000004f0  0d 01 72 23 c8 99 22 4f  53 5f 53 65 72 69 61 6c  |..r#.."OS_Serial|
00000500  4f 70 22 2c 30 2c 26 38  37 2c 26 46 46 46 46 46  |Op",0,&87,&FFFFF|
00000510  46 37 38 0d 01 7c 0a 2a  46 58 32 2c 32 0d 01 86  |F78..|.*FX2,2...|
00000520  04 0d 01 90 11 ee 20 85  20 f2 65 72 72 6f 72 62  |...... . .errorb|
00000530  6f 78 0d 01 9a 10 f2 5f  55 70 50 28 32 2c 30 2c  |ox....._UpP(2,0,|
00000540  31 29 0d 01 a4 04 0d 01  ae 0e f2 73 65 74 75 70  |1).........setup|
00000550  6d 65 6e 75 0d 01 b8 04  0d 01 c2 05 f5 0d 01 cc  |menu............|
00000560  1d 20 c8 99 20 22 57 69  6d 70 5f 50 6f 6c 6c 22  |. .. "Wimp_Poll"|
00000570  2c 30 2c 71 25 20 b8 20  41 25 0d 01 d6 0d 20 20  |,0,q% . A%....  |
00000580  c8 8e 20 41 25 20 ca 0d  01 e0 11 20 20 20 c9 20  |.. A% .....   . |
00000590  30 3a f2 5f 4e 75 6c 6c  0d 01 ea 15 20 20 20 c9  |0:._Null....   .|
000005a0  20 31 3a f2 5f 64 6f 57  69 6e 64 6f 77 0d 01 f4  | 1:._doWindow...|
000005b0  4f 20 20 20 c9 20 32 3a  c8 99 22 4f 53 5f 52 65  |O   . 2:.."OS_Re|
000005c0  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
000005d0  2d 31 2c 33 20 b8 20 2c  2c 4e 63 6f 6c 6f 75 72  |-1,3 . ,,Ncolour|
000005e0  73 25 3a 20 c8 99 20 22  57 69 6d 70 5f 4f 70 65  |s%: .. "Wimp_Ope|
000005f0  6e 57 69 6e 64 6f 77 22  2c 2c 71 25 0d 01 fe 12  |nWindow",,q%....|
00000600  20 20 20 c9 20 33 3a f2  5f 63 6c 6f 73 65 0d 02  |   . 3:._close..|
00000610  08 21 20 20 20 c9 20 34  3a 49 6e 57 69 6e 25 3d  |.!   . 4:InWin%=|
00000620  a3 3a 4c 58 25 3d 2d 31  3a 4c 59 25 3d 2d 31 0d  |.:LX%=-1:LY%=-1.|
00000630  02 12 13 20 20 20 c9 20  35 3a 49 6e 57 69 6e 25  |...   . 5:InWin%|
00000640  3d b9 0d 02 1c 19 20 20  20 c9 20 36 3a f2 5f 64  |=.....   . 6:._d|
00000650  6f 5f 63 6c 69 63 6b 28  71 25 29 0d 02 26 0b 20  |o_click(q%)..&. |
00000660  20 20 c9 20 37 3a 0d 02  30 15 20 20 20 c9 20 38  |  . 7:..0.   . 8|
00000670  3a f2 5f 4b 65 79 50 72  65 73 73 0d 02 3a 16 20  |:._KeyPress..:. |
00000680  20 20 c9 20 39 3a f2 5f  53 4f 52 54 5f 4d 65 6e  |  . 9:._SORT_Men|
00000690  75 0d 02 44 1b 20 20 20  c9 20 31 37 2c 31 38 3a  |u..D.   . 17,18:|
000006a0  f2 72 65 63 65 69 76 65  28 71 25 29 0d 02 4e 08  |.receive(q%)..N.|
000006b0  20 20 20 cb 0d 02 58 08  20 fd 20 a3 0d 02 62 04  |   ...X. . ...b.|
000006c0  0d 02 6c 05 e0 0d 02 76  0c dd 20 f2 5f 4e 75 6c  |..l....v.. ._Nul|
000006d0  6c 0d 02 80 0e ea 20 41  25 2c 42 25 2c 43 25 0d  |l..... A%,B%,C%.|
000006e0  02 8a 1a e7 20 91 3e 4d  69 54 69 6d 65 25 20 80  |.... .>MiTime% .|
000006f0  20 77 6f 70 65 6e 25 20  8c 0d 02 94 12 f2 5f 54  | wopen% ......_T|
00000700  72 61 6e 73 28 6d 6f 6e  57 25 29 0d 02 95 0e e3  |rans(monW%).....|
00000710  20 41 25 3d 31 20 b8 20  32 0d 02 9e 2a e7 20 41  | A%=1 . 2...*. A|
00000720  25 3d 32 20 8c 20 c8 99  22 4f 53 5f 53 65 72 69  |%=2 . .."OS_Seri|
00000730  61 6c 4f 70 22 2c 30 2c  30 2c 26 46 46 46 46 46  |alOp",0,0,&FFFFF|
00000740  46 46 37 0d 02 a8 0c 42  25 3d a4 5f 48 53 72 0d  |FF7....B%=._HSr.|
00000750  02 b2 38 e7 20 42 25 3c  3e 50 4f 52 54 25 28 41  |..8. B%<>PORT%(A|
00000760  25 29 20 8c 20 50 4f 52  54 25 28 41 25 29 3d 42  |%) . PORT%(A%)=B|
00000770  25 3a f2 5f 55 70 50 28  41 25 2c 50 4f 52 54 25  |%:._UpP(A%,PORT%|
00000780  28 41 25 29 2c 31 29 0d  02 bc 05 ed 0d 02 c6 22  |(A%),1)........"|
00000790  c8 99 22 4f 53 5f 53 65  72 69 61 6c 4f 70 22 2c  |.."OS_SerialOp",|
000007a0  30 2c 26 38 2c 26 46 46  46 46 46 46 46 37 0d 02  |0,&8,&FFFFFFF7..|
000007b0  d0 10 4d 69 54 69 6d 65  25 3d 91 2b 32 30 0d 02  |..MiTime%=.+20..|
000007c0  da 05 cd 0d 02 e4 05 e1  0d 02 ee 04 0d 02 f8 0b  |................|
000007d0  dd 20 a4 5f 48 53 72 0d  03 02 0b ea 20 41 25 2c  |. ._HSr..... A%,|
000007e0  42 25 0d 03 0c 28 c8 99  22 4f 53 5f 53 65 72 69  |B%...(.."OS_Seri|
000007f0  61 6c 4f 70 22 2c 30 2c  30 2c 26 46 46 46 46 46  |alOp",0,0,&FFFFF|
00000800  46 46 46 20 b8 20 2c 2c  41 25 0d 03 16 1b 41 25  |FFF . ,,A%....A%|
00000810  3d 28 28 41 25 3e 3e 31  38 29 20 80 20 26 46 29  |=((A%>>18) . &F)|
00000820  20 82 20 26 34 0d 03 20  21 c8 99 22 4f 53 5f 53  | . &4.. !.."OS_S|
00000830  65 72 69 61 6c 4f 70 22  2c 30 2c 30 2c 26 46 46  |erialOp",0,0,&FF|
00000840  46 46 46 46 37 46 0d 03  2a 28 c8 99 22 4f 53 5f  |FFFF7F..*(.."OS_|
00000850  53 65 72 69 61 6c 4f 70  22 2c 30 2c 30 2c 26 46  |SerialOp",0,0,&F|
00000860  46 46 46 46 46 46 46 20  b8 20 2c 2c 42 25 0d 03  |FFFFFFF . ,,B%..|
00000870  34 1d 42 25 3d 28 28 42  25 3e 3e 31 34 29 20 80  |4.B%=((B%>>14) .|
00000880  20 26 46 30 29 20 82 20  26 34 30 0d 03 3e 23 c8  | &F0) . &40..>#.|
00000890  99 22 4f 53 5f 53 65 72  69 61 6c 4f 70 22 2c 30  |."OS_SerialOp",0|
000008a0  2c 26 38 30 2c 26 46 46  46 46 46 46 37 46 0d 03  |,&80,&FFFFFF7F..|
000008b0  48 0c 3d 41 25 20 84 20  42 25 0d 03 52 04 0d 03  |H.=A% . B%..R...|
000008c0  5c 04 0d 03 66 11 dd 20  a4 5f 73 70 61 74 68 28  |\...f.. ._spath(|
000008d0  6e 24 29 0d 03 70 0f c8  95 20 a7 6e 24 2c 22 2e  |n$)..p... .n$,".|
000008e0  22 29 0d 03 7a 13 6e 24  3d c2 6e 24 2c a9 28 6e  |")..z.n$=.n$,.(n|
000008f0  24 29 2d 31 29 0d 03 84  05 ce 0d 03 8e 1b e7 20  |$)-1).......... |
00000900  a9 28 6e 24 29 3e 31 30  20 8c 20 6e 24 3d c2 6e  |.(n$)>10 . n$=.n|
00000910  24 2c 31 30 29 0d 03 98  07 3d 6e 24 0d 03 a2 04  |$,10)....=n$....|
00000920  0d 03 ac 0f dd 20 f2 5f  47 65 74 4e 61 6d 65 0d  |..... ._GetName.|
00000930  03 b6 0e ea 20 54 25 2c  41 25 2c 46 24 0d 03 c0  |.... T%,A%,F$...|
00000940  10 46 24 3d 22 22 3a 66  6e 24 3d 22 22 0d 03 ca  |.F$="":fn$=""...|
00000950  16 71 25 21 30 3d 73 61  76 65 57 25 3a 71 25 21  |.q%!0=saveW%:q%!|
00000960  34 3d 31 0d 03 d4 1e c8  99 20 22 57 69 6d 70 5f  |4=1...... "Wimp_|
00000970  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 71  |GetIconState",,q|
00000980  25 0d 03 de 0c 54 25 3d  71 25 21 32 38 0d 03 e8  |%....T%=q%!28...|
00000990  09 54 25 2d 3d 31 0d 03  f2 05 f5 0d 03 fc 09 54  |.T%-=1.........T|
000009a0  25 2b 3d 31 0d 04 06 10  46 24 3d 46 24 2b bd 28  |%+=1....F$=F$+.(|
000009b0  3f 54 25 29 0d 04 10 0b  fd 20 3f 54 25 3d 30 0d  |?T%)..... ?T%=0.|
000009c0  04 1a 16 66 6e 24 3d c1  46 24 2c 31 2c a9 28 46  |...fn$=.F$,1,.(F|
000009d0  24 29 2d 31 29 0d 04 24  05 e1 0d 04 2e 04 0d 04  |$)-1)..$........|
000009e0  38 11 dd 20 f2 5f 53 4f  52 54 5f 4d 65 6e 75 0d  |8.. ._SORT_Menu.|
000009f0  04 42 11 e7 20 49 63 6f  6e 4d 65 6e 75 25 20 8c  |.B.. IconMenu% .|
00000a00  0d 04 4c 53 e7 20 21 71  25 3d 31 20 8c 20 6d 65  |..LS. !q%=1 . me|
00000a10  6e 75 25 21 35 32 3d 31  3a 6d 65 6e 75 25 21 37  |nu%!52=1:menu%!7|
00000a20  36 3d 30 3a 20 4c 45 44  3d a3 20 3a c8 99 22 57  |6=0: LED=. :.."W|
00000a30  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00000a40  2c 6d 6f 6e 57 25 2c 30  2c 2d 33 30 30 2c 37 30  |,monW%,0,-300,70|
00000a50  30 2c 30 0d 04 56 52 e7  20 21 71 25 3d 32 20 8c  |0,0..VR. !q%=2 .|
00000a60  20 6d 65 6e 75 25 21 35  32 3d 30 3a 6d 65 6e 75  | menu%!52=0:menu|
00000a70  25 21 37 36 3d 31 3a 4c  45 44 3d b9 20 3a c8 99  |%!76=1:LED=. :..|
00000a80  22 57 69 6d 70 5f 46 6f  72 63 65 52 65 64 72 61  |"Wimp_ForceRedra|
00000a90  77 22 2c 6d 6f 6e 57 25  2c 30 2c 2d 33 30 30 2c  |w",monW%,0,-300,|
00000aa0  37 30 30 2c 30 0d 04 60  12 e7 20 21 71 25 3d 33  |700,0..`.. !q%=3|
00000ab0  20 8c 20 f2 64 69 65 0d  04 6a 05 cb 0d 04 74 05  | . .die..j....t.|
00000ac0  cd 0d 04 7e 1f c8 99 22  57 69 6d 70 5f 47 65 74  |...~..."Wimp_Get|
00000ad0  50 6f 69 6e 74 65 72 49  6e 66 6f 22 2c 2c 71 25  |PointerInfo",,q%|
00000ae0  0d 04 88 2a e7 20 71 25  21 38 3d 31 20 8c 20 c8  |...*. q%!8=1 . .|
00000af0  99 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  |."Wimp_CreateMen|
00000b00  75 22 2c 2c 57 6d 65 6e  75 25 0d 04 92 05 e1 0d  |u",,Wmenu%......|
00000b10  04 9c 04 0d 04 a6 0d dd  20 f2 5f 63 6c 6f 73 65  |........ ._close|
00000b20  0d 04 b0 37 e7 20 71 25  21 30 3d 6d 6f 6e 57 25  |...7. q%!0=monW%|
00000b30  20 8c 20 c8 99 22 57 69  6d 70 5f 47 65 74 57 69  | . .."Wimp_GetWi|
00000b40  6e 64 6f 77 49 6e 66 6f  22 2c 2c 57 6e 25 3a 77  |ndowInfo",,Wn%:w|
00000b50  6f 70 65 6e 25 3d a3 0d  04 ba 20 e7 20 71 25 21  |open%=.... . q%!|
00000b60  30 3d 77 61 72 6e 69 6e  67 57 25 20 8c 20 77 61  |0=warningW% . wa|
00000b70  72 6e 4f 6e 25 3d a3 0d  04 c4 1d c8 99 20 22 57  |rnOn%=....... "W|
00000b80  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
00000b90  2c 2c 71 25 0d 04 ce 05  e1 0d 04 d8 04 0d 04 e2  |,,q%............|
00000ba0  14 dd 20 f2 5f 64 6f 5f  63 6c 69 63 6b 28 71 25  |.. ._do_click(q%|
00000bb0  29 0d 04 ec 0c 69 25 3d  71 25 21 31 36 0d 04 f6  |)....i%=q%!16...|
00000bc0  0e c8 8e 20 71 25 21 31  32 20 ca 0d 05 00 28 c9  |... q%!12 ....(.|
00000bd0  20 77 61 72 6e 69 6e 67  57 25 3a 20 71 25 21 30  | warningW%: q%!0|
00000be0  3d 77 61 72 6e 69 6e 67  57 25 20 3a f2 5f 63 6c  |=warningW% :._cl|
00000bf0  6f 73 65 0d 05 0a 04 0d  05 14 28 c9 20 2d 32 3a  |ose.......(. -2:|
00000c00  20 f4 20 4c 6f 6f 6b 20  66 69 72 73 74 20 61 74  | . Look first at|
00000c10  20 49 63 6f 6e 20 42 61  72 20 43 6c 69 63 6b 0d  | Icon Bar Click.|
00000c20  05 1e 1e 20 20 20 20 20  20 20 20 e7 20 71 25 21  |...        . q%!|
00000c30  31 36 3d 73 6d 70 69 63  6f 6e 25 20 8c 0d 05 28  |16=smpicon% ...(|
00000c40  4a 20 20 20 20 20 20 20  20 e7 20 71 25 21 38 3d  |J        . q%!8=|
00000c50  32 20 8c 20 49 63 6f 6e  4d 65 6e 75 25 3d b9 3a  |2 . IconMenu%=.:|
00000c60  20 c8 99 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  | .."Wimp_CreateM|
00000c70  65 6e 75 22 2c 2c 6d 65  6e 75 25 2c 71 25 21 30  |enu",,menu%,q%!0|
00000c80  2d 39 34 2c 32 37 30 0d  05 32 1d 20 20 20 20 20  |-94,270..2.     |
00000c90  20 20 20 e7 20 71 25 21  38 3d 34 20 8c 20 f2 5f  |   . q%!8=4 . ._|
00000ca0  4f 70 65 6e 0d 05 3c 0d  20 20 20 20 20 20 20 20  |Open..<.        |
00000cb0  cd 0d 05 46 04 0d 05 50  0e c9 20 6d 6f 6e 57 25  |...F...P.. monW%|
00000cc0  3a 20 20 0d 05 5a 27 20  20 20 20 20 20 20 20 20  |:  ..Z'         |
00000cd0  20 20 20 20 20 e7 20 71  25 21 38 3d 34 20 8c 20  |     . q%!8=4 . |
00000ce0  f2 5f 4d 6f 6e 43 6c 69  63 6b 0d 05 64 05 cb 0d  |._MonClick..d...|
00000cf0  05 6e 05 e1 0d 05 78 04  0d 05 82 04 0d 05 8c 10  |.n....x.........|
00000d00  dd 20 f2 5f 4d 6f 6e 43  6c 69 63 6b 0d 05 96 0e  |. ._MonClick....|
00000d10  ea 20 44 25 2c 56 25 2c  42 25 0d 05 a0 26 f4 20  |. D%,V%,B%...&. |
00000d20  44 6f 20 74 68 65 20 61  63 74 69 6f 6e 20 66 6f  |Do the action fo|
00000d30  72 20 61 20 77 69 6e 64  6f 77 20 63 6c 69 63 6b  |r a window click|
00000d40  0d 05 aa 08 f2 5f 44 70  0d 05 b4 15 e7 20 63 62  |....._Dp..... cb|
00000d50  25 3c 38 20 80 20 63 72  25 3c 33 20 8c 0d 05 be  |%<8 . cr%<3 ....|
00000d60  0e 20 20 c8 8e 20 63 72  25 20 ca 0d 05 c8 27 20  |.  .. cr% ....' |
00000d70  20 c9 20 32 3a 20 50 4f  52 54 25 28 30 29 3d 50  | . 2: PORT%(0)=P|
00000d80  4f 52 54 25 28 32 29 20  82 20 31 3c 3c 28 63 62  |ORT%(2) . 1<<(cb|
00000d90  25 29 0d 05 d2 17 20 20  20 20 20 20 20 20 20 20  |%)....          |
00000da0  4d 69 54 69 6d 65 25 3d  30 0d 05 dc 07 20 20 cb  |MiTime%=0....  .|
00000db0  0d 05 e6 05 cd 0d 05 f0  05 e1 0d 05 fa 04 0d 06  |................|
00000dc0  04 0c dd 20 f2 5f 4f 70  65 6e 0d 06 0e 2e c8 99  |... ._Open......|
00000dd0  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
00000de0  61 62 6c 65 22 2c 2d 31  2c 33 20 b8 20 2c 2c 4e  |able",-1,3 . ,,N|
00000df0  63 6f 6c 6f 75 72 73 25  0d 06 18 19 f4 20 4f 50  |colours%..... OP|
00000e00  45 4e 20 55 50 20 57 49  4e 44 4f 57 20 48 45 52  |EN UP WINDOW HER|
00000e10  45 0d 06 22 0e e7 20 77  6f 70 65 6e 25 20 8c 0d  |E..".. wopen% ..|
00000e20  06 2c 0e 71 25 21 30 3d  6d 6f 6e 57 25 0d 06 36  |.,.q%!0=monW%..6|
00000e30  1f c8 99 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |..."Wimp_GetWind|
00000e40  6f 77 53 74 61 74 65 22  2c 2c 71 25 0d 06 40 36  |owState",,q%..@6|
00000e50  20 20 e7 20 71 25 21 32  38 3c 3e 2d 31 20 8c 20  |  . q%!28<>-1 . |
00000e60  71 25 21 32 38 3d 2d 31  3a 20 c8 99 20 22 57 69  |q%!28=-1: .. "Wi|
00000e70  6d 70 5f 4f 70 65 6e 57  69 6e 64 6f 77 22 2c 2c  |mp_OpenWindow",,|
00000e80  71 25 0d 06 4a 05 cc 0d  06 54 1d c8 99 20 22 57  |q%..J....T... "W|
00000e90  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
00000ea0  2c 57 6e 25 0d 06 5e 0c  77 6f 70 65 6e 25 3d b9  |,Wn%..^.wopen%=.|
00000eb0  0d 06 68 05 cd 0d 06 72  05 e1 0d 06 7c 04 0d 06  |..h....r....|...|
00000ec0  86 10 dd 20 f2 5f 64 6f  57 69 6e 64 6f 77 0d 06  |... ._doWindow..|
00000ed0  90 10 20 20 ea 20 41 25  2c 49 25 2c 4c 25 0d 06  |..  . A%,I%,L%..|
00000ee0  9a 04 0d 06 a4 15 20 20  20 f2 5f 54 72 61 6e 73  |......   ._Trans|
00000ef0  28 6d 6f 6e 57 25 29 0d  06 ae 29 20 20 20 c8 99  |(monW%)...)   ..|
00000f00  20 22 57 69 6d 70 5f 52  65 64 72 61 77 57 69 6e  | "Wimp_RedrawWin|
00000f10  64 6f 77 22 2c 2c 71 25  20 b8 20 66 6c 61 67 25  |dow",,q% . flag%|
00000f20  0d 06 b8 11 20 20 20 20  20 c8 95 20 66 6c 61 67  |....     .. flag|
00000f30  25 0d 06 c2 04 0d 06 cc  0f 20 20 20 20 20 f2 5f  |%........     ._|
00000f40  44 6d 70 77 0d 06 d6 2b  20 20 20 20 20 c8 99 20  |Dmpw...+     .. |
00000f50  22 57 69 6d 70 5f 47 65  74 52 65 63 74 61 6e 67  |"Wimp_GetRectang|
00000f60  6c 65 22 2c 2c 71 25 20  b8 20 66 6c 61 67 25 0d  |le",,q% . flag%.|
00000f70  06 e0 0a 20 20 20 20 20  ce 0d 06 ea 06 20 20 0d  |...     .....  .|
00000f80  06 f4 07 20 20 e1 0d 06  fe 04 0d 07 08 0e dd 20  |...  .......... |
00000f90  a4 70 6f 69 6e 74 53 71  0d 07 12 11 ea 20 58 25  |.pointSq..... X%|
00000fa0  2c 59 25 2c 42 25 2c 52  25 0d 07 1c 12 f2 5f 54  |,Y%,B%,R%....._T|
00000fb0  72 61 6e 73 28 6d 6f 6e  57 25 29 0d 07 26 0f c8  |rans(monW%)..&..|
00000fc0  97 20 58 25 2c 59 25 2c  42 25 0d 07 30 08 52 25  |. X%,Y%,B%..0.R%|
00000fd0  3d 30 0d 07 3a 29 e7 20  28 58 25 3c 28 78 6f 25  |=0..:). (X%<(xo%|
00000fe0  2b 33 30 29 20 80 20 59  25 3c 28 79 6f 25 2b 33  |+30) . Y%<(yo%+3|
00000ff0  30 29 20 29 20 8c 20 52  25 3d 31 0d 07 44 2e e7  |0) ) . R%=1..D..|
00001000  20 28 58 25 3e 28 78 6f  25 2b 32 34 36 2a 78 73  | (X%>(xo%+246*xs|
00001010  25 29 20 80 20 59 25 3c  28 79 6f 25 2b 33 30 29  |%) . Y%<(yo%+30)|
00001020  20 29 20 8c 20 52 25 3d  32 0d 07 4e 07 3d 52 25  | ) . R%=2..N.=R%|
00001030  0d 07 58 04 0d 07 62 0c  dd 20 f2 5f 44 6d 70 77  |..X...b.. ._Dmpw|
00001040  0d 07 6c 0e ea 20 41 25  2c 42 25 2c 56 25 0d 07  |..l.. A%,B%,V%..|
00001050  76 12 f2 5f 54 72 61 6e  73 28 6d 6f 6e 57 25 29  |v.._Trans(monW%)|
00001060  0d 07 80 04 0d 07 8a 0e  e3 20 42 25 3d 31 20 b8  |......... B%=1 .|
00001070  20 32 0d 07 94 0e e3 20  41 25 3d 30 20 b8 20 37  | 2..... A%=0 . 7|
00001080  0d 07 9e 1c 56 25 3d 50  4f 52 54 25 28 42 25 29  |....V%=PORT%(B%)|
00001090  20 80 20 31 3c 3c 28 37  2d 41 25 29 0d 07 a8 12  | . 1<<(7-A%)....|
000010a0  f2 5f 57 53 28 41 25 2c  42 25 2c 56 25 29 0d 07  |._WS(A%,B%,V%)..|
000010b0  b2 05 ed 0d 07 bc 17 f2  5f 48 65 78 28 50 4f 52  |........_Hex(POR|
000010c0  54 25 28 42 25 29 2c 42  25 29 0d 07 c6 05 ed 0d  |T%(B%),B%)......|
000010d0  07 d0 06 ef 35 0d 07 da  0e e3 20 41 25 3d 30 20  |....5..... A%=0 |
000010e0  b8 20 37 0d 07 e4 1a ec  20 78 6f 25 2b 35 32 2b  |. 7..... xo%+52+|
000010f0  41 25 2a 34 30 2c 79 6f  25 2b 31 30 36 0d 07 ee  |A%*40,yo%+106...|
00001100  0a f1 3b 37 2d 41 25 0d  07 f8 05 ed 0d 08 02 15  |..;7-A%.........|
00001110  ec 20 78 6f 25 2b 31 34  30 2c 79 6f 25 2b 31 39  |. xo%+140,yo%+19|
00001120  34 0d 08 0c 0e f1 22 49  6e 70 75 74 20 41 22 0d  |4....."Input A".|
00001130  08 16 15 ec 20 78 6f 25  2b 31 34 30 2c 79 6f 25  |.... xo%+140,yo%|
00001140  2b 32 37 34 0d 08 20 0e  f1 22 49 6e 70 75 74 20  |+274.. .."Input |
00001150  42 22 0d 08 2a 06 ef 34  0d 08 34 05 e1 0d 08 3e  |B"..*..4..4....>|
00001160  04 0d 08 48 12 dd 20 f2  5f 48 65 78 28 56 25 2c  |...H.. ._Hex(V%,|
00001170  59 25 29 0d 08 52 08 ea  20 76 24 0d 08 5c 09 59  |Y%)..R.. v$..\.Y|
00001180  25 2b 3d 31 0d 08 66 39  e7 20 4c 45 44 20 8c 20  |%+=1..f9. LED . |
00001190  c8 99 22 57 69 6d 70 5f  53 65 74 43 6f 6c 6f 75  |.."Wimp_SetColou|
000011a0  72 22 2c 31 30 20 8b 20  c8 99 22 57 69 6d 70 5f  |r",10 . .."Wimp_|
000011b0  53 65 74 43 6f 6c 6f 75  72 22 2c 31 35 0d 08 70  |SetColour",15..p|
000011c0  19 e7 20 4e 63 6f 6c 6f  75 72 73 25 3c 34 20 8c  |.. Ncolours%<4 .|
000011d0  20 e6 20 30 2c 30 0d 08  7a 04 0d 08 84 21 c8 93  | . 0,0..z....!..|
000011e0  c8 90 20 78 6f 25 2b 33  38 30 2c 79 6f 31 25 2b  |.. xo%+380,yo1%+|
000011f0  34 30 2a 59 25 2c 35 34  2c 34 30 0d 08 8e 18 c8  |40*Y%,54,40.....|
00001200  99 22 57 69 6d 70 5f 53  65 74 43 6f 6c 6f 75 72  |."Wimp_SetColour|
00001210  22 2c 37 0d 08 98 20 c8  93 20 78 6f 25 2b 20 33  |",7... .. xo%+ 3|
00001220  38 30 2c 79 6f 31 25 2b  59 25 2a 34 30 2c 35 34  |80,yo1%+Y%*40,54|
00001230  2c 34 30 0d 08 a2 06 ef  35 0d 08 ac 1b ec 20 78  |,40.....5..... x|
00001240  6f 25 2b 33 38 34 2c 79  6f 31 25 2b 59 25 2a 34  |o%+384,yo1%+Y%*4|
00001250  30 2b 33 32 0d 08 b6 22  e7 20 56 25 3c 32 35 36  |0+32...". V%<256|
00001260  20 8c 20 76 24 3d c3 7e  28 56 25 29 20 8b 20 76  | . v$=.~(V%) . v|
00001270  24 3d 22 58 58 22 0d 08  c0 19 e7 20 a9 28 76 24  |$="XX"..... .(v$|
00001280  29 3d 31 20 8c 20 76 24  3d 22 30 22 2b 76 24 0d  |)=1 . v$="0"+v$.|
00001290  08 ca 0b f1 22 26 22 3b  76 24 0d 08 d4 06 ef 34  |...."&";v$.....4|
000012a0  0d 08 de 05 e1 0d 08 e8  04 0d 08 f2 14 dd 20 f2  |.............. .|
000012b0  5f 57 53 28 58 25 2c 59  25 2c 56 25 29 0d 08 fc  |_WS(X%,Y%,V%)...|
000012c0  08 ea 20 53 25 0d 09 06  09 53 25 3d 34 30 0d 09  |.. S%....S%=40..|
000012d0  10 12 79 6f 31 25 3d 79  6f 25 2b 59 25 2a 53 25  |..yo1%=yo%+Y%*S%|
000012e0  0d 09 1a 0b e7 20 4c 45  44 20 8c 0d 09 24 18 c8  |..... LED ...$..|
000012f0  99 22 57 69 6d 70 5f 53  65 74 43 6f 6c 6f 75 72  |."Wimp_SetColour|
00001300  22 2c 37 0d 09 2e 2f c8  8f c8 90 20 32 30 2b 78  |",7.../.... 20+x|
00001310  6f 25 2b 20 53 25 20 2b  20 58 25 2a 53 25 2c 32  |o%+ S% + X%*S%,2|
00001320  30 2b 79 6f 31 25 2b 53  25 2b 59 25 2a 53 25 2c  |0+yo1%+S%+Y%*S%,|
00001330  31 36 0d 09 38 04 0d 09  42 29 e7 20 56 25 3d 30  |16..8...B). V%=0|
00001340  20 80 20 4e 77 25 3d a3  20 8c 20 c8 99 22 57 69  | . Nw%=. . .."Wi|
00001350  6d 70 5f 53 65 74 43 6f  6c 6f 75 72 22 2c 34 0d  |mp_SetColour",4.|
00001360  09 4c 2b e7 20 56 25 3c  3e 30 20 80 20 4e 77 25  |.L+. V%<>0 . Nw%|
00001370  3d a3 20 8c 20 c8 99 22  57 69 6d 70 5f 53 65 74  |=. . .."Wimp_Set|
00001380  43 6f 6c 6f 75 72 22 2c  31 31 0d 09 56 22 e7 20  |Colour",11..V". |
00001390  4e 77 25 3d b9 20 8c 20  c8 99 22 57 69 6d 70 5f  |Nw%=. . .."Wimp_|
000013a0  53 65 74 43 6f 6c 6f 75  72 22 2c 37 0d 09 60 04  |SetColour",7..`.|
000013b0  0d 09 6a 20 e7 20 4e 63  6f 6c 6f 75 72 73 25 3c  |..j . Ncolours%<|
000013c0  34 20 80 20 56 25 3d 30  20 8c 20 e6 20 30 2c 30  |4 . V%=0 . . 0,0|
000013d0  0d 09 74 2e c8 8f c8 90  20 32 30 2b 78 6f 25 2b  |..t..... 20+xo%+|
000013e0  53 25 20 2b 20 58 25 2a  53 25 2c 32 30 2b 79 6f  |S% + X%*S%,20+yo|
000013f0  31 25 2b 53 25 2b 53 25  2a 59 25 2c 31 30 0d 09  |1%+S%+S%*Y%,10..|
00001400  7e 04 0d 09 88 05 cc 0d  09 92 32 e7 20 4e 63 6f  |~.........2. Nco|
00001410  6c 6f 75 72 73 25 3e 31  35 20 8c 20 e6 20 30 2c  |lours%>15 . . 0,|
00001420  34 35 20 8b 20 c8 99 22  57 69 6d 70 5f 53 65 74  |45 . .."Wimp_Set|
00001430  43 6f 6c 6f 75 72 22 2c  30 0d 09 9c 2b c8 93 c8  |Colour",0...+...|
00001440  90 20 78 6f 25 2b 53 25  20 2b 20 58 25 2a 53 25  |. xo%+S% + X%*S%|
00001450  2c 79 6f 31 25 2b 53 25  2b 53 25 2a 59 25 2c 53  |,yo1%+S%+S%*Y%,S|
00001460  25 2c 53 25 0d 09 a6 18  c8 99 22 57 69 6d 70 5f  |%,S%......"Wimp_|
00001470  53 65 74 43 6f 6c 6f 75  72 22 2c 37 0d 09 b0 2a  |SetColour",7...*|
00001480  c8 93 20 78 6f 25 2b 20  53 25 20 2b 20 58 25 2a  |.. xo%+ S% + X%*|
00001490  53 25 2c 79 6f 31 25 2b  53 25 2b 59 25 2a 53 25  |S%,yo1%+S%+Y%*S%|
000014a0  2c 53 25 2c 53 25 0d 09  ba 06 ef 35 0d 09 c4 27  |,S%,S%.....5...'|
000014b0  ec 20 78 6f 25 2b 53 25  2b 58 25 2a 53 25 2b 31  |. xo%+S%+X%*S%+1|
000014c0  32 2c 79 6f 31 25 2b 53  25 2a 32 2b 59 25 2a 53  |2,yo1%+S%*2+Y%*S|
000014d0  25 2d 38 0d 09 ce 19 e7  20 56 25 3d 30 20 80 20  |%-8..... V%=0 . |
000014e0  4e 77 25 3d a3 20 8c 20  f1 22 30 22 0d 09 d8 1a  |Nw%=. . ."0"....|
000014f0  e7 20 56 25 3c 3e 30 20  80 20 4e 77 25 3d a3 20  |. V%<>0 . Nw%=. |
00001500  8c 20 f1 22 31 22 0d 09  e2 12 e7 20 4e 77 25 3d  |. ."1"..... Nw%=|
00001510  b9 20 8c 20 f1 22 58 22  0d 09 ec 06 ef 34 0d 09  |. . ."X".....4..|
00001520  f6 05 cd 0d 0a 00 05 e1  0d 0a 0a 04 0d 0a 14 15  |................|
00001530  dd 20 f2 5f 55 70 50 28  50 25 2c 56 25 2c 4d 25  |. ._UpP(P%,V%,M%|
00001540  29 0d 0a 1e 12 ea 20 54  25 2c 41 25 2c 45 25 2c  |)..... T%,A%,E%,|
00001550  4e 77 25 0d 0a 28 33 20  20 71 25 21 30 3d 6d 6f  |Nw%..(3  q%!0=mo|
00001560  6e 57 25 3a 71 25 21 34  3d 30 3a 71 25 21 38 3d  |nW%:q%!4=0:q%!8=|
00001570  2d 34 30 30 3a 71 25 21  31 32 3d 36 38 30 3a 71  |-400:q%!12=680:q|
00001580  25 21 31 36 3d 30 0d 0a  32 27 20 20 c8 99 22 57  |%!16=0..2'  .."W|
00001590  69 6d 70 5f 55 70 64 61  74 65 57 69 6e 64 6f 77  |imp_UpdateWindow|
000015a0  22 2c 2c 71 25 20 b8 20  4d 6f 72 65 25 0d 0a 3c  |",,q% . More%..<|
000015b0  04 0d 0a 46 0d 20 c8 95  20 4d 6f 72 65 25 0d 0a  |...F. .. More%..|
000015c0  50 04 0d 0a 5a 2b 20 20  e7 20 50 4f 52 54 25 28  |P...Z+  . PORT%(|
000015d0  31 29 3e 32 35 35 20 80  20 50 25 3d 31 20 8c 20  |1)>255 . P%=1 . |
000015e0  4e 77 25 3d b9 20 8b 20  4e 77 25 3d a3 0d 0a 64  |Nw%=. . Nw%=...d|
000015f0  10 20 20 e3 20 41 25 3d  30 20 b8 20 37 0d 0a 6e  |.  . A%=0 . 7..n|
00001600  17 20 20 54 25 3d 56 25  20 80 20 31 3c 3c 28 37  |.  T%=V% . 1<<(7|
00001610  2d 41 25 29 0d 0a 78 1e  20 20 45 25 3d 50 4f 52  |-A%)..x.  E%=POR|
00001620  54 25 28 50 25 29 20 80  20 31 3c 3c 28 37 2d 41  |T%(P%) . 1<<(7-A|
00001630  25 29 0d 0a 82 26 20 20  e7 20 54 25 3c 3e 45 25  |%)...&  . T%<>E%|
00001640  20 84 20 4d 25 3d 31 20  8c 20 f2 5f 57 53 28 41  | . M%=1 . ._WS(A|
00001650  25 2c 50 25 2c 54 25 29  0d 0a 8c 07 20 20 ed 0d  |%,P%,T%)....  ..|
00001660  0a 96 12 20 20 f2 5f 48  65 78 28 56 25 2c 50 25  |...  ._Hex(V%,P%|
00001670  29 0d 0a a0 06 20 20 0d  0a aa 27 20 20 c8 99 22  |)....  ...'  .."|
00001680  57 69 6d 70 5f 47 65 74  52 65 63 74 61 6e 67 6c  |Wimp_GetRectangl|
00001690  65 22 2c 2c 71 25 20 b8  20 4d 6f 72 65 25 0d 0a  |e",,q% . More%..|
000016a0  b4 06 20 ce 0d 0a be 04  0d 0a c8 05 e1 0d 0a d2  |.. .............|
000016b0  04 0d 0a dc 0a dd 20 a4  5f 57 72 0d 0a e6 0c ea  |...... ._Wr.....|
000016c0  20 54 59 25 2c 52 25 0d  0a f0 0f 20 54 59 25 3d  | TY%,R%.... TY%=|
000016d0  59 25 2d 79 6f 25 0d 0a  fa 09 20 52 25 3d 33 0d  |Y%-yo%.... R%=3.|
000016e0  0b 04 1f 20 e7 20 54 59  25 3e 3d 34 30 20 80 20  |... . TY%>=40 . |
000016f0  54 59 25 3c 3d 38 30 20  8c 20 52 25 3d 30 0d 0b  |TY%<=80 . R%=0..|
00001700  0e 21 20 e7 20 54 59 25  3e 3d 31 32 30 20 80 20  |.! . TY%>=120 . |
00001710  54 59 25 3c 3d 31 36 30  20 8c 20 52 25 3d 31 0d  |TY%<=160 . R%=1.|
00001720  0b 18 21 20 e7 20 54 59  25 3e 3d 32 30 30 20 80  |..! . TY%>=200 .|
00001730  20 54 59 25 3c 3d 32 34  30 20 8c 20 52 25 3d 32  | TY%<=240 . R%=2|
00001740  0d 0b 22 07 3d 52 25 0d  0b 2c 0a dd 20 a4 5f 57  |..".=R%..,.. ._W|
00001750  62 0d 0b 36 08 ea 20 42  25 0d 0b 40 19 42 25 3d  |b..6.. B%..@.B%=|
00001760  37 2d a8 28 28 58 25 2d  78 6f 25 29 2f 34 30 2d  |7-.((X%-xo%)/40-|
00001770  31 29 0d 0b 4a 18 e7 20  42 25 3e 37 20 84 20 42  |1)..J.. B%>7 . B|
00001780  25 3c 30 20 8c 20 42 25  3d 38 0d 0b 54 07 3d 42  |%<0 . B%=8..T.=B|
00001790  25 0d 0b 5e 04 0d 0b 68  0a dd 20 f2 5f 44 70 0d  |%..^...h.. ._Dp.|
000017a0  0b 72 16 ea 20 58 25 2c  59 25 2c 42 25 2c 6e 72  |.r.. X%,Y%,B%,nr|
000017b0  25 2c 6e 62 25 0d 0b 7c  0f c8 97 20 58 25 2c 59  |%,nb%..|... X%,Y|
000017c0  25 2c 42 25 0d 0b 86 19  e7 20 58 25 3c 3e 4c 58  |%,B%..... X%<>LX|
000017d0  25 20 84 20 59 25 3c 3e  4c 59 25 20 8c 0d 0b 90  |% . Y%<>LY% ....|
000017e0  13 20 f2 5f 54 72 61 6e  73 28 6d 6f 6e 57 25 29  |. ._Trans(monW%)|
000017f0  0d 0b 9a 18 20 6e 72 25  3d a4 5f 57 72 20 3a 20  |.... nr%=._Wr : |
00001800  6e 62 25 3d a4 5f 57 62  0d 0b a4 1c 20 e7 20 6e  |nb%=._Wb.... . n|
00001810  72 25 3c 3e 63 72 25 20  84 20 6e 62 25 3c 3e 63  |r%<>cr% . nb%<>c|
00001820  62 25 20 8c 0d 0b ae 16  20 20 20 63 72 25 3d 6e  |b% .....   cr%=n|
00001830  72 25 3a 63 62 25 3d 6e  62 25 0d 0b b8 08 20 20  |r%:cb%=nb%....  |
00001840  20 cd 0d 0b c2 12 20 4c  58 25 3d 58 25 3a 4c 59  | ..... LX%=X%:LY|
00001850  25 3d 59 25 0d 0b cc 05  cd 0d 0b d6 05 e1 0d 0b  |%=Y%............|
00001860  e0 04 0d 0b ea 12 dd 20  f2 5f 54 72 61 6e 73 28  |....... ._Trans(|
00001870  77 68 25 29 0d 0b f4 0b  21 71 25 3d 77 68 25 0d  |wh%)....!q%=wh%.|
00001880  0b fe 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |.. .. "Wimp_GetW|
00001890  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 71 25 0d  |indowState",,q%.|
000018a0  0c 08 28 78 6f 25 3d 71  25 21 34 2d 71 25 21 32  |..(xo%=q%!4-q%!2|
000018b0  30 2b 38 3a 79 6f 25 3d  71 25 21 31 36 2d 71 25  |0+8:yo%=q%!16-q%|
000018c0  21 32 34 2d 32 39 30 0d  0c 12 16 58 4f 25 3d 71  |!24-290....XO%=q|
000018d0  25 21 34 3a 59 4f 25 3d  71 25 21 31 36 0d 0c 1c  |%!4:YO%=q%!16...|
000018e0  05 e1 0d 0c 26 04 0d 0c  30 0f dd f2 73 65 74 75  |....&...0...setu|
000018f0  70 6d 65 6e 75 0d 0c 3a  08 ea 20 6d 25 0d 0c 44  |pmenu..:.. m%..D|
00001900  04 0d 0c 4e 11 24 6d 65  6e 75 25 3d 22 50 55 50  |...N.$menu%="PUP|
00001910  65 22 0d 0c 58 0e 6d 65  6e 75 25 3f 31 32 3d 37  |e"..X.menu%?12=7|
00001920  0d 0c 62 0e 6d 65 6e 75  25 3f 31 33 3d 32 0d 0c  |..b.menu%?13=2..|
00001930  6c 0e 6d 65 6e 75 25 3f  31 34 3d 37 0d 0c 76 0e  |l.menu%?14=7..v.|
00001940  6d 65 6e 75 25 3f 31 35  3d 30 0d 0c 80 10 6d 65  |menu%?15=0....me|
00001950  6e 75 25 21 31 36 3d 31  32 38 0d 0c 8a 0f 6d 65  |nu%!16=128....me|
00001960  6e 75 25 21 32 30 3d 34  30 0d 0c 94 0e 6d 65 6e  |nu%!20=40....men|
00001970  75 25 21 32 34 3d 30 0d  0c 9e 0f 6d 25 3d 6d 65  |u%!24=0....m%=me|
00001980  6e 75 25 2b 32 38 0d 0c  a8 0a 6d 25 21 30 3d 30  |nu%+28....m%!0=0|
00001990  0d 0c b2 0e 6d 25 21 34  3d 69 6e 66 6f 25 0d 0c  |....m%!4=info%..|
000019a0  bc 18 6d 25 21 38 3d 28  37 3c 3c 32 34 29 84 20  |..m%!8=(7<<24). |
000019b0  25 31 30 30 30 31 0d 0c  c6 13 24 28 6d 25 2b 31  |%10001....$(m%+1|
000019c0  32 29 3d 22 49 6e 66 6f  22 0d 0c d0 04 0d 0c da  |2)="Info".......|
000019d0  0a 6d 25 2b 3d 32 34 0d  0c e4 0a 6d 25 21 30 3d  |.m%+=24....m%!0=|
000019e0  31 0d 0c ee 0a 6d 25 21  34 3d 30 0d 0c f8 18 6d  |1....m%!4=0....m|
000019f0  25 21 38 3d 28 37 3c 3c  32 34 29 84 20 25 31 30  |%!8=(7<<24). %10|
00001a00  30 30 31 0d 0d 02 15 24  28 6d 25 2b 31 32 29 3d  |001....$(m%+12)=|
00001a10  22 42 69 6e 61 72 79 22  0d 0d 0c 04 0d 0d 16 0a  |"Binary"........|
00001a20  6d 25 2b 3d 32 34 0d 0d  20 0a 6d 25 21 30 3d 30  |m%+=24.. .m%!0=0|
00001a30  0d 0d 2a 0a 6d 25 21 34  3d 30 0d 0d 34 18 6d 25  |..*.m%!4=0..4.m%|
00001a40  21 38 3d 28 37 3c 3c 32  34 29 84 20 25 31 30 30  |!8=(7<<24). %100|
00001a50  30 31 0d 0d 3e 12 24 28  6d 25 2b 31 32 29 3d 22  |01..>.$(m%+12)="|
00001a60  4c 45 44 22 0d 0d 48 04  0d 0d 52 0a 6d 25 2b 3d  |LED"..H...R.m%+=|
00001a70  32 34 0d 0d 5c 0c 6d 25  21 30 3d 26 38 30 0d 0d  |24..\.m%!0=&80..|
00001a80  66 0a 6d 25 21 34 3d 30  0d 0d 70 18 6d 25 21 38  |f.m%!4=0..p.m%!8|
00001a90  3d 28 37 3c 3c 32 34 29  84 20 25 31 30 30 30 31  |=(7<<24). %10001|
00001aa0  0d 0d 7a 13 24 28 6d 25  2b 31 32 29 3d 22 51 75  |..z.$(m%+12)="Qu|
00001ab0  69 74 22 0d 0d 84 04 0d  0d 8e 05 e1 0d 0d 98 04  |it".............|
00001ac0  0d 0d a2 12 dd 20 f2 72  65 63 65 69 76 65 28 71  |..... .receive(q|
00001ad0  25 29 0d 0d ac 08 ea 20  41 25 0d 0d b6 0c 41 25  |%)..... A%....A%|
00001ae0  3d 71 25 21 31 36 0d 0d  c0 0b c8 8e 20 41 25 20  |=q%!16...... A% |
00001af0  ca 0d 0d ca 0c c9 20 30  3a f2 64 69 65 0d 0d d4  |...... 0:.die...|
00001b00  14 c9 20 26 35 30 32 3a  20 20 20 c8 8e 20 b9 20  |.. &502:   .. . |
00001b10  ca 0d 0d de 7a 20 20 20  20 20 20 20 20 20 20 20  |....z           |
00001b20  20 20 c9 20 71 25 21 33  32 3d 2d 32 20 80 20 71  |  . q%!32=-2 . q|
00001b30  25 21 33 36 3d 73 6d 70  69 63 6f 6e 25 3a 6d 65  |%!36=smpicon%:me|
00001b40  73 24 3d 22 54 68 69 73  20 69 73 20 74 68 65 20  |s$="This is the |
00001b50  50 55 50 65 20 4d 6f 6e  69 74 6f 72 20 69 63 6f  |PUPe Monitor ico|
00001b60  6e 2e 7c 4d 4f 62 73 65  72 76 65 20 74 68 65 20  |n.|MObserve the |
00001b70  73 69 67 6e 61 6c 73 20  6f 6e 20 74 68 65 20 73  |signals on the s|
00001b80  65 72 69 61 6c 20 70 6f  72 74 22 0d 0d e8 1a 20  |erial port".... |
00001b90  20 20 20 20 20 20 20 20  20 20 20 20 7f 3a 6d 65  |            .:me|
00001ba0  73 24 3d 22 22 0d 0d f2  12 20 20 20 20 20 20 20  |s$=""....       |
00001bb0  20 20 20 20 20 20 cb 0d  0d fc 14 20 20 20 20 e7  |      .....    .|
00001bc0  20 6d 65 73 24 3c 3e 22  22 20 8c 0d 0e 06 12 20  | mes$<>"" ..... |
00001bd0  20 20 20 71 25 21 31 32  3d 71 25 21 38 0d 0e 10  |   q%!12=q%!8...|
00001be0  18 20 20 20 20 24 28 71  25 2b 32 30 29 3d 6d 65  |.    $(q%+20)=me|
00001bf0  73 24 2b bd 30 0d 0e 1a  1e 20 20 20 20 71 25 21  |s$+.0....    q%!|
00001c00  30 3d 28 32 30 2b a9 6d  65 73 24 2b 34 29 80 20  |0=(20+.mes$+4). |
00001c10  ac 20 33 0d 0e 24 12 20  20 20 20 71 25 21 31 36  |. 3..$.    q%!16|
00001c20  3d 26 35 30 33 0d 0e 2e  28 20 20 20 20 c8 99 20  |=&503...(    .. |
00001c30  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00001c40  65 22 2c 31 38 2c 71 25  2c 71 25 21 34 0d 0e 38  |e",18,q%,q%!4..8|
00001c50  05 cb 0d 0e 42 05 e1 0d  0e 4c 04 0d 0e 56 0c dd  |....B....L...V..|
00001c60  20 f2 5f 44 61 63 6b 0d  0e 60 10 73 65 6e 64 74  | ._Dack..`.sendt|
00001c70  68 25 3d 71 25 21 34 0d  0e 6a 0f 6d 79 72 65 66  |h%=q%!4..j.myref|
00001c80  25 3d 71 25 21 38 0d 0e  74 22 c8 99 20 22 57 69  |%=q%!8..t".. "Wi|
00001c90  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
00001ca0  6f 22 2c 2c 71 25 2b 38  0d 0e 7e 0e 71 25 21 32  |o",,q%+8..~.q%!2|
00001cb0  38 3d 71 25 21 38 0d 0e  88 0f 71 25 21 33 32 3d  |8=q%!8....q%!32=|
00001cc0  71 25 21 31 32 0d 0e 92  18 71 25 21 30 3d 28 34  |q%!12....q%!0=(4|
00001cd0  34 2b a9 6e 24 2b 34 29  80 20 ac 20 33 0d 0e 9c  |4+.n$+4). . 3...|
00001ce0  10 71 25 21 31 32 3d 6d  79 72 65 66 25 0d 0e a6  |.q%!12=myref%...|
00001cf0  0b 71 25 21 31 36 3d 34  0d 0e b0 0c 71 25 21 33  |.q%!16=4....q%!3|
00001d00  36 3d 2d 31 0d 0e ba 0e  71 25 21 34 30 3d 26 46  |6=-1....q%!40=&F|
00001d10  46 39 0d 0e c4 12 24 28  71 25 2b 34 34 29 3d 6e  |F9....$(q%+44)=n|
00001d20  24 2b bd 30 0d 0e ce 27  c8 99 20 22 57 69 6d 70  |$+.0...'.. "Wimp|
00001d30  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 31 37  |_SendMessage",17|
00001d40  2c 71 25 2c 73 65 6e 64  74 68 25 0d 0e d8 05 cd  |,q%,sendth%.....|
00001d50  0d 0e e2 05 e1 0d 0e ec  04 0d 0e f6 0e dd a4 73  |...............s|
00001d60  67 65 74 28 78 25 29 0d  0f 00 08 ea 20 78 24 0d  |get(x%)..... x$.|
00001d70  0f 0a 1d c8 95 20 3f 78  25 20 78 24 2b 3d bd 28  |..... ?x% x$+=.(|
00001d80  3f 78 25 29 3a 78 25 2b  3d 31 3a ce 0d 0f 14 07  |?x%):x%+=1:.....|
00001d90  3d 78 24 0d 0f 1e 04 0d  0f 28 0a dd a4 69 63 6f  |=x$......(...ico|
00001da0  6e 0d 0f 32 0b 71 25 21  30 3d 2d 31 0d 0f 3c 0a  |n..2.q%!0=-1..<.|
00001db0  71 25 21 34 3d 30 0d 0f  46 1b 71 25 21 38 3d 31  |q%!4=0..F.q%!8=1|
00001dc0  30 20 3a 20 f4 20 59 20  44 49 52 45 43 54 49 4f  |0 : . Y DIRECTIO|
00001dd0  4e 0d 0f 50 1c 71 25 21  31 32 3d 37 30 20 3a 20  |N..P.q%!12=70 : |
00001de0  f4 20 58 20 44 49 52 45  43 54 49 4f 4e 0d 0f 5a  |. X DIRECTION..Z|
00001df0  0c 71 25 21 31 36 3d 39  36 0d 0f 64 0f 71 25 21  |.q%!16=96..d.q%!|
00001e00  32 30 3d 26 32 30 30 32  0d 0f 6e 14 24 28 71 25  |20=&2002..n.$(q%|
00001e10  2b 32 34 29 3d 22 21 50  55 50 65 22 0d 0f 78 24  |+24)="!PUPe"..x$|
00001e20  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |.. "Wimp_CreateI|
00001e30  63 6f 6e 22 2c 2c 71 25  20 b8 20 69 63 6f 6e 25  |con",,q% . icon%|
00001e40  0d 0f 82 0a 3d 69 63 6f  6e 25 0d 0f 8c 04 0d 0f  |....=icon%......|
00001e50  96 12 dd 20 f2 5f 73 65  74 75 70 57 28 74 24 29  |... ._setupW(t$)|
00001e60  0d 0f a0 58 21 71 25 3d  77 61 72 6e 69 6e 67 57  |...X!q%=warningW|
00001e70  25 3a 71 25 21 34 3d 32  30 30 3a 71 25 21 38 3d  |%:q%!4=200:q%!8=|
00001e80  32 30 30 3a 71 25 21 31  32 3d 32 30 30 2b 58 51  |200:q%!12=200+XQ|
00001e90  25 3a 71 25 21 31 36 3d  32 30 30 2b 59 51 25 3a  |%:q%!16=200+YQ%:|
00001ea0  71 25 21 32 30 3d 30 3a  71 25 21 32 34 3d 30 3a  |q%!20=0:q%!24=0:|
00001eb0  71 25 21 32 38 3d 2d 31  0d 0f aa 11 24 54 65 78  |q%!28=-1....$Tex|
00001ec0  74 57 61 72 6e 25 3d 74  24 0d 0f b4 15 54 65 78  |tWarn%=t$....Tex|
00001ed0  74 57 61 72 6e 25 3f a9  28 74 24 29 3d 30 0d 0f  |tWarn%?.(t$)=0..|
00001ee0  be 07 ef 20 37 0d 0f c8  0d 77 61 72 6e 4f 6e 25  |... 7....warnOn%|
00001ef0  3d b9 0d 0f d2 1c c8 99  20 22 57 69 6d 70 5f 4f  |=....... "Wimp_O|
00001f00  70 65 6e 57 69 6e 64 6f  77 22 2c 2c 71 25 0d 0f  |penWindow",,q%..|
00001f10  dc 05 e1 0d 0f e6 04 0d  0f f0 0f dd 20 f2 65 72  |............ .er|
00001f20  72 6f 72 62 6f 78 0d 0f  fa 19 c8 99 20 22 57 69  |rorbox...... "Wi|
00001f30  6d 70 5f 44 72 61 67 42  6f 78 22 2c 2c 2d 31 0d  |mp_DragBox",,-1.|
00001f40  10 04 32 21 62 75 66 66  65 72 73 25 3d 9f 3a 24  |..2!buffers%=.:$|
00001f50  28 62 75 66 66 65 72 73  25 2b 34 29 3d f6 24 2b  |(buffers%+4)=.$+|
00001f60  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 9e 2b bd  |" at line "+..+.|
00001f70  30 0d 10 0e 33 c8 99 20  22 57 69 6d 70 5f 52 65  |0...3.. "Wimp_Re|
00001f80  70 6f 72 74 45 72 72 6f  72 22 2c 62 75 66 66 65  |portError",buffe|
00001f90  72 73 25 2c 31 2c 22 50  6f 72 74 20 4d 6f 6e 69  |rs%,1,"Port Moni|
00001fa0  74 6f 72 22 0d 10 18 08  f2 64 69 65 0d 10 22 05  |tor".....die..".|
00001fb0  e1 0d 10 2c 04 0d 10 36  09 dd f2 64 69 65 0d 10  |...,...6...die..|
00001fc0  40 2a c8 99 20 22 57 69  6d 70 5f 43 6c 6f 73 65  |@*.. "Wimp_Close|
00001fd0  44 6f 77 6e 22 2c 74 61  73 6b 68 61 6e 64 25 2c  |Down",taskhand%,|
00001fe0  21 74 61 73 6b 69 64 25  0d 10 4a 05 e0 0d 10 54  |!taskid%..J....T|
00001ff0  05 e1 0d 10 5e 04 0d 10  68 2e dd 20 f2 64 72 61  |....^...h.. .dra|
00002000  67 69 63 6f 6e 28 6d 6f  75 73 65 78 25 2c 6d 6f  |gicon(mousex%,mo|
00002010  75 73 65 79 25 2c 68 61  6e 64 6c 65 25 2c 69 63  |usey%,handle%,ic|
00002020  6f 6e 25 29 0d 10 72 21  ea 20 62 78 25 2c 62 79  |on%)..r!. bx%,by|
00002030  25 2c 69 78 30 25 2c 69  79 30 25 2c 69 78 31 25  |%,ix0%,iy0%,ix1%|
00002040  2c 69 79 31 25 0d 10 7c  12 f2 67 65 74 77 28 68  |,iy1%..|..getw(h|
00002050  61 6e 64 6c 65 25 29 0d  10 86 18 f2 67 65 74 69  |andle%).....geti|
00002060  28 68 61 6e 64 6c 65 25  2c 69 63 6f 6e 25 29 0d  |(handle%,icon%).|
00002070  10 90 16 21 71 25 3d 68  61 6e 64 6c 65 25 3a 71  |...!q%=handle%:q|
00002080  25 21 34 3d 35 0d 10 9a  3e 71 25 21 38 3d 62 78  |%!4=5...>q%!8=bx|
00002090  25 2b 69 78 30 25 3a 71  25 21 31 32 3d 62 79 25  |%+ix0%:q%!12=by%|
000020a0  2b 69 79 30 25 3a 71 25  21 31 36 3d 62 78 25 2b  |+iy0%:q%!16=bx%+|
000020b0  69 78 31 25 3a 71 25 21  32 30 3d 62 79 25 2b 69  |ix1%:q%!20=by%+i|
000020c0  79 31 25 0d 10 a4 2a 71  25 21 32 34 3d 71 25 21  |y1%...*q%!24=q%!|
000020d0  38 2d 6d 6f 75 73 65 78  25 3a 71 25 21 32 38 3d  |8-mousex%:q%!28=|
000020e0  71 25 21 31 32 2d 6d 6f  75 73 65 79 25 0d 10 ae  |q%!12-mousey%...|
000020f0  19 c8 99 20 22 57 69 6d  70 5f 44 72 61 67 42 6f  |... "Wimp_DragBo|
00002100  78 22 2c 2c 71 25 0d 10  b8 0c 53 46 4c 41 47 25  |x",,q%....SFLAG%|
00002110  3d b9 0d 10 c2 05 e1 0d  10 cc 04 0d 10 d6 14 dd  |=...............|
00002120  20 f2 67 65 74 77 28 68  61 6e 64 6c 65 25 29 0d  | .getw(handle%).|
00002130  10 e0 38 21 71 25 3d 68  61 6e 64 6c 65 25 3a c8  |..8!q%=handle%:.|
00002140  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
00002150  77 53 74 61 74 65 22 2c  2c 71 25 3a f2 69 6e 66  |wState",,q%:.inf|
00002160  6f 28 71 25 2b 34 29 0d  10 ea 05 e1 0d 10 f4 12  |o(q%+4).........|
00002170  dd 20 f2 67 65 74 69 28  68 25 2c 69 25 29 0d 10  |. .geti(h%,i%)..|
00002180  fe 2d 21 71 25 3d 68 25  3a 71 25 21 34 3d 69 25  |.-!q%=h%:q%!4=i%|
00002190  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  |:.. "Wimp_GetIco|
000021a0  6e 53 74 61 74 65 22 2c  2c 71 25 0d 11 08 2e 69  |nState",,q%....i|
000021b0  78 30 25 3d 71 25 21 38  3a 69 79 30 25 3d 71 25  |x0%=q%!8:iy0%=q%|
000021c0  21 31 32 3a 69 78 31 25  3d 71 25 21 31 36 3a 69  |!12:ix1%=q%!16:i|
000021d0  79 31 25 3d 71 25 21 32  30 0d 11 12 1e 69 66 6c  |y1%=q%!20....ifl|
000021e0  61 67 73 25 3d 71 25 21  32 34 3a 69 64 61 74 61  |ags%=q%!24:idata|
000021f0  25 3d 71 25 2b 32 38 0d  11 1c 05 e1 0d 11 26 04  |%=q%+28.......&.|
00002200  0d 11 30 0f dd 20 f2 69  6e 66 6f 28 70 25 29 0d  |..0.. .info(p%).|
00002210  11 3a 0d ea 20 78 30 25  2c 79 30 25 0d 11 44 27  |.:.. x0%,y0%..D'|
00002220  78 30 25 3d 21 70 25 3a  79 30 25 3d 70 25 21 34  |x0%=!p%:y0%=p%!4|
00002230  3a 78 31 25 3d 70 25 21  38 3a 79 31 25 3d 70 25  |:x1%=p%!8:y1%=p%|
00002240  21 31 32 0d 11 4e 35 73  63 78 25 3d 70 25 21 31  |!12..N5scx%=p%!1|
00002250  36 3a 73 63 79 25 3d 70  25 21 32 30 3a 62 68 61  |6:scy%=p%!20:bha|
00002260  6e 64 6c 65 25 3d 70 25  21 32 34 3a 66 6c 61 67  |ndle%=p%!24:flag|
00002270  73 25 3d 70 25 21 32 38  0d 11 58 1d 62 78 25 3d  |s%=p%!28..X.bx%=|
00002280  78 30 25 2d 73 63 78 25  3a 62 79 25 3d 79 31 25  |x0%-scx%:by%=y1%|
00002290  2d 73 63 79 25 0d 11 62  05 e1 0d 11 6c 04 0d 11  |-scy%..b....l...|
000022a0  76 10 dd 20 f2 5f 4b 65  79 50 72 65 73 73 0d 11  |v.. ._KeyPress..|
000022b0  80 0d c8 8e 20 71 25 21  30 20 ca 0d 11 8a 2b f4  |.... q%!0 ....+.|
000022c0  20 4f 54 48 45 52 57 49  53 45 3a 20 53 59 53 22  | OTHERWISE: SYS"|
000022d0  57 69 6d 70 5f 50 72 6f  63 65 73 73 4b 65 79 22  |Wimp_ProcessKey"|
000022e0  2c 71 25 21 32 34 0d 11  94 05 cb 0d 11 9e 05 e1  |,q%!24..........|
000022f0  0d 11 a8 04 0d ff                                 |......|
000022f6