' 'ArtMaster Professional 'AMPRO V1.00 'Richard Wheeldon 1994 ' 'Screen Usage: ' '0 = Toolbox '1 = Options '2 = Help screen / undo temp screen '3 = undo buffer '4 = Palette '5 = Block / temporary screen ' / file selector screen / Magnify '6 = Effects Dest/ClipArt '7 = Main screen ' 'Bank usage: '1 Mouse pointers '10-50 screens '51-100 coordinates '1000-10000 Slider bars '846 Tracker Music '956 Temp ' Set Buffer 50 Hide On ' Global TRACK_LOOP,TRACK_BANK TRACK_BANK=846 ' Global SCRFONT Global FONTS,ALL,ROM,DISK,NONE ALL=1 : ROM=2 : DISK=3 : NONE=0 FONTS=ROM Global TEST_TEXT$ TEST_TEXT$="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" Global FONT_ACTIVE ' Dim GRF_VAL(50,50) Global GRF_VAL(),GRF_A#,GRF_MX,GRF_MY,GRF_MV Global GRF_TLX,GRF_TLY,GRF_WIDTH,GRF_HEIGHT Global GRF_BRX,GRF_BRY GRF_TLX=0 GRF_TLY=0 GRF_BRX=639 GRF_BRY=199 GRF_WIDTH=640 GRF_HEIGHT=200 GRAPH_RANDOMDATA ' Global CLP_NUMBER Global CLP_MIN,CLP_MAX Global CLP_GRF,CLP_MODE Global CLP_NUM Global CLP_F$ CLP_MIN=0 CLP_MAX=34 CLP_NUMBER=6 ' Dim COPPER_STR$(2,3) Dim COPPER_COL(2) Global COPPER_STR$(),COPPER_COL(),COPPER_LIST COPPER_LIST=1 COPPER_COL(1)=1 COPPER_COL(2)=0 ' Global FULL_DISPLAY FULL_DISPLAY=True ' Global PNT_LEFT,PNT_RGHT,PNT_X,PNT_Y PNT_LEFT=1 : PNT_RGHT=2 PNT_X=5 : PNT_Y=5 ' Global EFCT_NUMBER EFCT_NUMBER=6 'Misc Global SCR_OPT 'Spraycan globals Global SPRAY_BOX,SPRAY_X,SPRAY_Y,SPRAY_RAD,SPRAY_BRUSH SPRAY_X=20 : SPRAY_Y=20 : SPRAY_RAD=10 'globals for 2nd mouse Global MSE_MX,MSE_MY,MSE_CX,MSE_CY,MSE_MNX,MSE_MNY,MSE_MXX,MSE_MXY Global MSE_ACTIVE,MSE_READX,MSE_READY MSE_READX=True : MSE_READY=True ' 'Fractal globals Global FR_POSX,FR_POSY Global FR_STEPX,FR_STEPY Global FR_CR,FR_CI Global FR_MAND FR_STEPX=1 : FR_STEPY=1 ' 'Pattern globals Global PAT_LINE,PAT_FILL PAT_LINE=65535 PAT_FILL=0 ' 'Config Flags ' Global CFG_LASTWORK,CFG_PATHREQ,CFG_VIRUS,CFG_CLOSEWB Global CFG_LOGO,CFG_MUSIC,CFG_RAD,CFG_AMPRO,CFG_READFONTS CFG_PATHREQ=False Global CURFILE$ ' 'Directory Constants ' Global PRG_DIR$,DAT_DIR$,CFG_DIR$,SPL_DIR$,DCT_DIR$,CLP_DIR$,HLP_DIR$,TMP_DIR$ _SET_SYSTEM_DIRECTORIES ' 'Screen Parameters ' Global SCR_NUMBER,SCR_HEIGHT,SCR_WIDTH,SCR_RES,SCR_LACED,SCR_COLOURS SCR_NUMBER=7 : SCR_HEIGHT=200 : SCR_WIDTH=320 SCR_RES=Lowres : SCR_LACED=0 : SCR_COLOURS=8 Global SCR_X_OFFSET,SCR_Y_OFFSET,SCR_X_MAX,SCR_Y_MAX SCR_X_OFFSET=0 : SCR_X_MAX=0 SCR_Y_OFFSET=0 : SCR_Y_MAX=0 ' 'Toolbox Options and coordinates ' Global TLB_ACTIVE,TLB_NUMBER TLB_NUMBER=0 Dim ZNEX1(51),ZNEY1(51),ZNEX2(51),ZNEY2(51) Global ZNEX1(),ZNEY1(),ZNEX2(),ZNEY2() Global TLB_POSITION TLB_POSITION=100 ' 'Preferences options ' Global COORDS COORDS=True ' 'Other options ' Global FG_COL,BG_COL Global DRWTYPE Global OPT_POSITION,OPT_NUMBER,OPT_ACTIVE OPT_NUMBER=1 : OPT_POSITION=TLB_POSITION+49 OPT_ACTIVE=False FG_COL=5 BG_COL=0 ' Global PAL_ACTIVE,PAL_POSITION,PAL_NUMBER,PAL_NOEDIT PAL_NOEDIT=False PAL_POSITION=OPT_POSITION+35 PAL_NUMBER=4 PAL_ACTIVE=False ' Global UNDO_NUMBER UNDO_NUMBER=3 ' Global PALMODE ' 'Circle Drawing Modes Global CIRCMODE,CENTR,CORNR,PONT3 CENTR=3 : CORNR=2 : PONT3=1 CIRCMODE=CORNR ' FILES=53 Dim FILE$(FILES) Global FILES,FILE$() FILE$(1)=DAT_DIR$+"AMPro1.abk" FILE$(2)=DAT_DIR$+"amprobrush.abk" FILE$(3)=DAT_DIR$+"amproFontSel.abk" FILE$(4)=DAT_DIR$+"amproclipart.abk" FILE$(5)=DAT_DIR$+"amproscreenformat.abk" FILE$(6)=DAT_DIR$+"amproEffects.abk" FILE$(7)=DAT_DIR$+"amproCopper.abk" FILE$(8)=DAT_DIR$+"ampro_palette.abk" 'FILE$(9)=DAT_DIR$+"ampro_ham_palette.abk" 'FILE$(10)=DAT_DIR$+"ampro_printer.abk" FILE$(11)=DAT_DIR$+"amprohelp.abk" FILE$(12)=DAT_DIR$+"amprofsel.abk" FILE$(13)=DAT_DIR$+"ampro_fillpattern.abk" FILE$(14)=DAT_DIR$+"amproprefs.abk" FILE$(15)=DAT_DIR$+"ampro_symgrid.abk" FILE$(16)=DAT_DIR$+"amprofractal.abk" ' FILE$(17)=CFG_DIR$+"AMPro_PrefsOpt.cfg" FILE$(18)=CFG_DIR$+"AMProLastPic.cfg" FILE$(19)=CFG_DIR$+"SymGrid.cfg" FILE$(20)=DAT_DIR$+"ampro_mouse.abk" FILE$(21)=CFG_DIR$+"default_palette" FILE$(22)=PRG_DIR$+"Virus_Checker" FILE$(23)=DAT_DIR$+"AMPro_Music.mod" FILE$(24)=DAT_DIR$+"AMPro_Logo.abk" FILE$(25)=PRG_DIR$+"APTemp" FILE$(26)=CFG_DIR$+"AmproPatterns.cfg" 'FILE$(27)=CFG_DIR$+"printer.cfg" 'FILE$(28)=TMP_DIR$+"tempprint.cfg" FILE$(29)=TMP_DIR$+"SpareScreen.iff" FILE$(30)=TMP_DIR$+"TempSpare.iff" ' FILE$(31)=DAT_DIR$+"AMPro1.dat" FILE$(32)=DAT_DIR$+"amprobrush.dat" FILE$(33)=DAT_DIR$+"amprowp.dat" FILE$(34)=DAT_DIR$+"amproclipart.dat" FILE$(35)=DAT_DIR$+"amproscreenformat.dat" FILE$(36)=DAT_DIR$+"amproEffects.dat" FILE$(37)=DAT_DIR$+"amproCopper.dat" FILE$(38)=DAT_DIR$+"ampro_palette.dat" 'FILE$(39)=DAT_DIR$+"ampro_ham_palette.dat" 'FILE$(40)=DAT_DIR$+"ampro_printer.dat" FILE$(41)=DAT_DIR$+"amprohelp.dat" FILE$(42)=DAT_DIR$+"amprofsel.dat" FILE$(43)=DAT_DIR$+"ampro_fillpattern.dat" FILE$(44)=DAT_DIR$+"amproprefs.dat" FILE$(45)=DAT_DIR$+"ampro_symgrid.dat" FILE$(46)=DAT_DIR$+"amprofractal.dat" ' FILE$(47)=DAT_DIR$+"ampropainter.abk" FILE$(48)=DAT_DIR$+"ampropainter.dat" FILE$(49)=CFG_DIR$+"ampropainter.cfg" FILE$(50)=TMP_DIR$+"ampropainter.tmp" FILE$(51)=CFG_DIR$+"amprocopper.cfg" FILE$(52)=TMP_DIR$+"FontsList.cfg" FILE$(53)=DAT_DIR$+"AMproSystem.Abk" ' Trap Kill FILE$(52) Load FILE$(20),0 _LOAD_OPTIONS_SCREENS _LOAD_MENU_COORDS Unpack 9 To TLB_NUMBER Screen Display TLB_NUMBER,,TLB_POSITION,, _SETZONES ' Trap Load FILE$(17),4096 If Errtrap=0 S=Start(4096) CFG_READFONTS=Leek(S) CFG_VIRUS=Leek(S+4) CFG_CLOSEWB=Leek(S+8) CFG_AMPRO=Leek(S+12) CFG_LASTWORK=Leek(S+16) CFG_LOGO=Leek(S+20) CFG_MUSIC=Leek(S+24) CFG_RAD=Leek(S+28) CIRCMODE=Leek(S+32) SCR_OPT=Leek(S+36) Erase 4096 End If ' If CFG_MUSIC If Exist(FILE$(23)) Track Load FILE$(23),45695 Track Play 45695 End If End If ' If CFG_LOGO If Exist(FILE$(24)) Load FILE$(24),9 Unpack 9 To TLB_NUMBER Repeat I$=Inkey$ If I$<>"" Exit End If Until Mouse Key Screen Close TLB_NUMBER Erase 9 End If End If ' Trap Load FILE$(26),60235 If Errtrap=0 S=Start(60235) PAT_LINE=Leek(S) PAT_FILL=Leek(S+4) Erase 60235 End If ' '_LOADPRINTCFG[FILE$(27)] ' 'Init screen _NEW 'Init undo screen Screen Open UNDO_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Screen UNDO_NUMBER Curs Off : Flash Off : Paper 0 : Cls Screen Hide UNDO_NUMBER ' Global ACTIVETOOL ACTIVETOOL=4 ' Dim CLOURVALUE(7) Global CLOURVALUE() For A=1 To 7 : Read CLOURVALUE(A) : Next Data 2,4,8,16,32,64,4096 ' Global BLOCK_NUMBER BLOCK_NUMBER=5 ' Global BRUSH_WIDTH,BRUSH_HEIGHT,BRUSH_BOB,BRUSH_X,BRUSH_Y BRUSH_BOB=26 ' Show On Hot Spot 8,7,7 Change Mouse 4 Screen SCR_NUMBER _MOUSECOLOURS Screen TLB_NUMBER _MOUSECOLOURS If ACTIVETOOL=15 _DRAWBOX[ZNEX1(17),ZNEY1(17),ZNEX2(17),ZNEY2(17),-1] Else If ACTIVETOOL=16 _DRAWBOX[ZNEX1(16),ZNEY1(16),ZNEX2(16),ZNEY2(16),-1] Else If ACTIVETOOL=17 _DRAWBOX[ZNEX1(14),ZNEY1(14),ZNEX2(14),ZNEY2(14),-1] Else If ACTIVETOOL=18 _DRAWBOX[ZNEX1(38),ZNEY1(38),ZNEX2(38),ZNEY2(38),-1] Else _DRAWBOX[ZNEX1(ACTIVETOOL+18),ZNEY1(ACTIVETOOL+18),ZNEX2(ACTIVETOOL+18),ZNEY2(ACTIVETOOL+18),-1] End If While Mouse Key : Wend ' Global TMP_BANK TMP_BANK=956 ' _INITCLIPS ' Global BRUSH_ACTIVE BRUSH_ACTIVE=False ' Global FILE_CHANGED FILE_CHANGED=False ' Global HLP_NUMBER,HLP_POSITION,HLP_WIDTH,HLPDIR$,HLP_ACTIVE HLP_NUMBER=2 : HLP_POSITION=TLB_POSITION-97 : HLP_WIDTH=76 HLP_ACTIVE=False ' _LOADPALETTE[FILE$(21)] _LOAD_SYMGRID_CONFIG[FILE$(19)] ' Global FSEL_NUMBER,FSEL_POSITION,FSEL_ACTIVE Global FSEL_HELP_POSITION FSEL_NUMBER=5 : FSEL_ACTIVE=False FSEL_POSITION=TLB_POSITION-100 FSEL_HELP_POSITION=FSEL_POSITION-97 ' Global MAGFACTOR,MAG_POSITION,MAG_NUMBER,MAG_ACTIVE Global MAG_HELP_POSITION,MG_X,MG_Y MAGFACTOR=3 : MAG_NUMBER=5 MAG_POSITION=TLB_POSITION-98 MAG_HELP_POSITION=MAG_POSITION-97 ' Global UNDO_TEMP_NUMBER UNDO_TEMP_NUMBER=2 ' Dim PALSLIDERS(3) Global PALSLIDERS() ' Limit Mouse 0,0 To 1000,1000 ' Global SYM_ACTIVE,SYM_ROT,SYM_X,SYM_Y,SYM_ORDER,SYM_REFINX SYM_ACTIVE=False SYM_ROT=True SYM_X=SCR_WIDTH/2-1 SYM_Y=SCR_HEIGHT/2-1 SYM_ORDER=2 : Rem 1 or 2 SYM_REFINX=True : Rem -1=symetry in x-axis 0=in y-axis ' Global GRID_ACTIVE,GRID_X,GRID_Y,GRID_SX,GRID_SY GRID_X=8 : GRID_Y=8 ' CL$=Command Line$ If CL$<>"" _LOAD[CL$] Else If CFG_LASTWORK Trap Open In 1,FILE$(18) If Errtrap=0 Input #1,D$ Trap Dir$=D$ If Errtrap=0 Input #1,CURFILE$ If Exist(CURFILE$) _LOAD[CURFILE$] End If End If End If Trap Close 1 End If ' If CFG_CLOSEWB Close Workbench End If If CFG_VIRUS Exec "Run >nil: "+FILE$(22) End If If CFG_READFONTS _READ_FONT_DIR End If If CFG_AMPRO _READCONFIGFILE End If If CFG_RAD If Exist("APTemp")=False Exec "Run >nil: "+FILE$(25) If Exist("APTemp") TMP_DIR$="APTemp:" End If End If End If ' Screen TLB_NUMBER If GRID_ACTIVE _DRAWBOX[ZNEX1(34),ZNEY1(34),ZNEX2(34),ZNEY2(34),-1] End If If SYM_ACTIVE _DRAWBOX[ZNEX1(35),ZNEY1(35),ZNEX2(35),ZNEY2(35),-1] End If ' MSE_MXX=SCR_WIDTH-1 MSE_MXY=SCR_HEIGHT-1 ' _LOAD_PAINT_CONFIG[""] ' _DO_SCR_OPT ' Do OMX=MX : OMY=MY Timer=0 ' Repeat If MSE_ACTIVE MOUSEREAD[$DFF00C] End If MK=Mouse Key MS=Mouse Screen Trap Screen MS MZ=Mouse Zone MX=X Screen(X Mouse) MY=Y Screen(Y Mouse) I$=Inkey$ S=Scancode SS=Scanshift Until MK or S<>0 or MX<>OMX or MY<>OMY ' If OMS<>MS If MS=SCR_NUMBER Change Mouse 11 Else Change Mouse 4 End If OMS=MS End If If MK=1 If MS=SCR_NUMBER _PAINT[FG_COL] Else If FULL_DISPLAY If MS=TLB_NUMBER _CHECKTOOLS[MZ] While Mouse Key : Wend Else If(MS=OPT_NUMBER) or(MS=PAL_NUMBER) _TESTPALETTE[MZ,MS,MK] Else If MS=MAG_NUMBER _TEST_MAGNIFY[MZ,MX,MY,MK] End If End If Else If MK=2 If MS=SCR_NUMBER _PAINT[BG_COL] Else If FULL_DISPLAY If(MS=OPT_NUMBER) or(MS=PAL_NUMBER) _TESTPALETTE[MZ,MS,MK] Else If MS=MAG_NUMBER _TEST_MAGNIFY[MZ,MX,MY,MK] Else If MS=TLB_NUMBER _CHECKRMTOOLS[MZ] End If End If Else If MK=4 _TESTHELPKEY[MS,MZ] End If If BRUSH_ACTIVE If MS=SCR_NUMBER Screen SCR_NUMBER Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),BRUSH_BOB Screen TLB_NUMBER Else Bob Off End If End If _TESTKEY[I$,S,SS,MS,MZ] Loop ' Procedure _DO_SCR_OPT If SCR_OPT=1 _SCREENFORMAT Else If SCR_OPT=2 _COPPER_OPTIONS Else If SCR_OPT=3 _PALETTE Else If SCR_OPT=4 _HELP["WORDPRO"] Else If SCR_OPT=5 _BRUSH_OPTIONS Else If SCR_OPT=6 _FRACTAL_OPTIONS Else If SCR_OPT=7 _EFFECTS_OPTIONS Else If SCR_OPT=8 _LOAD[""] End If End Proc ' Procedure _TESTKEY[I$,S,SS,MS,MZ] L$=Lower$(I$) If S<>0 L$=Lower$(I$) If S=95 _TESTHELPKEY[MS,MZ] Else If S=76 or S=62 : Rem up If SS and %11 Limit Mouse X Mouse,Y Mouse-10 To X Mouse,Y Mouse-10 Else Limit Mouse X Mouse,Y Mouse-1 To X Mouse,Y Mouse-1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=77 or S=30 : Rem down If SS and %11 Limit Mouse X Mouse,Y Mouse+10 To X Mouse,Y Mouse+10 Else Limit Mouse X Mouse,Y Mouse+1 To X Mouse,Y Mouse+1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=78 or S=47 : Rem right If SS and %11 Limit Mouse X Mouse+10,Y Mouse To X Mouse+10,Y Mouse Else Limit Mouse X Mouse+1,Y Mouse To X Mouse+1,Y Mouse End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=79 or S=45 : Rem left If SS and %11 Limit Mouse X Mouse-10,Y Mouse To X Mouse-10,Y Mouse Else Limit Mouse X Mouse-1,Y Mouse To X Mouse-1,Y Mouse End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=61 : Rem up and left If SS and %11 Limit Mouse X Mouse-10,Y Mouse-10 To X Mouse-10,Y Mouse-10 Else Limit Mouse X Mouse-1,Y Mouse-1 To X Mouse-1,Y Mouse-1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=63 : Rem up and right If SS and %11 Limit Mouse X Mouse+10,Y Mouse-10 To X Mouse+10,Y Mouse-10 Else Limit Mouse X Mouse+1,Y Mouse-1 To X Mouse+1,Y Mouse-1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=29 : Rem down and left If SS and %11 Limit Mouse X Mouse-10,Y Mouse+10 To X Mouse-10,Y Mouse+10 Else Limit Mouse X Mouse-1,Y Mouse+1 To X Mouse-1,Y Mouse+1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If S=31 : Rem down and right If SS and %11 Limit Mouse X Mouse+10,Y Mouse+10 To X Mouse+10,Y Mouse+10 Else Limit Mouse X Mouse+1,Y Mouse+1 To X Mouse+1,Y Mouse+1 End If Wait Vbl Limit Mouse 0,0 To 1000,1000 Else If I$=Chr$(13) If BRUSH_ACTIVE Screen SCR_NUMBER Bob Off _UPDATEUNDOBUFFER X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) Paste Bob X1-BRUSH_X,Y1-BRUSH_Y,BRUSH_BOB Else If SS and %11 APLOT[MX,MY,BG_COL] Else APLOT[MX,MY,FG_COL] End If End If Else If I$="j" _SWAP_SPARE Else If S=80 : Rem f1 _SAVEAS Else If S=81 : Rem f2 _SAVE Else If S=82 : Rem f3 _LOAD[""] Else If S=83 : Rem f4 SPRAY_BOX= Not(SPRAY_BOX) Else If S=84 : Rem f5 _SETSPRAY Else If S=85 : Rem f6 - move toolbox down _MOVE_TLB_DOWN[SS] Else If S=86 : Rem f7 - move toolbox up _MOVE_TLB_UP[SS] Else If S=87 : Rem f8 - second mouse on If MSE_ACTIVE MSE_ACTIVE=False Sprite Off Else MSE_ACTIVE=True End If Else If S=88 : Rem f9 - mouse read y MSE_READX= Not(MSE_READX) If MSE_READX=0 MSE_READY=True End If Else If S=89 : Rem f10 - mouse read y MSE_READY= Not(MSE_READY) If MSE_READY=0 MSE_READX=True End If Else If S=70 _UPDATEUNDOBUFFER _NEW Else If I$=" " If FULL_DISPLAY Trap Screen Hide TLB_NUMBER Trap Screen Hide OPT_NUMBER Trap Screen Hide PAL_NUMBER Trap Screen Hide MAG_NUMBER FULL_DISPLAY=False Else FULL_DISPLAY=True Trap Screen Show TLB_NUMBER Trap Screen Show OPT_NUMBER Trap Screen Show PAL_NUMBER Trap Screen Show MAG_NUMBER End If Else If(SS and 251)=0 If L$="s" _CHECKTOOLS[22] Else If L$="v" _CHECKTOOLS[31] Else If L$="f" _CHECKTOOLS[35] Else If L$="r" _CHECKTOOLS[23] Else If L$="e" _CHECKTOOLS[29] Else If L$="b" _CHECKTOOLS[41] Else If L$="g" _CHECKTOOLS[38] Else If L$="u" _CHECKTOOLS[13] Else If L$="d" _CHECKTOOLS[25] Else If L$="q" _CHECKTOOLS[28] Else If L$="a" _CHECKTOOLS[20] Else If L$="c" _CHECKTOOLS[26] Else If L$="t" _CHECKTOOLS[19] Else If L$="/" _CHECKTOOLS[39] Else If L$="p" _CHECKTOOLS[32] Else If L$="z" _CHECKTOOLS[36] Else If L$="x" _CHECKTOOLS[21] End If Else If SS and %11 If L$="r" _CHECKTOOLS[24] Else If L$="e" _CHECKTOOLS[30] Else If L$="c" _CHECKTOOLS[27] Else If L$="p" _CHECKTOOLS[33] Else If L$="q" _QUIT End If End If End If End Proc ' Procedure _SET_SYSTEM_DIRECTORIES If Exist("ReAssign.cfg") Open In 1,"ReAssign.cfg" Set Input 10,-1 Input #1,PRG_DIR$ Input #1,DAT_DIR$ Input #1,CFG_DIR$ Input #1,SPL_DIR$ Input #1,DCT_DIR$ Input #1,CLP_DIR$ Input #1,HLP_DIR$ Input #1,TMP_DIR$ Close 1 Else If CFG_PATHREQ Screen Open 0,640,32,4,Hires Palette $0,$444,$888,$BBB Paper 2 : Pen 0 : Flash Off : Cls : Locate 1,1 _DRAW_OPT_BOX[0,0,639,31,3,1] Centre At(,1)+"Please enter a new path to locate data or press enter." Locate 1,2 Input "New Path: ";D$ If D$<>"" Trap Dir$=D$ End If Cls _DRAW_OPT_BOX[0,0,639,31,3,1] End If ' PRG_DIR$=Dir$ If Exist(Dir$+"Data/") DAT_DIR$=Dir$+"Data/" Else DAT_DIR$="AMProData:Data/" End If If Exist(Dir$+"Config/") CFG_DIR$=Dir$+"Config/" Else CFG_DIR$="AMProConfig:" End If If Exist(Dir$+"Spell/") SPL_DIR$=Dir$+"Spell/" Else SPL_DIR$="AMProSpell:" End If If Exist(Dir$+"Dict/") DCT_DIR$=Dir$+"Dict/" Else DCT_DIR$="AMProDict:" End If If Exist(Dir$+"Clipart/") CLP_DIR$=Dir$+"Clipart/" Else CLP_DIR$="AMProClipart:" End If If Exist(Dir$+"Help/") HLP_DIR$=Dir$+"Help/" Else HLP_DIR$="AMProHelp:" End If If Exist(Dir$+"Temp/") TMP_DIR$=Dir$+"Temp/" Else If Exist("APTemp:") TMP_DIR$="APTemp:" Else If Exist("Ram:Temp") TMP_DIR$="Ram:Temp/" Else If Exist("T:") TMP_DIR$="T:" Else Mkdir "ram:temp" TMP_DIR$="Ram:Temp/" End If End If End Proc ' Procedure _DRAWBOX[X1,Y1,X2,Y2,EMBOSSED] If EMBOSSED Ink 7 Draw X1,Y1 To X2,Y1 Draw X1,Y1 To X1,Y2 Draw X1+1,Y1+1 To X1+1,Y2-1 Ink 5 Draw X1,Y2 To X2,Y2 Draw X2,Y1 To X2,Y2 Draw X2-1,Y1+1 To X2-1,Y2-1 Else Ink 5 Draw X1,Y1 To X2,Y1 Draw X1,Y1 To X1,Y2 Draw X1+1,Y1+1 To X1+1,Y2-1 Ink 7 Draw X1,Y2 To X2,Y2 Draw X2,Y1 To X2,Y2 Draw X2-1,Y1+1 To X2-1,Y2-1 End If End Proc ' Procedure XBAR[X1,Y1,X2,Y2] If X1<>X2 and Y1<>Y2 AX=Min(X1,X2) BX=Max(X1,X2) AY=Min(Y1,Y2) BY=Max(Y1,Y2) Bar AX,AY To BX,BY End If End Proc Procedure APLOT[X,Y,NK] If GRID_ACTIVE X=X-GRID_SX X=X+(GRID_X/2) X=X/GRID_X X=X*GRID_X X=X+GRID_SX ' Y=Y-GRID_SY Y=Y+(GRID_Y/2) Y=Y/GRID_Y Y=Y*GRID_Y Y=Y+GRID_SY End If ' If SYM_ACTIVE DX=X-SYM_X DY=Y-SYM_Y If SYM_ROT If SYM_ORDER=2 F Plot SYM_X+DX,SYM_Y+DY,NK F Plot SYM_X-DX,SYM_Y-DY,NK F Plot SYM_X+DY,SYM_Y-DX,NK F Plot SYM_X-DY,SYM_Y+DX,NK Else If SYM_ORDER=1 F Plot SYM_X+DX,SYM_Y+DY,NK F Plot SYM_X-DX,SYM_Y-DY,NK End If Else If SYM_ORDER=2 F Plot SYM_X+DX,SYM_Y+DY,NK F Plot SYM_X-DX,SYM_Y+DY,NK F Plot SYM_X+DX,SYM_Y-DY,NK F Plot SYM_X-DX,SYM_Y-DY,NK Else If SYM_ORDER=1 If SYM_REFINX F Plot SYM_X+DX,SYM_Y+DY,NK F Plot SYM_X+DX,SYM_Y-DY,NK Else F Plot SYM_X-DX,SYM_Y+DY,NK F Plot SYM_X+DX,SYM_Y+DY,NK End If End If End If Else F Plot X,Y,NK End If End Proc Procedure ALINE[X1,Y1,X2,Y2] If GRID_ACTIVE X1=X1-GRID_SX X1=X1+(GRID_X/2) X1=X1/GRID_X X1=X1*GRID_X X1=X1+GRID_SX ' Y1=Y1-GRID_SY Y1=Y1+(GRID_Y/2) Y1=Y1/GRID_Y Y1=Y1*GRID_Y Y1=Y1+GRID_SY ' X2=X2-GRID_SX X2=X2+(GRID_X/2) X2=X2/GRID_X X2=X2*GRID_X X2=X2+GRID_SX ' Y2=Y2-GRID_SY Y2=Y2+(GRID_Y/2) Y2=Y2/GRID_Y Y2=Y2*GRID_Y Y2=Y2+GRID_SY End If If SYM_ACTIVE DX1=X1-SYM_X DY1=Y1-SYM_Y DX2=X2-SYM_X DY2=Y2-SYM_Y If SYM_ROT If SYM_ORDER=2 Draw SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 Draw SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 Draw SYM_X+DY1,SYM_Y-DX1 To SYM_X+DY2,SYM_Y-DX2 Draw SYM_X-DY1,SYM_Y+DX1 To SYM_X-DY2,SYM_Y+DX2 Else If SYM_ORDER=1 Draw SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 Draw SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 End If Else If SYM_ORDER=2 Draw SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 Draw SYM_X-DX1,SYM_Y+DY1 To SYM_X-DX2,SYM_Y+DY2 Draw SYM_X+DX1,SYM_Y-DY1 To SYM_X+DX2,SYM_Y-DY2 Draw SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 Else If SYM_ORDER=1 If SYM_REFINX Draw SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 Draw SYM_X+DX1,SYM_Y-DY1 To SYM_X+DX2,SYM_Y-DY2 Else Draw SYM_X-DX1,SYM_Y+DY1 To SYM_X-DX2,SYM_Y+DY2 Draw SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 End If End If End If Else Draw X1,Y1 To X2,Y2 End If End Proc Procedure ABAR[X1,Y1,X2,Y2] Set Pattern PAT_FILL If GRID_ACTIVE X1=X1-GRID_SX X1=X1+(GRID_X/2) X1=X1/GRID_X X1=X1*GRID_X X1=X1+GRID_SX ' Y1=Y1-GRID_SY Y1=Y1+(GRID_Y/2) Y1=Y1/GRID_Y Y1=Y1*GRID_Y Y1=Y1+GRID_SY ' X2=X2-GRID_SX X2=X2+(GRID_X/2) X2=X2/GRID_X X2=X2*GRID_X X2=X2+GRID_SX ' Y2=Y2-GRID_SY Y2=Y2+(GRID_Y/2) Y2=Y2/GRID_Y Y2=Y2*GRID_Y Y2=Y2+GRID_SY End If If SYM_ACTIVE DX1=X1-SYM_X DY1=Y1-SYM_Y DX2=X2-SYM_X DY2=Y2-SYM_Y If SYM_ROT If SYM_ORDER=2 XBAR[SYM_X+DX1,SYM_Y+DY1,SYM_X+DX2,SYM_Y+DY2] XBAR[SYM_X-DX1,SYM_Y-DY1,SYM_X-DX2,SYM_Y-DY2] XBAR[SYM_X+DY1,SYM_Y-DX1,SYM_X+DY2,SYM_Y-DX2] XBAR[SYM_X-DY1,SYM_Y+DX1,SYM_X-DY2,SYM_Y+DX2] Else If SYM_ORDER=1 XBAR[SYM_X+DX1,SYM_Y+DY1,SYM_X+DX2,SYM_Y+DY2] XBAR[SYM_X-DX1,SYM_Y-DY1,SYM_X-DX2,SYM_Y-DY2] End If Else If SYM_ORDER=2 XBAR[SYM_X+DX1,SYM_Y+DY1,SYM_X+DX2,SYM_Y+DY2] XBAR[SYM_X-DX1,SYM_Y+DY1,SYM_X-DX2,SYM_Y+DY2] XBAR[SYM_X+DX1,SYM_Y-DY1,SYM_X+DX2,SYM_Y-DY2] XBAR[SYM_X-DX1,SYM_Y-DY1,SYM_X-DX2,SYM_Y-DY2] Else If SYM_ORDER=1 If SYM_REFINX XBAR[SYM_X+DX1,SYM_Y+DY1,SYM_X+DX2,SYM_Y+DY2] XBAR[SYM_X+DX1,SYM_Y-DY1,SYM_X+DX2,SYM_Y-DY2] Else XBAR[SYM_X-DX1,SYM_Y+DY1,SYM_X-DX2,SYM_Y+DY2] XBAR[SYM_X+DX1,SYM_Y+DY1,SYM_X+DX2,SYM_Y+DY2] End If End If End If Else XBAR[X1,Y1,X2,Y2] End If End Proc Procedure ACIRCLE[X,Y,R] If GRID_ACTIVE X=X-GRID_SX X=X+(GRID_X/2) X=X/GRID_X X=X*GRID_X X=X+GRID_SX ' Y=Y-GRID_SY Y=Y+(GRID_Y/2) Y=Y/GRID_Y Y=Y*GRID_Y Y=Y+GRID_SY End If ' If SYM_ACTIVE DX=X-SYM_X DY=Y-SYM_Y If SYM_ROT If SYM_ORDER=2 Circle SYM_X+DX,SYM_Y+DY,R Circle SYM_X-DX,SYM_Y-DY,R Circle SYM_X+DY,SYM_Y-DX,R Circle SYM_X-DY,SYM_Y+DX,R Else If SYM_ORDER=1 Circle SYM_X+DX,SYM_Y+DY,R Circle SYM_X-DX,SYM_Y-DY,R End If Else If SYM_ORDER=2 Circle SYM_X+DX,SYM_Y+DY,R Circle SYM_X-DX,SYM_Y+DY,R Circle SYM_X+DX,SYM_Y-DY,R Circle SYM_X-DX,SYM_Y-DY,R Else If SYM_ORDER=1 If SYM_REFINX Circle SYM_X+DX,SYM_Y+DY,R Circle SYM_X+DX,SYM_Y-DY,R Else Circle SYM_X-DX,SYM_Y+DY,R Circle SYM_X+DX,SYM_Y+DY,R End If End If End If Else Circle X,Y,R End If End Proc Procedure ALLIPSE[X1,Y1,R1,R2] Set Pattern PAT_FILL If GRID_ACTIVE X1=X1-GRID_SX X1=X1+(GRID_X/2) X1=X1/GRID_X X1=X1*GRID_X X1=X1+GRID_SX ' Y1=Y1-GRID_SY Y1=Y1+(GRID_Y/2) Y1=Y1/GRID_Y Y1=Y1*GRID_Y Y1=Y1+GRID_SY End If If SYM_ACTIVE DX1=X1-SYM_X DY1=Y1-SYM_Y If SYM_ROT If SYM_ORDER=2 Ellipse SYM_X+DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X-DX1,SYM_Y-DY1,R1,R2 Ellipse SYM_X+DY1,SYM_Y-DX1,R2,R1 Ellipse SYM_X-DY1,SYM_Y+DX1,R2,R1 Else If SYM_ORDER=1 Ellipse SYM_X+DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X-DX1,SYM_Y-DY1,R1,R2 End If Else If SYM_ORDER=2 Ellipse SYM_X+DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X-DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X+DX1,SYM_Y-DY1,R1,R2 Ellipse SYM_X-DX1,SYM_Y-DY1,R1,R2 Else If SYM_ORDER=1 If SYM_REFINX Ellipse SYM_X+DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X+DX1,SYM_Y-DY1,R1,R2 Else Ellipse SYM_X-DX1,SYM_Y+DY1,R1,R2 Ellipse SYM_X+DX1,SYM_Y+DY1,R1,R2 End If End If End If Else Ellipse X1,Y1,R1,R2 End If End Proc Procedure AFIL[X,Y] Set Pattern PAT_FILL If GRID_ACTIVE X=X-GRID_SX X=X+(GRID_X/2) X=X/GRID_X X=X*GRID_X X=X+GRID_SX ' Y=Y-GRID_SY Y=Y+(GRID_Y/2) Y=Y/GRID_Y Y=Y*GRID_Y Y=Y+GRID_SY End If ' If SYM_ACTIVE DX=X-SYM_X DY=Y-SYM_Y If SYM_ROT If SYM_ORDER=2 Paint SYM_X+DX,SYM_Y+DY Paint SYM_X-DX,SYM_Y-DY Paint SYM_X+DY,SYM_Y-DX Paint SYM_X-DY,SYM_Y+DX Else If SYM_ORDER=1 Paint SYM_X+DX,SYM_Y+DY Paint SYM_X-DX,SYM_Y-DY End If Else If SYM_ORDER=2 Paint SYM_X+DX,SYM_Y+DY Paint SYM_X-DX,SYM_Y+DY Paint SYM_X+DX,SYM_Y-DY Paint SYM_X-DX,SYM_Y-DY Else If SYM_ORDER=1 If SYM_REFINX Paint SYM_X+DX,SYM_Y+DY Paint SYM_X+DX,SYM_Y-DY Else Paint SYM_X-DX,SYM_Y+DY Paint SYM_X+DX,SYM_Y+DY End If End If End If Else Paint X,Y End If End Proc Procedure APOLYGON[X1,Y1,X2,Y2,X3,Y3] If GRID_ACTIVE X1=X1-GRID_SX X1=X1+(GRID_X/2) X1=X1/GRID_X X1=X1*GRID_X X1=X1+GRID_SX ' Y1=Y1-GRID_SY Y1=Y1+(GRID_Y/2) Y1=Y1/GRID_Y Y1=Y1*GRID_Y Y1=Y1+GRID_SY ' X2=X2-GRID_SX X2=X2+(GRID_X/2) X2=X2/GRID_X X2=X2*GRID_X X2=X2+GRID_SX ' Y2=Y2-GRID_SY Y2=Y2+(GRID_Y/2) Y2=Y2/GRID_Y Y2=Y2*GRID_Y Y2=Y2+GRID_SY ' X3=X3-GRID_SX X3=X3+(GRID_X/2) X3=X3/GRID_X X3=X3*GRID_X X3=X3+GRID_SX ' Y3=Y3-GRID_SY Y3=Y3+(GRID_Y/2) Y3=Y3/GRID_Y Y3=Y3*GRID_Y Y3=Y3+GRID_SY End If If SYM_ACTIVE DX1=X1-SYM_X DY1=Y1-SYM_Y DX2=X2-SYM_X DY2=Y2-SYM_Y DX3=X3-SYM_X DY3=Y3-SYM_Y If SYM_ROT If SYM_ORDER=2 Polygon SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 To SYM_X+DX3,SYM_Y+DY3 Polygon SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 To SYM_X-DX3,SYM_Y-DY3 Polygon SYM_X+DY1,SYM_Y-DX1 To SYM_X+DY2,SYM_Y-DX2 To SYM_X+DY3,SYM_Y-DX3 Polygon SYM_X-DY1,SYM_Y+DX1 To SYM_X-DY2,SYM_Y+DX2 To SYM_X-DY3,SYM_Y+DX3 Else If SYM_ORDER=1 Polygon SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 To SYM_X+DX3,SYM_Y+DY3 Polygon SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 To SYM_X-DX3,SYM_Y-DY3 End If Else If SYM_ORDER=2 Polygon SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 To SYM_X+DX3,SYM_Y+DY3 Polygon SYM_X-DX1,SYM_Y+DY1 To SYM_X-DX2,SYM_Y+DY2 To SYM_X-DX3,SYM_Y+DY3 Polygon SYM_X+DX1,SYM_Y-DY1 To SYM_X+DX2,SYM_Y-DY2 To SYM_X+DX3,SYM_Y-DY3 Polygon SYM_X-DX1,SYM_Y-DY1 To SYM_X-DX2,SYM_Y-DY2 To SYM_X-DX3,SYM_Y-DY3 Else If SYM_ORDER=1 If SYM_REFINX Polygon SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 To SYM_X+DX3,SYM_Y+DY3 Polygon SYM_X+DX1,SYM_Y-DY1 To SYM_X+DX2,SYM_Y-DY2 To SYM_X+DX3,SYM_Y-DY3 Else Polygon SYM_X-DX1,SYM_Y+DY1 To SYM_X-DX2,SYM_Y+DY2 To SYM_X-DX3,SYM_Y+DY3 Polygon SYM_X+DX1,SYM_Y+DY1 To SYM_X+DX2,SYM_Y+DY2 To SYM_X+DX3,SYM_Y+DY3 End If End If End If Else Polygon X1,Y1 To X2,Y2 To X3,Y3 End If End Proc ' Procedure _CHECKTOOLS[ZN] Screen TLB_NUMBER If ZN=1 : Rem up left _MOVE_UP_LEFT Else If ZN=2 : Rem left _MOVE_LEFT Else If ZN=3 : Rem down left _MOVE_DOWN_LEFT Else If ZN=4 : Rem up _MOVE_UP Else If ZN=5 : Rem move screen _DRAG_SCREEN Else If ZN=6 : Rem down _MOVE_DOWN Else If ZN=7 : Rem up right _MOVE_UP_RIGHT Else If ZN=8 : Rem right _MOVE_RIGHT Else If ZN=9 : Rem down right _MOVE_DOWN_RIGHT Else If ZN=10 : Rem save as _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),-1] _SAVEAS _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),0] Else If ZN=11 : Rem save _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),-1] _SAVE While Mouse Key : Wend _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),0] Else If ZN=12 : Rem load _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),-1] _LOAD[""] _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),0] Else If ZN=13 : Rem undo _UNDO Else If ZN=14 : Rem cls/new _DRAWBOX[ZNEX1(14),ZNEY1(14),ZNEX2(14),ZNEY2(14),-1] _UPDATEUNDOBUFFER _NEW While Mouse Key : Wend _DRAWBOX[ZNEX1(14),ZNEY1(14),ZNEX2(14),ZNEY2(14),0] Else If ZN=15 : Rem Screen Format If PAL_ACTIVE=False _SCREENFORMAT End If Else If ZN=16 : Rem Set Font If PAL_ACTIVE=False _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),-1] _SETFONT _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),0] End If Else If ZN=17 : Rem Painter/Spray Options If PAL_ACTIVE=False _PAINTER_OPTIONS End If Else If ZN=18 : Rem Magnify _MAGNIFY Else If ZN=>19 and ZN<=36 : Rem Tools _CLEARTOOL _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),-1] ACTIVETOOL=ZN-18 While Mouse Key : Wend Else If ZN=37 : Rem grid and symetry options If PAL_ACTIVE=False _SYM_GRID_OPTIONS End If Else If ZN=38 : Rem gridlock GRID_ACTIVE= Not(GRID_ACTIVE) _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),GRID_ACTIVE] Else If ZN=39 : Rem symetry SYM_ACTIVE= Not(SYM_ACTIVE) _DRAWBOX[ZNEX1(ZN),ZNEY1(ZN),ZNEX2(ZN),ZNEY2(ZN),SYM_ACTIVE] Else If ZN=40 : Rem Printer If PAL_ACTIVE=False _PRINT End If Else If ZN=41 : Rem pick up brush _GRAB_BRUSH Else If ZN=42 : Rem palette If OPT_ACTIVE=False _PALETTE End If Else If ZN=43 : Rem SysInfo/Coords/Modplayer If PAL_ACTIVE=False _SYSTEM_OPTIONS End If Else If ZN=44 : Rem Preferences If PAL_ACTIVE=False _PREFERENCES End If Else If ZN=45 : Rem Quit _QUIT Else If ZN=46 : Rem Pattern If PAL_ACTIVE=False _PATTERN_OPTIONS End If Else If ZN=47 : Rem Fractal If PAL_ACTIVE=False _FRACTAL_OPTIONS End If Else If ZN=48 : Rem brush If PAL_ACTIVE=False _BRUSH_OPTIONS End If Else If ZN=49 : Rem Effects If PAL_ACTIVE=False _EFFECTS_OPTIONS End If Else If ZN=50 : Rem Copper If PAL_ACTIVE=False _COPPER_OPTIONS End If Else If ZN=51 : Rem Clipart If PAL_ACTIVE=False _CLIPART_OPTIONS End If End If End Proc Procedure _CHECKRMTOOLS[ZN] If ZN=34 _SETSPRAY End If End Proc Procedure _PAINT[CL] Screen SCR_NUMBER If BRUSH_ACTIVE Bob Off Wait Vbl End If If(Mouse Key=1) or(ACTIVETOOL<>7) _UPDATEUNDOBUFFER End If If CL=FG_COL Ink FG_COL,BG_COL Else Ink BG_COL,FG_COL End If Gr Writing 0 If BRUSH_ACTIVE If ACTIVETOOL=4 _DOTTED_BRUSH Else If ACTIVETOOL=5 _BOX_BRUSH Else If ACTIVETOOL=7 _FREEHAND_BRUSH Else If ACTIVETOOL=8 _CIRCLE_BRUSH Else If ACTIVETOOL=11 _ELLIPSE_BRUSH Else If ACTIVETOOL=13 _LINE_BRUSH Else If ACTIVETOOL=16 _SPRAY_BRUSH Else If ACTIVETOOL=2 _DEL_BRUSH End If Else If ACTIVETOOL=1 _TEXT Else If ACTIVETOOL=2 PA1NT Else If ACTIVETOOL=3 _POLYGON Else If ACTIVETOOL=4 _DOTTED[CL] Else If ACTIVETOOL=5 _RECTANGLE Else If ACTIVETOOL=6 FIL_RECTANGLE Else If ACTIVETOOL=7 _FREEHAND Else If ACTIVETOOL=8 _CIRCLE Else If ACTIVETOOL=9 FIL_CIRCLE[CL] Else If ACTIVETOOL=10 _CURVE Else If ACTIVETOOL=11 _ELIPSE Else If ACTIVETOOL=12 FIL_ELIPSE[CL] Else If ACTIVETOOL=13 _LINE Else If ACTIVETOOL=14 _PIE Else If ACTIVETOOL=15 FIL_PIE[CL] Else If ACTIVETOOL=16 _SPRAYCAN[CL] Else If ACTIVETOOL=17 FIL Else If ACTIVETOOL=18 _FREEHAND_SHAPE End If If MAG_ACTIVE _DRAWGRID End If End If End Proc Procedure _CLEARTOOL _DRAWBOX[ZNEX1(ACTIVETOOL+18),ZNEY1(ACTIVETOOL+18),ZNEX2(ACTIVETOOL+18),ZNEY2(ACTIVETOOL+18),0] End Proc ' 'Tools ' Procedure _DOTTED[CL] While Mouse Key APLOT[X Screen(X Mouse),Y Screen(Y Mouse),CL] Wend End Proc Procedure _FREEHAND OLDX=X Screen(X Mouse) OLDY=Y Screen(Y Mouse) Set Line PAT_LINE While Mouse Key X=X Screen(X Mouse) Y=Y Screen(Y Mouse) ALINE[OLDX,OLDY,X,Y] OLDX=X : OLDY=Y Wend End Proc Procedure _CURVE If Mouse Key<>1 Then Pop Proc X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) ' Set Line 65535 Gr Writing 2 ' While Mouse Key X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) Draw X1,Y1 To X2,Y2 Draw X1,Y1 To X2,Y2 Wend ' Repeat X3=X Screen(X Mouse) Y3=Y Screen(Y Mouse) CURVE[X1,Y1,X2,Y2,X3,Y3] CURVE[X1,Y1,X2,Y2,X3,Y3] Until Mouse Key Gr Writing 1 Set Line PAT_LINE CURVE[X1,Y1,X2,Y2,X3,Y3] ' Do While Mouse Key : Wend X4=X3+(X3-X2) Y4=Y3+(Y3-Y2) Gr Writing 2 Set Line 65535 Repeat X5=X Screen(X Mouse) Y5=Y Screen(Y Mouse) CURVE[X3,Y3,X4,Y4,X5,Y5] CURVE[X3,Y3,X4,Y4,X5,Y5] If Mouse Key and 2 Then Goto EX Until Mouse Key Gr Writing 1 Set Line PAT_LINE CURVE[X3,Y3,X4,Y4,X5,Y5] X3=X5 Y3=Y5 X2=X4 Y2=Y4 Loop EX: While Mouse Key : Wend End Proc Procedure _LINE Set Line 65535 Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) ALINE[X1,Y1,X2,Y2] ALINE[X1,Y1,X2,Y2] Wend Gr Writing 1 Set Line PAT_LINE ALINE[X1,Y1,X2,Y2] End Proc Procedure _RECTANGLE Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) Set Line 65535 While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) ' ALINE[X1,Y1,X2,Y1] ALINE[X1,Y1,X1,Y2] ALINE[X1,Y2,X2,Y2] ALINE[X2,Y1,X2,Y2] ' ALINE[X1,Y1,X2,Y1] ALINE[X1,Y1,X1,Y2] ALINE[X1,Y2,X2,Y2] ALINE[X2,Y1,X2,Y2] Wend Gr Writing 1 Set Line PAT_LINE ALINE[X1,Y1,X2,Y1] ALINE[X1,Y1,X1,Y2] ALINE[X1,Y2,X2,Y2] ALINE[X2,Y1,X2,Y2] End Proc Procedure FIL_RECTANGLE Gr Writing 2 Set Line 65535 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) ' ALINE[X1,Y1,X2,Y1] ALINE[X1,Y1,X1,Y2] ALINE[X1,Y2,X2,Y2] ALINE[X2,Y1,X2,Y2] ' ALINE[X1,Y1,X2,Y1] ALINE[X1,Y1,X1,Y2] ALINE[X1,Y2,X2,Y2] ALINE[X2,Y1,X2,Y2] Wend Gr Writing 1 ABAR[X1,Y1,X2,Y2] End Proc Procedure _CIRCLE If CIRCMODE=CENTR Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R=Abs(Max(X2-X1,Y2-Y1)) R=Max(R,1) ACIRCLE[X1,Y1,R] ACIRCLE[X1,Y1,R] Wend Gr Writing 1 ACIRCLE[X1,Y1,R] Else If CIRCMODE=CORNR Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R=Max(Abs((X2-X1)/2),Abs((Y2-Y1)/2)) R=Max(R,1) ACIRCLE[X1+R,Y1+R,R] ACIRCLE[X1+R,Y1+R,R] Wend Gr Writing 1 ACIRCLE[X1+R,Y1+R,R] Else If CIRCMODE=PONT3 Gr Writing 2 X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) Plot X1,Y1 ' While Mouse Key : Wend Repeat : Until Mouse Click X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) ' Plot X1,Y1 ' While Mouse Key X3=X Screen(X Mouse) Y3=Y Screen(Y Mouse) _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] Wend Gr Writing 1 _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] End If End Proc Procedure FIL_CIRCLE[CL] Screen SCR_NUMBER Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) If CIRCMODE=CENTR While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R=Abs(Max(X2-X1,Y2-Y1)) R=Max(R,1) ACIRCLE[X1,Y1,R] ACIRCLE[X1,Y1,R] Wend Else If CIRCMODE=CORNR While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R=Max(Abs((X2-X1)/2),Abs((Y2-Y1)/2)) R=Max(R,1) ACIRCLE[X1+R,Y1+R,R] ACIRCLE[X1+R,Y1+R,R] Wend Else If CIRCMODE=PONT3 Plot X1,Y1 ' While Mouse Key : Wend Repeat : Until Mouse Click X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) ' Plot X1,Y1 ' While Mouse Key X3=X Screen(X Mouse) Y3=Y Screen(Y Mouse) _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] Wend End If ' Auto View Off Screen Open BLOCK_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Gr Writing 1 Screen BLOCK_NUMBER : Cls 0 If CL=FG_COL Ink FG_COL,BG_COL Else Ink BG_COL,FG_COL End If If CIRCMODE=CENTR ACIRCLE[X1,Y1,R] Else If CIRCMODE=CORNR ACIRCLE[X1+R,Y1+R,R] Else If CIRCMODE=PONT3 _3POINTCIRCLE[X1,Y1,X2,Y2,X3,Y3] End If Set Pattern PAT_FILL AFIL[X1,Y1] Get Block 1,0,0,SCR_WIDTH,SCR_HEIGHT,1 Screen Close BLOCK_NUMBER Screen SCR_NUMBER Put Block 1,X,Y Auto View On Screen SCR_NUMBER End Proc Procedure _ELIPSE Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R1=Max(Abs(X2-X1),1) R2=Max(Abs(Y2-Y1),1) ALLIPSE[X1,Y1,R1,R2] ALLIPSE[X1,Y1,R1,R2] Wend Gr Writing 1 ALLIPSE[X1,Y1,R1,R2] End Proc Procedure FIL_ELIPSE[CL] Screen SCR_NUMBER Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R1=Max(Abs(X2-X1),1) R2=Max(Abs(Y2-Y1),1) ALLIPSE[X1,Y1,R1,R2] ALLIPSE[X1,Y1,R1,R2] Wend Auto View Off Screen Open BLOCK_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Gr Writing 1 Screen BLOCK_NUMBER : Cls 0 If CL=FG_COL Ink FG_COL,BG_COL Else Ink BG_COL,FG_COL End If Set Pattern PAT_FILL ALLIPSE[X1,Y1,R1,R2] AFIL[X1,Y1] If SYM_ACTIVE X=0 : Y=0 W=SCR_WIDTH : H=SCR_HEIGHT Else X=Max(X1-R1,0) : Y=Max(Y1-R2,0) W=Min(X1+R1+16,SCR_WIDTH)-X : H=Min(Y1+R2+16,SCR_HEIGHT)-Y End If Get Block 1,X,Y,W,H,1 Screen Close BLOCK_NUMBER Screen SCR_NUMBER Put Block 1,X,Y Auto View On Screen SCR_NUMBER End Proc Procedure _PIE Degree X1#=X Screen(X Mouse) Y1#=Y Screen(Y Mouse) Gr Writing 2 While Mouse Key X2#=X Screen(X Mouse) Y2#=Y Screen(Y Mouse) Draw X1#,Y1# To X2#,Y2# Draw X1#,Y1# To X2#,Y2# Wend Repeat X2#=X Screen(X Mouse) Y2#=Y Screen(Y Mouse) Draw X1#,Y1# To X2#,Y2# Draw X1#,Y1# To X2#,Y2# Until Mouse Key R#=Sqr(((X2#-X1#)^2)+((Y2#-Y1#)^2)) If X2#Y1# Trap A#=180+Atan((Y2#-Y1#)/(X2#-X1#)) Else If X2#X1# and Y2#Y1# Trap B#=180+Atan((Y2#-Y1#)/(X2#-X1#)) Else If X2#X1# and Y2#Y1# Trap A#=180+Atan((Y2#-Y1#)/(X2#-X1#)) Else If X2#X1# and Y2#Y1# Trap B#=180+Atan((Y2#-Y1#)/(X2#-X1#)) Else If X2#X1# and Y2#-1 and P<>FG_COL and P<>BG_COL F=False Gosub CHCK If F CP(AX,AY)=BG_COL Else CP(AX,AY)=FG_COL End If Else CP(AX,AY)=P End If Inc AY Next Inc AX Next AX=1 : AY=1 For X=XM-PNT_X To XM+PNT_X AY=0 For Y=YM-PNT_Y To YM+PNT_Y Trap F Plot X,Y,CP(AX,AY) Inc AY Next Inc AX Next Wend Else If PNT_VAR=4 If SCR_COLOURS=64 While Mouse Key XM=X Screen(X Mouse) YM=Y Screen(Y Mouse) For X=XM-PNT_X To XM+PNT_X For Y=YM-PNT_Y To YM+PNT_Y P=F Point(X,Y) If P>=0 and P<32 Trap F Plot X,Y,P+32 End If Next Next Wend End If Else If PNT_VAR=5 If SCR_COLOURS=64 While Mouse Key XM=X Screen(X Mouse) YM=Y Screen(Y Mouse) For X=XM-PNT_X To XM+PNT_X For Y=YM-PNT_Y To YM+PNT_Y P=F Point(X,Y) If P>=32 and P<64 Trap F Plot X,Y,P-32 End If Next Next Wend End If Else If PNT_VAR=6 Ink 0 : Set Pattern 0 While Mouse Key X1=X Screen(X Mouse)-PNT_X : Y1=Y Screen(Y Mouse)-PNT_Y X2=X Screen(X Mouse)+PNT_X : Y2=Y Screen(Y Mouse)+PNT_Y X1=Max(0,X1) : Y1=Max(0,Y1) X2=Min(SCR_WIDTH-1,X2) : Y2=Min(SCR_HEIGHT-1,Y2) Trap Bar X1,Y1 To X2,Y2 Wend Else If PNT_VAR=7 Screen SCR_NUMBER While Mouse Key X1=X Screen(X Mouse)-PNT_X : Y1=Y Screen(Y Mouse)-PNT_Y X2=X Screen(X Mouse)+PNT_X : Y2=Y Screen(Y Mouse)+PNT_Y X1=Max(0,X1) : Y1=Max(0,Y1) X2=Min(SCR_WIDTH-1,X2) : Y2=Min(SCR_HEIGHT-1,Y2) For X=X1 To X2 For Y=Y1 To Y2 If F Point(X,Y)=FG_COL APLOT[X,Y,BG_COL] End If Next Next Wend Else If PNT_VAR=8 Ink FG_COL,BG_COL : Set Pattern PAT_FILL While Mouse Key X1=X Screen(X Mouse)-PNT_X : Y1=Y Screen(Y Mouse)-PNT_Y X2=X Screen(X Mouse)+PNT_X : Y2=Y Screen(Y Mouse)+PNT_Y X1=Max(0,X1) : Y1=Max(0,Y1) X2=Min(SCR_WIDTH-1,X2) : Y2=Min(SCR_HEIGHT-1,Y2) Trap Bar X1,Y1 To X2,Y2 Wend Else If PNT_VAR=9 Set Pattern 0 While Mouse Key X1=X Screen(X Mouse)-PNT_X : Y1=Y Screen(Y Mouse)-PNT_Y X2=X Screen(X Mouse)+PNT_X : Y2=Y Screen(Y Mouse)+PNT_Y X1=Max(0,X1) : Y1=Max(0,Y1) X2=Min(SCR_WIDTH-1,X2) : Y2=Min(SCR_HEIGHT-1,Y2) Ink Rnd(SCR_COLOURS) Trap Bar X1,Y1 To X2,Y2 Wend End If Pop Proc ' CHCK: If F Point(X,Y-1)

