home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 452.lha / PopArt / sorcery / init.c < prev    next >
C/C++ Source or Header  |  1990-12-09  |  18KB  |  514 lines

  1.  
  2.  
  3.  /*  init   ---   stuff a zillion strucks, grab extra chip real-estate  */
  4.  
  5.                     /*  good code is beautiful code  */
  6.  
  7.  
  8. #include <exec/memory.h>
  9. #include <graphics/gfxbase.h>
  10. #include <libraries/dosextens.h>
  11. #include "stuff.h"
  12.  
  13. #ifdef POPLITE
  14. #include "chip2.h"
  15. #else
  16. #include "chip.h"
  17. #endif
  18.  
  19.              extern struct SUPERwindow         SuperWindows []  ;
  20.              extern struct Image               vop              ;
  21.              extern UWORD                      mrQ              ;
  22.              extern   int                      CurrentWindow    ;
  23.              extern   int                      curOnion         ;
  24.              extern   int                      togOnion         ;
  25.              extern   int                      Enable_Abort     ;
  26.                     struct RastPort           *reep             ;
  27.                     struct ViewPort           *veep             ;
  28.                     struct IntuitionBase      *IntuitionBase    ;
  29.                     struct GfxBase            *GfxBase          ;
  30.                     struct Screen             *scr              ;
  31.                     struct Window             *win              ;
  32.                     USHORT                    *myBitOfChip      ;
  33.                     USHORT                    *fillerChip       ;
  34.                     struct Process            *OurTask          ;
  35.                     APTR                       old_pr_WindowPtr ;
  36.  
  37. UWORD ni_colCMAP[]={
  38.     0x522,0xfe0,0x606,0x4d0,0x00f,0xf0f,0x0ff,0xfff,0x620,0xe50,0x9f1,0xeb0,
  39.     0x55f,0x92f,0x0f8,0xccc,0x000,0xbef,0x442,0x189,0x444,0x555,0x666,0x777,
  40.     0x888,0x999,0xaaa,0xbbb,0xccc,0xddd,0x44b,0xcc5,
  41. }; /* end of ni_col9CMAP */
  42.  
  43.     UWORD actionmap [32];
  44.     UBYTE flubb [12] = { "ni_" };
  45.     SHORT vecks2 [10] = { 0,0, 86,0, 86,13, 0,13, 0,0 };
  46.     struct Border bored2 = { -3, -3, 16, 0, JAM1, 5, vecks2, NL };
  47.     SHORT vecks [10] = { 0,0, 84,0, 84,11, 0,11, 0,0 };
  48.     struct Border bored = { -2, -2, 23, 0, JAM1, 5, vecks, &bored2 };
  49.  
  50.     struct StringInfo nameinfo = { flubb, NL, 1, 10, 0, 0, };
  51.  
  52.     struct Gadget namegad =  { NL,229,148,80,12,
  53.       GADGHCOMP,STRINGCENTER|RELVERIFY,STRGADGET,(APTR)&bored,
  54.       NL,NL,NL, (APTR) &nameinfo,SAVEG,NL};
  55.  
  56.  
  57. #define ImGAD(x,y,len,hite,rn,hit,id,nx) \
  58.     { nx, x, y,len,hite, GADGHNONE | GADGIMAGE, hit, BOOLGADGET, (APTR)\
  59.               rn,NL,NL,NL,NL, id, NL}
  60.  
  61. #define ZzGAD(x,y,len,hite,hit,id,nx) \
  62.     { nx, x, y,len,hite, GADGHNONE, hit, BOOLGADGET, (APTR)\
  63.               NL,NL,NL,NL,NL,id,NL}
  64.  
  65. #define IxGAD(x,y,len,hite,rn,rd,hit,id,nx) \
  66.     { nx, x, y,len,hite, GADGHIMAGE | GADGIMAGE, hit, BOOLGADGET, (APTR)\
  67.             rn,(APTR) rd,NL,NL,NL, id, NL}
  68.  
  69. #define AnGAD(x,y,len,hite,rn,hit,id,nx) \
  70.     { nx, x, y,len,hite,GADGHNONE|GADGIMAGE, hit|RELVERIFY, BOOLGADGET, (APTR)\
  71.                  rn,NL,NL,NL,NL, id, NL}
  72.  
  73. #ifdef POPLITE
  74. #define IM(x,y)  { 0, 0, x, y, 1, NL,    1, 0, NL }
  75. #else
  76. #define IM(x,y)  { 0, 0, x, y, 5, NL, 0x1f, 0, NL }
  77. #endif
  78.  
  79.                    struct Image
  80.     hatchI = IM (ni_htofWIDT,   ni_htofHITE),
  81.     unhtcI = IM (ni_unhtofWIDT, ni_unhtofHITE),
  82.     hato_I = IM (ni_htonWIDT,   ni_htonHITE),
  83.     hatf_I = IM (ni_unhtonWIDT, ni_unhtonHITE),
  84.     pick_I = IM (ni_pickWIDT,   ni_pickHITE),
  85.     save_I = IM (ni_saveWIDT,   ni_saveHITE),
  86.     load_I = IM (ni_loadWIDT,   ni_loadHITE),
  87.     new__I = IM (32, 24),
  88.     svsz_I = IM (ni_allQWIDT, ni_allQHITE),
  89.     svsz_X = IM (ni_allQWIDT, ni_allQHITE),
  90.     clon_I = IM (ni_clon1WIDT, ni_clon1HITE),
  91.     inc_I  = IM (ni_incWIDT, ni_incHITE),
  92.     ins_I  = IM (ni_insWIDT, ni_insHITE),
  93.     fillI  = IM (ni_fillWIDT, ni_fillHITE),
  94.     nocmI  = IM (ni_cmWIDT, ni_cmHITE),
  95.     nocmX  = IM (ni_cmWIDT, ni_cmHITE),
  96.     dec_I  = IM (ni_decWIDT, ni_decHITE), 
  97.     hex_I  = IM (ni_decWIDT, ni_decHITE),
  98.  
  99.    ;
  100.  
  101.  
  102. struct Gadget TGads [] = {
  103.      ZzGAD (  4,144,38,26, RELVERIFY, BLOKG, &namegad   ),
  104.      IxGAD (  4,161,38,26, &hatchI,&hato_I,TOGGLESELECT, HATCG,  &TGads [0]),
  105.      IxGAD ( 42,161,38,26, &unhtcI,&hatf_I,TOGGLESELECT, UNHTG,  &TGads [1]),
  106.      AnGAD (281,162,38,26, &new__I,        NL,           NEW_G,  &TGads [2]),
  107.      ImGAD ( 80,161,38,26, &pick_I,        RELVERIFY,    PICKG,  &TGads [3]),
  108.      AnGAD (204,161,38,26, &save_I,        0,            SAVEG,  &TGads [4]),
  109.      ImGAD (242,161,38,26, &load_I,        RELVERIFY,    LOADG,  &TGads [5]),
  110.      AnGAD (277,121,2*16,20,&clon_I,       NL,           CLONG,  &TGads [6]),
  111.  
  112.     IxGAD (156,144, ni_allQWIDT, ni_allQHITE,
  113.             &svsz_I, &svsz_X, TOGGLESELECT, SVSZG, &TGads[7]),
  114.  
  115.     ZzGAD (232,121, ni_rollWIDT, ni_rollHITE,     RELVERIFY,ROLLG,&TGads[ 8]),
  116.     AnGAD (156,161,  ni_incWIDT,  ni_incHITE, &inc_I,RELVERIFY,INC_G,&TGads[ 9]),
  117.     AnGAD (194,161,  ni_insWIDT,  ni_insHITE, &ins_I,RELVERIFY,INS_G,&TGads[10]),
  118.     AnGAD (118,161, ni_fillWIDT, ni_fillHITE,&fillI,RELVERIFY,FILLG,&TGads[11]),
  119.     ZzGAD (231, 81, ni_copyWIDT, ni_copyHITE,RELVERIFY,COPYG,&TGads[12]),
  120.     ZzGAD (231,100, ni_undoWIDT, ni_undoHITE,RELVERIFY,UNDOG,&TGads[13]),
  121.     ZzGAD (267,121,ni_stackWIDT,ni_stackHITE,RELVERIFY,STAKG,&TGads[14]),
  122.     ZzGAD (229,121,  ni_seqWIDT,  ni_seqHITE,RELVERIFY,SEQ_G,&TGads[15]),
  123.     ZzGAD (118,144,  ni_cnlWIDT,  ni_cnlHITE,RELVERIFY,CNL_G,&TGads[16]),
  124.  
  125.     IxGAD (80,144,ni_cmWIDT,ni_cmHITE,
  126.             &nocmI,&nocmX,TOGGLESELECT,NOCMG,&TGads[17]),
  127.  
  128.     ZzGAD (201, 10, ni_onionWIDT, ni_onionHITE,RELVERIFY,ONIOG,&TGads[18]),
  129.     ZzGAD (169, 10, ni_poponWIDT, ni_poponHITE,RELVERIFY,POP_G,&TGads[19]),
  130.     ZzGAD (137, 10,   ni_xwbWIDT,   ni_xwbHITE,RELVERIFY,XWB_G,&TGads[20]),
  131.     ZzGAD (  2,128,ni_colorsWIDT,ni_colorsHITE,RELVERIFY,TWEKG,&TGads[21]),
  132.  
  133.     IxGAD (105,10,ni_decWIDT,ni_decHITE,
  134.             &hex_I,&dec_I,TOGGLESELECT,HEX_G,&TGads[22]),
  135.  
  136.     };
  137.  
  138.  
  139. #define ColGAD(x,y,id,nx) \
  140.             {nx,x,y,10,7,GADGHCOMP,RELVERIFY,BOOLGADGET,NL,NL,NL,NL,NL,id,NL}
  141.  
  142.  
  143.     struct Gadget   CGads [ 32 ] =
  144.      {  ColGAD( 2, 15, COL0, &TGads[23]),
  145.         ColGAD( 2, 22, COL1, &CGads[ 0]), ColGAD( 2, 29,COL2, &CGads[ 1]),
  146.         ColGAD( 2, 36, COL3, &CGads[ 2]), ColGAD( 2, 43,COL4, &CGads[ 3]),
  147.         ColGAD( 2, 50, COL5, &CGads[ 4]), ColGAD( 2, 57,COL6, &CGads[ 5]),
  148.         ColGAD( 2, 64, COL7, &CGads[ 6]), ColGAD( 2, 71,COL8, &CGads[ 7]),
  149.         ColGAD( 2, 78, COL9, &CGads[ 8]), ColGAD( 2, 85,COL10,&CGads[ 9]),
  150.         ColGAD( 2, 92, COL11,&CGads[10]), ColGAD( 2, 99,COL12,&CGads[11]),
  151.         ColGAD( 2,106, COL13,&CGads[12]), ColGAD( 2,113,COL14,&CGads[13]),
  152.         ColGAD( 2,120, COL15,&CGads[14]), ColGAD(22, 15,COL16,&CGads[15]),
  153.         ColGAD(22, 22, COL17,&CGads[16]), ColGAD(22, 29,COL18,&CGads[17]),
  154.         ColGAD(22, 36, COL19,&CGads[18]), ColGAD(22, 43,COL20,&CGads[19]),
  155.         ColGAD(22, 50, COL21,&CGads[20]), ColGAD(22, 57,COL22,&CGads[21]),
  156.         ColGAD(22, 64, COL23,&CGads[22]), ColGAD(22, 71,COL24,&CGads[23]),
  157.         ColGAD(22, 78, COL25,&CGads[24]), ColGAD(22, 85,COL26,&CGads[25]),
  158.         ColGAD(22, 92, COL27,&CGads[26]), ColGAD(22, 99,COL28,&CGads[27]),
  159.         ColGAD(22,106, COL29,&CGads[28]), ColGAD(22,113,COL30,&CGads[29]),
  160.         ColGAD(22,120, COL31,&CGads[30]),                                  };
  161.  
  162.  
  163.          /*  HALLELLULLIA Sing Hail and Praise Unto the Cosmos!
  164.  
  165.                                     N O
  166.                                   F**KING
  167.                                 M E N U S ! !
  168.  
  169.       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  */
  170.  
  171.  
  172.     struct NewScreen scrdef = { 0,0, 320,200, 5,1,0,NL,
  173.                             CUSTOMSCREEN|SCREENBEHIND,NL,NL,NL,NL };
  174.  
  175.     struct NewWindow windef = { 0,1, 320,199, 0,1,
  176.                 CLOSEWINDOW | MOUSEMOVE | MOUSEBUTTONS |
  177.                 GADGETUP | RAWKEY | INACTIVEWINDOW,    /* IDCMP */
  178.                 WINDOWCLOSE | WINDOWDEPTH | REPORTMOUSE |
  179.                 BORDERLESS | ACTIVATE | RMBTRAP,   /* Flags */
  180.                 &CGads [31], NL,NL,NL,NL, 0,0,0,0, CUSTOMSCREEN };
  181.  
  182.  
  183.    void
  184. openstuff ()
  185. {
  186.  USHORT *grabChip ();
  187.  
  188. #define SIP (struct InuitionBase *)
  189. #define SGP (struct      GfxBase *)
  190. #define ILB "intuition.library",33L
  191. #define GLB  "graphics.library",33L
  192. #define OLB OpenLibrary
  193. #define OAM AllocMem
  194. #define QUIT(x) quit ("Abort - " x " \n")
  195.  
  196.  
  197.     Enable_Abort = 0;
  198.     IFN (IntuitionBase = SIP OpenLibrary (ILB))  QUIT ("No Intuition");
  199.     IFN (     GfxBase  = SGP OpenLibrary (GLB))  QUIT ("No Graphics");
  200.     IFN (         scr  =  OpenScreen (&scrdef))  QUIT ("No Screen ");
  201.     LoadRGB4 (&(scr->ViewPort), actionmap, 32L);
  202.       new____Chip = grabChip (new____,   new____SIZE,   &TGads [3]);
  203.       ni_pickChip = grabChip (ni_pick,   ni_pickSIZE,   &TGads [4]);
  204.       ni_saveChip = grabChip (ni_save,   ni_saveSIZE,   &TGads [5]);
  205.       ni_loadChip = grabChip (ni_load,   ni_loadSIZE,   &TGads [6]);
  206.      ni_clon1Chip = grabChip (ni_clon1, ni_clon1SIZE,   &TGads [7]);
  207.       ni_allQChip = grabChip (ni_allQ,   ni_allQSIZE,   &TGads [8]);
  208.       ni_oneQChip = grabChip (ni_oneQ,   ni_oneQSIZE,   &TGads [8]);
  209.  svsz_I.ImageData = ni_allQChip;
  210.  svsz_X.ImageData = ni_oneQChip;
  211.       ni_htonChip = grabChip (ni_hton,     ni_htonSIZE, &TGads [1]);
  212.       ni_htofChip = grabChip (ni_htof,     ni_htofSIZE, &TGads [1]);
  213.     ni_unhtonChip = grabChip (ni_unhton, ni_unhtonSIZE, &TGads [2]);
  214.     ni_unhtofChip = grabChip (ni_unhtof, ni_unhtofSIZE, &TGads [2]);
  215.  hato_I.ImageData = ni_htonChip;
  216.  hatf_I.ImageData = ni_unhtonChip;
  217.  hatchI.ImageData = ni_htofChip;
  218.  unhtcI.ImageData = ni_unhtofChip;
  219.       ni_nocmChip = grabChip (ni_nocm, ni_nocmSIZE, &TGads [18]);
  220.         ni_cmChip = grabChip (ni_cm, ni_cmSIZE, &TGads [18]);
  221.   nocmI.ImageData = ni_nocmChip;
  222.   nocmX.ImageData = ni_cmChip;
  223.        ni_hexChip = grabChip (ni_hex, ni_decSIZE, &TGads [23]);
  224.        ni_decChip = grabChip (ni_dec, ni_decSIZE, &TGads [23]);
  225.   hex_I.ImageData = ni_hexChip;
  226.   dec_I.ImageData = ni_decChip;
  227. #ifndef POPLITE   
  228.       hex_I.Depth = dec_I.Depth = 2;
  229.   dec_I.PlanePick = hex_I.PlanePick = 3;
  230. #endif
  231.        ni_incChip = grabChip (ni_inc, ni_incSIZE, &TGads [10]);
  232.       ni_fillChip = grabChip (ni_fill, ni_fillSIZE, &TGads [12]);
  233.     windef.Screen = scr;
  234.     IFN (win = OpenWindow (&windef))  QUIT ("No Window");
  235.  
  236.     IFN ( myBitOfChip  = (USHORT *) AllocMem (PICKSIZE, MEMF_CHIP))
  237.         quit ("Abort - No Fashionable, Expensive Chips Left!");
  238.  
  239.     CopyMem (pickmousepoints, myBitOfChip, PICKSIZE);
  240.  
  241.     IFN ( fillerChip  = (USHORT *) AllocMem (FILLSIZE, MEMF_CHIP))
  242.         quit ("Abort - Hey, free up some graphics memory, huh?");
  243.  
  244.     CopyMem (fillerpoints, fillerChip, FILLSIZE);
  245.     NewSuperWindow ();
  246.     reep = win->RPort;
  247.     DOni_cnl (118, 144);
  248.     DOni_roll (232, 121);
  249.     DOni_ins (194, 161);
  250.     popChip (ni_namer, ni_namerSIZE, 32, 16, 194, 145);
  251.     vop.PlanePick = 0x09;
  252.     DOni_copy (231, 81);
  253.     DOni_undo (231,100);
  254.     vop.PlanePick  = ni_xwbPLAN;
  255.     DOni_xwb (137, 10),
  256.     vop.PlanePick  = ni_whatPLAN;
  257.     vop.PlaneOnOff = ni_whatONOF;
  258.     DOni_what (42, 144);
  259.     vop.PlanePick = 0x0f;
  260.     vop.PlaneOnOff = 0x010;
  261.     DOni_ubuff (UbfOver, UbfDown);
  262.     vop.PlanePick = 0x05;
  263.     vop.PlaneOnOff = 0x0;
  264.     DOni_stack (267, 121);
  265.     vop.PlanePick = ni_seqPlanePick;
  266.     DOni_seq (229,121);
  267.     vop.PlanePick = 0x01f;
  268.     onionOn ();
  269.     DOni_blokof (4,144);
  270.     popOnOff ();
  271.     Mess ("Welcome to PopArt!!!");
  272.     DOni_colors (2, 128);
  273.  
  274. }  /*  give me the WHOLE F**KING AMIGA!!!
  275.                               (or at least my pink half of the drain pipe)  */
  276.  
  277.  
  278.            void
  279. onionOn ()
  280. {
  281.  
  282.     vop.Depth = 2;
  283.     vop.PlanePick = 0x03;
  284.     DOni_onion (201, 10);
  285.     vop.PlanePick = 0x01f;
  286.     vop.Depth = 5;
  287.     Mess ("See-Thru Enabled");
  288.  
  289. }
  290.  
  291.  
  292.     int bloking = 0;
  293.  
  294.              void
  295. blokOnOff ()
  296. {
  297.  
  298.     ifn (bloking)  {  bloking = izCtrl (mrQ)? 5: 2;
  299.                       Mess ("Block Mode Enabled");
  300.                       DOni_blokon (4,144);  }
  301.     else  {           bloking = 0;
  302.                       Mess ("Block Mode Disabled (computerese...)");
  303.                       DOni_blokof (4,144);  }
  304.  
  305. }
  306.  
  307.  
  308.     int popping = 1;
  309.  
  310.              void
  311. popOnOff ()
  312. {
  313.  
  314.     popping = !popping;
  315.     vop.PlanePick = ni_poponPLAN;
  316.     if (popping)  {  Mess ("Pop Mode Started");  DOni_popon (169, 10);  }
  317.     else  {  Mess ("Bye-Bye Pop Mode (Disabled)");  DOni_popoff (169, 10);  }
  318.     vop.PlanePick = 0x01f;
  319.  
  320. }
  321.  
  322.  
  323.             void
  324. onionOff ()
  325. {
  326.  
  327.     vop.Depth = 2;
  328.     vop.PlanePick = 0x03;
  329.     DOni_onnoff (201, 10);
  330.     vop.PlanePick = 0x01f;
  331.     vop.Depth = 5;
  332.     Mess ("See-Thru Disabled");
  333.     if (curOnion != CurrentWindow)  redrawWorkArea (1);
  334.  
  335. }
  336.  
  337.  
  338.             void
  339. pickmouse ()
  340. {
  341.     long eno = 0;
  342.     
  343.     
  344.     ClearPointer (win);
  345.     
  346.     loop (;  eno < 85;  eno += 2)  
  347.         SetPointer (win, myBitOfChip, eno, 16L, 0L, -1L);  
  348.  
  349. }                                                     /*  end of pickmouse  */
  350.  
  351.  
  352. fillermouse ()
  353. {
  354.  
  355.     ClearPointer (win);
  356.     SetPointer (win, fillerChip, 66L, 16L, -7L, 1L);
  357.  
  358. }
  359.  
  360.  
  361.            void
  362. fade (hot)
  363. {
  364.     int sex;
  365.  
  366.  
  367.     loop (sex = 32; sex--;)  {  int r, g, b;
  368.         r =  ni_colCMAP [sex] >> 8;
  369.         g = (ni_colCMAP [sex] >> 4) & 0x0f;
  370.         b = (ni_colCMAP [sex]     ) & 0x0f;
  371.         if (r > hot)  r = hot;
  372.         if (g > hot)  g = hot;
  373.         if (b > hot)  b = hot;
  374.         actionmap [sex] = (r << 8) | (g << 4) | b;  }
  375.     Delay (1L);
  376.     LoadRGB4 (&(scr->ViewPort), actionmap, 32L);  
  377.  
  378. }
  379.  
  380.  
  381.        void
  382. init ()
  383. {
  384.     REG unsigned int z = 32;
  385.     void       openstuff ();
  386.     struct Preferences Polly;
  387.  
  388. /*    if (!gargc)
  389.         exit (1);  /*  ain't big enough to go off the training wheels yet...*/
  390.  
  391.     openstuff ();
  392.     OurTask = (struct Process *)FindTask(0L);
  393.     old_pr_WindowPtr = OurTask->pr_WindowPtr;
  394.     OurTask->pr_WindowPtr = (APTR) win;
  395.     SetDrMd (( reep ), JAM2);
  396.  
  397.     while (z--)  {
  398.         SetAPen (reep, (long) z);
  399.  
  400.         RectFill (reep, (long) CGads [z].LeftEdge, (long) CGads [z].TopEdge,
  401.                  (long) (CGads [z].LeftEdge + CGads [z].Width  - 1),
  402.                  (long) (CGads [z].TopEdge  + CGads [z].Height - 1));  }
  403.  
  404.     new_color (1L);
  405.     GetPrefs (&Polly, (long) sizeof (struct Preferences));
  406.     ni_colCMAP [0] = Polly.color0;
  407.     ni_colCMAP [1] = Polly.color1;
  408.     ni_colCMAP [2] = Polly.color2;
  409.     onInput ();
  410.     ScreenToFront (scr);
  411.  
  412.     loop (z = 0;  z < 16;  ++z)  fade (z);
  413.  
  414.  /* letting_The_Days_Go_By (); */
  415.  
  416. }                                                          /*  end of init  */
  417.             
  418.             
  419.        USHORT *
  420. grabChip (array, size, gadz)
  421.    USHORT *array;
  422.    long          size;
  423.    struct Gadget      *gadz;
  424. {
  425.     REG USHORT *myChip;
  426.  
  427.  
  428.     IFN ( myChip  = (USHORT *)  AllocMem (size,  MEMF_CHIP | MEMF_CLEAR))
  429.         quit ("Abort - No Fashionable, Expensive Chips Left!");
  430.  
  431.     CopyMem (array, myChip, size);
  432.     ((struct Image *)(gadz->GadgetRender))->ImageData = myChip;
  433.     return myChip;
  434.  
  435. }
  436.  
  437.  
  438.                   void
  439. new_color (wheat)       ULONG  wheat;  /*  how're the comments so far?  */
  440. {
  441.     extern  ULONG      thisCol;
  442.     ULONG thatCol;
  443.     REG    int z        = maxsupwin;
  444.  
  445. #define             SCALE(i)        ( (long) ( 21 + 7 * ((i) % 16) ) )
  446. #define             POINT(i)        ( (i) > 15 ) ? ">": "<", 1L
  447.  
  448.  
  449.      thatCol = thisCol;
  450.      thisCol = wheat;
  451.      SetAPen  (reep,  0L                 );
  452.     RectFill  (reep, 13L, 15L, 20L, 126L );      /*  saturation bombing...  */
  453.      SetAPen  (reep,  1L                 );
  454.         Move  (reep, 13L, SCALE (wheat)  );
  455.         Text  (reep,      POINT (wheat)  );
  456.      SetAPen  (reep,             wheat   );
  457.     while (z--)  if swin (z)  SetAPen (zreep (z), (long) thisCol);
  458.     if izCtrl (mrQ)  SchRep ((int) thatCol);
  459.  
  460. }                                                     /*  end of new_color  */
  461.  
  462.  
  463.             void
  464. clozeWB ()
  465. {
  466.  
  467.     if (CloseWorkBench ())  Mess ("WorkBench Blown Away!");
  468.     else   Mess ("No Effect!!!");
  469.  
  470. }
  471.  
  472.  
  473.             void
  474. quit ( why )     char *why;     /*  give up - toss in the towel, on top of all the chips we've grabbed, scribbled upon, and now are casting aside like the chaff of our labors, back into the pool from whence the screens of the tasks of the Amiga lie.  It just makes one want to stare at that space-amoeba the Enterprise once encountered for a few billenia.  */  /*  lagunas mentalis, no?  */
  475. {
  476.  
  477.     ifn (strcmp (why, "bye!"))  {  int hot;
  478.         loop (hot = 15; hot >= 0; --hot)  fade (hot);  }
  479.  
  480.     ScreenToBack (scr);             /*  polished to the last  */
  481.     OurTask->pr_WindowPtr = old_pr_WindowPtr;
  482. /*    if (    gargc    )       puts       (     why               );
  483. */    if ( myBitOfChip )    FreeMem       ( myBitOfChip, PICKSIZE );
  484.     if ( ni_htofChip )    FreeMem       ( ni_htofChip, ni_htofSIZE );
  485.     if ( ni_unhtofChip )    FreeMem       ( ni_unhtofChip, ni_unhtofSIZE );
  486.     if ( ni_htonChip )    FreeMem       ( ni_htonChip, ni_htonSIZE );
  487.     if ( ni_unhtonChip )    FreeMem       ( ni_unhtonChip, ni_unhtonSIZE );
  488.     if ( new____Chip )    FreeMem       ( new____Chip, new____SIZE );
  489.     if ( ni_pickChip )    FreeMem       ( ni_pickChip, ni_pickSIZE );
  490.     if ( ni_saveChip )    FreeMem       ( ni_saveChip, ni_saveSIZE );
  491.     if ( ni_loadChip )    FreeMem       ( ni_loadChip, ni_loadSIZE );
  492.     if ( ni_allQChip )    FreeMem       ( ni_allQChip, ni_allQSIZE );
  493.     if ( ni_oneQChip )    FreeMem       ( ni_oneQChip, ni_oneQSIZE );
  494.     if (ni_clon1Chip )    FreeMem       (ni_clon1Chip,ni_clon1SIZE );
  495.     if (   ni_incChip)    FreeMem       (   ni_incChip,  ni_incSIZE);
  496.     if (  ni_fillChip)    FreeMem       (  ni_fillChip, ni_fillSIZE);
  497.     if (   fillerChip)    FreeMem       (   fillerChip, FILLSIZE);
  498.     if (  ni_nocmChip)    FreeMem       (  ni_nocmChip, ni_nocmSIZE);
  499.     if (    ni_cmChip)    FreeMem       (    ni_cmChip,   ni_cmSIZE);
  500.     if (   ni_hexChip)    FreeMem       (   ni_hexChip,  ni_decSIZE);
  501.     if (   ni_decChip)    FreeMem       (   ni_decChip,  ni_decSIZE);
  502.     zapAllWindows ();
  503.     closeSeqWin ();
  504.     clozeClipWin ();
  505.     if ( win ) CloseWindow ( win );
  506.     OpenWorkBench ();
  507.     if ( scr ) CloseScreen ( scr );
  508.     if ( GfxBase ) CloseLibrary ( GfxBase );
  509.     if (IntuitionBase) CloseLibrary ( IntuitionBase );
  510.     exit ( strcmp (why, "bye!") != 0 );
  511.  
  512. }  /* "It's like," Radar peered into Henry's ear, "A little nativity scene" */
  513.  
  514.