home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 42 / af042a.adf / Sprite_Editor1_3.AMOS / Sprite_Editor1_3.amosSourceCode < prev   
AMOS Source Code  |  1992-02-21  |  40KB  |  1,984 lines

  1. Set Buffer 11
  2. Bgrab 1
  3. A#=1.0
  4. 'Break Off 
  5. On Error Goto GENERALERROR
  6. ' do a Close Editor here if you desperately want more memory, but be 
  7. ' warned, there is then no memory checking, so it could bomb out ! 
  8. Dim C(7),C2(7),C3(7),SX(7),ST(7),NC(7),RGB(63),REZ$(7),OK$(1)
  9. Dim LINE$(5),BUTTON$(2) : Rem for use with alert box routine 
  10. OK$(0)=" " : OK$(1)="*"
  11. NCOLS=16 : XSIZE=32 : YSIZE=32
  12. CVOL=62 : Rem click volume 
  13. APRD=6
  14. AIR=4
  15. STXSIZE=32 : STYSIZE=32 : STNCOLS=16
  16. TPWIN=0
  17. LFTWIN=0
  18. REZ=1
  19. XS=1
  20. IN=1
  21. FC=15
  22. BC=2
  23. FP=0
  24. LEFTC=1 : RIGHTC=0
  25. MDE=0 : Rem draw mode
  26. Get Block 1,0,0,1,1 : Get Block 2,0,0,1,1
  27. Fade 1
  28. Rem Amos Sprite Editor V1.1 for AMOS1.3  
  29. Rem By Aaron Fothergill
  30. Rem Shadow Software 1990 
  31. Rem for Mandarin/Jawx Software 
  32. For A=0 To 7 : Read SX(A),NC(A),ST(A),REZ$(A) : Next A
  33. Data 320,8,Lowres,"Lowres 8 "
  34. Data 320,16,Lowres,"Lowres 16"
  35. Data 320,32,Lowres,"Lowres 32"
  36. Data 320,64,Lowres,"Lowres 64"
  37. Data 640,2,Hires,"Hires 2  "
  38. Data 640,4,Hires,"Hires 4  "
  39. Data 640,8,Hires,"Hires 8  "
  40. Data 640,16,Hires,"Hires 16 "
  41. Auto View Off 
  42. TITLEBAR
  43. Auto View Off 
  44. Gosub SHWPSTE
  45. CHANGEREZ
  46. SPDISP=0
  47. Screen To Front 1
  48. Limit Mouse 
  49. Screen 1
  50. CHANGEREZ
  51. HILITE[21]
  52. Screen 0
  53. Limit Mouse 
  54. Reserve Zone 1
  55. SETBUTZONE
  56. SHWSPRITES[IN]
  57. SHWFILL[FP]
  58. Rem set up drawing screen zones
  59. Gosub STORE
  60. Do 
  61.    Screen 1
  62.    If XSIZE mod 16>0
  63.       XSIZE=(XSIZE/16)*16+16
  64.       XSIZE=Min(96,XSIZE)
  65.    End If 
  66.    If XSIZE>32 or YSIZE>32
  67.       BIGSPR=1
  68.       TPWO=-1 : LFTWO=-1
  69.       LFTWIN=Max(0,Min(LFTWIN,XSIZE-32))
  70.       TPWIN=Max(0,Min(TPWIN,YSIZE-32))
  71.    Else 
  72.       BIGSPR=0
  73.       LFTWIN=0
  74.       TPWIN=0
  75.    End If 
  76.    If NREZ=1
  77.       If SPDISP=1
  78.          Put Block 5,160*XS,7
  79.          SPDISP=0
  80.       End If 
  81.       Get Block 1,160*XS,7,XSIZE,YSIZE
  82.    End If 
  83.    Wait Vbl 
  84.    Reserve Zone 8
  85.    Set Zone 1,278*XS,3 To 310*XS,130
  86.    FASTZOOM
  87.    BXES
  88.    FASTZOOM
  89.    BIGBARS
  90.    PALDRAW
  91.    Screen To Front 1
  92.    Auto View On 
  93.    NREZ=0
  94.    MOF=1
  95.    FXSCRN
  96.    INO=IN
  97.    While NREZ=0
  98.       X=X Screen(X Mouse) : Y=Y Screen(Y Mouse) : K=Mouse Key
  99.       SCRNCHK[X,Y]
  100.       Z=Mouse Zone : X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  101.       SHWSPO=SHWSP
  102.       If SCRN=0 and((Z>44 and Z<50) or Z=39 or Z=40 or Z=9) and SPDISP=0 and IN<=Length(1)
  103.          GMDE=0
  104.          If Z=9
  105.             GMDE=1
  106.          End If 
  107.          SHWSP=1
  108.       Else 
  109.          SHWSP=0
  110.       End If 
  111.       If SPDISP=0
  112.          If IN<>INO
  113.             SHWSPO=-1
  114.          End If 
  115.          INO=IN
  116.          If SHWSP<>SHWSPO and SPDISP=0
  117.             If SHWSP=1
  118.                Screen 1
  119.                If SHWSPO=0
  120.                   Get Block 5,160*XS,7,96,128
  121.                   B5=1
  122.                End If 
  123.                Clip 160*XS,7 To 160*XS+95,135
  124.                Ink 0 : Bar 160*XS,7 To 160*XS+95,135
  125.                If GMDE=0
  126.                   Paste Bob 160*XS,7,IN
  127.                Else 
  128.                   Sprite 8,X Hard(1,160*XS),Y Hard(1,7),IN
  129.                End If 
  130.                Screen 0
  131.             Else 
  132.                If B5
  133.                   TS=Screen
  134.                   Screen 1
  135.                   Put Block 5,160*XS,7
  136.                   Sprite Off 
  137.                   Clip 
  138.                   Screen TS
  139.                End If 
  140.             End If 
  141.          End If 
  142.       End If 
  143.       If((SCRN=0 and Z>10 and Z<19) or MDE=12) and SPDISP=0 and MDE<>13
  144.          TS=Screen
  145.          Screen 1
  146.          XT=X : YT=Y : HTX=HX : HTY=HY
  147.          X=(HX-LFTWIN)*MP+16 : Y=7+(HY-TPWIN)*MP
  148.          Gosub GTBACK
  149.          MT=MDE
  150.          LC=LEFTC : RC=RIGHTC : LEFTC=NCOLS-1-Point(160*XS+HX,7+HY) : RIGHTC=LEFTC : MDE=0
  151.          Gosub PLTPNT
  152.          Wait Vbl 
  153.          Put Block 1,160*XS,7
  154.          X=XT : Y=YT : HX=HTX : HY=HTY
  155.          MDE=MT : LEFTC=LC : RIGHTC=RC
  156.          FASTZOOM
  157.          Screen TS
  158.       End If 
  159.       A$=Inkey$
  160.       If A$<>""
  161.  SC=Scancode
  162. SH=Scanshift
  163.          Gosub KEYIN
  164.       End If 
  165.       K=Mouse Key
  166.       If K=0
  167.          MOF=1 : TICK=0
  168.       Else 
  169.          KPR=1
  170.       End If 
  171.       If K=2 and MDE<>10
  172.          DRG=1
  173.       End If 
  174.       If(X<>XMSO or Y<>YMSO) and KPR=0 and SHWSP=0
  175.          SC=Screen
  176.          Screen 1
  177.          Put Block 1,160*XS,7
  178.          FASTZOOM
  179.          Screen SC
  180.       End If 
  181.       If SCRN=1 and SHWSP=0 and K=0 and Z=2 and DRG=0 and MDE>0 and SPDISP=0 and MDE<>8 and MDE<>13
  182.          LPLT=1
  183.          TIM=Timer
  184.          If X<>XMSO or Y<>YMSO or(TIM mod 10<=4 and FLSH=0)
  185.             FLSH=1
  186.             If KPR=0
  187.                Put Block 1,160*XS,7
  188.             End If 
  189.             Gosub GTBACK
  190.             KPR=0
  191.             XT=X : YT=Y
  192.             Gosub PLTPNT
  193.             Wait Vbl 
  194.             Y=YT : X=XT
  195.             FASTZOOM
  196.          Else 
  197.             If TIM mod 10>4
  198.                FLSH=0
  199.             End If 
  200.          End If 
  201.       Else 
  202.          If LPLT=1
  203.             LPLT=0
  204.             SC=Screen
  205.             Screen 1
  206.             Put Block 1,160*XS,7
  207.             FASTZOOM
  208.             Screen SC
  209.          End If 
  210.       End If 
  211.       YMSO=Y : XMSO=X
  212.       If SCRN=1 and K>0 and SPDISP=0
  213.          Rem see what happens when you put Z=mouse zone here !
  214.          If Z=1
  215.             Gosub STORE
  216.             PICKCOL[X,Y,K]
  217.          End If 
  218.          If Z=2
  219.             REAL=1
  220.             Gosub PLTPNT
  221.             REAL=0
  222.             Gosub GTBACK
  223.             PLT=1
  224.          End If 
  225.          If Z=3
  226.             If MDE<>13
  227.                If K=1
  228.                   RESIZE[X,Y,K]
  229.                End If 
  230.             Else 
  231.                REDUCEZOOM[X,Y,K]
  232.             End If 
  233.          End If 
  234.       End If 
  235.       If SCRN=0 and K
  236.          Gosub BUTTONS
  237.       End If 
  238.    Wend 
  239. Loop 
  240. KEYIN:
  241. A$=Upper$(A$)
  242. KEYIN$=A$
  243. SH=SH and 3
  244. If BIGSPR
  245.    FZ=0
  246.    If SC=76 and SH=0
  247.       TPWIN=Max(0,TPWIN-16)
  248.       FZ=1
  249.    End If 
  250.    If SC=77 and SH=0
  251.       TPWIN=Max(0,Min(YSIZE-32,TPWIN+16))
  252.       FZ=1
  253.    End If 
  254.    If SC=79 and SH=0
  255.       LFTWIN=Max(0,LFTWIN-16)
  256.       FZ=1
  257.    End If 
  258.    If SC=78 and SH=0
  259.       LFTWIN=Max(0,Min(XSIZE-32*XS,LFTWIN+16))
  260.       FZ=1
  261.    End If 
  262.    If FZ
  263.       FASTZOOM
  264.       BIGBARS
  265.    End If 
  266. End If 
  267. If SC=76 and SH
  268. Bell 
  269.    Gosub GEDIT
  270.    SHWSPRITES[IN]
  271. End If 
  272. If SC=77 and SH
  273. Bell 
  274.    Gosub SPGRAB
  275. End If 
  276. If SC=79 and SH
  277. Bell 
  278.    TI=IN-1
  279.    Gosub GEDIT
  280.    IN=Max(1,TI)
  281.    Gosub SPGRAB
  282.    SHWSPRITES[IN]
  283. End If 
  284. If SC=78 and SH
  285. Bell 
  286.    Gosub GEDIT
  287.    If IN<Length(1)
  288.       Inc IN
  289.       Gosub SPGRAB
  290.    End If 
  291.    SHWSPRITES[IN]
  292. End If 
  293. If MDE<>6
  294.    If SH=0 and SC>79 and SC<90
  295.       If IN+SC-80<=Length(1)
  296. Bell 
  297.          TI=IN : IN=IN+SC-80
  298.          Gosub SPGRAB
  299.          IN=TI
  300.       End If 
  301.       SHWSPRITES[IN]
  302.    End If 
  303.    If SH>0 and SC>79 and SC<90
  304.       If IN+SC-80<=Length(1)+1
  305. Bell 
  306.          TI=IN : IN=IN+SC-80
  307.          Gosub GEDIT
  308.          IN=TI
  309.       End If 
  310.       SHWSPRITES[IN]
  311.    End If 
  312.    If A$="L"
  313.       Gosub LDSPRITES : A$=""
  314.    End If 
  315.    If A$="S" and Length(1)>0
  316.       Gosub SVSPRITES : A$=""
  317.    End If 
  318. Else 
  319.    Gosub GTTXT
  320. End If 
  321. Return 
  322. LDSPRITES:
  323. Sprite Off 
  324. On Error Goto DISKERROR
  325. F$=""
  326. While F$=""
  327.    F$=Fsel$("*.ABK","","Load A Sprite Bank")
  328.    If F$<>""
  329.       A$=Upper$(F$)
  330.       If Right$(A$,4)=".ABK"
  331.          Erase 1
  332.          Load F$,1
  333.          IN=1
  334.          A$="" : For A=0 To 7 : A$=A$+Chr$(Peek(Start(1)-8+A)) : Next A
  335.          If A$<>"Sprites "
  336.             F$=""
  337.             Erase 1
  338.          End If 
  339.       Else 
  340.          F$=""
  341.       End If 
  342.    Else 
  343.       F$=" "
  344.    End If 
  345. Wend 
  346. NREZ=1
  347. If Length(1)>0
  348.    TS=Screen
  349.    Screen 1
  350.    Get Sprite Palette 
  351.    Screen TS
  352. End If 
  353. On Error Goto GENERALERROR
  354. Return 
  355. SVSPRITES:
  356. Sprite Off 
  357. On Error Goto DISKERROR
  358. F$="" : While F$=""
  359.    F$=Fsel$("*.ABK","","Save a Sprite Bank")
  360.    If F$<>""
  361.       A$=Upper$(F$)
  362.       If Right$(A$,4)=".ABK"
  363.          Save F$,1
  364.       Else 
  365.          F$=""
  366.       End If 
  367.    Else 
  368.       F$=" "
  369.    End If 
  370. Wend 
  371. NREZ=1
  372. On Error Goto GENERALERROR
  373. Return 
  374. PHONE:
  375. T1=Z mod 8+64 : T2=Z mod 8+48+(Z/3) mod 3
  376. Volume CVOL
  377. Play 1,T1,0 : Play 2,T2,0
  378. Play 3,T1,0 : Play 4,T2,0
  379. Wait 2 : Volume 0
  380. Return 
  381. BLL:
  382. Volume CVOL
  383. Bell 
  384. Wait 2 : Volume 0
  385. Return 
  386. BUTTONS:
  387. If Z>0
  388.    On BLEEP+1 Gosub PHONE,BLL
  389. End If 
  390. R=(Z-1)/10
  391. C=(Z-1) mod 10
  392. If Z=51
  393.    R=4 : C=10
  394. End If 
  395. If Z=52
  396.    R=4 : C=11
  397. End If 
  398. If(R<>2 or C<>9) and SPDISP=0 and MDE<>13
  399.    Gosub STORE
  400. End If 
  401. On R+1 Gosub ROW1,ROW2,ROW3,ROW4,ROW5
  402. While Mouse Key<>0 and TICK<550
  403.    If TICK>0
  404.       Inc TICK
  405.    End If 
  406. Wend : If TICK=550
  407.    TICK=500
  408. End If 
  409. Return 
  410. ROW1:
  411. If C=9 and MDE<>13 and SPDISP=0
  412.    SMDE=1
  413.    Gosub SCRLLER
  414. End If 
  415. If C=0
  416.    MDE=9
  417.    HILITE[Z]
  418. End If 
  419. If C=1 and BLK4=1
  420.    MDE=10
  421.    DRG=0
  422.    HILITE[Z]
  423. End If 
  424. If C=2
  425.    PSTMDE=1-PSTMDE
  426.    Gosub SHWPSTE
  427. End If 
  428. If C>2 and C<8
  429.    On C-2 Gosub HNBR,HNTL,HNTR,HNBL,HNC
  430. End If 
  431. If C=8
  432.    GMDE=1-GMDE
  433. End If 
  434. Return 
  435. HNBR:
  436. HNX=XW : HNY=YH
  437. Return 
  438. HNTL:
  439. HNX=0 : HNY=0
  440. Return 
  441. HNTR:
  442. HNX=XW : HNY=0
  443. Return 
  444. HNBL:
  445. HNX=0 : HNY=YH
  446. Return 
  447. HNC:
  448. HNX=XW/2 : HNY=YH/2
  449. Return 
  450. SHWPSTE:
  451. Ink(1-PSTMDE)*5,0
  452. Set Pattern 2*(1-PSTMDE)
  453. Bar 82,21 To 89,28
  454. Bar 77,27 To 89,28
  455. Set Pattern 0
  456. Return 
  457. ROW4:
  458. If C=8 and IN>1
  459.    TICK=Max(TICK,1)
  460.    Dec IN
  461.    SHWSPRITES[IN]
  462. End If 
  463. If C=9
  464.    IN=Max(1,Length(1))
  465.    SHWSPRITES[IN]
  466. End If 
  467. If C=0
  468.    MDE=7
  469.    DRG=1
  470.    HILITE[Z]
  471. End If 
  472. If C=4
  473.    MDE=8
  474.    HILITE[Z]
  475. End If 
  476. If C=1 Then MDE=4 : DRG=1
  477. If C=2 Then MDE=2 : DRG=1
  478. If C=3 Then MDE=6 : DRG=0
  479. If C>0 and C<4
  480.    HILITE[Z]
  481. End If 
  482. If C=5 and MDE<>13 and SPDISP=0
  483.    Gosub VFLIP
  484. End If 
  485. If C=6 and MDE<>13 and SPDISP=0
  486.    SMDE=0
  487.    Gosub SCRLLER
  488. End If 
  489. If C=7 and MDE<>13 and SPDISP=0
  490.    LINE$(0)="Clear Sprite"
  491.    LINE$(1)="Are you sure?"
  492.    BUTTON$(0)="Clear"
  493.    BUTTON$(1)="Cancel"
  494.    ALERT[26,7,1,0,2,2]
  495.    If Q=1
  496.       Gosub STORE
  497.       Screen 1
  498.       Set Paint 0
  499.       Set Pattern FP
  500.       Ink RIGHTC,LEFTC
  501.       Bar 160*XS,7 To 160*XS+XSIZE-1,6+YSIZE
  502.       Set Pattern 0
  503.       FASTZOOM
  504.       Screen 0
  505.    End If 
  506. End If 
  507. Return 
  508. ROW3:
  509. If C=9 and MDE<>13 and SPDISP=0
  510.    Gosub UNDO
  511. End If 
  512. If C=0
  513.    HILITE[Z]
  514.    MDE=0
  515.    DRG=0
  516. End If 
  517. If C=1 Then MDE=3 : MOF=1
  518. If C=2 Then MDE=1 : DRG=1
  519. If C=3 Then MDE=5 : DRG=1
  520. If C>0 and C<4
  521.    HILITE[Z]
  522. End If 
  523. If C=8
  524.    Dec FP
  525.    FP=(FP+35) mod 35
  526.    SHWFILL[FP]
  527. End If 
  528. If C=7
  529.    Gosub SELREZ
  530.    SCRN=1
  531.    NREZ=1
  532. End If 
  533. If C=4 and MDE<>13 and SPDISP=0
  534.    HILITE[Z]
  535.    MDE=13
  536.    Screen 1
  537.    Ink BC,FC,BC
  538.    Text 10,150,"Right Button Fixes,Change Mode to exit"
  539.    Ink 0
  540.    Bar 0,0 To 158*XS,138
  541.    Screen 0
  542.    Screen Copy 1,160*XS-1,6,160*XS+97,138 To 1,15,6
  543.    SC4=1
  544. End If 
  545. If C=5 and MDE<>13 and SPDISP=0
  546.    Gosub HFLIP
  547. End If 
  548. If C=6 and MDE<>13 and SPDISP=0
  549.    Gosub ROTATE
  550. End If 
  551. Return 
  552. ROW2:
  553. If C=9 and MDE<>13 and SPDISP=0
  554.    Gosub STORE
  555.    Gosub SCRUNCH1
  556. End If 
  557. If C=8 and MDE<>13 and SPDISP=0
  558.    Gosub STORE
  559.    Gosub SCRUNCH2
  560. End If 
  561. If C>=0 and C<8 and MDE<>13 and SPDISP=0
  562.    On C+1 Gosub HSTL,HSTR,HSBM,HSTM,HSBR,HSBL,HSC,HSUSER
  563. End If 
  564. Return 
  565. HSTL:
  566. HX=0 : HY=0 : Return 
  567. HSTR:
  568. HX=XSIZE-1 : HY=0 : Return 
  569. HSBM:
  570. HX=XSIZE/2 : HY=YSIZE-1 : Return 
  571. HSTM:
  572. HX=XSIZE/2 : HY=0 : Return 
  573. HSBR:
  574. HX=XSIZE-1 : HY=YSIZE-1 : Return 
  575. HSBL:
  576. HX=0 : HY=YSIZE-1 : Return 
  577. HSC:
  578. HX=XSIZE/2 : HY=YSIZE/2 : Return 
  579. HSUSER:
  580. DRG=0
  581. MDE=12
  582. HILITE[Z]
  583. Return 
  584. ROW5:
  585. If C=0
  586.    Gosub GTBACK
  587.    CHANGERGB
  588.    NREZ=1
  589. End If 
  590. If C=2 and MDE<>13
  591.    Gosub GEDIT
  592.    SHWSPRITES[IN]
  593. End If 
  594. If C=1 and MDE<>13
  595.    Gosub INSIT
  596.    SHWSPRITES[IN]
  597. End If 
  598. If C=3 and IN<=Length(1) and MDE<>13
  599.    Gosub SPGRAB
  600. End If 
  601. If C=4 and IN<=Length(1)
  602.    Del Bob IN
  603.    SHWSPRITES[IN]
  604.    INO=-1
  605. End If 
  606. If C=5 and Length(1)>0
  607.    LINE$(0)="Do you really want"
  608.    LINE$(1)="to erase all your"
  609.    LINE$(2)="Images ?"
  610.    BUTTON$(0)="ERASE"
  611.    BUTTON$(1)="CANCEL"
  612.    ALERT[30,8,6,1,2,3]
  613.    If Q=1
  614.       If SMDE<2
  615.          Erase 1
  616.          IN=1
  617.          SHWSPRITES[IN]
  618.       Else 
  619.          Erase 2
  620.       End If 
  621.    End If 
  622. End If 
  623. If C=6
  624.    IN=1
  625.    SHWSPRITES[IN]
  626. End If 
  627. If C=8 and IN<=Length(1)
  628.    Inc IN
  629.    SHWSPRITES[IN]
  630.    TICK=Max(1,TICK)
  631. End If 
  632. If C=7
  633.    If SREDO=1
  634.       SREDO=0
  635.       If SHWSP=1
  636.          Screen 1
  637.          Put Block 5,160*XS,7
  638.          SHWSP=0
  639.          SHWSPO=0
  640.          Screen 0
  641.       End If 
  642.       DISPSPRITES
  643.       Auto View On 
  644.       SPDISP=1
  645.    End If 
  646.    Clip 
  647.    SHWSPRITES[IN]
  648. End If 
  649. If C=10
  650.    Inc FP
  651.    FP=FP mod 35
  652.    SHWFILL[FP]
  653. End If 
  654. If C=11
  655.    Gosub NICENESS
  656. End If 
  657. If C=9
  658.    LINE$(0)="Are you sure you"
  659.    LINE$(1)="Want to quit"
  660.    BUTTON$(0)="Quit"
  661.    BUTTON$(1)="Cancel"
  662.    ALERT[20,7,1,2,2,2]
  663.    If Q=1
  664.       Default 
  665.       End 
  666.    End If 
  667. End If 
  668. Return 
  669. SPGRAB:
  670. If IN<=Length(1)
  671.    S=Screen
  672.    Screen 1
  673.    If SPDISP=1
  674.       Put Block 5,160*XS,7
  675.    End If 
  676.    SB=Sprite Base(IN)
  677.    XSIZE=Min(96,Deek(SB)*16)
  678.    YSIZE=Min(128,Deek(SB+2))
  679.    If XSIZE>32 or YSIZE>32
  680.       BIGSPR=1
  681.    End If 
  682.    HX=Min(95,Deek(SB+6))
  683.    HY=Min(127,Deek(SB+8))
  684.    If SPDISP=0
  685.       BXES
  686.    End If 
  687.    Ink 0 : Bar 160*XS,7 To 160*XS+XSIZE-1,6+YSIZE
  688.    Paste Bob 160*XS,7,IN
  689.    If SPDISP=0
  690.       FASTZOOM
  691.       NREZ=1
  692.    Else 
  693.       DISPSPRITES
  694.       Auto View On 
  695.    End If 
  696.    Clip 
  697.    SHWSPRITES[IN]
  698.    Screen S
  699. Else 
  700.    Bell 
  701. End If 
  702. Return 
  703. HFLIP:
  704. Screen Copy 1,160*XS,7,160*XS+XSIZE,7+YSIZE To 1,0,0
  705. A=0 : Repeat 
  706.    Screen Copy 1,XSIZE-A-1,0,XSIZE-A,YSIZE To 1,160*XS+A,7
  707.    Inc A
  708. Until A=XSIZE
  709. NREZ=1
  710. Return 
  711. VFLIP:
  712. Screen Copy 1,160*XS,7,160*XS+XSIZE,7+YSIZE To 1,0,0
  713. A=0 : Repeat 
  714.    Screen Copy 1,0,YSIZE-A-1,XSIZE,YSIZE-A To 1,160*XS,7+A
  715. Inc A : Until A=YSIZE
  716. NREZ=1
  717. Return 
  718. ROTATE:
  719. Autoback 0
  720. Screen 1
  721. Screen Copy 1,160*XS,7,160*XS+XSIZE,7+YSIZE To 1,0,0
  722. Cls 0,160*XS,7 To 160*XS+XSIZE,7+YSIZE
  723. A=0 : Repeat : Ink FC : Plot 160*XS+96,6+A : Plot 159*XS,6+A
  724.    Ink BC : Plot 160*XS+96,7+A : Plot 159*XS,7+A
  725.    B=0 : Repeat : If A<YSIZE and B<XSIZE
  726.          Ink Point(A,B) : Plot 160*XS+XSIZE-B-1,7+A
  727.       End If 
  728.    Inc B : Until B=YSIZE
  729. Inc A : Until A=XSIZE
  730. Ink FC : Box 159*XS,6 To 160*XS+96,136
  731. NREZ=1
  732. Return 
  733. SHWCURS:
  734. Gosub GTBACK
  735. X2=(X-16)/MP : Y2=(Y-7)/MP
  736. CLPIT
  737. Paste Bob X2+160*XS,Y2+7,Length(1)
  738. FASTZOOM
  739. Clip 
  740. Put Block 1,160*XS,7
  741. Return 
  742. Rem Plot point general draw routine
  743. Rem lftwin & Tpwin are used when sprite is >64x64 to determine window area 
  744. PLTPNT:
  745. X=(X-16)/MP+LFTWIN : Y=(Y-7)/MP+TPWIN
  746. Y=Min(YSIZE-1,Y) : X=Min(XSIZE-1,X)
  747. Set Paint 0
  748. Set Pattern FP
  749. If K=1 or REAL=0
  750.    Ink LEFTC,RIGHTC,LEFTC
  751.    If REAL=0 and TIM mod 20<=4
  752.       Ink RIGHTC,LEFTC,RIGHTC
  753.    End If 
  754. Else 
  755.    If K=2 or Rnd(1)=0
  756.       Ink RIGHTC,LEFTC,RIGHTC
  757.    Else 
  758.       Ink LEFTC,RIGHTC,LEFTC
  759.    End If 
  760. End If 
  761. If K<>2 or MDE=0 or MDE=3 or MDE=6 or MDE=10 or MDE=12
  762.    On MDE+1 Gosub PLT,BX,BR,DRW,AIR,ELLPS,FELLPS,LINE,FLL,CUT,PSTE,HTSPOT,HTSPOT
  763. End If 
  764. Set Pattern 0
  765. FASTZOOM
  766. Return 
  767. HTSPOT:
  768. If K>0
  769.    HX=X : HY=Y
  770. End If 
  771. Return 
  772. PLT:
  773. Plot 160*XS+X,7+Y
  774. Return 
  775. DRW:
  776. If MOF=1
  777.    LPX=X : LPY=Y
  778.    MOF=0
  779. End If 
  780. Draw 160*XS+LPX,7+LPY To 160*XS+X,7+Y : If REAL=1 Then LPX=X : LPY=Y
  781. Return 
  782. DAIR:
  783. A=0 : Repeat 
  784.    Plot 160*XS+X+Rnd(XW)-Rnd(XW),7+Y+Rnd(XW)-Rnd(XW)
  785. Inc A : Until A>AIR
  786. Return 
  787. BX:
  788. If DRG
  789.    Gosub STRETCH
  790. Else 
  791.    CLPIT
  792.    Box 160*XS+X-HNX,7+Y-HNY To 160*XS+X+XW-HNX,7+Y+YH-HNY
  793.    Clip 
  794. End If 
  795. Return 
  796. STRETCH:
  797. STX=X Mouse : STY=Y Mouse
  798. CLPIT
  799. Gosub GTBACK
  800. OK=0
  801. XO=-1 : YO=-1
  802. LX=X+160*XS : LY=Y+7
  803. Set Pattern FP
  804. While OK=0
  805.    K=Mouse Key : X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  806.    X=(X-16)/MP+LFTWIN : Y=(Y-7)/MP+TPWIN
  807.    If K=0
  808.       OK=1
  809.    End If 
  810.    If XO<>X or YO<>Y
  811.       XO=X : YO=Y
  812.       X=X+160*XS : Y=Y+7
  813.       X1=Max(LX,160*XS) : X2=Max(160*XS,Min(X,160*XS+XSIZE))
  814.       Y1=Max(LY,7) : Y2=Max(7,Min(7+YSIZE,Y))
  815.       TX=Min(X1,X2) : BX=Max(X1,X2)
  816.       TY=Min(Y1,Y2) : BY=Max(Y1,Y2)
  817.       BX=Max(TX+1,BX) : BY=Max(TY+1,BY)
  818.       Put Block 1,160*XS,7
  819.       Ink LEFTC,RIGHTC
  820.       On MDE Gosub SBX,SBR,SBR,SAIR,SELLPS,SELLPS,SLINE,SLINE,SBX
  821.       FASTZOOM
  822.    End If 
  823. Wend 
  824. Ink 0
  825. Put Block 1,160*XS,7
  826. XW=BX-TX : YH=BY-TY
  827. DRG=0
  828. Set Pattern 0
  829. Clip 
  830. X Mouse=STX : Y Mouse=STY
  831. Return 
  832. SBX:
  833. Box TX,TY To BX,BY
  834. Return 
  835. SBR:
  836. Bar TX,TY To BX,BY
  837. Return 
  838. SAIR:
  839. D=Max((BX-TX)/2,1)
  840. Circle TX+D,TY+D,D
  841. Return 
  842. SELLPS:
  843. DX=Max((BX-TX)/2,1) : DY=Max((BY-TY)/2,1)
  844. Ellipse TX+DX,TY+DY,DX,DY
  845. Return 
  846. SLINE:
  847. Draw LX,LY To X,Y
  848. Return 
  849. BR:
  850. If DRG=1
  851.    Gosub STRETCH
  852. Else 
  853.    CLPIT
  854.    Bar 160*XS+X-HNX,7+Y-HNY To 160*XS+X+XW-HNX,7+Y+YH-HNY
  855.    Clip 
  856. End If 
  857. Return 
  858. AIR:
  859. If DRG=1
  860.    Gosub STRETCH
  861.    XW=Max(1,Max(XW,YH)/2)
  862. Else 
  863.    CLPIT
  864.    Gosub DAIR
  865.    Clip 
  866. End If 
  867. Return 
  868. ELLPS:
  869. If DRG=1
  870.    Gosub STRETCH
  871.    XW=Max(1,XW/2) : YH=Max(1,YH/2)
  872. HNX=XW : HNY=YH
  873. Else 
  874.    CLPIT
  875.    Ellipse 160*XS+X+XW-HNX,7+Y-HNY+YH,XW,YH
  876.    Clip 
  877. End If 
  878. Return 
  879. FELLPS:
  880. If DRG=1
  881.    DRG=0
  882.    TXT$=""
  883. Else 
  884.    CLPIT
  885.    Autoback 0
  886.    Gr Writing 0
  887.    Text 160*XS+X,7+Y,TXT$
  888.    Gr Writing 1
  889.    Clip 
  890. End If 
  891. Return 
  892. LINE:
  893. If DRG=1
  894.    Gosub STRETCH
  895.    XW=X2-LX : YH=Y2-LY
  896. Else 
  897.    CLPIT
  898.    Draw 160*XS+X-HNX,7+Y-HNY To 160*XS+X+XW-HNX,7+Y+YH-HNY
  899.    Clip 
  900. End If 
  901. Return 
  902. FLL:
  903. Screen 1
  904. Get Block 1,158*XS,5,100,135
  905. Set Pattern FP
  906. Set Paint 0
  907. If K=2
  908.    M=0
  909. Else 
  910.    M=1
  911. End If 
  912. Ink FC
  913. Box 158*XS,5 To 160*XS+XSIZE+1,8+YSIZE
  914. Ink BC
  915. Box 159*XS,6 To 160*XS+XSIZE,7+YSIZE
  916. Ink LEFTC,RIGHTC,LEFTC
  917. Paint 160*XS+X,7+Y,M
  918. Get Block 2,160*XS,7,XSIZE,YSIZE
  919. Clip 
  920. Put Block 1,158*XS,5 : Put Block 2,160*XS,7
  921. Return 
  922. CUT:
  923. If K=1
  924.    Gosub STRETCH
  925.    Get Block 4,LX,LY,XW,YH,1
  926.    HNX=0 : HNY=0
  927.    MDE=10
  928.    Screen 0
  929.    HILITE[2]
  930.    Screen 1
  931.    BLK4=1
  932. End If 
  933. Return 
  934. PSTE:
  935. CLPIT
  936. If PSTMDE=1 or K=2
  937.    Ink 0
  938.    Bar 160*XS+X-HNX,7+Y-HNY To 160*XS+X-HNX+XW-1,6+Y-HNY+YH
  939. End If 
  940. If K<>2
  941.    Put Block 4,160*XS+X-HNX,7+Y-HNY
  942. End If 
  943. Clip 
  944. Return 
  945. GTTXT:
  946. A$=KEYIN$
  947. KEYIN$=""
  948. If A$<>""
  949.    If A$=Chr$(8)
  950.       TXT$=Left$(TXT$,Len(TXT$)-1)
  951.    End If 
  952.    If A$>=" "
  953.       TXT$=TXT$+A$
  954.    End If 
  955. End If 
  956. Return 
  957. SCRUNCH1:
  958. Screen 1
  959. SCY=-1
  960. A=0 : Repeat : B=0 : Repeat : If Point(160*XS+B,7+A)>0 Then SCY=A : B=XSIZE : A=YSIZE
  961. Inc B : Until B>=XSIZE : Inc A : Until A>=YSIZE
  962. SCX=-1
  963. A=0 : Repeat : B=0 : Repeat : If Point(160*XS+A,7+B)>0 Then SCX=A : B=YSIZE : A=XSIZE
  964. Inc B : Until B>=YSIZE : Inc A : Until A>=XSIZE
  965. If SCY>=0 and SCX>=0
  966.    Screen Copy 1,160*XS+SCX,7+SCY,160*XS+XSIZE,7+YSIZE To 1,160*XS,7
  967.    CLPIT
  968.    Ink 0 : Bar 160*XS,7+YSIZE-SCY To 160*XS+XSIZE+1,7+YSIZE+1
  969.    Bar 160*XS+XSIZE-SCX,7 To 160*XS+XSIZE+1,7+YSIZE+1
  970.    FASTZOOM
  971.    Clip 
  972. End If 
  973. Screen 0
  974. SREDO=1
  975. Return 
  976. SCRUNCH2:
  977. Gosub SCRUNCH1
  978. Screen 1
  979. SCX=XSIZE
  980. A=XSIZE-1 : Repeat : B=YSIZE-1 : Repeat : If Point(160*XS+A,7+B)>0 Then SCX=A : B=0 : A=0
  981. Dec B : Until B<0 : Dec A : Until A<0
  982. A=YSIZE-1 : Repeat : B=XSIZE-1 : Repeat : If Point(160*XS+B,7+A)>0 Then SCY=A : B=0 : A=0
  983. Dec B : Until B<0 : Dec A : Until A<0
  984. XSIZE=Max(16,SCX+1) : YSIZE=Max(1,SCY+1)
  985. NREZ=1
  986. Screen 0
  987. Return 
  988. Rem this routine grabs the data as a sprite,bob or icon
  989. Rem IN = image number to grab to 
  990. Rem HX & HY contain the Hot Spot location
  991. INSIT:
  992. SC=Screen
  993. Screen 1
  994. If IN<=Length(1)
  995.    Ins Sprite IN
  996. End If 
  997. Gosub GEDITBOB
  998. If IN=Length(1) and OK=1
  999.    Inc IN
  1000. End If 
  1001. Screen SC
  1002. Return 
  1003. GEDIT:
  1004. SC=Screen
  1005. Screen 1
  1006. Gosub GEDITBOB
  1007. If IN=Length(1) and OK=1
  1008.    Inc IN
  1009. End If 
  1010. Screen SC
  1011. Return 
  1012. GEDITBOB:
  1013. On Error Goto FAIL
  1014. OK=1
  1015. If SPDISP=1 and Screen=0 and SREDO=1
  1016.    Put Block 5,160*XS,7
  1017. End If 
  1018. Get Bob IN,160*XS,7 To 160*XS+XSIZE,7+YSIZE
  1019. Hot Spot IN,HX,HY
  1020. If SPDISP=1
  1021.    DISPSPRITES
  1022.    Auto View On 
  1023. End If 
  1024. FAILSAFE:
  1025. On Error Goto GENERALERROR
  1026. Return 
  1027. FAIL:
  1028. SC=Screen
  1029. Screen 0
  1030. LINE$(0)="Not Enough Memory"
  1031. LINE$(1)="to store image..."
  1032. BUTTON$(0)="O.K"
  1033. ALERT[30,7,6,1,1,2]
  1034. Screen SC
  1035. NREZ=1
  1036. OK=0
  1037. Resume FAILSAFE
  1038. GTBACK:
  1039. Del Block 1
  1040. SC=Screen
  1041. Screen 1
  1042. Get Block 1,160*XS,7,Max(16,XSIZE),Max(16,YSIZE)
  1043. Screen SC
  1044. Return 
  1045. STORE:
  1046. XSIZE=Max(16,XSIZE) : YSIZE=Max(1,YSIZE)
  1047. S=Screen
  1048. Screen 1
  1049. Del Block 2
  1050. Get Block 2,160*XS,7,XSIZE,YSIZE
  1051. A=0 : Repeat : RGB(A)=Colour(A) : Inc A : Until A=Min(31,NCOLS)
  1052. STNCOLS=NCOLS : STXSIZE=XSIZE : STYSIZE=YSIZE
  1053. STBIG=BIGSPR : STTL=LFTWIN : STTP=TPWIN
  1054. Screen S
  1055. Return 
  1056. UNDO:
  1057. S=Screen
  1058. Screen 1
  1059. XSIZE=STXSIZE : YSIZE=STYSIZE : NCOLS=STNCOLS
  1060. BIGSPR=STBIG : LFTWIN=STTL : TPWIN=STTP
  1061. A=0 : Repeat : Colour A,RGB(A) : Inc A : Until A=Min(31,NCOLS)
  1062. BXES
  1063. Put Block 2,160*XS,7
  1064. FASTZOOM
  1065. BIGBARS
  1066. PALDRAW
  1067. Screen S
  1068. Return 
  1069. SCRLLER:
  1070. TS=Screen
  1071. Screen 0
  1072. Del Block 1
  1073. Get Block 1,208,10,80,64
  1074. Ink 0
  1075. Bar 209,11 To 274,60
  1076. Bar 214,16 To 279,65
  1077. Screen Copy 0,0,96,64,144 To 0,210,12
  1078. Reset Zone 
  1079. Reserve Zone 4
  1080. Set Zone 1,234,20 To 250,36
  1081. Set Zone 2,234,36 To 250,52
  1082. Set Zone 3,218,28 To 234,44
  1083. Set Zone 4,250,28 To 266,44
  1084. If SMDE=1
  1085.    Screen 1
  1086.    Get Block 3,160*XS,7,XSIZE,YSIZE
  1087.    Screen 0
  1088. End If 
  1089. OK=0
  1090. TMR=0
  1091. While OK=0
  1092.    K=Mouse Key : Z=Mouse Zone
  1093.    If K=0
  1094.       TMR=0
  1095.    End If 
  1096.    If K=2
  1097.       OK=1
  1098.    Else 
  1099.       If K=1
  1100.          On Z Gosub SUP,SDOWN,SLEFT,SRIGHT
  1101.          If SMDE=1
  1102.             Gosub SIZEREDO
  1103.             NREZ=1
  1104.          Else 
  1105.             FASTZOOM
  1106.          End If 
  1107.          While Mouse Key<>0 and TMR<500 : Inc TMR : Wend 
  1108.       End If 
  1109.    End If 
  1110. Wend 
  1111. Put Block 1,208,10
  1112. SETBUTZONE
  1113. Return 
  1114. SUP:
  1115. If SMDE=0
  1116.    Screen 1
  1117.    Get Block 3,160*XS,7,XSIZE,1
  1118.    Screen Copy 1,160*XS,8,160*XS+XSIZE,7+YSIZE To 1,160*XS,7
  1119.    Put Block 3,160*XS,6+YSIZE
  1120.    Del Block 3
  1121.    Screen 0
  1122. Else 
  1123.    If YSIZE>1
  1124.       Dec YSIZE
  1125.    End If 
  1126. End If 
  1127. Return 
  1128. SDOWN:
  1129. If SMDE=0
  1130.    Screen 1
  1131.    Get Block 3,160*XS,6+YSIZE,XSIZE,1
  1132.    Screen Copy 1,160*XS,7,160*XS+XSIZE,6+YSIZE To 1,160*XS,8
  1133.    Put Block 3,160*XS,7
  1134.    Del Block 3
  1135.    Screen 0
  1136. Else 
  1137.    If YSIZE<128
  1138.       Inc YSIZE
  1139.    End If 
  1140. End If 
  1141. Return 
  1142. SLEFT:
  1143. If SMDE=0
  1144.    Screen 1
  1145.    Get Block 3,160*XS,7,1,7+YSIZE
  1146.    Screen Copy 1,160*XS+1,7,160*XS+XSIZE,7+YSIZE To 1,160*XS,7
  1147.    Put Block 3,160*XS+XSIZE-1,7
  1148.    Del Block 3
  1149.    BXES2
  1150.    Screen 0
  1151. Else 
  1152.    If XSIZE>16
  1153.       Add XSIZE,-16
  1154.    End If 
  1155. End If 
  1156. Return 
  1157. SRIGHT:
  1158. If SMDE=0
  1159.    Screen 1
  1160.    Get Block 3,160*XS+XSIZE-1,7,1,YSIZE,1
  1161.    Screen Copy 1,160*XS,7,160*XS+XSIZE-1,7+YSIZE To 1,160*XS+1,7
  1162.    Ink 0
  1163.    Draw 160*XS,7 To 160*XS,6+YSIZE
  1164.    Put Block 3,160*XS,7
  1165.    Del Block 3
  1166.    BXES2
  1167.    Screen 0
  1168. Else 
  1169.    If XSIZE<96
  1170.       Add XSIZE,16
  1171.    End If 
  1172. End If 
  1173. Return 
  1174. SIZEREDO:
  1175. Screen 1
  1176. Cls 0,159*XS,7 To 160*XS+96,136
  1177. Put Block 3,160*XS,7
  1178. Ink FC,BC
  1179. Box 159*XS,6 To 160*XS+96,136
  1180. Box 159*XS,6 To 160*XS+XSIZE,7+YSIZE
  1181. Ink BC,FC,BC
  1182. Text 120*XS-(XS=2)*100,150,"Size X:"+Right$(" "+Str$(XSIZE),2)+" Y:"+Right$("  "+Str$(YSIZE),3)
  1183. Screen 0
  1184. Return 
  1185. NICENESS:
  1186. Screen 0
  1187. Reset Zone 
  1188. Reserve Zone 20
  1189. Del Block 1
  1190. Get Block 1,48,0,240,96
  1191. Ink 0 : Bar 52,4 To 274,94
  1192. Ink 2 : Bar 48,0 To 270,90
  1193. Ink 1 : Polyline 48,90 To 48,0 To 270,0
  1194. Ink 7 : Polyline 49,90 To 270,90 To 270,1
  1195. Ink 6 : Bar 49,55 To 180,89
  1196. Set Paint 1
  1197. Ink 0,0,1 : Bar 80,80 To 114,88
  1198. Set Zone 1,81,81 To 113,87
  1199. Bar 230,16 To 264,25
  1200. Set Zone 8,231,17 To 263,24
  1201. Set Paint 0
  1202. Ink 1,6
  1203. Text 54,87,"Vol"
  1204. CX=CVOL/2
  1205. AX=AIR
  1206. Gosub VOLSLIDE
  1207. Gosub AIRSLIDE
  1208. SMALLBUTTON[2,"O.K",224,70]
  1209. QUADBUTTON[3,"Niceness Page",52,4]
  1210. QUADBUTTON[3,"Background Col",52,22]
  1211. QUADBUTTON[4,"Foreground Col",52,38]
  1212. Ink 1,6
  1213. Text 52,66,"Button"
  1214. Text 52,76,"Click"
  1215. Ink 1,2
  1216. Text 185,12,"Airbrush"
  1217. Text 185,22,"Power"
  1218. TWINBUTTON[5,"Tone "+OK$(1-BLEEP),116,56]
  1219. TWINBUTTON[6,"Bell "+OK$(BLEEP),116,72]
  1220. TWINBUTTON[7,"Credits",192,52]
  1221. Ink 3,2
  1222. Text 185,36,"Free Mem"
  1223. Text 185,46,Str$(Int(((Fast Free+Chip Free)*100)/1024.0)/100.0)+" K"
  1224. OK=0
  1225. While OK=0
  1226.    While Mouse Key=0 : Wend : Z=Mouse Zone
  1227.    If Z=5
  1228.       BLEEP=0
  1229.       TWINBUTTON[5,"Tone *",116,56]
  1230.       TWINBUTTON[6,"Bell  ",116,72]
  1231.    End If 
  1232.    If Z=6
  1233.       BLEEP=1
  1234.       TWINBUTTON[5,"Tone  ",116,56]
  1235.       TWINBUTTON[6,"Bell *",116,72]
  1236.    End If 
  1237.    If Z=1
  1238.       CX=(X Screen(X Mouse)-81)
  1239.       Gosub VOLSLIDE
  1240.    End If 
  1241.    If Z=8
  1242.       AX=(X Screen(X Mouse)-231)
  1243.       Gosub AIRSLIDE
  1244.    End If 
  1245.    If Z=2
  1246.       OK=1
  1247.    End If 
  1248.    If Z=7
  1249.       CREDITS
  1250.    End If 
  1251.    If Z=3
  1252.       Inc BC
  1253.       BC=BC mod NCOLS
  1254.       If BC=FC
  1255.          Inc BC
  1256.          BC=BC mod NCOLS
  1257.       End If 
  1258.       BXES3
  1259.       PALDRAW
  1260.       Screen 0
  1261.    End If 
  1262.    If Z=4
  1263.       Inc FC
  1264.       FC=FC mod NCOLS
  1265.       If FC=BC
  1266.          Inc FC
  1267.          FC=FC mod NCOLS
  1268.       End If 
  1269.       BXES3
  1270.       PALDRAW
  1271.       Screen 0
  1272.    End If 
  1273. Wend 
  1274. Put Block 1,48,0
  1275. SETBUTZONE
  1276. Screen 0
  1277. Return 
  1278. VOLSLIDE:
  1279. Ink 0 : Bar 81+CVOL/2,81 To 82+CVOL/2,87
  1280. Bar 81,82 To 82+CVOL/2,86
  1281. CVOL=Max(0,Min(CX,31))*2
  1282. Ink 2 : Bar 81,82 To 82+CVOL/2,86
  1283. Ink 3 : Bar 81+CVOL/2,81 To 82+CVOL/2,87
  1284. Return 
  1285. AIRSLIDE:
  1286. Ink 0 : Bar 231+AIR,18 To 232+AIR,24
  1287. Bar 231,19 To 232+AIR,23
  1288. AIR=Max(0,Min(AX,31))
  1289. Ink 5 : Bar 231,19 To 232+AIR,23
  1290. Ink 3 : Bar 231+AIR,18 To 232+AIR,24
  1291. Return 
  1292. SELREZ:
  1293. Screen 0
  1294. Reset Zone 
  1295. Reserve Zone 8
  1296. Del Block 1
  1297. Get Block 1,48,0,240,96
  1298. Ink 0 : Bar 52,4 To 274,94
  1299. Ink 6 : Bar 48,0 To 270,90
  1300. Ink 1 : Polyline 48,90 To 48,0 To 270,0
  1301. Ink 7 : Polyline 49,90 To 270,90 To 270,1
  1302. Ink 1,2
  1303. A=0 : Repeat : B=0 : Repeat 
  1304.       TRIBUTTON[1+B*4+A,REZ$(B*4+A),64+B*96,A*16+20]
  1305. Inc B : Until B=2 : Inc A : Until A=4
  1306. Screen Copy 0,128,96,256,112 To 0,96,4
  1307. Ink 0,3
  1308. Text 100,14,"Select Mode"
  1309. REZ=-1
  1310. While REZ=-1
  1311.    While Mouse Key=0 : Wend : Z=Mouse Zone : While Mouse Key<>0 : Wend 
  1312.    If Z>0
  1313.       REZ=Z-1
  1314.    Else 
  1315.       Bell 
  1316.    End If 
  1317. Wend 
  1318. Put Block 1,48,0
  1319. Screen 1
  1320. Get Block 1,160*XS,7,96,128
  1321. Screen Close 1
  1322. CHANGEREZ
  1323. SETBUTZONE
  1324. Screen 1
  1325. Put Block 1,160*XS,7
  1326. Screen 0
  1327. Return 
  1328. Procedure SMALLBUTTON[BN,T$,BX,BY]
  1329.    Screen Copy 0,96,96,128,112 To 0,BX,BY
  1330.    Set Zone BN,BX,BY To BX+32,BY+16
  1331.    Ink 1,5 : Text BX+4,BY+10,T$
  1332. End Proc
  1333. Procedure TWINBUTTON[BN,T$,BX,BY]
  1334.    Screen Copy 0,96,112,160,128 To 0,BX,BY
  1335.    Set Zone BN,BX,BY To BX+64,BY+16
  1336.    Ink 1,6 : Text BX+4,BY+10,T$
  1337. End Proc
  1338. Procedure TRIBUTTON[BN,T$,BX,BY]
  1339.    Screen Copy 0,160,112,256,128 To 0,BX,BY
  1340.    Set Zone BN,BX,BY To BX+96,BY+16
  1341.    Ink 1,2 : Text BX+4,BY+10,T$
  1342. End Proc
  1343. Procedure QUADBUTTON[BN,T$,BX,BY]
  1344.    Screen Copy 0,128,96,256,112 To 0,BX,BY
  1345.    Set Zone BN,BX,BY To BX+128,BY+16
  1346.    Ink 0,3 : Text BX+4,BY+10,T$
  1347. End Proc
  1348. Procedure CHANGERGB
  1349.    Shared FC,BC,REZ,NCOLS,XS
  1350.    Dim RGB(31)
  1351.    SC=Screen
  1352.    Screen 1
  1353.    Del Block 1
  1354.    Get Block 1,8,3,256,112
  1355.    Limit Mouse 
  1356.    Reset Zone 
  1357.    Reserve Zone 40
  1358.    Ink 0,0
  1359.    Bar 13,8 To 217,112
  1360.    Ink FC,BC
  1361.    Bar 8,3 To 212,107
  1362.    Ink BC,FC
  1363.    Box 9,4 To 211,106
  1364.    Ink BC,FC
  1365.    A=0 : Repeat 
  1366.       Bar 15+A*20,6 To 30+A*20,104
  1367.       Set Zone A+1,15+A*20,6 To 30+A*20,104
  1368.       Inc A
  1369.    Until A=3
  1370.    A=0 : Repeat 
  1371.       Draw 10,6+A*6 To 75,6+A*6
  1372.       Inc A
  1373.    Until A=17
  1374.    A=0 : Repeat 
  1375.       Ink A,A : X=A mod 8 : Y=A/8
  1376.       Bar X*16+80,Y*16+8 To X*16+95,Y*16+23
  1377.       Set Zone A+4,X*16+80,Y*16+8 To X*16+95,Y*16+23
  1378.       RGB(A)=Colour(A)
  1379.    Inc A : Until A>=Min(32,NCOLS)
  1380.    Ink BC,FC
  1381.    Box 79,7 To 96+16*X,24+16*Y
  1382.    Box 80,90 To 140,100
  1383.    Text 86,98,"Cancel"
  1384.    Box 152,90 To 202,100
  1385.    Text 165,98,"O.K"
  1386.    Set Zone 36,80,90 To 140,100
  1387.    Set Zone 37,152,90 To 202,100
  1388.    Ink SELCOL
  1389.    Bar 195,78 To 201,87
  1390.    Ink BC : Box 194,77 To 202,88
  1391.   SFADERS[SELCOL]
  1392.    OK=0 : While OK=0
  1393.       While Mouse Key=0 : Wend : YM=Y Screen(Y Mouse) : Z=Mouse Zone
  1394.       If Z>0 and Z<4
  1395.          CFADERS[SELCOL,Z-1,YM]
  1396.          SFADERS[SELCOL]
  1397.       End If 
  1398.       If Z>3 and Z<36
  1399.          SELCOL=Z-4
  1400. Ink SELCOL
  1401. Bar 195,78 To 201,87
  1402.          SFADERS[SELCOL]
  1403.          Ink SELCOL
  1404.       End If 
  1405.       If Z=37
  1406.          OK=1
  1407.       End If 
  1408.       If Z=36
  1409.          A=0 : Repeat 
  1410.             Colour A,RGB(A) : SPCOL[A,RGB(A)]
  1411.          Inc A : Until A>=Min(32,NCOLS)
  1412.          OK=1
  1413.       End If 
  1414.    Wend 
  1415.    Put Block 1,8,3
  1416.    Screen SC
  1417. End Proc
  1418. Procedure CFADERS[S,F,YM]
  1419.    Dim R(2)
  1420.    C=Colour(S)
  1421.    R(0)=C/256
  1422.    R(1)=(C/16) mod 16
  1423.    R(2)=C mod 16
  1424.    V=Max(0,Min(15,15-(YM-7)/6))
  1425.    R(F)=V
  1426.    Colour S,(R(0)*256+R(1)*16+R(2))
  1427.    SPCOL[S,Colour(S)]
  1428. End Proc
  1429. Procedure SFADERS[S]
  1430.    Shared RGBO,BC,FC
  1431.    Dim R(2)
  1432.    C=RGBO
  1433.    R(0)=C/256
  1434.    R(1)=(C/16) mod 16
  1435.    R(2)=C mod 16
  1436.    Ink BC,BC
  1437.    A=0 : Repeat 
  1438.       V=(15-R(A))*6 : Bar 17+20*A,7+V To 28+20*A,12+V
  1439.       Inc A
  1440.    Until A=3
  1441.    C=Colour(S)
  1442.    RGBO=C
  1443.    R(0)=C/256
  1444.    R(1)=(C/16) mod 16
  1445.    R(2)=C mod 16
  1446. Ink BC,FC
  1447. Text 80,85,"Col"+Right$(" "+Str$(S),2)+" Val:$"+Right$("000"+Mid$(Hex$(RGBO),2),3)
  1448.    Ink FC,FC
  1449.    A=0 : Repeat 
  1450.       Ink FC,FC
  1451.       V=(15-R(A))*6 : Box 17+20*A,7+V To 28+20*A,12+V
  1452.       Ink S
  1453.       Bar 18+20*A,8+V To 27+20*A,11+V
  1454.       Inc A
  1455.    Until A=3
  1456. End Proc
  1457. Procedure SPCOL[A,B]
  1458.    If Length(1)>0
  1459.       Doke Start(1)+2+8*Length(1)+2*A,B
  1460.    End If 
  1461. End Proc
  1462. Procedure CHANGEREZ
  1463.    Shared SREDO,FC,BC,REZ,NCOLS,XS,NC(),SX(),ST()
  1464.    Auto View Off 
  1465.    Screen Open 1,SX(REZ),160,NC(REZ),ST(REZ)
  1466.    Flash Off 
  1467.    NCOLS=NC(REZ) : XS=SX(REZ)/320
  1468.    Screen Display 1,,140,,160
  1469.    Curs Off 
  1470.    FC=NCOLS-1 : BC=0 : A=0 : Repeat : If Colour(FC)=0 and Colour(A)>0 Then FC=A
  1471.       If Colour(BC)>Colour(A) Then BC=A
  1472.    Inc A : Until A=NCOLS
  1473.    Ink 0 : Bar 0,0 To 320*XS,160
  1474.    Auto View On 
  1475.    SREDO=1
  1476.    If Length(1)>0
  1477.       Get Sprite Palette 
  1478.    End If 
  1479. End Proc
  1480. Procedure SCRNUP
  1481.    If Ntsc=-1
  1482.       Screen Display 1,,80,,160
  1483.    Else 
  1484.       Screen Display 1,,140,,160
  1485.    End If 
  1486. End Proc
  1487. Procedure SCRNDOWN
  1488.    Screen Display 1,,140,,160
  1489. End Proc
  1490. Rem alert box routine without using the window commands
  1491. Rem uses the arrays line$() and button$()
  1492. Procedure ALERT[W,H,C1,C2,NB,NL]
  1493.    Shared Q,LINE$(),BUTTON$()
  1494.    Reset Zone 
  1495.    Reserve Zone 3
  1496.    W=W*8
  1497.    H=H*8
  1498.    X=160-W/2
  1499.    Y=50-H/2
  1500.    Get Block 1,X,Y,W+16,H+16
  1501.    Ink 0
  1502.    Bar X+5,Y+5 To X+W+5,Y+H+5
  1503.    Ink C1
  1504.    Bar X,Y To X+W,Y+H
  1505.    Ink C2
  1506.    Box X+1,Y+1 To X+W-1,Y+H-1
  1507.    S=W/8/(NB+1)+1
  1508.    Paper C1
  1509.    Pen C2
  1510.    Curs Off 
  1511.    A=0 : While A<NB
  1512.       Locate X Text(X)+S/2+S*A,Y Text(Y+H)-2
  1513.       Print Border$(Zone$(BUTTON$(A),1+A),2);
  1514.    Inc A : Wend 
  1515.    A=0 : While A<NL
  1516.       Locate 0,Y Text(Y)+1+A
  1517.       Centre LINE$(A)
  1518.       Inc A
  1519.    Wend 
  1520.    Q=0
  1521.    While Q=0
  1522.       While Mouse Key=0 : Wend 
  1523.       Z=Mouse Zone
  1524.       If Z<1 or Z>1+NB
  1525.          Bell 
  1526.       Else 
  1527.          Q=Z
  1528.       End If 
  1529.    Wend 
  1530.    Put Block 1,X,Y
  1531.    SETBUTZONE
  1532. End Proc
  1533. Procedure SETBUTZONE
  1534.    Screen 0
  1535.    Reset Zone 
  1536.    Reserve Zone 60
  1537.    A=0
  1538.    Repeat 
  1539.       B=0
  1540.       Repeat 
  1541.          Set Zone A*10+B+1,B*32,A*16+16 To B*32+32,A*16+32
  1542.          Inc B
  1543.       Until B=10
  1544.       Inc A
  1545.    Until A=5
  1546.    Set Zone 29,256,48 To 272,64
  1547.    Set Zone 51,272,48 To 288,64 : Set Zone 52,288,64 To 320,80
  1548.    Set Zone 47,192,80 To 208,96 : Set Zone 39,208,80 To 224,96
  1549.    Set Zone 49,256,80 To 272,96 : Set Zone 40,272,80 To 288,96
  1550.    Set Zone 30,288,48 To 320,64
  1551. End Proc
  1552. Procedure CLPIT
  1553.    Shared XS,XSIZE,YSIZE
  1554.    Clip 160*XS,7 To 160*XS+XSIZE,7+YSIZE
  1555. End Proc
  1556. Procedure TITLEBAR
  1557.    Shared C(),C2()
  1558.    Change Mouse 3
  1559.    Auto View Off 
  1560.    Flash Off 
  1561.    Curs Off 
  1562.    Hide On 
  1563.    Unpack 6 To 2
  1564.    Screen Display 2,,40,,16
  1565.    A=0 : Repeat : C(A)=Colour(A) : C2(A)=0 : Colour A,0 : Inc A : Until A=8
  1566.    CPAUSE[1,0]
  1567.    Auto View On 
  1568.    Screen To Front 2
  1569.    B=0 : T=0
  1570.    While B<>999
  1571.       Read B,B2
  1572.       If B<>999
  1573.          C2(B)=$FFF : C2(B2)=$FFF
  1574.          OT=T
  1575.          While T<OT+2
  1576.             NEATFADE
  1577.             Inc T
  1578.          Wend 
  1579.       End If 
  1580.    Wend 
  1581.    OT=T : D=6
  1582.    While T<OT+D
  1583.       NEATFADE
  1584.       Inc T
  1585.    Wend 
  1586.    Colour 1,$FFF
  1587.    Screen 0
  1588.    Show On 
  1589.    Screen Display 0,,40,,96
  1590.    Screen Copy 2,0,0,320,144 To 0,0,0
  1591.    Fade 3 To 2
  1592.    Wait 15
  1593.    Screen Close 2
  1594.    Auto View On 
  1595.    Data 4,4,3,5,2,6,7,7,999,999
  1596. End Proc
  1597. Procedure CPAUSE[C,C2]
  1598.    While Colour(C)<>C2 : Wend 
  1599. End Proc
  1600. Procedure NEATFADE
  1601.    Shared C(),C2(),C3(),GTG
  1602.    Dim R(5)
  1603.    A=0 : Repeat 
  1604.       CO=Colour(A)
  1605.       R(0)=CO/256
  1606.       R(1)=(CO mod 256)/16
  1607.       R(2)=CO mod 16
  1608.       R(3)=C2(A)/256
  1609.       R(4)=(C2(A) mod 256)/16
  1610.       R(5)=C2(A) mod 16
  1611.       R=0 : Repeat 
  1612.          If R(R)<R(R+3)
  1613.             R(R)=R(R)+3 : R(R)=Min(R(R),R(R+3))
  1614.          End If 
  1615.          If R(R)>R(R+3)
  1616.             R(R)=R(R)-3 : R(R)=Max(R(R),R(R+3))
  1617.          End If 
  1618.          Inc R
  1619.       Until R=3
  1620.       CO=R(0)*256+R(1)*16+R(2)
  1621.       Colour A,CO
  1622.       If CO=$FFF
  1623.          C2(A)=C(A)
  1624.          C3(A)=1
  1625.       End If 
  1626.       Inc A
  1627.    Until A=8
  1628. End Proc
  1629. Procedure FXSCRN
  1630.    Shared SCRN
  1631.    Y=Y Mouse
  1632.    If Y>141
  1633.       SCRN=1
  1634.       Screen 1
  1635.       SCRNUP
  1636.       Screen To Front 1
  1637.       Change Mouse 2
  1638.    Else 
  1639.       SCRN=0
  1640.       Screen 0
  1641.       SCRNUP
  1642.       Screen To Front 0
  1643.       Change Mouse 1
  1644.    End If 
  1645.    View 
  1646.    Limit Mouse 
  1647. End Proc
  1648. Procedure SCRNCHK[X,Y]
  1649.    Shared SREDO,NREZ,SPDISP,SCRN,SCRNO
  1650.    If SCRN=0 and Y>98
  1651.       SCRN=1
  1652.       Screen 1
  1653.       SCRNUP
  1654.       If SPDISP=1
  1655.          NREZ=1
  1656.          SREDO=1
  1657.          Put Block 5,160*XS,7
  1658.       End If 
  1659.       Screen To Front 1
  1660.       Change Mouse 2
  1661.       Y=Y Hard(1,3)
  1662.    End If 
  1663.    If SCRN=1 and Y<=1
  1664.       SCRN=0
  1665.       Screen 0
  1666.       SCRNDOWN
  1667.       Screen To Front 0
  1668.       Change Mouse 1
  1669.       Y=Y Hard(0,95)
  1670.    End If 
  1671.    If SCRN<>SCRNO
  1672.       SCRNO=SCRN
  1673.       View 
  1674.       Limit Mouse 
  1675.       Y Mouse=Y
  1676.    End If 
  1677. End Proc
  1678. Procedure REDUCEZOOM[X,Y,K]
  1679.    Shared NREZ,BC,FC,XS,XSIZE,YSIZE
  1680.    Screen 1
  1681.    Zoom 1,16,7,16+XSIZE,7+YSIZE To 1,160*XS,7,Max(X,160*XS+1),Max(Y,8)
  1682.    Ink 0
  1683.    If X<160*XS+95
  1684.       Bar X,7 To 160*XS+95,135
  1685.    End If 
  1686.    If Y<135
  1687.       Bar 160*XS,Y To 160*XS+95,135
  1688.    End If 
  1689.    If K=2
  1690.       XSIZE=X-160*XS : YSIZE=Y-7
  1691.       Screen Copy 1,160*XS,7,160*XS+96,135 To 1,16,7
  1692.    Else 
  1693.       If K=0
  1694.          Screen Copy 1,16,7,112,135 To 1,160*XS,7
  1695.       End If 
  1696.    End If 
  1697. End Proc
  1698. Procedure RESIZE[X,Y,K]
  1699.    Shared NREZ,BC,FC,XS,XSIZE,YSIZE
  1700.    Screen 1
  1701.    Get Block 1,160*XS,7,XSIZE,YSIZE
  1702.    OK=0
  1703.    Ink BC,FC,BC
  1704.    Text 10,150," Press Right Button when done "
  1705.    While OK=0
  1706.       K=0
  1707.       While K=0
  1708.          Z=Mouse Zone
  1709.          K=Mouse Key
  1710.          X=X Screen(X Mouse)
  1711.          Y=Y Screen(Y Mouse)
  1712.       Wend 
  1713.       If K=1 and Z=3
  1714.          X=(X-160*XS)
  1715.          Y=(Y-7)
  1716.          X=Max(16,X)
  1717.          Y=Max(1,Y)
  1718.          XSIZE=X : YSIZE=Y
  1719.          X=X mod 16
  1720.          If X>0
  1721.             XSIZE=(XSIZE/16)*16+16
  1722.          End If 
  1723.          Cls 0,159*XS,7 To 160*XS+96,136
  1724.          Ink FC,BC
  1725.          Box 159*XS,6 To 160*XS+96,136
  1726.          Put Block 1,160*XS,7
  1727.          Ink FC,BC : Box 159*XS,6 To 160*XS+XSIZE,7+YSIZE
  1728.       Else 
  1729.          OK=1
  1730.       End If 
  1731.    Wend 
  1732.    NREZ=1
  1733. End Proc
  1734. Procedure PICKCOL[X,Y,K]
  1735.    Shared NCOLS,REZ,XS,BC,FC,LEFTC,RIGHTC
  1736.    If K=1
  1737.       LEFTC=Point(X,Y)
  1738.    Else 
  1739.       RIGHTC=Point(X,Y)
  1740.    End If 
  1741.    PALDRAW2
  1742. End Proc
  1743. Procedure PALDRAW
  1744.    Shared NCOLS,REZ,XS,BC,FC,LEFTC,RIGHTC,XSIZE,YSIZE
  1745.    If Colour(BC)/2=Colour(FC)/2
  1746.       FC=1
  1747.       BC=0
  1748.       Set Pattern 2
  1749.    End If 
  1750.    REZ$=" Low"
  1751.    If XS>1 Then REZ$="High"
  1752.    Auto View Off 
  1753.    Screen 1
  1754.    X=NCOLS/8
  1755.    If X<1 Then X=1
  1756.    Y=8 : If NCOLS<8 Then Y=NCOLS
  1757.    S=32/X*XS
  1758.    Set Paint 1
  1759.    Ink FC,BC,FC
  1760.    Bar 269*XS,2 To 319*XS,142
  1761.    Bar 0,142 To 320*XS,152
  1762.    Ink BC,FC,BC
  1763.    Text 269*XS,150,REZ$
  1764.    Set Paint 0
  1765.    Ink 0,0,0
  1766.    Bar 277*XS,6 To 279*XS+X*S-1,23+(Y-1)*16
  1767.    A=0 : Repeat : B=0 : Repeat 
  1768.          Ink A*8+B
  1769.          Bar 278*XS+A*S,7+B*16 To 278*XS+(A+1)*S-1,22+B*16
  1770.       Inc B : Until B>=Y
  1771.    Inc A : Until A=X
  1772.    Ink BC,FC,BC
  1773.    Text 120*XS-(XS=2)*100,150,"Size X:"+Right$(" "+Str$(XSIZE),2)+" Y:"+Right$("  "+Str$(YSIZE),3)
  1774.    PALDRAW2
  1775. End Proc
  1776. Procedure PALDRAW2
  1777.    Shared FC,BC,LEFTC,RIGHTC,XS,NCOLS
  1778.    Set Paint 1
  1779.    Y=8 : If NCOLS<8 Then Y=NCOLS
  1780.    Ink LEFTC,BC,BC
  1781.    Bar 272*XS,7 To 275*XS,7+Y*16
  1782.    Ink RIGHTC,BC,BC
  1783.    Bar 313*XS,7 To 316*XS,7+Y*16
  1784.    Set Paint 0
  1785. End Proc
  1786. Procedure HILITE[B]
  1787.    Shared BO,SC4,NREZ,HNX,HNY
  1788. HNX=0 : HNY=0
  1789.    If SC4=1
  1790.       SC4=0
  1791.       NREZ=1
  1792.    End If 
  1793.    Screen 0
  1794.    If B<>0
  1795.       Ink 0 : BX=(BO-1) mod 10 : BY=(BO-1)/10 : Box BX*32,BY*16+16 To BX*32+31,BY*16+31
  1796.       Ink 1 : BX=(B-1) mod 10 : BY=(B-1)/10 : Box BX*32,BY*16+16 To BX*32+31,BY*16+31
  1797.       BO=B
  1798.    End If 
  1799. End Proc
  1800. Procedure SHWFILL[F]
  1801.    Set Paint 1
  1802.    Set Pattern F
  1803.    Ink 1,0
  1804.    Bar 260,68 To 284,76
  1805.    Set Paint 0
  1806.    Set Pattern 0
  1807. End Proc
  1808. Procedure SHWSPRITES[B]
  1809.    Shared SPDISP,XS,FC,BC
  1810.    SC=Screen
  1811.    Screen 0
  1812.    Ink 0,3
  1813.    Text 228,91,Right$("000"+Mid$(Str$(B),2),3)
  1814.    If SPDISP=1
  1815.       Screen 1
  1816.       A=-1 : Repeat : S=B+A
  1817.          If S>0 and S<=Length(1)+1
  1818.             Ink FC : Box 8*XS-1+(A+1)*104*XS,15 To 104*XS+1+(A+1)*104*XS,145
  1819.             If S<=Length(1)
  1820.                SB=Sprite Base(S)
  1821.                X=Deek(SB)*16 : Y=Deek(SB+2)
  1822.                HX=Deek(SB+6) : HY=Deek(SB+8)
  1823.                XV=(52*XS)-X/2
  1824.                YV=64-Y/2
  1825.                Bob A+1,(A+1)*104*XS+8*XS+HX+XV,16+HY+YV,S
  1826.                Ink BC,FC,BC : Text(A+1)*104*XS+8*XS,8,Right$("  "+Str$(S),3)+" Plns"+Str$(Deek(SB+4))
  1827.                Text(A+1)*104*XS+8*XS,154," X:"+Right$(" "+Str$(X),2)+" Y:"+Right$("  "+Str$(Y),3)+" "
  1828.             Else 
  1829.                Bob Off A+1
  1830.                Ink BC,FC,BC : Text(A+1)*104*XS+8*XS,8,Right$("   "+Str$(S),3)+" Empty "
  1831.                Text(A+1)*104*XS+8*XS,154,"Blank Sprite"
  1832.             End If 
  1833.          Else 
  1834.             Bob Off A+1
  1835.             Ink 0 : Bar 8*XS-1+(A+1)*104*XS,0 To 104*XS+1+(A+1)*104*XS,160
  1836.          End If 
  1837.          Inc A
  1838.       Until A=2
  1839.    End If 
  1840.    Screen SC
  1841. End Proc
  1842. Procedure DISPSPRITES
  1843.    Shared SPDISP,XS,NC(),SX(),ST(),FC,REZ,XSIZE,YSIZE
  1844.    SC=Screen
  1845.    Screen 1
  1846.    Clip 
  1847.    Get Block 5,160*XS,7,XSIZE,YSIZE
  1848.    Ink 0 : Bar 0,0 To 320*XS,160
  1849.    If Length(1)>0
  1850.       Get Sprite Palette 
  1851.    End If 
  1852.    Screen SC
  1853.    Screen To Front SC
  1854. End Proc
  1855. Procedure BXES
  1856.    Shared BIGSPR,LFTO,TPWO,LFTWIN,TPWIN,NCOLS,FC,BC,XS,XSIZE,YSIZE,MP
  1857.    TXS=XSIZE : TYS=YSIZE
  1858.       XSIZE=Min(32*XS,XSIZE) : YSIZE=Min(32,YSIZE)
  1859.    FC=FC mod NCOLS
  1860.    BC=BC mod NCOLS
  1861.    If FC=BC
  1862.       FC=1
  1863.       BC=0
  1864.    End If 
  1865.    Get Block 1,160*XS,7,TXS,TYS
  1866.    Screen 1
  1867.    Ink 0
  1868.    Bar 0,0 To XS*320,160
  1869.    Ink FC,BC
  1870.    Put Block 1,160*XS,7
  1871.    Box 14,5 To 17+XSIZE*MP,8+YSIZE*MP
  1872.    Box 159*XS,6 To 160*XS+96,136
  1873.    Box 159*XS,6 To 160*XS+TXS,7+TYS
  1874.    Ink BC,FC
  1875.    Text 120*XS-(XS=2)*100,150,"Size X:"+Str$(TXS)+" Y:"+Str$(TYS)
  1876.    LFTO=-1
  1877.       XSIZE=TXS : YSIZE=TYS
  1878. End Proc
  1879. Procedure BXES2
  1880.    Shared BIGSPR,LFTO,TPWO,TPWIN,LFTWIN,FC,BC,XS,XSIZE,YSIZE,MP
  1881.    TXS=XSIZE : TYS=YSIZE
  1882.       XSIZE=Min(32*XS,XSIZE) : YSIZE=Min(32,YSIZE)
  1883.    BIGBARS
  1884.    Screen 1
  1885.    Ink FC,BC
  1886.    Draw 17+XSIZE*MP,5 To 17+XSIZE*MP,8+YSIZE*MP
  1887.    Draw 160*XS+TXS,6 To 160*XS+TXS,7+TYS
  1888.    XSIZE=TXS : YSIZE=TYS
  1889. End Proc
  1890. Procedure BXES3
  1891.    Shared BIGSPR,FC,BC,XS,XSIZE,YSIZE,MP
  1892.    TXS=XSIZE : TYS=YSIZE
  1893.    If BIGSPR
  1894.       XSIZE=Min(32*XS,XSIZE) : YSIZE=Min(32,YSIZE)
  1895.    End If 
  1896.    Screen 1
  1897.    Ink FC,BC
  1898.    Box 14,5 To 17+XSIZE*MP,8+YSIZE*MP
  1899.    Box 159*XS,6 To 160*XS+96,136
  1900.    Box 159*XS,6 To 160*XS+TXS,7+TYS
  1901.    Ink BC,FC
  1902.    Text 120*XS-(XS=2)*100,150,"Size X:"+Str$(TXS)+" Y:"+Str$(TYS)
  1903.    XSIZE=TXS : YSIZE=TYS
  1904. End Proc
  1905. Procedure BIGBARS
  1906.    Shared FC,BC,XSIZE,YSIZE,BIGSPR,TPWO,TPWIN,LFTO,LFTWIN,XS
  1907. X=Min(32*XS,XSIZE) : Y=Min(32,YSIZE)
  1908.  SC=Screen
  1909.    Screen 1
  1910.    If TPWO<>TPWIN or LFTO<>LFTWIN
  1911.       Ink 0
  1912.       Bar 154*XS,6 To 158*XS,135
  1913.       Bar 160*XS,1 To 160*XS+96,5
  1914.    End If 
  1915.    Ink FC,BC
  1916.    If BIGSPR and(TPWO<>TPWIN or LFTO<>LFTWIN)
  1917.       Draw 154*XS,6+TPWIN To 158*XS,6+TPWIN : Draw 154*XS,6+Y+TPWIN To 158*XS,6+Y+TPWIN
  1918.       Draw 160*XS+LFTWIN,1 To 160*XS+LFTWIN,5 : Draw 160*XS+LFTWIN+X,1 To 160*XS+LFTWIN+X,5
  1919.       Draw 156*XS,6+TPWIN To 156*XS,Y+6+TPWIN : Draw 160*XS+LFTWIN,3 To 160*XS+LFTWIN+X,3
  1920.       LFTO=LFTWIN : TPWO=TPWIN
  1921.    End If 
  1922.    Screen SC
  1923. End Proc
  1924. Procedure FASTZOOM
  1925.    Shared TPWIN,LFTWIN,BIGSPR,FC,BC,XS,M,XSIZE,YSIZE,MP,ST(),SX(),NC()
  1926.    SC=Screen
  1927.    Screen 1
  1928.    TXS=XSIZE
  1929.    TYS=YSIZE
  1930.       XSIZE=Min(32*XS,XSIZE)
  1931.       YSIZE=Min(32,YSIZE)
  1932. MP=4
  1933.       If BIGSPR
  1934.          Get Block 6,160*XS,7,96,128
  1935.       End If 
  1936.       Dreg(1)=MP
  1937.       Dreg(2)=160*XS+LFTWIN : Dreg(3)=7+TPWIN
  1938.       Dreg(4)=16 : Dreg(5)=7
  1939.       Dreg(6)=XSIZE : Dreg(7)=YSIZE
  1940.       Areg(0)=Screen Base
  1941.       Call 10
  1942.       If BIGSPR
  1943.          Put Block 6,160*XS,7
  1944.          Del Block 6
  1945.       End If 
  1946.    Set Zone 2,16,7 To 16+XSIZE*MP,7+YSIZE*MP
  1947.    Set Zone 3,160*XS,7 To 160*XS+96,135
  1948.       XSIZE=TXS : YSIZE=TYS
  1949.    Screen SC
  1950. End Proc
  1951. Procedure CREDITS
  1952.    Get Block 5,48,0,224,96
  1953.    Ink 2
  1954.    Bar 49,1 To 269,89
  1955.    Screen Copy 0,256,96,320,144 To 0,50,2
  1956.    Ink 1,2
  1957.    Text 120,12,"AMOS Sprite Editor"
  1958.    Text 120,22,"Copyright"
  1959.    Ink 3,2
  1960.    Text 120,32,"Mandarin/Jawx 1990"
  1961.    Text 120,42,"Written by"
  1962.    Text 120,52,"Shadow Software"
  1963.    Ink 1,2
  1964.    Text 52,62,"Program:Aaron Fothergill"
  1965.    Text 52,72,"Graphics:Adam Fothergill"
  1966.    Text 52,82,"Fast Zoom:Francois Lionet"
  1967.    While Mouse Key<>0 : Wend 
  1968.    While Mouse Key=0 and Asc(Inkey$)=0 : Wend : While Mouse Key<>0 : Wend 
  1969.    Put Block 5,48,0 : Del Block 5
  1970. End Proc
  1971. DISKERROR:
  1972. SC=Screen
  1973. Screen 0
  1974. Limit Mouse 
  1975. LSTERRN=Errn
  1976. LINE$(0)="Disk Error "+Str$(Errn)
  1977. BUTTON$(0)="O.K"
  1978. ALERT[30,5,6,1,1,1]
  1979. Screen SC
  1980. Limit Mouse 
  1981. Resume Next 
  1982. GENERALERROR:
  1983. LSTERRN=Errn
  1984. Resume Next