Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199609.adf » Extras » Educ/!To-Mars/!Runimage
Educ/!To-Mars/!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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199609.adf » Extras |
Filename: | Educ/!To-Mars/!Runimage |
Read OK: | ✔ |
File size: | D147 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM Ultimap v 2.00 (30 March 1995) 20REM LEN Simon Hayles 1994 30 40 HIMEM=&40000 50 DIM taskid% 4:$taskid%="TASK" 60 SYS "Wimp_Initialise",200,!taskid%,"Ultimap" TO version%,task_handle% 70 80 ON ERROR PROCerrorbox 90 100 PROCvars 110 120 SYS "OS_Module",16,"Ubase%Ultimap" 130 *UBASE 40000 800000 140 150 REM global variables 160 170 DIM box% 12,box2% 12,matrix% 16,origin1% 8,origin2% 8 180 icon_font$="Homerton.Medium" 190 full_name$="Untitled" 200 query_string$="" 210 menu%=0 220 sprite_size%=&1E000 230 DIM q% 256,old_q% 256 240 DIM errblk% 3000 250 DIM main% 1000,sprites% sprite_size% 260 !sprites%=sprite_size%:sprites%!8=16:SYS spop%,&209,sprites% 270 DIM wimp_palette% 20*4 280 DIM page_stack% 1024 290 300 s_sprites%=1 310 s_draw%=2 320 s_replay%=3 330 s_quicktime%=4 340 s_fonts%=5 350 s_starcoms%=6 360 s_loadorder%=7 370 s_sounds%=8 380 s_text%=9 390 s_pages%=10 400 410 s_clicks%=11 420 s_mousedrag%=12 430 s_often%=13 440 s_pointer%=14 450 s_mouse%=15 460 s_pageshown%=16 470 s_spare%=17 480 s_clickson%=18 490 s_temp%=19 500 s_sequences%=20 510 520 REM options 530 540 printing%=FALSE 550 portrait%=FALSE 560 current_page%=0 570 margin%=16 580 click_time=1 590 click_pause=1 600 temp_list%=0 610 trying%=TRUE 620 speaking_text%=FALSE 630 speak_sound%=FALSE 640 speak_token%=FALSE 650 h_scroll%=TRUE 660 v_scroll%=TRUE 670 toggle_icon%=TRUE 680 title_bar%=TRUE 690 scanning%=FALSE 700 scan_keys%=1 710 scan_time%=100 720 scan_object%=1 730 scan_count%=0 740 menu_enabled%=TRUE 750 ws%=sprites%+32 760 page_size%=3 770 file_version%=101 780 current_page$="Page 1" 790 ws%=sprites%+32 800 810 SYS "Hourglass_On" 820 PROCload_templates 830 PROCget_mode_info 840 PROCload_options 850 PROCnew_file 860 870 SYS "OS_GetEnv" TO EnvStr$,end_adr% 880 IF INSTR(EnvStr$," -quit ") THEN 890 I%=INSTR(EnvStr$,""""):I%=INSTR(EnvStr$,"""",I%+1) 900 REPEATI%+=1:UNTILMID$(EnvStr$,I%,1)<>" " 910 f$=MID$(EnvStr$,I%) 920 IF f$<>"" full_name$=f$:PROCload_file(f$,2) 930 ENDIF 940 950 icon_bar%=FNiconbar 960 970 SYS setcaret%,main_w%,-1,0,10,10 980 990 SYS "Hourglass_Off" 1000 ON ERROR PROCerrorbox 1010 1020 SYS drag%,,-1 1030 PROCbegin_trying 1040 REPEAT 1050 PROCtry_poll 1060 UNTIL FALSE 1070 1080 DEFPROCload_templates 1090 DIM font_array% 256:FORt%=0TO252STEP4:t%!font_array%=0:NEXT 1100 SYS "Wimp_OpenTemplate",,"<Obey$Dir>.Templates" 1110 DIM winds% 2000,indir% 1000 1120 indl%=indir%+4000 1130 SYS "Wimp_LoadTemplate",,winds%,indir%,indl%,-1,"main_w",0 TO ,,indir% 1140 SYS "Wimp_CreateWindow",,winds% TO main_w% 1150 SYS "Wimp_LoadTemplate",,winds%,indir%,indl%,font_array%,"pagelist_wc",0 TO ,,indir% 1160 SYS "Wimp_CreateWindow",,winds% TO pagelist_wc% 1170 SYS "Wimp_LoadTemplate",,winds%,indir%,indl%,font_array%,"print_w",0 TO ,,indir% 1180 SYS "Wimp_CreateWindow",,winds% TO print_w% 1190 SYS "Wimp_LoadTemplate",,winds%,indir%,indl%,-1,"info",0 TO ,,indir% 1200 SYS "Wimp_CreateWindow",,winds% TO info% 1210 SYS "Wimp_CloseTemplate" 1220 ENDPROC 1230; 1240 DEFPROCload_options 1250 ptr%=OPENIN("<Ultimap$Dir>.options") 1260 INPUT#ptr%,toolbox_on%,scanning%,scan_keys%,scan_time%,menu_enabled%,sound_vol% 1270 CLOSE#ptr% 1280 ptr%=OPENIN("<Ultimap$Dir>.messages") 1290 INPUT#ptr%,info$,info1$ 1300 CLOSE#ptr% 1310 PROCset_icon_text(info%,1,info$) 1320 PROCset_icon_text(info%,2,info1$) 1330 ENDPROC 1340 1350 1360DEF PROCfinish 1370 SYS setcaret%,-1 1380 PROClose_fonts 1390 SYS "Wimp_CloseDown",task_handle%,!taskid% 1400 SYS "OS_Exit" 1410ENDPROC 1420 1430 DEFPROCredraw_window 1440 SYS redraww%,,q% TO more% 1450 WHILE more% 1460 offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) 1470 CASE !q% OF 1480 WHEN main_w%:PROCdraw_main_w(q%!28-offx%,q%!32-offy%,q%!36-offx%,q%!40-offy%,offx%,offy%) 1490 WHEN pagelist_wc%:PROCdraw_pagelist_wc(q%!28-offx%,q%!32-offy%,q%!36-offx%,q%!40-offy%) 1500 ENDCASE 1510 SYS getr%,,q% TO more% 1520 ENDWHILE 1530 ENDPROC 1540 1550 DEF PROCfront(handle%) 1560 !q%=handle%:SYS getw%,,q% 1570 PROCopen_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,-1) 1580 ENDPROC 1590 1600 DEF PROCopen_window(handle%,x%,y%,x1%,y1%,scx%,scy%,bhandle%) 1610 IFhandle%=-1THENENDPROC 1620 q%!28=bhandle% 1630 q%!0=handle% 1640 q%!4=x%:q%!8=y%:q%!12=x1%:q%!16=y1% 1650 q%!20=scx%:q%!24=scy% 1660 SYS openw%,,q% 1670 ENDPROC 1680 1690 1700 DEF PROCclose_window(handle%) 1710 !q%=handle%:SYS closew%,,q% 1720 ENDPROC 1730 1740DEF PROCvars 1750 getenv%=&10 1760 wimp% = (1<<18) + (3<<6) 1770 createw%=wimp%+1 1780 createicon%=wimp%+2 1790 deleteicon%=wimp%+4 1800 openw%=wimp%+5 1810 closew%=wimp%+6 1820 poll%=wimp%+7 1830 redraww%=wimp%+8 1840 updatew%=wimp%+9 1850 getr%=wimp%+10 1860 getw%=wimp%+11 1870 getwi%=wimp%+12 1880 seti%=wimp%+13 1890 geti%=wimp%+14 1900 getp%=wimp%+15 1910 drag%=wimp%+16 1920 forceredraw%=wimp%+17 1930 setcaret%=wimp%+18 1940 getcaret%=wimp%+19 1950 createmenu%=wimp%+20 1960 setextent%=wimp%+&17 1970 processkey%=wimp%+&1C 1980 sendmessage%=wimp%+&27 1990 crsubmenu%=wimp%+&28 2000 ploticon%=&400E2 2010 2020 setcol%=&40743 2030 spop%=&2E 2040 findfont%=&40081 2050 losefont%=&40082 2060 fontinfo%=&40084 2070 stringwidth%=&40085 2080 setfont%=&4008A 2090 currentfont%=&4008B 2100 converttoos%=&40088 2110 converttopoints%=&40089 2120 paint%=&40086 2130 findcaret%=&4008D 2140 charbbox%=&4008E 2150 2160 Ubase%=&1C0100 2170 newfile%=Ubase% 2180 newstack%=Ubase%+1 2190 killstack%=Ubase%+2 2200 addentry%=Ubase%+3 2210 amendentry%=Ubase%+4 2220 findtoken%=Ubase%+5 2230 killentry%=Ubase%+6 2240 movedata%=Ubase%+7 2250 addpacked%=Ubase%+8 2260 getentry%=Ubase%+9 2270 unpacksprite%=Ubase%+10 2280 nentries%=Ubase%+11 2290 movetoend%=Ubase%+12 2300 readstatus%=Ubase%+13 2310 writestatus%=Ubase%+14 2320 rendershape%=Ubase%+15 2330 getnth%=Ubase%+17 2340 locatefile%=Ubase%+19 2350 playsound%=Ubase%+20 2360 2370 PD%=&80140 2380 PDselect%=PD%+5 2390 PDabort%=PD%+9 2400 PDpagesize%=PD%+3 2410 PDgiverec%=PD%+11 2420 PDdrawpage%=PD%+12 2430 PDgetrec%=PD%+13 2440 PDendjob%=PD%+8 2450 2460 LOCAL ERROR 2470 ON ERROR LOCAL ENDPROC 2480 SYS "OS_Module",14,"Ubase%Ultimap" 2490 ENDPROC 2500 2510DEF PROCget_pointer 2520SYS getp%,,q% 2530mousex%=!q%:mousey%=q%!4:b%=q%!8:handle%=q%!12:icon%=q%!16:ob%=q%!20 2540ENDPROC 2550 2560DEF PROCerrorbox 2570REM SYS drag%,,-1 2580!errblk%=ERR:t$=REPORT$:t$="("+STR$ERR+")"+t$+" at line "+STR$ERL 2590$(errblk%+4)=t$+CHR$0 2600SYS "Wimp_ReportError",errblk%,1,"Ultimap" 2610IF ERR<>1 PROCfinish:END 2620REM IF printing% printing%=FALSE:PROCclose_window(print_w%) 2630ENDPROC 2640; 2650 DEFFNiconbar 2660 !q%=-1:q%!4=0:q%!8=0:q%!12=64:q%!16=64 2670 q%!20=&300A 2680 PROCstring0(q%+24,appsprite$) 2690 SYS "Wimp_CreateIcon",,q% TO handle% 2700 =handle% 2710; 2720 DEFPROCset_icon_fonts 2730 SYS findfont%,,icon_font$,12*16,12*16 TO font% 2740 SYS "Wimp_WhichIcon",print_w%,q%,1<<6,1<<6 2750 t%=0:REPEAT:PROCicon_font(print_w%,t%!q%,font%):t%+=4:UNTILt%!q%=-1 2760 ENDPROC 2770 2780 DEFPROCicon_font(window%,icon%,font%) 2790 !errblk%=window%:errblk%!4=icon% 2800 errblk%!12=&FF000000:errblk%!8=font%<<24 2810 font%?font_array%+=1 2820 SYS seti%,,errblk% 2830 ENDPROC 2840 2850 DEFPROClose_fonts 2860 FORA%=0TO255:n%=A%?font_array%:A%?font_array%=0 2870 IF n%>0 FOR B%=1TOn%:SYS losefont%,A%:NEXT 2880 NEXT:ENDPROC 2890 2900 DEFPROCget_mode_info 2910 SYS "Wimp_ReadPalette",,wimp_palette% 2920 SYS "OS_ReadModeVariable",-1,4 TO ,,xef% 2930 SYS "OS_ReadModeVariable",-1,5 TO ,,yef% 2940 SYS "OS_ReadModeVariable",-1,11 TO ,,screen_width% 2950 SYS "OS_ReadModeVariable",-1,12 TO ,,screen_height% 2960 screen_width%=screen_width%<<xef%:screen_height%=screen_height%<<yef% 2970 ENDPROC 2980 2990 DEFPROCstart_drag(type%,x%,y%,x1%,y1%) 3000 !q%=0:q%!4=5 3010 q%!8=x%:q%!12=y%:q%!16=x1%:q%!20=y1% 3020 q%!24=0:q%!28=0:q%!32=screen_width%:q%!36=screen_height% 3030 SYS drag%,,q% 3040 drag_type%=type% 3050 ENDPROC 3060 3070REM-------------------------------------------------------------------------------------------------------- 3080 3090 DEFFNstring0(t%):LOCAL t$:t$="":IF ?t%<32:="" 3100 REPEAT:t$=t$+CHR$?t%:t%+=1:UNTIL?t%<32 OR LENt$=255:=t$ 3110 3120 DEFPROCstring0(t%,t$):$t%=t$:t%?LENt$=0:ENDPROC 3130 3140REM-------------------------------------------------------------------------------------------------------- 3150 3160 DEFPROCcheck_pagelist_wc 3170 but%=q%!8 3180 !ws%=pagelist_wc%:SYS getw%,,ws% 3190 offx%=(ws%!4-ws%!20):offy%=(ws%!16-ws%!24) 3200 page%=(((q%!4)-offy%)DIV-48)+1 3210 SYS nentries%,s_pages% TO np%:IF page%>np% ENDPROC 3220 SYS getnth%,s_pages%,page% TO ,page% 3230 current_page%=page% 3240 PROCarrange_pagelist_wc(page%) 3250 PROCpre_process 3260 PROCshow_page(page%) 3270 IF scanning% PROCscan 3280 IF but%AND4 SYS createmenu%,,-1 3290 ENDPROC 3300 3310 DEFPROCshow_page(page%) 3320 current_page%=page% 3330 !q%=main_w%:SYS getw%,,q% 3340 IF (q%!32) AND (1<<16) SYS forceredraw%,-1,q%!4,q%!8,q%!12,q%!16 3350 PROCwindow_title(main_w%,full_name$) 3360 SYS getentry%,s_pages%,page% TO adr% 3370 current_page$=FNstring0(adr%+4) 3380 OSCLI "set Upage "+current_page$ 3390 ENDPROC 3400 3410 DEFPROCupdate_object(stack%,object%) 3420 LOCAL adr% 3430 SYS getentry%,stack%,object% TO adr% 3440 SYS forceredraw%,main_w%,adr%!12,adr%!16,adr%!20,adr%!24 3450 ENDPROC 3460 3470 DEFPROCset_icon_state(window%,icon%,eor%,clear%) 3480 !errblk%=window%:errblk%!4=icon%:errblk%!8=eor%:errblk%!12=clear%:SYS seti%,,errblk% 3490 ENDPROC 3500 3510 DEFFNicon_state(window%,icon%) 3520 !errblk%=window%:errblk%!4=icon%:SYS geti%,,errblk%:=errblk%!24 3530 3540 DEF PROCset_icon_text(window%,icon%,text$) 3550 !errblk%=window%:errblk%!4=icon%:SYS geti%,,errblk% 3560 PROCstring0(errblk%!28,LEFT$(text$,(errblk%!36)-1)) 3570 errblk%!8=0:errblk%!12=0:SYS seti%,,errblk% 3580 ENDPROC 3590 3600 DEFFNleaf(name$):IF INSTR(name$,".")=0:=name$ 3610 REPEATname$=RIGHT$(name$,LENname$-INSTR(name$,".")) 3620 UNTILINSTR(name$,".")=0:=name$ 3630 3640 DEFPROCstart_drag(type%,x%,y%,x1%,y1%) 3650 !q%=0:q%!4=5 3660 q%!8=x%:q%!12=y%:q%!16=x1%:q%!20=y1% 3670 q%!24=0:q%!28=0:q%!32=screen_width%:q%!36=screen_height% 3680 SYS drag%,,q% 3690 drag_type%=type% 3700 ENDPROC 3710 3720 DEFPROCramfetch 3730 DMT_ref%=q%!4 3740 DMT%=q%!20 3750 DMT_len%=q%!24 3760 CASE file_type% OF 3770 WHEN &AFF,&FF9:PROCsave_picture(drag_ptype%,drag_picture%,"") 3780 WHEN &FFF:PROCsave_text(drag_picture%,"") 3790 WHEN &D3C:PROCsave_sound(drag_sound%,"") 3800 ENDCASE 3810 ENDPROC 3820 3830 DEFPROCdatasaveack 3840 IF q%!12<>myref% ENDPROC 3850 DMT%=0 3860 f_type%=q%!40 3870 CASE f_type% OF 3880 WHEN &AFF,&FF9:PROCsave_picture(drag_ptype%,drag_picture%,FNstring0(q%+44)) 3890 WHEN &D3C:PROCsave_sound(drag_sound%,FNstring0(q%+44)) 3900 WHEN &FFF:PROCsave_text(drag_picture%,FNstring0(q%+44)) 3910 ENDCASE 3920 q%!12=q%!8:q%!16=3 3930 SYS sendmessage%,17,q%,q%!4 3940 ENDPROC 3950 3960 DEFPROCsave_picture(type%,token%,name$) 3970 save$="" 3980 LOCAL ERROR 3990 ON ERROR LOCAL:RESTORE ERROR:ERROR 1,REPORT$ 4000 IF DMT_ptr%=0 THEN 4010 SYS "Hourglass_On" 4020 SYS getentry%,type%,token% TO adr% 4030 len%=(!adr%)-16 4040 SYS readstatus%,type%,token% TO l%:IF l% len%=l% 4050 adr%+=16 4060 IF type%=s_sprites% THEN 4070 SYS getentry%,s_sprites%,token% TO adr% 4080 IF !adr%=(adr%!16)+16 THEN 4090 save$=FNstring0(adr%+4) 4100 adr%!4=1:adr%!8=16:adr%!12=!adr% 4110 len%=!adr%+12:adr%+=4 4120 ELSE 4130 SYS unpacksprite%,s_sprites%,token%,sprites%+12 4140 !sprites%=1 4150 sprites%!4=16 4160 sprites%!8=(sprites%!12)+16 4170 len%=sprites%!8 4180 adr%=sprites% 4190 ENDIF 4200 file_type%=&FF9 4210 ELSE 4220 file_type%=&AFF 4230 ENDIF 4240 DMT_mylen%=len% 4250 DMT_data%=adr% 4260 ENDIF 4270 PROCsave_slave(name$,adr%,len%,file_type%) 4280 IF save$<>"" THEN 4290 SYS getentry%,s_sprites%,token% TO adr% 4300 PROCstring0(adr%+4,save$) 4310 ENDIF 4320 ENDPROC 4330 4340 DEFPROCsave_sound(sound%,name$) 4350 LOCAL ERROR 4360 ON ERROR LOCAL:RESTORE ERROR:ERROR 1,REPORT$ 4370 IF DMT_ptr%=0 THEN 4380 SYS "Hourglass_On" 4390 SYS getentry%,s_sounds%,sound% TO adr% 4400 len%=(!adr%)-24 4410 SYS readstatus%,s_sounds%,sound% TO l%:IF l% len%=l% 4420 adr%+=24 4430 DMT_mylen%=len% 4440 DMT_data%=adr% 4450 ENDIF 4460 PROCsave_slave(name$,adr%,len%,&D3C) 4470 ENDPROC 4480 4490 DEFPROCsave_text(text%,name$) 4500 LOCAL ERROR 4510 ON ERROR LOCAL:RESTORE ERROR:ERROR 1,REPORT$ 4520 SYS getentry%,s_text%,text% TO adr% 4530 SYS movedata%,adr%,ws%,!adr% 4540 adr%=ws%+4:t%=adr% 4550 len%=0 4560 REPEAT 4570 IF ?t%=13 ?t%=10 4580 IF ?t%<>0 len%+=1:t%+=1 4590 UNTIL?t%=0 ELSE UNTIL?t%=0 4600 IF DMT_ptr%=0 THEN 4610 SYS "Hourglass_On" 4620 DMT_mylen%=len% 4630 DMT_data%=adr% 4640 ENDIF 4650 PROCsave_slave(name$,adr%,len%,&FFF) 4660 ENDPROC 4670 4680 DEFPROCsave_slave(name$,adr%,len%,file_type%) 4690 IF DMT% THEN 4700 IF DMT_mylen%-DMT_ptr%>DMT_len% THEN 4710 l%=DMT_len% 4720 ELSE 4730 l%=DMT_mylen%-DMT_ptr% 4740 SYS "Hourglass_Off" 4750 ENDIF 4760 SYS "Wimp_TransferBlock",task_handle%,DMT_data%+DMT_ptr%,DMT_ref%,DMT%,l% 4770 DMT_ptr%+=l% 4780 q%!12=q%!8:q%!16=7 4790 q%!24=l% 4800 SYS sendmessage%,18,q%,q%!4:REM send RAM transmit 4810 ELSE 4820 OSCLI "save "+name$+" "+STR$~adr%+" +"+STR$~len% 4830 OSCLI "SETTYPE "+name$+" "+STR$~file_type% 4840 SYS "Hourglass_Off" 4850 ENDIF 4860 ENDPROC 4870 4880 DEFPROCdataload 4890 SYS movedata%,q%,old_q%,256 4900 CASE old_q%!40 OF 4910 WHEN &BC3: 4920 IF old_q%!20=main_w% OR (old_q%!20=-2 AND old_q%!24=icon_bar%) THEN 4930 IF old_q%!12<>0 ENDPROC 4940 IF modified% THEN 4950 PROCopen_query("load"+FNstring0(old_q%+44)) 4960 ELSE 4970 PROCload_file(FNstring0(old_q%+44),1) 4980 old_q%!12=old_q%!8:old_q%!16=4:SYS "Wimp_SendMessage",17,old_q%,old_q%!4 4990 ENDIF 5000 ENDIF 5010 ENDCASE 5020 ENDPROC 5030 5040 DEFPROCload_file(name$,error%) 5050 t%=OPENIN(name$):l%=EXT#t%:CLOSE#t% 5060 PROCset_slot(HIMEM+(l%DIV&4000)*&4000+&4000,error%) 5070 SYS newfile% 5080 full_name$=LEFT$(name$,LEN(name$)-INSTR(name$,"!")-1) 5090 SYS "Hourglass_On" 5100 OSCLI "load "+name$+" 40000" 5110 version%=!&4000C 5120 SYS locatefile%,&78000 5130 modified%=0 5140 query_string$="" 5150 edited_area%=0 5160 current_page%=!&40020:toolbox_on%=!&40024:menu_enabled%=!&40028:page_size%=!&4002C 5170 h_scroll%=!&40060:v_scroll%=!&40064:title_bar%=!&40068:toggle_icon%=!&4006C 5180 scanning%=!&40070:scan_keys%=!&40074:scan_time%=!&40078 5190 PROCsize_page 5200 PROCredefine_main_w 5210 PROCopen_main_w 5220 IF !&40030 THEN 5230 t%=&40030:x%=t%!4:y%=t%!8:x1%=t%!12:y1%=t%!16 5240 IF x1%>screen_width% x%=x%-(x1%-x%):x1%=screen_width% 5250 IF y1%+40>screen_height% y%=y%-(y1%-y%)-40:y1%=screen_height%-40 5260 IF x%<0 x%=0 5270 IF y%<0 y%=0 5280 PROCopen_window(main_w%,x%,y%,x1%,y1%,t%!20,t%!24,-1) 5290 ENDIF 5300 SYS "Hourglass_Off" 5310 SYS "OS_ReadVarVal","Obey$Dir",main%,1000 TO ,,T% 5320 T%?main%=0 5330 full_name$=FNstring0(main%) 5340 PROCwindow_title(main_w%,full_name$) 5350 appsprite$=FNleaf(full_name$) 5360 menu$=RIGHT$(appsprite$,LEN(appsprite$)-1) 5370 IF LENmenu$<12 REPEAT:menu$=menu$+CHR$0:UNTILLENmenu$=12 5380 ENDPROC 5390 5400REM-------------------------------------------------------------------------------------------------------- 5410 5420 DEFPROCnew_file 5430 PROCset_slot(HIMEM+&4000,2) 5440 SYS newfile% 5450 FOR t%=1 TO 20 5460 SYS newstack% 5470 NEXT 5480 full_name$="No_Name" 5490 ENDPROC 5500 5510REM---------------------------------------------------------------------------------------------------- 5520 5530 DEFPROCopen_centre(handle%,off%) 5540 !q%=handle%:SYS getw%,,q% 5550 w%=(q%!12)-(q%!4):h%=(q%!16)-(q%!8) 5560 wx%=screen_width%DIV2-w%DIV2 5570 wy%=screen_height%DIV2-h%DIV2 5580 PROCopen_window(handle%,wx%,wy%+off%,wx%+w%,wy%+h%+off%,q%!20,q%!24,-1) 5590 ENDPROC 5600 5610 DEFPROCopen_main_w 5620 !ws%=main_w%:SYS getw%,,ws% 5630 sx%=ws%!4:sy%=ws%!8 5640 sx1%=ws%!12:sy1%=ws%!16 5650 sh%=screen_height%:sw%=screen_width% 5660 hs%=0:vs%=0:tb%=0 5670 IF h_scroll% hs%=40 5680 IF v_scroll% vs%+=40 5690 IF title_bar% tb%=36 5700 w%=sx1%-sx%:h%=sy1%-sy% 5710 IF sy1%+tb%>sh% sy1%=sh%-tb%:sy%=sy1%-h% 5720 IF sy%<hs% sy%=hs% 5730 IF sx1%+vs%>sw% sx1%=sw%-vs%:sx%=sx1%-w% 5740 IF sx%<0 sx%=0 5750 !ws%=main_w% 5760 ws%!4=sx% 5770 ws%!8=sy% 5780 ws%!12=sx1% 5790 ws%!16=sy1% 5800 ws%!20=0:ws%!24=0 5810 ws%!28=-1 5820 PROCopen_window(main_w%,ws%!4,ws%!8,ws%!12,ws%!16,ws%!20,ws%!24,ws%!28) 5830 !q%=main_w%:SYS getw%,,ws% 5840 ENDPROC 5850 5860REM---------------------------------------------------------------------------------------------------- 5870 5880 DEFPROCdraw_picture(type%,token%,x%,y%,w%,h%,flags%) 5890 IF type%=s_draw% x%+=(1<<xef%):y%+=(1<<yef%):w%-=(2<<xef%):h%-=(2<<yef%) 5900 SYS getentry%,type%,token% TO a% 5910 IF !a%>sprite_size%-24 flags%=flags%OR8 5920 !errblk%=x%:errblk%!4=y%:errblk%!8=w%:errblk%!12=h% 5930 SYS rendershape%,type%,token%,sprites%,errblk%,flags%AND15 5940 ENDPROC 5950 5960REM---------------------------------------------------------------------------------------------------- 5970 5980 DEFPROCwindow_title(window%,title$) 5990 IF window%=main_w% THEN 6000 SYS getentry%,s_pages%,current_page% TO adr% 6010 title$=title$+" - "+FNstring0(adr%+4) 6020 ENDIF 6030 IF modified% title$=title$+" *" 6040 !errblk%=window%:SYS getwi%,,errblk% 6050 PROCstring0(errblk%!76,title$) 6060 SYS forceredraw%,-1,errblk%!4,(errblk%!16),errblk%!12,errblk%!16+36 6070 ENDPROC 6080 6090 6100 6110REM---------------------------------------------------------------------------------------------------- 6120 6130 DEFPROCcheck_icon_bar 6140 mx%=!q%:my%=q%!4:button%=q%!8 6150 IF button% AND 2:PROCdo_icon_bar_menu(mx%,my%):ENDPROC 6160 PROCfront(main_w%) 6170 SYS setcaret%,main_w%,-1,0,0,10 6180 ENDPROC 6190 6200 DEFPROCdo_icon_bar_menu(x%,y%) 6210 IF scan_time%=0:scan_time%=100:scan_keys%=1 6220 FOR opt%=0TO2STEP2:P%=main% 6230 [opt opt% 6240.iconmenu 6250 equs menu$ 6260 equd &070207:equd 208:equd 40:equd 0 6270 equd 0:equd info%:equd &07000021 6280 equs "Info " 6290 equd scanning%AND1:equd ibmenu:equd &07000021 6300 equs "Scanning " 6310 equd 0:equd somenu:equd &07000021 6320 equs "Sound volume" 6330 equd &80:equd -1:equd &07000021 6340 equs "Quit " 6350 6360.ibmenu 6370 equs "Scanning":equd 0 6380 equd &070207:equd 208:equd 40:equd 0 6390 equd (scan_keys%=2)AND1:equd -1:equd &07000021 6400 equs "Two switches" 6410 equd &80:equd ibmenu1:equd &07000021 6420 equs "Speed " 6430 6440.somenu 6450 equs "Sound Volume" 6460 equd &070207:equd 208:equd 40:equd 0 6470 equd (sound_vol%=&10F)AND1:equd -1:equd &07000021 6480 equs "Off " 6490 equd (sound_vol%=&14F)AND1:equd -1:equd &07000021 6500 equs "Quiet " 6510 equd &80 OR ((sound_vol%=&17F)AND1):equd -1:equd &07000021 6520 equs "Loud " 6530 6540.ibmenu1 6550 equs "Seconds":equb 0:equd 0 6560 equd &070207:equd 208:equd 40:equd 0 6570 equd &84:equd -1:equd &07000121 6580 equd ibmess:equd ibval:equd 8 6590 6600.ibval equs "a0-9."+CHR$0 6610.ibmess equs STR$(scan_time%/100)+CHR$(0) 6620 6630 ]:NEXT 6640 6650 SYS createmenu%,,main%,mx%-16,260 6660 menu%=5 6670 ENDPROC 6680 6690REM---------------------------------------------------------------------------------------------------- 6700 6710 DEFPROCicon_bar_menu 6720 LOCAL c% 6730 CASE !q% OF 6740 WHEN 1 6750 CASE q%!4 OF 6760 WHEN -1:scanning%=scanning% EOR TRUE 6770 WHEN 0: 6780 IF scan_keys%=2 scan_keys%=1 ELSE scan_keys%=2 6790 scanning%=TRUE 6800 WHEN 1: 6810 t%=(VAL(FNstring0(ibmess)))*100 6820 IF t% scan_time%=t% 6830 scanning%=TRUE 6840 ENDCASE 6850 WHEN 2: 6860 CASE q%!4 OF 6870 WHEN 0:sound_vol%=&10F 6880 WHEN 1:sound_vol%=&14F 6890 WHEN 2:sound_vol%=&17F 6900 ENDCASE 6910 WHEN 3:IF modified% PROCopen_query("") ELSE PROCfinish 6920 ENDCASE 6930 SYS getp%,,q%:IF q%!8 AND 1 PROCdo_icon_bar_menu(mx%,my%) 6940 ENDPROC 6950 6960REM-------------------------------------------------------------------------------------------------------- 6970 6980 DEFPROCdraw_main_w(wx%,wy%,wx1%,wy1%,offx%,offy%) 6990 SYS getentry%,s_pages%,current_page% TO adr% 7000 stack%=adr%!20:page_col%=adr%!28 7010 SYS setcol%,page_col%:RECTANGLE FILL wx%+offx%,wy%+offy%,wx1%-wx%,wy1%-wy% 7020 SYS nentries%,stack% TO no% 7030 IF no% THEN 7040 FOR object%=1 TO no% 7050 SYS getnth%,stack%,object% TO adr%,token% 7060 x%=adr%!12:y%=adr%!16:x1%=adr%!20:y1%=adr%!24:flags%=adr%!36 7070 IF x%<wx1% AND x1%>wx% AND y%<wy1% AND y1%>wy% AND (flags%AND128)=0 THEN 7080 CASE adr%!4 OF 7090 WHEN s_text%:PROCdraw_text(stack%,token%,offx%,offy%) 7100 WHEN s_sprites%,s_draw%:PROCdraw_picture(adr%!4,adr%!8,x%+offx%,y%+offy%,x1%-x%,y1%-y%,flags%) 7110 ENDCASE 7120 ENDIF 7130 NEXT 7140 ENDIF 7150 ENDPROC 7160 7170 DEFFNstrip_spaces(text$) 7180 REPEAT 7190 IF ASCtext$=32 text$=RIGHT$(text$,LENtext$-1) 7200 UNTILASCtext$<>32 7210 =text$ 7220 7230 DEFFNlower_case(text$):IF text$="":="" 7240 LOCAL t$,t%,c% 7250 FORt%=1TOLENtext$ 7260 c%=ASC(MID$(text$,t%,1)) 7270 IF c%>64 AND c%<91 c%+=32 7280 t$=t$+CHR$c% 7290 NEXT 7300 =t$ 7310 7320REM---------------------------------------------------------------------------------------------------- 7330 7340 DEFPROCdraw_text(stack%,token%,offx%,offy%) 7350 IF speaking_text% AND speak_token%=token% PROChighlight_text(stack%,token%,offx%,offy%,speak_word%):ENDPROC 7360 SYS getentry%,stack%,token% TO adr% 7370 x%=(adr%!12)+offx% 7380 y%=(adr%!16)+offy% 7390 x1%=(adr%!20)-(1<<xef%)+offx% 7400 y1%=(adr%!24)-(1<<yef%)+offy% 7410 flags%=adr%!36:font%=adr%!40:b_s%=adr%!32 7420 fcol%=adr%!52:IF fcol% AND &FF fcol%=page_col% 7430 bcol%=adr%!56 7440 IF flags%AND1 fcol%=fcol%EOR&FFFFFF00:bcol%=bcol%EOR&FFFFFF00 7450 PROCdraw_border(b_s%,fcol%,bcol%,x%,y%,x1%,y1%) 7460 x%+=(1<<xef%) 7470 x1%-=(1<<xef%) 7480 y%+=(1<<yef%) 7490 y1%-=(1<<yef%) 7500LOCAL ERROR 7510ON ERROR LOCAL RESTORE ERROR:font%=0 7520 IF font% THEN 7530 SYS getentry%,s_fonts%,font% TO t% 7540 SYS findfont%,,t%+4,adr%!44,adr%!48 TO font% 7550 ENDIF 7560 IF font% THEN 7570 IF bcol% AND &FF bcol%=fcol% 7580 SYS "ColourTrans_SetFontColours",font%,bcol%,fcol%,14 7590 SYS fontinfo%,font% TO ,cx%,cy%,cx1%,cy1% 7600 ELSE 7610 cx%=-(1<<xef%):cy%=-(1<<yef%):cx1%=8<<xef%:cy1%=8<<yef% 7620 ENDIF 7630 text_height%=cy1% 7640 SYS getentry%,s_text%,adr%!8 TO text% 7650 text%+=4 7660 text_offset%=0 7670 px%=x%+margin%:py%=y1%-text_height%+cy% 7680 centre%=FALSE:right%=FALSE:underline%=FALSE 7690 IF flags% AND 8 centre%=TRUE 7700 IF flags% AND 16 right%=TRUE 7710 IF flags% AND 32 underline%=TRUE 7720 REPEAT 7730 CASE text_offset%?text% OF 7740 WHEN 0: 7750 WHEN 13:py%-=text_height%:text_offset%+=1 7760 OTHERWISE 7770 text$=FNstring0(text%+text_offset%) 7780 text_offset%+=LENtext$ 7790 IF font% THEN 7800 SYS stringwidth%,,text$,1<<30,1<<30,-1,LENtext$ TO ,,w% 7810 SYS converttoos%,,w% TO ,w% 7820 IF centre% px%=x%+(x1%-x%)DIV2-w%DIV2 7830 IF right% px%=x1%-w%-margin% 7840 IF underline% text$=CHR$(25)+CHR$(1)+CHR$(16)+text$ 7850 SYS paint%,,text$,1<<4,px%,py%-cy% 7860 ELSE 7870 w%=LENtext$*cx1% 7880 IF centre% px%=x%+(x1%-x%)DIV2-w%DIV2 7890 IF right% px%=x1%-w%-margin% 7900 SYS setcol%,fcol%:MOVE px%,py%+cy1%:PRINTtext$ 7910 IF underline% MOVE px%,py%-cy%:PLOT1,cx1%*LENtext$,0 7920 ENDIF 7930 ENDCASE 7940 UNTIL text_offset%?text%=0 7950 IF font% SYS losefont%,font% 7960 ENDPROC 7970 7980 DEFPROCdraw_border(style%,col%,bcol%,x%,y%,x1%,y1%) 7990 IF (bcol%AND&FF)=0 SYS setcol%,bcol%:RECTANGLE FILL x%,y%,x1%-x%,y1%-y% 8000 CASE style% OF 8010 WHEN 1 8020 SYS setcol%,col% 8030 RECTANGLE x%,y%,x1%-x%,y1%-y% 8040 WHEN 2:REM bold 8050 SYS setcol%,&FFFFFF00 8060 MOVE x%,y%:DRAW x%,y1%:DRAW x1%,y1% 8070 SYS setcol%,!(wimp_palette%+16) 8080 DRAW x1%,y%:DRAW x%,y% 8090 WHEN 3:REM inset 8100 SYS setcol%,!(wimp_palette%+16) 8110 MOVE x%,y%:DRAW x%,y1%:DRAW x1%,y1% 8120 SYS setcol%,&FFFFFF00 8130 DRAW x1%,y%:DRAW x%,y% 8140 ENDCASE 8150 ENDIF 8160 ENDPROC 8170 8180 DEFPROCplay_sound(sound%) 8190 SYS getentry%,s_sounds%,sound% TO adr1% 8200 len%=(!adr1%)-24:SYS readstatus%,s_sounds%,sound% TO l%:IF l% len%=l% 8210 LOCAL ERROR 8220 ON ERROR LOCAL RESTORE ERROR:PROCerrorbox:ENDPROC 8230 SYS playsound%,adr1%+24,len%,sound_vol% 8240 ENDPROC 8250 8260 DEFPROCplay_sound_wait(sound%) 8270 SYS getentry%,s_sounds%,sound% TO adr1% 8280 len%=(!adr1%)-24:SYS readstatus%,s_sounds%,sound% TO l%:IF l% len%=l% 8290 SYS playsound%,adr1%+24,len%,sound_vol% 8300 REPEAT:SYS playsound%,0 TO t%:UNTILt%<>-1 8310 ENDPROC 8320 8330 DEFPROCmake_space(plus%) 8340 size%=(!&40004-&40000)+plus%*2 8350 slot_size%=HIMEM+(size%DIV&4000)*&4000+&4000 8360 SYS "Wimp_SlotSize",slot_size%,-1 TO t% 8370 IF t%<slot_size% ERROR 1,"Ultimap has run out of memory" 8380 ENDPROC 8390 8400 DEFPROCset_slot(size%,error%) 8410 slot_size%=size% 8420 SYS "Wimp_SlotSize",slot_size%,-1 TO t% 8430 IF t%<slot_size% ERROR error%,"There's not enough memory to load this file!" 8440 ENDPROC 8450 8460 DEFPROCopen_print_w 8470 IF portrait% a%=0:b%=1<<21 ELSE a%=1<<21:b%=0 8480 PROCset_icon_state(print_w%,6,a%,1<<21) 8490 PROCset_icon_state(print_w%,7,b%,1<<21) 8500 PROCset_icon_text(print_w%,2,"1") 8510 SYS getp%,,q% 8520 SYS createmenu%,,-1 8530 SYS createmenu%,,print_w%,!q%-30,q%!4+60 8540 ENDPROC 8550 8560 DEFPROCcheck_print_w 8570 b%=q%!8 8580 CASE q%!16 OF 8590 WHEN 3:SYS createmenu%,,-1 8600 WHEN 4: 8610 !q%=print_w%:q%!4=7:SYS geti%,,q% 8620 IF (q%!24) AND (1<<21) style%=2:portrait%=TRUE ELSE style%=1:portrait%=FALSE 8630 !q%=print_w%:q%!4=2:SYS geti%,,q% 8640 run_num%=VAL(FNstring0(q%!28)) 8650 IF run_num%=0 run_num%=1 8660 PROCprint_routine(style%,run_num%) 8670 IF b% AND 6 SYS createmenu%,,-1 8680 ENDCASE 8690 ENDPROC 8700 8710 DEFPROCprint_routine(style%,run_num%) 8720 LOCAL phandle%,ohandle% 8730 LOCAL left%,bottom%,right%,top% 8740 LOCAL copiesleft%,rect% 8750 8760 phandle%=OPENOUT("printer:") 8770 LOCAL ERROR 8780 ON ERROR LOCAL:CLOSE#phandle%:RESTORE ERROR:ERROR 1,"There is no printer driver!" 8790 SYS PDselect%,phandle%,"Ultima" TO ohandle% 8800 8810 ON ERROR LOCAL:SYS PDabort%,phandle%:CLOSE#phandle%:SYS PDselect%,ohandle%:printing%=FALSE:RESTORE ERROR:ERROR 1,REPORT$+STR$ERL 8820 8830 SYS PDpagesize% TO ,,,left%,bottom%,right%,top% 8840 SYS "Hourglass_On" 8850 8860 FOR loop%=1 TO run_num% 8870 !ws%=main_w%:SYS getwi%,,ws% 8880 mx%=ws%!44:my%=ws%!48:mx1%=ws%!52:my1%=ws%!56 8890 !box%=mx%:box%!4=my%:box%!8=mx1%:box%!12=my1% 8900 CASE style% OF 8910 WHEN 1:REM landscape 8920 IF page_size%=4 THEN 8930 scx=.67 8940 scy=.67 8950 !matrix%=0:matrix%!4=-scx*2^16:matrix%!8=scy*2^16:matrix%!12=0 8960 !origin1%=(right%-left%)DIV16:origin1%!4=top%-(top%-bottom%)DIV2-(top%-bottom%)DIV30 8970 ELSE 8980 scx=1.4 8990 scy=1.5 9000 !matrix%=0:matrix%!4=-scx*2^16:matrix%!8=scy*2^16:matrix%!12=0 9010 !origin1%=(right%-left%)DIV20:origin1%!4=top%-(top%-bottom%)DIV20 9020 ENDIF 9030 WHEN 2:REM portrait 9040 scx=1.05 9050 scy=.95 9060 !matrix%=scx*2^16:matrix%!4=0:matrix%!8=0:matrix%!12=scy*2^16 9070 !origin1%=(right%-left%)DIV20:origin1%!4=bottom% 9080 ENDCASE 9090 SYS PDgiverec%,loop%,box%,matrix%,origin1%,&FFFFFF00 9100 printing%=TRUE 9110 SYS PDdrawpage%,1,box2%,0,0 TO copiesleft%,,rect% 9120 WHILE copiesleft%<>0 9130 PROCdraw_main_w(mx%,my%,mx1%,my1%,0,0) 9140 SYS PDgetrec%,,box2% TO copiesleft%,,rect% 9150 ENDWHILE 9160 NEXT 9170 9180 SYS PDendjob%,phandle% 9190 CLOSE#phandle% 9200 SYS PDselect%,ohandle% 9210 printing%=FALSE 9220 SYS "Hourglass_Off" 9230 ENDPROC 9240 9250 DEFPROChide_object(stack%,token%,hide%,on_vdu%) 9260 SYS getentry%,stack%,token% TO adr1% 9270 IF hide%<>0 AND ((adr1%!36)AND128)<>0 on_vdu%=0 9280 IF hide%=0 AND ((adr1%!36)AND128)=0 on_vdu%=0 9290 IF hide% adr1%!36=(adr1%!36)OR128 ELSE adr1%!36=(adr1%!36)AND&FFFFFF7F 9300 IF on_vdu% SYS forceredraw%,main_w%,adr1%!12,adr1%!16,adr1%!20+(4<<xef%),adr1%!24+(1<<yef%) 9310 ENDPROC 9320 9330 DEFPROClight_object(stack%,token%,hi%,on_vdu%) 9340 SYS getentry%,stack%,token% TO adr1% 9350 h%=(adr1%!36)AND1:IF hi% hi%=1 9360 IF hi% adr1%!36=(adr1%!36)OR1 ELSE adr1%!36=(adr1%!36)AND&FFFFFFFE 9370 IF on_vdu% AND h%<>hi% SYS forceredraw%,main_w%,adr1%!12,adr1%!16,adr1%!20,adr1%!24 9380 ENDPROC 9390 9400 DEFFNstack(page%) 9410 LOCAL adr% 9420 SYS getentry%,s_pages%,page% TO adr% 9430 IF adr%=0 OR adr%!20=0 ERROR 2,"bad stack from page" 9440 =adr%!20 9450 9460 DEFFNwhich_object(page%,x%,y%) 9470 stack%=FNstack(page%) 9480 SYS nentries%,stack% TO no%:o%=0 9490 IF no%=0:=0 9500 FOR t%=1 TO no% 9510 SYS getnth%,stack%,t% TO adr%,token% 9520 IF x%>=adr%!12 AND y%>=adr%!16 AND x%<adr%!20 AND y%<adr%!24 AND ((adr%!36)AND128)=0 THEN 9530 o%=token%:off_mx%=x%-adr%!12:off_my%=y%-adr%!16 9540 ENDIF 9550 NEXT 9560 =o% 9570 9580 DEFPROCarrange_pagelist_wc(page%) 9590 iw%=280:ih%=-48:pl_tick%=0 9600 SYS nentries%,s_pages% TO np% 9610 !q%=0:q%!8=iw%-(3<<xef%):q%!12=0 9620 IF np%<3 q%!4=ih%*3 ELSE q%!4=ih%*np% 9630 SYS setextent%,pagelist_wc%,q% 9640 iy%=ih%:cur_y%=iy% 9650 FOR loop%=1TOnp% 9660 SYS getnth%,s_pages%,loop% TO adr%,token% 9670 IF token%=page% cur_y%=iy%:pl_tick%=iy% 9680 iy%+=ih% 9690 NEXT 9700 !q%=pagelist_wc%:SYS getw%,,q% 9710 offy%=(q%!16-q%!24):sy%=q%!24 9720 wy%=(q%!8)-offy%:wy1%=(q%!16)-offy% 9730 IF cur_y%<wy% sy%+=cur_y%-wy% 9740 IF cur_y%-ih%>wy1% sy%=cur_y%-ih% 9750 q%!24=sy% 9760 o%=(q%!32)AND(1<<16) 9770 SYS openw%,,q% 9780 IF o%=0 THEN 9790 SYS closew%,,q% 9800 ELSE 9810 SYS forceredraw%,-1,q%!4,q%!8,q%!12,q%!16 9820 ENDIF 9830 ENDPROC 9840 9850 DEFPROCdraw_pagelist_wc(wx%,wy%,wx1%,wy1%) 9860 SYS nentries%,s_pages% TO np% 9870 SYS findfont%,,icon_font$,12*16,12*16 TO font% 9880 ih%=-48:ix%=0:iy%=ih%:ix1%=280:iy1%=0 9890 FORpage%=1TOnp% 9900 IF ix%<=wx1% AND ix1%>=wx% AND iy%<=wy1% AND iy1%>=wy% THEN 9910 SYS getnth%,s_pages%,page% TO adr%,token% 9920 IF iy%=pl_tick% THEN 9930 !q%=ix%:q%!4=iy%:q%!8=ix%+38:q%!12=iy1% 9940 q%!16=&7000019:PROCstring0(q%+20,"�") 9950 SYS ploticon%,,q% 9960 ENDIF 9970 !q%=ix%+38:q%!4=iy%:q%!8=ix%+280:q%!12=iy1% 9980 q%!16=font%<<24 OR &171:q%!20=adr%+4:q%!24=0:q%!32=12 9990 SYS ploticon%,,q% 10000 ENDIF 10010 iy%+=ih%:iy1%+=ih% 10020 NEXT 10030 SYS losefont%,font% 10040 !q%=pagelist_wc% 10050 ENDPROC 10060 10070 DEFFNpt_from_context(context%) 10080 CASE context% OF 10090 WHEN s_mousedrag%:=4 10100 WHEN s_often%:=8 10110 WHEN s_pointer%:=16 10120 WHEN s_mouse%:=20 10130 WHEN s_pageshown%:=32 10140 ENDCASE 10150 =0 10160 10170 DEFFNname_exsists(stack%,f$) 10180 SYS nentries%,stack% TO ne% 10190 IF ne%=0:=0 10200 f%=0:f$=FNlower_case(f$) 10210 FORentry%=1TOne% 10220 SYS getnth%,stack%,entry% TO adr%,token% 10230 IF f$=FNlower_case(FNstring0(adr%+4)) f%=token% 10240 NEXT:=f% 10250 10260 DEFPROCsize_page 10270 !q%=main_w%:SYS getwi%,,q% 10280 IF (q%!32)AND(1<<16) open%=TRUE ELSE open%=FALSE 10290 SYS "Wimp_DeleteWindow",,q% 10300 bh%=q%!28 10310 portrait%=FALSE 10320 CASE page_size% OF 10330 WHEN 1:q%!52=1279:q%!48=-920 10340 WHEN 2:q%!52=1599:q%!48=-1160 10350 WHEN 3:q%!52=2046:q%!48=-1500 10360 WHEN 4:q%!52=1320:q%!48=-2000:portrait%=TRUE 10370 OTHERWISE:q%!52=1279:q%!48=-920 10380 ENDCASE 10390 SYS "Wimp_CreateWindow",,q%+4 TO main_w% 10400 !q%=main_w%:SYS getw%,,q%:PROCopen_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,bh%) 10410 ENDPROC 10420 10430REM ***************************** clicks below here ************************** 10440 10450 DEFPROCbegin_trying 10460 trying%=TRUE 10470 click_underway%=FALSE 10480 pause_on%=FALSE 10490 pointer_object%=0 10500 input$="" 10510 PROCzero_page_stack 10520 PROCpre_process 10530 PROCshow_page(current_page%) 10540 IF scanning% PROCscan 10550 OSCLI "set Uobject "+CHR$34+CHR$34 10560 OSCLI "set Ustatus "+CHR$34+CHR$34 10570 status$="" 10580 ENDPROC 10590 10600 DEFPROCdelight 10610 stack%=FNstack(current_page%) 10620 SYS nentries%,stack% TO no% 10630 IF no% THEN 10640 FOR object%=1TOno% 10650 SYS getnth%,stack%,object% TO adr% 10660 IF adr%!36 AND 1 adr%!36=(adr%!36)AND-2 10670 NEXT 10680 ENDIF 10690 IF speak_token% PROCupdate_object(stack%,speak_token%) 10700 ENDPROC 10710 10720 DEFPROCzero_page_stack:FORT%=0TO1020STEP4:T%!page_stack%=0:NEXT:page_ptr%=0:ENDPROC 10730 10740 DEFPROCpre_process 10750 pointer_object%=0 10760 pointer_int%=0 10770 often_int%=0 10780 seq_int%=0 10790 scan_object%=0 10800 speaking_text%=0:speak_word%=0:speak_token%=0 10810 pointer_on%=TRUE 10820 try_time%=TIME 10830 REPEAT 10840 SYS nentries%,s_sequences% TO s% 10850 IF s% THEN 10860 SYS getnth%,s_sequences%,1 TO adr%,token% 10870 SYS killentry%,s_sequences%,token%:REM clear all sequences 10880 ENDIF 10890 UNTILs%=0 10900 REPEAT 10910 SYS nentries%,s_clickson% TO s% 10920 IF s% THEN 10930 SYS getnth%,s_clickson%,1 TO ,token% 10940 SYS killentry%,s_clickson%,token%:REM clear all clicks 10950 ENDIF 10960 UNTILs%=0 10970 stack%=FNstack(current_page%) 10980 SYS getentry%,s_pages%,current_page% TO adr% 10990 IF adr%!24 SYS writestatus%,s_clicks%,adr%!24,0 11000 SYS nentries%,stack% TO no% 11010 IF no% THEN 11020 FOR object%=1TOno% 11030 SYS getnth%,stack%,object% TO adr% 11040 adr%!36=(adr%!36)AND&FFFFFF3E:REM ensure all objects shown, unselected and unhighlighted 11050 click%=adr%!28 11060 IF click% SYS writestatus%,s_clicks%,click%,0:REM zero status to avoid repetition of click 11070 NEXT 11080 ENDIF 11090 FOR object%=0TOno% 11100 IF object%=0 THEN 11110 SYS getentry%,s_pages%,current_page% TO adr% 11120 click%=adr%!24 11130 ELSE 11140 SYS getnth%,stack%,object% TO adr% 11150 click%=adr%!28 11160 ENDIF 11170 IF click% THEN 11180 SYS getentry%,s_clicks%,click% TO adr% 11190 SYS readstatus%,s_clicks%,click% TO s% 11200 IF s%=0 THEN 11210 SYS writestatus%,s_clicks%,click%,1 11220 IF adr%!4 PROCpre_click(s_mousedrag%,adr%!4,0) 11230 IF adr%!8 THEN 11240 often_int%=TRUE 11250 adr%!24=try_time%+adr%!12 11260 PROCpre_click(s_often%,adr%!8,1) 11270 ENDIF 11280 IF adr%!16 THEN 11290 pointer_int%=TRUE 11300 PROCpre_click(s_pointer%,adr%!16,1) 11310 ENDIF 11320 IF adr%!20 PROCpre_click(s_mouse%,adr%!20,1) 11330 IF adr%!32 THEN 11340 PROCpre_click(s_pageshown%,adr%!32,1) 11350 PROCdo_click(s_pageshown%,adr%!32) 11360 ENDIF 11370 ENDIF 11380 ENDIF 11390 NEXT 11400 ENDPROC 11410 11420 DEFPROCpre_click(context%,click%,seq%) 11430 LOCAL adr% 11440 SYS getentry%,context%,click% TO adr% 11450 end%=adr%+!adr%:adr%+=4 11460 REPEAT 11470 len%=!adr%:cmd%=adr%!4 11480 CASE cmd% OF 11490 WHEN 1,3,4:IF seq%=0 PROCpre_list(cmd%,adr%+8,len%-12) 11500 WHEN 5:IF context%=s_pageshown% AND seq%=0 PROCplay_sound(adr%!8) 11510 WHEN 7: 11520 IF seq% THEN 11530 seq_int%=TRUE 11540 flag%=adr%!12:s%=adr%+36:e%=len%-40 11550 IF flag% AND 4 s%=adr%+40:e%=len%-44 11560 PROCpre_list(3,s%,e%) 11570 ENDIF 11580 ENDCASE 11590 adr%+=len% 11600 UNTIL adr%>=end% 11610 ENDPROC 11620 11630 DEFPROCpre_list(cmd%,adr%,len%) 11640 FORlist%=0TOlen%STEP4 11650 CASE cmd% OF 11660 WHEN 1:PROClight_object(stack%,list%!adr%,1,0) 11670 WHEN 3:PROChide_object(stack%,list%!adr%,1,0) 11680 WHEN 4:PROChide_object(stack%,list%!adr%,0,0) 11690 ENDCASE 11700 NEXT 11710 ENDPROC 11720 11730 DEFPROCtry_poll 11740 SYS poll%,,q% TO A% 11750 SYS playsound%,0 11760 SYS "OS_Module",16,"Ubase%Ultimap" 11770 CASE A% OF 11780 WHEN 0:PROCtry_null 11790 WHEN 1:PROCredraw_window 11800 WHEN 2:PROCopen_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) 11810 WHEN 3:PROCclose_window(!q%) 11820 WHEN 4:IF !q%=main_w% AND pointer_on%<>TRUE OSCLI"pointer 1" 11830 WHEN 5 11840 IF !q%=main_w% AND pointer_on%=1 SYS "Wimp_SpriteOp",36,1,"ptr_clock",2 11850 IF !q%=main_w% AND pointer_on%=2 SYS "Wimp_SpriteOp",36,1,"ptr_hand",2 11860 WHEN 6:PROCtry_mouse 11870 WHEN 7:PROCtry_user_drag 11880 WHEN 8:PROCtry_keys 11890 WHEN 9:PROCtry_menu_select 11900 WHEN 17,18:PROCtry_receive(q%) 11910 ENDCASE 11920 ENDPROC 11930 11940 DEF PROCtry_receive(q%) 11950 CASE q%!16 OF 11960 WHEN 0:PROCfinish:END 11970 WHEN 2:PROCdatasaveack 11980 WHEN 3:IF q%!40=&BC3 PROCdataload 11990 WHEN 6:PROCramfetch 12000 WHEN &502:PROChelp_request 12010 WHEN &400C0:PROCtry_menu_warning 12020 WHEN &400C1: 12030 SYS "Hourglass_On" 12040 PROCget_mode_info 12050 PROClose_fonts 12060 PROCset_icon_fonts 12070 SYS "Hourglass_Off" 12080 ENDCASE 12090 ENDPROC 12100 12110 DEFPROCtry_null 12120 !q%=main_w%:SYS getw%,,q%:IF((q%!32)AND(1<<16))=0 ENDPROC 12130 IF seq_int% PROCcheck_sequences(TIME) 12140 PROCcheck_clicks 12150 IF RIGHT$(input$,1)=CHR$13:input$=LEFT$(input$,LEN(input$)-1):!q%=main_w%:q%!24=13:PROCtry_keys 12160 IF pointer_int% AND scanning%=FALSE PROCunder_pointer 12170 IF often_int% PROCoften 12180 IF scanning% AND scan_keys%=1 PROCscan 12190 SYS playsound%,0 TO t% 12200 IF t%<>-1 THEN 12210 IF speaking_text% THEN 12220 IF speak_sound% THEN 12230 PROCplay_sound_wait(speak_sound%) 12240 ELSE 12250 VDU7:t%=TIME+50:REPEAT:UNTILTIME>t% 12260 ENDIF 12270 PROCspeaking_text 12280 ENDIF 12290 ENDIF 12300 PROCcheck_sysvars 12310 ENDPROC 12320 12330 DEFPROCcheck_sysvars 12340 SYS "OS_ReadVarVal","Upage",main%,1000 TO ,,T% 12350 T%?main%=0:page$=FNstring0(main%) 12360 IF page$<>current_page$ THEN 12370 page%=FNname_exsists(s_pages%,page$) 12380 IF page% THEN 12390 current_page%=page% 12400 PROCpre_process 12410 PROCshow_page(current_page%) 12420 IF scanning% PROCscan 12430 ENDIF 12440 ENDIF 12450 SYS "OS_ReadVarVal","Uobject",main%,1000 TO ,,T% 12460 T%?main%=0:object$=FNstring0(main%) 12470 IF object$<>"" THEN 12480 OSCLI "set Uobject "+CHR$34+CHR$34 12490 input$=object$:!q%=main_w%:q%!24=13:PROCtry_keys 12500 ENDIF 12510 ENDPROC 12520 12530 DEFPROCtry_mouse 12540 CASE q%!12 OF 12550 WHEN -2:IF q%!16=icon_bar% SOUND 1,&100,&9000,1:PROCcheck_icon_bar 12560 WHEN main_w%:PROCtry_main_w 12570 WHEN pagelist_wc%:PROCcheck_pagelist_wc 12580 WHEN print_w%:PROCcheck_print_w 12590 ENDCASE 12600 ENDPROC 12610 12620 DEFPROCtry_main_w 12630 SYS setcaret%,main_w%,-1,0,0,10 12640 mx%=!q%:my%=q%!4 12650 button%=q%!8 12660 IF button%AND2 THEN 12670 IF menu_enabled% PROCopen_try_menu(mx%,my%) 12680 ENDPROC 12690 ENDIF 12700 IF scanning% PROCscan_click(button%):ENDPROC 12710 IF pointer_on%=1 ENDPROC 12720 icon%=q%!16 12730 !q%=main_w%:SYS getw%,,q% 12740 offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) 12750 mx%-=offx%:my%-=offy% 12760 CASE button% OF 12770 WHEN &40 12780 stack%=FNstack(current_page%) 12790 object%=FNwhich_object(current_page%,mx%,my%) 12800 IF object% THEN 12810 SYS getentry%,stack%,object% TO adr% 12820 click%=adr%!28 12830 IF click% THEN 12840 SYS getentry%,s_clicks%,click% TO adr% 12850 IF adr%!4 THEN 12860 SYS getentry%,s_mousedrag%,adr%!4 TO adr% 12870 PROCbegin_save(object%,adr%!12) 12880 ENDIF 12890 ENDIF 12900 ENDIF 12910 WHEN &100 12920 page_ptr%-=4:IF page_ptr%<0 page_ptr%=1020 12930 IF page_ptr%!page_stack%<>0 THEN 12940 PROCdelight 12950 current_page%=page_ptr%!page_stack% 12960 page_ptr%!page_stack%=0 12970 PROCpre_process 12980 PROCshow_page(current_page%) 12990 IF scanning% PROCscan 13000 ENDIF 13010 WHEN &400 13020 stack%=FNstack(current_page%) 13030 object%=FNwhich_object(current_page%,mx%,my%) 13040 IF object% THEN 13050 SYS getentry%,stack%,object% TO adr% 13060 click%=adr%!28 13070 IF click% THEN 13080 SYS getentry%,s_clicks%,click% TO adr% 13090 IF adr%!20 PROCdo_click_recorded(object%,s_mouse%,adr%!20) 13100 ENDIF 13110 ELSE 13120 SYS getentry%,s_pages%,current_page% TO adr% 13130 click%=adr%!24 13140 IF click% THEN 13150 SYS getentry%,s_clicks%,click% TO adr% 13160 IF adr%!20 PROCdo_click_recorded(0,s_mouse%,adr%!20) 13170 ENDIF 13180 ENDIF 13190 ENDCASE 13200 ENDPROC 13210 13220 DEFPROCtry_keys 13230 CASE !q% OF 13240 WHEN main_w% 13250 key%=q%!24 13260 IF key%=13 THEN 13270 stack%=FNstack(current_page%) 13280 IF FNlower_case(LEFT$(input$,6))="object" THEN 13290 token%=VAL(RIGHT$(input$,LEN(input$)-6)) 13300 SYS getentry%,stack%,token% TO adr% 13310 IF adr% THEN 13320 IF adr%!28 THEN 13330 pointer_object%=token% 13340 SYS getentry%,s_clicks%,adr%!28 TO adr% 13350 IF adr%!20 PROCdo_click_recorded(token%,s_mouse%,adr%!20) 13360 ENDIF 13370 ENDIF 13380 ENDIF 13390 IF FNlower_case(LEFT$(input$,4))="back" q%!8=&100:PROCtry_main_w 13400 input$="" 13410 ELSE 13420 IF key%=27:PROCclose_window(main_w%):ENDPROC 13430 IF key%=&180 PROCopen_print_w:ENDPROC 13440 IF key%>31 AND key%<255 input$=input$+CHR$(key%) ELSE SYS processkey%,key% 13450 IF LENinput$=255 input$="" 13460 ENDIF 13470 WHEN print_w% 13480 IF q%!24=13 q%!8=4:q%!16=4:PROCcheck_print_w ELSE SYS processkey%,q%!24 13490 OTHERWISE 13500 SYS processkey%,q%!24 13510 ENDCASE 13520 ENDPROC 13530 13540 DEFPROCdo_click_recorded(object%,context%,click%) 13550 IF object% status$=".object"+STR$object%+"."+RIGHT$(TIME$,8) 13560 IF object%=0 status$=".background."+RIGHT$(TIME$,8) 13570 OSCLI "set Ustatus "+FNleaf(full_name$)+"."+current_page$+status$ 13580 PROCdo_click(context%,click%) 13590 ENDPROC 13600 13610 DEFPROCdo_click(context%,click%) 13620 SYS getentry%,context%,click% TO adr% 13630 SYS movedata%,adr%,ws%+8,!adr% 13640 !ws%=(ws%!8)+8:ws%!4=12:ws%!8=0 13650 PROCmake_space(!ws%+16) 13660 SYS addentry%,s_clickson%,ws% 13670 PROCcheck_clicks 13680 ENDPROC 13690 13700 DEFPROCcheck_clicks 13710 SYS nentries%,s_clickson% TO nc% 13720 IF nc%=0 ENDPROC 13730 FOR click%=1TOnc% 13740 SYS getnth%,s_clickson%,click% TO click_adr% 13750 IF click_adr%!8<TIME AND click_adr%!4<>0 THEN 13760 ptr%=click_adr%!4:cadr%=click_adr%+ptr% 13770 click_len%=!cadr%:cmd%=cadr%!4:ok%=TRUE 13780 CASE cmd% OF 13790 WHEN 1,3,4:PROCclick_list(cmd%,cadr%+8,click_len%-12) 13800 WHEN 2 13810 PROCdelight 13820 page_ptr%!page_stack%=current_page% 13830 page_ptr%+=4:IF page_ptr%=1024 page_ptr%=0 13840 current_page%=cadr%!8 13850 IF current_page%=0 SYS nentries%,s_pages% TO t%:current_page%=RND(t%) 13860 IF current_page%=0 current_page%=1 13870 PROCpre_process 13880 PROCshow_page(current_page%) 13890 IF scanning% PROCscan 13900 ENDPROC 13910 WHEN 5 13920 SYS playsound%,0 TO t% 13930 IF t%=-1 ok%=FALSE ELSE PROCplay_sound(cadr%!8) 13940 WHEN 6:PROCspeak_text(stack%,cadr%!8) 13950 WHEN 7:PROCinit_seq(TIME,cadr%) 13960 WHEN 8: 13970 click_cmd$=FNstring0(cadr%+8) 13980 cmd$=FNlower_case(click_cmd$) 13990 IF LEFT$(cmd$,10)="load file " THEN 14000 file$=RIGHT$(cmd$,LENcmd$-10):page$="" 14010 IF INSTR(file$," ") THEN 14020 page$=RIGHT$(file$,LEN(file$)-INSTR(file$," ")) 14030 file$=LEFT$(file$,INSTR(file$," ")-1) 14040 ENDIF 14050 file$=full_name$+"."+file$ 14060 LOCAL ERROR 14070 ON ERROR LOCAL:RESTORE ERROR:click_adr%!4=0:ERROR 1,REPORT$ 14080 PROCload_file(file$,1) 14090 IF page$<>"" page%=FNname_exsists(s_pages%,page$):IF page% current_page%=page% 14100 PROCpre_process 14110 PROCshow_page(current_page%) 14120 IF scanning% PROCscan 14130 PROCzero_page_stack 14140 ENDPROC 14150 ENDIF 14160 IF LEFT$(cmd$,4)="load" OR LEFT$(cmd$,5)="*load" THEN 14170 file$=RIGHT$(cmd$,LENcmd$-5):page$="" 14180 IF INSTR(file$," ") THEN 14190 page$=RIGHT$(file$,LEN(file$)-INSTR(file$," ")) 14200 file$=LEFT$(file$,INSTR(file$," ")-1) 14210 ENDIF 14220 LOCAL ERROR 14230 ON ERROR LOCAL:RESTORE ERROR:click_adr%!4=0:ERROR 1,REPORT$ 14240 PROCload_file(file$,1) 14250 IF page$<>"" page%=FNname_exsists(s_pages%,page$):IF page% current_page%=page% 14260 PROCpre_process 14270 PROCshow_page(current_page%) 14280 IF scanning% PROCscan 14290 PROCzero_page_stack 14300 ENDPROC 14310 ENDIF 14320 IF LEFT$(cmd$,3)="run" OR LEFT$(cmd$,4)="*run" THEN 14330 file$=RIGHT$(cmd$,LENcmd$-4):PRINTfile$ 14340 LOCAL ERROR 14350 ON ERROR LOCAL:RESTORE ERROR:click_adr%!4=0:ERROR 1,REPORT$ 14360 OSCLI "filer_run "+file$ 14370 click_cmd$="" 14380 ENDIF 14390 IF LEFT$(cmd$,6)="replay" THEN 14400 file$=RIGHT$(cmd$,LENcmd$-7) 14410 IF INSTR(file$,"-at")=0 THEN 14420 SYS getentry%,stack%,object% TO adr% 14430 x%=(adr%!12)+offx%:y%=(adr%!16)+offy% 14440 file$=file$+" -at "+STR$x%+","+STR$y% 14450 ENDIF 14460 LOCAL ERROR 14470 ON ERROR LOCAL:RESTORE ERROR:click_adr%!4=0:ERROR 1,REPORT$ 14480 SYS "Wimp_StartTask",file$ 14490 click_cmd$="" 14500 ENDIF 14510 IF LEFT$(cmd$,4)="back" input$="back":!q%=main_w%:q%!24=13:PROCtry_keys:ENDPROC 14520 IF LEFT$(cmd$,6)="object" THEN 14530 click_cmd$="" 14540 input$=cmd$+CHR$13 14550 ENDIF 14560 LOCAL ERROR 14570 ON ERROR LOCAL:RESTORE ERROR:click_adr%!4=0:ERROR 1,REPORT$ 14580 IF click_cmd$<>"" OSCLI click_cmd$ 14590 WHEN 9:click_adr%!8=TIME+cadr%!8 14600 WHEN 12:pointer_on%=2:PROCget_pointer:IF handle%=main_w% SYS "Wimp_SpriteOp",36,1,"ptr_hand",2 14610 ENDCASE 14620 SYS getnth%,s_clickson%,click% TO click_adr% 14630 IF ok% click_adr%!4=ptr%+click_len% 14640 IF click_adr%!4>=!click_adr% click_adr%!4=0 14650 ENDIF 14660 NEXT 14670 click%=1 14680 REPEAT 14690 SYS getnth%,s_clickson%,click% TO adr%,token% 14700 IF adr%!4=0 THEN 14710 SYS killentry%,s_clickson%,token% 14720 click%-=1 14730 ENDIF 14740 click%+=1 14750 SYS nentries%,s_clickson% TO nc% 14760 UNTILclick%>=nc% OR nc%=0 14770 ENDPROC 14780 14790 DEFPROCclick_list(cmd%,adr%,len%) 14800 FORlist%=0TOlen%STEP4 14810 CASE cmd% OF 14820 WHEN 1 14830 SYS getentry%,stack%,list%!adr% TO t% 14840 IF (t%!36)AND1 t%=0 ELSE t%=1 14850 PROClight_object(stack%,list%!adr%,1,1) 14860 WHEN 3:PROChide_object(stack%,list%!adr%,1,1) 14870 WHEN 4:PROChide_object(stack%,list%!adr%,0,1) 14880 ENDCASE 14890 NEXT 14900 ENDPROC 14910 14920 DEFPROCunder_pointer:IF pointer_on%=1 ENDPROC 14930 PROCget_pointer 14940 !q%=main_w%:SYS getw%,,q% 14950 offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) 14960 mx%=mousex%-offx%:my%=mousey%-offy% 14970 IF handle%=main_w% object%=FNwhich_object(current_page%,mx%,my%) ELSE object%=0 14980 IF object%<>pointer_object% THEN 14990 OSCLI"pointer 1":pointer_on%=TRUE 15000 pointer_object%=object% 15010 stack%=FNstack(current_page%) 15020 SYS nentries%,stack% TO no% 15030 IF no% THEN 15040 FOR ob%=1TOno% 15050 SYS getnth%,stack%,ob% TO adr%,token% 15060 IF token%<>object% AND (adr%!36)AND1 PROClight_object(stack%,token%,0,1) 15070 NEXT 15080 IF object% THEN 15090 SYS getentry%,stack%,object% TO adr%,token% 15100 IF adr%!28 THEN 15110 SYS getentry%,s_clicks%,adr%!28 TO adr% 15120 IF adr%!16 PROCdo_click(s_pointer%,adr%!16) 15130 ENDIF 15140 ELSE 15150 SYS getentry%,s_pages%,current_page% TO adr% 15160 IF adr%!24 THEN 15170 SYS getentry%,s_clicks%,adr%!24 TO adr% 15180 IF adr%!16 PROCdo_click(s_pointer%,adr%!16) 15190 ENDIF 15200 ENDIF 15210 ENDIF 15220 ENDIF 15230 ENDPROC 15240 15250 DEFPROCoften:IF pointer_on%<>TRUE ENDPROC 15260 stack%=FNstack(current_page%) 15270 SYS nentries%,stack% TO no% 15280 IF no% THEN 15290 FOR ob%=1TOno% 15300 SYS getnth%,stack%,ob% TO adr%,token% 15310 IF adr%!28 THEN 15320 SYS getentry%,s_clicks%,adr%!28 TO adr% 15330 IF adr%!8 THEN 15340 IF adr%!24<TIME THEN 15350 adr%!24=TIME+adr%!12 15360 PROCdo_click(s_often%,adr%!8) 15370 ENDIF 15380 ENDIF 15390 ENDIF 15400 NEXT 15410 ENDIF 15420 ENDPROC 15430 15440 DEFPROCopen_try_menu(mx%,my%) 15450 FORI%=0TO2STEP2:P%=main% 15460 [optI% 15470 equs menu$ 15480 equd &070207 15490 equd 168:equd 40:equd 0 15500 equd 8:equd pagelist_wc%:equd &07000021 15510 equs "Show page " 15520 equd &80:equd -1:equd &07000021 15530 equs "Print " 15540 ]:NEXT 15550 menu%=11 15560 SYS createmenu%,,main%,mx%,my%-32 15570 ENDPROC 15580 15590 DEFPROCtry_menu_warning 15600 mx%=q%!24:my%=q%!28:item%=q%!32 15610 PROCarrange_pagelist_wc(current_page%) 15620 SYS crsubmenu%,,pagelist_wc%,mx%,my% 15630 ENDPROC 15640 15650 DEFPROCtry_menu_select 15660 CASE menu% OF 15670 WHEN 5:PROCicon_bar_menu 15680 WHEN 11: 15690 CASE !q% OF 15700 WHEN 1:PROCopen_print_w 15710 ENDCASE 15720 ENDCASE 15730 ENDPROC 15740 15750 DEFPROCtry_pagelist_wc 15760 but%=q%!8 15770 !ws%=pagelist_wc%:SYS getw%,,ws% 15780 offx%=(ws%!4-ws%!20):offy%=(ws%!16-ws%!24) 15790 page%=(((q%!4)-offy%)DIV-48)+1 15800 SYS nentries%,s_pages% TO np%:IF page%>np% ENDPROC 15810 SYS getnth%,s_pages%,page% TO ,page% 15820 PROCarrange_pagelist_wc(page%) 15830 PROCshow_page(page%) 15840 PROCarrange_pagelist_wc(current_page%) 15850 PROCbegin_trying 15860 IF but%AND4 SYS createmenu%,,-1 15870 ENDPROC 15880 15890 DEFPROCscan 15900 IF scan_count%>TIME ENDPROC 15910 IF scan_keys%=1 scan_count%=TIME+scan_time% 15920 stack%=FNstack(current_page%) 15930 SYS nentries%,stack% TO no% 15940 IF no%=0 ENDPROC 15950 IF scan_object%<>0 THEN 15960 SYS getnth%,stack%,scan_object% TO adr%,token% 15970 IF adr%!36 AND 1 THEN 15980 PROClight_object(stack%,token%,0,1) 15990 scan_object%+=1 16000 IF scan_object%>no% scan_object%=1 16010 ENDIF 16020 ELSE 16030 scan_object%=1 16040 ENDIF 16050 yes%=0 16060 REPEAT 16070 SYS getnth%,stack%,scan_object% TO adr%,token% 16080 IF (adr%!28)<>0 AND ((adr%!36)AND128)=0 THEN 16090 SYS getentry%,s_clicks%,adr%!28 TO adr% 16100 IF adr%!16 THEN 16110 PROClight_object(stack%,token%,1,1):yes%=no% 16120 ELSE 16130 scan_object%+=1 16140 IF scan_object%>no% scan_object%=1 16150 yes%+=1 16160 ENDIF 16170 ELSE 16180 scan_object%+=1 16190 IF scan_object%>no% scan_object%=1 16200 yes%+=1 16210 ENDIF 16220 UNTILyes%=no% 16230 ENDPROC 16240 16250 DEFPROCscan_click(but%) 16260 IF scan_object%=0 ENDPROC 16270 stack%=FNstack(current_page%) 16280 IF scan_keys%=1 OR (scan_keys%=2 AND (but%AND&101)) THEN 16290 SYS getnth%,stack%,scan_object% TO adr%,token% 16300 IF adr%!28 THEN 16310 SYS getentry%,s_clicks%,adr%!28 TO adr% 16320 IF adr%!20 PROCdo_click(s_mouse%,adr%!20) 16330 ENDIF 16340 ELSE 16350 IF but%AND&404 PROCscan 16360 ENDIF 16370 ENDPROC 16380 16390 DEFPROCredefine_main_w 16400 !q%=main_w%:SYS getwi%,,q% 16410 IF (q%!32)AND(1<<16) open%=TRUE ELSE open%=FALSE 16420 SYS "Wimp_DeleteWindow",,q% 16430 f%=((q%!32)AND&83FFFFFF) OR (&83<<24) 16440 bh%=q%!28 16450 IF h_scroll% f%=f%OR(1<<30) 16460 IF v_scroll% f%=f%OR(1<<28) 16470 IF h_scroll% OR v_scroll% f%=f%OR(1<<29) 16480 IF title_bar% f%=f%OR(1<<26):IF toggle_icon% f%=f%OR(1<<27) 16490 q%!32=f% 16500 SYS "Wimp_CreateWindow",,q%+4 TO main_w% 16510 !q%=main_w%:SYS getw%,,q%:PROCopen_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,bh%) 16520 ENDPROC 16530 16540 DEFPROCinit_seq(time%,adr%) 16550 SYS movedata%,adr%,ws%,!adr% 16560 IF (adr%!12)AND4 ws%!4=40:ws%!8=36 ELSE ws%!4=36:ws%!8=0 16570 ws%!12=4:ws%!16=adr%!20:ws%!20=time% 16580 ws%!24=adr%!8:ws%!28=0:ws%!32=adr%!12 16590 PROCmake_space(!ws%+16) 16600 SYS addentry%,s_sequences%,ws% 16610 IF (ws%!32)AND64 pointer_on%=1:PROCget_pointer:IF handle%=main_w% SYS "Wimp_SpriteOp",36,1,"ptr_clock",2 16620 ENDPROC 16630 16640 DEFPROCcheck_sequences(time%) 16650 SYS nentries%,s_sequences% TO ns% 16660 IF ns% THEN 16670 stack%=FNstack(current_page%) 16680 FOR seq%=1 TO ns% 16690 SYS getnth%,s_sequences%,seq% TO adr% 16700 IF time%>adr%!20 THEN 16710 adr%!20=time%+adr%!16 16720 len%=!adr%:ptr%=adr%!4:optr%=adr%!8:ptr_inc%=adr%!12 16730 loop%=(adr%!32)AND2:last_one%=0 16740 last%=(adr%!32)AND8:trail%=(adr%!32)AND16:noud%=(adr%!32)AND32 16750 seethru%=(adr%!32)AND128 16760 IF adr%!24<>0 AND adr%!28=adr%!24 THEN 16770 IF loop% THEN 16780 IF ptr%=40 last_one%=TRUE 16790 ELSE 16800 IF ptr%=36 last_one%=TRUE 16810 ENDIF 16820 ENDIF 16830 IF optr%<>0 AND trail%=0 THEN 16840 IF last_one% THEN 16850 IF last%=0 THEN 16860 IF noud% THEN 16870 PROCfast_draw(stack%,optr%!adr%,TRUE,0) 16880 ELSE 16890 PROChide_object(stack%,optr%!adr%,1,1) 16900 ENDIF 16910 ENDIF 16920 ELSE 16930 IF noud% THEN 16940 PROCfast_draw(stack%,optr%!adr%,TRUE,0) 16950 ELSE 16960 PROChide_object(stack%,optr%!adr%,1,1) 16970 ENDIF 16980 ENDIF 16990 ENDIF 17000 IF last_one%=0 THEN 17010 IF noud% THEN 17020 PROCfast_draw(stack%,ptr%!adr%,0,seethru%) 17030 ELSE 17040 PROChide_object(stack%,ptr%!adr%,0,1) 17050 ENDIF 17060 adr%!8=ptr%:ptr%+=ptr_inc% 17070 IF loop% THEN 17080 IF ptr%=len% THEN 17090 ptr%=len%-8:adr%!12=-4 17100 ELSE 17110 IF ptr%=32 THEN 17120 ptr%=40:adr%!12=4 17130 IF adr%!24<>0 adr%!28=(adr%!28)+1 17140 ENDIF 17150 ENDIF 17160 ELSE 17170 IF ptr%=len% THEN 17180 ptr%=36 17190 IF adr%!24<>0 adr%!28=(adr%!28)+1 17200 ENDIF 17210 ENDIF 17220 ELSE 17230 ptr%=0 17240 ENDIF 17250 adr%!4=ptr% 17260 ENDIF 17270 NEXT 17280 REPEAT 17290 nomore%=TRUE 17300 SYS nentries%,s_sequences% TO ns% 17310 IF ns% THEN 17320 FOR seq%=1 TO ns% 17330 SYS getnth%,s_sequences%,seq% TO adr%,token% 17340 IF adr%!4=0 AND (adr%!32)AND64 OSCLI"pointer 1":pointer_on%=TRUE 17350 IF adr%!4=0 nomore%=0:seq%=ns%:SYS killentry%,s_sequences%,token% 17360 NEXT 17370 ENDIF 17380 UNTILnomore% 17390 ENDIF 17400 ENDPROC 17410 17420 DEFPROCfast_draw(stack%,token%,erase%,seethru%) 17430 LOCAL adr% 17440 !q%=main_w%:SYS getw%,,q% 17450 offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) 17460 SYS getentry%,stack%,token% TO adr% 17470 x%=(adr%!12)+offx% 17480 y%=(adr%!16)+offy% 17490 x1%=(adr%!20)-(1<<xef%)+offx% 17500 y1%=(adr%!24)-(1<<yef%)+offy% 17510 IF erase% THEN 17520 IF ((adr%!36)AND128)=0 adr%!36=(adr%!36)OR128 17530 SYS getentry%,s_pages%,current_page% TO adr1% 17540 bcol%=adr1%!28: 17550 ELSE 17560 IF (adr%!36)AND128 AND seethru%=0 adr%!36=(adr%!36)EOR128 17570 ENDIF 17580 flags%=adr%!36:type%=adr%!4 17590 !q%=main_w%:q%!4=x%-offx%:q%!8=y%-offy%-32:q%!12=x1%-offx%+(1<<xef%)+32:q%!16=y1%-offy%+(1<<yef%) 17600 SYS updatew%,,q% TO more% 17610 WHILE more% 17620 IF erase% THEN 17630 SYS setcol%,bcol%:RECTANGLE FILL x%,y%,x1%-x%,y1%-y% 17640 ELSE 17650 CASE type% OF 17660 WHEN s_text%:PROCdraw_text(stack%,token%,offx%,offy%) 17670 WHEN s_sprites%,s_draw%:PROCdraw_picture(adr%!4,adr%!8,x%+(1<<xef%),y%+(1<<yef%),x1%-x%,y1%-y%,flags%) 17680 ENDCASE 17690 ENDIF 17700 SYS getr%,,q% TO more% 17710 ENDWHILE 17720 ENDPROC 17730 17740 DEFPROCspeak_text(stack%,token%) 17750 speak_token%=token% 17760 speak_word%=0:speak_sound%=0 17770 SYS getentry%,stack%,token% TO adr% 17780 SYS getentry%,s_text%,adr%!8 TO adr% 17790 sptext%=adr%+4 17800 IF ?sptext%<>0 THEN 17810 speaking_text%=TRUE 17820 text$="":a%=sptext% 17830 REPEAT:text$=text$+CHR$(?a%):a%+=1:UNTIL?a%<48 17840 speak_sound%=FNname_exsists(s_sounds%,text$) 17850 PROCupdate_object(stack%,speak_token%) 17860 ENDIF 17870 ENDPROC 17880 17890 DEFPROCspeaking_text 17900 SYS getentry%,stack%,speak_token% TO adr% 17910 SYS getentry%,s_text%,adr%!8 TO adr% 17920 sptext%=adr%+4 17930 REPEAT 17940 speak_word%+=1 17950 c%=speak_word%?sptext% 17960 UNTILc%=32 OR c%=13 OR c%=0 17970 IF c%=32 OR c%=13 THEN 17980 REPEAT 17990 speak_word%+=1:c%=speak_word%?sptext% 18000 UNTILc%>32 OR c%=0 18010 ENDIF 18020 IF c%<>0 THEN 18030 text$="":a%=speak_word%+sptext% 18040 REPEAT:text$=text$+CHR$(?a%):a%+=1:UNTIL?a%<48 18050 speak_sound%=FNname_exsists(s_sounds%,text$) 18060 ENDIF 18070 IF c%=0 speaking_text%=FALSE 18080 PROCupdate_object(stack%,speak_token%) 18090 ENDPROC 18100 18110 DEFPROChighlight_text(stack%,token%,offx%,offy%,word%) 18120 SYS getentry%,stack%,token% TO adr% 18130 x%=(adr%!12)+offx% 18140 y%=(adr%!16)+offy% 18150 x1%=(adr%!20)-(1<<xef%)+offx% 18160 y1%=(adr%!24)-(1<<yef%)+offy% 18170 flags%=adr%!36:font%=adr%!40:b_s%=adr%!32 18180 fcol%=adr%!52:IF fcol% AND &FF fcol%=default_page_col% 18190 bcol%=adr%!56 18200 IF flags%AND1 fcol%=fcol%EOR&FFFFFF00:bcol%=bcol%EOR&FFFFFF00 18210 PROCdraw_border(b_s%,fcol%,bcol%,x%,y%,x1%,y1%) 18220 x%+=(1<<xef%) 18230 x1%-=(1<<xef%) 18240 y%+=(1<<yef%) 18250 y1%-=(1<<yef%) 18260 LOCAL ERROR 18270 ON ERROR LOCAL RESTORE ERROR:font%=0 18280 IF font% THEN 18290 SYS getentry%,s_fonts%,font% TO t% 18300 SYS findfont%,,t%+4,adr%!44,adr%!48 TO font% 18310 ENDIF 18320 IF font% THEN 18330 IF bcol% AND &FF bcol%=fcol% 18340 SYS fontinfo%,font% TO ,cx%,cy%,cx1%,cy1% 18350 ELSE 18360 cx%=-(1<<xef%):cy%=-(1<<yef%):cx1%=8<<xef%:cy1%=8<<yef% 18370 ENDIF 18380 text_height%=cy1% 18390 SYS getentry%,s_text%,adr%!8 TO text% 18400 text%+=4 18410 text_offset%=0 18420 px%=x%+margin%:py%=y1%-text_height%+cy% 18430 centre%=FALSE:right%=FALSE:underline%=FALSE 18440 IF flags% AND 8 centre%=TRUE 18450 IF flags% AND 16 right%=TRUE 18460 IF flags% AND 32 underline%=TRUE 18470 REPEAT 18480 CASE text_offset%?text% OF 18490 WHEN 0: 18500 WHEN 13:py%-=text_height%:text_offset%+=1 18510 OTHERWISE 18520 text$=FNstring0(text%+text_offset%) 18530 text_offset%+=LENtext$ 18540 px%=x%+margin% 18550 IF font% THEN 18560 SYS stringwidth%,,text$,1<<30,1<<30,-1,LENtext$ TO ,,w% 18570 SYS converttoos%,,w% TO ,w% 18580 IF centre% px%=x%+(x1%-x%)DIV2-w%DIV2 18590 IF right% px%=x1%-w%-margin% 18600 IF underline% ul$=CHR$(25)+CHR$(1)+CHR$(16) ELSE ul$="" 18610 SYS "ColourTrans_SetFontColours",font%,bcol%,fcol%,14 18620 SYS paint%,,ul$+text$,1<<4,px%,py%-cy% 18630 IF text_offset%>word% AND (text_offset%-LENtext$)<=word% THEN 18640 i%=word%-(text_offset%-LEN(text$)) 18650 l$=LEFT$(text$,i%) 18660 SYS stringwidth%,,l$,1<<30,1<<30,-1,LENl$ TO ,,w% 18670 SYS converttoos%,,w% TO ,w% 18680 px%+=w% 18690 r$=RIGHT$(text$,LENtext$-LENl$) 18700 IF INSTR(r$," ") r$=LEFT$(r$,INSTR(r$," ")) 18710 SYS "ColourTrans_SetFontColours",font%,bcol%EOR&FFFFFF00,fcol%EOR&FFFFFF00,14 18720 SYS paint%,,ul$+r$,1<<4,px%,py%-cy% 18730 ENDIF 18740 ELSE 18750 w%=LENtext$*cx1% 18760 IF centre% px%=x%+(x1%-x%)DIV2-w%DIV2 18770 IF right% px%=x1%-w%-margin% 18780 SYS setcol%,fcol%:MOVE px%,py%+cy1%:PRINTtext$ 18790 IF underline% MOVE px%,py%-cy%:PLOT1,cx1%*LENtext$,0 18800 IF text_offset%>word% AND (text_offset%-LENtext$)<=word% THEN 18810 i%=word%-(text_offset%-LEN(text$)) 18820 l$=LEFT$(text$,i%) 18830 w%=LENl$*cx1%:px%+=w% 18840 r$=RIGHT$(text$,LENtext$-LENl$) 18850 IF INSTR(r$," ") r$=LEFT$(r$,INSTR(r$," ")) 18860 SYS setcol%,fcol%EOR&FFFF0000:MOVE px%,py%+cy1%:PRINTr$ 18870 IF underline% MOVE px%,py%-cy%:PLOT1,cx1%*LENr$,0 18880 ENDIF 18890 ENDIF 18900 ENDCASE 18910 UNTIL text_offset%?text%=0 18920 IF font% SYS losefont%,font% 18930 ENDPROC 18940 18950 DEFPROCbegin_save(object%,sound%) 18960 SYS getentry%,stack%,object% TO adr% 18970 SYS getp%,,q%:mx%=!q%:my%=q%!4 18980 ix%=mx%-38:iy%=my%-38:ix1%=mx%+38:iy1%=my%+38 18990 IF sound% THEN 19000 IF adr%!28 THEN 19010 SYS getentry%,s_clicks%,adr%!28 TO adr% 19020 IF adr%!20 THEN 19030 SYS getentry%,s_mouse%,adr%!20 TO adr% 19040 IF adr%!8=5 THEN 19050 drag_sound%=adr%!12 19060 PROCstart_drag(3,ix%,iy%,ix1%,iy1%) 19070 ENDIF 19080 ENDIF 19090 ENDIF 19100 ELSE 19110 IF adr%!4=s_text% THEN 19120 drag_ptype%=s_text%:drag_picture%=adr%!8 19130 PROCstart_drag(20,ix%,iy%,ix1%,iy1%) 19140 ELSE 19150 drag_ptype%=adr%!4:drag_picture%=adr%!8 19160 PROCstart_drag(4,ix%,iy%,ix1%,iy1%) 19170 ENDIF 19180 ENDIF 19190 ENDPROC 19200 19210 DEFPROCtry_user_drag 19220 PROCget_pointer 19230 IF handle%=main_w% ENDPROC 19240 q%!20=handle%:q%!24=icon% 19250 q%!28=mousex%:q%!32=mousey% 19260 q%!36=sprite_size%-24 19270 !q%=56 19280 CASE drag_type% OF 19290 WHEN 3:REM saving sound 19300 SYS getentry%,s_sounds%,drag_sound% TO adr% 19310 save$=FNstring0(adr%+4) 19320 file_type%=&D3C 19330 WHEN 4:REM saving picture 19340 SYS getentry%,drag_ptype%,drag_picture% TO adr% 19350 save$=FNstring0(adr%+4) 19360 IF drag_ptype%=s_sprites% file_type%=&FF9 ELSE file_type%=&AFF 19370 WHEN 20:REM saving text 19380 save$="text" 19390 file_type%=&FFF 19400 ENDCASE 19410 q%!40=file_type% 19420 PROCstring0(q%+44,save$) 19430 q%!12=q%!8:q%!16=1 19440 SYS sendmessage%,17,q%,handle%,icon%:REM send datasave 19450 myref%=q%!8 19460 DMT%=0 19470 DMT_ptr%=0 19480 ENDCASE 19490 ENDPROC
$� Ultimap v 2.00 (30 March 1995) � � Simon Hayles 1994 ( �=&40000 2 � taskid% 4:$taskid%="TASK" <H ș "Wimp_Initialise",200,!taskid%,"Ultimap" � version%,task_handle% F P � � �errorbox Z d �vars n x& ș "OS_Module",16,"Ubase%Ultimap" � *UBASE 40000 800000 � � � global variables � �8 � box% 12,box2% 12,matrix% 16,origin1% 8,origin2% 8 �! icon_font$="Homerton.Medium" � full_name$="Untitled" � query_string$="" � menu%=0 � sprite_size%=&1E000 � � q% 256,old_q% 256 � � errblk% 3000 �' � main% 1000,sprites% sprite_size% @ !sprites%=sprite_size%:sprites%!8=16:ș spop%,&209,sprites% � wimp_palette% 20*4 � page_stack% 1024 " , s_sprites%=1 6 s_draw%=2 @ s_replay%=3 J s_quicktime%=4 T s_fonts%=5 ^ s_starcoms%=6 h s_loadorder%=7 r s_sounds%=8 | s_text%=9 � s_pages%=10 � � s_clicks%=11 � s_mousedrag%=12 � s_often%=13 � s_pointer%=14 � s_mouse%=15 � s_pageshown%=16 � s_spare%=17 � s_clickson%=18 � s_temp%=19 � s_sequences%=20 � � options printing%=� & portrait%=� 0 current_page%=0 : margin%=16 D click_time=1 N click_pause=1 X temp_list%=0 b trying%=� l speaking_text%=� v speak_sound%=� � speak_token%=� � h_scroll%=� � v_scroll%=� � toggle_icon%=� � title_bar%=� � scanning%=� � scan_keys%=1 � scan_time%=100 � scan_object%=1 � scan_count%=0 � menu_enabled%=� � ws%=sprites%+32 � page_size%=3 file_version%=101 current_page$="Page 1" ws%=sprites%+32 * ș "Hourglass_On" 4 �load_templates > �get_mode_info H �load_options R �new_file \ f& ș "OS_GetEnv" � EnvStr$,end_adr% p � �EnvStr$," -quit ") � z- I%=�EnvStr$,""""):I%=�EnvStr$,"""",I%+1) � �I%+=1:��EnvStr$,I%,1)<>" " � f$=�EnvStr$,I%) �, � f$<>"" full_name$=f$:�load_file(f$,2) � � � � icon_bar%=�iconbar � �$ ș setcaret%,main_w%,-1,0,10,10 � � ș "Hourglass_Off" � � � �errorbox � � ș drag%,,-1 �begin_trying � �try_poll $ � � . 8 ��load_templates B5 � font_array% 256:�t%=0�252�4:t%!font_array%=0:� L3 ș "Wimp_OpenTemplate",,"<Obey$Dir>.Templates" V � winds% 2000,indir% 1000 ` indl%=indir%+4000 jI ș "Wimp_LoadTemplate",,winds%,indir%,indl%,-1,"main_w",0 � ,,indir% t- ș "Wimp_CreateWindow",,winds% � main_w% ~W ș "Wimp_LoadTemplate",,winds%,indir%,indl%,font_array%,"pagelist_wc",0 � ,,indir% �2 ș "Wimp_CreateWindow",,winds% � pagelist_wc% �S ș "Wimp_LoadTemplate",,winds%,indir%,indl%,font_array%,"print_w",0 � ,,indir% �. ș "Wimp_CreateWindow",,winds% � print_w% �G ș "Wimp_LoadTemplate",,winds%,indir%,indl%,-1,"info",0 � ,,indir% �+ ș "Wimp_CreateWindow",,winds% � info% � ș "Wimp_CloseTemplate" � � �; � ��load_options �$ ptr%=�("<Ultimap$Dir>.options") �P �#ptr%,toolbox_on%,scanning%,scan_keys%,scan_time%,menu_enabled%,sound_vol% � �#ptr% % ptr%=�("<Ultimap$Dir>.messages") �#ptr%,info$,info1$ �#ptr% " �set_icon_text(info%,1,info$) (# �set_icon_text(info%,2,info1$) 2 � < F P � �finish Z ș setcaret%,-1 d �lose_fonts n. ș "Wimp_CloseDown",task_handle%,!taskid% x ș "OS_Exit" �� � � ��redraw_window � ș redraww%,,q% � more% � ȕ more% �- offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) � Ȏ !q% � �\ � main_w%:�draw_main_w(q%!28-offx%,q%!32-offy%,q%!36-offx%,q%!40-offy%,offx%,offy%) �Z � pagelist_wc%:�draw_pagelist_wc(q%!28-offx%,q%!32-offy%,q%!36-offx%,q%!40-offy%) � � � ș getr%,,q% � more% � � � � � �front(handle%) !q%=handle%:ș getw%,,q% "; �open_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,-1) , � 6 @= � �open_window(handle%,x%,y%,x1%,y1%,scx%,scy%,bhandle%) J �handle%=-1�� T q%!28=bhandle% ^ q%!0=handle% h( q%!4=x%:q%!8=y%:q%!12=x1%:q%!16=y1% r q%!20=scx%:q%!24=scy% | ș openw%,,q% � � � � � � �close_window(handle%) � !q%=handle%:ș closew%,,q% � � � �� �vars � getenv%=&10 � wimp% = (1<<18) + (3<<6) � createw%=wimp%+1 � createicon%=wimp%+2 � deleteicon%=wimp%+4 openw%=wimp%+5 closew%=wimp%+6 poll%=wimp%+7 & redraww%=wimp%+8 0 updatew%=wimp%+9 : getr%=wimp%+10 D getw%=wimp%+11 N getwi%=wimp%+12 X seti%=wimp%+13 b geti%=wimp%+14 l getp%=wimp%+15 v drag%=wimp%+16 � forceredraw%=wimp%+17 � setcaret%=wimp%+18 � getcaret%=wimp%+19 � createmenu%=wimp%+20 � setextent%=wimp%+&17 � processkey%=wimp%+&1C � sendmessage%=wimp%+&27 � crsubmenu%=wimp%+&28 � ploticon%=&400E2 � � setcol%=&40743 � spop%=&2E � findfont%=&40081 losefont%=&40082 fontinfo%=&40084 stringwidth%=&40085 setfont%=&4008A * currentfont%=&4008B 4 converttoos%=&40088 > converttopoints%=&40089 H paint%=&40086 R findcaret%=&4008D \ charbbox%=&4008E f p Ubase%=&1C0100 z newfile%=Ubase% � newstack%=Ubase%+1 � killstack%=Ubase%+2 � addentry%=Ubase%+3 � amendentry%=Ubase%+4 � findtoken%=Ubase%+5 � killentry%=Ubase%+6 � movedata%=Ubase%+7 � addpacked%=Ubase%+8 � getentry%=Ubase%+9 � unpacksprite%=Ubase%+10 � nentries%=Ubase%+11 � movetoend%=Ubase%+12 � readstatus%=Ubase%+13 writestatus%=Ubase%+14 rendershape%=Ubase%+15 getnth%=Ubase%+17 $ locatefile%=Ubase%+19 . playsound%=Ubase%+20 8 B PD%=&80140 L PDselect%=PD%+5 V PDabort%=PD%+9 ` PDpagesize%=PD%+3 j PDgiverec%=PD%+11 t PDdrawpage%=PD%+12 ~ PDgetrec%=PD%+13 � PDendjob%=PD%+8 � � � � � � � � � �& ș "OS_Module",14,"Ubase%Ultimap" � � � �� �get_pointer �ș getp%,,q% �Hmousex%=!q%:mousey%=q%!4:b%=q%!8:handle%=q%!12:icon%=q%!16:ob%=q%!20 �� � � �errorbox � SYS drag%,,-1 4!errblk%=�:t$=�$:t$="("+ß+")"+t$+" at line "+Þ $(errblk%+4)=t$+�0 (-ș "Wimp_ReportError",errblk%,1,"Ultimap" 2� �<>1 �finish:� <=� IF printing% printing%=FALSE:PROCclose_window(print_w%) F� P; Z ݤiconbar d+ !q%=-1:q%!4=0:q%!8=0:q%!12=64:q%!16=64 n q%!20=&300A x �string0(q%+24,appsprite$) �' ș "Wimp_CreateIcon",,q% � handle% � =handle% �; � ��set_icon_fonts �1 ș findfont%,,icon_font$,12*16,12*16 � font% �. ș "Wimp_WhichIcon",print_w%,q%,1<<6,1<<6 �< t%=0:�:�icon_font(print_w%,t%!q%,font%):t%+=4:�t%!q%=-1 � � � �% ��icon_font(window%,icon%,font%) �% !errblk%=window%:errblk%!4=icon% �- errblk%!12=&FF000000:errblk%!8=font%<<24 � font%?font_array%+=1 ș seti%,,errblk% � " ��lose_fonts ,1 �A%=0�255:n%=A%?font_array%:A%?font_array%=0 6' � n%>0 � B%=1�n%:ș losefont%,A%:� @ �:� J T ��get_mode_info ^) ș "Wimp_ReadPalette",,wimp_palette% h+ ș "OS_ReadModeVariable",-1,4 � ,,xef% r+ ș "OS_ReadModeVariable",-1,5 � ,,yef% |5 ș "OS_ReadModeVariable",-1,11 � ,,screen_width% �6 ș "OS_ReadModeVariable",-1,12 � ,,screen_height% �J screen_width%=screen_width%<<xef%:screen_height%=screen_height%<<yef% � � � �& ��start_drag(type%,x%,y%,x1%,y1%) � !q%=0:q%!4=5 �) q%!8=x%:q%!12=y%:q%!16=x1%:q%!20=y1% �= q%!24=0:q%!28=0:q%!32=screen_width%:q%!36=screen_height% � ș drag%,,q% � drag_type%=type% � � � �m�-------------------------------------------------------------------------------------------------------- * ݤstring0(t%):� t$:t$="":� ?t%<32:="" - �:t$=t$+�?t%:t%+=1:�?t%<32 � �t$=255:=t$ & 0' ��string0(t%,t$):$t%=t$:t%?�t$=0:� : Dm�-------------------------------------------------------------------------------------------------------- N X ��check_pagelist_wc b but%=q%!8 l$ !ws%=pagelist_wc%:ș getw%,,ws% v/ offx%=(ws%!4-ws%!20):offy%=(ws%!16-ws%!24) �! page%=(((q%!4)-offy%)�-48)+1 �. ș nentries%,s_pages% � np%:� page%>np% � �' ș getnth%,s_pages%,page% � ,page% � current_page%=page% � �arrange_pagelist_wc(page%) � �pre_process � �show_page(page%) � � scanning% �scan � � but%�4 ș createmenu%,,-1 � � � � ��show_page(page%) � current_page%=page% !q%=main_w%:ș getw%,,q% A � (q%!32) � (1<<16) ș forceredraw%,-1,q%!4,q%!8,q%!12,q%!16 & �window_title(main_w%,full_name$) ' ș getentry%,s_pages%,page% � adr% *# current_page$=�string0(adr%+4) 4! � "set Upage "+current_page$ > � H R$ ��update_object(stack%,object%) \ � adr% f' ș getentry%,stack%,object% � adr% p< ș forceredraw%,main_w%,adr%!12,adr%!16,adr%!20,adr%!24 z � � �0 ��set_icon_state(window%,icon%,eor%,clear%) �X !errblk%=window%:errblk%!4=icon%:errblk%!8=eor%:errblk%!12=clear%:ș seti%,,errblk% � � � � ݤicon_state(window%,icon%) �C !errblk%=window%:errblk%!4=icon%:ș geti%,,errblk%:=errblk%!24 � �* � �set_icon_text(window%,icon%,text$) �7 !errblk%=window%:errblk%!4=icon%:ș geti%,,errblk% �0 �string0(errblk%!28,�text$,(errblk%!36)-1)) �/ errblk%!8=0:errblk%!12=0:ș seti%,,errblk% � � ) ݤleaf(name$):� �name$,".")=0:=name$ & �name$=�name$,�name$-�name$,".")) $ ��name$,".")=0:=name$ . 8& ��start_drag(type%,x%,y%,x1%,y1%) B !q%=0:q%!4=5 L) q%!8=x%:q%!12=y%:q%!16=x1%:q%!20=y1% V= q%!24=0:q%!28=0:q%!32=screen_width%:q%!36=screen_height% ` ș drag%,,q% j drag_type%=type% t � ~ � ��ramfetch � DMT_ref%=q%!4 � DMT%=q%!20 � DMT_len%=q%!24 � Ȏ file_type% � �> � &AFF,&FF9:�save_picture(drag_ptype%,drag_picture%,"") �* � &FFF:�save_text(drag_picture%,"") �) � &D3C:�save_sound(drag_sound%,"") � � � � � � ��datasaveack � q%!12<>myref% � DMT%=0 f_type%=q%!40 Ȏ f_type% � (K � &AFF,&FF9:�save_picture(drag_ptype%,drag_picture%,�string0(q%+44)) 26 � &D3C:�save_sound(drag_sound%,�string0(q%+44)) <7 � &FFF:�save_text(drag_picture%,�string0(q%+44)) F � P q%!12=q%!8:q%!16=3 Z ș sendmessage%,17,q%,q%!4 d � n x' ��save_picture(type%,token%,name$) � save$="" � � � � � � �:� �:� 1,�$ � � DMT_ptr%=0 � � ș "Hourglass_On" �' ș getentry%,type%,token% � adr% � len%=(!adr%)-16 �4 ș readstatus%,type%,token% � l%:� l% len%=l% � adr%+=16 � � type%=s_sprites% � �. ș getentry%,s_sprites%,token% � adr% � � !adr%=(adr%!16)+16 � �! save$=�string0(adr%+4) + adr%!4=1:adr%!8=16:adr%!12=!adr% len%=!adr%+12:adr%+=4 � "9 ș unpacksprite%,s_sprites%,token%,sprites%+12 , !sprites%=1 6 sprites%!4=16 @& sprites%!8=(sprites%!12)+16 J len%=sprites%!8 T adr%=sprites% ^ � h file_type%=&FF9 r � | file_type%=&AFF � � � DMT_mylen%=len% � DMT_data%=adr% � � �, �save_slave(name$,adr%,len%,file_type%) � � save$<>"" � �, ș getentry%,s_sprites%,token% � adr% � �string0(adr%+4,save$) � � � � � � ��save_sound(sound%,name$) � � � � � �:� �:� 1,�$ � DMT_ptr%=0 � ș "Hourglass_On" &+ ș getentry%,s_sounds%,sound% � adr% 0 len%=(!adr%)-24 :8 ș readstatus%,s_sounds%,sound% � l%:� l% len%=l% D adr%+=24 N DMT_mylen%=len% X DMT_data%=adr% b � l& �save_slave(name$,adr%,len%,&D3C) v � � � ��save_text(text%,name$) � � � � � � �:� �:� 1,�$ �& ș getentry%,s_text%,text% � adr% � ș movedata%,adr%,ws%,!adr% � adr%=ws%+4:t%=adr% � len%=0 � � � � ?t%=13 ?t%=10 � � ?t%<>0 len%+=1:t%+=1 � �?t%=0 � �?t%=0 � � DMT_ptr%=0 � ș "Hourglass_On" DMT_mylen%=len% DMT_data%=adr% � *& �save_slave(name$,adr%,len%,&FFF) 4 � > H- ��save_slave(name$,adr%,len%,file_type%) R � DMT% � \' � DMT_mylen%-DMT_ptr%>DMT_len% � f l%=DMT_len% p � z l%=DMT_mylen%-DMT_ptr% � ș "Hourglass_Off" � � �O ș "Wimp_TransferBlock",task_handle%,DMT_data%+DMT_ptr%,DMT_ref%,DMT%,l% � DMT_ptr%+=l% � q%!12=q%!8:q%!16=7 � q%!24=l% �5 ș sendmessage%,18,q%,q%!4:� send RAM transmit � � �. � "save "+name$+" "+�~adr%+" +"+�~len% �+ � "SETTYPE "+name$+" "+�~file_type% � ș "Hourglass_Off" � � � � ��dataload ș movedata%,q%,old_q%,256 $ Ȏ old_q%!40 � . � &BC3: 8E � old_q%!20=main_w% � (old_q%!20=-2 � old_q%!24=icon_bar%) � B � old_q%!12<>0 � L � modified% � V4 �open_query("load"+�string0(old_q%+44)) ` � j. �load_file(�string0(old_q%+44),1) tT old_q%!12=old_q%!8:old_q%!16=4:ș "Wimp_SendMessage",17,old_q%,old_q%!4 ~ � � � � � � � � � ��load_file(name$,error%) � t%=�(name$):l%=�#t%:�#t% �/ �set_slot(�+(l%�&4000)*&4000+&4000,error%) � ș newfile% �. full_name$=�name$,�(name$)-�name$,"!")-1) � ș "Hourglass_On" � � "load "+name$+" 40000" � version%=!&4000C ș locatefile%,&78000 modified%=0 query_string$="" edited_area%=0 (W current_page%=!&40020:toolbox_on%=!&40024:menu_enabled%=!&40028:page_size%=!&4002C 2P h_scroll%=!&40060:v_scroll%=!&40064:title_bar%=!&40068:toggle_icon%=!&4006C << scanning%=!&40070:scan_keys%=!&40074:scan_time%=!&40078 F �size_page P �redefine_main_w Z �open_main_w d � !&40030 � n4 t%=&40030:x%=t%!4:y%=t%!8:x1%=t%!12:y1%=t%!16 x; � x1%>screen_width% x%=x%-(x1%-x%):x1%=screen_width% �F � y1%+40>screen_height% y%=y%-(y1%-y%)-40:y1%=screen_height%-40 � � x%<0 x%=0 � � y%<0 y%=0 �9 �open_window(main_w%,x%,y%,x1%,y1%,t%!20,t%!24,-1) � � � ș "Hourglass_Off" �4 ș "OS_ReadVarVal","Obey$Dir",main%,1000 � ,,T% � T%?main%=0 � full_name$=�string0(main%) �& �window_title(main_w%,full_name$) �! appsprite$=�leaf(full_name$) �' menu$=�appsprite$,�(appsprite$)-1) �, � �menu$<12 �:menu$=menu$+�0:��menu$=12 � m�-------------------------------------------------------------------------------------------------------- " , ��new_file 6 �set_slot(�+&4000,2) @ ș newfile% J � t%=1 � 20 T ș newstack% ^ � h full_name$="No_Name" r � | �i�---------------------------------------------------------------------------------------------------- � � ��open_centre(handle%,off%) � !q%=handle%:ș getw%,,q% �( w%=(q%!12)-(q%!4):h%=(q%!16)-(q%!8) � wx%=screen_width%�2-w%�2 � wy%=screen_height%�2-h%�2 �I �open_window(handle%,wx%,wy%+off%,wx%+w%,wy%+h%+off%,q%!20,q%!24,-1) � � � � ��open_main_w � !ws%=main_w%:ș getw%,,ws% � sx%=ws%!4:sy%=ws%!8 sx1%=ws%!12:sy1%=ws%!16 ) sh%=screen_height%:sw%=screen_width% hs%=0:vs%=0:tb%=0 & � h_scroll% hs%=40 0 � v_scroll% vs%+=40 : � title_bar% tb%=36 D w%=sx1%-sx%:h%=sy1%-sy% N, � sy1%+tb%>sh% sy1%=sh%-tb%:sy%=sy1%-h% X � sy%<hs% sy%=hs% b, � sx1%+vs%>sw% sx1%=sw%-vs%:sx%=sx1%-w% l � sx%<0 sx%=0 v !ws%=main_w% � ws%!4=sx% � ws%!8=sy% � ws%!12=sx1% � ws%!16=sy1% � ws%!20=0:ws%!24=0 � ws%!28=-1 �I �open_window(main_w%,ws%!4,ws%!8,ws%!12,ws%!16,ws%!20,ws%!24,ws%!28) � !q%=main_w%:ș getw%,,ws% � � � �i�---------------------------------------------------------------------------------------------------- � �4 ��draw_picture(type%,token%,x%,y%,w%,h%,flags%) L � type%=s_draw% x%+=(1<<xef%):y%+=(1<<yef%):w%-=(2<<xef%):h%-=(2<<yef%) # ș getentry%,type%,token% � a% * � !a%>sprite_size%-24 flags%=flags%�8 8 !errblk%=x%:errblk%!4=y%:errblk%!8=w%:errblk%!12=h% *< ș rendershape%,type%,token%,sprites%,errblk%,flags%�15 4 � > Hi�---------------------------------------------------------------------------------------------------- R \# ��window_title(window%,title$) f � window%=main_w% � p1 ș getentry%,s_pages%,current_page% � adr% z+ title$=title$+" - "+�string0(adr%+4) � � �# � modified% title$=title$+" *" �( !errblk%=window%:ș getwi%,,errblk% � �string0(errblk%!76,title$) �G ș forceredraw%,-1,errblk%!4,(errblk%!16),errblk%!12,errblk%!16+36 � � � � � �i�---------------------------------------------------------------------------------------------------- � � ��check_icon_bar �" mx%=!q%:my%=q%!4:button%=q%!8 / � button% � 2:�do_icon_bar_menu(mx%,my%):� �front(main_w%) # ș setcaret%,main_w%,-1,0,0,10 $ � . 8 ��do_icon_bar_menu(x%,y%) B/ � scan_time%=0:scan_time%=100:scan_keys%=1 L � opt%=0�2�2:P%=main% V [opt opt% ` .iconmenu j equs menu$ t) equd &070207:equd 208:equd 40:equd 0 ~% equd 0:equd info%:equd &07000021 � equs "Info " �0 equd scanning%�1:equd ibmenu:equd &07000021 � equs "Scanning " �& equd 0:equd somenu:equd &07000021 � equs "Sound volume" �$ equd &80:equd -1:equd &07000021 � equs "Quit " � �.ibmenu � equs "Scanning":equd 0 �) equd &070207:equd 208:equd 40:equd 0 �1 equd (scan_keys%=2)�1:equd -1:equd &07000021 equs "Two switches" ) equd &80:equd ibmenu1:equd &07000021 equs "Speed " (.somenu 2 equs "Sound Volume" <) equd &070207:equd 208:equd 40:equd 0 F4 equd (sound_vol%=&10F)�1:equd -1:equd &07000021 P equs "Off " Z4 equd (sound_vol%=&14F)�1:equd -1:equd &07000021 d equs "Quiet " n< equd &80 � ((sound_vol%=&17F)�1):equd -1:equd &07000021 x equs "Loud " � �.ibmenu1 �! equs "Seconds":equb 0:equd 0 �) equd &070207:equd 208:equd 40:equd 0 �$ equd &84:equd -1:equd &07000121 �" equd ibmess:equd ibval:equd 8 � �.ibval equs "a0-9."+�0 �'.ibmess equs �(scan_time%/100)+�(0) � � ]:� � �% ș createmenu%,,main%,mx%-16,260 menu%=5 � "i�---------------------------------------------------------------------------------------------------- , 6 ��icon_bar_menu @ � c% J Ȏ !q% � T � 1 ^ Ȏ q%!4 � h' � -1:scanning%=scanning% � � r � 0: |7 � scan_keys%=2 scan_keys%=1 � scan_keys%=2 � scanning%=� � � 1: �) t%=(�(�string0(ibmess)))*100 � � t% scan_time%=t% � scanning%=� � � � � 2: � Ȏ q%!4 � � � 0:sound_vol%=&10F � � 1:sound_vol%=&14F � � 2:sound_vol%=&17F � � �0 � 3:� modified% �open_query("") � �finish � 7 ș getp%,,q%:� q%!8 � 1 �do_icon_bar_menu(mx%,my%) � & 0m�-------------------------------------------------------------------------------------------------------- : D1 ��draw_main_w(wx%,wy%,wx1%,wy1%,offx%,offy%) N/ ș getentry%,s_pages%,current_page% � adr% X% stack%=adr%!20:page_col%=adr%!28 bE ș setcol%,page_col%:ȓ Ȑ wx%+offx%,wy%+offy%,wx1%-wx%,wy1%-wy% l ș nentries%,stack% � no% v � no% � � � object%=1 � no% �0 ș getnth%,stack%,object% � adr%,token% �E x%=adr%!12:y%=adr%!16:x1%=adr%!20:y1%=adr%!24:flags%=adr%!36 �C � x%<wx1% � x1%>wx% � y%<wy1% � y1%>wy% � (flags%�128)=0 � � Ȏ adr%!4 � �< � s_text%:�draw_text(stack%,token%,offx%,offy%) �e � s_sprites%,s_draw%:�draw_picture(adr%!4,adr%!8,x%+offx%,y%+offy%,x1%-x%,y1%-y%,flags%) � � � � � � � � � � � ݤstrip_spaces(text$) � ) � �text$=32 text$=�text$,�text$-1) ��text$<>32 * =text$ 4 >' ݤlower_case(text$):� text$="":="" H � t$,t%,c% R �t%=1��text$ \ c%=�(�text$,t%,1)) f � c%>64 � c%<91 c%+=32 p t$=t$+�c% z � � =t$ � �i�---------------------------------------------------------------------------------------------------- � �+ ��draw_text(stack%,token%,offx%,offy%) �d � speaking_text% � speak_token%=token% �highlight_text(stack%,token%,offx%,offy%,speak_word%):� �& ș getentry%,stack%,token% � adr% � x%=(adr%!12)+offx% � y%=(adr%!16)+offy% �" x1%=(adr%!20)-(1<<xef%)+offx% �" y1%=(adr%!24)-(1<<yef%)+offy% �. flags%=adr%!36:font%=adr%!40:b_s%=adr%!32 �0 fcol%=adr%!52:� fcol% � &FF fcol%=page_col% bcol%=adr%!56 ; � flags%�1 fcol%=fcol%�&FFFFFF00:bcol%=bcol%�&FFFFFF00 1 �draw_border(b_s%,fcol%,bcol%,x%,y%,x1%,y1%) $ x%+=(1<<xef%) . x1%-=(1<<xef%) 8 y%+=(1<<yef%) B y1%-=(1<<yef%) L� � V� � � � �:font%=0 ` � font% � j' ș getentry%,s_fonts%,font% � t% t1 ș findfont%,,t%+4,adr%!44,adr%!48 � font% ~ � � � font% � � � bcol% � &FF bcol%=fcol% �; ș "ColourTrans_SetFontColours",font%,bcol%,fcol%,14 �. ș fontinfo%,font% � ,cx%,cy%,cx1%,cy1% � � �> cx%=-(1<<xef%):cy%=-(1<<yef%):cx1%=8<<xef%:cy1%=8<<yef% � � � text_height%=cy1% �( ș getentry%,s_text%,adr%!8 � text% � text%+=4 � text_offset%=0 �, px%=x%+margin%:py%=y1%-text_height%+cy% $ centre%=�:right%=�:underline%=� � flags% � 8 centre%=� � flags% � 16 right%=� � flags% � 32 underline%=� ( � 2 Ȏ text_offset%?text% � < � 0: F/ � 13:py%-=text_height%:text_offset%+=1 P Z- text$=�string0(text%+text_offset%) d text_offset%+=�text$ n � font% � x@ ș stringwidth%,,text$,1<<30,1<<30,-1,�text$ � ,,w% �& ș converttoos%,,w% � ,w% �- � centre% px%=x%+(x1%-x%)�2-w%�2 �( � right% px%=x1%-w%-margin% �6 � underline% text$=�(25)+�(1)+�(16)+text$ �. ș paint%,,text$,1<<4,px%,py%-cy% � � � w%=�text$*cx1% �- � centre% px%=x%+(x1%-x%)�2-w%�2 �( � right% px%=x1%-w%-margin% �3 ș setcol%,fcol%:� px%,py%+cy1%:�text$ �8 � underline% � px%,py%-cy%:�1,cx1%*�text$,0 � � � � � text_offset%?text%=0 � font% ș losefont%,font% � " ,3 ��draw_border(style%,col%,bcol%,x%,y%,x1%,y1%) 6? � (bcol%�&FF)=0 ș setcol%,bcol%:ȓ Ȑ x%,y%,x1%-x%,y1%-y% @ Ȏ style% � J � 1 T ș setcol%,col% ^ ȓ x%,y%,x1%-x%,y1%-y% h � 2:� bold r ș setcol%,&FFFFFF00 |# � x%,y%:� x%,y1%:� x1%,y1% �' ș setcol%,!(wimp_palette%+16) � � x1%,y%:� x%,y% � � 3:� inset �' ș setcol%,!(wimp_palette%+16) �# � x%,y%:� x%,y1%:� x1%,y1% � ș setcol%,&FFFFFF00 � � x1%,y%:� x%,y% � � � � � � � � ��play_sound(sound%) �* ș getentry%,s_sounds%,sound% � adr1% G len%=(!adr1%)-24:ș readstatus%,s_sounds%,sound% � l%:� l% len%=l% � � � � � � �:�errorbox:� &+ ș playsound%,adr1%+24,len%,sound_vol% 0 � : D ��play_sound_wait(sound%) N* ș getentry%,s_sounds%,sound% � adr1% XG len%=(!adr1%)-24:ș readstatus%,s_sounds%,sound% � l%:� l% len%=l% b+ ș playsound%,adr1%+24,len%,sound_vol% l# �:ș playsound%,0 � t%:�t%<>-1 v � � � ��make_space(plus%) �# size%=(!&40004-&40000)+plus%*2 �+ slot_size%=�+(size%�&4000)*&4000+&4000 �* ș "Wimp_SlotSize",slot_size%,-1 � t% �8 � t%<slot_size% � 1,"Ultimap has run out of memory" � � � � ��set_slot(size%,error%) � slot_size%=size% �* ș "Wimp_SlotSize",slot_size%,-1 � t% �L � t%<slot_size% � error%,"There's not enough memory to load this file!" � � ! ! ��open_print_w !. � portrait% a%=0:b%=1<<21 � a%=1<<21:b%=0 ! ) �set_icon_state(print_w%,6,a%,1<<21) !*) �set_icon_state(print_w%,7,b%,1<<21) !4# �set_icon_text(print_w%,2,"1") !> ș getp%,,q% !H ș createmenu%,,-1 !R, ș createmenu%,,print_w%,!q%-30,q%!4+60 !\ � !f !p ��check_print_w !z b%=q%!8 !� Ȏ q%!16 � !� � 3:ș createmenu%,,-1 !� � 4: !�) !q%=print_w%:q%!4=7:ș geti%,,q% !�H � (q%!24) � (1<<21) style%=2:portrait%=� � style%=1:portrait%=� !�) !q%=print_w%:q%!4=2:ș geti%,,q% !�$ run_num%=�(�string0(q%!28)) !� � run_num%=0 run_num%=1 !�( �print_routine(style%,run_num%) !�$ � b% � 6 ș createmenu%,,-1 !� � !� � !� "% ��print_routine(style%,run_num%) " � phandle%,ohandle% " � left%,bottom%,right%,top% "$ � copiesleft%,rect% ". "8 phandle%=�("printer:") "B � � "L; � � �:�#phandle%:� �:� 1,"There is no printer driver!" "V. ș PDselect%,phandle%,"Ultima" � ohandle% "` "jZ � � �:ș PDabort%,phandle%:�#phandle%:ș PDselect%,ohandle%:printing%=�:� �:� 1,�$+Þ "t "~2 ș PDpagesize% � ,,,left%,bottom%,right%,top% "� ș "Hourglass_On" "� "� � loop%=1 � run_num% "�" !ws%=main_w%:ș getwi%,,ws% "�4 mx%=ws%!44:my%=ws%!48:mx1%=ws%!52:my1%=ws%!56 "�4 !box%=mx%:box%!4=my%:box%!8=mx1%:box%!12=my1% "� Ȏ style% � "� � 1:� landscape "� � page_size%=4 � "� scx=.67 "� scy=.67 "�K !matrix%=0:matrix%!4=-scx*2^16:matrix%!8=scy*2^16:matrix%!12=0 # [ !origin1%=(right%-left%)�16:origin1%!4=top%-(top%-bottom%)�2-(top%-bottom%)�30 # � # scx=1.4 # scy=1.5 #(K !matrix%=0:matrix%!4=-scx*2^16:matrix%!8=scy*2^16:matrix%!12=0 #2J !origin1%=(right%-left%)�20:origin1%!4=top%-(top%-bottom%)�20 #< � #F � 2:� portrait #P scx=1.05 #Z scy=.95 #dH !matrix%=scx*2^16:matrix%!4=0:matrix%!8=0:matrix%!12=scy*2^16 #n9 !origin1%=(right%-left%)�20:origin1%!4=bottom% #x � #�: ș PDgiverec%,loop%,box%,matrix%,origin1%,&FFFFFF00 #� printing%=� #�6 ș PDdrawpage%,1,box2%,0,0 � copiesleft%,,rect% #� ȕ copiesleft%<>0 #�, �draw_main_w(mx%,my%,mx1%,my1%,0,0) #�1 ș PDgetrec%,,box2% � copiesleft%,,rect% #� � #� � #� #� ș PDendjob%,phandle% #� �#phandle% #� ș PDselect%,ohandle% #� printing%=� $ ș "Hourglass_Off" $ � $ $"/ ��hide_object(stack%,token%,hide%,on_vdu%) $,' ș getentry%,stack%,token% � adr1% $6/ � hide%<>0 � ((adr1%!36)�128)<>0 on_vdu%=0 $@- � hide%=0 � ((adr1%!36)�128)=0 on_vdu%=0 $JD � hide% adr1%!36=(adr1%!36)�128 � adr1%!36=(adr1%!36)�&FFFFFF7F $T^ � on_vdu% ș forceredraw%,main_w%,adr1%!12,adr1%!16,adr1%!20+(4<<xef%),adr1%!24+(1<<yef%) $^ � $h $r. ��light_object(stack%,token%,hi%,on_vdu%) $|' ș getentry%,stack%,token% � adr1% $� h%=(adr1%!36)�1:� hi% hi%=1 $�@ � hi% adr1%!36=(adr1%!36)�1 � adr1%!36=(adr1%!36)�&FFFFFFFE $�T � on_vdu% � h%<>hi% ș forceredraw%,main_w%,adr1%!12,adr1%!16,adr1%!20,adr1%!24 $� � $� $� ݤstack(page%) $� � adr% $�' ș getentry%,s_pages%,page% � adr% $�3 � adr%=0 � adr%!20=0 � 2,"bad stack from page" $� =adr%!20 $� $� ݤwhich_object(page%,x%,y%) $� stack%=�stack(page%) %# ș nentries%,stack% � no%:o%=0 % � no%=0:=0 % � t%=1 � no% %&) ș getnth%,stack%,t% � adr%,token% %0R � x%>=adr%!12 � y%>=adr%!16 � x%<adr%!20 � y%<adr%!24 � ((adr%!36)�128)=0 � %:8 o%=token%:off_mx%=x%-adr%!12:off_my%=y%-adr%!16 %D � %N � %X =o% %b %l! ��arrange_pagelist_wc(page%) %v iw%=280:ih%=-48:pl_tick%=0 %� ș nentries%,s_pages% � np% %�% !q%=0:q%!8=iw%-(3<<xef%):q%!12=0 %�& � np%<3 q%!4=ih%*3 � q%!4=ih%*np% %�" ș setextent%,pagelist_wc%,q% %� iy%=ih%:cur_y%=iy% %� � loop%=1�np% %�. ș getnth%,s_pages%,loop% � adr%,token% %�- � token%=page% cur_y%=iy%:pl_tick%=iy% %� iy%+=ih% %� � %�" !q%=pagelist_wc%:ș getw%,,q% %�" offy%=(q%!16-q%!24):sy%=q%!24 %�( wy%=(q%!8)-offy%:wy1%=(q%!16)-offy% &! � cur_y%<wy% sy%+=cur_y%-wy% &% � cur_y%-ih%>wy1% sy%=cur_y%-ih% & q%!24=sy% & o%=(q%!32)�(1<<16) &* ș openw%,,q% &4 � o%=0 � &> ș closew%,,q% &H � &R/ ș forceredraw%,-1,q%!4,q%!8,q%!12,q%!16 &\ � &f � &p &z* ��draw_pagelist_wc(wx%,wy%,wx1%,wy1%) &� ș nentries%,s_pages% � np% &�1 ș findfont%,,icon_font$,12*16,12*16 � font% &�* ih%=-48:ix%=0:iy%=ih%:ix1%=280:iy1%=0 &� �page%=1�np% &�8 � ix%<=wx1% � ix1%>=wx% � iy%<=wy1% � iy1%>=wy% � &�0 ș getnth%,s_pages%,page% � adr%,token% &� � iy%=pl_tick% � &�2 !q%=ix%:q%!4=iy%:q%!8=ix%+38:q%!12=iy1% &�- q%!16=&7000019:�string0(q%+20,"�") &� ș ploticon%,,q% &� � &�4 !q%=ix%+38:q%!4=iy%:q%!8=ix%+280:q%!12=iy1% &�= q%!16=font%<<24 � &171:q%!20=adr%+4:q%!24=0:q%!32=12 ' ș ploticon%,,q% ' � ' iy%+=ih%:iy1%+=ih% '$ � '. ș losefont%,font% '8 !q%=pagelist_wc% 'B � 'L 'V ݤpt_from_context(context%) '` Ȏ context% � 'j � s_mousedrag%:=4 't � s_often%:=8 '~ � s_pointer%:=16 '� � s_mouse%:=20 '� � s_pageshown%:=32 '� � '� =0 '� '� ݤname_exsists(stack%,f$) '� ș nentries%,stack% � ne% '� � ne%=0:=0 '� f%=0:f$=�lower_case(f$) '� �entry%=1�ne% '�- ș getnth%,stack%,entry% � adr%,token% '�3 � f$=�lower_case(�string0(adr%+4)) f%=token% ( �:=f% ( ( ��size_page ( !q%=main_w%:ș getwi%,,q% ((( � (q%!32)�(1<<16) open%=� � open%=� (2 ș "Wimp_DeleteWindow",,q% (< bh%=q%!28 (F portrait%=� (P Ȏ page_size% � (Z � 1:q%!52=1279:q%!48=-920 (d! � 2:q%!52=1599:q%!48=-1160 (n! � 3:q%!52=2046:q%!48=-1500 (x- � 4:q%!52=1320:q%!48=-2000:portrait%=� (� :q%!52=1279:q%!48=-920 (� � (�+ ș "Wimp_CreateWindow",,q%+4 � main_w% (�U !q%=main_w%:ș getw%,,q%:�open_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,bh%) (� � (� (�P� ***************************** clicks below here ************************** (� (� ��begin_trying (� trying%=� (� click_underway%=� (� pause_on%=� (� pointer_object%=0 ) input$="" ) �zero_page_stack ) �pre_process )" �show_page(current_page%) ), � scanning% �scan )6 � "set Uobject "+�34+�34 )@ � "set Ustatus "+�34+�34 )J status$="" )T � )^ )h ��delight )r! stack%=�stack(current_page%) )| ș nentries%,stack% � no% )� � no% � )� � object%=1�no% )�) ș getnth%,stack%,object% � adr% )�+ � adr%!36 � 1 adr%!36=(adr%!36)�-2 )� � )� � )�7 � speak_token% �update_object(stack%,speak_token%) )� � )� )�D ��zero_page_stack:�T%=0�1020�4:T%!page_stack%=0:�:page_ptr%=0:� )� )� ��pre_process )� pointer_object%=0 * pointer_int%=0 * often_int%=0 * seq_int%=0 *& scan_object%=0 *02 speaking_text%=0:speak_word%=0:speak_token%=0 *: pointer_on%=� *D try_time%=� *N � *X$ ș nentries%,s_sequences% � s% *b � s% � *l/ ș getnth%,s_sequences%,1 � adr%,token% *vC ș killentry%,s_sequences%,token%:� clear all sequences *� � *� �s%=0 *� � *�# ș nentries%,s_clickson% � s% *� � s% � *�* ș getnth%,s_clickson%,1 � ,token% *�? ș killentry%,s_clickson%,token%:� clear all clicks *� � *� �s%=0 *�! stack%=�stack(current_page%) *�/ ș getentry%,s_pages%,current_page% � adr% *�2 � adr%!24 ș writestatus%,s_clicks%,adr%!24,0 *� ș nentries%,stack% � no% + � no% � + � object%=1�no% +) ș getnth%,stack%,object% � adr% + a adr%!36=(adr%!36)�&FFFFFF3E:� ensure all objects shown, unselected and unhighlighted +* click%=adr%!28 +4h � click% ș writestatus%,s_clicks%,click%,0:� zero status to avoid repetition of click +> � +H � +R � object%=0�no% +\ � object%=0 � +f3 ș getentry%,s_pages%,current_page% � adr% +p click%=adr%!24 +z � +�) ș getnth%,stack%,object% � adr% +� click%=adr%!28 +� � +� � click% � +�- ș getentry%,s_clicks%,click% � adr% +�- ș readstatus%,s_clicks%,click% � s% +� � s%=0 � +�- ș writestatus%,s_clicks%,click%,1 +�5 � adr%!4 �pre_click(s_mousedrag%,adr%!4,0) +� � adr%!8 � +� often_int%=� +�& adr%!24=try_time%+adr%!12 +�* �pre_click(s_often%,adr%!8,1) , � , � adr%!16 � , pointer_int%=� ,$- �pre_click(s_pointer%,adr%!16,1) ,. � ,83 � adr%!20 �pre_click(s_mouse%,adr%!20,1) ,B � adr%!32 � ,L/ �pre_click(s_pageshown%,adr%!32,1) ,V, �do_click(s_pageshown%,adr%!32) ,` � ,j � ,t � ,~ � ,� � ,� ,�& ��pre_click(context%,click%,seq%) ,� � adr% ,�( ș getentry%,context%,click% � adr% ,� end%=adr%+!adr%:adr%+=4 ,� � ,� len%=!adr%:cmd%=adr%!4 ,� Ȏ cmd% � ,�8 � 1,3,4:� seq%=0 �pre_list(cmd%,adr%+8,len%-12) ,�A � 5:� context%=s_pageshown% � seq%=0 �play_sound(adr%!8) ,� � 7: - � seq% � - seq_int%=� -0 flag%=adr%!12:s%=adr%+36:e%=len%-40 -. � flag% � 4 s%=adr%+40:e%=len%-44 -( �pre_list(3,s%,e%) -2 � -< � -F adr%+=len% -P � adr%>=end% -Z � -d -n ��pre_list(cmd%,adr%,len%) -x �list%=0�len%�4 -� Ȏ cmd% � -�1 � 1:�light_object(stack%,list%!adr%,1,0) -�0 � 3:�hide_object(stack%,list%!adr%,1,0) -�0 � 4:�hide_object(stack%,list%!adr%,0,0) -� � -� � -� � -� -� ��try_poll -� ș poll%,,q% � A% -� ș playsound%,0 -�& ș "OS_Module",16,"Ubase%Ultimap" -� Ȏ A% � . � 0:�try_null . � 1:�redraw_window .D � 2:�open_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) ." � 3:�close_window(!q%) .,6 � 4:� !q%=main_w% � pointer_on%<>� �"pointer 1" .6 � 5 .@L � !q%=main_w% � pointer_on%=1 ș "Wimp_SpriteOp",36,1,"ptr_clock",2 .JK � !q%=main_w% � pointer_on%=2 ș "Wimp_SpriteOp",36,1,"ptr_hand",2 .T � 6:�try_mouse .^ � 7:�try_user_drag .h � 8:�try_keys .r � 9:�try_menu_select .| � 17,18:�try_receive(q%) .� � .� � .� .� � �try_receive(q%) .� Ȏ q%!16 � .� � 0:�finish:� .� � 2:�datasaveack .�! � 3:� q%!40=&BC3 �dataload .� � 6:�ramfetch .� � &502:�help_request .�! � &400C0:�try_menu_warning .� � &400C1: .� ș "Hourglass_On" / �get_mode_info / �lose_fonts / �set_icon_fonts /& ș "Hourglass_Off" /0 � /: � /D /N ��try_null /X4 !q%=main_w%:ș getw%,,q%:�((q%!32)�(1<<16))=0 � /b# � seq_int% �check_sequences(�) /l �check_clicks /vP � �input$,1)=�13:input$=�input$,�(input$)-1):!q%=main_w%:q%!24=13:�try_keys /�0 � pointer_int% � scanning%=� �under_pointer /� � often_int% �often /�% � scanning% � scan_keys%=1 �scan /� ș playsound%,0 � t% /� � t%<>-1 � /� � speaking_text% � /� � speak_sound% � /�) �play_sound_wait(speak_sound%) /� � /� �7:t%=�+50:�:��>t% /� � /� �speaking_text /� � 0 � 0 �check_sysvars 0 � 0 0* ��check_sysvars 041 ș "OS_ReadVarVal","Upage",main%,1000 � ,,T% 0>% T%?main%=0:page$=�string0(main%) 0H � page$<>current_page$ � 0R* page%=�name_exsists(s_pages%,page$) 0\ � page% � 0f current_page%=page% 0p �pre_process 0z" �show_page(current_page%) 0� � scanning% �scan 0� � 0� � 0�3 ș "OS_ReadVarVal","Uobject",main%,1000 � ,,T% 0�' T%?main%=0:object$=�string0(main%) 0� � object$<>"" � 0� � "set Uobject "+�34+�34 0�4 input$=object$:!q%=main_w%:q%!24=13:�try_keys 0� � 0� � 0� 0� ��try_mouse 0� Ȏ q%!12 � 1> � -2:� q%!16=icon_bar% � 1,&100,&9000,1:�check_icon_bar 1 � main_w%:�try_main_w 1( � pagelist_wc%:�check_pagelist_wc 1$ � print_w%:�check_print_w 1. � 18 � 1B 1L ��try_main_w 1V# ș setcaret%,main_w%,-1,0,0,10 1` mx%=!q%:my%=q%!4 1j button%=q%!8 1t � button%�2 � 1~. � menu_enabled% �open_try_menu(mx%,my%) 1� � 1� � 1�' � scanning% �scan_click(button%):� 1� � pointer_on%=1 � 1� icon%=q%!16 1� !q%=main_w%:ș getw%,,q% 1�+ offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) 1� mx%-=offx%:my%-=offy% 1� Ȏ button% � 1� � &40 1�% stack%=�stack(current_page%) 1�5 object%=�which_object(current_page%,mx%,my%) 2 � object% � 2 - ș getentry%,stack%,object% � adr% 2 click%=adr%!28 2 � click% � 2(1 ș getentry%,s_clicks%,click% � adr% 22 � adr%!4 � 2<6 ș getentry%,s_mousedrag%,adr%!4 � adr% 2F+ �begin_save(object%,adr%!12) 2P � 2Z � 2d � 2n � &100 2x2 page_ptr%-=4:� page_ptr%<0 page_ptr%=1020 2�% � page_ptr%!page_stack%<>0 � 2� �delight 2�. current_page%=page_ptr%!page_stack% 2�" page_ptr%!page_stack%=0 2� �pre_process 2�$ �show_page(current_page%) 2� � scanning% �scan 2� � 2� � &400 2�% stack%=�stack(current_page%) 2�5 object%=�which_object(current_page%,mx%,my%) 2� � object% � 2�- ș getentry%,stack%,object% � adr% 3 click%=adr%!28 3 � click% � 31 ș getentry%,s_clicks%,click% � adr% 3"C � adr%!20 �do_click_recorded(object%,s_mouse%,adr%!20) 3, � 36 � 3@5 ș getentry%,s_pages%,current_page% � adr% 3J click%=adr%!24 3T � click% � 3^1 ș getentry%,s_clicks%,click% � adr% 3h= � adr%!20 �do_click_recorded(0,s_mouse%,adr%!20) 3r � 3| � 3� � 3� � 3� 3� ��try_keys 3� Ȏ !q% � 3� � main_w% 3� key%=q%!24 3� � key%=13 � 3�' stack%=�stack(current_page%) 3�/ � �lower_case(�input$,6))="object" � 3�+ token%=�(�input$,�(input$)-6)) 3�. ș getentry%,stack%,token% � adr% 3� � adr% � 4 � adr%!28 � 4' pointer_object%=token% 46 ș getentry%,s_clicks%,adr%!28 � adr% 4&F � adr%!20 �do_click_recorded(token%,s_mouse%,adr%!20) 40 � 4: � 4D � 4NA � �lower_case(�input$,4))="back" q%!8=&100:�try_main_w 4X input$="" 4b � 4l- � key%=27:�close_window(main_w%):� 4v& � key%=&180 �open_print_w:� 4�K � key%>31 � key%<255 input$=input$+�(key%) � ș processkey%,key% 4�" � �input$=255 input$="" 4� � 4� � print_w% 4�H � q%!24=13 q%!8=4:q%!16=4:�check_print_w � ș processkey%,q%!24 4� 4� ș processkey%,q%!24 4� � 4� � 4� 4�1 ��do_click_recorded(object%,context%,click%) 4�4 � object% status$=".object"+�object%+"."+$,8) 4�. � object%=0 status$=".background."+$,8) 5A � "set Ustatus "+�leaf(full_name$)+"."+current_page$+status$ 5 �do_click(context%,click%) 5 � 5 5* ��do_click(context%,click%) 54( ș getentry%,context%,click% � adr% 5>" ș movedata%,adr%,ws%+8,!adr% 5H$ !ws%=(ws%!8)+8:ws%!4=12:ws%!8=0 5R �make_space(!ws%+16) 5\! ș addentry%,s_clickson%,ws% 5f �check_clicks 5p � 5z 5� ��check_clicks 5�# ș nentries%,s_clickson% � nc% 5� � nc%=0 � 5� � click%=1�nc% 5�1 ș getnth%,s_clickson%,click% � click_adr% 5�+ � click_adr%!8<� � click_adr%!4<>0 � 5�0 ptr%=click_adr%!4:cadr%=click_adr%+ptr% 5�- click_len%=!cadr%:cmd%=cadr%!4:ok%=� 5� Ȏ cmd% � 5�: � 1,3,4:�click_list(cmd%,cadr%+8,click_len%-12) 5� � 2 5� �delight 5�0 page_ptr%!page_stack%=current_page% 66 page_ptr%+=4:� page_ptr%=1024 page_ptr%=0 6" current_page%=cadr%!8 6M � current_page%=0 ș nentries%,s_pages% � t%:current_page%=�(t%) 6$. � current_page%=0 current_page%=1 6. �pre_process 68& �show_page(current_page%) 6B � scanning% �scan 6L � 6V � 5 6`! ș playsound%,0 � t% 6j1 � t%=-1 ok%=� � �play_sound(cadr%!8) 6t* � 6:�speak_text(stack%,cadr%!8) 6~! � 7:�init_seq(�,cadr%) 6� � 8: 6�) click_cmd$=�string0(cadr%+8) 6�) cmd$=�lower_case(click_cmd$) 6�' � �cmd$,10)="load file " � 6�- file$=�cmd$,�cmd$-10):page$="" 6� � �file$," ") � 6�3 page$=�file$,�(file$)-�file$," ")) 6�, file$=�file$,�file$," ")-1) 6� � 6�) file$=full_name$+"."+file$ 6� � � 6�. � � �:� �:click_adr%!4=0:� 1,�$ 7 " �load_file(file$,1) 7 Z � page$<>"" page%=�name_exsists(s_pages%,page$):� page% current_page%=page% 7 �pre_process 7( �show_page(current_page%) 7( � scanning% �scan 72 �zero_page_stack 7< � 7F � 7P3 � �cmd$,4)="load" � �cmd$,5)="*load" � 7Z, file$=�cmd$,�cmd$-5):page$="" 7d � �file$," ") � 7n3 page$=�file$,�(file$)-�file$," ")) 7x, file$=�file$,�file$," ")-1) 7� � 7� � � 7�. � � �:� �:click_adr%!4=0:� 1,�$ 7�" �load_file(file$,1) 7�Z � page$<>"" page%=�name_exsists(s_pages%,page$):� page% current_page%=page% 7� �pre_process 7�( �show_page(current_page%) 7� � scanning% �scan 7� �zero_page_stack 7� � 7� � 7�1 � �cmd$,3)="run" � �cmd$,4)="*run" � 7�* file$=�cmd$,�cmd$-4):�file$ 8 � � 8. � � �:� �:click_adr%!4=0:� 1,�$ 8# � "filer_run "+file$ 8" click_cmd$="" 8, � 86" � �cmd$,6)="replay" � 8@# file$=�cmd$,�cmd$-7) 8J" � �file$,"-at")=0 � 8T3 ș getentry%,stack%,object% � adr% 8^6 x%=(adr%!12)+offx%:y%=(adr%!16)+offy% 8h0 file$=file$+" -at "+�x%+","+�y% 8r � 8| � � 8�. � � �:� �:click_adr%!4=0:� 1,�$ 8�( ș "Wimp_StartTask",file$ 8� click_cmd$="" 8� � 8�M � �cmd$,4)="back" input$="back":!q%=main_w%:q%!24=13:�try_keys:� 8�" � �cmd$,6)="object" � 8� click_cmd$="" 8� input$=cmd$+�13 8� � 8� � � 8�, � � �:� �:click_adr%!4=0:� 1,�$ 8�* � click_cmd$<>"" � click_cmd$ 8�% � 9:click_adr%!8=�+cadr%!8 9a � 12:pointer_on%=2:�get_pointer:� handle%=main_w% ș "Wimp_SpriteOp",36,1,"ptr_hand",2 9 � 93 ș getnth%,s_clickson%,click% � click_adr% 9&+ � ok% click_adr%!4=ptr%+click_len% 903 � click_adr%!4>=!click_adr% click_adr%!4=0 9: � 9D � 9N click%=1 9X � 9b2 ș getnth%,s_clickson%,click% � adr%,token% 9l � adr%!4=0 � 9v) ș killentry%,s_clickson%,token% 9� click%-=1 9� � 9� click%+=1 9�% ș nentries%,s_clickson% � nc% 9� �click%>=nc% � nc%=0 9� � 9� 9�! ��click_list(cmd%,adr%,len%) 9� �list%=0�len%�4 9� Ȏ cmd% � 9� � 1 9�. ș getentry%,stack%,list%!adr% � t% 9�" � (t%!36)�1 t%=0 � t%=1 :/ �light_object(stack%,list%!adr%,1,1) :0 � 3:�hide_object(stack%,list%!adr%,1,1) :0 � 4:�hide_object(stack%,list%!adr%,0,1) : � :* � :4 � :> :H& ��under_pointer:� pointer_on%=1 � :R �get_pointer :\ !q%=main_w%:ș getw%,,q% :f+ offx%=(q%!4-q%!20):offy%=(q%!16-q%!24) :p( mx%=mousex%-offx%:my%=mousey%-offy% :zO � handle%=main_w% object%=�which_object(current_page%,mx%,my%) � object%=0 :�! � object%<>pointer_object% � :�! �"pointer 1":pointer_on%=� :� pointer_object%=object% :�# stack%=�stack(current_page%) :� ș nentries%,stack% � no% :� � no% � :� � ob%=1�no% :�. ș getnth%,stack%,ob% � adr%,token% :�K � token%<>object% � (adr%!36)�1 �light_object(stack%,token%,0,1) :� � :� � object% � :�4 ș getentry%,stack%,object% � adr%,token% :� � adr%!28 � ;2 ș getentry%,s_clicks%,adr%!28 � adr% ;4 � adr%!16 �do_click(s_pointer%,adr%!16) ; � ;$ � ;.5 ș getentry%,s_pages%,current_page% � adr% ;8 � adr%!24 � ;B2 ș getentry%,s_clicks%,adr%!24 � adr% ;L4 � adr%!16 �do_click(s_pointer%,adr%!16) ;V � ;` � ;j � ;t � ;~ � ;� ;� ��often:� pointer_on%<>� � ;�! stack%=�stack(current_page%) ;� ș nentries%,stack% � no% ;� � no% � ;� � ob%=1�no% ;�, ș getnth%,stack%,ob% � adr%,token% ;� � adr%!28 � ;�0 ș getentry%,s_clicks%,adr%!28 � adr% ;� � adr%!8 � ;� � adr%!24<� � ;� adr%!24=�+adr%!12 <