-1 and F Point(X,Y-1)<>BG_COL and F Point(X,Y-1)<>FG_COL F=True Else If F Point(X-1,Y)

-1 and F Point(X-1,Y)<>BG_COL and F Point(X-1,Y)<>FG_COL F=True Else If F Point(X+1,Y)

-1 and F Point(X+1,Y)<>BG_COL and F Point(X+1,Y)<>FG_COL F=True Else If F Point(X,Y+1)

-1 and F Point(X,Y+1)<>BG_COL and F Point(X,Y+1)<>FG_COL F=True End If Return End Proc Procedure _TEXT Set Font SCRFONT X=X Screen(X Mouse) Y=Y Screen(Y Mouse) Gr Writing 2 Text X,Y,"|" Do Repeat I$=Inkey$ S=Scancode SS=Scanshift MK=Mouse Key MS=Mouse Screen Trap Screen MS MZ=Mouse Zone Until S<>0 or MK<>0 Screen SCR_NUMBER If WRAP TXT_WRITELN[X,Y,T$+"|"] Else Text X,Y,T$+"|" End If If MK=1 If MZ=5 and MS=TLB_NUMBER _DRAG_SCREEN Screen SCR_NUMBER Else X=X Screen(X Mouse) Y=Y Screen(Y Mouse) End If Else If I$=Chr$(13) Exit Else If I$=Chr$(27) Pop Proc Else If S=80 IBU=IBU xor 4 Else If S=81 IBU=IBU xor 2 Else If S=82 IBU=IBU xor 1 Else If S=83 WRAP= Not(WRAP) Else If I$=Chr$(8) If SS and %11 T$="" Else T$=Left$(T$,Len(T$)-1) End If Else If I$>=" " T$=T$+I$ End If Set Text IBU If WRAP TXT_WRITELN[X,Y,T$+"|"] Else Text X,Y,T$+"|" End If Loop Gr Writing 0 If WRAP TXT_WRITELN[X,Y,T$] Else Text X,Y,T$ End If End Proc Procedure TXT_WRITELN[TX,TY,T$] MXTB=(Text Base*4)/3 For C1=1 To Len(T$) CH$=Mid$(T$,C1,1) If CH$=" " If WORD$<>"" If TX+Text Length(LINE$+WORD$+" ")>SCR_WIDTH-1 Text TX,TY,LINE$ Add TY,MXTB LINE$=WORD$+" " Else LINE$=LINE$+WORD$+" " End If WORD$="" Else LINE$=LINE$+" " End If Else If CH$>" " WORD$=WORD$+CH$ End If Next C1 If WORD$<>"" If TX+Text Length(LINE$+WORD$+" ")>SCR_WIDTH-1 Text TX,TY,LINE$ Add TY,MXTB Text TX,TY,WORD$ Else LINE$=LINE$+WORD$ Text TX,TY,LINE$ End If WORD$="" Else Text TX,TY,LINE$ End If End Proc Procedure _FREEHAND_SHAPE X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) X2=X1 Y2=Y1 Set Pattern PAT_FILL While Mouse Key X3=X Screen(X Mouse) Y3=Y Screen(Y Mouse) APOLYGON[X1,Y1,X2,Y2,X3,Y3] X2=X3 Y2=Y3 Wend End Proc Procedure _POLYGON X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) While Mouse Key : Wend Gr Writing 2 Repeat X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) Draw X1,Y1 To X2,Y2 Draw X1,Y1 To X2,Y2 Until Mouse Key While Mouse Key : Wend Do Gr Writing 2 Set Pattern 0 Repeat X3=X Screen(X Mouse) Y3=Y Screen(Y Mouse) APOLYGON[X1,Y1,X2,Y2,X3,Y3] APOLYGON[X1,Y1,X2,Y2,X3,Y3] If Mouse Key=2 While Mouse Key : Wend Exit 2 End If Until Mouse Key=1 If X3=X2 and Y3=Y2 While Mouse Key : Wend Exit End If Gr Writing 1 Set Pattern PAT_FILL APOLYGON[X1,Y1,X2,Y2,X3,Y3] X2=X3 Y2=Y3 While Mouse Key : Wend Loop End Proc ' Procedure _DOTTED_BRUSH While Mouse Key=1 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) Paste Bob X1-BRUSH_X,Y1-BRUSH_Y,BRUSH_BOB Wend End Proc Procedure _FREEHAND_BRUSH OLDMX=X Screen(X Mouse) OLDMY=Y Screen(Y Mouse) While Mouse Key MX=X Screen(X Mouse) MY=Y Screen(Y Mouse) _DRAW_BRUSH_LINE[OLDMX,OLDMY,MX,MY] OLDMX=MX OLDMY=MY Wend End Proc Procedure _LINE_BRUSH Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) Draw X1,Y1 To X2,Y2 Draw X1,Y1 To X2,Y2 Wend Gr Writing 1 Bob Off _DRAW_BRUSH_LINE[X1,Y1,X2,Y2] End Proc Procedure _BOX_BRUSH Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) Box X1,Y1 To X2,Y2 Box X1,Y1 To X2,Y2 Wend Gr Writing 1 _DRAW_BRUSH_LINE[X1,Y1,X2,Y1] _DRAW_BRUSH_LINE[X1,Y1,X1,Y2] _DRAW_BRUSH_LINE[X1,Y2,X2,Y2] _DRAW_BRUSH_LINE[X2,Y1,X2,Y2] End Proc Procedure _CIRCLE_BRUSH Radian Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) RADIUS=Max(Abs(X2-X1),Abs(Y2-Y1)) RADIUS=Max(RADIUS,1) Circle X1,Y1,RADIUS Circle X1,Y1,RADIUS Wend Gr Writing 1 RAD#=0 Ink _COLOUR RADIUS=32767/RADIUS OLDX=X1+(Int(32767*(Cos(RAD#))+0.5))/RADIUS OLDY=Y1+(Int(32767*(Sin(RAD#))+0.5)) For ITERATION=0 To 90 X=Int(32767*(Cos(RAD#))+0.5) Y=Int(32767*(Sin(RAD#))+0.5) RAD#=RAD#+2*Pi#/90 _DRAW_BRUSH_LINE[X1+(X/RADIUS),Y1+(Y/RADIUS),OLDX,OLDY] OLDX=X1+(X/RADIUS) OLDY=Y1+(Y/RADIUS) Next ITERATION End Proc Procedure _ELLIPSE_BRUSH Gr Writing 2 X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse) While Mouse Key X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse) R1=Max(Abs(X2-X1),1) R2=Max(Abs(Y2-Y1),1) Ellipse X1,Y1,R1,R2 Ellipse X1,Y1,R1,R2 Wend Gr Writing 1 Ink _COLOUR X=Int(32767*(Cos(RAD#))+0.5) Y=Int(32767*(Sin(RAD#))+0.5) RAD#=RAD#+2*Pi#/90 R1=32767/R1 : R2=32767/R2 OLDX=X1+(X/R1) : OLDY=Y1+(Y/R2) For ITERATION=0 To 90 X=Int(32767*(Cos(RAD#))+0.5) Y=Int(32767*(Sin(RAD#))+0.5) RAD#=RAD#+2*Pi#/90 _DRAW_BRUSH_LINE[X1+(X/R1),Y1+(Y/R2),OLDX,OLDY] OLDX=X1+(X/R1) OLDY=Y1+(Y/R2) Next ITERATION End Proc Procedure _SPRAY_BRUSH While Mouse Key X1=X Screen(X Mouse)-BRUSH_WIDTH+Rnd(BRUSH_WIDTH*2) Y1=Y Screen(Y Mouse)-BRUSH_HEIGHT+Rnd(BRUSH_HEIGHT*2) Paste Bob X1-BRUSH_X,Y1-BRUSH_Y,BRUSH_BOB Wend End Proc Procedure _DEL_BRUSH Auto View Off Screen Open BLOCK_NUMBER,BRUSH_WIDTH+(16-(BRUSH_WIDTH mod 16)),BRUSH_HEIGHT+(8-(BRUSH_HEIGHT mod 8)),SCR_COLOURS,SCR_RES+SCR_LACED Screen BLOCK_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB Trap Dim PNT(BRUSH_WIDTH,BRUSH_HEIGHT) If Errtrap Screen Close BLOCK_NUMBER Pop Proc End If For X=0 To BRUSH_WIDTH-1 For Y=0 To BRUSH_HEIGHT-1 If F Point(X,Y) PNT(X+1,Y+1)=True End If Next Next Screen Close BLOCK_NUMBER Screen SCR_NUMBER View : Auto View On While Mouse Key X1=X Screen(X Mouse)-BRUSH_X Y1=Y Screen(Y Mouse)-BRUSH_Y X2=X Screen(X Mouse)+BRUSH_WIDTH-BRUSH_X-1 Y2=Y Screen(Y Mouse)+BRUSH_HEIGHT-BRUSH_Y-1 X1=Max(0,X1) : Y1=Max(0,Y1) X2=Min(SCR_WIDTH-1,X2) : Y2=Min(SCR_HEIGHT-1,Y2) PX=0 For X=X1 To X2 Inc PX : PY=0 For Y=Y1 To Y2 Inc PY Trap If PNT(PX,PY) APLOT[X,Y,BG_COL] End If Next Next Wend End Proc ' Procedure _DRAW_BRUSH_LINE[OMX,OMY,MX,MY] If MX=OMX and MY=OMY Paste Bob MX-BRUSH_X,MY-BRUSH_Y,BRUSH_BOB Else If Abs(OMX-MX)>Abs(OMY-MY) If MXX2 Swap X1,X2 End If If Y1>Y2 Swap Y1,Y2 End If F Plot X1,Y1,P X2=Max(X2,X1+1) Y2=Max(Y2,Y1+1) Trap Get Bob BRUSH_BOB,X1,Y1 To X2,Y2 If Not Errtrap BRUSH_HEIGHT=Y2-Y1 BRUSH_WIDTH=X2-X1 Gr Writing 0 BRUSH_ACTIVE=True BRUSH_X=0 BRUSH_Y=0 End If End If End Proc ' Procedure _SETZONES Screen TLB_NUMBER Reserve Zone 51 S=Start(51) For Z=1 To 51 ZNEX1(Z)=Leek(S) : Add S,4 ZNEY1(Z)=Leek(S) : Add S,4 ZNEX2(Z)=Leek(S) : Add S,4 ZNEY2(Z)=Leek(S) : Add S,4 Set Zone Z,ZNEX1(Z),ZNEY1(Z) To ZNEX2(Z),ZNEY2(Z) Next End Proc ' Procedure _MOVE_UP_LEFT Screen TLB_NUMBER _DRAWBOX[ZNEX1(1),ZNEY1(1),ZNEX2(1),ZNEY2(1),-1] Screen SCR_NUMBER If MAG_ACTIVE While Mouse Key and 1 Dec MG_X : Dec MG_Y _TESTMAGZONES _DRAWGRID Wend Else While Mouse Key and 1 If SCR_X_OFFSET>0 Dec SCR_X_OFFSET End If If SCR_Y_OFFSET>0 Dec SCR_Y_OFFSET End If Screen Offset SCR_NUMBER,SCR_X_OFFSET,SCR_Y_OFFSET Wend End If Screen TLB_NUMBER _DRAWBOX[ZNEX1(1),ZNEY1(1),ZNEX2(1),ZNEY2(1),0] End Proc Procedure _MOVE_LEFT Screen TLB_NUMBER _DRAWBOX[ZNEX1(2),ZNEY1(2),ZNEX2(2),ZNEY2(2),-1] Screen SCR_NUMBER If MAG_ACTIVE While Mouse Key and 1 Dec MG_X _TESTMAGZONES _DRAWGRID Wend Else While Mouse Key and 1 If SCR_X_OFFSET>0 Dec SCR_X_OFFSET End If Screen Offset SCR_NUMBER,SCR_X_OFFSET,SCR_Y_OFFSET Wend End If Screen TLB_NUMBER _DRAWBOX[ZNEX1(2),ZNEY1(2),ZNEX2(2),ZNEY2(2),0] End Proc Procedure _MOVE_DOWN_LEFT Screen TLB_NUMBER _DRAWBOX[ZNEX1(3),ZNEY1(3),ZNEX2(3),ZNEY2(3),-1] Screen SCR_NUMBER If MAG_ACTIVE While Mouse Key and 1 Dec MG_X : Inc MG_Y _TESTMAGZONES _DRAWGRID Wend Else While Mouse Key and 1 If SCR_X_OFFSET>0 Dec SCR_X_OFFSET End If If SCR_Y_OFFSET0 Dec SCR_Y_OFFSET End If Screen Offset SCR_NUMBER,SCR_X_OFFSET,SCR_Y_OFFSET Wend End If Screen TLB_NUMBER _DRAWBOX[ZNEX1(4),ZNEY1(4),ZNEX2(4),ZNEY2(4),0] End Proc Procedure _MOVE_DOWN Screen TLB_NUMBER _DRAWBOX[ZNEX1(6),ZNEY1(6),ZNEX2(6),ZNEY2(6),-1] Screen SCR_NUMBER If MAG_ACTIVE While Mouse Key and 1 Inc MG_Y _TESTMAGZONES _DRAWGRID Wend Else While Mouse Key and 1 If SCR_Y_OFFSET0 Dec SCR_Y_OFFSET End If Screen Offset SCR_NUMBER,SCR_X_OFFSET,SCR_Y_OFFSET Wend End If Screen TLB_NUMBER _DRAWBOX[ZNEX1(7),ZNEY1(7),ZNEX2(7),ZNEY2(7),0] End Proc Procedure _MOVE_RIGHT Screen TLB_NUMBER _DRAWBOX[ZNEX1(8),ZNEY1(8),ZNEX2(8),ZNEY2(8),-1] Screen SCR_NUMBER If MAG_ACTIVE While Mouse Key and 1 Inc MG_X _TESTMAGZONES _DRAWGRID Wend Else While Mouse Key and 1 If SCR_X_OFFSET"" Screen SCR_NUMBER Trap Save Iff F$ If Errtrap=0 CURFILE$=F$ End If End If End Proc Procedure _SAVE F$=CURFILE$ If F$<>"" Screen SCR_NUMBER Trap Save Iff F$ End If End Proc Procedure _LOAD[F$] If F$="" FILESELECTOR$["","","**","*.info",0] F$=Param$ End If If F$<>"" Auto View Off Trap Load Iff F$,SCR_NUMBER If Errtrap Auto View On Pop Proc Else _GETCOLS[F$] P=Param If P>0 SCR_COLOURS=P Else Auto View On Pop Proc End If End If ' Screen Open UNDO_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Screen UNDO_NUMBER Curs Off : Flash Off : Paper 0 : Cls Screen Hide UNDO_NUMBER ' CURFILE$=F$ Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front PAL_NUMBER Trap Screen To Front MAG_NUMBER Screen SCR_NUMBER If SCR_COLOURS<32 _MOUSECOLOURS End If Curs Off : Flash Off : Paper 0 View Auto View On SCR_WIDTH=Screen Width SCR_HEIGHT=Screen Height If PAL_ACTIVE Screen PAL_NUMBER Get Palette SCR_NUMBER If OPT_ACTIVE Screen SCR_NUMBER If FG_COL>32 and SCR_COLOURS=64 C=Colour(FG_COL-32) Else C=Colour(FG_COL) End If Screen OPT_NUMBER Colour 4,C Screen SCR_NUMBER If BG_COL>32 and SCR_COLOURS=64 C=Colour(BG_COL-32) Else C=Colour(BG_COL) End If Screen OPT_NUMBER Colour 5,C End If End If If MAG_ACTIVE Screen MAG_NUMBER Get Palette SCR_NUMBER _DRAWGRID End If If SCR_RES=Lowres SCR_X_OFFSET=0 : SCR_X_MAX=SCR_WIDTH-320 Else If SCR_RES=Hires SCR_X_OFFSET=0 : SCR_X_MAX=SCR_WIDTH-640 End If If SCR_LACED=Laced If PALMODE SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-512 Else SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-400 End If Else If PALMODE SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-256 Else SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-200 End If End If Screen TLB_NUMBER End If MSE_MXX=SCR_WIDTH-1 MSE_MXY=SCR_HEIGHT-1 End Proc Procedure _QUIT _DRAWBOX[ZNEX1(45),ZNEY1(45),ZNEX2(45),ZNEY2(45),-1] If(CURFILE$<>"") and CFG_LASTWORK=True Open Out 1,FILE$(18) Print #1,Dir$ Print #1,CURFILE$ Close 1 Else If Exist(FILE$(18)) Trap Kill FILE$(18) End If Erase All Edit End Proc Procedure _NEW Change Mouse 5 Auto View Off Trap Screen Close SCR_NUMBER Trap Screen Open SCR_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front PAL_NUMBER Trap Screen To Front MAG_NUMBER Screen SCR_NUMBER _MOUSECOLOURS _LOADPALETTE[FILE$(21)] Screen SCR_NUMBER Curs Off : Flash Off : Paper 0 : Cls View Auto View On If PAL_ACTIVE Screen PAL_NUMBER Get Palette SCR_NUMBER If OPT_ACTIVE Screen SCR_NUMBER If FG_COL>32 and SCR_COLOURS=64 C=Colour(FG_COL-32) Else C=Colour(FG_COL) End If Screen OPT_NUMBER Colour 4,C Screen SCR_NUMBER If BG_COL>32 and SCR_COLOURS=64 C=Colour(BG_COL-32) Else C=Colour(BG_COL) End If Screen OPT_NUMBER Colour 5,C End If End If If MAG_ACTIVE Screen MAG_NUMBER Get Palette SCR_NUMBER _DRAWGRID End If If SCR_RES=Lowres SCR_X_OFFSET=0 : SCR_X_MAX=SCR_WIDTH-320 Else If SCR_RES=Hires SCR_X_OFFSET=0 : SCR_X_MAX=SCR_WIDTH-640 End If If SCR_LACED=Laced If PALMODE SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-512 Else SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-400 End If Else If PALMODE SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-256 Else SCR_Y_OFFSET=0 : SCR_Y_MAX=SCR_HEIGHT-200 End If End If Screen TLB_NUMBER CURFILE$="" FULL_DISPLAY=True MSE_MXX=SCR_WIDTH-1 MSE_MXY=SCR_HEIGHT-1 Change Mouse 4 End Proc Procedure _GETCOLS[F$] Trap Open In 1,F$ If Errtrap Then Pop Proc[-1] ' A$=Input$(1,4) If A$<>"FORM" Then Pop Proc[-1] ' A$=Right$(Input$(1,8),4) If A$<>"ILBM" Then Pop Proc[-1] ' A$=Right$(Input$(1,17),1) Print A$ SCR_COLOURS=2^Asc(A$) Close 1 End Proc[SCR_COLOURS] Procedure _PRINT Change Mouse 5 _DRAWBOX[ZNEX1(40),ZNEY1(40),ZNEX2(40),ZNEY2(40),-1] Screen SCR_NUMBER Trap Printer Open Trap Printer Dump Trap Printer Close Change Mouse 5 Screen TLB_NUMBER _DRAWBOX[ZNEX1(40),ZNEY1(40),ZNEX2(40),ZNEY2(40),0] End Proc ' Procedure _BRUSH_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(48),ZNEY1(48),ZNEX2(48),ZNEY2(48),-1] If BRUSH_ACTIVE=False While Mouse Key : Wend _DRAWBOX[ZNEX1(48),ZNEY1(48),ZNEX2(48),ZNEY2(48),0] Pop Proc End If OPT_ACTIVE=True Unpack 10 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, _MOUSECOLOURS ' Reserve Zone 30 Dim X1(30),Y1(30),X2(30),Y2(30) S=Start(52) For Z=1 To 30 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next ' While Mouse Key : Wend ' Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=48 Exit End If Else If MS=OPT_NUMBER If MZ _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If MZ=1 BRUSH_X=BRUSH_WIDTH BRUSH_Y=BRUSH_HEIGHT Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Else If MZ=2 BRUSH_X=BRUSH_WIDTH/2 BRUSH_Y=BRUSH_HEIGHT/2 Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Else If MZ=5 _PLACEBRUSHHANDLE Else If MZ=6 : Rem Clockwise BRUSH_ROT[True] Else If MZ=7 : Rem Anti-Clockwise BRUSH_ROT[False] Else If MZ=8 : Rem X×2 BRUSH_SCALE[(BRUSH_WIDTH+1)*2,BRUSH_HEIGHT+1] Else If MZ=9 : Rem Y×2 BRUSH_SCALE[BRUSH_WIDTH+1,(BRUSH_HEIGHT+1)*2] Else If MZ=10 : Rem ×2 BRUSH_SCALE[(BRUSH_WIDTH+1)*2,(BRUSH_HEIGHT+1)*2] Else If MZ=11 : Rem X÷2 BRUSH_SCALE[(BRUSH_WIDTH+1)/2,BRUSH_HEIGHT+1] Else If MZ=12 : Rem Y÷2 BRUSH_SCALE[BRUSH_WIDTH+1,(BRUSH_HEIGHT+1)/2] Else If MZ=13 : Rem ÷2 BRUSH_SCALE[(BRUSH_WIDTH+1)/2,(BRUSH_HEIGHT+1)/2] Else If MZ=14 : Rem Set Size _SETBRUSHSIZE Else If MZ=17 : Rem Flip X BRUSH_BOB=Hrev(BRUSH_BOB) Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Else If MZ=18 : Rem Flip Y BRUSH_BOB=Vrev(BRUSH_BOB) Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Else If MZ=19 FILESELECTOR$["","","**","*.info",0] BRUSH_LOAD[Param$] Else If MZ=20 FILESELECTOR$["","","**","*.info",0] BRUSH_SAVE[Param$] Else If MZ>=21 and MZ<=25 F$=TMP_DIR$+"Brush"+Hex$(MZ-20) BRUSH_SAVE[F$] Else If MZ>=26 and MZ<=30 F$=TMP_DIR$+"Brush"+Hex$(MZ-25) BRUSH_LOAD[F$] End If While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False _DRAWBOX[ZNEX1(48),ZNEY1(48),ZNEX2(48),ZNEY2(48),0] End Proc Procedure _PLACEBRUSHHANDLE If BRUSH_ACTIVE If SCR_RES=Hires Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,640),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Else Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,320),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED End If Screen BLOCK_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER _MOUSECOLOURS Change Mouse 11 Limit Mouse X Hard(0),Y Hard(0) To X Hard(BRUSH_WIDTH),Y Hard(BRUSH_HEIGHT) Paste Bob 0,0,BRUSH_BOB While Mouse Key : Wend Repeat : Until Mouse Key While Mouse Key : Wend BRUSH_X=Min(X Screen(X Mouse),BRUSH_WIDTH) BRUSH_Y=Min(Y Screen(Y Mouse),BRUSH_HEIGHT) Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Screen Close BLOCK_NUMBER Screen SCR_NUMBER Limit Mouse 0,0 To 1000,1000 Screen OPT_NUMBER Change Mouse 4 End If End Proc Procedure _SETBRUSHSIZE If SCR_RES=Hires Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,640),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Screen Open EFCT_NUMBER,Max(BRUSH_WIDTH,640),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Else Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,320),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Screen Open EFCT_NUMBER,Max(BRUSH_WIDTH,320),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED End If ' Screen BLOCK_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB ' Screen EFCT_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB ' Screen To Front EFCT_NUMBER Screen EFCT_NUMBER Change Mouse 11 ' Ink 0 Do Exit If Mouse Key=2 While Mouse Key=1 X=X Screen(X Mouse) Y=Y Screen(Y Mouse) X=Max(1,X) : X=Min(Screen Width,X) Y=Max(1,Y) : Y=Min(Screen Height,Y) If X<>OX or Y<>OY Trap Bar 0,0 To OX,OY Zoom BLOCK_NUMBER,0,0,BRUSH_WIDTH,BRUSH_HEIGHT To EFCT_NUMBER,0,0,X,Y OX=X : OY=Y End If Wend Loop ' BRUSH_WIDTH=X BRUSH_HEIGHT=Y BRUSH_X=Min(BRUSH_X,BRUSH_WIDTH) BRUSH_Y=Min(BRUSH_Y,BRUSH_HEIGHT) Get Bob BRUSH_BOB,0,0 To BRUSH_WIDTH,BRUSH_HEIGHT Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Screen Close BLOCK_NUMBER Screen Close EFCT_NUMBER Limit Mouse 0,0 To 1000,1000 Screen OPT_NUMBER Change Mouse 4 End Proc ' Procedure _PREFERENCES If Chip Max Block<50*1024 Then Pop Proc T_CM=CIRCMODE _DRAWBOX[ZNEX1(44),ZNEY1(44),ZNEX2(44),ZNEY2(44),-1] OPT_ACTIVE=True Unpack 22 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Dim X1(55),X2(55),Y1(55),Y2(55),OPT(24),PREFSOPT(8) Dim PREFS_HLP$(16) Gosub SETPREFSHELP _MOUSECOLOURS Gosub _GETZONES _DRAW_OPT_BOX[X1(T_CM+4),Y1(T_CM+4),X2(T_CM+4),Y2(T_CM+4),1,3] ' Gosub _GET_OPTIONS Gosub _SHOW_OPTIONS While Mouse Key : Wend ' Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=44 CIRCMODE=T_CM Gosub _PUT_OPTIONS Exit End If Else If MS=OPT_NUMBER If MZ=1 : Rem cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] While Mouse Key : Wend : Exit Else If MZ=2 : Rem load _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] FL$=FILE$(17) Gosub _LOAD_OPTIONS Gosub _SHOW_OPTIONS While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=3 : Rem save _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] FL$=FILE$(17) Gosub _SAVE_OPTIONS While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=4 : Rem flipscreen _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Amos Unlock Amos To Back Repeat : Until Amos Here and(Mouse Key=0) _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ>=5 and MZ<=7 _DRAW_OPT_BOX[X1(T_CM+4),Y1(T_CM+4),X2(T_CM+4),Y2(T_CM+4),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_CM=MZ-4 While Mouse Key : Wend Else If MZ>=8 and MZ<=15 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _HELP[PREFS_HLP$(MZ-7)] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ>=32 and MZ<=39 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _HELP[PREFS_HLP$(MZ-23)] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If(MZ>=16 and MZ<=23) _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] PREFSOPT(MZ-15)=True _DRAW_OPT_BOX[X1(MZ+8),Y1(MZ+8),X2(MZ+8),Y2(MZ+8),3,1] While Mouse Key : Wend Else If(MZ>=24 and MZ<=31) _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] PREFSOPT(MZ-23)=False _DRAW_OPT_BOX[X1(MZ-8),Y1(MZ-8),X2(MZ-8),Y2(MZ-8),3,1] While Mouse Key : Wend Else If MZ>=40 and MZ<=47 If MZ-39<>T_SCR_OPT _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If T_SCR_OPT>0 _DRAW_OPT_BOX[X1(T_SCR_OPT+39),Y1(T_SCR_OPT+39),X2(T_SCR_OPT+39),Y2(T_SCR_OPT+39),3,1] End If For Z=48 To 55 If Z<>MZ+8 _DRAW_OPT_BOX[X1(Z),Y1(Z),X2(Z),Y2(Z),1,3] Else _DRAW_OPT_BOX[X1(Z),Y1(Z),X2(Z),Y2(Z),3,1] End If Next T_SCR_OPT=MZ-39 End If While Mouse Key : Wend Else If MZ=T_SCR_OPT+47 _DRAW_OPT_BOX[X1(T_SCR_OPT+39),Y1(T_SCR_OPT+39),X2(T_SCR_OPT+39),Y2(T_SCR_OPT+39),3,1] For Z=48 To 55 _DRAW_OPT_BOX[X1(Z),Y1(Z),X2(Z),Y2(Z),1,3] Next T_SCR_OPT=False End If End If Else If MK=4 If MS=OPT_NUMBER If MZ>=5 and MZ<=7 _HELP["circle"] Else If MZ>7 _HELP["preferences"] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False : Screen TLB_NUMBER _DRAWBOX[ZNEX1(44),ZNEY1(44),ZNEX2(44),ZNEY2(44),0] Pop Proc ' _GETZONES: Reserve Zone 55 S=Start(64) For Z=1 To 55 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next Return ' _GET_OPTIONS: PREFSOPT(1)=CFG_READFONTS PREFSOPT(2)=CFG_VIRUS PREFSOPT(3)=CFG_CLOSEWB PREFSOPT(4)=CFG_AMPRO PREFSOPT(5)=CFG_LASTWORK PREFSOPT(6)=CFG_LOGO PREFSOPT(7)=CFG_MUSIC PREFSOPT(8)=CFG_RAD T_SCR_OPT=SCR_OPT Return ' _PUT_OPTIONS: CFG_READFONTS=PREFSOPT(1) CFG_VIRUS=PREFSOPT(2) CFG_CLOSEWB=PREFSOPT(3) CFG_AMPRO=PREFSOPT(4) CFG_LASTWORK=PREFSOPT(5) CFG_LOGO=PREFSOPT(6) CFG_MUSIC=PREFSOPT(7) CFG_RAD=PREFSOPT(8) SCR_OPT=T_SCR_OPT Return ' _SAVE_OPTIONS: Trap Reserve As Data 4096,40 If Errtrap=0 S=Start(4096) For C=1 To 8 Loke(S+((C-1)*4)),PREFSOPT(C) Next Loke(S+32),T_CM Loke(S+36),T_SCR_OPT Save FL$,4096 Erase 4096 End If Return ' _LOAD_OPTIONS: Trap Load FL$,4096 If Errtrap=0 S=Start(4096) For C=1 To 8 PREFSOPT(C)=Leek(S+((C-1)*4)) Next T_CM=Leek(S+32) T_SCR_OPT=Leek(S+32) Erase 4096 End If Return ' _SHOW_OPTIONS: For Z=48 To 55 If Z<>T_SCR_OPT+47 _DRAW_OPT_BOX[X1(Z),Y1(Z),X2(Z),Y2(Z),1,3] _DRAW_OPT_BOX[X1(Z-8),Y1(Z-8),X2(Z-8),Y2(Z-8),3,1] Else _DRAW_OPT_BOX[X1(Z),Y1(Z),X2(Z),Y2(Z),3,1] _DRAW_OPT_BOX[X1(Z-8),Y1(Z-8),X2(Z-8),Y2(Z-8),1,3] End If Next For Z=1 To 8 If PREFSOPT(Z) _DRAW_OPT_BOX[X1(Z+15),Y1(Z+15),X2(Z+15),Y2(Z+15),1,3] _DRAW_OPT_BOX[X1(Z+23),Y1(Z+23),X2(Z+23),Y2(Z+23),3,1] Else _DRAW_OPT_BOX[X1(Z+23),Y1(Z+23),X2(Z+23),Y2(Z+23),1,3] _DRAW_OPT_BOX[X1(Z+15),Y1(Z+15),X2(Z+15),Y2(Z+15),3,1] End If Next Return ' SETPREFSHELP: Restore HELPNAMES For C1=1 To 16 Read PREFS_HLP$(C1) Next Return ' HELPNAMES: Data "Fonts","Virus" Data "Workbench","Configuration" Data "LastPic","Logo" Data "StartMusic","Rad" Data "","" Data "","" Data "","" Data "","" End Proc Procedure _CLIPART_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(51),ZNEY1(51),ZNEX2(51),ZNEY2(51),-1] OPT_ACTIVE=True Unpack 12 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, MXZ=19 Dim X1(MXZ),Y1(MXZ),X2(MXZ),Y2(MXZ) Gosub _GETZONES X1=X1(CLP_MODE+10) : Y1=Y1(CLP_MODE+10) : X2=X2(CLP_MODE+10) Y2=Y2(CLP_MODE+10) : N1=2 : N2=4 Gosub DRW_BOX X1=X1(CLP_GRF+12) : Y1=Y1(CLP_GRF+12) : X2=X2(CLP_GRF+12) : Y2=Y2(CLP_GRF+12) Gosub DRW_BOX ' N=CLP_NUM Gosub _LOAD Gosub SHW While Mouse Key : Wend Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=51 Exit End If Else If MS=OPT_NUMBER If MZ>=1 and MZ<=4 X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX If MZ=1 I$=Chr$(29) : SS=0 Else If MZ=2 I$=Chr$(28) : SS=0 Else If MZ=3 I$=Chr$(29) : SS=1 Else If MZ=4 I$=Chr$(28) : SS=1 End If While Mouse Key : Wend N1=4 : N2=2 Gosub DRW_BOX Else If MZ=5 or MZ=6 : Rem Read disk X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX While Mouse Key : Wend If MZ=6 If Exist("DF0:") Trap CLP_DIR$=Dr Name$("DF0:") End If End If Gosub _LOAD N1=4 : N2=2 Gosub DRW_BOX Else If MZ=7 : Rem cancel X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX While Mouse Key : Wend Exit Else If MZ=8 : Rem OK If CLP_MODE=0 X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX CLP_NUM=N Get Bob CLP_NUMBER,BRUSH_BOB,160*(N and 1),50*(N and 2) To 160*(N and 1)+159,50*(N and 2)+99 BRUSH_ACTIVE=True BRUSH_WIDTH=160 BRUSH_HEIGHT=100 BRUSH_X=0 BRUSH_Y=0 While Mouse Key : Wend Exit Else If CLP_MODE=1 X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX Exit End If Else If MZ=9 X1=X1(MZ) : Y1=Y1(MZ) : X2=X2(MZ) : Y2=Y2(MZ) : N1=2 : N2=4 Gosub DRW_BOX FILESELECTOR$["","","**","*.info",0] F$=Param$ GRAPH_LOADDATA[F$] Screen OPT_NUMBER N1=4 : N2=2 Gosub DRW_BOX Else If MZ>=10 and MZ<=11 X1=X1(CLP_MODE+10) : Y1=Y1(CLP_MODE+10) : X2=X2(CLP_MODE+10) Y2=Y2(CLP_MODE+10) : N1=4 : N2=2 Gosub DRW_BOX CLP_MODE=MZ-10 X1=X1(CLP_MODE+10) : Y1=Y1(CLP_MODE+10) : X2=X2(CLP_MODE+10) Y2=Y2(CLP_MODE+10) : N1=2 : N2=4 Gosub DRW_BOX While Mouse Key : Wend Else If MZ>=12 and MZ<=19 X1=X1(CLP_GRF+12) : Y1=Y1(CLP_GRF+12) : X2=X2(CLP_GRF+12) Y2=Y2(CLP_GRF+12) : N1=4 : N2=2 Gosub DRW_BOX CLP_GRF=MZ-12 X1=X1(CLP_GRF+12) : Y1=Y1(CLP_GRF+12) : X2=X2(CLP_GRF+12) Y2=Y2(CLP_GRF+12) : N1=2 : N2=4 Gosub DRW_BOX While Mouse Key : Wend End If End If End If If I$=Chr$(29) : Rem left If N>CLP_MIN If SS and %11 N=CLP_MIN Else Dec N End If If(N and 1020)<>(OLDN and 1020) Gosub _LOAD End If Gosub SHW OLDN=N End If Else If I$=Chr$(28) : Rem right If N(OLDN and 1020) Gosub _LOAD End If Gosub SHW OLDN=N End If End If Loop ' QUIT: Auto View On Trap Screen Close CLP_NUMBER Trap Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(51),ZNEY1(51),ZNEX2(51),ZNEY2(51),0] _DRAWBOX[ZNEX1(41),ZNEY1(41),ZNEX2(41),ZNEY2(41),BRUSH_ACTIVE] If CLP_MODE=1 and MK=1 and MZ=8 Screen SCR_NUMBER GRAPH_SETSIZE On CLP_GRF+1 Proc GRAPH_BARLAYERED,GRAPH_LINE,GRAPH_PIE,GRAPH_3DLINE,GRAPH_3DBAR,GRAPH_LAYERED,GRAPH_3DPIE,GRAPH_3DSLOPEDBAR End If Pop Proc ' _GETZONES: Reserve Zone MXZ S=Start(54) For Z=1 To MXZ X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next Return ' DRW_BOX: Ink N1 Draw X1,Y1 To X2,Y1 Draw X1,Y1 To X1,Y2 Ink N2 Draw X1,Y2 To X2,Y2 Draw X2,Y1 To X2,Y2 Return ' SHW: Screen CLP_NUMBER Get Block 2,160*(N and 1),50*(N and 2),160,100 Screen OPT_NUMBER Put Block 2,4,4 Return ' GPAL: For C1=0 To 15 Screen CLP_NUMBER CL=Colour(C1) Screen OPT_NUMBER Colour C1+16,CL Next Return ' _LOAD: Auto View Off Trap Load Iff CLP_DIR$+"Gfx/Clip_"+Hex$((N and 1020)/4),CLP_NUMBER If Errtrap Pop Goto QUIT Else Trap Screen Hide CLP_NUMBER Auto View On Trap Screen OPT_NUMBER Gosub GPAL End If Return End Proc Procedure _SETFONT If Chip Max Block<50*1024 Then Pop Proc If MAG_ACTIVE Pop Proc End If FONT_ACTIVE=True _SET_FONT_REQ_SCREEN _FONT_REQ_MESSAGE["Checking Font List."] If Not(Exist(FILE$(52))) _READ_FONT_DIR End If Do If Exist(FILE$(52)) _GET_FONTS_FILE P=Param If P>=0 If P>0 SCRFONT=P End If Exit Else FONTS=-P _SET_FONT_REQ_SCREEN _FONT_REQ_MESSAGE["Checking Font List."] _READ_FONT_DIR End If Else Exit End If Loop Trap Screen Close FSEL_NUMBER FONT_ACTIVE=False Screen TLB_NUMBER End Proc Procedure _SCREENFORMAT If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(15),ZNEY1(15),ZNEX2(15),ZNEY2(15),-1] OPT_ACTIVE=True Unpack 13 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER Reserve Zone 24 _MOUSECOLOURS Dim X1(24),X2(24),Y1(24),Y2(24) Reserve Zone 24 S=Start(55) For Z=1 To 24 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next ' Wind Open 1,224,57,6,1 Wind Open 2,224,68,6,1 Dim NUM$(2) 'HWNUM=1 or 2. If 1 edit height [num$(1)], else if 2, edit width HWNUM=1 ' Gosub RESTOR ' While Mouse Key : Wend Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=15 Exit End If Else If MS=OPT_NUMBER If MZ>=1 and MZ<=7 _DRAW_OPT_BOX[X1(CLZONE),Y1(CLZONE),X2(CLZONE),Y2(CLZONE),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] CLZONE=MZ While Mouse Key : Wend If T_SCR_RES=Hires Gosub HIGHRESCOLOUR End If Else If MZ=8 : Rem max _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_SCR_WIDTH=1000 T_SCR_HEIGHT=1000 Gosub HWUPDATE While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=9 : Rem min _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If T_SCR_RES=Lowres T_SCR_WIDTH=320 Else If T_SCR_RES=Hires T_SCR_WIDTH=640 End If T_SCR_HEIGHT=8 Gosub HWUPDATE While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=10 : Rem standard _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If T_SCR_RES=Lowres T_SCR_WIDTH=320 Else If T_SCR_RES=Hires T_SCR_WIDTH=640 End If If T_SCR_LACED=Laced If T_PALMODE T_SCR_HEIGHT=512 Else T_SCR_HEIGHT=400 End If Else If T_PALMODE T_SCR_HEIGHT=256 Else T_SCR_HEIGHT=200 End If End If Gosub HWUPDATE While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=11 : Rem overscan _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If T_SCR_RES=Lowres T_SCR_WIDTH=350 Else If T_SCR_RES=Hires T_SCR_WIDTH=720 End If If T_SCR_LACED=Laced If T_PALMODE T_SCR_HEIGHT=552 Else T_SCR_HEIGHT=440 End If Else If T_PALMODE T_SCR_HEIGHT=276 Else T_SCR_HEIGHT=220 End If End If Gosub HWUPDATE While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=12 : Rem height HWNUM=1 Gosub SETNUM Else If MZ=13 : Rem width HWNUM=2 Gosub SETNUM Else If MZ=14 : Rem Lores _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_SCR_RES=Lowres T_SCR_LACED=0 RESZ=MZ T_SCR_WIDTH=Max(T_SCR_WIDTH,320) If T_PALMODE T_SCR_HEIGHT=Max(T_SCR_HEIGHT,256) Else T_SCR_HEIGHT=Max(T_SCR_HEIGHT,200) End If Gosub HWUPDATE While Mouse Key : Wend Else If MZ=15 : Rem hires _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_SCR_RES=Hires T_SCR_LACED=0 RESZ=MZ T_SCR_WIDTH=Max(T_SCR_WIDTH,640) If T_PALMODE T_SCR_HEIGHT=Max(T_SCR_HEIGHT,256) Else T_SCR_HEIGHT=Max(T_SCR_HEIGHT,200) End If Gosub HWUPDATE Gosub HIGHRESCOLOUR While Mouse Key : Wend Else If MZ=16 : Rem lores laced _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_SCR_RES=Lowres T_SCR_LACED=Laced RESZ=MZ T_SCR_WIDTH=Max(T_SCR_WIDTH,320) If T_PALMODE T_SCR_HEIGHT=Max(T_SCR_HEIGHT,512) Else T_SCR_HEIGHT=Max(T_SCR_HEIGHT,400) End If Gosub HWUPDATE While Mouse Key : Wend Else If MZ=17 : Rem hires_laced _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] T_SCR_RES=Hires T_SCR_LACED=Laced RESZ=MZ T_SCR_WIDTH=Max(T_SCR_WIDTH,640) If T_PALMODE T_SCR_HEIGHT=Max(T_SCR_HEIGHT,512) Else T_SCR_HEIGHT=Max(T_SCR_HEIGHT,400) End If Gosub HWUPDATE Gosub HIGHRESCOLOUR While Mouse Key : Wend Else If MZ=18 : Rem ntsc _DRAW_OPT_BOX[X1(19),Y1(19),X2(19),Y2(19),3,1] _DRAW_OPT_BOX[X1(18),Y1(18),X2(18),Y2(18),1,3] T_PALMODE=False While Mouse Key : Wend Else If MZ=19 : Rem pal _DRAW_OPT_BOX[X1(19),Y1(19),X2(19),Y2(19),1,3] _DRAW_OPT_BOX[X1(18),Y1(18),X2(18),Y2(18),3,1] T_PALMODE=True While Mouse Key : Wend Else If MZ=20 : Rem reset _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub RESTOR While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=21 : Rem OK _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SCR_COLOURS=CLOURVALUE(CLZONE) SCR_RES=T_SCR_RES SCR_LACED=T_SCR_LACED SCR_WIDTH=T_SCR_WIDTH SCR_HEIGHT=T_SCR_HEIGHT PALMODE=T_PALMODE Screen Open UNDO_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Screen UNDO_NUMBER Curs Off : Flash Off : Paper 0 : Cls Screen Hide UNDO_NUMBER _NEW Exit Else If MZ=22 : Rem Cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub RESTOR Exit Else If MZ=23 : Rem Grab WB _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SCR_WIDTH=640 SCR_HEIGHT=256 SCR_PALMODE= Not(Ntsc) SCR_COLOURS=4 SCR_LACED=False SCR_RES=Hires While Mouse Key : Wend Screen Open UNDO_NUMBER,SCR_WIDTH,SCR_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Screen UNDO_NUMBER Curs Off : Flash Off : Paper 0 : Cls Screen Hide UNDO_NUMBER _NEW Exit Else If MZ=24 : Rem flip to WB _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] While Mouse Key : Wend Amos To Back _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(15),ZNEY1(15),ZNEX2(15),ZNEY2(15),0] Pop Proc ' RESTOR: _DRAW_OPT_BOX[X1(CLZONE),Y1(CLZONE),X2(CLZONE),Y2(CLZONE),3,1] If SCR_COLOURS=2 Then CLZONE=1 If SCR_COLOURS=4 Then CLZONE=2 If SCR_COLOURS=8 Then CLZONE=3 If SCR_COLOURS=16 Then CLZONE=4 If SCR_COLOURS=32 Then CLZONE=5 If SCR_COLOURS=64 Then CLZONE=6 If SCR_COLOURS=4096 Then CLZONE=7 _DRAW_OPT_BOX[X1(CLZONE),Y1(CLZONE),X2(CLZONE),Y2(CLZONE),1,3] T_PALMODE=PALMODE If T_PALMODE _DRAW_OPT_BOX[X1(18),Y1(18),X2(18),Y2(18),3,1] _DRAW_OPT_BOX[X1(19),Y1(19),X2(19),Y2(19),1,3] Else _DRAW_OPT_BOX[X1(19),Y1(19),X2(19),Y2(19),3,1] _DRAW_OPT_BOX[X1(18),Y1(18),X2(18),Y2(18),1,3] End If _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),3,1] T_SCR_WIDTH=SCR_WIDTH T_SCR_HEIGHT=SCR_HEIGHT Gosub HWUPDATE T_SCR_RES=SCR_RES If T_SCR_RES=Hires If T_SCR_LACED RESZ=17 Else RESZ=15 End If Else If T_SCR_LACED RESZ=16 Else RESZ=14 End If End If _DRAW_OPT_BOX[X1(RESZ),Y1(RESZ),X2(RESZ),Y2(RESZ),1,3] Return ' HIGHRESCOLOUR: If CLZONE>4 _DRAW_OPT_BOX[X1(CLZONE),Y1(CLZONE),X2(CLZONE),Y2(CLZONE),3,1] CLZONE=4 _DRAW_OPT_BOX[X1(CLZONE),Y1(CLZONE),X2(CLZONE),Y2(CLZONE),1,3] End If Return ' HWUPDATE: Window 1 : Pen 0 : Paper 2 : Clw Print At(0,0)+Str$(T_SCR_HEIGHT)-" "; Window 2 : Pen 0 : Paper 2 : Clw Print At(0,0)+Str$(T_SCR_WIDTH)-" "; Window 0 Return ' SETNUM: NUM$(1)=Str$(T_SCR_HEIGHT)-" " NUM$(2)=Str$(T_SCR_WIDTH)-" " Window HWNUM NP=Len(NUM$(HWNUM)) Do I$=Inkey$ S=Scancode SS=Scanshift If Mouse Key=1 If Mouse Zone<>MZ Exit Else X=X Text(X Screen(X Mouse)) If X>=0 and X<=Len(NUM$(HWNUM)) NP=X Locate 0+NP,0 End If End If End If If S If I$=Chr$(27) Exit Else If I$=Chr$(13) Exit Else If I$>="0" and I$<="9" If Len(NUM$(HWNUM))<4 NUM$(HWNUM)=Left$(NUM$(HWNUM),NP)+I$+Right$(NUM$(HWNUM),Len(NUM$(HWNUM))-NP) Inc NP End If Else If I$=Chr$(29) : Rem left If NP>0 If SS and %11 NP=0 Else Dec NP End If End If Else If I$=Chr$(28) : Rem right If NP0 If SS and %11 NUM$(HWNUM)=Right$(NUM$(HWNUM),Len(NUM$(HWNUM))-NP) NP=0 Else NUM$(HWNUM)=Left$(NUM$(HWNUM),NP-1)+Right$(NUM$(HWNUM),Len(NUM$(HWNUM))-NP) Dec NP End If End If Else If S=70 If NP"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift MX=X Screen(X Mouse) MY=Y Screen(Y Mouse) Trap Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=47 While Mouse Key : Wend Screen Close OPT_NUMBER OPT_ACTIVE=False Exit End If Else If MS=OPT_NUMBER If MZ>=1 and MZ<=6 Gosub SETNUM Else If MZ=7 _DRAW_OPT_BOX[X1(7),Y1(7),X2(7),Y2(7),1,3] _DRAW_OPT_BOX[X1(8),Y1(8),X2(8),Y2(8),3,1] FR_MAND=True : While Mouse Key : Wend Else If MZ=8 _DRAW_OPT_BOX[X1(7),Y1(7),X2(7),Y2(7),3,1] _DRAW_OPT_BOX[X1(8),Y1(8),X2(8),Y2(8),1,3] FR_MAND=True : While Mouse Key : Wend Else If MZ=11 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] While Mouse Key : Wend Screen Close OPT_NUMBER OPT_ACTIVE=False _MAKEFRACT Exit Else If MZ=12 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] While Mouse Key : Wend Screen Close OPT_NUMBER OPT_ACTIVE=False Exit End If End If End If Loop ' Screen TLB_NUMBER _DRAWBOX[ZNEX1(47),ZNEY1(47),ZNEX2(47),ZNEY2(47),0] Pop Proc ' INITNUM: NUM$(1)=Str$(FR_STEPX)-" " NUM$(2)=Str$(FR_STEPY)-" " NUM$(3)=Str$(FR_POSX)-" " NUM$(4)=Str$(FR_POSY)-" " NUM$(5)=Str$(FR_CR)-" " NUM$(6)=Str$(FR_CI)-" " Return ' SETNUM: Gosub INITNUM Window MZ NP=Len(NUM$(MZ)) Do I$=Inkey$ S=Scancode SS=Scanshift If Mouse Key=1 If Mouse Zone<>MZ Exit Else X=X Text(X Screen(X Mouse)) If X>=0 and X<=Len(NUM$(MZ)) NP=X Locate NP,0 End If End If End If If S If I$=Chr$(27) Exit Else If I$=Chr$(13) Exit Else If I$>="0" and I$<="9" or I$="-" If Len(NUM$(MZ))0 If SS and %11 NP=0 Else Dec NP End If End If Else If I$=Chr$(28) : Rem right If NP0 If SS and %11 NUM$(MZ)=Right$(NUM$(MZ),Len(NUM$(MZ))-NP) NP=0 Else NUM$(MZ)=Left$(NUM$(MZ),NP-1)+Right$(NUM$(MZ),Len(NUM$(MZ))-NP) Dec NP End If End If Else If S=70 If NP32 and SCR_COLOURS=64 C=Colour(FG_COL-32) Else C=Colour(FG_COL) End If Screen OPT_NUMBER Colour 4,C Screen PAL_NUMBER If BG_COL>32 and SCR_COLOURS=64 C=Colour(BG_COL-32) Else C=Colour(BG_COL) End If If SCR_COLOURS<16 _MOUSECOLOURS End If Screen OPT_NUMBER Colour 5,C MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS _MOUSECOLOURS End Proc Procedure _DRAWPALETTEBOX If SCR_COLOURS=4096 Screen Open PAL_NUMBER,320,24,16,Lowres Screen Display PAL_NUMBER,,PAL_POSITION,, PAL_ACTIVE=True Screen PAL_NUMBER Reserve Zone 16 Curs Off : Flash Off W=40 For X=0 To 7 Ink X : Bar X*W,0 To X*W+W-1,11 Set Zone X+1,X*W,0 To X*W+W-1,11 Ink X+8 : Bar X*W,12 To X*W+W-1,23 Set Zone X+9,X*W,12 To(X*W)+W-1,23 Next Get Palette SCR_NUMBER _MOUSECOLOURS Else If SCR_COLOURS=2 Screen Open PAL_NUMBER,320,24,SCR_COLOURS,Lowres Screen Display PAL_NUMBER,,PAL_POSITION,, PAL_ACTIVE=True Screen PAL_NUMBER Reserve Zone 2 Curs Off : Flash Off Ink 0 : Bar 0,0 To 159,23 Set Zone 1,0,0 To 159,23 Ink 1 : Bar 160,0 To 319,23 Set Zone 2,160,0 To 319,23 Get Palette SCR_NUMBER Else Screen Open PAL_NUMBER,320,24,SCR_COLOURS,Lowres Screen Display PAL_NUMBER,,PAL_POSITION,, PAL_ACTIVE=True Screen PAL_NUMBER Reserve Zone SCR_COLOURS Curs Off : Flash Off W=(64/SCR_COLOURS)*10 For X=0 To(SCR_COLOURS/2)-1 Ink X : Bar X*W,0 To X*W+W-1,11 Set Zone X+1,X*W,0 To X*W+W-1,11 Ink X+(SCR_COLOURS/2) : Bar X*W,12 To X*W+W-1,23 Set Zone X+(SCR_COLOURS/2)+1,X*W,12 To(X*W)+W-1,23 Next Get Palette SCR_NUMBER End If End Proc Procedure _TESTPALETTE[MZ,MS,MK] Dim X1(21),Y1(21),X2(21),Y2(21) For Y=1 To 3 X1(Y)=0 : X2(Y)=255 Y1(Y)=(Y-1)*11 Y2(Y)=Y1(Y)+10 For X=1 To 6 SZ=(X*3)+Y X1(SZ)=X*64+192 Y1(SZ)=Y1(Y) X2(SZ)=X*64+255 Y2(SZ)=Y2(Y) Next Next If MK=1 and MS=OPT_NUMBER If MZ=1 TEST_H_SLIDER[PALSLIDERS(MZ)] Screen PAL_NUMBER Colour FG_COL,((Param-1)*256)+(Colour(FG_COL) mod 256) Screen SCR_NUMBER Colour FG_COL,((Param-1)*256)+(Colour(FG_COL) mod 256) Screen OPT_NUMBER Colour 4,((Param-1)*256)+(Colour(4) mod 256) If FG_COL=BG_COL Colour 5,((Param-1)*256)+(Colour(5) mod 256) End If _PUT_RGB_NUMBERS Else If MZ=2 TEST_H_SLIDER[PALSLIDERS(MZ)] Screen PAL_NUMBER Colour FG_COL,(Colour(FG_COL)/256*256)+((Param-1)*16)+(Colour(FG_COL) mod 16) Screen SCR_NUMBER Colour FG_COL,(Colour(FG_COL)/256*256)+((Param-1)*16)+(Colour(FG_COL) mod 16) Screen OPT_NUMBER Colour 4,(Colour(4)/256*256)+((Param-1)*16)+(Colour(4) mod 16) If FG_COL=BG_COL Colour 5,(Colour(5)/256*256)+((Param-1)*16)+(Colour(5) mod 16) End If _PUT_RGB_NUMBERS Else If MZ=3 TEST_H_SLIDER[PALSLIDERS(MZ)] Screen PAL_NUMBER Colour FG_COL,(Colour(FG_COL)/16*16)+Param-1 Screen SCR_NUMBER Colour FG_COL,(Colour(FG_COL)/16*16)+Param-1 Screen OPT_NUMBER Colour 4,(Colour(4)/16*16)+Param-1 If FG_COL=BG_COL Colour 5,(Colour(5)/16*16)+Param-1 End If _PUT_RGB_NUMBERS Else If MZ=9 : Rem pick Change Mouse 6 Screen SCR_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key FG_COL=Point(X Screen(X Mouse),Y Screen(Y Mouse)) C=Colour(FG_COL) Screen OPT_NUMBER Colour 4,C For A=1 To 3 Erase PALSLIDERS(A) Next MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS Change Mouse 4 Else If MZ>6 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If MZ=7 : Rem OK Trap Screen Close PAL_NUMBER Trap Screen Close OPT_NUMBER PAL_ACTIVE=False OPT_ACTIVE=False For Z=1 To 3 Trap Erase PALSLIDERS(Z) Next Pop Proc Else If MZ=8 : Rem Cancel _LOADPALETTE["Clips:255"] Trap Screen Close PAL_NUMBER Trap Screen Close OPT_NUMBER PAL_ACTIVE=False OPT_ACTIVE=False For Z=1 To 3 Trap Erase PALSLIDERS(Z) Next Pop Proc Else If MZ=10 : Rem Reset _LOADPALETTE["Clips:255"] While Mouse Key : Wend Else If MZ=11 : Rem Load FILESELECTOR$["","","**","*.info",0] F$=Param$ If F$<>"" _LOADPALETTE[F$] End If Else If MZ=12 : Rem Save FILESELECTOR$["","","**","*.info",0] F$=Param$ _SAVEPALETTE[F$] Else If MZ=13 : Rem Save default _SAVEPALETTE[CFG_DIR$+"Default_Palette"] While Mouse Key : Wend Else If MZ=14 : Rem Load Iff FILESELECTOR$["","","**","*.info",0] F$=Param$ If F$<>"" _LOADIFFPALETTE[F$] End If Else If MZ=15 : Rem Save iff FILESELECTOR$["","","**","*.info",0] F$=Param$ _SAVEIFFPALETTE[F$] Else If MZ=16 : Rem No editor Screen Close OPT_NUMBER Screen Display PAL_NUMBER,,OPT_POSITION,, PAL_NOEDIT=True OPT_ACTIVE=False For Z=1 To 3 Trap Erase PALSLIDERS(Z) Next While Mouse Key : Wend Else If MZ=17 : Rem Default _LOADPALETTE[CFG_DIR$+"Default_Palette"] While Mouse Key : Wend Else If MZ=18 : Rem Spread Change Mouse 10 Screen PAL_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key MZ1=Mouse Zone-1 If MZ1>=0 While Mouse Key : Wend Change Mouse 8 Repeat : Until Mouse Key MZ2=Mouse Zone-1 If MZ2>=0 _SPREADPALETTE[MZ1,MZ2] Screen SCR_NUMBER Get Palette PAL_NUMBER While Mouse Key : Wend If FG_COL>32 and SCR_COLOURS=64 C1=Colour(FG_COL-32) Else C1=Colour(FG_COL) End If If BG_COL>32 and SCR_COLOURS=64 C2=Colour(BG_COL-32) Else C2=Colour(BG_COL) End If Screen OPT_NUMBER Colour 4,C1 Colour 5,C2 End If Change Mouse 4 End If For A=1 To 3 Erase PALSLIDERS(A) Next Screen OPT_NUMBER MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS Else If MZ=19 : Rem Copy to.. Change Mouse 7 Screen PAL_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key MZ1=Mouse Zone-1 While Mouse Key : Wend Change Mouse 8 Repeat : Until Mouse Key MZ2=Mouse Zone-1 Colour MZ2,Colour(MZ1) Screen SCR_NUMBER Colour MZ2,Colour(MZ1) While Mouse Key : Wend If MZ2=FG_COL or MZ2=BG_COL If FG_COL>32 and SCR_COLOURS=64 C1=Colour(FG_COL-32) Else C1=Colour(FG_COL) End If If BG_COL>32 and SCR_COLOURS=64 C2=Colour(BG_COL-32) Else C2=Colour(BG_COL) End If Screen OPT_NUMBER Colour 4,C1 Colour 5,C2 For A=1 To 3 Erase PALSLIDERS(A) Next MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS End If Change Mouse 4 Else If MZ=20 : Rem Swap Change Mouse 9 Screen PAL_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key MZ1=Mouse Zone-1 If MZ1>=0 While Mouse Key : Wend Change Mouse 8 Repeat : Until Mouse Key MZ2=Mouse Zone-1 If MZ2>=0 Screen SCR_NUMBER C1=Colour(MZ1) C2=Colour(MZ2) Colour MZ1,C2 Colour MZ2,C1 Screen PAL_NUMBER Colour MZ1,C2 Colour MZ2,C1 While Mouse Key : Wend If MZ2=FG_COL or MZ2=BG_COL or MZ1=FG_COL or MZ1=BG_COL If FG_COL>32 and SCR_COLOURS=64 C1=Colour(FG_COL-32) Else C1=Colour(FG_COL) End If If BG_COL>32 and SCR_COLOURS=64 C2=Colour(BG_COL-32) Else C2=Colour(BG_COL) End If Screen OPT_NUMBER Colour 4,C1 Colour 5,C2 For A=1 To 3 Erase PALSLIDERS(A) Next MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS End If End If Change Mouse 4 End If Else If MZ=21 : Rem Grab WB If SCR_COLOURS>=4 Reserve As Work TMP_BANK,200 Wb Prefs Start(TMP_BANK),200 For I=0 To 3 Screen PAL_NUMBER Colour I,Deek(Start(TMP_BANK)+110+I*2) Screen SCR_NUMBER Colour I,Deek(Start(TMP_BANK)+110+I*2) Next Erase TMP_BANK Screen SCR_NUMBER If FG_COL>32 and SCR_COLOURS=64 C=Colour(FG_COL-32) Else C=Colour(FG_COL) End If Screen OPT_NUMBER Colour 4,C Screen SCR_NUMBER If BG_COL>32 and SCR_COLOURS=64 C=Colour(BG_COL-32) Else C=Colour(BG_COL) End If Screen OPT_NUMBER Colour 5,C For A=1 To 3 Erase PALSLIDERS(A) Next MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS End If End If If PAL_NOEDIT=False Screen OPT_NUMBER _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] End If End If If MAG_ACTIVE Screen MAG_NUMBER Get Palette SCR_NUMBER End If Else If MK=2 and MS=OPT_NUMBER and MZ=9 Change Mouse 6 Screen SCR_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key BG_COL=Point(X Screen(X Mouse),Y Screen(Y Mouse)) C=Colour(BG_COL) Screen OPT_NUMBER Colour 5,C Change Mouse 4 Else If MS=PAL_NUMBER If MK=1 Screen PAL_NUMBER FG_COL=MZ-1 If FG_COL>4096 and SCR_COLOURS=4096 FG_COL=FG_COL-4096 End If If FG_COL>32 and SCR_COLOURS=64 C=Colour(FG_COL-32) Else C=Colour(FG_COL) End If If PAL_NOEDIT=False Screen OPT_NUMBER Colour 4,C For A=1 To 3 Erase PALSLIDERS(A) Next MAKE_H_SLIDER[1,X1(1)+1,Y1(1)+1,X2(1)-1,Y2(1)-1,16,Colour(4)/256,3,1] PALSLIDERS(1)=Param MAKE_H_SLIDER[2,X1(2)+1,Y1(2)+1,X2(2)-1,Y2(2)-1,16,(Colour(4) mod 256)/16,3,1] PALSLIDERS(2)=Param MAKE_H_SLIDER[3,X1(3)+1,Y1(3)+1,X2(3)-1,Y2(3)-1,16,Colour(4) mod 16,3,1] PALSLIDERS(3)=Param _PUT_RGB_NUMBERS End If Else If MK=2 Screen PAL_NUMBER BG_COL=MZ-1 If BG_COL>4096 and SCR_COLOURS=4096 BG_COL=BG_COL-4096 End If If BG_COL>32 and SCR_COLOURS=64 C=Colour(BG_COL-32) Else C=Colour(BG_COL) End If If PAL_NOEDIT=False Screen OPT_NUMBER Colour 5,C End If End If End If End Proc Procedure _PUT_RGB_NUMBERS Ink 0,2 Text 280,8,Hex$(Colour(4)/256) Text 280,19,Hex$((Colour(4) mod 256)/16) Text 280,30,Hex$(Colour(4) mod 16) End Proc Procedure _PATTERN_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(46),ZNEY1(46),ZNEX2(46),ZNEY2(46),-1] OPT_ACTIVE=True Unpack 21 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, _MOUSECOLOURS Dim X1(56),Y1(56),X2(56),Y2(56) Reserve Zone 56 S=Start(63) For Z=1 To 56 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next For A=0 To 15 T_FLAG=Btst(15-A,PAT_LINE) T_ZNE=A+5 Gosub _DRAWBOX Next For Y=0 To 3 For X=0 To 8 Z=Y*9+X+21 If PAT_FILL=Z-21 Ink 5 : Box X1(Z),Y1(Z) To X2(Z),Y2(Z) End If Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next Next ' T_FILL=PAT_FILL T_LINE=PAT_LINE ' While Mouse Key : Wend ' Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS MZ=Mouse Zone MX=X Screen(X Mouse) MY=Y Screen(Y Mouse) If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=46 Exit End If Else If MS=OPT_NUMBER If MZ=1 : Rem cancel T_FLAG=True : T_ZNE=MZ : Gosub _DRAWBOX While Mouse Key : Wend T_FLAG=False : T_ZNE=MZ : Gosub _DRAWBOX PAT_FILL=T_FILL PAT_LINE=T_LINE Exit Else If MZ=2 : Rem ok T_FLAG=True : T_ZNE=MZ : Gosub _DRAWBOX While Mouse Key : Wend T_FLAG=False : T_ZNE=MZ : Gosub _DRAWBOX Exit Else If MZ=3 : Rem save T_FLAG=True : T_ZNE=MZ : Gosub _DRAWBOX Trap Reserve As Data 60235,8 If Errtrap=0 S=Start(60235) Loke S,PAT_LINE Loke S+4,PAT_FILL Trap Save FILE$(26),60235 Erase 60235 End If While Mouse Key : Wend T_FLAG=False : T_ZNE=MZ : Gosub _DRAWBOX Else If MZ=4 : Rem load T_FLAG=True : T_ZNE=MZ : Gosub _DRAWBOX Trap Load FILE$(26),60235 If Errtrap=0 Set Pattern PAT_FILL Ink 2,1 : Bar X1(PAT_FILL+21),Y1(PAT_FILL+21) To X2(PAT_FILL+21),Y2(PAT_FILL+21) S=Start(60235) PAT_LINE=Leek(S) PAT_FILL=Leek(S+4) Erase 60235 Ink 5 Box X1(PAT_FILL+21),Y1(PAT_FILL+21) To X2(PAT_FILL+21),Y2(PAT_FILL+21) For A=0 To 15 T_FLAG=Btst(15-A,PAT_LINE) T_ZNE=A+5 Gosub _DRAWBOX Next End If While Mouse Key : Wend T_FLAG=False : T_ZNE=MZ : Gosub _DRAWBOX Else If MZ=>5 and MZ<=20 Bchg 20-MZ,PAT_LINE T_FLAG=Btst(20-MZ,PAT_LINE) : T_ZNE=MZ : Gosub _DRAWBOX While Mouse Key : Wend Else If MZ>=21 Set Pattern PAT_FILL : Ink 2,1 Bar X1(PAT_FILL+21),Y1(PAT_FILL+21) To X2(PAT_FILL+21),Y2(PAT_FILL+21) PAT_FILL=MZ-21 Ink 5 Box X1(PAT_FILL+21),Y1(PAT_FILL+21) To X2(PAT_FILL+21),Y2(PAT_FILL+21) While Mouse Key : Wend End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(46),ZNEY1(46),ZNEX2(46),ZNEY2(46),0] Pop Proc ' _DRAWBOX: If T_FLAG Ink 7 Draw X1(T_ZNE),Y1(T_ZNE) To X2(T_ZNE),Y1(T_ZNE) Draw X1(T_ZNE),Y1(T_ZNE) To X1(T_ZNE),Y2(T_ZNE) Ink 6 Draw X2(T_ZNE),Y1(T_ZNE) To X2(T_ZNE),Y2(T_ZNE) Draw X1(T_ZNE),Y2(T_ZNE) To X2(T_ZNE),Y2(T_ZNE) Else Ink 6 Draw X1(T_ZNE),Y1(T_ZNE) To X2(T_ZNE),Y1(T_ZNE) Draw X1(T_ZNE),Y1(T_ZNE) To X1(T_ZNE),Y2(T_ZNE) Ink 7 Draw X2(T_ZNE),Y1(T_ZNE) To X2(T_ZNE),Y2(T_ZNE) Draw X1(T_ZNE),Y2(T_ZNE) To X2(T_ZNE),Y2(T_ZNE) End If Return End Proc Procedure _SYM_GRID_OPTIONS If Chip Max Block<50*1024 Then Pop Proc 'Affects: 'SYM_ACTIVE,SYM_ROT,SYM_X,SYM_Y,SYM_ORDER,SYM_REFINX 'GRID_ACTIVE,GRID_X,GRID_Y,GRID_SX,GRID_SY _DRAWBOX[ZNEX1(37),ZNEY1(37),ZNEX2(37),ZNEY2(37),-1] OPT_ACTIVE=True Unpack 23 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER _MOUSECOLOURS Reserve Zone 32 Dim X1(32),X2(32),Y1(32),Y2(32) S=Start(65) For Z=1 To 32 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next _SAVE_SYMGRID_CONFIG[TMP_DIR$+"symgrid.tmp"] Gosub _INIT While Mouse Key : Wend Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=38 If GRID_ACTIVE=False Screen OPT_NUMBER _DRAW_OPT_BOX[X1(1),Y1(1),X2(1),Y2(1),3,1] _DRAW_OPT_BOX[X1(2),Y1(2),X2(2),Y2(2),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(34),ZNEY1(34),ZNEX2(34),ZNEY2(34),-1] GRID_ACTIVE=True While Mouse Key : Wend Else Screen OPT_NUMBER _DRAW_OPT_BOX[X1(2),Y1(2),X2(2),Y2(2),3,1] _DRAW_OPT_BOX[X1(1),Y1(1),X2(1),Y2(1),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(34),ZNEY1(34),ZNEX2(34),ZNEY2(34),0] GRID_ACTIVE=False While Mouse Key : Wend End If Else If MZ=39 If SYM_ACTIVE=False Screen OPT_NUMBER _DRAW_OPT_BOX[X1(3),Y1(3),X2(3),Y2(3),3,1] _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(35),ZNEY1(35),ZNEX2(35),ZNEY2(35),-1] SYM_ACTIVE=True While Mouse Key : Wend Else Screen OPT_NUMBER _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),3,1] _DRAW_OPT_BOX[X1(3),Y1(3),X2(3),Y2(3),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(35),ZNEY1(35),ZNEX2(35),ZNEY2(35),0] SYM_ACTIVE=False While Mouse Key : Wend End If Else If MZ=37 Exit End If Else If MS=OPT_NUMBER If MZ=1 If GRID_ACTIVE=False _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(2),Y1(2),X2(2),Y2(2),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(38),ZNEY1(38),ZNEX2(38),ZNEY2(38),-1] GRID_ACTIVE=True While Mouse Key : Wend End If Else If MZ=2 If GRID_ACTIVE=True _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(1),Y1(1),X2(1),Y2(1),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(38),ZNEY1(38),ZNEX2(38),ZNEY2(38),0] GRID_ACTIVE=False While Mouse Key : Wend End If Else If MZ=3 If SYM_ACTIVE=False _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(39),ZNEY1(39),ZNEX2(39),ZNEY2(39),-1] SYM_ACTIVE=True While Mouse Key : Wend End If Else If MZ=4 If SYM_ACTIVE=True _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(3),Y1(3),X2(3),Y2(3),1,3] Screen TLB_NUMBER _DRAWBOX[ZNEX1(39),ZNEY1(39),ZNEX2(39),ZNEY2(39),0] SYM_ACTIVE=False While Mouse Key : Wend End If Else If MZ=5 If SYM_ORDER=2 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(6),Y1(6),X2(6),Y2(6),1,3] SYM_ORDER=1 While Mouse Key : Wend End If Else If MZ=6 If SYM_ORDER=1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(5),Y1(5),X2(5),Y2(5),1,3] SYM_ORDER=2 While Mouse Key : Wend End If Else If MZ=7 If SYM_ROT=False _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(8),Y1(8),X2(8),Y2(8),1,3] SYM_ROT=True While Mouse Key : Wend End If Else If MZ=8 If SYM_ROT=True _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(7),Y1(7),X2(7),Y2(7),1,3] SYM_ROT=False While Mouse Key : Wend End If Else If MZ=9 : Rem ok _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend Exit Else If MZ=10 : Rem cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend _LOAD_SYMGRID_CONFIG[TMP_DIR$+"symgrid.tmp"] Gosub _PUTTBICONS Exit Else If MZ=11 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] FILESELECTOR$["","","**","*.info",0] _LOAD_SYMGRID_CONFIG[Param$] Gosub _INIT Gosub _PUTTBICONS Gosub _SHOWDATA While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=12 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] FILESELECTOR$["","","**","*.info",0] _SAVE_SYMGRID_CONFIG[Param$] Gosub _INIT Gosub _PUTTBICONS Gosub _SHOWDATA While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=13 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _SAVE_SYMGRID_CONFIG[FILE$(19)] While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=14 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _LOAD_SYMGRID_CONFIG[FILE$(19)] Gosub _INIT Gosub _PUTTBICONS Gosub _SHOWDATA While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=15 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(16),Y1(16),X2(16),Y2(16),1,3] While Mouse Key : Wend SYM_REFINX=True Else If MZ=16 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(15),Y1(15),X2(15),Y2(15),1,3] SYM_REFINX=False While Mouse Key : Wend Else If MZ=19 : Rem set X _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER Gr Writing 2 : Set Line 65535 While Mouse Key : Wend Repeat SYM_X=X Screen(X Mouse) Draw SYM_X,-1 To SYM_X,SCR_HEIGHT Draw SYM_X,-1 To SYM_X,SCR_HEIGHT Until Mouse Key Screen OPT_NUMBER Gr Writing 1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SHOWDATA While Mouse Key : Wend Else If MZ=20 : Rem Set Y _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER Gr Writing 2 : Set Line 65535 While Mouse Key : Wend Repeat SYM_Y=Y Screen(Y Mouse) Draw -1,SYM_Y To SCR_WIDTH,SYM_Y Draw -1,SYM_Y To SCR_WIDTH,SYM_Y Until Mouse Key Screen OPT_NUMBER Gr Writing 1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SHOWDATA While Mouse Key : Wend Else If MZ=21 : Rem Set Sym Coords _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER Gr Writing 2 : Set Line 65535 While Mouse Key : Wend Repeat SYM_Y=Y Screen(Y Mouse) SYM_X=X Screen(X Mouse) Draw SYM_X,-1 To SYM_X,SCR_HEIGHT Draw SYM_X,-1 To SYM_X,SCR_HEIGHT Draw -1,SYM_Y To SCR_WIDTH,SYM_Y Draw -1,SYM_Y To SCR_WIDTH,SYM_Y Until Mouse Key Screen OPT_NUMBER Gr Writing 1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SHOWDATA While Mouse Key : Wend Else If MZ=22 : Rem Set Grid _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER While Mouse Key : Wend Gr Writing 2 Repeat X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) For C=1 To 2 For X=0 To 3 Draw X1-GRID_X*X,Y1-3*GRID_Y To X1-GRID_X*X,Y1 Next For Y=0 To 3 Draw X1-GRID_X*3,Y1-Y*GRID_Y To X1,Y1-Y*GRID_Y Next Next Until Mouse Key X2=X1-GRID_X*3 Y2=Y1-GRID_Y*3 While Mouse Key X1=Max(X2+1,X Screen(X Mouse)) Y1=Max(Y2+1,Y Screen(Y Mouse)) GRID_X=(X1-X2)/3 GRID_Y=(Y1-Y2)/3 For C=1 To 2 For X=0 To 3 Draw X1-GRID_X*X,Y1-3*GRID_Y To X1-GRID_X*X,Y1 Next For Y=0 To 3 Draw X1-GRID_X*3,Y1-Y*GRID_Y To X1,Y1-Y*GRID_Y Next Next Wend GRID_SX=X1 mod GRID_X GRID_SY=Y1 mod GRID_Y Screen OPT_NUMBER _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SHOWDATA Else If MZ=>23 and MZ<=25 : Rem Set Grid Size _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER While Mouse Key : Wend Gr Writing 2 Repeat X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) For C=1 To 2 For X=0 To 3 Draw X1-GRID_X*X,Y1-3*GRID_Y To X1-GRID_X*X,Y1 Next For Y=0 To 3 Draw X1-GRID_X*3,Y1-Y*GRID_Y To X1,Y1-Y*GRID_Y Next Next Until Mouse Key X2=X1-GRID_X*3 Y2=Y1-GRID_Y*3 While Mouse Key X1=Max(X2+1,X Screen(X Mouse)) Y1=Max(Y2+1,Y Screen(Y Mouse)) If MZ=23 GRID_X=(X1-X2)/3 GRID_Y=(Y1-Y2)/3 Else If MZ=24 GRID_X=(X1-X2)/3 GRID_Y=(Y1-Y2)/3 Else If MZ=25 GRID_X=(X1-X2)/3 GRID_Y=(Y1-Y2)/3 End If For C=1 To 2 For X=0 To 3 Draw X1-GRID_X*X,Y1-3*GRID_Y To X1-GRID_X*X,Y1 Next For Y=0 To 3 Draw X1-GRID_X*3,Y1-Y*GRID_Y To X1,Y1-Y*GRID_Y Next Next Wend GRID_SX=GRID_SX mod GRID_X GRID_SY=GRID_SY mod GRID_Y Screen OPT_NUMBER _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SHOWDATA Else If MZ>=28 and MZ<=30 : Rem Set Grid Position _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Screen SCR_NUMBER While Mouse Key : Wend Gr Writing 2 Repeat X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) For C=1 To 2 For X=0 To 3 Draw X1-GRID_X*X,Y1-3*GRID_Y To X1-GRID_X*X,Y1 Next For Y=0 To 3 Draw X1-GRID_X*3,Y1-Y*GRID_Y To X1,Y1-Y*GRID_Y Next Next Until Mouse Key While Mouse Key : Wend Screen OPT_NUMBER _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] If MZ=28 GRID_SX=X1 mod GRID_X Else If MZ=29 GRID_SY=Y1 mod GRID_Y Else GRID_SX=X1 mod GRID_X GRID_SY=Y1 mod GRID_Y End If Gosub _SHOWDATA End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(37),ZNEY1(37),ZNEX2(37),ZNEY2(37),0] Pop Proc ' _INIT: If GRID_ACTIVE=False _DRAW_OPT_BOX[X1(1),Y1(1),X2(1),Y2(1),1,3] _DRAW_OPT_BOX[X1(2),Y1(2),X2(2),Y2(2),3,1] Else _DRAW_OPT_BOX[X1(1),Y1(1),X2(1),Y2(1),3,1] _DRAW_OPT_BOX[X1(2),Y1(2),X2(2),Y2(2),1,3] End If If SYM_ACTIVE=True _DRAW_OPT_BOX[X1(3),Y1(3),X2(3),Y2(3),3,1] _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),1,3] Else _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),3,1] _DRAW_OPT_BOX[X1(3),Y1(3),X2(3),Y2(3),1,3] End If If SYM_ORDER=1 _DRAW_OPT_BOX[X1(5),Y1(5),X2(5),Y2(5),3,1] _DRAW_OPT_BOX[X1(6),Y1(6),X2(6),Y2(6),1,3] Else _DRAW_OPT_BOX[X1(6),Y1(6),X2(6),Y2(6),3,1] _DRAW_OPT_BOX[X1(5),Y1(5),X2(5),Y2(5),1,3] End If If SYM_ROT=True _DRAW_OPT_BOX[X1(7),Y1(7),X2(7),Y2(7),3,1] _DRAW_OPT_BOX[X1(8),Y1(8),X2(8),Y2(8),1,3] Else _DRAW_OPT_BOX[X1(8),Y1(8),X2(8),Y2(8),3,1] _DRAW_OPT_BOX[X1(7),Y1(7),X2(7),Y2(7),1,3] End If If SYM_REFINX=1 _DRAW_OPT_BOX[X1(15),Y1(15),X2(15),Y2(15),3,1] Else _DRAW_OPT_BOX[X1(16),Y1(16),X2(16),Y2(16),3,1] End If Gosub _SHOWDATA Return ' _SHOWDATA: Gr Writing 1 : Ink 0,2 Text 350,85,Str$(GRID_X)+" " Text 350,96,Str$(GRID_Y)+" " Text 552,85,Str$(GRID_SX)+" " Text 552,96,Str$(GRID_SY)+" " Text 420,30,Str$(SYM_X)+" " Text 420,41,Str$(SYM_Y)+" " Return ' _PUTTBICONS: S=Screen Screen TLB_NUMBER If GRID_ACTIVE _DRAWBOX[ZNEX1(38),ZNEY1(38),ZNEX2(38),ZNEY2(38),-1] Else _DRAWBOX[ZNEX1(38),ZNEY1(38),ZNEX2(38),ZNEY2(38),0] End If If SYM_ACTIVE _DRAWBOX[ZNEX1(39),ZNEY1(39),ZNEX2(39),ZNEY2(39),-1] Else _DRAWBOX[ZNEX1(39),ZNEY1(39),ZNEX2(39),ZNEY2(39),0] End If Screen S Return ' End Proc Procedure _COPPER_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(50),ZNEY1(50),ZNEX2(50),ZNEY2(50),-1] OPT_ACTIVE=True Unpack 15 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER _MOUSECOLOURS Dim X1(47),Y1(47),X2(47),Y2(47) Reserve Zone 47 S=Start(57) For Z=1 To 47 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next ' Gr Writing 1 Ink 0,2 Text 465,19,Str$(Chip Free) Text 465,30,Str$(Fast Free) ' Wind Open 1,160,35,58,1 : Pen 0 : Paper 2 : Clw Print At(0,0)+COPPER_STR$(COPPER_LIST,1); Wind Open 2,160,46,58,1 : Pen 0 : Paper 2 : Clw Print At(0,0)+COPPER_STR$(COPPER_LIST,2); Wind Open 3,160,57,58,1 : Pen 0 : Paper 2 : Clw Print At(0,0)+COPPER_STR$(COPPER_LIST,3); COPWIND=1 Window COPWIND ' Dim CH$(14) For C=1 To 14 : Read CH$(C) : Next ' CZ=COPPER_COL(COPPER_LIST)+32 _DRAW_OPT_BOX[X1(CZ),Y1(CZ),X2(CZ),Y2(CZ),3,1] CZ=COPPER_LIST+29 _DRAW_OPT_BOX[X1(CZ),Y1(CZ),X2(CZ),Y2(CZ),3,1] ' While Mouse Key : Wend ' Do Repeat If CF<>Chip Free CF=Chip Free Ink 0,2 Text 465,19,Str$(CF)+" " End If If FF<>Fast Free FF=Fast Free Ink 0,2 Text 465,30,Str$(FF)+" " End If MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS : MZ=Mouse Zone If I$>" " If Len(COPPER_STR$(COPPER_LIST,COPWIND))<50 COPPER_STR$(COPPER_LIST,COPWIND)=Left$(COPPER_STR$(COPPER_LIST,COPWIND),POS)+I$+Right$(COPPER_STR$(COPPER_LIST,COPWIND),Len(COPPER_STR$(COPPER_LIST,COPWIND))-POS) Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,COPWIND); Inc POS Locate POS,0 End If Else If I$=Chr$(13) or I$=Chr$(31) Add COPWIND,1,1 To 3 POS=Min(POS,Len(COPPER_STR$(COPPER_LIST,COPWIND))) Window COPWIND Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,COPWIND); Locate POS,0 Else If I$=Chr$(8) : Rem backspace If POS>0 If SS and %11 COPPER_STR$(COPPER_LIST,COPWIND)=Right$(COPPER_STR$(COPPER_LIST,COPWIND),Len(COPPER_STR$(COPPER_LIST,COPWIND))-POS) POS=0 Else COPPER_STR$(COPPER_LIST,COPWIND)=Left$(COPPER_STR$(COPPER_LIST,COPWIND),POS-1)+Right$(COPPER_STR$(COPPER_LIST,COPWIND),Len(COPPER_STR$(COPPER_LIST,COPWIND))-POS) Dec POS End If Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,COPWIND); Locate POS,0 End If Else If S=70 : Rem delete If POS0 If SS and %11 POS=0 Else Dec POS End If Locate POS,0 End If Else If I$=Chr$(28) : Rem right If POS=8 and MZ<=21 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] If Len(COPPER_STR$(COPPER_LIST,COPWIND))<50 COPPER_STR$(COPPER_LIST,COPWIND)=Left$(COPPER_STR$(COPPER_LIST,COPWIND),POS)+CH$(MZ-7)+Right$(COPPER_STR$(COPPER_LIST,COPWIND),Len(COPPER_STR$(COPPER_LIST,COPWIND))-POS) Inc POS Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,COPWIND); Locate POS,0 End If While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ>=22 and MZ<=24 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] COPWIND=MZ-21 Window COPWIND COPPER_STR$(COPPER_LIST,COPWIND)="" POS=0 Pen 0 : Paper 2 : Clw While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ>=25 and MZ<=27 COPWIND=MZ-24 Window COPWIND POS=(X Screen(X Mouse)-160)/8 POS=Max(0,POS) POS=Min(POS,Len(COPPER_STR$(COPPER_LIST,COPWIND))) Locate POS,0 Else If MZ=28 _HELP["copper"] Else If MZ=30 or MZ=31 CZ=COPPER_COL(COPPER_LIST)+32 _DRAW_OPT_BOX[X1(CZ),Y1(CZ),X2(CZ),Y2(CZ),1,3] If MZ=30 COPPER_LIST=1 _DRAW_OPT_BOX[X1(31),Y1(31),X2(31),Y2(31),1,3] Else COPPER_LIST=2 _DRAW_OPT_BOX[X1(30),Y1(30),X2(30),Y2(30),1,3] End If Window 1 : Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,1); Window 2 : Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,2); Window 3 : Clw : Print At(0,0)+COPPER_STR$(COPPER_LIST,3); POS=Max(0,POS) POS=Min(POS,Len(COPPER_STR$(COPPER_LIST,COPWIND))) Window COPWIND : Locate POS,0 CZ=COPPER_COL(COPPER_LIST)+32 _DRAW_OPT_BOX[X1(CZ),Y1(CZ),X2(CZ),Y2(CZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend Else If MZ>=32 and MZ<=47 CZ=COPPER_COL(COPPER_LIST)+32 COPPER_COL(COPPER_LIST)=MZ-32 _DRAW_OPT_BOX[X1(CZ),Y1(CZ),X2(CZ),Y2(CZ),1,3] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(50),ZNEY1(50),ZNEX2(50),ZNEY2(50),0] ' Data "(","1","3","5","7","9","-",")","2","4","6","8","0","," End Proc Procedure _PAINTER_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(17),ZNEY1(17),ZNEX2(17),ZNEY2(17),-1] OPT_ACTIVE=True Unpack 25 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER _MOUSECOLOURS Dim X1(31),Y1(31),X2(31),Y2(31) Reserve Zone 31 S=Start(67) For Z=1 To 31 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next ' _SAVE_PAINT_CONFIG[FILE$(50)] _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),3,1] _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),3,1] Gosub OPTSHOW ' While Mouse Key : Wend ' Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=17 Exit End If Else If MS=OPT_NUMBER If MZ>=1 and MZ<=9 _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),1,3] PNT_LEFT=MZ _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),3,1] While Mouse Key : Wend Else If MZ>=10 and MZ<=18 _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),1,3] PNT_RGHT=MZ-9 _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),3,1] While Mouse Key : Wend Else If MZ=19 : Rem OK _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] While Mouse Key : Wend Exit Else If MZ=20 : Rem Cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _LOAD_PAINT_CONFIG[FILE$(50)] While Mouse Key : Wend Exit Else If MZ=21 : Rem Save Default _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _SAVE_PAINT_CONFIG[""] While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=22 : Rem reset _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),1,3] _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),1,3] _LOAD_PAINT_CONFIG[FILE$(50)] Gosub OPTSHOW While Mouse Key : Wend _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),3,1] _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=23 : Rem default _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),1,3] _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),1,3] _LOAD_PAINT_CONFIG[""] Gosub OPTSHOW While Mouse Key : Wend _DRAW_OPT_BOX[X1(PNT_LEFT),Y1(PNT_LEFT),X2(PNT_LEFT),Y2(PNT_LEFT),3,1] _DRAW_OPT_BOX[X1(PNT_RGHT+9),Y1(PNT_RGHT+9),X2(PNT_RGHT+9),Y2(PNT_RGHT+9),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=24 : Rem take brush size If SPRAY_BRUSH SPRAY_BRUSH=False _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else SPRAY_BRUSH=True _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] End If While Mouse Key : Wend Else If MZ=25 : Rem Set spray size _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] _SETSPRAY Screen OPT_NUMBER _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Else If MZ=26 : Rem Circular mode SPRAY_BOX=False _DRAW_OPT_BOX[X1(26),Y1(26),X2(26),Y2(26),3,1] _DRAW_OPT_BOX[X1(27),Y1(27),X2(27),Y2(27),1,3] While Mouse Key : Wend Else If MZ=27 : Rem Square mode SPRAY_BOX=True _DRAW_OPT_BOX[X1(26),Y1(26),X2(26),Y2(26),1,3] _DRAW_OPT_BOX[X1(27),Y1(27),X2(27),Y2(27),3,1] While Mouse Key : Wend Else If MZ>=28 and MZ<=31 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Ink 2 Bar 547-PNT_X,72-PNT_Y To 546+PNT_X,72+PNT_Y If MZ=28 Inc PNT_X Else If MZ=29 Dec PNT_X Else If MZ=30 Inc PNT_Y Else If MZ=31 Dec PNT_Y End If Gosub REDRAW Wait 5 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False Screen TLB_NUMBER _DRAWBOX[ZNEX1(17),ZNEY1(17),ZNEX2(17),ZNEY2(17),0] Pop Proc ' OPTSHOW: If SPRAY_BRUSH _DRAW_OPT_BOX[X1(24),Y1(24),X2(24),Y2(24),3,1] Else _DRAW_OPT_BOX[X1(24),Y1(24),X2(24),Y2(24),1,3] End If If SPRAY_BOX _DRAW_OPT_BOX[X1(27),Y1(27),X2(27),Y2(27),3,1] _DRAW_OPT_BOX[X1(26),Y1(26),X2(26),Y2(26),1,3] Else _DRAW_OPT_BOX[X1(26),Y1(26),X2(26),Y2(26),3,1] _DRAW_OPT_BOX[X1(27),Y1(27),X2(27),Y2(27),1,3] End If ' REDRAW: Gr Writing 1 PNT_X=Max(1,PNT_X) PNT_Y=Max(1,PNT_Y) PNT_X=Min(49,PNT_X) PNT_Y=Min(30,PNT_Y) Ink 0,2 Bar 547-PNT_X,72-PNT_Y To 546+PNT_X,72+PNT_Y If PNT_X>4 Text 490,34,Str$(PNT_X*2+1) Else Text 490,34,Str$(PNT_X*2+1)+" " End If If PNT_Y>4 Text 566,34,Str$(PNT_Y*2+1) Else Text 566,34,Str$(PNT_Y*2+1)+" " End If Return End Proc Procedure _SYSTEM_OPTIONS If Chip Max Block<50*1024 Then Pop Proc _DRAWBOX[ZNEX1(43),ZNEY1(43),ZNEX2(43),ZNEY2(43),-1] OPT_ACTIVE=True Unpack 26 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER _MOUSECOLOURS Dim X1(6),Y1(6),X2(6),Y2(6) Reserve Zone 6 For X=0 To 1 For Y=1 To 3 Z=X*3+Y X1(Z)=X*64 Y1(Z)=(Y-1)*16 X2(Z)=X*64+63 Y2(Z)=Y*16-1 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next Next Screen SCR_NUMBER OLDX=X Screen(X Mouse) OLDY=Y Screen(Y Mouse) OLDCHIP=Chip Free OLDFAST=Fast Free If Exist(Dir$) Trap OLDD$=Dr Name$(Left$(Dir$,Instr(Dir$,":"))) OLDD$=Left$(OLDD$,13) OLDD$=OLDD$+Space$(13-Len(OLDD$)) Trap OLDDF=Dfree End If Screen OPT_NUMBER Ink 0,6 Text 200,8,(Str$(OLDX)-" ")+" " Text 200,19,(Str$(OLDY)-" ")+" " Text 350,8,(Str$(OLDCHIP)-" ")+" " Text 350,19,(Str$(OLDFAST)-" ")+" " Text 528,8,OLDD$ Text 535,19,(Str$(OLDDF)-" ")+" " ' If TRACK_LOOP _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),7,5] Track Loop On Else _DRAW_OPT_BOX[X1(4),Y1(4),X2(4),Y2(4),5,7] Track Loop Of End If If Btst(1,$BFE001) _DRAW_OPT_BOX[X1(6),Y1(6),X2(6),Y2(6),7,5] Else _DRAW_OPT_BOX[X1(6),Y1(6),X2(6),Y2(6),5,7] End If While Mouse Key : Wend ' Do Screen SCR_NUMBER X=X Screen(X Mouse) Y=Y Screen(Y Mouse) MS=Mouse Screen Trap Screen MS MZ=Mouse Zone MK=Mouse Key CHIP=Chip Free FAST=Fast Free If Exist(Dir$) Trap D$=Dr Name$(Left$(Dir$,Instr(Dir$,":"))) D$=Left$(D$,13) D$=D$+Space$(13-Len(D$)) Trap DF=Dfree End If If MK If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=43 Exit End If Else If MS=OPT_NUMBER If MZ=1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] FILESELECTOR$["","","**","*.info",0] F$=Param$ Trap Track Load F$,TRACK_BANK _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] Else If MZ=2 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] Trap Track Play TRACK_BANK While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] Else If MZ=3 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] Track Stop While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] Else If MZ=4 TRACK_LOOP= Not(TRACK_LOOP) If TRACK_LOOP _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] Track Loop On Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] Track Loop Of End If While Mouse Key : Wend Else If MZ=5 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] Trap Erase TRACK_BANK While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] Else If MZ=6 Bchg 1,$BFE001 If Btst(1,$BFE001) _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),7,5] Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),5,7] End If While Mouse Key : Wend End If End If End If ' Screen OPT_NUMBER Ink 0,6 If X<>OLDX Text 200,8,(Str$(X)-" ")+" " OLDX=X End If If Y<>OLDY Text 200,19,(Str$(Y)-" ")+" " OLDY=Y End If ' If CHIP<>OLDCHIP Text 350,8,(Str$(CHIP)-" ")+" " OLDCHIP=CHIP End If If FAST<>OLDFAST Text 350,19,(Str$(FAST)-" ")+" " OLDFAST=FAST End If ' If D$<>OLDD$ Text 528,8,D$ OLDD$=D$ End If If DF<>OLDDF Text 535,19,(Str$(DF)-" ")+" " OLDDF=DF End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False _DRAWBOX[ZNEX1(43),ZNEY1(43),ZNEX2(43),ZNEY2(43),0] End Proc ' Procedure _LOAD_OPTIONS_SCREENS For F=1 To 16 Trap Load FILE$(F),8+F Next Trap Load FILE$(47),25 Trap Load FILE$(53),26 End Proc Procedure _LOAD_MENU_COORDS For F=31 To 46 Trap Load FILE$(F),F+20 Next Trap Load FILE$(48),67 End Proc Procedure _DRAW_OPT_BOX[X1,Y1,X2,Y2,CL1,CL2] Ink CL1 Draw X1,Y1 To X1,Y2 Draw X1,Y1 To X2,Y1 Draw X1+1,Y1 To X1+1,Y2-1 Ink CL2 Draw X1,Y2 To X2,Y2 Draw X2,Y1 To X2,Y2 Draw X2-1,Y1+1 To X2-1,Y2 End Proc Procedure _MOUSECOLOURS Colour 16,$0 Colour 17,$E44 Colour 18,$0 Colour 19,$EEC End Proc ' Procedure _LOADPALETTE[FILE$] If SCR_COLOURS<>4096 Trap Load FILE$,TMP_BANK S=Start(TMP_BANK) For C=0 To Min(SCR_COLOURS-1,Length(TMP_BANK)*2) CL=Deek(S) : Add S,2 Screen SCR_NUMBER Colour C,CL Trap Screen PAL_NUMBER Colour C,CL Next Erase TMP_BANK If FG_COL>32 and SCR_COLOURS=64 C1=Colour(FG_COL-32) Else C1=Colour(FG_COL) End If If BG_COL>32 and SCR_COLOURS=64 C2=Colour(BG_COL-32) Else C2=Colour(BG_COL) End If Trap Screen OPT_NUMBER If Errtrap=0 Colour 4,C1 Colour 5,C2 End If End If End Proc Procedure _SAVEPALETTE[FILE$] If SCR_COLOURS<>4096 Screen SCR_NUMBER Trap Reserve As Data TMP_BANK,SCR_COLOURS*2 If Errtrap=0 S=Start(TMP_BANK) For C=0 To SCR_COLOURS-1 Doke S,Colour(C) : Add S,2 Next Trap Save FILE$,TMP_BANK Trap Erase TMPBANK End If End If End Proc Procedure _LOADIFFPALETTE[NAME$] ' ' Inputs... ' NAME$ - The filename of the IFF-ILBM type colour palette file to load. ' ' ************************** ' ' User Functions... ' Fn _RED - Returns the red component of a colour, given its RGB ' value. ' Fn _GREEN - As _RED, but returns the green component. ' FN _BLUE - As _RED and _GREEN, but returns the blue component. ' ' ************************** ' Def Fn _RED(C)=(C and $F00)/$100 Def Fn _GREEN(C)=(C and $F0)/$10 Def Fn _BLUE(C)=C and $F ' Open the file in question. Trap Open In 1,NAME$ If Errtrap Then Pop Proc ' Check that it is an IFF type. _PLD_BUFFER$=Input$(1,4) If _PLD_BUFFER$<>"FORM" Then Close 1 : Error 30 ' Cjeck that it is an ILBM type. _PLD_BUFFER$=Input$(1,4) _PLD_BUFFER$=Input$(1,4) If _PLD_BUFFER$<>"ILBM" Then Close 1 : Error 30 ' Now we have to read each chunk until we find the "CMAP" chunk. _PLD_CHUNK$=Input$(1,4) : Rem 'First chunk's type _PLD_BUFFER$=Input$(1,4) : Rem 'First chunk's length While _PLD_CHUNK$<>"CMAP" and Not Eof(1) : Rem 'Go until we find the CMAP or we hit EOF. _PLD_CHUNKSIZE=Leek(Varptr(_PLD_BUFFER$)) : Rem 'Turn chunklength into a number variable. Pof(1)=Pof(1)+_PLD_CHUNKSIZE : Rem 'Read past this chunk. _PLD_CHUNK$=Input$(1,4) : Rem 'Read next chunk's type. _PLD_BUFFER$=Input$(1,4) : Rem 'Read next chunk's length. Wend If Eof(1) Then Close 1 : Error 30 : Rem ' If we didn't find the CMAP chunk, then quit. _PLD_CMAPSIZE=Leek(Varptr(_PLD_BUFFER$)) : Rem ' Read in whole palette. For _PLD_INDEX=0 To Min(_PLD_CMAPSIZE/3-1,31) _PLD_RED=Asc(Input$(1,1))*$10 _PLD_GREEN=Asc(Input$(1,1)) _PLD_BLUE=Asc(Input$(1,1))/$10 Colour _PLD_INDEX,_PLD_RED+_PLD_GREEN+_PLD_BLUE Next _PLD_INDEX ' Close the file and end. Close 1 End Proc Procedure _SAVEIFFPALETTE[NAME$] ' ' Inputs... ' NAME$ - The palette save name. ' ' ************************** ' ' User Functions... ' Fn _RED - Returns the red component of a colour, given its RGB ' value. ' Fn _GREEN - As _RED, but returns the green component. ' FN _BLUE - As _RED and _GREEN, but returns the blue component. ' ' ************************** ' Def Fn _RED(C)=(C and $F00)/$100 Def Fn _GREEN(C)=(C and $F0)/$10 Def Fn _BLUE(C)=C and $F ' Open the file. Trap Open Out 1,NAME$ If Errtrap Then Pop Proc ' Sizes of the chunks required. _PSV_BMHDSIZE=20 _PSV_CMAPSIZE=3*32 ' Mark this as an IFF file. Print #1,"FORM"; ' Calculate the formsize. _PSV_FILESIZE=4+8+_PSV_BMHDSIZE+8+_PSV_CMAPSIZE _PSV_FILESIZE$=Space$(4) Loke Varptr(_PSV_FILESIZE$),_PSV_FILESIZE Print #1,_PSV_FILESIZE$; ' Mark this as an ILBM file. Print #1,"ILBM"; ' Print a blank BMHD. DPaint needs this, I think, although it doesn't do anything. Print #1,"BMHD"; : Rem ' Chunk name. Loke Varptr(_PSV_FILESIZE$),_PSV_BMHDSIZE Print #1,_PSV_FILESIZE$; : Rem ' Chunk size. _PSV_BUFFER$=String$(Chr$(0),_PSV_BMHDSIZE) Print #1,_PSV_BUFFER$; : Rem ' Print a blank chunk. ' Now print the important CMAP chunk. Print #1,"CMAP"; : Rem ' Chunk name. Loke Varptr(_PSV_FILESIZE$),_PSV_CMAPSIZE Print #1,_PSV_FILESIZE$; : Rem ' Chunk size. ' Calculate the weighted RGB values for all 32 colours, and print them. For _PSV_INDEX=0 To 31 _PSV_RED$=Chr$( Fn _RED(Colour(_PSV_INDEX))*$10) _PSV_GREEN$=Chr$( Fn _GREEN(Colour(_PSV_INDEX))*$10) _PSV_BLUE$=Chr$( Fn _BLUE(Colour(_PSV_INDEX))*$10) Print #1,_PSV_RED$; Print #1,_PSV_GREEN$; Print #1,_PSV_BLUE$; Next _PSV_INDEX ' Done. Close 1 End Proc ' Procedure _SPREADPALETTE[CL1,CL2] If(Abs(CL1-CL2))<2 Pop Proc End If If CL2=0 _HELP["move"] Else If MZ=10 or MZ=11 _HELP["save"] Else If MZ=12 _HELP["load"] Else If MZ=13 _HELP["undo"] Else If MZ=14 _HELP["new"] Else If MZ=15 _HELP["format"] Else If MZ=16 or MZ=19 _HELP["text"] Else If MZ=17 or MZ=20 _HELP["painter"] Else If MZ=18 _HELP["magnify"] Else If MZ=21 _HELP["polygon"] Else If MZ=22 _HELP["freehand"] Else If MZ=23 or MZ=24 _HELP["rectangle"] Else If MZ=25 _HELP["continuous"] Else If MZ=26 or MZ=27 _HELP["circle"] Else If MZ=28 _HELP["curves"] Else If MZ=29 or MZ=30 _HELP["ellipse"] Else If MZ=31 _HELP["line"] Else If MZ=32 or MZ=33 _HELP["pies"] Else If MZ=34 _HELP["spraycan"] Else If MZ=35 _HELP["fill"] Else If MZ=36 _HELP["shape"] Else If MZ=37 or MZ=39 _HELP["symmetry"] Else If MZ=38 _HELP["gridlock"] Else If MZ=40 _HELP["print"] Else If MZ=41 or MZ=48 _HELP["brush"] Else If MZ=42 _HELP["palette"] Else If MZ=43 _HELP["system"] Else If MZ=44 _HELP["preferences"] Else If MZ=45 _HELP["quit"] Else If MZ=46 _HELP["pattern"] Else If MZ=47 _HELP["fractal"] Else If MZ=49 _HELP["effects"] Else If MZ=50 _HELP["copper"] Else If MZ=51 _HELP["clipart"] End If Else _HELP["menu"] End If End Proc Procedure HELP[HLP$] Change Mouse 5 Trap Open In 1,HLP_DIR$+"HelpText/"+HLP$ If Errtrap Change Mouse 4 Pop Proc[False] End If ' Ink 0,2 : Pen 0 ' Dim WORD$(100) Dim LINE$(100) Trap FULL$=Input$(1,File Length(HLP_DIR$+"HelpText/"+HLP$)) If Errtrap Change Mouse 4 Pop Proc[0] End If ' POS=1 CH$=Mid$(FULL$,POS,1) : Inc POS LCH$=Lower$(CH$) L=1 : A=1 Close 1 FULL_LEN=Len(FULL$) ' Repeat While LCH$<=" " or LCH$=Chr$(138) If CH$<>Chr$(13) and CH$FULL_LEN Wend While LCH$>" " and LCH$<>Chr$(138) WORD$=WORD$+CH$ CH$=Mid$(FULL$,POS,1) : Inc POS LCH$=Lower$(CH$) Wend If Len(WORD$)+Len(SENT$)=HLP_WIDTH-1 SENT$=WORD$ : Inc L Gosub ADWORD End If WORD$="" Until POS>=FULL_LEN MXLINE=L-8 MXLINE=Max(0,MXLINE) SLINE=1 Gosub REDRAW Change Mouse 4 Do MS=Mouse Screen Trap Screen MS MZ=Mouse Zone MK=Mouse Key I$=Inkey$ S=Scancode If MK=1 If MS=HLP_NUMBER If MZ=1 : Rem quit Pop Proc[True] Else If MZ=2 : Rem contents HELP["contents"] If Param=True Pop Proc[True] End If Gosub REDRAW While Mouse Key : Wend Else If MZ=3 : Rem index HELP["index"] If Param=True Pop Proc[True] End If Gosub REDRAW While Mouse Key : Wend Else If MZ=4 : Rem previous Pop Proc[False] Else If MZ=5 : Rem print _PRINT_HELP[HLP_DIR$+"HelpText/"+HLP$] Else If MZ=6 : Rem help HELP["help"] If Param=True Pop Proc[True] End If Gosub REDRAW While Mouse Key : Wend Else If MZ=7 : Rem up I$=Chr$(30) Else If MZ=8 : Rem slider bar Else If MZ=9 : Rem down I$=Chr$(31) Else If MZ>9 HELP[WORD$(MZ-9)] If Param=True Pop Proc[True] End If Gosub REDRAW While Mouse Key : Wend End If Else If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN End If End If End If If I$=Chr$(30) : Rem up If SLINE>1 Dec SLINE Gosub REDRAW End If Else If I$=Chr$(31) : Rem down If SLINE="a" and C$<="z" F$=F$+C$ End If Next If F$<>"" If F$<>HLP$ If Exist(HLP_DIR$+"HelpText/"+F$) Trap LINE$(L)=LINE$(L)+Pen$(5)+Zone$(WORD$,A+9)+Pen$(0) WORD$(A)=F$ : Inc A Else Trap LINE$(L)=LINE$(L)+WORD$ End If Else Trap LINE$(L)=LINE$(L)+WORD$ End If Else Trap LINE$(L)=LINE$(L)+WORD$ End If Return ' REDRAW: Clw Reset Zone Gosub MAKEHELPZONES For A=SLINE To SLINE+8 Print At(0,A-SLINE)+LINE$(A) Next Return ' MAKEHELPZONES: Restore HLPZNEDAT For Z=1 To 9 Read X1,Y1,X2,Y2 Set Zone Z,X1,Y1 To X2,Y2 Next HLPZNEDAT: Data 0,85,37,95 Data 38,85,107,95 Data 108,85,152,95 Data 153,85,222,95 Data 223,85,267,95 Data 268,85,305,95 Data 618,0,639,10 Data 618,11,639,84 Data 618,85,639,95 Return End Proc Procedure _HELP[HLP$] Change Mouse 5 OLD_SCREEN=Screen HLP_ACTIVE=True Unpack 19 To HLP_NUMBER If FSEL_ACTIVE Screen Display HLP_NUMBER,,FSEL_HELP_POSITION,, Else If MAG_ACTIVE Screen Display HLP_NUMBER,,MAG_HELP_POSITION,, Else Screen Display HLP_NUMBER,,HLP_POSITION,, End If _MOUSECOLOURS Ink 1 Reserve Zone 109 Wind Open 1,0,12,HLP_WIDTH,9 Paper 2 : Clw Flash Off : Curs Off Scroll Off If HLP$="" HLP$="contents" End If HELP[HLP$] Screen Close HLP_NUMBER Trap Screen OLD_SCREEN HLP_ACTIVE=False End Proc Procedure _PRINT_HELP[F$] End Proc ' Procedure FILESELECTOR$[D$,F$,P$,FL$,FLAGS] If FLAGS and %1 DRSONLY=True Else If FLAGS and %10 FILESONLY=True End If If MAG_ACTIVE Then Pop Proc FSEL_ACTIVE=True Trap Dir$=D$ Unpack 20 To FSEL_NUMBER Screen Display FSEL_NUMBER,,FSEL_POSITION,, _MOUSECOLOURS Reserve Zone 120 Dim X1(20),Y1(20),X2(20),Y2(20) For A=1 To 20 Read X1(A),Y1(A),X2(A),Y2(A) Set Zone A,X1(A),Y1(A) To X2(A),Y2(A) Next Dim D$(100) Wind Open 1,336,14,36,10 Window 1 : Paper 2 : Pen 0 Curs Off : Flash Off : Clw Wind Open 2,48,90,30,1 Window 1 : Paper 2 : Pen 0 Curs Off : Flash Off : Clw SRT=4 _DRAW_OPT_BOX[X1(SRT+2),Y1(SRT+2),X2(SRT+2),Y2(SRT+2),1,3] A: Set Dir 50,FL$ _ASSIGNON=False For A=1 To 100 D$(A)="" Next D$(1)="*/"+Space$(32) Trap D$(2)=Left$(Dir First$(P$),34) If Errtrap Then Goto C DNUM=2 If FILESONLY While Left$(D$(DNUM),1)="*" D$(DNUM)=Left$(Dir Next$,34) Wend While D$(DNUM)<>"" Inc DNUM Repeat D$(DNUM)=Left$(Dir Next$,34) Until(Left$(D$(DNUM),1)=" ") or(D$(DNUM)="") Wend Else If DRSONLY While Left$(D$(DNUM),1)=" " D$(DNUM)=Left$(Dir Next$,34) Wend While D$(DNUM)<>"" Inc DNUM Repeat D$(DNUM)=Left$(Dir Next$,34) Until(Left$(D$(DNUM),1)="*") or(D$(DNUM)="") Wend Else While D$(DNUM)<>"" Inc DNUM D$(DNUM)=Left$(Dir Next$,34) Wend End If STRT=1 MXLIST=DNUM-10 On SRT Gosub _SORT_NAME,_SORT_DATE,_SORT_SIZE ' D: Screen FSEL_NUMBER Clw For A=21 To 120 Trap Reset Zone A Next Locate 0,0 For A=STRT To STRT+10 Print At(0,A-STRT)+Zone$(Left$(D$(A),35),A+21); Next _DRAW_OPT_BOX[X1(11),Y1(11),X2(11),Y2(11),3,1] Ink 2 Bar X1(19)+45,Y1(19)+1 To X2(19)-2,Y2(19)-1 Ink 0,2 Text 50,85,Right$(Dir$,31) ' C: Window 2 Clw Print At(0,0);F$; Curs Off Window 1 ' While Mouse Key : Wend ' Do Repeat MS=Mouse Screen Trap Screen MS MZ=Mouse Zone MK=Mouse Key I$=Inkey$ S=Scancode Until MK or S If MK=1 If MS=FSEL_NUMBER If MZ=1 : Rem OK _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Goto B Else If MZ=2 : Rem Cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] F$="" : Goto B Else If MZ=3 : Rem name _DRAW_OPT_BOX[X1(SRT+2),Y1(SRT+2),X2(SRT+2),Y2(SRT+2),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SORT_NAME : SRT=1 : Goto D Else If MZ=4 : Rem date _DRAW_OPT_BOX[X1(SRT+2),Y1(SRT+2),X2(SRT+2),Y2(SRT+2),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SORT_DATE : SRT=2 : Goto D Else If MZ=5 : Rem size _DRAW_OPT_BOX[X1(SRT+2),Y1(SRT+2),X2(SRT+2),Y2(SRT+2),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Gosub _SORT_SIZE : SRT=3 : Goto D Else If MZ=6 : Rem No Sort _DRAW_OPT_BOX[X1(SRT+2),Y1(SRT+2),X2(SRT+2),Y2(SRT+2),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SRT=4 : Goto D Else If MZ=7 : Rem filter Else If MZ=8 : Rem pattern Else If MZ=9 : Rem Dirs Only If DRSONLY _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] DRSONLY=False Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _DRAW_OPT_BOX[X1(10),Y1(10),X2(10),Y2(10),3,1] DRSONLY=True FILESONLY=False End If Goto A Else If MZ=10 : Rem Files only If FILESONLY _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] FILESONLY=False Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _DRAW_OPT_BOX[X1(9),Y1(9),X2(9),Y2(9),3,1] FILESONLY=True DRSONLY=False End If Goto A Else If MZ=11 : Rem Get Dir _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Goto A Else If MZ=12 : Rem Help _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _HELP["menu"] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=13 : Rem Iff Else If MZ=14 : Rem Amos Bank Else If MZ=15 : Rem PowerPacked Else If MZ=16 : Rem Packed IFF Else If MZ=17 : Rem raw bitplane Else If MZ=18 : Rem byte/pixel Else If MZ=19 : Rem path Else If MZ=20 : Rem name Goto SETNAME Else If MZ>20 A=MZ-21 If Left$(D$(A),1)="*" or _ASSIGNON D$=Right Trim$(Right$(D$(A),Len(D$(A))-1)) Trap Dir$=D$ While Mouse Key : Wend Goto A Else If Left$(D$(A),1)=" " TF$=Right$(D$(A),Len(D$(A))-1) TF$=Right Trim$(TF$) If TF$=F$ Goto B Else F$=TF$ While Mouse Key : Wend Goto C End If End If End If Else If MS=TLB_NUMBER If MZ=4 S=76 : I$=Cup$ Else If MZ=5 _DRAG_SCREEN Else If MZ=6 S=77 : I$=Cdown$ End If End If End If If MK=2 If _ASSIGNON Goto A Else For A=1 To 100 D$(A)="" Next D$(1)="*/"+Space$(32) D$(2)=Dev First$("") DNUM=2 While D$(DNUM)<>"" Inc DNUM D$(DNUM)=Dev Next$ Wend STRT=1 MXLIST=DNUM-10 _ASSIGNON=True Goto D End If End If If I$<>"" Screen FSEL_NUMBER If S=67 or S=68 : Rem enter Goto B Else If S=69 : Rem Esc F$="" : Goto B Else If S=76 : Rem up If STRT>1 Dec STRT Goto D End If Else If S=77 : Rem down If STRT99 Until D$(B)<>"" Repeat FLAG=False For A=2 To B-2 If D$(A)>D$(A+1) Swap D$(A),D$(A+1) FLAG=True End If Next Until FLAG=False Return ' _SORT_DATE: Return ' _SORT_SIZE: B=0 Repeat Inc B Exit If B>99 Until D$(B)<>"" Repeat FLAG=False For A=2 To B-2 TF1$=Right$(D$(A),Len(D$(A))-1) TF1$=Right Trim$(TF1$) TF2$=Right$(D$(A+1),Len(D$(A+1))-1) TF2$=Right Trim$(TF2$) Trap F1=File Length(TF1$) Trap F2=File Length(TF2$) If F1>F2 Swap D$(A),D$(A+1) FLAG=True End If Next Until FLAG=False Return ' B: Screen Close FSEL_NUMBER FSEL_ACTIVE=False Pop Proc[F$] ' Data 0,11,83,21 Data 0,22,83,32 Data 15,33,83,43 Data 15,44,83,54 Data 15,55,83,65 Data 15,66,83,76 Data 98,11,193,21 Data 98,22,193,32 Data 98,33,193,43 Data 98,44,193,54 Data 83,55,193,65 Data 83,66,193,76 Data 209,11,319,21 Data 209,22,319,32 Data 209,33,319,43 Data 209,44,319,54 Data 209,55,319,65 Data 209,66,319,76 Data 0,77,319,87 Data 0,88,319,98 ' SETNAME: Window 2 Curs On NP=Len(F$) Paper 2 : Pen 0 Do I$=Inkey$ S=Scancode SS=Scanshift If Mouse Key=1 If Mouse Zone<>20 Exit Else X=X Text(X Screen(X Mouse)) If X>=0 and X<=Len(F$) NP=X Locate NP,0 End If End If End If If S If I$=Chr$(27) Exit Else If I$=Chr$(13) Exit Else If I$>=" " If Len(F$)<29 F$=Left$(F$,NP)+I$+Right$(F$,Len(F$)-NP) Inc NP End If Else If I$=Chr$(29) : Rem left If NP>0 If SS and %11 NP=0 Else Dec NP End If End If Else If I$=Chr$(28) : Rem right If NP0 If SS and %11 F$=Right$(F$,Len(F$)-NP) NP=0 Else F$=Left$(F$,NP-1)+Right$(F$,Len(F$)-NP) Dec NP End If End If Else If S=70 If NP0 and MZ<>MAGFACTOR If MK=1 MAGFACTOR=MZ _DRAWGRID End If Else If MX<288 _UPDATEUNDOBUFFER X=MX/(MAGFACTOR*4) : Y=MY/(MAGFACTOR*4) MS=MAG_NUMBER : Screen MAG_NUMBER If MK=1 While MK=1 and MX<288 and MS=MAG_NUMBER Screen MAG_NUMBER Ink FG_COL Bar X*MAGFACTOR*4+1,Y*MAGFACTOR*4+1 To(X+1)*(MAGFACTOR*4)-1,(Y+1)*(MAGFACTOR*4)-1 Screen SCR_NUMBER F Plot X+MG_X,Y+MG_Y,FG_COL MK=Mouse Key : MS=Mouse Screen Trap Screen MS : MZ=Mouse Zone MX=X Screen(X Mouse) : MY=Y Screen(Y Mouse) X=MX/(MAGFACTOR*4) : Y=MY/(MAGFACTOR*4) Wend Else If MK=2 While MK=2 and MX<288 and MS=MAG_NUMBER Screen MAG_NUMBER Ink BG_COL Bar X*MAGFACTOR*4+1,Y*MAGFACTOR*4+1 To(X+1)*(MAGFACTOR*4)-1,(Y+1)*(MAGFACTOR*4)-1 Screen SCR_NUMBER F Plot X+MG_X,Y+MG_Y,BG_COL MK=Mouse Key : MS=Mouse Screen Trap Screen MS : MZ=Mouse Zone MX=X Screen(X Mouse) : MY=Y Screen(Y Mouse) X=MX/(MAGFACTOR*4) : Y=MY/(MAGFACTOR*4) Wend End If End If End Proc Procedure _GETMAGZONE Dim MG_WIDTH(4),MG_HEIGHT(4) For A=4 To 1 Step -1 Read MG_WIDTH(A),MG_HEIGHT(A) Next While Mouse Key : Wend Screen SCR_NUMBER Gr Writing 2 Set Line 65535 Repeat MX=X Screen(X Mouse) MY=Y Screen(Y Mouse) MX=Min(MX,SCR_WIDTH-1-MG_WIDTH(MAGFACTOR)) MY=Min(MY,SCR_HEIGHT-1-MG_HEIGHT(MAGFACTOR)) MX=Max(MX,0) : MY=Max(MY,0) P=F Point(MX,MY) Box MX,MY To MX+MG_WIDTH(MAGFACTOR),MY+MG_HEIGHT(MAGFACTOR) Box MX,MY To MX+MG_WIDTH(MAGFACTOR),MY+MG_HEIGHT(MAGFACTOR) F Plot MX,MY,P Until Mouse Key=1 Gr Writing 0 MG_X=MX : MG_Y=MY Data 17,5 Data 23,7 Data 35,11 Data 71,23 End Proc ' Procedure _TESTMAGZONES Dim MG_WIDTH(4),MG_HEIGHT(4) For A=4 To 1 Step -1 Read MG_WIDTH(A),MG_HEIGHT(A) Next MG_X=Min(MG_X,SCR_WIDTH-1-MG_WIDTH(MAGFACTOR)) MG_Y=Min(MG_Y,SCR_HEIGHT-1-MG_HEIGHT(MAGFACTOR)) MG_X=Max(MG_X,0) : MG_Y=Max(MG_Y,0) Data 17,5 Data 23,7 Data 35,11 Data 71,23 End Proc ' Procedure _DRAWGRID Screen MAG_NUMBER Paper BG_COL : Cls Ink 1,0 F=0 : SX=0 : SY=0 If MAGFACTOR=4 For A=0 To 288 Step 16 F Draw A,0 To A,96 F Draw 0,A To 288,A Next SX=MG_X For X=1 To 287 Step 16 SY=MG_Y For Y=1 To 95 Step 16 Screen SCR_NUMBER : P=F Point(SX,SY) Inc SY If P<>BGCOL Screen MAG_NUMBER : Ink P Bar X,Y To X+14,Y+14 End If Next Inc SX Next Else If MAGFACTOR=3 For A=0 To 288 Step 12 Draw A,0 To A,96 Draw 0,A To 288,A Next SX=MG_X For X=1 To 287 Step 12 SY=MG_Y For Y=1 To 94 Step 12 Screen SCR_NUMBER : P=F Point(SX,SY) Inc SY If P<>BG_COL Screen MAG_NUMBER : Ink P Bar X,Y To X+10,Y+10 End If Next Inc SX Next Else If MAGFACTOR=2 For A=0 To 288 Step 8 Draw A,0 To A,96 Draw 0,A To 288,A Next SX=MG_X For X=1 To 287 Step 8 SY=MG_Y For Y=1 To 94 Step 8 Screen SCR_NUMBER : P=F Point(SX,SY) Inc SY If P<>BG_COL Screen MAG_NUMBER : Ink P Bar X,Y To X+6,Y+6 End If Next Inc SX Next Else If MAGFACTOR=1 For A=0 To 288 Step 4 Draw A,0 To A,96 Draw 0,A To 288,A Next SX=MG_X For X=1 To 287 Step 4 SY=MG_Y For Y=1 To 94 Step 4 Screen SCR_NUMBER : P=F Point(SX,SY) Inc SY If P<>BG_COL Screen MAG_NUMBER : Ink P Bar X,Y To X+2,Y+2 End If Next Inc SX Next End If Screen MAG_NUMBER Reserve Zone 4 Ink 1 : Z=0 For A=0 To 72 Step 24 Inc F : Inc Z Box 290,A To 319,A+24 Set Zone Z,290,A To 319,A+24 Text 295,A+15,Str$(F) Next End Proc ' Procedure MAKE_V_SLIDER[Z,X1,Y1,X2,Y2,POSITIONS,POS,C1,C2] BRSIZE=1 T1#=POSITIONS T2#=Y2-Y1 BH#=T2#/T1# BH#=BH# Ink 2 Bar X1,Y1 To X2,Y2 Ink 1 _DRAW_OPT_BOX[X1-1,Y1-1,X2+1,Y2+1,C1,C2] _DRAW_OPT_BOX[X1+1,Y1+(POS*BH#),X2-1,Y1+((POS+BRSIZE)*BH#)-2,C1,C2] For BNK=1000 To 10000 Trap TS=Start(BNK) If Errtrap SLNUM=BNK Reserve As Work SLNUM,40 Exit End If Next TS=Start(SLNUM) Set Zone Z,X1,Y1 To X2,Y2 Doke TS,C1 Doke TS+2,C2 Loke TS+4,Z Loke TS+8,X1 Loke TS+12,Y1 Loke TS+16,X2 Loke TS+20,Y2 Loke TS+24,POSITIONS Loke TS+28,POS Loke TS+32,Leek(Varptr(BH#)) Loke TS+36,BRSIZE End Proc[SLNUM] Procedure TEST_V_SLIDER[SLNUM] If Mouse Key=1 TS=Start(SLNUM) Z=Leek(TS+4) If Mouse Zone=Z C1=Deek(TS) C2=Deek(TS+2) X1=Leek(TS+8) Y1=Leek(TS+12) X2=Leek(TS+16) Y2=Leek(TS+20) POSITIONS=Leek(TS+24) OLDPOS=Leek(TS+28) Loke Varptr(BH#),Leek(TS+32) BRSIZE=Leek(TS+36) While Mouse Key=1 P=POSITIONS Trap D#=((Y2-Y1)/P#) Trap POS=(Y Screen(Y Mouse)-Y1)/D# If POS<>OLDPOS If(POS=0) Ink 2 Trap Bar X1+1,Y1+(OLDPOS*BH#) To X2-1,Y1+((OLDPOS+BRSIZE)*BH#)-1 _DRAW_OPT_BOX[X1+1,Y1+(POS*BH#),X2-1,Y1+((POS+BRSIZE)*BH#)-2,C1,C2] Loke TS+28,POS OLDPOS=POS End If End If Wend End If POS=Min(Max(0,POS),POSITIONS-1) Ink 2 Trap Bar X1+1,Y1+(OLDPOS*BH#) To X2-1,Y1+((OLDPOS+BRSIZE)*BH#)-1 _DRAW_OPT_BOX[X1+1,Y1+(POS*BH#),X2-1,Y1+((POS+BRSIZE)*BH#)-2,C1,C2] Loke TS+28,POS OLDPOS=POS End If End Proc[POS] Procedure MAKE_H_SLIDER[Z,X1,Y1,X2,Y2,POSITIONS,POS,C1,C2] BRSIZE=1 T1#=POSITIONS T2#=X2-X1 BH#=T2#/T1# BH#=BH# Ink 2 Bar X1,Y1 To X2,Y2 Ink 1 _DRAW_OPT_BOX[X1-1,Y1-1,X2+1,Y2+1,C1,C2] _DRAW_OPT_BOX[X1+(POS*BH#),Y1+1,X1+((POS+BRSIZE)*BH#)-2,Y2-1,C1,C2] For BNK=1000 To 10000 Trap TS=Start(BNK) If Errtrap SLNUM=BNK Reserve As Work SLNUM,40 Exit End If Next TS=Start(SLNUM) Set Zone Z,X1,Y1 To X2,Y2 Doke TS,C1 Doke TS+2,C2 Loke TS+4,Z Loke TS+8,X1 Loke TS+12,Y1 Loke TS+16,X2 Loke TS+20,Y2 Loke TS+24,POSITIONS Loke TS+28,POS Loke TS+32,Leek(Varptr(BH#)) Loke TS+36,BRSIZE End Proc[SLNUM] Procedure TEST_H_SLIDER[SLNUM] If Mouse Key=1 TS=Start(SLNUM) Z=Leek(TS+4) If Mouse Zone=Z C1=Deek(TS) C2=Deek(TS+2) X1=Leek(TS+8) Y1=Leek(TS+12) X2=Leek(TS+16) Y2=Leek(TS+20) POSITIONS=Leek(TS+24) OLDPOS=Leek(TS+28) Loke Varptr(BH#),Leek(TS+32) BRSIZE=Leek(TS+36) While Mouse Key=1 POS=(X Screen(X Mouse)-X1)/((X2-X1)/POSITIONS) If POS<>OLDPOS If(POS=0) Ink 2 Trap Bar X1+(OLDPOS*BH#),Y1+1 To X1+((OLDPOS+BRSIZE)*BH#)-1,Y2-1 _DRAW_OPT_BOX[X1+(POS*BH#),Y1+1,X1+((POS+BRSIZE)*BH#)-2,Y2-1,C1,C2] Loke TS+28,POS OLDPOS=POS End If End If Wend End If POS=Min(Max(0,POS),POSITIONS-1)+1 Ink 2 Trap Bar X1+(OLDPOS*BH#),Y1+1 To X1+((OLDPOS+BRSIZE)*BH#)-1,Y2-1 _DRAW_OPT_BOX[X1+((POS-1)*BH#),Y1+1,X1+(((POS-1)+BRSIZE)*BH#)-2,Y2-1,C1,C2] Loke TS+28,(POS-1) End If End Proc[POS] ' Procedure _3POINTCIRCLE[X1#,Y1#,X2#,Y2#,X3#,Y3#] On Error Goto ERR M1#=-(X2#-X1#)/(Y2#-Y1#) M2#=-(X3#-X2#)/(Y3#-Y2#) ' IX1#=(X1#+X2#)/2 IY1#=(Y1#+Y2#)/2 ' IX2#=(X3#+X2#)/2 IY2#=(Y3#+Y2#)/2 ' C1#=IY1#-(M1#*IX1#) C2#=IY2#-(M2#*IX2#) ' XC#=(C2#-C1#)/(M1#-M2#) YC#=(M1#*XC#)+C1# ' R#=Sqr(Abs(((Y1#-YC#)^2)+((X1#-XC#)^2))) ' ACIRCLE[XC#,YC#,R#] ' QUIT: Pop Proc ' ERR: Resume QUIT End Proc Procedure CURVE[X1#,Y1#,X2#,Y2#,X3#,Y3#] G=10 On Error Goto ERCURVE OLDX#=X1# OLDY#=Y1# ' XSTEP1#=(X2#-X1#)/G YSTEP1#=(Y2#-Y1#)/G XSTEP2#=(X3#-X2#)/G YSTEP2#=(Y3#-Y2#)/G For C=0 To G-1 XA1#=X1#+XSTEP1#*C YA1#=Y1#+YSTEP1#*C XB1#=X2#+XSTEP2#*(C+1) YB1#=Y2#+YSTEP2#*(C+1) XA2#=X1#+XSTEP1#*(C+1) YA2#=Y1#+YSTEP1#*(C+1) XB2#=X2#+XSTEP2#*(C+2) YB2#=Y2#+YSTEP2#*(C+2) M1#=(YB1#-YA1#)/(XB1#-XA1#) M2#=(YB2#-YA2#)/(XB2#-XA2#) C1#=YA1#-(XA1#*M1#) C2#=YA2#-(XA2#*M2#) X#=(C2#-C1#)/(M1#-M2#) Y#=M1#*X#+C1# ALINE[OLDX#,OLDY#,X#,Y#] OLDX#=X# OLDY#=Y# Next ' EXCURVE: Pop Proc ERCURVE: Resume EXCURVE End Proc Procedure _DRAWSLICE[XC#,YC#,R#,æ#,ß#,STP#] Set Line 65535 If æ#=ß# OY#=YC#+R#*Sin(æ#) OX#=XC#+R#*Cos(æ#) ALINE[XC#,YC#,OX#,OY#] Pop Proc Else If ß#<æ# ß#=ß#+360 End If OY#=YC#+R#*Sin(æ#) OX#=XC#+R#*Cos(æ#) ALINE[XC#,YC#,OX#,OY#] I#=æ# Repeat I#=I#+STP# Y#=YC#+R#*Sin(I#) X#=XC#+R#*Cos(I#) ALINE[OX#,OY#,X#,Y#] OX#=X# OY#=Y# Until I#>ß# ALINE[XC#,YC#,OX#,OY#] End Proc ' Procedure _EFFECTS_OPTIONS _DRAWBOX[ZNEX1(49),ZNEY1(49),ZNEX2(49),ZNEY2(49),-1] OPT_ACTIVE=True Unpack 14 To OPT_NUMBER Screen Display OPT_NUMBER,,OPT_POSITION,, Screen OPT_NUMBER _MOUSECOLOURS Dim X1(14),X2(14),Y1(14),Y2(14) Reserve Zone 14 S=Start(56) For Z=1 To 14 X1(Z)=Leek(S) : Add S,4 Y1(Z)=Leek(S) : Add S,4 X2(Z)=Leek(S) : Add S,4 Y2(Z)=Leek(S) : Add S,4 Set Zone Z,X1(Z),Y1(Z) To X2(Z),Y2(Z) Next SRCE$="screen" : SZ=5 DEST$=FILE$(29) : DZ=10 _DRAW_OPT_BOX[X1(SZ),Y1(SZ),X2(SZ),Y2(SZ),1,3] _DRAW_OPT_BOX[X1(DZ),Y1(DZ),X2(DZ),Y2(DZ),1,3] Do Repeat MK=Mouse Key I$=Inkey$ Until I$<>"" or MK<>0 MS=Mouse Screen S=Scancode SS=Scanshift Trap Screen MS : MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=49 Exit End If Else If MS=OPT_NUMBER If MZ=1 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _EFFECTS_RIP[SRCE$,DEST$] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=2 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _EFFECTS_SPHERE[SRCE$,DEST$,100,100] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=3 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _EFFECTS_FADE[SRCE$,DEST$] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=4 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _EFFECTS_GREY[SRCE$,DEST$] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=5 _DRAW_OPT_BOX[X1(SZ),Y1(SZ),X2(SZ),Y2(SZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SRCE$="screen" SZ=MZ While Mouse Key : Wend Else If MZ=6 _DRAW_OPT_BOX[X1(SZ),Y1(SZ),X2(SZ),Y2(SZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SRCE$=FILE$(29) SZ=MZ While Mouse Key : Wend Else If MZ=7 _DRAW_OPT_BOX[X1(SZ),Y1(SZ),X2(SZ),Y2(SZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] FILESELECTOR$["","","**","*.info",0] SRCE$=Param$ SZ=MZ While Mouse Key : Wend Else If MZ=8 _DRAW_OPT_BOX[X1(SZ),Y1(SZ),X2(SZ),Y2(SZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] SRCE$="Clips:0" SZ=MZ While Mouse Key : Wend Else If MZ=9 _DRAW_OPT_BOX[X1(DZ),Y1(DZ),X2(DZ),Y2(DZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] DEST$="screen" DZ=MZ While Mouse Key : Wend Else If MZ=10 _DRAW_OPT_BOX[X1(DZ),Y1(DZ),X2(DZ),Y2(DZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] DEST$=FILE$(29) DZ=MZ While Mouse Key : Wend Else If MZ=11 _DRAW_OPT_BOX[X1(DZ),Y1(DZ),X2(DZ),Y2(DZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] FILESELECTOR$["","","**","*.info",0] DEST$=Param$ DZ=MZ While Mouse Key : Wend Else If MZ=12 _DRAW_OPT_BOX[X1(DZ),Y1(DZ),X2(DZ),Y2(DZ),3,1] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] DEST$="Clips:0" DZ=MZ While Mouse Key : Wend Else If MZ=14 _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _HELP["Effects"] _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] End If End If End If Loop Screen Close OPT_NUMBER OPT_ACTIVE=False _DRAWBOX[ZNEX1(49),ZNEY1(49),ZNEX2(49),ZNEY2(49),0] End Proc Procedure _EFFECTS_SPHERE[SRCE$,DEST$,XRADIUS,YRADIUS] While Mouse Key : Wend Change Mouse 5 If SRCE$="screen" SRCE_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff SRCE$,UNDO_NUMBER SRCE_SCR=UNDO_NUMBER End If End If ' If DEST$="screen" DEST_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff DEST$,EFCT_NUMBER DEST_SCR=EFCT_NUMBER End If End If ' Screen DEST_SCR : Screen To Front DEST_SCR Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front MAG_NUMBER ' Screen DEST_SCR : Curs Off : Flash Off Get Palette SRCE_SCR Change Mouse 5 Degree WARPLINE[100,0,319,120-XRADIUS,120+XRADIUS,SRCE_SCR,DEST_SCR] For Y#=1 To YRADIUS X#=Cos(Asin(Y#/YRADIUS))*XRADIUS WARPLINE[100+Y#,0,319,120-X#,120+X#,SRCE_SCR,DEST_SCR] WARPLINE[100-Y#,0,319,120-X#,120+X#,SRCE_SCR,DEST_SCR] Next If DEST$<>"screen" Save Iff DEST$,DEST_SCR End If Screen OPT_NUMBER Change Mouse 4 End Proc Procedure _EFFECTS_FADE[SRCE$,DEST$] While Mouse Key : Wend Change Mouse 5 If SRCE$="screen" SRCE_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff SRCE$,UNDO_NUMBER SRCE_SCR=UNDO_NUMBER End If End If ' If DEST$="screen" DEST_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff DEST$,EFCT_NUMBER DEST_SCR=EFCT_NUMBER End If End If ' Screen DEST_SCR : Screen To Front DEST_SCR Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front MAG_NUMBER ' Change Mouse 6 ' Do MK=Mouse Key MS=Mouse Screen Trap Screen MS MZ=Mouse Zone If MK=1 If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN Else If MZ=41 Pop Proc End If Else If MS=DEST_SCR Exit End If End If Loop FDCL=Point(X Screen(X Mouse),Y Screen(Y Mouse)) Change Mouse 5 For Y=0 To Screen Height-1 For X=0 To Screen Width-1 If Point(X,Y)=FDCL Screen SRCE_SCR P=Point(X,Y) Screen DEST_SCR F Plot X,Y,P End If Next Next If DEST$<>"screen" Save Iff DEST$,DEST_SCR End If Screen OPT_NUMBER Change Mouse 4 End Proc Procedure _EFFECTS_GREY[SRCE$,DEST$] While Mouse Key : Wend Change Mouse 5 If SRCE$="screen" SRCE_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff SRCE$,UNDO_NUMBER SRCE_SCR=UNDO_NUMBER End If End If ' If DEST$="screen" DEST_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff DEST$,EFCT_NUMBER DEST_SCR=EFCT_NUMBER End If End If ' Screen DEST_SCR : Screen To Front DEST_SCR Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front MAG_NUMBER ' Palette 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ' Dim CLOS(32) For A=0 To 31 Screen SRCE_SCR _CLOSEST[A,DEST_SCR,31] CLOS(A)=Param Next Change Mouse 5 For Y=0 To Screen Height-1 For X=0 To Screen Width-1 Screen SRCE_SCR P=CLOS(Point(X,Y)) Screen DEST_SCR F Plot X,Y,P Next Next If DEST$<>"screen" Save Iff DEST$,DEST_SCR End If Screen OPT_NUMBER Change Mouse 4 ' End Proc Procedure _EFFECTS_RIP[SRCE$,DEST$] While Mouse Key : Wend Change Mouse 5 If SRCE$="screen" SRCE_SCR=SCR_NUMBER Else If Param=False Pop Proc Else Load Iff SRCE$,UNDO_NUMBER SRCE_SCR=UNDO_NUMBER End If End If ' If DEST$="screen" DEST_SCR=SCR_NUMBER Else DEST_SCR=EFCT_NUMBER Screen SRCE_SCR Screen Clone DEST_SCR Save Iff DEST$,DEST_SCR Load Iff DEST$,DEST_SCR End If ' Screen DEST_SCR : Screen To Front DEST_SCR Trap Screen To Front TLB_NUMBER Trap Screen To Front OPT_NUMBER Trap Screen To Front MAG_NUMBER ' Change Mouse 5 ' 'R.I.P Filter 'Richard Wheeldon 1995 ' Pen 0 : Paper 1 Dim C(63) For X=1 To 638 For Y=1 To 198 Gosub RESET Gosub CHCK If F Gosub COMMON If TIED Gosub COMMONEDGE End If F Plot X,Y,CL Print At(0,0);X,Y,CL End If Next Next If DEST$<>"screen" Save Iff DEST$,DEST_SCR End If Screen OPT_NUMBER Change Mouse 4 Pop Proc ' CHCK: If Point(X-1,Y-1)=P F=False Else If Point(X,Y-1)=P F=False Else If Point(X+1,Y-1)=P F=False Else If Point(X-1,Y)=P F=False Else If Point(X+1,Y)=P F=False Else If Point(X-1,Y+1)=P F=False Else If Point(X,Y+1)=P F=False Else If Point(X+1,Y+1)=P F=False End If Return ' COMMON: Inc C(Point(X-1,Y-1)) Inc C(Point(X-1,Y+1)) Inc C(Point(X+1,Y-1)) Inc C(Point(X+1,Y+1)) COMMONEDGE: Inc C(Point(X-1,Y)) Inc C(Point(X+1,Y)) Inc C(Point(X,Y-1)) Inc C(Point(X,Y+1)) ' MX=0 : TIED=0 : CL=0 For C1=0 To SCR_COLOURS-1 If C(C1)>MX CL=C1 : MX=C(C1) Else If C(C1)=MX TIED=True End If Next Return ' RESET: P=Point(X,Y) F=True For C1=0 To SCR_COLOURS-1 C(C1)=0 Next Return End Proc Procedure EFFECTS_GET_CIRCLE End Proc ' Procedure _LOAD_SYMGRID_CONFIG[F$] 'SYM_ACTIVE,SYM_ROT,SYM_X,SYM_Y,SYM_ORDER,SYM_REFINX 'GRI_ACTIVE,GRID_X,GRID_Y,GRID_SX,GRID_SY Trap Load F$,100 If Errtrap Then Pop Proc S=Start(100) ' SYM_ACTIVE=Leek(S) : Add S,4 SYM_ROT=Leek(S) : Add S,4 SYM_X=Leek(S) : Add S,4 SYM_Y=Leek(S) : Add S,4 SYM_ORDER=Leek(S) : Add S,4 SYM_REFINX=Leek(S) : Add S,4 ' GRID_ACTIVE=Leek(S) : Add S,4 GRID_X=Leek(S) : Add S,4 GRID_Y=Leek(S) : Add S,4 GRID_SX=Leek(S) : Add S,4 GRID_SY=Leek(S) ' Erase 100 End Proc Procedure _SAVE_SYMGRID_CONFIG[F$] 'SYM_ACTIVE,SYM_ROT,SYM_X,SYM_Y,SYM_ORDER,SYM_REFINX 'GRID_ACTIVE,GRID_X,GRID_Y,GRID_SX,GRID_SY Trap Reserve As Data 100,44 If Errtrap Then Pop Proc S=Start(100) ' Loke S,SYM_ACTIVE : Add S,4 Loke S,SYM_ROT : Add S,4 Loke S,SYM_X : Add S,4 Loke S,SYM_Y : Add S,4 Loke S,SYM_ORDER : Add S,4 Loke S,SYM_REFINX : Add S,4 ' Loke S,GRID_ACTIVE : Add S,4 Loke S,GRID_X : Add S,4 Loke S,GRID_Y : Add S,4 Loke S,GRID_SX : Add S,4 Loke S,GRID_SY ' Trap Save F$,100 Erase 100 End Proc Procedure _READCONFIGFILE End Proc Procedure MOUSEREAD[HREG] TS=Screen Screen SCR_NUMBER MSE_OCX=MSE_CX MSE_OCY=MSE_CY If MSE_READX Then MSE_CX=Peek(HREG+1) If MSE_READY Then MSE_CY=Peek(HREG) MSE_DX=MSE_CX-MSE_OCX MSE_DY=MSE_CY-MSE_OCY If MSE_DX<-127 Then Add MSE_DX,256 If MSE_DX>127 Then Add MSE_DX,-256 If MSE_DY<-127 Then Add MSE_DY,256 If MSE_DY>127 Then Add MSE_DY,-256 If MSE_MX>MSE_MXX Then MSE_MX=MSE_MXX If MSE_MXMSE_MXY Then MSE_MY=MSE_MXY If MSE_MY127 Add MSE_DX,-256 End If If MSE_DY<-127 Add MSE_DY,256 End If If MSE_DY>127 Add MSE_DY,-256 End If If MSE_MX>MSE_MXX MSE_MX=MSE_MXX End If If MSE_MXMSE_MXY MSE_MY=MSE_MXY End If If MSE_MYT#*D# Ink I : Add I,1,2 To SCR_COLOURS-1 T#=T#+GRF_VAL(X,Y) Inc X If X>GRF_MX Inc Y : X=0 If Y>GRF_MY F=False End If End If End If End If Polygon XMID,YMID To XMID+XRAD*Cos(A),YMID+YRAD*Sin(A) To XMID+XRAD*Cos(A+1),YMID+YRAD*Sin(A+1) Next End Proc Procedure GRAPH_3DPIE TTL=0 For Y=0 To GRF_MY For X=0 To GRF_MX TTL=TTL+GRF_VAL(X,Y) Next Next ' D#=360.0/TTL Degree Ink 1 ' XMID=(GRF_WIDTH/2)+GRF_TLX YMID=(GRF_HEIGHT/3)+GRF_TLY XRAD=GRF_WIDTH/2 YRAD=GRF_HEIGHT/3 ' 'X,Y,Total,Angle,Ink,Flag X=0 : Y=0 : T#=0 : I=2 : F=True For A=0 To 360 If F If A>T#*D# Ink I : Add I,1,2 To SCR_COLOURS-1 T#=T#+GRF_VAL(X,Y) Inc X If X>GRF_MX Inc Y : X=0 If Y>GRF_MY F=False End If End If End If End If Polygon XMID,YMID To XMID+XRAD*Cos(A),YMID+YRAD*Sin(A) To XMID+XRAD*Cos(A+1),YMID+YRAD*Sin(A+1) If A<180 Polygon XMID+XRAD*Cos(A),YMID+YRAD*Sin(A) To XMID+XRAD*Cos(A+1),YMID+YRAD*Sin(A+1) To XMID+XRAD*Cos(A+1),YMID+YRAD+YRAD*Sin(A+1) To XMID+XRAD*Cos(A),YMID+YRAD+YRAD*Sin(A) End If Next End Proc Procedure GRAPH_3DSLOPEDBAR XG#=GRF_WIDTH/(5*(GRF_MX)) YG#=GRF_HEIGHT/(3*(GRF_MX)) ' BW#=Abs((GRF_WIDTH-(XG#*(GRF_MY+1)))/(GRF_MX)) BH#=Abs((GRF_HEIGHT-((GRF_MY+1)*YG#))/GRF_MV) ' X1#=GRF_TLX+((GRF_MY+1)*XG#) Y1#=GRF_BRY-((GRF_MY+1)*YG#) Ink 0 Draw X1#,Y1# To X1#,GRF_TLY Draw X1#,Y1# To GRF_BRX,Y1# Draw X1#,Y1# To GRF_TLX,GRF_BRY ' I=1 For Y=GRF_MY To 0 Step -1 Add I,1,2 To SCR_COLOURS-1 For X=0 To GRF_MX-1 ' XL1#=GRF_TLX+(X)*BW#+(Y*XG#) YL1#=GRF_BRY-(GRF_VAL(X,Y)*BH#)-(Y*YG#) ' XL2#=GRF_TLX+(X+1)*BW#-1+(Y*XG#) YL2#=GRF_BRY-(GRF_VAL(X+1,Y)*BH#)-(Y*YG#) ' XL3#=GRF_TLX+(X+1)*BW#-1+((Y+1)*XG#) YL3#=GRF_BRY-(GRF_VAL(X+1,Y)*BH#)-((Y+1)*YG#) ' XL4#=GRF_TLX+(X)*BW#+((Y+1)*XG#) YL4#=GRF_BRY-(GRF_VAL(X,Y)*BH#)-((Y+1)*YG#) ' XF1#=GRF_TLX+(X)*BW#+(Y*XG#) YF1#=GRF_BRY-(Y*YG#) ' XF2#=GRF_TLX+(X+1)*BW#-1+(Y*XG#) YF2#=GRF_BRY-(Y*YG#) ' XF3#=GRF_TLX+(X+1)*BW#-1+((Y+1)*XG#) YF3#=GRF_BRY-((Y+1)*YG#) ' XF4#=GRF_TLX+(X)*BW#+((Y+1)*XG#) YF4#=GRF_BRY-((Y+1)*YG#) ' Ink I Polygon XF2#,YF2# To XF3#,YF3# To XL3#,YL3# To XL2#,YL2# Polygon XF1#,YF1# To XF2#,YF2# To XL2#,YL2# To XL1#,YL1# Polygon XL1#,YL1# To XL2#,YL2# To XL3#,YL3# To XL4#,YL4# Ink 0 Polyline XL1#,YL1# To XL2#,YL2# To XL3#,YL3# To XL4#,YL4# To XL1#,YL1# Polyline XF1#,YF1# To XF2#,YF2# To XL2#,YL2# To XL1#,YL1# Polyline XF2#,YF2# To XF3#,YF3# To XL3#,YL3# To XL2#,YL2# Next Next End Proc Procedure GRAPH_3DLINE XG#=GRF_WIDTH/(5*(GRF_MX)) YG#=GRF_HEIGHT/(3*(GRF_MX)) ' BW#=Abs((GRF_WIDTH-(XG#*(GRF_MY+1)))/(GRF_MX)) BH#=Abs((GRF_HEIGHT-((GRF_MY+1)*YG#))/GRF_MV) ' X1#=GRF_TLX+((GRF_MY+1)*XG#) Y1#=GRF_BRY-((GRF_MY+1)*YG#) Ink 0 Draw X1#,Y1# To X1#,GRF_TLY Draw X1#,Y1# To GRF_BRX,Y1# Draw X1#,Y1# To GRF_TLX,GRF_BRY ' I=1 For Y=GRF_MY To 0 Step -1 Add I,1,2 To SCR_COLOURS-1 For X=0 To GRF_MX-1 ' XL1#=GRF_TLX+(X)*BW#+(Y*XG#) YL1#=GRF_BRY-(GRF_VAL(X,Y)*BH#)-(Y*YG#) ' XL2#=GRF_TLX+(X+1)*BW#-1+(Y*XG#) YL2#=GRF_BRY-(GRF_VAL(X+1,Y)*BH#)-(Y*YG#) ' XL3#=GRF_TLX+(X+1)*BW#-1+((Y+1)*XG#) YL3#=GRF_BRY-(GRF_VAL(X+1,Y)*BH#)-((Y+1)*YG#) ' XL4#=GRF_TLX+(X)*BW#+((Y+1)*XG#) YL4#=GRF_BRY-(GRF_VAL(X,Y)*BH#)-((Y+1)*YG#) ' XF1#=GRF_TLX+(X)*BW#+(Y*XG#) YF1#=GRF_BRY-(Y*YG#) ' XF2#=GRF_TLX+(X+1)*BW#-1+(Y*XG#) YF2#=GRF_BRY-(Y*YG#) ' XF3#=GRF_TLX+(X+1)*BW#-1+((Y+1)*XG#) YF3#=GRF_BRY-((Y+1)*YG#) ' XF4#=GRF_TLX+(X)*BW#+((Y+1)*XG#) YF4#=GRF_BRY-((Y+1)*YG#) ' Ink I Polygon XL1#,YL1# To XL2#,YL2# To XL3#,YL3# To XL4#,YL4# Ink 0 Polyline XL1#,YL1# To XL2#,YL2# To XL3#,YL3# To XL4#,YL4# To XL1#,YL1# Next Next End Proc ' Procedure GRAPH_RANDOMDATA GRF_MX=5 GRF_MY=4 For X=0 To GRF_MX For Y=0 To GRF_MY GRF_VAL(X,Y)=Rnd(500) GRF_MV=Max(GRF_MV,GRF_VAL(X,Y)) Next Next End Proc Procedure GRAPH_LOADDATA[F$] Trap Open In 1,F$ If Errtrap=0 GRF_MY=-1 While Not Eof(1) I$=Input$(1,1) If(I$>="0" and I$<="9") V$=V$+I$ Else If I$=Chr$(9) : Rem tab If V$<>"" GRF_VAL(CX,CY)=Val(V$) Print GRF_VAL(CX,CY), GRF_MV=Max(GRF_MV,GRF_VAL(CX,CY)) V$="" Inc CX End If Else If I$=Chr$(10) : Rem lf Inc VN If V$<>"" GRF_VAL(CX,CY)=Val(V$) Print GRF_VAL(CX,CY) GRF_MV=Max(GRF_MV,GRF_VAL(CX,CY)) GRF_MX=Max(GRF_MX,CX) V$="" Inc CY CX=0 Inc GRF_MY Else Print Inc CY Inc GRF_MY CX=0 End If End If If CX>50 or CY>50 Close GRAPH_RANDOMDATA Exit End If Wend End If End Proc ' Procedure GRAPH_SETSIZE Gr Writing 2 Repeat : Until Mouse Key X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) P=Point(X1,Y1) While Mouse Key X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) Box X1,Y1 To X2,Y2 Box X1,Y1 To X2,Y2 Wend GRF_TLX=Min(X1,X2) GRF_TLY=Min(Y1,Y2) GRF_BRX=Max(X1,X2) GRF_BRY=Max(Y1,Y2) GRF_WIDTH=Abs(X2-X1)+1 GRF_HEIGHT=Abs(Y2-Y1)+1 Gr Writing 1 Trap F Plot X1,Y1,P _UPDATEUNDOBUFFER End Proc Procedure GRAPH_GETMAXVAL For X=0 To GRF_MX For Y=0 To GRF_MY GRF_MV=Max(GRF_MV,GRF_VAL(X,Y)) Next Next End Proc ' Procedure _READ_FONT_DIR Change Mouse 5 If FONTS=ALL Trap Get Fonts Else If FONTS=ROM Trap Get Rom Fonts Else If FONTS=DISK Trap Get Disc Fonts End If If Errtrap Change Mouse 4 Pop Proc End If _FONT_REQ_MESSAGE["Initialising data"] Trap F$=Font$(1) If Errtrap Change Mouse 4 Pop Proc End If C1=1 Do If Font$(C1)="" MXFONTS=C1-1 Exit End If Inc C1 Loop Dim F$(MXFONTS),FONTNAME$(MXFONTS),T_FONTNUM(MXFONTS) For C1=1 To MXFONTS F$(C1)=Font$(C1) FONTNAME$(C1)=Left$(F$(C1),Instr(F$(C1),".")-1) T_FONTNUM(C1)=C1 Next _FONT_REQ_MESSAGE["Sorting fonts"] For C1=MXFONTS-1 To 1 Step -1 FLAG=True For C2=1 To C1 If FONTNAME$(C2)>FONTNAME$(C2+1) Swap FONTNAME$(C2),FONTNAME$(C2+1) Swap F$(C2),F$(C2+1) Swap T_FONTNUM(C2),T_FONTNUM(C2+1) FLAG=False End If Next Exit If FLAG Next MXNAMES=1 : MXSIZES=1 : T_MXSIZES=1 For C1=2 To MXFONTS If FONTNAME$(C1)=FONTNAME$(C1-1) Inc T_MXSIZES Else MXSIZES=Max(MXSIZES,T_MXSIZES) Inc MXNAMES : T_MXSIZES=1 End If Next If T_MXSIZES>1 MXSIZES=Max(MXSIZES,T_MXSIZES) End If Dim FONTSIZES(MXNAMES,MXSIZES) Dim FONTNUM(MXNAMES,MXSIZES) Dim MXFONTSIZE(MXNAMES) ' SIZE_COUNT=1 FONTSIZES(1,1)=Val(Mid$(F$(1),31,3)) FONTNUM(1,1)=T_FONTNUM(1) NAME_COUNT=1 For C1=2 To MXFONTS If FONTNAME$(C1)=FONTNAME$(C1-1) Inc SIZE_COUNT FONTSIZES(NAME_COUNT,SIZE_COUNT)=Val(Mid$(F$(C1),31,3)) Else MXFONTSIZE(NAME_COUNT)=SIZE_COUNT Inc NAME_COUNT SIZE_COUNT=1 FONTSIZES(NAME_COUNT,SIZE_COUNT)=Val(Mid$(F$(C1),31,3)) FONTNAME$(NAME_COUNT)=FONTNAME$(C1) End If FONTNUM(NAME_COUNT,SIZE_COUNT)=T_FONTNUM(C1) Next Dec C1 If FONTNAME$(C1)=FONTNAME$(C1-1) MXFONTSIZE(NAME_COUNT)=SIZE_COUNT End If _FONT_REQ_MESSAGE["Sorting Font Sizes"] For C1=1 To MXNAMES If MXFONTSIZE(C1)>1 For C2=MXFONTSIZE(C1)-1 To 1 Step -1 FLAG=True For C3=1 To C2 If FONTSIZES(C1,C3)>FONTSIZES(C1,C3+1) Swap FONTSIZES(C1,C3),FONTSIZES(C1,C3+1) Swap FONTNUM(C1,C3),FONTNUM(C1,C3+1) FLAG=False End If Next Exit If FLAG Next End If Next STRTNAME=1 : LASTNAME=11 : C2=0 STRTSIZE=1 : LASTSIZE=11 : C4=0 If MXNAMES<11 Then LASTNAME=MXNAMES If MXFONTSIZES<11 Then LASTSIZE=MXFONTSSIZE CURNAME=1 Trap Open Out 1,FILE$(52) ERT=Errtrap If ERT If ERT=81 Trap Mkdir Left$(TMP_DIR$,Len(TMP_DIR$)-1) Open Out 1,FILE$(52) End If End If Set Input 13,10 Print #1,MXNAMES Print #1,MXSIZES For C1=1 To MXNAMES Print #1,FONTNAME$(C1) Print #1,MXFONTSIZE(C1) For C2=1 To MXFONTSIZE(C1) Print #1,FONTSIZES(C1,C2) Print #1,FONTNUM(C1,C2) Next Next Close 1 Change Mouse 4 End Proc Procedure _GET_FONTS_FILE Change Mouse 5 Dim X1(16),Y1(16),X2(16),Y2(16) Trap F$=Font$(1) If Errtrap Change Mouse 4 Pop Proc[0] End If Open In 1,FILE$(52) Set Input 13,10 Input #1,MXNAMES Input #1,MXSIZES Dim FONTNAME$(MXNAMES),MXFONTSIZE(MXNAMES) Dim FONTSIZES(MXNAMES,MXSIZES),FONTNUM(MXNAMES,MXSIZES) For C1=1 To MXNAMES Input #1,FONTNAME$(C1) Input #1,MXFONTSIZE(C1) For C2=1 To MXFONTSIZE(C1) Input #1,FONTSIZES(C1,C2) Input #1,FONTNUM(C1,C2) Next Next Close 1 STRTNAME=1 : LASTNAME=8 : C2=0 STRTSIZE=1 : LASTSIZE=11 : C4=0 If MXNAMES<11 Then LASTNAME=MXNAMES If MXFONTSIZES<11 Then LASTSIZE=MXFONTSSIZE CURNAME=1 : CURSIZE=1 Unpack 11 To FSEL_NUMBER Screen FSEL_NUMBER Screen Display FSEL_NUMBER,,TLB_POSITION-Screen Height-1,, _MOUSECOLOURS Gosub _INITZONES FONTSHOW=NONE Wind Open 1,336,12,26,8 : Curs Off Wind Open 2,576,12,4,8 : Curs Off ' If MXNAMES>8 MAKE_V_SLIDER[14,X1(14)+1,Y1(14)+1,X2(14)-1,Y2(14)-1,MXNAMES-7,0,3,1] S1=Param Else MAKE_V_SLIDER[14,X1(14)+1,Y1(14)+1,X2(14)-1,Y2(14)-1,1,0,3,1] S1=Param End If If MXFONTSIZES>8 MAKE_V_SLIDER[16,X1(16)+1,Y1(16)+1,X2(16)-1,Y2(16)-1,MXNAMES-7,0,3,1] S2=Param Else MAKE_V_SLIDER[16,X1(16)+1,Y1(16)+1,X2(16)-1,Y2(16)-1,1,0,3,1] S2=Param End If Gosub REDRAW Change Mouse 4 Do MK=Mouse Key : MS=Mouse Screen Trap Screen MS : MZ=Mouse Zone MY=Y Screen(Y Mouse) : MX=X Screen(X Mouse) If MK=1 If MS=FSEL_NUMBER If MZ=1 : Rem Ok _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Pop Proc[FONTNUM(CURNAME,CURSIZE)] Else If MZ=2 : Rem cancel _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Pop Proc[NONE] Else If MZ=7 : Rem rom _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Pop Proc[-ROM] Else If MZ=8 : Rem disk _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Pop Proc[-DISK] Else If MZ=9 : Rem rom and disk _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] Pop Proc[-ALL] Else If MZ=10 : Rem rom If FONTSHOW=ROM _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] FONTSHOW=NONE Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _DRAW_OPT_BOX[X1(11),Y1(11),X2(11),Y2(11),3,1] FONTSHOW=ROM End If Else If MZ=11 : Rem all If FONTSHOW=ALL _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] FONTSHOW=NONE Else _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] _DRAW_OPT_BOX[X1(10),Y1(10),X2(10),Y2(10),3,1] FONTSHOW=ALL End If Else If MZ=12 : Rem current _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),1,3] NUM=FONTNUM(CURNAME,CURSIZE) Gosub _SHOWFONT While Mouse Key : Wend _DRAW_OPT_BOX[X1(MZ),Y1(MZ),X2(MZ),Y2(MZ),3,1] Else If MZ=13 : Rem names If((MY-3)/8)+STRTNAME-1<=MXNAMES CURNAME=((MY-3)/8)+STRTNAME-1 Gosub REDRAW End If Else If MZ=14 : Rem name slider TEST_V_SLIDER[S1] STRTNAME=Param+1 LASTNAME=Min(STRTNAME+7,MXNAMES) CURNAME=Min(CURNAME,LASTNAME) CURNAME=Max(CURNAME,STRTNAME) Gosub REDRAW Else If MZ=15 : Rem sizes If(MY-3)/8+STRTSIZE-1<=MXFONTSIZE(CURNAME) CURSIZE=(MY-3)/8+STRTSIZE-1 Gosub REDRAW End If Else If MZ=16 : Rem sizes slider TEST_V_SLIDER[S2] STRTSIZE=Param+1 LASTSIZE=Min(STRTSIZE+7,MXFONTSSIZES) CURSIZE=Min(CURSIZE,LASTNAME) CURSIZE=Max(CURSIZE,STRTNAME) Gosub REDRAW End If While Mouse Key : Wend Else If MS=TLB_NUMBER If MZ=5 _DRAG_SCREEN End If End If End If Loop ' REDRAW: Ink 2 : Bar 100,23 To 200,31 Bar 50,34 To 200,42 Ink 0,2 : Text 50,41,FONTNAME$(CURNAME) Text 102,30,Str$(FONTSIZES(CURNAME,CURSIZE))-" " Text 125,19,Mid$(Font$(FONTNUM(CURNAME,CURSIZE)),35,4) Window 2 : Inverse Off : Paper 2 : Pen 0 : Clw Window 1 : Inverse Off : Paper 2 : Pen 0 : Clw : C2=0 If FONTSHOW=ALL NUM=FONTNUM(CURNAME,CURSIZE) Gosub _SHOWFONT Else If FONTSHOW=ROM If Mid$(Font$(FONTNUM(CURNAME,CURSIZE)),35,4)="Rom " NUM=FONTNUM(CURNAME,CURSIZE) Gosub _SHOWFONT End If End If For C1=STRTNAME To LASTNAME If C1=CURNAME Inverse On Print At(0,C2)+FONTNAME$(C1); : Inc C2 Window 2 If MXFONTSIZE(C1)>11 For C3=STRTSIZE To LASTSIZE If FONTSIZES(C1,C3) Locate 0,C4 Print FONTSIZES(C1,C3); Inc C4 End If Next Else For C3=1 To MXFONTSIZE(C1) Locate 0,C3-1 If C3=CURSIZE Inverse On Else Inverse Off End If Print FONTSIZES(C1,C3); Next End If Window 1 Else Inverse Off Print At(0,C2)+FONTNAME$(C1); : Inc C2 End If Next Return _INITZONES: Reserve Zone 16 For C1=1 To 16 Read X1(C1),Y1(C1),X2(C1),Y2(C1) Set Zone C1,X1(C1),Y1(C1) To X2(C1),Y2(C1) Next Return Data 0,11,52,21 Data 0,22,52,32 Data 53,11,202,21 Data 53,22,202,32 Data 0,33,202,43 Data 0,44,243,76 Data 218,11,319,21 Data 218,22,319,32 Data 218,33,319,43 Data 259,44,319,54 Data 259,55,319,65 Data 259,66,319,76 Data 320,11,551,76 Data 552,11,566,76 Data 567,11,624,76 Data 625,11,639,76 ' _SHOWFONT: Clip X1(6)+2,Y1(6)+1 To X2(6)-2,Y2(6)-1 Ink 2 Bar X1(6)+2,Y1(6)+1 To X2(6)-2,Y2(6)-1 Trap Set Font NUM Ink 0,2 Text 3,71,TEST_TEXT$ Set Font 0 Wait Vbl Clip Return End Proc Procedure _SET_FONT_REQ_SCREEN Screen Open FSEL_NUMBER,640,24,4,Hires Screen FSEL_NUMBER Screen Display FSEL_NUMBER,,TLB_POSITION-Screen Height-1,, _MOUSECOLOURS Curs Off : Flash Off : Paper 2 : Cls Palette $0,$BBB,$888,$444 _DRAW_OPT_BOX[0,0,639,23,1,3] End Proc Procedure _FONT_REQ_MESSAGE[_TEXT$] Screen FSEL_NUMBER Paper 2 : Pen 0 Print At(1,1)+Space$(78) Centre At(,1)+_TEXT$ End Proc ' Procedure _MAKEFRACT Screen SCR_NUMBER While Mouse Key : Wend Repeat : Until Mouse Key Gr Writing 2 X1=X Screen(X Mouse) Y1=Y Screen(Y Mouse) Trap P=Point(X1,Y1) While Mouse Key X2=X Screen(X Mouse) Y2=Y Screen(Y Mouse) Box X1,Y1 To X2,Y2 Box X1,Y1 To X2,Y2 Wend Change Mouse 5 Fr Position FR_POSX,FR_POSY Trap Fr Window Min(X1,X2),Min(Y1,Y2),Abs(X1-X2),Abs(Y1-Y2) If Errtrap Fr Window SCR_NUMBER End If Fr Step FR_STEPX,FR_STEPY If FR_MAND Trap Fr Mandelbrot SCR_COLOURS-1 Else Trap Fr Julia SCR_COLOURS-1,FR_CR,FR_CI End If Change Mouse 4 End Proc ' Procedure BRUSH_SCALE[W,H] W=Max(W,1) : H=Max(H,1) Change Mouse 5 If SCR_RES=Hires Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,640),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Screen Open EFCT_NUMBER,Max(BRUSH_WIDTH,640),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Else Screen Open BLOCK_NUMBER,Max(BRUSH_WIDTH,320),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED Screen Open EFCT_NUMBER,Max(BRUSH_WIDTH,320),Max(BRUSH_HEIGHT,256),SCR_COLOURS,SCR_RES+SCR_LACED End If ' Screen To Back BLOCK_NUMBER Screen To Back EFCT_NUMBER ' Screen BLOCK_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB ' Screen EFCT_NUMBER Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB ' Screen EFCT_NUMBER Zoom BLOCK_NUMBER,0,0,BRUSH_WIDTH,BRUSH_HEIGHT To EFCT_NUMBER,0,0,W,H ' BRUSH_WIDTH=W BRUSH_HEIGHT=H BRUSH_X=Min(BRUSH_X,BRUSH_WIDTH) BRUSH_Y=Min(BRUSH_Y,BRUSH_HEIGHT) Get Bob BRUSH_BOB,0,0 To BRUSH_WIDTH,BRUSH_HEIGHT Hot Spot BRUSH_BOB,BRUSH_X,BRUSH_Y Screen Close BLOCK_NUMBER Screen Close EFCT_NUMBER Limit Mouse 0,0 To 1000,1000 Screen OPT_NUMBER Change Mouse 4 End Proc Procedure BRUSH_ROT[CLOCKWISE] Change Mouse 5 Auto View Off M=Max(BRUSH_WIDTH,BRUSH_HEIGHT) Screen Open EFCT_NUMBER,Max(BRUSH_WIDTH,320),BRUSH_HEIGHT+8,32,Lowres Screen EFCT_NUMBER : Flash Off : Curs Off : Paper 0 : Cls Hot Spot BRUSH_BOB,0,0 Paste Bob 0,0,BRUSH_BOB Screen Open TEMP_NUMBER,Max(BRUSH_WIDTH,320),BRUSH_HEIGHT,32,Lowres Screen TEMP_NUMBER : Flash Off : Curs Off : Paper 0 : Cls Screen To Back TEMP_NUMBER Screen To Back EFCT_NUMBER Get Palette 0 SW#=BRUSH_WIDTH SH#=BRUSH_HEIGHT S1#=SW#/SH# S2#=1.0/S1# If CLOCKWISE For X1#=0 To BRUSH_WIDTH-1 Y2#=BRUSH_HEIGHT-1-X1#*S2# For Y1#=0 To BRUSH_HEIGHT-1 X2#=Y1#*S1# Screen EFCT_NUMBER P=Point(X2#,Y2#) Screen TEMP_NUMBER Trap Plot X1#,Y1#,P Next Next Else For X1#=0 To BRUSH_WIDTH-1 Y2#=X1#*S2# For Y1#=0 To BRUSH_HEIGHT-1 X2#=BRUSH_WIDTH-Y1#*S1# Screen EFCT_NUMBER P=Point(X2#,Y2#) Screen TEMP_NUMBER Trap Plot X1#,Y1#,P Next Next End If Get Bob BRUSH_BOB,0,0 To BRUSH_WIDTH-1,BRUSH_HEIGHT-1 Screen Close 1 Screen Close 2 Wait Vbl Auto View On Change Mouse 4 End Proc Procedure BRUSH_SAVE[F$] Change Mouse 5 Auto View Off Screen Open UNDO_TEMP_NUMBER,BRUSH_WIDTH,BRUSH_HEIGHT,SCR_COLOURS,SCR_RES+SCR_LACED Screen UNDO_TEMP_NUMBER : Curs Off : Flash Off : Paper 0 : Cls Get Palette SCR_NUMBER Paste Bob 0,0,BRUSH_BOB Screen To Back UNDO_TEMP_NUMBER Trap Save Iff F$,UNDO_TEMP_NUMBER ERRT=Errtrap Trap Screen Close UNDO_TEMP_NUMBER Auto View On Change Mouse 4 End Proc[ERRT] Procedure BRUSH_LOAD[F$] Change Mouse 5 Auto View Off Trap Load Iff F$,UNDO_TEMP_NUMBER ERRT=Errtrap If ERRT=0 Screen UNDO_TEMP_NUMBER Get Bob BRUSH_BOB,0,0 To Screen Width-1,Screen Height-1 End If Trap Screen Close UNDO_TEMP_NUMBER Change Mouse 4 End Proc[ERRT]